@lunora/codegen 1.0.0-alpha.211 → 1.0.0-alpha.212

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
@@ -3556,11 +3556,11 @@ declare const emitOpenApi: (input: OpenApiEmitInput) => string;
3556
3556
  /**
3557
3557
  * Emit the OpenAPI document as an importable TS module
3558
3558
  * (`_generated/openapi.ts`) the worker entry imports and passes to
3559
- * `createWorker({ openApiSpec })`. The document object literal is inlined
3560
- * verbatim (same `JSON.stringify` form the `.json` uses), so the `.ts` and
3561
- * `.json` are byte-identical content and regenerate together — closing the gap
3562
- * where a Worker cannot read the JSON file at runtime. `document_` is the object
3563
- * returned by {@link buildOpenApiDocument} (reused, never recomputed).
3559
+ * `createWorker({ openApiSpec })`. The document is inlined as a `JSON.parse`
3560
+ * string (see {@link renderJsonData}), so the `.ts` and `.json` carry the same
3561
+ * content and regenerate together — closing the gap where a Worker cannot read
3562
+ * the JSON file at runtime. `document_` is the object returned by
3563
+ * {@link buildOpenApiDocument} (reused, never recomputed).
3564
3564
  */
3565
3565
  declare const emitOpenApiModule: (document_: Record<string, unknown>) => string;
3566
3566
  /** The OpenRPC dialect version this emitter targets. */
@@ -3598,9 +3598,10 @@ declare const emitOpenRpc: (input: OpenRpcEmitInput) => string;
3598
3598
  /**
3599
3599
  * Emit the OpenRPC document as an importable TS module
3600
3600
  * (`_generated/openrpc.ts`) the worker entry imports and passes to
3601
- * `createWorker({ openRpcSpec })`. The document object literal is inlined
3602
- * verbatim (same `JSON.stringify` form the `.json` uses), so the `.ts` and
3603
- * `.json` are byte-identical content and regenerate together. `document_` is
3601
+ * `createWorker({ openRpcSpec })`. The document is inlined as a `JSON.parse`
3602
+ * string (see {@link renderJsonData}), so the `.ts` and `.json` carry the same
3603
+ * content and regenerate together; its `methods` array grows with every
3604
+ * procedure, which as a literal fails `tsc` with TS2590 (#823). `document_` is
3604
3605
  * the object returned by {@link buildOpenRpcDocument} (reused, never recomputed).
3605
3606
  */
3606
3607
  declare const emitOpenRpcModule: (document_: Record<string, unknown>) => string;
package/dist/index.d.ts CHANGED
@@ -3556,11 +3556,11 @@ declare const emitOpenApi: (input: OpenApiEmitInput) => string;
3556
3556
  /**
3557
3557
  * Emit the OpenAPI document as an importable TS module
3558
3558
  * (`_generated/openapi.ts`) the worker entry imports and passes to
3559
- * `createWorker({ openApiSpec })`. The document object literal is inlined
3560
- * verbatim (same `JSON.stringify` form the `.json` uses), so the `.ts` and
3561
- * `.json` are byte-identical content and regenerate together — closing the gap
3562
- * where a Worker cannot read the JSON file at runtime. `document_` is the object
3563
- * returned by {@link buildOpenApiDocument} (reused, never recomputed).
3559
+ * `createWorker({ openApiSpec })`. The document is inlined as a `JSON.parse`
3560
+ * string (see {@link renderJsonData}), so the `.ts` and `.json` carry the same
3561
+ * content and regenerate together — closing the gap where a Worker cannot read
3562
+ * the JSON file at runtime. `document_` is the object returned by
3563
+ * {@link buildOpenApiDocument} (reused, never recomputed).
3564
3564
  */
3565
3565
  declare const emitOpenApiModule: (document_: Record<string, unknown>) => string;
3566
3566
  /** The OpenRPC dialect version this emitter targets. */
@@ -3598,9 +3598,10 @@ declare const emitOpenRpc: (input: OpenRpcEmitInput) => string;
3598
3598
  /**
3599
3599
  * Emit the OpenRPC document as an importable TS module
3600
3600
  * (`_generated/openrpc.ts`) the worker entry imports and passes to
3601
- * `createWorker({ openRpcSpec })`. The document object literal is inlined
3602
- * verbatim (same `JSON.stringify` form the `.json` uses), so the `.ts` and
3603
- * `.json` are byte-identical content and regenerate together. `document_` is
3601
+ * `createWorker({ openRpcSpec })`. The document is inlined as a `JSON.parse`
3602
+ * string (see {@link renderJsonData}), so the `.ts` and `.json` carry the same
3603
+ * content and regenerate together; its `methods` array grows with every
3604
+ * procedure, which as a literal fails `tsc` with TS2590 (#823). `document_` is
3604
3605
  * the object returned by {@link buildOpenRpcDocument} (reused, never recomputed).
3605
3606
  */
3606
3607
  declare const emitOpenRpcModule: (document_: Record<string, unknown>) => string;
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-DPIMTD_h.mjs";import{listLunoraSourceFiles as g}from"./packem_shared/listLunoraSourceFiles-DsxeRYvh.mjs";import{default as O}from"./packem_shared/discoverAuthApiCalls-EHm1O8uG.mjs";import{CONTAINERS_FILENAME as M,discoverContainers as T}from"./packem_shared/CONTAINERS_FILENAME-wDZs0S4p.mjs";import{default as h}from"./packem_shared/discoverCrons-B2GXsB-m.mjs";import{FLAGS_FILENAME as F,discoverFlags as I}from"./packem_shared/FLAGS_FILENAME-CQofXgIf.mjs";import{default as D}from"./packem_shared/discoverFunctions-7IsdPbJJ.mjs";import{default as U}from"./packem_shared/discoverHttpRoutes-HeBP7vhK.mjs";import{default as H}from"./packem_shared/discoverHyperdriveCalls-CzRlqv_N.mjs";import{default as y}from"./packem_shared/discoverInserts-BP0Gl37o.mjs";import{d as W}from"./packem_shared/index-D6xfnMEE.mjs";import{default as V}from"./packem_shared/discoverMigrations-BX86Fv9G.mjs";import{MUTATORS_FILENAME as Q,discoverMutators as w}from"./packem_shared/MUTATORS_FILENAME-CE7K7DfT.mjs";import{default as q}from"./packem_shared/discoverNondeterministicCalls-CJYIXWPw.mjs";import{NOTIFY_FILENAME as Y,discoverNotifyCalls as X,discoverNotifyConfig as Z}from"./packem_shared/NOTIFY_FILENAME-DbuOgja2.mjs";import{default as ee}from"./packem_shared/readPackageDependencies-C6h6FZuP.mjs";import{d as oe}from"./packem_shared/queries-TZaLWhWq.mjs";import{QUEUES_FILENAME as se,discoverQueues as ae}from"./packem_shared/QUEUES_FILENAME-Dd781zOQ.mjs";import{default as me}from"./packem_shared/discoverR2sqlCalls-emIgm3TF.mjs";import{default as fe}from"./packem_shared/discoverRlsProcedures-CU7YMR3P.mjs";import{default as ce}from"./packem_shared/discoverRlsMetadata-3Gs8U3ng.mjs";import{discoverSandboxUsage as le}from"./packem_shared/discoverSandboxUsage-pJ42YuvL.mjs";import{default as xe}from"./packem_shared/discoverSchema-ClYGs0dx.mjs";import{SHAPES_FILENAME as Ae,discoverShapes as ue}from"./packem_shared/SHAPES_FILENAME-BtuI2r7-.mjs";import{default as Ne}from"./packem_shared/discoverStorageRulesMetadata-BFiKUo5m.mjs";import{WORKFLOWS_FILENAME as Ce,discoverWorkflows as Oe}from"./packem_shared/WORKFLOWS_FILENAME-v3AJcUjy.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-_LUzQG_K.mjs";import{emitApp as We}from"./packem_shared/emitApp-CgW3zBjL.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-Ck7uULMF.mjs";import{OPENRPC_VERSION as Ye,buildOpenRpcDocument as Xe,emitOpenRpc as Ze,emitOpenRpcModule as $e}from"./packem_shared/OPENRPC_VERSION-BRCNaNPW.mjs";import{DEFAULT_TARGET as rr,platformMatrixIds as or,readProjectTarget as tr,resolveCodegenTarget as sr}from"./packem_shared/DEFAULT_TARGET-DtzlGawL.mjs";import{PROJECT_CONFIG_FILENAMES as ir,findProjectConfigFile as mr,loadProjectConfig as dr,readProjectConfigLiterals as fr}from"./packem_shared/PROJECT_CONFIG_FILENAMES-D29yBg5X.mjs";import{SCHEMA_SNAPSHOT_FILENAME as cr,createCodegenProject as nr,findTsconfig as lr,refreshCodegenProject as Sr,runCodegen as xr}from"./packem_shared/SCHEMA_SNAPSHOT_FILENAME-D2xc36Bb.mjs";import{SchemaSnapshotParseError as Ar,buildSchemaSnapshot as ur,evaluateSchemaDrift as vr,parseSchemaSnapshot as Nr}from"./packem_shared/SchemaSnapshotParseError-lUWe6lPo.mjs";import{schemaFromIr as Cr}from"./packem_shared/schemaFromIr-BWFnvCVg.mjs";import{LUNORA_ERROR_CODES as Rr,validatorIrToJsonSchema as Mr}from"./packem_shared/LUNORA_ERROR_CODES-C2s0xWQD.mjs";import{SDK_LANGUAGES as _r,SDK_TARGETS as hr,generateSdk as Lr}from"./packem_shared/SDK_LANGUAGES-CFyux-74.mjs";import{redact as Ir,secretKindOf as Pr}from"./packem_shared/redact-Cy14LEnc.mjs";import{MESSAGE_SOLUTIONS as Gr,findSolutionByMessage as Ur}from"@lunora/errors";import{isTypedSchema as Hr}from"./packem_shared/isTypedSchema-B_qlBbE-.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,Rr as LUNORA_ERROR_CODES,Gr as LUNORA_SOLUTION_RULES,Q as MUTATORS_FILENAME,Y as NOTIFY_FILENAME,Ye as OPENRPC_VERSION,ir as PROJECT_CONFIG_FILENAMES,se as QUEUES_FILENAME,cr as SCHEMA_SNAPSHOT_FILENAME,t as SCHEMA_SNAPSHOT_VERSION,_r as SDK_LANGUAGES,hr as SDK_TARGETS,Ae as SHAPES_FILENAME,Ar as SchemaSnapshotParseError,e as VERSION,Ce as WORKFLOWS_FILENAME,we as buildOpenApiDocument,Xe as buildOpenRpcDocument,ur as buildSchemaSnapshot,nr 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,vr as evaluateSchemaDrift,Ur as findLunoraSolution,mr as findProjectConfigFile,lr as findTsconfig,m as formatAdvisories,Lr as generateSdk,Ve as isD1GlobalTable,ze as isHyperdriveGlobalTable,Hr as isTypedSchema,d as lintSchema,g as listLunoraSourceFiles,dr as loadProjectConfig,Nr as parseSchemaSnapshot,or as platformMatrixIds,ee as readPackageDependencies,fr as readProjectConfigLiterals,tr as readProjectTarget,Ir as redact,Sr as refreshCodegenProject,sr as resolveCodegenTarget,xr as runCodegen,Cr as schemaFromIr,Pr as secretKindOf,a as serializeSchemaSnapshot,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 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-DPIMTD_h.mjs";import{listLunoraSourceFiles as g}from"./packem_shared/listLunoraSourceFiles-DsxeRYvh.mjs";import{default as O}from"./packem_shared/discoverAuthApiCalls-EHm1O8uG.mjs";import{CONTAINERS_FILENAME as M,discoverContainers as T}from"./packem_shared/CONTAINERS_FILENAME-wDZs0S4p.mjs";import{default as h}from"./packem_shared/discoverCrons-B2GXsB-m.mjs";import{FLAGS_FILENAME as F,discoverFlags as I}from"./packem_shared/FLAGS_FILENAME-CQofXgIf.mjs";import{default as D}from"./packem_shared/discoverFunctions-7IsdPbJJ.mjs";import{default as U}from"./packem_shared/discoverHttpRoutes-HeBP7vhK.mjs";import{default as H}from"./packem_shared/discoverHyperdriveCalls-CzRlqv_N.mjs";import{default as y}from"./packem_shared/discoverInserts-BP0Gl37o.mjs";import{d as W}from"./packem_shared/index-D6xfnMEE.mjs";import{default as V}from"./packem_shared/discoverMigrations-BX86Fv9G.mjs";import{MUTATORS_FILENAME as Q,discoverMutators as w}from"./packem_shared/MUTATORS_FILENAME-CE7K7DfT.mjs";import{default as q}from"./packem_shared/discoverNondeterministicCalls-CJYIXWPw.mjs";import{NOTIFY_FILENAME as Y,discoverNotifyCalls as X,discoverNotifyConfig as Z}from"./packem_shared/NOTIFY_FILENAME-DbuOgja2.mjs";import{default as ee}from"./packem_shared/readPackageDependencies-C6h6FZuP.mjs";import{d as oe}from"./packem_shared/queries-TZaLWhWq.mjs";import{QUEUES_FILENAME as se,discoverQueues as ae}from"./packem_shared/QUEUES_FILENAME-Dd781zOQ.mjs";import{default as me}from"./packem_shared/discoverR2sqlCalls-emIgm3TF.mjs";import{default as fe}from"./packem_shared/discoverRlsProcedures-CU7YMR3P.mjs";import{default as ce}from"./packem_shared/discoverRlsMetadata-3Gs8U3ng.mjs";import{discoverSandboxUsage as le}from"./packem_shared/discoverSandboxUsage-pJ42YuvL.mjs";import{default as xe}from"./packem_shared/discoverSchema-ClYGs0dx.mjs";import{SHAPES_FILENAME as Ae,discoverShapes as ue}from"./packem_shared/SHAPES_FILENAME-BtuI2r7-.mjs";import{default as Ne}from"./packem_shared/discoverStorageRulesMetadata-BFiKUo5m.mjs";import{WORKFLOWS_FILENAME as Ce,discoverWorkflows as Oe}from"./packem_shared/WORKFLOWS_FILENAME-v3AJcUjy.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-akFzQrlf.mjs";import{emitApp as We}from"./packem_shared/emitApp-DHEB4XFE.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-sc25Dacj.mjs";import{OPENRPC_VERSION as Ye,buildOpenRpcDocument as Xe,emitOpenRpc as Ze,emitOpenRpcModule as $e}from"./packem_shared/OPENRPC_VERSION-ClwB3jCx.mjs";import{DEFAULT_TARGET as rr,platformMatrixIds as or,readProjectTarget as tr,resolveCodegenTarget as sr}from"./packem_shared/DEFAULT_TARGET-DtzlGawL.mjs";import{PROJECT_CONFIG_FILENAMES as ir,findProjectConfigFile as mr,loadProjectConfig as dr,readProjectConfigLiterals as fr}from"./packem_shared/PROJECT_CONFIG_FILENAMES-D29yBg5X.mjs";import{SCHEMA_SNAPSHOT_FILENAME as cr,createCodegenProject as nr,findTsconfig as lr,refreshCodegenProject as Sr,runCodegen as xr}from"./packem_shared/SCHEMA_SNAPSHOT_FILENAME-BtDKUUYV.mjs";import{SchemaSnapshotParseError as Ar,buildSchemaSnapshot as ur,evaluateSchemaDrift as vr,parseSchemaSnapshot as Nr}from"./packem_shared/SchemaSnapshotParseError-lUWe6lPo.mjs";import{schemaFromIr as Cr}from"./packem_shared/schemaFromIr-BWFnvCVg.mjs";import{LUNORA_ERROR_CODES as Rr,validatorIrToJsonSchema as Mr}from"./packem_shared/LUNORA_ERROR_CODES-C2s0xWQD.mjs";import{SDK_LANGUAGES as _r,SDK_TARGETS as hr,generateSdk as Lr}from"./packem_shared/SDK_LANGUAGES-CFyux-74.mjs";import{redact as Ir,secretKindOf as Pr}from"./packem_shared/redact-Cy14LEnc.mjs";import{MESSAGE_SOLUTIONS as Gr,findSolutionByMessage as Ur}from"@lunora/errors";import{isTypedSchema as Hr}from"./packem_shared/isTypedSchema-B_qlBbE-.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,Rr as LUNORA_ERROR_CODES,Gr as LUNORA_SOLUTION_RULES,Q as MUTATORS_FILENAME,Y as NOTIFY_FILENAME,Ye as OPENRPC_VERSION,ir as PROJECT_CONFIG_FILENAMES,se as QUEUES_FILENAME,cr as SCHEMA_SNAPSHOT_FILENAME,t as SCHEMA_SNAPSHOT_VERSION,_r as SDK_LANGUAGES,hr as SDK_TARGETS,Ae as SHAPES_FILENAME,Ar as SchemaSnapshotParseError,e as VERSION,Ce as WORKFLOWS_FILENAME,we as buildOpenApiDocument,Xe as buildOpenRpcDocument,ur as buildSchemaSnapshot,nr 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,vr as evaluateSchemaDrift,Ur as findLunoraSolution,mr as findProjectConfigFile,lr as findTsconfig,m as formatAdvisories,Lr as generateSdk,Ve as isD1GlobalTable,ze as isHyperdriveGlobalTable,Hr as isTypedSchema,d as lintSchema,g as listLunoraSourceFiles,dr as loadProjectConfig,Nr as parseSchemaSnapshot,or as platformMatrixIds,ee as readPackageDependencies,fr as readProjectConfigLiterals,tr as readProjectTarget,Ir as redact,Sr as refreshCodegenProject,sr as resolveCodegenTarget,xr as runCodegen,Cr as schemaFromIr,Pr as secretKindOf,a as serializeSchemaSnapshot,f as toAdvisorContext,Mr as validatorIrToJsonSchema};
@@ -1 +1 @@
1
- import"./SCHEMA_SNAPSHOT_VERSION-C0oHwiJZ.mjs";import{G as o,U as n,o as l,e as p,a as A,b as E,c as S,d as c,f as d,g,h as u,p as C,i as h,q as D,j as f,k as G,l as R,m as _,n as b}from"./emit-_LUzQG_K.mjs";import"./declared-output-Iaar469J.mjs";import"./isD1GlobalTable-udvHAAzD.mjs";import"./paths-C-9fwEgQ.mjs";import"./LUNORA_ERROR_CODES-C2s0xWQD.mjs";export{o as GENERATED_HEADER,n as UMBRELLA_BASE_PACKAGES,l as buildStorageColumns,p as emitAgents,A as emitApi,E as emitCollections,S as emitContainers,c as emitCrons,d as emitDataModel,g as emitDrizzleSchema,u as emitFunctions,C as emitQueues,h as emitScheduler,D as emitSeed,f as emitServer,G as emitShard,R as emitVectors,_ as emitWorkflows,b as emitWranglerCronTriggers};
1
+ import"./SCHEMA_SNAPSHOT_VERSION-C0oHwiJZ.mjs";import{G as o,U as n,o as l,e as p,a as A,b as E,c as S,d as c,f as d,g,h as u,p as C,i as h,q as D,j as f,k as G,l as R,m as _,n as b}from"./emit-akFzQrlf.mjs";import"./declared-output-Iaar469J.mjs";import"./isD1GlobalTable-udvHAAzD.mjs";import"./paths-C-9fwEgQ.mjs";import"./LUNORA_ERROR_CODES-C2s0xWQD.mjs";export{o as GENERATED_HEADER,n as UMBRELLA_BASE_PACKAGES,l as buildStorageColumns,p as emitAgents,A as emitApi,E as emitCollections,S as emitContainers,c as emitCrons,d as emitDataModel,g as emitDrizzleSchema,u as emitFunctions,C as emitQueues,h as emitScheduler,D as emitSeed,f as emitServer,G as emitShard,R as emitVectors,_ as emitWorkflows,b as emitWranglerCronTriggers};
@@ -0,0 +1,3 @@
1
+ import{G as c,r as u}from"./emit-akFzQrlf.mjs";import{s as m}from"./paths-C-9fwEgQ.mjs";import{validatorIrToJsonSchema as p,objectSchema as l,LUNORA_ERROR_CODES as d}from"./LUNORA_ERROR_CODES-C2s0xWQD.mjs";const i="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 o=m(e.filePath),n=`${o}:${e.exportName}`;return{description:`Invoke the \`${e.kind}\` \`${n}\` over the Lunora RPC envelope (POST /_lunora/rpc, body \`{ "functionPath": "${n}", "args": { … } }\`).`,errors:d.map((r,s)=>({code:-32e3-s,data:{code:r},message:r})),name:n,params:[{description:"The function's argument object (the RPC envelope's `args`).",name:"args",required:Object.keys(e.args).length>0,schema:l(e.args)}],result:{name:"result",schema:e.output?p(e.output):R},summary:`${e.kind}: ${n}`,"x-lunora-function-kind":e.kind,"x-tags":[{name:o}]}},g=e=>{const o=e.version??"0.0.0",r=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:o},methods:r,openrpc:i}},v=e=>`${JSON.stringify(g(e),void 0,2)}
2
+ `,$=e=>`${c}export const openRpcSpec = ${u(e,"Record<string, unknown>")};
3
+ `;export{i as OPENRPC_VERSION,g as buildOpenRpcDocument,v as emitOpenRpc,$ as emitOpenRpcModule};
@@ -1,4 +1,4 @@
1
- import{existsSync as P,mkdirSync as ws,readFileSync as kt,writeFileSync as Ts,rmSync as Cs}from"node:fs";import{join as S,dirname as ne}from"node:path";import{performance as Ae}from"node:perf_hooks";import{runAdvisor as Fs}from"@lunora/advisor";import{LunoraError as k}from"@lunora/errors";import{SyntaxKind as l,Node as i,VariableDeclarationKind as Os,Project as ct}from"ts-morph";import{serializeSchemaSnapshot as Rs}from"./SCHEMA_SNAPSHOT_VERSION-C0oHwiJZ.mjs";import{toAdvisorContext as Ls}from"./formatAdvisories-DwmUKYuc.mjs";import{s as Ds}from"./paths-C-9fwEgQ.mjs";import{C as re,o as Mt,j as ks,f as Ms,k as Ks,b as _s,c as zs,m as $s,e as Us,p as qs,d as Bs,i as Vs,l as Ws,g as js,q as Hs,n as Gs,a as Ys,h as Qs}from"./emit-_LUzQG_K.mjs";import{isD1GlobalTable as Kt,isHyperdriveGlobalTable as _t}from"./isD1GlobalTable-udvHAAzD.mjs";import{discoverAgents as Xs}from"./AGENTS_FILENAME-DPIMTD_h.mjs";import{discoverContainers as Zs}from"./CONTAINERS_FILENAME-wDZs0S4p.mjs";import Js from"./discoverCrons-B2GXsB-m.mjs";import{diagnosticAt as ue}from"./CodegenDiagnosticError-BUXlG3P-.mjs";import{b as de}from"./module-specifiers-WF8iAydP.mjs";import{listLunoraSourceFiles as p,unwrapExpression as G,listSecurityScanFiles as Re,objectLiteralFromCallbackBody as zt,propertyInitializer as A,lunoraRelativePath as v,collectCallRows as T,collectSecurityCallRows as en,limitNameOf as $t,optionsObjectLiteral as Ut,isContextIdentifier as Ie,handlerOf as tn,isDatabaseAccessor as M,readTargetOf as qt,enclosingExportName as sn}from"./listLunoraSourceFiles-DsxeRYvh.mjs";import nn from"./readPackageDependencies-C6h6FZuP.mjs";import{discoverQueues as rn}from"./QUEUES_FILENAME-Dd781zOQ.mjs";import{discoverSandboxUsage as on}from"./discoverSandboxUsage-pJ42YuvL.mjs";import an from"./discoverStorageRulesMetadata-BFiKUo5m.mjs";import{a as y,c as K,d as Bt,e as cn}from"./classify-procedure-call-RjsZg8AH.mjs";import{discoverWorkflows as ln}from"./WORKFLOWS_FILENAME-v3AJcUjy.mjs";import{gatePlatformFeatures as un,resolveCodegenTarget as dn,readTargetDiagnostics as fn}from"./DEFAULT_TARGET-DtzlGawL.mjs";import{i as L,a as z,e as E,r as gn,b as pn,s as fe,c as mn,f as hn,d as xn}from"./queries-TZaLWhWq.mjs";import{r as ge,s as vn}from"./parse-validator-DW5RNi_6.mjs";import En from"./discoverAuthApiCalls-EHm1O8uG.mjs";import{i as Sn,a as yn,e as An,b as Nn,d as bn,c as Pn}from"./unwrap-handler-return-BEdusskg.mjs";import In from"./discoverFunctions-7IsdPbJJ.mjs";import wn from"./discoverHttpRoutes-HeBP7vhK.mjs";import Tn from"./discoverHyperdriveCalls-CzRlqv_N.mjs";import Cn from"./discoverInserts-BP0Gl37o.mjs";import{m as Le,a as ie,s as Vt,d as Fn}from"./index-D6xfnMEE.mjs";import{e as Wt}from"./exported-procedure-chains-CjlBrFjo.mjs";import On from"./discoverMigrations-BX86Fv9G.mjs";import{MUTATORS_FILENAME as Rn,isDefineMutatorCallee as Ln,discoverMutators as Dn}from"./MUTATORS_FILENAME-CE7K7DfT.mjs";import kn from"./discoverNondeterministicCalls-CJYIXWPw.mjs";import{discoverNotifyConfig as Mn,discoverNotifyCalls as Kn}from"./NOTIFY_FILENAME-DbuOgja2.mjs";import _n from"./discoverR2sqlCalls-emIgm3TF.mjs";import zn from"./discoverRlsProcedures-CU7YMR3P.mjs";import $n from"./discoverRlsMetadata-3Gs8U3ng.mjs";import Un from"./discoverSchema-ClYGs0dx.mjs";import{secretKindOf as qn,redact as Bn,isHeuristicSecretKind as Vn,isSecretishName as Wn}from"./redact-Cy14LEnc.mjs";import{discoverShapes as jn}from"./SHAPES_FILENAME-BtuI2r7-.mjs";import{emitApp as Hn}from"./emitApp-CgW3zBjL.mjs";import{buildOpenApiDocument as Gn,emitOpenApiModule as Yn}from"./buildOpenApiDocument-Ck7uULMF.mjs";import{buildOpenRpcDocument as Qn,emitOpenRpcModule as Xn}from"./OPENRPC_VERSION-BRCNaNPW.mjs";import{buildSchemaSnapshot as Zn}from"./SchemaSnapshotParseError-lUWe6lPo.mjs";const lt=(e,t="api")=>{const s=new Map;for(const n of e){const o=Ds(n),r=s.get(o);if(r===void 0){s.set(o,n);continue}if(r!==n){const a=t==="api"?`the generated api.ts would declare "${o}" twice and the dispatch key "${o}:<fn>" would be ambiguous`:`the generated api.ts would declare "${o}" twice in HttpStreamsRef and again in the httpStreams object literal`;throw new k("INTERNAL",`@lunora/codegen: "${r}" and "${n}" both map to the ${t} namespace "${o}" — ${a}. Rename one file so the two differ by more than a non-identifier character (\`-\`, \`.\`, \`/\` and \`_\` all sanitize to \`_\`).`,{status:500})}}},Jn=(e,t={})=>{const{hasVectors:s=!0,scheduler:n=!1,storage:o=!1,usage:r}=t,a=[];e.tables.some(c=>Kt(c))&&a.push({name:"@lunora/d1",reason:"`.global()` tables are D1-backed, so `_generated/app.ts` imports the D1 `ctx.db` adapter"}),e.tables.some(c=>_t(c))&&a.push({name:"@lunora/hyperdrive",reason:'`.global({ backend: "hyperdrive" })` tables route through `@lunora/hyperdrive/global`'},{name:"@lunora/sql-store",reason:'`.global({ backend: "hyperdrive" })` makes `_generated/app.ts` import the `SqlCtxDbOptions` / `SqlExec` types'}),n&&a.push({name:"@lunora/scheduler",reason:"a declared cron (or `ctx.scheduler` use) makes `_generated/app.ts` import `createScheduler`"}),o&&a.push({name:"@lunora/storage",reason:"a `v.storage()` column, a storage access rule (or `ctx.storage` use) makes `_generated/app.ts` import `createStorage`"}),e.vectorIndexes.length>0&&s&&a.push({name:"@lunora/bindings",reason:"`.vectorize()` indexes make `_generated/shard.ts` import `@lunora/bindings/vectors`"});for(const c of r===void 0?[]:re)c.requiredPackage!==void 0&&r?.[c.key]===!0&&a.push({name:c.requiredPackage,reason:`\`ctx.${c.contextProperty??c.key}\` usage makes \`_generated/\` import \`${c.moduleSpecifier}\``});return a.filter((c,u)=>a.findIndex(d=>d.name===c.name)===u)},er=(e,t,s={})=>{if(t===void 0)return;const n=Jn(e,s).filter(r=>!t.has(r.name));if(n.length===0)return;const o=n.map(r=>` - ${r.name} — ${r.reason}`).join(`
1
+ import{existsSync as P,mkdirSync as ws,readFileSync as kt,writeFileSync as Ts,rmSync as Cs}from"node:fs";import{join as S,dirname as ne}from"node:path";import{performance as Ae}from"node:perf_hooks";import{runAdvisor as Fs}from"@lunora/advisor";import{LunoraError as k}from"@lunora/errors";import{SyntaxKind as l,Node as i,VariableDeclarationKind as Os,Project as ct}from"ts-morph";import{serializeSchemaSnapshot as Rs}from"./SCHEMA_SNAPSHOT_VERSION-C0oHwiJZ.mjs";import{toAdvisorContext as Ls}from"./formatAdvisories-DwmUKYuc.mjs";import{s as Ds}from"./paths-C-9fwEgQ.mjs";import{C as re,o as Mt,j as ks,f as Ms,k as Ks,b as _s,c as zs,m as $s,e as Us,p as qs,d as Bs,i as Vs,l as Ws,g as js,q as Hs,n as Gs,a as Ys,h as Qs}from"./emit-akFzQrlf.mjs";import{isD1GlobalTable as Kt,isHyperdriveGlobalTable as _t}from"./isD1GlobalTable-udvHAAzD.mjs";import{discoverAgents as Xs}from"./AGENTS_FILENAME-DPIMTD_h.mjs";import{discoverContainers as Zs}from"./CONTAINERS_FILENAME-wDZs0S4p.mjs";import Js from"./discoverCrons-B2GXsB-m.mjs";import{diagnosticAt as ue}from"./CodegenDiagnosticError-BUXlG3P-.mjs";import{b as de}from"./module-specifiers-WF8iAydP.mjs";import{listLunoraSourceFiles as p,unwrapExpression as G,listSecurityScanFiles as Re,objectLiteralFromCallbackBody as zt,propertyInitializer as A,lunoraRelativePath as v,collectCallRows as T,collectSecurityCallRows as en,limitNameOf as $t,optionsObjectLiteral as Ut,isContextIdentifier as Ie,handlerOf as tn,isDatabaseAccessor as M,readTargetOf as qt,enclosingExportName as sn}from"./listLunoraSourceFiles-DsxeRYvh.mjs";import nn from"./readPackageDependencies-C6h6FZuP.mjs";import{discoverQueues as rn}from"./QUEUES_FILENAME-Dd781zOQ.mjs";import{discoverSandboxUsage as on}from"./discoverSandboxUsage-pJ42YuvL.mjs";import an from"./discoverStorageRulesMetadata-BFiKUo5m.mjs";import{a as y,c as K,d as Bt,e as cn}from"./classify-procedure-call-RjsZg8AH.mjs";import{discoverWorkflows as ln}from"./WORKFLOWS_FILENAME-v3AJcUjy.mjs";import{gatePlatformFeatures as un,resolveCodegenTarget as dn,readTargetDiagnostics as fn}from"./DEFAULT_TARGET-DtzlGawL.mjs";import{i as L,a as z,e as E,r as gn,b as pn,s as fe,c as mn,f as hn,d as xn}from"./queries-TZaLWhWq.mjs";import{r as ge,s as vn}from"./parse-validator-DW5RNi_6.mjs";import En from"./discoverAuthApiCalls-EHm1O8uG.mjs";import{i as Sn,a as yn,e as An,b as Nn,d as bn,c as Pn}from"./unwrap-handler-return-BEdusskg.mjs";import In from"./discoverFunctions-7IsdPbJJ.mjs";import wn from"./discoverHttpRoutes-HeBP7vhK.mjs";import Tn from"./discoverHyperdriveCalls-CzRlqv_N.mjs";import Cn from"./discoverInserts-BP0Gl37o.mjs";import{m as Le,a as ie,s as Vt,d as Fn}from"./index-D6xfnMEE.mjs";import{e as Wt}from"./exported-procedure-chains-CjlBrFjo.mjs";import On from"./discoverMigrations-BX86Fv9G.mjs";import{MUTATORS_FILENAME as Rn,isDefineMutatorCallee as Ln,discoverMutators as Dn}from"./MUTATORS_FILENAME-CE7K7DfT.mjs";import kn from"./discoverNondeterministicCalls-CJYIXWPw.mjs";import{discoverNotifyConfig as Mn,discoverNotifyCalls as Kn}from"./NOTIFY_FILENAME-DbuOgja2.mjs";import _n from"./discoverR2sqlCalls-emIgm3TF.mjs";import zn from"./discoverRlsProcedures-CU7YMR3P.mjs";import $n from"./discoverRlsMetadata-3Gs8U3ng.mjs";import Un from"./discoverSchema-ClYGs0dx.mjs";import{secretKindOf as qn,redact as Bn,isHeuristicSecretKind as Vn,isSecretishName as Wn}from"./redact-Cy14LEnc.mjs";import{discoverShapes as jn}from"./SHAPES_FILENAME-BtuI2r7-.mjs";import{emitApp as Hn}from"./emitApp-DHEB4XFE.mjs";import{buildOpenApiDocument as Gn,emitOpenApiModule as Yn}from"./buildOpenApiDocument-sc25Dacj.mjs";import{buildOpenRpcDocument as Qn,emitOpenRpcModule as Xn}from"./OPENRPC_VERSION-ClwB3jCx.mjs";import{buildSchemaSnapshot as Zn}from"./SchemaSnapshotParseError-lUWe6lPo.mjs";const lt=(e,t="api")=>{const s=new Map;for(const n of e){const o=Ds(n),r=s.get(o);if(r===void 0){s.set(o,n);continue}if(r!==n){const a=t==="api"?`the generated api.ts would declare "${o}" twice and the dispatch key "${o}:<fn>" would be ambiguous`:`the generated api.ts would declare "${o}" twice in HttpStreamsRef and again in the httpStreams object literal`;throw new k("INTERNAL",`@lunora/codegen: "${r}" and "${n}" both map to the ${t} namespace "${o}" — ${a}. Rename one file so the two differ by more than a non-identifier character (\`-\`, \`.\`, \`/\` and \`_\` all sanitize to \`_\`).`,{status:500})}}},Jn=(e,t={})=>{const{hasVectors:s=!0,scheduler:n=!1,storage:o=!1,usage:r}=t,a=[];e.tables.some(c=>Kt(c))&&a.push({name:"@lunora/d1",reason:"`.global()` tables are D1-backed, so `_generated/app.ts` imports the D1 `ctx.db` adapter"}),e.tables.some(c=>_t(c))&&a.push({name:"@lunora/hyperdrive",reason:'`.global({ backend: "hyperdrive" })` tables route through `@lunora/hyperdrive/global`'},{name:"@lunora/sql-store",reason:'`.global({ backend: "hyperdrive" })` makes `_generated/app.ts` import the `SqlCtxDbOptions` / `SqlExec` types'}),n&&a.push({name:"@lunora/scheduler",reason:"a declared cron (or `ctx.scheduler` use) makes `_generated/app.ts` import `createScheduler`"}),o&&a.push({name:"@lunora/storage",reason:"a `v.storage()` column, a storage access rule (or `ctx.storage` use) makes `_generated/app.ts` import `createStorage`"}),e.vectorIndexes.length>0&&s&&a.push({name:"@lunora/bindings",reason:"`.vectorize()` indexes make `_generated/shard.ts` import `@lunora/bindings/vectors`"});for(const c of r===void 0?[]:re)c.requiredPackage!==void 0&&r?.[c.key]===!0&&a.push({name:c.requiredPackage,reason:`\`ctx.${c.contextProperty??c.key}\` usage makes \`_generated/\` import \`${c.moduleSpecifier}\``});return a.filter((c,u)=>a.findIndex(d=>d.name===c.name)===u)},er=(e,t,s={})=>{if(t===void 0)return;const n=Jn(e,s).filter(r=>!t.has(r.name));if(n.length===0)return;const o=n.map(r=>` - ${r.name} — ${r.reason}`).join(`
2
2
  `);throw new k("INTERNAL",`@lunora/codegen: this schema's generated code imports packages the project does not declare:
3
3
  ${o}
4
4
 
@@ -0,0 +1,3 @@
1
+ import{G as S,r as O}from"./emit-akFzQrlf.mjs";import{s as p}from"./paths-C-9fwEgQ.mjs";import{LUNORA_ERROR_CODES as E,objectSchema as h,validatorIrToJsonSchema as u}from"./LUNORA_ERROR_CODES-C2s0xWQD.mjs";const A="/_lunora/rest",P=["authorization","cf-access-jwt-assertion","cookie","x-payment"],f=["x-d1-bookmark","x-lunora-shard-key"],T=e=>[...P,...(e.credentialHeaders??[]).map(t=>t.toLowerCase())],g=e=>Number.isFinite(e)?Math.max(0,Math.floor(e)):0,y=(...e)=>{const t=[];for(const r of e)for(const o of r?.split(",")??[]){const s=o.trim().toLowerCase();s!==""&&!t.includes(s)&&t.push(s)}return t.length===0?void 0:t.join(", ")},b=(e,t)=>{const r=[t,`max-age=${String(g(e.maxAge))}`];return e.staleWhileRevalidate!==void 0&&r.push(`stale-while-revalidate=${String(g(e.staleWhileRevalidate))}`),r.join(", ")},x=e=>e.scope==="public"?y(e.vary,...T(e),...f):y(e.vary,...f),k=e=>{const t=e.indexOf(":");if(!(t<=0||t>=e.length-1||e.indexOf(":",t+1)!==-1))return{name:e.slice(t+1),namespace:e.slice(0,t)}},N=e=>{const t=k(e);if(t!==void 0)return`${A}/${t.namespace}/${t.name}`},q=e=>e==="query"?"GET":"POST",m="#/components/responses/LunoraError",v=/:([A-Za-z_$][\w$]*)/gu,_=e=>[...e.matchAll(v)].map(t=>t[1]),j=e=>e.replaceAll(v,"{$1}"),l=e=>e.kind==="optional"?e.inner??e:e,C=e=>{const t=new Set(_(e.path)),r=[];for(const[o,s]of Object.entries(e.searchParams)){const c=l(s);r.push({description:`Query parameter \`${o}\``,in:"query",name:o,required:s.kind!=="optional",schema:u(c)})}for(const[o,s]of Object.entries(e.params)){const c=l(s);r.push({description:`Path parameter \`${o}\``,in:t.has(o)?"path":"query",name:o,required:t.has(o)?!0:s.kind!=="optional",schema:u(c)})}return r},$=e=>e?{content:{"application/json":{schema:u(e)}},description:"Successful response."}:{content:{"application/json":{schema:{description:"Return shape is TS-inferred (no `.output()` declared); best-effort — any JSON."}}},description:"Successful response. The return shape is TypeScript-inferred and not declared via `.output()`, so it is documented best-effort."},w=e=>{const t=p(e.filePath),r=C(e),o={description:`${e.stream?"Streaming (SSE) ":""}HTTP route handler \`${e.exportName}\` (${e.method} ${e.path}).`,operationId:`${e.method.toLowerCase()}_${p(e.path)}`,responses:{200:$(e.output),204:{description:"No content (handler returned `undefined`)."},default:{$ref:m}},summary:`${e.method} ${e.path}`,tags:[t]};return r.length>0&&(o.parameters=r),Object.keys(e.body).length>0&&(o.requestBody={content:{"application/json":{schema:h(e.body)}},required:!0}),e.stream&&(o["x-lunora-stream"]="text/event-stream"),o},D=e=>{const t=p(e.filePath),r=`${t}:${e.exportName}`,o={additionalProperties:!1,properties:{args:h(e.args),functionPath:{const:r,type:"string"},shardKey:{description:"Optional shard key; omitted routes to the default shard.",type:"string"}},required:["functionPath"],type:"object"};return{operation:{description:`Invoke the \`${e.kind}\` \`${r}\` over the Lunora RPC envelope (POST /_lunora/rpc).`,operationId:r,requestBody:{content:{"application/json":{schema:o}},required:!0},responses:{200:$(e.output),default:{$ref:m}},summary:`${e.kind}: ${r}`,tags:[t],"x-lunora-function-kind":e.kind},pathKey:`/_lunora/rpc#${r}`}},L=(e,t)=>{if(e===void 0||t!=="get"||e.scope===void 0||e.maxAge===void 0)return{};const r={maxAge:e.maxAge,scope:e.scope,...e.staleWhileRevalidate===void 0?{}:{staleWhileRevalidate:e.staleWhileRevalidate},...e.tag===void 0?{}:{tag:e.tag},...e.vary===void 0?{}:{vary:e.vary}},o={"Cache-Control":{description:r.scope==="public"?"Caching policy. `public` applies only to an uncredentialed request — a request carrying `Authorization` or `Cookie` is always answered `private`.":"Caching policy. Restricted to the caller's own cache; never stored by a shared/edge cache.",schema:{example:b(r,r.scope),type:"string"}}};r.tag!==void 0&&(o["Cache-Tag"]={description:"Purge tag for `ctx.cache.purge({ tags: [...] })`.",schema:{example:r.tag,type:"string"}});const s=x(r);return s!==void 0&&(o.Vary={description:"Request headers this response varies by. The endpoint's own negotiated headers are merged in at runtime.",schema:{example:s,type:"string"}}),{headers:o}},I=e=>{const t=p(e.filePath),r=`${t}:${e.exportName}`,o=N(r);if(o===void 0)return;const s=q(e.kind),c=s==="GET",d={description:`Public REST endpoint for the \`${e.kind}\` \`${r}\` (opt-in via \`.expose({ rest: true })\`). Routed through the procedure, so auth / RLS / validators are enforced.`,operationId:`rest_${p(o)}`,responses:{200:{content:{"application/json":{schema:{description:"Procedure result. The shape is TS-inferred from the return type; best-effort — any JSON."}}},description:"Successful result (TypeScript-inferred return shape, documented best-effort).",...L(e.expose?.cache,c?"get":"post")},default:{$ref:m}},summary:`${s} ${o}`,tags:[t],"x-lunora-function-kind":e.kind};if(c){const n=Object.entries(e.args).map(([a,i])=>{const R=l(i);return{description:`Argument \`${a}\` (JSON-encoded for non-string values).`,in:"query",name:a,required:i.kind!=="optional",schema:u(R)}});return n.length>0&&(d.parameters=n),{method:"get",operation:d,path:o}}return d.requestBody={content:{"application/json":{schema:h(e.args)}},required:Object.keys(e.args).length>0},{method:"post",operation:d,path:o}},F=e=>{const t=e.version??"0.0.0",r={},o=new Set;for(const n of e.httpRoutes){const a=j(n.path),i=r[a]??{};i[n.method.toLowerCase()]=w(n),r[a]=i,o.add(p(n.filePath))}const s=e.functions.filter(n=>n.visibility!=="internal"&&n.kind!=="stream");for(const n of s){const{operation:a,pathKey:i}=D(n);r[i]={post:a},o.add(p(n.filePath))}for(const n of s){if(n.expose?.rest!==!0)continue;const a=I(n);if(a===void 0)continue;const i=r[a.path]??{};i[a.method]=a.operation,r[a.path]=i}const c=[...o].toSorted((n,a)=>n.localeCompare(a)).map(n=>({description:`Operations declared in \`lunora/${n}\`.`,name:n}));return{components:{responses:{LunoraError:{content:{"application/json":{schema:{additionalProperties:!1,description:"Standard Lunora error envelope.",properties:{error:{additionalProperties:!1,properties:{code:{description:"Machine-readable error code. Clients switch on this value.",enum:E,type:"string"},message:{description:"Human-readable error message (never echoes internal details).",type:"string"}},required:["code","message"],type:"object"}},required:["error"],type:"object"}}},description:"A Lunora error response. The HTTP status reflects the error code (e.g. BAD_REQUEST→400, UNAUTHORIZED→401, FORBIDDEN→403, NOT_FOUND→404)."}}},info:{description:"Auto-generated from @lunora/values-typed functions by @lunora/codegen. Do not edit — run `lunora codegen` to regenerate.",title:"Lunora API",version:t},openapi:"3.1.0",paths:r,tags:c}},U=e=>`${JSON.stringify(F(e),void 0,2)}
2
+ `,B=e=>`${S}export const openApiSpec = ${O(e,"Record<string, unknown>")};
3
+ `;export{F as buildOpenApiDocument,U as emitOpenApi,B as emitOpenApiModule};