@letterstory/cli 0.177.57 → 0.177.59
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 +14 -5
- package/lib/commands/bench.mjs +2 -1
- package/lib/commands/models.mjs +16 -4
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -90,7 +90,7 @@ import {
|
|
|
90
90
|
import { fetchParkedSections, withoutParked } from "./parked.mjs";
|
|
91
91
|
|
|
92
92
|
// Matches cli/package.json; publish-cli.yml rewrites both to the published version.
|
|
93
|
-
export const VERSION = "0.177.
|
|
93
|
+
export const VERSION = "0.177.59";
|
|
94
94
|
|
|
95
95
|
/** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
|
|
96
96
|
export const EXIT_PAYMENT_REQUIRED = 3;
|
|
@@ -346,6 +346,7 @@ export const BOOLEAN_FLAGS = new Set([
|
|
|
346
346
|
"start-writing",
|
|
347
347
|
// `phantom-onboard primitives --retry [<domain>]` re-reads a domain whose read failed.
|
|
348
348
|
"retry",
|
|
349
|
+
"redeploy",
|
|
349
350
|
"posts-only",
|
|
350
351
|
"clear-topics",
|
|
351
352
|
"clear-stances",
|
|
@@ -473,6 +474,10 @@ export const BOOLEAN_FLAGS = new Set([
|
|
|
473
474
|
"keep-rest",
|
|
474
475
|
"no-train",
|
|
475
476
|
"baselines-only",
|
|
477
|
+
// models update: turn a model on or off for Letterpress. models train: price the run, start nothing.
|
|
478
|
+
"on",
|
|
479
|
+
"off",
|
|
480
|
+
"dry-run",
|
|
476
481
|
// usage case-study generate --named: name the companies (counts only without it).
|
|
477
482
|
"named",
|
|
478
483
|
]);
|
|
@@ -2140,14 +2145,18 @@ Models (your own writing models, each trained on writing you give it so it write
|
|
|
2140
2145
|
models confirm <id> [<link-id>…] [--keep-rest] [--no-train]
|
|
2141
2146
|
Confirm what was found (all, or the ids) and train on it
|
|
2142
2147
|
models remove <id> <link-id>… Take links out of the next version
|
|
2143
|
-
models train <id> [--retry] [--recipe <id>]
|
|
2148
|
+
models train <id> [--retry] [--recipe <id>] [--dry-run]
|
|
2149
|
+
Train the next version (rewrite_v1 by default), or try a stopped one again;
|
|
2150
|
+
--dry-run says what it may cost and starts nothing
|
|
2144
2151
|
models test <id> [--version <n>] [--units <n>] Test a version on held-out writing against Claude with examples
|
|
2145
2152
|
models activate <id> <version> Make a ready version live (a first version is live when it trains)
|
|
2146
2153
|
models stop <id> Stop what is training; what it spent is charged
|
|
2147
|
-
models rewrite <id> "<
|
|
2154
|
+
models rewrite <id-or-handle> "<finished text>" [--for "<what it is>"]
|
|
2155
|
+
Put finished words in its voice: the same piece, never an outline
|
|
2148
2156
|
models compare <id> "<source text>" Compare your model, Astra and Claude + Skill
|
|
2149
2157
|
models write <id> "<what to write>" [--words <n>] Legacy ask-based generation
|
|
2150
|
-
models update <id> [--name <n>] [--budget <usd>] [--description <d>] [--base <base-id>]
|
|
2158
|
+
models update <id> [--name <n>] [--budget <usd>] [--description <d>] [--base <base-id>] [--handle <h>] [--on] [--off]
|
|
2159
|
+
--on: Letterpress may write with it where its description fits
|
|
2151
2160
|
models archive <id> | models restore <id>
|
|
2152
2161
|
|
|
2153
2162
|
Bench (Benches: open-source benchmarks on their own domains, kept running; @letterstory.com only):
|
|
@@ -2161,7 +2170,7 @@ Bench (Benches: open-source benchmarks on their own domains, kept running; @lett
|
|
|
2161
2170
|
bench update <id> [--name <n>] [--slug <s>] [--repo-owner <o>] [--repo-name <r>] [--spec-file <path>] [--domain <d>] [--every <days>]
|
|
2162
2171
|
[--disclosure "<text>"|--disclosure-file <path>|--no-disclosure] The README's optional ## Disclosure
|
|
2163
2172
|
bench pause <id> | bench resume <id> | bench archive <id>
|
|
2164
|
-
bench advance <id> [--retry] [--skip <id>]… Move it on now; --retry once blocked_on is done
|
|
2173
|
+
bench advance <id> [--retry | --redeploy] [--skip <id>]… Move it on now; --retry once blocked_on is done
|
|
2165
2174
|
bench run <id> [--note "<what else to do>"] [--spec-changed] [--skip <id>]… Run the benchmark again
|
|
2166
2175
|
bench connect <id> <collection-id|none> A letterbase whose posts cite and link it
|
|
2167
2176
|
bench cite <id> The reference line a post cites
|
package/lib/commands/bench.mjs
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// letterstory bench update <id> [--name <n>] [--slug <s>] [--repo-owner <o>] [--repo-name <r>] [--spec-file spec.json] [--domain <d>] [--every <days>]
|
|
15
15
|
// [--disclosure "<README disclosure text>" | --no-disclosure]
|
|
16
16
|
// letterstory bench pause <id> | resume <id> | archive <id>
|
|
17
|
-
// letterstory bench advance <id> [--retry] [--skip <contender-id>]…
|
|
17
|
+
// letterstory bench advance <id> [--retry] [--redeploy] [--skip <contender-id>]…
|
|
18
18
|
// letterstory bench run <id> [--note "add Qdrant as a contender"] [--spec-changed] [--skip <contender-id>]…
|
|
19
19
|
// letterstory bench connect <id> <collection-id|none>
|
|
20
20
|
// letterstory bench cite <id>
|
|
@@ -78,6 +78,7 @@ export const ARGS = {
|
|
|
78
78
|
approve_bench: { bench_id: benchId, skip_contenders: { flag: "skip", type: "list" } },
|
|
79
79
|
advance_bench: {
|
|
80
80
|
bench_id: benchId,
|
|
81
|
+
redeploy: { flag: "redeploy", type: "bool" },
|
|
81
82
|
retry: { flag: "retry", type: "bool" },
|
|
82
83
|
skip_contenders: { flag: "skip", type: "list" },
|
|
83
84
|
},
|
package/lib/commands/models.mjs
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
// letterstory models stop <id> stop what is training
|
|
21
21
|
// letterstory models write <id> "<what to write>" [--words <n>]
|
|
22
22
|
// letterstory models update <id> [--name <n>] [--budget <usd>] [--description <d>] [--base <base-id>]
|
|
23
|
+
// [--handle <h>] [--on] [--off] turn it on or off for Letterpress
|
|
23
24
|
// letterstory models archive <id> | models restore <id>
|
|
24
25
|
|
|
25
26
|
import { readFileSync, readdirSync, statSync } from "node:fs";
|
|
@@ -48,6 +49,8 @@ export const ARGS = {
|
|
|
48
49
|
description: "description",
|
|
49
50
|
budget_usd: { flag: "budget", type: "num" },
|
|
50
51
|
base_model: "base",
|
|
52
|
+
handle: "handle",
|
|
53
|
+
on: { value: (flags) => (flags.on ? true : flags.off ? false : undefined) },
|
|
51
54
|
archived: { internal: "models archive / models restore" },
|
|
52
55
|
},
|
|
53
56
|
add_writing_model_links: {
|
|
@@ -104,7 +107,13 @@ export const ARGS = {
|
|
|
104
107
|
train: { flag: "no-train", type: "bool", invert: true },
|
|
105
108
|
},
|
|
106
109
|
remove_writing_model_links: { model_id: modelId, source_ids: { value: rest(1) } },
|
|
107
|
-
train_writing_model: {
|
|
110
|
+
train_writing_model: {
|
|
111
|
+
model_id: modelId,
|
|
112
|
+
retry: { flag: "retry", type: "bool" },
|
|
113
|
+
recipe: "recipe",
|
|
114
|
+
dry_run: { flag: "dry-run", type: "bool" },
|
|
115
|
+
accepted_quote: { internal: "a conversation's: the CLI starts a run on the model's budget" },
|
|
116
|
+
},
|
|
108
117
|
activate_writing_model_version: {
|
|
109
118
|
model_id: modelId,
|
|
110
119
|
version: { value: (flags, positionals) => (positionals[1] ? Number(positionals[1]) : undefined) },
|
|
@@ -119,6 +128,7 @@ export const ARGS = {
|
|
|
119
128
|
model_id: modelId,
|
|
120
129
|
text: { value: (flags, positionals) => positionals.slice(1).join(" ").trim() || undefined },
|
|
121
130
|
version: { flag: "version", type: "num" },
|
|
131
|
+
for: "for",
|
|
122
132
|
},
|
|
123
133
|
compare_writing_model: {
|
|
124
134
|
model_id: modelId,
|
|
@@ -162,7 +172,7 @@ export async function cmdModels(ctx) {
|
|
|
162
172
|
return r.models
|
|
163
173
|
.map(
|
|
164
174
|
(m) =>
|
|
165
|
-
`${m.id} ${m.name.slice(0, 28).padEnd(28)} ${(STATE[m.state] ?? m.state).padEnd(17)} ${m.links.confirmed} links${m.version ? ` v${m.version.n}` : ""}`
|
|
175
|
+
`${m.id} ${m.name.slice(0, 28).padEnd(28)} ${(STATE[m.state] ?? m.state).padEnd(17)} ${m.links.confirmed} links${m.version ? ` v${m.version.n}` : ""}${m.handle ? ` letter/${m.handle}` : ""}${m.on ? " on" : ""}`
|
|
166
176
|
)
|
|
167
177
|
.join("\n");
|
|
168
178
|
});
|
|
@@ -295,7 +305,9 @@ export async function cmdModels(ctx) {
|
|
|
295
305
|
case "train": {
|
|
296
306
|
refuseUnknownFlags(next, ARGS.train_writing_model, []);
|
|
297
307
|
const result = await call(next, "train_writing_model");
|
|
298
|
-
printResult(next.io, next.flags, result, (r) =>
|
|
308
|
+
printResult(next.io, next.flags, result, (r) =>
|
|
309
|
+
r.dry_run ? `Would spend up to $${r.budget_usd} (${r.tokens} tokens). Nothing started.` : runLine(r.run)
|
|
310
|
+
);
|
|
299
311
|
return 0;
|
|
300
312
|
}
|
|
301
313
|
case "activate": {
|
|
@@ -345,7 +357,7 @@ export async function cmdModels(ctx) {
|
|
|
345
357
|
return 0;
|
|
346
358
|
}
|
|
347
359
|
case "update":
|
|
348
|
-
refuseUnknownFlags(next, ARGS.update_writing_model, []);
|
|
360
|
+
refuseUnknownFlags(next, ARGS.update_writing_model, ["on", "off"]);
|
|
349
361
|
return modelShow(next, await call(next, "update_writing_model"));
|
|
350
362
|
case "archive":
|
|
351
363
|
case "restore":
|