@letterstory/cli 0.33.7 → 0.33.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/cli.mjs CHANGED
@@ -45,7 +45,7 @@ import {
45
45
  } from "./commands.mjs";
46
46
 
47
47
  // Keep in sync with cli/package.json.
48
- export const VERSION = "0.33.7";
48
+ export const VERSION = "0.33.9";
49
49
 
50
50
  // Flags that never take a value. Listing them explicitly means `deploy get --json <id>`
51
51
  // can't accidentally swallow the id as --json's value.
@@ -219,6 +219,22 @@ export const ARGS = {
219
219
  kernel_id: { positional: 1, label: "kernel-id", required: true },
220
220
  eval_id: { positional: 2, label: "eval-id", required: true },
221
221
  },
222
+ update_kernel: {
223
+ kernel_id: { positional: 0, label: "kernel-id", required: true },
224
+ name: "name",
225
+ description: "description",
226
+ // A whole-document JSON file, same reasoning as add_kernel_custom_eval's detector/repair:
227
+ // register/humor/inquisitive/notes together are a real object, not four independent
228
+ // flags — kernelVoiceConfigSchema requires register/humor/inquisitive all at once, so a
229
+ // partial flag set would just fail the tool's own validation anyway.
230
+ voice_config: { value: (flags) => readJsonFileFlag(flags, "voice-config-file") },
231
+ },
232
+ archive_kernel: {
233
+ kernel_id: { positional: 0, label: "kernel-id", required: true },
234
+ },
235
+ get_kernel_endpoint_run_steps: {
236
+ run_id: { positional: 0, label: "run-id", required: true },
237
+ },
222
238
  };
223
239
 
224
240
  export async function cmdKernel(ctx) {
@@ -238,6 +254,10 @@ export async function cmdKernel(ctx) {
238
254
  return kernelEndpoint(rest);
239
255
  case "eval":
240
256
  return kernelEval(rest);
257
+ case "update":
258
+ return kernelUpdate(rest);
259
+ case "archive":
260
+ return kernelArchive(rest);
241
261
  case "write":
242
262
  return kernelWrite(rest);
243
263
  case "polish":
@@ -250,7 +270,7 @@ export async function cmdKernel(ctx) {
250
270
  return kernelBalance(rest);
251
271
  default:
252
272
  throw new CliError(
253
- `Unknown kernel subcommand: ${sub ?? "(none)"}. Try: list, endpoints, endpoint, eval, write, polish, run-status, runs, balance, run, status`
273
+ `Unknown kernel subcommand: ${sub ?? "(none)"}. Try: list, endpoints, endpoint, eval, update, archive, write, polish, run-status, runs, balance, run, status`
254
274
  );
255
275
  }
256
276
  }
@@ -473,6 +493,39 @@ async function kernelEval(ctx) {
473
493
  throw new CliError(`Unknown kernel eval action: ${action ?? "(none)"}. Try: add, rm`);
474
494
  }
475
495
 
496
+ /**
497
+ * `kernel update <kernel-id>` — name/description/voice on an org-owned kernel. Raw
498
+ * prompt/config editing stays staff-only (the app's own developer console), same as always.
499
+ */
500
+ async function kernelUpdate(ctx) {
501
+ const { client, positionals, flags, io } = ctx;
502
+ const args = argsFromFlags(ARGS.update_kernel, flags, positionals);
503
+ if (args.name === undefined && args.description === undefined && args.voice_config === undefined) {
504
+ throw new CliError("Provide at least one of --name, --description, --voice-config-file <path>.");
505
+ }
506
+ const result = await client.callTool("update_kernel", args);
507
+ ok(ctx, `Updated kernel ${args.kernel_id}.`);
508
+ printResult(io, flags, result);
509
+ return 0;
510
+ }
511
+
512
+ /**
513
+ * `kernel archive <kernel-id>` — never a hard delete; every run it ever produced keeps its
514
+ * attribution. Requires --yes, same as every other destructive kernel/endpoint command.
515
+ */
516
+ async function kernelArchive(ctx) {
517
+ const { client, positionals, flags, io } = ctx;
518
+ const args = argsFromFlags(ARGS.archive_kernel, flags, positionals);
519
+ if (!flags.yes) {
520
+ io.error(`Re-run with --yes to confirm: ${ctx.bin} kernel archive ${args.kernel_id} --yes`);
521
+ return 1;
522
+ }
523
+ const result = await client.callTool("archive_kernel", args);
524
+ ok(ctx, `Archived kernel ${args.kernel_id}.`);
525
+ printResult(io, flags, result);
526
+ return 0;
527
+ }
528
+
476
529
  /**
477
530
  * The OTHER door: run the same pipeline against a document you already have, instead of
478
531
  * writing a new one. Decomposed into a brief and GENERATED FRESH (content_kind: "article",
@@ -536,6 +589,16 @@ async function kernelPolish(ctx) {
536
589
  async function kernelRunStatus(ctx) {
537
590
  const { client, positionals, flags, io } = ctx;
538
591
  const runId = requirePositional(positionals, 0, "run-id");
592
+ if (flags.steps === true) {
593
+ // The round-by-round draft trace instead of the run summary — the same view the app's
594
+ // kernel detail page shows as its version-diff and rule-trip panels.
595
+ const result = await client.callTool(
596
+ "get_kernel_endpoint_run_steps",
597
+ argsFromFlags(ARGS.get_kernel_endpoint_run_steps, flags, positionals)
598
+ );
599
+ printResult(io, flags, result);
600
+ return 0;
601
+ }
539
602
  const result = await client.callTool("get_kernel_endpoint_run", { run_id: runId });
540
603
  printRecordLine(ctx, result);
541
604
  printResult(io, flags, result);
@@ -149,6 +149,8 @@ export const ARGS = {
149
149
  site_domain: "domain",
150
150
  domain_mode: { flag: "domain-mode", enum: DOMAIN_MODES },
151
151
  is_test: { flag: "real", type: "bool", invert: true },
152
+ // A self-serve integrator's customers launch their own sites: no staff pings.
153
+ notify_staff: { flag: "no-notify-staff", type: "bool", invert: true },
152
154
  },
153
155
  },
154
156
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.33.7",
3
+ "version": "0.33.9",
4
4
  "description": "Spin up and manage Letterstory phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",