Skip to main content

Module wrangler

Module wrangler 

Source
Expand description

wrangler.toml generation per Worker (v0.8 §4.4 / §4.5).

Each context becomes a Cloudflare Worker with its own wrangler config. Service Bindings are declared for every consumed context. Durable Object bindings + migrations are declared for every agent.

Constants§

KV_NAMESPACE_ID_PLACEHOLDER
Deploy-time sentinel in generated Worker configuration. The driver replaces this with the persistent Cloudflare KV namespace id immediately before a remote Wrangler command runs.

Functions§

materialise_kv_namespace_id
Materialise the deploy-time KV namespace id placeholder in a generated wrangler.toml’s text, structurally. Parses text and, if (and only if) the first [[kv_namespaces]] entry’s id is currently exactly KV_NAMESPACE_ID_PLACEHOLDER, replaces it with id.
wrangler_needs_kv_materialisation
Whether a generated wrangler.toml’s KV namespace id is still the deploy-time placeholder — the same condition materialise_kv_namespace_id itself checks internally before writing, exposed separately so a caller can decide whether materialising is needed at all before doing the (possibly fallible) work of finding the real id to substitute — e.g. bynk dev --remote skipping a lock-file lookup entirely for a project that either has no KV binding or is already materialised.