@letterstory/cli 0.177.120 → 0.177.122
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 +6 -1
- package/lib/commands/rail.mjs +38 -0
- package/lib/commands/usage.mjs +28 -0
- package/lib/commands.mjs +1 -0
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -70,6 +70,7 @@ import {
|
|
|
70
70
|
cmdPlan,
|
|
71
71
|
cmdMemory,
|
|
72
72
|
cmdGoals,
|
|
73
|
+
cmdRail,
|
|
73
74
|
cmdSite,
|
|
74
75
|
cmdEvals,
|
|
75
76
|
cmdOfferings,
|
|
@@ -92,7 +93,7 @@ import {
|
|
|
92
93
|
import { fetchParkedSections, withoutParked } from "./parked.mjs";
|
|
93
94
|
|
|
94
95
|
// Matches cli/package.json; publish-cli.yml rewrites both to the published version.
|
|
95
|
-
export const VERSION = "0.177.
|
|
96
|
+
export const VERSION = "0.177.122";
|
|
96
97
|
|
|
97
98
|
/** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
|
|
98
99
|
export const EXIT_PAYMENT_REQUIRED = 3;
|
|
@@ -1904,6 +1905,7 @@ Insights:
|
|
|
1904
1905
|
plan strategy add "<words…>" [--site host] Keep a goal in your words as a strategy
|
|
1905
1906
|
plan strategy archive <strategy-id> [--restore] Put one away (its card leaves the Plan), or bring it back
|
|
1906
1907
|
goals list|save|commit [goal] --host <host> Set up goals, save to Memory and commit intent JSON
|
|
1908
|
+
rail [list] | rail set <key>… | rail reset Your Letterpress sidebar's pins, in order
|
|
1907
1909
|
memory ingest [--text|--text-file <path|->] [--link <url>]… [--include-website] [--mcp-url <url>] Push context to Memory: a reviewable proposal
|
|
1908
1910
|
memory apply <ingestion-id> --changes <id>,<id> Save the proposed changes you accept
|
|
1909
1911
|
memory add --section <id> --body <text> [--title] [--origin] File one entry in a custom memory section
|
|
@@ -2183,6 +2185,8 @@ Usage data (what signed-in people do in your own app):
|
|
|
2183
2185
|
usage find-proofs --since <ISO> --until <ISO> [--focus <text>] Analyze actions
|
|
2184
2186
|
usage review-proof --analysis-id <id> --card-id <id> --decision approved|dismissed
|
|
2185
2187
|
usage instrument --action <words> [--event <name>] [--owner <o> --repo <r>] PR that records an action
|
|
2188
|
+
usage test-agents [run [--rounds 4] [--engines chatgpt,claude]] Statistics on vs off with AI engines
|
|
2189
|
+
usage test-agents show <test_id> | stop <test_id> | questions --file <q.json>
|
|
2186
2190
|
usage discover-actions --since <ISO> --until <ISO> Event inventory from connected PostHog
|
|
2187
2191
|
usage evaluate-action --since <ISO> --until <ISO> --definition <file.json>
|
|
2188
2192
|
usage [--days 7|30|90] [--site <id>] [--limit <n>] People, companies and the features they use
|
|
@@ -2369,6 +2373,7 @@ const CLIENT_COMMANDS = {
|
|
|
2369
2373
|
plan: cmdPlan,
|
|
2370
2374
|
memory: cmdMemory,
|
|
2371
2375
|
goals: cmdGoals,
|
|
2376
|
+
rail: cmdRail,
|
|
2372
2377
|
site: cmdSite,
|
|
2373
2378
|
evals: cmdEvals,
|
|
2374
2379
|
visits: cmdVisits,
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// `rail` — your own Letterpress rail (the sidebar), the same list pinning from More sets in the app. Thin wrappers
|
|
2
|
+
// over get_rail_pins / set_rail_pins (lib/rail/pins.ts).
|
|
3
|
+
//
|
|
4
|
+
// letterstory rail your pins, in order
|
|
5
|
+
// letterstory rail set build plan fix templates pin exactly these, in this order
|
|
6
|
+
// letterstory rail reset back to the defaults
|
|
7
|
+
|
|
8
|
+
import { CliError } from "../client.mjs";
|
|
9
|
+
import { argsFromFlags, printResult, refuseUnknownFlags } from "./shared.mjs";
|
|
10
|
+
|
|
11
|
+
export const ARGS = {
|
|
12
|
+
get_rail_pins: {},
|
|
13
|
+
set_rail_pins: {
|
|
14
|
+
// `rail set <key>…` pins exactly these, in order; `rail reset` is the tool's null (the defaults).
|
|
15
|
+
pins: { value: (_flags, positionals) => (positionals[0] === "reset" ? null : positionals.slice(1)) },
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export async function cmdRail(ctx) {
|
|
20
|
+
const [sub, ...keys] = ctx.positionals;
|
|
21
|
+
refuseUnknownFlags(ctx, {}, []);
|
|
22
|
+
let result;
|
|
23
|
+
if (!sub || sub === "list") result = await ctx.client.callTool("get_rail_pins", {});
|
|
24
|
+
else if (sub === "set") {
|
|
25
|
+
if (!keys.length) throw new CliError("Usage: rail set <key> [<key>…] (rail reset puts the defaults back)");
|
|
26
|
+
result = await ctx.client.callTool(
|
|
27
|
+
"set_rail_pins",
|
|
28
|
+
argsFromFlags(ARGS.set_rail_pins, ctx.flags, ctx.positionals)
|
|
29
|
+
);
|
|
30
|
+
} else if (sub === "reset")
|
|
31
|
+
result = await ctx.client.callTool(
|
|
32
|
+
"set_rail_pins",
|
|
33
|
+
argsFromFlags(ARGS.set_rail_pins, ctx.flags, ctx.positionals)
|
|
34
|
+
);
|
|
35
|
+
else throw new CliError("Usage: rail [list] | rail set <key>… | rail reset");
|
|
36
|
+
printResult(ctx.io, ctx.flags, result, (r) => (r.pins ?? []).join("\n"));
|
|
37
|
+
return 0;
|
|
38
|
+
}
|
package/lib/commands/usage.mjs
CHANGED
|
@@ -75,6 +75,17 @@ export const ARGS = {
|
|
|
75
75
|
},
|
|
76
76
|
set_usage_payment_scope: paymentScopeArgs,
|
|
77
77
|
preview_usage_payment_scope: paymentScopeArgs,
|
|
78
|
+
get_agent_tests: { test_id: { positional: 0, label: "test_id" } },
|
|
79
|
+
set_agent_test_questions: {
|
|
80
|
+
questions: {
|
|
81
|
+
value: (flags) => (flags.file ? JSON.parse(readFileSync(String(flags.file), "utf8")) : undefined),
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
start_agent_test: {
|
|
85
|
+
rounds: { flag: "rounds", type: "num" },
|
|
86
|
+
engines: { value: (flags) => (flags.engines ? flagCsv(flags.engines) : undefined) },
|
|
87
|
+
},
|
|
88
|
+
stop_agent_test: { test_id: { positional: 0, required: true, label: "test_id" } },
|
|
78
89
|
get_shown_statistics: {},
|
|
79
90
|
set_shown_statistic: {
|
|
80
91
|
choice_id: { positional: 0, required: true, label: "choice_id" },
|
|
@@ -377,6 +388,23 @@ export async function cmdUsage(ctx) {
|
|
|
377
388
|
}
|
|
378
389
|
throw new CliError("Use shown, shown show|hide <choice_id>, shown pr or shown check");
|
|
379
390
|
}
|
|
391
|
+
if (ctx.positionals[0] === "test-agents") {
|
|
392
|
+
const sub = ctx.positionals[1] ?? "status";
|
|
393
|
+
const rest = ctx.positionals.slice(2);
|
|
394
|
+
const tool = {
|
|
395
|
+
status: "get_agent_tests",
|
|
396
|
+
show: "get_agent_tests",
|
|
397
|
+
questions: "set_agent_test_questions",
|
|
398
|
+
run: "start_agent_test",
|
|
399
|
+
stop: "stop_agent_test",
|
|
400
|
+
}[sub];
|
|
401
|
+
if (!tool)
|
|
402
|
+
throw new CliError(
|
|
403
|
+
"Use test-agents, test-agents run, show <test_id>, questions --file <q.json> or stop <test_id>"
|
|
404
|
+
);
|
|
405
|
+
printResult(io, flags, await client.callTool(tool, argsFromFlags(ARGS[tool], flags, rest)));
|
|
406
|
+
return 0;
|
|
407
|
+
}
|
|
380
408
|
if (ctx.positionals[0] === "payments") {
|
|
381
409
|
const tool = {
|
|
382
410
|
connect: "connect_usage_payments",
|
package/lib/commands.mjs
CHANGED