@lunora/codegen 1.0.0-alpha.425 → 1.0.0-alpha.427
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 +20 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/DEFAULT_TARGET-CnglMKg_.mjs +1 -0
- package/dist/packem_shared/SCHEMA_SNAPSHOT_FILENAME-jjnAlXZN.mjs +57 -0
- package/package.json +1 -1
- package/dist/packem_shared/DEFAULT_TARGET-5-_edM-R.mjs +0 -1
- package/dist/packem_shared/SCHEMA_SNAPSHOT_FILENAME-DamKv-D7.mjs +0 -57
package/dist/index.d.mts
CHANGED
|
@@ -3637,6 +3637,15 @@ interface CodegenOptions {
|
|
|
3637
3637
|
* `platform_unknown_target` diagnostic.
|
|
3638
3638
|
*/
|
|
3639
3639
|
target?: string;
|
|
3640
|
+
/**
|
|
3641
|
+
* The worker entry the deploy bundles, as an absolute path. It seeds the
|
|
3642
|
+
* `cloudflare:*` import gate alongside `lunora/` and the schema, so an import
|
|
3643
|
+
* in the entry, or in anything it imports, is refused at build time on a
|
|
3644
|
+
* target without those modules. Produced by `@lunora/config`'s
|
|
3645
|
+
* `wranglerCodegenInputs`, which resolves it the way the deploy does; absent
|
|
3646
|
+
* when no entry file exists (the composed `virtual:lunora/worker` included).
|
|
3647
|
+
*/
|
|
3648
|
+
workerEntry?: string;
|
|
3640
3649
|
/**
|
|
3641
3650
|
* Every `queues.producers[]` entry of `wrangler.jsonc`, top level and each
|
|
3642
3651
|
* `env.<name>` block. A producer naming a push queue's binding with another
|
|
@@ -3656,6 +3665,12 @@ interface CodegenOptions {
|
|
|
3656
3665
|
*/
|
|
3657
3666
|
wranglerVariables?: ReadonlyArray<WranglerVariableIR>;
|
|
3658
3667
|
}
|
|
3668
|
+
/** A schedule `createWorker` dispatches itself (not a `cronJobs()` job), and which of its options declared it. */
|
|
3669
|
+
interface WorkerEntryCron {
|
|
3670
|
+
cron: string;
|
|
3671
|
+
/** `backupCron`: the nightly backup. `crons`: a key of `createWorker({ crons })`. */
|
|
3672
|
+
handler: "backupCron" | "crons";
|
|
3673
|
+
}
|
|
3659
3674
|
interface CodegenResult {
|
|
3660
3675
|
/**
|
|
3661
3676
|
* The normalized advisor evidence the findings were produced from, so a
|
|
@@ -3802,6 +3817,11 @@ interface CodegenResult {
|
|
|
3802
3817
|
* checks stored rows against the schema reads the validators here.
|
|
3803
3818
|
*/
|
|
3804
3819
|
schemaTables: ReadonlyArray<TableIR>;
|
|
3820
|
+
/**
|
|
3821
|
+
* The schedules the worker entry's `createWorker({ backupCron, crons })` handles itself, each with the option that declared
|
|
3822
|
+
* it. They reach only the worker's `scheduled()`, so a host that never calls it (the Node container) names them.
|
|
3823
|
+
*/
|
|
3824
|
+
workerEntryCrons: ReadonlyArray<WorkerEntryCron>;
|
|
3805
3825
|
/**
|
|
3806
3826
|
* Workflows discovered from `defineWorkflow` exports in
|
|
3807
3827
|
* `lunora/workflows.ts` — the list the config layer reconciles into
|
package/dist/index.d.ts
CHANGED
|
@@ -3637,6 +3637,15 @@ interface CodegenOptions {
|
|
|
3637
3637
|
* `platform_unknown_target` diagnostic.
|
|
3638
3638
|
*/
|
|
3639
3639
|
target?: string;
|
|
3640
|
+
/**
|
|
3641
|
+
* The worker entry the deploy bundles, as an absolute path. It seeds the
|
|
3642
|
+
* `cloudflare:*` import gate alongside `lunora/` and the schema, so an import
|
|
3643
|
+
* in the entry, or in anything it imports, is refused at build time on a
|
|
3644
|
+
* target without those modules. Produced by `@lunora/config`'s
|
|
3645
|
+
* `wranglerCodegenInputs`, which resolves it the way the deploy does; absent
|
|
3646
|
+
* when no entry file exists (the composed `virtual:lunora/worker` included).
|
|
3647
|
+
*/
|
|
3648
|
+
workerEntry?: string;
|
|
3640
3649
|
/**
|
|
3641
3650
|
* Every `queues.producers[]` entry of `wrangler.jsonc`, top level and each
|
|
3642
3651
|
* `env.<name>` block. A producer naming a push queue's binding with another
|
|
@@ -3656,6 +3665,12 @@ interface CodegenOptions {
|
|
|
3656
3665
|
*/
|
|
3657
3666
|
wranglerVariables?: ReadonlyArray<WranglerVariableIR>;
|
|
3658
3667
|
}
|
|
3668
|
+
/** A schedule `createWorker` dispatches itself (not a `cronJobs()` job), and which of its options declared it. */
|
|
3669
|
+
interface WorkerEntryCron {
|
|
3670
|
+
cron: string;
|
|
3671
|
+
/** `backupCron`: the nightly backup. `crons`: a key of `createWorker({ crons })`. */
|
|
3672
|
+
handler: "backupCron" | "crons";
|
|
3673
|
+
}
|
|
3659
3674
|
interface CodegenResult {
|
|
3660
3675
|
/**
|
|
3661
3676
|
* The normalized advisor evidence the findings were produced from, so a
|
|
@@ -3802,6 +3817,11 @@ interface CodegenResult {
|
|
|
3802
3817
|
* checks stored rows against the schema reads the validators here.
|
|
3803
3818
|
*/
|
|
3804
3819
|
schemaTables: ReadonlyArray<TableIR>;
|
|
3820
|
+
/**
|
|
3821
|
+
* The schedules the worker entry's `createWorker({ backupCron, crons })` handles itself, each with the option that declared
|
|
3822
|
+
* it. They reach only the worker's `scheduled()`, so a host that never calls it (the Node container) names them.
|
|
3823
|
+
*/
|
|
3824
|
+
workerEntryCrons: ReadonlyArray<WorkerEntryCron>;
|
|
3805
3825
|
/**
|
|
3806
3826
|
* Workflows discovered from `defineWorkflow` exports in
|
|
3807
3827
|
* `lunora/workflows.ts` — the list the config layer reconciles into
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SCHEMA_SNAPSHOT_VERSION as t,diffSchemaSnapshots as i,serializeSchemaSnapshot as a}from"./packem_shared/SCHEMA_SNAPSHOT_VERSION-DTLoSaNn.mjs";import{formatAdvisories as d,lintSchema as f,toAdvisorContext as m}from"./packem_shared/formatAdvisories-Bue5tbp6.mjs";import{describeErrorLevelFindings as n,errorAdvisoryNames as c,errorPlatformDiagnosticNames as l,sortedUniqueNames as S}from"./packem_shared/describeErrorLevelFindings-DlkgCw8a.mjs";import{CAPABILITY_PROBES as E}from"./packem_shared/CAPABILITY_PROBES-DCzOjTN7.mjs";import{COMPANION_BINDING as u,COMPANION_SERVICE_NAME as N}from"./packem_shared/COMPANION_BINDING-Da_v9XpC.mjs";import{CodegenDiagnosticError as g,diagnosticAt as C}from"./packem_shared/CodegenDiagnosticError-BUXlG3P-.mjs";import{AGENTS_FILENAME as I,discoverAgents as _}from"./packem_shared/AGENTS_FILENAME-BSW65Q9R.mjs";import{isTestPath as L,listLunoraSourceFiles as M}from"./packem_shared/isTestPath-DJeZ18i9.mjs";import{default as F}from"./packem_shared/discoverAuthApiCalls-DcvsgL5u.mjs";import{CONTAINERS_FILENAME as P,discoverContainers as D}from"./packem_shared/CONTAINERS_FILENAME-Dy3qWGfI.mjs";import{default as b}from"./packem_shared/discoverCrons-MpIC14pg.mjs";import{ENV_FILENAME as U}from"./packem_shared/ENV_FILENAME-DFx_jlpa.mjs";import{capabilitiesUsedBy as H,createTargetScope as j,foldCapabilitySignals as V,mayReadCapabilityContext as k,sourceCapabilitySignals as W}from"./packem_shared/capabilitiesUsedBy-BcDkRoOu.mjs";import{FLAGS_FILENAME as K,discoverFlags as Q}from"./packem_shared/FLAGS_FILENAME-CDaIBL6L.mjs";import{d as q}from"./packem_shared/index-BwLaIVqA.mjs";import{default as J}from"./packem_shared/discoverHttpRoutes-BtMgsfzG.mjs";import{default as Z}from"./packem_shared/discoverHyperdriveCalls-B--Nvx36.mjs";import{default as ee}from"./packem_shared/discoverInserts-Dx7Lxey3.mjs";import{d as oe}from"./packem_shared/index-CQuAXbal.mjs";import{default as ie}from"./packem_shared/discoverMigrations-DaBdK1Bv.mjs";import{MUTATORS_FILENAME as se,discoverMutators as de}from"./packem_shared/MUTATORS_FILENAME-SLAN2VXq.mjs";import{default as me}from"./packem_shared/discoverNondeterministicCalls-MeKjo_UX.mjs";import{ALL_NOTIFY_CHANNELS as ne,NOTIFY_FILENAME as ce,discoverNotifyCalls as le,discoverNotifyChannels as Se,discoverNotifyConfig as xe}from"./packem_shared/ALL_NOTIFY_CHANNELS-DI0zmZGs.mjs";import{default as Ae}from"./packem_shared/readPackageDependencies-RHhGiz0k.mjs";import{default as Ne}from"./packem_shared/discoverQueries-BlhMsXuk.mjs";import{QUEUES_FILENAME as ge,discoverQueues as Ce}from"./packem_shared/QUEUES_FILENAME-CVkpGqoY.mjs";import{default as Ie}from"./packem_shared/discoverR2sqlCalls-DHvclvkv.mjs";import{default as Re}from"./packem_shared/discoverRlsProcedures-CUfhUqfY.mjs";import{default as Me}from"./packem_shared/discoverRlsMetadata-CO-pRHOx.mjs";import{discoverSandboxUsage as Fe}from"./packem_shared/discoverSandboxUsage-CdrJNRFd.mjs";import{default as Pe}from"./packem_shared/discoverSchema-CL9PLdOu.mjs";import{companionServiceBinding as ye,readBoundServiceBindings as be,readDevServiceBindings as Ge,readServiceBindings as Ue,resolveServiceBindings as Be}from"./packem_shared/companionServiceBinding-BZjm486n.mjs";import{SHAPES_FILENAME as je,discoverShapes as Ve}from"./packem_shared/SHAPES_FILENAME-Cf4sum4C.mjs";import{default as We}from"./packem_shared/discoverStorageRulesMetadata-D_pYyr1i.mjs";import{WORKFLOWS_FILENAME as Ke,discoverWorkflows as Qe}from"./packem_shared/WORKFLOWS_FILENAME-Dtxo_XBw.mjs";import{emitApp as qe}from"./packem_shared/emitApp-LFKtDRYu.mjs";import{isD1GlobalTable as Je,isHyperdriveGlobalTable as Xe}from"./packem_shared/isD1GlobalTable-udvHAAzD.mjs";import{buildOpenApiDocument as $e,emitOpenApi as er,emitOpenApiModule as rr}from"./packem_shared/buildOpenApiDocument-C3zlve6K.mjs";import{OPENRPC_VERSION as tr,buildOpenRpcDocument as ir,emitOpenRpc as ar,emitOpenRpcModule as sr}from"./packem_shared/OPENRPC_VERSION-DkWde9eh.mjs";import{DEFAULT_TARGET as fr,platformMatrixIds as mr,readProjectTarget as pr,resolveCodegenTarget as nr}from"./packem_shared/DEFAULT_TARGET-
|
|
1
|
+
import{SCHEMA_SNAPSHOT_VERSION as t,diffSchemaSnapshots as i,serializeSchemaSnapshot as a}from"./packem_shared/SCHEMA_SNAPSHOT_VERSION-DTLoSaNn.mjs";import{formatAdvisories as d,lintSchema as f,toAdvisorContext as m}from"./packem_shared/formatAdvisories-Bue5tbp6.mjs";import{describeErrorLevelFindings as n,errorAdvisoryNames as c,errorPlatformDiagnosticNames as l,sortedUniqueNames as S}from"./packem_shared/describeErrorLevelFindings-DlkgCw8a.mjs";import{CAPABILITY_PROBES as E}from"./packem_shared/CAPABILITY_PROBES-DCzOjTN7.mjs";import{COMPANION_BINDING as u,COMPANION_SERVICE_NAME as N}from"./packem_shared/COMPANION_BINDING-Da_v9XpC.mjs";import{CodegenDiagnosticError as g,diagnosticAt as C}from"./packem_shared/CodegenDiagnosticError-BUXlG3P-.mjs";import{AGENTS_FILENAME as I,discoverAgents as _}from"./packem_shared/AGENTS_FILENAME-BSW65Q9R.mjs";import{isTestPath as L,listLunoraSourceFiles as M}from"./packem_shared/isTestPath-DJeZ18i9.mjs";import{default as F}from"./packem_shared/discoverAuthApiCalls-DcvsgL5u.mjs";import{CONTAINERS_FILENAME as P,discoverContainers as D}from"./packem_shared/CONTAINERS_FILENAME-Dy3qWGfI.mjs";import{default as b}from"./packem_shared/discoverCrons-MpIC14pg.mjs";import{ENV_FILENAME as U}from"./packem_shared/ENV_FILENAME-DFx_jlpa.mjs";import{capabilitiesUsedBy as H,createTargetScope as j,foldCapabilitySignals as V,mayReadCapabilityContext as k,sourceCapabilitySignals as W}from"./packem_shared/capabilitiesUsedBy-BcDkRoOu.mjs";import{FLAGS_FILENAME as K,discoverFlags as Q}from"./packem_shared/FLAGS_FILENAME-CDaIBL6L.mjs";import{d as q}from"./packem_shared/index-BwLaIVqA.mjs";import{default as J}from"./packem_shared/discoverHttpRoutes-BtMgsfzG.mjs";import{default as Z}from"./packem_shared/discoverHyperdriveCalls-B--Nvx36.mjs";import{default as ee}from"./packem_shared/discoverInserts-Dx7Lxey3.mjs";import{d as oe}from"./packem_shared/index-CQuAXbal.mjs";import{default as ie}from"./packem_shared/discoverMigrations-DaBdK1Bv.mjs";import{MUTATORS_FILENAME as se,discoverMutators as de}from"./packem_shared/MUTATORS_FILENAME-SLAN2VXq.mjs";import{default as me}from"./packem_shared/discoverNondeterministicCalls-MeKjo_UX.mjs";import{ALL_NOTIFY_CHANNELS as ne,NOTIFY_FILENAME as ce,discoverNotifyCalls as le,discoverNotifyChannels as Se,discoverNotifyConfig as xe}from"./packem_shared/ALL_NOTIFY_CHANNELS-DI0zmZGs.mjs";import{default as Ae}from"./packem_shared/readPackageDependencies-RHhGiz0k.mjs";import{default as Ne}from"./packem_shared/discoverQueries-BlhMsXuk.mjs";import{QUEUES_FILENAME as ge,discoverQueues as Ce}from"./packem_shared/QUEUES_FILENAME-CVkpGqoY.mjs";import{default as Ie}from"./packem_shared/discoverR2sqlCalls-DHvclvkv.mjs";import{default as Re}from"./packem_shared/discoverRlsProcedures-CUfhUqfY.mjs";import{default as Me}from"./packem_shared/discoverRlsMetadata-CO-pRHOx.mjs";import{discoverSandboxUsage as Fe}from"./packem_shared/discoverSandboxUsage-CdrJNRFd.mjs";import{default as Pe}from"./packem_shared/discoverSchema-CL9PLdOu.mjs";import{companionServiceBinding as ye,readBoundServiceBindings as be,readDevServiceBindings as Ge,readServiceBindings as Ue,resolveServiceBindings as Be}from"./packem_shared/companionServiceBinding-BZjm486n.mjs";import{SHAPES_FILENAME as je,discoverShapes as Ve}from"./packem_shared/SHAPES_FILENAME-Cf4sum4C.mjs";import{default as We}from"./packem_shared/discoverStorageRulesMetadata-D_pYyr1i.mjs";import{WORKFLOWS_FILENAME as Ke,discoverWorkflows as Qe}from"./packem_shared/WORKFLOWS_FILENAME-Dtxo_XBw.mjs";import{emitApp as qe}from"./packem_shared/emitApp-LFKtDRYu.mjs";import{isD1GlobalTable as Je,isHyperdriveGlobalTable as Xe}from"./packem_shared/isD1GlobalTable-udvHAAzD.mjs";import{buildOpenApiDocument as $e,emitOpenApi as er,emitOpenApiModule as rr}from"./packem_shared/buildOpenApiDocument-C3zlve6K.mjs";import{OPENRPC_VERSION as tr,buildOpenRpcDocument as ir,emitOpenRpc as ar,emitOpenRpcModule as sr}from"./packem_shared/OPENRPC_VERSION-DkWde9eh.mjs";import{DEFAULT_TARGET as fr,platformMatrixIds as mr,readProjectTarget as pr,resolveCodegenTarget as nr}from"./packem_shared/DEFAULT_TARGET-CnglMKg_.mjs";import{b as lr,r as Sr,c as xr,d as Er}from"./packem_shared/project-config-file-DR7xrrNB.mjs";import{PROJECT_CONFIG_FILENAMES as ur,findCodegenConfigFile as Nr,findProjectConfigFile as vr,projectConfigCandidatePaths as gr}from"./packem_shared/PROJECT_CONFIG_FILENAMES-CLfsyvjA.mjs";import{SCHEMA_SNAPSHOT_FILENAME as Or,runCodegen as Ir}from"./packem_shared/SCHEMA_SNAPSHOT_FILENAME-jjnAlXZN.mjs";import{SchemaSnapshotParseError as Rr,buildSchemaSnapshot as Lr,evaluateSchemaDrift as Mr,indexReferencesOf as Tr,parseSchemaSnapshot as Fr}from"./packem_shared/SchemaSnapshotParseError-CV7mmuPi.mjs";import{default as Pr}from"./packem_shared/fingerprintSchemaSources-BqPD3mw0.mjs";import{schemaFromIr as yr}from"./packem_shared/schemaFromIr-CByOxuZb.mjs";import{LUNORA_ERROR_CODES as Gr,validatorIrToJsonSchema as Ur}from"./packem_shared/LUNORA_ERROR_CODES-D7AVT7qF.mjs";import{SDK_LANGUAGES as Hr,SDK_TARGETS as jr,generateSdk as Vr}from"./sdk/index.mjs";import{redact as Wr,secretKindOf as zr}from"./packem_shared/redact-Cy14LEnc.mjs";import{default as Qr}from"./packem_shared/emitDrizzleSchema-BzOChEYW.mjs";import{e as qr}from"./packem_shared/server-Dfxmm5Zw.mjs";import{e as Jr}from"./packem_shared/shard-CWAD5mYy.mjs";import{G as Zr}from"./packem_shared/shared-Cn7dMQ_u.mjs";import{MESSAGE_SOLUTIONS as eo,findSolutionByMessage as ro}from"@lunora/errors";import{createCodegenProject as to,findTsconfig as io,refreshCodegenProject as ao,tsconfigFingerprint as so}from"./packem_shared/createCodegenProject-C4XuJSap.mjs";import{t as mo,u as po,v as no}from"./packem_shared/shard-runtime-G5mZQjY0.mjs";import{emitApi as lo,emitCollections as So,emitInternalApi as xo}from"./packem_shared/emitApi-lwadq5G7.mjs";import{emitCrons as Ao,emitScheduler as uo,emitVectors as No,emitWranglerCronTriggers as vo}from"./packem_shared/emitCrons-CCRKs482.mjs";import{emitDataModel as Co}from"./packem_shared/emitDataModel-BvCZS4Yq.mjs";import{emitFunctions as Io}from"./packem_shared/emitFunctions-ppMX7E3X.mjs";import{isTypedSchema as Ro}from"./packem_shared/isTypedSchema-CDv3pJB6.mjs";const e="0.0.0";export{I as AGENTS_FILENAME,ne as ALL_NOTIFY_CHANNELS,E as CAPABILITY_PROBES,u as COMPANION_BINDING,N as COMPANION_SERVICE_NAME,P as CONTAINERS_FILENAME,g as CodegenDiagnosticError,fr as DEFAULT_TARGET,U as ENV_FILENAME,K as FLAGS_FILENAME,Zr as GENERATED_HEADER,Gr as LUNORA_ERROR_CODES,eo as LUNORA_SOLUTION_RULES,se as MUTATORS_FILENAME,ce as NOTIFY_FILENAME,tr as OPENRPC_VERSION,ur as PROJECT_CONFIG_FILENAMES,ge as QUEUES_FILENAME,Or as SCHEMA_SNAPSHOT_FILENAME,t as SCHEMA_SNAPSHOT_VERSION,Hr as SDK_LANGUAGES,jr as SDK_TARGETS,je as SHAPES_FILENAME,Rr as SchemaSnapshotParseError,e as VERSION,Ke as WORKFLOWS_FILENAME,$e as buildOpenApiDocument,ir as buildOpenRpcDocument,Lr as buildSchemaSnapshot,H as capabilitiesUsedBy,ye as companionServiceBinding,to as createCodegenProject,j as createTargetScope,n as describeErrorLevelFindings,C as diagnosticAt,i as diffSchemaSnapshots,_ as discoverAgents,F as discoverAuthApiCalls,D as discoverContainers,b as discoverCrons,Q as discoverFlags,q as discoverFunctions,J as discoverHttpRoutes,Z as discoverHyperdriveCalls,ee as discoverInserts,oe as discoverMaskProcedures,ie as discoverMigrations,de as discoverMutators,me as discoverNondeterministicCalls,le as discoverNotifyCalls,Se as discoverNotifyChannels,xe as discoverNotifyConfig,Ne as discoverQueries,Ce as discoverQueues,Ie as discoverR2sqlCalls,Me as discoverRlsMetadata,Re as discoverRlsProcedures,Fe as discoverSandboxUsage,Pe as discoverSchema,Ve as discoverShapes,We as discoverStorageRulesMetadata,Qe as discoverWorkflows,mo as emitAgents,lo as emitApi,qe as emitApp,So as emitCollections,po as emitContainers,Ao as emitCrons,Co as emitDataModel,Qr as emitDrizzleSchema,Io as emitFunctions,xo as emitInternalApi,er as emitOpenApi,rr as emitOpenApiModule,ar as emitOpenRpc,sr as emitOpenRpcModule,uo as emitScheduler,qr as emitServer,Jr as emitShard,No as emitVectors,no as emitWorkflows,vo as emitWranglerCronTriggers,c as errorAdvisoryNames,l as errorPlatformDiagnosticNames,Mr as evaluateSchemaDrift,Nr as findCodegenConfigFile,ro as findLunoraSolution,vr as findProjectConfigFile,io as findTsconfig,Pr as fingerprintSchemaSources,V as foldCapabilitySignals,d as formatAdvisories,Vr as generateSdk,Tr as indexReferencesOf,Je as isD1GlobalTable,Xe as isHyperdriveGlobalTable,L as isTestPath,Ro as isTypedSchema,f as lintSchema,M as listLunoraSourceFiles,lr as loadProjectConfig,k as mayReadCapabilityContext,Fr as parseSchemaSnapshot,mr as platformMatrixIds,gr as projectConfigCandidatePaths,be as readBoundServiceBindings,Ge as readDevServiceBindings,Ae as readPackageDependencies,Sr as readProjectConfigLiterals,xr as readProjectLazyFunctions,Er as readProjectSecurityHeaders,pr as readProjectTarget,Ue as readServiceBindings,Wr as redact,ao as refreshCodegenProject,nr as resolveCodegenTarget,Be as resolveServiceBindings,Ir as runCodegen,yr as schemaFromIr,zr as secretKindOf,a as serializeSchemaSnapshot,S as sortedUniqueNames,W as sourceCapabilitySignals,m as toAdvisorContext,so as tsconfigFingerprint,Ur as validatorIrToJsonSchema};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{NODE_CAPABILITIES as y,CLOUDFLARE_CAPABILITIES as S,CELLD_CAPABILITIES as k}from"@lunora/platform";import{r as h}from"./project-config-file-DR7xrrNB.mjs";const m="cloudflare",w=t=>{const{target:e}=h(t);return e!==void 0&&e.length>0?e:void 0},W=(t,e)=>e??w(t)??m,D=(t,e)=>{if(e!==void 0)return[];const{target:r,unreadable:o}=h(t);return o!==!0||r!==void 0?[]:[{level:"warn",message:`lunora.config declares a \`target\` that codegen cannot read without evaluating it, so the "${m}" surface was emitted. \`runCodegen\` resolves the target synchronously, which means it reads literals only.`,name:"platform_unreadable_target",remediation:`Write \`target\` as a string literal on the config's default export (\`export default { target: "${m}" }\`), or pass \`--target\`.`,target:m}]},_={max:1536,min:32},M=(t,e)=>{if(t!=="cloudflare")return[];const{max:r,min:o}=_,s=`${String(o)}-${String(r)}`;return e.filter(({dimensions:n})=>n!==void 0&&(!Number.isInteger(n)||n<o||n>r)).map(({dimensions:n,name:a})=>({level:"warn",message:`Vector index "${a}" declares ${String(n)} dimensions; Cloudflare Vectorize accepts ${s}, so creating a Vectorize index for it fails at deploy.`,name:"platform_vector_dimensions_out_of_range",remediation:`If a Vectorize index backs "${a}", use ${s} dimensions (many embedding models can truncate output to fit). Ignore this if another store, such as pgvector, backs it.`,target:t}))},d={celld:k,cloudflare:S,node:y},O=(t,e)=>{const r=d[t];if(r===void 0)return!0;const o=r.features[e]?.level;return o==="native"||o==="emulated"},P=()=>Object.keys(d).toSorted((t,e)=>t.localeCompare(e)),$={access:null,ai:"ai",aiSearch:"aiSearch",analytics:"analytics",analyticsSql:"analyticsSql",artifacts:"artifacts",browser:"browser",container:"containers",flags:null,hyperdrive:"hyperdrive",images:"images",kv:"keyValueStore",mail:"mail",notify:null,payments:null,pipelines:"pipelines",r2sql:null,scheduler:"scheduler",storage:"objectStorage",vectors:"vectorStore",workflows:"workflows",x402:"secrets"},T=["agents","commitOrderedTables","containerEgressPolicy","containerRuntimeScheduling","containerSandboxTools","cronTriggers","cronWorkflowTriggers","crossShardFanout","deliveryAuthorization","durableStreams","globalTables","liveStreams","queues","relationGraph","secrets","secretValues","services","topics","typedWebSockets","vectorStore","workerLoaders","workflowRollback","workflowSchedules"],g={agents:"durable agents (`defineAgent`)",commitOrderedTables:"commit-ordered tables (`.commitOrdered()`)",containerEgressPolicy:"container egress policies (`defineContainer({ allowedHosts | deniedHosts | interceptHttps })`)",containerRuntimeScheduling:'per-instance container images and snapshots (`defineContainer({ schedulingPolicy: "durable_object" })`)',containerSandboxTools:"container sandbox helpers — files, directory backups, bucket mounts (`defineContainer({ sandbox: true })`)",deliveryAuthorization:"delivery authorization (`.deliveryAuthorization(...)` on the app builder)",cronTriggers:"declared cron triggers (`cronJobs()`)",cronWorkflowTriggers:"declared cron jobs that start a workflow (`cronJobs()` with a workflow target)",crossShardFanout:"cross-shard fan-out queries (a `.shardBy(...)` schema)",durableStreams:"durable streams (`.stream(handler, { durable: true })`)",globalTables:"global tables (`.global()`)",liveContext:"the live publisher (`ctx.live`)",cloudflareModuleImports:"imports of the Workers runtime's `cloudflare:*` built-in modules",liveStreams:"live topic streams (`defineLiveStream`)",queues:"queues (`defineQueue`)",relationGraph:"relation-graph traversal (`ctx.db.related`, derived from `v.id(...)` columns)",secrets:"the secrets store (`ctx.secrets`)",secretValues:"human-supplied secret values (`requestSecretTool`, held for one agent step)",services:"service bindings to sibling Workers (`lunora.config` `services`)",topics:"pub/sub topics (`defineTopic` / `defineSubscription`)",typedWebSockets:"typed WebSocket routes and rooms (`defineWebSocket` / `defineRoom`)",vectorStore:"vector indexes (`.vectorize()`)",workerLoaders:"sandboxed agent scripts (`jsCodeTool`, on Worker Loaders)",workflowRollback:"workflow step rollback (`defineStep({ rollback })`)",workflowSchedules:"scheduled workflow instances (`defineWorkflow({ schedules })`)"},x=(t,e,r)=>({level:"error",message:`${e.name} does not support ${g[t]}, which this app declares.`,name:"platform_unsupported_feature",remediation:`Remove the declaration, or deploy to a target whose capability matrix marks "${t}" as native or emulated.`,target:r}),A=(t,e,r,o)=>{const s=r.map(({module:n,specifiers:a})=>`${n} (${a.join(", ")})`).join("; ");return o===void 0?{level:"error",message:`${t.name}'s capability matrix does not declare whether its runtime provides the cloudflare:* built-in modules, and these app modules import them: ${s}. Treated as unsupported.`,name:"platform_undeclared_feature",remediation:`Rate "cloudflareModules" in the ${t.name} capability matrix as "native", "emulated", or "unsupported".`,target:e}:{level:"error",message:`${t.name} has no cloudflare:* built-in modules, so these app modules would fail to load on the "${e}" target: ${s}.`,name:"platform_unsupported_feature",remediation:'Remove the cloudflare:* imports from those modules (an `import type { … }` declaration is fine; inline `type` specifiers still load the module), or deploy to a target whose capability matrix marks "cloudflareModules" as native or emulated. For mail on Node, send through platform.mail.mailer instead of the registry starter.',target:e}},R=(t,e)=>({level:"error",message:`${t.name} withholds live streams, so ctx.live is not available on the "${e}" target, but this app reads ctx.live.`,name:"platform_unsupported_feature",remediation:'Remove the ctx.live usage, or deploy to a target whose capability matrix marks "liveStreams" as native or emulated.',target:e}),j=t=>({level:"error",message:"This app declares defineLiveStream topics and enables delivery authorization. With delivery authorization on, the shard answers every /_lunora/live/* request with 501, so the live streams cannot be served.",name:"platform_live_stream_delivery_authorization",remediation:"Remove the defineLiveStream declarations, or remove the .deliveryAuthorization(...) call. Live streams and delivery authorization cannot be combined.",target:t}),F=t=>({level:"error",message:"This app declares defineWebSocket routes and enables delivery authorization. With delivery authorization on, the shard answers every route upgrade with 501, so the routes cannot be served.",name:"platform_socket_delivery_authorization",remediation:"Remove the defineWebSocket declarations, or remove the .deliveryAuthorization(...) call. Socket routes and delivery authorization cannot be combined.",target:t}),L=(t,e,r)=>({level:"error",message:`${e.name}'s capability matrix does not declare a support level for ${g[t]}, which this app declares. Treated as unsupported.`,name:"platform_undeclared_feature",remediation:`Rate "${t}" in the ${e.name} capability matrix as "native", "emulated", or "unsupported" — an undeclared feature fails closed rather than letting the app deploy onto a primitive the host may not provide.`,target:r}),b=t=>{const e=t.features.cloudflareModules?.level;return e===void 0||e==="unsupported"},N=t=>{const e=d[t];return e!==void 0&&b(e)},C=t=>{const{diagnostics:e,gatedSignals:r,matrix:o,reported:s,signals:n,target:a}=t;for(const l of T){if(n[l]!==!0)continue;const c=o.features[l]?.level;c!=="unsupported"&&c!==void 0||(r[l]=!1,!s.has(l)&&e.push(c==="unsupported"?x(l,o,a):L(l,o,a)))}},I=(t,e,r,o={})=>{const s={...t},n={...o},a=[],l=new Set;for(const[i,u]of Object.entries($)){if(u===null||!t[i])continue;const v=e.features[u]?.level;v==="unsupported"?(s[i]=!1,l.add(u),a.push({feature:i,level:"error",message:`${e.name} does not support "${i}" (ctx.${i}).`,name:"platform_unsupported_feature",remediation:`Remove the ctx.${i} usage, or deploy to a target whose capability matrix marks "${u}" as native or emulated.`,target:r})):v===void 0&&(s[i]=!1,l.add(u),a.push({feature:i,level:"error",message:`${e.name}'s capability matrix does not declare a support level for "${i}" (ctx.${i}). Treated as unsupported.`,name:"platform_undeclared_feature",remediation:`Rate "${u}" in the ${e.name} capability matrix as "native", "emulated", or "unsupported" — an undeclared feature fails closed rather than shipping a surface the host may not provide.`,target:r}))}C({diagnostics:a,gatedSignals:n,matrix:e,reported:l,signals:o,target:r});const c=e.features.liveStreams?.level,p=c===void 0||c==="unsupported";o.liveContext===!0&&p&&a.push(R(e,r));const f=o.cloudflareModuleImports??[];if(f.length>0&&b(e)){const i=e.features.cloudflareModules?.level==="unsupported"?"unsupported":void 0;a.push(A(e,r,f,i))}return{diagnostics:a,liveStreamsWithheld:p,signals:n,usage:s}},q=(t,e,r={})=>{const o=d[e];return o===void 0?{diagnostics:[{level:"error",message:`Unknown deploy target "${e}" — no capability matrix is registered for it. Codegen emitted the full Cloudflare surface un-gated.`,name:"platform_unknown_target",remediation:`Use a registered target (${Object.keys(d).join(", ")}) or install the target's @lunora/platform-${e} package.`,target:e}],liveStreamsWithheld:!1,signals:{...r},usage:{...t}}:I(t,o,e,r)},V=t=>{const e=d[t];if(e===void 0)return{supported:!0};const r=e.features.adminTokenRevocation?.level;return r!==void 0&&r!=="unsupported"?{supported:!0}:{diagnostic:{level:"warn",message:`${e.name} ${r===void 0?"does not declare a support level for":"does not support"} named admin tokens, so codegen omits the admin revocation store (\`_generated/adminRevocations.ts\` and the builder's \`.adminRevocations()\`). The root LUNORA_ADMIN_TOKEN is the only admin credential here.`,name:r===void 0?"platform_undeclared_feature":"platform_unsupported_feature",remediation:'Use the root admin token, or deploy to a target whose capability matrix marks "adminTokenRevocation" as native or emulated.',target:t},supported:!1}},U=t=>{const e=d[t];if(e===void 0)return;const r=Object.entries(e.features).filter(([,o])=>o.level==="unsupported").map(([o])=>o).toSorted((o,s)=>o.localeCompare(s));return{id:e.id,name:e.name,unsupported:r}};export{$ as CAPABILITY_TO_FEATURE,m as DEFAULT_TARGET,V as gateAdminTokenRevocation,I as gateAgainstMatrix,q as gatePlatformFeatures,j as liveStreamsDeliveryAuthorizationDiagnostic,N as needsCloudflareModuleWalk,O as platformFeatureAvailable,P as platformMatrixIds,w as readProjectTarget,D as readTargetDiagnostics,W as resolveCodegenTarget,F as socketRoutesDeliveryAuthorizationDiagnostic,U as studioPlatformFor,M as vectorizeDimensionDiagnostics};
|