@lunora/codegen 1.0.0-alpha.387 → 1.0.0-alpha.388
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 +3 -3
- package/dist/index.d.ts +3 -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/{SCHEMA_SNAPSHOT_FILENAME-CA_Jy0Mi.mjs → SCHEMA_SNAPSHOT_FILENAME-DJ8KVD1z.mjs} +1 -1
- 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-DI0NqdBD.mjs} +2 -2
- package/dist/packem_shared/emitServer-Bo1CO-pn.mjs +1 -0
- package/dist/packem_shared/{emitShard-CyFV41Mb.mjs → emitShard-9bkKBgXn.mjs} +1 -1
- package/dist/packem_shared/{server-qWq5nN-R.mjs → server-59fi39OH.mjs} +1 -1
- package/dist/packem_shared/{shard-t1Jkywmh.mjs → shard-BCIxx9-G.mjs} +1 -1
- package/dist/packem_shared/{shard-runtime-C1P_uVye.mjs → shard-runtime-CHda0G1i.mjs} +1 -1
- package/package.json +8 -8
- 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";
|
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";
|
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-DI0NqdBD.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-3OLdJhTj.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-DJ8KVD1z.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-BCIxx9-G.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-BvqxeNRr.mjs";import{emitDataModel as no}from"./packem_shared/emitDataModel-MjAOi3KM.mjs";import{emitFunctions as lo}from"./packem_shared/emitFunctions-C4PzKb4H.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,4 +1,4 @@
|
|
|
1
|
-
import{existsSync as z,readFileSync as Qe,mkdirSync as qt,writeFileSync as yr,rmSync as Pe,readdirSync as Ln}from"node:fs";import{dirname as jt,join as E,relative as Ht}from"node:path";import{performance as Et}from"node:perf_hooks";import{runAdvisor as br}from"@lunora/advisor";import{LunoraError as D}from"@lunora/errors";import{serializeSchemaSnapshot as Nr}from"./SCHEMA_SNAPSHOT_VERSION-DTLoSaNn.mjs";import{toAdvisorContext as Pr}from"./formatAdvisories-BCVASH7N.mjs";import{Node as r,SyntaxKind as d,Project as Gt,ts as wr,VariableDeclarationKind as Yt}from"ts-morph";import{listLunoraSourceFiles as y,lunoraRelativePath as w,descendantsOfKind as x,bindingKeyName as ue,collectCallRows as O,findObjectProperty as W,collectSecurityCallRows as Ir,propertyInitializer as L,listSecurityScanFiles as Xe,objectLiteralFromCallbackBody as Dn,limitNameOf as Mn,optionsObjectLiteral as _n,handlerOf as Tr,collectNodeRows as ie,chainRootOf as Je,outermostValueWrapper as C,isWriteTarget as Ze,isSameNode as b,unwrapExpression as h,isConstDeclaration as re,memberAccessOf as Qt,returningFunctionOf as Ct,walkChain as Cr,RUN_METHODS as zn,functionReferenceSegments as Or,isTestPath as kr,isFunctionLike as oe,functionKeyOf as Kn,withSourceListMemo as Rr}from"./isTestPath-JdN4KXhV.mjs";import{j as J,h as G,d as M,b as Xt,c as S,a as et,w as Jt,k as Fr,l as Lr,f as Dr,m as Mr,g as Ot,i as _r}from"./attribution-CTMkuBkn.mjs";import{b as Ks,r as xt,a as Q,e as zr,m as $n,c as tt,f as Zt,E as Bn,C as Vn,d as Kr,g as $r,i as Br}from"./context-root-DtpwprsY.mjs";import{a as T,i as Un,c as te,d as Wn,e as Vr,f as Ur,g as qn}from"./classify-procedure-call-DtqiTjPg.mjs";import{a as A,s as Wr}from"./property-name-7cBlgK_O.mjs";import{b as qr,a as st}from"./module-specifiers-BctA0m_p.mjs";import{r as nt,s as jr}from"./parse-validator-BisfC8bR.mjs";import Hr from"./discoverAuthApiCalls-DZMYREsq.mjs";import{i as K,r as jn}from"./database-calls-Cn47SfSU.mjs";import{i as kt,p as Hn,w as Gr,d as Yr}from"./index-o449rQLQ.mjs";import Qr from"./discoverHyperdriveCalls-DlyCZKX3.mjs";import{diagnosticAt as ae}from"./CodegenDiagnosticError-BUXlG3P-.mjs";import{m as es,a as Ue,s as Gn,d as Xr}from"./index-CNI4vSyc.mjs";import{MUTATORS_FILENAME as Jr,isDefineMutatorCallee as Zr,mutatorServerImplOf as eo,discoverMutators as to}from"./MUTATORS_FILENAME-D9WbOFm7.mjs";import so from"./discoverNondeterministicCalls-DQgVTcLv.mjs";import{discoverNotifyConfig as no,discoverNotifyCalls as io}from"./NOTIFY_FILENAME-CRU_TEKs.mjs";import ro from"./discoverR2sqlCalls-BrDIti5c.mjs";import oo from"./discoverRlsProcedures-BiyDg2ej.mjs";import{s as ts,n as ao}from"./dispatch-namespace-DwTjD7BU.mjs";import{secretKindOf as co,redact as lo,isHeuristicSecretKind as uo,isSecretishName as fo}from"./redact-Cy14LEnc.mjs";import{readProjectConfigLiterals as Yn,readMergeDurableObjects as go}from"./loadProjectConfig-B7RmxIeD.mjs";import{a as De,d as po,r as mo}from"./modules-DEBCI7Gm.mjs";import{WORKFLOWS_FILENAME as ho,discoverWorkflows as vo}from"./WORKFLOWS_FILENAME--RWiu_Vy.mjs";import{r as Eo}from"./json-data-Chfs2Cz5.mjs";import{a as xo,I as So,g as Ao,G as Qn,d as yo,i as bo}from"./shared-DhqnD5R3.mjs";import{createCodegenProject as No}from"./createCodegenProject-DmXl8m_P.mjs";import{findTsconfig as BE,refreshCodegenProject as VE,tsconfigFingerprint as UE}from"./createCodegenProject-DmXl8m_P.mjs";import{CAPABILITIES as Po,usedCapabilities as wo}from"./CAPABILITY_PROBES-
|
|
1
|
+
import{existsSync as z,readFileSync as Qe,mkdirSync as qt,writeFileSync as yr,rmSync as Pe,readdirSync as Ln}from"node:fs";import{dirname as jt,join as E,relative as Ht}from"node:path";import{performance as Et}from"node:perf_hooks";import{runAdvisor as br}from"@lunora/advisor";import{LunoraError as D}from"@lunora/errors";import{serializeSchemaSnapshot as Nr}from"./SCHEMA_SNAPSHOT_VERSION-DTLoSaNn.mjs";import{toAdvisorContext as Pr}from"./formatAdvisories-BCVASH7N.mjs";import{Node as r,SyntaxKind as d,Project as Gt,ts as wr,VariableDeclarationKind as Yt}from"ts-morph";import{listLunoraSourceFiles as y,lunoraRelativePath as w,descendantsOfKind as x,bindingKeyName as ue,collectCallRows as O,findObjectProperty as W,collectSecurityCallRows as Ir,propertyInitializer as L,listSecurityScanFiles as Xe,objectLiteralFromCallbackBody as Dn,limitNameOf as Mn,optionsObjectLiteral as _n,handlerOf as Tr,collectNodeRows as ie,chainRootOf as Je,outermostValueWrapper as C,isWriteTarget as Ze,isSameNode as b,unwrapExpression as h,isConstDeclaration as re,memberAccessOf as Qt,returningFunctionOf as Ct,walkChain as Cr,RUN_METHODS as zn,functionReferenceSegments as Or,isTestPath as kr,isFunctionLike as oe,functionKeyOf as Kn,withSourceListMemo as Rr}from"./isTestPath-JdN4KXhV.mjs";import{j as J,h as G,d as M,b as Xt,c as S,a as et,w as Jt,k as Fr,l as Lr,f as Dr,m as Mr,g as Ot,i as _r}from"./attribution-CTMkuBkn.mjs";import{b as Ks,r as xt,a as Q,e as zr,m as $n,c as tt,f as Zt,E as Bn,C as Vn,d as Kr,g as $r,i as Br}from"./context-root-DtpwprsY.mjs";import{a as T,i as Un,c as te,d as Wn,e as Vr,f as Ur,g as qn}from"./classify-procedure-call-DtqiTjPg.mjs";import{a as A,s as Wr}from"./property-name-7cBlgK_O.mjs";import{b as qr,a as st}from"./module-specifiers-BctA0m_p.mjs";import{r as nt,s as jr}from"./parse-validator-BisfC8bR.mjs";import Hr from"./discoverAuthApiCalls-DZMYREsq.mjs";import{i as K,r as jn}from"./database-calls-Cn47SfSU.mjs";import{i as kt,p as Hn,w as Gr,d as Yr}from"./index-o449rQLQ.mjs";import Qr from"./discoverHyperdriveCalls-DlyCZKX3.mjs";import{diagnosticAt as ae}from"./CodegenDiagnosticError-BUXlG3P-.mjs";import{m as es,a as Ue,s as Gn,d as Xr}from"./index-CNI4vSyc.mjs";import{MUTATORS_FILENAME as Jr,isDefineMutatorCallee as Zr,mutatorServerImplOf as eo,discoverMutators as to}from"./MUTATORS_FILENAME-D9WbOFm7.mjs";import so from"./discoverNondeterministicCalls-DQgVTcLv.mjs";import{discoverNotifyConfig as no,discoverNotifyCalls as io}from"./NOTIFY_FILENAME-CRU_TEKs.mjs";import ro from"./discoverR2sqlCalls-BrDIti5c.mjs";import oo from"./discoverRlsProcedures-BiyDg2ej.mjs";import{s as ts,n as ao}from"./dispatch-namespace-DwTjD7BU.mjs";import{secretKindOf as co,redact as lo,isHeuristicSecretKind as uo,isSecretishName as fo}from"./redact-Cy14LEnc.mjs";import{readProjectConfigLiterals as Yn,readMergeDurableObjects as go}from"./loadProjectConfig-B7RmxIeD.mjs";import{a as De,d as po,r as mo}from"./modules-DEBCI7Gm.mjs";import{WORKFLOWS_FILENAME as ho,discoverWorkflows as vo}from"./WORKFLOWS_FILENAME--RWiu_Vy.mjs";import{r as Eo}from"./json-data-Chfs2Cz5.mjs";import{a as xo,I as So,g as Ao,G as Qn,d as yo,i as bo}from"./shared-DhqnD5R3.mjs";import{createCodegenProject as No}from"./createCodegenProject-DmXl8m_P.mjs";import{findTsconfig as BE,refreshCodegenProject as VE,tsconfigFingerprint as UE}from"./createCodegenProject-DmXl8m_P.mjs";import{CAPABILITIES as Po,usedCapabilities as wo}from"./CAPABILITY_PROBES-BuNEmlCO.mjs";import{isD1GlobalTable as Xn,isHyperdriveGlobalTable as Jn}from"./isD1GlobalTable-udvHAAzD.mjs";import{discoverAgents as Io}from"./AGENTS_FILENAME-5mDMAMWy.mjs";import{discoverContainers as To}from"./CONTAINERS_FILENAME-BJYrxnq2.mjs";import Co from"./discoverCrons-D-vJXsgx.mjs";import{contextPropertiesRead as Oo,fileWiresRequestSecretTool as ko,createTargetScope as Ro,discoverFeatureUsage as Fo}from"./capabilitiesUsedBy-CkMimFS2.mjs";import Zn from"./readPackageDependencies-RHhGiz0k.mjs";import{PROJECT_CONFIG_FILENAMES as Lo,findProjectConfigFile as Do}from"./PROJECT_CONFIG_FILENAMES-CLfsyvjA.mjs";import{discoverQueueDeclarations as Mo}from"./QUEUES_FILENAME-BeGwgqcw.mjs";import{discoverSandboxUsage as _o}from"./discoverSandboxUsage-CdGRnVU2.mjs";import{resolveServiceBindings as zo}from"./readServiceBindings-BA49C6aN.mjs";import Ko from"./discoverStorageRulesMetadata-H3RJzkH_.mjs";import{resolveCodegenTarget as Rt,gatePlatformFeatures as $o,readTargetDiagnostics as Bo,vectorizeDimensionDiagnostics as Vo,liveStreamsDeliveryAuthorizationDiagnostic as Uo,socketRoutesDeliveryAuthorizationDiagnostic as Wo,studioPlatformFor as qo,platformFeatureAvailable as jo}from"./DEFAULT_TARGET-3OLdJhTj.mjs";import{i as Ho}from"./schema-BgM8A3XV.mjs";import{b as ei,e as Go}from"./shard-BCIxx9-G.mjs";import{e as Yo,a as Qo}from"./server-59fi39OH.mjs";import{emitDataModel as Xo}from"./emitDataModel-MjAOi3KM.mjs";import{i as Jo,b as Zo,e as ea,d as ta,f as sa,c as na}from"./unwrap-handler-return-c2s2-nk9.mjs";import ia from"./discoverHttpRoutes-D9Q0lBBb.mjs";import ra from"./discoverInserts-7Xdawmuk.mjs";import{e as ti}from"./exported-procedure-chains-CRM-MVfP.mjs";import oa from"./discoverMigrations-C649uAWL.mjs";import $s from"./discoverQueries-C75OdGHl.mjs";import aa from"./discoverRlsMetadata-DqZpiGts.mjs";import ca from"./discoverSchema-Bs5JUiOE.mjs";import{discoverShapes as la}from"./SHAPES_FILENAME-D9beIrs1.mjs";import{i as da}from"./reserved-words-CW1QFbTd.mjs";import{emitAuthModule as ua,emitApp as fa}from"./emitApp-DI0NqdBD.mjs";import{readJsonSync as ga}from"@visulima/fs";import{indexReferencesOf as pa,buildSchemaSnapshot as ma}from"./SchemaSnapshotParseError-DnAuFdpl.mjs";import{buildOpenApiDocument as ha,emitOpenApiModule as va}from"./buildOpenApiDocument-67-fasdW.mjs";import{buildOpenRpcDocument as Ea,emitOpenRpcModule as xa}from"./OPENRPC_VERSION-CT_E2DcI.mjs";import{w as Sa,u as Aa,v as ya,t as ba,x as Na}from"./shard-runtime-CHda0G1i.mjs";import{emitCollections as Pa,emitSeed as wa,emitApi as Ia,emitInternalApi as Ta}from"./emitApi-DWJW8Vu9.mjs";import{emitCrons as Ca,emitScheduler as Oa,emitShardRegistry as ka,emitDurableObjects as Ra,emitVectors as Fa,emitWranglerCronTriggers as La}from"./emitCrons-BvqxeNRr.mjs";import Da from"./emitDrizzleSchema-Dszoyymv.mjs";import{LAZY_FUNCTION_DIRECTORY as si,emitFunctions as Ma,emitLazyFunctionModules as _a}from"./emitFunctions-C4PzKb4H.mjs";const za=(e,t=!1)=>{if(e.length===0)return"";const s=yo(t),n=e.map(c=>{if(xo(c.exportName,"live stream export name"),!So.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=>{Ao(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(B=>`\${encodeURIComponent(key.${B})}`).join(":");return` ${u.name}: (key: LiveTopicKey<${f}>): ${g} => ({
|
|
2
2
|
__lunoraLive: ${m},
|
|
3
3
|
topic: \`${u.name}:${v}\`,
|
|
4
4
|
}),`});return` ${c.exportName}: {
|
package/dist/packem_shared/{capabilitiesUsedBy-CN8HACEL.mjs → capabilitiesUsedBy-CkMimFS2.mjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SyntaxKind as g,Node as m,ts as w,Project as R}from"ts-morph";import{CAPABILITIES as u}from"./CAPABILITY_PROBES-
|
|
1
|
+
import{SyntaxKind as g,Node as m,ts as w,Project as R}from"ts-morph";import{CAPABILITIES as u}from"./CAPABILITY_PROBES-BuNEmlCO.mjs";import{descendantsOfKind as l,bindingKeyName as y,listLunoraSourceFiles as D}from"./isTestPath-JdN4KXhV.mjs";import{scanImportDeclaration as P,noSandboxUsage as v}from"./discoverSandboxUsage-CdGRnVU2.mjs";const f="ctx",A=(e,t,s)=>{for(const n of l(e,g.ElementAccessExpression)){const r=n.getArgumentExpression();t(n.getExpression())&&r!==void 0&&(m.isStringLiteral(r)||m.isNoSubstitutionTemplateLiteral(r))&&s.add(r.getLiteralValue())}},L=e=>{const t=new Set,s=new Set,n=new Set(l(e,g.Parameter).map(o=>o.getName())),r=l(e,g.VariableDeclaration).some(o=>{const c=o.getInitializer();return o.getName()===f&&m.isIdentifier(c)&&n.has(c.getText())});(n.has(f)||r)&&s.add(f);const i=o=>{if(m.isObjectBindingPattern(o))for(const c of o.getElements()){const d=y(c);d&&t.add(d)}};for(const o of l(e,g.BindingElement)){if(y(o)!==f)continue;const c=o.getNameNode();m.isIdentifier(c)?s.add(c.getText()):i(c)}const a=o=>m.isIdentifier(o)&&s.has(o.getText());for(const o of l(e,g.PropertyAccessExpression))a(o.getExpression())&&t.add(o.getName());A(e,a,t);for(const o of l(e,g.VariableDeclaration)){const c=o.getInitializer();c!==void 0&&a(c)&&i(o.getNameNode())}return t},M=e=>{if(e.isTypeOnly())return!0;if(m.isExportDeclaration(e)){const s=e.getNamedExports();return!e.isNamespaceExport()&&s.length>0&&s.every(n=>n.isTypeOnly())}const t=e.getNamedImports();return e.getDefaultImport()===void 0&&e.getNamespaceImport()===void 0&&t.length>0&&t.every(s=>s.isTypeOnly())},C=new Map(u.flatMap(({bindingFreeExports:e,moduleSpecifier:t})=>e===void 0?[]:[[t,new Set(e)]])),V=(e,t)=>{const s=C.get(t);if(s===void 0||m.isImportDeclaration(e)&&(e.getDefaultImport()!==void 0||e.getNamespaceImport()!==void 0))return!1;const n=m.isExportDeclaration(e)?e.getNamedExports():e.getNamedImports();return n.length>0&&n.every(r=>r.isTypeOnly()||s.has(r.getName()))},F=e=>{const t=new Set;for(const s of l(e,g.CallExpression)){const[n]=s.getArguments();s.getExpression().getKind()===g.ImportKeyword&&(m.isStringLiteral(n)||m.isNoSubstitutionTemplateLiteral(n))&&t.add(n.getLiteralValue())}return t},N="@lunora/agent",E="requestSecretTool",I=e=>e.startsWith("./")||e.startsWith("../"),S=e=>e.getAliasNode()?.getText()??e.getNameNode().getText(),z=(e,t)=>{const s=e!==void 0&&m.isCallExpression(e)?e.getExpression():e;return s!==void 0&&m.isIdentifier(s)&&t.has(s.getText())},_=e=>{const t=new Set;for(const s of e.getImportDeclarations())if(!(s.getModuleSpecifierValue()!==N||s.isTypeOnly()))for(const n of s.getNamedImports())!n.isTypeOnly()&&n.getNameNode().getText()===E&&t.add(S(n));return t},p=e=>({names:new Set(e),namespaces:new Map}),x=()=>({projects:new Map,origins:new Map}),k=(e,t)=>{if(e.origins.has(t))return t;let s=e.projects.get(t);return s===void 0&&(s=new R({compilerOptions:{...t.getCompilerOptions(),allowJs:!0},fileSystem:t.getFileSystem(),skipAddingFilesFromTsConfig:!0,skipFileDependencyResolution:!0,skipLoadingLibFiles:!0}),e.projects.set(t,s),e.origins.set(s,t)),s},b=(e,t,s)=>{const n=t.getSourceFile(),r=n.getProject(),i=e.origins.get(r)??r,{resolvedModule:a}=w.resolveModuleName(s,n.getFilePath(),i.getCompilerOptions(),i.getModuleResolutionHost()),o=a?.resolvedFileName;if(o===void 0)return;const c=i.getSourceFile(o)??r.getSourceFile(o);if(c!==void 0)return c;const d=k(e,r);return d.getSourceFile(o)??d.addSourceFileAtPath(o)},B=(e,t,s)=>{const n=e.getNamespaceExport();if(n!==void 0){const r=new Set(t.names);t.namespaces.forEach((i,a)=>{i.forEach(o=>{r.add(`${a}.${o}`)})}),r.size>0&&s.namespaces.set(n.getName(),r);return}if(!e.hasNamedExports()){t.names.forEach(r=>s.names.add(r)),t.namespaces.forEach((r,i)=>s.namespaces.set(i,r));return}for(const r of e.getNamedExports()){if(r.isTypeOnly())continue;const i=r.getNameNode().getText(),a=S(r);t.names.has(i)&&s.names.add(a);const o=t.namespaces.get(i);o!==void 0&&s.namespaces.set(a,o)}},K=(e,t,s,n)=>{const r=t.getModuleSpecifierValue();if(r===void 0)return p(s);if(r===N)return p([E]);const i=I(r)?b(e,t,r):void 0;return i===void 0?p([]):n(i)},h=(e,t,s)=>{const n=p([]),r=e.getFilePath();if(t.has(r))return n;t.add(r);const i=_(e);for(const a of e.getExportDeclarations())a.isTypeOnly()||B(a,K(s,a,i,o=>h(o,t,s)),n);for(const a of e.getVariableStatements())if(a.hasExportKeyword())for(const o of a.getDeclarations())z(o.getInitializer(),i)&&n.names.add(o.getName());return t.delete(r),n},W=(e,t,s)=>{const n=e.getModuleSpecifierValue();if(n===N)return p([E]);const r=I(n)?b(s,e,n):void 0;return r===void 0?p([]):h(r,new Set([t.getFilePath()]),s)},$=e=>{const t=e.getPropertyNameNode();return t===void 0?e.getName():m.isStringLiteral(t)?t.getLiteralValue():t.getText()},T=(e,t,s)=>{const n=(o,c)=>o===t?s.has(c):o.startsWith(`${t}.`)&&s.has(`${o.slice(t.length+1)}.${c}`),r=e.getDescendantsOfKind(g.PropertyAccessExpression).some(o=>n(o.getExpression().getText(),o.getName())),i=l(e,g.ElementAccessExpression).some(o=>{const c=o.getArgumentExpression();return m.isStringLiteral(c)&&n(o.getExpression().getText(),c.getLiteralValue())}),a=l(e,g.VariableDeclaration).some(o=>{const c=o.getInitializer(),d=o.getNameNode();return c!==void 0&&m.isObjectBindingPattern(d)&&d.getElements().some(O=>n(c.getText(),$(O)))});return r||i||a},j=(e,t,s)=>{if(s.names.has(t.getNameNode().getText()))return!0;const n=s.namespaces.get(t.getNameNode().getText());return n!==void 0&&T(e,S(t),n)},q=(e,t=x())=>e.getImportDeclarations().some(s=>{if(s.isTypeOnly())return!1;const n=W(s,e,t);if(n.names.size===0&&n.namespaces.size===0)return!1;const r=s.getDefaultImport(),i=s.getNamespaceImport();return r!==void 0&&(n.names.has("default")||T(e,r.getText(),n.namespaces.get("default")??new Set))||s.getNamedImports().some(o=>!o.isTypeOnly()&&j(e,o,n))||i!==void 0&&T(e,i.getText(),n.names)}),U=(e,t=x())=>{const s=e.getImportDeclarations(),n=v();for(const r of s){const i=P(r);for(const a of Object.keys(n))n[a]||=i[a]}return{contextReads:L(e),dynamicImports:F(e),requestSecretTool:q(e,t),sandboxTools:n,valueImports:new Set([...s,...e.getExportDeclarations()].flatMap(r=>{const i=r.getModuleSpecifierValue();return i===void 0||M(r)||V(r,i)?[]:[i]}))}},X=e=>{const t=new Set,s=new Set,n=v(),r=new Set;let i=!1;for(const a of e){i||=a.requestSecretTool;for(const o of a.contextReads)t.add(o);for(const o of a.dynamicImports)s.add(o);for(const o of a.valueImports)r.add(o);for(const o of Object.keys(n))n[o]||=a.sandboxTools[o]}return{contextReads:t,dynamicImports:s,requestSecretTool:i,sandboxTools:n,valueImports:r}},G=e=>new Set(u.filter(({contextProperty:t,moduleSpecifier:s})=>e.valueImports.has(s)||t!==void 0&&e.contextReads.has(t)).map(({key:t})=>t)),H=new RegExp(String.raw`\b${f}\b`,"u"),J=new RegExp(String.raw`\b(?:${u.flatMap(({contextProperty:e})=>e===void 0?[]:[e]).join("|")})\b`,"u"),te=e=>H.test(e)&&J.test(e),se=(e,t)=>{const s=x(),n=X(D(t).map(i=>U(e.getSourceFile(i)??e.addSourceFileAtPath(i),s))),r=G(n);return Object.fromEntries(u.map(({key:i})=>[i,r.has(i)]))};export{G as capabilitiesUsedBy,L as contextPropertiesRead,x as createTargetScope,se as discoverFeatureUsage,q as fileWiresRequestSecretTool,X as foldCapabilitySignals,te as mayReadCapabilityContext,U as sourceCapabilitySignals};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./json-data-Chfs2Cz5.mjs";import{p as i,j as r,t as n,h as o,u as g,k as F,d as u,x as p,n as l,g as f,f as d,m as k,i as w,v as W,l as v,w as A}from"./shard-runtime-
|
|
1
|
+
import"./json-data-Chfs2Cz5.mjs";import{p as i,j as r,t as n,h as o,u as g,k as F,d as u,x as p,n as l,g as f,f as d,m as k,i as w,v as W,l as v,w as A}from"./shard-runtime-CHda0G1i.mjs";import"./shared-DhqnD5R3.mjs";import"./platform-8oj7iXQy.mjs";export{i as buildDoTypeImports,r as emitAgentFragments,n as emitAgents,o as emitContainerFragments,g as emitContainers,F as emitPaymentFragments,u as emitQueueFragments,p as emitQueues,l as emitQueuesMetadataFragments,f as emitServiceFragments,d as emitTopicFragments,k as emitWorkflowEventFragments,w as emitWorkflowFragments,W as emitWorkflows,v as emitWorkflowsMetadataFragments,A as queueAliasFindings};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{APP_METHOD_CAPABILITIES as q}from"./CAPABILITY_PROBES-
|
|
1
|
+
import{APP_METHOD_CAPABILITIES as q}from"./CAPABILITY_PROBES-BuNEmlCO.mjs";import{i as I}from"./schema-BgM8A3XV.mjs";import{a as N,I as L,G as y}from"./shared-DhqnD5R3.mjs";const j={configKey:"vectors",doc:"Wire the Vectorize index map backing `ctx.vectors`.",method:"vectors"},f=e=>[...q.filter(({key:r})=>e.capabilities.has(r)).map(({appMethod:r})=>r),...e.hasVectors?[j]:[]],w=e=>f(e).length>0,k=e=>(e.emailAgents?.length??0)>0,c=e=>e.tables.some(r=>I(r)),p=e=>e.liveStreams===!0&&(e.liveStreamDeclarations?.length??0)>0,$=e=>e.hasScheduler?`
|
|
2
2
|
/** Resolve the \`SchedulerDO\`-backed scheduler for this env; \`undefined\` until the namespace is wired. */
|
|
3
3
|
private resolveScheduler(env: Env): ReturnType<typeof createScheduler> | undefined {
|
|
4
4
|
const namespace = this.schedulerDeclaration?.namespace(env);
|
|
@@ -340,7 +340,7 @@ const buildGlobalCdcApplier =
|
|
|
340
340
|
|
|
341
341
|
return request.changes.length;
|
|
342
342
|
};
|
|
343
|
-
`:"",M=e=>[...e.hasStorage?["/** `.storage(...)` declaration — one bucket (required) plus optional extra named buckets and signed-URL config. Backs `ctx.storage` AND the studio file browser. */\ninterface StorageDeclaration<Env> {\n /** The default R2 bucket binding (the bare `ctx.storage`). */\n bucket: Selector<Env, R2BucketLike>;\n /** Extra named buckets, reached via `ctx.storage.bucket(\"name\")` and the studio's bucket picker. */\n buckets?: Record<string, Selector<Env, R2BucketLike>>;\n /** Public base URL signed/public object URLs resolve against. Omit it and `ctx.storage` in a mutation, action or HTTP handler (and the studio's copy-URL) signs against the origin the request reached the worker on — no per-environment value to ship. Queries get no such fallback (a live query re-runs with no request behind it), so a query that signs URLs needs this set. */\n publicBaseUrl?: Selector<Env, string>;\n /** R2 S3-API credentials (`{ accountId, accessKeyId, secretAccessKey, bucket, jurisdiction? }`) enabling `ctx.storage.getPresignedUrl` — native S3 presigned URLs that hit R2 directly, bypassing the worker. Omit to use only the worker-signed `getSignedUrl` path. */\n s3?: Selector<Env, R2S3Credentials>;\n /** HMAC secret for signed URLs. */\n signingSecret?: Selector<Env, string>;\n}"]:[],...e.hasScheduler?["/** `.scheduler(...)` declaration — the `SchedulerDO` namespace. Backs `ctx.scheduler` AND the studio's scheduled-jobs view. The origin its callbacks dispatch back to is not declared here: the DO reads `env.LUNORA_ORIGIN_URL` at fire time, because a caller-supplied dispatch target would be an SSRF vector. */\ninterface SchedulerDeclaration<Env> {\n /** The `SchedulerDO` namespace binding (typically `env.SCHEDULER`). */\n namespace: Selector<Env, DurableObjectNamespaceLike & ShardNamespaceLike>;\n}"]:[],...e.hasGlobal?["/** `.global(...)` declaration — the D1 binding backing `.global()` tables. Backs cross-tenant `ctx.db` reads/writes AND the studio's global data browser. */\ninterface GlobalDeclaration<Env> {\n /** The D1 binding (typically `env.DB`). */\n d1: Selector<Env, D1DatabaseLike>;\n /** The worker origin used to fan reverse cross-backend relations across shards. Without it, such a relation throws a clear error. */\n origin?: Selector<Env, string>;\n}"]:[],...e.hasHyperdriveGlobal?['/** `.hyperdriveGlobal(...)` declaration — backs `.global({ backend: "hyperdrive" })` tables on a Postgres/MySQL database via Hyperdrive. Stays reactive: the writer is injected as `globalDb` and the broadcast hook drives live queries. */\ninterface HyperdriveGlobalDeclaration<Env> {\n /** The Hyperdrive engine — selects the Postgres or MySQL dialect. */\n engine: HyperdriveEngine;\n /** Build the `SqlExec` from `env` — e.g. `buildPgExec(fromPostgresJs(postgres(env.HYPERDRIVE.connectionString, { fetch_types: false, max: 5 })))`. Called per request, by the shard and by the stateless worker\'s admin plane, so return an exec on a connection opened for that call: never cache a driver or socket at module scope, since Workers refuse I/O across requests. */\n exec: (env: Env) => SqlExec;\n /** The worker origin used to fan reverse cross-backend relations across shards. Without it, such a relation throws a clear error. */\n origin?: Selector<Env, string>;\n}']:[],...e.hasAuth?['/** `.auth(...)` declaration — better-auth options plus the storage the adapter reads. Give it `d1` (the default) or `namespace` (a Durable Object that hosts the auth tables), never both. The builder owns the lazy build + `ensureMigrated` dance and wires `authHandler` / `resolveIdentity` / `authAdmin`. */\ninterface AuthDeclaration<Env> {\n /** The D1 binding the auth SQL adapter is wired over (via `lunoraD1Adapter`). Omit only when using `namespace`. */\n d1?: Selector<Env, unknown>;\n /** Shared secret the worker presents on the object\'s internal session route. REQUIRED with `namespace`: the binding is reachable from any worker bound to it, so the secret — not the binding — is the authorization boundary. Without it identity resolution fails closed. */\n internalSecret?: Selector<Env, string>;\n /** Name of the Durable Object instance holding the auth tables. Defaults to `"auth"`. Set it to run separate auth objects (per deployment, per tenant) off one namespace. */\n objectName?: Selector<Env, string>;\n /** The auth Durable Object namespace — the DO-backed mode. Needed for `@better-auth/scim`, which requires native transactions that D1 has none of. The object owns the auth tables, so `/api/auth/*` and identity resolution both go through it. Typed as `AuthNamespaceLike` because `createDoAuthWiring` resolves through `idFromName` + `get` and has no `getByName` fallback — both members are load-bearing here, and `ShardNamespaceLike` leaves both optional. */\n namespace?: Selector<Env, AuthNamespaceLike>;\n /** Build the better-auth options from `env` (secret, plugins, email/password, …). */\n options: (env: Env) => LunoraAuthOptions;\n}']:[]],B=e=>[...e.hasAccess?[" private accessSelector?: Selector<Env, CreateAccessResolverOptions | undefined>;"]:[]," private adminToken?: Selector<Env, string>;",...e.hasAuth?[" private authDeclaration?: AuthDeclaration<Env>;"]:[]," private cdcEnabled = false;",...e.hasDeliveryAuthorization===!1?[]:[' private deliveryAuthorizationSelector?: ShardConfig["deliveryAuthorization"];']," private reactiveCacheConfig: boolean | { maxBytes?: number; maxEntries?: number } = false;",' private maxRelationKeysLimit?: ShardConfig["maxRelationKeys"];',' private observabilitySink?: ShardConfig["observability"];',' private relationExistsPushDownMode?: ShardConfig["relationExistsPushDown"];'," private readonly extendFns: ((env: Env, derived: Readonly<WorkerOptions>) => Partial<WorkerOptions>)[] = [];",...e.hasGlobal?[" private globalDeclaration?: GlobalDeclaration<Env>;"]:[],...e.hasHyperdriveGlobal?[" private hyperdriveGlobalDeclaration?: HyperdriveGlobalDeclaration<Env>;"]:[]," private httpRouterApp?: HttpRouterLike;"," private readonly routeMap: Record<string, Route> = {};",...e.hasScheduler?[" private schedulerDeclaration?: SchedulerDeclaration<Env>;"]:[],...w(e)?[" private readonly shardExtras: Partial<ShardConfig> = {};"]:[],...c(e)?[" private shardRegistrySelector?: Selector<Env, ShardNamespaceLike | ShardRegistryRpc>;"]:[]," private shardSelector?: Selector<Env, ShardNamespaceLike>;",...e.hasSourcedTables?[' private sourceClientFactory?: NonNullable<ShardConfig["sourceClient"]>;']:[],...e.hasStorage?[" private storageDeclaration?: StorageDeclaration<Env>;"]:[]],_=e=>f(e).map(({configKey:r,doc:t,method:a})=>` /** ${t} */
|
|
343
|
+
`:"",M=e=>[...e.hasStorage?["/** `.storage(...)` declaration — one bucket (required) plus optional extra named buckets and signed-URL config. Backs `ctx.storage` AND the studio file browser. */\ninterface StorageDeclaration<Env> {\n /** The default R2 bucket binding (the bare `ctx.storage`). */\n bucket: Selector<Env, R2BucketLike>;\n /** Extra named buckets, reached via `ctx.storage.bucket(\"name\")` and the studio's bucket picker. */\n buckets?: Record<string, Selector<Env, R2BucketLike>>;\n /** Public base URL signed/public object URLs resolve against. Omit it and `ctx.storage` in a mutation, action or HTTP handler (and the studio's copy-URL) signs against the origin the request reached the worker on — no per-environment value to ship. Queries get no such fallback (a live query re-runs with no request behind it), so a query that signs URLs needs this set. */\n publicBaseUrl?: Selector<Env, string>;\n /** R2 S3-API credentials (`{ accountId, accessKeyId, secretAccessKey, bucket, jurisdiction? }`) enabling `ctx.storage.getPresignedUrl` — native S3 presigned URLs that hit R2 directly, bypassing the worker. Omit to use only the worker-signed `getSignedUrl` path. */\n s3?: Selector<Env, R2S3Credentials>;\n /** HMAC secret for signed URLs. */\n signingSecret?: Selector<Env, string>;\n}"]:[],...e.hasScheduler?["/** `.scheduler(...)` declaration — the `SchedulerDO` namespace. Backs `ctx.scheduler` AND the studio's scheduled-jobs view. The origin its callbacks dispatch back to is not declared here: the DO reads `env.LUNORA_ORIGIN_URL` at fire time, because a caller-supplied dispatch target would be an SSRF vector. */\ninterface SchedulerDeclaration<Env> {\n /** The `SchedulerDO` namespace binding (typically `env.SCHEDULER`). */\n namespace: Selector<Env, DurableObjectNamespaceLike & ShardNamespaceLike>;\n}"]:[],...e.hasGlobal?["/** `.global(...)` declaration — the D1 binding backing `.global()` tables. Backs cross-tenant `ctx.db` reads/writes AND the studio's global data browser. */\ninterface GlobalDeclaration<Env> {\n /** The D1 binding (typically `env.DB`). */\n d1: Selector<Env, D1DatabaseLike>;\n /** The worker origin used to fan reverse cross-backend relations across shards. Without it, such a relation throws a clear error. */\n origin?: Selector<Env, string>;\n}"]:[],...e.hasHyperdriveGlobal?['/** `.hyperdriveGlobal(...)` declaration — backs `.global({ backend: "hyperdrive" })` tables on a Postgres/MySQL database via Hyperdrive. Stays reactive: the writer is injected as `globalDb` and the broadcast hook drives live queries. */\ninterface HyperdriveGlobalDeclaration<Env> {\n /** The Hyperdrive engine — selects the Postgres or MySQL dialect. */\n engine: HyperdriveEngine;\n /** Build the `SqlExec` from `env` — e.g. `buildPgExec(fromPostgresJs(async () => (await import("postgres")).default(env.HYPERDRIVE.connectionString, { fetch_types: false, max: 5 })))`. Called per request, by the shard and by the stateless worker\'s admin plane, so return an exec on a connection opened for that call: never cache a driver or socket at module scope, since Workers refuse I/O across requests. */\n exec: (env: Env) => SqlExec;\n /** The worker origin used to fan reverse cross-backend relations across shards. Without it, such a relation throws a clear error. */\n origin?: Selector<Env, string>;\n}']:[],...e.hasAuth?['/** `.auth(...)` declaration — better-auth options plus the storage the adapter reads. Give it `d1` (the default) or `namespace` (a Durable Object that hosts the auth tables), never both. The builder owns the lazy build + `ensureMigrated` dance and wires `authHandler` / `resolveIdentity` / `authAdmin`. */\ninterface AuthDeclaration<Env> {\n /** The D1 binding the auth SQL adapter is wired over (via `lunoraD1Adapter`). Omit only when using `namespace`. */\n d1?: Selector<Env, unknown>;\n /** Shared secret the worker presents on the object\'s internal session route. REQUIRED with `namespace`: the binding is reachable from any worker bound to it, so the secret — not the binding — is the authorization boundary. Without it identity resolution fails closed. */\n internalSecret?: Selector<Env, string>;\n /** Name of the Durable Object instance holding the auth tables. Defaults to `"auth"`. Set it to run separate auth objects (per deployment, per tenant) off one namespace. */\n objectName?: Selector<Env, string>;\n /** The auth Durable Object namespace — the DO-backed mode. Needed for `@better-auth/scim`, which requires native transactions that D1 has none of. The object owns the auth tables, so `/api/auth/*` and identity resolution both go through it. Typed as `AuthNamespaceLike` because `createDoAuthWiring` resolves through `idFromName` + `get` and has no `getByName` fallback — both members are load-bearing here, and `ShardNamespaceLike` leaves both optional. */\n namespace?: Selector<Env, AuthNamespaceLike>;\n /** Build the better-auth options from `env` (secret, plugins, email/password, …). */\n options: (env: Env) => LunoraAuthOptions;\n}']:[]],B=e=>[...e.hasAccess?[" private accessSelector?: Selector<Env, CreateAccessResolverOptions | undefined>;"]:[]," private adminToken?: Selector<Env, string>;",...e.hasAuth?[" private authDeclaration?: AuthDeclaration<Env>;"]:[]," private cdcEnabled = false;",...e.hasDeliveryAuthorization===!1?[]:[' private deliveryAuthorizationSelector?: ShardConfig["deliveryAuthorization"];']," private reactiveCacheConfig: boolean | { maxBytes?: number; maxEntries?: number } = false;",' private maxRelationKeysLimit?: ShardConfig["maxRelationKeys"];',' private observabilitySink?: ShardConfig["observability"];',' private relationExistsPushDownMode?: ShardConfig["relationExistsPushDown"];'," private readonly extendFns: ((env: Env, derived: Readonly<WorkerOptions>) => Partial<WorkerOptions>)[] = [];",...e.hasGlobal?[" private globalDeclaration?: GlobalDeclaration<Env>;"]:[],...e.hasHyperdriveGlobal?[" private hyperdriveGlobalDeclaration?: HyperdriveGlobalDeclaration<Env>;"]:[]," private httpRouterApp?: HttpRouterLike;"," private readonly routeMap: Record<string, Route> = {};",...e.hasScheduler?[" private schedulerDeclaration?: SchedulerDeclaration<Env>;"]:[],...w(e)?[" private readonly shardExtras: Partial<ShardConfig> = {};"]:[],...c(e)?[" private shardRegistrySelector?: Selector<Env, ShardNamespaceLike | ShardRegistryRpc>;"]:[]," private shardSelector?: Selector<Env, ShardNamespaceLike>;",...e.hasSourcedTables?[' private sourceClientFactory?: NonNullable<ShardConfig["sourceClient"]>;']:[],...e.hasStorage?[" private storageDeclaration?: StorageDeclaration<Env>;"]:[]],_=e=>f(e).map(({configKey:r,doc:t,method:a})=>` /** ${t} */
|
|
344
344
|
public ${a}(factory: (env: Env) => ReturnType<NonNullable<ShardConfig["${r}"]>>): this {
|
|
345
345
|
this.shardExtras.${r} = factory as NonNullable<ShardConfig["${r}"]>;
|
|
346
346
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./CAPABILITY_PROBES-BuNEmlCO.mjs";import{e}from"./server-59fi39OH.mjs";import"./shared-DhqnD5R3.mjs";import"./platform-8oj7iXQy.mjs";export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./SCHEMA_SNAPSHOT_VERSION-DTLoSaNn.mjs";import"./isD1GlobalTable-udvHAAzD.mjs";import"./json-data-Chfs2Cz5.mjs";import{e as d}from"./shard-
|
|
1
|
+
import"./SCHEMA_SNAPSHOT_VERSION-DTLoSaNn.mjs";import"./isD1GlobalTable-udvHAAzD.mjs";import"./json-data-Chfs2Cz5.mjs";import{e as d}from"./shard-BCIxx9-G.mjs";import"./shard-runtime-CHda0G1i.mjs";import"./shared-DhqnD5R3.mjs";import"./platform-8oj7iXQy.mjs";import"./schema-BgM8A3XV.mjs";export{d as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{CAPABILITIES as Qe}from"./CAPABILITY_PROBES-
|
|
1
|
+
import{CAPABILITIES as Qe}from"./CAPABILITY_PROBES-BuNEmlCO.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,sep as ue,isAbsolute as _e,resolve as Ve,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-DhqnD5R3.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
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
3
|
`:"",R=a.length>0?`
|
|
4
4
|
readonly containers: {${a.map(r=>`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{LunoraError as me}from"@lunora/errors";import{serializeSchemaSnapshot as Zt,hashSchemaSnapshot as er}from"./SCHEMA_SNAPSHOT_VERSION-DTLoSaNn.mjs";import{isHyperdriveGlobalTable as tr,isD1GlobalTable as rr}from"./isD1GlobalTable-udvHAAzD.mjs";import{r as nr}from"./json-data-Chfs2Cz5.mjs";import{r as M,e as ar,a as sr,b as or,c as ir,d as dr,f as cr,g as lr,h as ur,i as hr,j as pr,k as mr,l as fr,m as gr,n as br,o as yr,p as wr,q as vr,s as kr}from"./shard-runtime-
|
|
1
|
+
import{LunoraError as me}from"@lunora/errors";import{serializeSchemaSnapshot as Zt,hashSchemaSnapshot as er}from"./SCHEMA_SNAPSHOT_VERSION-DTLoSaNn.mjs";import{isHyperdriveGlobalTable as tr,isD1GlobalTable as rr}from"./isD1GlobalTable-udvHAAzD.mjs";import{r as nr}from"./json-data-Chfs2Cz5.mjs";import{r as M,e as ar,a as sr,b as or,c as ir,d as dr,f as cr,g as lr,h as ur,i as hr,j as pr,k as mr,l as fr,m as gr,n as br,o as yr,p as wr,q as vr,s as kr}from"./shard-runtime-CHda0G1i.mjs";import{u as q,h as Sr,s as Rr,a as xr,I as Ar,c as Or,G as Dr,d as Tr}from"./shared-DhqnD5R3.mjs";import{p as _r}from"./platform-8oj7iXQy.mjs";import{i as Ir}from"./schema-BgM8A3XV.mjs";const p=(r,t)=>`((): (() => ${t}) => { let cached: ${t} | undefined; return () => (cached ??= JSON.parse(${JSON.stringify(JSON.stringify(r))}) as ${t}); })()`,fe=["categories","description","facing","level","remediation","title"],Er=r=>{const t={};return{advisoryRows:r.map(o=>{let n=t[o.name];return n||(n=Object.fromEntries(fe.filter(a=>a in o).map(a=>[a,o[a]])),t[o.name]=n),Object.fromEntries(Object.entries(o).filter(([a,i])=>!fe.includes(a)||JSON.stringify(i)!==JSON.stringify(n[a])))}),advisoryRules:t}},Cr=` /**
|
|
2
2
|
* The bare writer every admin/maintenance entry point writes through.
|
|
3
3
|
*
|
|
4
4
|
* Admin and maintenance writes go through the SAME reactive-cache hooks as a
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{LunoraError as k}from"@lunora/errors";import{r as b}from"./json-data-Chfs2Cz5.mjs";import{CAPABILITIES as R}from"./CAPABILITY_PROBES-
|
|
1
|
+
import{LunoraError as k}from"@lunora/errors";import{r as b}from"./json-data-Chfs2Cz5.mjs";import{CAPABILITIES as R}from"./CAPABILITY_PROBES-BuNEmlCO.mjs";import{a as l,G as f,I as w}from"./shared-DhqnD5R3.mjs";import{s as S}from"./platform-8oj7iXQy.mjs";const Q=e=>e?{importFragment:"serveRelationFanout, ",override:`
|
|
2
2
|
protected override async runRelationFanoutRead(functionPath: string, args: Record<string, unknown>): Promise<unknown> {
|
|
3
3
|
this.ensureServable();
|
|
4
4
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/codegen",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.388",
|
|
4
4
|
"description": "Code generator for Lunora: emits _generated/{api,server,dataModel}.ts from your schema",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -50,15 +50,15 @@
|
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@lunora/advisor": "1.0.0-alpha.
|
|
54
|
-
"@lunora/agent": "1.0.0-alpha.
|
|
55
|
-
"@lunora/container": "1.0.0-alpha.
|
|
53
|
+
"@lunora/advisor": "1.0.0-alpha.283",
|
|
54
|
+
"@lunora/agent": "1.0.0-alpha.275",
|
|
55
|
+
"@lunora/container": "1.0.0-alpha.107",
|
|
56
56
|
"@lunora/errors": ">=1.0.0-alpha.51 <2.0.0-0",
|
|
57
57
|
"@lunora/platform": "1.0.0-alpha.78",
|
|
58
|
-
"@lunora/queue": "1.0.0-alpha.
|
|
59
|
-
"@lunora/scheduler": "1.0.0-alpha.
|
|
60
|
-
"@lunora/values": "1.0.0-alpha.
|
|
61
|
-
"@lunora/workflow": "1.0.0-alpha.
|
|
58
|
+
"@lunora/queue": "1.0.0-alpha.141",
|
|
59
|
+
"@lunora/scheduler": "1.0.0-alpha.166",
|
|
60
|
+
"@lunora/values": "1.0.0-alpha.93",
|
|
61
|
+
"@lunora/workflow": "1.0.0-alpha.109",
|
|
62
62
|
"@visulima/fs": "7.0.0",
|
|
63
63
|
"jiti": "^2.7.0",
|
|
64
64
|
"quicktype-core": "^26.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./CAPABILITY_PROBES-DKYJ2K4t.mjs";import{e}from"./server-qWq5nN-R.mjs";import"./shared-DhqnD5R3.mjs";import"./platform-8oj7iXQy.mjs";export{e as default};
|