| 1 | { |
| 2 | "$schema": "../../node_modules/wrangler/config-schema.json", |
| 3 | "name": "g1t-agents", |
| 4 | "account_id": "1e6f2cffa3f445920836e8ebe446bb58", |
| 5 | "compatibility_date": "2026-09-26", |
| 6 | "main": "./src/index.ts", |
| 7 | // Reached only through service bindings: the site, the API and the chat |
| 8 | // service. Chat hands it messages to answer (`deliver`). |
| 9 | "workers_dev": false, |
| 10 | "placement": { "mode": "off" }, |
| 11 | "d1_databases": [ |
| 12 | { |
| 13 | "binding": "DB", |
| 14 | "database_name": "g1t-agents", |
| 15 | // npx wrangler d1 create g1t-agents, and its id here. |
| 16 | "database_id": "454dd730-b6cb-42a3-885f-a02f9adbfce0", |
| 17 | "migrations_dir": "migrations" |
| 18 | } |
| 19 | ], |
| 20 | // Each agent's desk: one object per agent, which queues what it is |
| 21 | // handed and works at most its capacity of replies at once (src/desk.ts). |
| 22 | "durable_objects": { |
| 23 | "bindings": [{ "name": "DESKS", "class_name": "Desk" }] |
| 24 | }, |
| 25 | "migrations": [{ "tag": "v1", "new_sqlite_classes": ["Desk"] }], |
| 26 | "services": [ |
| 27 | // Reading the conversation, typing, and posting replies as the agent. |
| 28 | { "binding": "CHAT", "service": "g1t-chat" }, |
| 29 | // Workspaces by slug. |
| 30 | { "binding": "IDENTITY", "service": "g1t-identity" }, |
| 31 | // The compute gate (reserve, settle), runs (start_run, finish_run), |
| 32 | // the price book and staff's model defaults. |
| 33 | { "binding": "BILLING", "service": "g1t-billing" }, |
| 34 | // The workspace's own model provider, and a model session for each |
| 35 | // reply, as runs get. |
| 36 | { "binding": "INTEGRATIONS", "service": "g1t-integrations" }, |
| 37 | // The audit log: agents created, changed and archived. |
| 38 | { "binding": "EVENTS", "service": "g1t-events" }, |
| 39 | // The model proxy, which replies' model requests go through with a |
| 40 | // model session's token, as sandboxes' do: it holds the keys, g1t's or |
| 41 | // the workspace's own, and counts what each answer cost. A binding, |
| 42 | // not its address: same-zone Worker-to-Worker fetches can be refused. |
| 43 | { "binding": "MODELS", "service": "g1t-models" } |
| 44 | ], |
| 45 | "vars": { |
| 46 | // Who may use g1t's hosted models while billing takes no real money: |
| 47 | // the same list as the runner's (services/runner/wrangler.jsonc, and |
| 48 | // src/hosted.ts there, which this service uses). Keep the two equal. |
| 49 | "HOSTED_AGENT_WORKSPACES": "flagon-io", |
| 50 | // The runner's routing policy, the same JSON as its AGENT_ROUTING: |
| 51 | // the model behind each tier. Staff's defaults in sudo (billing's |
| 52 | // model_defaults) go on top, read once a minute, as in the runner. |
| 53 | // Chat replies start on the small tier; an agent's floor and ceiling |
| 54 | // move them. Keep it equal to the runner's. |
| 55 | "AGENT_ROUTING": "{\"tiers\":{\"small\":{\"modelName\":\"Claude Haiku 5.5\",\"model\":\"claude-haiku-5-5\",\"price\":{\"input\":0.1,\"output\":0.5,\"cacheRead\":0.01,\"cacheWrite\":0.125}},\"large\":{\"modelName\":\"Claude Sonnet 5.5\",\"model\":\"claude-sonnet-5-5\",\"price\":{\"input\":2,\"output\":10,\"cacheRead\":0.1,\"cacheWrite\":2.5}},\"frontier\":{\"modelName\":\"Claude Opus 5.5\",\"model\":\"claude-opus-5-5\",\"price\":{\"input\":4,\"output\":20,\"cacheRead\":0.2,\"cacheWrite\":5}}},\"tasks\":{\"implement\":\"large\",\"revise\":\"large\",\"answer\":\"small\",\"review\":\"change\",\"update\":\"small\",\"plan\":\"small\"},\"effort\":{\"plan\":\"high\",\"answer\":\"medium\",\"update\":\"low\"},\"smallChange\":{\"files\":10,\"lines\":200},\"largeChange\":{\"files\":60,\"lines\":3000},\"largeLabels\":[\"security\"],\"frontierLabels\":[\"architecture\"],\"smallLabels\":[\"documentation\",\"docs\",\"typo\"],\"frontierAfter\":2,\"learning\":{\"window\":20,\"minRuns\":5,\"stepDownAt\":0.9,\"stepUpAt\":0.5}}", |
| 56 | // The model proxy's address, used only without the MODELS binding |
| 57 | // (an installation that runs its proxy elsewhere). |
| 58 | "MODELS_URL": "https://models.g1t.sh" |
| 59 | }, |
| 60 | // Every log kept while replies are new: a failed one must be traceable. |
| 61 | "observability": { "enabled": true, "head_sampling_rate": 1 } |
| 62 | } |