@letterstory/cli 0.175.19 → 0.175.20
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 +7 -3
- package/lib/commands/bench.mjs +55 -7
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -78,7 +78,7 @@ import {
|
|
|
78
78
|
} from "./commands.mjs";
|
|
79
79
|
|
|
80
80
|
// Matches cli/package.json; publish-cli.yml rewrites both to the published version.
|
|
81
|
-
export const VERSION = "0.175.
|
|
81
|
+
export const VERSION = "0.175.20";
|
|
82
82
|
|
|
83
83
|
/** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
|
|
84
84
|
export const EXIT_PAYMENT_REQUIRED = 3;
|
|
@@ -87,6 +87,8 @@ export const EXIT_PAYMENT_REQUIRED = 3;
|
|
|
87
87
|
// can't accidentally swallow the id as --json's value. Every `type: "bool"` flag (and its
|
|
88
88
|
// `negate` spelling) in a command's ARGS map must be listed; boolean-flags.test.ts enforces it.
|
|
89
89
|
export const BOOLEAN_FLAGS = new Set([
|
|
90
|
+
// bench run: the spec was just changed.
|
|
91
|
+
"spec-changed",
|
|
90
92
|
// bench update: remove the README's disclosure.
|
|
91
93
|
"no-disclosure",
|
|
92
94
|
// sim create / resample / sample-key: keep the customer's sample key, or delete it now.
|
|
@@ -1728,11 +1730,13 @@ Bench (Benches: open-source benchmarks on their own domains, kept running; @lett
|
|
|
1728
1730
|
[--letterbase <collection-id>] [--every <days>] [--repo-owner <o>] [--repo-name <r>] [--spec-file <path>]
|
|
1729
1731
|
The repo lives on your organization's GitHub
|
|
1730
1732
|
bench show <id> Spec, domain, repo, site, results, recent events
|
|
1733
|
+
bench check <id> [--skip <contender-id>]… Readiness: GitHub, credentials, domain, model, sandboxes; the quote
|
|
1734
|
+
bench approve <id> [--skip <contender-id>]… Approve a bench in review; nothing is spent before
|
|
1731
1735
|
bench update <id> [--name <n>] [--slug <s>] [--repo-owner <o>] [--repo-name <r>] [--spec-file <path>] [--domain <d>] [--every <days>]
|
|
1732
1736
|
[--disclosure "<text>"|--disclosure-file <path>|--no-disclosure] The README's optional ## Disclosure
|
|
1733
1737
|
bench pause <id> | bench resume <id> | bench archive <id>
|
|
1734
|
-
bench advance <id> [--retry]
|
|
1735
|
-
bench run <id> [--note "<what else to do>"]
|
|
1738
|
+
bench advance <id> [--retry] [--skip <id>]… Move it on now; --retry once blocked_on is done
|
|
1739
|
+
bench run <id> [--note "<what else to do>"] [--spec-changed] [--skip <id>]… Run the benchmark again
|
|
1736
1740
|
bench connect <id> <collection-id|none> A letterbase whose posts cite and link it
|
|
1737
1741
|
bench cite <id> The reference line a post cites
|
|
1738
1742
|
bench replicate <id> REPLICATE.md: how an agent reproduces the results
|
package/lib/commands/bench.mjs
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
// `bench` — Benches from a terminal (docs/architecture/benches.md): public, open-source benchmarks
|
|
2
2
|
// on their own domains, kept running by Letter. Staff only: the tools answer only a key an
|
|
3
3
|
// @letterstory.com person made. Thin wrappers over the bench tools (create_bench, list_benches,
|
|
4
|
-
// get_bench, update_bench, advance_bench, start_bench_run,
|
|
5
|
-
// get_bench_citation), the same lib functions the app calls.
|
|
4
|
+
// get_bench, get_bench_readiness, approve_bench, update_bench, advance_bench, start_bench_run,
|
|
5
|
+
// connect_bench_letterbase, get_bench_citation), the same lib functions the app calls.
|
|
6
6
|
//
|
|
7
7
|
// letterstory bench create --prompt "Benchmark Acme's vector search against Pinecone and Qdrant: …"
|
|
8
8
|
// letterstory bench create --prompt-file brief.md --name VectorBench --domain vectorbench.dev --letterbase <collection-id>
|
|
9
9
|
// [--repo-owner <their GitHub account>] [--repo-name <name>]
|
|
10
10
|
// letterstory bench list
|
|
11
11
|
// letterstory bench show <id>
|
|
12
|
+
// letterstory bench check <id> [--skip <contender-id>]… (the readiness checklist and the quote)
|
|
13
|
+
// letterstory bench approve <id> [--skip <contender-id>]… (a bench in review: nothing is spent before)
|
|
12
14
|
// letterstory bench update <id> [--name <n>] [--slug <s>] [--repo-owner <o>] [--repo-name <r>] [--spec-file spec.json] [--domain <d>] [--every <days>]
|
|
13
15
|
// [--disclosure "<README disclosure text>" | --no-disclosure]
|
|
14
16
|
// letterstory bench pause <id> | resume <id> | archive <id>
|
|
15
|
-
// letterstory bench advance <id> [--retry]
|
|
16
|
-
// letterstory bench run <id> [--note "add Qdrant as a contender"]
|
|
17
|
+
// letterstory bench advance <id> [--retry] [--skip <contender-id>]…
|
|
18
|
+
// letterstory bench run <id> [--note "add Qdrant as a contender"] [--spec-changed] [--skip <contender-id>]…
|
|
17
19
|
// letterstory bench connect <id> <collection-id|none>
|
|
18
20
|
// letterstory bench cite <id>
|
|
19
21
|
// letterstory bench replicate <id>
|
|
@@ -72,8 +74,19 @@ export const ARGS = {
|
|
|
72
74
|
},
|
|
73
75
|
status: { flag: "status", enum: ["live", "paused", "archived"] },
|
|
74
76
|
},
|
|
75
|
-
|
|
76
|
-
|
|
77
|
+
get_bench_readiness: { bench_id: benchId, skip_contenders: { flag: "skip", type: "list" } },
|
|
78
|
+
approve_bench: { bench_id: benchId, skip_contenders: { flag: "skip", type: "list" } },
|
|
79
|
+
advance_bench: {
|
|
80
|
+
bench_id: benchId,
|
|
81
|
+
retry: { flag: "retry", type: "bool" },
|
|
82
|
+
skip_contenders: { flag: "skip", type: "list" },
|
|
83
|
+
},
|
|
84
|
+
start_bench_run: {
|
|
85
|
+
bench_id: benchId,
|
|
86
|
+
note: "note",
|
|
87
|
+
spec_changed: { flag: "spec-changed", type: "bool" },
|
|
88
|
+
skip_contenders: { flag: "skip", type: "list" },
|
|
89
|
+
},
|
|
77
90
|
connect_bench_letterbase: {
|
|
78
91
|
bench_id: benchId,
|
|
79
92
|
collection_id: {
|
|
@@ -104,6 +117,12 @@ export async function cmdBench(ctx) {
|
|
|
104
117
|
return benchShow(rest, await call(rest, "create_bench"));
|
|
105
118
|
case "show":
|
|
106
119
|
return benchShow(rest, await call(rest, "get_bench"));
|
|
120
|
+
case "check":
|
|
121
|
+
refuseUnknownFlags(rest, ARGS.get_bench_readiness, []);
|
|
122
|
+
return benchCheck(rest);
|
|
123
|
+
case "approve":
|
|
124
|
+
refuseUnknownFlags(rest, ARGS.approve_bench, []);
|
|
125
|
+
return benchShow(rest, await call(rest, "approve_bench"));
|
|
107
126
|
case "update":
|
|
108
127
|
refuseUnknownFlags(rest, ARGS.update_bench, [
|
|
109
128
|
"spec-file",
|
|
@@ -131,7 +150,7 @@ export async function cmdBench(ctx) {
|
|
|
131
150
|
return benchReplicate(rest);
|
|
132
151
|
default:
|
|
133
152
|
throw new CliError(
|
|
134
|
-
"Usage: bench [list|create|show|update|pause|resume|archive|advance|run|connect|cite|replicate]"
|
|
153
|
+
"Usage: bench [list|create|show|check|approve|update|pause|resume|archive|advance|run|connect|cite|replicate]"
|
|
135
154
|
);
|
|
136
155
|
}
|
|
137
156
|
}
|
|
@@ -160,6 +179,9 @@ function benchShow(ctx, result) {
|
|
|
160
179
|
`${title(b)} — ${b.status}, stage ${b.stage}`,
|
|
161
180
|
...(b.spec ? [` ${b.spec.tagline}`] : []),
|
|
162
181
|
...(b.blocked_on ? [` Blocked: ${b.blocked_on}`, ` Then: bench advance ${b.id} --retry`] : []),
|
|
182
|
+
...(b.stage === "review" && !b.blocked_on
|
|
183
|
+
? [` In review: check it (bench check ${b.id}), then bench approve ${b.id}`]
|
|
184
|
+
: []),
|
|
163
185
|
...(b.stage_note && !b.blocked_on ? [` ${b.stage_note}`] : []),
|
|
164
186
|
...(b.domain
|
|
165
187
|
? [` Domain ${b.domain}${b.domain_decision?.source === "ai" ? " (chosen and bought)" : ""}`]
|
|
@@ -193,6 +215,32 @@ function benchShow(ctx, result) {
|
|
|
193
215
|
return 0;
|
|
194
216
|
}
|
|
195
217
|
|
|
218
|
+
const MARK = { pass: "✓", warn: "!", block: "✗" };
|
|
219
|
+
|
|
220
|
+
async function benchCheck(ctx) {
|
|
221
|
+
const result = await call(ctx, "get_bench_readiness");
|
|
222
|
+
printResult(ctx.io, ctx.flags, result, (r) => {
|
|
223
|
+
const { readiness } = r;
|
|
224
|
+
const q = readiness.quote;
|
|
225
|
+
const lines = readiness.items.map(
|
|
226
|
+
(i) =>
|
|
227
|
+
`${MARK[i.state]} ${i.label.padEnd(12)} ${i.detail}${i.fix ? ` (${i.fix.label}: ${i.fix.href})` : ""}`
|
|
228
|
+
);
|
|
229
|
+
lines.push(
|
|
230
|
+
"",
|
|
231
|
+
`Domain ${q.domain.domain ?? "—"} (${q.domain.state}${q.domain.price_usd != null ? `, $${q.domain.price_usd}` : ""})`,
|
|
232
|
+
`Repo ${q.repo.owner ?? "?"}/${q.repo.name}${q.repo.public === false ? " (private)" : ""}`,
|
|
233
|
+
`A run at most $${q.run.budget_usd}${q.run.typical_usd != null ? `; typically $${q.run.typical_usd} (${q.run.runs_counted} runs)` : ""}`,
|
|
234
|
+
"",
|
|
235
|
+
readiness.ready
|
|
236
|
+
? "Ready."
|
|
237
|
+
: "Not ready: fix what's marked ✗ (or --skip a contender to run without its credentials)."
|
|
238
|
+
);
|
|
239
|
+
return lines.join("\n");
|
|
240
|
+
});
|
|
241
|
+
return 0;
|
|
242
|
+
}
|
|
243
|
+
|
|
196
244
|
async function benchCite(ctx) {
|
|
197
245
|
const result = await call(ctx, "get_bench_citation");
|
|
198
246
|
printResult(ctx.io, ctx.flags, result, (r) => r.citation.cite_as);
|