Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| Chat and workspace agents: channels, DMs and named agents you talk to | 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. | |
| Chat and agents: their D1 databases | 16 | "database_id": "454dd730-b6cb-42a3-885f-a02f9adbfce0", |
| Chat and workspace agents: channels, DMs and named agents you talk to | 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" }, | |
| Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002) | 29 | // Workspaces by slug; for read tools, the audience's people with |
| 30 | // their access (users_for_audience), members and teams. | |
| Chat and workspace agents: channels, DMs and named agents you talk to | 31 | { "binding": "IDENTITY", "service": "g1t-identity" }, |
| Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002) | 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" }, | |
| Chat and workspace agents: channels, DMs and named agents you talk to | 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 | ], | |
| 51 | "vars": { | |
| 52 | // Who may use g1t's hosted models while billing takes no real money: | |
| 53 | // the same list as the runner's (services/runner/wrangler.jsonc, and | |
| 54 | // src/hosted.ts there, which this service uses). Keep the two equal. | |
| 55 | "HOSTED_AGENT_WORKSPACES": "flagon-io", | |
| 56 | // The runner's routing policy, the same JSON as its AGENT_ROUTING: | |
| 57 | // the model behind each tier. Staff's defaults in sudo (billing's | |
| 58 | // model_defaults) go on top, read once a minute, as in the runner. | |
| 59 | // Chat replies start on the small tier; an agent's floor and ceiling | |
| 60 | // move them. Keep it equal to the runner's. | |
| 61 | "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}}", | |
| 62 | // The model proxy's address, used only without the MODELS binding | |
| 63 | // (an installation that runs its proxy elsewhere). | |
| 64 | "MODELS_URL": "https://models.g1t.sh" | |
| 65 | }, | |
| 66 | // Every log kept while replies are new: a failed one must be traceable. | |
| 67 | "observability": { "enabled": true, "head_sampling_rate": 1 } | |
| 68 | } |
This file's history is long; its oldest lines are credited to the oldest commit read.