@letterstory/cli 0.33.3 → 0.33.5
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 +1 -1
- package/lib/commands/kernel.mjs +43 -0
- package/package.json +1 -1
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.
|
|
48
|
+
export const VERSION = "0.33.5";
|
|
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.
|
package/lib/commands/kernel.mjs
CHANGED
|
@@ -170,6 +170,12 @@ export const ARGS = {
|
|
|
170
170
|
// `[{"name":"...","treatment":"never"|"mention_once"|"mention_often"|"lead_company",
|
|
171
171
|
// "linkable":false}, ...]` (linkable optional, default true).
|
|
172
172
|
entities: { value: (flags) => readJsonFileFlag(flags, "entities-file") },
|
|
173
|
+
// Your own guidance for the writer (2026-09-25): how to write, not what is true. Sent
|
|
174
|
+
// on its own field and appended AFTER the claims are read from the input, so nothing in
|
|
175
|
+
// it becomes a claim the article must carry. Inline for a sentence, a file for a page.
|
|
176
|
+
directives: {
|
|
177
|
+
value: (flags) => flagStr(flags.directives) ?? readTextFileFlag(flags, "directives-file"),
|
|
178
|
+
},
|
|
173
179
|
},
|
|
174
180
|
create_kernel_endpoint: {
|
|
175
181
|
name: { flag: "name", required: true },
|
|
@@ -246,10 +252,46 @@ async function kernelStatus(ctx) {
|
|
|
246
252
|
const { client, positionals, flags, io } = ctx;
|
|
247
253
|
const jobId = requirePositional(positionals, 0, "kernel-job-id");
|
|
248
254
|
const result = await client.callTool("get_kernel_run_status", { kernel_job_id: jobId });
|
|
255
|
+
printRecordLine(ctx, result);
|
|
249
256
|
printResult(io, flags, result);
|
|
250
257
|
return 0;
|
|
251
258
|
}
|
|
252
259
|
|
|
260
|
+
/**
|
|
261
|
+
* THE RECORD'S HEADLINE, one line, on a done run — the same `verification.service` both poll
|
|
262
|
+
* tools return (get_kernel_run_status for an article-bound run, get_kernel_endpoint_run for a
|
|
263
|
+
* standalone one), so a reader at a terminal sees "invented 0" before the JSON. Quiet under
|
|
264
|
+
* --json / --quiet like every other `ok` line. The full record is in the JSON below it.
|
|
265
|
+
*/
|
|
266
|
+
export function recordSummaryLine(result) {
|
|
267
|
+
const service = toolField(result, "verification")?.service;
|
|
268
|
+
if (!service || typeof service !== "object") return null;
|
|
269
|
+
const parts = [];
|
|
270
|
+
const s = service.sentences;
|
|
271
|
+
if (s && typeof s === "object") {
|
|
272
|
+
if (typeof s.supported === "number") parts.push(`${s.supported} supported`);
|
|
273
|
+
if (typeof s.contradicted === "number" || typeof s.unreferenced === "number")
|
|
274
|
+
parts.push(`${(s.contradicted ?? 0) + (s.unreferenced ?? 0)} invented`);
|
|
275
|
+
if (typeof s.dropped === "number") parts.push(`${s.dropped} dropped`);
|
|
276
|
+
}
|
|
277
|
+
const h = service.held;
|
|
278
|
+
if (h && typeof h.blocks === "number") parts.push(`held ${h.restored ?? 0}/${h.blocks}`);
|
|
279
|
+
const c = service.attachments?.citations;
|
|
280
|
+
if (c && typeof c.expected === "number") parts.push(`citations ${c.carried ?? 0}/${c.expected}`);
|
|
281
|
+
if (typeof service.shape?.title_held === "boolean")
|
|
282
|
+
parts.push(service.shape.title_held ? "title held" : "title not held");
|
|
283
|
+
if (typeof service.length?.delta === "number") {
|
|
284
|
+
const pct = Math.round(service.length.delta * 100);
|
|
285
|
+
parts.push(`length ${pct >= 0 ? "+" : ""}${pct}%`);
|
|
286
|
+
}
|
|
287
|
+
return parts.length ? `Record: ${parts.join(" \u00B7 ")}` : null;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
function printRecordLine(ctx, result) {
|
|
291
|
+
const line = recordSummaryLine(result);
|
|
292
|
+
if (line) ok(ctx, line);
|
|
293
|
+
}
|
|
294
|
+
|
|
253
295
|
/* ------------------------------------------------------------------ */
|
|
254
296
|
/* The standalone endpoint: prose back, nothing written into an article */
|
|
255
297
|
/* ------------------------------------------------------------------ */
|
|
@@ -424,6 +466,7 @@ async function kernelRunStatus(ctx) {
|
|
|
424
466
|
const { client, positionals, flags, io } = ctx;
|
|
425
467
|
const runId = requirePositional(positionals, 0, "run-id");
|
|
426
468
|
const result = await client.callTool("get_kernel_endpoint_run", { run_id: runId });
|
|
469
|
+
printRecordLine(ctx, result);
|
|
427
470
|
printResult(io, flags, result);
|
|
428
471
|
return 0;
|
|
429
472
|
}
|