2 "deno.enable": true,
3 "cSpell.words": [
4 "neondatabase"
5 ]
6}
4import { convertToCoreMessages, type CoreUserMessage, streamText } from "npm:ai";
5import { Hono } from "npm:hono";
6import { finishTrackingUsage, insertInferenceCall, overLimit, startTrackingUsage } from "../database/queries.tsx";
7import {
8 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 } = {};
1export DATABASE_URL=postgresql://orders_owner:npg_dEM4gWmVbep6@ep-wandering-mud-a55sfdr7-pooler.us-east-2.aws.neon.tech/orders?sslmode=require
2export VAL_TOWN_API_KEY=vtwn_3mzQcNhKaM15RXATiDM4SDvLsMvy
9- [ ] make it one click to branch off like old jp townie demos
10- [ ] opentownie as a pr bot
11- [ ] give it the ability to see its own client-side and server-side logs by building a middleware that shoves them into a SQL light database date and then give it a tool to access them
12- [ ] do a browser use or screenshot thing to give it access to its own visual output
13- [ ] Have it default to creating a new branch off main
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
4import { convertToCoreMessages, type CoreUserMessage, streamText } from "npm:ai";
5import { Hono } from "npm:hono";
6import { finishTrackingUsage, insertInferenceCall, overLimit, startTrackingUsage } from "../database/queries.tsx";
7import {
8 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