Files
openclaw/scripts/cloudflare/src/index.ts
T
Peter Steinberger 5fda9d09f0 feat(deploy): add experimental Cloudflare deployment template (#122768)
* feat(deploy): add experimental Cloudflare template

* fix(deploy): keep container SSH debug access opt-in

* fix(deploy): satisfy scripts tsgo lane and model wrangler entrypoint in knip

* fix(deploy): model wrangler-consumed exports and isolated dependency in knip

The Worker default export and Durable Object class are instantiated by
wrangler from wrangler.jsonc, and @cloudflare/containers lives in the
template's isolated package.json — modeled per the deadcode checks' own
guidance rather than root-manifest changes.

* docs(deploy): align SSH bootstrap flow with the disabled-by-default policy
2026-08-12 14:07:48 -07:00

30 lines
749 B
TypeScript

export { OpenClawContainer } from "./container.js";
interface ContainerStub {
fetch(request: Request): Promise<Response>;
}
interface ContainerNamespace {
getByName(name: string): ContainerStub;
}
interface WorkerEnv {
OPENCLAW_CONTAINER: ContainerNamespace;
}
interface WorkerHandler {
fetch(request: Request, env: WorkerEnv): Promise<Response>;
}
// One stable name gives the installation one globally unique Durable Object.
// That object is the outer single-writer fence for the Litestream replica.
const INSTALLATION_INSTANCE = "openclaw-installation";
const worker: WorkerHandler = {
async fetch(request, env) {
return env.OPENCLAW_CONTAINER.getByName(INSTALLATION_INSTANCE).fetch(request);
},
};
export default worker;