Skip to content
82 linesCodeBlameRaw

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 to1{
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 databases16 "database_id": "454dd730-b6cb-42a3-885f-a02f9adbfce0",
Chat and workspace agents: channels, DMs and named agents you talk to17 "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 to31 { "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 to37 // 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.
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked49 { "binding": "MODELS", "service": "g1t-models" },
Docs: a workspace knowledge base people and agents write together50 // Docs: agents search, read, write and suggest edits to pages, for the
51 // person they act for (src/ports.ts docsPorts).
52 { "binding": "DOCS", "service": "g1t-docs-service" },
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked53 // Notifications: a session waiting for an owner to approve more spend.
54 { "binding": "NOTIFY", "service": "g1t-notify" }
Chat and workspace agents: channels, DMs and named agents you talk to55 ],
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked56 // Every five minutes: routines that are due, and session steps a desk
57 // lost (src/routines.ts, src/sessions.ts).
58 "triggers": { "crons": ["*/5 * * * *"] },
Routines run when something happens: a pull request ready for review or merged, checks or a deploy failing, an issue opened59 // Events routines run on: pull requests ready for review or merged,
60 // checks and deploys failing, issues opened (src/triggers.ts). Create it
61 // once: npx wrangler queues create g1t-events-agents
62 "queues": {
63 "consumers": [{ "queue": "g1t-events-agents", "max_batch_size": 20, "max_batch_timeout": 2, "max_retries": 3, "dead_letter_queue": "g1t-events-dlq" }]
64 },
Chat and workspace agents: channels, DMs and named agents you talk to65 "vars": {
66 // Who may use g1t's hosted models while billing takes no real money:
67 // the same list as the runner's (services/runner/wrangler.jsonc, and
68 // src/hosted.ts there, which this service uses). Keep the two equal.
69 "HOSTED_AGENT_WORKSPACES": "flagon-io",
70 // The runner's routing policy, the same JSON as its AGENT_ROUTING:
71 // the model behind each tier. Staff's defaults in sudo (billing's
72 // model_defaults) go on top, read once a minute, as in the runner.
73 // Chat replies start on the small tier; an agent's floor and ceiling
74 // move them. Keep it equal to the runner's.
75 "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}}",
76 // The model proxy's address, used only without the MODELS binding
77 // (an installation that runs its proxy elsewhere).
78 "MODELS_URL": "https://models.g1t.sh"
79 },
80 // Every log kept while replies are new: a failed one must be traceable.
81 "observability": { "enabled": true, "head_sampling_rate": 1 }
82}

This file's history is long; its oldest lines are credited to the oldest commit read.