@lunora/config 1.0.0-alpha.282 → 1.0.0-alpha.283
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cloudflare/index.d.mts +94 -93
- package/dist/cloudflare/index.d.ts +94 -93
- package/dist/cloudflare/index.mjs +1 -1
- package/dist/index.d.mts +36 -3
- package/dist/index.d.ts +36 -3
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/{BINDING_MANIFEST_VERSION-B8dwEKLn.mjs → BINDING_MANIFEST_VERSION-B4Tu8Ytd.mjs} +1 -1
- package/dist/packem_shared/CLOUDFLARE_DRIVER-DUE6r-Pg.mjs +1 -0
- package/dist/packem_shared/COMPOSED_WORKER_ENTRY-5R-BECOC.mjs +1 -0
- package/dist/packem_shared/DEFAULT_DEPLOY_TARGET-CtEZtsUF.mjs +2 -0
- package/dist/packem_shared/REQUIRED_COMPATIBILITY_DATE-g_1F-n2X.mjs +1 -0
- package/dist/packem_shared/UNEXPORTED_CLASS_MARKER-Bc302QS4.mjs +1 -0
- package/dist/packem_shared/addArgsFor-CYZKhNIo.mjs +1 -0
- package/dist/packem_shared/{assertWranglerSatisfiesSchema-DHITzU7H.mjs → assertWranglerSatisfiesSchema-B24XPKq7.mjs} +1 -1
- package/dist/packem_shared/collectExportGaps-BmEGzQQc.mjs +2 -0
- package/dist/packem_shared/inferLunoraBindings-GaAITuz-.mjs +1 -0
- package/dist/packem_shared/{interpretRemote-CQ06qpjM.mjs → interpretRemote-Da32GcUi.mjs} +1 -1
- package/dist/packem_shared/mergeWranglerEnvironment-BIcLqPfv.mjs +1 -0
- package/dist/packem_shared/reconcileBindingsSafely-DOqY2zb2.mjs +1 -0
- package/dist/packem_shared/{runPostCodegenHook-CVrOTiGB.mjs → runPostCodegenHook-B0T1q2YI.mjs} +1 -1
- package/dist/packem_shared/{schema-info.d-DvKkJ7HJ.d.mts → schema-info.d-C3DeuUmC.d.mts} +111 -51
- package/dist/packem_shared/{schema-info.d-DvKkJ7HJ.d.ts → schema-info.d-C3DeuUmC.d.ts} +111 -51
- package/dist/packem_shared/validate-bindings-D6-vb6if.mjs +1 -0
- package/dist/packem_shared/withTailConsumer-DaP3r6ia.mjs +1 -0
- package/dist/packem_shared/{wranglerToAlchemy-SDoS_XY0.mjs → wranglerToAlchemy-DZOim9As.mjs} +1 -1
- package/package.json +3 -3
- package/dist/packem_shared/CLOUDFLARE_DRIVER-Ci9oJMYb.mjs +0 -1
- package/dist/packem_shared/COMPOSED_WORKER_ENTRY-Bj793dir.mjs +0 -1
- package/dist/packem_shared/DEFAULT_DEPLOY_TARGET-B-e9mqgX.mjs +0 -1
- package/dist/packem_shared/REQUIRED_COMPATIBILITY_DATE-SdRHaUwh.mjs +0 -1
- package/dist/packem_shared/addArgsFor-CWb4cPij.mjs +0 -1
- package/dist/packem_shared/collectExportGaps-BJw9LdRV.mjs +0 -2
- package/dist/packem_shared/reconcileBindingsSafely-Ds107djO.mjs +0 -1
|
@@ -14,10 +14,10 @@ import { AgentIR, ContainerIR, QueueIR, WorkflowIR } from '@lunora/codegen';
|
|
|
14
14
|
* `temporary` are concepts, not wrangler flags. A second host maps the same
|
|
15
15
|
* request onto its own CLI without the caller changing.
|
|
16
16
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* which has none — it is a codegen target, and
|
|
20
|
-
* refuse it at selection.
|
|
17
|
+
* Three drivers are registered: Cloudflare (`cloudflare/cloudflare-driver.ts`)
|
|
18
|
+
* and celld (`celld/celld-driver.ts`), which ship toolchains, and Node
|
|
19
|
+
* (`node/node-driver.ts`), which has none — it is a codegen target, and
|
|
20
|
+
* `lunora deploy` / `lunora dev` refuse it at selection.
|
|
21
21
|
*
|
|
22
22
|
* **What this seam deliberately does NOT carry: configuration inference.** It
|
|
23
23
|
* used to, through an `infer`/`provision` pair over a provider-neutral
|
|
@@ -36,17 +36,28 @@ import { AgentIR, ContainerIR, QueueIR, WorkflowIR } from '@lunora/codegen';
|
|
|
36
36
|
* A host CLI invocation, described but not run.
|
|
37
37
|
*
|
|
38
38
|
* `tool` is the binary name only (`"wrangler"`); the caller resolves how to
|
|
39
|
-
* execute it through the project's package manager
|
|
40
|
-
* driver never has to know whether the project uses
|
|
39
|
+
* execute it through the project's package manager (see `toolchainExecArgs`).
|
|
40
|
+
* Keeping that split means a driver never has to know whether the project uses
|
|
41
|
+
* pnpm, npm, yarn, or bun.
|
|
41
42
|
*/
|
|
42
43
|
interface ToolchainCommand {
|
|
43
44
|
/** Arguments for {@link ToolchainCommand.tool}. */
|
|
44
45
|
args: ReadonlyArray<string>;
|
|
46
|
+
/**
|
|
47
|
+
* The tool is a standalone binary installed on `PATH`, not a project
|
|
48
|
+
* dependency: run it directly. Going through the package manager would be
|
|
49
|
+
* wrong for it — `npx --` / `bun x` fetch an npm package of the same name
|
|
50
|
+
* when none is installed locally, which for a non-npm binary is somebody
|
|
51
|
+
* else's code.
|
|
52
|
+
*/
|
|
53
|
+
onPath?: boolean;
|
|
45
54
|
/** The host CLI binary, e.g. `"wrangler"`. */
|
|
46
55
|
tool: string;
|
|
47
56
|
}
|
|
48
57
|
/** Neutral options for a deploy. */
|
|
49
58
|
interface DeployRequest {
|
|
59
|
+
/** Host config file to deploy, when the flow uses a projected one (see {@link DeployDriver.projectConfig}). */
|
|
60
|
+
configPath?: string;
|
|
50
61
|
/** Validate and bundle without publishing — nothing ships. */
|
|
51
62
|
dryRun?: boolean;
|
|
52
63
|
/** Deploy this entry file instead of the host config's default (framework composition). */
|
|
@@ -97,18 +108,53 @@ interface SecretRequest {
|
|
|
97
108
|
* The host's command-line surface. Optional as a whole: a host with no vendor
|
|
98
109
|
* CLI (the Node target; a hypothetical API-driven one) declares none, and
|
|
99
110
|
* `isRunnableTarget` refuses it for the commands that would have to shell out.
|
|
111
|
+
*
|
|
112
|
+
* `deploy` and `dev` are what make a target runnable. The secret and tail
|
|
113
|
+
* commands are optional on their own, because a runnable host can simply not
|
|
114
|
+
* have them — celld keeps configuration in plain `vars` and has no log tail —
|
|
115
|
+
* and the commands that need one say so rather than guessing a substitute.
|
|
100
116
|
*/
|
|
101
117
|
interface DriverToolchain {
|
|
102
118
|
/** The command that deploys the app. */
|
|
103
119
|
deploy: (request: DeployRequest) => ToolchainCommand;
|
|
104
120
|
/** The command that runs a local dev server. */
|
|
105
121
|
dev: (request: DevRequest) => ToolchainCommand;
|
|
106
|
-
/**
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
122
|
+
/**
|
|
123
|
+
* Where `lunora dev` runs the worker. `"workerd"`: `wrangler dev`, or the
|
|
124
|
+
* Vite plugin's `@cloudflare/vite-plugin`, whichever flavor the project
|
|
125
|
+
* picks. `"own"`: the host's dev server ({@link DriverToolchain.dev}) on
|
|
126
|
+
* the projected config, always the standalone flavor — neither Vite nor a
|
|
127
|
+
* framework sidecar can serve the worker on that runtime.
|
|
128
|
+
*/
|
|
129
|
+
readonly devServer: "own" | "workerd";
|
|
130
|
+
/**
|
|
131
|
+
* Whether `lunora deploy` builds and pushes container images itself
|
|
132
|
+
* (railpack, into the host's registry) before `deploy`. `false` when the
|
|
133
|
+
* host CLI builds each image from its Dockerfile during the deploy.
|
|
134
|
+
*/
|
|
135
|
+
readonly prebuildsContainerImages: boolean;
|
|
136
|
+
/** The command that lists remote secret names, when the host has a secret store. */
|
|
137
|
+
secretList?: (request: SecretRequest) => ToolchainCommand;
|
|
138
|
+
/** The command that writes one secret, when the host has a secret store. Its value is passed on stdin, never argv. */
|
|
139
|
+
secretPut?: (request: SecretRequest) => ToolchainCommand;
|
|
140
|
+
/** The command that tails live logs, when the host has one. */
|
|
141
|
+
tail?: (request: TailRequest) => ToolchainCommand;
|
|
142
|
+
}
|
|
143
|
+
/** What a {@link DeployDriver.projectConfig} projection is for — a dev server may need a different source than a deploy. */
|
|
144
|
+
type ProjectionPurpose = "deploy" | "dev";
|
|
145
|
+
/**
|
|
146
|
+
* The result of {@link DeployDriver.projectConfig}: a plan, not yet on disk.
|
|
147
|
+
* The caller validates the request it is for (the toolchain's argv builder
|
|
148
|
+
* refuses unsupported options), then calls `write` — so a refused command
|
|
149
|
+
* changes nothing.
|
|
150
|
+
*/
|
|
151
|
+
interface ProjectedConfig {
|
|
152
|
+
/** Where the projection goes, to pass as the request's `configPath`. */
|
|
153
|
+
configPath: string;
|
|
154
|
+
/** Every key removed, as a dotted path (`observability`, `containers[0].rollout_step_percentage`). */
|
|
155
|
+
dropped: ReadonlyArray<string>;
|
|
156
|
+
/** Write the projection (and any build-artifact cleanup it planned). */
|
|
157
|
+
write: () => void;
|
|
112
158
|
}
|
|
113
159
|
/** A deploy target's implementation: an identity the registry resolves, and the host CLI surface (if any) behind it. */
|
|
114
160
|
interface DeployDriver {
|
|
@@ -116,6 +162,18 @@ interface DeployDriver {
|
|
|
116
162
|
readonly id: string;
|
|
117
163
|
/** Human-readable target name, for logs. */
|
|
118
164
|
readonly name: string;
|
|
165
|
+
/**
|
|
166
|
+
* Rewrite the project's wrangler config into the form this host's CLI
|
|
167
|
+
* accepts, and return the file to hand `deploy`/`dev` as `configPath`.
|
|
168
|
+
* Absent when the host reads the project's config as-is (Cloudflare).
|
|
169
|
+
*
|
|
170
|
+
* Needed because Lunora's reconcilers and templates write Cloudflare-only
|
|
171
|
+
* keys (`observability`, `limits`, …) that a Workers-compatible host with a
|
|
172
|
+
* strict config reader refuses outright. `dropped` names what was removed,
|
|
173
|
+
* so the caller can say so instead of silently deploying less than the
|
|
174
|
+
* config describes.
|
|
175
|
+
*/
|
|
176
|
+
readonly projectConfig?: (projectRoot: string, purpose: ProjectionPurpose) => ProjectedConfig;
|
|
119
177
|
/**
|
|
120
178
|
* The host's command-line surface, or `undefined` for a host that has none.
|
|
121
179
|
* Pure: these build argv, they never spawn.
|
|
@@ -126,6 +184,44 @@ interface DurableObjectSpec {
|
|
|
126
184
|
binding: string;
|
|
127
185
|
className: string;
|
|
128
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* The `_generated/` modules that hold a generated Durable Object / Workflow
|
|
189
|
+
* class — one per class kind a project can declare. wrangler validates every
|
|
190
|
+
* `class_name` against the worker's exports, so this is the set a worker entry
|
|
191
|
+
* re-exports (and the set the composed class-A entry star-re-exports for the
|
|
192
|
+
* kinds the project has).
|
|
193
|
+
*
|
|
194
|
+
* Owned here because four places need it and they must not drift:
|
|
195
|
+
* `@lunora/vite` emits one star re-export per entry, the wrangler validator
|
|
196
|
+
* DECIDES the composed entry's exports from it, `reconcile-bindings` types its
|
|
197
|
+
* export-gap `module` field on it, and this module's own `detectClassExports`
|
|
198
|
+
* probes the same names.
|
|
199
|
+
*
|
|
200
|
+
* `scheduler` carries no `define*` declarations of its own — codegen writes it
|
|
201
|
+
* off `hasScheduler` purely so the composed class-A entry has a `SchedulerDO`
|
|
202
|
+
* to forward. Its presence is therefore the ONLY signal the plugin and the
|
|
203
|
+
* validator need, and it is the same signal that decides whether the builder
|
|
204
|
+
* has a `.scheduler()` method at all. `@lunora/vite` depends on `@lunora/config`, so config
|
|
205
|
+
* owning it is the direction the dependency graph allows.
|
|
206
|
+
*/
|
|
207
|
+
declare const GENERATED_CLASS_MODULES: readonly ["agents", "containers", "scheduler", "workflows"];
|
|
208
|
+
/** One {@link GENERATED_CLASS_MODULES} entry. */
|
|
209
|
+
type GeneratedClassModule = (typeof GENERATED_CLASS_MODULES)[number];
|
|
210
|
+
/**
|
|
211
|
+
* The class-B composed entry. `lunora deploy` passes this file to wrangler as
|
|
212
|
+
* the positional script whenever it exists, overriding `wrangler.main` — so it
|
|
213
|
+
* is what actually gets bundled and what wrangler checks its DO/Workflow
|
|
214
|
+
* bindings against. `main` in a class-B project names the framework adapter's
|
|
215
|
+
* build output (`.svelte-kit/cloudflare/_worker.js`, `dist/_worker.js`), which
|
|
216
|
+
* exists after `vite build` and exports only the SSR fetch handler. Lexing that
|
|
217
|
+
* instead read every declared class as unexported: nothing provisioned, plus a
|
|
218
|
+
* "add `export * from …`" warning the user cannot silence.
|
|
219
|
+
*
|
|
220
|
+
* Exported, not documented-as-duplicated: the CLI's `resolveComposedWorkerEntry`
|
|
221
|
+
* imports this constant, so the deploy's positional entry and the file this
|
|
222
|
+
* module lexes for exported classes cannot drift apart.
|
|
223
|
+
*/
|
|
224
|
+
declare const COMPOSED_WORKER_ENTRY = "src/worker.ts";
|
|
129
225
|
/**
|
|
130
226
|
* A `defineContainer` declaration plus whether its generated DO class is
|
|
131
227
|
* exported by the worker entry. Only exported containers are safe to
|
|
@@ -213,6 +309,8 @@ interface InferredBindings {
|
|
|
213
309
|
usesScheduler: boolean;
|
|
214
310
|
/** `@lunora/storage` is imported (R2 bucket binding name is user-defined). */
|
|
215
311
|
usesStorage: boolean;
|
|
312
|
+
/** `jsCodeTool` is imported from `@lunora/agent` in `lunora/` → self-describing `worker_loaders` binding (`LOADER`). */
|
|
313
|
+
usesWorkerLoader: boolean;
|
|
216
314
|
/** `@lunora/x402/charge` is imported — the charge rail settles USDC to a recipient address (a public `[vars]` entry, user-named; hint-only). */
|
|
217
315
|
usesX402Charge: boolean;
|
|
218
316
|
/** `@lunora/x402/pay` is imported — the agent-wallet pay rail signs from a Secrets Store binding paired with a spend policy (ActionCtx-only; hint-only). */
|
|
@@ -227,44 +325,6 @@ interface InferOptions {
|
|
|
227
325
|
/** Lunora source directory holding `schema.ts`. Defaults to `lunora`. */
|
|
228
326
|
schemaDir?: string;
|
|
229
327
|
}
|
|
230
|
-
/**
|
|
231
|
-
* The `_generated/` modules that hold a generated Durable Object / Workflow
|
|
232
|
-
* class — one per class kind a project can declare. wrangler validates every
|
|
233
|
-
* `class_name` against the worker's exports, so this is the set a worker entry
|
|
234
|
-
* re-exports (and the set the composed class-A entry star-re-exports for the
|
|
235
|
-
* kinds the project has).
|
|
236
|
-
*
|
|
237
|
-
* Owned here because four places need it and they must not drift:
|
|
238
|
-
* `@lunora/vite` emits one star re-export per entry, the wrangler validator
|
|
239
|
-
* DECIDES the composed entry's exports from it, `reconcile-bindings` types its
|
|
240
|
-
* export-gap `module` field on it, and this module's own `detectClassExports`
|
|
241
|
-
* probes the same names.
|
|
242
|
-
*
|
|
243
|
-
* `scheduler` carries no `define*` declarations of its own — codegen writes it
|
|
244
|
-
* off `hasScheduler` purely so the composed class-A entry has a `SchedulerDO`
|
|
245
|
-
* to forward. Its presence is therefore the ONLY signal the plugin and the
|
|
246
|
-
* validator need, and it is the same signal that decides whether the builder
|
|
247
|
-
* has a `.scheduler()` method at all. `@lunora/vite` depends on `@lunora/config`, so config
|
|
248
|
-
* owning it is the direction the dependency graph allows.
|
|
249
|
-
*/
|
|
250
|
-
declare const GENERATED_CLASS_MODULES: readonly ["agents", "containers", "scheduler", "workflows"];
|
|
251
|
-
/** One {@link GENERATED_CLASS_MODULES} entry. */
|
|
252
|
-
type GeneratedClassModule = (typeof GENERATED_CLASS_MODULES)[number];
|
|
253
|
-
/**
|
|
254
|
-
* The class-B composed entry. `lunora deploy` passes this file to wrangler as
|
|
255
|
-
* the positional script whenever it exists, overriding `wrangler.main` — so it
|
|
256
|
-
* is what actually gets bundled and what wrangler checks its DO/Workflow
|
|
257
|
-
* bindings against. `main` in a class-B project names the framework adapter's
|
|
258
|
-
* build output (`.svelte-kit/cloudflare/_worker.js`, `dist/_worker.js`), which
|
|
259
|
-
* exists after `vite build` and exports only the SSR fetch handler. Lexing that
|
|
260
|
-
* instead read every declared class as unexported: nothing provisioned, plus a
|
|
261
|
-
* "add `export * from …`" warning the user cannot silence.
|
|
262
|
-
*
|
|
263
|
-
* Exported, not documented-as-duplicated: the CLI's `resolveComposedWorkerEntry`
|
|
264
|
-
* imports this constant, so the deploy's positional entry and the file this
|
|
265
|
-
* module lexes for exported classes cannot drift apart.
|
|
266
|
-
*/
|
|
267
|
-
declare const COMPOSED_WORKER_ENTRY = "src/worker.ts";
|
|
268
328
|
/**
|
|
269
329
|
* Scan a Lunora project and report which Cloudflare bindings its code implies.
|
|
270
330
|
* Read-only: performs no writes. Binding provisioning is driven by the worker
|
|
@@ -328,4 +388,4 @@ interface DiscoverSchemaInfoResult {
|
|
|
328
388
|
* parse failure is a warning (validator) or simply ignorable (inference).
|
|
329
389
|
*/
|
|
330
390
|
declare const discoverSchemaInfo: (projectRoot: string, schemaDirectory: string) => DiscoverSchemaInfoResult;
|
|
331
|
-
export { COMPOSED_WORKER_ENTRY as C, DeployDriver as D, GeneratedClassModule as G, InferredBindings as I, SchemaInfo as S,
|
|
391
|
+
export { COMPOSED_WORKER_ENTRY as C, DeployDriver as D, GeneratedClassModule as G, InferredBindings as I, ProjectionPurpose as P, SchemaInfo as S, ToolchainCommand as T, DeployRequest as a, DevRequest as b, DiscoverSchemaInfoResult as c, DriverToolchain as d, GENERATED_CLASS_MODULES as e, InferOptions as f, InferredAgent as g, InferredContainer as h, InferredWorkflow as i, ProjectedConfig as j, SecretRequest as k, TailRequest as l, discoverSchemaInfo as m, inferLunoraBindings as n, packageNamesFromBindings as p };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const k=(e,s,a)=>{if(s.length===0)return;const n=e.vectorize??[],t=new Set(n.filter(Boolean).map(i=>i?.index_name));for(const i of s)t.has(i)||a.push(`schema declares vector index "${i}"; wrangler "vectorize" must include a binding with index_name "${i}"`)},p=new Set(["basic","dev","lite","standard","standard-1","standard-2","standard-3","standard-4"]),h={disk_mb:2e4,memory_mib:12288,vcpu:4},y=(e,s,a)=>{const n=e.instance_type;if(n===void 0)return;if(typeof n=="string"){p.has(n)||a.push(`${s} has unknown instance_type "${n}" — expected lite, basic, standard-1..4, or a custom { vcpu, memory_mib, disk_mb } object`);return}for(const[o,g]of Object.entries(h)){const c=n[o];c!==void 0&&(typeof c!="number"||c<=0||c>g)&&a.push(`${s} custom instance_type ${o} must be a positive number ≤ ${String(g)} (got ${String(c)})`)}const{disk_mb:t,memory_mib:i,vcpu:r}=n;if(typeof r=="number"&&typeof i=="number"&&i<r*3072&&a.push(`${s} custom instance_type needs ≥ 3 GiB (3072 MiB) memory per vCPU (got ${String(i)} MiB for ${String(r)} vCPU)`),typeof i=="number"&&typeof t=="number"){const o=Math.floor(i/1024*2e3);t>o&&a.push(`${s} custom instance_type allows ≤ 2 GB disk per GiB memory (≤ ${String(o)} MB for ${String(i)} MiB memory; got ${String(t)} MB)`)}},_=(e,s,a)=>{const{boundClasses:n,classKinds:t,errors:i,warnings:r}=a;if(!e||typeof e!="object"||typeof e.class_name!="string"||e.class_name.length===0){i.push(`${s} must have a non-empty "class_name" naming its container-enabled Durable Object class`);return}(typeof e.image!="string"||e.image.length===0)&&i.push(`${s} ("${e.class_name}") must have an "image" — a Dockerfile path or a registry reference`),n.has(e.class_name)||i.push(`${s} class "${e.class_name}" has no matching durable_objects binding — your dev server auto-reconciles this on startup; add { "name": "...", "class_name": "${e.class_name}" } to fix it by hand`);const o=t.get(e.class_name);o!=="sqlite"&&i.push(o==="classic"?`${s} class "${e.class_name}" is registered via "new_classes" but containers require SQLite-backed DOs — move it to "new_sqlite_classes"`:`${s} class "${e.class_name}" is missing from migrations — add a migration entry with "new_sqlite_classes": ["${e.class_name}"]`),y(e,`${s} ("${e.class_name}")`,i),e.max_instances===void 0&&r.push(`${s} ("${e.class_name}") declares no max_instances — set a cap so a traffic spike can't fan out unbounded container spend`)},d=e=>typeof e=="string"&&e.length>0,m=e=>Array.isArray(e)?e.filter(s=>s!==null&&typeof s=="object"):[],b=e=>Array.isArray(e)?e.filter(s=>d(s)):[],f=e=>{const s=new Map;for(const a of m(e)){for(const n of b(a.new_classes))s.set(n,"classic");for(const n of b(a.new_sqlite_classes))s.set(n,"sqlite");for(const n of m(a.renamed_classes))if(d(n.from)&&d(n.to)){const t=s.get(n.from)??"sqlite";s.delete(n.from),s.set(n.to,t)}for(const n of b(a.deleted_classes))s.delete(n)}return s},v=e=>new Set(f(e).keys()),E=(e,s)=>{const a=v(e.migrations);for(const n of m(e.durable_objects?.bindings))n.script_name===void 0&&d(n.class_name)&&!a.has(n.class_name)&&s.push(`durable_objects.bindings declares class "${n.class_name}" but it is missing from migrations — add a migration entry with "new_sqlite_classes": ["${n.class_name}"] (or "new_classes" for a non-SQLite-backed class), or let the dev server auto-reconcile it on the next start`)},S=(e,s,a)=>{if(e.containers===void 0)return;if(!Array.isArray(e.containers)){s.push("containers must be an array of { class_name, image, ... } entries");return}const n=e.containers;if(n.length===0)return;const t=new Set(m(e.durable_objects?.bindings).map(r=>r.class_name)),i=f(e.migrations);for(const[r,o]of n.entries())_(o,`containers[${String(r)}]`,{boundClasses:t,classKinds:i,errors:s,warnings:a});e.observability?.enabled!==!0&&a.push('containers are configured but observability is not enabled — container logs will not be captured (add { "observability": { "enabled": true } })')},u=e=>e,l=(e,s,a,n)=>{if(e!==void 0){if(!Array.isArray(e)){n.push(a.arrayMessage);return}for(const[t,i]of u(e).entries()){const r=`${s}[${String(t)}]`;if(!i||typeof i!="object"){n.push(a.objectMessage(r));continue}for(const o of a.fields)d(i[o.field])||n.push(o.message(r))}}},j={arrayMessage:"workflows must be an array of { name, binding, class_name } entries",fields:[{field:"binding",message:e=>`${e} must have a non-empty "binding" naming the Workflow binding (e.g. WORKFLOW_ORDER_PIPELINE)`},{field:"class_name",message:e=>`${e} must have a non-empty "class_name" naming the exported WorkflowEntrypoint class`},{field:"name",message:e=>`${e} must have a non-empty "name" naming the deployed workflow`}],objectMessage:e=>`${e} must be a { name, binding, class_name } object`},$={arrayMessage:"queues.producers must be an array of { binding, queue } entries",fields:[{field:"binding",message:e=>`${e} must have a non-empty "binding" naming the Queue producer (e.g. QUEUE_EMAIL)`},{field:"queue",message:e=>`${e} must have a non-empty "queue" naming the deployed queue`}],objectMessage:e=>`${e} must be a { binding, queue } object`},M={arrayMessage:"queues.consumers must be an array of { queue } entries",fields:[{field:"queue",message:e=>`${e} must have a non-empty "queue" naming the consumed queue`}],objectMessage:e=>`${e} must be a { queue } object`},q=(e,s)=>{if(e.queues!==void 0){if(typeof e.queues!="object"||Array.isArray(e.queues)){s.push("queues must be a { producers, consumers } object");return}l(e.queues.producers,"queues.producers",$,s),l(e.queues.consumers,"queues.consumers",M,s)}},w={arrayMessage:"secrets_store_secrets must be an array of { binding, store_id, secret_name } entries",fields:["binding","store_id","secret_name"].map(e=>({field:e,message:s=>`${s} must have a non-empty "${e}"`})),objectMessage:e=>`${e} must be a { binding, store_id, secret_name } object`},R=[{arrayMessage:"kv_namespaces must be an array of { binding, id } entries",bindingMessage:e=>`${e} must have a non-empty "binding" naming the KV namespace binding`,hintField:"id",hintMessage:(e,s)=>`${e} ("${s}") has no "id" — run \`wrangler kv namespace create\` and set the namespace id, or the binding can't resolve`,key:"kv_namespaces"},{arrayMessage:"flagship must be an array of { binding, app_id } entries",bindingMessage:e=>`${e} must have a non-empty "binding" naming the Flagship binding`,hintField:"app_id",hintMessage:(e,s)=>`${e} ("${s}") has no "app_id" — create a Flagship app and set its id, or the binding can't resolve`,key:"flagship"},{arrayMessage:"hyperdrive must be an array of { binding, id } entries",bindingMessage:e=>`${e} must have a non-empty "binding" naming the Hyperdrive binding`,hintField:"id",hintMessage:(e,s)=>`${e} ("${s}") has no "id" — run \`wrangler hyperdrive create\` and set the id, or the binding can't connect`,key:"hyperdrive"},{arrayMessage:"pipelines must be an array of { binding, stream } entries",bindingMessage:e=>`${e} must have a non-empty "binding" naming the Pipelines binding`,hintField:["stream","pipeline"],hintMessage:(e,s)=>`${e} ("${s}") has no "stream" — run \`wrangler pipelines create <name>\` and set the stream name, or the binding can't resolve`,key:"pipelines"},{arrayMessage:"analytics_engine_datasets must be an array of { binding, dataset } entries",bindingMessage:e=>`${e} must have a non-empty "binding" naming the Analytics Engine binding`,hintField:"dataset",hintMessage:(e,s)=>`${e} ("${s}") has no "dataset" — it defaults to the binding name; set it explicitly to avoid drift`,key:"analytics_engine_datasets"}],B=(e,s,a,n)=>{const t=e[s.key];if(t!==void 0){if(!Array.isArray(t)){a.push(s.arrayMessage);return}for(const[i,r]of u(t).entries()){const o=`${s.key}[${String(i)}]`;if(!r||typeof r!="object"||!d(r.binding)){a.push(s.bindingMessage(o));continue}(typeof s.hintField=="string"?[s.hintField]:s.hintField).some(c=>d(r[c]))||n.push(s.hintMessage(o,r.binding))}}},D=[{key:"browser",message:'browser must be an object with a non-empty "binding" (e.g. { "binding": "BROWSER" })'},{key:"images",message:'images must be an object with a non-empty "binding" (e.g. { "binding": "IMAGES" })'}],A=(e,s,a)=>{const n=e[s.key];n!==void 0&&(typeof n!="object"||n===null||Array.isArray(n)||!d(n.binding))&&a.push(s.message)},I=[{arrayMessage:"services must be an array of { binding, service, entrypoint? } entries",fields:[{field:"binding",message:e=>`${e} must have a non-empty "binding" naming the service binding`},{field:"service",message:e=>`${e} must have a non-empty "service" naming the target Worker`}],key:"services",objectMessage:e=>`${e} must be a { binding, service, entrypoint? } object`},{arrayMessage:"dispatch_namespaces must be an array of { binding, namespace } entries",fields:[{field:"binding",message:e=>`${e} must have a non-empty "binding"`},{field:"namespace",message:e=>`${e} must have a non-empty "namespace" naming the dispatch namespace`}],key:"dispatch_namespaces",objectMessage:e=>`${e} must be a { binding, namespace } object`},{arrayMessage:"mtls_certificates must be an array of { binding, certificate_id } entries",fields:[{field:"binding",message:e=>`${e} must have a non-empty "binding"`},{field:"certificate_id",message:e=>`${e} must have a non-empty "certificate_id" (upload via \`wrangler mtls-certificate upload\`)`}],key:"mtls_certificates",objectMessage:e=>`${e} must be a { binding, certificate_id } object`},{arrayMessage:"r2_buckets must be an array of { binding, bucket_name } entries",fields:[{field:"binding",message:e=>`${e} must have a non-empty "binding" naming the R2 bucket binding`},{field:"bucket_name",message:e=>`${e} must have a non-empty "bucket_name" naming the deployed bucket`}],key:"r2_buckets",objectMessage:e=>`${e} must be a { binding, bucket_name } object`}],x=(e,s,a)=>{s?.hasD1GlobalTable&&!m(e.d1_databases).some(n=>n.binding==="DB")&&a.push('schema declares .global() tables; d1_databases must include a binding named "DB" — your dev server auto-reconciles this on startup, or add the binding manually'),s?.hasHyperdriveGlobalTable&&m(e.hyperdrive).length===0&&a.push('schema declares .global({ backend: "hyperdrive" }) tables; wrangler must declare a hyperdrive binding for `.hyperdriveGlobal({ exec })` to read — run `wrangler hyperdrive create <name> --connection-string=...` and add `"hyperdrive": [{ "binding": "HYPERDRIVE", "id": "<id>" }]` (any binding name works; your `exec` selector picks it)')},U=(e,s)=>{const{d1_databases:a}=e;if(a!==void 0){if(!Array.isArray(a)){s.push("d1_databases must be an array of { binding, database_id | database_name } entries");return}for(const[n,t]of u(a).entries()){const i=`d1_databases[${String(n)}]`;if(!t||typeof t!="object"){s.push(`${i} must be a { binding, database_id | database_name } object`);continue}d(t.binding)||s.push(`${i} must have a non-empty "binding" naming the D1 binding`),!d(t.database_id)&&!d(t.database_name)&&s.push(`${i} must have a "database_id" or a "database_name" — run \`wrangler d1 create\` and set one, or the binding can't resolve`)}}};export{R as H,I as R,D as S,j as W,x as a,U as b,k as c,S as d,l as e,q as f,B as g,A as h,w as i,d as j,m as o,b as s,E as v};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as d,o as p}from"./validate-bindings-D6-vb6if.mjs";const b=new Set(["1","enabled","on","true","yes"]),m=s=>typeof s=="string"&&b.has(s.trim().toLowerCase()),g=(s,t,e)=>{const i=s.send_email;if(i===void 0)return;if(!Array.isArray(i)){t.push("send_email must be an array of { name, destination_address? } entries");return}const n=i;for(const[o,a]of n.entries())(!a||typeof a!="object"||typeof a.name!="string"||a.name.length===0)&&e.push(`send_email[${String(o)}] has no non-empty "name" naming the send-email binding — set one before deploying`)},y=(s,t)=>{s.logpush!==void 0&&typeof s.logpush!="boolean"&&t.push('logpush must be a boolean (set "logpush": true to enable Cloudflare Logpush)')},c=3e5,v=(s,t)=>{const{limits:e}=s;if(e===void 0)return;if(typeof e!="object"||Array.isArray(e)){t.push('limits must be an object (e.g. { "cpu_ms": 30000 })');return}const i=e.cpu_ms;if(i!==void 0){if(typeof i!="number"||!Number.isFinite(i)||!Number.isInteger(i)||i<=0){t.push("limits.cpu_ms must be a positive integer number of milliseconds");return}i>c&&t.push(`limits.cpu_ms must be at most ${String(c)} (Cloudflare's per-invocation ceiling)`)}},l=new Set(["off","smart","targeted"]),_=(s,t)=>{const{placement:e}=s;if(e===void 0)return;if(typeof e!="object"||e===null||Array.isArray(e)){t.push('placement must be an object (e.g. { "mode": "smart" })');return}const{mode:i}=e;i!==void 0&&(typeof i!="string"||!l.has(i))&&t.push(`placement.mode must be one of ${[...l].map(n=>`"${n}"`).join(", ")}`)},A=(s,t)=>{const{observability:e}=s;if(e===void 0)return;if(typeof e!="object"||Array.isArray(e)){t.push('observability must be an object (e.g. { "enabled": true, "head_sampling_rate": 1 })');return}const i=(n,o)=>{n!==void 0&&(typeof n!="number"||Number.isNaN(n)||n<0||n>1)&&t.push(`${o} must be a number in [0, 1] (the fraction of requests sampled)`)};i(e.head_sampling_rate,"observability.head_sampling_rate"),e.logs!==void 0&&(typeof e.logs!="object"||Array.isArray(e.logs)?t.push("observability.logs must be an object"):(i(e.logs.head_sampling_rate,"observability.logs.head_sampling_rate"),e.logs.invocation_logs!==void 0&&typeof e.logs.invocation_logs!="boolean"&&t.push('observability.logs.invocation_logs must be a boolean (set "invocation_logs": true to keep per-invocation summaries)')))},j=(s,t)=>{const{cache:e}=s;if(e!==void 0){if(typeof e!="object"||e===null||Array.isArray(e)){t.push('cache must be an object (e.g. { "enabled": true })');return}e.enabled!==void 0&&typeof e.enabled!="boolean"&&t.push("cache.enabled must be a boolean (true or false)")}},S=(s,t)=>{const{exports:e}=s;if(e!==void 0){if(typeof e!="object"||e===null||Array.isArray(e)){t.push("exports must be an object keyed by entrypoint name");return}for(const[i,n]of Object.entries(e)){if(typeof n!="object"||n===null){t.push(`exports["${i}"] must be an object`);continue}n.type!==void 0&&typeof n.type!="string"&&t.push(`exports["${i}"].type must be a string`),n.cache!==void 0&&(typeof n.cache!="object"||n.cache===null||Array.isArray(n.cache)?t.push(`exports["${i}"].cache must be an object`):n.cache.enabled!==void 0&&typeof n.cache.enabled!="boolean"&&t.push(`exports["${i}"].cache.enabled must be a boolean`))}}},O=(s,t)=>{const{assets:e}=s;if(e!==void 0){if(typeof e!="object"||Array.isArray(e)){t.push('assets must be an object (e.g. { "directory": "./dist/client", "binding": "ASSETS" })');return}(typeof e.directory!="string"||e.directory.length===0)&&t.push('assets must declare a non-empty "directory" pointing at the built client output (e.g. "./dist/client")'),e.binding!==void 0&&(typeof e.binding!="string"||e.binding.length===0)&&t.push('assets.binding must be a non-empty string (e.g. "ASSETS")'),e.html_handling!==void 0&&typeof e.html_handling!="string"&&t.push("assets.html_handling must be a string"),e.not_found_handling!==void 0&&typeof e.not_found_handling!="string"&&t.push("assets.not_found_handling must be a string")}},E=(s,t)=>{const e=s.tail_consumers;if(e===void 0)return;if(!Array.isArray(e)){t.push("tail_consumers must be an array of { service, environment? } entries");return}const i=e;for(const[n,o]of i.entries())(!o||typeof o!="object"||typeof o.service!="string"||o.service.length===0)&&t.push(`tail_consumers[${String(n)}] must have a non-empty "service" naming the consumer Worker`)},L=(s,t)=>{const e=s.tail_consumers??[];return e.some(n=>!!n&&n?.service===t.service&&n?.environment===t.environment)?s:{...s,tail_consumers:[...e,t]}},N=(s,t)=>{const{vars:e}=s;if(!e||typeof e!="object")return;const i=e.LUNORA_ALLOWED_ORIGINS,n=e.LUNORA_CORS_ALLOW_CREDENTIALS,o=typeof i=="string"&&i.split(",").some(u=>u.trim()==="*"),a=m(n);o&&a&&t.push('vars.LUNORA_ALLOWED_ORIGINS includes a "*" wildcard while vars.LUNORA_CORS_ALLOW_CREDENTIALS is on — browsers reject this combination and it defeats the allowlist; name explicit origins or drop credentials')},f=s=>p(s.durable_objects?.bindings).some(t=>t.class_name==="SchedulerDO"&&t.script_name===void 0),r="LUNORA_ORIGIN_URL",R=(s,t,e)=>{if(!f(s)||d(s.vars?.[r]))return;const i=t===void 0?"vars":`env.${t}.vars`,n=t===void 0?"":` --env ${t}`;e.push(`durable_objects.bindings declares the SchedulerDO but ${i}.${r} is unset — the DO reads its dispatch origin from its own env and refuses to schedule without it, so every ctx.scheduler.runAfter/runAt fails with ORIGIN_NOT_CONFIGURED. Set ${i}.${r} to the worker's public URL, or \`wrangler secret put ${r}${n}\` (ignore this if it is already set as a secret or in the dashboard).`)};export{O as validateAssets,j as validateCache,N as validateCorsVariables,S as validateExports,v as validateLimits,y as validateLogpush,A as validateObservability,_ as validatePlacement,R as validateSchedulerOrigin,g as validateSendEmail,E as validateTailConsumers,L as withTailConsumer};
|
package/dist/packem_shared/{wranglerToAlchemy-SDoS_XY0.mjs → wranglerToAlchemy-DZOim9As.mjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const o=e=>JSON.stringify(e),$=/^[A-Z_a-z][\w$]*$/u,d=e=>$.test(e),u=e=>d(e)?e:`binding_${e.replaceAll(/\W/gu,"_")}`,m=(e,s=u(e))=>{const n=d(e);return n&&s===e?`${e},`:`${n?e:o(e)}: ${s},`},g=e=>{const s=new Set;for(const n of e.migrations??[])for(const r of n.new_sqlite_classes??[])s.add(r);return s},v=(e,s,n,r,c)=>{for(const a of e.durable_objects?.bindings??[])if(!(a.name===void 0||a.class_name===void 0)){if(a.script_name!==void 0){c.push(`durable_objects.${a.name} (external script_name "${a.script_name}")`);continue}n.add("DurableObjectNamespace"),r.push(m(a.name,`DurableObjectNamespace(${o(a.name)}, { className: ${o(a.class_name)}, sqlite: ${String(s.has(a.class_name))} })`))}},h=(e,s)=>{for(const[n,r]of Object.entries(e.vars??{}))s.push(m(n,o(r)))},
|
|
1
|
+
const o=e=>JSON.stringify(e),$=/^[A-Z_a-z][\w$]*$/u,d=e=>$.test(e),u=e=>d(e)?e:`binding_${e.replaceAll(/\W/gu,"_")}`,m=(e,s=u(e))=>{const n=d(e);return n&&s===e?`${e},`:`${n?e:o(e)}: ${s},`},g=e=>{const s=new Set;for(const n of e.migrations??[])for(const r of n.new_sqlite_classes??[])s.add(r);return s},v=(e,s,n,r,c)=>{for(const a of e.durable_objects?.bindings??[])if(!(a.name===void 0||a.class_name===void 0)){if(a.script_name!==void 0){c.push(`durable_objects.${a.name} (external script_name "${a.script_name}")`);continue}n.add("DurableObjectNamespace"),r.push(m(a.name,`DurableObjectNamespace(${o(a.name)}, { className: ${o(a.class_name)}, sqlite: ${String(s.has(a.class_name))} })`))}},h=(e,s)=>{for(const[n,r]of Object.entries(e.vars??{}))s.push(m(n,o(r)))},w=["ai","analytics_engine_datasets","assets","browser","containers","flagship","hyperdrive","images","pipelines","secrets_store_secrets","send_email","services","tail_consumers","vectorize","worker_loaders","workflows"],f=(e,s)=>{for(const n of w){const r=e[n];r!==void 0&&(!Array.isArray(r)||r.length>0)&&s.push(n)}(e.queues?.consumers?.length??0)>0&&s.push("queues.consumers")},k=e=>{const s=e.name??"worker",n=[],r=new Set(["Worker"]),c=[],a=[],p=g(e),b=[{construct:"D1Database",entries:(e.d1_databases??[]).map(t=>({binding:t.binding,name:t.database_name})),nameKey:"name"},{construct:"R2Bucket",entries:(e.r2_buckets??[]).map(t=>({binding:t.binding,name:t.bucket_name})),nameKey:"name"},{construct:"KVNamespace",entries:(e.kv_namespaces??[]).map(t=>({binding:t.binding,name:t.binding})),nameKey:"title"},{construct:"Queue",entries:(e.queues?.producers??[]).map(t=>({binding:t.binding,name:t.queue})),nameKey:"name"}];for(const{construct:t,entries:l,nameKey:y}of b)for(const i of l)i.binding!==void 0&&(r.add(t),c.push(`const ${u(i.binding)} = await ${t}(${o(i.binding)}, { adopt: true, ${y}: ${o(i.name??i.binding)} });`),a.push(m(i.binding)));v(e,p,r,a,n),h(e,a),f(e,n);const _=["adopt: true,",a.length===0?void 0:`bindings: {
|
|
2
2
|
${a.join(`
|
|
3
3
|
`)}
|
|
4
4
|
},`,e.compatibility_date===void 0?void 0:`compatibilityDate: ${o(e.compatibility_date)},`,e.compatibility_flags===void 0||e.compatibility_flags.length===0?void 0:`compatibilityFlags: ${o([...e.compatibility_flags])},`,e.triggers?.crons===void 0||e.triggers.crons.length===0?void 0:`crons: ${o([...e.triggers.crons])},`,e.main===void 0?void 0:`entrypoint: ${o(e.main)},`,`name: ${o(s)},`].filter(t=>t!==void 0);return{source:["// GENERATED by @lunora/config from wrangler.jsonc — do not edit.","// Re-generated on every `lunora deploy`; edit wrangler.jsonc instead.","",'import alchemy from "alchemy";',`import { ${[...r].toSorted((t,l)=>t.localeCompare(l)).join(", ")} } from "alchemy/cloudflare";`,"",`const app = await alchemy(${o(s)});`,"",...c.length===0?[]:[...c,""],`export const worker = await Worker(${o(s)}, {`,` ${_.join(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/config",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.283",
|
|
4
4
|
"description": "Internal shared CLI + Vite config layer for Lunora: wrangler.jsonc validation, binding inference, and .dev.vars scaffolding",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bindings",
|
|
@@ -54,10 +54,10 @@
|
|
|
54
54
|
"access": "public"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@lunora/codegen": "1.0.0-alpha.
|
|
57
|
+
"@lunora/codegen": "1.0.0-alpha.238",
|
|
58
58
|
"@lunora/container": "1.0.0-alpha.63",
|
|
59
59
|
"@lunora/errors": "1.0.0-alpha.47",
|
|
60
|
-
"@lunora/seed": "1.0.0-alpha.
|
|
60
|
+
"@lunora/seed": "1.0.0-alpha.169",
|
|
61
61
|
"@visulima/colorize": "2.1.1",
|
|
62
62
|
"@visulima/find-ai-runner": "1.0.2",
|
|
63
63
|
"@visulima/package": "5.0.20",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const r={deploy:o=>{const n=o.preview===!0?["versions","upload"]:["deploy"];return o.entry!==void 0&&n.push(o.entry),o.environment!==void 0&&n.push("--env",o.environment),o.temporary===!0&&n.push("--temporary"),o.dryRun===!0&&n.push("--dry-run"),o.outDir!==void 0&&n.push("--outdir",o.outDir,"--metafile"),{args:n,tool:"wrangler"}},dev:o=>{const n=["dev"];return o.configPath!==void 0&&n.push("--config",o.configPath),o.environment!==void 0&&n.push("--env",o.environment),n.push(...o.extraArgs??[]),{args:n,tool:"wrangler"}},secretList:o=>{const n=["secret","list","--format","json"];return o.environment!==void 0&&n.push("--env",o.environment),o.temporary===!0&&n.push("--temporary"),{args:n,tool:"wrangler"}},secretPut:o=>{const n=["secret","put",o.key??""];return o.environment!==void 0&&n.push("--env",o.environment),o.temporary===!0&&n.push("--temporary"),{args:n,tool:"wrangler"}},tail:o=>{const n=["tail"];return o.worker!==void 0&&n.push(o.worker),o.environment!==void 0&&n.push("--env",o.environment),o.format!==void 0&&n.push("--format",o.format),o.status!==void 0&&n.push("--status",o.status),o.search!==void 0&&n.push("--search",o.search),o.temporary===!0&&n.push("--temporary"),{args:n,tool:"wrangler"}}},i={id:"cloudflare",name:"Cloudflare",toolchain:r};export{i as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{existsSync as l,statSync as w,readFileSync as b,readdirSync as j}from"node:fs";import{init as Y,parse as f}from"es-module-lexer";import{discoverAgentInfo as K}from"./discoverAgentInfo-CTdCSfYM.mjs";import{WRANGLER_FILES as W,readWranglerJsonc as M}from"./WRANGLER_FILES-UNW-xY5u.mjs";import{discoverContainerInfo as G}from"./discoverContainerInfo-EhZtEBQs.mjs";import{escapeRegExp as D}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{discoverFlags as X,FLAGS_FILENAME as q,discoverQueues as H,QUEUES_FILENAME as Q}from"@lunora/codegen";import{d as C}from"./discover-info-Vj9d4qYt.mjs";import{discoverSchemaInfo as V}from"./discoverSchemaInfo-DJvevsCm.mjs";import{discoverWorkflowInfo as J}from"./discoverWorkflowInfo-BsPvlo6O.mjs";import{join as c}from"node:path";const z=(e,s)=>{const{error:t,value:r}=C(e,s,q,X);return t===void 0?{flags:r}:{error:t}},Z=(e,s)=>{const{error:t,value:r}=C(e,s,Q,H);return t===void 0?{queues:r??[]}:{error:t,queues:[]}},ee=new Set([".cjs",".cts",".js",".jsx",".mjs",".mts",".ts",".tsx"]),R="_generated",se=new Set([".git",".lunora-cache",".wrangler","dist",R,"node_modules"]),re=["lunora","src"],te=["src/server.ts","src/server/index.ts","src/server/index.tsx","src/index.ts","src/worker.ts"],ne=new Set(["build","coverage","dist",R,"node_modules","out","target"]),oe=new Set([".client",".server"]),ae=/[/\\]/u,ie=e=>{const s=[];for(const t of e.split(ae))t===""||t==="."||(t===".."&&s.length>0&&s.at(-1)!==".."?s.pop():s.push(t));return s},ce=e=>ie(e).slice(0,-1).some(s=>ne.has(s)||s.startsWith(".")&&!oe.has(s)),g={SchedulerDO:"SCHEDULER",SessionDO:"SESSION",ShardDO:"SHARD"},v=Object.keys(g),qe=e=>Object.hasOwn(g,e),ue=/\benv\s*\.\s*DB\b/,le=/\benv\s*\.\s*AI\b/,P=/\bctx\s*\.\s*pipelines\b/,L=/\bctx\s*\.\s*r2sql\b/,B=/^\s*import\s+type\b/,de=new Set(["@lunora/agent","@lunora/agent/sandbox"]),pe=e=>{const s=e.indexOf("{");if(s===-1)return"";const t=e.indexOf("}",s+1);return t===-1?e.slice(s+1):e.slice(s+1,t)},me=/\btype\s+browserTool\b/,be=/\bbrowserTool\b/,fe=/import\s+\{[^}]*\bbrowserTool\b[^}]*\}\s+from\s+["']@lunora\/agent(?:\/sandbox)?["']/,ge=e=>{if(B.test(e))return!1;const s=pe(e);return be.test(s)&&!me.test(s)},Ee=e=>{try{const[s]=f(e);return s.some(t=>t.n!==void 0&&de.has(t.n)&&ge(e.slice(t.ss,t.se)))}catch{return fe.test(e)}},E={usesAi:{pattern:/\bfrom\s+["']@lunora\/ai["']/,source:"@lunora/ai"},usesAnalytics:{pattern:/\bfrom\s+["']@lunora\/bindings\/analytics["']/,source:"@lunora/bindings/analytics"},usesAuth:{pattern:/\bfrom\s+["']@lunora\/auth["']/,source:"@lunora/auth"},usesBrowser:{pattern:/\bfrom\s+["']@lunora\/browser["']/,source:"@lunora/browser"},usesHyperdrive:{pattern:/\bfrom\s+["']@lunora\/hyperdrive["']/,source:"@lunora/hyperdrive"},usesImages:{pattern:/\bfrom\s+["']@lunora\/bindings\/images["']/,source:"@lunora/bindings/images"},usesKv:{pattern:/\bfrom\s+["']@lunora\/bindings\/kv["']/,source:"@lunora/bindings/kv"},usesMail:{pattern:/\bfrom\s+["']@lunora\/mail["']/,source:"@lunora/mail"},usesNotify:{pattern:/\bfrom\s+["']@lunora\/notify["']/,source:"@lunora/notify"},usesPayment:{pattern:/\bfrom\s+["']@lunora\/payment["']/,source:"@lunora/payment"},usesPipelines:{pattern:P,source:"@lunora/bindings/pipelines"},usesR2sql:{pattern:L,source:"@lunora/bindings/r2sql"},usesScheduler:{pattern:/\bfrom\s+["']@lunora\/scheduler["']/,source:"@lunora/scheduler"},usesStorage:{pattern:/\bfrom\s+["']@lunora\/storage["']/,source:"@lunora/storage"},usesX402Charge:{pattern:/\bfrom\s+["']@lunora\/x402\/charge["']/,source:"@lunora/x402/charge"},usesX402Pay:{pattern:/\bfrom\s+["']@lunora\/x402\/pay["']/,source:"@lunora/x402/pay"}},p=Object.keys(E),he="STRIPE_SECRET_KEY + STRIPE_WEBHOOK_SECRET (Stripe) or POLAR_ACCESS_TOKEN + POLAR_WEBHOOK_SECRET (Polar)",k=[...p,"needsD1"],Se=()=>{const e={};for(const s of k)e[s]=!1;return e},d=Object.freeze(Se()),x=(e,s)=>{const t={};for(const r of k)t[r]=e[r]||s[r];return t},_e=e=>{for(const s of p)if(E[s].source===e)return{...d,[s]:!0};return d},Re=e=>{const[s]=f(e);let t=d;for(const r of s){const n=r.n;!n||B.test(e.slice(r.ss,r.se))||(t=x(t,_e(n)))}return t},xe=e=>{const s={...d};for(const t of p)s[t]=E[t].pattern.test(e);return s},ye=e=>{let s;try{s=Re(e)}catch{s=xe(e)}return x(s,{...d,needsD1:ue.test(e),usesAi:le.test(e),usesPipelines:P.test(e),usesR2sql:L.test(e)})},y=(e,s)=>{let t;try{t=j(e,{withFileTypes:!0})}catch{return}for(const r of t){if(r.isDirectory()){se.has(r.name)||y(c(e,r.name),s);continue}const n=r.name.lastIndexOf(".");n!==-1&&ee.has(r.name.slice(n))&&s.push(c(e,r.name))}},Oe="virtual:lunora/worker",Ie=["ShardDO"],He=["agents","containers","scheduler","workflows"],Ae="src/worker.ts",Ne=e=>{for(const s of W){const t=c(e,s);if(!l(t))continue;const{parsed:r}=M(t),n=r?.main;if(n===Oe)return{composed:!0};const a=c(e,Ae);if(l(a))return{composed:!1,path:a};if(typeof n=="string"&&!ce(n)&&l(c(e,n)))return{composed:!1,path:c(e,n)};break}for(const s of te){const t=c(e,s);if(l(t))return{composed:!1,path:t}}return{composed:!1}},Te=/(?:^|[\s,{])type$/u,$=(e,s)=>{const t=s.ls>=0?s.ls:s.s;return Te.test(e.slice(0,t).trimEnd())},F=(e,s)=>{const t=D(s);return new RegExp(String.raw`\bexport\s+type\s+${t}\b`,"u").test(e)||new RegExp(String.raw`\bexport\s+type\s*\{[^}]*\b${t}\b`,"u").test(e)||new RegExp(String.raw`\bexport\s+\{[^}]*\btype\s+${t}\b`,"u").test(e)},ve=e=>{const s=b(e,"utf8");let t;try{const[,r]=f(s);t=new Set(r.filter(n=>!$(s,n)).map(n=>n.n))}catch{t=new Set(v.filter(r=>new RegExp(String.raw`\bexport\b[^\n;]*\b${r}\b`,"u").test(s)&&!F(s,r)))}return v.filter(r=>t.has(r)).map(r=>({binding:g[r],className:r}))},_=(e,s,t)=>{if(s.length===0)return[];if(e.composed)return s.map(o=>({...o,exported:!0}));if(e.path===void 0)return s.map(o=>({...o,exported:!1}));const r=b(e.path,"utf8"),n=new RegExp(String.raw`\bexport\s*\*\s*from\s*["'][^"']*_generated\/${t}(?:\.js)?["']`).test(r);let a;try{const[,o]=f(r);a=new Set(o.filter(i=>!$(r,i)).map(i=>i.n))}catch{a=new Set(s.map(o=>o.className).filter(o=>new RegExp(String.raw`\bexport\b[^\n;]*\b${D(o)}\b`,"u").test(r)&&!F(r,o)))}return s.map(o=>{const i=n||a.has(o.className);return{...o,exported:i}})},we=(e,s)=>V(e,s).info?.hasD1GlobalTable??!1,De=(e,s)=>{let t=d;for(const r of s){const n=c(e,r);if(!l(n)||!w(n).isDirectory())continue;const a=[];y(n,a);for(const o of a)t=x(t,ye(b(o,"utf8")))}return t},Ce=(e,s)=>{const t=c(e,s);if(!l(t)||!w(t).isDirectory())return!1;const r=[];return y(t,r),r.some(n=>Ee(b(n,"utf8")))},Pe=(e,s,t)=>[...e.map(r=>r.exported?`${r.bindingName}/${r.className} (container "${r.exportName}" declared and exported)`:`hint: container "${r.exportName}" is declared but ${r.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/containers"\``),...s.map(r=>r.exported?`${r.bindingName}/${r.className} (workflow "${r.exportName}" declared and exported)`:`hint: workflow "${r.exportName}" is declared but ${r.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/workflows"\``),...t.map(r=>r.exported?`${r.bindingName}/${r.className} (agent "${r.exportName}" declared and exported)`:`hint: agent "${r.exportName}" is declared but ${r.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/agents"\``)],Le=(e,s)=>[[e.usesAi,"AI (@lunora/ai imported or env.AI used)"],[e.usesAuth&&!s.has("SessionDO"),"hint: @lunora/auth is imported; its tables are D1-backed by default. For DO-backed auth (what @better-auth/scim needs), pass `namespace` to .auth() and export the generated auth DO class"],[e.usesScheduler&&!s.has("SchedulerDO"),"hint: @lunora/scheduler is imported but no SchedulerDO is exported by the worker entry"],[e.usesStorage,"hint: @lunora/storage is imported; add an r2_buckets binding (bucket binding names are user-defined)"],[e.usesMail,"hint: @lunora/mail is imported; set RESEND_API_KEY in .dev.vars (obtain at https://resend.com/api-keys)"],[e.usesPayment,`hint: @lunora/payment is imported; set the provider secrets in .dev.vars — ${he}`],[e.usesBrowser,"browser (@lunora/browser imported) — self-describing { binding: BROWSER }"],[e.usesImages,"images (@lunora/bindings/images imported) — self-describing { binding: IMAGES }"],[e.usesAnalytics,"analytics_engine_datasets (@lunora/bindings/analytics imported) — self-describing { binding: ANALYTICS, dataset }"],[e.usesKv,"hint: @lunora/bindings/kv is imported; add a kv_namespaces binding ({ binding, id }) and pass env.<BINDING> to createKv() — the namespace id can't be auto-provisioned"],[e.usesHyperdrive,"hint: @lunora/hyperdrive is imported; run 'wrangler hyperdrive create' and add a 'hyperdrive' binding ({ binding, id }) — the id can't be auto-provisioned"],[e.usesPipelines,"hint: ctx.pipelines is used; run 'wrangler pipelines create <name>' and add a 'pipelines' binding ({ binding, pipeline }) — the pipeline resource can't be auto-provisioned"],[e.usesX402Charge,"hint: @lunora/x402/charge is imported; set the recipient wallet address as a [vars] entry (the var name is yours to choose) and pass it to the charge config — the x402 facilitator settles USDC to that address"],[e.usesX402Pay,"hint: @lunora/x402/pay is imported (ActionCtx-only, spends real funds); add a secrets_store_secrets[] binding for the agent wallet key (name it to match signer.secretName) and pair the pay rail with a spend policy — ctx.secrets reads a Secrets Store binding, not .dev.vars, so the key can't be auto-provisioned"]].filter(([r])=>r).map(([,r])=>r),Be=(e,s,t,r=[],n=[],a=[])=>{const o=new Set(e.map(u=>u.className)),i=e.map(u=>`${u.binding}/${u.className} (exported by worker entry)`);return s&&i.push("DB (.global() table declared)"),i.push(...Pe(r,n,a),...Le(t,o)),i},Qe=async e=>{await Y;const s=e.schemaDir??"lunora",t=e.scanDirs??re,r=De(e.projectRoot,t),n={...r,usesBrowser:r.usesBrowser||Ce(e.projectRoot,s)},a=Ne(e.projectRoot);let o;a.composed?o=[...Ie,...l(c(e.projectRoot,s,R,"scheduler.ts"))?["SchedulerDO"]:[]].map(T=>({binding:g[T],className:T})):o=a.path===void 0?[]:ve(a.path);const i=n.needsD1||we(e.projectRoot,s),u=_(a,G(e.projectRoot,s).containers,"containers"),O=_(a,J(e.projectRoot,s).workflows,"workflows"),I=_(a,K(e.projectRoot,s).agents,"agents"),U=[...Z(e.projectRoot,s).queues],{flags:m}=z(e.projectRoot,s),h=m?.provider==="flagship"&&m.mode==="binding"?m.bindingName:void 0,A={};for(const S of p)A[S]=n[S];const N=Be(o,i,n,u,O,I);return h!==void 0&&N.push(`hint: lunora/flags.ts uses Flagship in binding mode; add a flagship binding ({ binding: "${h}", app_id }) — the app_id can't be auto-provisioned`),{agents:I,containers:u,durableObjects:o,flagshipBinding:h,needsD1:i,queues:U,signals:N,usesFlags:m!==void 0,workflows:O,...A}},Ve=e=>{const s=[];for(const t of p)e[t]&&s.push(E[t].source);return s};export{Ie as COMPOSED_ENTRY_DURABLE_OBJECTS,Ae as COMPOSED_WORKER_ENTRY,He as GENERATED_CLASS_MODULES,R as GENERATED_DIRECTORY,Oe as LUNORA_WORKER_VIRTUAL_ID,ne as NON_SOURCE_DIRECTORIES,oe as SOURCE_DOT_DIRECTORIES,te as WORKER_ENTRY_FALLBACKS,Qe as inferLunoraBindings,qe as isFrameworkDurableObject,ce as isGeneratedOutput,Ve as packageNamesFromBindings,Ne as resolveWorkerEntry};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import t from"./CLOUDFLARE_DRIVER-Ci9oJMYb.mjs";const l={id:"node",name:"Node"},a="cloudflare",n={cloudflare:t,node:l},r=()=>Object.keys(n).toSorted((o,e)=>o.localeCompare(e)),s=(o=a)=>{const e=n[o];if(e===void 0)throw new Error(`unknown deploy target "${o}" — available targets: ${r().join(", ")}`);return e},c=o=>Object.hasOwn(n,o)&&s(o).toolchain!==void 0,i=()=>r().filter(o=>c(o));export{a as DEFAULT_DEPLOY_TARGET,r as deployTargetIds,c as isRunnableTarget,s as resolveDeployDriver,i as runnableTargetIds};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{existsSync as f,readFileSync as B,readdirSync as J}from"node:fs";import{join as p,dirname as R,extname as w,basename as W}from"node:path";import{COMPOSED_WORKER_ENTRY as Z,LUNORA_WORKER_VIRTUAL_ID as E,isGeneratedOutput as ee,WORKER_ENTRY_FALLBACKS as te,GENERATED_DIRECTORY as se,COMPOSED_ENTRY_DURABLE_OBJECTS as F,GENERATED_CLASS_MODULES as P,SOURCE_DOT_DIRECTORIES as ne,NON_SOURCE_DIRECTORIES as ie,isFrameworkDurableObject as ae}from"./COMPOSED_WORKER_ENTRY-Bj793dir.mjs";import{discoverSchemaInfo as oe}from"./discoverSchemaInfo-DJvevsCm.mjs";import{Project as re,Node as m}from"ts-morph";import{isCacheEnabled as ce,WORKERS_CACHE_MIN_DATE as k}from"./WORKERS_CACHE_MIN_DATE-0k9ABJtF.mjs";import{findWranglerFile as de,readWranglerJsonc as le}from"./WRANGLER_FILES-UNW-xY5u.mjs";const ue=new Set(["1","enabled","on","true","yes"]),me=e=>typeof e=="string"&&ue.has(e.trim().toLowerCase()),$=[".ts",".tsx",".mts",".cts"],S=new Set($),pe=new Set([".cjs",".js",".mjs"]),A="default",N={".cjs":[".cts"],".js":[".ts",".tsx"],".mjs":[".mts"]},ge=250,fe=(e,t,n)=>{const s=p(t,Z);if(f(s))return{origin:"declared",path:s};if(e===E)return{origin:"composed"};const i=()=>{const r=te.map(c=>p(t,c)).find(c=>f(c));return r===void 0?void 0:{origin:"probed",path:r}};if(typeof e!="string"||e.length===0||ee(e))return i();const a=p(R(n),e),o=w(a);if(!(!S.has(o)&&!pe.has(o)))return f(a)?{origin:"declared",path:a}:{origin:"absent",path:a}},q=(e,t)=>{if(m.isIdentifier(e)){t.add(e.getText());return}if(m.isObjectBindingPattern(e)||m.isArrayBindingPattern(e))for(const n of e.getElements())m.isBindingElement(n)&&q(n.getNameNode(),t)},be=(e,t)=>{const n=[];for(const s of e.getExportDeclarations())if(!s.isTypeOnly()){if(s.isNamespaceExport()){const i=s.getNamespaceExport();i===void 0?n.push(s.getModuleSpecifierValue()??""):t.add(i.getName());continue}for(const i of s.getNamedExports())i.isTypeOnly()||t.add(i.getAliasNode()?.getText()??i.getName())}return n},he=(e,t)=>{for(const n of e.getVariableStatements().filter(s=>s.getExportKeyword()!==void 0))for(const s of n.getDeclarations())q(s.getNameNode(),t);for(const n of[...e.getClasses(),...e.getFunctions(),...e.getEnums()]){if(n.getExportKeyword()===void 0)continue;const s=n.isDefaultExport()?A:n.getName();s!==void 0&&t.add(s)}e.getExportAssignments().length>0&&t.add(A)},G=(e,t)=>{const n=new re({compilerOptions:{allowJs:!0},skipFileDependencyResolution:!0,skipLoadingLibFiles:!0,useInMemoryFileSystem:!0}),s=n.createSourceFile(e,t,{overwrite:!0});return n.getProgram().compilerObject.getSyntacticDiagnostics(s.compilerNode).length>0?void 0:s},ye=(e,t)=>{if(!t.startsWith("./")&&!t.startsWith("../"))return;const n=p(R(e),t),s=w(n),i=S.has(s)||N[s]!==void 0,a=i?n.slice(0,-s.length):n;return[...S.has(s)?[n]:[],...(N[s]??[]).map(r=>`${a}${r}`),...i?[]:$.map(r=>`${n}${r}`),...i||s.length===0?$.map(r=>p(a,`index${r}`)):[]].find(r=>f(r))},K=e=>{const t=new Set,n=new Set([e]),s=[e];for(;s.length>0;){if(n.size-1>ge)return;const i=s.pop();let a;try{a=B(i,"utf8")}catch{return}const o=G(W(i),a);if(o===void 0)return;const r=be(o,t);he(o,t);for(const c of r){const d=ye(i,c);if(d===void 0)return;n.has(d)||(n.add(d),s.push(d))}}return t},ve=(e,t)=>{const n={exports:void 0,kind:"composed",path:E},s=p(e,t,se);if(!f(s))return n;const i=new Set(F);for(const a of P){const o=p(s,`${a}.ts`);if(!f(o))continue;const r=K(o);if(r===void 0)return n;for(const c of r)i.add(c)}return{exports:i,kind:"composed",path:E}},_e=(e,t,n)=>{if(e===void 0||e.origin==="absent")return;if(e.origin==="composed")return ve(t,n);const s=K(e.path);if(!(e.origin==="probed"&&s!==void 0&&!s.has(A)))return{exports:s,kind:"authored",path:e.path}},Ee=new Set([".cjs",".cts",".js",".jsx",".mjs",".mts",".ts",".tsx"]),$e=2e3,D="defineTable",x="defineApp",Se=e=>{const t=[],n=[];let s;try{s=J(e,{withFileTypes:!0})}catch{return{files:t,subdirectories:n}}for(const i of s)i.isDirectory()?i.name.startsWith(".")&&!ne.has(i.name)||ie.has(i.name)||n.push(p(e,i.name)):Ee.has(w(i.name))&&t.push(p(e,i.name));return{files:t,subdirectories:n}},Y=(e,t)=>{const n=new Set;for(const s of e.getImportDeclarations())for(const i of s.getNamedImports())!i.isTypeOnly()&&i.getName()===t&&n.add(i.getAliasNode()?.getText()??i.getName());return n},Ae=(e,t)=>{let n=!1;return e.forEachDescendant((s,i)=>{if(!m.isCallExpression(s))return;const a=s.getExpression();m.isIdentifier(a)&&t.has(a.getText())&&(n=!0,i.stop())}),n},Re=e=>{let t=e;for(;m.isCallExpression(t)||m.isPropertyAccessExpression(t);)t=t.getExpression();return t},we=(e,t)=>{const n=Re(e);return m.isIdentifier(n)&&t.has(n.getText())},H={global:/\.\s*global\s*\(/u,hyperdriveGlobal:/\.\s*hyperdriveGlobal\s*\(/u,vectors:/\.\s*vectors\s*\(/u},je=e=>Object.hasOwn(H,e),Oe=(e,t)=>{const n=new Set,s=new Set([D,...Y(e,D)]);return e.forEachDescendant(i=>{if(!m.isCallExpression(i))return;const a=i.getExpression();if(!m.isPropertyAccessExpression(a)||we(a,s))return;const o=a.getName();je(o)&&t.has(o)&&n.add(o)}),n},ke=(e,t)=>{let n;try{n=B(e,"utf8")}catch{return}const s=new Set([...t].filter(a=>H[a].test(n)));if(s.size===0&&!n.includes(x))return;const i=G(W(e),n);return i===void 0?{chained:s,composes:!1}:{chained:Oe(i,s),composes:Ae(i,Y(i,x))}},Ne=(e,t)=>{const n=[e],s=new Set;let i=0,a;const o=r=>{if(i+=1,i>$e)return!1;const c=ke(r,t);for(const d of c?.chained??[])s.add(d);return c?.composes&&(a??=r),!0};for(;n.length>0;){const r=n.pop(),{files:c,subdirectories:d}=Se(r);n.push(...d);for(const l of c){if(!o(l))return;if(a!==void 0&&s.size===t.size)return{chained:s,site:a}}}return a===void 0?void 0:{chained:s,site:a}},M="2026-04-07",St="web_socket_auto_reply_to_close",I=/^\d{4}-\d{2}-\d{2}$/,C=["containers","d1_databases","durable_objects","kv_namespaces","queues","r2_buckets","secrets_store_secrets","services","tail_consumers","vars","vectorize","workflows"],T=["assets","compatibility_date","exports","logpush","main","migrations","observability","placement"],V=(e,t)=>{if(t===void 0)return{merged:e,unverifiedKeys:[]};const n=e.env?.[t];if(n===void 0){const r=Object.keys(e.env??{}).toSorted((d,l)=>d.localeCompare(l)),c=r.length>0?` (declared: ${r.join(", ")}).`:" (no environments are declared).";return{error:`--env "${t}" names no environment declared in wrangler.jsonc's "env" block${c}`,merged:e,unverifiedKeys:[]}}const s={...e},i=Object.keys(n).filter(r=>r!=="env");for(const r of i)T.includes(r)&&(s[r]=n[r]);for(const r of C)s[r]=n[r];const a=new Set([...C,...T]),o=i.filter(r=>!a.has(r)).map(String);return{merged:s,unverifiedKeys:o}},De=(e,t,n)=>{if(t.length===0)return;const s=e.vectorize??[],i=new Set(s.filter(Boolean).map(a=>a?.index_name));for(const a of t)i.has(a)||n.push(`schema declares vector index "${a}"; wrangler "vectorize" must include a binding with index_name "${a}"`)},xe=new Set(["basic","dev","lite","standard","standard-1","standard-2","standard-3","standard-4"]),Me={disk_mb:2e4,memory_mib:12288,vcpu:4},Ie=(e,t,n)=>{const s=e.instance_type;if(s===void 0)return;if(typeof s=="string"){xe.has(s)||n.push(`${t} has unknown instance_type "${s}" — expected lite, basic, standard-1..4, or a custom { vcpu, memory_mib, disk_mb } object`);return}for(const[r,c]of Object.entries(Me)){const d=s[r];d!==void 0&&(typeof d!="number"||d<=0||d>c)&&n.push(`${t} custom instance_type ${r} must be a positive number ≤ ${String(c)} (got ${String(d)})`)}const{disk_mb:i,memory_mib:a,vcpu:o}=s;if(typeof o=="number"&&typeof a=="number"&&a<o*3072&&n.push(`${t} custom instance_type needs ≥ 3 GiB (3072 MiB) memory per vCPU (got ${String(a)} MiB for ${String(o)} vCPU)`),typeof a=="number"&&typeof i=="number"){const r=Math.floor(a/1024*2e3);i>r&&n.push(`${t} custom instance_type allows ≤ 2 GB disk per GiB memory (≤ ${String(r)} MB for ${String(a)} MiB memory; got ${String(i)} MB)`)}},Ce=(e,t,n)=>{const{boundClasses:s,classKinds:i,errors:a,warnings:o}=n;if(!e||typeof e!="object"||typeof e.class_name!="string"||e.class_name.length===0){a.push(`${t} must have a non-empty "class_name" naming its container-enabled Durable Object class`);return}(typeof e.image!="string"||e.image.length===0)&&a.push(`${t} ("${e.class_name}") must have an "image" — a Dockerfile path or a registry reference`),s.has(e.class_name)||a.push(`${t} class "${e.class_name}" has no matching durable_objects binding — your dev server auto-reconciles this on startup; add { "name": "...", "class_name": "${e.class_name}" } to fix it by hand`);const r=i.get(e.class_name);r!=="sqlite"&&a.push(r==="classic"?`${t} class "${e.class_name}" is registered via "new_classes" but containers require SQLite-backed DOs — move it to "new_sqlite_classes"`:`${t} class "${e.class_name}" is missing from migrations — add a migration entry with "new_sqlite_classes": ["${e.class_name}"]`),Ie(e,`${t} ("${e.class_name}")`,a),e.max_instances===void 0&&o.push(`${t} ("${e.class_name}") declares no max_instances — set a cap so a traffic spike can't fan out unbounded container spend`)},u=e=>typeof e=="string"&&e.length>0,g=e=>Array.isArray(e)?e.filter(t=>t!==null&&typeof t=="object"):[],_=e=>Array.isArray(e)?e.filter(t=>u(t)):[],Q=e=>{const t=new Map;for(const n of g(e)){for(const s of _(n.new_classes))t.set(s,"classic");for(const s of _(n.new_sqlite_classes))t.set(s,"sqlite");for(const s of g(n.renamed_classes))if(u(s.from)&&u(s.to)){const i=t.get(s.from)??"sqlite";t.delete(s.from),t.set(s.to,i)}for(const s of _(n.deleted_classes))t.delete(s)}return t},Te=e=>new Set(Q(e).keys()),Le=(e,t)=>{const n=Te(e.migrations);for(const s of g(e.durable_objects?.bindings))s.script_name===void 0&&u(s.class_name)&&!n.has(s.class_name)&&t.push(`durable_objects.bindings declares class "${s.class_name}" but it is missing from migrations — add a migration entry with "new_sqlite_classes": ["${s.class_name}"] (or "new_classes" for a non-SQLite-backed class), or let the dev server auto-reconcile it on the next start`)},Ue=(e,t,n)=>{if(e.containers===void 0)return;if(!Array.isArray(e.containers)){t.push("containers must be an array of { class_name, image, ... } entries");return}const s=e.containers;if(s.length===0)return;const i=new Set(g(e.durable_objects?.bindings).map(o=>o.class_name)),a=Q(e.migrations);for(const[o,r]of s.entries())Ce(r,`containers[${String(o)}]`,{boundClasses:i,classKinds:a,errors:t,warnings:n});e.observability?.enabled!==!0&&n.push('containers are configured but observability is not enabled — container logs will not be captured (add { "observability": { "enabled": true } })')},j=e=>e,y=(e,t,n,s)=>{if(e!==void 0){if(!Array.isArray(e)){s.push(n.arrayMessage);return}for(const[i,a]of j(e).entries()){const o=`${t}[${String(i)}]`;if(!a||typeof a!="object"){s.push(n.objectMessage(o));continue}for(const r of n.fields)u(a[r.field])||s.push(r.message(o))}}},Be={arrayMessage:"workflows must be an array of { name, binding, class_name } entries",fields:[{field:"binding",message:e=>`${e} must have a non-empty "binding" naming the Workflow binding (e.g. WORKFLOW_ORDER_PIPELINE)`},{field:"class_name",message:e=>`${e} must have a non-empty "class_name" naming the exported WorkflowEntrypoint class`},{field:"name",message:e=>`${e} must have a non-empty "name" naming the deployed workflow`}],objectMessage:e=>`${e} must be a { name, binding, class_name } object`},We={arrayMessage:"queues.producers must be an array of { binding, queue } entries",fields:[{field:"binding",message:e=>`${e} must have a non-empty "binding" naming the Queue producer (e.g. QUEUE_EMAIL)`},{field:"queue",message:e=>`${e} must have a non-empty "queue" naming the deployed queue`}],objectMessage:e=>`${e} must be a { binding, queue } object`},Fe={arrayMessage:"queues.consumers must be an array of { queue } entries",fields:[{field:"queue",message:e=>`${e} must have a non-empty "queue" naming the consumed queue`}],objectMessage:e=>`${e} must be a { queue } object`},Pe=(e,t)=>{if(e.queues!==void 0){if(typeof e.queues!="object"||Array.isArray(e.queues)){t.push("queues must be a { producers, consumers } object");return}y(e.queues.producers,"queues.producers",We,t),y(e.queues.consumers,"queues.consumers",Fe,t)}},qe={arrayMessage:"secrets_store_secrets must be an array of { binding, store_id, secret_name } entries",fields:["binding","store_id","secret_name"].map(e=>({field:e,message:t=>`${t} must have a non-empty "${e}"`})),objectMessage:e=>`${e} must be a { binding, store_id, secret_name } object`},Ge=[{arrayMessage:"kv_namespaces must be an array of { binding, id } entries",bindingMessage:e=>`${e} must have a non-empty "binding" naming the KV namespace binding`,hintField:"id",hintMessage:(e,t)=>`${e} ("${t}") has no "id" — run \`wrangler kv namespace create\` and set the namespace id, or the binding can't resolve`,key:"kv_namespaces"},{arrayMessage:"flagship must be an array of { binding, app_id } entries",bindingMessage:e=>`${e} must have a non-empty "binding" naming the Flagship binding`,hintField:"app_id",hintMessage:(e,t)=>`${e} ("${t}") has no "app_id" — create a Flagship app and set its id, or the binding can't resolve`,key:"flagship"},{arrayMessage:"hyperdrive must be an array of { binding, id } entries",bindingMessage:e=>`${e} must have a non-empty "binding" naming the Hyperdrive binding`,hintField:"id",hintMessage:(e,t)=>`${e} ("${t}") has no "id" — run \`wrangler hyperdrive create\` and set the id, or the binding can't connect`,key:"hyperdrive"},{arrayMessage:"pipelines must be an array of { binding, stream } entries",bindingMessage:e=>`${e} must have a non-empty "binding" naming the Pipelines binding`,hintField:["stream","pipeline"],hintMessage:(e,t)=>`${e} ("${t}") has no "stream" — run \`wrangler pipelines create <name>\` and set the stream name, or the binding can't resolve`,key:"pipelines"},{arrayMessage:"analytics_engine_datasets must be an array of { binding, dataset } entries",bindingMessage:e=>`${e} must have a non-empty "binding" naming the Analytics Engine binding`,hintField:"dataset",hintMessage:(e,t)=>`${e} ("${t}") has no "dataset" — it defaults to the binding name; set it explicitly to avoid drift`,key:"analytics_engine_datasets"}],Ke=(e,t,n,s)=>{const i=e[t.key];if(i!==void 0){if(!Array.isArray(i)){n.push(t.arrayMessage);return}for(const[a,o]of j(i).entries()){const r=`${t.key}[${String(a)}]`;if(!o||typeof o!="object"||!u(o.binding)){n.push(t.bindingMessage(r));continue}(typeof t.hintField=="string"?[t.hintField]:t.hintField).some(d=>u(o[d]))||s.push(t.hintMessage(r,o.binding))}}},Ye=[{key:"browser",message:'browser must be an object with a non-empty "binding" (e.g. { "binding": "BROWSER" })'},{key:"images",message:'images must be an object with a non-empty "binding" (e.g. { "binding": "IMAGES" })'}],He=(e,t,n)=>{const s=e[t.key];s!==void 0&&(typeof s!="object"||s===null||Array.isArray(s)||!u(s.binding))&&n.push(t.message)},Ve=[{arrayMessage:"services must be an array of { binding, service, entrypoint? } entries",fields:[{field:"binding",message:e=>`${e} must have a non-empty "binding" naming the service binding`},{field:"service",message:e=>`${e} must have a non-empty "service" naming the target Worker`}],key:"services",objectMessage:e=>`${e} must be a { binding, service, entrypoint? } object`},{arrayMessage:"dispatch_namespaces must be an array of { binding, namespace } entries",fields:[{field:"binding",message:e=>`${e} must have a non-empty "binding"`},{field:"namespace",message:e=>`${e} must have a non-empty "namespace" naming the dispatch namespace`}],key:"dispatch_namespaces",objectMessage:e=>`${e} must be a { binding, namespace } object`},{arrayMessage:"mtls_certificates must be an array of { binding, certificate_id } entries",fields:[{field:"binding",message:e=>`${e} must have a non-empty "binding"`},{field:"certificate_id",message:e=>`${e} must have a non-empty "certificate_id" (upload via \`wrangler mtls-certificate upload\`)`}],key:"mtls_certificates",objectMessage:e=>`${e} must be a { binding, certificate_id } object`},{arrayMessage:"r2_buckets must be an array of { binding, bucket_name } entries",fields:[{field:"binding",message:e=>`${e} must have a non-empty "binding" naming the R2 bucket binding`},{field:"bucket_name",message:e=>`${e} must have a non-empty "bucket_name" naming the deployed bucket`}],key:"r2_buckets",objectMessage:e=>`${e} must be a { binding, bucket_name } object`}],Qe=(e,t,n)=>{t?.hasD1GlobalTable&&!g(e.d1_databases).some(s=>s.binding==="DB")&&n.push('schema declares .global() tables; d1_databases must include a binding named "DB" — your dev server auto-reconciles this on startup, or add the binding manually'),t?.hasHyperdriveGlobalTable&&g(e.hyperdrive).length===0&&n.push('schema declares .global({ backend: "hyperdrive" }) tables; wrangler must declare a hyperdrive binding for `.hyperdriveGlobal({ exec })` to read — run `wrangler hyperdrive create <name> --connection-string=...` and add `"hyperdrive": [{ "binding": "HYPERDRIVE", "id": "<id>" }]` (any binding name works; your `exec` selector picks it)')},Xe=(e,t)=>{const{d1_databases:n}=e;if(n!==void 0){if(!Array.isArray(n)){t.push("d1_databases must be an array of { binding, database_id | database_name } entries");return}for(const[s,i]of j(n).entries()){const a=`d1_databases[${String(s)}]`;if(!i||typeof i!="object"){t.push(`${a} must be a { binding, database_id | database_name } object`);continue}u(i.binding)||t.push(`${a} must have a non-empty "binding" naming the D1 binding`),!u(i.database_id)&&!u(i.database_name)&&t.push(`${a} must have a "database_id" or a "database_name" — run \`wrangler d1 create\` and set one, or the binding can't resolve`)}}},ze=(e,t,n)=>{const s=e.send_email;if(s===void 0)return;if(!Array.isArray(s)){t.push("send_email must be an array of { name, destination_address? } entries");return}const i=s;for(const[a,o]of i.entries())(!o||typeof o!="object"||typeof o.name!="string"||o.name.length===0)&&n.push(`send_email[${String(a)}] has no non-empty "name" naming the send-email binding — set one before deploying`)},Je=(e,t)=>{e.logpush!==void 0&&typeof e.logpush!="boolean"&&t.push('logpush must be a boolean (set "logpush": true to enable Cloudflare Logpush)')},L=3e5,Ze=(e,t)=>{const{limits:n}=e;if(n===void 0)return;if(typeof n!="object"||Array.isArray(n)){t.push('limits must be an object (e.g. { "cpu_ms": 30000 })');return}const s=n.cpu_ms;if(s!==void 0){if(typeof s!="number"||!Number.isFinite(s)||!Number.isInteger(s)||s<=0){t.push("limits.cpu_ms must be a positive integer number of milliseconds");return}s>L&&t.push(`limits.cpu_ms must be at most ${String(L)} (Cloudflare's per-invocation ceiling)`)}},U=new Set(["off","smart","targeted"]),et=(e,t)=>{const{placement:n}=e;if(n===void 0)return;if(typeof n!="object"||n===null||Array.isArray(n)){t.push('placement must be an object (e.g. { "mode": "smart" })');return}const{mode:s}=n;s!==void 0&&(typeof s!="string"||!U.has(s))&&t.push(`placement.mode must be one of ${[...U].map(i=>`"${i}"`).join(", ")}`)},tt=(e,t)=>{const{observability:n}=e;if(n===void 0)return;if(typeof n!="object"||Array.isArray(n)){t.push('observability must be an object (e.g. { "enabled": true, "head_sampling_rate": 1 })');return}const s=(i,a)=>{i!==void 0&&(typeof i!="number"||Number.isNaN(i)||i<0||i>1)&&t.push(`${a} must be a number in [0, 1] (the fraction of requests sampled)`)};s(n.head_sampling_rate,"observability.head_sampling_rate"),n.logs!==void 0&&(typeof n.logs!="object"||Array.isArray(n.logs)?t.push("observability.logs must be an object"):(s(n.logs.head_sampling_rate,"observability.logs.head_sampling_rate"),n.logs.invocation_logs!==void 0&&typeof n.logs.invocation_logs!="boolean"&&t.push('observability.logs.invocation_logs must be a boolean (set "invocation_logs": true to keep per-invocation summaries)')))},st=(e,t)=>{const{cache:n}=e;if(n!==void 0){if(typeof n!="object"||n===null||Array.isArray(n)){t.push('cache must be an object (e.g. { "enabled": true })');return}n.enabled!==void 0&&typeof n.enabled!="boolean"&&t.push("cache.enabled must be a boolean (true or false)")}},nt=(e,t)=>{const{exports:n}=e;if(n!==void 0){if(typeof n!="object"||n===null||Array.isArray(n)){t.push("exports must be an object keyed by entrypoint name");return}for(const[s,i]of Object.entries(n)){if(typeof i!="object"||i===null){t.push(`exports["${s}"] must be an object`);continue}i.type!==void 0&&typeof i.type!="string"&&t.push(`exports["${s}"].type must be a string`),i.cache!==void 0&&(typeof i.cache!="object"||i.cache===null||Array.isArray(i.cache)?t.push(`exports["${s}"].cache must be an object`):i.cache.enabled!==void 0&&typeof i.cache.enabled!="boolean"&&t.push(`exports["${s}"].cache.enabled must be a boolean`))}}},it=(e,t)=>{const{assets:n}=e;if(n!==void 0){if(typeof n!="object"||Array.isArray(n)){t.push('assets must be an object (e.g. { "directory": "./dist/client", "binding": "ASSETS" })');return}(typeof n.directory!="string"||n.directory.length===0)&&t.push('assets must declare a non-empty "directory" pointing at the built client output (e.g. "./dist/client")'),n.binding!==void 0&&(typeof n.binding!="string"||n.binding.length===0)&&t.push('assets.binding must be a non-empty string (e.g. "ASSETS")'),n.html_handling!==void 0&&typeof n.html_handling!="string"&&t.push("assets.html_handling must be a string"),n.not_found_handling!==void 0&&typeof n.not_found_handling!="string"&&t.push("assets.not_found_handling must be a string")}},at=(e,t)=>{const n=e.tail_consumers;if(n===void 0)return;if(!Array.isArray(n)){t.push("tail_consumers must be an array of { service, environment? } entries");return}const s=n;for(const[i,a]of s.entries())(!a||typeof a!="object"||typeof a.service!="string"||a.service.length===0)&&t.push(`tail_consumers[${String(i)}] must have a non-empty "service" naming the consumer Worker`)},At=(e,t)=>{const n=e.tail_consumers??[];return n.some(i=>!!i&&i?.service===t.service&&i?.environment===t.environment)?e:{...e,tail_consumers:[...n,t]}},ot=(e,t)=>{const{vars:n}=e;if(!n||typeof n!="object")return;const s=n.LUNORA_ALLOWED_ORIGINS,i=n.LUNORA_CORS_ALLOW_CREDENTIALS,a=typeof s=="string"&&s.split(",").some(r=>r.trim()==="*"),o=me(i);a&&o&&t.push('vars.LUNORA_ALLOWED_ORIGINS includes a "*" wildcard while vars.LUNORA_CORS_ALLOW_CREDENTIALS is on — browsers reject this combination and it defeats the allowlist; name explicit origins or drop credentials')},rt=e=>g(e.durable_objects?.bindings).some(t=>t.class_name==="SchedulerDO"&&t.script_name===void 0),v="LUNORA_ORIGIN_URL",ct=(e,t,n)=>{if(!rt(e)||u(e.vars?.[v]))return;const s=t===void 0?"vars":`env.${t}.vars`,i=t===void 0?"":` --env ${t}`;n.push(`durable_objects.bindings declares the SchedulerDO but ${s}.${v} is unset — the DO reads its dispatch origin from its own env and refuses to schedule without it, so every ctx.scheduler.runAfter/runAt fails with ORIGIN_NOT_CONFIGURED. Set ${s}.${v} to the worker's public URL, or \`wrangler secret put ${v}${i}\` (ignore this if it is already set as a secret or in the dashboard).`)},dt=(e,t,n)=>{const{error:s,merged:i,unverifiedKeys:a}=V(e,t);return s!==void 0?{error:s,wrangler:i}:(a.length>0&&n.push(`env.${String(t)} overrides ${a.join(", ")}, which this validator doesn't have a verified inheritance rule for — validated against the TOP-LEVEL value only. Double-check ${a.length===1?"it":"them"} by hand for "${String(t)}".`),{wrangler:i})},X=(e,t,n)=>{const s=[],i=[];if(!e||typeof e!="object")return s.push("wrangler config is not a valid object"),{errors:s,valid:!1,warnings:i};const{error:a,wrangler:o}=dt(e,n,i);if(a!==void 0)return s.push(a),{errors:s,valid:!1,warnings:i};g(o.durable_objects?.bindings).find(l=>l.name==="SHARD"&&l.class_name==="ShardDO")||s.push('durable_objects.bindings must include { "name": "SHARD", "class_name": "ShardDO" } — your dev server auto-reconciles this on startup, or add the binding manually'),Le(o,s);const d=o.compatibility_date??"";d&&!I.test(d)?s.push(`compatibility_date must be in YYYY-MM-DD format (got "${d}")`):d<M&&s.push(`compatibility_date must be >= "${M}" (got "${d||"<missing>"}")`),ce(o)&&I.test(d)&&d<k&&s.push(`cache.enabled requires compatibility_date >= "${k}" (got "${d||"<missing>"}")`),Qe(o,t,s),Xe(o,s),De(o,t?.vectorIndexNames??[],s),at(o,s),Ue(o,s,i),y(o.workflows,"workflows",Be,s),Pe(o,s),y(o.secrets_store_secrets,"secrets_store_secrets",qe,s);for(const l of Ge)Ke(o,l,s,i);for(const l of Ve)y(o[l.key],l.key,l,s);for(const l of Ye)He(o,l,s);return ze(o,s,i),Je(o,s),Ze(o,s),et(o,s),tt(o,s),it(o,s),st(o,s),nt(o,s),ot(o,s),ct(o,n,i),{errors:s,valid:s.length===0,warnings:i}},Rt=X,z=e=>Array.isArray(e)?e:[],lt=(e,t,n)=>{const s=[];for(const i of z(e)){const a=i?.image;typeof a!="string"||!(a.startsWith("./")||a.startsWith("../")||a.startsWith("/")||a.includes("Dockerfile"))||f(a.startsWith("/")?a:p(t,a))||s.push(`containers image "${a}" does not exist (resolved relative to ${n}); create the Dockerfile or point image at a registry reference`)}return s},ut=(e,t)=>{const n=e?.vectorIndexNames??[],s=[];if(n.length>0&&s.push({message:a=>`schema declares vector index(es) ${n.map(o=>`"${o}"`).join(", ")} but nothing chains .vectors(...) onto defineApp() (composed in: ${a}) — \`ctx.vectors\` is then a throwing stub and buildWorkerOptions rejects EVERY request, /_lunora/health included. Add \`.vectors((env) => ({ ${String(n[0])}: env.<BINDING> }))\` to the chain.`,method:"vectors"}),e?.hasD1GlobalTable&&s.push({message:a=>`schema declares .global() table(s) but nothing chains .global(...) onto defineApp() (composed in: ${a}) — the shard then has no global writer, so every read or write of a global table throws INTERNAL ("requires a globalDb writer"). Add \`.global({ d1: (env) => env.DB })\` to the chain.`,method:"global"}),e?.hasHyperdriveGlobalTable&&s.push({message:a=>`schema declares .global({ backend: "hyperdrive" }) table(s) but nothing chains .hyperdriveGlobal(...) onto defineApp() (composed in: ${a}) — the shard then has no global writer, so every read or write of those tables throws INTERNAL. Add \`.hyperdriveGlobal({ engine: "postgres", exec: (env) => buildPgExec(fromPostgresJs(postgres(env.HYPERDRIVE.connectionString))) })\` to the chain (\`buildPgExec\` from \`@lunora/hyperdrive/global\`, \`fromPostgresJs\` from \`@lunora/hyperdrive\`).`,method:"hyperdriveGlobal"}),s.length===0)return[];const i=Ne(t,new Set(s.map(a=>a.method)));return i===void 0?[]:s.filter(a=>!i.chained.has(a.method)).map(a=>a.message(i.site))},mt="does not export it",pt=(e,t)=>{if(t!=="composed")return`Re-export it from the module that defines it (\`export { ${e} } from "./…";\`), or add it to the app builder's own export (\`export const { ${e} } = app;\`).`;const n=`it exports ${F.join(", ")}, SchedulerDO when its binding is declared, and every class codegen emits from your ${P.map(s=>`${s}.ts`).join(" / ")} declarations`;return ae(e)?`\`@lunora/vite\` generates that entry — ${n}, and ${e} is not among them. Class-A composition does not carry ${e}, so drop the binding; a project that needs it has to own its worker entry (add \`src/worker.ts\`, which \`lunora deploy\` bundles in place of \`main\`, and compose \`defineApp()\` there).`:`\`@lunora/vite\` generates that entry, so there is no file to add a re-export to: ${n}. Declare "${e}" in one of those and re-run \`lunora codegen\`, or drop the binding.`},gt=(e,t)=>{const n=t.exports;if(n===void 0)return[];const s=[];for(const a of g(e.durable_objects?.bindings))typeof a.class_name=="string"&&a.class_name.length>0&&a.script_name===void 0&&s.push({className:a.class_name,label:"durable_objects.bindings"});for(const a of z(e.workflows))typeof a?.class_name=="string"&&a.class_name.length>0&&a.script_name===void 0&&s.push({className:a.class_name,label:"workflows"});return s.filter(a=>!n.has(a.className)).map(a=>`${a.label} declares class "${a.className}" but the ${t.kind==="composed"?"composed class-A worker entry":"worker entry"} (${t.path}) ${mt} — wrangler refuses to bundle a Worker whose ${a.label==="workflows"?"Workflow":"Durable Object"} classes are not exported. ${pt(a.className,t.kind)}`)},ft=e=>e?.origin!=="absent"?[]:[`main is set but no readable file is there (looked in ${e.path}) — wrangler cannot resolve the worker entry, so a deploy will fail there. Point main at the entry that composes your app, or remove it to fall back to the conventional locations.`],wt=e=>{const t=e.schemaDir??"lunora",n=de(e.projectRoot);if(!n){const b=`wrangler.jsonc not found in ${e.projectRoot}; create one declaring at least the SHARD durable object binding.`;return{problems:[b],report:{errors:[b],valid:!1,warnings:[]},wranglerPath:void 0}}const{parsed:s}=le(n);if(s===void 0){const b=`failed to parse ${n} as JSONC.`;return{problems:[b],report:{errors:[b],valid:!1,warnings:[]},wranglerPath:n}}const{error:i,merged:a}=V(s,e.environment);if(i!==void 0)return{problems:[i],report:{errors:[i],valid:!1,warnings:[]},wranglerPath:n};const{error:o,info:r}=oe(e.projectRoot,t),c=X(s,r,e.environment);o!==void 0&&c.warnings.push(`schema parse failed in ${t}/schema.ts: ${o}`);const d=R(n),l=fe(a.main,e.projectRoot,n),O=_e(l,e.projectRoot,t);c.errors.push(...lt(a.containers??[],d,n)),c.warnings.push(...ft(l)),O!==void 0&&c.errors.push(...gt(a,O)),c.errors.push(...ut(r,e.projectRoot));const h=a.assets?.directory;if(typeof h=="string"&&h.length>0){const b=h.startsWith("/")?h:p(d,h);f(b)||c.warnings.push(`assets.directory "${h}" does not exist yet — it is created by the client build; run the build before deploy`)}return c.valid=c.errors.length===0,{problems:c.errors,report:c,wranglerPath:n}};export{M as REQUIRED_COMPATIBILITY_DATE,St as REQUIRED_FLAG,mt as UNEXPORTED_CLASS_MARKER,V as mergeWranglerEnvironment,g as objectBindingEntries,_ as stringEntries,Rt as validateWrangler,X as validateWranglerConfig,wt as validateWranglerProject,At as withTailConsumer};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{spawnSync as o}from"node:child_process";import{LunoraError as s}from"@lunora/errors";import{findPackageManagerSync as i,identifyInitiatingPackageManager as c}from"@visulima/package/package-manager";const a=["pnpm","bun","yarn","npm"],u=new Set(a),d=n=>u.has(n),m=n=>{try{return o(n,["--version"],{shell:process.platform==="win32",stdio:"ignore",timeout:5e3}).status===0}catch{return!1}},p=(n=m)=>a.filter(r=>n(r)),A=n=>({args:["install"],command:n}),y=(n,r,t={})=>{const e=t.dev===!0;return n==="npm"?{args:["install",...e?["--save-dev"]:[],...r],command:"npm"}:n==="bun"?{args:["add",...e?["-d"]:[],...r],command:"bun"}:{args:["add",...e?["-D"]:[],...r],command:n}},M=n=>{try{return i(n).packageManager}catch{}const r=c();if(r!==void 0){const e=r.name==="cnpm"?"npm":r.name;if(d(e))return e}const[t]=p();if(t!==void 0)return t;throw new s("INTERNAL","Could not detect a package manager: no lock file or `packageManager` field was found, and none (pnpm, bun, yarn, npm) is installed on PATH.")},b=(n,r,t)=>n==="yarn"?{args:[r,...t],command:"yarn"}:n==="bun"?{args:["x",r,...t],command:"bun"}:n==="npm"?{args:["--",r,...t],command:"npx"}:{args:["exec",r,...t],command:"pnpm"},E=(n,r)=>({args:["run",r],command:n}),v=(n,r)=>n==="npm"?`npm run ${r}`:n==="bun"?`bun run ${r}`:`${n} ${r}`;export{y as addArgsFor,p as detectInstalledManagers,M as detectPackageManager,b as execArgsFor,A as installArgsFor,E as runScriptArgsFor,v as runScriptCommand};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{writeFileSync as T,readFileSync as R}from"node:fs";import{join as M}from"node:path";import{containerBuildTag as W}from"@lunora/container";import{parseTree as L,findNodeAtLocation as Q}from"jsonc-parser";import{DEV_VARS_FILE as K,parseDevVariableEntries as U}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{a as x}from"./jsonc-edit-BZgQIdAH.mjs";import{r as Y,a as F}from"./lunora-manifest-V77OcyFC.mjs";import{findWranglerFile as G,readWranglerJsonc as H}from"./WRANGLER_FILES-UNW-xY5u.mjs";import{objectBindingEntries as q,stringEntries as E}from"./REQUIRED_COMPATIBILITY_DATE-SdRHaUwh.mjs";const I="<replace-with-d1-create-id>",J=e=>[["container","containers",e.containers],["workflow","workflows",e.workflows],["agent","agents",e.agents]].flatMap(([s,t,a])=>a.filter(o=>!o.exported).map(({className:o,exportName:c})=>({className:o,exportName:c,kind:s,module:t}))),k="PIPELINES",V=(e,n)=>{const s=e.flagshipBinding!==void 0&&!(n?.flagship??[]).some(o=>o.binding===e.flagshipBinding),t=e.usesPipelines&&!(n?.pipelines??[]).some(o=>o.binding===k);return[[e.usesKv&&(n?.kv_namespaces?.length??0)===0,"@lunora/bindings/kv is used but no kv_namespaces binding exists; add a kv_namespaces entry ({ binding, id }) and pass env.<BINDING> to createKv() — the namespace id can't be auto-provisioned."],[e.usesHyperdrive&&(n?.hyperdrive?.length??0)===0,"@lunora/hyperdrive is used but no hyperdrive binding exists; run 'wrangler hyperdrive create' and add a 'hyperdrive' binding ({ binding, id }) — the id can't be auto-provisioned."],[t,`ctx.pipelines is used but no "${k}" pipelines binding exists; run 'wrangler pipelines create <name>' and add a 'pipelines' binding ({ binding: "${k}", pipeline }) — codegen resolves this one name, and the pipeline resource can't be auto-provisioned.`],[s,`lunora/flags.ts uses Flagship in binding mode but no flagship binding "${e.flagshipBinding??""}" exists; add a flagship entry ({ binding: "${e.flagshipBinding??""}", app_id }) — the app_id can't be auto-provisioned.`]].filter(([o])=>o).map(([,o])=>o)},z=e=>[[e.usesX402Charge,"@lunora/x402/charge is used; set the recipient wallet address as a [vars] entry (the var name is your choice) and pass it to the charge config — the x402 facilitator settles USDC to that address."],[e.usesX402Pay,"@lunora/x402/pay is used (ActionCtx-only, spends real funds); add a secrets_store_secrets[] binding holding the agent wallet key (binding name == signer.secretName) and pair the pay rail with a spend policy — ctx.secrets reads a Secrets Store binding, not .dev.vars."]].filter(([s])=>s).map(([,s])=>s),N=(e,n,s)=>s.filter(t=>!t.exported).map(t=>`${e} "${t.exportName}" is declared but ${t.className} is not exported by the worker entry; add \`export * from "./lunora/_generated/${n}"\` so its binding can be provisioned.`),X=(e,n)=>{const s=new Set([...e.workflows,...e.agents].map(t=>t.className));return s.size===0?[]:(n.workflows??[]).flatMap(t=>{const a=t.class_name;return a===void 0||s.has(a)?[]:[`wrangler.jsonc declares workflows[] entry "${a}" but no defineWorkflow/defineAgent export generates that class — a leftover from a rename will fail the deploy (wrangler rejects a class_name the worker does not export). Remove it if it is not hand-wired.`]})},Z=(e,n)=>{if(e.queues.length===0)return[];const s=new Set(e.queues.map(a=>a.name)),t=new Set(e.queues.map(a=>a.bindingName));return[...(n.queues?.consumers??[]).flatMap(a=>{const{queue:o}=a;return o===void 0||s.has(o)?[]:[`wrangler.jsonc subscribes queues.consumers[] to "${o}" but no defineQueue export declares that queue — a leftover from a rename keeps delivering batches this worker has no handler for (they retry to exhaustion, then drop or dead-letter). Remove it if it is not hand-wired.`]}),...(n.queues?.producers??[]).flatMap(a=>{const{binding:o}=a;return o===void 0||t.has(o)?[]:[`wrangler.jsonc declares queues.producers[] binding "${o}" but no defineQueue export declares it — a leftover from a rename. Remove it if it is not hand-wired.`]})]},ee=(e,n)=>[...X(e,n),...Z(e,n)],j=[{keys:["STRIPE_SECRET_KEY","STRIPE_WEBHOOK_SECRET"],label:"Stripe"},{keys:["POLAR_ACCESS_TOKEN","POLAR_WEBHOOK_SECRET"],label:"Polar"},{keys:["CREEM_API_KEY","CREEM_WEBHOOK_SECRET"],label:"Creem"},{keys:["AUTUMN_SECRET_KEY","AUTUMN_WEBHOOK_SECRET"],label:"Autumn"},{keys:["DODO_PAYMENTS_API_KEY","DODO_PAYMENTS_WEBHOOK_KEY"],label:"Dodo Payments"}],ne=()=>j.map(({keys:e,label:n})=>`${e[0]} + ${e[1]} (${n})`).join(" or "),se=e=>{let n;try{n=R(M(e,K),"utf8")}catch{return!1}const s=new Map(U(n).map(t=>[t.key,t.value]));return j.some(({keys:t})=>t.every(a=>(s.get(a)??"")!==""))},O=(e,n,s)=>{const t=new Set(e.durableObjects.map(d=>d.className)),a=[],o=(s?.r2_buckets?.length??0)>0,c=(s?.d1_databases?.some(d=>d.binding==="DB")??!1)||e.needsD1;return e.usesStorage&&!o&&a.push("@lunora/storage is used but R2 bucket bindings have user-defined names; add an r2_buckets entry and pass env.<BINDING> to createStorage()."),e.usesAuth&&!t.has("SessionDO")&&!c&&a.push("@lunora/auth is used but the worker entry exports no SessionDO; sessions are D1-backed, or export SessionDO to enable DO-backed sessions."),e.usesScheduler&&!t.has("SchedulerDO")&&a.push("@lunora/scheduler is used but the worker entry exports no SchedulerDO; export it so the SCHEDULER binding can be provisioned."),a.push(...N("container","containers",e.containers),...N("workflow","workflows",e.workflows),...N("agent","agents",e.agents)),e.containers.length>0&&s?.observability?.enabled===!1&&a.push("containers are declared but observability is explicitly disabled in wrangler.jsonc — container logs will not be captured."),e.usesPayment&&!se(n)&&a.push(`@lunora/payment is used; set one provider's secret pair in .dev.vars — ${ne()}.`),a.push(...z(e),...V(e,s)),s!==void 0&&a.push(...ee(e,s)),a},te=e=>{const n=new Set(q(e).map(t=>t.tag));let s=1;for(;n.has(`v${String(s)}`);)s+=1;return`v${String(s)}`},oe=e=>{const n=new Set;for(const s of q(e)){for(const t of E(s.deleted_classes))n.delete(t);for(const{from:t,to:a}of q(s.renamed_classes))t!==void 0&&n.delete(t),a!==void 0&&n.add(a);for(const t of[...E(s.new_classes),...E(s.new_sqlite_classes)])n.add(t)}return n},ae=(e,n,s)=>{const t=n.durable_objects?.bindings??[],a=new Set(t.map(l=>l.name)),o=s.filter(l=>!a.has(l.binding));let c=e;const d=[];if(o.length>0){const l=[...t,...o.map(b=>({class_name:b.className,name:b.binding}))];c=x(c,["durable_objects","bindings"],l),d.push(...o.map(b=>`${b.binding}/${b.className}`))}const p=n.migrations??[],r=s.map(l=>l.className).filter(l=>!oe(p).has(l));if(r.length>0){const l=[...p,{new_sqlite_classes:r,tag:te(p)}];c=x(c,["migrations"],l)}return{added:d,text:c}},ie=(e,n)=>{const s=n.d1_databases??[];if(s.some(o=>o.binding==="DB"))return{added:[],text:e};const t=typeof n.name=="string"&&n.name.length>0?n.name:"lunora",a=[...s,{binding:"DB",database_id:I,database_name:t}];return{added:["DB (D1)"],text:x(e,["d1_databases"],a)}},$=(e,n,s,t,a)=>{const o=n[s]?.binding;return typeof o=="string"&&o.length>0?{added:[],text:e}:{added:[a],text:x(e,[s],{binding:t})}},re=(e,n)=>(n.analytics_engine_datasets?.length??0)>0?{added:[],text:e}:{added:["ANALYTICS (Analytics Engine)"],text:x(e,["analytics_engine_datasets"],[{binding:"ANALYTICS",dataset:"ANALYTICS"}])},de=e=>{if(typeof e=="string")return e;const n={};return e.diskMb!==void 0&&(n.disk_mb=e.diskMb),e.memoryMib!==void 0&&(n.memory_mib=e.memoryMib),e.vcpu!==void 0&&(n.vcpu=e.vcpu),n},ce=e=>e.image.kind==="dockerfile"?e.image.dockerfilePath:e.image.kind==="registry"?e.image.reference:W(e.exportName),ue=e=>{const n={class_name:e.className,image:ce(e)};return e.image.kind==="dockerfile"&&(n.image_build_context=e.image.buildContext),e.buildArgs!==void 0&&e.image.kind!=="registry"&&(n.image_vars=e.buildArgs),e.instanceType!==void 0&&(n.instance_type=de(e.instanceType)),e.maxInstances!==void 0&&(n.max_instances=e.maxInstances),e.name!==void 0&&(n.name=e.name),e.rollout?.stepPercentage!==void 0&&(n.rollout_step_percentage=e.rollout.stepPercentage),e.rollout?.gracePeriodSeconds!==void 0&&(n.rollout_active_grace_period=e.rollout.gracePeriodSeconds),n},le=(e,n,s)=>{const t=n.containers??[],a=new Set(t.map(d=>d.class_name)),o=s.filter(d=>!a.has(d.className));if(o.length===0)return{added:[],text:e};const c=x(e,["containers"],[...t,...o.map(d=>ue(d))]);return{added:o.map(d=>`containers/${d.className}`),text:c}},ge=(e,n)=>{if(n.observability!==void 0)return{added:[],text:e};const s=x(e,["observability"],{enabled:!0,head_sampling_rate:1});return{added:["observability"],text:s}},B=e=>({binding:e.bindingName,class_name:e.className,name:e.name}),me=(e,n,s,t=[])=>{const a=n.workflows??[],o=new Set(a.map(r=>r.class_name)),c=s.filter(r=>!o.has(r.className)),d=t.filter(r=>!o.has(r.className));if(c.length===0&&d.length===0)return{added:[],text:e};const p=x(e,["workflows"],[...a,...c.map(r=>B(r)),...d.map(r=>B(r))]);return{added:[...c.map(r=>`workflows/${r.className}`),...d.map(r=>`workflows/${r.className}`)],text:p}},pe=[["maxBatchSize","max_batch_size"],["maxBatchTimeout","max_batch_timeout"],["maxRetries","max_retries"],["deadLetterQueue","dead_letter_queue"],["retryDelay","retry_delay"]],D=e=>Object.fromEntries(pe.filter(([n])=>e.tuning[n]!==void 0).map(([n,s])=>[s,e.tuning[n]])),A="queueTuning",be=/^[\t ]*(?:,[\t ]*)?(?:\/\/[^\n\r]*)?\r?\n/u,he=/^[\t ]*,/u,fe=(e,n)=>{const s=L(e),t=s===void 0?void 0:Q(s,[...n])?.parent;if(t?.type==="property"){const a=t.offset+t.length,o=e.lastIndexOf(`
|
|
2
|
-
`,t.offset-1)+1,c=be.exec(e.slice(a));if(c!==null&&e.slice(o,t.offset).trim()===""){const d=t.parent?.children??[],p=d.indexOf(t),r=p===d.length-1&&p>0?d[p-1]:void 0,l=r===void 0?void 0:he.exec(e.slice(r.offset+r.length))??void 0;return(l===void 0||r===void 0?e.slice(0,o):e.slice(0,r.offset+r.length)+e.slice(r.offset+r.length+l[0].length,o))+e.slice(a+c[0].length)}}return x(e,n,void 0)},P=(e,n,s,t,a,o=new Set)=>{const c=s.join("."),d={},p=[],r=[];let l=e;return{entries:n.map((u,f)=>{const g=t(u);if(g===void 0||u.queue===void 0)return u;const v=Object.fromEntries(Object.entries(D(g)).filter(([m])=>!o.has(m))),w=Object.entries(a[u.queue]??{}).filter(([m])=>!Object.hasOwn(v,m)),_=Object.entries(v).filter(([m,i])=>u[m]!==i),y=w.filter(([m,i])=>u[m]===i).map(([m])=>m),S=Object.fromEntries(Object.entries({...u,...v}).filter(([m])=>!y.includes(m)));for(const[m,i]of _)l=x(l,[...s,f,m],i);for(const m of y)l=fe(l,[...s,f,m]);for(const[m,i]of w){const h=u[m];h!==void 0&&h!==i&&r.push(`${c}/${u.queue}: ${m} is no longer declared by defineQueue, but it was changed by hand to ${JSON.stringify(h)} from the declared ${JSON.stringify(i)}, so it was kept. Delete it from wrangler.jsonc if it should go.`)}return(_.length>0||y.length>0)&&p.push(`${c}/${u.queue} (${[..._.map(([m])=>m),...y.map(m=>`removed ${m}`)].join(", ")})`),Object.keys(v).length>0&&(d[u.queue]=v),S}),owned:d,text:l,updated:p,warnings:r}},ve=(e,n,s,t)=>{const a=n.queues??{},o=a.producers??[],c=a.consumers??[],d=new Set(o.map(g=>g.binding)),p=new Set(c.map(g=>g.queue)),r=s.filter(g=>!d.has(g.bindingName)),l=s.filter(g=>!p.has(g.name)),b=P(e,c,["queues","consumers"],g=>s.find(v=>v.name===g.queue),t);let u=b.text;const f={...b.owned};if(r.length>0||l.length>0){const g=[...o,...r.map(w=>({binding:w.bindingName,queue:w.name}))],v=[...b.entries,...l.map(w=>({queue:w.name,...w.mode==="pull"?{type:"http_pull"}:{},...D(w)}))];for(const w of l){const _=D(w);Object.keys(_).length>0&&(f[w.name]=_)}u=x(u,["queues"],{consumers:v,producers:g})}return{added:[...r.map(g=>`queues.producers/${g.bindingName}`),...l.map(g=>`queues.consumers/${g.name}`)],owned:f,text:u,updated:b.updated,warnings:b.warnings}},we=(e,n,s,t,a)=>{const o=n.env?.[t],c=o?.queues?.consumers??[],d=o?.queues?.producers??[],p=u=>{const f=d.find(g=>g.queue===u.queue)?.binding;return f!==void 0?s.find(g=>g.bindingName===f):s.find(g=>g.name===u.queue&&!d.some(v=>v.binding===g.bindingName))},r=P(e,c,["env",t,"queues","consumers"],p,a,new Set(["dead_letter_queue"])),l=c.filter(u=>u.queue!==void 0&&p(u)===void 0).map(u=>`env.${t}.queues.consumers/${String(u.queue)}: no defineQueue export matches it — this block declares no producer mapping one of their bindings to "${String(u.queue)}", and no export is named that — so it was not retuned. A consumer for a queue another worker produces is skipped the same way.`),b=c.flatMap(u=>{const f=p(u)?.tuning.deadLetterQueue;return f===void 0||u.dead_letter_queue!==void 0?[]:[`env.${t}.queues.consumers/${String(u.queue)}: defineQueue declares deadLetterQueue "${f}", but this consumer has no dead_letter_queue, so its exhausted messages are dropped. Queue names differ per environment, so reconcile does not write it here; add it by hand.`]});return{added:[],owned:r.owned,text:r.text,updated:r.updated,warnings:[...r.warnings,...b,...l]}},_e=(e,n)=>{if(e?.lunoraIsForeign===!0)return n.push(`${e.path}: \`lunora\` is not an object, so the queue tuning ownership record cannot be read or written — an option removed from defineQueue stays deployed.`),{};const s=e?.lunora?.[A],t=a=>typeof a=="object"&&a!==null&&!Array.isArray(a);return s===void 0?{}:!t(s)||!Object.values(s).every(a=>t(a)&&Object.values(a).every(o=>t(o)))?(n.push(`${e?.path??"package.json"}: \`lunora.${A}\` is not a map of scope → queue → fields, so it is ignored — an option removed from defineQueue stays deployed until the next pass records it again.`),{}):s},xe=(e,n,s)=>{const t=Object.fromEntries(Object.entries({...n,...s}).filter(([,a])=>Object.keys(a).length>0));F(e,A,Object.keys(t).length===0?void 0:t)},Ae=(e,n,s)=>{const t=G(e),a=J(n);if(!t)return{added:[],changed:!1,exportGaps:a,reason:"wrangler.jsonc not found",updated:[],warnings:O(n,e)};const{parsed:o,text:c}=H(t);if(o===void 0)return{added:[],changed:!1,exportGaps:a,reason:`failed to parse ${t} as JSONC`,updated:[],warnings:O(n,e),wranglerPath:t};const d=O(n,e,o);if(s!==void 0){const i=o.env?.[s]!==void 0;d.push(i?`auto-provisioned bindings are written to the top level of wrangler.jsonc only (queue consumers "env.${s}" already declares are retuned, nothing is added) — "env.${s}" has its own (non-inheritable) bindings and must be reconciled by hand; \`lunora deploy --env ${s}\` now validates them, so a gap here will be reported at deploy time.`:`--env "${s}" was requested but wrangler.jsonc declares no "env.${s}" block — auto-provisioned bindings are written to the top level only and will not apply to that environment.`)}const p=n.containers.filter(i=>i.exported),r=n.agents.filter(i=>i.exported&&i.voice===!0&&i.voiceBindingName!==void 0&&i.voiceClassName!==void 0),l=[...n.durableObjects,...p.map(i=>({binding:i.bindingName,className:i.className})),...r.map(i=>({binding:i.voiceBindingName,className:i.voiceClassName}))],b=n.workflows.filter(i=>i.exported),u=n.agents.filter(i=>i.exported),f=Y(e),g=_e(f,d),v={},w=[{enabled:!0,run:i=>ae(i,o,l)},{enabled:n.needsD1,run:i=>ie(i,o)},{enabled:n.usesAi,run:i=>$(i,o,"ai","AI","AI (Workers AI)")},{enabled:n.usesBrowser,run:i=>$(i,o,"browser","BROWSER","BROWSER (Browser Rendering)")},{enabled:n.usesImages,run:i=>$(i,o,"images","IMAGES","IMAGES (Cloudflare Images)")},{enabled:n.usesAnalytics,run:i=>re(i,o)},{enabled:!0,run:i=>ge(i,o)},{enabled:p.length>0,run:i=>le(i,o,p)},{enabled:b.length>0||u.length>0,run:i=>me(i,o,b,u)},{enabled:n.queues.length>0,run:i=>{const h=ve(i,o,n.queues,g.queues??{});return v.queues=h.owned,h}},...s===void 0||o.env?.[s]===void 0?[]:[{enabled:n.queues.length>0,run:i=>{const h=`env.${s}.queues`,C=we(i,o,n.queues,s,g[h]??{});return v[h]=C.owned,C}}]];let _=c;const y=[],S=[];for(const i of w){if(!i.enabled)continue;const h=i.run(_);_=h.text,y.push(...h.added),S.push(...h.updated??[]),d.push(...h.warnings??[])}const m=i=>{if(!(f===void 0||Object.keys(v).length===0))try{xe(f,g,v)}catch(h){d.push(`${i?"wrangler.jsonc was updated, but ":""}recording the queue tuning reconcile owns in ${f.path} (lunora.queueTuning) failed: ${h instanceof Error?h.message:String(h)}. Until it is recorded, an option removed from defineQueue stays deployed.`)}};return y.includes("DB (D1)")&&d.push(`wrote a DB binding with a placeholder database_id ("${I}") — run \`wrangler d1 create <name>\` and replace it before deploying.`),_===c?(m(!1),{added:[],changed:!1,exportGaps:a,reason:"bindings already in sync",updated:[],warnings:d,wranglerPath:t}):(T(t,_,"utf8"),m(!0),{added:y,changed:!0,exportGaps:a,updated:S,warnings:d,wranglerPath:t})};export{J as collectExportGaps,Ae as reconcileWranglerBindings};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{inferLunoraBindings as d}from"./COMPOSED_WORKER_ENTRY-Bj793dir.mjs";import{LUNORA_TAG as r}from"./LUNORA_TAG-CiQM3BkI.mjs";import{reconcileWranglerBindings as f}from"./collectExportGaps-BJw9LdRV.mjs";import{reconcileWranglerCompatibilityDate as p}from"./reconcileWranglerCompatibilityDate-7OO_xaKR.mjs";import{reconcileWranglerCrons as g,describePreservedCrons as $}from"./describePreservedCrons-Ci5r2aph.mjs";const b=async(i,a,t)=>{try{const n=await d({projectRoot:i.projectRoot,schemaDir:i.schemaDir}),e=f(i.projectRoot,n),o=e.wranglerPath??"wrangler.jsonc";e.added.length>0&&a.info?.(`${r} inferred bindings → ${e.added.join(", ")} (written to ${o})`),e.updated.length>0&&a.info?.(`${r} updated bindings → ${e.updated.join(", ")} (written to ${o})`);for(const s of e.warnings)a.warn(`${r} ${s}`);e.exportGaps.length>0&&t?.(e.exportGaps)}catch(n){const e=n instanceof Error?n.message:String(n);a.warn(`${r} binding inference skipped: ${e}`)}},c=new Map,j=(i,a,t)=>{try{const n=g(i,a);n.changed&&t.info?.(`${r} synced ${a.length.toFixed(0)} cron trigger(s) into ${n.wranglerPath??"wrangler.jsonc"}`);for(const s of n.warnings)t.warn(`${r} ${s}`);const e=n.preserved.join("\0"),o=$(n.preserved);o!==void 0&&(n.changed||c.get(i)!==e)&&t.info?.(`${r} ${o}`),c.set(i,e)}catch(n){const e=n instanceof Error?n.message:String(n);t.warn(`${r} cron trigger sync skipped: ${e}`)}try{const n=p(i);n.changed&&t.info?.(`${r} bumped compatibility_date to ${n.date??"unknown"} (Workers Cache enabled) → ${n.wranglerPath??"wrangler.jsonc"}`)}catch(n){const e=n instanceof Error?n.message:String(n);t.warn(`${r} compatibility date sync skipped: ${e}`)}};export{b as reconcileBindingsSafely,j as reconcileWranglerExtras};
|