@lunora/config 1.0.0-alpha.103 → 1.0.0-alpha.104
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/README.md +2 -2
- package/dist/cloudflare/index.d.mts +628 -0
- package/dist/cloudflare/index.d.ts +628 -0
- package/dist/cloudflare/index.mjs +1 -0
- package/dist/index.d.mts +97 -723
- package/dist/index.d.ts +97 -723
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/CLOUDFLARE_DRIVER-DqnWynqM.mjs +1 -0
- package/dist/packem_shared/DEFAULT_DEPLOY_TARGET-DDfyhjj8.mjs +1 -0
- package/dist/packem_shared/LUNORA_CONFIG_FILE-DVkEe5L6.mjs +1 -0
- package/dist/packem_shared/{inferLunoraBindings-B2y-19KL.mjs → inferLunoraBindings-BP-OTizO.mjs} +1 -1
- package/dist/packem_shared/schema-info.d-DS0bUsWE.d.mts +375 -0
- package/dist/packem_shared/schema-info.d-DS0bUsWE.d.ts +375 -0
- package/dist/packem_shared/wranglerToAlchemy-Fh5KfTPB.mjs +6 -0
- package/package.json +7 -3
- package/dist/packem_shared/LUNORA_CONFIG_FILE-3bpx6TZN.mjs +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,51 @@
|
|
|
1
|
-
import { AgentIR, ContainerIR, WorkflowIR
|
|
1
|
+
import { AgentIR, ContainerIR, WorkflowIR } from '@lunora/codegen';
|
|
2
2
|
export type { AgentIR, ContainerIR, WorkflowIR } from '@lunora/codegen';
|
|
3
3
|
import { Writable } from 'node:stream';
|
|
4
|
+
import { D as DeployDriver } from "./packem_shared/schema-info.d-DS0bUsWE.mjs";
|
|
5
|
+
export { type a as DeployRequest, type b as DevRequest, type c as DiscoverSchemaInfoResult, type d as DriverContext, type e as DriverToolchain, type f as InferOptions, type g as InferredAgent, type I as InferredBindings, type h as InferredContainer, type i as InferredWorkflow, type N as NamedResource, type P as ProvisionResult, type R as ResourceGraph, type S as SchemaInfo, type j as SecretRequest, type k as ShardNamespaceResource, type T as TailRequest, type l as ToolchainCommand, m as discoverSchemaInfo, n as inferLunoraBindings, p as packageNamesFromBindings } from "./packem_shared/schema-info.d-DS0bUsWE.mjs";
|
|
4
6
|
import 'ts-morph';
|
|
5
7
|
export { type A as AdditivePolicyEdit, type D as DestructivePolicyEdit, type P as PolicyEdit, type a as PolicyScaffoldFailureReason, type b as ScaffoldFileResult, type S as ScaffoldPolicyEdit, type c as WireResult, type W as WireRlsEdit, d as classifyPolicyEdit, s as scaffoldPolicyFile, w as wireRlsIntoProcedure } from "./packem_shared/policy-scaffold.d-CFd2FlqG.mjs";
|
|
8
|
+
interface DiscoverAgentInfoResult {
|
|
9
|
+
/** Discovered agent definitions; `[]` when none are declared or parsing failed. */
|
|
10
|
+
agents: ReadonlyArray<AgentIR>;
|
|
11
|
+
/** Parse error message, when `lunora/agents.ts` exists but could not be analyzed. */
|
|
12
|
+
error?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Discover the project's `defineAgent` declarations. Returns `{ agents: [] }`
|
|
16
|
+
* when the project has no `lunora/agents.ts` (not an error), or
|
|
17
|
+
* `{ agents: [], error }` when the file exists but could not be parsed — callers
|
|
18
|
+
* decide whether that is a warning (validator) or ignorable (inference).
|
|
19
|
+
*/
|
|
20
|
+
declare const discoverAgentInfo: (projectRoot: string, schemaDirectory: string) => DiscoverAgentInfoResult;
|
|
21
|
+
interface DiscoverContainerInfoResult {
|
|
22
|
+
/** Discovered container definitions; `[]` when none are declared or parsing failed. */
|
|
23
|
+
containers: ReadonlyArray<ContainerIR>;
|
|
24
|
+
/** Parse error message, when `lunora/containers.ts` exists but could not be analyzed. */
|
|
25
|
+
error?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Discover the project's `defineContainer` declarations. Returns
|
|
29
|
+
* `{ containers: [] }` when the project has no `lunora/containers.ts` (not an
|
|
30
|
+
* error), or `{ containers: [], error }` when the file exists but could not be
|
|
31
|
+
* parsed — callers decide whether that is a warning (validator) or ignorable
|
|
32
|
+
* (inference).
|
|
33
|
+
*/
|
|
34
|
+
declare const discoverContainerInfo: (projectRoot: string, schemaDirectory: string) => DiscoverContainerInfoResult;
|
|
35
|
+
interface DiscoverWorkflowInfoResult {
|
|
36
|
+
/** Parse error message, when `lunora/workflows.ts` exists but could not be analyzed. */
|
|
37
|
+
error?: string;
|
|
38
|
+
/** Discovered workflow definitions; `[]` when none are declared or parsing failed. */
|
|
39
|
+
workflows: ReadonlyArray<WorkflowIR>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Discover the project's `defineWorkflow` declarations. Returns
|
|
43
|
+
* `{ workflows: [] }` when the project has no `lunora/workflows.ts` (not an
|
|
44
|
+
* error), or `{ workflows: [], error }` when the file exists but could not be
|
|
45
|
+
* parsed — callers decide whether that is a warning (validator) or ignorable
|
|
46
|
+
* (inference).
|
|
47
|
+
*/
|
|
48
|
+
declare const discoverWorkflowInfo: (projectRoot: string, schemaDirectory: string) => DiscoverWorkflowInfoResult;
|
|
6
49
|
/** Minimal env shape — `process.env` structurally, injectable for tests. */
|
|
7
50
|
type EnvLike = Readonly<Record<string, string | undefined>>;
|
|
8
51
|
/** One detected agent: which tool, and which env var gave it away. */
|
|
@@ -20,19 +63,6 @@ declare const AGENT_MODE_ENV = "LUNORA_AGENT_MODE";
|
|
|
20
63
|
* both directions. Pure — pass a custom `env` in tests.
|
|
21
64
|
*/
|
|
22
65
|
declare const detectAiAgent: (env?: EnvLike) => AgentDetection | undefined;
|
|
23
|
-
interface DiscoverAgentInfoResult {
|
|
24
|
-
/** Discovered agent definitions; `[]` when none are declared or parsing failed. */
|
|
25
|
-
agents: ReadonlyArray<AgentIR>;
|
|
26
|
-
/** Parse error message, when `lunora/agents.ts` exists but could not be analyzed. */
|
|
27
|
-
error?: string;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Discover the project's `defineAgent` declarations. Returns `{ agents: [] }`
|
|
31
|
-
* when the project has no `lunora/agents.ts` (not an error), or
|
|
32
|
-
* `{ agents: [], error }` when the file exists but could not be parsed — callers
|
|
33
|
-
* decide whether that is a warning (validator) or ignorable (inference).
|
|
34
|
-
*/
|
|
35
|
-
declare const discoverAgentInfo: (projectRoot: string, schemaDirectory: string) => DiscoverAgentInfoResult;
|
|
36
66
|
/**
|
|
37
67
|
* Project-relative directory the Lunora agent skills ("rules") install into.
|
|
38
68
|
* This is the portable [Agent Skills](https://tanstack.com/intent/latest/docs/registry)
|
|
@@ -82,20 +112,6 @@ interface AgentRulesStatus {
|
|
|
82
112
|
* hint.
|
|
83
113
|
*/
|
|
84
114
|
declare const detectAgentRules: (projectRoot: string) => AgentRulesStatus;
|
|
85
|
-
interface DiscoverContainerInfoResult {
|
|
86
|
-
/** Discovered container definitions; `[]` when none are declared or parsing failed. */
|
|
87
|
-
containers: ReadonlyArray<ContainerIR>;
|
|
88
|
-
/** Parse error message, when `lunora/containers.ts` exists but could not be analyzed. */
|
|
89
|
-
error?: string;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Discover the project's `defineContainer` declarations. Returns
|
|
93
|
-
* `{ containers: [] }` when the project has no `lunora/containers.ts` (not an
|
|
94
|
-
* error), or `{ containers: [], error }` when the file exists but could not be
|
|
95
|
-
* parsed — callers decide whether that is a warning (validator) or ignorable
|
|
96
|
-
* (inference).
|
|
97
|
-
*/
|
|
98
|
-
declare const discoverContainerInfo: (projectRoot: string, schemaDirectory: string) => DiscoverContainerInfoResult;
|
|
99
115
|
/** Severity a container output line is surfaced at: `stderr` → `error`, `stdout` → `info`. */
|
|
100
116
|
type ContainerLogLevel = "error" | "info";
|
|
101
117
|
/** One declared container to follow, identified by the names codegen lifts from `defineContainer`. */
|
|
@@ -332,139 +348,15 @@ declare const parseDevVariableEntries: (content: string) => {
|
|
|
332
348
|
key: string;
|
|
333
349
|
value: string;
|
|
334
350
|
}[];
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
workflows: ReadonlyArray<WorkflowIR>;
|
|
340
|
-
}
|
|
341
|
-
/**
|
|
342
|
-
* Discover the project's `defineWorkflow` declarations. Returns
|
|
343
|
-
* `{ workflows: [] }` when the project has no `lunora/workflows.ts` (not an
|
|
344
|
-
* error), or `{ workflows: [], error }` when the file exists but could not be
|
|
345
|
-
* parsed — callers decide whether that is a warning (validator) or ignorable
|
|
346
|
-
* (inference).
|
|
347
|
-
*/
|
|
348
|
-
declare const discoverWorkflowInfo: (projectRoot: string, schemaDirectory: string) => DiscoverWorkflowInfoResult;
|
|
349
|
-
interface DurableObjectSpec {
|
|
350
|
-
binding: string;
|
|
351
|
-
className: string;
|
|
352
|
-
}
|
|
353
|
-
/**
|
|
354
|
-
* A `defineContainer` declaration plus whether its generated DO class is
|
|
355
|
-
* exported by the worker entry. Only exported containers are safe to
|
|
356
|
-
* provision — wrangler rejects a `containers[].class_name` (and its Durable
|
|
357
|
-
* Object binding) that the worker doesn't export.
|
|
358
|
-
*/
|
|
359
|
-
interface InferredContainer extends ContainerIR {
|
|
360
|
-
exported: boolean;
|
|
361
|
-
}
|
|
362
|
-
/**
|
|
363
|
-
* A `defineWorkflow` declaration plus whether its generated
|
|
364
|
-
* `WorkflowEntrypoint` class is exported by the worker entry. Only exported
|
|
365
|
-
* workflows are safe to provision — wrangler rejects a `workflows[].class_name`
|
|
366
|
-
* the worker doesn't export. Workflows are NOT Durable Objects, so this never
|
|
367
|
-
* implies a `durable_objects` binding or migration.
|
|
368
|
-
*/
|
|
369
|
-
interface InferredWorkflow extends WorkflowIR {
|
|
370
|
-
exported: boolean;
|
|
371
|
-
}
|
|
372
|
-
/**
|
|
373
|
-
* A `defineAgent` declaration plus whether its generated agent
|
|
374
|
-
* `WorkflowEntrypoint` class (e.g. `SupportAgentWorkflow`) is exported by the
|
|
375
|
-
* worker entry. An agent compiles onto a Cloudflare Workflow, so — exactly like
|
|
376
|
-
* {@link InferredWorkflow} — only exported agents are safe to provision
|
|
377
|
-
* (wrangler rejects a `workflows[].class_name` the worker doesn't export), and
|
|
378
|
-
* an agent is NOT a Durable Object (no `durable_objects` binding or migration).
|
|
379
|
-
*/
|
|
380
|
-
interface InferredAgent extends AgentIR {
|
|
381
|
-
exported: boolean;
|
|
382
|
-
}
|
|
383
|
-
/**
|
|
384
|
-
* A queue declared in `lunora/queues.ts`. Unlike workflows, a queue needs no
|
|
385
|
-
* worker-entry class export (its `queue()` handler rides `createWorker`), so
|
|
386
|
-
* there is no `exported` flag — every declared queue is reconcilable into the
|
|
387
|
-
* wrangler `queues.producers[]` / `queues.consumers[]`.
|
|
388
|
-
*/
|
|
389
|
-
type InferredQueue = QueueIR;
|
|
390
|
-
interface InferredBindings {
|
|
391
|
-
/** Agents declared in `lunora/agents.ts` (exported or not — see {@link InferredAgent.exported}); reconciled into `workflows[]`. */
|
|
392
|
-
agents: InferredAgent[];
|
|
393
|
-
/** Containers declared in `lunora/containers.ts` (exported or not — see {@link InferredContainer.exported}). */
|
|
394
|
-
containers: InferredContainer[];
|
|
395
|
-
/** Durable Objects the worker entry exports → safe to bind. */
|
|
396
|
-
durableObjects: DurableObjectSpec[];
|
|
397
|
-
/**
|
|
398
|
-
* The wrangler `flagship[].binding` name implied by `lunora/flags.ts` when it
|
|
399
|
-
* uses the Flagship provider in binding mode — `undefined` for HTTP-mode
|
|
400
|
-
* Flagship, a custom OpenFeature provider, or no flags. The binding needs an
|
|
401
|
-
* un-mintable `app_id`, so it is reconciled as a hint, not auto-written.
|
|
402
|
-
*/
|
|
403
|
-
flagshipBinding?: string;
|
|
404
|
-
/** Schema declares a `.global()` table → needs the `DB` D1 binding. */
|
|
405
|
-
needsD1: boolean;
|
|
406
|
-
/** Queues declared in `lunora/queues.ts` → reconciled into `queues.producers[]` / `queues.consumers[]`. */
|
|
407
|
-
queues: InferredQueue[];
|
|
408
|
-
/** Human-readable provenance for each inferred binding / hint, for logging. */
|
|
409
|
-
signals: string[];
|
|
410
|
-
/** `@lunora/ai` is imported or `env.AI` is used → needs the `ai` Workers AI binding. */
|
|
411
|
-
usesAi: boolean;
|
|
412
|
-
/** `@lunora/bindings/analytics` is imported → self-describing `analytics_engine_datasets` binding (auto-writeable). */
|
|
413
|
-
usesAnalytics: boolean;
|
|
414
|
-
/** `@lunora/auth` is imported (sessions may be D1- or `SessionDO`-backed). */
|
|
415
|
-
usesAuth: boolean;
|
|
416
|
-
/** `@lunora/browser` is imported → self-describing `browser` binding (auto-writeable). */
|
|
417
|
-
usesBrowser: boolean;
|
|
418
|
-
/** `lunora/flags.ts` declares a feature-flag provider (any OpenFeature provider — Flagship or custom). */
|
|
419
|
-
usesFlags: boolean;
|
|
420
|
-
/** `@lunora/hyperdrive` is imported (binding needs an un-mintable remote `id`; hint-only). */
|
|
421
|
-
usesHyperdrive: boolean;
|
|
422
|
-
/** `@lunora/bindings/images` is imported → self-describing `images` binding (auto-writeable). */
|
|
423
|
-
usesImages: boolean;
|
|
424
|
-
/** `@lunora/bindings/kv` is imported (namespace binding name + id are user-defined; hint-only). */
|
|
425
|
-
usesKv: boolean;
|
|
426
|
-
/** `@lunora/mail` is imported (Resend API key must be set in `.dev.vars`; no binding). */
|
|
427
|
-
usesMail: boolean;
|
|
428
|
-
/** `@lunora/payment` is imported (provider secrets must be set in `.dev.vars`; no binding). */
|
|
429
|
-
usesPayment: boolean;
|
|
430
|
-
/** `ctx.pipelines` is used (binding needs an un-mintable remote pipeline name; hint-only). */
|
|
431
|
-
usesPipelines: boolean;
|
|
432
|
-
/** `@lunora/scheduler` is imported. */
|
|
433
|
-
usesScheduler: boolean;
|
|
434
|
-
/** `@lunora/storage` is imported (R2 bucket binding name is user-defined). */
|
|
435
|
-
usesStorage: boolean;
|
|
436
|
-
/** `@lunora/x402/charge` is imported — the charge rail settles USDC to a recipient address (a public `[vars]` entry, user-named; hint-only). */
|
|
437
|
-
usesX402Charge: boolean;
|
|
438
|
-
/** `@lunora/x402/pay` is imported — the agent-wallet pay rail signs from a Secrets Store binding paired with a spend policy (ActionCtx-only; hint-only). */
|
|
439
|
-
usesX402Pay: boolean;
|
|
440
|
-
/** Workflows declared in `lunora/workflows.ts` (exported or not — see {@link InferredWorkflow.exported}). */
|
|
441
|
-
workflows: InferredWorkflow[];
|
|
442
|
-
}
|
|
443
|
-
interface InferOptions {
|
|
444
|
-
projectRoot: string;
|
|
445
|
-
/** Directories (relative to root) to scan. Defaults to `lunora` + `src`. */
|
|
446
|
-
scanDirs?: ReadonlyArray<string>;
|
|
447
|
-
/** Lunora source directory holding `schema.ts`. Defaults to `lunora`. */
|
|
448
|
-
schemaDir?: string;
|
|
449
|
-
}
|
|
351
|
+
/** The default deploy target — today's behavior for every project. */
|
|
352
|
+
declare const DEFAULT_DEPLOY_TARGET = "cloudflare";
|
|
353
|
+
/** The ids a caller may select, for error messages and `--target` help text. */
|
|
354
|
+
declare const deployTargetIds: () => ReadonlyArray<string>;
|
|
450
355
|
/**
|
|
451
|
-
*
|
|
452
|
-
*
|
|
453
|
-
* entry's Durable Object exports plus the schema's D1 need; capability imports
|
|
454
|
-
* surface as hints.
|
|
356
|
+
* Resolve a target name to its driver.
|
|
357
|
+
* @throws when `target` names no registered driver — never falls back to the default.
|
|
455
358
|
*/
|
|
456
|
-
declare const
|
|
457
|
-
/**
|
|
458
|
-
* Derive the list of `@lunora/*` package names that are actively used by a
|
|
459
|
-
* project, based on its already-resolved {@link InferredBindings}.
|
|
460
|
-
*
|
|
461
|
-
* This is the canonical bridge between binding inference and the package-aware
|
|
462
|
-
* `.dev.vars.example` scaffolding in `scaffold-dev-variables.ts`. The result is
|
|
463
|
-
* a stable, predictable slice of {@link CAPABILITY_SOURCES} source values,
|
|
464
|
-
* filtered to the flags that are `true` in `bindings` — in CAPABILITY_SOURCES
|
|
465
|
-
* declaration order.
|
|
466
|
-
*/
|
|
467
|
-
declare const packageNamesFromBindings: (bindings: InferredBindings) => string[];
|
|
359
|
+
declare const resolveDeployDriver: (target?: string) => DeployDriver;
|
|
468
360
|
/** Directory holding per-checkout Lunora state (gitignored by convention). */
|
|
469
361
|
declare const LINKED_PROJECT_DIR = ".lunora";
|
|
470
362
|
/** The canonical link filename, relative to the project root. */
|
|
@@ -606,6 +498,7 @@ type RemotePreference = boolean | undefined;
|
|
|
606
498
|
/** The structural slice of `lunora.json` Lunora reads. */
|
|
607
499
|
interface LunoraProjectConfig {
|
|
608
500
|
remote?: unknown;
|
|
501
|
+
target?: unknown;
|
|
609
502
|
}
|
|
610
503
|
/**
|
|
611
504
|
* Interpret a raw `remote` value into a tri-state preference. A boolean passes
|
|
@@ -615,12 +508,52 @@ interface LunoraProjectConfig {
|
|
|
615
508
|
*/
|
|
616
509
|
declare const interpretRemote: (value: unknown) => RemotePreference;
|
|
617
510
|
/**
|
|
618
|
-
* Read the project's `remote` preference
|
|
619
|
-
*
|
|
620
|
-
* parse error, or unexpected shape all collapse to `undefined` so the caller
|
|
621
|
-
* falls through to the env/flag layers.
|
|
511
|
+
* Read the project's `remote` preference, or `undefined` when there is no
|
|
512
|
+
* usable one — the caller then falls through to the env/flag layers.
|
|
622
513
|
*/
|
|
623
514
|
declare const readProjectRemotePreference: (projectRoot: string) => RemotePreference;
|
|
515
|
+
/**
|
|
516
|
+
* Read the project's deploy `target` from `lunora.json`, or `undefined` when
|
|
517
|
+
* absent.
|
|
518
|
+
*
|
|
519
|
+
* Delegates to `@lunora/codegen` rather than re-reading the file here.
|
|
520
|
+
* `runCodegen` has to resolve the same key without this package (config
|
|
521
|
+
* depends on codegen, not the reverse), so the parser lives there and this is a
|
|
522
|
+
* re-export — two readers of one key is exactly the kind of copy that drifts.
|
|
523
|
+
*/
|
|
524
|
+
declare const readProjectTarget: (projectRoot: string) => string | undefined;
|
|
525
|
+
/**
|
|
526
|
+
* Resolve the deploy target for a command: an explicit `--target` wins, then
|
|
527
|
+
* `lunora.json`, then the registry default.
|
|
528
|
+
*
|
|
529
|
+
* **This is the canonical resolution point, and the reason it is one place.**
|
|
530
|
+
* Codegen tailors the emitted `ctx.*` surface to a target while deploy picks
|
|
531
|
+
* the driver that ships it. Resolve those separately and they can disagree,
|
|
532
|
+
* producing an app that builds cleanly and fails at runtime with nothing in the
|
|
533
|
+
* build to explain it. Every caller — CLI commands, the Vite plugin,
|
|
534
|
+
* `runCodegen`'s own fallback — resolves through here or through
|
|
535
|
+
* {@link resolveTargetOrThrow}, so there is exactly one precedence order to
|
|
536
|
+
* reason about.
|
|
537
|
+
*/
|
|
538
|
+
declare const resolveProjectTarget: (projectRoot: string, explicit?: string) => string;
|
|
539
|
+
/**
|
|
540
|
+
* Resolve the deploy target as {@link resolveProjectTarget} does, then reject
|
|
541
|
+
* one that no registered driver serves.
|
|
542
|
+
*
|
|
543
|
+
* Lives here rather than in `@lunora/cli` because nothing about it is
|
|
544
|
+
* CLI-shaped and the Vite plugin needs the same guard — a validator only the
|
|
545
|
+
* CLI could reach left `vite build` emitting the default surface for a
|
|
546
|
+
* mis-declared target, silently.
|
|
547
|
+
*
|
|
548
|
+
* Callers that go on to resolve a driver get this for free; the ones that never
|
|
549
|
+
* look a driver up — codegen, the Vite plugin — need it, because otherwise
|
|
550
|
+
* nothing in their path ever rejects the name.
|
|
551
|
+
* @param projectRoot Directory containing `lunora.json`.
|
|
552
|
+
* @param explicit A caller-supplied target, if any.
|
|
553
|
+
* @throws when the resolved target names no registered driver.
|
|
554
|
+
* @returns the resolved, registered target id.
|
|
555
|
+
*/
|
|
556
|
+
declare const resolveTargetOrThrow: (projectRoot: string, explicit?: string) => string;
|
|
624
557
|
/**
|
|
625
558
|
* Whether we can interactively prompt — stdin must be a TTY. In CI / piped
|
|
626
559
|
* contexts this is false, and callers should fall back to a non-interactive
|
|
@@ -685,259 +618,6 @@ type MultiSelectOption<T extends string> = SelectOption<T>;
|
|
|
685
618
|
declare const promptMultiSelect: <T extends string>(message: string, options: ReadonlyArray<MultiSelectOption<T>>, settings?: {
|
|
686
619
|
defaults?: ReadonlyArray<T>;
|
|
687
620
|
}) => Promise<T[]>;
|
|
688
|
-
/**
|
|
689
|
-
* A container/workflow that is declared (so codegen emits its class) but the
|
|
690
|
-
* worker entry never re-exports — the one wiring step the generators can't always
|
|
691
|
-
* do for the developer. wrangler rejects a `class_name` the deployed worker
|
|
692
|
-
* doesn't export, so a deploy fails late on this; surfacing it as structured data
|
|
693
|
-
* lets the Vite plugin raise it in the dev error overlay (not just the console)
|
|
694
|
-
* the moment the gap appears. The human-readable form is also folded into
|
|
695
|
-
* {@link ReconcileBindingsResult.warnings}.
|
|
696
|
-
*/
|
|
697
|
-
interface ExportGap {
|
|
698
|
-
/** Generated class wrangler needs exported, e.g. `OrderPipelineWorkflow`. */
|
|
699
|
-
className: string;
|
|
700
|
-
/** The `lunora/{agents,containers,workflows}.ts` export name, e.g. `orderPipeline`. */
|
|
701
|
-
exportName: string;
|
|
702
|
-
/** Which declaration is unexported. */
|
|
703
|
-
kind: "agent" | "container" | "workflow";
|
|
704
|
-
/** The `_generated/{module}` to re-export from, e.g. `workflows`. */
|
|
705
|
-
module: "agents" | "containers" | "workflows";
|
|
706
|
-
}
|
|
707
|
-
interface ReconcileBindingsResult {
|
|
708
|
-
/** Short labels for each binding written (e.g. `"SCHEDULER/SchedulerDO"`). */
|
|
709
|
-
added: string[];
|
|
710
|
-
/** `true` when `wrangler.jsonc` was rewritten. */
|
|
711
|
-
changed: boolean;
|
|
712
|
-
/**
|
|
713
|
-
* Declared containers/workflows the worker entry doesn't re-export — the
|
|
714
|
-
* structured form of the corresponding `warnings` entries, for the dev error
|
|
715
|
-
* overlay. Empty when every declaration is wired.
|
|
716
|
-
*/
|
|
717
|
-
exportGaps: ExportGap[];
|
|
718
|
-
/** Reason reconciliation was skipped, for logging. */
|
|
719
|
-
reason?: string;
|
|
720
|
-
/** Non-fatal hints for capabilities that cannot be auto-provisioned. */
|
|
721
|
-
warnings: string[];
|
|
722
|
-
/** Resolved wrangler path, or `undefined` when none was found. */
|
|
723
|
-
wranglerPath?: string;
|
|
724
|
-
}
|
|
725
|
-
/**
|
|
726
|
-
* Reconcile inferred Durable Object / D1 bindings into `wrangler.jsonc`.
|
|
727
|
-
*
|
|
728
|
-
* Writes only when something is missing; returns `changed: false` when the
|
|
729
|
-
* config already satisfies the inferred needs.
|
|
730
|
-
*/
|
|
731
|
-
declare const reconcileWranglerBindings: (projectRoot: string, inferred: InferredBindings) => ReconcileBindingsResult;
|
|
732
|
-
interface ReconcileCompatibilityDateResult {
|
|
733
|
-
/** `true` when `wrangler.jsonc` was rewritten. */
|
|
734
|
-
changed: boolean;
|
|
735
|
-
/** The new date value, or the existing one when unchanged. */
|
|
736
|
-
date: string | undefined;
|
|
737
|
-
/** Human-readable reason when reconciliation was skipped. */
|
|
738
|
-
reason?: string;
|
|
739
|
-
/** Resolved wrangler path, or `undefined` when none was found. */
|
|
740
|
-
wranglerPath?: string;
|
|
741
|
-
}
|
|
742
|
-
/**
|
|
743
|
-
* Reconcile the `compatibility_date` in `wrangler.jsonc` when Workers Cache
|
|
744
|
-
* is enabled but the date is below the minimum required.
|
|
745
|
-
*/
|
|
746
|
-
declare const reconcileWranglerCompatibilityDate: (projectRoot: string) => ReconcileCompatibilityDateResult;
|
|
747
|
-
interface ReconcileResult {
|
|
748
|
-
/** `true` when `wrangler.jsonc` was rewritten. */
|
|
749
|
-
changed: boolean;
|
|
750
|
-
/** Human-readable reason when reconciliation was skipped (for logging). */
|
|
751
|
-
reason?: string;
|
|
752
|
-
/** Resolved wrangler path, or `undefined` when none was found. */
|
|
753
|
-
wranglerPath?: string;
|
|
754
|
-
}
|
|
755
|
-
/**
|
|
756
|
-
* Reconcile the codegen-derived cron schedules into the project's
|
|
757
|
-
* `wrangler.jsonc` `triggers.crons` array, preserving comments and formatting
|
|
758
|
-
* via `jsonc-parser`'s structural edits.
|
|
759
|
-
*
|
|
760
|
-
* When `triggers.crons` already matches `cronTriggers`, nothing is written (so
|
|
761
|
-
* we don't churn the file or trip the dev server's file watcher). When the
|
|
762
|
-
* project declares no crons, a stale non-empty array is cleared so removed
|
|
763
|
-
* crons stop firing.
|
|
764
|
-
*
|
|
765
|
-
* This intentionally writes the SAME `triggers.crons` shape the
|
|
766
|
-
* `@lunora/config` validator accepts, so the wrangler validator never fights
|
|
767
|
-
* the generated value.
|
|
768
|
-
*/
|
|
769
|
-
declare const reconcileWranglerCrons: (projectRoot: string, cronTriggers: ReadonlyArray<string>) => ReconcileResult;
|
|
770
|
-
/**
|
|
771
|
-
* The wrangler config sections Lunora can safely flip to remote mode in dev,
|
|
772
|
-
* each with the human label used in logs and the structural `shape` the entry
|
|
773
|
-
* lives in.
|
|
774
|
-
*
|
|
775
|
-
* `"array"` is a top-level array of binding objects (`d1_databases`,
|
|
776
|
-
* `kv_namespaces`, `r2_buckets`, `vectorize`, `services`). `"producers"` is
|
|
777
|
-
* `queues.producers[]` — consumers are NOT remoted (their schema has no `remote`
|
|
778
|
-
* field) and the edit path is two levels deep. `"object"` is a single binding
|
|
779
|
-
* object, not an array (`ai`), whose edit path targets the section key directly.
|
|
780
|
-
*
|
|
781
|
-
* Every kind here was confirmed against `wrangler/config-schema.json`: the
|
|
782
|
-
* entry's schema declares a `remote` property. Deliberately omits
|
|
783
|
-
* `durable_objects` (no CF remote-DO mode; shards stay local) and sections whose
|
|
784
|
-
* schema has no `remote` field (`hyperdrive`, `analytics_engine_datasets`,
|
|
785
|
-
* `secrets_store_secrets`, queue consumers, …). Widening further is a one-line
|
|
786
|
-
* table edit.
|
|
787
|
-
*/
|
|
788
|
-
declare const REMOTE_ELIGIBLE_KEYS: {
|
|
789
|
-
readonly ai: {
|
|
790
|
-
readonly label: "AI";
|
|
791
|
-
readonly shape: "object";
|
|
792
|
-
};
|
|
793
|
-
readonly d1_databases: {
|
|
794
|
-
readonly label: "D1";
|
|
795
|
-
readonly shape: "array";
|
|
796
|
-
};
|
|
797
|
-
readonly kv_namespaces: {
|
|
798
|
-
readonly label: "KV";
|
|
799
|
-
readonly shape: "array";
|
|
800
|
-
};
|
|
801
|
-
readonly queues: {
|
|
802
|
-
readonly label: "Queue";
|
|
803
|
-
readonly shape: "producers";
|
|
804
|
-
};
|
|
805
|
-
readonly r2_buckets: {
|
|
806
|
-
readonly label: "R2";
|
|
807
|
-
readonly shape: "array";
|
|
808
|
-
};
|
|
809
|
-
readonly services: {
|
|
810
|
-
readonly label: "Service";
|
|
811
|
-
readonly shape: "array";
|
|
812
|
-
};
|
|
813
|
-
readonly vectorize: {
|
|
814
|
-
readonly label: "Vectorize";
|
|
815
|
-
readonly shape: "array";
|
|
816
|
-
};
|
|
817
|
-
};
|
|
818
|
-
type RemoteEligibleKey = keyof typeof REMOTE_ELIGIBLE_KEYS;
|
|
819
|
-
/** One binding object as it appears in any eligible section. */
|
|
820
|
-
interface BindingEntry {
|
|
821
|
-
binding?: string;
|
|
822
|
-
remote?: boolean;
|
|
823
|
-
}
|
|
824
|
-
/** One binding entry we mark remote, with enough provenance to log + edit it. */
|
|
825
|
-
interface RemoteBindingPlan {
|
|
826
|
-
/** The binding name as declared in the config (e.g. `"DB"`, `"FILES"`). */
|
|
827
|
-
binding: string;
|
|
828
|
-
/** Short kind label for logging (`"D1"`, `"KV"`, `"R2"`, `"Vectorize"`, …). */
|
|
829
|
-
kind: string;
|
|
830
|
-
/**
|
|
831
|
-
* The jsonc edit path within {@link RemoteBindingPlan.section}, relative to
|
|
832
|
-
* the section key: `[index]` for an `"array"` section, `["producers", index]`
|
|
833
|
-
* for a queue producer, or `[]` for the single-object `ai` section. The
|
|
834
|
-
* materializer prepends the section key and appends `"remote"`.
|
|
835
|
-
*/
|
|
836
|
-
path: ReadonlyArray<number | string>;
|
|
837
|
-
/** The wrangler config key the entry lives under. */
|
|
838
|
-
section: RemoteEligibleKey;
|
|
839
|
-
}
|
|
840
|
-
/** The structural slice of a wrangler config the remote planner reads. */
|
|
841
|
-
interface RemoteWranglerShape {
|
|
842
|
-
ai?: BindingEntry | null;
|
|
843
|
-
d1_databases?: ReadonlyArray<BindingEntry | null | undefined>;
|
|
844
|
-
kv_namespaces?: ReadonlyArray<BindingEntry | null | undefined>;
|
|
845
|
-
queues?: {
|
|
846
|
-
producers?: ReadonlyArray<BindingEntry | null | undefined>;
|
|
847
|
-
} | null;
|
|
848
|
-
r2_buckets?: ReadonlyArray<BindingEntry | null | undefined>;
|
|
849
|
-
services?: ReadonlyArray<BindingEntry | null | undefined>;
|
|
850
|
-
vectorize?: ReadonlyArray<BindingEntry | null | undefined>;
|
|
851
|
-
}
|
|
852
|
-
/**
|
|
853
|
-
* Inspect a parsed wrangler config and list every eligible binding that should
|
|
854
|
-
* be flipped to remote mode. Pure — no file-system access, no mutation. An
|
|
855
|
-
* entry already carrying `"remote": true` is still reported (so logging is
|
|
856
|
-
* complete) but the materializer's edit is a harmless no-op for it.
|
|
857
|
-
*/
|
|
858
|
-
declare const planRemoteBindings: (parsed: RemoteWranglerShape) => RemoteBindingPlan[];
|
|
859
|
-
/**
|
|
860
|
-
* Inject `"remote": true` onto each planned binding in the config `text`,
|
|
861
|
-
* comment-preservingly via jsonc edits. Pure string→string; the edits target
|
|
862
|
-
* disjoint entries so applying them sequentially is safe. The edit path is
|
|
863
|
-
* `[section, ...plan.path, "remote"]`, which resolves to the array element, the
|
|
864
|
-
* `queues.producers[i]` entry, or the single `ai` object as the plan demands.
|
|
865
|
-
*/
|
|
866
|
-
declare const injectRemoteFlags: (text: string, plans: ReadonlyArray<RemoteBindingPlan>) => string;
|
|
867
|
-
interface MaterializeOptions {
|
|
868
|
-
/** When `false`, the call is a no-op (returns `enabled: false`). */
|
|
869
|
-
enabled: boolean;
|
|
870
|
-
projectRoot: string;
|
|
871
|
-
}
|
|
872
|
-
interface MaterializeResult {
|
|
873
|
-
/**
|
|
874
|
-
* Removes the generated temp config file. Always present and always safe to
|
|
875
|
-
* call: it is idempotent, a no-op when nothing was written (disabled /
|
|
876
|
-
* fall-through cases), and never throws if the path is already gone. The dev
|
|
877
|
-
* command calls this on every exit path (normal, signal, error).
|
|
878
|
-
*/
|
|
879
|
-
cleanup: () => void;
|
|
880
|
-
/**
|
|
881
|
-
* Absolute path to the generated temp config to pass to
|
|
882
|
-
* `wrangler dev --config`. `undefined` when remote mode is disabled, no
|
|
883
|
-
* wrangler config was found, it failed to parse, or it declared no eligible
|
|
884
|
-
* binding (nothing to remote — run plain local dev).
|
|
885
|
-
*/
|
|
886
|
-
configPath?: string;
|
|
887
|
-
/** Whether remote mode was requested at all. */
|
|
888
|
-
enabled: boolean;
|
|
889
|
-
/** Why no temp config was produced, for logging (only set when none was). */
|
|
890
|
-
reason?: string;
|
|
891
|
-
/** The bindings flipped to remote, for the dev banner. */
|
|
892
|
-
remoteBindings: RemoteBindingPlan[];
|
|
893
|
-
}
|
|
894
|
-
/**
|
|
895
|
-
* Produce a temporary wrangler config with `"remote": true` on every eligible
|
|
896
|
-
* binding, so `lunora dev` can run `wrangler dev --config <temp>` against the
|
|
897
|
-
* deployed D1/KV/R2 without touching the user's file.
|
|
898
|
-
*
|
|
899
|
-
* The temp file is written as a sibling of the source `wrangler.jsonc` (in the
|
|
900
|
-
* project root), NOT an OS temp dir: wrangler resolves a config's relative paths
|
|
901
|
-
* (`main`, `assets`, `migrations_dir`, …) against the **config file's own
|
|
902
|
-
* directory**, so a temp config in `/tmp` would make wrangler look for
|
|
903
|
-
* `/tmp/src/server.ts` and fail to start the worker. Keeping it beside the real
|
|
904
|
-
* config preserves those relative paths. Returns `configPath: undefined` (with a
|
|
905
|
-
* `reason`) for every fall-through case so the caller degrades to plain local
|
|
906
|
-
* dev instead of failing.
|
|
907
|
-
*/
|
|
908
|
-
declare const materializeRemoteWranglerConfig: (options: MaterializeOptions) => MaterializeResult;
|
|
909
|
-
/**
|
|
910
|
-
* Parse a `LUNORA_REMOTE` env value into the on/off decision. Truthy when set to
|
|
911
|
-
* `"1"` or `"true"` (case-insensitive); anything else — unset, `"0"`, `"false"`,
|
|
912
|
-
* empty — is off. Mirrors the `"1" | "true"` convention used across the runtime.
|
|
913
|
-
*/
|
|
914
|
-
declare const isRemoteEnvEnabled: (value: string | undefined) => boolean;
|
|
915
|
-
/** The three inputs that can switch remote-binding dev on, in precedence order. */
|
|
916
|
-
interface RemoteEnableInputs {
|
|
917
|
-
/**
|
|
918
|
-
* The `remote` preference from `lunora.json` (the lowest-priority signal).
|
|
919
|
-
* `undefined` means "no project preference"; an explicit `false` here loses
|
|
920
|
-
* to neither the flag nor the env when those are absent — it just stays off.
|
|
921
|
-
*/
|
|
922
|
-
configPreference?: boolean;
|
|
923
|
-
/** The raw `LUNORA_REMOTE` env value (parsed with {@link isRemoteEnvEnabled}). */
|
|
924
|
-
envValue?: string;
|
|
925
|
-
/** The explicit `--remote` CLI flag — `true` when passed, `undefined`/`false` otherwise. */
|
|
926
|
-
flag?: boolean;
|
|
927
|
-
}
|
|
928
|
-
/**
|
|
929
|
-
* Resolve whether remote-binding dev is on, with a clear precedence:
|
|
930
|
-
*
|
|
931
|
-
* 1. an explicit `--remote` flag (highest — a deliberate per-invocation choice),
|
|
932
|
-
* 2. then `LUNORA_REMOTE` in the environment,
|
|
933
|
-
* 3. then the `remote` key in `lunora.json` (lowest — a project default).
|
|
934
|
-
*
|
|
935
|
-
* The flag and env are one-directional (they can only turn remote *on*); only
|
|
936
|
-
* the config preference carries a meaningful `false`, and it applies solely when
|
|
937
|
-
* neither stronger signal is present. So a project that sets `"remote": false`
|
|
938
|
-
* is still overridable per-run by `--remote` or `LUNORA_REMOTE=1`.
|
|
939
|
-
*/
|
|
940
|
-
declare const resolveRemoteEnabled: (inputs: RemoteEnableInputs) => boolean;
|
|
941
621
|
/** Core (always-scaffolded) secrets followed by the package-specific ones for the detected capabilities. */
|
|
942
622
|
declare const requiredSecrets: (packageNames: ReadonlyArray<string>) => SecretEntry[];
|
|
943
623
|
/**
|
|
@@ -1226,44 +906,6 @@ type ParseSchemaResult = {
|
|
|
1226
906
|
* message per failure mode without throwing.
|
|
1227
907
|
*/
|
|
1228
908
|
declare const parseSchema: (source: string) => ParseSchemaResult;
|
|
1229
|
-
/** One filterable Vectorize metadata property a schema declares. */
|
|
1230
|
-
interface VectorMetadataDeclaration {
|
|
1231
|
-
/** The vector index the property belongs to. */
|
|
1232
|
-
index: string;
|
|
1233
|
-
/**
|
|
1234
|
-
* The validator kind behind the column, or `undefined` when the column
|
|
1235
|
-
* isn't in the owning table's shape. Callers map it to the Vectorize
|
|
1236
|
-
* metadata type; a kind that can't be filtered on is reported, not indexed.
|
|
1237
|
-
*/
|
|
1238
|
-
kind: string | undefined;
|
|
1239
|
-
/** Column mirrored into vector metadata. */
|
|
1240
|
-
property: string;
|
|
1241
|
-
}
|
|
1242
|
-
interface SchemaInfo {
|
|
1243
|
-
/** Whether the lunora schema declares any `.global()` table. */
|
|
1244
|
-
hasGlobalTable: boolean;
|
|
1245
|
-
/** Names of vector indexes declared via `.vectorize()` / `defineVectorIndex()`. */
|
|
1246
|
-
vectorIndexNames?: ReadonlyArray<string>;
|
|
1247
|
-
/**
|
|
1248
|
-
* Metadata properties declared filterable on a vector index. Cloudflare
|
|
1249
|
-
* needs an explicit metadata index per property before a `filter` can match
|
|
1250
|
-
* anything, so deploy provisions these and doctor reports them.
|
|
1251
|
-
*/
|
|
1252
|
-
vectorMetadata?: ReadonlyArray<VectorMetadataDeclaration>;
|
|
1253
|
-
}
|
|
1254
|
-
interface DiscoverSchemaInfoResult {
|
|
1255
|
-
/** Parse error message, when the schema exists but could not be analyzed. */
|
|
1256
|
-
error?: string;
|
|
1257
|
-
/** Schema facts, or `undefined` when no `schema.ts` exists or parsing failed. */
|
|
1258
|
-
info: SchemaInfo | undefined;
|
|
1259
|
-
}
|
|
1260
|
-
/**
|
|
1261
|
-
* Discover {@link SchemaInfo} for a project. Returns `{ info: undefined }` when
|
|
1262
|
-
* the project declares no `schema.ts` (not an error), or `{ info: undefined,
|
|
1263
|
-
* error }` when a present schema could not be parsed — callers decide whether a
|
|
1264
|
-
* parse failure is a warning (validator) or simply ignorable (inference).
|
|
1265
|
-
*/
|
|
1266
|
-
declare const discoverSchemaInfo: (projectRoot: string, schemaDirectory: string) => DiscoverSchemaInfoResult;
|
|
1267
909
|
/**
|
|
1268
910
|
* A badge: the short colored label that prefixes a line. `bg`/`fg` are hex so the
|
|
1269
911
|
* same value drives both colorize's `bgHex().hex()` and the tui `<Text>` props.
|
|
@@ -1314,272 +956,4 @@ declare const badgeWidth: (_spec: BadgeSpec) => number;
|
|
|
1314
956
|
declare const paintBadge: (spec: BadgeSpec) => string;
|
|
1315
957
|
/** Dim continuation text (a step's chosen answer, shown under the question). */
|
|
1316
958
|
declare const paintAnswer: (text: string) => string;
|
|
1317
|
-
|
|
1318
|
-
* Single source of truth for "does this wrangler config enable Workers
|
|
1319
|
-
* Cache?" and "what compatibility_date does that require?".
|
|
1320
|
-
*
|
|
1321
|
-
* Before this module, `reconcile-compatibility-date.ts` (auto-bump) and
|
|
1322
|
-
* `wrangler-validator.ts` (validation) each carried their own
|
|
1323
|
-
* `WORKERS_CACHE_MIN_DATE` literal and their own top-level/`exports[]`
|
|
1324
|
-
* cache-enabled walk — two copies of the same fact that could silently drift
|
|
1325
|
-
* apart (a date bumped in one file without the other would either validate a
|
|
1326
|
-
* config the reconciler wouldn't produce, or vice versa).
|
|
1327
|
-
*/
|
|
1328
|
-
/** The `compatibility_date` Workers Cache (`cache.enabled: true`) requires. */
|
|
1329
|
-
declare const WORKERS_CACHE_MIN_DATE = "2026-05-01";
|
|
1330
|
-
/** The subset of a parsed `wrangler.jsonc` the cache-enabled check reads. */
|
|
1331
|
-
interface WranglerCacheShape {
|
|
1332
|
-
cache?: {
|
|
1333
|
-
enabled?: boolean;
|
|
1334
|
-
} | null;
|
|
1335
|
-
exports?: Record<string, {
|
|
1336
|
-
cache?: {
|
|
1337
|
-
enabled?: boolean;
|
|
1338
|
-
} | null;
|
|
1339
|
-
} | null> | null;
|
|
1340
|
-
}
|
|
1341
|
-
/**
|
|
1342
|
-
* Whether Workers Cache is enabled anywhere in a parsed wrangler config — the
|
|
1343
|
-
* top-level `cache.enabled` toggle, or a per-export override in
|
|
1344
|
-
* `exports[name].cache.enabled` (Workers can scope cache per named export).
|
|
1345
|
-
* `undefined`/`null` (an unparsed or absent config) is treated as disabled.
|
|
1346
|
-
*/
|
|
1347
|
-
declare const isCacheEnabled: (parsed: WranglerCacheShape | null | undefined) => boolean;
|
|
1348
|
-
/** Candidate wrangler config filenames, in the order every consumer probes them. */
|
|
1349
|
-
declare const WRANGLER_FILES: readonly ["wrangler.jsonc", "wrangler.json"];
|
|
1350
|
-
/** Locate the project's wrangler config, or `undefined` when none exists. */
|
|
1351
|
-
declare const findWranglerFile: (projectRoot: string) => string | undefined;
|
|
1352
|
-
interface ReadWranglerResult<T> {
|
|
1353
|
-
/** Parsed config, or `undefined` when the file was not valid JSONC. */
|
|
1354
|
-
parsed: T | undefined;
|
|
1355
|
-
/** Raw file text — needed for comment-preserving `modify`/`applyEdits`. */
|
|
1356
|
-
text: string;
|
|
1357
|
-
}
|
|
1358
|
-
/**
|
|
1359
|
-
* Read and JSONC-parse a wrangler config file. Returns the raw `text` (for
|
|
1360
|
-
* structural edits) alongside `parsed`, which is `undefined` when the file is
|
|
1361
|
-
* not valid JSONC or does not parse to an object. Allows trailing commas, as
|
|
1362
|
-
* wrangler does.
|
|
1363
|
-
*/
|
|
1364
|
-
declare const readWranglerJsonc: <T = unknown>(wranglerPath: string) => ReadWranglerResult<T>;
|
|
1365
|
-
/**
|
|
1366
|
-
* Pure scan of a `vars` map for plaintext secrets — the FS-free core, exported for
|
|
1367
|
-
* unit tests. A variable is flagged when, for a **string** value that is neither a
|
|
1368
|
-
* placeholder nor a public/publishable key, EITHER the value matches a known
|
|
1369
|
-
* secret shape (`secretKindOf`) OR the key name strongly implies a secret and the
|
|
1370
|
-
* value is long enough to plausibly be one. `kind` is the matched shape, or
|
|
1371
|
-
* `secret_named_var` for the key-name path.
|
|
1372
|
-
*/
|
|
1373
|
-
declare const scanWranglerVariablesForSecrets: (variables: Record<string, unknown> | undefined, file: string) => WranglerVariableIR[];
|
|
1374
|
-
/**
|
|
1375
|
-
* Read the project's `wrangler.jsonc` and return its plaintext-secret `vars` as IR
|
|
1376
|
-
* for the `plaintext_secret_in_wrangler_vars` lint. Returns `[]` when there is no
|
|
1377
|
-
* wrangler config, it doesn't parse, or nothing looks like a secret. Scans the
|
|
1378
|
-
* top-level `vars` block (mirroring the existing `validateCorsVariables` scope);
|
|
1379
|
-
* per-environment `env.<name>.vars` overrides are out of scope for now.
|
|
1380
|
-
*/
|
|
1381
|
-
declare const collectWranglerSecretVariables: (projectRoot: string) => WranglerVariableIR[];
|
|
1382
|
-
declare const REQUIRED_COMPATIBILITY_DATE: string;
|
|
1383
|
-
declare const REQUIRED_FLAG: string;
|
|
1384
|
-
interface WranglerDurableObjectBinding {
|
|
1385
|
-
class_name?: string;
|
|
1386
|
-
name?: string;
|
|
1387
|
-
}
|
|
1388
|
-
/**
|
|
1389
|
-
* A `tail_consumers` entry: a Worker that receives this Worker's tail events
|
|
1390
|
-
* (logs, exceptions, fetch metadata) for forwarding to an external sink. See
|
|
1391
|
-
* `withTailConsumer` for the wiring helper.
|
|
1392
|
-
*/
|
|
1393
|
-
interface TailConsumer {
|
|
1394
|
-
/** Optional Cloudflare environment of the consumer Worker. */
|
|
1395
|
-
environment?: string;
|
|
1396
|
-
/** Name of the Worker that consumes tail events. */
|
|
1397
|
-
service?: string;
|
|
1398
|
-
}
|
|
1399
|
-
/** A wrangler `containers[]` entry (parsed from untrusted JSONC). */
|
|
1400
|
-
interface WranglerContainerEntry {
|
|
1401
|
-
class_name?: string;
|
|
1402
|
-
image?: string;
|
|
1403
|
-
instance_type?: string | {
|
|
1404
|
-
disk_mb?: number;
|
|
1405
|
-
memory_mib?: number;
|
|
1406
|
-
vcpu?: number;
|
|
1407
|
-
};
|
|
1408
|
-
max_instances?: number;
|
|
1409
|
-
}
|
|
1410
|
-
/**
|
|
1411
|
-
* A wrangler `workflows[]` entry (parsed from untrusted JSONC). Unlike
|
|
1412
|
-
* containers, workflows are NOT Durable Objects — the entry stands alone (no
|
|
1413
|
-
* `durable_objects` binding, no migration class).
|
|
1414
|
-
*/
|
|
1415
|
-
interface WranglerWorkflowEntry {
|
|
1416
|
-
binding?: string;
|
|
1417
|
-
class_name?: string;
|
|
1418
|
-
name?: string;
|
|
1419
|
-
}
|
|
1420
|
-
/** A wrangler `queues.producers[]` entry — a `Queue` binding sending to `queue`. */
|
|
1421
|
-
interface WranglerQueueProducer {
|
|
1422
|
-
binding?: string;
|
|
1423
|
-
delivery_delay?: number;
|
|
1424
|
-
queue?: string;
|
|
1425
|
-
}
|
|
1426
|
-
/** A wrangler `queues.consumers[]` entry — push (worker) or `type: "http_pull"`. */
|
|
1427
|
-
interface WranglerQueueConsumer {
|
|
1428
|
-
dead_letter_queue?: string;
|
|
1429
|
-
max_batch_size?: number;
|
|
1430
|
-
max_batch_timeout?: number;
|
|
1431
|
-
max_retries?: number;
|
|
1432
|
-
queue?: string;
|
|
1433
|
-
retry_delay?: number;
|
|
1434
|
-
type?: string;
|
|
1435
|
-
}
|
|
1436
|
-
interface WranglerConfig {
|
|
1437
|
-
analytics_engine_datasets?: ReadonlyArray<{
|
|
1438
|
-
binding?: string;
|
|
1439
|
-
dataset?: string;
|
|
1440
|
-
} | null | undefined>;
|
|
1441
|
-
assets?: {
|
|
1442
|
-
binding?: string;
|
|
1443
|
-
directory?: string;
|
|
1444
|
-
html_handling?: string;
|
|
1445
|
-
not_found_handling?: string;
|
|
1446
|
-
};
|
|
1447
|
-
browser?: {
|
|
1448
|
-
binding?: string;
|
|
1449
|
-
};
|
|
1450
|
-
cache?: {
|
|
1451
|
-
enabled?: boolean;
|
|
1452
|
-
} | null;
|
|
1453
|
-
compatibility_date?: string;
|
|
1454
|
-
compatibility_flags?: ReadonlyArray<string>;
|
|
1455
|
-
containers?: ReadonlyArray<WranglerContainerEntry | null | undefined>;
|
|
1456
|
-
d1_databases?: ReadonlyArray<{
|
|
1457
|
-
binding?: string;
|
|
1458
|
-
}>;
|
|
1459
|
-
dispatch_namespaces?: ReadonlyArray<{
|
|
1460
|
-
binding?: string;
|
|
1461
|
-
namespace?: string;
|
|
1462
|
-
outbound?: unknown;
|
|
1463
|
-
} | null | undefined>;
|
|
1464
|
-
durable_objects?: {
|
|
1465
|
-
bindings?: ReadonlyArray<WranglerDurableObjectBinding>;
|
|
1466
|
-
};
|
|
1467
|
-
exports?: Record<string, {
|
|
1468
|
-
cache?: {
|
|
1469
|
-
enabled?: boolean;
|
|
1470
|
-
} | null;
|
|
1471
|
-
type?: string;
|
|
1472
|
-
} | null> | null;
|
|
1473
|
-
flagship?: ReadonlyArray<{
|
|
1474
|
-
app_id?: string;
|
|
1475
|
-
binding?: string;
|
|
1476
|
-
} | null | undefined>;
|
|
1477
|
-
hyperdrive?: ReadonlyArray<{
|
|
1478
|
-
binding?: string;
|
|
1479
|
-
id?: string;
|
|
1480
|
-
localConnectionString?: string;
|
|
1481
|
-
} | null | undefined>;
|
|
1482
|
-
images?: {
|
|
1483
|
-
binding?: string;
|
|
1484
|
-
};
|
|
1485
|
-
kv_namespaces?: ReadonlyArray<{
|
|
1486
|
-
binding?: string;
|
|
1487
|
-
id?: string;
|
|
1488
|
-
} | null | undefined>;
|
|
1489
|
-
logpush?: boolean;
|
|
1490
|
-
migrations?: ReadonlyArray<{
|
|
1491
|
-
new_classes?: ReadonlyArray<string>;
|
|
1492
|
-
new_sqlite_classes?: ReadonlyArray<string>;
|
|
1493
|
-
} | null | undefined>;
|
|
1494
|
-
mtls_certificates?: ReadonlyArray<{
|
|
1495
|
-
binding?: string;
|
|
1496
|
-
certificate_id?: string;
|
|
1497
|
-
} | null | undefined>;
|
|
1498
|
-
observability?: {
|
|
1499
|
-
enabled?: boolean;
|
|
1500
|
-
head_sampling_rate?: number;
|
|
1501
|
-
logs?: {
|
|
1502
|
-
enabled?: boolean;
|
|
1503
|
-
head_sampling_rate?: number;
|
|
1504
|
-
};
|
|
1505
|
-
};
|
|
1506
|
-
pipelines?: ReadonlyArray<{
|
|
1507
|
-
binding?: string;
|
|
1508
|
-
pipeline?: string;
|
|
1509
|
-
stream?: string;
|
|
1510
|
-
} | null | undefined>;
|
|
1511
|
-
placement?: {
|
|
1512
|
-
mode?: string;
|
|
1513
|
-
};
|
|
1514
|
-
queues?: {
|
|
1515
|
-
consumers?: ReadonlyArray<WranglerQueueConsumer | null | undefined>;
|
|
1516
|
-
producers?: ReadonlyArray<WranglerQueueProducer | null | undefined>;
|
|
1517
|
-
};
|
|
1518
|
-
r2_buckets?: ReadonlyArray<{
|
|
1519
|
-
binding?: string;
|
|
1520
|
-
}>;
|
|
1521
|
-
secrets_store_secrets?: ReadonlyArray<{
|
|
1522
|
-
binding?: string;
|
|
1523
|
-
secret_name?: string;
|
|
1524
|
-
store_id?: string;
|
|
1525
|
-
} | null | undefined>;
|
|
1526
|
-
send_email?: ReadonlyArray<{
|
|
1527
|
-
allowed_destination_addresses?: ReadonlyArray<string>;
|
|
1528
|
-
destination_address?: string;
|
|
1529
|
-
name?: string;
|
|
1530
|
-
} | null | undefined>;
|
|
1531
|
-
services?: ReadonlyArray<{
|
|
1532
|
-
binding?: string;
|
|
1533
|
-
entrypoint?: string;
|
|
1534
|
-
environment?: string;
|
|
1535
|
-
service?: string;
|
|
1536
|
-
} | null | undefined>;
|
|
1537
|
-
tail_consumers?: ReadonlyArray<TailConsumer | null | undefined>;
|
|
1538
|
-
vars?: Record<string, unknown>;
|
|
1539
|
-
vectorize?: ReadonlyArray<{
|
|
1540
|
-
binding?: string;
|
|
1541
|
-
index_name?: string;
|
|
1542
|
-
} | null | undefined>;
|
|
1543
|
-
workflows?: ReadonlyArray<WranglerWorkflowEntry | null | undefined>;
|
|
1544
|
-
}
|
|
1545
|
-
interface WranglerValidationReport {
|
|
1546
|
-
errors: string[];
|
|
1547
|
-
valid: boolean;
|
|
1548
|
-
warnings: string[];
|
|
1549
|
-
}
|
|
1550
|
-
/**
|
|
1551
|
-
* Return a new `WranglerConfig` with `consumer` present in `tail_consumers`,
|
|
1552
|
-
* wiring this Worker to forward its tail events (logs/exceptions) to another
|
|
1553
|
-
* Worker that fans them out to an external sink. Pure and idempotent: an
|
|
1554
|
-
* existing entry with the same `service` + `environment` is left untouched
|
|
1555
|
-
* rather than duplicated, so it is safe to call on every codegen/deploy.
|
|
1556
|
-
*/
|
|
1557
|
-
declare const withTailConsumer: (wrangler: WranglerConfig, consumer: TailConsumer) => WranglerConfig;
|
|
1558
|
-
/**
|
|
1559
|
-
* Pure validator: given a parsed `WranglerConfig` object and an optional
|
|
1560
|
-
* `SchemaInfo`, produce a structured report. Performs no I/O.
|
|
1561
|
-
*/
|
|
1562
|
-
declare const validateWranglerConfig: (wrangler: WranglerConfig | undefined, schema?: SchemaInfo) => WranglerValidationReport;
|
|
1563
|
-
/**
|
|
1564
|
-
* Convenience alias matching the original task-spec signature
|
|
1565
|
-
* `validateWrangler(wranglerJson, schema)` returning
|
|
1566
|
-
* `{ valid, errors, warnings }`.
|
|
1567
|
-
*/
|
|
1568
|
-
declare const validateWrangler: typeof validateWranglerConfig;
|
|
1569
|
-
interface WranglerProjectValidationOptions {
|
|
1570
|
-
projectRoot: string;
|
|
1571
|
-
schemaDir?: string;
|
|
1572
|
-
}
|
|
1573
|
-
interface WranglerProjectValidationResult {
|
|
1574
|
-
problems: ReadonlyArray<string>;
|
|
1575
|
-
report: WranglerValidationReport;
|
|
1576
|
-
wranglerPath: string | undefined;
|
|
1577
|
-
}
|
|
1578
|
-
/**
|
|
1579
|
-
* File-system aware variant: reads `wrangler.jsonc`/`wrangler.json` from
|
|
1580
|
-
* the given project root, discovers the schema (if any), and delegates to
|
|
1581
|
-
* `validateWranglerConfig`. Returns the legacy
|
|
1582
|
-
* `{ problems, wranglerPath }` shape plus the structured `report`.
|
|
1583
|
-
*/
|
|
1584
|
-
declare const validateWranglerProject: (options: WranglerProjectValidationOptions) => WranglerProjectValidationResult;
|
|
1585
|
-
export { ACCENT, AGENT_MODE_ENV, AGENT_RULES_DIR, AGENT_RULES_HINT, AGENT_RULES_HINT_ENV, type AddIndexEdit, type AddOptionalColumnEdit, type AddTableEdit, type AdditiveEdit, type AgentDetection, type AgentRulesStatus, type ApplyEditResult, type ApplyFailureReason, type AugmentPlan, BADGES, BADGE_COLUMN_WIDTH, type BadgeName, type BadgeSpec, type ClaimDevServerStateResult, type ContainerLogLevel, type ContainerLogLine, type ContainerLogSource, type ContainerLogStreamHandle, type ContainerLogStreamOptions, DEV_DAEMON_ENV, DEV_HANDOFF_ENV, DEV_LOG_FILE, DEV_LOG_FILE_ENV, DEV_STATE_DIR, DEV_STATE_FILE, DEV_VARS_EXAMPLE_FILE, DEV_VARS_FILE, DEV_VARS_KEY_PATTERN, type DestructiveEdit, type DetectedFramework, type DevSecretsFillPlan, type DevServerMode, type DevServerState, type DiscoverAgentInfoResult, type DiscoverContainerInfoResult, type DiscoverSchemaInfoResult, type DiscoverWorkflowInfoResult, type DockerLike, type EnsureDevVariablesDeps, type EnsureDevVariablesResult, type EnsureDevVariablesStatus, type ExportGap, type FillDevSecretsResult, type FrameworkClass, type FrameworkDetection, type InferOptions, type InferredAgent, type InferredBindings, type InferredContainer, type InferredWorkflow, LINKED_PROJECT_DIR, LINKED_PROJECT_FILE, LUNA_ART, LUNA_BUNNY, LUNA_NAME, LUNA_SIGNOFF, LUNORA_CONFIG_FILE, LUNORA_EVENT_SOURCE, LUNORA_SKILL_NAMES, type LevelBadgeName, type LinkedProject, type LunoraFormattedLine, type LunoraLineLevel, type LunoraProjectConfig, LunoraReporter, type MaterializeOptions, type MaterializeResult, type MultiSelectOption, PACKAGE_SECRETS_REGISTRY, type ParseSchemaResult, REMOTE_ELIGIBLE_KEYS, REQUIRED_COMPATIBILITY_DATE, REQUIRED_FLAG, ROOT_SKILL_NAME, type ReadWranglerResult, type ReconcileBindingsResult, type ReconcileCompatibilityDateResult, type ReconcileResult as ReconcileCronsResult, type RemoteBindingPlan, type RemoteEnableInputs, type RemotePreference, type RemoteWranglerShape, STEP_BADGE_NAMES, type ScaffoldPlan, type SchemaColumn, type SchemaEdit, type SchemaIndex, type SchemaInfo, type SchemaTable, type SecretEntry, type SelectOption, type StepBadgeName, type TailConsumer, WORKERS_CACHE_MIN_DATE, WRANGLER_FILES, type WranglerCacheShape, type WranglerConfig, type WranglerContainerEntry, type WranglerProjectValidationOptions, type WranglerProjectValidationResult, type WranglerValidationReport, type WranglerWorkflowEntry, applyAdditiveEdit, badgeLead, badgeWidth, buildPackageSecretsBlock, claimAgentRulesHint, claimDevServerState, classifyEdit, clearDevServerState, collectWranglerSecretVariables, createConfirm, detectAgentRules, detectAiAgent, detectFramework, discoverAgentInfo, discoverContainerInfo, discoverSchemaInfo, discoverWorkflowInfo, ensureDevVariables, ensureDevVariablesExample as ensureDevVarsExample, fillDevSecrets, findWranglerFile, formatLunoraEvent, generateSecretValue, inferLunoraBindings, injectRemoteFlags, interpretRemote, isCacheEnabled, isInteractive, isMintableSecretKey, isPlaceholderValue, isProcessAlive, isRecordedProcessCurrent, isRemoteEnvEnabled, materializeRemoteWranglerConfig, packageNamesFromBindings, padBadge, paintAnswer, paintBadge, parseDevVariableEntries, parseSchema, planDevSecretsFill, planDevVariablesAugment, planDevVariablesScaffold, planRemoteBindings, promptMultiSelect, promptSelect, promptText, promptYesNo, readDevServerState, readLinkedProject, readLiveDevServerState, readProjectDependencyNames, readProjectRemotePreference, readWranglerJsonc, reconcileWranglerBindings, reconcileWranglerCompatibilityDate, reconcileWranglerCrons, requiredSecrets, resolveRemoteEnabled, scanWranglerVariablesForSecrets, secretsForPackages, streamContainerLogs, updateDevServerState, validateWrangler, validateWranglerConfig, validateWranglerProject, withTailConsumer, writeDevServerState, writeLinkedProject };
|
|
959
|
+
export { ACCENT, AGENT_MODE_ENV, AGENT_RULES_DIR, AGENT_RULES_HINT, AGENT_RULES_HINT_ENV, type AddIndexEdit, type AddOptionalColumnEdit, type AddTableEdit, type AdditiveEdit, type AgentDetection, type AgentRulesStatus, type ApplyEditResult, type ApplyFailureReason, type AugmentPlan, BADGES, BADGE_COLUMN_WIDTH, type BadgeName, type BadgeSpec, type ClaimDevServerStateResult, type ContainerLogLevel, type ContainerLogLine, type ContainerLogSource, type ContainerLogStreamHandle, type ContainerLogStreamOptions, DEFAULT_DEPLOY_TARGET, DEV_DAEMON_ENV, DEV_HANDOFF_ENV, DEV_LOG_FILE, DEV_LOG_FILE_ENV, DEV_STATE_DIR, DEV_STATE_FILE, DEV_VARS_EXAMPLE_FILE, DEV_VARS_FILE, DEV_VARS_KEY_PATTERN, type DeployDriver, type DestructiveEdit, type DetectedFramework, type DevSecretsFillPlan, type DevServerMode, type DevServerState, type DiscoverAgentInfoResult, type DiscoverContainerInfoResult, type DiscoverWorkflowInfoResult, type DockerLike, type EnsureDevVariablesDeps, type EnsureDevVariablesResult, type EnsureDevVariablesStatus, type FillDevSecretsResult, type FrameworkClass, type FrameworkDetection, LINKED_PROJECT_DIR, LINKED_PROJECT_FILE, LUNA_ART, LUNA_BUNNY, LUNA_NAME, LUNA_SIGNOFF, LUNORA_CONFIG_FILE, LUNORA_EVENT_SOURCE, LUNORA_SKILL_NAMES, type LevelBadgeName, type LinkedProject, type LunoraFormattedLine, type LunoraLineLevel, type LunoraProjectConfig, LunoraReporter, type MultiSelectOption, PACKAGE_SECRETS_REGISTRY, type ParseSchemaResult, ROOT_SKILL_NAME, type RemotePreference, STEP_BADGE_NAMES, type ScaffoldPlan, type SchemaColumn, type SchemaEdit, type SchemaIndex, type SchemaTable, type SecretEntry, type SelectOption, type StepBadgeName, applyAdditiveEdit, badgeLead, badgeWidth, buildPackageSecretsBlock, claimAgentRulesHint, claimDevServerState, classifyEdit, clearDevServerState, createConfirm, deployTargetIds, detectAgentRules, detectAiAgent, detectFramework, discoverAgentInfo, discoverContainerInfo, discoverWorkflowInfo, ensureDevVariables, ensureDevVariablesExample as ensureDevVarsExample, fillDevSecrets, formatLunoraEvent, generateSecretValue, interpretRemote, isInteractive, isMintableSecretKey, isPlaceholderValue, isProcessAlive, isRecordedProcessCurrent, padBadge, paintAnswer, paintBadge, parseDevVariableEntries, parseSchema, planDevSecretsFill, planDevVariablesAugment, planDevVariablesScaffold, promptMultiSelect, promptSelect, promptText, promptYesNo, readDevServerState, readLinkedProject, readLiveDevServerState, readProjectDependencyNames, readProjectRemotePreference, readProjectTarget, requiredSecrets, resolveDeployDriver, resolveProjectTarget, resolveTargetOrThrow, secretsForPackages, streamContainerLogs, updateDevServerState, writeDevServerState, writeLinkedProject };
|