@lunora/codegen 1.0.0-alpha.387 → 1.0.0-alpha.389
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 +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/{CAPABILITY_PROBES-DKYJ2K4t.mjs → CAPABILITY_PROBES-BuNEmlCO.mjs} +3 -3
- package/dist/packem_shared/{DEFAULT_TARGET-3OLdJhTj.mjs → DEFAULT_TARGET-hkUrVddn.mjs} +1 -1
- package/dist/packem_shared/SCHEMA_SNAPSHOT_FILENAME-CtfWbIuc.mjs +31 -0
- package/dist/packem_shared/{capabilitiesUsedBy-CN8HACEL.mjs → capabilitiesUsedBy-CkMimFS2.mjs} +1 -1
- package/dist/packem_shared/{emitAgents-iTKWSKan.mjs → emitAgents-Dg5j1R-4.mjs} +1 -1
- package/dist/packem_shared/{emitApp-L7PnfjJK.mjs → emitApp-Blxf5Bvs.mjs} +38 -29
- package/dist/packem_shared/{emitCrons-BvqxeNRr.mjs → emitCrons-BQjDleCe.mjs} +37 -22
- package/dist/packem_shared/{emitFunctions-C4PzKb4H.mjs → emitFunctions-D6n4ENZO.mjs} +44 -33
- package/dist/packem_shared/emitServer-Bo1CO-pn.mjs +1 -0
- package/dist/packem_shared/{emitShard-CyFV41Mb.mjs → emitShard-g-4f3Zle.mjs} +1 -1
- package/dist/packem_shared/{server-qWq5nN-R.mjs → server-59fi39OH.mjs} +1 -1
- package/dist/packem_shared/{shard-t1Jkywmh.mjs → shard-D_mnxT3r.mjs} +2 -2
- package/dist/packem_shared/{shard-runtime-C1P_uVye.mjs → shard-runtime-CHda0G1i.mjs} +1 -1
- package/package.json +9 -9
- package/dist/packem_shared/SCHEMA_SNAPSHOT_FILENAME-CA_Jy0Mi.mjs +0 -31
- package/dist/packem_shared/emitServer-BgI9yXW1.mjs +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -3052,7 +3052,7 @@ declare const CAPABILITY_ROWS: readonly [{
|
|
|
3052
3052
|
}, {
|
|
3053
3053
|
readonly appMethod: {
|
|
3054
3054
|
readonly configKey: "browser";
|
|
3055
|
-
readonly doc: "Build the `ctx.browser` helper, e.g. `(env) => createBrowser({ binding: env.BROWSER,
|
|
3055
|
+
readonly doc: "Build the `ctx.browser` helper, e.g. `(env) => createBrowser({ binding: env.BROWSER, playwright: () => import('@cloudflare/playwright') })`. REQUIRED: unlike the binding-backed capabilities, `ctx.browser` is not auto-constructed — without this thunk every method throws, because the generated worker deliberately stays free of the optional `@cloudflare/playwright` peer. Load it through `playwright` rather than a static import, so it stays out of the Worker's startup graph.";
|
|
3056
3056
|
readonly method: "browser";
|
|
3057
3057
|
};
|
|
3058
3058
|
readonly contextProperty: "browser";
|
|
@@ -3062,7 +3062,7 @@ declare const CAPABILITY_ROWS: readonly [{
|
|
|
3062
3062
|
readonly serverCtxField: "\n /** Browser Rendering (screenshots/PDF/scrape). Non-deterministic — available only in actions. */\n readonly browser: import(\"@lunora/browser\").Browser;";
|
|
3063
3063
|
readonly shardBinding: {
|
|
3064
3064
|
readonly clientType: "Browser";
|
|
3065
|
-
readonly missingMessage: "ctx.browser: provide a `browser` config thunk, e.g. `browser: (env) => createBrowser({ binding: env.BROWSER,
|
|
3065
|
+
readonly missingMessage: "ctx.browser: provide a `browser` config thunk, e.g. `browser: (env) => createBrowser({ binding: env.BROWSER, playwright: () => import('@cloudflare/playwright') })`.";
|
|
3066
3066
|
readonly stubMethods: readonly ["cancelCrawl", "connect", "content", "crawl", "crawlResult", "launch", "pdf", "quickAction", "scrape", "screenshot", "sessions"];
|
|
3067
3067
|
};
|
|
3068
3068
|
readonly tier: "action";
|
|
@@ -3088,7 +3088,7 @@ declare const CAPABILITY_ROWS: readonly [{
|
|
|
3088
3088
|
readonly shardBinding: {
|
|
3089
3089
|
readonly clientType: "SqlClient";
|
|
3090
3090
|
readonly instrument: "instrumentSql";
|
|
3091
|
-
readonly missingMessage: "ctx.sql: provide a `sql` config thunk that builds a SqlClient from your driver, e.g. `sql: (env) => fromPostgresJs(postgres(env.HYPERDRIVE.connectionString, { fetch_types: false, max: 5 }))`.";
|
|
3091
|
+
readonly missingMessage: "ctx.sql: provide a `sql` config thunk that builds a SqlClient from your driver, e.g. `sql: (env) => fromPostgresJs(async () => (await import('postgres')).default(env.HYPERDRIVE.connectionString, { fetch_types: false, max: 5 }))`.";
|
|
3092
3092
|
readonly stubMethods: readonly ["query"];
|
|
3093
3093
|
};
|
|
3094
3094
|
readonly tier: "action";
|
|
@@ -4477,6 +4477,8 @@ interface EmitAppOptions {
|
|
|
4477
4477
|
}>;
|
|
4478
4478
|
/** App depends on `@lunora/cloudflare-access` → emit `.access()` (wire the Cloudflare Access `resolveIdentity`, composed ahead of `@lunora/auth` when both are present). */
|
|
4479
4479
|
hasAccess: boolean;
|
|
4480
|
+
/** The target backs named admin tokens' revocation store → emit `.adminRevocations()`. Absent counts as true. */
|
|
4481
|
+
hasAdminRevocations?: boolean;
|
|
4480
4482
|
/** App depends on `@lunora/auth` → emit `.auth()` + the lazy build/migrate dance. */
|
|
4481
4483
|
hasAuth: boolean;
|
|
4482
4484
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -3052,7 +3052,7 @@ declare const CAPABILITY_ROWS: readonly [{
|
|
|
3052
3052
|
}, {
|
|
3053
3053
|
readonly appMethod: {
|
|
3054
3054
|
readonly configKey: "browser";
|
|
3055
|
-
readonly doc: "Build the `ctx.browser` helper, e.g. `(env) => createBrowser({ binding: env.BROWSER,
|
|
3055
|
+
readonly doc: "Build the `ctx.browser` helper, e.g. `(env) => createBrowser({ binding: env.BROWSER, playwright: () => import('@cloudflare/playwright') })`. REQUIRED: unlike the binding-backed capabilities, `ctx.browser` is not auto-constructed — without this thunk every method throws, because the generated worker deliberately stays free of the optional `@cloudflare/playwright` peer. Load it through `playwright` rather than a static import, so it stays out of the Worker's startup graph.";
|
|
3056
3056
|
readonly method: "browser";
|
|
3057
3057
|
};
|
|
3058
3058
|
readonly contextProperty: "browser";
|
|
@@ -3062,7 +3062,7 @@ declare const CAPABILITY_ROWS: readonly [{
|
|
|
3062
3062
|
readonly serverCtxField: "\n /** Browser Rendering (screenshots/PDF/scrape). Non-deterministic — available only in actions. */\n readonly browser: import(\"@lunora/browser\").Browser;";
|
|
3063
3063
|
readonly shardBinding: {
|
|
3064
3064
|
readonly clientType: "Browser";
|
|
3065
|
-
readonly missingMessage: "ctx.browser: provide a `browser` config thunk, e.g. `browser: (env) => createBrowser({ binding: env.BROWSER,
|
|
3065
|
+
readonly missingMessage: "ctx.browser: provide a `browser` config thunk, e.g. `browser: (env) => createBrowser({ binding: env.BROWSER, playwright: () => import('@cloudflare/playwright') })`.";
|
|
3066
3066
|
readonly stubMethods: readonly ["cancelCrawl", "connect", "content", "crawl", "crawlResult", "launch", "pdf", "quickAction", "scrape", "screenshot", "sessions"];
|
|
3067
3067
|
};
|
|
3068
3068
|
readonly tier: "action";
|
|
@@ -3088,7 +3088,7 @@ declare const CAPABILITY_ROWS: readonly [{
|
|
|
3088
3088
|
readonly shardBinding: {
|
|
3089
3089
|
readonly clientType: "SqlClient";
|
|
3090
3090
|
readonly instrument: "instrumentSql";
|
|
3091
|
-
readonly missingMessage: "ctx.sql: provide a `sql` config thunk that builds a SqlClient from your driver, e.g. `sql: (env) => fromPostgresJs(postgres(env.HYPERDRIVE.connectionString, { fetch_types: false, max: 5 }))`.";
|
|
3091
|
+
readonly missingMessage: "ctx.sql: provide a `sql` config thunk that builds a SqlClient from your driver, e.g. `sql: (env) => fromPostgresJs(async () => (await import('postgres')).default(env.HYPERDRIVE.connectionString, { fetch_types: false, max: 5 }))`.";
|
|
3092
3092
|
readonly stubMethods: readonly ["query"];
|
|
3093
3093
|
};
|
|
3094
3094
|
readonly tier: "action";
|
|
@@ -4477,6 +4477,8 @@ interface EmitAppOptions {
|
|
|
4477
4477
|
}>;
|
|
4478
4478
|
/** App depends on `@lunora/cloudflare-access` → emit `.access()` (wire the Cloudflare Access `resolveIdentity`, composed ahead of `@lunora/auth` when both are present). */
|
|
4479
4479
|
hasAccess: boolean;
|
|
4480
|
+
/** The target backs named admin tokens' revocation store → emit `.adminRevocations()`. Absent counts as true. */
|
|
4481
|
+
hasAdminRevocations?: boolean;
|
|
4480
4482
|
/** App depends on `@lunora/auth` → emit `.auth()` + the lazy build/migrate dance. */
|
|
4481
4483
|
hasAuth: boolean;
|
|
4482
4484
|
/**
|
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 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-
|
|
1
|
+
import{SCHEMA_SNAPSHOT_VERSION as t,diffSchemaSnapshots as i,serializeSchemaSnapshot as a}from"./packem_shared/SCHEMA_SNAPSHOT_VERSION-DTLoSaNn.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-BuNEmlCO.mjs";import{CodegenDiagnosticError as A,diagnosticAt as v}from"./packem_shared/CodegenDiagnosticError-BUXlG3P-.mjs";import{AGENTS_FILENAME as C,discoverAgents as N}from"./packem_shared/AGENTS_FILENAME-5mDMAMWy.mjs";import{isTestPath as R,listLunoraSourceFiles as T}from"./packem_shared/isTestPath-JdN4KXhV.mjs";import{default as I}from"./packem_shared/discoverAuthApiCalls-DZMYREsq.mjs";import{CONTAINERS_FILENAME as F,discoverContainers as L}from"./packem_shared/CONTAINERS_FILENAME-BJYrxnq2.mjs";import{default as P}from"./packem_shared/discoverCrons-D-vJXsgx.mjs";import{capabilitiesUsedBy as b,createTargetScope as y,foldCapabilitySignals as U,mayReadCapabilityContext as G,sourceCapabilitySignals as H}from"./packem_shared/capabilitiesUsedBy-CkMimFS2.mjs";import{FLAGS_FILENAME as B,discoverFlags as k}from"./packem_shared/FLAGS_FILENAME-BEMyglH0.mjs";import{d as K}from"./packem_shared/index-o449rQLQ.mjs";import{default as z}from"./packem_shared/discoverHttpRoutes-D9Q0lBBb.mjs";import{default as q}from"./packem_shared/discoverHyperdriveCalls-DlyCZKX3.mjs";import{default as J}from"./packem_shared/discoverInserts-7Xdawmuk.mjs";import{d as X}from"./packem_shared/index-CNI4vSyc.mjs";import{default as $}from"./packem_shared/discoverMigrations-C649uAWL.mjs";import{MUTATORS_FILENAME as re,discoverMutators as oe}from"./packem_shared/MUTATORS_FILENAME-D9WbOFm7.mjs";import{default as ie}from"./packem_shared/discoverNondeterministicCalls-DQgVTcLv.mjs";import{NOTIFY_FILENAME as se,discoverNotifyCalls as fe,discoverNotifyChannels as me,discoverNotifyConfig as de}from"./packem_shared/NOTIFY_FILENAME-CRU_TEKs.mjs";import{default as ne}from"./packem_shared/readPackageDependencies-RHhGiz0k.mjs";import{default as le}from"./packem_shared/discoverQueries-C75OdGHl.mjs";import{QUEUES_FILENAME as Se,discoverQueues as Ee}from"./packem_shared/QUEUES_FILENAME-BeGwgqcw.mjs";import{default as Ae}from"./packem_shared/discoverR2sqlCalls-BrDIti5c.mjs";import{default as ge}from"./packem_shared/discoverRlsProcedures-BiyDg2ej.mjs";import{default as Ne}from"./packem_shared/discoverRlsMetadata-DqZpiGts.mjs";import{discoverSandboxUsage as Re}from"./packem_shared/discoverSandboxUsage-CdGRnVU2.mjs";import{default as he}from"./packem_shared/discoverSchema-Bs5JUiOE.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-D9beIrs1.mjs";import{default as be}from"./packem_shared/discoverStorageRulesMetadata-H3RJzkH_.mjs";import{WORKFLOWS_FILENAME as Ue,discoverWorkflows as Ge}from"./packem_shared/WORKFLOWS_FILENAME--RWiu_Vy.mjs";import{emitApp as je}from"./packem_shared/emitApp-Blxf5Bvs.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-67-fasdW.mjs";import{OPENRPC_VERSION as we,buildOpenRpcDocument as Je,emitOpenRpc as Ye,emitOpenRpcModule as Xe}from"./packem_shared/OPENRPC_VERSION-CT_E2DcI.mjs";import{DEFAULT_TARGET as $e,platformMatrixIds as er,readProjectTarget as rr,resolveCodegenTarget as or}from"./packem_shared/DEFAULT_TARGET-hkUrVddn.mjs";import{loadProjectConfig as ir,readProjectConfigLiterals as ar}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-CtfWbIuc.mjs";import{SchemaSnapshotParseError as Sr,buildSchemaSnapshot as Er,evaluateSchemaDrift as ur,indexReferencesOf as Ar,parseSchemaSnapshot as vr}from"./packem_shared/SchemaSnapshotParseError-DnAuFdpl.mjs";import{default as Cr}from"./packem_shared/fingerprintSchemaSources-DIYx5eO0.mjs";import{schemaFromIr as Or}from"./packem_shared/schemaFromIr-CByOxuZb.mjs";import{LUNORA_ERROR_CODES as Tr,validatorIrToJsonSchema as hr}from"./packem_shared/LUNORA_ERROR_CODES-CjACC-MQ.mjs";import{SDK_LANGUAGES as _r,SDK_TARGETS as Fr,generateSdk as Lr}from"./sdk/index.mjs";import{redact as Pr,secretKindOf as Dr}from"./packem_shared/redact-Cy14LEnc.mjs";import{default as yr}from"./packem_shared/emitDrizzleSchema-Dszoyymv.mjs";import{e as Gr}from"./packem_shared/server-59fi39OH.mjs";import{e as jr}from"./packem_shared/shard-D_mnxT3r.mjs";import{G as kr}from"./packem_shared/shared-DhqnD5R3.mjs";import{MESSAGE_SOLUTIONS as Kr,findSolutionByMessage as Vr}from"@lunora/errors";import{createCodegenProject as Qr,findTsconfig as qr,refreshCodegenProject as wr,tsconfigFingerprint as Jr}from"./packem_shared/createCodegenProject-DmXl8m_P.mjs";import{t as Xr,u as Zr,v as $r}from"./packem_shared/shard-runtime-CHda0G1i.mjs";import{emitApi as ro,emitCollections as oo,emitInternalApi as to}from"./packem_shared/emitApi-DWJW8Vu9.mjs";import{emitCrons as ao,emitScheduler as so,emitVectors as fo,emitWranglerCronTriggers as mo}from"./packem_shared/emitCrons-BQjDleCe.mjs";import{emitDataModel as no}from"./packem_shared/emitDataModel-MjAOi3KM.mjs";import{emitFunctions as lo}from"./packem_shared/emitFunctions-D6n4ENZO.mjs";import{isTypedSchema as So}from"./packem_shared/isTypedSchema-CDv3pJB6.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,kr as GENERATED_HEADER,Tr as LUNORA_ERROR_CODES,Kr 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,_r as SDK_LANGUAGES,Fr 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,Qr as createCodegenProject,y as createTargetScope,n as describeErrorLevelFindings,v as diagnosticAt,i 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,ie as discoverNondeterministicCalls,fe as discoverNotifyCalls,me as discoverNotifyChannels,de as discoverNotifyConfig,le as discoverQueries,Ee as discoverQueues,Ae as discoverR2sqlCalls,Ne as discoverRlsMetadata,ge as discoverRlsProcedures,Re as discoverSandboxUsage,he as discoverSchema,Pe as discoverShapes,be as discoverStorageRulesMetadata,Ge as discoverWorkflows,Xr as emitAgents,ro as emitApi,je as emitApp,oo as emitCollections,Zr as emitContainers,ao as emitCrons,no as emitDataModel,yr as emitDrizzleSchema,lo as emitFunctions,to as emitInternalApi,ze as emitOpenApi,Qe as emitOpenApiModule,Ye as emitOpenRpc,Xe as emitOpenRpcModule,so as emitScheduler,Gr as emitServer,jr as emitShard,fo as emitVectors,$r as emitWorkflows,mo as emitWranglerCronTriggers,c as errorAdvisoryNames,l as errorPlatformDiagnosticNames,ur as evaluateSchemaDrift,mr as findCodegenConfigFile,Vr as findLunoraSolution,dr as findProjectConfigFile,qr as findTsconfig,Cr as fingerprintSchemaSources,U as foldCapabilitySignals,f as formatAdvisories,Lr as generateSdk,Ar as indexReferencesOf,ke as isD1GlobalTable,We as isHyperdriveGlobalTable,R as isTestPath,So as isTypedSchema,m as lintSchema,T as listLunoraSourceFiles,ir as loadProjectConfig,G as mayReadCapabilityContext,vr as parseSchemaSnapshot,er as platformMatrixIds,pr as projectConfigCandidatePaths,ne as readPackageDependencies,ar as readProjectConfigLiterals,rr as readProjectTarget,_e as readServiceBindings,Pr as redact,wr as refreshCodegenProject,or as resolveCodegenTarget,Fe as resolveServiceBindings,lr as runCodegen,Or as schemaFromIr,Dr as secretKindOf,a as serializeSchemaSnapshot,x as sortedUniqueNames,H as sourceCapabilitySignals,d as toAdvisorContext,Jr as tsconfigFingerprint,hr as validatorIrToJsonSchema};
|
package/dist/packem_shared/{CAPABILITY_PROBES-DKYJ2K4t.mjs → CAPABILITY_PROBES-BuNEmlCO.mjs}
RENAMED
|
@@ -5,13 +5,13 @@ const n=[{contextProperty:"access",key:"access",moduleSpecifier:"@lunora/cloudfl
|
|
|
5
5
|
/** Analytics Engine telemetry sink. Fire-and-forget and sampled; do not read it back in-handler. */
|
|
6
6
|
readonly analytics: import("@lunora/bindings/analytics").AnalyticsClient;`,shardBinding:{binding:{bindingType:"AnalyticsEngineDatasetLike",envName:"ANALYTICS",factory:{name:"createAnalytics"}},clientType:"AnalyticsClient",missingMessage:"ctx.analytics: no Analytics Engine binding found. Add an `analytics_engine_datasets` binding (env.ANALYTICS) to wrangler.jsonc, or pass `analytics` to createShardDO().",stubMethods:["track","writeDataPoint"],syncStubMethods:["track","writeDataPoint"]},tier:"every"},{appMethod:{configKey:"analyticsSql",doc:"Override the Analytics SQL binding backing `ctx.analyticsSql` (defaults to `env.ANALYTICS_SQL`), e.g. `(env) => createAnalyticsSqlRest({ accountId, apiToken })` where the Worker has no `analytics` binding.",method:"analyticsSql"},contextProperty:"analyticsSql",key:"analyticsSql",moduleSpecifier:"@lunora/bindings/analytics-sql",requiredPackage:"@lunora/bindings",serverCtxField:`
|
|
7
7
|
/** Read-only SQL over Cloudflare's Analytics SQL API (Analytics Engine datasets and more) through the \`analytics\` binding. Non-deterministic — available only in actions. Reads here are NOT tracked by Lunora live queries. */
|
|
8
|
-
readonly analyticsSql: import("@lunora/bindings/analytics-sql").AnalyticsSql;`,shardBinding:{binding:{bindingType:"AnalyticsSqlBindingLike",envName:"ANALYTICS_SQL",factory:{name:"createAnalyticsSql",option:"binding"}},clientType:"AnalyticsSql",missingMessage:'ctx.analyticsSql: no Analytics SQL binding found. Add an `analytics` binding ({ binding: "ANALYTICS_SQL" }, wrangler >= 4.145.0) to wrangler.jsonc, or point ctx.analyticsSql at a token transport with defineApp().analyticsSql((env) => createAnalyticsSqlRest({ accountId, apiToken })).',stubMethods:["query"]},tier:"action"},{appMethod:{configKey:"artifacts",doc:"Override the Artifacts binding backing `ctx.artifacts` (defaults to `env.ARTIFACTS`).",method:"artifacts"},contextProperty:"artifacts",key:"artifacts",moduleSpecifier:"@lunora/bindings/artifacts",requiredPackage:"@lunora/bindings",serverCtxField:'\n /** Cloudflare Artifacts repos (create/import/fork, Git tokens, read commits and files). Non-deterministic — available only in actions. Writes go through `git push` with a token, not this client. */\n readonly artifacts: import("@lunora/bindings/artifacts").ArtifactsClient;',shardBinding:{binding:{bindingType:"ArtifactsBindingLike",envName:"ARTIFACTS",factory:{name:"createArtifacts",option:"binding"}},clientType:"ArtifactsClient",missingMessage:'ctx.artifacts: no Artifacts binding found. Add an `artifacts` binding ({ binding: "ARTIFACTS", namespace }) to wrangler.jsonc, or point ctx.artifacts at another binding with defineApp().artifacts((env) => env.<BINDING>).',stubMethods:["authenticatedRemote","create","delete","import","info","list","withRepo"],syncStubMethods:["authenticatedRemote"]},tier:"action"},{appMethod:{configKey:"browser",doc:"Build the `ctx.browser` helper, e.g. `(env) => createBrowser({ binding: env.BROWSER,
|
|
8
|
+
readonly analyticsSql: import("@lunora/bindings/analytics-sql").AnalyticsSql;`,shardBinding:{binding:{bindingType:"AnalyticsSqlBindingLike",envName:"ANALYTICS_SQL",factory:{name:"createAnalyticsSql",option:"binding"}},clientType:"AnalyticsSql",missingMessage:'ctx.analyticsSql: no Analytics SQL binding found. Add an `analytics` binding ({ binding: "ANALYTICS_SQL" }, wrangler >= 4.145.0) to wrangler.jsonc, or point ctx.analyticsSql at a token transport with defineApp().analyticsSql((env) => createAnalyticsSqlRest({ accountId, apiToken })).',stubMethods:["query"]},tier:"action"},{appMethod:{configKey:"artifacts",doc:"Override the Artifacts binding backing `ctx.artifacts` (defaults to `env.ARTIFACTS`).",method:"artifacts"},contextProperty:"artifacts",key:"artifacts",moduleSpecifier:"@lunora/bindings/artifacts",requiredPackage:"@lunora/bindings",serverCtxField:'\n /** Cloudflare Artifacts repos (create/import/fork, Git tokens, read commits and files). Non-deterministic — available only in actions. Writes go through `git push` with a token, not this client. */\n readonly artifacts: import("@lunora/bindings/artifacts").ArtifactsClient;',shardBinding:{binding:{bindingType:"ArtifactsBindingLike",envName:"ARTIFACTS",factory:{name:"createArtifacts",option:"binding"}},clientType:"ArtifactsClient",missingMessage:'ctx.artifacts: no Artifacts binding found. Add an `artifacts` binding ({ binding: "ARTIFACTS", namespace }) to wrangler.jsonc, or point ctx.artifacts at another binding with defineApp().artifacts((env) => env.<BINDING>).',stubMethods:["authenticatedRemote","create","delete","import","info","list","withRepo"],syncStubMethods:["authenticatedRemote"]},tier:"action"},{appMethod:{configKey:"browser",doc:"Build the `ctx.browser` helper, e.g. `(env) => createBrowser({ binding: env.BROWSER, playwright: () => import('@cloudflare/playwright') })`. REQUIRED: unlike the binding-backed capabilities, `ctx.browser` is not auto-constructed — without this thunk every method throws, because the generated worker deliberately stays free of the optional `@cloudflare/playwright` peer. Load it through `playwright` rather than a static import, so it stays out of the Worker's startup graph.",method:"browser"},contextProperty:"browser",key:"browser",moduleSpecifier:"@lunora/browser",requiredPackage:"@lunora/browser",serverCtxField:`
|
|
9
9
|
/** Browser Rendering (screenshots/PDF/scrape). Non-deterministic — available only in actions. */
|
|
10
|
-
readonly browser: import("@lunora/browser").Browser;`,shardBinding:{clientType:"Browser",missingMessage:"ctx.browser: provide a `browser` config thunk, e.g. `browser: (env) => createBrowser({ binding: env.BROWSER,
|
|
10
|
+
readonly browser: import("@lunora/browser").Browser;`,shardBinding:{clientType:"Browser",missingMessage:"ctx.browser: provide a `browser` config thunk, e.g. `browser: (env) => createBrowser({ binding: env.BROWSER, playwright: () => import('@cloudflare/playwright') })`.",stubMethods:["cancelCrawl","connect","content","crawl","crawlResult","launch","pdf","quickAction","scrape","screenshot","sessions"]},tier:"action"},{contextProperty:"containers",key:"container",moduleSpecifier:"@lunora/container"},{contextProperty:"flags",key:"flags",moduleSpecifier:"@lunora/flags"},{appMethod:{configKey:"sql",doc:"Wire the Hyperdrive SQL client backing `ctx.sql` — build it with `createHyperdrive` + `fromPostgresJs`/`fromNodePg`/`fromMysql2`.",method:"hyperdrive"},contextProperty:"sql",key:"hyperdrive",moduleSpecifier:"@lunora/hyperdrive",requiredPackage:"@lunora/hyperdrive",serverCtxField:`
|
|
11
11
|
/**
|
|
12
12
|
* External database access via Hyperdrive. Non-deterministic — available only in actions. Writes here are NOT tracked by Lunora live queries; subscriptions will not re-run on external DB changes.
|
|
13
13
|
*/
|
|
14
|
-
readonly sql: import("@lunora/hyperdrive").SqlClient;`,shardBinding:{clientType:"SqlClient",instrument:"instrumentSql",missingMessage:"ctx.sql: provide a `sql` config thunk that builds a SqlClient from your driver, e.g. `sql: (env) => fromPostgresJs(postgres(env.HYPERDRIVE.connectionString, { fetch_types: false, max: 5 }))`.",stubMethods:["query"]},tier:"action"},{appMethod:{configKey:"images",doc:"Override the Images binding backing `ctx.images` (defaults to `env.IMAGES`).",method:"images"},bindingFreeExports:["buildImageDeliveryUrl","buildSignedImageUrl","parseSignedTransform","verifySignedImageUrl"],contextProperty:"images",key:"images",moduleSpecifier:"@lunora/bindings/images",requiredPackage:"@lunora/bindings",serverCtxField:`
|
|
14
|
+
readonly sql: import("@lunora/hyperdrive").SqlClient;`,shardBinding:{clientType:"SqlClient",instrument:"instrumentSql",missingMessage:"ctx.sql: provide a `sql` config thunk that builds a SqlClient from your driver, e.g. `sql: (env) => fromPostgresJs(async () => (await import('postgres')).default(env.HYPERDRIVE.connectionString, { fetch_types: false, max: 5 }))`.",stubMethods:["query"]},tier:"action"},{appMethod:{configKey:"images",doc:"Override the Images binding backing `ctx.images` (defaults to `env.IMAGES`).",method:"images"},bindingFreeExports:["buildImageDeliveryUrl","buildSignedImageUrl","parseSignedTransform","verifySignedImageUrl"],contextProperty:"images",key:"images",moduleSpecifier:"@lunora/bindings/images",requiredPackage:"@lunora/bindings",serverCtxField:`
|
|
15
15
|
/** Cloudflare Images transforms (resize/format/optimize). Non-deterministic — available only in actions. */
|
|
16
16
|
readonly images: import("@lunora/bindings/images").Images;`,shardBinding:{binding:{bindingType:"ImagesBindingLike",envName:"IMAGES",factory:{name:"createImages",option:"binding"}},clientType:"Images",missingMessage:"ctx.images: no Images binding found. Add an `images` binding (env.IMAGES) to wrangler.jsonc, or pass `images` to createShardDO().",stubMethods:["info","transform"]},tier:"action"},{appMethod:{configKey:"kv",doc:"Override the Workers KV binding backing `ctx.kv` (defaults to `env.KV`).",method:"kv"},bindingFreeExports:["scopeKey"],contextProperty:"kv",key:"kv",moduleSpecifier:"@lunora/bindings/kv",requiredPackage:"@lunora/bindings",serverCtxField:`
|
|
17
17
|
readonly kv: import("@lunora/bindings/kv").Kv;`,shardBinding:{binding:{bindingType:"KVNamespaceLike",envName:"KV",factory:{name:"createKv",option:"namespace"},unvouchableReads:["get","getRaw","getWithMetadata","list"]},clientType:"Kv",missingMessage:"ctx.kv: no KV binding found. Add a `kv_namespaces` binding (env.KV) to wrangler.jsonc, or pass `kv` to createShardDO().",stubMethods:["delete","get","getRaw","getWithMetadata","list","put"]},tier:"every"},{key:"mail",moduleSpecifier:"@lunora/mail"},{contextProperty:"notify",key:"notify",moduleSpecifier:"@lunora/notify"},{appMethod:{configKey:"payment",doc:"Wire the payment options backing `ctx.payments`.",method:"payment"},contextProperty:"payments",key:"payments",moduleSpecifier:"@lunora/payment",requiredPackage:"@lunora/payment",serverCtxField:`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{NODE_CAPABILITIES as g,CLOUDFLARE_CAPABILITIES as b,CELLD_CAPABILITIES as
|
|
1
|
+
import{NODE_CAPABILITIES as g,CLOUDFLARE_CAPABILITIES as b,CELLD_CAPABILITIES as y}from"@lunora/platform";import{readProjectConfigLiterals as f}from"./loadProjectConfig-B7RmxIeD.mjs";const m="cloudflare",S=t=>{const{target:e}=f(t);return e!==void 0&&e.length>0?e:void 0},I=(t,e)=>e??S(t)??m,z=(t,e)=>{if(e!==void 0)return[];const{target:r,unreadable:a}=f(t);return a!==!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},E=(t,e)=>{if(t!=="cloudflare")return[];const{max:r,min:a}=_,i=`${String(a)}-${String(r)}`;return e.filter(({dimensions:o})=>o!==void 0&&(!Number.isInteger(o)||o<a||o>r)).map(({dimensions:o,name:s})=>({level:"warn",message:`Vector index "${s}" declares ${String(o)} dimensions; Cloudflare Vectorize accepts ${i}, so creating a Vectorize index for it fails at deploy.`,name:"platform_vector_dimensions_out_of_range",remediation:`If a Vectorize index backs "${s}", use ${i} dimensions (many embedding models can truncate output to fit). Ignore this if another store, such as pgvector, backs it.`,target:t}))},u={celld:y,cloudflare:b,node:g},O=(t,e)=>{const r=u[t];if(r===void 0)return!0;const a=r.features[e]?.level;return a==="native"||a==="emulated"},D=()=>Object.keys(u).toSorted((t,e)=>t.localeCompare(e)),k={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"},w=["agents","commitOrderedTables","containerEgressPolicy","containerRuntimeScheduling","containerSandboxTools","cronTriggers","crossShardFanout","deliveryAuthorization","durableStreams","globalTables","liveStreams","queues","relationGraph","secrets","secretValues","services","topics","typedWebSockets","vectorStore","workerLoaders","workflowRollback","workflowSchedules"],h={agents:"durable agents (`defineAgent`)",commitOrderedTables:"commit-ordered tables (`.commitOrdered()`)",containerEgressPolicy:"container egress policies (`defineContainer({ allowedHosts | deniedHosts | interceptHttps })`)",containerRuntimeScheduling:'per-instance container images and snapshots (`defineContainer({ schedulingPolicy: "durable_object" })`)',containerSandboxTools:"container sandbox helpers — files, directory backups, bucket mounts (`defineContainer({ sandbox: true })`)",deliveryAuthorization:"delivery authorization (`.deliveryAuthorization(...)` on the app builder)",cronTriggers:"declared cron triggers (`cronJobs()`)",crossShardFanout:"cross-shard fan-out queries (a `.shardBy(...)` schema)",durableStreams:"durable streams (`.stream(handler, { durable: true })`)",globalTables:"global tables (`.global()`)",liveContext:"the live publisher (`ctx.live`)",liveStreams:"live topic streams (`defineLiveStream`)",queues:"queues (`defineQueue`)",relationGraph:"relation-graph traversal (`ctx.db.related`, derived from `v.id(...)` columns)",secrets:"the secrets store (`ctx.secrets`)",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 })`)"},T=(t,e,r)=>({level:"error",message:`${e.name} does not support ${h[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}),x=(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}),P=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}),W=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}),A=(t,e,r)=>({level:"error",message:`${e.name}'s capability matrix does not declare a support level for ${h[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}),$=t=>{const{diagnostics:e,gatedSignals:r,matrix:a,reported:i,signals:o,target:s}=t;for(const n of w){if(o[n]!==!0)continue;const d=a.features[n]?.level;d!=="unsupported"&&d!==void 0||(r[n]=!1,!i.has(n)&&e.push(d==="unsupported"?T(n,a,s):A(n,a,s)))}},R=(t,e,r,a={})=>{const i={...t},o={...a},s=[],n=new Set;for(const[l,c]of Object.entries(k)){if(c===null||!t[l])continue;const v=e.features[c]?.level;v==="unsupported"?(i[l]=!1,n.add(c),s.push({feature:l,level:"error",message:`${e.name} does not support "${l}" (ctx.${l}).`,name:"platform_unsupported_feature",remediation:`Remove the ctx.${l} usage, or deploy to a target whose capability matrix marks "${c}" as native or emulated.`,target:r})):v===void 0&&(i[l]=!1,n.add(c),s.push({feature:l,level:"error",message:`${e.name}'s capability matrix does not declare a support level for "${l}" (ctx.${l}). Treated as unsupported.`,name:"platform_undeclared_feature",remediation:`Rate "${c}" 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}))}$({diagnostics:s,gatedSignals:o,matrix:e,reported:n,signals:a,target:r});const d=e.features.liveStreams?.level,p=d===void 0||d==="unsupported";return a.liveContext===!0&&p&&s.push(x(e,r)),{diagnostics:s,liveStreamsWithheld:p,signals:o,usage:i}},F=(t,e,r={})=>{const a=u[e];return a===void 0?{diagnostics:[{level:"error",message:`Unknown deploy target "${e}" — no capability matrix is registered for it. Codegen emitted the full Cloudflare surface un-gated.`,name:"platform_unknown_target",remediation:`Use a registered target (${Object.keys(u).join(", ")}) or install the target's @lunora/platform-${e} package.`,target:e}],liveStreamsWithheld:!1,signals:{...r},usage:{...t}}:R(t,a,e,r)},j=t=>{const e=u[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}},N=t=>{const e=u[t];if(e===void 0)return;const r=Object.entries(e.features).filter(([,a])=>a.level==="unsupported").map(([a])=>a).toSorted((a,i)=>a.localeCompare(i));return{id:e.id,name:e.name,unsupported:r}};export{k as CAPABILITY_TO_FEATURE,m as DEFAULT_TARGET,j as gateAdminTokenRevocation,R as gateAgainstMatrix,F as gatePlatformFeatures,P as liveStreamsDeliveryAuthorizationDiagnostic,O as platformFeatureAvailable,D as platformMatrixIds,S as readProjectTarget,z as readTargetDiagnostics,I as resolveCodegenTarget,W as socketRoutesDeliveryAuthorizationDiagnostic,N as studioPlatformFor,E as vectorizeDimensionDiagnostics};
|