@letterstory/cli 0.176.6 → 0.176.8
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 +10 -2
- package/lib/commands/admin.mjs +39 -1
- package/lib/commands/repo.mjs +6 -0
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -80,7 +80,7 @@ import {
|
|
|
80
80
|
import { fetchParkedSections, withoutParked } from "./parked.mjs";
|
|
81
81
|
|
|
82
82
|
// Matches cli/package.json; publish-cli.yml rewrites both to the published version.
|
|
83
|
-
export const VERSION = "0.176.
|
|
83
|
+
export const VERSION = "0.176.8";
|
|
84
84
|
|
|
85
85
|
/** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
|
|
86
86
|
export const EXIT_PAYMENT_REQUIRED = 3;
|
|
@@ -994,6 +994,12 @@ Admin (STAFF key — --staff-key / LETTERSTORY_STAFF_API_KEY; acts before an org
|
|
|
994
994
|
how runs grounded (a recipe / none). Needs recipes:read.
|
|
995
995
|
admin letterpress gaps [--customers] The gaps the numbers show, each with the one call that
|
|
996
996
|
addresses it, pre-filled. Needs recipes:read.
|
|
997
|
+
admin letterpress decisions <org-id> [--site <host>] [--surface plan|fix|build|site]
|
|
998
|
+
Everything set aside on one account's site: what Letter
|
|
999
|
+
withheld (it cannot do it here) and what a person dismissed,
|
|
1000
|
+
each with who, when, until when and its id. Needs recipes:read.
|
|
1001
|
+
admin letterpress undo <org-id> <host> <decision-id> Take one decision back: a withhold shown anyway, a dismissal
|
|
1002
|
+
undone. Needs recipes:write.
|
|
997
1003
|
admin letterpress replay <run-id> A Build or Fix run through today's checks and settings, no
|
|
998
1004
|
model: what it would keep, drop and rank against what it
|
|
999
1005
|
showed; --json carries the run as an evals case.
|
|
@@ -1683,11 +1689,13 @@ Repo changes (Claude Code edits your repo in a sandbox; the Letter GitHub App op
|
|
|
1683
1689
|
repo settings [--action build|build_pr|build_merge|slack|linear] [--branch <name>|none] [--slack-agent <name|U…>|none]
|
|
1684
1690
|
[--slack-channel <C…>|none] [--autopilot-channel <C…>|none] [--listen <C…,C…>|none] [--autopilot on|off] [--autopilot-weekly <1-20>]
|
|
1685
1691
|
[--autopilot-severity critical|warning] [--auto-merge 1h|12h|24h|3d|off] [--editor-auto-merge on|off]
|
|
1692
|
+
[--agent letterpress-1|claude-code|default]
|
|
1686
1693
|
The org's defaults for every fix: build (preview first),
|
|
1687
1694
|
build_pr, or slack (post it to --slack-channel for your
|
|
1688
1695
|
own agent, tagging --slack-agent), and the branch changes go to;
|
|
1689
1696
|
--auto-merge merges Letter's PRs once open that long;
|
|
1690
|
-
--editor-auto-merge merges Letter Edit's (⌘L) changes once ready
|
|
1697
|
+
--editor-auto-merge merges Letter Edit's (⌘L) changes once ready;
|
|
1698
|
+
--agent is who builds every change, on every door.
|
|
1691
1699
|
What Letter posts to Slack on its own is an automation:
|
|
1692
1700
|
automate add --template … --slack-channel <C…>
|
|
1693
1701
|
repo slack-targets Slack channels and people Send to Slack can use, with ids
|
package/lib/commands/admin.mjs
CHANGED
|
@@ -5144,7 +5144,7 @@ const ENGINE = "/api/superadmin/engine-settings";
|
|
|
5144
5144
|
const LETTERPRESS = "/api/superadmin/letterpress";
|
|
5145
5145
|
const CODING_TELEMETRY = "/api/superadmin/coding-telemetry";
|
|
5146
5146
|
const ENGINE_USAGE =
|
|
5147
|
-
"Usage: admin letterpress status | gaps | telemetry [--days N] [--harness h] [--all-orgs] | blocked [--days N] [--org id] [--all-orgs] | unblock <org-id> <host> <subject> | runs [--status s] [--error-code c] [--first-review-cause agent|context|setup|unknown] [--pr merged|closed|open|none] [--harness h] [--days N] | beyond [--limit N] [--before ISO] | companies | company <org-id> [--site host] | facts <org-id> [--site host] | fits [--recipe id] [--org id] [--site host] [--fits yes|no|unknown|waiting] [--limit N] | replay <run-id> | mark <run-id> <item-id> <right|weak|wrong|lead|gap|recipe|clear> [--note …] | settings | set <weights.<ask>.<reading>|lenses.<lens>.bar.<reading>|lenses.<lens>.bar|lenses.<lens>.research.turns|lenses.<lens>.research.ms|asks.<lens>.ask|asks.<lens>.guidance|dismissals.block_days|preflight.off|explore.ask|explore.research.turns|explore.research.ms|explore.every_days> <value>";
|
|
5147
|
+
"Usage: admin letterpress status | gaps | telemetry [--days N] [--harness h] [--all-orgs] | blocked [--days N] [--org id] [--all-orgs] | unblock <org-id> <host> <subject> | decisions <org-id> [--site host] [--surface plan|fix|build|site] | undo <org-id> <host> <decision-id> | runs [--status s] [--error-code c] [--first-review-cause agent|context|setup|unknown] [--pr merged|closed|open|none] [--harness h] [--days N] | beyond [--limit N] [--before ISO] | companies | company <org-id> [--site host] | facts <org-id> [--site host] | fits [--recipe id] [--org id] [--site host] [--fits yes|no|unknown|waiting] [--limit N] | replay <run-id> | mark <run-id> <item-id> <right|weak|wrong|lead|gap|recipe|clear> [--note …] | settings | set <weights.<ask>.<reading>|lenses.<lens>.bar.<reading>|lenses.<lens>.bar|lenses.<lens>.research.turns|lenses.<lens>.research.ms|asks.<lens>.ask|asks.<lens>.guidance|dismissals.block_days|preflight.off|explore.ask|explore.research.turns|explore.research.ms|explore.every_days> <value>";
|
|
5148
5148
|
|
|
5149
5149
|
/** One number of the settings from a dotted path and a value: the PUT body save_engine_settings reads. */
|
|
5150
5150
|
function engineSettingsPatch(path, value) {
|
|
@@ -5349,6 +5349,44 @@ async function cmdAdminLetterpress(ctx) {
|
|
|
5349
5349
|
);
|
|
5350
5350
|
return 0;
|
|
5351
5351
|
}
|
|
5352
|
+
case "decisions": {
|
|
5353
|
+
// list_decisions: everything set aside on one account's site (docs/architecture/decisions.md).
|
|
5354
|
+
const [orgId] = positionals.slice(1);
|
|
5355
|
+
if (!orgId) throw new CliError("Usage: admin letterpress decisions <org-id> [--site host] [--surface s]");
|
|
5356
|
+
const q = new URLSearchParams({ view: "decisions", org_id: orgId });
|
|
5357
|
+
if (flags.site) q.set("host", String(flags.site));
|
|
5358
|
+
if (flags.surface) q.set("surface", String(flags.surface));
|
|
5359
|
+
const r = await staffRequest(ctx, "GET", `${CODING_TELEMETRY}?${q}`);
|
|
5360
|
+
printResult(io, flags, r, (d) =>
|
|
5361
|
+
!d.host
|
|
5362
|
+
? "No site: the organization has no website yet."
|
|
5363
|
+
: d.decisions.length
|
|
5364
|
+
? [
|
|
5365
|
+
`Set aside on ${d.host}: ${d.decisions.length}`,
|
|
5366
|
+
...d.decisions.map(
|
|
5367
|
+
(x) =>
|
|
5368
|
+
` ${x.id}
|
|
5369
|
+
${x.kind === "withheld" ? "Letter set aside" : "Dismissed"} (${x.surface}${x.code ? `, ${x.code}` : ""}) ${x.title}
|
|
5370
|
+
${x.say}${x.next ? ` ${x.next}` : ""}${x.at ? ` since ${x.at.slice(0, 10)}` : ""}${x.until ? `, lifts ${x.until.slice(0, 10)}` : ""}`
|
|
5371
|
+
),
|
|
5372
|
+
"",
|
|
5373
|
+
`Take one back: admin letterpress undo ${orgId} ${d.host} <decision-id>`,
|
|
5374
|
+
].join("\n")
|
|
5375
|
+
: `Nothing is set aside on ${d.host}.`
|
|
5376
|
+
);
|
|
5377
|
+
return 0;
|
|
5378
|
+
}
|
|
5379
|
+
case "undo": {
|
|
5380
|
+
// undo_decision: one decision back, by its id.
|
|
5381
|
+
const [orgId, host, id] = positionals.slice(1);
|
|
5382
|
+
if (!orgId || !host || !id)
|
|
5383
|
+
throw new CliError("Usage: admin letterpress undo <org-id> <host> <decision-id>");
|
|
5384
|
+
const r = await staffRequest(ctx, "POST", CODING_TELEMETRY, { org_id: orgId, host, id });
|
|
5385
|
+
printResult(io, flags, r, (x) =>
|
|
5386
|
+
x.undone ? "Taken back: it is offered and allowed to start again." : "Nothing was holding."
|
|
5387
|
+
);
|
|
5388
|
+
return 0;
|
|
5389
|
+
}
|
|
5352
5390
|
case "runs": {
|
|
5353
5391
|
// list_coding_runs with fleet.
|
|
5354
5392
|
const q = new URLSearchParams({
|
package/lib/commands/repo.mjs
CHANGED
|
@@ -205,6 +205,11 @@ const ARGS = {
|
|
|
205
205
|
autopilot_min_severity: { flag: "autopilot-severity", enum: ["critical", "warning"] },
|
|
206
206
|
// --auto-merge 1h|12h|24h|3d (or the hours: 1, 12, 24, 72), or --auto-merge off
|
|
207
207
|
auto_merge_after_hours: { value: (flags) => autoMergeHours(flags["auto-merge"]) },
|
|
208
|
+
// --agent letterpress-1|claude-code|default: the coding agent every change runs on (default = the deployment's)
|
|
209
|
+
default_harness: {
|
|
210
|
+
value: (flags) =>
|
|
211
|
+
flags.agent === undefined ? undefined : flags.agent === "default" ? null : String(flags.agent),
|
|
212
|
+
},
|
|
208
213
|
// --editor-auto-merge on|off: Letter Edit's (⌘L) changes merge once they're ready
|
|
209
214
|
editor_auto_merge: {
|
|
210
215
|
value: (flags) =>
|
|
@@ -839,6 +844,7 @@ async function repoSettings(ctx) {
|
|
|
839
844
|
"autopilot-severity",
|
|
840
845
|
"auto-merge",
|
|
841
846
|
"editor-auto-merge",
|
|
847
|
+
"agent",
|
|
842
848
|
];
|
|
843
849
|
refuseUnknownFlags(ctx, {}, settingFlags);
|
|
844
850
|
const setting = settingFlags.some((f) => flags[f] !== undefined);
|