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.
| Mission control: a place to ask g1t, shown and not on yet, with the actions under it | 1 | // A service that is turned off on this installation. |
| 2 | // | |
| 3 | // Self-hosted phase 1 runs the core forge only. The site and the services | |
| The agents, models and context services are deleted. Nothing calls them any more: workspace agents, the hosted model proxy at models.g1t.sh with its AI Gateway, and the context hub with its search index are gone with the features they served. The deploy stack no longer builds or deploys them, so it no longer needs CONNECTORS_KEY, AI_GATEWAY_TOKEN, ANTHROPIC_API_KEY or WORKERS_AI_TOKEN, and a self-hosted install no longer generates CONNECTORS_KEY or stubs them out. Their databases, queues, index, gateway and domain stay in Cloudflare until they are deleted by hand after this is deployed. | 4 | // still hold bindings to the cloud runner and the deployments' builders; |
| A self-hosted g1t's off Worker answers only the JSON protocol the services speak: the runner methods it also stood in for (enabled, modelAccess, instructions, run, plan, applyPlan, update, review, recheck, stopRun) were for the site's calls to g1t's own agents, and nothing calls them. The self-hosted configuration no longer lists the model proxy among the parts it does not run. Checked: the deploy tool's 92 tests. | 5 | // this Worker stands in for each of them: every method of the JSON protocol |
| 6 | // the services speak (`POST /rpc/<method>`) answers with a failed Result | |
| 7 | // that says why, instead of failing. | |
| Mission control: a place to ask g1t, shown and not on yet, with the actions under it | 8 | // |
| The agents, models and context services are deleted. Nothing calls them any more: workspace agents, the hosted model proxy at models.g1t.sh with its AI Gateway, and the context hub with its search index are gone with the features they served. The deploy stack no longer builds or deploys them, so it no longer needs CONNECTORS_KEY, AI_GATEWAY_TOKEN, ANTHROPIC_API_KEY or WORKERS_AI_TOKEN, and a self-hosted install no longer generates CONNECTORS_KEY or stubs them out. Their databases, queues, index, gateway and domain stay in Cloudflare until they are deleted by hand after this is deployed. | 9 | // OFF_NAME names the feature in those messages, such as "Cloud runners". |
| Mission control: a place to ask g1t, shown and not on yet, with the actions under it | 10 | |
| 11 | import { WorkerEntrypoint } from "cloudflare:workers"; | |
| 12 | ||
| 13 | function off(env) { | |
| 14 | const name = env.OFF_NAME ?? "This feature"; | |
| 15 | return { | |
| 16 | ok: false, | |
| 17 | error: { code: "forbidden", message: `${name} are off on this installation of g1t.` }, | |
| 18 | }; | |
| 19 | } | |
| 20 | ||
| 21 | export default class Off extends WorkerEntrypoint { | |
| 22 | // ── The JSON protocol ── | |
| 23 | async fetch(request) { | |
| 24 | const { pathname } = new URL(request.url); | |
| 25 | if (request.method === "POST" && pathname.startsWith("/rpc/")) { | |
| 26 | return Response.json(off(this.env)); | |
| 27 | } | |
| 28 | return new Response("Off on this installation.", { status: 404 }); | |
| 29 | } | |
| 30 | ||
| 31 | // Events and schedules for a service that is off are dropped. | |
| 32 | async queue(batch) { | |
| 33 | batch.ackAll(); | |
| 34 | } | |
| 35 | async scheduled() {} | |
| 36 | } |
This file's history is long; its oldest lines are credited to the oldest commit read.