@lunora/codegen 1.0.0-alpha.250 → 1.0.0-alpha.252
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 +66 -62
- package/dist/index.d.ts +66 -62
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/CAPABILITY_PROBES-LYIlPWT3.mjs +24 -0
- package/dist/packem_shared/DEFAULT_TARGET-Co7ZXJ21.mjs +1 -0
- package/dist/packem_shared/SCHEMA_SNAPSHOT_FILENAME-DyKj7n2S.mjs +11 -0
- package/dist/packem_shared/emitAgents-DBUkiiof.mjs +1 -0
- package/dist/packem_shared/{emitApp-T_My13i6.mjs → emitApp-DPzAn_NF.mjs} +21 -21
- package/dist/packem_shared/{emitServer-DQxwHVPM.mjs → emitServer-CLJh410z.mjs} +50 -54
- package/dist/packem_shared/{emitShard-BDfiH_JF.mjs → emitShard-CdltMRWo.mjs} +1 -1
- package/dist/packem_shared/{shard-f7coQFS9.mjs → shard-DRdVWVi_.mjs} +60 -60
- package/dist/packem_shared/{shard-runtime-CyEbIjPA.mjs → shard-runtime-B9wmfm43.mjs} +21 -21
- package/dist/packem_shared/sourceCapabilitySignals-D5p3WRdM.mjs +1 -0
- package/package.json +10 -10
- package/dist/packem_shared/DEFAULT_TARGET-vMWzRzRF.mjs +0 -1
- package/dist/packem_shared/SCHEMA_SNAPSHOT_FILENAME-jefy8GTn.mjs +0 -11
- package/dist/packem_shared/capabilities-CqnIsyA9.mjs +0 -20
- package/dist/packem_shared/contextPropertiesRead-BGy4tGCY.mjs +0 -1
- package/dist/packem_shared/emitAgents-3XP5C-VJ.mjs +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -2411,9 +2411,9 @@ declare const formatAdvisories: (findings: ReadonlyArray<Finding>) => string;
|
|
|
2411
2411
|
/**
|
|
2412
2412
|
* The canonical capability list. **Order is load-bearing** — every consumer
|
|
2413
2413
|
* emits in row order (see the module doc). The `appMethod` rows reproduce the
|
|
2414
|
-
* original `LONG_TAIL` builder sequence (ai, aiSearch, analytics, artifacts, browser,
|
|
2415
|
-
* images, kv, payment, x402, r2sql
|
|
2416
|
-
* `ctx.*` fields and the ShardDO wiring.
|
|
2414
|
+
* original `LONG_TAIL` builder sequence (ai, aiSearch, analytics, analyticsSql, artifacts, browser,
|
|
2415
|
+
* hyperdrive, images, kv, payment, x402, r2sql — `.vectors()` follows them, emitted off the
|
|
2416
|
+
* declaration), and the same order places the `ctx.*` fields and the ShardDO wiring.
|
|
2417
2417
|
*/
|
|
2418
2418
|
declare const CAPABILITY_ROWS: readonly [{
|
|
2419
2419
|
readonly contextProperty: "access";
|
|
@@ -2433,6 +2433,7 @@ declare const CAPABILITY_ROWS: readonly [{
|
|
|
2433
2433
|
readonly key: "ai";
|
|
2434
2434
|
readonly moduleSpecifier: "@lunora/ai";
|
|
2435
2435
|
readonly requiredPackage: "@lunora/ai";
|
|
2436
|
+
readonly serverCtxField: "\n readonly ai: import(\"@lunora/ai\").LunoraAi;";
|
|
2436
2437
|
readonly shardBinding: "bespoke";
|
|
2437
2438
|
readonly tier: "action";
|
|
2438
2439
|
}, {
|
|
@@ -2451,7 +2452,7 @@ declare const CAPABILITY_ROWS: readonly [{
|
|
|
2451
2452
|
readonly envName: "AI_SEARCH";
|
|
2452
2453
|
};
|
|
2453
2454
|
readonly clientType: "AiSearch";
|
|
2454
|
-
readonly missingMessage: "ctx.aiSearch: no AI Search binding found. Add an
|
|
2455
|
+
readonly missingMessage: "ctx.aiSearch: no AI Search binding found. Add an `ai_search_namespaces` binding (env.AI_SEARCH) to wrangler.jsonc, or point `defineApp().aiSearch((env) => …)` at yours.";
|
|
2455
2456
|
readonly stubMethods: readonly ["chatCompletions", "create", "delete", "get", "list", "search"];
|
|
2456
2457
|
readonly syncStubMethods: readonly ["get"];
|
|
2457
2458
|
};
|
|
@@ -2476,11 +2477,36 @@ declare const CAPABILITY_ROWS: readonly [{
|
|
|
2476
2477
|
};
|
|
2477
2478
|
};
|
|
2478
2479
|
readonly clientType: "AnalyticsClient";
|
|
2479
|
-
readonly missingMessage: "ctx.analytics: no Analytics Engine binding found. Add an
|
|
2480
|
+
readonly missingMessage: "ctx.analytics: no Analytics Engine binding found. Add an `analytics_engine_datasets` binding (env.ANALYTICS) to wrangler.jsonc, or pass `analytics` to createShardDO().";
|
|
2480
2481
|
readonly stubMethods: readonly ["track", "writeDataPoint"];
|
|
2481
2482
|
readonly syncStubMethods: readonly ["track", "writeDataPoint"];
|
|
2482
2483
|
};
|
|
2483
2484
|
readonly tier: "every";
|
|
2485
|
+
}, {
|
|
2486
|
+
readonly appMethod: {
|
|
2487
|
+
readonly configKey: "analyticsSql";
|
|
2488
|
+
readonly 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.";
|
|
2489
|
+
readonly method: "analyticsSql";
|
|
2490
|
+
};
|
|
2491
|
+
readonly contextProperty: "analyticsSql";
|
|
2492
|
+
readonly key: "analyticsSql";
|
|
2493
|
+
readonly moduleSpecifier: "@lunora/bindings/analytics-sql";
|
|
2494
|
+
readonly requiredPackage: "@lunora/bindings";
|
|
2495
|
+
readonly serverCtxField: "\n /** 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. */\n readonly analyticsSql: import(\"@lunora/bindings/analytics-sql\").AnalyticsSql;";
|
|
2496
|
+
readonly shardBinding: {
|
|
2497
|
+
readonly binding: {
|
|
2498
|
+
readonly bindingType: "AnalyticsSqlBindingLike";
|
|
2499
|
+
readonly envName: "ANALYTICS_SQL";
|
|
2500
|
+
readonly factory: {
|
|
2501
|
+
readonly name: "createAnalyticsSql";
|
|
2502
|
+
readonly option: "binding";
|
|
2503
|
+
};
|
|
2504
|
+
};
|
|
2505
|
+
readonly clientType: "AnalyticsSql";
|
|
2506
|
+
readonly 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 })).";
|
|
2507
|
+
readonly stubMethods: readonly ["query"];
|
|
2508
|
+
};
|
|
2509
|
+
readonly tier: "action";
|
|
2484
2510
|
}, {
|
|
2485
2511
|
readonly appMethod: {
|
|
2486
2512
|
readonly configKey: "artifacts";
|
|
@@ -2502,7 +2528,7 @@ declare const CAPABILITY_ROWS: readonly [{
|
|
|
2502
2528
|
};
|
|
2503
2529
|
};
|
|
2504
2530
|
readonly clientType: "ArtifactsClient";
|
|
2505
|
-
readonly missingMessage: "ctx.artifacts: no Artifacts binding found. Add an
|
|
2531
|
+
readonly 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>).";
|
|
2506
2532
|
readonly stubMethods: readonly ["authenticatedRemote", "create", "delete", "import", "info", "list", "withRepo"];
|
|
2507
2533
|
readonly syncStubMethods: readonly ["authenticatedRemote"];
|
|
2508
2534
|
};
|
|
@@ -2520,7 +2546,7 @@ declare const CAPABILITY_ROWS: readonly [{
|
|
|
2520
2546
|
readonly serverCtxField: "\n /** Browser Rendering (screenshots/PDF/scrape). Non-deterministic — available only in actions. */\n readonly browser: import(\"@lunora/browser\").Browser;";
|
|
2521
2547
|
readonly shardBinding: {
|
|
2522
2548
|
readonly clientType: "Browser";
|
|
2523
|
-
readonly missingMessage: "ctx.browser: provide a
|
|
2549
|
+
readonly missingMessage: "ctx.browser: provide a `browser` config thunk, e.g. `browser: (env) => createBrowser({ binding: env.BROWSER, launch })` with `import { launch } from '@cloudflare/playwright'`. Session reuse (connect/sessions) additionally needs those two exports passed the same way.";
|
|
2524
2550
|
readonly stubMethods: readonly ["cancelCrawl", "connect", "content", "crawl", "crawlResult", "launch", "pdf", "quickAction", "scrape", "screenshot", "sessions"];
|
|
2525
2551
|
};
|
|
2526
2552
|
readonly tier: "action";
|
|
@@ -2545,7 +2571,7 @@ declare const CAPABILITY_ROWS: readonly [{
|
|
|
2545
2571
|
readonly serverCtxField: "\n /**\n * 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.\n */\n readonly sql: import(\"@lunora/hyperdrive\").SqlClient;";
|
|
2546
2572
|
readonly shardBinding: {
|
|
2547
2573
|
readonly clientType: "SqlClient";
|
|
2548
|
-
readonly missingMessage: "ctx.sql: provide a
|
|
2574
|
+
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))`.";
|
|
2549
2575
|
readonly stubMethods: readonly ["query"];
|
|
2550
2576
|
};
|
|
2551
2577
|
readonly tier: "action";
|
|
@@ -2570,7 +2596,7 @@ declare const CAPABILITY_ROWS: readonly [{
|
|
|
2570
2596
|
};
|
|
2571
2597
|
};
|
|
2572
2598
|
readonly clientType: "Images";
|
|
2573
|
-
readonly missingMessage: "ctx.images: no Images binding found. Add an
|
|
2599
|
+
readonly missingMessage: "ctx.images: no Images binding found. Add an `images` binding (env.IMAGES) to wrangler.jsonc, or pass `images` to createShardDO().";
|
|
2574
2600
|
readonly stubMethods: readonly ["info", "transform"];
|
|
2575
2601
|
};
|
|
2576
2602
|
readonly tier: "action";
|
|
@@ -2596,7 +2622,7 @@ declare const CAPABILITY_ROWS: readonly [{
|
|
|
2596
2622
|
readonly unvouchableReads: readonly ["get", "getRaw", "getWithMetadata", "list"];
|
|
2597
2623
|
};
|
|
2598
2624
|
readonly clientType: "Kv";
|
|
2599
|
-
readonly missingMessage: "ctx.kv: no KV binding found. Add a
|
|
2625
|
+
readonly missingMessage: "ctx.kv: no KV binding found. Add a `kv_namespaces` binding (env.KV) to wrangler.jsonc, or pass `kv` to createShardDO().";
|
|
2600
2626
|
readonly stubMethods: readonly ["delete", "get", "getRaw", "getWithMetadata", "list", "put"];
|
|
2601
2627
|
};
|
|
2602
2628
|
readonly tier: "every";
|
|
@@ -2627,6 +2653,9 @@ declare const CAPABILITY_ROWS: readonly [{
|
|
|
2627
2653
|
readonly key: "x402";
|
|
2628
2654
|
readonly moduleSpecifier: "@lunora/x402/pay";
|
|
2629
2655
|
readonly requiredPackage: "@lunora/x402";
|
|
2656
|
+
readonly serverCtxField: "\n readonly x402: import(\"@lunora/x402/pay\").X402Pay;";
|
|
2657
|
+
readonly shardBinding: "bespoke";
|
|
2658
|
+
readonly tier: "action";
|
|
2630
2659
|
}, {
|
|
2631
2660
|
readonly contextProperty: "pipelines";
|
|
2632
2661
|
readonly key: "pipelines";
|
|
@@ -2643,7 +2672,7 @@ declare const CAPABILITY_ROWS: readonly [{
|
|
|
2643
2672
|
};
|
|
2644
2673
|
};
|
|
2645
2674
|
readonly clientType: "PipelineClient";
|
|
2646
|
-
readonly missingMessage: "ctx.pipelines: no Pipelines binding found. Add a
|
|
2675
|
+
readonly missingMessage: "ctx.pipelines: no Pipelines binding found. Add a `pipelines` binding (env.PIPELINES) to wrangler.jsonc, or pass `pipelines` to createShardDO().";
|
|
2647
2676
|
readonly stubMethods: readonly ["send"];
|
|
2648
2677
|
};
|
|
2649
2678
|
readonly tier: "action";
|
|
@@ -2669,11 +2698,6 @@ declare const CAPABILITY_ROWS: readonly [{
|
|
|
2669
2698
|
readonly key: "storage";
|
|
2670
2699
|
readonly moduleSpecifier: "@lunora/storage";
|
|
2671
2700
|
}, {
|
|
2672
|
-
readonly appMethod: {
|
|
2673
|
-
readonly configKey: "vectors";
|
|
2674
|
-
readonly doc: "Wire the Vectorize index map backing `ctx.vectors`.";
|
|
2675
|
-
readonly method: "vectors";
|
|
2676
|
-
};
|
|
2677
2701
|
readonly contextProperty: "vectors";
|
|
2678
2702
|
readonly key: "vectors";
|
|
2679
2703
|
readonly moduleSpecifier: "@lunora/bindings/vectors";
|
|
@@ -2685,50 +2709,30 @@ declare const CAPABILITY_ROWS: readonly [{
|
|
|
2685
2709
|
/** The literal union of every capability id — the single source of truth for `FeatureUsage`'s keys (so they cannot drift). */
|
|
2686
2710
|
type CapabilityKey = (typeof CAPABILITY_ROWS)[number]["key"];
|
|
2687
2711
|
/**
|
|
2688
|
-
*
|
|
2689
|
-
*
|
|
2690
|
-
* the
|
|
2691
|
-
*
|
|
2692
|
-
* `discoverAiUsage` / `discoverPaymentUsage` probes (which were line-for-line
|
|
2693
|
-
* copies of this same import-or-`ctx.X` check).
|
|
2694
|
-
*
|
|
2695
|
-
* The key set is derived from the {@link CAPABILITIES} table (its
|
|
2696
|
-
* {@link CapabilityKey} union), so a capability added there is automatically
|
|
2697
|
-
* probed here — the two can't drift. `ai` and `payments` gate whether codegen
|
|
2698
|
-
* wires the SDK into the generated worker (so a non-AI app never imports
|
|
2699
|
-
* `@lunora/ai`); the rest additionally feed the studio's nav gating via
|
|
2700
|
-
* `buildStudioFeatures`. `mail` is import-only — it has no `ctx.mail`
|
|
2701
|
-
* helper (mail is reached through its own client), so only a `@lunora/mail`
|
|
2702
|
-
* import flips it here; a worker-entry wiring outside `lunora/` is caught
|
|
2703
|
-
* instead by the package-dependency signal in `buildStudioFeatures`.
|
|
2704
|
-
*/
|
|
2705
|
-
type FeatureUsage = Record<CapabilityKey, boolean>;
|
|
2706
|
-
/**
|
|
2707
|
-
* The set of `ctx` helper names the source reaches — a direct `ctx.PROPERTY`
|
|
2708
|
-
* access, or a destructuring of the property off the context (`const { kv } =
|
|
2709
|
-
* ctx`, `async ({ ctx: { kv } }) => …`).
|
|
2710
|
-
*
|
|
2711
|
-
* The context is resolved by BINDING, not by the identifier text `ctx`. A
|
|
2712
|
-
* handler receives it as a property of one destructured argument, so the local
|
|
2713
|
-
* name it lands under is the handler's to pick: `{ ctx }`, `{ ctx: context }`
|
|
2714
|
-
* and `{ ctx: { secrets } }` are the same read. Matching the text `ctx`
|
|
2715
|
-
* recognised only the first — and for `secrets`, which has no import arm and no
|
|
2716
|
-
* {@link CAPABILITIES} row, nothing else covered the other two, so a renamed or
|
|
2717
|
-
* destructured read built green on a host that rates the Secrets Store
|
|
2718
|
-
* unsupported and threw on first use.
|
|
2719
|
-
*
|
|
2720
|
-
* Three descendant walks (bindings, then accesses and `const … = ctx` patterns),
|
|
2721
|
-
* collected once per file: each context-bearing {@link CAPABILITIES} entry then
|
|
2722
|
-
* just tests membership in this set, so detection is O(files × nodes) rather
|
|
2723
|
-
* than O(files × features × nodes).
|
|
2712
|
+
* The usage-probe facets of every row, read-only — the view a consumer outside
|
|
2713
|
+
* codegen keys its own capability detection off (`@lunora/config`'s binding
|
|
2714
|
+
* inference), so the two cannot disagree on which import or `ctx.<property>`
|
|
2715
|
+
* read marks a capability used.
|
|
2724
2716
|
*/
|
|
2725
|
-
declare const
|
|
2717
|
+
declare const CAPABILITY_PROBES: ReadonlyArray<{
|
|
2718
|
+
readonly contextProperty: string | undefined;
|
|
2719
|
+
readonly key: CapabilityKey;
|
|
2720
|
+
readonly moduleSpecifier: string;
|
|
2721
|
+
}>;
|
|
2722
|
+
/** The two per-file signals the capability probe reads. */
|
|
2723
|
+
interface SourceCapabilitySignals {
|
|
2724
|
+
/** The `ctx` helper names the file reads — see {@link contextPropertiesRead}. */
|
|
2725
|
+
contextReads: ReadonlySet<string>;
|
|
2726
|
+
/** Module specifiers of the file's static imports that survive compilation (type-only ones dropped — see {@link isTypeOnlyImport}). */
|
|
2727
|
+
valueImports: ReadonlySet<string>;
|
|
2728
|
+
}
|
|
2726
2729
|
/**
|
|
2727
|
-
*
|
|
2728
|
-
*
|
|
2729
|
-
* `
|
|
2730
|
+
* The capability signals of one source file: its value-import specifiers and its
|
|
2731
|
+
* `ctx.<property>` reads. The single reading behind codegen's usage probe —
|
|
2732
|
+
* exported so `@lunora/config`'s binding inference marks a capability used on
|
|
2733
|
+
* exactly the same imports and reads (matched against `CAPABILITY_PROBES`).
|
|
2730
2734
|
*/
|
|
2731
|
-
declare const
|
|
2735
|
+
declare const sourceCapabilitySignals: (sourceFile: SourceFile) => SourceCapabilitySignals;
|
|
2732
2736
|
/** The default codegen target — today's behavior, byte-identical goldens. */
|
|
2733
2737
|
declare const DEFAULT_TARGET = "cloudflare";
|
|
2734
2738
|
/**
|
|
@@ -3527,8 +3531,8 @@ interface EmitServerOptions {
|
|
|
3527
3531
|
/**
|
|
3528
3532
|
* The package-backed capabilities the app uses (post platform gate). Each
|
|
3529
3533
|
* used row of the `CAPABILITIES` table with a `serverCtxField` lands on the
|
|
3530
|
-
* ctx interfaces its `tier` names; `
|
|
3531
|
-
*
|
|
3534
|
+
* ctx interfaces its `tier` names; `payments` gates its bespoke ActionCtx
|
|
3535
|
+
* field, and `ai` the `env.AI` binding field, off the same set.
|
|
3532
3536
|
*/
|
|
3533
3537
|
capabilities?: ReadonlySet<CapabilityKey>;
|
|
3534
3538
|
containers?: ReadonlyArray<ContainerIR>;
|
|
@@ -3662,8 +3666,8 @@ interface EmitAppOptions {
|
|
|
3662
3666
|
* `defineApp` method (`.ai()`, `.kv()`, `.payment()`, …), which sets the
|
|
3663
3667
|
* matching `createShardDO` config key. Usage-driven on purpose: each method's
|
|
3664
3668
|
* parameter reads `ShardConfig[configKey]`, and the shard emits that config
|
|
3665
|
-
* field on the same usage signal.
|
|
3666
|
-
*
|
|
3669
|
+
* field on the same usage signal. `.vectors()` is not among them — it is
|
|
3670
|
+
* declaration-gated on {@link EmitAppOptions.hasVectors} + `vectorIndexCount`.
|
|
3667
3671
|
*/
|
|
3668
3672
|
capabilities: ReadonlySet<CapabilityKey>;
|
|
3669
3673
|
/**
|
|
@@ -4431,4 +4435,4 @@ declare const secretKindOf: (value: string) => string | undefined;
|
|
|
4431
4435
|
/** A redacted preview of a secret value — first 4 chars plus its length, never the full value. */
|
|
4432
4436
|
declare const redact: (value: string) => string;
|
|
4433
4437
|
declare const VERSION = "0.0.0";
|
|
4434
|
-
export { AGENTS_FILENAME, type AgentIR, type AuthApiCallIR, CONTAINERS_FILENAME, CodegenDiagnosticError, type CodegenOptions, type CodegenResult, type ContainerIR, type ContainerImageIR, type ContainerNamedImageIR, type ContextPropertyCallIR, type CronJobIR, DEFAULT_TARGET, type DefaultScheduledContainerIR, type DriftChange, type DriftRemediation, type DriftScope, type DurableObjectScheduledContainerIR, type EmitAppOptions, FLAGS_FILENAME, type
|
|
4438
|
+
export { AGENTS_FILENAME, type AgentIR, type AuthApiCallIR, CAPABILITY_PROBES, CONTAINERS_FILENAME, type CapabilityKey, CodegenDiagnosticError, type CodegenOptions, type CodegenResult, type ContainerIR, type ContainerImageIR, type ContainerNamedImageIR, type ContextPropertyCallIR, type CronJobIR, DEFAULT_TARGET, type DefaultScheduledContainerIR, type DriftChange, type DriftRemediation, type DriftScope, type DurableObjectScheduledContainerIR, type EmitAppOptions, FLAGS_FILENAME, type FieldSnapshot, type FlagsIR, type FunctionIR, GENERATED_HEADER, type HttpRouteIR, type IndexIR, type IndexSnapshot, type InsertWriteIR, LUNORA_ERROR_CODES, type LintSchemaOptions, type LoadedProjectConfig, type LunoraProjectConfig, MUTATORS_FILENAME, type MaskProcedureIR, type MigrationIR, type MutatorIR, NOTIFY_FILENAME, OPENRPC_VERSION, type OpenApiEmitInput, type OpenRpcDocument, type OpenRpcEmitInput, type OpenRpcMethod, PROJECT_CONFIG_FILENAMES, type PlatformDiagnostic, type ProjectConfigLiterals, type ProjectIR, QUEUES_FILENAME, type QueryReadIR, type QueueIR, type RelationSnapshot, type RlsMetadataIR, type RlsPolicyIR, type RlsProcedureIR, type RlsRoleIR, type RuntimeVerb, SCHEMA_SNAPSHOT_FILENAME, SCHEMA_SNAPSHOT_VERSION, SDK_LANGUAGES, SDK_TARGETS, SHAPES_FILENAME, type SandboxUsage, type SchemaDrift, type SchemaDriftDecision, type SchemaIR, type SchemaSnapshot, SchemaSnapshotParseError, type SdkFiles, type SdkMethod, type SdkNamespace, type SdkRenderInput, type SdkResult, type SdkTarget, type ServiceBindingIR, type ServiceLiteral, type ShapeIR, type SourceCapabilitySignals, type StorageRuleIR, type StorageRulesMetadataIR, type TableIR, type TableSnapshot, type TopicIR, VERSION, type ValidatorIR, type VectorIndexIR, WORKFLOWS_FILENAME, type WorkflowIR, type WranglerVariableIR, buildOpenApiDocument, buildOpenRpcDocument, buildSchemaSnapshot, createCodegenProject, describeErrorLevelFindings, diagnosticAt, diffSchemaSnapshots, discoverAgents, discoverAuthApiCalls, discoverContainers, discoverCrons, discoverFlags, discoverFunctions, discoverHttpRoutes, discoverHyperdriveCalls, discoverInserts, discoverMaskProcedures, discoverMigrations, discoverMutators, discoverNondeterministicCalls, discoverNotifyCalls, discoverNotifyConfig, discoverQueries, discoverQueues, discoverR2sqlCalls, discoverRlsMetadata, discoverRlsProcedures, discoverSandboxUsage, discoverSchema, discoverShapes, discoverStorageRulesMetadata, discoverWorkflows, emitAgents, emitApi, emitApp, emitCollections, emitContainers, emitCrons, emitDataModel, emitDrizzleSchema, emitFunctions, emitOpenApi, emitOpenApiModule, emitOpenRpc, emitOpenRpcModule, emitScheduler, emitServer, emitShard, emitVectors, emitWorkflows, emitWranglerCronTriggers, errorAdvisoryNames, errorPlatformDiagnosticNames, evaluateSchemaDrift, findProjectConfigFile, findTsconfig, fingerprintSchemaSources, formatAdvisories, generateSdk, isD1GlobalTable, isHyperdriveGlobalTable, isTypedSchema, lintSchema, listLunoraSourceFiles, loadProjectConfig, parseSchemaSnapshot, platformMatrixIds, readPackageDependencies, readProjectConfigLiterals, readProjectTarget, readServiceBindings, redact, refreshCodegenProject, resolveCodegenTarget, resolveServiceBindings, runCodegen, schemaFromIr, secretKindOf, serializeSchemaSnapshot, sortedUniqueNames, sourceCapabilitySignals, toAdvisorContext, validatorIrToJsonSchema };
|
package/dist/index.d.ts
CHANGED
|
@@ -2411,9 +2411,9 @@ declare const formatAdvisories: (findings: ReadonlyArray<Finding>) => string;
|
|
|
2411
2411
|
/**
|
|
2412
2412
|
* The canonical capability list. **Order is load-bearing** — every consumer
|
|
2413
2413
|
* emits in row order (see the module doc). The `appMethod` rows reproduce the
|
|
2414
|
-
* original `LONG_TAIL` builder sequence (ai, aiSearch, analytics, artifacts, browser,
|
|
2415
|
-
* images, kv, payment, x402, r2sql
|
|
2416
|
-
* `ctx.*` fields and the ShardDO wiring.
|
|
2414
|
+
* original `LONG_TAIL` builder sequence (ai, aiSearch, analytics, analyticsSql, artifacts, browser,
|
|
2415
|
+
* hyperdrive, images, kv, payment, x402, r2sql — `.vectors()` follows them, emitted off the
|
|
2416
|
+
* declaration), and the same order places the `ctx.*` fields and the ShardDO wiring.
|
|
2417
2417
|
*/
|
|
2418
2418
|
declare const CAPABILITY_ROWS: readonly [{
|
|
2419
2419
|
readonly contextProperty: "access";
|
|
@@ -2433,6 +2433,7 @@ declare const CAPABILITY_ROWS: readonly [{
|
|
|
2433
2433
|
readonly key: "ai";
|
|
2434
2434
|
readonly moduleSpecifier: "@lunora/ai";
|
|
2435
2435
|
readonly requiredPackage: "@lunora/ai";
|
|
2436
|
+
readonly serverCtxField: "\n readonly ai: import(\"@lunora/ai\").LunoraAi;";
|
|
2436
2437
|
readonly shardBinding: "bespoke";
|
|
2437
2438
|
readonly tier: "action";
|
|
2438
2439
|
}, {
|
|
@@ -2451,7 +2452,7 @@ declare const CAPABILITY_ROWS: readonly [{
|
|
|
2451
2452
|
readonly envName: "AI_SEARCH";
|
|
2452
2453
|
};
|
|
2453
2454
|
readonly clientType: "AiSearch";
|
|
2454
|
-
readonly missingMessage: "ctx.aiSearch: no AI Search binding found. Add an
|
|
2455
|
+
readonly missingMessage: "ctx.aiSearch: no AI Search binding found. Add an `ai_search_namespaces` binding (env.AI_SEARCH) to wrangler.jsonc, or point `defineApp().aiSearch((env) => …)` at yours.";
|
|
2455
2456
|
readonly stubMethods: readonly ["chatCompletions", "create", "delete", "get", "list", "search"];
|
|
2456
2457
|
readonly syncStubMethods: readonly ["get"];
|
|
2457
2458
|
};
|
|
@@ -2476,11 +2477,36 @@ declare const CAPABILITY_ROWS: readonly [{
|
|
|
2476
2477
|
};
|
|
2477
2478
|
};
|
|
2478
2479
|
readonly clientType: "AnalyticsClient";
|
|
2479
|
-
readonly missingMessage: "ctx.analytics: no Analytics Engine binding found. Add an
|
|
2480
|
+
readonly missingMessage: "ctx.analytics: no Analytics Engine binding found. Add an `analytics_engine_datasets` binding (env.ANALYTICS) to wrangler.jsonc, or pass `analytics` to createShardDO().";
|
|
2480
2481
|
readonly stubMethods: readonly ["track", "writeDataPoint"];
|
|
2481
2482
|
readonly syncStubMethods: readonly ["track", "writeDataPoint"];
|
|
2482
2483
|
};
|
|
2483
2484
|
readonly tier: "every";
|
|
2485
|
+
}, {
|
|
2486
|
+
readonly appMethod: {
|
|
2487
|
+
readonly configKey: "analyticsSql";
|
|
2488
|
+
readonly 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.";
|
|
2489
|
+
readonly method: "analyticsSql";
|
|
2490
|
+
};
|
|
2491
|
+
readonly contextProperty: "analyticsSql";
|
|
2492
|
+
readonly key: "analyticsSql";
|
|
2493
|
+
readonly moduleSpecifier: "@lunora/bindings/analytics-sql";
|
|
2494
|
+
readonly requiredPackage: "@lunora/bindings";
|
|
2495
|
+
readonly serverCtxField: "\n /** 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. */\n readonly analyticsSql: import(\"@lunora/bindings/analytics-sql\").AnalyticsSql;";
|
|
2496
|
+
readonly shardBinding: {
|
|
2497
|
+
readonly binding: {
|
|
2498
|
+
readonly bindingType: "AnalyticsSqlBindingLike";
|
|
2499
|
+
readonly envName: "ANALYTICS_SQL";
|
|
2500
|
+
readonly factory: {
|
|
2501
|
+
readonly name: "createAnalyticsSql";
|
|
2502
|
+
readonly option: "binding";
|
|
2503
|
+
};
|
|
2504
|
+
};
|
|
2505
|
+
readonly clientType: "AnalyticsSql";
|
|
2506
|
+
readonly 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 })).";
|
|
2507
|
+
readonly stubMethods: readonly ["query"];
|
|
2508
|
+
};
|
|
2509
|
+
readonly tier: "action";
|
|
2484
2510
|
}, {
|
|
2485
2511
|
readonly appMethod: {
|
|
2486
2512
|
readonly configKey: "artifacts";
|
|
@@ -2502,7 +2528,7 @@ declare const CAPABILITY_ROWS: readonly [{
|
|
|
2502
2528
|
};
|
|
2503
2529
|
};
|
|
2504
2530
|
readonly clientType: "ArtifactsClient";
|
|
2505
|
-
readonly missingMessage: "ctx.artifacts: no Artifacts binding found. Add an
|
|
2531
|
+
readonly 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>).";
|
|
2506
2532
|
readonly stubMethods: readonly ["authenticatedRemote", "create", "delete", "import", "info", "list", "withRepo"];
|
|
2507
2533
|
readonly syncStubMethods: readonly ["authenticatedRemote"];
|
|
2508
2534
|
};
|
|
@@ -2520,7 +2546,7 @@ declare const CAPABILITY_ROWS: readonly [{
|
|
|
2520
2546
|
readonly serverCtxField: "\n /** Browser Rendering (screenshots/PDF/scrape). Non-deterministic — available only in actions. */\n readonly browser: import(\"@lunora/browser\").Browser;";
|
|
2521
2547
|
readonly shardBinding: {
|
|
2522
2548
|
readonly clientType: "Browser";
|
|
2523
|
-
readonly missingMessage: "ctx.browser: provide a
|
|
2549
|
+
readonly missingMessage: "ctx.browser: provide a `browser` config thunk, e.g. `browser: (env) => createBrowser({ binding: env.BROWSER, launch })` with `import { launch } from '@cloudflare/playwright'`. Session reuse (connect/sessions) additionally needs those two exports passed the same way.";
|
|
2524
2550
|
readonly stubMethods: readonly ["cancelCrawl", "connect", "content", "crawl", "crawlResult", "launch", "pdf", "quickAction", "scrape", "screenshot", "sessions"];
|
|
2525
2551
|
};
|
|
2526
2552
|
readonly tier: "action";
|
|
@@ -2545,7 +2571,7 @@ declare const CAPABILITY_ROWS: readonly [{
|
|
|
2545
2571
|
readonly serverCtxField: "\n /**\n * 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.\n */\n readonly sql: import(\"@lunora/hyperdrive\").SqlClient;";
|
|
2546
2572
|
readonly shardBinding: {
|
|
2547
2573
|
readonly clientType: "SqlClient";
|
|
2548
|
-
readonly missingMessage: "ctx.sql: provide a
|
|
2574
|
+
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))`.";
|
|
2549
2575
|
readonly stubMethods: readonly ["query"];
|
|
2550
2576
|
};
|
|
2551
2577
|
readonly tier: "action";
|
|
@@ -2570,7 +2596,7 @@ declare const CAPABILITY_ROWS: readonly [{
|
|
|
2570
2596
|
};
|
|
2571
2597
|
};
|
|
2572
2598
|
readonly clientType: "Images";
|
|
2573
|
-
readonly missingMessage: "ctx.images: no Images binding found. Add an
|
|
2599
|
+
readonly missingMessage: "ctx.images: no Images binding found. Add an `images` binding (env.IMAGES) to wrangler.jsonc, or pass `images` to createShardDO().";
|
|
2574
2600
|
readonly stubMethods: readonly ["info", "transform"];
|
|
2575
2601
|
};
|
|
2576
2602
|
readonly tier: "action";
|
|
@@ -2596,7 +2622,7 @@ declare const CAPABILITY_ROWS: readonly [{
|
|
|
2596
2622
|
readonly unvouchableReads: readonly ["get", "getRaw", "getWithMetadata", "list"];
|
|
2597
2623
|
};
|
|
2598
2624
|
readonly clientType: "Kv";
|
|
2599
|
-
readonly missingMessage: "ctx.kv: no KV binding found. Add a
|
|
2625
|
+
readonly missingMessage: "ctx.kv: no KV binding found. Add a `kv_namespaces` binding (env.KV) to wrangler.jsonc, or pass `kv` to createShardDO().";
|
|
2600
2626
|
readonly stubMethods: readonly ["delete", "get", "getRaw", "getWithMetadata", "list", "put"];
|
|
2601
2627
|
};
|
|
2602
2628
|
readonly tier: "every";
|
|
@@ -2627,6 +2653,9 @@ declare const CAPABILITY_ROWS: readonly [{
|
|
|
2627
2653
|
readonly key: "x402";
|
|
2628
2654
|
readonly moduleSpecifier: "@lunora/x402/pay";
|
|
2629
2655
|
readonly requiredPackage: "@lunora/x402";
|
|
2656
|
+
readonly serverCtxField: "\n readonly x402: import(\"@lunora/x402/pay\").X402Pay;";
|
|
2657
|
+
readonly shardBinding: "bespoke";
|
|
2658
|
+
readonly tier: "action";
|
|
2630
2659
|
}, {
|
|
2631
2660
|
readonly contextProperty: "pipelines";
|
|
2632
2661
|
readonly key: "pipelines";
|
|
@@ -2643,7 +2672,7 @@ declare const CAPABILITY_ROWS: readonly [{
|
|
|
2643
2672
|
};
|
|
2644
2673
|
};
|
|
2645
2674
|
readonly clientType: "PipelineClient";
|
|
2646
|
-
readonly missingMessage: "ctx.pipelines: no Pipelines binding found. Add a
|
|
2675
|
+
readonly missingMessage: "ctx.pipelines: no Pipelines binding found. Add a `pipelines` binding (env.PIPELINES) to wrangler.jsonc, or pass `pipelines` to createShardDO().";
|
|
2647
2676
|
readonly stubMethods: readonly ["send"];
|
|
2648
2677
|
};
|
|
2649
2678
|
readonly tier: "action";
|
|
@@ -2669,11 +2698,6 @@ declare const CAPABILITY_ROWS: readonly [{
|
|
|
2669
2698
|
readonly key: "storage";
|
|
2670
2699
|
readonly moduleSpecifier: "@lunora/storage";
|
|
2671
2700
|
}, {
|
|
2672
|
-
readonly appMethod: {
|
|
2673
|
-
readonly configKey: "vectors";
|
|
2674
|
-
readonly doc: "Wire the Vectorize index map backing `ctx.vectors`.";
|
|
2675
|
-
readonly method: "vectors";
|
|
2676
|
-
};
|
|
2677
2701
|
readonly contextProperty: "vectors";
|
|
2678
2702
|
readonly key: "vectors";
|
|
2679
2703
|
readonly moduleSpecifier: "@lunora/bindings/vectors";
|
|
@@ -2685,50 +2709,30 @@ declare const CAPABILITY_ROWS: readonly [{
|
|
|
2685
2709
|
/** The literal union of every capability id — the single source of truth for `FeatureUsage`'s keys (so they cannot drift). */
|
|
2686
2710
|
type CapabilityKey = (typeof CAPABILITY_ROWS)[number]["key"];
|
|
2687
2711
|
/**
|
|
2688
|
-
*
|
|
2689
|
-
*
|
|
2690
|
-
* the
|
|
2691
|
-
*
|
|
2692
|
-
* `discoverAiUsage` / `discoverPaymentUsage` probes (which were line-for-line
|
|
2693
|
-
* copies of this same import-or-`ctx.X` check).
|
|
2694
|
-
*
|
|
2695
|
-
* The key set is derived from the {@link CAPABILITIES} table (its
|
|
2696
|
-
* {@link CapabilityKey} union), so a capability added there is automatically
|
|
2697
|
-
* probed here — the two can't drift. `ai` and `payments` gate whether codegen
|
|
2698
|
-
* wires the SDK into the generated worker (so a non-AI app never imports
|
|
2699
|
-
* `@lunora/ai`); the rest additionally feed the studio's nav gating via
|
|
2700
|
-
* `buildStudioFeatures`. `mail` is import-only — it has no `ctx.mail`
|
|
2701
|
-
* helper (mail is reached through its own client), so only a `@lunora/mail`
|
|
2702
|
-
* import flips it here; a worker-entry wiring outside `lunora/` is caught
|
|
2703
|
-
* instead by the package-dependency signal in `buildStudioFeatures`.
|
|
2704
|
-
*/
|
|
2705
|
-
type FeatureUsage = Record<CapabilityKey, boolean>;
|
|
2706
|
-
/**
|
|
2707
|
-
* The set of `ctx` helper names the source reaches — a direct `ctx.PROPERTY`
|
|
2708
|
-
* access, or a destructuring of the property off the context (`const { kv } =
|
|
2709
|
-
* ctx`, `async ({ ctx: { kv } }) => …`).
|
|
2710
|
-
*
|
|
2711
|
-
* The context is resolved by BINDING, not by the identifier text `ctx`. A
|
|
2712
|
-
* handler receives it as a property of one destructured argument, so the local
|
|
2713
|
-
* name it lands under is the handler's to pick: `{ ctx }`, `{ ctx: context }`
|
|
2714
|
-
* and `{ ctx: { secrets } }` are the same read. Matching the text `ctx`
|
|
2715
|
-
* recognised only the first — and for `secrets`, which has no import arm and no
|
|
2716
|
-
* {@link CAPABILITIES} row, nothing else covered the other two, so a renamed or
|
|
2717
|
-
* destructured read built green on a host that rates the Secrets Store
|
|
2718
|
-
* unsupported and threw on first use.
|
|
2719
|
-
*
|
|
2720
|
-
* Three descendant walks (bindings, then accesses and `const … = ctx` patterns),
|
|
2721
|
-
* collected once per file: each context-bearing {@link CAPABILITIES} entry then
|
|
2722
|
-
* just tests membership in this set, so detection is O(files × nodes) rather
|
|
2723
|
-
* than O(files × features × nodes).
|
|
2712
|
+
* The usage-probe facets of every row, read-only — the view a consumer outside
|
|
2713
|
+
* codegen keys its own capability detection off (`@lunora/config`'s binding
|
|
2714
|
+
* inference), so the two cannot disagree on which import or `ctx.<property>`
|
|
2715
|
+
* read marks a capability used.
|
|
2724
2716
|
*/
|
|
2725
|
-
declare const
|
|
2717
|
+
declare const CAPABILITY_PROBES: ReadonlyArray<{
|
|
2718
|
+
readonly contextProperty: string | undefined;
|
|
2719
|
+
readonly key: CapabilityKey;
|
|
2720
|
+
readonly moduleSpecifier: string;
|
|
2721
|
+
}>;
|
|
2722
|
+
/** The two per-file signals the capability probe reads. */
|
|
2723
|
+
interface SourceCapabilitySignals {
|
|
2724
|
+
/** The `ctx` helper names the file reads — see {@link contextPropertiesRead}. */
|
|
2725
|
+
contextReads: ReadonlySet<string>;
|
|
2726
|
+
/** Module specifiers of the file's static imports that survive compilation (type-only ones dropped — see {@link isTypeOnlyImport}). */
|
|
2727
|
+
valueImports: ReadonlySet<string>;
|
|
2728
|
+
}
|
|
2726
2729
|
/**
|
|
2727
|
-
*
|
|
2728
|
-
*
|
|
2729
|
-
* `
|
|
2730
|
+
* The capability signals of one source file: its value-import specifiers and its
|
|
2731
|
+
* `ctx.<property>` reads. The single reading behind codegen's usage probe —
|
|
2732
|
+
* exported so `@lunora/config`'s binding inference marks a capability used on
|
|
2733
|
+
* exactly the same imports and reads (matched against `CAPABILITY_PROBES`).
|
|
2730
2734
|
*/
|
|
2731
|
-
declare const
|
|
2735
|
+
declare const sourceCapabilitySignals: (sourceFile: SourceFile) => SourceCapabilitySignals;
|
|
2732
2736
|
/** The default codegen target — today's behavior, byte-identical goldens. */
|
|
2733
2737
|
declare const DEFAULT_TARGET = "cloudflare";
|
|
2734
2738
|
/**
|
|
@@ -3527,8 +3531,8 @@ interface EmitServerOptions {
|
|
|
3527
3531
|
/**
|
|
3528
3532
|
* The package-backed capabilities the app uses (post platform gate). Each
|
|
3529
3533
|
* used row of the `CAPABILITIES` table with a `serverCtxField` lands on the
|
|
3530
|
-
* ctx interfaces its `tier` names; `
|
|
3531
|
-
*
|
|
3534
|
+
* ctx interfaces its `tier` names; `payments` gates its bespoke ActionCtx
|
|
3535
|
+
* field, and `ai` the `env.AI` binding field, off the same set.
|
|
3532
3536
|
*/
|
|
3533
3537
|
capabilities?: ReadonlySet<CapabilityKey>;
|
|
3534
3538
|
containers?: ReadonlyArray<ContainerIR>;
|
|
@@ -3662,8 +3666,8 @@ interface EmitAppOptions {
|
|
|
3662
3666
|
* `defineApp` method (`.ai()`, `.kv()`, `.payment()`, …), which sets the
|
|
3663
3667
|
* matching `createShardDO` config key. Usage-driven on purpose: each method's
|
|
3664
3668
|
* parameter reads `ShardConfig[configKey]`, and the shard emits that config
|
|
3665
|
-
* field on the same usage signal.
|
|
3666
|
-
*
|
|
3669
|
+
* field on the same usage signal. `.vectors()` is not among them — it is
|
|
3670
|
+
* declaration-gated on {@link EmitAppOptions.hasVectors} + `vectorIndexCount`.
|
|
3667
3671
|
*/
|
|
3668
3672
|
capabilities: ReadonlySet<CapabilityKey>;
|
|
3669
3673
|
/**
|
|
@@ -4431,4 +4435,4 @@ declare const secretKindOf: (value: string) => string | undefined;
|
|
|
4431
4435
|
/** A redacted preview of a secret value — first 4 chars plus its length, never the full value. */
|
|
4432
4436
|
declare const redact: (value: string) => string;
|
|
4433
4437
|
declare const VERSION = "0.0.0";
|
|
4434
|
-
export { AGENTS_FILENAME, type AgentIR, type AuthApiCallIR, CONTAINERS_FILENAME, CodegenDiagnosticError, type CodegenOptions, type CodegenResult, type ContainerIR, type ContainerImageIR, type ContainerNamedImageIR, type ContextPropertyCallIR, type CronJobIR, DEFAULT_TARGET, type DefaultScheduledContainerIR, type DriftChange, type DriftRemediation, type DriftScope, type DurableObjectScheduledContainerIR, type EmitAppOptions, FLAGS_FILENAME, type
|
|
4438
|
+
export { AGENTS_FILENAME, type AgentIR, type AuthApiCallIR, CAPABILITY_PROBES, CONTAINERS_FILENAME, type CapabilityKey, CodegenDiagnosticError, type CodegenOptions, type CodegenResult, type ContainerIR, type ContainerImageIR, type ContainerNamedImageIR, type ContextPropertyCallIR, type CronJobIR, DEFAULT_TARGET, type DefaultScheduledContainerIR, type DriftChange, type DriftRemediation, type DriftScope, type DurableObjectScheduledContainerIR, type EmitAppOptions, FLAGS_FILENAME, type FieldSnapshot, type FlagsIR, type FunctionIR, GENERATED_HEADER, type HttpRouteIR, type IndexIR, type IndexSnapshot, type InsertWriteIR, LUNORA_ERROR_CODES, type LintSchemaOptions, type LoadedProjectConfig, type LunoraProjectConfig, MUTATORS_FILENAME, type MaskProcedureIR, type MigrationIR, type MutatorIR, NOTIFY_FILENAME, OPENRPC_VERSION, type OpenApiEmitInput, type OpenRpcDocument, type OpenRpcEmitInput, type OpenRpcMethod, PROJECT_CONFIG_FILENAMES, type PlatformDiagnostic, type ProjectConfigLiterals, type ProjectIR, QUEUES_FILENAME, type QueryReadIR, type QueueIR, type RelationSnapshot, type RlsMetadataIR, type RlsPolicyIR, type RlsProcedureIR, type RlsRoleIR, type RuntimeVerb, SCHEMA_SNAPSHOT_FILENAME, SCHEMA_SNAPSHOT_VERSION, SDK_LANGUAGES, SDK_TARGETS, SHAPES_FILENAME, type SandboxUsage, type SchemaDrift, type SchemaDriftDecision, type SchemaIR, type SchemaSnapshot, SchemaSnapshotParseError, type SdkFiles, type SdkMethod, type SdkNamespace, type SdkRenderInput, type SdkResult, type SdkTarget, type ServiceBindingIR, type ServiceLiteral, type ShapeIR, type SourceCapabilitySignals, type StorageRuleIR, type StorageRulesMetadataIR, type TableIR, type TableSnapshot, type TopicIR, VERSION, type ValidatorIR, type VectorIndexIR, WORKFLOWS_FILENAME, type WorkflowIR, type WranglerVariableIR, buildOpenApiDocument, buildOpenRpcDocument, buildSchemaSnapshot, createCodegenProject, describeErrorLevelFindings, diagnosticAt, diffSchemaSnapshots, discoverAgents, discoverAuthApiCalls, discoverContainers, discoverCrons, discoverFlags, discoverFunctions, discoverHttpRoutes, discoverHyperdriveCalls, discoverInserts, discoverMaskProcedures, discoverMigrations, discoverMutators, discoverNondeterministicCalls, discoverNotifyCalls, discoverNotifyConfig, discoverQueries, discoverQueues, discoverR2sqlCalls, discoverRlsMetadata, discoverRlsProcedures, discoverSandboxUsage, discoverSchema, discoverShapes, discoverStorageRulesMetadata, discoverWorkflows, emitAgents, emitApi, emitApp, emitCollections, emitContainers, emitCrons, emitDataModel, emitDrizzleSchema, emitFunctions, emitOpenApi, emitOpenApiModule, emitOpenRpc, emitOpenRpcModule, emitScheduler, emitServer, emitShard, emitVectors, emitWorkflows, emitWranglerCronTriggers, errorAdvisoryNames, errorPlatformDiagnosticNames, evaluateSchemaDrift, findProjectConfigFile, findTsconfig, fingerprintSchemaSources, formatAdvisories, generateSdk, isD1GlobalTable, isHyperdriveGlobalTable, isTypedSchema, lintSchema, listLunoraSourceFiles, loadProjectConfig, parseSchemaSnapshot, platformMatrixIds, readPackageDependencies, readProjectConfigLiterals, readProjectTarget, readServiceBindings, redact, refreshCodegenProject, resolveCodegenTarget, resolveServiceBindings, runCodegen, schemaFromIr, secretKindOf, serializeSchemaSnapshot, sortedUniqueNames, sourceCapabilitySignals, toAdvisorContext, validatorIrToJsonSchema };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SCHEMA_SNAPSHOT_VERSION as t,diffSchemaSnapshots as s,serializeSchemaSnapshot as a}from"./packem_shared/SCHEMA_SNAPSHOT_VERSION-C0oHwiJZ.mjs";import{formatAdvisories as m,lintSchema as f,toAdvisorContext as d}from"./packem_shared/formatAdvisories-DwmUKYuc.mjs";import{describeErrorLevelFindings as c,errorAdvisoryNames as n,errorPlatformDiagnosticNames as l,sortedUniqueNames as x}from"./packem_shared/describeErrorLevelFindings-vzaGS9KL.mjs";import{CodegenDiagnosticError as
|
|
1
|
+
import{SCHEMA_SNAPSHOT_VERSION as t,diffSchemaSnapshots as s,serializeSchemaSnapshot as a}from"./packem_shared/SCHEMA_SNAPSHOT_VERSION-C0oHwiJZ.mjs";import{formatAdvisories as m,lintSchema as f,toAdvisorContext as d}from"./packem_shared/formatAdvisories-DwmUKYuc.mjs";import{describeErrorLevelFindings as c,errorAdvisoryNames as n,errorPlatformDiagnosticNames as l,sortedUniqueNames as x}from"./packem_shared/describeErrorLevelFindings-vzaGS9KL.mjs";import{CAPABILITY_PROBES as E}from"./packem_shared/CAPABILITY_PROBES-LYIlPWT3.mjs";import{CodegenDiagnosticError as A,diagnosticAt as v}from"./packem_shared/CodegenDiagnosticError-BUXlG3P-.mjs";import{AGENTS_FILENAME as g,discoverAgents as C}from"./packem_shared/AGENTS_FILENAME-D8SgT3OR.mjs";import{listLunoraSourceFiles as R}from"./packem_shared/listLunoraSourceFiles-CSlcBYlo.mjs";import{default as _}from"./packem_shared/discoverAuthApiCalls-DoSN_yc3.mjs";import{CONTAINERS_FILENAME as L,discoverContainers as M}from"./packem_shared/CONTAINERS_FILENAME-C13yKxas.mjs";import{default as F}from"./packem_shared/discoverCrons-BEALHx1S.mjs";import{sourceCapabilitySignals as D}from"./packem_shared/sourceCapabilitySignals-D5p3WRdM.mjs";import{FLAGS_FILENAME as U,discoverFlags as b}from"./packem_shared/FLAGS_FILENAME-W5XQz_Po.mjs";import{default as y}from"./packem_shared/discoverFunctions-BcBzcG5x.mjs";import{default as k}from"./packem_shared/discoverHttpRoutes-CJHS4llq.mjs";import{default as W}from"./packem_shared/discoverHyperdriveCalls-Bkbh4tG7.mjs";import{default as V}from"./packem_shared/discoverInserts-DpuLYPPd.mjs";import{d as Q}from"./packem_shared/index-D7dKfGPh.mjs";import{default as w}from"./packem_shared/discoverMigrations-Dt7ywfZv.mjs";import{MUTATORS_FILENAME as Y,discoverMutators as X}from"./packem_shared/MUTATORS_FILENAME-DqWOgC5Z.mjs";import{default as $}from"./packem_shared/discoverNondeterministicCalls-CNJV2BiP.mjs";import{NOTIFY_FILENAME as re,discoverNotifyCalls as oe,discoverNotifyConfig as te}from"./packem_shared/NOTIFY_FILENAME-C1J_47et.mjs";import{default as ae}from"./packem_shared/readPackageDependencies-C6h6FZuP.mjs";import{default as me}from"./packem_shared/discoverQueries-BcdqjYky.mjs";import{QUEUES_FILENAME as de,discoverQueues as pe}from"./packem_shared/QUEUES_FILENAME-RGwht3Xu.mjs";import{default as ne}from"./packem_shared/discoverR2sqlCalls-30Wtbc0P.mjs";import{default as xe}from"./packem_shared/discoverRlsProcedures-F4Cy-kSi.mjs";import{default as Ee}from"./packem_shared/discoverRlsMetadata-mXBmPOGj.mjs";import{discoverSandboxUsage as Ae}from"./packem_shared/discoverSandboxUsage-BnsPld5I.mjs";import{default as Ne}from"./packem_shared/discoverSchema-D5R60b4F.mjs";import{readServiceBindings as Ce,resolveServiceBindings as Oe}from"./packem_shared/readServiceBindings-CeQvSswr.mjs";import{SHAPES_FILENAME as Te,discoverShapes as _e}from"./packem_shared/SHAPES_FILENAME-DRUFomCj.mjs";import{default as Le}from"./packem_shared/discoverStorageRulesMetadata-D3Ot9g5f.mjs";import{WORKFLOWS_FILENAME as he,discoverWorkflows as Fe}from"./packem_shared/WORKFLOWS_FILENAME-4-ib4HH-.mjs";import{emitApp as De}from"./packem_shared/emitApp-DPzAn_NF.mjs";import{isD1GlobalTable as Ue,isHyperdriveGlobalTable as be}from"./packem_shared/isD1GlobalTable-udvHAAzD.mjs";import{buildOpenApiDocument as ye,emitOpenApi as je,emitOpenApiModule as ke}from"./packem_shared/buildOpenApiDocument-SxfElVzK.mjs";import{OPENRPC_VERSION as We,buildOpenRpcDocument as Ke,emitOpenRpc as Ve,emitOpenRpcModule as ze}from"./packem_shared/OPENRPC_VERSION-Cr7Zzp6s.mjs";import{DEFAULT_TARGET as qe,platformMatrixIds as we,readProjectTarget as Je,resolveCodegenTarget as Ye}from"./packem_shared/DEFAULT_TARGET-Co7ZXJ21.mjs";import{loadProjectConfig as Ze,readProjectConfigLiterals as $e}from"./packem_shared/loadProjectConfig-nNIDOrlR.mjs";import{SCHEMA_SNAPSHOT_FILENAME as rr,createCodegenProject as or,findTsconfig as tr,refreshCodegenProject as sr,runCodegen as ar}from"./packem_shared/SCHEMA_SNAPSHOT_FILENAME-DyKj7n2S.mjs";import{SchemaSnapshotParseError as mr,buildSchemaSnapshot as fr,evaluateSchemaDrift as dr,parseSchemaSnapshot as pr}from"./packem_shared/SchemaSnapshotParseError-CPOXlFhI.mjs";import{default as nr}from"./packem_shared/fingerprintSchemaSources-Cl1CJFeh.mjs";import{schemaFromIr as xr}from"./packem_shared/schemaFromIr-BWFnvCVg.mjs";import{LUNORA_ERROR_CODES as Er,validatorIrToJsonSchema as ur}from"./packem_shared/LUNORA_ERROR_CODES-C2s0xWQD.mjs";import{SDK_LANGUAGES as vr,SDK_TARGETS as Nr,generateSdk as gr}from"./packem_shared/SDK_LANGUAGES-Df_CnJx5.mjs";import{redact as Or,secretKindOf as Rr}from"./packem_shared/redact-Cy14LEnc.mjs";import{default as _r}from"./packem_shared/emitDrizzleSchema-Cv0HtLR3.mjs";import{default as Lr}from"./packem_shared/emitFunctions-BgNeOZt_.mjs";import{default as hr}from"./packem_shared/emitServer-CLJh410z.mjs";import{e as Pr}from"./packem_shared/shard-DRdVWVi_.mjs";import{G as Gr}from"./packem_shared/shared-DjUziztz.mjs";import{MESSAGE_SOLUTIONS as br,findSolutionByMessage as Hr}from"@lunora/errors";import{PROJECT_CONFIG_FILENAMES as jr,findProjectConfigFile as kr}from"./packem_shared/PROJECT_CONFIG_FILENAMES-DzOu-lSc.mjs";import{s as Wr,t as Kr,u as Vr}from"./packem_shared/shard-runtime-B9wmfm43.mjs";import{emitApi as Qr,emitCollections as qr}from"./packem_shared/emitApi-DdW9RyGG.mjs";import{emitCrons as Jr,emitScheduler as Yr,emitVectors as Xr,emitWranglerCronTriggers as Zr}from"./packem_shared/emitCrons-BRKXFGFu.mjs";import{emitDataModel as eo}from"./packem_shared/emitDataModel-D3WuEZ4b.mjs";import{isTypedSchema as oo}from"./packem_shared/isTypedSchema-CKzc3ioR.mjs";const e="0.0.0";export{g as AGENTS_FILENAME,E as CAPABILITY_PROBES,L as CONTAINERS_FILENAME,A as CodegenDiagnosticError,qe as DEFAULT_TARGET,U as FLAGS_FILENAME,Gr as GENERATED_HEADER,Er as LUNORA_ERROR_CODES,br as LUNORA_SOLUTION_RULES,Y as MUTATORS_FILENAME,re as NOTIFY_FILENAME,We as OPENRPC_VERSION,jr as PROJECT_CONFIG_FILENAMES,de as QUEUES_FILENAME,rr as SCHEMA_SNAPSHOT_FILENAME,t as SCHEMA_SNAPSHOT_VERSION,vr as SDK_LANGUAGES,Nr as SDK_TARGETS,Te as SHAPES_FILENAME,mr as SchemaSnapshotParseError,e as VERSION,he as WORKFLOWS_FILENAME,ye as buildOpenApiDocument,Ke as buildOpenRpcDocument,fr as buildSchemaSnapshot,or as createCodegenProject,c as describeErrorLevelFindings,v as diagnosticAt,s as diffSchemaSnapshots,C as discoverAgents,_ as discoverAuthApiCalls,M as discoverContainers,F as discoverCrons,b as discoverFlags,y as discoverFunctions,k as discoverHttpRoutes,W as discoverHyperdriveCalls,V as discoverInserts,Q as discoverMaskProcedures,w as discoverMigrations,X as discoverMutators,$ as discoverNondeterministicCalls,oe as discoverNotifyCalls,te as discoverNotifyConfig,me as discoverQueries,pe as discoverQueues,ne as discoverR2sqlCalls,Ee as discoverRlsMetadata,xe as discoverRlsProcedures,Ae as discoverSandboxUsage,Ne as discoverSchema,_e as discoverShapes,Le as discoverStorageRulesMetadata,Fe as discoverWorkflows,Wr as emitAgents,Qr as emitApi,De as emitApp,qr as emitCollections,Kr as emitContainers,Jr as emitCrons,eo as emitDataModel,_r as emitDrizzleSchema,Lr as emitFunctions,je as emitOpenApi,ke as emitOpenApiModule,Ve as emitOpenRpc,ze as emitOpenRpcModule,Yr as emitScheduler,hr as emitServer,Pr as emitShard,Xr as emitVectors,Vr as emitWorkflows,Zr as emitWranglerCronTriggers,n as errorAdvisoryNames,l as errorPlatformDiagnosticNames,dr as evaluateSchemaDrift,Hr as findLunoraSolution,kr as findProjectConfigFile,tr as findTsconfig,nr as fingerprintSchemaSources,m as formatAdvisories,gr as generateSdk,Ue as isD1GlobalTable,be as isHyperdriveGlobalTable,oo as isTypedSchema,f as lintSchema,R as listLunoraSourceFiles,Ze as loadProjectConfig,pr as parseSchemaSnapshot,we as platformMatrixIds,ae as readPackageDependencies,$e as readProjectConfigLiterals,Je as readProjectTarget,Ce as readServiceBindings,Or as redact,sr as refreshCodegenProject,Ye as resolveCodegenTarget,Oe as resolveServiceBindings,ar as runCodegen,xr as schemaFromIr,Rr as secretKindOf,a as serializeSchemaSnapshot,x as sortedUniqueNames,D as sourceCapabilitySignals,d as toAdvisorContext,ur as validatorIrToJsonSchema};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const n=[{contextProperty:"access",key:"access",moduleSpecifier:"@lunora/cloudflare-access",requiredPackage:"@lunora/cloudflare-access",serverCtxField:`
|
|
2
|
+
/** Verified Cloudflare Access identity — a synchronous facade over the resolved claims (email / groups / hasGroup / claims). Anonymous when no Access token is present. */
|
|
3
|
+
readonly access: import("@lunora/cloudflare-access/context").AccessFacade;`,shardBinding:"bespoke",tier:"every"},{appMethod:{configKey:"ai",doc:"Override the Workers AI binding backing `ctx.ai` (defaults to `env.AI`).",method:"ai"},contextProperty:"ai",key:"ai",moduleSpecifier:"@lunora/ai",requiredPackage:"@lunora/ai",serverCtxField:`
|
|
4
|
+
readonly ai: import("@lunora/ai").LunoraAi;`,shardBinding:"bespoke",tier:"action"},{appMethod:{configKey:"aiSearch",doc:"Override the AI Search namespace binding backing `ctx.aiSearch` (defaults to `env.AI_SEARCH`).",method:"aiSearch"},contextProperty:"aiSearch",key:"aiSearch",moduleSpecifier:"@lunora/bindings/ai-search",requiredPackage:"@lunora/bindings",serverCtxField:'\n /** Cloudflare AI Search namespace (`ai_search_namespaces`): `.get(name)` an instance, then `search` / `chatCompletions`. Billed, non-deterministic network I/O — available only in actions. */\n readonly aiSearch: import("@lunora/bindings/ai-search").AiSearch;',shardBinding:{binding:{envName:"AI_SEARCH"},clientType:"AiSearch",missingMessage:"ctx.aiSearch: no AI Search binding found. Add an `ai_search_namespaces` binding (env.AI_SEARCH) to wrangler.jsonc, or point `defineApp().aiSearch((env) => …)` at yours.",stubMethods:["chatCompletions","create","delete","get","list","search"],syncStubMethods:["get"]},tier:"action"},{appMethod:{configKey:"analytics",doc:"Override the Analytics Engine dataset backing `ctx.analytics` (defaults to `env.ANALYTICS`).",method:"analytics"},contextProperty:"analytics",key:"analytics",moduleSpecifier:"@lunora/bindings/analytics",requiredPackage:"@lunora/bindings",serverCtxField:`
|
|
5
|
+
/** Analytics Engine telemetry sink. Fire-and-forget and sampled; do not read it back in-handler. */
|
|
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
|
+
/** 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, launch })`. 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.",method:"browser"},contextProperty:"browser",key:"browser",moduleSpecifier:"@lunora/browser",requiredPackage:"@lunora/browser",serverCtxField:`
|
|
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, launch })` with `import { launch } from '@cloudflare/playwright'`. Session reuse (connect/sessions) additionally needs those two exports passed the same way.",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
|
+
/**
|
|
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
|
+
*/
|
|
14
|
+
readonly sql: import("@lunora/hyperdrive").SqlClient;`,shardBinding:{clientType:"SqlClient",missingMessage:"ctx.sql: provide a `sql` config thunk that builds a SqlClient from your driver, e.g. `sql: (env) => fromPostgresJs(postgres(env.HYPERDRIVE.connectionString))`.",stubMethods:["query"]},tier:"action"},{appMethod:{configKey:"images",doc:"Override the Images binding backing `ctx.images` (defaults to `env.IMAGES`).",method:"images"},contextProperty:"images",key:"images",moduleSpecifier:"@lunora/bindings/images",requiredPackage:"@lunora/bindings",serverCtxField:`
|
|
15
|
+
/** Cloudflare Images transforms (resize/format/optimize). Non-deterministic — available only in actions. */
|
|
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"},contextProperty:"kv",key:"kv",moduleSpecifier:"@lunora/bindings/kv",requiredPackage:"@lunora/bindings",serverCtxField:`
|
|
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"},{appMethod:{configKey:"x402",doc:"Wire the x402 agent-wallet pay rail backing `ctx.x402` — a payment-enabled `fetch` that answers `402` challenges under a mandatory spend policy (ActionCtx-only; spends real funds).",method:"x402"},contextProperty:"x402",key:"x402",moduleSpecifier:"@lunora/x402/pay",requiredPackage:"@lunora/x402",serverCtxField:`
|
|
18
|
+
readonly x402: import("@lunora/x402/pay").X402Pay;`,shardBinding:"bespoke",tier:"action"},{contextProperty:"pipelines",key:"pipelines",moduleSpecifier:"@lunora/bindings/pipelines",requiredPackage:"@lunora/bindings",serverCtxField:`
|
|
19
|
+
/** Pipelines ingestion sink (durable, R2-backed). Fire-and-forget and batched; do not read it back in-handler. */
|
|
20
|
+
readonly pipelines: import("@lunora/bindings/pipelines").PipelineClient;`,shardBinding:{binding:{bindingType:"PipelineBindingLike",envName:"PIPELINES",factory:{name:"createPipelines",option:"binding"}},clientType:"PipelineClient",missingMessage:"ctx.pipelines: no Pipelines binding found. Add a `pipelines` binding (env.PIPELINES) to wrangler.jsonc, or pass `pipelines` to createShardDO().",stubMethods:["send"]},tier:"action"},{appMethod:{configKey:"r2sql",doc:"Wire the R2 SQL client backing `ctx.r2sql` — build it with `createR2Sql({ accountId, apiToken, bucket })` (defaults to env `R2_SQL_TOKEN` / `R2_SQL_ACCOUNT_ID` / `R2_SQL_BUCKET`).",method:"r2sql"},contextProperty:"r2sql",key:"r2sql",moduleSpecifier:"@lunora/bindings/r2sql",requiredPackage:"@lunora/bindings",serverCtxField:`
|
|
21
|
+
/**
|
|
22
|
+
* R2 SQL over Apache Iceberg tables (window functions, DISTINCT, set operations). Non-deterministic — available only in actions. Reads here are NOT tracked by Lunora live queries.
|
|
23
|
+
*/
|
|
24
|
+
readonly r2sql: import("@lunora/bindings/r2sql").R2SqlClient;`,shardBinding:"bespoke",tier:"action"},{contextProperty:"scheduler",key:"scheduler",moduleSpecifier:"@lunora/scheduler"},{contextProperty:"storage",key:"storage",moduleSpecifier:"@lunora/storage"},{contextProperty:"vectors",key:"vectors",moduleSpecifier:"@lunora/bindings/vectors"},{contextProperty:"workflows",key:"workflows",moduleSpecifier:"@lunora/workflow"}],a=n,r=n.flatMap(e=>"appMethod"in e?[{appMethod:e.appMethod,key:e.key}]:[]),o=a.map(({contextProperty:e,key:i,moduleSpecifier:t})=>({contextProperty:e,key:i,moduleSpecifier:t})),s=e=>new Set(a.filter(i=>e[i.key]).map(i=>i.key));export{r as APP_METHOD_CAPABILITIES,a as CAPABILITIES,o as CAPABILITY_PROBES,s as usedCapabilities};
|