Skip to content
79 linesCodeBlameRaw
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; for read tools, the audience's people with
30 // their access (users_for_audience), members and teams.
31 { "binding": "IDENTITY", "service": "g1t-identity" },
32 // Read tools, always after the audience check (src/audience.ts):
33 // files, issues and pull requests, and code search.
34 { "binding": "REPOS", "service": "g1t-repos" },
35 { "binding": "WORK", "service": "g1t-work" },
36 { "binding": "SEARCH", "service": "g1t-search" },
37 // The compute gate (reserve, settle), runs (start_run, finish_run),
38 // the price book and staff's model defaults.
39 { "binding": "BILLING", "service": "g1t-billing" },
40 // The workspace's own model provider, and a model session for each
41 // reply, as runs get.
42 { "binding": "INTEGRATIONS", "service": "g1t-integrations" },
43 // The audit log: agents created, changed and archived.
44 { "binding": "EVENTS", "service": "g1t-events" },
45 // The model proxy, which replies' model requests go through with a
46 // model session's token, as sandboxes' do: it holds the keys, g1t's or
47 // the workspace's own, and counts what each answer cost. A binding,
48 // not its address: same-zone Worker-to-Worker fetches can be refused.
49 { "binding": "MODELS", "service": "g1t-models" },
50 // Notifications: a session waiting for an owner to approve more spend.
51 { "binding": "NOTIFY", "service": "g1t-notify" }
52 ],
53 // Every five minutes: routines that are due, and session steps a desk
54 // lost (src/routines.ts, src/sessions.ts).
55 "triggers": { "crons": ["*/5 * * * *"] },
56 // Events routines run on: pull requests ready for review or merged,
57 // checks and deploys failing, issues opened (src/triggers.ts). Create it
58 // once: npx wrangler queues create g1t-events-agents
59 "queues": {
60 "consumers": [{ "queue": "g1t-events-agents", "max_batch_size": 20, "max_batch_timeout": 2, "max_retries": 3, "dead_letter_queue": "g1t-events-dlq" }]
61 },
62 "vars": {
63 // Who may use g1t's hosted models while billing takes no real money:
64 // the same list as the runner's (services/runner/wrangler.jsonc, and
65 // src/hosted.ts there, which this service uses). Keep the two equal.
66 "HOSTED_AGENT_WORKSPACES": "flagon-io",
67 // The runner's routing policy, the same JSON as its AGENT_ROUTING:
68 // the model behind each tier. Staff's defaults in sudo (billing's
69 // model_defaults) go on top, read once a minute, as in the runner.
70 // Chat replies start on the small tier; an agent's floor and ceiling
71 // move them. Keep it equal to the runner's.
72 "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}}",
73 // The model proxy's address, used only without the MODELS binding
74 // (an installation that runs its proxy elsewhere).
75 "MODELS_URL": "https://models.g1t.sh"
76 },
77 // Every log kept while replies are new: a failed one must be traceable.
78 "observability": { "enabled": true, "head_sampling_rate": 1 }
79}