@lunora/codegen 1.0.0-alpha.321 → 1.0.0-alpha.323

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -3200,8 +3200,8 @@ interface PlatformDiagnostic {
3200
3200
  level: "error" | "warn";
3201
3201
  /** Human-readable explanation of the gap. */
3202
3202
  message: string;
3203
- /** The lint id: `platform_unsupported_feature`, `platform_undeclared_feature`, `platform_unknown_target`, `platform_unreadable_target` or `platform_vector_dimensions_out_of_range`. */
3204
- name: "platform_undeclared_feature" | "platform_unknown_target" | "platform_unreadable_target" | "platform_unsupported_feature" | "platform_vector_dimensions_out_of_range";
3203
+ /** The lint id: one of the `platform_*` names in the union below. */
3204
+ name: "platform_live_stream_delivery_authorization" | "platform_undeclared_feature" | "platform_unknown_target" | "platform_unreadable_target" | "platform_unsupported_feature" | "platform_vector_dimensions_out_of_range";
3205
3205
  /** How to resolve it. */
3206
3206
  remediation: string;
3207
3207
  /** The requested deploy target. */
@@ -4060,6 +4060,12 @@ interface EmitShardOptions {
4060
4060
  hasVectors?: boolean;
4061
4061
  /** User function handlers are imported through generated per-module loaders. */
4062
4062
  lazyFunctions?: boolean;
4063
+ /**
4064
+ * The app declares a `defineLiveStream` that the target serves (post platform
4065
+ * gate) — wires `ctx.live.publish` onto the action ctx, so an action running on
4066
+ * this shard (a scheduled job) publishes to its own stream subscribers.
4067
+ */
4068
+ liveStreams?: boolean;
4063
4069
  maskMetadata?: MaskMetadataIR;
4064
4070
  /** Custom mutators declared via `defineMutator` in `lunora/mutators.ts` — wires the `isCustomMutator` push-protocol override. */
4065
4071
  mutators?: ReadonlyArray<MutatorIR>;
@@ -4087,7 +4093,7 @@ interface EmitShardOptions {
4087
4093
  useUmbrella?: boolean;
4088
4094
  workflows?: ReadonlyArray<WorkflowIR>;
4089
4095
  }
4090
- declare const emitShard: ({ advisories, advisorProcedures, agents, capabilities, containers, env, flagKeys, hasFlags, hasNotify, hasRooms, lazyFunctions, hasVectors, maskMetadata, mutators, queues, rlsMetadata, schema, schemaSnapshot, shapes, storageRules, studioFeatures, services, topics, useUmbrella, workflows }: EmitShardOptions) => string;
4096
+ declare const emitShard: ({ advisories, advisorProcedures, agents, capabilities, containers, env, flagKeys, hasFlags, hasNotify, hasRooms, lazyFunctions, hasVectors, liveStreams, maskMetadata, mutators, queues, rlsMetadata, schema, schemaSnapshot, shapes, storageRules, studioFeatures, services, topics, useUmbrella, workflows }: EmitShardOptions) => string;
4091
4097
  /**
4092
4098
  * Emit `_generated/containers.ts` — one container-enabled Durable Object class
4093
4099
  * per `defineContainer` export, each a thin subclass of `LunoraContainer`
@@ -4143,6 +4149,13 @@ interface EmitAppOptions {
4143
4149
  hasAccess: boolean;
4144
4150
  /** App depends on `@lunora/auth` → emit `.auth()` + the lazy build/migrate dance. */
4145
4151
  hasAuth: boolean;
4152
+ /**
4153
+ * `false` withholds the `.deliveryAuthorization(...)` builder method and its
4154
+ * `createShardDO` config plumbing — the verdict of the platform gate for the
4155
+ * target's matrix, not the app's usage. Absent means emitted, as before the
4156
+ * gate existed.
4157
+ */
4158
+ hasDeliveryAuthorization?: boolean;
4146
4159
  /** App depends on a worker-composition framework adapter (`@lunora/astro`/`@lunora/svelte`/`@lunora/vue`), or hand-composes one in `src/worker.ts` → emit `.buildFrameworkWorker(host)`. */
4147
4160
  hasFramework: boolean;
4148
4161
  /** Schema declares **D1-backed** `.global()` tables → emit `.global()` (D1 ctx-db + studio introspector + cross-shard relations). */
@@ -4201,6 +4214,18 @@ interface EmitAppOptions {
4201
4214
  * auth object (codegen refuses a project it can see doing that).
4202
4215
  */
4203
4216
  jurisdictionPinsAuth?: boolean;
4217
+ /**
4218
+ * The app declares a `defineLiveStream` the target serves (post platform gate) →
4219
+ * the queue consumer forwards the runtime's publisher as `ctx.live`. Absent or
4220
+ * `false` leaves the consumer without `ctx.live`.
4221
+ */
4222
+ liveStreams?: boolean;
4223
+ /**
4224
+ * The target withholds live streams (`PlatformGateResult.liveStreamsWithheld`).
4225
+ * Emitted as `liveStreams: false` on `createWorker`, so the HTTP context carries
4226
+ * no `ctx.live`. Absent or `false` leaves the emitted options unchanged.
4227
+ */
4228
+ liveStreamsWithheld?: boolean;
4204
4229
  /**
4205
4230
  * Every table the schema declares, with its shard mode. Emitted as a literal
4206
4231
  * table map backing `listSchemaTables` and `resolveTableSharding`: export
package/dist/index.d.ts CHANGED
@@ -3200,8 +3200,8 @@ interface PlatformDiagnostic {
3200
3200
  level: "error" | "warn";
3201
3201
  /** Human-readable explanation of the gap. */
3202
3202
  message: string;
3203
- /** The lint id: `platform_unsupported_feature`, `platform_undeclared_feature`, `platform_unknown_target`, `platform_unreadable_target` or `platform_vector_dimensions_out_of_range`. */
3204
- name: "platform_undeclared_feature" | "platform_unknown_target" | "platform_unreadable_target" | "platform_unsupported_feature" | "platform_vector_dimensions_out_of_range";
3203
+ /** The lint id: one of the `platform_*` names in the union below. */
3204
+ name: "platform_live_stream_delivery_authorization" | "platform_undeclared_feature" | "platform_unknown_target" | "platform_unreadable_target" | "platform_unsupported_feature" | "platform_vector_dimensions_out_of_range";
3205
3205
  /** How to resolve it. */
3206
3206
  remediation: string;
3207
3207
  /** The requested deploy target. */
@@ -4060,6 +4060,12 @@ interface EmitShardOptions {
4060
4060
  hasVectors?: boolean;
4061
4061
  /** User function handlers are imported through generated per-module loaders. */
4062
4062
  lazyFunctions?: boolean;
4063
+ /**
4064
+ * The app declares a `defineLiveStream` that the target serves (post platform
4065
+ * gate) — wires `ctx.live.publish` onto the action ctx, so an action running on
4066
+ * this shard (a scheduled job) publishes to its own stream subscribers.
4067
+ */
4068
+ liveStreams?: boolean;
4063
4069
  maskMetadata?: MaskMetadataIR;
4064
4070
  /** Custom mutators declared via `defineMutator` in `lunora/mutators.ts` — wires the `isCustomMutator` push-protocol override. */
4065
4071
  mutators?: ReadonlyArray<MutatorIR>;
@@ -4087,7 +4093,7 @@ interface EmitShardOptions {
4087
4093
  useUmbrella?: boolean;
4088
4094
  workflows?: ReadonlyArray<WorkflowIR>;
4089
4095
  }
4090
- declare const emitShard: ({ advisories, advisorProcedures, agents, capabilities, containers, env, flagKeys, hasFlags, hasNotify, hasRooms, lazyFunctions, hasVectors, maskMetadata, mutators, queues, rlsMetadata, schema, schemaSnapshot, shapes, storageRules, studioFeatures, services, topics, useUmbrella, workflows }: EmitShardOptions) => string;
4096
+ declare const emitShard: ({ advisories, advisorProcedures, agents, capabilities, containers, env, flagKeys, hasFlags, hasNotify, hasRooms, lazyFunctions, hasVectors, liveStreams, maskMetadata, mutators, queues, rlsMetadata, schema, schemaSnapshot, shapes, storageRules, studioFeatures, services, topics, useUmbrella, workflows }: EmitShardOptions) => string;
4091
4097
  /**
4092
4098
  * Emit `_generated/containers.ts` — one container-enabled Durable Object class
4093
4099
  * per `defineContainer` export, each a thin subclass of `LunoraContainer`
@@ -4143,6 +4149,13 @@ interface EmitAppOptions {
4143
4149
  hasAccess: boolean;
4144
4150
  /** App depends on `@lunora/auth` → emit `.auth()` + the lazy build/migrate dance. */
4145
4151
  hasAuth: boolean;
4152
+ /**
4153
+ * `false` withholds the `.deliveryAuthorization(...)` builder method and its
4154
+ * `createShardDO` config plumbing — the verdict of the platform gate for the
4155
+ * target's matrix, not the app's usage. Absent means emitted, as before the
4156
+ * gate existed.
4157
+ */
4158
+ hasDeliveryAuthorization?: boolean;
4146
4159
  /** App depends on a worker-composition framework adapter (`@lunora/astro`/`@lunora/svelte`/`@lunora/vue`), or hand-composes one in `src/worker.ts` → emit `.buildFrameworkWorker(host)`. */
4147
4160
  hasFramework: boolean;
4148
4161
  /** Schema declares **D1-backed** `.global()` tables → emit `.global()` (D1 ctx-db + studio introspector + cross-shard relations). */
@@ -4201,6 +4214,18 @@ interface EmitAppOptions {
4201
4214
  * auth object (codegen refuses a project it can see doing that).
4202
4215
  */
4203
4216
  jurisdictionPinsAuth?: boolean;
4217
+ /**
4218
+ * The app declares a `defineLiveStream` the target serves (post platform gate) →
4219
+ * the queue consumer forwards the runtime's publisher as `ctx.live`. Absent or
4220
+ * `false` leaves the consumer without `ctx.live`.
4221
+ */
4222
+ liveStreams?: boolean;
4223
+ /**
4224
+ * The target withholds live streams (`PlatformGateResult.liveStreamsWithheld`).
4225
+ * Emitted as `liveStreams: false` on `createWorker`, so the HTTP context carries
4226
+ * no `ctx.live`. Absent or `false` leaves the emitted options unchanged.
4227
+ */
4228
+ liveStreamsWithheld?: boolean;
4204
4229
  /**
4205
4230
  * Every table the schema declares, with its shard mode. Emitted as a literal
4206
4231
  * table map backing `listSchemaTables` and `resolveTableSharding`: export
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 f,toAdvisorContext as p}from"./packem_shared/formatAdvisories-BCVASH7N.mjs";import{describeErrorLevelFindings as n,errorAdvisoryNames as l,errorPlatformDiagnosticNames as c,sortedUniqueNames as x}from"./packem_shared/describeErrorLevelFindings-vzaGS9KL.mjs";import{CAPABILITY_PROBES as E}from"./packem_shared/CAPABILITY_PROBES-brcmKenl.mjs";import{CodegenDiagnosticError as A,diagnosticAt as v}from"./packem_shared/CodegenDiagnosticError-BUXlG3P-.mjs";import{AGENTS_FILENAME as N,discoverAgents as g}from"./packem_shared/AGENTS_FILENAME-B6-kjzM3.mjs";import{isTestPath as R,listLunoraSourceFiles as T}from"./packem_shared/isTestPath-B81lOULB.mjs";import{default as I}from"./packem_shared/discoverAuthApiCalls-xs0ONfI-.mjs";import{CONTAINERS_FILENAME as L,discoverContainers as M}from"./packem_shared/CONTAINERS_FILENAME-dFRtAyIe.mjs";import{default as P}from"./packem_shared/discoverCrons-DBnCama4.mjs";import{capabilitiesUsedBy as b,foldCapabilitySignals as y,mayReadCapabilityContext as U,sourceCapabilitySignals as G}from"./packem_shared/capabilitiesUsedBy-QgSZyE0T.mjs";import{FLAGS_FILENAME as j,discoverFlags as B}from"./packem_shared/FLAGS_FILENAME-Bf0MSlHH.mjs";import{default as W}from"./packem_shared/discoverFunctions-CZgLhsMn.mjs";import{default as V}from"./packem_shared/discoverHttpRoutes-WBAqBcfK.mjs";import{default as Q}from"./packem_shared/discoverHyperdriveCalls-DV4IglLE.mjs";import{default as w}from"./packem_shared/discoverInserts-BjxXCACZ.mjs";import{d as Y}from"./packem_shared/index-JnqBWRYO.mjs";import{default as Z}from"./packem_shared/discoverMigrations-C9mLIhGZ.mjs";import{MUTATORS_FILENAME as ee,discoverMutators as re}from"./packem_shared/MUTATORS_FILENAME-Jkk8Zgkb.mjs";import{default as te}from"./packem_shared/discoverNondeterministicCalls-DvhyKM-f.mjs";import{NOTIFY_FILENAME as ae,discoverNotifyCalls as ie,discoverNotifyChannels as me,discoverNotifyConfig as fe}from"./packem_shared/NOTIFY_FILENAME-bAt7J3cs.mjs";import{default as de}from"./packem_shared/readPackageDependencies-RHhGiz0k.mjs";import{default as le}from"./packem_shared/discoverQueries-C8E7TeRT.mjs";import{QUEUES_FILENAME as xe,discoverQueues as Se}from"./packem_shared/QUEUES_FILENAME-CsRy4VTF.mjs";import{default as ue}from"./packem_shared/discoverR2sqlCalls-DVcfMO6-.mjs";import{default as ve}from"./packem_shared/discoverRlsProcedures-Du7ITNTQ.mjs";import{default as Ne}from"./packem_shared/discoverRlsMetadata-QRsWRQbM.mjs";import{discoverSandboxUsage as Oe}from"./packem_shared/discoverSandboxUsage-w6Q3RvxZ.mjs";import{default as Te}from"./packem_shared/discoverSchema-BtsX-CN9.mjs";import{readServiceBindings as Ie,resolveServiceBindings as _e}from"./packem_shared/readServiceBindings-DvqIThzd.mjs";import{SHAPES_FILENAME as Me,discoverShapes as Fe}from"./packem_shared/SHAPES_FILENAME-DkBUN9dK.mjs";import{default as De}from"./packem_shared/discoverStorageRulesMetadata-ClzKLdCV.mjs";import{WORKFLOWS_FILENAME as ye,discoverWorkflows as Ue}from"./packem_shared/WORKFLOWS_FILENAME-CdeS224T.mjs";import{emitApp as He}from"./packem_shared/emitApp-K6otnCNZ.mjs";import{isD1GlobalTable as Be,isHyperdriveGlobalTable as ke}from"./packem_shared/isD1GlobalTable-udvHAAzD.mjs";import{buildOpenApiDocument as Ke,emitOpenApi as Ve,emitOpenApiModule as ze}from"./packem_shared/buildOpenApiDocument-DFv-RYZU.mjs";import{OPENRPC_VERSION as qe,buildOpenRpcDocument as we,emitOpenRpc as Je,emitOpenRpcModule as Ye}from"./packem_shared/OPENRPC_VERSION-CCY7xqSL.mjs";import{DEFAULT_TARGET as Ze,platformMatrixIds as $e,readProjectTarget as er,resolveCodegenTarget as rr}from"./packem_shared/DEFAULT_TARGET-B0FkdiZq.mjs";import{l as tr,r as sr}from"./packem_shared/project-config-file-BV7RR-l6.mjs";import{SCHEMA_SNAPSHOT_FILENAME as ir,runCodegen as mr}from"./packem_shared/SCHEMA_SNAPSHOT_FILENAME-B6NxV9VM.mjs";import{SchemaSnapshotParseError as pr,buildSchemaSnapshot as dr,evaluateSchemaDrift as nr,parseSchemaSnapshot as lr}from"./packem_shared/SchemaSnapshotParseError-BRJT7c2k.mjs";import{default as xr}from"./packem_shared/fingerprintSchemaSources-eVG9aVt0.mjs";import{schemaFromIr as Er}from"./packem_shared/schemaFromIr-BWFnvCVg.mjs";import{LUNORA_ERROR_CODES as Ar,validatorIrToJsonSchema as vr}from"./packem_shared/LUNORA_ERROR_CODES-C2s0xWQD.mjs";import{SDK_LANGUAGES as Nr,SDK_TARGETS as gr,generateSdk as Or}from"./sdk/index.mjs";import{redact as Tr,secretKindOf as hr}from"./packem_shared/redact-Cy14LEnc.mjs";import{default as _r}from"./packem_shared/emitDrizzleSchema-DitcRZ1a.mjs";import{e as Mr}from"./packem_shared/server-DAvi_bv_.mjs";import{e as Pr}from"./packem_shared/shard-CtYnaXAX.mjs";import{G as br}from"./packem_shared/shared-DnCokNcE.mjs";import{MESSAGE_SOLUTIONS as Ur,findSolutionByMessage as Gr}from"@lunora/errors";import{PROJECT_CONFIG_FILENAMES as jr,findProjectConfigFile as Br}from"./packem_shared/PROJECT_CONFIG_FILENAMES-DzOu-lSc.mjs";import{createCodegenProject as Wr,findTsconfig as Kr,refreshCodegenProject as Vr}from"./packem_shared/createCodegenProject-V51_yBw3.mjs";import{s as Qr,t as qr,u as wr}from"./packem_shared/shard-runtime-BpoCV-aM.mjs";import{emitApi as Yr,emitCollections as Xr,emitInternalApi as Zr}from"./packem_shared/emitApi-CDgIPAG2.mjs";import{emitCrons as eo,emitScheduler as ro,emitVectors as oo,emitWranglerCronTriggers as to}from"./packem_shared/emitCrons-BQW2lviZ.mjs";import{emitDataModel as ao}from"./packem_shared/emitDataModel-BskFt9Wv.mjs";import{emitFunctions as mo}from"./packem_shared/emitFunctions-CuZzKaU4.mjs";import{isTypedSchema as po}from"./packem_shared/isTypedSchema-CKzc3ioR.mjs";const e="0.0.0";export{N as AGENTS_FILENAME,E as CAPABILITY_PROBES,L as CONTAINERS_FILENAME,A as CodegenDiagnosticError,Ze as DEFAULT_TARGET,j as FLAGS_FILENAME,br as GENERATED_HEADER,Ar as LUNORA_ERROR_CODES,Ur as LUNORA_SOLUTION_RULES,ee as MUTATORS_FILENAME,ae as NOTIFY_FILENAME,qe as OPENRPC_VERSION,jr as PROJECT_CONFIG_FILENAMES,xe as QUEUES_FILENAME,ir as SCHEMA_SNAPSHOT_FILENAME,t as SCHEMA_SNAPSHOT_VERSION,Nr as SDK_LANGUAGES,gr as SDK_TARGETS,Me as SHAPES_FILENAME,pr as SchemaSnapshotParseError,e as VERSION,ye as WORKFLOWS_FILENAME,Ke as buildOpenApiDocument,we as buildOpenRpcDocument,dr as buildSchemaSnapshot,b as capabilitiesUsedBy,Wr as createCodegenProject,n as describeErrorLevelFindings,v as diagnosticAt,s as diffSchemaSnapshots,g as discoverAgents,I as discoverAuthApiCalls,M as discoverContainers,P as discoverCrons,B as discoverFlags,W as discoverFunctions,V as discoverHttpRoutes,Q as discoverHyperdriveCalls,w as discoverInserts,Y as discoverMaskProcedures,Z as discoverMigrations,re as discoverMutators,te as discoverNondeterministicCalls,ie as discoverNotifyCalls,me as discoverNotifyChannels,fe as discoverNotifyConfig,le as discoverQueries,Se as discoverQueues,ue as discoverR2sqlCalls,Ne as discoverRlsMetadata,ve as discoverRlsProcedures,Oe as discoverSandboxUsage,Te as discoverSchema,Fe as discoverShapes,De as discoverStorageRulesMetadata,Ue as discoverWorkflows,Qr as emitAgents,Yr as emitApi,He as emitApp,Xr as emitCollections,qr as emitContainers,eo as emitCrons,ao as emitDataModel,_r as emitDrizzleSchema,mo as emitFunctions,Zr as emitInternalApi,Ve as emitOpenApi,ze as emitOpenApiModule,Je as emitOpenRpc,Ye as emitOpenRpcModule,ro as emitScheduler,Mr as emitServer,Pr as emitShard,oo as emitVectors,wr as emitWorkflows,to as emitWranglerCronTriggers,l as errorAdvisoryNames,c as errorPlatformDiagnosticNames,nr as evaluateSchemaDrift,Gr as findLunoraSolution,Br as findProjectConfigFile,Kr as findTsconfig,xr as fingerprintSchemaSources,y as foldCapabilitySignals,m as formatAdvisories,Or as generateSdk,Be as isD1GlobalTable,ke as isHyperdriveGlobalTable,R as isTestPath,po as isTypedSchema,f as lintSchema,T as listLunoraSourceFiles,tr as loadProjectConfig,U as mayReadCapabilityContext,lr as parseSchemaSnapshot,$e as platformMatrixIds,de as readPackageDependencies,sr as readProjectConfigLiterals,er as readProjectTarget,Ie as readServiceBindings,Tr as redact,Vr as refreshCodegenProject,rr as resolveCodegenTarget,_e as resolveServiceBindings,mr as runCodegen,Er as schemaFromIr,hr as secretKindOf,a as serializeSchemaSnapshot,x as sortedUniqueNames,G as sourceCapabilitySignals,p as toAdvisorContext,vr 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 p}from"./packem_shared/formatAdvisories-BCVASH7N.mjs";import{describeErrorLevelFindings as n,errorAdvisoryNames as l,errorPlatformDiagnosticNames as c,sortedUniqueNames as x}from"./packem_shared/describeErrorLevelFindings-vzaGS9KL.mjs";import{CAPABILITY_PROBES as E}from"./packem_shared/CAPABILITY_PROBES-brcmKenl.mjs";import{CodegenDiagnosticError as A,diagnosticAt as v}from"./packem_shared/CodegenDiagnosticError-BUXlG3P-.mjs";import{AGENTS_FILENAME as N,discoverAgents as g}from"./packem_shared/AGENTS_FILENAME-B6-kjzM3.mjs";import{isTestPath as R,listLunoraSourceFiles as T}from"./packem_shared/isTestPath-B81lOULB.mjs";import{default as I}from"./packem_shared/discoverAuthApiCalls-xs0ONfI-.mjs";import{CONTAINERS_FILENAME as L,discoverContainers as M}from"./packem_shared/CONTAINERS_FILENAME-dFRtAyIe.mjs";import{default as P}from"./packem_shared/discoverCrons-DBnCama4.mjs";import{capabilitiesUsedBy as b,foldCapabilitySignals as y,mayReadCapabilityContext as U,sourceCapabilitySignals as G}from"./packem_shared/capabilitiesUsedBy-D3pvpeAt.mjs";import{FLAGS_FILENAME as j,discoverFlags as B}from"./packem_shared/FLAGS_FILENAME-Bf0MSlHH.mjs";import{default as W}from"./packem_shared/discoverFunctions-CZgLhsMn.mjs";import{default as V}from"./packem_shared/discoverHttpRoutes-WBAqBcfK.mjs";import{default as Q}from"./packem_shared/discoverHyperdriveCalls-DV4IglLE.mjs";import{default as w}from"./packem_shared/discoverInserts-BjxXCACZ.mjs";import{d as Y}from"./packem_shared/index-JnqBWRYO.mjs";import{default as Z}from"./packem_shared/discoverMigrations-C9mLIhGZ.mjs";import{MUTATORS_FILENAME as ee,discoverMutators as re}from"./packem_shared/MUTATORS_FILENAME-Jkk8Zgkb.mjs";import{default as te}from"./packem_shared/discoverNondeterministicCalls-DvhyKM-f.mjs";import{NOTIFY_FILENAME as ae,discoverNotifyCalls as ie,discoverNotifyChannels as me,discoverNotifyConfig as fe}from"./packem_shared/NOTIFY_FILENAME-bAt7J3cs.mjs";import{default as de}from"./packem_shared/readPackageDependencies-RHhGiz0k.mjs";import{default as le}from"./packem_shared/discoverQueries-C8E7TeRT.mjs";import{QUEUES_FILENAME as xe,discoverQueues as Se}from"./packem_shared/QUEUES_FILENAME-CsRy4VTF.mjs";import{default as ue}from"./packem_shared/discoverR2sqlCalls-DVcfMO6-.mjs";import{default as ve}from"./packem_shared/discoverRlsProcedures-Du7ITNTQ.mjs";import{default as Ne}from"./packem_shared/discoverRlsMetadata-QRsWRQbM.mjs";import{discoverSandboxUsage as Oe}from"./packem_shared/discoverSandboxUsage-w6Q3RvxZ.mjs";import{default as Te}from"./packem_shared/discoverSchema-BtsX-CN9.mjs";import{readServiceBindings as Ie,resolveServiceBindings as _e}from"./packem_shared/readServiceBindings-DvqIThzd.mjs";import{SHAPES_FILENAME as Me,discoverShapes as Fe}from"./packem_shared/SHAPES_FILENAME-DkBUN9dK.mjs";import{default as De}from"./packem_shared/discoverStorageRulesMetadata-ClzKLdCV.mjs";import{WORKFLOWS_FILENAME as ye,discoverWorkflows as Ue}from"./packem_shared/WORKFLOWS_FILENAME-CdeS224T.mjs";import{emitApp as He}from"./packem_shared/emitApp-DuJW6LKD.mjs";import{isD1GlobalTable as Be,isHyperdriveGlobalTable as ke}from"./packem_shared/isD1GlobalTable-udvHAAzD.mjs";import{buildOpenApiDocument as Ke,emitOpenApi as Ve,emitOpenApiModule as ze}from"./packem_shared/buildOpenApiDocument-DFv-RYZU.mjs";import{OPENRPC_VERSION as qe,buildOpenRpcDocument as we,emitOpenRpc as Je,emitOpenRpcModule as Ye}from"./packem_shared/OPENRPC_VERSION-CCY7xqSL.mjs";import{DEFAULT_TARGET as Ze,platformMatrixIds as $e,readProjectTarget as er,resolveCodegenTarget as rr}from"./packem_shared/DEFAULT_TARGET-DXhxbij-.mjs";import{l as tr,r as sr}from"./packem_shared/project-config-file-BV7RR-l6.mjs";import{SCHEMA_SNAPSHOT_FILENAME as ir,runCodegen as mr}from"./packem_shared/SCHEMA_SNAPSHOT_FILENAME-CU4krosg.mjs";import{SchemaSnapshotParseError as pr,buildSchemaSnapshot as dr,evaluateSchemaDrift as nr,parseSchemaSnapshot as lr}from"./packem_shared/SchemaSnapshotParseError-BRJT7c2k.mjs";import{default as xr}from"./packem_shared/fingerprintSchemaSources-eVG9aVt0.mjs";import{schemaFromIr as Er}from"./packem_shared/schemaFromIr-BWFnvCVg.mjs";import{LUNORA_ERROR_CODES as Ar,validatorIrToJsonSchema as vr}from"./packem_shared/LUNORA_ERROR_CODES-C2s0xWQD.mjs";import{SDK_LANGUAGES as Nr,SDK_TARGETS as gr,generateSdk as Or}from"./sdk/index.mjs";import{redact as Tr,secretKindOf as hr}from"./packem_shared/redact-Cy14LEnc.mjs";import{default as _r}from"./packem_shared/emitDrizzleSchema-DitcRZ1a.mjs";import{e as Mr}from"./packem_shared/server-DAvi_bv_.mjs";import{e as Pr}from"./packem_shared/shard-ceGu_Fps.mjs";import{G as br}from"./packem_shared/shared-DnCokNcE.mjs";import{MESSAGE_SOLUTIONS as Ur,findSolutionByMessage as Gr}from"@lunora/errors";import{PROJECT_CONFIG_FILENAMES as jr,findProjectConfigFile as Br}from"./packem_shared/PROJECT_CONFIG_FILENAMES-DzOu-lSc.mjs";import{createCodegenProject as Wr,findTsconfig as Kr,refreshCodegenProject as Vr}from"./packem_shared/createCodegenProject-V51_yBw3.mjs";import{s as Qr,t as qr,u as wr}from"./packem_shared/shard-runtime-BpoCV-aM.mjs";import{emitApi as Yr,emitCollections as Xr,emitInternalApi as Zr}from"./packem_shared/emitApi-CDgIPAG2.mjs";import{emitCrons as eo,emitScheduler as ro,emitVectors as oo,emitWranglerCronTriggers as to}from"./packem_shared/emitCrons-BQW2lviZ.mjs";import{emitDataModel as ao}from"./packem_shared/emitDataModel-BskFt9Wv.mjs";import{emitFunctions as mo}from"./packem_shared/emitFunctions-CuZzKaU4.mjs";import{isTypedSchema as po}from"./packem_shared/isTypedSchema-CKzc3ioR.mjs";const e="0.0.0";export{N as AGENTS_FILENAME,E as CAPABILITY_PROBES,L as CONTAINERS_FILENAME,A as CodegenDiagnosticError,Ze as DEFAULT_TARGET,j as FLAGS_FILENAME,br as GENERATED_HEADER,Ar as LUNORA_ERROR_CODES,Ur as LUNORA_SOLUTION_RULES,ee as MUTATORS_FILENAME,ae as NOTIFY_FILENAME,qe as OPENRPC_VERSION,jr as PROJECT_CONFIG_FILENAMES,xe as QUEUES_FILENAME,ir as SCHEMA_SNAPSHOT_FILENAME,t as SCHEMA_SNAPSHOT_VERSION,Nr as SDK_LANGUAGES,gr as SDK_TARGETS,Me as SHAPES_FILENAME,pr as SchemaSnapshotParseError,e as VERSION,ye as WORKFLOWS_FILENAME,Ke as buildOpenApiDocument,we as buildOpenRpcDocument,dr as buildSchemaSnapshot,b as capabilitiesUsedBy,Wr as createCodegenProject,n as describeErrorLevelFindings,v as diagnosticAt,s as diffSchemaSnapshots,g as discoverAgents,I as discoverAuthApiCalls,M as discoverContainers,P as discoverCrons,B as discoverFlags,W as discoverFunctions,V as discoverHttpRoutes,Q as discoverHyperdriveCalls,w as discoverInserts,Y as discoverMaskProcedures,Z as discoverMigrations,re as discoverMutators,te as discoverNondeterministicCalls,ie as discoverNotifyCalls,me as discoverNotifyChannels,fe as discoverNotifyConfig,le as discoverQueries,Se as discoverQueues,ue as discoverR2sqlCalls,Ne as discoverRlsMetadata,ve as discoverRlsProcedures,Oe as discoverSandboxUsage,Te as discoverSchema,Fe as discoverShapes,De as discoverStorageRulesMetadata,Ue as discoverWorkflows,Qr as emitAgents,Yr as emitApi,He as emitApp,Xr as emitCollections,qr as emitContainers,eo as emitCrons,ao as emitDataModel,_r as emitDrizzleSchema,mo as emitFunctions,Zr as emitInternalApi,Ve as emitOpenApi,ze as emitOpenApiModule,Je as emitOpenRpc,Ye as emitOpenRpcModule,ro as emitScheduler,Mr as emitServer,Pr as emitShard,oo as emitVectors,wr as emitWorkflows,to as emitWranglerCronTriggers,l as errorAdvisoryNames,c as errorPlatformDiagnosticNames,nr as evaluateSchemaDrift,Gr as findLunoraSolution,Br as findProjectConfigFile,Kr as findTsconfig,xr as fingerprintSchemaSources,y as foldCapabilitySignals,m as formatAdvisories,Or as generateSdk,Be as isD1GlobalTable,ke as isHyperdriveGlobalTable,R as isTestPath,po as isTypedSchema,f as lintSchema,T as listLunoraSourceFiles,tr as loadProjectConfig,U as mayReadCapabilityContext,lr as parseSchemaSnapshot,$e as platformMatrixIds,de as readPackageDependencies,sr as readProjectConfigLiterals,er as readProjectTarget,Ie as readServiceBindings,Tr as redact,Vr as refreshCodegenProject,rr as resolveCodegenTarget,_e as resolveServiceBindings,mr as runCodegen,Er as schemaFromIr,hr as secretKindOf,a as serializeSchemaSnapshot,x as sortedUniqueNames,G as sourceCapabilitySignals,p as toAdvisorContext,vr as validatorIrToJsonSchema};
@@ -0,0 +1 @@
1
+ import{NODE_CAPABILITIES as h,CLOUDFLARE_CAPABILITIES as b,CELLD_CAPABILITIES as S}from"@lunora/platform";import{r as v}from"./project-config-file-BV7RR-l6.mjs";const m="cloudflare",y=t=>{const{target:e}=v(t);return e!==void 0&&e.length>0?e:void 0},R=(t,e)=>e??y(t)??m,E=(t,e)=>{if(e!==void 0)return[];const{target:a,unreadable:r}=v(t);return r!==!0||a!==void 0?[]:[{level:"warn",message:`lunora.config declares a \`target\` that codegen cannot read without evaluating it, so the "${m}" surface was emitted. \`runCodegen\` resolves the target synchronously, which means it reads literals only.`,name:"platform_unreadable_target",remediation:`Write \`target\` as a string literal on the config's default export (\`export default { target: "${m}" }\`), or pass \`--target\`.`,target:m}]},w={max:1536,min:32},z=(t,e)=>{if(t!=="cloudflare")return[];const{max:a,min:r}=w,i=`${String(r)}-${String(a)}`;return e.filter(({dimensions:o})=>o!==void 0&&(!Number.isInteger(o)||o<r||o>a)).map(({dimensions:o,name:s})=>({level:"warn",message:`Vector index "${s}" declares ${String(o)} dimensions; Cloudflare Vectorize accepts ${i}, so creating a Vectorize index for it fails at deploy.`,name:"platform_vector_dimensions_out_of_range",remediation:`If a Vectorize index backs "${s}", use ${i} dimensions (many embedding models can truncate output to fit). Ignore this if another store, such as pgvector, backs it.`,target:t}))},u={celld:S,cloudflare:b,node:h},O=(t,e)=>{const a=u[t];if(a===void 0)return!0;const r=a.features[e]?.level;return r==="native"||r==="emulated"},P=()=>Object.keys(u).toSorted((t,e)=>t.localeCompare(e)),_={access:null,ai:"ai",aiSearch:"aiSearch",analytics:"analytics",analyticsSql:"analyticsSql",artifacts:"artifacts",browser:"browser",container:"containers",flags:null,hyperdrive:"hyperdrive",images:"images",kv:"keyValueStore",mail:"mail",notify:null,payments:null,pipelines:"pipelines",r2sql:null,scheduler:"scheduler",storage:"objectStorage",vectors:"vectorStore",workflows:"workflows",x402:"secrets"},k=["agents","commitOrderedTables","containerEgressPolicy","containerRuntimeScheduling","containerSandboxTools","cronTriggers","crossShardFanout","deliveryAuthorization","durableStreams","globalTables","liveStreams","queues","relationGraph","secrets","services","topics","typedWebSockets","vectorStore","workerLoaders","workflowRollback","workflowSchedules"],g={agents:"durable agents (`defineAgent`)",commitOrderedTables:"commit-ordered tables (`.commitOrdered()`)",containerEgressPolicy:"container egress policies (`defineContainer({ allowedHosts | deniedHosts | interceptHttps })`)",containerRuntimeScheduling:'per-instance container images and snapshots (`defineContainer({ schedulingPolicy: "durable_object" })`)',containerSandboxTools:"container sandbox helpers — files, directory backups, bucket mounts (`defineContainer({ sandbox: true })`)",deliveryAuthorization:"delivery authorization (`.deliveryAuthorization(...)` on the app builder)",cronTriggers:"declared cron triggers (`cronJobs()`)",crossShardFanout:"cross-shard fan-out queries (a `.shardBy(...)` schema)",durableStreams:"durable streams (`.stream(handler, { durable: true })`)",globalTables:"global tables (`.global()`)",liveContext:"the live publisher (`ctx.live`)",liveStreams:"live topic streams (`defineLiveStream`)",queues:"queues (`defineQueue`)",relationGraph:"relation-graph traversal (`ctx.db.related`, derived from `v.id(...)` columns)",secrets:"the secrets store (`ctx.secrets`)",services:"service bindings to sibling Workers (`lunora.config` `services`)",topics:"pub/sub topics (`defineTopic` / `defineSubscription`)",typedWebSockets:"typed WebSocket routes and rooms (`defineWebSocket` / `defineRoom`)",vectorStore:"vector indexes (`.vectorize()`)",workerLoaders:"sandboxed agent scripts (`jsCodeTool`, on Worker Loaders)",workflowRollback:"workflow step rollback (`defineStep({ rollback })`)",workflowSchedules:"scheduled workflow instances (`defineWorkflow({ schedules })`)"},x=(t,e,a)=>({level:"error",message:`${e.name} does not support ${g[t]}, which this app declares.`,name:"platform_unsupported_feature",remediation:`Remove the declaration, or deploy to a target whose capability matrix marks "${t}" as native or emulated.`,target:a}),$=(t,e)=>({level:"error",message:`${t.name} withholds live streams, so ctx.live is not available on the "${e}" target, but this app reads ctx.live.`,name:"platform_unsupported_feature",remediation:'Remove the ctx.live usage, or deploy to a target whose capability matrix marks "liveStreams" as native or emulated.',target:e}),D=t=>({level:"error",message:"This app declares defineLiveStream topics and enables delivery authorization. With delivery authorization on, the shard answers every /_lunora/live/* request with 501, so the live streams cannot be served.",name:"platform_live_stream_delivery_authorization",remediation:"Remove the defineLiveStream declarations, or remove the .deliveryAuthorization(...) call. Live streams and delivery authorization cannot be combined.",target:t}),T=(t,e,a)=>({level:"error",message:`${e.name}'s capability matrix does not declare a support level for ${g[t]}, which this app declares. Treated as unsupported.`,name:"platform_undeclared_feature",remediation:`Rate "${t}" in the ${e.name} capability matrix as "native", "emulated", or "unsupported" — an undeclared feature fails closed rather than letting the app deploy onto a primitive the host may not provide.`,target:a}),A=t=>{const{diagnostics:e,gatedSignals:a,matrix:r,reported:i,signals:o,target:s}=t;for(const n of k){if(o[n]!==!0)continue;const c=r.features[n]?.level;c!=="unsupported"&&c!==void 0||(a[n]=!1,!i.has(n)&&e.push(c==="unsupported"?x(n,r,s):T(n,r,s)))}},L=(t,e,a,r={})=>{const i={...t},o={...r},s=[],n=new Set;for(const[l,d]of Object.entries(_)){if(d===null||!t[l])continue;const f=e.features[d]?.level;f==="unsupported"?(i[l]=!1,n.add(d),s.push({feature:l,level:"error",message:`${e.name} does not support "${l}" (ctx.${l}).`,name:"platform_unsupported_feature",remediation:`Remove the ctx.${l} usage, or deploy to a target whose capability matrix marks "${d}" as native or emulated.`,target:a})):f===void 0&&(i[l]=!1,n.add(d),s.push({feature:l,level:"error",message:`${e.name}'s capability matrix does not declare a support level for "${l}" (ctx.${l}). Treated as unsupported.`,name:"platform_undeclared_feature",remediation:`Rate "${d}" in the ${e.name} capability matrix as "native", "emulated", or "unsupported" — an undeclared feature fails closed rather than shipping a surface the host may not provide.`,target:a}))}A({diagnostics:s,gatedSignals:o,matrix:e,reported:n,signals:r,target:a});const c=e.features.liveStreams?.level,p=c===void 0||c==="unsupported";return r.liveContext===!0&&p&&s.push($(e,a)),{diagnostics:s,liveStreamsWithheld:p,signals:o,usage:i}},W=(t,e,a={})=>{const r=u[e];return r===void 0?{diagnostics:[{level:"error",message:`Unknown deploy target "${e}" — no capability matrix is registered for it. Codegen emitted the full Cloudflare surface un-gated.`,name:"platform_unknown_target",remediation:`Use a registered target (${Object.keys(u).join(", ")}) or install the target's @lunora/platform-${e} package.`,target:e}],liveStreamsWithheld:!1,signals:{...a},usage:{...t}}:L(t,r,e,a)},F=t=>{const e=u[t];if(e===void 0)return;const a=Object.entries(e.features).filter(([,r])=>r.level==="unsupported").map(([r])=>r).toSorted((r,i)=>r.localeCompare(i));return{id:e.id,name:e.name,unsupported:a}};export{_ as CAPABILITY_TO_FEATURE,m as DEFAULT_TARGET,L as gateAgainstMatrix,W as gatePlatformFeatures,D as liveStreamsDeliveryAuthorizationDiagnostic,O as platformFeatureAvailable,P as platformMatrixIds,y as readProjectTarget,E as readTargetDiagnostics,R as resolveCodegenTarget,F as studioPlatformFor,z as vectorizeDimensionDiagnostics};