Skip to content
95 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.

Docs: a workspace knowledge base people and agents write together1{
2 "$schema": "../../node_modules/wrangler/config-schema.json",
3 "name": "g1t-docs-service",
4 "account_id": "1e6f2cffa3f445920836e8ebe446bb58",
5 "compatibility_date": "2026-09-26",
6 "main": "./src/index.ts",
7 // Reached only through service bindings. The live socket's and uploads'
8 // viewer comes in a header the site sets after checking the session,
9 // which is only safe to trust because nothing else can reach this Worker.
10 "workers_dev": false,
11 "placement": { "mode": "off" },
12 "d1_databases": [
13 {
14 "binding": "DB",
15 "database_name": "g1t-docs",
16 // Create it once, then put its id here:
17 // npx wrangler d1 create g1t-docs
18 // npx wrangler d1 migrations apply g1t-docs --remote
Docs: the g1t-docs database's id19 "database_id": "8f2193ed-fd2b-4322-b6cb-c79090e7603d",
Docs: a workspace knowledge base people and agents write together20 "migrations_dir": "migrations"
21 }
22 ],
23 // Files people put in pages (images, attachments), served from the
24 // usercontent origin at /docs-files/<key> (apps/web/workers/usercontent.ts).
25 // Create it once: npx wrangler r2 bucket create g1t-docs-files
Docs know what code they describe; a project's docs folder in Docs; Docs events; files on any S3 store26 // Self-hosted, any S3-compatible store instead: DOCS_FILES=s3 and the
The docs folder is gone, and what it held lives where people read it: how a self-hosted g1t runs and how to deploy g1t to Cloudflare are pages on docs.g1t.sh under Run g1t yourself, and speed, rate limits and operating g1t.sh are sections of CONTRIBUTING.md; code that cited a file in docs/ now points to the page or section that covers it, or says what it means itself, and applied migrations and the runner images are left as they were.27 // DOCS_S3_* settings (src/files.ts,
28 // docs.g1t.sh/guides/self-hosting-architecture/, "Storage").
Docs: a workspace knowledge base people and agents write together29 "r2_buckets": [{ "binding": "FILES", "bucket_name": "g1t-docs-files" }],
Docs index by meaning: passages of every page and project doc, embedded on save and recalled for agents; hybrid search for people30 // The semantic index agents recall from (src/indexer.ts, src/vectors.ts):
31 // Workers AI embeds passages (@cf/baai/bge-base-en-v1.5, 768 dimensions)
32 // into Vectorize, with metadata indexes on workspace_id and space_id so a
33 // query only reads spaces its reader may. Create it once:
34 // npx wrangler vectorize create g1t-docs --dimensions=768 --metric=cosine
35 // npx wrangler vectorize create-metadata-index g1t-docs --property-name=workspace_id --type=string
36 // npx wrangler vectorize create-metadata-index g1t-docs --property-name=space_id --type=string
37 // Without them Docs still keeps passages in D1 and recall matches words.
The docs service answers every artifacts call: docs can be made, listed, shared, moved, trashed, restored, searched, versioned and edited live in their own rooms, agents read, write and recall them only where their person and everyone in the conversation can, and folio events go out on the bus, while Docs' pages keep working as before.38 //
The docs folder is gone, and what it held lives where people read it: how a self-hosted g1t runs and how to deploy g1t to Cloudflare are pages on docs.g1t.sh under Run g1t yourself, and speed, rate limits and operating g1t.sh are sections of CONTRIBUTING.md; code that cited a file in docs/ now points to the page or section that covers it, or says what it means itself, and applied migrations and the runner images are left as they were.39 // Folios (Artifacts mode) have an index of their own, filtered by
40 // workspace, scope and kind. Create it once, before the first deploy that
41 // has this binding:
The docs service answers every artifacts call: docs can be made, listed, shared, moved, trashed, restored, searched, versioned and edited live in their own rooms, agents read, write and recall them only where their person and everyone in the conversation can, and folio events go out on the bus, while Docs' pages keep working as before.42 // npx wrangler vectorize create g1t-folios --dimensions=768 --metric=cosine
43 // npx wrangler vectorize create-metadata-index g1t-folios --property-name=workspace_id --type=string
44 // npx wrangler vectorize create-metadata-index g1t-folios --property-name=scope --type=string
45 // npx wrangler vectorize create-metadata-index g1t-folios --property-name=kind --type=string
46 // Without FOLIO_VECTORS, artifacts are searched and recalled by words.
Docs index by meaning: passages of every page and project doc, embedded on save and recalled for agents; hybrid search for people47 "ai": { "binding": "AI" },
The docs service answers every artifacts call: docs can be made, listed, shared, moved, trashed, restored, searched, versioned and edited live in their own rooms, agents read, write and recall them only where their person and everyone in the conversation can, and folio events go out on the bus, while Docs' pages keep working as before.48 "vectorize": [
49 { "binding": "VECTORS", "index_name": "g1t-docs" },
50 { "binding": "FOLIO_VECTORS", "index_name": "g1t-folios" }
51 ],
Docs: a workspace knowledge base people and agents write together52 "services": [
53 // Workspaces by slug, people's names and avatars, and teams.
54 { "binding": "IDENTITY", "service": "g1t-identity" },
55 // The workspace's agents: who they are, for agents' calls and mentions.
56 { "binding": "AGENTS", "service": "g1t-agents" },
57 // Mentions and suggestions reach people's inboxes (services/notify).
Docs know what code they describe; a project's docs folder in Docs; Docs events; files on any S3 store58 { "binding": "NOTIFY", "service": "g1t-notify" },
59 // Who may read a repository, what a change touched, and a project's
60 // docs folder (src/staleness.ts, src/repo-spaces.ts).
61 { "binding": "REPOS", "service": "g1t-repos" },
62 // What a merged pull request changed.
63 { "binding": "WORK", "service": "g1t-work" },
64 // doc.page.* events on the bus (src/events.ts).
65 { "binding": "EVENTS", "service": "g1t-events" }
Docs: a workspace knowledge base people and agents write together66 ],
Docs know what code they describe; a project's docs folder in Docs; Docs events; files on any S3 store67 // Merges and pushes to default branches: pages whose cited code
68 // changed, and projects' docs read again (src/staleness.ts). The events
69 // service sends it what g1t_contracts::subscribers routes to
70 // SUBSCRIBER_DOCS. Create it once: npx wrangler queues create g1t-events-docs
71 "queues": {
Docs index by meaning: passages of every page and project doc, embedded on save and recalled for agents; hybrid search for people72 // Its own backfill jobs ride the same queue (`docs.index`,
73 // src/indexer.ts): a workspace's pages and projects' docs indexed in
74 // batches, and waiting out the hourly embedding cap.
75 "producers": [{ "binding": "JOBS", "queue": "g1t-events-docs" }],
Docs know what code they describe; a project's docs folder in Docs; Docs events; files on any S3 store76 "consumers": [{ "queue": "g1t-events-docs", "max_batch_size": 20, "max_batch_timeout": 2, "max_retries": 3, "dead_letter_queue": "g1t-events-dlq" }]
77 },
Docs: a workspace knowledge base people and agents write together78 // One room per page: it holds the page's Yjs document and open sockets,
The docs service answers every artifacts call: docs can be made, listed, shared, moved, trashed, restored, searched, versioned and edited live in their own rooms, agents read, write and recall them only where their person and everyone in the conversation can, and folio events go out on the bus, while Docs' pages keep working as before.79 // hibernating while nobody types (src/room.ts). And one per folio
80 // (Artifacts mode, src/folios/room.ts): PageRoom stays until Phase 7
81 // deletes it (`deleted_classes` in a v3 migration).
Docs: a workspace knowledge base people and agents write together82 "durable_objects": {
The docs service answers every artifacts call: docs can be made, listed, shared, moved, trashed, restored, searched, versioned and edited live in their own rooms, agents read, write and recall them only where their person and everyone in the conversation can, and folio events go out on the bus, while Docs' pages keep working as before.83 "bindings": [
84 { "name": "PAGES", "class_name": "PageRoom" },
85 { "name": "FOLIOS", "class_name": "FolioRoom" }
86 ]
Docs: a workspace knowledge base people and agents write together87 },
The docs service answers every artifacts call: docs can be made, listed, shared, moved, trashed, restored, searched, versioned and edited live in their own rooms, agents read, write and recall them only where their person and everyone in the conversation can, and folio events go out on the bus, while Docs' pages keep working as before.88 "migrations": [
89 { "tag": "v1", "new_sqlite_classes": ["PageRoom"] },
90 { "tag": "v2", "new_sqlite_classes": ["FolioRoom"] }
91 ],
92 // Daily: folios in the trash for over 30 days are deleted for good.
93 "triggers": { "crons": ["17 3 * * *"] },
Docs: a workspace knowledge base people and agents write together94 "observability": { "enabled": true, "head_sampling_rate": 0.1 }
95}