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

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 (27) hide show
  1. package/dist/index.d.mts +116 -116
  2. package/dist/index.d.ts +116 -116
  3. package/dist/index.mjs +1 -1
  4. package/dist/packem_shared/GENERATED_HEADER-DSXl0YM2.mjs +1 -0
  5. package/dist/packem_shared/OPENRPC_VERSION-Cl6P9WGv.mjs +3 -0
  6. package/dist/packem_shared/{SCHEMA_SNAPSHOT_FILENAME-BtMVx-4j.mjs → SCHEMA_SNAPSHOT_FILENAME-BxnbL9RB.mjs} +4 -4
  7. package/dist/packem_shared/buildOpenApiDocument-nYvBhjxu.mjs +3 -0
  8. package/dist/packem_shared/capabilities-DJJWVEtk.mjs +18 -0
  9. package/dist/packem_shared/emitAgents-BPFw6ww2.mjs +1 -0
  10. package/dist/packem_shared/emitApi-CJ9ziZnP.mjs +154 -0
  11. package/dist/packem_shared/{emitApp-CTLwFZHO.mjs → emitApp-BGhO5bhT.mjs} +3 -3
  12. package/dist/packem_shared/emitCrons-mkwWkn0R.mjs +69 -0
  13. package/dist/packem_shared/emitDataModel-D3WuEZ4b.mjs +113 -0
  14. package/dist/packem_shared/emitDrizzleSchema-Cv0HtLR3.mjs +15 -0
  15. package/dist/packem_shared/emitFunctions-BqAz1ssY.mjs +249 -0
  16. package/dist/packem_shared/emitServer-BEo_fCY8.mjs +365 -0
  17. package/dist/packem_shared/emitShard-Bu7EKdou.mjs +1 -0
  18. package/dist/packem_shared/json-data-Chfs2Cz5.mjs +1 -0
  19. package/dist/packem_shared/qualifiers-BhOL15WZ.mjs +1 -0
  20. package/dist/packem_shared/shard-B3LMNjIg.mjs +1435 -0
  21. package/dist/packem_shared/shard-runtime-B_ppYvOf.mjs +323 -0
  22. package/dist/packem_shared/shared-DjUziztz.mjs +9 -0
  23. package/package.json +3 -3
  24. package/dist/packem_shared/GENERATED_HEADER-Da0OC3EI.mjs +0 -1
  25. package/dist/packem_shared/OPENRPC_VERSION-CL0VnCPW.mjs +0 -3
  26. package/dist/packem_shared/buildOpenApiDocument-C7S5wJCl.mjs +0 -3
  27. 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
  /**
@@ -3068,9 +3068,6 @@ declare const WORKFLOWS_FILENAME = "workflows.ts";
3068
3068
  * body is runtime-only, so codegen never evaluates it.
3069
3069
  */
3070
3070
  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
3071
  /**
3075
3072
  * Emit `_generated/api.ts` — the typed `api.*` registry (public functions), the
3076
3073
  * `internal.*` registry, and (when the project declares them) the typed
@@ -3122,6 +3119,98 @@ declare const emitApi: (options: EmitApiOptions) => string;
3122
3119
  * is remapped to `lunorash/client`.
3123
3120
  */
3124
3121
  declare const emitCollections: (shapes: ReadonlyArray<ShapeIR>, hasDatabase: boolean, useUmbrella?: boolean) => string;
3122
+ /** Emit `_generated/dataModel.ts` — `Doc<"name">` + `Id<"name">` for every table. */
3123
+ declare const emitDataModel: (schema: SchemaIR) => string;
3124
+ /**
3125
+ * Emit drizzle `sqliteTable` definitions for the project schema, split into
3126
+ * `global` (D1-backed) and `shard` (DO-SQLite-backed) buckets. Tables marked
3127
+ * `.global()` go in the global file; everything else (default root + `.shardBy()`)
3128
+ * goes in the shard file.
3129
+ *
3130
+ * `searchIndexes` are intentionally not emitted — drizzle has no `sqliteTable`
3131
+ * abstraction for FTS5 virtual tables. FTS plumbing is handled by the runtime
3132
+ * outside of drizzle.
3133
+ */
3134
+ declare const emitDrizzleSchema: (schema: SchemaIR, useUmbrella?: boolean) => {
3135
+ global: string;
3136
+ shard: string;
3137
+ };
3138
+ interface EmitFunctionsOptions {
3139
+ agents?: ReadonlyArray<AgentIR>;
3140
+ functions: ReadonlyArray<FunctionIR>;
3141
+ migrations?: ReadonlyArray<MigrationIR>;
3142
+ mutators?: ReadonlyArray<MutatorIR>;
3143
+ shapes?: ReadonlyArray<ShapeIR>;
3144
+ /** Import of a sandbox tool (`browserTool`/`containerTool`) auto-registers the `sandbox:invoke` action. */
3145
+ usesSandbox?: boolean;
3146
+ useUmbrella?: boolean;
3147
+ }
3148
+ declare const emitFunctions: (options: EmitFunctionsOptions) => string;
3149
+ /**
3150
+ * Emit `_generated/crons.ts` from the discovered cron jobs.
3151
+ *
3152
+ * `LUNORA_CRON_TRIGGERS` is the deduplicated schedule array — what lands in
3153
+ * wrangler's `triggers.crons` (the vite plugin reconciles it into
3154
+ * `wrangler.jsonc`, and {@link emitWranglerCronTriggers} renders the same list
3155
+ * for the CLI / docs).
3156
+ *
3157
+ * `LUNORA_CRONS` is the dispatcher map keyed by cron expression, each value a
3158
+ * list of `{ name, functionPath, args }`. Cloudflare's `scheduled()` handler
3159
+ * receives only the cron string, so multiple jobs sharing one expression must
3160
+ * all fire — hence a list per key rather than a single entry.
3161
+ *
3162
+ * Jobs arrive pre-sorted by name (deterministic output); the trigger array
3163
+ * preserves first-seen order of distinct expressions.
3164
+ *
3165
+ * Cloudflare caps a Worker at **3 Cron Triggers** (i.e. 3 distinct cron
3166
+ * expressions). Because the dispatcher fires every job sharing an expression,
3167
+ * many jobs can ride a single trigger — only the count of *distinct* schedules
3168
+ * matters. `lunora codegen` warns when that count exceeds the limit; for
3169
+ * finer-grained scheduling use Durable Object alarms (`@lunora/scheduler`),
3170
+ * which have no such cap.
3171
+ */
3172
+ /**
3173
+ * Emit `_generated/scheduler.ts` — the `SchedulerDO` class re-export, or `""`
3174
+ * when the app has no scheduler (the file is not written then).
3175
+ *
3176
+ * It exists so the class-A composed entry has something to FORWARD. wrangler
3177
+ * binds only what the worker entry exports, and `@lunora/vite` generates that
3178
+ * entry, so a Vite-first app had no file to add the re-export to and
3179
+ * `ctx.scheduler.runAfter` / `runAt` were unreachable.
3180
+ *
3181
+ * Emitted off the same `hasScheduler` that decides whether the builder even HAS
3182
+ * a `.scheduler()` method, and that is the whole point: the plugin composes the
3183
+ * call and the re-export off THIS FILE's existence, so the two cannot disagree.
3184
+ * Keying the plugin on the `wrangler.jsonc` binding instead let a project
3185
+ * declare the binding with no scheduler code and get
3186
+ * `TypeError: ….scheduler is not a function` at worker boot, from inside a
3187
+ * virtual module.
3188
+ *
3189
+ * `@lunora/scheduler` stays scoped — the umbrella ships no `./scheduler`
3190
+ * subpath — and `assertRequiredPackages` already demands the dependency off the
3191
+ * same signal, so the specifier cannot go unresolvable.
3192
+ */
3193
+ declare const emitScheduler: (hasScheduler: boolean) => string;
3194
+ declare const emitCrons: (crons: ReadonlyArray<CronJobIR>) => string;
3195
+ /**
3196
+ * Render `_generated/vectors.ts` — the static registry of every vector index
3197
+ * declared in `schema.ts` (inline `.vectorize()` columns + standalone
3198
+ * `defineVectorIndex()` definitions).
3199
+ *
3200
+ * Cloudflare Vectorize exposes no way to enumerate an account's indexes at
3201
+ * runtime — a binding can `describe()` itself but the worker can't ask "which
3202
+ * indexes exist". So this generated array is the source of truth the studio's
3203
+ * vector browser lists, and the worker's admin route pairs each entry with its
3204
+ * live `describe()` stats. Entries are sorted by name for deterministic output.
3205
+ */
3206
+ declare const emitVectors: (vectorIndexes: ReadonlyArray<VectorIndexIR>) => string;
3207
+ /**
3208
+ * Render the deduplicated cron schedules as a JSON fragment suitable for
3209
+ * splicing into `wrangler.jsonc`'s `triggers.crons`. The vite plugin uses this
3210
+ * (plus the parsed wrangler config) to reconcile generated triggers without the
3211
+ * user hand-editing the file.
3212
+ */
3213
+ declare const emitWranglerCronTriggers: (crons: ReadonlyArray<CronJobIR>) => string[];
3125
3214
  interface EmitServerOptions {
3126
3215
  /** Agents declared via `defineAgent` exports — wires the typed `ctx.agents` producers onto Mutation/Action contexts. */
3127
3216
  agents?: ReadonlyArray<AgentIR>;
@@ -3182,45 +3271,6 @@ interface EmitServerOptions {
3182
3271
  workflows?: ReadonlyArray<WorkflowIR>;
3183
3272
  }
3184
3273
  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
3274
  interface EmitShardOptions {
3225
3275
  advisories?: ReadonlyArray<Finding>;
3226
3276
  /** Every declared procedure — the health map's denominator, served via `getAdvisorProcedures`. */
@@ -3292,84 +3342,34 @@ interface EmitShardOptions {
3292
3342
  }
3293
3343
  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
3344
  /**
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.
3345
+ * Emit `_generated/containers.ts` — one container-enabled Durable Object class
3346
+ * per `defineContainer` export, each a thin subclass of `LunoraContainer`
3347
+ * (`@lunora/container/do`) constructed with the user's definition object. The
3348
+ * worker entry must re-export these classes: wrangler requires every
3349
+ * `containers[].class_name` to be exported by the deployed worker. Returns ""
3350
+ * when the project declares no containers (the file is not written then).
3351
3351
  */
3352
- declare const emitScheduler: (hasScheduler: boolean) => string;
3353
- declare const emitCrons: (crons: ReadonlyArray<CronJobIR>) => string;
3352
+ declare const emitContainers: (containers: ReadonlyArray<ContainerIR>, jurisdiction?: JurisdictionIR) => string;
3354
3353
  /**
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.
3354
+ * Emit `_generated/workflows.ts` — one `WorkflowEntrypoint` class per
3355
+ * `defineWorkflow` export, each a thin subclass of `LunoraWorkflow`
3356
+ * (`@lunora/workflow/do`) constructed with the user's definition object. The
3357
+ * worker entry must re-export these classes: wrangler requires every
3358
+ * `workflows[].class_name` to be exported by the deployed worker. Returns ""
3359
+ * when the project declares no workflows (the file is not written then).
3364
3360
  */
3365
- declare const emitVectors: (vectorIndexes: ReadonlyArray<VectorIndexIR>) => string;
3361
+ declare const emitWorkflows: (workflows: ReadonlyArray<WorkflowIR>) => string;
3366
3362
  /**
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.
3363
+ * Emit `_generated/agents.ts` — one `WorkflowEntrypoint` class per `defineAgent`
3364
+ * export, each a thin subclass of `LunoraWorkflow` (`@lunora/workflow/do`)
3365
+ * constructed with the compiled agent tool-loop (`compileAgentWorkflow`). Like
3366
+ * `_generated/workflows.ts`, the worker entry must re-export these classes:
3367
+ * wrangler requires every `workflows[].class_name` to be exported by the
3368
+ * deployed worker. Returns "" when the project declares no agents (the file is
3369
+ * not written then).
3371
3370
  */
3372
- declare const emitWranglerCronTriggers: (crons: ReadonlyArray<CronJobIR>) => string[];
3371
+ declare const emitAgents: (agents: ReadonlyArray<AgentIR>) => string;
3372
+ declare const GENERATED_HEADER = "// GENERATED by @lunora/codegen — do not edit.\n// Run `lunora codegen` to regenerate.\n\n";
3373
3373
  /** Which capability methods the generated `defineApp` builder exposes — one flag per package-backed feature the app actually uses. */
3374
3374
  interface EmitAppOptions {
3375
3375
  /**
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
  /**
@@ -3068,9 +3068,6 @@ declare const WORKFLOWS_FILENAME = "workflows.ts";
3068
3068
  * body is runtime-only, so codegen never evaluates it.
3069
3069
  */
3070
3070
  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
3071
  /**
3075
3072
  * Emit `_generated/api.ts` — the typed `api.*` registry (public functions), the
3076
3073
  * `internal.*` registry, and (when the project declares them) the typed
@@ -3122,6 +3119,98 @@ declare const emitApi: (options: EmitApiOptions) => string;
3122
3119
  * is remapped to `lunorash/client`.
3123
3120
  */
3124
3121
  declare const emitCollections: (shapes: ReadonlyArray<ShapeIR>, hasDatabase: boolean, useUmbrella?: boolean) => string;
3122
+ /** Emit `_generated/dataModel.ts` — `Doc<"name">` + `Id<"name">` for every table. */
3123
+ declare const emitDataModel: (schema: SchemaIR) => string;
3124
+ /**
3125
+ * Emit drizzle `sqliteTable` definitions for the project schema, split into
3126
+ * `global` (D1-backed) and `shard` (DO-SQLite-backed) buckets. Tables marked
3127
+ * `.global()` go in the global file; everything else (default root + `.shardBy()`)
3128
+ * goes in the shard file.
3129
+ *
3130
+ * `searchIndexes` are intentionally not emitted — drizzle has no `sqliteTable`
3131
+ * abstraction for FTS5 virtual tables. FTS plumbing is handled by the runtime
3132
+ * outside of drizzle.
3133
+ */
3134
+ declare const emitDrizzleSchema: (schema: SchemaIR, useUmbrella?: boolean) => {
3135
+ global: string;
3136
+ shard: string;
3137
+ };
3138
+ interface EmitFunctionsOptions {
3139
+ agents?: ReadonlyArray<AgentIR>;
3140
+ functions: ReadonlyArray<FunctionIR>;
3141
+ migrations?: ReadonlyArray<MigrationIR>;
3142
+ mutators?: ReadonlyArray<MutatorIR>;
3143
+ shapes?: ReadonlyArray<ShapeIR>;
3144
+ /** Import of a sandbox tool (`browserTool`/`containerTool`) auto-registers the `sandbox:invoke` action. */
3145
+ usesSandbox?: boolean;
3146
+ useUmbrella?: boolean;
3147
+ }
3148
+ declare const emitFunctions: (options: EmitFunctionsOptions) => string;
3149
+ /**
3150
+ * Emit `_generated/crons.ts` from the discovered cron jobs.
3151
+ *
3152
+ * `LUNORA_CRON_TRIGGERS` is the deduplicated schedule array — what lands in
3153
+ * wrangler's `triggers.crons` (the vite plugin reconciles it into
3154
+ * `wrangler.jsonc`, and {@link emitWranglerCronTriggers} renders the same list
3155
+ * for the CLI / docs).
3156
+ *
3157
+ * `LUNORA_CRONS` is the dispatcher map keyed by cron expression, each value a
3158
+ * list of `{ name, functionPath, args }`. Cloudflare's `scheduled()` handler
3159
+ * receives only the cron string, so multiple jobs sharing one expression must
3160
+ * all fire — hence a list per key rather than a single entry.
3161
+ *
3162
+ * Jobs arrive pre-sorted by name (deterministic output); the trigger array
3163
+ * preserves first-seen order of distinct expressions.
3164
+ *
3165
+ * Cloudflare caps a Worker at **3 Cron Triggers** (i.e. 3 distinct cron
3166
+ * expressions). Because the dispatcher fires every job sharing an expression,
3167
+ * many jobs can ride a single trigger — only the count of *distinct* schedules
3168
+ * matters. `lunora codegen` warns when that count exceeds the limit; for
3169
+ * finer-grained scheduling use Durable Object alarms (`@lunora/scheduler`),
3170
+ * which have no such cap.
3171
+ */
3172
+ /**
3173
+ * Emit `_generated/scheduler.ts` — the `SchedulerDO` class re-export, or `""`
3174
+ * when the app has no scheduler (the file is not written then).
3175
+ *
3176
+ * It exists so the class-A composed entry has something to FORWARD. wrangler
3177
+ * binds only what the worker entry exports, and `@lunora/vite` generates that
3178
+ * entry, so a Vite-first app had no file to add the re-export to and
3179
+ * `ctx.scheduler.runAfter` / `runAt` were unreachable.
3180
+ *
3181
+ * Emitted off the same `hasScheduler` that decides whether the builder even HAS
3182
+ * a `.scheduler()` method, and that is the whole point: the plugin composes the
3183
+ * call and the re-export off THIS FILE's existence, so the two cannot disagree.
3184
+ * Keying the plugin on the `wrangler.jsonc` binding instead let a project
3185
+ * declare the binding with no scheduler code and get
3186
+ * `TypeError: ….scheduler is not a function` at worker boot, from inside a
3187
+ * virtual module.
3188
+ *
3189
+ * `@lunora/scheduler` stays scoped — the umbrella ships no `./scheduler`
3190
+ * subpath — and `assertRequiredPackages` already demands the dependency off the
3191
+ * same signal, so the specifier cannot go unresolvable.
3192
+ */
3193
+ declare const emitScheduler: (hasScheduler: boolean) => string;
3194
+ declare const emitCrons: (crons: ReadonlyArray<CronJobIR>) => string;
3195
+ /**
3196
+ * Render `_generated/vectors.ts` — the static registry of every vector index
3197
+ * declared in `schema.ts` (inline `.vectorize()` columns + standalone
3198
+ * `defineVectorIndex()` definitions).
3199
+ *
3200
+ * Cloudflare Vectorize exposes no way to enumerate an account's indexes at
3201
+ * runtime — a binding can `describe()` itself but the worker can't ask "which
3202
+ * indexes exist". So this generated array is the source of truth the studio's
3203
+ * vector browser lists, and the worker's admin route pairs each entry with its
3204
+ * live `describe()` stats. Entries are sorted by name for deterministic output.
3205
+ */
3206
+ declare const emitVectors: (vectorIndexes: ReadonlyArray<VectorIndexIR>) => string;
3207
+ /**
3208
+ * Render the deduplicated cron schedules as a JSON fragment suitable for
3209
+ * splicing into `wrangler.jsonc`'s `triggers.crons`. The vite plugin uses this
3210
+ * (plus the parsed wrangler config) to reconcile generated triggers without the
3211
+ * user hand-editing the file.
3212
+ */
3213
+ declare const emitWranglerCronTriggers: (crons: ReadonlyArray<CronJobIR>) => string[];
3125
3214
  interface EmitServerOptions {
3126
3215
  /** Agents declared via `defineAgent` exports — wires the typed `ctx.agents` producers onto Mutation/Action contexts. */
3127
3216
  agents?: ReadonlyArray<AgentIR>;
@@ -3182,45 +3271,6 @@ interface EmitServerOptions {
3182
3271
  workflows?: ReadonlyArray<WorkflowIR>;
3183
3272
  }
3184
3273
  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
3274
  interface EmitShardOptions {
3225
3275
  advisories?: ReadonlyArray<Finding>;
3226
3276
  /** Every declared procedure — the health map's denominator, served via `getAdvisorProcedures`. */
@@ -3292,84 +3342,34 @@ interface EmitShardOptions {
3292
3342
  }
3293
3343
  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
3344
  /**
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.
3345
+ * Emit `_generated/containers.ts` — one container-enabled Durable Object class
3346
+ * per `defineContainer` export, each a thin subclass of `LunoraContainer`
3347
+ * (`@lunora/container/do`) constructed with the user's definition object. The
3348
+ * worker entry must re-export these classes: wrangler requires every
3349
+ * `containers[].class_name` to be exported by the deployed worker. Returns ""
3350
+ * when the project declares no containers (the file is not written then).
3351
3351
  */
3352
- declare const emitScheduler: (hasScheduler: boolean) => string;
3353
- declare const emitCrons: (crons: ReadonlyArray<CronJobIR>) => string;
3352
+ declare const emitContainers: (containers: ReadonlyArray<ContainerIR>, jurisdiction?: JurisdictionIR) => string;
3354
3353
  /**
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.
3354
+ * Emit `_generated/workflows.ts` — one `WorkflowEntrypoint` class per
3355
+ * `defineWorkflow` export, each a thin subclass of `LunoraWorkflow`
3356
+ * (`@lunora/workflow/do`) constructed with the user's definition object. The
3357
+ * worker entry must re-export these classes: wrangler requires every
3358
+ * `workflows[].class_name` to be exported by the deployed worker. Returns ""
3359
+ * when the project declares no workflows (the file is not written then).
3364
3360
  */
3365
- declare const emitVectors: (vectorIndexes: ReadonlyArray<VectorIndexIR>) => string;
3361
+ declare const emitWorkflows: (workflows: ReadonlyArray<WorkflowIR>) => string;
3366
3362
  /**
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.
3363
+ * Emit `_generated/agents.ts` — one `WorkflowEntrypoint` class per `defineAgent`
3364
+ * export, each a thin subclass of `LunoraWorkflow` (`@lunora/workflow/do`)
3365
+ * constructed with the compiled agent tool-loop (`compileAgentWorkflow`). Like
3366
+ * `_generated/workflows.ts`, the worker entry must re-export these classes:
3367
+ * wrangler requires every `workflows[].class_name` to be exported by the
3368
+ * deployed worker. Returns "" when the project declares no agents (the file is
3369
+ * not written then).
3371
3370
  */
3372
- declare const emitWranglerCronTriggers: (crons: ReadonlyArray<CronJobIR>) => string[];
3371
+ declare const emitAgents: (agents: ReadonlyArray<AgentIR>) => string;
3372
+ declare const GENERATED_HEADER = "// GENERATED by @lunora/codegen — do not edit.\n// Run `lunora codegen` to regenerate.\n\n";
3373
3373
  /** Which capability methods the generated `defineApp` builder exposes — one flag per package-backed feature the app actually uses. */
3374
3374
  interface EmitAppOptions {
3375
3375
  /**
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-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{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-kmm2i4Fw.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-BxnbL9RB.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};
@@ -0,0 +1 @@
1
+ import{G as s,I as n,a as t,d as p,i,p as o,r as d,e as E,c as I,b as T,u as c,v as y}from"./shared-DjUziztz.mjs";import"./LUNORA_ERROR_CODES-C2s0xWQD.mjs";export{s as GENERATED_HEADER,n as IMPORT_PATH_RE,t as assertIdentifier,p as baseSpecifiers,i as isOptionalOnInsert,o as pascalCase,d as renderArgsType,E as renderInsertInterface,I as renderObjectKey,T as renderPropertyKey,c as unwrapOptional,y as validatorToType};
@@ -0,0 +1,3 @@
1
+ import{r as c}from"./json-data-Chfs2Cz5.mjs";import{s as u}from"./paths-C-9fwEgQ.mjs";import{validatorIrToJsonSchema as m,objectSchema as p,LUNORA_ERROR_CODES as i}from"./LUNORA_ERROR_CODES-C2s0xWQD.mjs";import{G as l}from"./shared-DjUziztz.mjs";const d="1.3.2",R={description:"Result is TS-inferred from the function's return type (no `.output()` declared); best-effort — any JSON."},h=e=>{const r=u(e.filePath),o=`${r}:${e.exportName}`;return{description:`Invoke the \`${e.kind}\` \`${o}\` over the Lunora RPC envelope (POST /_lunora/rpc, body \`{ "functionPath": "${o}", "args": { … } }\`).`,errors:i.map((n,s)=>({code:-32e3-s,data:{code:n},message:n})),name:o,params:[{description:"The function's argument object (the RPC envelope's `args`).",name:"args",required:Object.keys(e.args).length>0,schema:p(e.args)}],result:{name:"result",schema:e.output?m(e.output):R},summary:`${e.kind}: ${o}`,"x-lunora-function-kind":e.kind,"x-tags":[{name:r}]}},g=e=>{const r=e.version??"0.0.0",n=e.functions.filter(t=>t.visibility!=="internal"&&t.kind!=="stream").map(t=>h(t)).toSorted((t,a)=>t.name.localeCompare(a.name));return{info:{description:"Auto-generated from @lunora/values-typed functions by @lunora/codegen. Do not edit — run `lunora codegen` to regenerate.",title:"Lunora RPC",version:r},methods:n,openrpc:d}},$=e=>`${JSON.stringify(g(e),void 0,2)}
2
+ `,y=e=>`${l}export const openRpcSpec = ${c(e,"Record<string, unknown>")};
3
+ `;export{d as OPENRPC_VERSION,g as buildOpenRpcDocument,$ as emitOpenRpc,y as emitOpenRpcModule};