Deploy Minimal Worker
Represent a Cloudflare Worker deployment with symbolic deploy facts.
What You Build
Section titled “What You Build”A minimal deployment flow that stages a Worker bundle, records symbolic deploy refs, and keeps provider handles outside the ledger.
Prerequisites
Section titled “Prerequisites”-
Build a Worker bundle outside the ledger:
Terminal window bun build src/worker.ts --target=browser --outdir dist --external cloudflare:workers -
Produce an artifact ref and digest:
const artifactRef = "artifact:worker/tutorial";const digest = "sha256:..."; -
Resolve the artifact through provider-side material composition. The resolver sees bytes, routes, credentials, and account ids; ledger facts see only symbolic refs.
-
Record deploy facts through the deploy carrier:
const deployRef = "deploy:cloudflare/tutorial/1";const productionRef = "production:cloudflare/tutorial";tx.insertEvent({kind: "deploy.promoted",payload: { artifactRef, digest, deployRef, productionRef },}); -
Resolve
productionRefto a URL only in the caller that needs to display or smoke-test the deployed app.
Checkpoint
Section titled “Checkpoint”Allowed ledger payload:
{ "artifactRef": "artifact:worker/tutorial", "digest": "sha256:...", "deployRef": "deploy:cloudflare/tutorial/1", "productionRef": "production:cloudflare/tutorial"}Forbidden ledger payload:
https://...CF_API_TOKENaccount_idroute_idAssemble the pieces with full small agent app.