@lunora/codegen 1.0.0-alpha.235 → 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 (29) hide show
  1. package/dist/index.d.mts +150 -122
  2. package/dist/index.d.ts +150 -122
  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/{describeErrorLevelFindings-D23VSkFP.mjs → describeErrorLevelFindings-vzaGS9KL.mjs} +1 -1
  10. package/dist/packem_shared/emitAgents-BPFw6ww2.mjs +1 -0
  11. package/dist/packem_shared/emitApi-CJ9ziZnP.mjs +154 -0
  12. package/dist/packem_shared/{emitApp-CTLwFZHO.mjs → emitApp-BGhO5bhT.mjs} +3 -3
  13. package/dist/packem_shared/emitCrons-mkwWkn0R.mjs +69 -0
  14. package/dist/packem_shared/emitDataModel-D3WuEZ4b.mjs +113 -0
  15. package/dist/packem_shared/emitDrizzleSchema-Cv0HtLR3.mjs +15 -0
  16. package/dist/packem_shared/emitFunctions-BqAz1ssY.mjs +249 -0
  17. package/dist/packem_shared/emitServer-BEo_fCY8.mjs +365 -0
  18. package/dist/packem_shared/emitShard-Bu7EKdou.mjs +1 -0
  19. package/dist/packem_shared/fingerprintSchemaSources-L3nGKDQt.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 +3 -3
  26. package/dist/packem_shared/GENERATED_HEADER-Da0OC3EI.mjs +0 -1
  27. package/dist/packem_shared/OPENRPC_VERSION-CL0VnCPW.mjs +0 -3
  28. package/dist/packem_shared/buildOpenApiDocument-C7S5wJCl.mjs +0 -3
  29. package/dist/packem_shared/emit-DUpkZ68h.mjs +0 -2696
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
  /**
@@ -2761,16 +2761,16 @@ interface CodegenResult {
2761
2761
  */
2762
2762
  writtenFiles: ReadonlyArray<string>;
2763
2763
  }
2764
+ declare const sortedUniqueNames: (names: Iterable<string>) => ReadonlyArray<string>;
2764
2765
  /** Deduplicated, sorted names of every ERROR-level advisory in `advisories`. */
2765
2766
  declare const errorAdvisoryNames: (advisories: ReadonlyArray<Pick<Finding, "level" | "name">>) => ReadonlyArray<string>;
2766
2767
  /** Deduplicated, sorted names of every error-level platform diagnostic in `platformDiagnostics`. */
2767
2768
  declare const errorPlatformDiagnosticNames: (platformDiagnostics: ReadonlyArray<Pick<PlatformDiagnostic, "level" | "name">>) => ReadonlyArray<string>;
2768
2769
  /**
2769
- * Convenience read combining both categories from a full {@link CodegenResult}
2770
- * — the shape the Vite plugin's `buildBlockingMessage` needs, which (unlike
2771
- * the CLI's `lunora codegen`/`lunora deploy`) folds ERROR-level advisories and
2772
- * platform diagnostics into a single blocking message with no strict/CI
2773
- * opt-out.
2770
+ * Convenience read combining both categories from a full {@link CodegenResult} —
2771
+ * the shape the bundler plugins need, which (unlike the CLI's `lunora
2772
+ * codegen`/`lunora deploy`) folds ERROR-level advisories and platform
2773
+ * diagnostics into a single blocking message with no strict/CI opt-out.
2774
2774
  */
2775
2775
  declare const describeErrorLevelFindings: (result: Pick<CodegenResult, "advisories" | "platformDiagnostics">) => {
2776
2776
  advisoryNames: ReadonlyArray<string>;
@@ -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
  /**
@@ -3786,6 +3786,34 @@ declare const evaluateSchemaDrift: (options: {
3786
3786
  /** This run's declared migrations, so a new one is matched to the table it iterates. */
3787
3787
  migrations: ReadonlyArray<Pick<MigrationIR, "id" | "table">>;
3788
3788
  }) => SchemaDriftDecision;
3789
+ /**
3790
+ * Content hash of the schema directory's TypeScript sources — everything codegen
3791
+ * reads, minus its own `_generated/` output.
3792
+ *
3793
+ * Taken before codegen runs and compared against the previous run's, this is what
3794
+ * tells a developer's save apart from a write the `postcodegen` hook made itself.
3795
+ * Timing cannot: both look identical to a watcher, which is why every save during
3796
+ * a multi-second hook used to be dropped outright. Content can — a formatter that
3797
+ * rewrites a file to the same bytes leaves the hash alone, and a real edit does not.
3798
+ *
3799
+ * Crucially the set EXCLUDES `_generated/`, so a hook that rewrites generated
3800
+ * output (a formatter, a codemod) does not read as a source change. That is what
3801
+ * lets a bundler plugin watch the whole schema directory — the only way a newly
3802
+ * created `lunora/foo.ts` is ever noticed — without the hook's own writes
3803
+ * retriggering it forever.
3804
+ *
3805
+ * The file set comes from codegen's own `listLunoraSourceFiles` (plus
3806
+ * `schema.ts`, which discovery loads separately), so "what codegen reads" is one
3807
+ * decision rather than two that drift: a `readdirSync` walk of its own silently
3808
+ * disagreed about symlinked sources, which is exactly the case where a
3809
+ * regeneration must not be judged a no-op.
3810
+ *
3811
+ * Cheap by construction (a schema directory is a handful of files, read once per
3812
+ * regeneration, not per watcher event). An unreadable directory hashes to a
3813
+ * constant so a transient read error reads as "no change" rather than as an
3814
+ * edit — degrading toward doing nothing, never toward a spurious rerun.
3815
+ */
3816
+ declare const fingerprintSchemaSources: (schemaDirectory: string) => string;
3789
3817
  /**
3790
3818
  * Convert a {@link SchemaIR} into a synthetic runtime {@link Schema} carrying just
3791
3819
  * the `tables[name].shape` surface `@lunora/seed` introspects. System columns
@@ -4101,4 +4129,4 @@ declare const secretKindOf: (value: string) => string | undefined;
4101
4129
  /** A redacted preview of a secret value — first 4 chars plus its length, never the full value. */
4102
4130
  declare const redact: (value: string) => string;
4103
4131
  declare const VERSION = "0.0.0";
4104
- export { AGENTS_FILENAME, type AgentIR, type AuthApiCallIR, CONTAINERS_FILENAME, CodegenDiagnosticError, type CodegenOptions, type CodegenResult, type ContainerIR, type ContextPropertyCallIR, type CronJobIR, DEFAULT_TARGET, type DriftChange, type DriftRemediation, type DriftScope, type EmitAppOptions, FLAGS_FILENAME, type FieldSnapshot, type FlagsIR, type FunctionIR, GENERATED_HEADER, type HttpRouteIR, type IndexIR, type IndexSnapshot, type InsertWriteIR, LUNORA_ERROR_CODES, type LintSchemaOptions, type LoadedProjectConfig, type LunoraProjectConfig, MUTATORS_FILENAME, type MaskProcedureIR, type MigrationIR, type MutatorIR, NOTIFY_FILENAME, OPENRPC_VERSION, type OpenApiEmitInput, type OpenRpcDocument, type OpenRpcEmitInput, type OpenRpcMethod, PROJECT_CONFIG_FILENAMES, type PlatformDiagnostic, type ProjectConfigLiterals, type ProjectIR, QUEUES_FILENAME, type QueryReadIR, type QueueIR, type RelationSnapshot, type RlsMetadataIR, type RlsPolicyIR, type RlsProcedureIR, type RlsRoleIR, type RuntimeVerb, SCHEMA_SNAPSHOT_FILENAME, SCHEMA_SNAPSHOT_VERSION, SDK_LANGUAGES, SDK_TARGETS, SHAPES_FILENAME, type SandboxUsage, type SchemaDrift, type SchemaDriftDecision, type SchemaIR, type SchemaSnapshot, SchemaSnapshotParseError, type SdkFiles, type SdkMethod, type SdkNamespace, type SdkRenderInput, type SdkResult, type SdkTarget, type ShapeIR, type StorageRuleIR, type StorageRulesMetadataIR, type TableIR, type TableSnapshot, VERSION, type ValidatorIR, type VectorIndexIR, WORKFLOWS_FILENAME, type WorkflowIR, type WranglerVariableIR, buildOpenApiDocument, buildOpenRpcDocument, buildSchemaSnapshot, createCodegenProject, describeErrorLevelFindings, diagnosticAt, diffSchemaSnapshots, discoverAgents, discoverAuthApiCalls, discoverContainers, discoverCrons, discoverFlags, discoverFunctions, discoverHttpRoutes, discoverHyperdriveCalls, discoverInserts, discoverMaskProcedures, discoverMigrations, discoverMutators, discoverNondeterministicCalls, discoverNotifyCalls, discoverNotifyConfig, discoverQueries, discoverQueues, discoverR2sqlCalls, discoverRlsMetadata, discoverRlsProcedures, discoverSandboxUsage, discoverSchema, discoverShapes, discoverStorageRulesMetadata, discoverWorkflows, emitAgents, emitApi, emitApp, emitCollections, emitContainers, emitCrons, emitDataModel, emitDrizzleSchema, emitFunctions, emitOpenApi, emitOpenApiModule, emitOpenRpc, emitOpenRpcModule, emitScheduler, emitServer, emitShard, emitVectors, emitWorkflows, emitWranglerCronTriggers, errorAdvisoryNames, errorPlatformDiagnosticNames, evaluateSchemaDrift, findProjectConfigFile, findTsconfig, formatAdvisories, generateSdk, isD1GlobalTable, isHyperdriveGlobalTable, isTypedSchema, lintSchema, listLunoraSourceFiles, loadProjectConfig, parseSchemaSnapshot, platformMatrixIds, readPackageDependencies, readProjectConfigLiterals, readProjectTarget, redact, refreshCodegenProject, resolveCodegenTarget, runCodegen, schemaFromIr, secretKindOf, serializeSchemaSnapshot, toAdvisorContext, validatorIrToJsonSchema };
4132
+ export { AGENTS_FILENAME, type AgentIR, type AuthApiCallIR, CONTAINERS_FILENAME, CodegenDiagnosticError, type CodegenOptions, type CodegenResult, type ContainerIR, type ContextPropertyCallIR, type CronJobIR, DEFAULT_TARGET, type DriftChange, type DriftRemediation, type DriftScope, type EmitAppOptions, FLAGS_FILENAME, type FieldSnapshot, type FlagsIR, type FunctionIR, GENERATED_HEADER, type HttpRouteIR, type IndexIR, type IndexSnapshot, type InsertWriteIR, LUNORA_ERROR_CODES, type LintSchemaOptions, type LoadedProjectConfig, type LunoraProjectConfig, MUTATORS_FILENAME, type MaskProcedureIR, type MigrationIR, type MutatorIR, NOTIFY_FILENAME, OPENRPC_VERSION, type OpenApiEmitInput, type OpenRpcDocument, type OpenRpcEmitInput, type OpenRpcMethod, PROJECT_CONFIG_FILENAMES, type PlatformDiagnostic, type ProjectConfigLiterals, type ProjectIR, QUEUES_FILENAME, type QueryReadIR, type QueueIR, type RelationSnapshot, type RlsMetadataIR, type RlsPolicyIR, type RlsProcedureIR, type RlsRoleIR, type RuntimeVerb, SCHEMA_SNAPSHOT_FILENAME, SCHEMA_SNAPSHOT_VERSION, SDK_LANGUAGES, SDK_TARGETS, SHAPES_FILENAME, type SandboxUsage, type SchemaDrift, type SchemaDriftDecision, type SchemaIR, type SchemaSnapshot, SchemaSnapshotParseError, type SdkFiles, type SdkMethod, type SdkNamespace, type SdkRenderInput, type SdkResult, type SdkTarget, type ShapeIR, type StorageRuleIR, type StorageRulesMetadataIR, type TableIR, type TableSnapshot, VERSION, type ValidatorIR, type VectorIndexIR, WORKFLOWS_FILENAME, type WorkflowIR, type WranglerVariableIR, buildOpenApiDocument, buildOpenRpcDocument, buildSchemaSnapshot, createCodegenProject, describeErrorLevelFindings, diagnosticAt, diffSchemaSnapshots, discoverAgents, discoverAuthApiCalls, discoverContainers, discoverCrons, discoverFlags, discoverFunctions, discoverHttpRoutes, discoverHyperdriveCalls, discoverInserts, discoverMaskProcedures, discoverMigrations, discoverMutators, discoverNondeterministicCalls, discoverNotifyCalls, discoverNotifyConfig, discoverQueries, discoverQueues, discoverR2sqlCalls, discoverRlsMetadata, discoverRlsProcedures, discoverSandboxUsage, discoverSchema, discoverShapes, discoverStorageRulesMetadata, discoverWorkflows, emitAgents, emitApi, emitApp, emitCollections, emitContainers, emitCrons, emitDataModel, emitDrizzleSchema, emitFunctions, emitOpenApi, emitOpenApiModule, emitOpenRpc, emitOpenRpcModule, emitScheduler, emitServer, emitShard, emitVectors, emitWorkflows, emitWranglerCronTriggers, errorAdvisoryNames, errorPlatformDiagnosticNames, evaluateSchemaDrift, findProjectConfigFile, findTsconfig, fingerprintSchemaSources, formatAdvisories, generateSdk, isD1GlobalTable, isHyperdriveGlobalTable, isTypedSchema, lintSchema, listLunoraSourceFiles, loadProjectConfig, parseSchemaSnapshot, platformMatrixIds, readPackageDependencies, readProjectConfigLiterals, readProjectTarget, redact, refreshCodegenProject, resolveCodegenTarget, runCodegen, schemaFromIr, secretKindOf, serializeSchemaSnapshot, sortedUniqueNames, toAdvisorContext, validatorIrToJsonSchema };
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}from"./packem_shared/describeErrorLevelFindings-D23VSkFP.mjs";import{CodegenDiagnosticError as x,diagnosticAt as E}from"./packem_shared/CodegenDiagnosticError-BUXlG3P-.mjs";import{AGENTS_FILENAME as u,discoverAgents as v}from"./packem_shared/AGENTS_FILENAME-DoPI92Wu.mjs";import{listLunoraSourceFiles as g}from"./packem_shared/listLunoraSourceFiles-DP-5e-RE.mjs";import{default as O}from"./packem_shared/discoverAuthApiCalls-FxrdBeVt.mjs";import{CONTAINERS_FILENAME as M,discoverContainers as T}from"./packem_shared/CONTAINERS_FILENAME-B6TFs82W.mjs";import{default as h}from"./packem_shared/discoverCrons-MfKw7IFf.mjs";import{FLAGS_FILENAME as F,discoverFlags as I}from"./packem_shared/FLAGS_FILENAME-BedPDCsR.mjs";import{default as D}from"./packem_shared/discoverFunctions-BsmX-sEq.mjs";import{default as U}from"./packem_shared/discoverHttpRoutes-BcXI9CNt.mjs";import{default as H}from"./packem_shared/discoverHyperdriveCalls-D9qXqTq3.mjs";import{default as y}from"./packem_shared/discoverInserts-CFJ3IVeI.mjs";import{d as W}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 q}from"./packem_shared/discoverNondeterministicCalls-CSQ_GDcA.mjs";import{NOTIFY_FILENAME as Y,discoverNotifyCalls as X,discoverNotifyConfig as Z}from"./packem_shared/NOTIFY_FILENAME-Cri3NT5U.mjs";import{default as ee}from"./packem_shared/readPackageDependencies-C6h6FZuP.mjs";import{d as oe}from"./packem_shared/queries-B-f4jO-x.mjs";import{QUEUES_FILENAME as se,discoverQueues as ae}from"./packem_shared/QUEUES_FILENAME-CxkPcMH1.mjs";import{default as me}from"./packem_shared/discoverR2sqlCalls-fu7fC0i_.mjs";import{default as fe}from"./packem_shared/discoverRlsProcedures-BO4qC77y.mjs";import{default as ce}from"./packem_shared/discoverRlsMetadata-CPmAGL0W.mjs";import{discoverSandboxUsage as le}from"./packem_shared/discoverSandboxUsage-CgmfgDTS.mjs";import{default as xe}from"./packem_shared/discoverSchema-D8DBDHEg.mjs";import{SHAPES_FILENAME as Ae,discoverShapes as ue}from"./packem_shared/SHAPES_FILENAME-zJgzynXR.mjs";import{default as Ne}from"./packem_shared/discoverStorageRulesMetadata-D8VYflWt.mjs";import{WORKFLOWS_FILENAME as Ce,discoverWorkflows as Oe}from"./packem_shared/WORKFLOWS_FILENAME-B_ZJxRSx.mjs";import{G as Me,e as Te,a as _e,b as he,c as Le,d as Fe,f as Ie,g as Pe,h as De,i as Ge,j as Ue,k as be,l as He,m as je,n as ye}from"./packem_shared/emit-DUpkZ68h.mjs";import{emitApp as We}from"./packem_shared/emitApp-CTLwFZHO.mjs";import{isD1GlobalTable as Ve,isHyperdriveGlobalTable as ze}from"./packem_shared/isD1GlobalTable-udvHAAzD.mjs";import{buildOpenApiDocument as we,emitOpenApi as Je,emitOpenApiModule as qe}from"./packem_shared/buildOpenApiDocument-C7S5wJCl.mjs";import{OPENRPC_VERSION as Ye,buildOpenRpcDocument as Xe,emitOpenRpc as Ze,emitOpenRpcModule as $e}from"./packem_shared/OPENRPC_VERSION-CL0VnCPW.mjs";import{DEFAULT_TARGET as rr,platformMatrixIds as or,readProjectTarget as tr,resolveCodegenTarget as sr}from"./packem_shared/DEFAULT_TARGET-kmm2i4Fw.mjs";import{loadProjectConfig as ir,readProjectConfigLiterals as mr}from"./packem_shared/loadProjectConfig-CKsFNgn3.mjs";import{SCHEMA_SNAPSHOT_FILENAME as fr,createCodegenProject as pr,findTsconfig as cr,refreshCodegenProject as nr,runCodegen as lr}from"./packem_shared/SCHEMA_SNAPSHOT_FILENAME-BtMVx-4j.mjs";import{SchemaSnapshotParseError as xr,buildSchemaSnapshot as Er,evaluateSchemaDrift as Ar,parseSchemaSnapshot as ur}from"./packem_shared/SchemaSnapshotParseError-CPOXlFhI.mjs";import{schemaFromIr as Nr}from"./packem_shared/schemaFromIr-BWFnvCVg.mjs";import{LUNORA_ERROR_CODES as Cr,validatorIrToJsonSchema as Or}from"./packem_shared/LUNORA_ERROR_CODES-C2s0xWQD.mjs";import{SDK_LANGUAGES as Mr,SDK_TARGETS as Tr,generateSdk as _r}from"./packem_shared/SDK_LANGUAGES-Df_CnJx5.mjs";import{redact as Lr,secretKindOf as Fr}from"./packem_shared/redact-Cy14LEnc.mjs";import{MESSAGE_SOLUTIONS as Pr,findSolutionByMessage as Dr}from"@lunora/errors";import{PROJECT_CONFIG_FILENAMES as Ur,findProjectConfigFile as br}from"./packem_shared/PROJECT_CONFIG_FILENAMES-DzOu-lSc.mjs";import{isTypedSchema as jr}from"./packem_shared/isTypedSchema-CKzc3ioR.mjs";const e="0.0.0";export{u as AGENTS_FILENAME,M as CONTAINERS_FILENAME,x as CodegenDiagnosticError,rr as DEFAULT_TARGET,F as FLAGS_FILENAME,Me as GENERATED_HEADER,Cr as LUNORA_ERROR_CODES,Pr as LUNORA_SOLUTION_RULES,Q as MUTATORS_FILENAME,Y as NOTIFY_FILENAME,Ye as OPENRPC_VERSION,Ur as PROJECT_CONFIG_FILENAMES,se as QUEUES_FILENAME,fr as SCHEMA_SNAPSHOT_FILENAME,t as SCHEMA_SNAPSHOT_VERSION,Mr as SDK_LANGUAGES,Tr as SDK_TARGETS,Ae as SHAPES_FILENAME,xr as SchemaSnapshotParseError,e as VERSION,Ce as WORKFLOWS_FILENAME,we as buildOpenApiDocument,Xe as buildOpenRpcDocument,Er as buildSchemaSnapshot,pr as createCodegenProject,c as describeErrorLevelFindings,E as diagnosticAt,s as diffSchemaSnapshots,v as discoverAgents,O as discoverAuthApiCalls,T as discoverContainers,h as discoverCrons,I as discoverFlags,D as discoverFunctions,U as discoverHttpRoutes,H as discoverHyperdriveCalls,y as discoverInserts,W as discoverMaskProcedures,V as discoverMigrations,w as discoverMutators,q as discoverNondeterministicCalls,X as discoverNotifyCalls,Z as discoverNotifyConfig,oe as discoverQueries,ae as discoverQueues,me as discoverR2sqlCalls,ce as discoverRlsMetadata,fe as discoverRlsProcedures,le as discoverSandboxUsage,xe as discoverSchema,ue as discoverShapes,Ne as discoverStorageRulesMetadata,Oe as discoverWorkflows,Te as emitAgents,_e as emitApi,We as emitApp,he as emitCollections,Le as emitContainers,Fe as emitCrons,Ie as emitDataModel,Pe as emitDrizzleSchema,De as emitFunctions,Je as emitOpenApi,qe as emitOpenApiModule,Ze as emitOpenRpc,$e as emitOpenRpcModule,Ge as emitScheduler,Ue as emitServer,be as emitShard,He as emitVectors,je as emitWorkflows,ye as emitWranglerCronTriggers,n as errorAdvisoryNames,l as errorPlatformDiagnosticNames,Ar as evaluateSchemaDrift,Dr as findLunoraSolution,br as findProjectConfigFile,cr as findTsconfig,m as formatAdvisories,_r as generateSdk,Ve as isD1GlobalTable,ze as isHyperdriveGlobalTable,jr as isTypedSchema,d as lintSchema,g as listLunoraSourceFiles,ir as loadProjectConfig,ur as parseSchemaSnapshot,or as platformMatrixIds,ee as readPackageDependencies,mr as readProjectConfigLiterals,tr as readProjectTarget,Lr as redact,nr as refreshCodegenProject,sr as resolveCodegenTarget,lr as runCodegen,Nr as schemaFromIr,Fr as secretKindOf,a as serializeSchemaSnapshot,f as toAdvisorContext,Or 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};