@lunora/cli 1.0.0-alpha.89 → 1.0.0-alpha.90

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 (3) hide show
  1. package/dist/index.d.mts +281 -361
  2. package/dist/index.d.ts +281 -361
  3. package/package.json +12 -12
package/dist/index.d.ts CHANGED
@@ -10,24 +10,24 @@ interface RunCliOptions {
10
10
  argv?: ReadonlyArray<string>;
11
11
  cwd?: string;
12
12
  /**
13
- * Inject a console-like logger so callers (tests) can capture cerebro's
14
- * help / version / usage rendering. Omitted in production, where cerebro
15
- * uses its default stdout/stderr logger.
16
- */
13
+ * Inject a console-like logger so callers (tests) can capture cerebro's
14
+ * help / version / usage rendering. Omitted in production, where cerebro
15
+ * uses its default stdout/stderr logger.
16
+ */
17
17
  logger?: Console;
18
18
  }
19
19
  /**
20
- * Run the CLI and resolve to the process exit code. cerebro handles help,
21
- * version, usage, and unknown commands (the latter throws, caught here as 1).
22
- * `shouldExitProcess: false` keeps the process alive so callers/tests read the
23
- * captured exit code.
24
- */
20
+ * Run the CLI and resolve to the process exit code. cerebro handles help,
21
+ * version, usage, and unknown commands (the latter throws, caught here as 1).
22
+ * `shouldExitProcess: false` keeps the process alive so callers/tests read the
23
+ * captured exit code.
24
+ */
25
25
  declare const runCli: (options?: RunCliOptions) => Promise<number>;
26
26
  /**
27
- * The `--api-spec` flag's accepted values, mirroring `@lunora/codegen`'s
28
- * `CodegenOptions["apiSpec"]`. `"openapi"` (the default) emits `openapi.json`;
29
- * `"openrpc"` emits `openrpc.json`; `"both"` emits both; `"none"` emits neither.
30
- */
27
+ * The `--api-spec` flag's accepted values, mirroring `@lunora/codegen`'s
28
+ * `CodegenOptions["apiSpec"]`. `"openapi"` (the default) emits `openapi.json`;
29
+ * `"openrpc"` emits `openrpc.json`; `"both"` emits both; `"none"` emits neither.
30
+ */
31
31
  type ApiSpec = NonNullable<CodegenOptions["apiSpec"]>;
32
32
  interface Logger {
33
33
  debug?: (message: string) => void;
@@ -37,11 +37,11 @@ interface Logger {
37
37
  warn: (message: string) => void;
38
38
  }
39
39
  /**
40
- * Narrowed view over the pail instance. `createPail` returns an intersection
41
- * type that includes a constructor signature and `(...args: any[])` logger
42
- * overloads, which the type-aware linter cannot safely resolve. We only ever
43
- * call the level methods with a string, so we describe exactly that surface.
44
- */
40
+ * Narrowed view over the pail instance. `createPail` returns an intersection
41
+ * type that includes a constructor signature and `(...args: any[])` logger
42
+ * overloads, which the type-aware linter cannot safely resolve. We only ever
43
+ * call the level methods with a string, so we describe exactly that surface.
44
+ */
45
45
  interface PailLogger {
46
46
  debug: (message: string) => void;
47
47
  error: (message: string) => void;
@@ -49,36 +49,14 @@ interface PailLogger {
49
49
  success: (message: string) => void;
50
50
  warn: (message: string) => void;
51
51
  }
52
- /**
53
- * Minimal reporter shape consumed by `createPail`. We re-declare it locally
54
- * because `@visulima/pail`'s `reporter/*` entrypoints ship a packaging bug:
55
- * their `index.d.ts` re-exports `./json-reporter.d.ts` / `./pretty-reporter.d.ts`,
56
- * but the real declaration files are suffixed (`*.server.d.ts`). `tsc` tolerates
57
- * the dangling re-export, but the type-aware linter resolves `JsonReporter` /
58
- * `PrettyReporter` to an unresolved type. Constructing them through this typed
59
- * factory keeps every call site safe.
60
- */
61
52
  declare const createLogger: () => Logger;
62
53
  /**
63
- * Logger whose every channel writes to `process.stderr`. Used by commands in
64
- * `--format json` mode so all human/progress output stays off stdout leaving
65
- * stdout for the single JSON document the command prints, so `… --format json`
66
- * stays cleanly pipeable (`| jq`). Each line carries a one-character level tag
67
- * so the stream is still readable when a human watches it.
68
- */
69
- /**
70
- * Direct access to the underlying pail instance for advanced use-cases.
71
- * A Proxy keeps the public `pail` binding lazy: the real pail is only
72
- * constructed on first property access, so importing this module (and thus
73
- * the package barrel) stays side-effect-free.
74
- */
54
+ * Direct access to the underlying pail instance for advanced use-cases.
55
+ * A Proxy keeps the public `pail` binding lazy: the real pail is only
56
+ * constructed on first property access, so importing this module (and thus
57
+ * the package barrel) stays side-effect-free.
58
+ */
75
59
  declare const pail: PailLogger;
76
- /**
77
- * Emit a badged step line through the shared pail (the `init` flow's off-TTY
78
- * fallback for the create-astro-style transcript). The `message` may contain
79
- * newlines — `LunoraReporter` indents continuation lines under the badge so a
80
- * dimmed answer sits below its question.
81
- */
82
60
  interface CodegenCommandOptions {
83
61
  /** Which API spec(s) to emit. Defaults to codegen's `"openapi"` when omitted. */
84
62
  apiSpec?: ApiSpec;
@@ -100,14 +78,13 @@ interface CodegenCommandResult {
100
78
  outputDirectory: string;
101
79
  }
102
80
  declare const runCodegenCommand: (options: CodegenCommandOptions) => CodegenCommandResult;
103
- /** `lunora codegen` handler (lazy-loaded via the command's `loader`). */
104
81
  /** Rows per HTTP request when importing. Convex uses ~500; same here. */
105
82
  declare const DEFAULT_IMPORT_BATCH_SIZE = 500;
106
83
  /**
107
- * Minimal projection of `globalThis.fetch` for the export path — we need
108
- * `body` as a stream-iterable, which the shared {@link FetchLike} type
109
- * intentionally hides for the JSON-only commands.
110
- */
84
+ * Minimal projection of `globalThis.fetch` for the export path — we need
85
+ * `body` as a stream-iterable, which the shared {@link FetchLike} type
86
+ * intentionally hides for the JSON-only commands.
87
+ */
111
88
  type StreamingFetchLike = (input: string, init?: {
112
89
  body?: string;
113
90
  headers?: Record<string, string>;
@@ -141,10 +118,10 @@ interface ExportCommandResult {
141
118
  rows: number;
142
119
  }
143
120
  /**
144
- * Stream an export. The worker emits NDJSON; we count newlines as we go and
145
- * pipe straight to the output sink, so a 10M-row export doesn't materialise
146
- * the body in memory.
147
- */
121
+ * Stream an export. The worker emits NDJSON; we count newlines as we go and
122
+ * pipe straight to the output sink, so a 10M-row export doesn't materialise
123
+ * the body in memory.
124
+ */
148
125
  declare const runExportCommand: (options: ExportCommandOptions) => Promise<ExportCommandResult>;
149
126
  interface ImportCommandOptions {
150
127
  /** Rows per HTTP request. Defaults to {@link DEFAULT_IMPORT_BATCH_SIZE}. */
@@ -156,10 +133,10 @@ interface ImportCommandOptions {
156
133
  logger: Logger;
157
134
  prod?: boolean;
158
135
  /**
159
- * Wrap each line as `{table:&lt;name>,doc:&lt;line>}`. Use when the source NDJSON
160
- * is bare docs from a single table — Convex's `convex import --table users`
161
- * shape.
162
- */
136
+ * Wrap each line as `{table:&lt;name>,doc:&lt;line>}`. Use when the source NDJSON
137
+ * is bare docs from a single table — Convex's `convex import --table users`
138
+ * shape.
139
+ */
163
140
  table?: string;
164
141
  token?: string;
165
142
  url?: string;
@@ -173,46 +150,40 @@ interface ImportCommandResult {
173
150
  inserted: number;
174
151
  }
175
152
  /**
176
- * Stream an NDJSON file in chunks, POSTing each batch to
177
- * `/_lunora/admin/import`. We keep the line buffer bounded by `batchSize` so a
178
- * multi-GiB file imports without buffering everything in memory.
179
- */
153
+ * Stream an NDJSON file in chunks, POSTing each batch to
154
+ * `/_lunora/admin/import`. We keep the line buffer bounded by `batchSize` so a
155
+ * multi-GiB file imports without buffering everything in memory.
156
+ */
180
157
  declare const runImportCommand: (options: ImportCommandOptions) => Promise<ImportCommandResult>;
181
158
  /**
182
- * Injectable probe for a Docker-compatible container engine. Tests pass a
183
- * stub; production uses {@link isDockerAvailable}.
184
- */
159
+ * Injectable probe for a Docker-compatible container engine. Tests pass a
160
+ * stub; production uses {@link isDockerAvailable}.
161
+ */
185
162
  type DockerProbe = () => boolean;
186
- /**
187
- * True when a Docker-compatible engine answers `docker info` — the same
188
- * prerequisite `wrangler deploy` has for building and pushing a container
189
- * image from a local Dockerfile. Quiet by design (output discarded): callers
190
- * own the messaging.
191
- */
192
163
  interface SpawnDescriptor {
193
164
  args: ReadonlyArray<string>;
194
165
  /**
195
- * Capture the child's stdout (in addition to streaming it to the parent), so
196
- * the caller can parse it — used by `deploy` to read the deployed URL from
197
- * `wrangler deploy` output. Each chunk is still teed to the parent's stdout
198
- * so the user sees live progress. Mutually exclusive with `stdoutToStderr`.
199
- */
166
+ * Capture the child's stdout (in addition to streaming it to the parent), so
167
+ * the caller can parse it — used by `deploy` to read the deployed URL from
168
+ * `wrangler deploy` output. Each chunk is still teed to the parent's stdout
169
+ * so the user sees live progress. Mutually exclusive with `stdoutToStderr`.
170
+ */
200
171
  captureStdout?: boolean;
201
172
  command: string;
202
173
  cwd?: string;
203
174
  env?: Readonly<Record<string, string>>;
204
175
  /**
205
- * Pipe this string into the child's stdin and close it. Used to feed
206
- * `wrangler secret put` its value without exposing it on the command
207
- * line or in env. When absent, stdin is inherited from the parent.
208
- */
176
+ * Pipe this string into the child's stdin and close it. Used to feed
177
+ * `wrangler secret put` its value without exposing it on the command
178
+ * line or in env. When absent, stdin is inherited from the parent.
179
+ */
209
180
  input?: string;
210
181
  /**
211
- * Route the child's stdout to the parent's STDERR instead of stdout. Set in
212
- * `--format json` mode so a spawned tool's human output (e.g. `wrangler
213
- * deploy`'s progress + the deployed URL) can't interleave with — and corrupt
214
- * — the single JSON document the command prints to stdout.
215
- */
182
+ * Route the child's stdout to the parent's STDERR instead of stdout. Set in
183
+ * `--format json` mode so a spawned tool's human output (e.g. `wrangler
184
+ * deploy`'s progress + the deployed URL) can't interleave with — and corrupt
185
+ * — the single JSON document the command prints to stdout.
186
+ */
216
187
  stdoutToStderr?: boolean;
217
188
  }
218
189
  interface SpawnResult {
@@ -221,18 +192,18 @@ interface SpawnResult {
221
192
  stdout?: string;
222
193
  }
223
194
  /**
224
- * Injectable spawner. Tests pass a stub that just records the descriptor
225
- * instead of executing a real subprocess.
226
- */
195
+ * Injectable spawner. Tests pass a stub that just records the descriptor
196
+ * instead of executing a real subprocess.
197
+ */
227
198
  type Spawner = (descriptor: SpawnDescriptor) => Promise<SpawnResult>;
228
199
  declare const defaultSpawner: Spawner;
229
200
  interface RecordedSpawn {
230
201
  descriptor: SpawnDescriptor;
231
202
  }
232
203
  /**
233
- * Test helper: returns a spawner that records every invocation and resolves
234
- * with the configured exit code.
235
- */
204
+ * Test helper: returns a spawner that records every invocation and resolves
205
+ * with the configured exit code.
206
+ */
236
207
  declare const createRecordingSpawner: (exitCode?: number) => {
237
208
  calls: RecordedSpawn[];
238
209
  spawner: Spawner;
@@ -261,11 +232,6 @@ interface ListRemoteSecretsResult {
261
232
  /** False when wrangler failed or its output could not be parsed. */
262
233
  ok: boolean;
263
234
  }
264
- /**
265
- * Parse `wrangler secret list --format json` output into a sorted name list.
266
- * The payload is an array of `{ name, type }`; anything else yields `undefined`
267
- * so the caller can report a parse failure rather than silently returning [].
268
- */
269
235
  type FetchLike = (input: string, init?: {
270
236
  body?: string;
271
237
  headers?: Record<string, string>;
@@ -291,7 +257,6 @@ interface RunCommandResult {
291
257
  requestUrl: string;
292
258
  }
293
259
  declare const runRpcCommand: (options: RunCommandOptions) => Promise<RunCommandResult>;
294
- /** `lunora run &lt;functionPath>` handler (lazy-loaded via the command's `loader`). */
295
260
  interface DeployCommandOptions {
296
261
  /** Override the schema-drift gate — deploy even with breaking drift and no new migration. */
297
262
  allowSchemaDrift?: boolean;
@@ -301,10 +266,10 @@ interface DeployCommandOptions {
301
266
  /** Docker-availability probe injected in tests. Defaults to a real `docker info` check. */
302
267
  dockerAvailable?: DockerProbe;
303
268
  /**
304
- * Validate, bundle, and run all pre-deploy gates without publishing
305
- * (`wrangler deploy --dry-run`). Post-deploy steps (data migrations, schema
306
- * baseline re-bless) are skipped since nothing shipped.
307
- */
269
+ * Validate, bundle, and run all pre-deploy gates without publishing
270
+ * (`wrangler deploy --dry-run`). Post-deploy steps (data migrations, schema
271
+ * baseline re-bless) are skipped since nothing shipped.
272
+ */
308
273
  dryRun?: boolean;
309
274
  env?: string;
310
275
  /** Fetch implementation injected in tests for `--migrate` RPC calls. */
@@ -315,46 +280,46 @@ interface DeployCommandOptions {
315
280
  interactive?: boolean;
316
281
  logger: Logger;
317
282
  /**
318
- * When true, after a successful `wrangler deploy`, discover and run all
319
- * pending data migrations via the worker's `/_lunora/migrate` admin RPC.
320
- * The worker must be live (exit 0) before migrations are attempted.
321
- *
322
- * Implementation note: the status RPC returns the full shard-level
323
- * migration state, but there is no single authoritative "list of pending
324
- * migration ids" that can be read client-side before running the worker.
325
- * Instead, `--migrate` runs `migrate status` followed by `migrate up` for
326
- * each migration id discovered locally via `discoverMigrations`. The
327
- * worker's `MigrationRunner` is idempotent — running `up` on an already-
328
- * applied migration is a no-op — so this approach is safe.
329
- */
283
+ * When true, after a successful `wrangler deploy`, discover and run all
284
+ * pending data migrations via the worker's `/_lunora/migrate` admin RPC.
285
+ * The worker must be live (exit 0) before migrations are attempted.
286
+ *
287
+ * Implementation note: the status RPC returns the full shard-level
288
+ * migration state, but there is no single authoritative "list of pending
289
+ * migration ids" that can be read client-side before running the worker.
290
+ * Instead, `--migrate` runs `migrate status` followed by `migrate up` for
291
+ * each migration id discovered locally via `discoverMigrations`. The
292
+ * worker's `MigrationRunner` is idempotent — running `up` on an already-
293
+ * applied migration is a no-op — so this approach is safe.
294
+ */
330
295
  migrate?: boolean;
331
296
  /** Admin bearer token for `--migrate` (falls back to `LUNORA_ADMIN_TOKEN`). */
332
297
  migrateToken?: string;
333
298
  /**
334
- * Worker URL for `--migrate`. REQUIRED when `--migrate` is set — the deploy
335
- * handler never captures the URL `wrangler deploy` published to, so there is
336
- * no safe default; omitting it would silently target `http://localhost:8787`
337
- * (the dev worker), applying the migration to local state instead of prod.
338
- */
299
+ * Worker URL for `--migrate`. REQUIRED when `--migrate` is set — the deploy
300
+ * handler never captures the URL `wrangler deploy` published to, so there is
301
+ * no safe default; omitting it would silently target `http://localhost:8787`
302
+ * (the dev worker), applying the migration to local state instead of prod.
303
+ */
339
304
  migrateUrl?: string;
340
305
  /**
341
- * Confirm a production data migration triggered via `--migrate` (the
342
- * `migrate up --prod` confirmation the standalone command requires). Without
343
- * it a `--migrate --migrate-url &lt;prod>` deploy refuses to run the migration.
344
- */
306
+ * Confirm a production data migration triggered via `--migrate` (the
307
+ * `migrate up --prod` confirmation the standalone command requires). Without
308
+ * it a `--migrate --migrate-url &lt;prod>` deploy refuses to run the migration.
309
+ */
345
310
  migrateYes?: boolean;
346
311
  /**
347
- * Emit the bundled worker to this directory via `wrangler deploy --outdir`
348
- * (paired with `dryRun` by `lunora build`). Also writes esbuild metadata to
349
- * `&lt;outDir>/bundle-meta.json`. When unset, no artifact is written.
350
- */
312
+ * Emit the bundled worker to this directory via `wrangler deploy --outdir`
313
+ * (paired with `dryRun` by `lunora build`). Also writes esbuild metadata to
314
+ * `&lt;outDir>/bundle-meta.json`. When unset, no artifact is written.
315
+ */
351
316
  outDir?: string;
352
317
  /**
353
- * Upload a preview version (`wrangler versions upload`) instead of a live
354
- * `wrangler deploy`. Codegen + the drift gate + validation still run, but
355
- * the post-deploy finalize (migrations, baseline re-bless, auto-link, the
356
- * production summary) is skipped — a preview never shifts live traffic.
357
- */
318
+ * Upload a preview version (`wrangler versions upload`) instead of a live
319
+ * `wrangler deploy`. Codegen + the drift gate + validation still run, but
320
+ * the post-deploy finalize (migrations, baseline re-bless, auto-link, the
321
+ * production summary) is skipped — a preview never shifts live traffic.
322
+ */
358
323
  preview?: boolean;
359
324
  /** Railpack-availability probe injected in tests. Defaults to a real `railpack --version` + `BUILDKIT_HOST` check. */
360
325
  railpackAvailable?: DockerProbe;
@@ -365,13 +330,13 @@ interface DeployCommandOptions {
365
330
  skipCodegen?: boolean;
366
331
  spawner?: Spawner;
367
332
  /**
368
- * Deploy to a temporary Cloudflare account (`wrangler deploy --temporary`).
369
- * For unauthenticated use only: wrangler provisions a short-lived account +
370
- * token, deploys, and prints a claim URL; the deployment stays live ~60
371
- * minutes before the unclaimed account is deleted. Wrangler itself errors
372
- * if credentials are already present (OAuth / `CLOUDFLARE_API_TOKEN` /
373
- * global API key), so we pass the flag straight through without guarding.
374
- */
333
+ * Deploy to a temporary Cloudflare account (`wrangler deploy --temporary`).
334
+ * For unauthenticated use only: wrangler provisions a short-lived account +
335
+ * token, deploys, and prints a claim URL; the deployment stays live ~60
336
+ * minutes before the unclaimed account is deleted. Wrangler itself errors
337
+ * if credentials are already present (OAuth / `CLOUDFLARE_API_TOKEN` /
338
+ * global API key), so we pass the flag straight through without guarding.
339
+ */
375
340
  temporary?: boolean;
376
341
  /** Re-bless the committed schema baseline with the current shape (accepts breaking drift). */
377
342
  updateSchemaBaseline?: boolean;
@@ -392,18 +357,17 @@ interface DeployCommandResult {
392
357
  };
393
358
  }
394
359
  /**
395
- * Run a deploy, then (in `--format json` mode) serialize the structured
396
- * {@link DeployCommandResult} to stdout. Human/progress logging is routed to
397
- * stderr for json output so stdout carries only the single JSON document.
398
- */
360
+ * Run a deploy, then (in `--format json` mode) serialize the structured
361
+ * {@link DeployCommandResult} to stdout. Human/progress logging is routed to
362
+ * stderr for json output so stdout carries only the single JSON document.
363
+ */
399
364
  declare const runDeployCommand: (options: DeployCommandOptions) => Promise<DeployCommandResult>;
400
- /** `lunora deploy` handler (lazy-loaded via the command's `loader`). */
401
365
  /**
402
- * Start the codegen watch loop and return a handle to stop it. Regenerates on
403
- * startup, then on debounced changes under `lunora/` (ignoring writes to the
404
- * `_generated/` output to avoid a feedback loop). If the platform can't do a
405
- * recursive watch, it logs once and falls back to startup-only codegen.
406
- */
366
+ * Start the codegen watch loop and return a handle to stop it. Regenerates on
367
+ * startup, then on debounced changes under `lunora/` (ignoring writes to the
368
+ * `_generated/` output to avoid a feedback loop). If the platform can't do a
369
+ * recursive watch, it logs once and falls back to startup-only codegen.
370
+ */
407
371
  declare const startCodegenWatch: (options: CodegenWatcherOptions) => CodegenWatcherHandle;
408
372
  interface CodegenWatcherOptions {
409
373
  /** Which API spec(s) to emit. Defaults to codegen's `"openapi"` when omitted. */
@@ -420,18 +384,18 @@ interface CodegenWatcherHandle {
420
384
  /** Stop watching and cancel any pending regeneration. */
421
385
  close: () => void;
422
386
  /**
423
- * `true` when the platform supports recursive watch and the loop is active.
424
- * `false` when `fs.watch({ recursive })` threw — startup-only codegen was run
425
- * but schema edits will NOT auto-regenerate. Callers can surface this in the
426
- * dev banner so the degraded state is visible beyond the single startup warning.
427
- */
387
+ * `true` when the platform supports recursive watch and the loop is active.
388
+ * `false` when `fs.watch({ recursive })` threw — startup-only codegen was run
389
+ * but schema edits will NOT auto-regenerate. Callers can surface this in the
390
+ * dev banner so the degraded state is visible beyond the single startup warning.
391
+ */
428
392
  watchAvailable: boolean;
429
393
  }
430
394
  /**
431
- * Start the studio server and resolve once it is listening. Loads the static
432
- * bundle + renders the host HTML once up front; serves them and proxies
433
- * `/_lunora/*` (HTTP + WS) to the worker.
434
- */
395
+ * Start the studio server and resolve once it is listening. Loads the static
396
+ * bundle + renders the host HTML once up front; serves them and proxies
397
+ * `/_lunora/*` (HTTP + WS) to the worker.
398
+ */
435
399
  declare const startStudioServer: (options: StudioServerOptions) => Promise<StudioServerHandle>;
436
400
  interface StudioServerOptions {
437
401
  /** Project root — `.dev.vars` is read from here for the admin token. */
@@ -454,33 +418,23 @@ interface StudioServerHandle {
454
418
  url: string;
455
419
  }
456
420
  /**
457
- * How the dev child runs. `wrangler` is the classic `lunora dev` stack (wrangler
458
- * worker + embedded studio + codegen watch) for a standalone class-C project.
459
- * `vite` is a project on `@lunora/vite`: the plugin already runs the worker,
460
- * studio, and codegen inside the Vite dev server, so `lunora dev` runs the
461
- * project's own dev script and gets out of the way — this also covers class-B
462
- * frameworks whose own dev server runs the worker in `workerd` (Astro 6 +
463
- * `@astrojs/cloudflare`, which embeds `@cloudflare/vite-plugin` in `astro dev`:
464
- * SSR + `/_lunora/*` + `ShardDO` in one process, HMR intact). `framework-worker`
465
- * is a class-B framework whose dev server CANNOT host the `ShardDO` Durable
466
- * Object (SvelteKit / Nuxt: their adapters use wrangler's `getPlatformProxy()`,
467
- * which runs an empty-script Miniflare and does not emulate internal DOs); there
468
- * `lunora dev` runs the framework's own dev server (front door, HMR, and — via
469
- * its `@lunora/vite` plugin — studio + codegen) AND a second `wrangler dev`
470
- * sidecar that owns the real `ShardDO` in `workerd`, wired via the committed
471
- * `wrangler.dev.jsonc`.
472
- */
421
+ * How the dev child runs. `wrangler` is the classic `lunora dev` stack (wrangler
422
+ * worker + embedded studio + codegen watch) for a standalone class-C project.
423
+ * `vite` is a project on `@lunora/vite`: the plugin already runs the worker,
424
+ * studio, and codegen inside the Vite dev server, so `lunora dev` runs the
425
+ * project's own dev script and gets out of the way — this also covers class-B
426
+ * frameworks whose own dev server runs the worker in `workerd` (Astro 6 +
427
+ * `@astrojs/cloudflare`, which embeds `@cloudflare/vite-plugin` in `astro dev`:
428
+ * SSR + `/_lunora/*` + `ShardDO` in one process, HMR intact). `framework-worker`
429
+ * is a class-B framework whose dev server CANNOT host the `ShardDO` Durable
430
+ * Object (SvelteKit / Nuxt: their adapters use wrangler's `getPlatformProxy()`,
431
+ * which runs an empty-script Miniflare and does not emulate internal DOs); there
432
+ * `lunora dev` runs the framework's own dev server (front door, HMR, and — via
433
+ * its `@lunora/vite` plugin — studio + codegen) AND a second `wrangler dev`
434
+ * sidecar that owns the real `ShardDO` in `workerd`, wired via the committed
435
+ * `wrangler.dev.jsonc`.
436
+ */
473
437
  type DevFlavor = "framework-worker" | "vite" | "wrangler";
474
- /**
475
- * Detect the dev flavor.
476
- *
477
- * A SvelteKit / Nuxt project needs the two-process `framework-worker` stack even
478
- * though it also declares `@lunora/vite` (which its framework dev server uses for
479
- * codegen/studio) — so the framework check comes FIRST. Everything else on
480
- * `@lunora/vite` (class-A frameworks + Astro + standalone Vite) delegates to the
481
- * project's own dev server (`vite`); a project without `@lunora/vite` is the
482
- * classic standalone `wrangler` stack.
483
- */
484
438
  /** A running worker child the orchestrator controls: send signals, await its exit. */
485
439
  interface WorkerProcess {
486
440
  /** Resolves with the worker's exit code (1 if it failed to start). */
@@ -531,10 +485,10 @@ interface DevRemotePlan {
531
485
  /** Short binding labels remoted (e.g. `"DB (D1)"`), for the banner. */
532
486
  bindings: string[];
533
487
  /**
534
- * Removes the generated temp wrangler config when dev exits. Always present
535
- * and idempotent — a no-op when remote mode is off or nothing was
536
- * materialized. The dev loop calls it on every shutdown path.
537
- */
488
+ * Removes the generated temp wrangler config when dev exits. Always present
489
+ * and idempotent — a no-op when remote mode is off or nothing was
490
+ * materialized. The dev loop calls it on every shutdown path.
491
+ */
538
492
  cleanup: () => void;
539
493
  /** Whether remote mode was requested. */
540
494
  enabled: boolean;
@@ -546,31 +500,31 @@ interface DevCommandPlan {
546
500
  /** Which stack the child runs — see {@link DevFlavor}. */
547
501
  flavor: DevFlavor;
548
502
  /**
549
- * One-line redirect hint printed when a meta-framework is detected on the
550
- * wrangler flavor: without `@lunora/vite` in the dependencies the worker
551
- * still runs *inside* the framework's dev server, so the user should run
552
- * their framework dev script for the full app. `undefined` for the vite
553
- * flavor (`lunora dev` already runs the project's dev script there) and
554
- * for a standalone project. Purely informational: the wrangler spawn runs
555
- * regardless.
556
- */
503
+ * One-line redirect hint printed when a meta-framework is detected on the
504
+ * wrangler flavor: without `@lunora/vite` in the dependencies the worker
505
+ * still runs *inside* the framework's dev server, so the user should run
506
+ * their framework dev script for the full app. `undefined` for the vite
507
+ * flavor (`lunora dev` already runs the project's dev script there) and
508
+ * for a standalone project. Purely informational: the wrangler spawn runs
509
+ * regardless.
510
+ */
557
511
  frameworkHint?: string;
558
512
  /**
559
- * True when `wrangler dev` was given `--ip 127.0.0.1` because the host has no
560
- * IPv6 loopback (`::1`) — surfaced so the dev loop can note the rebind.
561
- * Always `false` for the vite flavor (the plugin owns its own bind).
562
- */
513
+ * True when `wrangler dev` was given `--ip 127.0.0.1` because the host has no
514
+ * IPv6 loopback (`::1`) — surfaced so the dev loop can note the rebind.
515
+ * Always `false` for the vite flavor (the plugin owns its own bind).
516
+ */
563
517
  ipv4LoopbackForced: boolean;
564
518
  /** The remote-binding decision: which D1/KV/R2 bindings hit the deployed worker. */
565
519
  remote: DevRemotePlan;
566
520
  /**
567
- * The `wrangler dev` sidecar for the `framework-worker` flavor (SvelteKit /
568
- * Nuxt): a second child that owns the real `ShardDO` in `workerd`, wired via
569
- * the committed `wrangler.dev.jsonc`. `undefined` for every other flavor —
570
- * only the two-process class-B stack has a sidecar. When present, `wrangler`
571
- * (above) is the framework's own dev server (the front door / HMR) and this
572
- * is the Lunora realtime plane.
573
- */
521
+ * The `wrangler dev` sidecar for the `framework-worker` flavor (SvelteKit /
522
+ * Nuxt): a second child that owns the real `ShardDO` in `workerd`, wired via
523
+ * the committed `wrangler.dev.jsonc`. `undefined` for every other flavor —
524
+ * only the two-process class-B stack has a sidecar. When present, `wrangler`
525
+ * (above) is the framework's own dev server (the front door / HMR) and this
526
+ * is the Lunora realtime plane.
527
+ */
574
528
  sidecar?: SpawnDescriptor & {
575
529
  tag: string;
576
530
  };
@@ -584,46 +538,30 @@ interface DevCommandPlan {
584
538
  };
585
539
  }
586
540
  /**
587
- * Resolve remote-binding mode into the extra `wrangler dev` args + a banner
588
- * summary. When `--remote`/`LUNORA_REMOTE` is set we materialize a temp wrangler
589
- * config with `"remote": true` on each D1/KV/R2 binding (Durable Object shards
590
- * stay local) and point `wrangler dev --config` at it, so the local worker reads
591
- * and writes the **deployed** resources. When disabled, or when there's nothing
592
- * to remote, the args stay empty and dev runs fully local.
593
- */
594
- /**
595
- * Plan `lunora dev`. Wrangler flavor: the worker runs via `wrangler dev` and
596
- * nothing else as a child process. Vite flavor (`@lunora/vite` declared): the
597
- * plugin already runs the worker inside the Vite dev server, so the one child
598
- * is the project's own dev script (`vite dev`, `astro dev`, …) and every CLI
599
- * sibling is disabled. Pure + synchronous so it's unit-testable.
600
- */
541
+ * Plan `lunora dev`. Wrangler flavor: the worker runs via `wrangler dev` and
542
+ * nothing else as a child process. Vite flavor (`@lunora/vite` declared): the
543
+ * plugin already runs the worker inside the Vite dev server, so the one child
544
+ * is the project's own dev script (`vite dev`, `astro dev`, …) and every CLI
545
+ * sibling is disabled. Pure + synchronous so it's unit-testable.
546
+ */
601
547
  declare const planDevCommand: (options: DevCommandOptions) => DevCommandPlan;
602
548
  /**
603
- * Start codegen watch + the studio server, spawn `wrangler dev`, print the
604
- * banner, and resolve when the worker exits or the user interrupts — tearing
605
- * down the sibling servers either way. The three side-effecting pieces (worker,
606
- * studio, codegen) are injectable so this is testable without real I/O.
607
- */
549
+ * Start codegen watch + the studio server, spawn `wrangler dev`, print the
550
+ * banner, and resolve when the worker exits or the user interrupts — tearing
551
+ * down the sibling servers either way. The three side-effecting pieces (worker,
552
+ * studio, codegen) are injectable so this is testable without real I/O.
553
+ */
608
554
  declare const runDevCommand: (options: DevCommandOptions) => Promise<{
609
555
  code: number;
610
556
  plan: DevCommandPlan;
611
557
  }>;
612
- /** `lunora dev` handler (lazy-loaded via the command's `loader`). */
613
558
  /** Supported CI providers. */
614
559
  type CiProvider = "github" | "gitlab";
615
560
  type PackageManager = "pnpm" | "npm" | "yarn" | "bun";
616
561
  /** True when `manager` is on PATH — probed by running `&lt;manager> --version`. Injectable for tests. */
617
562
  type PackageManagerProbe = (manager: PackageManager) => boolean;
618
- /**
619
- * The package managers actually installed on this machine, in preference order
620
- * ({@link INSTALL_PREFERENCE} — pnpm > bun > yarn > npm). The first entry is the
621
- * recommended default for the install prompt; the whole list is what the user
622
- * picks from. Empty when none are found.
623
- */
624
563
  /** A registry item a feature can install. */
625
564
  type FeatureItem = "auth" | "auth-auth0" | "auth-clerk" | "mail";
626
- /** The auth-provider choices offered for `add auth` / the init auth prompt. Each value is a registry item name. */
627
565
  /** A single file the item scaffolds into the project. */
628
566
  interface RegistryFile {
629
567
  /** Source path inside the item dir (e.g. `schema.ts`). */
@@ -639,10 +577,10 @@ interface RegistryBinding {
639
577
  value: unknown;
640
578
  }
641
579
  /**
642
- * An environment variable an item needs. Scaffolded into `.dev.vars` (Workers'
643
- * local-secrets file) on add — non-secrets get their `value`; secrets get an
644
- * empty placeholder and a reminder to run `wrangler secret put` for production.
645
- */
580
+ * An environment variable an item needs. Scaffolded into `.dev.vars` (Workers'
581
+ * local-secrets file) on add — non-secrets get their `value`; secrets get an
582
+ * empty placeholder and a reminder to run `wrangler secret put` for production.
583
+ */
646
584
  interface RegistryEnvVariable {
647
585
  /** Human note on what the variable is for. */
648
586
  description?: string;
@@ -712,11 +650,11 @@ interface AddCommandOptions {
712
650
  /** Override the remote registry source base (default gh:anolilab/lunora/registry). */
713
651
  source?: string;
714
652
  /**
715
- * Customize each resolved manifest after it is loaded but before the plan is
716
- * printed / reconciled — used to inject user-chosen values into otherwise
717
- * static manifests (e.g. the R2 `bucket_name` the init storage prompt asks
718
- * for). Applied to every item; return the manifest unchanged to leave it as-is.
719
- */
653
+ * Customize each resolved manifest after it is loaded but before the plan is
654
+ * printed / reconciled — used to inject user-chosen values into otherwise
655
+ * static manifests (e.g. the R2 `bucket_name` the init storage prompt asks
656
+ * for). Applied to every item; return the manifest unchanged to leave it as-is.
657
+ */
720
658
  transformManifest?: (manifest: RegistryManifest) => RegistryManifest;
721
659
  /** Skip the package.json mutation confirmation prompt. */
722
660
  yes?: boolean;
@@ -732,21 +670,20 @@ interface AddCommandResult {
732
670
  /** Files written (absolute paths). */
733
671
  written: ReadonlyArray<string>;
734
672
  }
735
- /** One resolved item: its parsed manifest plus the (possibly staged) directory it lives in. */
736
673
  /**
737
- * A feature offered in the post-scaffold multi-select. `auth`/`email` carry a
738
- * sub-prompt or alias; every other value IS the registry item name applied
739
- * directly (`storage` → the `storage` registry item, etc.).
740
- */
674
+ * A feature offered in the post-scaffold multi-select. `auth`/`email` carry a
675
+ * sub-prompt or alias; every other value IS the registry item name applied
676
+ * directly (`storage` → the `storage` registry item, etc.).
677
+ */
741
678
  type StackFeature = "ai" | "auth" | "backup" | "browser" | "cloudflare-access" | "crons" | "email" | "flags" | "hyperdrive" | "payment" | "presence" | "queue" | "storage" | "workflow";
742
679
  /** Customize a resolved manifest before it is written (e.g. inject the chosen R2 bucket name). */
743
680
  type OfferTransformManifest = (manifest: RegistryManifest) => RegistryManifest;
744
681
  /**
745
- * One feature ready to apply: the registry item name(s), an optional manifest
746
- * transform, and a short `label` (the feature value) shown on the combined
747
- * progress line. Built up-front by the collectors so every prompt is answered
748
- * before any apply runs.
749
- */
682
+ * One feature ready to apply: the registry item name(s), an optional manifest
683
+ * transform, and a short `label` (the feature value) shown on the combined
684
+ * progress line. Built up-front by the collectors so every prompt is answered
685
+ * before any apply runs.
686
+ */
750
687
  interface FeatureApply {
751
688
  label: string;
752
689
  names: ReadonlyArray<string>;
@@ -754,11 +691,11 @@ interface FeatureApply {
754
691
  }
755
692
  interface OfferDeps {
756
693
  /**
757
- * Apply the collected features into the new project in one batch — resolves
758
- * `true` when every item succeeds. The CLI renders this as a single progress
759
- * line whose label changes per feature; each plan's `transformManifest`
760
- * customizes that item's manifest before it is written.
761
- */
694
+ * Apply the collected features into the new project in one batch — resolves
695
+ * `true` when every item succeeds. The CLI renders this as a single progress
696
+ * line whose label changes per feature; each plan's `transformManifest`
697
+ * customizes that item's manifest before it is written.
698
+ */
762
699
  applyAll: (plans: ReadonlyArray<FeatureApply>) => Promise<boolean>;
763
700
  /** When `false`, skip all prompts and print the later-setup hint. */
764
701
  interactive: boolean;
@@ -772,10 +709,10 @@ interface OfferDeps {
772
709
  defaults?: ReadonlyArray<StackFeature>;
773
710
  }) => Promise<StackFeature[]>;
774
711
  /**
775
- * Features chosen non-interactively (the `--add` flag). When set, the
776
- * multi-select and every sub-prompt are skipped — each feature is applied with
777
- * its shipped defaults (base registry item, placeholder bindings).
778
- */
712
+ * Features chosen non-interactively (the `--add` flag). When set, the
713
+ * multi-select and every sub-prompt are skipped — each feature is applied with
714
+ * its shipped defaults (base registry item, placeholder bindings).
715
+ */
779
716
  preselected?: ReadonlyArray<StackFeature>;
780
717
  /** The new project's name — seeds smart defaults like the `project-uploads` bucket name. */
781
718
  projectName: string;
@@ -793,116 +730,103 @@ interface OfferDeps {
793
730
  placeholder?: string;
794
731
  }) => Promise<string>;
795
732
  }
796
- /**
797
- * Offer the stack features (ai, auth, backup, browser, cloudflare-access,
798
- * crons, email, flags, hyperdrive, payment, presence, queue, storage,
799
- * workflow) in ONE multi-select after a successful scaffold. Auth,
800
- * presence, backups) in ONE multi-select after a successful scaffold. Auth,
801
- * email, and storage run a follow-up prompt (provider / destination / bucket
802
- * name); every other feature value is applied as its registry item directly.
803
- *
804
- * Every question is asked FIRST (in selection order), then the picked features
805
- * are applied together via {@link OfferDeps.applyAll} — the CLI renders that as a
806
- * single progress line whose label changes per feature, instead of one spinner
807
- * per item. Non-interactive: prints how to add them later and changes nothing.
808
- */
809
733
  type Template = "analog" | "astro" | "expo" | "next" | "nuxt" | "react-router" | "standalone" | "sveltekit" | "tanstack-start-react" | "tanstack-start-solid";
810
734
  interface InitCommandOptions {
811
735
  /**
812
- * Add features non-interactively after scaffolding (the `--add` flag): a
813
- * comma-separated list of `ai | auth | backup | browser | cloudflare-access | crons | email | flags | hyperdrive | payment | presence | queue | storage | workflow`.
814
- * Bypasses the interactive multi-select and sub-prompts —
815
- * each named feature is applied with its shipped defaults.
816
- */
736
+ * Add features non-interactively after scaffolding (the `--add` flag): a
737
+ * comma-separated list of `ai | auth | backup | browser | cloudflare-access | crons | email | flags | hyperdrive | payment | presence | queue | storage | workflow`.
738
+ * Bypasses the interactive multi-select and sub-prompts —
739
+ * each named feature is applied with its shipped defaults.
740
+ */
817
741
  add?: string;
818
742
  /**
819
- * When true, accept `--source` values that don't start with `gh:` /
820
- * `github:` / `https://` or that contain `..`. Defaults to false; the CLI
821
- * gate exists to stop arbitrary filesystem / scheme sources from being
822
- * pulled without the caller opting in.
823
- */
743
+ * When true, accept `--source` values that don't start with `gh:` /
744
+ * `github:` / `https://` or that contain `..`. Defaults to false; the CLI
745
+ * gate exists to stop arbitrary filesystem / scheme sources from being
746
+ * pulled without the caller opting in.
747
+ */
824
748
  allowUnsafeSource?: boolean;
825
749
  /** When set, also scaffold a CI deploy pipeline for the given provider. */
826
750
  ci?: CiProvider;
827
751
  cwd?: string;
828
752
  /**
829
- * Walk the whole flow — prompts, task list, next-steps, mascot — but make no
830
- * changes: skip the template fetch/copy, the feature applies, the dependency
831
- * install, and `git init`. Each skipped action logs a `would …` line instead.
832
- */
753
+ * Walk the whole flow — prompts, task list, next-steps, mascot — but make no
754
+ * changes: skip the template fetch/copy, the feature applies, the dependency
755
+ * install, and `git init`. Each skipped action logs a `would …` line instead.
756
+ */
833
757
  dryRun?: boolean;
834
758
  /**
835
- * Local directory containing the template subdirs (e.g. `vite/`,
836
- * `standalone/`). When provided, skips the network fetch entirely.
837
- * Useful for offline runs, the clean-machine smoke test, and unit tests.
838
- */
759
+ * Local directory containing the template subdirs (e.g. `vite/`,
760
+ * `standalone/`). When provided, skips the network fetch entirely.
761
+ * Useful for offline runs, the clean-machine smoke test, and unit tests.
762
+ */
839
763
  from?: string;
840
764
  /**
841
- * When true, configure Lunora into the CURRENT project (`cwd`) instead of
842
- * scaffolding a new directory. Finds an existing `vite.config.*` and
843
- * patches it via `patchViteConfig`, or creates a minimal one when absent.
844
- * All other scaffold options (`name`, `templateType`, `source`, `from`)
845
- * are ignored in this mode.
846
- */
765
+ * When true, configure Lunora into the CURRENT project (`cwd`) instead of
766
+ * scaffolding a new directory. Finds an existing `vite.config.*` and
767
+ * patches it via `patchViteConfig`, or creates a minimal one when absent.
768
+ * All other scaffold options (`name`, `templateType`, `source`, `from`)
769
+ * are ignored in this mode.
770
+ */
847
771
  inPlace?: boolean;
848
772
  /**
849
- * Inject the post-scaffold install offer's prompts (tests). When set, the
850
- * offer runs regardless of TTY: `confirmInstall` drives the yes/no, and
851
- * `selectManager` picks among the detected managers.
852
- */
773
+ * Inject the post-scaffold install offer's prompts (tests). When set, the
774
+ * offer runs regardless of TTY: `confirmInstall` drives the yes/no, and
775
+ * `selectManager` picks among the detected managers.
776
+ */
853
777
  installPrompt?: {
854
778
  confirmInstall: () => Promise<boolean>;
855
779
  selectManager: (managers: ReadonlyArray<PackageManager>) => Promise<PackageManager>;
856
780
  };
857
781
  /**
858
- * Force the post-scaffold "add auth / email?" offer on (the `--interactive`
859
- * flag). When omitted, the offer runs only when stdin is a TTY. `--yes`
860
- * suppresses it regardless. Has no effect once {@link prompt} is injected.
861
- */
782
+ * Force the post-scaffold "add auth / email?" offer on (the `--interactive`
783
+ * flag). When omitted, the offer runs only when stdin is a TTY. `--yes`
784
+ * suppresses it regardless. Has no effect once {@link prompt} is injected.
785
+ */
862
786
  interactive?: boolean;
863
787
  logger: Logger;
864
788
  name?: string;
865
789
  /**
866
- * Local directory holding create-vite bases (one `template-&lt;id>/` subdir per
867
- * framework). When set with `vite`, the overlay copies the base from disk
868
- * instead of fetching `create-vite` over the network — offline mode + tests.
869
- */
790
+ * Local directory holding create-vite bases (one `template-&lt;id>/` subdir per
791
+ * framework). When set with `vite`, the overlay copies the base from disk
792
+ * instead of fetching `create-vite` over the network — offline mode + tests.
793
+ */
870
794
  overlayBaseFrom?: string;
871
795
  /** Probe for which package managers are installed (tests). Defaults to a real `&lt;pm> --version` check. */
872
796
  packageManagerProbe?: PackageManagerProbe;
873
797
  /**
874
- * Inject the offer's prompts (tests). When set, the offer is treated as
875
- * interactive regardless of TTY, and these drive the feature multi-select,
876
- * the auth-provider sub-select, and the storage bucket-name text input.
877
- */
798
+ * Inject the offer's prompts (tests). When set, the offer is treated as
799
+ * interactive regardless of TTY, and these drive the feature multi-select,
800
+ * the auth-provider sub-select, and the storage bucket-name text input.
801
+ */
878
802
  prompt?: Pick<OfferDeps, "multiSelect" | "select" | "text">;
879
803
  /**
880
- * Override the git ref (branch, tag, or commit) the default template source
881
- * is fetched from. Takes precedence over the version-derived ref. Ignored
882
- * when `source` or `from` is set.
883
- */
804
+ * Override the git ref (branch, tag, or commit) the default template source
805
+ * is fetched from. Takes precedence over the version-derived ref. Ignored
806
+ * when `source` or `from` is set.
807
+ */
884
808
  ref?: string;
885
809
  /** Local registry root for the offer's `runAddCommand` (offline / tests). Mirrors `from` but for registry items. */
886
810
  registryFrom?: string;
887
811
  /** Override the remote registry source base for the offer (default `gh:anolilab/lunora/registry`). */
888
812
  registrySource?: string;
889
813
  /**
890
- * Override the remote source giget downloads from. Default:
891
- * `gh:anolilab/lunora/templates/&lt;templateType>#&lt;ref>`, where `&lt;ref>` is
892
- * the `ref` option when set, else derived from the CLI version (pre-release
893
- * channels → their branch, stable → `main`). Tests typically use `from`
894
- * instead to skip the network.
895
- */
814
+ * Override the remote source giget downloads from. Default:
815
+ * `gh:anolilab/lunora/templates/&lt;templateType>#&lt;ref>`, where `&lt;ref>` is
816
+ * the `ref` option when set, else derived from the CLI version (pre-release
817
+ * channels → their branch, stable → `main`). Tests typically use `from`
818
+ * instead to skip the network.
819
+ */
896
820
  source?: string;
897
821
  /** Spawner for the post-scaffold dependency install (tests inject a recording stub). Defaults to a real subprocess. */
898
822
  spawner?: Spawner;
899
823
  templateType?: Template;
900
824
  /**
901
- * Scaffold via the **create-vite overlay** for this framework (`react`,
902
- * `vue`, `solid`, `svelte`, `vanilla`) instead of a bespoke template: fetch
903
- * the official create-vite base and apply the Lunora layer on top. Takes
904
- * precedence over `templateType`.
905
- */
825
+ * Scaffold via the **create-vite overlay** for this framework (`react`,
826
+ * `vue`, `solid`, `svelte`, `vanilla`) instead of a bespoke template: fetch
827
+ * the official create-vite base and apply the Lunora layer on top. Takes
828
+ * precedence over `templateType`.
829
+ */
906
830
  vite?: string;
907
831
  /** Suppress the offer entirely (the `--yes` flag): scaffold only, print the later-setup hint. */
908
832
  yes?: boolean;
@@ -913,7 +837,6 @@ interface InitCommandResult {
913
837
  target: string;
914
838
  }
915
839
  declare const runInitCommand: (options: InitCommandOptions) => Promise<InitCommandResult>;
916
- /** Narrow a raw `--template` value to a known {@link Template}. */
917
840
  interface MigrateGenerateCommandOptions {
918
841
  cwd?: string;
919
842
  logger: Logger;
@@ -939,29 +862,27 @@ interface CatalogItem {
939
862
  interface IndexItem extends CatalogItem {
940
863
  title?: string;
941
864
  }
942
- /** Names of the subdirectories under `root` that ship a `registry.json`. */
943
-
944
865
  /**
945
- * Build the catalog (`index.json` contents) from a local registry root by
946
- * reading every item's `registry.json`. Used by both `lunora registry build`
947
- * and the registry tests so the committed index can't drift from the item dirs.
948
- */
866
+ * Build the catalog (`index.json` contents) from a local registry root by
867
+ * reading every item's `registry.json`. Used by both `lunora registry build`
868
+ * and the registry tests so the committed index can't drift from the item dirs.
869
+ */
949
870
  declare const buildRegistryIndex: (root: string) => {
950
871
  items: IndexItem[];
951
872
  };
952
873
  /** `lunora registry add` (one or more item names): scaffold items into the project. */
953
874
  declare const runAddCommand: (options: AddCommandOptions) => Promise<AddCommandResult>;
954
875
  /**
955
- * `lunora registry view` — inspect a registry item without installing it:
956
- * print its plan (files / deps / env vars) followed by the full contents of each
957
- * file it would scaffold. Resolves only the named item — no `requires` expansion.
958
- */
876
+ * `lunora registry view` — inspect a registry item without installing it:
877
+ * print its plan (files / deps / env vars) followed by the full contents of each
878
+ * file it would scaffold. Resolves only the named item — no `requires` expansion.
879
+ */
959
880
  declare const runRegistryViewCommand: (options: AddCommandOptions) => Promise<AddCommandResult>;
960
881
  /**
961
- * `lunora registry build` — regenerate `index.json` from the item directories
962
- * (the catalog `list` reads). With `--check`, verify the committed index matches
963
- * instead of rewriting it (exits non-zero on drift) — a CI guard.
964
- */
882
+ * `lunora registry build` — regenerate `index.json` from the item directories
883
+ * (the catalog `list` reads). With `--check`, verify the committed index matches
884
+ * instead of rewriting it (exits non-zero on drift) — a CI guard.
885
+ */
965
886
  declare const runBuildIndexCommand: (options: AddCommandOptions) => Promise<AddCommandResult>;
966
887
  /** Validate + narrow a parsed JSON value into a {@link RegistryManifest}. */
967
888
  declare const parseManifest: (raw: unknown, itemName: string) => RegistryManifest;
@@ -979,7 +900,6 @@ interface ResetCommandResult {
979
900
  removed: ReadonlyArray<string>;
980
901
  }
981
902
  declare const runResetCommand: (options: ResetCommandOptions) => Promise<ResetCommandResult>;
982
- /** `lunora reset` handler (lazy-loaded via the command's `loader`). */
983
903
  type InsertSchemaExtensionResult = {
984
904
  ok: true;
985
905
  text: string;
@@ -988,12 +908,12 @@ type InsertSchemaExtensionResult = {
988
908
  reason: "already-applied" | "invalid-identifier" | "no-define-schema" | "non-object-argument";
989
909
  };
990
910
  /**
991
- * Append `.extend(&lt;key>.extension)` and a managed import to an existing
992
- * `lunora/schema.ts`. Idempotent: a second call for the same `key` returns
993
- * `already-applied` and leaves the text unchanged.
994
- * @param source the current `lunora/schema.ts` contents
995
- * @param key the registry item key (e.g. `"ratelimit"`)
996
- */
911
+ * Append `.extend(&lt;key>.extension)` and a managed import to an existing
912
+ * `lunora/schema.ts`. Idempotent: a second call for the same `key` returns
913
+ * `already-applied` and leaves the text unchanged.
914
+ * @param source the current `lunora/schema.ts` contents
915
+ * @param key the registry item key (e.g. `"ratelimit"`)
916
+ */
997
917
  declare const insertSchemaExtension: (source: string, key: string) => InsertSchemaExtensionResult;
998
918
  /** Compact snapshot of a single global table — what we persist + diff. */
999
919
  interface TableSnapshot {
@@ -1036,10 +956,10 @@ interface SchemaDiff {
1036
956
  unsupported: ReadonlyArray<UnsupportedEntry>;
1037
957
  }
1038
958
  /**
1039
- * Map a Lunora validator kind to a SQLite type affinity — the canonical
1040
- * `@lunora/d1/dialect` mapping. Re-exported under this name because
1041
- * `schema-snapshot.ts` builds the persisted snapshot from it.
1042
- */
959
+ * Map a Lunora validator kind to a SQLite type affinity — the canonical
960
+ * `@lunora/d1/dialect` mapping. Re-exported under this name because
961
+ * `schema-snapshot.ts` builds the persisted snapshot from it.
962
+ */
1043
963
  declare const validatorKindToSqlType: (kind: string) => ColumnSnapshot["sqlType"];
1044
964
  /** Emit `CREATE TABLE` SQL for a new global table. */
1045
965
  declare const renderCreateTable: (table: TableSnapshot) => string;
@@ -1048,14 +968,14 @@ declare const renderAddColumn: (tableName: string, columnName: string, column: C
1048
968
  declare const renderCreateIndex: (tableName: string, index: IndexSnapshot) => string;
1049
969
  declare const renderDropIndex: (tableName: string, indexName: string) => string;
1050
970
  /**
1051
- * Compute a {@link SchemaDiff} from two snapshots. Pure function — no I/O.
1052
- */
971
+ * Compute a {@link SchemaDiff} from two snapshots. Pure function — no I/O.
972
+ */
1053
973
  declare const diffSnapshots: (previous: SchemaSnapshot | undefined, next: SchemaSnapshot) => SchemaDiff;
1054
974
  /**
1055
- * Render a complete migration file body from a diff. Includes a header,
1056
- * each SQL statement, and (if any) a trailing comment block describing the
1057
- * manual SQL the user needs to fill in for unsupported deltas.
1058
- */
975
+ * Render a complete migration file body from a diff. Includes a header,
976
+ * each SQL statement, and (if any) a trailing comment block describing the
977
+ * manual SQL the user needs to fill in for unsupported deltas.
978
+ */
1059
979
  declare const renderMigrationFile: (name: string, diff: SchemaDiff, generatedAt: string) => string;
1060
980
  declare const schemaIrToSnapshot: (ir: SchemaIR) => SchemaSnapshot;
1061
981
  export { type AddCommandOptions, type AddCommandResult, COMMANDS, type ColumnSnapshot, type CommandName, DEFAULT_IMPORT_BATCH_SIZE, type DeployCommandOptions, type DeployCommandResult, type DevCommandOptions, type DevCommandPlan, type DiffEntry, type ExportCommandOptions, type ExportCommandResult, type FetchLike, type ImportCommandOptions, type ImportCommandResult, type IndexSnapshot, type InitCommandOptions, type InitCommandResult, type InsertSchemaExtensionResult, type Logger, type MigrateGenerateCommandOptions, type MigrateGenerateCommandResult, type RecordedSpawn, type RegistryBinding, type RegistryFile, type RegistryManifest, type ResetCommandOptions, type ResetCommandResult, type RunCliOptions, type RunCommandOptions, type RunCommandResult, type SchemaDiff, type SchemaSnapshot, type SpawnDescriptor, type SpawnResult, type Spawner, type StreamingFetchLike, type TableSnapshot, type Template, type UnsupportedEntry, VERSION, buildRegistryIndex, createLogger, createRecordingSpawner, defaultSpawner, diffSnapshots, insertSchemaExtension, pail, parseManifest, planDevCommand, renderAddColumn, renderCreateIndex, renderCreateTable, renderDropIndex, renderDropTable, renderMigrationFile, runAddCommand, runBuildIndexCommand, runCli, runCodegenCommand, runDeployCommand, runDevCommand, runExportCommand, runImportCommand, runInitCommand, runMigrateGenerateCommand, runRegistryViewCommand, runResetCommand, runRpcCommand, schemaIrToSnapshot, validatorKindToSqlType };