@lunora/codegen 1.0.0-alpha.345 → 1.0.0-alpha.347

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.mjs CHANGED
@@ -1 +1 @@
1
- import{SCHEMA_SNAPSHOT_VERSION as t,diffSchemaSnapshots as a,serializeSchemaSnapshot as i}from"./packem_shared/SCHEMA_SNAPSHOT_VERSION-C7Um0EnM.mjs";import{formatAdvisories as f,lintSchema as m,toAdvisorContext as d}from"./packem_shared/formatAdvisories-BCVASH7N.mjs";import{describeErrorLevelFindings as n,errorAdvisoryNames as c,errorPlatformDiagnosticNames as l,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 g}from"./packem_shared/CodegenDiagnosticError-BUXlG3P-.mjs";import{AGENTS_FILENAME as C,discoverAgents as N}from"./packem_shared/AGENTS_FILENAME-isdHqPIt.mjs";import{isTestPath as R,listLunoraSourceFiles as T}from"./packem_shared/isTestPath-C3QumE88.mjs";import{default as I}from"./packem_shared/discoverAuthApiCalls-CScPrUD-.mjs";import{CONTAINERS_FILENAME as F,discoverContainers as L}from"./packem_shared/CONTAINERS_FILENAME-mK4cZpcz.mjs";import{default as P}from"./packem_shared/discoverCrons-B1_NUt19.mjs";import{capabilitiesUsedBy as b,createTargetScope as y,foldCapabilitySignals as U,mayReadCapabilityContext as G,sourceCapabilitySignals as H}from"./packem_shared/capabilitiesUsedBy-DjRHg-Zk.mjs";import{FLAGS_FILENAME as B,discoverFlags as k}from"./packem_shared/FLAGS_FILENAME-BQk3SX8D.mjs";import{default as K}from"./packem_shared/discoverFunctions-DkPOc8b9.mjs";import{default as z}from"./packem_shared/discoverHttpRoutes-DCDgDIYv.mjs";import{default as q}from"./packem_shared/discoverHyperdriveCalls-CL-d0IVo.mjs";import{default as J}from"./packem_shared/discoverInserts-BcoTjXqI.mjs";import{d as X}from"./packem_shared/index-CN8FVvr-.mjs";import{default as $}from"./packem_shared/discoverMigrations-BWxx8Wv9.mjs";import{MUTATORS_FILENAME as re,discoverMutators as oe}from"./packem_shared/MUTATORS_FILENAME-Cy9h3EVW.mjs";import{default as ae}from"./packem_shared/discoverNondeterministicCalls-mFJNU8qY.mjs";import{NOTIFY_FILENAME as se,discoverNotifyCalls as fe,discoverNotifyChannels as me,discoverNotifyConfig as de}from"./packem_shared/NOTIFY_FILENAME-9to_l_Kh.mjs";import{default as ne}from"./packem_shared/readPackageDependencies-RHhGiz0k.mjs";import{default as le}from"./packem_shared/discoverQueries-CxQRVuIV.mjs";import{QUEUES_FILENAME as Se,discoverQueues as Ee}from"./packem_shared/QUEUES_FILENAME-Civ-7SiI.mjs";import{default as Ae}from"./packem_shared/discoverR2sqlCalls-B4oeTYEM.mjs";import{default as ve}from"./packem_shared/discoverRlsProcedures-Cl6UKT7L.mjs";import{default as Ne}from"./packem_shared/discoverRlsMetadata-D0B4nCmG.mjs";import{discoverSandboxUsage as Re}from"./packem_shared/discoverSandboxUsage--Z1vx7GM.mjs";import{default as he}from"./packem_shared/discoverSchema-Cwt-DQgh.mjs";import{readServiceBindings as _e,resolveServiceBindings as Fe}from"./packem_shared/readServiceBindings-BA49C6aN.mjs";import{SHAPES_FILENAME as Me,discoverShapes as Pe}from"./packem_shared/SHAPES_FILENAME-DVJbfDZ8.mjs";import{default as be}from"./packem_shared/discoverStorageRulesMetadata-CitX6ziW.mjs";import{WORKFLOWS_FILENAME as Ue,discoverWorkflows as Ge}from"./packem_shared/WORKFLOWS_FILENAME-kXq07aGl.mjs";import{emitApp as je}from"./packem_shared/emitApp-BL16wvE9.mjs";import{isD1GlobalTable as ke,isHyperdriveGlobalTable as We}from"./packem_shared/isD1GlobalTable-udvHAAzD.mjs";import{buildOpenApiDocument as Ve,emitOpenApi as ze,emitOpenApiModule as Qe}from"./packem_shared/buildOpenApiDocument-DWdj2jvW.mjs";import{OPENRPC_VERSION as we,buildOpenRpcDocument as Je,emitOpenRpc as Ye,emitOpenRpcModule as Xe}from"./packem_shared/OPENRPC_VERSION-l4HD4osw.mjs";import{DEFAULT_TARGET as $e,platformMatrixIds as er,readProjectTarget as rr,resolveCodegenTarget as or}from"./packem_shared/DEFAULT_TARGET-3OLdJhTj.mjs";import{loadProjectConfig as ar,readProjectConfigLiterals as ir}from"./packem_shared/loadProjectConfig-B7RmxIeD.mjs";import{PROJECT_CONFIG_FILENAMES as fr,findCodegenConfigFile as mr,findProjectConfigFile as dr,projectConfigCandidatePaths as pr}from"./packem_shared/PROJECT_CONFIG_FILENAMES-CLfsyvjA.mjs";import{SCHEMA_SNAPSHOT_FILENAME as cr,runCodegen as lr}from"./packem_shared/SCHEMA_SNAPSHOT_FILENAME-BqChgDtf.mjs";import{SchemaSnapshotParseError as Sr,buildSchemaSnapshot as Er,evaluateSchemaDrift as ur,parseSchemaSnapshot as Ar}from"./packem_shared/SchemaSnapshotParseError-H9eQX4ui.mjs";import{default as vr}from"./packem_shared/fingerprintSchemaSources-BKXkgkj4.mjs";import{schemaFromIr as Nr}from"./packem_shared/schemaFromIr-BWFnvCVg.mjs";import{LUNORA_ERROR_CODES as Rr,validatorIrToJsonSchema as Tr}from"./packem_shared/LUNORA_ERROR_CODES-CIAJQeKB.mjs";import{SDK_LANGUAGES as Ir,SDK_TARGETS as _r,generateSdk as Fr}from"./sdk/index.mjs";import{redact as Mr,secretKindOf as Pr}from"./packem_shared/redact-Cy14LEnc.mjs";import{default as br}from"./packem_shared/emitDrizzleSchema-bct1OuH5.mjs";import{e as Ur}from"./packem_shared/server-B6VhYK7m.mjs";import{e as Hr}from"./packem_shared/shard-C_cP6i89.mjs";import{G as Br}from"./packem_shared/shared-8vTRkL2-.mjs";import{MESSAGE_SOLUTIONS as Wr,findSolutionByMessage as Kr}from"@lunora/errors";import{createCodegenProject as zr,findTsconfig as Qr,refreshCodegenProject as qr,tsconfigFingerprint as wr}from"./packem_shared/createCodegenProject-ClPr_MXM.mjs";import{s as Yr,t as Xr,u as Zr}from"./packem_shared/shard-runtime-ByYXjCKY.mjs";import{emitApi as eo,emitCollections as ro,emitInternalApi as oo}from"./packem_shared/emitApi-zynTVppI.mjs";import{emitCrons as ao,emitScheduler as io,emitVectors as so,emitWranglerCronTriggers as fo}from"./packem_shared/emitCrons-lc-hnJYn.mjs";import{emitDataModel as po}from"./packem_shared/emitDataModel-CuFqq97x.mjs";import{emitFunctions as co}from"./packem_shared/emitFunctions-D7mopPiT.mjs";import{isTypedSchema as xo}from"./packem_shared/isTypedSchema-CKzc3ioR.mjs";const e="0.0.0";export{C as AGENTS_FILENAME,E as CAPABILITY_PROBES,F as CONTAINERS_FILENAME,A as CodegenDiagnosticError,$e as DEFAULT_TARGET,B as FLAGS_FILENAME,Br as GENERATED_HEADER,Rr as LUNORA_ERROR_CODES,Wr as LUNORA_SOLUTION_RULES,re as MUTATORS_FILENAME,se as NOTIFY_FILENAME,we as OPENRPC_VERSION,fr as PROJECT_CONFIG_FILENAMES,Se as QUEUES_FILENAME,cr as SCHEMA_SNAPSHOT_FILENAME,t as SCHEMA_SNAPSHOT_VERSION,Ir as SDK_LANGUAGES,_r as SDK_TARGETS,Me as SHAPES_FILENAME,Sr as SchemaSnapshotParseError,e as VERSION,Ue as WORKFLOWS_FILENAME,Ve as buildOpenApiDocument,Je as buildOpenRpcDocument,Er as buildSchemaSnapshot,b as capabilitiesUsedBy,zr as createCodegenProject,y as createTargetScope,n as describeErrorLevelFindings,g as diagnosticAt,a as diffSchemaSnapshots,N as discoverAgents,I as discoverAuthApiCalls,L as discoverContainers,P as discoverCrons,k as discoverFlags,K as discoverFunctions,z as discoverHttpRoutes,q as discoverHyperdriveCalls,J as discoverInserts,X as discoverMaskProcedures,$ as discoverMigrations,oe as discoverMutators,ae as discoverNondeterministicCalls,fe as discoverNotifyCalls,me as discoverNotifyChannels,de as discoverNotifyConfig,le as discoverQueries,Ee as discoverQueues,Ae as discoverR2sqlCalls,Ne as discoverRlsMetadata,ve as discoverRlsProcedures,Re as discoverSandboxUsage,he as discoverSchema,Pe as discoverShapes,be as discoverStorageRulesMetadata,Ge as discoverWorkflows,Yr as emitAgents,eo as emitApi,je as emitApp,ro as emitCollections,Xr as emitContainers,ao as emitCrons,po as emitDataModel,br as emitDrizzleSchema,co as emitFunctions,oo as emitInternalApi,ze as emitOpenApi,Qe as emitOpenApiModule,Ye as emitOpenRpc,Xe as emitOpenRpcModule,io as emitScheduler,Ur as emitServer,Hr as emitShard,so as emitVectors,Zr as emitWorkflows,fo as emitWranglerCronTriggers,c as errorAdvisoryNames,l as errorPlatformDiagnosticNames,ur as evaluateSchemaDrift,mr as findCodegenConfigFile,Kr as findLunoraSolution,dr as findProjectConfigFile,Qr as findTsconfig,vr as fingerprintSchemaSources,U as foldCapabilitySignals,f as formatAdvisories,Fr as generateSdk,ke as isD1GlobalTable,We as isHyperdriveGlobalTable,R as isTestPath,xo as isTypedSchema,m as lintSchema,T as listLunoraSourceFiles,ar as loadProjectConfig,G as mayReadCapabilityContext,Ar as parseSchemaSnapshot,er as platformMatrixIds,pr as projectConfigCandidatePaths,ne as readPackageDependencies,ir as readProjectConfigLiterals,rr as readProjectTarget,_e as readServiceBindings,Mr as redact,qr as refreshCodegenProject,or as resolveCodegenTarget,Fe as resolveServiceBindings,lr as runCodegen,Nr as schemaFromIr,Pr as secretKindOf,i as serializeSchemaSnapshot,x as sortedUniqueNames,H as sourceCapabilitySignals,d as toAdvisorContext,wr as tsconfigFingerprint,Tr as validatorIrToJsonSchema};
1
+ import{SCHEMA_SNAPSHOT_VERSION as t,diffSchemaSnapshots as a,serializeSchemaSnapshot as i}from"./packem_shared/SCHEMA_SNAPSHOT_VERSION-C7Um0EnM.mjs";import{formatAdvisories as f,lintSchema as m,toAdvisorContext as d}from"./packem_shared/formatAdvisories-BCVASH7N.mjs";import{describeErrorLevelFindings as n,errorAdvisoryNames as c,errorPlatformDiagnosticNames as l,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 g}from"./packem_shared/CodegenDiagnosticError-BUXlG3P-.mjs";import{AGENTS_FILENAME as C,discoverAgents as N}from"./packem_shared/AGENTS_FILENAME-isdHqPIt.mjs";import{isTestPath as R,listLunoraSourceFiles as T}from"./packem_shared/isTestPath-C3QumE88.mjs";import{default as I}from"./packem_shared/discoverAuthApiCalls-CScPrUD-.mjs";import{CONTAINERS_FILENAME as F,discoverContainers as L}from"./packem_shared/CONTAINERS_FILENAME-mK4cZpcz.mjs";import{default as P}from"./packem_shared/discoverCrons-B1_NUt19.mjs";import{capabilitiesUsedBy as b,createTargetScope as y,foldCapabilitySignals as U,mayReadCapabilityContext as G,sourceCapabilitySignals as H}from"./packem_shared/capabilitiesUsedBy-DjRHg-Zk.mjs";import{FLAGS_FILENAME as B,discoverFlags as k}from"./packem_shared/FLAGS_FILENAME-BQk3SX8D.mjs";import{default as K}from"./packem_shared/discoverFunctions-DkPOc8b9.mjs";import{default as z}from"./packem_shared/discoverHttpRoutes-DCDgDIYv.mjs";import{default as q}from"./packem_shared/discoverHyperdriveCalls-CL-d0IVo.mjs";import{default as J}from"./packem_shared/discoverInserts-BcoTjXqI.mjs";import{d as X}from"./packem_shared/index-CN8FVvr-.mjs";import{default as $}from"./packem_shared/discoverMigrations-BWxx8Wv9.mjs";import{MUTATORS_FILENAME as re,discoverMutators as oe}from"./packem_shared/MUTATORS_FILENAME-Cy9h3EVW.mjs";import{default as ae}from"./packem_shared/discoverNondeterministicCalls-mFJNU8qY.mjs";import{NOTIFY_FILENAME as se,discoverNotifyCalls as fe,discoverNotifyChannels as me,discoverNotifyConfig as de}from"./packem_shared/NOTIFY_FILENAME-9to_l_Kh.mjs";import{default as ne}from"./packem_shared/readPackageDependencies-RHhGiz0k.mjs";import{default as le}from"./packem_shared/discoverQueries-CxQRVuIV.mjs";import{QUEUES_FILENAME as Se,discoverQueues as Ee}from"./packem_shared/QUEUES_FILENAME-Civ-7SiI.mjs";import{default as Ae}from"./packem_shared/discoverR2sqlCalls-B4oeTYEM.mjs";import{default as ve}from"./packem_shared/discoverRlsProcedures-Cl6UKT7L.mjs";import{default as Ne}from"./packem_shared/discoverRlsMetadata-D0B4nCmG.mjs";import{discoverSandboxUsage as Re}from"./packem_shared/discoverSandboxUsage--Z1vx7GM.mjs";import{default as he}from"./packem_shared/discoverSchema-Cwt-DQgh.mjs";import{readServiceBindings as _e,resolveServiceBindings as Fe}from"./packem_shared/readServiceBindings-BA49C6aN.mjs";import{SHAPES_FILENAME as Me,discoverShapes as Pe}from"./packem_shared/SHAPES_FILENAME-DVJbfDZ8.mjs";import{default as be}from"./packem_shared/discoverStorageRulesMetadata-CitX6ziW.mjs";import{WORKFLOWS_FILENAME as Ue,discoverWorkflows as Ge}from"./packem_shared/WORKFLOWS_FILENAME-kXq07aGl.mjs";import{emitApp as je}from"./packem_shared/emitApp-BL16wvE9.mjs";import{isD1GlobalTable as ke,isHyperdriveGlobalTable as We}from"./packem_shared/isD1GlobalTable-udvHAAzD.mjs";import{buildOpenApiDocument as Ve,emitOpenApi as ze,emitOpenApiModule as Qe}from"./packem_shared/buildOpenApiDocument-DWdj2jvW.mjs";import{OPENRPC_VERSION as we,buildOpenRpcDocument as Je,emitOpenRpc as Ye,emitOpenRpcModule as Xe}from"./packem_shared/OPENRPC_VERSION-l4HD4osw.mjs";import{DEFAULT_TARGET as $e,platformMatrixIds as er,readProjectTarget as rr,resolveCodegenTarget as or}from"./packem_shared/DEFAULT_TARGET-3OLdJhTj.mjs";import{loadProjectConfig as ar,readProjectConfigLiterals as ir}from"./packem_shared/loadProjectConfig-B7RmxIeD.mjs";import{PROJECT_CONFIG_FILENAMES as fr,findCodegenConfigFile as mr,findProjectConfigFile as dr,projectConfigCandidatePaths as pr}from"./packem_shared/PROJECT_CONFIG_FILENAMES-CLfsyvjA.mjs";import{SCHEMA_SNAPSHOT_FILENAME as cr,runCodegen as lr}from"./packem_shared/SCHEMA_SNAPSHOT_FILENAME-DRiq9CX7.mjs";import{SchemaSnapshotParseError as Sr,buildSchemaSnapshot as Er,evaluateSchemaDrift as ur,parseSchemaSnapshot as Ar}from"./packem_shared/SchemaSnapshotParseError-H9eQX4ui.mjs";import{default as vr}from"./packem_shared/fingerprintSchemaSources-BKXkgkj4.mjs";import{schemaFromIr as Nr}from"./packem_shared/schemaFromIr-BWFnvCVg.mjs";import{LUNORA_ERROR_CODES as Rr,validatorIrToJsonSchema as Tr}from"./packem_shared/LUNORA_ERROR_CODES-CIAJQeKB.mjs";import{SDK_LANGUAGES as Ir,SDK_TARGETS as _r,generateSdk as Fr}from"./sdk/index.mjs";import{redact as Mr,secretKindOf as Pr}from"./packem_shared/redact-Cy14LEnc.mjs";import{default as br}from"./packem_shared/emitDrizzleSchema-bct1OuH5.mjs";import{e as Ur}from"./packem_shared/server-DlEPJi5i.mjs";import{e as Hr}from"./packem_shared/shard-C_cP6i89.mjs";import{G as Br}from"./packem_shared/shared-8vTRkL2-.mjs";import{MESSAGE_SOLUTIONS as Wr,findSolutionByMessage as Kr}from"@lunora/errors";import{createCodegenProject as zr,findTsconfig as Qr,refreshCodegenProject as qr,tsconfigFingerprint as wr}from"./packem_shared/createCodegenProject-ClPr_MXM.mjs";import{s as Yr,t as Xr,u as Zr}from"./packem_shared/shard-runtime-ByYXjCKY.mjs";import{emitApi as eo,emitCollections as ro,emitInternalApi as oo}from"./packem_shared/emitApi-zynTVppI.mjs";import{emitCrons as ao,emitScheduler as io,emitVectors as so,emitWranglerCronTriggers as fo}from"./packem_shared/emitCrons-lc-hnJYn.mjs";import{emitDataModel as po}from"./packem_shared/emitDataModel-CuFqq97x.mjs";import{emitFunctions as co}from"./packem_shared/emitFunctions-D7mopPiT.mjs";import{isTypedSchema as xo}from"./packem_shared/isTypedSchema-CKzc3ioR.mjs";const e="0.0.0";export{C as AGENTS_FILENAME,E as CAPABILITY_PROBES,F as CONTAINERS_FILENAME,A as CodegenDiagnosticError,$e as DEFAULT_TARGET,B as FLAGS_FILENAME,Br as GENERATED_HEADER,Rr as LUNORA_ERROR_CODES,Wr as LUNORA_SOLUTION_RULES,re as MUTATORS_FILENAME,se as NOTIFY_FILENAME,we as OPENRPC_VERSION,fr as PROJECT_CONFIG_FILENAMES,Se as QUEUES_FILENAME,cr as SCHEMA_SNAPSHOT_FILENAME,t as SCHEMA_SNAPSHOT_VERSION,Ir as SDK_LANGUAGES,_r as SDK_TARGETS,Me as SHAPES_FILENAME,Sr as SchemaSnapshotParseError,e as VERSION,Ue as WORKFLOWS_FILENAME,Ve as buildOpenApiDocument,Je as buildOpenRpcDocument,Er as buildSchemaSnapshot,b as capabilitiesUsedBy,zr as createCodegenProject,y as createTargetScope,n as describeErrorLevelFindings,g as diagnosticAt,a as diffSchemaSnapshots,N as discoverAgents,I as discoverAuthApiCalls,L as discoverContainers,P as discoverCrons,k as discoverFlags,K as discoverFunctions,z as discoverHttpRoutes,q as discoverHyperdriveCalls,J as discoverInserts,X as discoverMaskProcedures,$ as discoverMigrations,oe as discoverMutators,ae as discoverNondeterministicCalls,fe as discoverNotifyCalls,me as discoverNotifyChannels,de as discoverNotifyConfig,le as discoverQueries,Ee as discoverQueues,Ae as discoverR2sqlCalls,Ne as discoverRlsMetadata,ve as discoverRlsProcedures,Re as discoverSandboxUsage,he as discoverSchema,Pe as discoverShapes,be as discoverStorageRulesMetadata,Ge as discoverWorkflows,Yr as emitAgents,eo as emitApi,je as emitApp,ro as emitCollections,Xr as emitContainers,ao as emitCrons,po as emitDataModel,br as emitDrizzleSchema,co as emitFunctions,oo as emitInternalApi,ze as emitOpenApi,Qe as emitOpenApiModule,Ye as emitOpenRpc,Xe as emitOpenRpcModule,io as emitScheduler,Ur as emitServer,Hr as emitShard,so as emitVectors,Zr as emitWorkflows,fo as emitWranglerCronTriggers,c as errorAdvisoryNames,l as errorPlatformDiagnosticNames,ur as evaluateSchemaDrift,mr as findCodegenConfigFile,Kr as findLunoraSolution,dr as findProjectConfigFile,Qr as findTsconfig,vr as fingerprintSchemaSources,U as foldCapabilitySignals,f as formatAdvisories,Fr as generateSdk,ke as isD1GlobalTable,We as isHyperdriveGlobalTable,R as isTestPath,xo as isTypedSchema,m as lintSchema,T as listLunoraSourceFiles,ar as loadProjectConfig,G as mayReadCapabilityContext,Ar as parseSchemaSnapshot,er as platformMatrixIds,pr as projectConfigCandidatePaths,ne as readPackageDependencies,ir as readProjectConfigLiterals,rr as readProjectTarget,_e as readServiceBindings,Mr as redact,qr as refreshCodegenProject,or as resolveCodegenTarget,Fe as resolveServiceBindings,lr as runCodegen,Nr as schemaFromIr,Pr as secretKindOf,i as serializeSchemaSnapshot,x as sortedUniqueNames,H as sourceCapabilitySignals,d as toAdvisorContext,wr as tsconfigFingerprint,Tr as validatorIrToJsonSchema};
@@ -1,4 +1,4 @@
1
- import{existsSync as M,readFileSync as Ge,mkdirSync as $t,writeFileSync as gr,rmSync as ye,readdirSync as Cn}from"node:fs";import{dirname as Bt,join as E,relative as Tn}from"node:path";import{performance as mt}from"node:perf_hooks";import{runAdvisor as pr}from"@lunora/advisor";import{LunoraError as _}from"@lunora/errors";import{serializeSchemaSnapshot as mr}from"./SCHEMA_SNAPSHOT_VERSION-C7Um0EnM.mjs";import{toAdvisorContext as hr}from"./formatAdvisories-BCVASH7N.mjs";import{Node as r,SyntaxKind as d,Project as Vt,ts as vr,VariableDeclarationKind as Er}from"ts-morph";import{listLunoraSourceFiles as A,lunoraRelativePath as w,bindingKeyName as ce,collectCallRows as C,findObjectProperty as V,collectSecurityCallRows as xr,propertyInitializer as R,listSecurityScanFiles as Ye,objectLiteralFromCallbackBody as On,limitNameOf as kn,optionsObjectLiteral as Rn,handlerOf as Sr,collectNodeRows as ne,chainRootOf as Qe,outermostValueWrapper as I,isWriteTarget as Xe,isSameNode as y,unwrapExpression as h,isConstDeclaration as ie,memberAccessOf as Ut,returningFunctionOf as Pt,walkChain as Ar,RUN_METHODS as Fn,functionReferenceSegments as yr,isTestPath as br,isFunctionLike as re,functionKeyOf as Ln}from"./isTestPath-C3QumE88.mjs";import{b as Q,d as j,f as L,g as Wt,c as x,a as qt,w as jt,k as Nr,l as Pr,h as wr,m as Ir,j as wt,i as Cr}from"./attribution-CG8-kUcl.mjs";import{a as Fs,r as ht,i as G,b as Tr,m as Dn,c as Je,e as Ht,E as Mn,C as _n,d as Or,f as kr,g as Rr}from"./context-root-CNR6TAsP.mjs";import{a as P,i as Fr,c as ee,d as Kn,e as Lr,f as Dr,g as zn}from"./classify-procedure-call-BkaeM9Ej.mjs";import{a as S,s as Mr}from"./property-name-7cBlgK_O.mjs";import{b as _r,a as Ze}from"./module-specifiers-BctA0m_p.mjs";import{r as et,s as Kr}from"./parse-validator-iVTounLK.mjs";import zr from"./discoverAuthApiCalls-CScPrUD-.mjs";import{i as z,r as $n}from"./database-calls-UPlhi3Ks.mjs";import $r from"./discoverHyperdriveCalls-CL-d0IVo.mjs";import{diagnosticAt as de}from"./CodegenDiagnosticError-BUXlG3P-.mjs";import{m as Gt,a as Be,s as Bn,d as Br}from"./index-CN8FVvr-.mjs";import{MUTATORS_FILENAME as Vr,isDefineMutatorCallee as Ur,mutatorServerImplOf as Wr,discoverMutators as qr}from"./MUTATORS_FILENAME-Cy9h3EVW.mjs";import jr from"./discoverNondeterministicCalls-mFJNU8qY.mjs";import{discoverNotifyConfig as Hr,discoverNotifyCalls as Gr}from"./NOTIFY_FILENAME-9to_l_Kh.mjs";import Yr from"./discoverR2sqlCalls-B4oeTYEM.mjs";import Qr from"./discoverRlsProcedures-Cl6UKT7L.mjs";import{s as Yt,n as Xr}from"./dispatch-namespace-DwTjD7BU.mjs";import{secretKindOf as Jr,redact as Zr,isHeuristicSecretKind as eo,isSecretishName as to}from"./redact-Cy14LEnc.mjs";import{readProjectConfigLiterals as Vn,readMergeDurableObjects as so}from"./loadProjectConfig-B7RmxIeD.mjs";import{a as Le,d as no,r as io}from"./modules-l-Db0C4S.mjs";import{WORKFLOWS_FILENAME as ro,discoverWorkflows as oo}from"./WORKFLOWS_FILENAME-kXq07aGl.mjs";import{r as ao}from"./json-data-Chfs2Cz5.mjs";import{a as co,I as lo,g as uo,G as Un,d as fo,i as go}from"./shared-8vTRkL2-.mjs";import{createCodegenProject as po}from"./createCodegenProject-ClPr_MXM.mjs";import{findTsconfig as wE,refreshCodegenProject as IE,tsconfigFingerprint as CE}from"./createCodegenProject-ClPr_MXM.mjs";import{CAPABILITIES as mo,usedCapabilities as ho}from"./CAPABILITY_PROBES-brcmKenl.mjs";import{isD1GlobalTable as Wn,isHyperdriveGlobalTable as qn}from"./isD1GlobalTable-udvHAAzD.mjs";import{discoverAgents as vo}from"./AGENTS_FILENAME-isdHqPIt.mjs";import{discoverContainers as Eo}from"./CONTAINERS_FILENAME-mK4cZpcz.mjs";import xo from"./discoverCrons-B1_NUt19.mjs";import{contextPropertiesRead as So,fileWiresRequestSecretTool as Ao,createTargetScope as yo,discoverFeatureUsage as bo}from"./capabilitiesUsedBy-DjRHg-Zk.mjs";import jn from"./readPackageDependencies-RHhGiz0k.mjs";import{PROJECT_CONFIG_FILENAMES as No,findProjectConfigFile as Po}from"./PROJECT_CONFIG_FILENAMES-CLfsyvjA.mjs";import{discoverQueueDeclarations as wo}from"./QUEUES_FILENAME-Civ-7SiI.mjs";import{discoverSandboxUsage as Io}from"./discoverSandboxUsage--Z1vx7GM.mjs";import{resolveServiceBindings as Co}from"./readServiceBindings-BA49C6aN.mjs";import To from"./discoverStorageRulesMetadata-CitX6ziW.mjs";import{resolveCodegenTarget as It,gatePlatformFeatures as Oo,readTargetDiagnostics as ko,vectorizeDimensionDiagnostics as Ro,liveStreamsDeliveryAuthorizationDiagnostic as Fo,socketRoutesDeliveryAuthorizationDiagnostic as Lo,studioPlatformFor as Do,platformFeatureAvailable as Mo}from"./DEFAULT_TARGET-3OLdJhTj.mjs";import{i as _o}from"./schema-BgM8A3XV.mjs";import{b as Hn,e as Ko}from"./shard-C_cP6i89.mjs";import{e as zo,a as $o}from"./server-B6VhYK7m.mjs";import{emitDataModel as Bo}from"./emitDataModel-CuFqq97x.mjs";import{i as Vo,a as Uo,e as Wo,b as qo,d as jo,c as Ho}from"./unwrap-handler-return-CGdJGvGh.mjs";import Go from"./discoverFunctions-DkPOc8b9.mjs";import Yo from"./discoverHttpRoutes-DCDgDIYv.mjs";import Qo from"./discoverInserts-BcoTjXqI.mjs";import{e as Gn}from"./exported-procedure-chains-D1WlRfqJ.mjs";import Xo from"./discoverMigrations-BWxx8Wv9.mjs";import Jo from"./discoverQueries-CxQRVuIV.mjs";import Zo from"./discoverRlsMetadata-D0B4nCmG.mjs";import ea from"./discoverSchema-Cwt-DQgh.mjs";import{discoverShapes as ta}from"./SHAPES_FILENAME-DVJbfDZ8.mjs";import{i as sa}from"./reserved-words-CW1QFbTd.mjs";import{emitApp as na}from"./emitApp-BL16wvE9.mjs";import{readJsonSync as ia}from"@visulima/fs";import{buildSchemaSnapshot as ra}from"./SchemaSnapshotParseError-H9eQX4ui.mjs";import{buildOpenApiDocument as oa,emitOpenApiModule as aa}from"./buildOpenApiDocument-DWdj2jvW.mjs";import{buildOpenRpcDocument as ca,emitOpenRpcModule as la}from"./OPENRPC_VERSION-l4HD4osw.mjs";import{v as da,t as ua,u as fa,s as ga,w as pa}from"./shard-runtime-ByYXjCKY.mjs";import{emitCollections as ma,emitSeed as ha,emitApi as va,emitInternalApi as Ea}from"./emitApi-zynTVppI.mjs";import{emitCrons as xa,emitScheduler as Sa,emitShardRegistry as Aa,emitDurableObjects as ya,emitVectors as ba,emitWranglerCronTriggers as Na}from"./emitCrons-lc-hnJYn.mjs";import Pa from"./emitDrizzleSchema-bct1OuH5.mjs";import{LAZY_FUNCTION_DIRECTORY as Yn,emitFunctions as wa,emitLazyFunctionModules as Ia}from"./emitFunctions-D7mopPiT.mjs";const Ca=(e,t=!1)=>{if(e.length===0)return"";const s=fo(t),n=e.map(c=>{if(co(c.exportName,"live stream export name"),!lo.test(c.filePath))throw new Error(`@lunora/codegen: live stream file path is not safe to import: ${JSON.stringify(c.filePath)}`);return`import type { ${c.exportName} as ${c.exportName}Stream } from "../${c.filePath}.js";`}),i=e.map(c=>{const l=c.topics.map(u=>{uo(u.name,"live topic name");const f=`(typeof ${c.exportName}Stream)["topics"]["${u.name}"]`,g=`LiveTopicRef<LiveTopicPayload<${f}>>`,m=JSON.stringify(c.id);if(u.fields.length===0)return` ${u.name}: (): ${g} => ({ __lunoraLive: ${m}, topic: ${JSON.stringify(u.name)} }),`;const v=u.fields.map($=>`\${encodeURIComponent(key.${$})}`).join(":");return` ${u.name}: (key: LiveTopicKey<${f}>): ${g} => ({
1
+ import{existsSync as M,readFileSync as Ge,mkdirSync as $t,writeFileSync as gr,rmSync as ye,readdirSync as Cn}from"node:fs";import{dirname as Bt,join as E,relative as Tn}from"node:path";import{performance as mt}from"node:perf_hooks";import{runAdvisor as pr}from"@lunora/advisor";import{LunoraError as _}from"@lunora/errors";import{serializeSchemaSnapshot as mr}from"./SCHEMA_SNAPSHOT_VERSION-C7Um0EnM.mjs";import{toAdvisorContext as hr}from"./formatAdvisories-BCVASH7N.mjs";import{Node as r,SyntaxKind as d,Project as Vt,ts as vr,VariableDeclarationKind as Er}from"ts-morph";import{listLunoraSourceFiles as A,lunoraRelativePath as w,bindingKeyName as ce,collectCallRows as C,findObjectProperty as V,collectSecurityCallRows as xr,propertyInitializer as R,listSecurityScanFiles as Ye,objectLiteralFromCallbackBody as On,limitNameOf as kn,optionsObjectLiteral as Rn,handlerOf as Sr,collectNodeRows as ne,chainRootOf as Qe,outermostValueWrapper as I,isWriteTarget as Xe,isSameNode as y,unwrapExpression as h,isConstDeclaration as ie,memberAccessOf as Ut,returningFunctionOf as Pt,walkChain as Ar,RUN_METHODS as Fn,functionReferenceSegments as yr,isTestPath as br,isFunctionLike as re,functionKeyOf as Ln}from"./isTestPath-C3QumE88.mjs";import{b as Q,d as j,f as L,g as Wt,c as x,a as qt,w as jt,k as Nr,l as Pr,h as wr,m as Ir,j as wt,i as Cr}from"./attribution-CG8-kUcl.mjs";import{a as Fs,r as ht,i as G,b as Tr,m as Dn,c as Je,e as Ht,E as Mn,C as _n,d as Or,f as kr,g as Rr}from"./context-root-CNR6TAsP.mjs";import{a as P,i as Fr,c as ee,d as Kn,e as Lr,f as Dr,g as zn}from"./classify-procedure-call-BkaeM9Ej.mjs";import{a as S,s as Mr}from"./property-name-7cBlgK_O.mjs";import{b as _r,a as Ze}from"./module-specifiers-BctA0m_p.mjs";import{r as et,s as Kr}from"./parse-validator-iVTounLK.mjs";import zr from"./discoverAuthApiCalls-CScPrUD-.mjs";import{i as z,r as $n}from"./database-calls-UPlhi3Ks.mjs";import $r from"./discoverHyperdriveCalls-CL-d0IVo.mjs";import{diagnosticAt as de}from"./CodegenDiagnosticError-BUXlG3P-.mjs";import{m as Gt,a as Be,s as Bn,d as Br}from"./index-CN8FVvr-.mjs";import{MUTATORS_FILENAME as Vr,isDefineMutatorCallee as Ur,mutatorServerImplOf as Wr,discoverMutators as qr}from"./MUTATORS_FILENAME-Cy9h3EVW.mjs";import jr from"./discoverNondeterministicCalls-mFJNU8qY.mjs";import{discoverNotifyConfig as Hr,discoverNotifyCalls as Gr}from"./NOTIFY_FILENAME-9to_l_Kh.mjs";import Yr from"./discoverR2sqlCalls-B4oeTYEM.mjs";import Qr from"./discoverRlsProcedures-Cl6UKT7L.mjs";import{s as Yt,n as Xr}from"./dispatch-namespace-DwTjD7BU.mjs";import{secretKindOf as Jr,redact as Zr,isHeuristicSecretKind as eo,isSecretishName as to}from"./redact-Cy14LEnc.mjs";import{readProjectConfigLiterals as Vn,readMergeDurableObjects as so}from"./loadProjectConfig-B7RmxIeD.mjs";import{a as Le,d as no,r as io}from"./modules-l-Db0C4S.mjs";import{WORKFLOWS_FILENAME as ro,discoverWorkflows as oo}from"./WORKFLOWS_FILENAME-kXq07aGl.mjs";import{r as ao}from"./json-data-Chfs2Cz5.mjs";import{a as co,I as lo,g as uo,G as Un,d as fo,i as go}from"./shared-8vTRkL2-.mjs";import{createCodegenProject as po}from"./createCodegenProject-ClPr_MXM.mjs";import{findTsconfig as wE,refreshCodegenProject as IE,tsconfigFingerprint as CE}from"./createCodegenProject-ClPr_MXM.mjs";import{CAPABILITIES as mo,usedCapabilities as ho}from"./CAPABILITY_PROBES-brcmKenl.mjs";import{isD1GlobalTable as Wn,isHyperdriveGlobalTable as qn}from"./isD1GlobalTable-udvHAAzD.mjs";import{discoverAgents as vo}from"./AGENTS_FILENAME-isdHqPIt.mjs";import{discoverContainers as Eo}from"./CONTAINERS_FILENAME-mK4cZpcz.mjs";import xo from"./discoverCrons-B1_NUt19.mjs";import{contextPropertiesRead as So,fileWiresRequestSecretTool as Ao,createTargetScope as yo,discoverFeatureUsage as bo}from"./capabilitiesUsedBy-DjRHg-Zk.mjs";import jn from"./readPackageDependencies-RHhGiz0k.mjs";import{PROJECT_CONFIG_FILENAMES as No,findProjectConfigFile as Po}from"./PROJECT_CONFIG_FILENAMES-CLfsyvjA.mjs";import{discoverQueueDeclarations as wo}from"./QUEUES_FILENAME-Civ-7SiI.mjs";import{discoverSandboxUsage as Io}from"./discoverSandboxUsage--Z1vx7GM.mjs";import{resolveServiceBindings as Co}from"./readServiceBindings-BA49C6aN.mjs";import To from"./discoverStorageRulesMetadata-CitX6ziW.mjs";import{resolveCodegenTarget as It,gatePlatformFeatures as Oo,readTargetDiagnostics as ko,vectorizeDimensionDiagnostics as Ro,liveStreamsDeliveryAuthorizationDiagnostic as Fo,socketRoutesDeliveryAuthorizationDiagnostic as Lo,studioPlatformFor as Do,platformFeatureAvailable as Mo}from"./DEFAULT_TARGET-3OLdJhTj.mjs";import{i as _o}from"./schema-BgM8A3XV.mjs";import{b as Hn,e as Ko}from"./shard-C_cP6i89.mjs";import{e as zo,a as $o}from"./server-DlEPJi5i.mjs";import{emitDataModel as Bo}from"./emitDataModel-CuFqq97x.mjs";import{i as Vo,a as Uo,e as Wo,b as qo,d as jo,c as Ho}from"./unwrap-handler-return-CGdJGvGh.mjs";import Go from"./discoverFunctions-DkPOc8b9.mjs";import Yo from"./discoverHttpRoutes-DCDgDIYv.mjs";import Qo from"./discoverInserts-BcoTjXqI.mjs";import{e as Gn}from"./exported-procedure-chains-D1WlRfqJ.mjs";import Xo from"./discoverMigrations-BWxx8Wv9.mjs";import Jo from"./discoverQueries-CxQRVuIV.mjs";import Zo from"./discoverRlsMetadata-D0B4nCmG.mjs";import ea from"./discoverSchema-Cwt-DQgh.mjs";import{discoverShapes as ta}from"./SHAPES_FILENAME-DVJbfDZ8.mjs";import{i as sa}from"./reserved-words-CW1QFbTd.mjs";import{emitApp as na}from"./emitApp-BL16wvE9.mjs";import{readJsonSync as ia}from"@visulima/fs";import{buildSchemaSnapshot as ra}from"./SchemaSnapshotParseError-H9eQX4ui.mjs";import{buildOpenApiDocument as oa,emitOpenApiModule as aa}from"./buildOpenApiDocument-DWdj2jvW.mjs";import{buildOpenRpcDocument as ca,emitOpenRpcModule as la}from"./OPENRPC_VERSION-l4HD4osw.mjs";import{v as da,t as ua,u as fa,s as ga,w as pa}from"./shard-runtime-ByYXjCKY.mjs";import{emitCollections as ma,emitSeed as ha,emitApi as va,emitInternalApi as Ea}from"./emitApi-zynTVppI.mjs";import{emitCrons as xa,emitScheduler as Sa,emitShardRegistry as Aa,emitDurableObjects as ya,emitVectors as ba,emitWranglerCronTriggers as Na}from"./emitCrons-lc-hnJYn.mjs";import Pa from"./emitDrizzleSchema-bct1OuH5.mjs";import{LAZY_FUNCTION_DIRECTORY as Yn,emitFunctions as wa,emitLazyFunctionModules as Ia}from"./emitFunctions-D7mopPiT.mjs";const Ca=(e,t=!1)=>{if(e.length===0)return"";const s=fo(t),n=e.map(c=>{if(co(c.exportName,"live stream export name"),!lo.test(c.filePath))throw new Error(`@lunora/codegen: live stream file path is not safe to import: ${JSON.stringify(c.filePath)}`);return`import type { ${c.exportName} as ${c.exportName}Stream } from "../${c.filePath}.js";`}),i=e.map(c=>{const l=c.topics.map(u=>{uo(u.name,"live topic name");const f=`(typeof ${c.exportName}Stream)["topics"]["${u.name}"]`,g=`LiveTopicRef<LiveTopicPayload<${f}>>`,m=JSON.stringify(c.id);if(u.fields.length===0)return` ${u.name}: (): ${g} => ({ __lunoraLive: ${m}, topic: ${JSON.stringify(u.name)} }),`;const v=u.fields.map($=>`\${encodeURIComponent(key.${$})}`).join(":");return` ${u.name}: (key: LiveTopicKey<${f}>): ${g} => ({
2
2
  __lunoraLive: ${m},
3
3
  topic: \`${u.name}:${v}\`,
4
4
  }),`});return` ${c.exportName}: {
@@ -1 +1 @@
1
- import"./CAPABILITY_PROBES-brcmKenl.mjs";import{e}from"./server-B6VhYK7m.mjs";import"./shared-8vTRkL2-.mjs";import"./platform-8oj7iXQy.mjs";export{e as default};
1
+ import"./CAPABILITY_PROBES-brcmKenl.mjs";import{e}from"./server-DlEPJi5i.mjs";import"./shared-8vTRkL2-.mjs";import"./platform-8oj7iXQy.mjs";export{e as default};
@@ -1,11 +1,12 @@
1
- import{CAPABILITIES as Re}from"./CAPABILITY_PROBES-brcmKenl.mjs";import{join as q,relative as m,dirname as Q,isAbsolute as Se,sep as De}from"node:path";import{ts as i,Project as Me}from"ts-morph";import{G as Z,a as $,u as Ce,d as Ne}from"./shared-8vTRkL2-.mjs";import{p as Ae}from"./platform-8oj7iXQy.mjs";const ee=/(?:\.d)?\.([cm]?)tsx?$/u,Fe=t=>t.replace(ee,".d.$1ts"),te=(t,n)=>{const a=m(t,n).split(De).join("/").replace(ee,".$1js");return a.startsWith(".")?a:`./${a}`},ae=t=>t.replaceAll("\\","/"),E=(t,n,a)=>ae(q(t,Fe(m(n,a)))),Pe=t=>te(".",q("services",t.name,m(Q(t.wranglerPath),t.main))),We=t=>{const n=[],a=r=>{(i.isImportDeclaration(r)||i.isExportDeclaration(r))&&r.moduleSpecifier!==void 0&&i.isStringLiteral(r.moduleSpecifier)?n.push(r.moduleSpecifier):i.isImportTypeNode(r)&&i.isLiteralTypeNode(r.argument)&&i.isStringLiteral(r.argument.literal)&&n.push(r.argument.literal),i.forEachChild(r,a)};return a(t),n},Ge=(t,n)=>{const a=Q(t.wranglerPath),r=m(a,t.main);if(r.startsWith("..")||Se(r))throw new Error(`@lunora/codegen: service "${t.name}": its entry module (${t.main}) must be inside ${a} to be typed as RPC`);const d=q(n,"services",t.name),c=i.findConfigFile(a,o=>i.sys.fileExists(o)),p=new Me({compilerOptions:{composite:!1,declaration:!0,declarationMap:!1,emitDeclarationOnly:!0,incremental:!1,noEmit:!1,noEmitOnError:!1,outDir:d,rootDir:a},skipAddingFilesFromTsConfig:!0,...c===void 0?{}:{tsConfigFilePath:c}});p.addSourceFileAtPath(t.main),p.resolveSourceFileDependencies();const u={...p.getCompilerOptions(),preserveSymlinks:!0},x=new Map(p.getSourceFiles().map(o=>o.getFilePath()).filter(o=>!o.endsWith(".d.ts")&&!m(a,o).startsWith("..")).map(o=>[E(d,a,o),o])),y={};for(const o of p.emitToMemory({emitOnlyDtsFiles:!0}).getFiles()){const g=x.get(ae(o.filePath));if(g===void 0)continue;const h=i.createSourceFile(o.filePath,o.text,i.ScriptTarget.Latest,!1);let{text:f}=o;for(const b of We(h).toReversed()){const s=i.resolveModuleName(b.text,g,u,i.sys).resolvedModule?.resolvedFileName;if(s===void 0)continue;const T=E(d,a,s),v=x.has(T)?T:s;f=`${f.slice(0,b.getStart(h))}${JSON.stringify(te(Q(o.filePath),v))}${f.slice(b.getEnd())}`}y[m(n,o.filePath)]=`${Z}${f}`}if(y[m(n,E(d,a,t.main))]===void 0)throw new Error(`@lunora/codegen: service "${t.name}": TypeScript emitted no declaration for its entry module ${t.main}`);return y},je=(t,n=[])=>{const a=new Set;for(const r of t.tables)for(const d of Object.values(r.shape)){const c=Ce(d);c.kind==="storage"&&typeof c.bucket=="string"&&c.bucket!==""&&a.add(c.bucket)}for(const r of n)r!==""&&r!=="default"&&a.add(r);return["default",...[...a].toSorted((r,d)=>r.localeCompare(d))]},He=({agents:t=[],capabilities:n=new Set,containers:a=[],env:r,hasVectors:d=!0,hasFlags:c=!1,hasNotify:p=!1,identity:u,queues:x=[],schema:y,services:o=[],storageRuleBuckets:g=[],topics:h=[],useUmbrella:f=!1,workflows:b=[]}={})=>{const s=Ne(f),T=je(y??{tables:[]},g).map(e=>JSON.stringify(e)).join(" | "),v=e=>e.sandbox===!0?"SandboxContainerAccessor":"ContainerAccessor",re=[...new Set(a.map(e=>v(e)))].toSorted((e,l)=>e.localeCompare(l)),oe=a.length>0?`import type { ${re.join(", ")} } from "@lunora/container";
2
- `:"",ne=a.length>0?`
3
- readonly containers: {${a.map(e=>`
4
- readonly ${e.exportName}: ${v(e)};`).join("")}
5
- };`:"",L=[...n.has("ai")?[" /** Workers AI binding (the conventional `env.AI`), narrowing `ctx.ai`. */\n readonly AI?: unknown;"]:[],...a.map(e=>($(e.bindingName,`container binding "${e.bindingName}"`),` /** Durable Object namespace for the \`${e.exportName}\` container. */
6
- readonly ${e.bindingName}?: unknown;`)),...x.map(e=>($(e.bindingName,`queue binding "${e.bindingName}"`),` /** Queue producer binding for the \`${e.exportName}\` queue. */
7
- readonly ${e.bindingName}?: unknown;`))].join(`
8
- `),se=`
1
+ import{CAPABILITIES as Qe}from"./CAPABILITY_PROBES-brcmKenl.mjs";import{existsSync as D,readdirSync as de,readlinkSync as ce,lstatSync as qe,statSync as Le}from"node:fs";import{join as h,relative as y,dirname as d,isAbsolute as _e,resolve as Ve,sep as ue,basename as Ge}from"node:path";import{ts as c,Project as He}from"ts-morph";import{G as pe,a as N,u as Ke,d as Ue}from"./shared-8vTRkL2-.mjs";import{p as Je}from"./platform-8oj7iXQy.mjs";const me=/(?:\.d)?\.([cm]?)tsx?$/u,ze=t=>t.replace(me,".d.$1ts"),ye=(t,o)=>{const a=y(t,o).split(ue).join("/").replace(me,".$1js");return a.startsWith(".")?a:`./${a}`},he=t=>t.replaceAll("\\","/"),Y=(t,o,a)=>he(h(t,ze(y(o,a)))),Ye=t=>ye(".",h("services",t.name,y(d(t.wranglerPath),t.main))),Xe=t=>{const o=[],a=e=>{(c.isImportDeclaration(e)||c.isExportDeclaration(e))&&e.moduleSpecifier!==void 0&&c.isStringLiteral(e.moduleSpecifier)?o.push(e.moduleSpecifier):c.isImportTypeNode(e)&&c.isLiteralTypeNode(e.argument)&&c.isStringLiteral(e.argument.literal)&&o.push(e.argument.literal),c.forEachChild(e,a)};return a(t),o},T=t=>{const{mtimeMs:o,size:a}=Le(t);return`${String(o)}:${String(a)}`},Ze=new Set([".git",".wrangler","dist","node_modules","target"]),fe=t=>de(t,{withFileTypes:!0}).flatMap(o=>{const a=h(t,o.name);return o.isSymbolicLink()?[`${a}->${ce(a)}`]:o.isDirectory()&&o.name.startsWith("@")?[`${a}:${T(a)}`,...fe(a)]:[]}),be=t=>[`${t}:${T(t)}`,...fe(t)],ge=t=>{const o=h(t,"node_modules"),a=D(o)?be(o):[],e=d(t);return e===t?a:[...a,...ge(e)]},et=(t,o)=>{const a=[];try{const e=s=>{for(const n of de(s,{withFileTypes:!0})){const l=h(s,n.name);if(l!==o)if(n.isSymbolicLink())a.push(`${l}->${ce(l)}`);else if(n.isDirectory()){if(n.name==="node_modules")a.push(...be(l));else if(!Ze.has(n.name)){if(!qe(l).isDirectory())throw new Error(`${l} changed during the scan`);e(l)}}else a.push(`${l}:${T(l)}`)}};e(t),a.push(...ge(t))}catch{return}return[...new Set(a)].toSorted((e,s)=>e.localeCompare(s)).join(`
2
+ `)},tt=t=>Ge(d(t)).startsWith("@")?d(d(t)):d(t),se=(t,o)=>!y(o,t).startsWith("..")&&!t.split(ue).includes("node_modules"),ie=(t,o)=>{const a=[];let e=t;for(;e!==d(e)&&!D(h(e,"package.json"));)a.push(e),e=d(e);if(D(h(e,"package.json"))){for(const s of[...a,e,h(e,"package.json")])o.add(s);return e}},at=(t,o,a)=>{let e=t;for(;y(e,o).startsWith("..")&&e!==d(e);)a.add(e),e=d(e);a.add(e)},rt=(t,o)=>{const a=new Set;t.some(e=>se(e,o))&&ie(o,a);for(const e of t){if(se(e,o)){for(let n=d(e);n!==o&&n!==d(n);n=d(n))a.add(n);continue}const s=ie(d(e),a);s===void 0?at(d(e),o,a):a.add(tt(s))}return[...a].map(e=>[e,T(e)])},xe=new Map,le=([t,o])=>{try{return T(t)===o}catch{return!1}},ot=(t,o,a)=>{const e=xe.get(t);return e?.optionsKey===o&&e.stamps.every(n=>le(n))&&e.directories.every(n=>le(n))&&a!==void 0&&e.tree===a?e.files:void 0},nt=(t,o,a)=>{const e=[...o.stamps,...o.directories].every(([,s])=>Math.floor(Number.parseFloat(s))<=a);o.tree!==void 0&&e&&xe.set(t,{...o,tree:o.tree})},st=(t,o)=>({directories:rt(o,t),stamps:o.map(a=>[a,T(a)])}),ht=(t,o)=>{const a=d(t.wranglerPath),e=y(a,t.main);if(e.startsWith("..")||_e(e))throw new Error(`@lunora/codegen: service "${t.name}": its entry module (${t.main}) must be inside ${a} to be typed as RPC`);const s=h(o,"services",t.name),n=c.findConfigFile(a,i=>c.sys.fileExists(i)),l=new He({compilerOptions:{composite:!1,declaration:!0,declarationMap:!1,emitDeclarationOnly:!0,incremental:!1,noEmit:!1,noEmitOnError:!1,outDir:s,rootDir:a},skipAddingFilesFromTsConfig:!0,...n===void 0?{}:{tsConfigFilePath:n}}),m=JSON.stringify([t.name,t.main,t.wranglerPath,o]),v=JSON.stringify(l.getCompilerOptions()),w=et(a,Ve(o)),g=ot(m,v,w);if(g!==void 0)return g;const A=Date.now();l.addSourceFileAtPath(t.main),l.resolveSourceFileDependencies();const $=l.getProgram().compilerObject.getSourceFiles().map(i=>i.fileName).filter(i=>D(i)),{directories:F,stamps:S}=st(a,$),u={...l.getCompilerOptions(),preserveSymlinks:!0},O=new Map(l.getSourceFiles().map(i=>i.getFilePath()).filter(i=>!i.endsWith(".d.ts")&&!y(a,i).startsWith("..")).map(i=>[Y(s,a,i),i])),f={};for(const i of l.emitToMemory({emitOnlyDtsFiles:!0}).getFiles()){const B=O.get(he(i.filePath));if(B===void 0)continue;const R=c.createSourceFile(i.filePath,i.text,c.ScriptTarget.Latest,!1);let{text:b}=i;for(const k of Xe(R).toReversed()){const x=c.resolveModuleName(k.text,B,u,c.sys).resolvedModule?.resolvedFileName;if(x===void 0)continue;const I=Y(s,a,x),W=O.has(I)?I:x;b=`${b.slice(0,k.getStart(R))}${JSON.stringify(ye(d(i.filePath),W))}${b.slice(k.getEnd())}`}f[y(o,i.filePath)]=`${pe}${b}`}if(f[y(o,Y(s,a,t.main))]===void 0)throw new Error(`@lunora/codegen: service "${t.name}": TypeScript emitted no declaration for its entry module ${t.main}`);return nt(m,{files:f,optionsKey:v,directories:F,stamps:S,tree:w},A),f},it=(t,o=[])=>{const a=new Set;for(const e of t.tables)for(const s of Object.values(e.shape)){const n=Ke(s);n.kind==="storage"&&typeof n.bucket=="string"&&n.bucket!==""&&a.add(n.bucket)}for(const e of o)e!==""&&e!=="default"&&a.add(e);return["default",...[...a].toSorted((e,s)=>e.localeCompare(s))]},ft=({agents:t=[],capabilities:o=new Set,containers:a=[],env:e,hasVectors:s=!0,hasFlags:n=!1,hasNotify:l=!1,identity:m,queues:v=[],schema:w,services:g=[],storageRuleBuckets:A=[],topics:$=[],useUmbrella:F=!1,workflows:S=[]}={})=>{const u=Ue(F),O=it(w??{tables:[]},A).map(r=>JSON.stringify(r)).join(" | "),f=r=>r.sandbox===!0?"SandboxContainerAccessor":"ContainerAccessor",i=[...new Set(a.map(r=>f(r)))].toSorted((r,p)=>r.localeCompare(p)),B=a.length>0?`import type { ${i.join(", ")} } from "@lunora/container";
3
+ `:"",R=a.length>0?`
4
+ readonly containers: {${a.map(r=>`
5
+ readonly ${r.exportName}: ${f(r)};`).join("")}
6
+ };`:"",b=[...o.has("ai")?[" /** Workers AI binding (the conventional `env.AI`), narrowing `ctx.ai`. */\n readonly AI?: unknown;"]:[],...a.map(r=>(N(r.bindingName,`container binding "${r.bindingName}"`),` /** Durable Object namespace for the \`${r.exportName}\` container. */
7
+ readonly ${r.bindingName}?: unknown;`)),...v.map(r=>(N(r.bindingName,`queue binding "${r.bindingName}"`),` /** Queue producer binding for the \`${r.exportName}\` queue. */
8
+ readonly ${r.bindingName}?: unknown;`))].join(`
9
+ `),k=`
9
10
 
10
11
  /**
11
12
  * This project's Cloudflare bindings, as far as codegen can discover them from
@@ -18,24 +19,24 @@ import{CAPABILITIES as Re}from"./CAPABILITY_PROBES-brcmKenl.mjs";import{join as
18
19
  * surface, so treat them as \`Fetcher\`/\`Service<unknown>\` and cast.
19
20
  */
20
21
  export interface CloudflareBindings {
21
- readonly [binding: string]: unknown;${L?`
22
- ${L}`:""}
22
+ readonly [binding: string]: unknown;${b?`
23
+ ${b}`:""}
23
24
  }
24
25
 
25
26
  /** Alias for {@link CloudflareBindings} — the typed shape of \`env\`. */
26
- export type Env = CloudflareBindings;`,V=e=>Re.map(l=>l.tier!==void 0&&e.includes(l.tier)&&n.has(l.key)?l.serverCtxField:"").join(""),_=V(["every"]),ie=V(["every","action"]),k=d&&(y?.vectorIndexes.length??0)>0,I=k?' | "vectors"':"",G=k?`
27
- readonly vectors: VectorSearch<VectorIndexName>;`:"",le=k?`
28
- readonly vectors: VectorSearchReader<VectorIndexName>;`:"",de=k?`import type { VectorSearch, VectorSearchReader } from "${s.server}";
27
+ export type Env = CloudflareBindings;`,x=r=>Qe.map(p=>p.tier!==void 0&&r.includes(p.tier)&&o.has(p.key)?p.serverCtxField:"").join(""),I=x(["every"]),W=x(["every","action"]),M=s&&(w?.vectorIndexes.length??0)>0,P=M?' | "vectors"':"",X=M?`
28
+ readonly vectors: VectorSearch<VectorIndexName>;`:"",Te=M?`
29
+ readonly vectors: VectorSearchReader<VectorIndexName>;`:"",ve=M?`import type { VectorSearch, VectorSearchReader } from "${u.server}";
29
30
  import type { VectorIndexName } from "./dataModel.js";
30
- `:"",O=c?`
31
+ `:"",j=n?`
31
32
  /** Feature-flag evaluation (OpenFeature). Reads are memoized per request; evaluations never throw — a provider error resolves to the supplied default. */
32
- readonly flags: import("${s.flags}").LunoraFlags;`:"",B=p?`
33
+ readonly flags: import("${u.flags}").LunoraFlags;`:"",E=l?`
33
34
  /** Multi-channel notifications (@lunora/notify): send / chat / inApp / webhook plus the push device sub-facade. Sends are external I/O — confine them to action handlers. */
34
35
  readonly notify: import("@lunora/notify").LunoraNotify;
35
36
  /** Device push sub-facade — the same object as ctx.notify.push (register / send / broadcast). Sends belong in action handlers. */
36
- readonly push: import("@lunora/notify").LunoraPush;`:"",w=b.length>0,ce=w?`import type { WorkflowHandle } from "@lunora/workflow";
37
+ readonly push: import("@lunora/notify").LunoraPush;`:"",C=S.length>0,we=C?`import type { WorkflowHandle } from "@lunora/workflow";
37
38
  import type * as lunoraWorkflowDefinitions from "../workflows.js";
38
- `:"",ue=w?`
39
+ `:"",$e=C?`
39
40
 
40
41
  /** Params type carried by a \`defineWorkflow\` definition (its phantom \`__params\`). */
41
42
  type WorkflowParamsOf<Definition> = Definition extends { __params?: infer Params }
@@ -46,56 +47,56 @@ type WorkflowParamsOf<Definition> = Definition extends { __params?: infer Params
46
47
 
47
48
  /** This project's declared workflows, addressable from \`ctx.workflows\` by their \`lunora/workflows.ts\` export name. */
48
49
  export interface LunoraWorkflows {
49
- ${b.map(e=>` get(name: ${JSON.stringify(e.exportName)}): WorkflowHandle<WorkflowParamsOf<typeof lunoraWorkflowDefinitions.${e.exportName}>>;`).join(`
50
+ ${S.map(r=>` get(name: ${JSON.stringify(r.exportName)}): WorkflowHandle<WorkflowParamsOf<typeof lunoraWorkflowDefinitions.${r.exportName}>>;`).join(`
50
51
  `)}
51
- }`:"",H=w?' | "workflows"':"",U=w?`
52
- readonly workflows: LunoraWorkflows;`:"",R=Ae(x),S=R.length>0,D=h.length>0,M=[...S?["QueueProducer"]:[],...D?["TopicPublisher"]:[]],z=[...new Set([...R,...h].map(e=>e.filePath))].toSorted((e,l)=>+(l==="queues")-+(e==="queues")||e.localeCompare(l)),C=e=>e==="queues"?"lunoraQueueDefinitions":`lunoraQueueDefinitions${String(z.indexOf(e))}`,pe=M.length>0?`import type { ${M.join(", ")} } from "@lunora/queue";
53
- ${z.map(e=>`import type * as ${C(e)} from "../${e}.js";
54
- `).join("")}`:"",me=M.length>0?"\n\n/** Message body type carried by a `defineQueue` / `defineTopic` definition (its phantom `__lunoraBody`). */\ntype QueueBodyOf<Definition> = Definition extends { __lunoraBody?: infer Body } ? (unknown extends Body ? unknown : NonNullable<Body>) : unknown;":"",ye=S?`
52
+ }`:"",Z=C?' | "workflows"':"",ee=C?`
53
+ readonly workflows: LunoraWorkflows;`:"",Q=Je(v),q=Q.length>0,L=$.length>0,_=[...q?["QueueProducer"]:[],...L?["TopicPublisher"]:[]],te=[...new Set([...Q,...$].map(r=>r.filePath))].toSorted((r,p)=>+(p==="queues")-+(r==="queues")||r.localeCompare(p)),V=r=>r==="queues"?"lunoraQueueDefinitions":`lunoraQueueDefinitions${String(te.indexOf(r))}`,ke=_.length>0?`import type { ${_.join(", ")} } from "@lunora/queue";
54
+ ${te.map(r=>`import type * as ${V(r)} from "../${r}.js";
55
+ `).join("")}`:"",Ie=_.length>0?"\n\n/** Message body type carried by a `defineQueue` / `defineTopic` definition (its phantom `__lunoraBody`). */\ntype QueueBodyOf<Definition> = Definition extends { __lunoraBody?: infer Body } ? (unknown extends Body ? unknown : NonNullable<Body>) : unknown;":"",Se=q?`
55
56
 
56
57
  /** This project's declared queues, addressable from \`ctx.queues\` by their \`lunora/queues.ts\` export name. */
57
58
  export interface LunoraQueues {
58
- ${R.map(e=>` readonly ${e.exportName}: QueueProducer<QueueBodyOf<typeof ${C(e.filePath)}.${e.exportName}>>;`).join(`
59
+ ${Q.map(r=>` readonly ${r.exportName}: QueueProducer<QueueBodyOf<typeof ${V(r.filePath)}.${r.exportName}>>;`).join(`
59
60
  `)}
60
- }`:"",he=D?`
61
+ }`:"",Oe=L?`
61
62
 
62
63
  /** This project's declared topics, addressable from \`ctx.topics\` by their \`lunora/queues.ts\` export name. */
63
64
  export interface LunoraTopics {
64
- ${h.map(e=>` readonly ${e.exportName}: TopicPublisher<QueueBodyOf<typeof ${C(e.filePath)}.${e.exportName}>>;`).join(`
65
+ ${$.map(r=>` readonly ${r.exportName}: TopicPublisher<QueueBodyOf<typeof ${V(r.filePath)}.${r.exportName}>>;`).join(`
65
66
  `)}
66
- }`:"",fe=`${me}${ye}${he}`,J=S?`
67
- readonly queues: LunoraQueues;`:"",K=D?`
68
- readonly topics: LunoraTopics;`:"",N=o.length>0,Y=o.filter(e=>e.rpcEntrypoint!==void 0),be=Y.length>0?"ServiceFetcher, ServiceRpc":"ServiceFetcher",xe=N?`import type { ${be} } from "${s.server}";
69
- ${Y.map(e=>`import type * as lunoraService_${e.name} from ${JSON.stringify(Pe(e))};
70
- `).join("")}`:"",ge=N?`
67
+ }`:"",Be=`${Ie}${Se}${Oe}`,ae=q?`
68
+ readonly queues: LunoraQueues;`:"",re=L?`
69
+ readonly topics: LunoraTopics;`:"",G=g.length>0,oe=g.filter(r=>r.rpcEntrypoint!==void 0),Re=oe.length>0?"ServiceFetcher, ServiceRpc":"ServiceFetcher",Me=G?`import type { ${Re} } from "${u.server}";
70
+ ${oe.map(r=>`import type * as lunoraService_${r.name} from ${JSON.stringify(Ye(r))};
71
+ `).join("")}`:"",Ce=G?`
71
72
 
72
73
  /** This project's service bindings (\`lunora.config\` \`services\`), addressable from \`ctx.services\` in actions. */
73
74
  export interface LunoraServices {
74
- ${o.map(e=>{$(e.name,`service "${e.name}"`);const l=e.rpcEntrypoint===void 0?"ServiceFetcher":`ServiceRpc<typeof lunoraService_${e.name}.${e.rpcEntrypoint}>`;return` readonly ${e.name}: ${l};`}).join(`
75
+ ${g.map(r=>{N(r.name,`service "${r.name}"`);const p=r.rpcEntrypoint===void 0?"ServiceFetcher":`ServiceRpc<typeof lunoraService_${r.name}.${r.rpcEntrypoint}>`;return` readonly ${r.name}: ${p};`}).join(`
75
76
  `)}
76
- }`:"",Te=N?`
77
- readonly services: LunoraServices;`:"",A=t.length>0,ve=A?`import type { AgentHandle } from "@lunora/agent";
78
- `:"",ke=A?`
77
+ }`:"",Ne=G?`
78
+ readonly services: LunoraServices;`:"",H=t.length>0,De=H?`import type { AgentHandle } from "@lunora/agent";
79
+ `:"",Ae=H?`
79
80
 
80
81
  /** This project's declared agents, addressable from \`ctx.agents\` by their \`lunora/agents.ts\` export name. */
81
82
  export interface LunoraAgents {
82
- ${t.map(e=>($(e.exportName,`agent export "${e.exportName}"`),` readonly ${e.exportName}: AgentHandle;`)).join(`
83
+ ${t.map(r=>(N(r.exportName,`agent export "${r.exportName}"`),` readonly ${r.exportName}: AgentHandle;`)).join(`
83
84
  `)}
84
- }`:"",X=A?`
85
- readonly agents: LunoraAgents;`:"",we=u?`import type { InferIdentity } from "${s.server}";
85
+ }`:"",ne=H?`
86
+ readonly agents: LunoraAgents;`:"",Fe=m?`import type { InferIdentity } from "${u.server}";
86
87
  import type * as lunoraIdentityContract from "../identity.js";
87
- `:"",$e=u?`
88
+ `:"",We=m?`
88
89
 
89
90
  /** This app's declared identity claim contract (\`defineIdentity\` in \`lunora/identity.ts\`) — the typed shape of \`ctx.auth.getIdentity()\`, the RLS policy \`ctx.auth.identity\`, and the \`authorizeShard\`/\`authorizeFanOut\` identity argument. */
90
- export type Identity = InferIdentity<typeof lunoraIdentityContract.${u.exportName}>;
91
+ export type Identity = InferIdentity<typeof lunoraIdentityContract.${m.exportName}>;
91
92
 
92
93
  /** \`ctx.auth\` narrowed so \`getIdentity()\` resolves the declared {@link Identity} contract instead of the untyped claim bag. */
93
- type NarrowedAuth = Omit<QueryCtxBase["auth"], "getIdentity"> & { getIdentity: () => Promise<Identity | null> };`:"",F=u?' | "auth"':"",P=u?`
94
- readonly auth: NarrowedAuth;`:"",Ie=u?", Identity":"",Oe=r?`import type * as lunoraEnvContract from "../env.js";
95
- `:"",Be=r?`
94
+ type NarrowedAuth = Omit<QueryCtxBase["auth"], "getIdentity"> & { getIdentity: () => Promise<Identity | null> };`:"",K=m?' | "auth"':"",U=m?`
95
+ readonly auth: NarrowedAuth;`:"",Pe=m?", Identity":"",je=e?`import type * as lunoraEnvContract from "../env.js";
96
+ `:"",Ee=e?`
96
97
 
97
98
  /** This app's declared env contract (\`defineEnv\` in \`lunora/env.ts\`) — the validated, coercion-aware shape of \`ctx.env\`. */
98
- export type LunoraEnv = ReturnType<typeof lunoraEnvContract.${r.exportName}>;`:"",W=r?' | "env"':"",j=r?"\n /** Validated, typed environment declared by `defineEnv` in `lunora/env.ts` — parsed & coercion-aware config values (`ctx.env.STRIPE_KEY`); a missing or invalid value throws at read time. */\n readonly env: LunoraEnv;":"";return`${Z}import { createPolicyDsl, defineMutator as defineMutatorBase, initLunora, v as vBase } from "${s.server}";
99
+ export type LunoraEnv = ReturnType<typeof lunoraEnvContract.${e.exportName}>;`:"",J=e?' | "env"':"",z=e?"\n /** Validated, typed environment declared by `defineEnv` in `lunora/env.ts` — parsed & coercion-aware config values (`ctx.env.STRIPE_KEY`); a missing or invalid value throws at read time. */\n readonly env: LunoraEnv;":"";return`${pe}import { createPolicyDsl, defineMutator as defineMutatorBase, initLunora, v as vBase } from "${u.server}";
99
100
  import type {
100
101
  ActionBuilder,
101
102
  ActionCtx as ActionCtxBase,
@@ -117,7 +118,7 @@ import type {
117
118
  Storage as StorageBase,
118
119
  TableReader,
119
120
  Validator,
120
- } from "${s.server}";
121
+ } from "${u.server}";
121
122
 
122
123
  import type {
123
124
  DatabaseReaderFacade as DatabaseReaderFacadeOf,
@@ -126,7 +127,7 @@ import type {
126
127
  TableReaderFacade as TableReaderFacadeOf,
127
128
  TableWriterFacade as TableWriterFacadeOf,
128
129
  WithArg as WithArgOf,
129
- } from "${s.serverDataModel}";
130
+ } from "${u.serverDataModel}";
130
131
 
131
132
  export type {
132
133
  AggregateOp,
@@ -149,10 +150,10 @@ export type {
149
150
  Where,
150
151
  WhereOf,
151
152
  WhereOperators,
152
- } from "${s.serverDataModel}";
153
+ } from "${u.serverDataModel}";
153
154
 
154
155
  import type { DataModel, Doc, GeoIndexNamesByTable, Id as IdOfTable, IndexNamesByTable, Insert, InsertModel, RankIndexNamesByTable, Relations, SearchIndexNamesByTable, TableName } from "./dataModel.js";
155
- ${de}${oe}${ce}${pe}${xe}${ve}${we}${Oe}
156
+ ${ve}${B}${we}${ke}${Me}${De}${Fe}${je}
156
157
  export type { AppTableName, DataModel, Doc, Id, TableName } from "./dataModel.js";
157
158
 
158
159
  /**
@@ -212,7 +213,7 @@ export interface OrmWriter extends OrmReader {
212
213
  }
213
214
 
214
215
  /** Storage buckets this schema declares (\`v.storage("name")\`), narrowing \`ctx.storage.bucket(name)\`. */
215
- export type StorageBucketName = ${T};${se}${ue}${fe}${ge}${ke}${$e}${Be}
216
+ export type StorageBucketName = ${O};${k}${$e}${Be}${Ce}${Ae}${We}${Ee}
216
217
 
217
218
  /**
218
219
  * Project-typed contexts. The base contexts from \`@lunora/server\` are
@@ -275,22 +276,22 @@ type AsIdTable<T extends string> = T extends TableName ? T : string extends T ?
275
276
  */
276
277
  type TypedAsId = <T extends string>(tableName: AsIdTable<T>, id: string) => IdOfTable<T & TableName>;
277
278
 
278
- export interface QueryCtx extends Omit<QueryCtxBase, "db" | "storage"${I}${F}${W}> {
279
+ export interface QueryCtx extends Omit<QueryCtxBase, "db" | "storage"${P}${K}${J}> {
279
280
  readonly db: Omit<DatabaseReader, "asId" | "query" | "get"> & DatabaseReaderFacade & { asId: TypedAsId; query: TypedTableQuery; get: TypedTableGet };
280
281
  readonly orm: OrmReader;
281
- readonly storage: ReadOnlyStorage<StorageBucketName>;${le}${_}${O}${B}${j}${P}
282
+ readonly storage: ReadOnlyStorage<StorageBucketName>;${Te}${I}${j}${E}${z}${U}
282
283
  }
283
284
 
284
- export interface MutationCtx extends Omit<MutationCtxBase, "db" | "storage"${I}${H}${F}${W}> {
285
+ export interface MutationCtx extends Omit<MutationCtxBase, "db" | "storage"${P}${Z}${K}${J}> {
285
286
  readonly db: Omit<DatabaseWriter, "asId" | "query" | "get"> & DatabaseWriterFacade & { asId: TypedAsId; query: TypedTableQuery; get: TypedTableGet };
286
287
  readonly orm: OrmWriter;
287
- readonly storage: MutationStorage<StorageBucketName>;${G}${_}${O}${B}${j}${U}${J}${K}${X}${P}
288
+ readonly storage: MutationStorage<StorageBucketName>;${X}${I}${j}${E}${z}${ee}${ae}${re}${ne}${U}
288
289
  }
289
290
 
290
- export interface ActionCtx extends Omit<ActionCtxBase, "db" | "storage"${I}${H}${F}${W}> {
291
+ export interface ActionCtx extends Omit<ActionCtxBase, "db" | "storage"${P}${Z}${K}${J}> {
291
292
  readonly db: Omit<DatabaseWriter, "asId" | "query" | "get"> & DatabaseWriterFacade & { asId: TypedAsId; query: TypedTableQuery; get: TypedTableGet };
292
293
  readonly orm: OrmWriter;
293
- readonly storage: StorageBase<StorageBucketName>;${G}${ie}${ne}${O}${B}${Te}${j}${U}${J}${K}${X}${P}
294
+ readonly storage: StorageBase<StorageBucketName>;${X}${W}${R}${j}${E}${Ne}${z}${ee}${ae}${re}${ne}${U}
294
295
  }
295
296
 
296
297
  /**
@@ -323,7 +324,7 @@ export const internalAction = lunoraBuilders.internalAction as unknown as Intern
323
324
  /**
324
325
  * \`defineMutator\` bound to this project's typed {@link MutationCtx} — declare
325
326
  * custom mutators (\`lunora/mutators.ts\`) with it instead of importing from
326
- * \`${s.server}\`, and the authoritative \`server\` impl's \`ctx\` carries the
327
+ * \`${u.server}\`, and the authoritative \`server\` impl's \`ctx\` carries the
327
328
  * schema-typed \`ctx.db\` (\`ctx.db.query("nodes")\` resolves \`Doc<"nodes">\`,
328
329
  * \`ctx.db.patch(id, …)\` takes an \`Id<"nodes">\`) with no hand-written ctx type and
329
330
  * no \`as unknown as\` cast. Runtime-identical to the package export; only the
@@ -348,7 +349,7 @@ export const defineMutator = defineMutatorBase as unknown as <Args extends Recor
348
349
  * Runtime-identical to \`@lunora/server\`'s \`definePolicy\`; only the types narrow,
349
350
  * so the \`rls()\` chain discovers a policy authored either way the same.
350
351
  */
351
- export const definePolicy = createPolicyDsl<DataModel, Relations${Ie}>();
352
+ export const definePolicy = createPolicyDsl<DataModel, Relations${Pe}>();
352
353
 
353
354
  /**
354
355
  * The validator builder \`v\`, with \`v.id(...)\` constrained to THIS schema's
@@ -365,4 +366,4 @@ export const definePolicy = createPolicyDsl<DataModel, Relations${Ie}>();
365
366
  export const v = vBase as unknown as Omit<typeof vBase, "id"> & {
366
367
  id: <T extends TableName>(table: T) => ColumnValidator<IdOfTable<T>, IdOfTable<T>>;
367
368
  };
368
- `};export{Ge as a,He as e};
369
+ `};export{ht as a,ft as e};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/codegen",
3
- "version": "1.0.0-alpha.345",
3
+ "version": "1.0.0-alpha.347",
4
4
  "description": "Code generator for Lunora: emits _generated/{api,server,dataModel}.ts from your schema",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -50,13 +50,13 @@
50
50
  "access": "public"
51
51
  },
52
52
  "dependencies": {
53
- "@lunora/advisor": "1.0.0-alpha.249",
54
- "@lunora/agent": "1.0.0-alpha.239",
53
+ "@lunora/advisor": "1.0.0-alpha.251",
54
+ "@lunora/agent": "1.0.0-alpha.241",
55
55
  "@lunora/container": "1.0.0-alpha.89",
56
56
  "@lunora/errors": ">=1.0.0-alpha.51 <2.0.0-0",
57
57
  "@lunora/platform": "1.0.0-alpha.74",
58
58
  "@lunora/queue": "1.0.0-alpha.124",
59
- "@lunora/scheduler": "1.0.0-alpha.146",
59
+ "@lunora/scheduler": "1.0.0-alpha.147",
60
60
  "@lunora/values": "1.0.0-alpha.78",
61
61
  "@lunora/workflow": "1.0.0-alpha.92",
62
62
  "@visulima/fs": "6.0.29",