@lunora/codegen 1.0.0-alpha.236 → 1.0.0-alpha.238

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.
Files changed (32) hide show
  1. package/dist/index.d.mts +120 -117
  2. package/dist/index.d.ts +120 -117
  3. package/dist/index.mjs +1 -1
  4. package/dist/packem_shared/DEFAULT_TARGET-DCpDuuUM.mjs +1 -0
  5. package/dist/packem_shared/GENERATED_HEADER-DSXl0YM2.mjs +1 -0
  6. package/dist/packem_shared/OPENRPC_VERSION-Cl6P9WGv.mjs +3 -0
  7. package/dist/packem_shared/SCHEMA_SNAPSHOT_FILENAME-Dj0pT9D6.mjs +9 -0
  8. package/dist/packem_shared/buildOpenApiDocument-nYvBhjxu.mjs +3 -0
  9. package/dist/packem_shared/capabilities-DJJWVEtk.mjs +18 -0
  10. package/dist/packem_shared/discoverSandboxUsage-CrjZ6yNg.mjs +1 -0
  11. package/dist/packem_shared/emitAgents-BPFw6ww2.mjs +1 -0
  12. package/dist/packem_shared/emitApi-CJ9ziZnP.mjs +154 -0
  13. package/dist/packem_shared/{emitApp-CTLwFZHO.mjs → emitApp-BGhO5bhT.mjs} +3 -3
  14. package/dist/packem_shared/emitCrons-mkwWkn0R.mjs +69 -0
  15. package/dist/packem_shared/emitDataModel-D3WuEZ4b.mjs +113 -0
  16. package/dist/packem_shared/emitDrizzleSchema-Cv0HtLR3.mjs +15 -0
  17. package/dist/packem_shared/emitFunctions-BqAz1ssY.mjs +249 -0
  18. package/dist/packem_shared/emitServer-BEo_fCY8.mjs +365 -0
  19. package/dist/packem_shared/emitShard-Bu7EKdou.mjs +1 -0
  20. package/dist/packem_shared/json-data-Chfs2Cz5.mjs +1 -0
  21. package/dist/packem_shared/qualifiers-BhOL15WZ.mjs +1 -0
  22. package/dist/packem_shared/shard-B3LMNjIg.mjs +1435 -0
  23. package/dist/packem_shared/shard-runtime-B_ppYvOf.mjs +323 -0
  24. package/dist/packem_shared/shared-DjUziztz.mjs +9 -0
  25. package/package.json +6 -6
  26. package/dist/packem_shared/DEFAULT_TARGET-kmm2i4Fw.mjs +0 -1
  27. package/dist/packem_shared/GENERATED_HEADER-Da0OC3EI.mjs +0 -1
  28. package/dist/packem_shared/OPENRPC_VERSION-CL0VnCPW.mjs +0 -3
  29. package/dist/packem_shared/SCHEMA_SNAPSHOT_FILENAME-BtMVx-4j.mjs +0 -9
  30. package/dist/packem_shared/buildOpenApiDocument-C7S5wJCl.mjs +0 -3
  31. package/dist/packem_shared/discoverSandboxUsage-CgmfgDTS.mjs +0 -1
  32. package/dist/packem_shared/emit-DUpkZ68h.mjs +0 -2696
package/dist/index.d.mts CHANGED
@@ -3,10 +3,10 @@ export type { Finding } from '@lunora/advisor';
3
3
  import { Project, Node } from 'ts-morph';
4
4
  import { LunoraError } from '@lunora/errors';
5
5
  export { MESSAGE_SOLUTIONS as LUNORA_SOLUTION_RULES, type Solution as LunoraSolution, type SolutionRule as LunoraSolutionRule, findSolutionByMessage as findLunoraSolution } from '@lunora/errors';
6
- import { StudioFeaturesResult } from '@lunora/shard-engine';
7
6
  import { Schema } from '@lunora/server';
8
7
  import { JsonSchema } from '@lunora/values';
9
8
  import { LanguageName } from 'quicktype-core';
9
+ import { StudioFeaturesResult } from '@lunora/shard-engine';
10
10
  /** Current snapshot format version. Bumped if the structural shape below changes. */
11
11
  declare const SCHEMA_SNAPSHOT_VERSION: 1;
12
12
  /**
@@ -3019,7 +3019,8 @@ declare const discoverRlsMetadata: (project: Project, lunoraDirectory: string) =
3019
3019
  * `ls`/`read`/`write`/`rm`/`stat` died on FUNCTION_NOT_FOUND) and provisioning
3020
3020
  * the `BROWSER` wrangler binding (`browserTool` only — the browser op runs on
3021
3021
  * `ctx.browser` inside the dispatcher, while `fsTool` reads a hand-declared R2
3022
- * bucket).
3022
+ * bucket). `jsCodeTool` is the exception: it calls the `LOADER` binding off the
3023
+ * tool's own env, so it needs no dispatcher — only the `workerLoaders` gate.
3023
3024
  */
3024
3025
  interface SandboxUsage {
3025
3026
  /** `import { browserTool } from "@lunora/agent"` (or `/sandbox`) appears in `lunora/`. */
@@ -3028,6 +3029,8 @@ interface SandboxUsage {
3028
3029
  usesSandboxContainer: boolean;
3029
3030
  /** `import { fsTool } from "@lunora/agent"` (or `/sandbox`) appears in `lunora/`. */
3030
3031
  usesSandboxFs: boolean;
3032
+ /** `import { jsCodeTool } from "@lunora/agent"` (or `/sandbox`) appears in `lunora/`. */
3033
+ usesSandboxLoader: boolean;
3031
3034
  }
3032
3035
  /**
3033
3036
  * Scan the `lunora/` source set for named imports of the sandbox tools
@@ -3068,9 +3071,6 @@ declare const WORKFLOWS_FILENAME = "workflows.ts";
3068
3071
  * body is runtime-only, so codegen never evaluates it.
3069
3072
  */
3070
3073
  declare const discoverWorkflows: (project: Project, lunoraDirectory: string) => WorkflowIR[];
3071
- declare const GENERATED_HEADER = "// GENERATED by @lunora/codegen — do not edit.\n// Run `lunora codegen` to regenerate.\n\n";
3072
- /** Emit `_generated/dataModel.ts` — `Doc<"name">` + `Id<"name">` for every table. */
3073
- declare const emitDataModel: (schema: SchemaIR) => string;
3074
3074
  /**
3075
3075
  * Emit `_generated/api.ts` — the typed `api.*` registry (public functions), the
3076
3076
  * `internal.*` registry, and (when the project declares them) the typed
@@ -3122,6 +3122,98 @@ declare const emitApi: (options: EmitApiOptions) => string;
3122
3122
  * is remapped to `lunorash/client`.
3123
3123
  */
3124
3124
  declare const emitCollections: (shapes: ReadonlyArray<ShapeIR>, hasDatabase: boolean, useUmbrella?: boolean) => string;
3125
+ /** Emit `_generated/dataModel.ts` — `Doc<"name">` + `Id<"name">` for every table. */
3126
+ declare const emitDataModel: (schema: SchemaIR) => string;
3127
+ /**
3128
+ * Emit drizzle `sqliteTable` definitions for the project schema, split into
3129
+ * `global` (D1-backed) and `shard` (DO-SQLite-backed) buckets. Tables marked
3130
+ * `.global()` go in the global file; everything else (default root + `.shardBy()`)
3131
+ * goes in the shard file.
3132
+ *
3133
+ * `searchIndexes` are intentionally not emitted — drizzle has no `sqliteTable`
3134
+ * abstraction for FTS5 virtual tables. FTS plumbing is handled by the runtime
3135
+ * outside of drizzle.
3136
+ */
3137
+ declare const emitDrizzleSchema: (schema: SchemaIR, useUmbrella?: boolean) => {
3138
+ global: string;
3139
+ shard: string;
3140
+ };
3141
+ interface EmitFunctionsOptions {
3142
+ agents?: ReadonlyArray<AgentIR>;
3143
+ functions: ReadonlyArray<FunctionIR>;
3144
+ migrations?: ReadonlyArray<MigrationIR>;
3145
+ mutators?: ReadonlyArray<MutatorIR>;
3146
+ shapes?: ReadonlyArray<ShapeIR>;
3147
+ /** Import of a sandbox tool (`browserTool`/`containerTool`) auto-registers the `sandbox:invoke` action. */
3148
+ usesSandbox?: boolean;
3149
+ useUmbrella?: boolean;
3150
+ }
3151
+ declare const emitFunctions: (options: EmitFunctionsOptions) => string;
3152
+ /**
3153
+ * Emit `_generated/crons.ts` from the discovered cron jobs.
3154
+ *
3155
+ * `LUNORA_CRON_TRIGGERS` is the deduplicated schedule array — what lands in
3156
+ * wrangler's `triggers.crons` (the vite plugin reconciles it into
3157
+ * `wrangler.jsonc`, and {@link emitWranglerCronTriggers} renders the same list
3158
+ * for the CLI / docs).
3159
+ *
3160
+ * `LUNORA_CRONS` is the dispatcher map keyed by cron expression, each value a
3161
+ * list of `{ name, functionPath, args }`. Cloudflare's `scheduled()` handler
3162
+ * receives only the cron string, so multiple jobs sharing one expression must
3163
+ * all fire — hence a list per key rather than a single entry.
3164
+ *
3165
+ * Jobs arrive pre-sorted by name (deterministic output); the trigger array
3166
+ * preserves first-seen order of distinct expressions.
3167
+ *
3168
+ * Cloudflare caps a Worker at **3 Cron Triggers** (i.e. 3 distinct cron
3169
+ * expressions). Because the dispatcher fires every job sharing an expression,
3170
+ * many jobs can ride a single trigger — only the count of *distinct* schedules
3171
+ * matters. `lunora codegen` warns when that count exceeds the limit; for
3172
+ * finer-grained scheduling use Durable Object alarms (`@lunora/scheduler`),
3173
+ * which have no such cap.
3174
+ */
3175
+ /**
3176
+ * Emit `_generated/scheduler.ts` — the `SchedulerDO` class re-export, or `""`
3177
+ * when the app has no scheduler (the file is not written then).
3178
+ *
3179
+ * It exists so the class-A composed entry has something to FORWARD. wrangler
3180
+ * binds only what the worker entry exports, and `@lunora/vite` generates that
3181
+ * entry, so a Vite-first app had no file to add the re-export to and
3182
+ * `ctx.scheduler.runAfter` / `runAt` were unreachable.
3183
+ *
3184
+ * Emitted off the same `hasScheduler` that decides whether the builder even HAS
3185
+ * a `.scheduler()` method, and that is the whole point: the plugin composes the
3186
+ * call and the re-export off THIS FILE's existence, so the two cannot disagree.
3187
+ * Keying the plugin on the `wrangler.jsonc` binding instead let a project
3188
+ * declare the binding with no scheduler code and get
3189
+ * `TypeError: ….scheduler is not a function` at worker boot, from inside a
3190
+ * virtual module.
3191
+ *
3192
+ * `@lunora/scheduler` stays scoped — the umbrella ships no `./scheduler`
3193
+ * subpath — and `assertRequiredPackages` already demands the dependency off the
3194
+ * same signal, so the specifier cannot go unresolvable.
3195
+ */
3196
+ declare const emitScheduler: (hasScheduler: boolean) => string;
3197
+ declare const emitCrons: (crons: ReadonlyArray<CronJobIR>) => string;
3198
+ /**
3199
+ * Render `_generated/vectors.ts` — the static registry of every vector index
3200
+ * declared in `schema.ts` (inline `.vectorize()` columns + standalone
3201
+ * `defineVectorIndex()` definitions).
3202
+ *
3203
+ * Cloudflare Vectorize exposes no way to enumerate an account's indexes at
3204
+ * runtime — a binding can `describe()` itself but the worker can't ask "which
3205
+ * indexes exist". So this generated array is the source of truth the studio's
3206
+ * vector browser lists, and the worker's admin route pairs each entry with its
3207
+ * live `describe()` stats. Entries are sorted by name for deterministic output.
3208
+ */
3209
+ declare const emitVectors: (vectorIndexes: ReadonlyArray<VectorIndexIR>) => string;
3210
+ /**
3211
+ * Render the deduplicated cron schedules as a JSON fragment suitable for
3212
+ * splicing into `wrangler.jsonc`'s `triggers.crons`. The vite plugin uses this
3213
+ * (plus the parsed wrangler config) to reconcile generated triggers without the
3214
+ * user hand-editing the file.
3215
+ */
3216
+ declare const emitWranglerCronTriggers: (crons: ReadonlyArray<CronJobIR>) => string[];
3125
3217
  interface EmitServerOptions {
3126
3218
  /** Agents declared via `defineAgent` exports — wires the typed `ctx.agents` producers onto Mutation/Action contexts. */
3127
3219
  agents?: ReadonlyArray<AgentIR>;
@@ -3182,45 +3274,6 @@ interface EmitServerOptions {
3182
3274
  workflows?: ReadonlyArray<WorkflowIR>;
3183
3275
  }
3184
3276
  declare const emitServer: ({ agents, containers, env, hasAccessFacade, hasAi, hasAnalytics, hasBrowser, hasVectors, hasFlags, hasHyperdrive, hasImages, hasKv, hasNotify, hasPayments, hasPipelines, hasR2sql, hasX402, identity, queues, schema, storageRuleBuckets, useUmbrella, workflows }?: EmitServerOptions) => string;
3185
- interface EmitFunctionsOptions {
3186
- agents?: ReadonlyArray<AgentIR>;
3187
- functions: ReadonlyArray<FunctionIR>;
3188
- migrations?: ReadonlyArray<MigrationIR>;
3189
- mutators?: ReadonlyArray<MutatorIR>;
3190
- shapes?: ReadonlyArray<ShapeIR>;
3191
- /** Import of a sandbox tool (`browserTool`/`containerTool`) auto-registers the `sandbox:invoke` action. */
3192
- usesSandbox?: boolean;
3193
- useUmbrella?: boolean;
3194
- }
3195
- declare const emitFunctions: (options: EmitFunctionsOptions) => string;
3196
- /**
3197
- * Emit `_generated/containers.ts` — one container-enabled Durable Object class
3198
- * per `defineContainer` export, each a thin subclass of `LunoraContainer`
3199
- * (`@lunora/container/do`) constructed with the user's definition object. The
3200
- * worker entry must re-export these classes: wrangler requires every
3201
- * `containers[].class_name` to be exported by the deployed worker. Returns ""
3202
- * when the project declares no containers (the file is not written then).
3203
- */
3204
- declare const emitContainers: (containers: ReadonlyArray<ContainerIR>, jurisdiction?: JurisdictionIR) => string;
3205
- /**
3206
- * Emit `_generated/workflows.ts` — one `WorkflowEntrypoint` class per
3207
- * `defineWorkflow` export, each a thin subclass of `LunoraWorkflow`
3208
- * (`@lunora/workflow/do`) constructed with the user's definition object. The
3209
- * worker entry must re-export these classes: wrangler requires every
3210
- * `workflows[].class_name` to be exported by the deployed worker. Returns ""
3211
- * when the project declares no workflows (the file is not written then).
3212
- */
3213
- declare const emitWorkflows: (workflows: ReadonlyArray<WorkflowIR>) => string;
3214
- /**
3215
- * Emit `_generated/agents.ts` — one `WorkflowEntrypoint` class per `defineAgent`
3216
- * export, each a thin subclass of `LunoraWorkflow` (`@lunora/workflow/do`)
3217
- * constructed with the compiled agent tool-loop (`compileAgentWorkflow`). Like
3218
- * `_generated/workflows.ts`, the worker entry must re-export these classes:
3219
- * wrangler requires every `workflows[].class_name` to be exported by the
3220
- * deployed worker. Returns "" when the project declares no agents (the file is
3221
- * not written then).
3222
- */
3223
- declare const emitAgents: (agents: ReadonlyArray<AgentIR>) => string;
3224
3277
  interface EmitShardOptions {
3225
3278
  advisories?: ReadonlyArray<Finding>;
3226
3279
  /** Every declared procedure — the health map's denominator, served via `getAdvisorProcedures`. */
@@ -3292,84 +3345,34 @@ interface EmitShardOptions {
3292
3345
  }
3293
3346
  declare const emitShard: ({ advisories, advisorProcedures, agents, containers, env, flagKeys, hasAccessFacade, hasAi, hasAnalytics, hasBrowser, hasFlags, hasHyperdrive, hasImages, hasKv, hasNotify, hasPayments, hasPipelines, hasR2sql, hasVectors, hasX402, maskMetadata, mutators, queues, rlsMetadata, schema, schemaSnapshot, shapes, storageRules, studioFeatures, useUmbrella, workflows }: EmitShardOptions) => string;
3294
3347
  /**
3295
- * Emit drizzle `sqliteTable` definitions for the project schema, split into
3296
- * `global` (D1-backed) and `shard` (DO-SQLite-backed) buckets. Tables marked
3297
- * `.global()` go in the global file; everything else (default root + `.shardBy()`)
3298
- * goes in the shard file.
3299
- *
3300
- * `searchIndexes` are intentionally not emitted — drizzle has no `sqliteTable`
3301
- * abstraction for FTS5 virtual tables. FTS plumbing is handled by the runtime
3302
- * outside of drizzle.
3303
- */
3304
- declare const emitDrizzleSchema: (schema: SchemaIR, useUmbrella?: boolean) => {
3305
- global: string;
3306
- shard: string;
3307
- };
3308
- /**
3309
- * Emit `_generated/crons.ts` from the discovered cron jobs.
3310
- *
3311
- * `LUNORA_CRON_TRIGGERS` is the deduplicated schedule array — what lands in
3312
- * wrangler's `triggers.crons` (the vite plugin reconciles it into
3313
- * `wrangler.jsonc`, and {@link emitWranglerCronTriggers} renders the same list
3314
- * for the CLI / docs).
3315
- *
3316
- * `LUNORA_CRONS` is the dispatcher map keyed by cron expression, each value a
3317
- * list of `{ name, functionPath, args }`. Cloudflare's `scheduled()` handler
3318
- * receives only the cron string, so multiple jobs sharing one expression must
3319
- * all fire — hence a list per key rather than a single entry.
3320
- *
3321
- * Jobs arrive pre-sorted by name (deterministic output); the trigger array
3322
- * preserves first-seen order of distinct expressions.
3323
- *
3324
- * Cloudflare caps a Worker at **3 Cron Triggers** (i.e. 3 distinct cron
3325
- * expressions). Because the dispatcher fires every job sharing an expression,
3326
- * many jobs can ride a single trigger — only the count of *distinct* schedules
3327
- * matters. `lunora codegen` warns when that count exceeds the limit; for
3328
- * finer-grained scheduling use Durable Object alarms (`@lunora/scheduler`),
3329
- * which have no such cap.
3330
- */
3331
- /**
3332
- * Emit `_generated/scheduler.ts` — the `SchedulerDO` class re-export, or `""`
3333
- * when the app has no scheduler (the file is not written then).
3334
- *
3335
- * It exists so the class-A composed entry has something to FORWARD. wrangler
3336
- * binds only what the worker entry exports, and `@lunora/vite` generates that
3337
- * entry, so a Vite-first app had no file to add the re-export to and
3338
- * `ctx.scheduler.runAfter` / `runAt` were unreachable.
3339
- *
3340
- * Emitted off the same `hasScheduler` that decides whether the builder even HAS
3341
- * a `.scheduler()` method, and that is the whole point: the plugin composes the
3342
- * call and the re-export off THIS FILE's existence, so the two cannot disagree.
3343
- * Keying the plugin on the `wrangler.jsonc` binding instead let a project
3344
- * declare the binding with no scheduler code and get
3345
- * `TypeError: ….scheduler is not a function` at worker boot, from inside a
3346
- * virtual module.
3347
- *
3348
- * `@lunora/scheduler` stays scoped — the umbrella ships no `./scheduler`
3349
- * subpath — and `assertRequiredPackages` already demands the dependency off the
3350
- * same signal, so the specifier cannot go unresolvable.
3348
+ * Emit `_generated/containers.ts` — one container-enabled Durable Object class
3349
+ * per `defineContainer` export, each a thin subclass of `LunoraContainer`
3350
+ * (`@lunora/container/do`) constructed with the user's definition object. The
3351
+ * worker entry must re-export these classes: wrangler requires every
3352
+ * `containers[].class_name` to be exported by the deployed worker. Returns ""
3353
+ * when the project declares no containers (the file is not written then).
3351
3354
  */
3352
- declare const emitScheduler: (hasScheduler: boolean) => string;
3353
- declare const emitCrons: (crons: ReadonlyArray<CronJobIR>) => string;
3355
+ declare const emitContainers: (containers: ReadonlyArray<ContainerIR>, jurisdiction?: JurisdictionIR) => string;
3354
3356
  /**
3355
- * Render `_generated/vectors.ts` — the static registry of every vector index
3356
- * declared in `schema.ts` (inline `.vectorize()` columns + standalone
3357
- * `defineVectorIndex()` definitions).
3358
- *
3359
- * Cloudflare Vectorize exposes no way to enumerate an account's indexes at
3360
- * runtime — a binding can `describe()` itself but the worker can't ask "which
3361
- * indexes exist". So this generated array is the source of truth the studio's
3362
- * vector browser lists, and the worker's admin route pairs each entry with its
3363
- * live `describe()` stats. Entries are sorted by name for deterministic output.
3357
+ * Emit `_generated/workflows.ts` — one `WorkflowEntrypoint` class per
3358
+ * `defineWorkflow` export, each a thin subclass of `LunoraWorkflow`
3359
+ * (`@lunora/workflow/do`) constructed with the user's definition object. The
3360
+ * worker entry must re-export these classes: wrangler requires every
3361
+ * `workflows[].class_name` to be exported by the deployed worker. Returns ""
3362
+ * when the project declares no workflows (the file is not written then).
3364
3363
  */
3365
- declare const emitVectors: (vectorIndexes: ReadonlyArray<VectorIndexIR>) => string;
3364
+ declare const emitWorkflows: (workflows: ReadonlyArray<WorkflowIR>) => string;
3366
3365
  /**
3367
- * Render the deduplicated cron schedules as a JSON fragment suitable for
3368
- * splicing into `wrangler.jsonc`'s `triggers.crons`. The vite plugin uses this
3369
- * (plus the parsed wrangler config) to reconcile generated triggers without the
3370
- * user hand-editing the file.
3366
+ * Emit `_generated/agents.ts` — one `WorkflowEntrypoint` class per `defineAgent`
3367
+ * export, each a thin subclass of `LunoraWorkflow` (`@lunora/workflow/do`)
3368
+ * constructed with the compiled agent tool-loop (`compileAgentWorkflow`). Like
3369
+ * `_generated/workflows.ts`, the worker entry must re-export these classes:
3370
+ * wrangler requires every `workflows[].class_name` to be exported by the
3371
+ * deployed worker. Returns "" when the project declares no agents (the file is
3372
+ * not written then).
3371
3373
  */
3372
- declare const emitWranglerCronTriggers: (crons: ReadonlyArray<CronJobIR>) => string[];
3374
+ declare const emitAgents: (agents: ReadonlyArray<AgentIR>) => string;
3375
+ declare const GENERATED_HEADER = "// GENERATED by @lunora/codegen — do not edit.\n// Run `lunora codegen` to regenerate.\n\n";
3373
3376
  /** Which capability methods the generated `defineApp` builder exposes — one flag per package-backed feature the app actually uses. */
3374
3377
  interface EmitAppOptions {
3375
3378
  /**
package/dist/index.d.ts CHANGED
@@ -3,10 +3,10 @@ export type { Finding } from '@lunora/advisor';
3
3
  import { Project, Node } from 'ts-morph';
4
4
  import { LunoraError } from '@lunora/errors';
5
5
  export { MESSAGE_SOLUTIONS as LUNORA_SOLUTION_RULES, type Solution as LunoraSolution, type SolutionRule as LunoraSolutionRule, findSolutionByMessage as findLunoraSolution } from '@lunora/errors';
6
- import { StudioFeaturesResult } from '@lunora/shard-engine';
7
6
  import { Schema } from '@lunora/server';
8
7
  import { JsonSchema } from '@lunora/values';
9
8
  import { LanguageName } from 'quicktype-core';
9
+ import { StudioFeaturesResult } from '@lunora/shard-engine';
10
10
  /** Current snapshot format version. Bumped if the structural shape below changes. */
11
11
  declare const SCHEMA_SNAPSHOT_VERSION: 1;
12
12
  /**
@@ -3019,7 +3019,8 @@ declare const discoverRlsMetadata: (project: Project, lunoraDirectory: string) =
3019
3019
  * `ls`/`read`/`write`/`rm`/`stat` died on FUNCTION_NOT_FOUND) and provisioning
3020
3020
  * the `BROWSER` wrangler binding (`browserTool` only — the browser op runs on
3021
3021
  * `ctx.browser` inside the dispatcher, while `fsTool` reads a hand-declared R2
3022
- * bucket).
3022
+ * bucket). `jsCodeTool` is the exception: it calls the `LOADER` binding off the
3023
+ * tool's own env, so it needs no dispatcher — only the `workerLoaders` gate.
3023
3024
  */
3024
3025
  interface SandboxUsage {
3025
3026
  /** `import { browserTool } from "@lunora/agent"` (or `/sandbox`) appears in `lunora/`. */
@@ -3028,6 +3029,8 @@ interface SandboxUsage {
3028
3029
  usesSandboxContainer: boolean;
3029
3030
  /** `import { fsTool } from "@lunora/agent"` (or `/sandbox`) appears in `lunora/`. */
3030
3031
  usesSandboxFs: boolean;
3032
+ /** `import { jsCodeTool } from "@lunora/agent"` (or `/sandbox`) appears in `lunora/`. */
3033
+ usesSandboxLoader: boolean;
3031
3034
  }
3032
3035
  /**
3033
3036
  * Scan the `lunora/` source set for named imports of the sandbox tools
@@ -3068,9 +3071,6 @@ declare const WORKFLOWS_FILENAME = "workflows.ts";
3068
3071
  * body is runtime-only, so codegen never evaluates it.
3069
3072
  */
3070
3073
  declare const discoverWorkflows: (project: Project, lunoraDirectory: string) => WorkflowIR[];
3071
- declare const GENERATED_HEADER = "// GENERATED by @lunora/codegen — do not edit.\n// Run `lunora codegen` to regenerate.\n\n";
3072
- /** Emit `_generated/dataModel.ts` — `Doc<"name">` + `Id<"name">` for every table. */
3073
- declare const emitDataModel: (schema: SchemaIR) => string;
3074
3074
  /**
3075
3075
  * Emit `_generated/api.ts` — the typed `api.*` registry (public functions), the
3076
3076
  * `internal.*` registry, and (when the project declares them) the typed
@@ -3122,6 +3122,98 @@ declare const emitApi: (options: EmitApiOptions) => string;
3122
3122
  * is remapped to `lunorash/client`.
3123
3123
  */
3124
3124
  declare const emitCollections: (shapes: ReadonlyArray<ShapeIR>, hasDatabase: boolean, useUmbrella?: boolean) => string;
3125
+ /** Emit `_generated/dataModel.ts` — `Doc<"name">` + `Id<"name">` for every table. */
3126
+ declare const emitDataModel: (schema: SchemaIR) => string;
3127
+ /**
3128
+ * Emit drizzle `sqliteTable` definitions for the project schema, split into
3129
+ * `global` (D1-backed) and `shard` (DO-SQLite-backed) buckets. Tables marked
3130
+ * `.global()` go in the global file; everything else (default root + `.shardBy()`)
3131
+ * goes in the shard file.
3132
+ *
3133
+ * `searchIndexes` are intentionally not emitted — drizzle has no `sqliteTable`
3134
+ * abstraction for FTS5 virtual tables. FTS plumbing is handled by the runtime
3135
+ * outside of drizzle.
3136
+ */
3137
+ declare const emitDrizzleSchema: (schema: SchemaIR, useUmbrella?: boolean) => {
3138
+ global: string;
3139
+ shard: string;
3140
+ };
3141
+ interface EmitFunctionsOptions {
3142
+ agents?: ReadonlyArray<AgentIR>;
3143
+ functions: ReadonlyArray<FunctionIR>;
3144
+ migrations?: ReadonlyArray<MigrationIR>;
3145
+ mutators?: ReadonlyArray<MutatorIR>;
3146
+ shapes?: ReadonlyArray<ShapeIR>;
3147
+ /** Import of a sandbox tool (`browserTool`/`containerTool`) auto-registers the `sandbox:invoke` action. */
3148
+ usesSandbox?: boolean;
3149
+ useUmbrella?: boolean;
3150
+ }
3151
+ declare const emitFunctions: (options: EmitFunctionsOptions) => string;
3152
+ /**
3153
+ * Emit `_generated/crons.ts` from the discovered cron jobs.
3154
+ *
3155
+ * `LUNORA_CRON_TRIGGERS` is the deduplicated schedule array — what lands in
3156
+ * wrangler's `triggers.crons` (the vite plugin reconciles it into
3157
+ * `wrangler.jsonc`, and {@link emitWranglerCronTriggers} renders the same list
3158
+ * for the CLI / docs).
3159
+ *
3160
+ * `LUNORA_CRONS` is the dispatcher map keyed by cron expression, each value a
3161
+ * list of `{ name, functionPath, args }`. Cloudflare's `scheduled()` handler
3162
+ * receives only the cron string, so multiple jobs sharing one expression must
3163
+ * all fire — hence a list per key rather than a single entry.
3164
+ *
3165
+ * Jobs arrive pre-sorted by name (deterministic output); the trigger array
3166
+ * preserves first-seen order of distinct expressions.
3167
+ *
3168
+ * Cloudflare caps a Worker at **3 Cron Triggers** (i.e. 3 distinct cron
3169
+ * expressions). Because the dispatcher fires every job sharing an expression,
3170
+ * many jobs can ride a single trigger — only the count of *distinct* schedules
3171
+ * matters. `lunora codegen` warns when that count exceeds the limit; for
3172
+ * finer-grained scheduling use Durable Object alarms (`@lunora/scheduler`),
3173
+ * which have no such cap.
3174
+ */
3175
+ /**
3176
+ * Emit `_generated/scheduler.ts` — the `SchedulerDO` class re-export, or `""`
3177
+ * when the app has no scheduler (the file is not written then).
3178
+ *
3179
+ * It exists so the class-A composed entry has something to FORWARD. wrangler
3180
+ * binds only what the worker entry exports, and `@lunora/vite` generates that
3181
+ * entry, so a Vite-first app had no file to add the re-export to and
3182
+ * `ctx.scheduler.runAfter` / `runAt` were unreachable.
3183
+ *
3184
+ * Emitted off the same `hasScheduler` that decides whether the builder even HAS
3185
+ * a `.scheduler()` method, and that is the whole point: the plugin composes the
3186
+ * call and the re-export off THIS FILE's existence, so the two cannot disagree.
3187
+ * Keying the plugin on the `wrangler.jsonc` binding instead let a project
3188
+ * declare the binding with no scheduler code and get
3189
+ * `TypeError: ….scheduler is not a function` at worker boot, from inside a
3190
+ * virtual module.
3191
+ *
3192
+ * `@lunora/scheduler` stays scoped — the umbrella ships no `./scheduler`
3193
+ * subpath — and `assertRequiredPackages` already demands the dependency off the
3194
+ * same signal, so the specifier cannot go unresolvable.
3195
+ */
3196
+ declare const emitScheduler: (hasScheduler: boolean) => string;
3197
+ declare const emitCrons: (crons: ReadonlyArray<CronJobIR>) => string;
3198
+ /**
3199
+ * Render `_generated/vectors.ts` — the static registry of every vector index
3200
+ * declared in `schema.ts` (inline `.vectorize()` columns + standalone
3201
+ * `defineVectorIndex()` definitions).
3202
+ *
3203
+ * Cloudflare Vectorize exposes no way to enumerate an account's indexes at
3204
+ * runtime — a binding can `describe()` itself but the worker can't ask "which
3205
+ * indexes exist". So this generated array is the source of truth the studio's
3206
+ * vector browser lists, and the worker's admin route pairs each entry with its
3207
+ * live `describe()` stats. Entries are sorted by name for deterministic output.
3208
+ */
3209
+ declare const emitVectors: (vectorIndexes: ReadonlyArray<VectorIndexIR>) => string;
3210
+ /**
3211
+ * Render the deduplicated cron schedules as a JSON fragment suitable for
3212
+ * splicing into `wrangler.jsonc`'s `triggers.crons`. The vite plugin uses this
3213
+ * (plus the parsed wrangler config) to reconcile generated triggers without the
3214
+ * user hand-editing the file.
3215
+ */
3216
+ declare const emitWranglerCronTriggers: (crons: ReadonlyArray<CronJobIR>) => string[];
3125
3217
  interface EmitServerOptions {
3126
3218
  /** Agents declared via `defineAgent` exports — wires the typed `ctx.agents` producers onto Mutation/Action contexts. */
3127
3219
  agents?: ReadonlyArray<AgentIR>;
@@ -3182,45 +3274,6 @@ interface EmitServerOptions {
3182
3274
  workflows?: ReadonlyArray<WorkflowIR>;
3183
3275
  }
3184
3276
  declare const emitServer: ({ agents, containers, env, hasAccessFacade, hasAi, hasAnalytics, hasBrowser, hasVectors, hasFlags, hasHyperdrive, hasImages, hasKv, hasNotify, hasPayments, hasPipelines, hasR2sql, hasX402, identity, queues, schema, storageRuleBuckets, useUmbrella, workflows }?: EmitServerOptions) => string;
3185
- interface EmitFunctionsOptions {
3186
- agents?: ReadonlyArray<AgentIR>;
3187
- functions: ReadonlyArray<FunctionIR>;
3188
- migrations?: ReadonlyArray<MigrationIR>;
3189
- mutators?: ReadonlyArray<MutatorIR>;
3190
- shapes?: ReadonlyArray<ShapeIR>;
3191
- /** Import of a sandbox tool (`browserTool`/`containerTool`) auto-registers the `sandbox:invoke` action. */
3192
- usesSandbox?: boolean;
3193
- useUmbrella?: boolean;
3194
- }
3195
- declare const emitFunctions: (options: EmitFunctionsOptions) => string;
3196
- /**
3197
- * Emit `_generated/containers.ts` — one container-enabled Durable Object class
3198
- * per `defineContainer` export, each a thin subclass of `LunoraContainer`
3199
- * (`@lunora/container/do`) constructed with the user's definition object. The
3200
- * worker entry must re-export these classes: wrangler requires every
3201
- * `containers[].class_name` to be exported by the deployed worker. Returns ""
3202
- * when the project declares no containers (the file is not written then).
3203
- */
3204
- declare const emitContainers: (containers: ReadonlyArray<ContainerIR>, jurisdiction?: JurisdictionIR) => string;
3205
- /**
3206
- * Emit `_generated/workflows.ts` — one `WorkflowEntrypoint` class per
3207
- * `defineWorkflow` export, each a thin subclass of `LunoraWorkflow`
3208
- * (`@lunora/workflow/do`) constructed with the user's definition object. The
3209
- * worker entry must re-export these classes: wrangler requires every
3210
- * `workflows[].class_name` to be exported by the deployed worker. Returns ""
3211
- * when the project declares no workflows (the file is not written then).
3212
- */
3213
- declare const emitWorkflows: (workflows: ReadonlyArray<WorkflowIR>) => string;
3214
- /**
3215
- * Emit `_generated/agents.ts` — one `WorkflowEntrypoint` class per `defineAgent`
3216
- * export, each a thin subclass of `LunoraWorkflow` (`@lunora/workflow/do`)
3217
- * constructed with the compiled agent tool-loop (`compileAgentWorkflow`). Like
3218
- * `_generated/workflows.ts`, the worker entry must re-export these classes:
3219
- * wrangler requires every `workflows[].class_name` to be exported by the
3220
- * deployed worker. Returns "" when the project declares no agents (the file is
3221
- * not written then).
3222
- */
3223
- declare const emitAgents: (agents: ReadonlyArray<AgentIR>) => string;
3224
3277
  interface EmitShardOptions {
3225
3278
  advisories?: ReadonlyArray<Finding>;
3226
3279
  /** Every declared procedure — the health map's denominator, served via `getAdvisorProcedures`. */
@@ -3292,84 +3345,34 @@ interface EmitShardOptions {
3292
3345
  }
3293
3346
  declare const emitShard: ({ advisories, advisorProcedures, agents, containers, env, flagKeys, hasAccessFacade, hasAi, hasAnalytics, hasBrowser, hasFlags, hasHyperdrive, hasImages, hasKv, hasNotify, hasPayments, hasPipelines, hasR2sql, hasVectors, hasX402, maskMetadata, mutators, queues, rlsMetadata, schema, schemaSnapshot, shapes, storageRules, studioFeatures, useUmbrella, workflows }: EmitShardOptions) => string;
3294
3347
  /**
3295
- * Emit drizzle `sqliteTable` definitions for the project schema, split into
3296
- * `global` (D1-backed) and `shard` (DO-SQLite-backed) buckets. Tables marked
3297
- * `.global()` go in the global file; everything else (default root + `.shardBy()`)
3298
- * goes in the shard file.
3299
- *
3300
- * `searchIndexes` are intentionally not emitted — drizzle has no `sqliteTable`
3301
- * abstraction for FTS5 virtual tables. FTS plumbing is handled by the runtime
3302
- * outside of drizzle.
3303
- */
3304
- declare const emitDrizzleSchema: (schema: SchemaIR, useUmbrella?: boolean) => {
3305
- global: string;
3306
- shard: string;
3307
- };
3308
- /**
3309
- * Emit `_generated/crons.ts` from the discovered cron jobs.
3310
- *
3311
- * `LUNORA_CRON_TRIGGERS` is the deduplicated schedule array — what lands in
3312
- * wrangler's `triggers.crons` (the vite plugin reconciles it into
3313
- * `wrangler.jsonc`, and {@link emitWranglerCronTriggers} renders the same list
3314
- * for the CLI / docs).
3315
- *
3316
- * `LUNORA_CRONS` is the dispatcher map keyed by cron expression, each value a
3317
- * list of `{ name, functionPath, args }`. Cloudflare's `scheduled()` handler
3318
- * receives only the cron string, so multiple jobs sharing one expression must
3319
- * all fire — hence a list per key rather than a single entry.
3320
- *
3321
- * Jobs arrive pre-sorted by name (deterministic output); the trigger array
3322
- * preserves first-seen order of distinct expressions.
3323
- *
3324
- * Cloudflare caps a Worker at **3 Cron Triggers** (i.e. 3 distinct cron
3325
- * expressions). Because the dispatcher fires every job sharing an expression,
3326
- * many jobs can ride a single trigger — only the count of *distinct* schedules
3327
- * matters. `lunora codegen` warns when that count exceeds the limit; for
3328
- * finer-grained scheduling use Durable Object alarms (`@lunora/scheduler`),
3329
- * which have no such cap.
3330
- */
3331
- /**
3332
- * Emit `_generated/scheduler.ts` — the `SchedulerDO` class re-export, or `""`
3333
- * when the app has no scheduler (the file is not written then).
3334
- *
3335
- * It exists so the class-A composed entry has something to FORWARD. wrangler
3336
- * binds only what the worker entry exports, and `@lunora/vite` generates that
3337
- * entry, so a Vite-first app had no file to add the re-export to and
3338
- * `ctx.scheduler.runAfter` / `runAt` were unreachable.
3339
- *
3340
- * Emitted off the same `hasScheduler` that decides whether the builder even HAS
3341
- * a `.scheduler()` method, and that is the whole point: the plugin composes the
3342
- * call and the re-export off THIS FILE's existence, so the two cannot disagree.
3343
- * Keying the plugin on the `wrangler.jsonc` binding instead let a project
3344
- * declare the binding with no scheduler code and get
3345
- * `TypeError: ….scheduler is not a function` at worker boot, from inside a
3346
- * virtual module.
3347
- *
3348
- * `@lunora/scheduler` stays scoped — the umbrella ships no `./scheduler`
3349
- * subpath — and `assertRequiredPackages` already demands the dependency off the
3350
- * same signal, so the specifier cannot go unresolvable.
3348
+ * Emit `_generated/containers.ts` — one container-enabled Durable Object class
3349
+ * per `defineContainer` export, each a thin subclass of `LunoraContainer`
3350
+ * (`@lunora/container/do`) constructed with the user's definition object. The
3351
+ * worker entry must re-export these classes: wrangler requires every
3352
+ * `containers[].class_name` to be exported by the deployed worker. Returns ""
3353
+ * when the project declares no containers (the file is not written then).
3351
3354
  */
3352
- declare const emitScheduler: (hasScheduler: boolean) => string;
3353
- declare const emitCrons: (crons: ReadonlyArray<CronJobIR>) => string;
3355
+ declare const emitContainers: (containers: ReadonlyArray<ContainerIR>, jurisdiction?: JurisdictionIR) => string;
3354
3356
  /**
3355
- * Render `_generated/vectors.ts` — the static registry of every vector index
3356
- * declared in `schema.ts` (inline `.vectorize()` columns + standalone
3357
- * `defineVectorIndex()` definitions).
3358
- *
3359
- * Cloudflare Vectorize exposes no way to enumerate an account's indexes at
3360
- * runtime — a binding can `describe()` itself but the worker can't ask "which
3361
- * indexes exist". So this generated array is the source of truth the studio's
3362
- * vector browser lists, and the worker's admin route pairs each entry with its
3363
- * live `describe()` stats. Entries are sorted by name for deterministic output.
3357
+ * Emit `_generated/workflows.ts` — one `WorkflowEntrypoint` class per
3358
+ * `defineWorkflow` export, each a thin subclass of `LunoraWorkflow`
3359
+ * (`@lunora/workflow/do`) constructed with the user's definition object. The
3360
+ * worker entry must re-export these classes: wrangler requires every
3361
+ * `workflows[].class_name` to be exported by the deployed worker. Returns ""
3362
+ * when the project declares no workflows (the file is not written then).
3364
3363
  */
3365
- declare const emitVectors: (vectorIndexes: ReadonlyArray<VectorIndexIR>) => string;
3364
+ declare const emitWorkflows: (workflows: ReadonlyArray<WorkflowIR>) => string;
3366
3365
  /**
3367
- * Render the deduplicated cron schedules as a JSON fragment suitable for
3368
- * splicing into `wrangler.jsonc`'s `triggers.crons`. The vite plugin uses this
3369
- * (plus the parsed wrangler config) to reconcile generated triggers without the
3370
- * user hand-editing the file.
3366
+ * Emit `_generated/agents.ts` — one `WorkflowEntrypoint` class per `defineAgent`
3367
+ * export, each a thin subclass of `LunoraWorkflow` (`@lunora/workflow/do`)
3368
+ * constructed with the compiled agent tool-loop (`compileAgentWorkflow`). Like
3369
+ * `_generated/workflows.ts`, the worker entry must re-export these classes:
3370
+ * wrangler requires every `workflows[].class_name` to be exported by the
3371
+ * deployed worker. Returns "" when the project declares no agents (the file is
3372
+ * not written then).
3371
3373
  */
3372
- declare const emitWranglerCronTriggers: (crons: ReadonlyArray<CronJobIR>) => string[];
3374
+ declare const emitAgents: (agents: ReadonlyArray<AgentIR>) => string;
3375
+ declare const GENERATED_HEADER = "// GENERATED by @lunora/codegen — do not edit.\n// Run `lunora codegen` to regenerate.\n\n";
3373
3376
  /** Which capability methods the generated `defineApp` builder exposes — one flag per package-backed feature the app actually uses. */
3374
3377
  interface EmitAppOptions {
3375
3378
  /**
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{SCHEMA_SNAPSHOT_VERSION as t,diffSchemaSnapshots as s,serializeSchemaSnapshot as a}from"./packem_shared/SCHEMA_SNAPSHOT_VERSION-C0oHwiJZ.mjs";import{formatAdvisories as m,lintSchema as d,toAdvisorContext as f}from"./packem_shared/formatAdvisories-DwmUKYuc.mjs";import{describeErrorLevelFindings as c,errorAdvisoryNames as n,errorPlatformDiagnosticNames as l,sortedUniqueNames as S}from"./packem_shared/describeErrorLevelFindings-vzaGS9KL.mjs";import{CodegenDiagnosticError as E,diagnosticAt as u}from"./packem_shared/CodegenDiagnosticError-BUXlG3P-.mjs";import{AGENTS_FILENAME as v,discoverAgents as N}from"./packem_shared/AGENTS_FILENAME-DoPI92Wu.mjs";import{listLunoraSourceFiles as C}from"./packem_shared/listLunoraSourceFiles-DP-5e-RE.mjs";import{default as R}from"./packem_shared/discoverAuthApiCalls-FxrdBeVt.mjs";import{CONTAINERS_FILENAME as M,discoverContainers as T}from"./packem_shared/CONTAINERS_FILENAME-B6TFs82W.mjs";import{default as L}from"./packem_shared/discoverCrons-MfKw7IFf.mjs";import{FLAGS_FILENAME as I,discoverFlags as P}from"./packem_shared/FLAGS_FILENAME-BedPDCsR.mjs";import{default as G}from"./packem_shared/discoverFunctions-BsmX-sEq.mjs";import{default as b}from"./packem_shared/discoverHttpRoutes-BcXI9CNt.mjs";import{default as j}from"./packem_shared/discoverHyperdriveCalls-D9qXqTq3.mjs";import{default as k}from"./packem_shared/discoverInserts-CFJ3IVeI.mjs";import{d as K}from"./packem_shared/index-BoaHhVtM.mjs";import{default as z}from"./packem_shared/discoverMigrations-DbrHwcGE.mjs";import{MUTATORS_FILENAME as q,discoverMutators as w}from"./packem_shared/MUTATORS_FILENAME-B6cKrN_m.mjs";import{default as B}from"./packem_shared/discoverNondeterministicCalls-CSQ_GDcA.mjs";import{NOTIFY_FILENAME as X,discoverNotifyCalls as Z,discoverNotifyConfig as $}from"./packem_shared/NOTIFY_FILENAME-Cri3NT5U.mjs";import{default as re}from"./packem_shared/readPackageDependencies-C6h6FZuP.mjs";import{d as te}from"./packem_shared/queries-B-f4jO-x.mjs";import{QUEUES_FILENAME as ae,discoverQueues as ie}from"./packem_shared/QUEUES_FILENAME-CxkPcMH1.mjs";import{default as de}from"./packem_shared/discoverR2sqlCalls-fu7fC0i_.mjs";import{default as pe}from"./packem_shared/discoverRlsProcedures-BO4qC77y.mjs";import{default as ne}from"./packem_shared/discoverRlsMetadata-CPmAGL0W.mjs";import{discoverSandboxUsage as Se}from"./packem_shared/discoverSandboxUsage-CgmfgDTS.mjs";import{default as Ee}from"./packem_shared/discoverSchema-D8DBDHEg.mjs";import{SHAPES_FILENAME as Ae,discoverShapes as ve}from"./packem_shared/SHAPES_FILENAME-zJgzynXR.mjs";import{default as ge}from"./packem_shared/discoverStorageRulesMetadata-D8VYflWt.mjs";import{WORKFLOWS_FILENAME as Oe,discoverWorkflows as Re}from"./packem_shared/WORKFLOWS_FILENAME-B_ZJxRSx.mjs";import{G as Me,e as Te,a as _e,b as Le,c as Fe,d as Ie,f as Pe,g as De,h as Ge,i as Ue,j as be,k as He,l as je,m as ye,n as ke}from"./packem_shared/emit-DUpkZ68h.mjs";import{emitApp as Ke}from"./packem_shared/emitApp-CTLwFZHO.mjs";import{isD1GlobalTable as ze,isHyperdriveGlobalTable as Qe}from"./packem_shared/isD1GlobalTable-udvHAAzD.mjs";import{buildOpenApiDocument as we,emitOpenApi as Je,emitOpenApiModule as Be}from"./packem_shared/buildOpenApiDocument-C7S5wJCl.mjs";import{OPENRPC_VERSION as Xe,buildOpenRpcDocument as Ze,emitOpenRpc as $e,emitOpenRpcModule as er}from"./packem_shared/OPENRPC_VERSION-CL0VnCPW.mjs";import{DEFAULT_TARGET as or,platformMatrixIds as tr,readProjectTarget as sr,resolveCodegenTarget as ar}from"./packem_shared/DEFAULT_TARGET-kmm2i4Fw.mjs";import{loadProjectConfig as mr,readProjectConfigLiterals as dr}from"./packem_shared/loadProjectConfig-CKsFNgn3.mjs";import{SCHEMA_SNAPSHOT_FILENAME as pr,createCodegenProject as cr,findTsconfig as nr,refreshCodegenProject as lr,runCodegen as Sr}from"./packem_shared/SCHEMA_SNAPSHOT_FILENAME-BtMVx-4j.mjs";import{SchemaSnapshotParseError as Er,buildSchemaSnapshot as ur,evaluateSchemaDrift as Ar,parseSchemaSnapshot as vr}from"./packem_shared/SchemaSnapshotParseError-CPOXlFhI.mjs";import{default as gr}from"./packem_shared/fingerprintSchemaSources-L3nGKDQt.mjs";import{schemaFromIr as Or}from"./packem_shared/schemaFromIr-BWFnvCVg.mjs";import{LUNORA_ERROR_CODES as hr,validatorIrToJsonSchema as Mr}from"./packem_shared/LUNORA_ERROR_CODES-C2s0xWQD.mjs";import{SDK_LANGUAGES as _r,SDK_TARGETS as Lr,generateSdk as Fr}from"./packem_shared/SDK_LANGUAGES-Df_CnJx5.mjs";import{redact as Pr,secretKindOf as Dr}from"./packem_shared/redact-Cy14LEnc.mjs";import{MESSAGE_SOLUTIONS as Ur,findSolutionByMessage as br}from"@lunora/errors";import{PROJECT_CONFIG_FILENAMES as jr,findProjectConfigFile as yr}from"./packem_shared/PROJECT_CONFIG_FILENAMES-DzOu-lSc.mjs";import{isTypedSchema as Wr}from"./packem_shared/isTypedSchema-CKzc3ioR.mjs";const e="0.0.0";export{v as AGENTS_FILENAME,M as CONTAINERS_FILENAME,E as CodegenDiagnosticError,or as DEFAULT_TARGET,I as FLAGS_FILENAME,Me as GENERATED_HEADER,hr as LUNORA_ERROR_CODES,Ur as LUNORA_SOLUTION_RULES,q as MUTATORS_FILENAME,X as NOTIFY_FILENAME,Xe as OPENRPC_VERSION,jr as PROJECT_CONFIG_FILENAMES,ae as QUEUES_FILENAME,pr as SCHEMA_SNAPSHOT_FILENAME,t as SCHEMA_SNAPSHOT_VERSION,_r as SDK_LANGUAGES,Lr as SDK_TARGETS,Ae as SHAPES_FILENAME,Er as SchemaSnapshotParseError,e as VERSION,Oe as WORKFLOWS_FILENAME,we as buildOpenApiDocument,Ze as buildOpenRpcDocument,ur as buildSchemaSnapshot,cr as createCodegenProject,c as describeErrorLevelFindings,u as diagnosticAt,s as diffSchemaSnapshots,N as discoverAgents,R as discoverAuthApiCalls,T as discoverContainers,L as discoverCrons,P as discoverFlags,G as discoverFunctions,b as discoverHttpRoutes,j as discoverHyperdriveCalls,k as discoverInserts,K as discoverMaskProcedures,z as discoverMigrations,w as discoverMutators,B as discoverNondeterministicCalls,Z as discoverNotifyCalls,$ as discoverNotifyConfig,te as discoverQueries,ie as discoverQueues,de as discoverR2sqlCalls,ne as discoverRlsMetadata,pe as discoverRlsProcedures,Se as discoverSandboxUsage,Ee as discoverSchema,ve as discoverShapes,ge as discoverStorageRulesMetadata,Re as discoverWorkflows,Te as emitAgents,_e as emitApi,Ke as emitApp,Le as emitCollections,Fe as emitContainers,Ie as emitCrons,Pe as emitDataModel,De as emitDrizzleSchema,Ge as emitFunctions,Je as emitOpenApi,Be as emitOpenApiModule,$e as emitOpenRpc,er as emitOpenRpcModule,Ue as emitScheduler,be as emitServer,He as emitShard,je as emitVectors,ye as emitWorkflows,ke as emitWranglerCronTriggers,n as errorAdvisoryNames,l as errorPlatformDiagnosticNames,Ar as evaluateSchemaDrift,br as findLunoraSolution,yr as findProjectConfigFile,nr as findTsconfig,gr as fingerprintSchemaSources,m as formatAdvisories,Fr as generateSdk,ze as isD1GlobalTable,Qe as isHyperdriveGlobalTable,Wr as isTypedSchema,d as lintSchema,C as listLunoraSourceFiles,mr as loadProjectConfig,vr as parseSchemaSnapshot,tr as platformMatrixIds,re as readPackageDependencies,dr as readProjectConfigLiterals,sr as readProjectTarget,Pr as redact,lr as refreshCodegenProject,ar as resolveCodegenTarget,Sr as runCodegen,Or as schemaFromIr,Dr as secretKindOf,a as serializeSchemaSnapshot,S as sortedUniqueNames,f as toAdvisorContext,Mr as validatorIrToJsonSchema};
1
+ import{SCHEMA_SNAPSHOT_VERSION as t,diffSchemaSnapshots as s,serializeSchemaSnapshot as a}from"./packem_shared/SCHEMA_SNAPSHOT_VERSION-C0oHwiJZ.mjs";import{formatAdvisories as m,lintSchema as f,toAdvisorContext as d}from"./packem_shared/formatAdvisories-DwmUKYuc.mjs";import{describeErrorLevelFindings as c,errorAdvisoryNames as n,errorPlatformDiagnosticNames as l,sortedUniqueNames as x}from"./packem_shared/describeErrorLevelFindings-vzaGS9KL.mjs";import{CodegenDiagnosticError as E,diagnosticAt as u}from"./packem_shared/CodegenDiagnosticError-BUXlG3P-.mjs";import{AGENTS_FILENAME as v,discoverAgents as N}from"./packem_shared/AGENTS_FILENAME-DoPI92Wu.mjs";import{listLunoraSourceFiles as C}from"./packem_shared/listLunoraSourceFiles-DP-5e-RE.mjs";import{default as R}from"./packem_shared/discoverAuthApiCalls-FxrdBeVt.mjs";import{CONTAINERS_FILENAME as T,discoverContainers as _}from"./packem_shared/CONTAINERS_FILENAME-B6TFs82W.mjs";import{default as L}from"./packem_shared/discoverCrons-MfKw7IFf.mjs";import{FLAGS_FILENAME as I,discoverFlags as P}from"./packem_shared/FLAGS_FILENAME-BedPDCsR.mjs";import{default as G}from"./packem_shared/discoverFunctions-BsmX-sEq.mjs";import{default as b}from"./packem_shared/discoverHttpRoutes-BcXI9CNt.mjs";import{default as y}from"./packem_shared/discoverHyperdriveCalls-D9qXqTq3.mjs";import{default as k}from"./packem_shared/discoverInserts-CFJ3IVeI.mjs";import{d as z}from"./packem_shared/index-BoaHhVtM.mjs";import{default as V}from"./packem_shared/discoverMigrations-DbrHwcGE.mjs";import{MUTATORS_FILENAME as q,discoverMutators as w}from"./packem_shared/MUTATORS_FILENAME-B6cKrN_m.mjs";import{default as B}from"./packem_shared/discoverNondeterministicCalls-CSQ_GDcA.mjs";import{NOTIFY_FILENAME as X,discoverNotifyCalls as Z,discoverNotifyConfig as $}from"./packem_shared/NOTIFY_FILENAME-Cri3NT5U.mjs";import{default as re}from"./packem_shared/readPackageDependencies-C6h6FZuP.mjs";import{d as te}from"./packem_shared/queries-B-f4jO-x.mjs";import{QUEUES_FILENAME as ae,discoverQueues as ie}from"./packem_shared/QUEUES_FILENAME-CxkPcMH1.mjs";import{default as fe}from"./packem_shared/discoverR2sqlCalls-fu7fC0i_.mjs";import{default as pe}from"./packem_shared/discoverRlsProcedures-BO4qC77y.mjs";import{default as ne}from"./packem_shared/discoverRlsMetadata-CPmAGL0W.mjs";import{discoverSandboxUsage as xe}from"./packem_shared/discoverSandboxUsage-CrjZ6yNg.mjs";import{default as Ee}from"./packem_shared/discoverSchema-D8DBDHEg.mjs";import{SHAPES_FILENAME as Ae,discoverShapes as ve}from"./packem_shared/SHAPES_FILENAME-zJgzynXR.mjs";import{default as ge}from"./packem_shared/discoverStorageRulesMetadata-D8VYflWt.mjs";import{WORKFLOWS_FILENAME as Oe,discoverWorkflows as Re}from"./packem_shared/WORKFLOWS_FILENAME-B_ZJxRSx.mjs";import{emitApp as Te}from"./packem_shared/emitApp-BGhO5bhT.mjs";import{isD1GlobalTable as he,isHyperdriveGlobalTable as Le}from"./packem_shared/isD1GlobalTable-udvHAAzD.mjs";import{buildOpenApiDocument as Ie,emitOpenApi as Pe,emitOpenApiModule as De}from"./packem_shared/buildOpenApiDocument-nYvBhjxu.mjs";import{OPENRPC_VERSION as Ue,buildOpenRpcDocument as be,emitOpenRpc as He,emitOpenRpcModule as ye}from"./packem_shared/OPENRPC_VERSION-Cl6P9WGv.mjs";import{DEFAULT_TARGET as ke,platformMatrixIds as We,readProjectTarget as ze,resolveCodegenTarget as Ke}from"./packem_shared/DEFAULT_TARGET-DCpDuuUM.mjs";import{loadProjectConfig as Qe,readProjectConfigLiterals as qe}from"./packem_shared/loadProjectConfig-CKsFNgn3.mjs";import{SCHEMA_SNAPSHOT_FILENAME as Je,createCodegenProject as Be,findTsconfig as Ye,refreshCodegenProject as Xe,runCodegen as Ze}from"./packem_shared/SCHEMA_SNAPSHOT_FILENAME-Dj0pT9D6.mjs";import{SchemaSnapshotParseError as er,buildSchemaSnapshot as rr,evaluateSchemaDrift as or,parseSchemaSnapshot as tr}from"./packem_shared/SchemaSnapshotParseError-CPOXlFhI.mjs";import{default as ar}from"./packem_shared/fingerprintSchemaSources-L3nGKDQt.mjs";import{schemaFromIr as mr}from"./packem_shared/schemaFromIr-BWFnvCVg.mjs";import{LUNORA_ERROR_CODES as dr,validatorIrToJsonSchema as pr}from"./packem_shared/LUNORA_ERROR_CODES-C2s0xWQD.mjs";import{SDK_LANGUAGES as nr,SDK_TARGETS as lr,generateSdk as xr}from"./packem_shared/SDK_LANGUAGES-Df_CnJx5.mjs";import{redact as Er,secretKindOf as ur}from"./packem_shared/redact-Cy14LEnc.mjs";import{default as vr}from"./packem_shared/emitDrizzleSchema-Cv0HtLR3.mjs";import{default as gr}from"./packem_shared/emitFunctions-BqAz1ssY.mjs";import{default as Or}from"./packem_shared/emitServer-BEo_fCY8.mjs";import{e as Mr}from"./packem_shared/shard-B3LMNjIg.mjs";import{G as _r}from"./packem_shared/shared-DjUziztz.mjs";import{MESSAGE_SOLUTIONS as Lr,findSolutionByMessage as Fr}from"@lunora/errors";import{PROJECT_CONFIG_FILENAMES as Pr,findProjectConfigFile as Dr}from"./packem_shared/PROJECT_CONFIG_FILENAMES-DzOu-lSc.mjs";import{y as Ur,z as br,A as Hr}from"./packem_shared/shard-runtime-B_ppYvOf.mjs";import{emitApi as jr,emitCollections as kr}from"./packem_shared/emitApi-CJ9ziZnP.mjs";import{emitCrons as zr,emitScheduler as Kr,emitVectors as Vr,emitWranglerCronTriggers as Qr}from"./packem_shared/emitCrons-mkwWkn0R.mjs";import{emitDataModel as wr}from"./packem_shared/emitDataModel-D3WuEZ4b.mjs";import{isTypedSchema as Br}from"./packem_shared/isTypedSchema-CKzc3ioR.mjs";const e="0.0.0";export{v as AGENTS_FILENAME,T as CONTAINERS_FILENAME,E as CodegenDiagnosticError,ke as DEFAULT_TARGET,I as FLAGS_FILENAME,_r as GENERATED_HEADER,dr as LUNORA_ERROR_CODES,Lr as LUNORA_SOLUTION_RULES,q as MUTATORS_FILENAME,X as NOTIFY_FILENAME,Ue as OPENRPC_VERSION,Pr as PROJECT_CONFIG_FILENAMES,ae as QUEUES_FILENAME,Je as SCHEMA_SNAPSHOT_FILENAME,t as SCHEMA_SNAPSHOT_VERSION,nr as SDK_LANGUAGES,lr as SDK_TARGETS,Ae as SHAPES_FILENAME,er as SchemaSnapshotParseError,e as VERSION,Oe as WORKFLOWS_FILENAME,Ie as buildOpenApiDocument,be as buildOpenRpcDocument,rr as buildSchemaSnapshot,Be as createCodegenProject,c as describeErrorLevelFindings,u as diagnosticAt,s as diffSchemaSnapshots,N as discoverAgents,R as discoverAuthApiCalls,_ as discoverContainers,L as discoverCrons,P as discoverFlags,G as discoverFunctions,b as discoverHttpRoutes,y as discoverHyperdriveCalls,k as discoverInserts,z as discoverMaskProcedures,V as discoverMigrations,w as discoverMutators,B as discoverNondeterministicCalls,Z as discoverNotifyCalls,$ as discoverNotifyConfig,te as discoverQueries,ie as discoverQueues,fe as discoverR2sqlCalls,ne as discoverRlsMetadata,pe as discoverRlsProcedures,xe as discoverSandboxUsage,Ee as discoverSchema,ve as discoverShapes,ge as discoverStorageRulesMetadata,Re as discoverWorkflows,Ur as emitAgents,jr as emitApi,Te as emitApp,kr as emitCollections,br as emitContainers,zr as emitCrons,wr as emitDataModel,vr as emitDrizzleSchema,gr as emitFunctions,Pe as emitOpenApi,De as emitOpenApiModule,He as emitOpenRpc,ye as emitOpenRpcModule,Kr as emitScheduler,Or as emitServer,Mr as emitShard,Vr as emitVectors,Hr as emitWorkflows,Qr as emitWranglerCronTriggers,n as errorAdvisoryNames,l as errorPlatformDiagnosticNames,or as evaluateSchemaDrift,Fr as findLunoraSolution,Dr as findProjectConfigFile,Ye as findTsconfig,ar as fingerprintSchemaSources,m as formatAdvisories,xr as generateSdk,he as isD1GlobalTable,Le as isHyperdriveGlobalTable,Br as isTypedSchema,f as lintSchema,C as listLunoraSourceFiles,Qe as loadProjectConfig,tr as parseSchemaSnapshot,We as platformMatrixIds,re as readPackageDependencies,qe as readProjectConfigLiterals,ze as readProjectTarget,Er as redact,Xe as refreshCodegenProject,Ke as resolveCodegenTarget,Ze as runCodegen,mr as schemaFromIr,ur as secretKindOf,a as serializeSchemaSnapshot,x as sortedUniqueNames,d as toAdvisorContext,pr as validatorIrToJsonSchema};