PRO

Artifacts Repo Provisioner

The control plane for Cloudflare Artifacts, the versioned filesystem that speaks Git and is meant to have repos created programmatically at fleet scale, written around the fact that the documented advice (if you have 10,000 agents, create 10,000 repos) is correct and is also an invoice. The provisioner file starts where nothing downstream can recover from a mistake: the name, which is the address, is unique per namespace, and cannot be renamed, so it is computed as fleet-YYYYMMDD-taskId from the task's own createdAt rather than from the clock, which makes the name a pure function of the task and therefore makes retry idempotency free. Creation attempts a fork of a reviewed baseline with defaultBranchOnly set, since a fork that copies every stale branch multiplies storage across every task, and reads the ALREADY_EXISTS error as evidence that an earlier attempt won rather than as a failure, adopting that repo instead of inventing a second name. The reuse path mints a fresh short-lived write token because create, import, and fork return the initial token exactly once and nothing serves it again, and it tolerates IMPORT_IN_PROGRESS and FORK_IN_PROGRESS while polling, since a repo that exists but is not ready throws from get() and looks identical to a repo that is missing. Token rotation mints before revoking so a running agent never has a window with no credential, revokes by plaintext so it never has to reconcile against a token list, and clamps TTL above the 60 second floor. Reaping splits the two questions it is actually asking: age comes from the server-side createdAt that list() returns, because a timestamp baked into a name is supplied by whoever created the repo and is not evidence of anything, while the name prefix is what proves ownership, since delete() takes a bare name and a sweep filtering on age alone would reap the reviewed baseline that every task repo forks from. The sweep also skips repos pushed to recently, counts delete()'s boolean rather than its attempts, caps deletions to stay under the 2,000 requests per 10 seconds namespace limit, and defaults to dry run. A cost estimator prices operations at $0.15 per 1,000 past the 10,000 monthly allowance and storage at $0.50 per GB-month past the first, prorated by retention, because storage is billed on daily peak and a repo reaped on day 14 bills for half a month rather than nothing.

Install
npx shadcn@latest add https://ui.aryank.space/r/artifacts-repo-provisioner.json

Installs from ui.aryank.space. To add it by hand, copy the files in Files below, or register the @compronents namespace via the docs.

Visualization
template
AgentTask
repo
unknown
const name = nameTaskRepo(task); catch (e) { if (e.code === "ALREADY_EXISTS") reuse() }

The control plane creates versioned Git repos at fleet scale, provisioning one per agent from a template instead of by hand.

Files

Dependencies
@cloudflare/[email protected]