7export const thinkTool = tool({
8 description:
9 "Use the tool to think about something. It will not obtain new information or change the database, but just append the thought to the log. Use it when complex reasoning or some cache memory is needed.",
10 parameters: z.object({
11 thought: z.string().describe("A thought to think about."),
192```
193โโโ backend/
194โ โโโ database/
195โ โ โโโ migrations.ts # Schema definitions
196โ โ โโโ queries.ts # DB query functions
252 ```
253
254### Database Patterns
255- Run migrations on startup or comment out for performance
256- Change table names when modifying schemas rather than altering
10 overLimit,
11 startTrackingUsage,
12} from "../database/queries.tsx";
13import {
14 getTextEditorTool,
4import { INFERENCE_CALLS_TABLE, USAGE_TABLE } from "./schema.tsx";
5
6// Eventually we'll have a user database,
7// but in the meantime, we can cache user info in memory
8const userIdCache: { [key: string]: any } = {};
198```
199โโโ backend/
200โ โโโ database/
201โ โ โโโ migrations.ts # Schema definitions
202โ โ โโโ queries.ts # DB query functions
257 ```
258
259### Database Patterns
260- Run migrations on startup or comment out for performance
261- Change table names when modifying schemas rather than altering
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
3import { TABLES } from "../database/migrations.ts";
4
5const app = new Hono();
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
3import { TABLES } from "../database/migrations.ts";
4
5const app = new Hono();
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
3import { TABLES } from "../database/migrations.ts";
4
5const app = new Hono();
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { cors } from "https://esm.sh/hono@3.11.7/cors";
3import { runMigrations } from "./database/migrations.ts";
4import authRoutes from "./routes/auth.ts";
5import childrenRoutes from "./routes/children.ts";
18app.use("*", cors());
19
20// Run database migrations
21app.use("*", async (c, next) => {
22 try {
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { jwt } from "https://esm.sh/hono@3.11.7/jwt";
3import { getPolicyAcceptance, updatePolicyAcceptance } from "../database/queries.ts";
4import { DAYCARE_RULES, UpdatePolicyAcceptanceRequest } from "../../shared/types.ts";
5