@lunora/config 1.0.0-alpha.7 → 1.0.0-alpha.70

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.
Files changed (36) hide show
  1. package/LICENSE.md +6 -0
  2. package/__assets__/package-og.svg +1 -1
  3. package/dist/index.d.mts +466 -10
  4. package/dist/index.d.ts +466 -10
  5. package/dist/index.mjs +17 -9
  6. package/dist/packem_shared/AGENT_MODE_ENV-B5R7jpY7.mjs +17 -0
  7. package/dist/packem_shared/DEV_DAEMON_ENV-FIEtW7Fz.mjs +163 -0
  8. package/dist/packem_shared/{PACKAGE_SECRETS_REGISTRY-CySy5vR_.mjs → PACKAGE_SECRETS_REGISTRY-BeRSvrl5.mjs} +45 -1
  9. package/dist/packem_shared/{POLICY_SCAFFOLD_ENDPOINT-CiC2IGKx.mjs → POLICY_SCAFFOLD_ENDPOINT-CvTZpaZF.mjs} +7 -10
  10. package/dist/packem_shared/{REMOTE_ELIGIBLE_KEYS-BC7_e9Bz.mjs → REMOTE_ELIGIBLE_KEYS-C-F_Flgy.mjs} +1 -6
  11. package/dist/packem_shared/{REQUIRED_COMPATIBILITY_DATE-ycqievRl.mjs → REQUIRED_COMPATIBILITY_DATE-DP0SFVy9.mjs} +135 -4
  12. package/dist/packem_shared/{SCHEMA_EDIT_ENDPOINT-Df-Wrix-.mjs → SCHEMA_EDIT_ENDPOINT-Bt2SNkpV.mjs} +4 -8
  13. package/dist/packem_shared/{SEED_ENDPOINT-DVCjaGO-.mjs → SEED_ENDPOINT-7izz_Jao.mjs} +1 -1
  14. package/dist/packem_shared/WORKERS_CACHE_MIN_DATE-CaXbS7CX.mjs +11 -0
  15. package/dist/packem_shared/assetContentType-ByZjeV3D.mjs +72 -0
  16. package/dist/packem_shared/{buildPackageSecretsBlock-S74dgmwy.mjs → buildPackageSecretsBlock-B-dWb-Sa.mjs} +115 -21
  17. package/dist/packem_shared/collectWranglerSecretVariables-p4ezBYQ4.mjs +56 -0
  18. package/dist/packem_shared/{createConfirm-fvpdgJ9s.mjs → createConfirm-BMikeJC9.mjs} +22 -5
  19. package/dist/packem_shared/{detectFramework-Br-BcPBq.mjs → detectFramework-U08038Yp.mjs} +3 -3
  20. package/dist/packem_shared/discoverAgentInfo-eXA3hF4v.mjs +19 -0
  21. package/dist/packem_shared/{discoverSchemaInfo-DWtypqpP.mjs → discoverSchemaInfo-BB-CKlTK.mjs} +1 -1
  22. package/dist/packem_shared/{inferLunoraBindings-XNJH4pup.mjs → inferLunoraBindings-BcvvtpSG.mjs} +146 -51
  23. package/dist/packem_shared/jsonc-edit-SbcD7MAe.mjs +9 -0
  24. package/dist/packem_shared/parseDevVariable-B0FEvfHC.mjs +21 -0
  25. package/dist/packem_shared/{reconcileWranglerBindings-DTHmqTbL.mjs → reconcileWranglerBindings-2Cww5VLa.mjs} +114 -29
  26. package/dist/packem_shared/reconcileWranglerCompatibilityDate-C8c497ag.mjs +31 -0
  27. package/dist/packem_shared/reconcileWranglerCrons-DvsceVFz.mjs +29 -0
  28. package/dist/packem_shared/{serveJsonHandler-B4OLTGLS.mjs → serveJsonHandler-Cl2Wqkv8.mjs} +2 -2
  29. package/dist/packem_shared/streamContainerLogs-BZ4cOZwH.mjs +157 -0
  30. package/dist/packem_shared/write-atomic-B2REqapi.mjs +14 -0
  31. package/dist/studio-host/index.d.mts +45 -3
  32. package/dist/studio-host/index.d.ts +45 -3
  33. package/dist/studio-host/index.mjs +6 -6
  34. package/package.json +11 -8
  35. package/dist/packem_shared/loadStudioAssets-Csk5RS4E.mjs +0 -28
  36. package/dist/packem_shared/parseDevVariable-CJiq2IwE.mjs +0 -30
package/dist/index.d.mts CHANGED
@@ -1,7 +1,38 @@
1
- import { ContainerIR, WorkflowIR } from '@lunora/codegen';
2
- export type { ContainerIR, WorkflowIR } from '@lunora/codegen';
1
+ import { AgentIR, ContainerIR, WorkflowIR, QueueIR, WranglerVariableIR } from '@lunora/codegen';
2
+ export type { AgentIR, ContainerIR, WorkflowIR } from '@lunora/codegen';
3
+ import { Writable } from 'node:stream';
3
4
  import 'ts-morph';
4
5
  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-DCmwn7zQ.mjs";
6
+ /** Minimal env shape — `process.env` structurally, injectable for tests. */
7
+ type EnvLike = Readonly<Record<string, string | undefined>>;
8
+ /** One detected agent: which tool, and which env var gave it away. */
9
+ interface AgentDetection {
10
+ /** Human-readable agent name, for the "agent detected" log line. */
11
+ name: string;
12
+ /** The environment variable that matched. */
13
+ variable: string;
14
+ }
15
+ /** Env var that forces agent mode on (`1`/`true`) or off (`0`/`false`), overriding detection. */
16
+ declare const AGENT_MODE_ENV = "LUNORA_AGENT_MODE";
17
+ /**
18
+ * Detect the AI agent driving this process, or `undefined` when none is.
19
+ * `LUNORA_AGENT_MODE` wins over `@visulima/find-ai-runner`'s marker table in
20
+ * both directions. Pure — pass a custom `env` in tests.
21
+ */
22
+ 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;
5
36
  /**
6
37
  * Project-relative directory the Lunora agent skills ("rules") install into.
7
38
  * This is the portable [Agent Skills](https://tanstack.com/intent/latest/docs/registry)
@@ -65,6 +96,77 @@ interface DiscoverContainerInfoResult {
65
96
  * (inference).
66
97
  */
67
98
  declare const discoverContainerInfo: (projectRoot: string, schemaDirectory: string) => DiscoverContainerInfoResult;
99
+ /** Severity a container output line is surfaced at: `stderr` → `error`, `stdout` → `info`. */
100
+ type ContainerLogLevel = "error" | "info";
101
+ /** One declared container to follow, identified by the names codegen lifts from `defineContainer`. */
102
+ interface ContainerLogSource {
103
+ /** Generated Durable Object class name, e.g. `TranscoderContainer`. Wrangler's dev image is `cloudflare-dev/&lt;lowercased>`. */
104
+ className: string;
105
+ /** The `lunora/containers.ts` export name, e.g. `transcoder` — used as the display tag. */
106
+ exportName: string;
107
+ }
108
+ /** A single line of container output handed back to the caller. */
109
+ interface ContainerLogLine {
110
+ /** `"error"` for the container's stderr, `"info"` for its stdout. */
111
+ level: ContainerLogLevel;
112
+ /** The container's export name (`transcoder`), for tagging the line. */
113
+ name: string;
114
+ /** One output line, with the trailing newline (and any `\r`) stripped. */
115
+ text: string;
116
+ }
117
+ interface ContainerLogStreamOptions {
118
+ /** The declared containers to follow. An empty list yields an inert handle. */
119
+ containers: ReadonlyArray<ContainerLogSource>;
120
+ /** Injected Docker client — defaults to a real lazily-imported `dockerode` instance. Tests pass a stub. */
121
+ docker?: DockerLike;
122
+ /** Called once per container output line. */
123
+ onLine: (line: ContainerLogLine) => void;
124
+ /** Called once when the Docker engine can't be reached (re-armed after it recovers). Defaults to silent. */
125
+ onUnavailable?: (message: string) => void;
126
+ /** Poll interval override, in ms. */
127
+ pollIntervalMs?: number;
128
+ }
129
+ /** Handle controlling a running log stream. */
130
+ interface ContainerLogStreamHandle {
131
+ /** Stop polling and tear down every attached log stream. Idempotent. */
132
+ close: () => void;
133
+ }
134
+ /** The minimal structural slice of a `dockerode` log stream this module consumes. */
135
+ interface DockerLogStream {
136
+ destroy: () => void;
137
+ on: (event: "data" | "end" | "error", listener: (chunk?: Buffer) => void) => void;
138
+ }
139
+ /** The minimal structural slice of a `dockerode` instance this module consumes. */
140
+ interface DockerLike {
141
+ getContainer: (id: string) => {
142
+ logs: (options: {
143
+ follow: true;
144
+ stderr: true;
145
+ stdout: true;
146
+ tail: "all";
147
+ timestamps: false;
148
+ }) => Promise<DockerLogStream>;
149
+ };
150
+ listContainers: (options: {
151
+ filters: {
152
+ status: ["running"];
153
+ };
154
+ }) => Promise<{
155
+ Id: string;
156
+ Image: string;
157
+ }[]>;
158
+ modem: {
159
+ demuxStream: (stream: DockerLogStream, stdout: Writable, stderr: Writable) => void;
160
+ };
161
+ }
162
+ /**
163
+ * Follow the local Docker logs of every declared container, emitting each output
164
+ * line through `onLine` tagged with its export name. Polls for containers (they
165
+ * start lazily on first request and may be replaced on restart), attaches once
166
+ * per container id, and drops streams whose container has gone. Returns
167
+ * immediately with a `close()` handle; all work happens asynchronously.
168
+ */
169
+ declare const streamContainerLogs: (options: ContainerLogStreamOptions) => ContainerLogStreamHandle;
68
170
  /**
69
171
  * The meta-frameworks Lunora can compose with, plus `"none"` for a standalone
70
172
  * SPA / SSR-less project (the current default). Mirrors PLAN4 §2.4.
@@ -85,6 +187,13 @@ interface FrameworkDetection {
85
187
  framework: DetectedFramework;
86
188
  }
87
189
  /**
190
+ * Read and parse the project `package.json`, returning its merged
191
+ * `dependencies` + `devDependencies` name set (empty on any failure). Public
192
+ * so sibling consumers (e.g. the CLI's Vite-project detection) share one
193
+ * best-effort reader instead of re-parsing `package.json` themselves.
194
+ */
195
+ declare const readProjectDependencyNames: (root: string) => ReadonlySet<string>;
196
+ /**
88
197
  * Detect which meta-framework a project uses by inspecting its `package.json`
89
198
  * dependencies, and classify it under void's class-A/B/C model (PLAN4 §3).
90
199
  *
@@ -93,6 +202,112 @@ interface FrameworkDetection {
93
202
  * SPA flow is preserved.
94
203
  */
95
204
  declare const detectFramework: (root: string) => FrameworkDetection;
205
+ /** Directory holding per-checkout Lunora state (gitignored by convention). */
206
+ declare const DEV_STATE_DIR = ".lunora";
207
+ /** The dev-server state filename, relative to the project root. */
208
+ declare const DEV_STATE_FILE: string;
209
+ /** Log file a backgrounded dev server's output is captured to, relative to the project root. */
210
+ declare const DEV_LOG_FILE: string;
211
+ /**
212
+ * Marker env `lunora dev --background` sets on the detached server process
213
+ * (the daemon `lunora dev` or `vite dev`), so it records itself as
214
+ * `background: true` — and, for the CLI daemon, never re-detects an agent and
215
+ * recurses into background mode again.
216
+ */
217
+ declare const DEV_DAEMON_ENV = "LUNORA_DEV_DAEMON";
218
+ /** Env carrying the capture-log path into the detached server, recorded in the state file. */
219
+ declare const DEV_LOG_FILE_ENV = "LUNORA_DEV_LOG_FILE";
220
+ /**
221
+ * Env carrying the PID of a parent that holds a *provisional* state record it
222
+ * expects the child dev server to supersede. The CLI claims `.lunora/dev.json`
223
+ * with its own PID before spawning the real server (closing the duplicate-start
224
+ * race for the vite flavor and the wrangler daemon), then hands its PID down
225
+ * via this variable; the child's claim (see {@link claimDevServerState}'s
226
+ * `supersedePid`) may replace exactly that record with the authoritative
227
+ * URL + PID.
228
+ */
229
+ declare const DEV_HANDOFF_ENV = "LUNORA_DEV_HANDOFF_PID";
230
+ /** How the recorded dev server runs. */
231
+ type DevServerMode = "cli" | "vite";
232
+ /** The state record persisted to `.lunora/dev.json`. */
233
+ interface DevServerState {
234
+ /** Whether the server was detached into the background (`lunora dev --background`). */
235
+ background?: boolean;
236
+ /** Absolute path of the log file capturing the server's output, when captured. */
237
+ logFile?: string;
238
+ /** `"cli"` for the `lunora dev` wrangler orchestration, `"vite"` for a Vite dev server. */
239
+ mode: DevServerMode;
240
+ /** PID of the process to signal for shutdown (the orchestrating CLI or the Vite process). */
241
+ pid: number;
242
+ /** ISO-8601 stamp written at startup, purely informational (drives `status` uptime). */
243
+ startedAt?: string;
244
+ /** The embedded studio server's URL, when it runs. */
245
+ studioUrl?: string;
246
+ /** The primary URL serving the worker/app. */
247
+ url: string;
248
+ }
249
+ /**
250
+ * True when a process with `pid` is currently alive AND signalable by this
251
+ * user. Signal `0` performs the existence check without delivering anything.
252
+ *
253
+ * `EPERM` ("alive but another user's process") deliberately counts as NOT
254
+ * alive here: every dev server this module tracks was spawned by the current
255
+ * user, so a PID we cannot signal is by definition a recycled PID — treating
256
+ * it as running would wedge the lockfile permanently and aim `dev stop`'s
257
+ * kill escalation at an innocent process.
258
+ */
259
+ declare const isProcessAlive: (pid: number) => boolean;
260
+ /**
261
+ * True when the record's PID verifiably still refers to the dev server that
262
+ * wrote the record — not merely "some process exists with that number".
263
+ * Guards against PID reuse: a server process necessarily starts BEFORE its
264
+ * record is written, so a process that started after `startedAt` (+ skew) is
265
+ * a recycled PID wearing the corpse's number. The start-time check runs only
266
+ * where the platform exposes it (Linux); elsewhere liveness alone decides.
267
+ */
268
+ declare const isRecordedProcessCurrent: (state: DevServerState) => boolean;
269
+ /**
270
+ * Read the state record from `.lunora/dev.json`, or `undefined` when there is
271
+ * no usable record. Best-effort; performs NO liveness check — use
272
+ * {@link readLiveDevServerState} for "is a dev server actually running".
273
+ */
274
+ declare const readDevServerState: (projectRoot: string) => DevServerState | undefined;
275
+ /**
276
+ * Write the state record to `.lunora/dev.json`, creating the `.lunora/`
277
+ * directory when absent. Returns the absolute path written, or `undefined`
278
+ * when the write failed (state is convenience metadata — a read-only checkout
279
+ * must never crash dev startup).
280
+ */
281
+ declare const writeDevServerState: (projectRoot: string, state: DevServerState) => string | undefined;
282
+ /**
283
+ * Merge `patch` into the existing state record, when one exists. Used by the
284
+ * CLI to stamp `background`/`logFile` onto the record the Vite plugin wrote.
285
+ * Returns the merged record, or `undefined` when there was nothing to update.
286
+ */
287
+ declare const updateDevServerState: (projectRoot: string, patch: Partial<DevServerState>) => DevServerState | undefined;
288
+ /**
289
+ * Remove `.lunora/dev.json`. Idempotent and never throws. When `expectedPid`
290
+ * is given, the file is only removed while it still records that PID — so a
291
+ * shutting-down server can't clobber the record a newer server just wrote.
292
+ */
293
+ declare const clearDevServerState: (projectRoot: string, expectedPid?: number) => void;
294
+ /**
295
+ * The state record of a dev server that is verifiably running right now, or
296
+ * `undefined`. A record whose PID is dead — or recycled onto a different
297
+ * process (see {@link isRecordedProcessCurrent}) — is stale: it is cleared on
298
+ * the spot so subsequent starts don't keep re-reading a corpse.
299
+ */
300
+ declare const readLiveDevServerState: (projectRoot: string) => DevServerState | undefined;
301
+ /** Result of {@link claimDevServerState}: claimed, or lost to the live server already recorded. */
302
+ interface ClaimDevServerStateResult {
303
+ /** The live record that won the race, when `ok` is `false`. */
304
+ existing?: DevServerState;
305
+ /** Whether this process now owns the record. */
306
+ ok: boolean;
307
+ }
308
+ declare const claimDevServerState: (projectRoot: string, state: DevServerState, options?: {
309
+ supersedePid?: number;
310
+ }) => ClaimDevServerStateResult;
96
311
  /**
97
312
  * The `.dev.vars` line grammar — one owner, shared by every reader/writer of the
98
313
  * file so the format can't drift between packages. `@lunora/cli`'s `env`
@@ -156,39 +371,74 @@ interface InferredContainer extends ContainerIR {
156
371
  interface InferredWorkflow extends WorkflowIR {
157
372
  exported: boolean;
158
373
  }
374
+ /**
375
+ * A `defineAgent` declaration plus whether its generated agent
376
+ * `WorkflowEntrypoint` class (e.g. `SupportAgentWorkflow`) is exported by the
377
+ * worker entry. An agent compiles onto a Cloudflare Workflow, so — exactly like
378
+ * {@link InferredWorkflow} — only exported agents are safe to provision
379
+ * (wrangler rejects a `workflows[].class_name` the worker doesn't export), and
380
+ * an agent is NOT a Durable Object (no `durable_objects` binding or migration).
381
+ */
382
+ interface InferredAgent extends AgentIR {
383
+ exported: boolean;
384
+ }
385
+ /**
386
+ * A queue declared in `lunora/queues.ts`. Unlike workflows, a queue needs no
387
+ * worker-entry class export (its `queue()` handler rides `createWorker`), so
388
+ * there is no `exported` flag — every declared queue is reconcilable into the
389
+ * wrangler `queues.producers[]` / `queues.consumers[]`.
390
+ */
391
+ type InferredQueue = QueueIR;
159
392
  interface InferredBindings {
393
+ /** Agents declared in `lunora/agents.ts` (exported or not — see {@link InferredAgent.exported}); reconciled into `workflows[]`. */
394
+ agents: InferredAgent[];
160
395
  /** Containers declared in `lunora/containers.ts` (exported or not — see {@link InferredContainer.exported}). */
161
396
  containers: InferredContainer[];
162
397
  /** Durable Objects the worker entry exports → safe to bind. */
163
398
  durableObjects: DurableObjectSpec[];
399
+ /**
400
+ * The wrangler `flagship[].binding` name implied by `lunora/flags.ts` when it
401
+ * uses the Flagship provider in binding mode — `undefined` for HTTP-mode
402
+ * Flagship, a custom OpenFeature provider, or no flags. The binding needs an
403
+ * un-mintable `app_id`, so it is reconciled as a hint, not auto-written.
404
+ */
405
+ flagshipBinding?: string;
164
406
  /** Schema declares a `.global()` table → needs the `DB` D1 binding. */
165
407
  needsD1: boolean;
408
+ /** Queues declared in `lunora/queues.ts` → reconciled into `queues.producers[]` / `queues.consumers[]`. */
409
+ queues: InferredQueue[];
166
410
  /** Human-readable provenance for each inferred binding / hint, for logging. */
167
411
  signals: string[];
168
412
  /** `@lunora/ai` is imported or `env.AI` is used → needs the `ai` Workers AI binding. */
169
413
  usesAi: boolean;
170
- /** `@lunora/analytics` is imported → self-describing `analytics_engine_datasets` binding (auto-writeable). */
414
+ /** `@lunora/bindings/analytics` is imported → self-describing `analytics_engine_datasets` binding (auto-writeable). */
171
415
  usesAnalytics: boolean;
172
416
  /** `@lunora/auth` is imported (sessions may be D1- or `SessionDO`-backed). */
173
417
  usesAuth: boolean;
174
418
  /** `@lunora/browser` is imported → self-describing `browser` binding (auto-writeable). */
175
419
  usesBrowser: boolean;
420
+ /** `lunora/flags.ts` declares a feature-flag provider (any OpenFeature provider — Flagship or custom). */
421
+ usesFlags: boolean;
176
422
  /** `@lunora/hyperdrive` is imported (binding needs an un-mintable remote `id`; hint-only). */
177
423
  usesHyperdrive: boolean;
178
- /** `@lunora/images` is imported → self-describing `images` binding (auto-writeable). */
424
+ /** `@lunora/bindings/images` is imported → self-describing `images` binding (auto-writeable). */
179
425
  usesImages: boolean;
180
- /** `@lunora/kv` is imported (namespace binding name + id are user-defined; hint-only). */
426
+ /** `@lunora/bindings/kv` is imported (namespace binding name + id are user-defined; hint-only). */
181
427
  usesKv: boolean;
182
428
  /** `@lunora/mail` is imported (Resend API key must be set in `.dev.vars`; no binding). */
183
429
  usesMail: boolean;
184
430
  /** `@lunora/payment` is imported (provider secrets must be set in `.dev.vars`; no binding). */
185
431
  usesPayment: boolean;
186
- /** `@lunora/pipelines` is imported (binding needs an un-mintable remote pipeline name; hint-only). */
432
+ /** `ctx.pipelines` is used (binding needs an un-mintable remote pipeline name; hint-only). */
187
433
  usesPipelines: boolean;
188
434
  /** `@lunora/scheduler` is imported. */
189
435
  usesScheduler: boolean;
190
436
  /** `@lunora/storage` is imported (R2 bucket binding name is user-defined). */
191
437
  usesStorage: boolean;
438
+ /** `@lunora/x402/charge` is imported — the charge rail settles USDC to a recipient address (a public `[vars]` entry, user-named; hint-only). */
439
+ usesX402Charge: boolean;
440
+ /** `@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). */
441
+ usesX402Pay: boolean;
192
442
  /** Workflows declared in `lunora/workflows.ts` (exported or not — see {@link InferredWorkflow.exported}). */
193
443
  workflows: InferredWorkflow[];
194
444
  }
@@ -338,6 +588,15 @@ interface SecretEntry {
338
588
  */
339
589
  placeholderValue: string;
340
590
  }
591
+ /**
592
+ * Secrets every Lunora project needs regardless of which capability packages are
593
+ * installed — scaffolded into `.dev.vars` always. `LUNORA_ADMIN_TOKEN` is the
594
+ * bearer the local Studio uses to call the worker's admin endpoints (the data
595
+ * browser, schema edits) in dev; the worker reads the SAME `.dev.vars` value via
596
+ * its admin gate, so both agree and the Studio authenticates without a prompt.
597
+ * Without it, every `/_lunora/admin/*` call is `ADMIN_FORBIDDEN` (403).
598
+ */
599
+
341
600
  /**
342
601
  * The canonical registry of per-package secret requirements.
343
602
  *
@@ -429,6 +688,16 @@ interface SelectOption<T extends string> {
429
688
  declare const promptSelect: <T extends string>(message: string, options: ReadonlyArray<SelectOption<T>>, settings?: {
430
689
  default?: T;
431
690
  }) => Promise<T | undefined>;
691
+ /**
692
+ * Ask a free-text question on stdin, returning the trimmed answer. An empty
693
+ * answer (just Enter) takes `settings.default`. In a non-interactive context
694
+ * (CI / piped — no TTY) it never reads and returns `settings.default` (or
695
+ * `undefined`), mirroring {@link promptSelect}'s "non-interactive ⇒ fall back"
696
+ * policy so automation never blocks.
697
+ */
698
+ declare const promptText: (message: string, settings?: {
699
+ default?: string;
700
+ }) => Promise<string | undefined>;
432
701
  /** One choice in a {@link promptMultiSelect} list. Identical shape to {@link SelectOption}; `value` is returned when picked. */
433
702
  type MultiSelectOption<T extends string> = SelectOption<T>;
434
703
  /**
@@ -456,12 +725,12 @@ declare const promptMultiSelect: <T extends string>(message: string, options: Re
456
725
  interface ExportGap {
457
726
  /** Generated class wrangler needs exported, e.g. `OrderPipelineWorkflow`. */
458
727
  className: string;
459
- /** The `lunora/{containers,workflows}.ts` export name, e.g. `orderPipeline`. */
728
+ /** The `lunora/{agents,containers,workflows}.ts` export name, e.g. `orderPipeline`. */
460
729
  exportName: string;
461
730
  /** Which declaration is unexported. */
462
- kind: "container" | "workflow";
731
+ kind: "agent" | "container" | "workflow";
463
732
  /** The `_generated/{module}` to re-export from, e.g. `workflows`. */
464
- module: "containers" | "workflows";
733
+ module: "agents" | "containers" | "workflows";
465
734
  }
466
735
  interface ReconcileBindingsResult {
467
736
  /** Short labels for each binding written (e.g. `"SCHEDULER/SchedulerDO"`). */
@@ -488,6 +757,44 @@ interface ReconcileBindingsResult {
488
757
  * config already satisfies the inferred needs.
489
758
  */
490
759
  declare const reconcileWranglerBindings: (projectRoot: string, inferred: InferredBindings) => ReconcileBindingsResult;
760
+ interface ReconcileCompatibilityDateResult {
761
+ /** `true` when `wrangler.jsonc` was rewritten. */
762
+ changed: boolean;
763
+ /** The new date value, or the existing one when unchanged. */
764
+ date: string | undefined;
765
+ /** Human-readable reason when reconciliation was skipped. */
766
+ reason?: string;
767
+ /** Resolved wrangler path, or `undefined` when none was found. */
768
+ wranglerPath?: string;
769
+ }
770
+ /**
771
+ * Reconcile the `compatibility_date` in `wrangler.jsonc` when Workers Cache
772
+ * is enabled but the date is below the minimum required.
773
+ */
774
+ declare const reconcileWranglerCompatibilityDate: (projectRoot: string) => ReconcileCompatibilityDateResult;
775
+ interface ReconcileResult {
776
+ /** `true` when `wrangler.jsonc` was rewritten. */
777
+ changed: boolean;
778
+ /** Human-readable reason when reconciliation was skipped (for logging). */
779
+ reason?: string;
780
+ /** Resolved wrangler path, or `undefined` when none was found. */
781
+ wranglerPath?: string;
782
+ }
783
+ /**
784
+ * Reconcile the codegen-derived cron schedules into the project's
785
+ * `wrangler.jsonc` `triggers.crons` array, preserving comments and formatting
786
+ * via `jsonc-parser`'s structural edits.
787
+ *
788
+ * When `triggers.crons` already matches `cronTriggers`, nothing is written (so
789
+ * we don't churn the file or trip the dev server's file watcher). When the
790
+ * project declares no crons, a stale non-empty array is cleared so removed
791
+ * crons stop firing.
792
+ *
793
+ * This intentionally writes the SAME `triggers.crons` shape the
794
+ * `@lunora/config` validator accepts, so the wrangler validator never fights
795
+ * the generated value.
796
+ */
797
+ declare const reconcileWranglerCrons: (projectRoot: string, cronTriggers: ReadonlyArray<string>) => ReconcileResult;
491
798
  /**
492
799
  * The wrangler config sections Lunora can safely flip to remote mode in dev,
493
800
  * each with the human label used in logs and the structural `shape` the entry
@@ -659,6 +966,8 @@ interface RemoteEnableInputs {
659
966
  * is still overridable per-run by `--remote` or `LUNORA_REMOTE=1`.
660
967
  */
661
968
  declare const resolveRemoteEnabled: (inputs: RemoteEnableInputs) => boolean;
969
+ /** Core (always-scaffolded) secrets followed by the package-specific ones for the detected capabilities. */
970
+ declare const requiredSecrets: (packageNames: ReadonlyArray<string>) => SecretEntry[];
662
971
  /**
663
972
  * Whether an (already-unquoted) value looks like a fill-me-in placeholder —
664
973
  * empty, angle-bracketed, or containing a known marker — rather than a real
@@ -667,6 +976,15 @@ declare const resolveRemoteEnabled: (inputs: RemoteEnableInputs) => boolean;
667
976
  */
668
977
  declare const isPlaceholderValue: (value: string) => boolean;
669
978
  /**
979
+ * True for a secret-looking key whose value Lunora can mint locally (a random
980
+ * 32-byte hex, like `openssl rand -hex 32`) — e.g. `AUTH_SECRET`,
981
+ * `LUNORA_ADMIN_TOKEN`, `STORAGE_SIGNING_SECRET`. False for provider-issued keys
982
+ * ({@link PROVIDER_SECRET_KEYS}) and any non-secret key.
983
+ */
984
+ declare const isMintableSecretKey: (key: string) => boolean;
985
+ /** Mint a fresh strong secret value — 64 hex chars (32 bytes), like `openssl rand -hex 32`. */
986
+ declare const generateSecretValue: (randomHex?: (bytes: number) => string) => string;
987
+ /**
670
988
  * The outcome of planning a scaffold — a discriminated union so the orchestrator
671
989
  * never has to re-derive whether `content` is present.
672
990
  *
@@ -768,6 +1086,58 @@ declare const buildPackageSecretsBlock: (packageNames: ReadonlyArray<string>, ex
768
1086
  * **Safety invariant:** only placeholder values are written — no real secrets.
769
1087
  */
770
1088
  declare const ensureDevVariablesExample: (cwd: string, packageNames: ReadonlyArray<string>) => string[];
1089
+ interface DevSecretsFillPlan {
1090
+ /** {@link CORE_SECRETS} keys appended because they were absent (each generated). */
1091
+ addedKeys: string[];
1092
+ /** The full new file content to write. */
1093
+ content: string;
1094
+ /** Existing empty/placeholder secret-keyed entries filled with fresh values. */
1095
+ filledKeys: string[];
1096
+ }
1097
+ /**
1098
+ * Plan the in-place generation of dev secrets for a `.dev.vars`. First, every
1099
+ * line whose KEY looks like a secret (`*_SECRET`, `*_TOKEN`, `*_KEY`,
1100
+ * `*_PASSWORD`) and whose value is empty or a placeholder gets a freshly
1101
+ * generated value — so a `lunora add`-scaffolded `.dev.vars` (which writes each
1102
+ * secret blank) becomes usable on `lunora dev` / `vite dev` without the user
1103
+ * running `openssl` by hand. Second, any {@link CORE_SECRETS} key absent from
1104
+ * the file is appended (generated) — notably `LUNORA_ADMIN_TOKEN`, which the
1105
+ * local Studio needs to call the worker's admin gate in dev (without it the
1106
+ * Studio shows its login gate).
1107
+ *
1108
+ * Pure (given `randomHex`): real (non-placeholder) values are never touched, and
1109
+ * comments + non-secret entries are preserved verbatim.
1110
+ */
1111
+ declare const planDevSecretsFill: (input: {
1112
+ existingContent: string;
1113
+ randomHex?: (bytes: number) => string;
1114
+ }) => DevSecretsFillPlan;
1115
+ interface FillDevSecretsResult {
1116
+ /** Core secret keys appended (generated) because they were missing. */
1117
+ addedKeys: string[];
1118
+ /** Existing empty/placeholder secrets filled with generated values. */
1119
+ filledKeys: string[];
1120
+ /** `created` = no `.dev.vars` existed; `filled` = topped up an existing one; `unchanged` = nothing to do. */
1121
+ status: "created" | "filled" | "unchanged";
1122
+ }
1123
+ /**
1124
+ * Generate any missing/empty dev secrets in the project's `.dev.vars`, in place.
1125
+ *
1126
+ * Complements {@link ensureDevVariables} (which scaffolds `.dev.vars` from
1127
+ * `.dev.vars.example`). A `lunora add`-scaffolded project writes secrets blank
1128
+ * straight into `.dev.vars` (no example) and never includes `LUNORA_ADMIN_TOKEN`
1129
+ * — so the worker boots with empty secrets and the Studio shows its login gate.
1130
+ * This fills those gaps at dev startup, so both `lunora dev` and the
1131
+ * `@lunora/vite` dev server give a working project with zero manual `openssl`.
1132
+ *
1133
+ * Never overwrites a real (non-placeholder) value. The write is atomic + owner-
1134
+ * only (temp + rename, `mode: 0o600`), matching the other `.dev.vars` writers.
1135
+ */
1136
+ declare const fillDevSecrets: (deps: {
1137
+ cwd: string;
1138
+ info?: (message: string) => void;
1139
+ randomHex?: (bytes: number) => string;
1140
+ }) => FillDevSecretsResult;
771
1141
  /** Add a new table to `defineSchema({ ... })`. */
772
1142
  interface AddTableEdit {
773
1143
  readonly kind: "addTable";
@@ -947,6 +1317,37 @@ declare const badgeWidth: (_spec: BadgeSpec) => number;
947
1317
  declare const paintBadge: (spec: BadgeSpec) => string;
948
1318
  /** Dim continuation text (a step's chosen answer, shown under the question). */
949
1319
  declare const paintAnswer: (text: string) => string;
1320
+ /**
1321
+ * Single source of truth for "does this wrangler config enable Workers
1322
+ * Cache?" and "what compatibility_date does that require?".
1323
+ *
1324
+ * Before this module, `reconcile-compatibility-date.ts` (auto-bump) and
1325
+ * `wrangler-validator.ts` (validation) each carried their own
1326
+ * `WORKERS_CACHE_MIN_DATE` literal and their own top-level/`exports[]`
1327
+ * cache-enabled walk — two copies of the same fact that could silently drift
1328
+ * apart (a date bumped in one file without the other would either validate a
1329
+ * config the reconciler wouldn't produce, or vice versa).
1330
+ */
1331
+ /** The `compatibility_date` Workers Cache (`cache.enabled: true`) requires. */
1332
+ declare const WORKERS_CACHE_MIN_DATE = "2026-05-01";
1333
+ /** The subset of a parsed `wrangler.jsonc` the cache-enabled check reads. */
1334
+ interface WranglerCacheShape {
1335
+ cache?: {
1336
+ enabled?: boolean;
1337
+ } | null;
1338
+ exports?: Record<string, {
1339
+ cache?: {
1340
+ enabled?: boolean;
1341
+ } | null;
1342
+ } | null> | null;
1343
+ }
1344
+ /**
1345
+ * Whether Workers Cache is enabled anywhere in a parsed wrangler config — the
1346
+ * top-level `cache.enabled` toggle, or a per-export override in
1347
+ * `exports[name].cache.enabled` (Workers can scope cache per named export).
1348
+ * `undefined`/`null` (an unparsed or absent config) is treated as disabled.
1349
+ */
1350
+ declare const isCacheEnabled: (parsed: WranglerCacheShape | null | undefined) => boolean;
950
1351
  /** Candidate wrangler config filenames, in the order every consumer probes them. */
951
1352
  declare const WRANGLER_FILES: readonly ["wrangler.jsonc", "wrangler.json"];
952
1353
  /** Locate the project's wrangler config, or `undefined` when none exists. */
@@ -964,6 +1365,23 @@ interface ReadWranglerResult<T> {
964
1365
  * wrangler does.
965
1366
  */
966
1367
  declare const readWranglerJsonc: <T = unknown>(wranglerPath: string) => ReadWranglerResult<T>;
1368
+ /**
1369
+ * Pure scan of a `vars` map for plaintext secrets — the FS-free core, exported for
1370
+ * unit tests. A variable is flagged when, for a **string** value that is neither a
1371
+ * placeholder nor a public/publishable key, EITHER the value matches a known
1372
+ * secret shape (`secretKindOf`) OR the key name strongly implies a secret and the
1373
+ * value is long enough to plausibly be one. `kind` is the matched shape, or
1374
+ * `secret_named_var` for the key-name path.
1375
+ */
1376
+ declare const scanWranglerVariablesForSecrets: (variables: Record<string, unknown> | undefined, file: string) => WranglerVariableIR[];
1377
+ /**
1378
+ * Read the project's `wrangler.jsonc` and return its plaintext-secret `vars` as IR
1379
+ * for the `plaintext_secret_in_wrangler_vars` lint. Returns `[]` when there is no
1380
+ * wrangler config, it doesn't parse, or nothing looks like a secret. Scans the
1381
+ * top-level `vars` block (mirroring the existing `validateCorsVariables` scope);
1382
+ * per-environment `env.&lt;name>.vars` overrides are out of scope for now.
1383
+ */
1384
+ declare const collectWranglerSecretVariables: (projectRoot: string) => WranglerVariableIR[];
967
1385
  declare const REQUIRED_COMPATIBILITY_DATE: string;
968
1386
  declare const REQUIRED_FLAG: string;
969
1387
  interface WranglerDurableObjectBinding {
@@ -1002,6 +1420,22 @@ interface WranglerWorkflowEntry {
1002
1420
  class_name?: string;
1003
1421
  name?: string;
1004
1422
  }
1423
+ /** A wrangler `queues.producers[]` entry — a `Queue` binding sending to `queue`. */
1424
+ interface WranglerQueueProducer {
1425
+ binding?: string;
1426
+ delivery_delay?: number;
1427
+ queue?: string;
1428
+ }
1429
+ /** A wrangler `queues.consumers[]` entry — push (worker) or `type: "http_pull"`. */
1430
+ interface WranglerQueueConsumer {
1431
+ dead_letter_queue?: string;
1432
+ max_batch_size?: number;
1433
+ max_batch_timeout?: number;
1434
+ max_retries?: number;
1435
+ queue?: string;
1436
+ retry_delay?: number;
1437
+ type?: string;
1438
+ }
1005
1439
  interface WranglerConfig {
1006
1440
  analytics_engine_datasets?: ReadonlyArray<{
1007
1441
  binding?: string;
@@ -1016,6 +1450,9 @@ interface WranglerConfig {
1016
1450
  browser?: {
1017
1451
  binding?: string;
1018
1452
  };
1453
+ cache?: {
1454
+ enabled?: boolean;
1455
+ } | null;
1019
1456
  compatibility_date?: string;
1020
1457
  compatibility_flags?: ReadonlyArray<string>;
1021
1458
  containers?: ReadonlyArray<WranglerContainerEntry | null | undefined>;
@@ -1030,6 +1467,16 @@ interface WranglerConfig {
1030
1467
  durable_objects?: {
1031
1468
  bindings?: ReadonlyArray<WranglerDurableObjectBinding>;
1032
1469
  };
1470
+ exports?: Record<string, {
1471
+ cache?: {
1472
+ enabled?: boolean;
1473
+ } | null;
1474
+ type?: string;
1475
+ } | null> | null;
1476
+ flagship?: ReadonlyArray<{
1477
+ app_id?: string;
1478
+ binding?: string;
1479
+ } | null | undefined>;
1033
1480
  hyperdrive?: ReadonlyArray<{
1034
1481
  binding?: string;
1035
1482
  id?: string;
@@ -1066,9 +1513,18 @@ interface WranglerConfig {
1066
1513
  placement?: {
1067
1514
  mode?: string;
1068
1515
  };
1516
+ queues?: {
1517
+ consumers?: ReadonlyArray<WranglerQueueConsumer | null | undefined>;
1518
+ producers?: ReadonlyArray<WranglerQueueProducer | null | undefined>;
1519
+ };
1069
1520
  r2_buckets?: ReadonlyArray<{
1070
1521
  binding?: string;
1071
1522
  }>;
1523
+ secrets_store_secrets?: ReadonlyArray<{
1524
+ binding?: string;
1525
+ secret_name?: string;
1526
+ store_id?: string;
1527
+ } | null | undefined>;
1072
1528
  send_email?: ReadonlyArray<{
1073
1529
  allowed_destination_addresses?: ReadonlyArray<string>;
1074
1530
  destination_address?: string;
@@ -1128,4 +1584,4 @@ interface WranglerProjectValidationResult {
1128
1584
  * `{ problems, wranglerPath }` shape plus the structured `report`.
1129
1585
  */
1130
1586
  declare const validateWranglerProject: (options: WranglerProjectValidationOptions) => WranglerProjectValidationResult;
1131
- export { ACCENT, AGENT_RULES_DIR, AGENT_RULES_HINT, AGENT_RULES_HINT_ENV, type AddIndexEdit, type AddOptionalColumnEdit, type AddTableEdit, type AdditiveEdit, type AgentRulesStatus, type ApplyEditResult, type ApplyFailureReason, type AugmentPlan, BADGES, BADGE_COLUMN_WIDTH, type BadgeName, type BadgeSpec, DEV_VARS_EXAMPLE_FILE, DEV_VARS_FILE, DEV_VARS_KEY_PATTERN, type DestructiveEdit, type DetectedFramework, type DiscoverContainerInfoResult, type DiscoverSchemaInfoResult, type DiscoverWorkflowInfoResult, type EnsureDevVariablesDeps, type EnsureDevVariablesResult, type EnsureDevVariablesStatus, type ExportGap, type FrameworkClass, type FrameworkDetection, type InferOptions, 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 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, WRANGLER_FILES, type WranglerConfig, type WranglerContainerEntry, type WranglerProjectValidationOptions, type WranglerProjectValidationResult, type WranglerValidationReport, type WranglerWorkflowEntry, applyAdditiveEdit, badgeLead, badgeWidth, buildPackageSecretsBlock, claimAgentRulesHint, classifyEdit, createConfirm, detectAgentRules, detectFramework, discoverContainerInfo, discoverSchemaInfo, discoverWorkflowInfo, ensureDevVariables, ensureDevVariablesExample as ensureDevVarsExample, findWranglerFile, formatLunoraEvent, inferLunoraBindings, injectRemoteFlags, interpretRemote, isInteractive, isPlaceholderValue, isRemoteEnvEnabled, materializeRemoteWranglerConfig, packageNamesFromBindings, padBadge, paintAnswer, paintBadge, parseDevVariableEntries, parseSchema, planDevVariablesAugment, planDevVariablesScaffold, planRemoteBindings, promptMultiSelect, promptSelect, promptYesNo, readLinkedProject, readProjectRemotePreference, readWranglerJsonc, reconcileWranglerBindings, resolveRemoteEnabled, secretsForPackages, validateWrangler, validateWranglerConfig, validateWranglerProject, withTailConsumer, writeLinkedProject };
1587
+ 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 };