@letterstory/cli 0.103.2 → 0.104.0
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 -3
- package/lib/commands/repo.mjs +44 -3
- package/lib/commands/site.mjs +1 -0
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
} from "./commands.mjs";
|
|
61
61
|
|
|
62
62
|
// Keep in sync with cli/package.json.
|
|
63
|
-
export const VERSION = "0.
|
|
63
|
+
export const VERSION = "0.104.0";
|
|
64
64
|
|
|
65
65
|
// Flags that never take a value. Listing them explicitly means `deploy get --json <id>`
|
|
66
66
|
// can't accidentally swallow the id as --json's value. Every `type: "bool"` flag (and its
|
|
@@ -1172,9 +1172,12 @@ Repo changes (Claude Code edits your repo in a sandbox; the Letterstory GitHub A
|
|
|
1172
1172
|
repo branches --repo owner/name Branches a change can start from (default first)
|
|
1173
1173
|
repo suggestions Fixes found and not acted on yet, and how to start each
|
|
1174
1174
|
repo settings [--action build|build_pr|slack] [--branch <name>|none] [--slack-agent <name|U…>|none]
|
|
1175
|
+
[--slack-channel <C…>|none]
|
|
1175
1176
|
The org's defaults for every fix: build (preview first),
|
|
1176
|
-
build_pr, or slack (post it for your
|
|
1177
|
-
--slack-agent), and the branch changes go to
|
|
1177
|
+
build_pr, or slack (post it to --slack-channel for your
|
|
1178
|
+
own agent, tagging --slack-agent), and the branch changes go to
|
|
1179
|
+
repo slack-targets Slack channels and people Send to Slack can use, with ids
|
|
1180
|
+
repo slack-test Post a test into the Send to Slack channel
|
|
1178
1181
|
repo start --repo <owner/name> --instructions <text>|--instructions-file <path|->
|
|
1179
1182
|
[--branch <base>] [--attach <path>]... [--attach-url <name>=<https url>]...
|
|
1180
1183
|
[--action build|build_pr|slack] [--wait]
|
package/lib/commands/repo.mjs
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
// repo install-letterprove → letterprove_open_install_pr
|
|
8
8
|
// repo suggestions → list_suggested_fixes
|
|
9
9
|
// repo settings → get_repo_change_settings, or set_repo_change_settings with --action / --branch
|
|
10
|
+
// repo slack-targets → list_slack_fix_targets repo slack-test → send_slack_test_message
|
|
10
11
|
|
|
11
12
|
import { readFileSync } from "node:fs";
|
|
12
13
|
import { basename } from "node:path";
|
|
@@ -81,12 +82,18 @@ const ARGS = {
|
|
|
81
82
|
},
|
|
82
83
|
get_repo_change_settings: {},
|
|
83
84
|
list_suggested_fixes: {},
|
|
85
|
+
list_slack_fix_targets: {},
|
|
86
|
+
send_slack_test_message: {},
|
|
84
87
|
set_repo_change_settings: {
|
|
85
88
|
default_action: { flag: "action", enum: ["build", "build_pr", "slack"] },
|
|
86
89
|
// --branch <name>, or --branch none for each repo's own default.
|
|
87
90
|
default_branch: { value: (flags) => (flags.branch === "none" ? null : flagStr(flags.branch)) },
|
|
88
91
|
// --slack-agent Devin (or a U… member id), or --slack-agent none to tag nobody.
|
|
89
92
|
slack_agent: { value: (flags) => (flags["slack-agent"] === "none" ? null : flagStr(flags["slack-agent"])) },
|
|
93
|
+
// --slack-channel C0123ABCD (from repo slack-targets), or none for the first linked channel.
|
|
94
|
+
slack_channel: {
|
|
95
|
+
value: (flags) => (flags["slack-channel"] === "none" ? null : flagStr(flags["slack-channel"])),
|
|
96
|
+
},
|
|
90
97
|
},
|
|
91
98
|
get_repo_change: { run_id: { positional: 0, required: true, label: "run-id" } },
|
|
92
99
|
cancel_repo_change: { run_id: { positional: 0, required: true, label: "run-id" } },
|
|
@@ -151,9 +158,13 @@ export async function cmdRepo(ctx) {
|
|
|
151
158
|
return repoSettings(rest);
|
|
152
159
|
case "suggestions":
|
|
153
160
|
return repoSuggestions(rest);
|
|
161
|
+
case "slack-targets":
|
|
162
|
+
return repoSlackTargets(rest);
|
|
163
|
+
case "slack-test":
|
|
164
|
+
return repoSlackTest(rest);
|
|
154
165
|
default:
|
|
155
166
|
throw new CliError(
|
|
156
|
-
`Unknown repo subcommand: ${sub ?? "(none)"}. Try: start, fix-audit, install-letterprove, sites, set-site, reset-site, status, list, publish, cancel, repos, branches, settings, suggestions`
|
|
167
|
+
`Unknown repo subcommand: ${sub ?? "(none)"}. Try: start, fix-audit, install-letterprove, sites, set-site, reset-site, status, list, publish, cancel, repos, branches, settings, suggestions, slack-targets, slack-test`
|
|
157
168
|
);
|
|
158
169
|
}
|
|
159
170
|
}
|
|
@@ -407,8 +418,12 @@ async function repoBranches(ctx) {
|
|
|
407
418
|
*/
|
|
408
419
|
async function repoSettings(ctx) {
|
|
409
420
|
const { client, flags, io } = ctx;
|
|
410
|
-
refuseUnknownFlags(ctx, {}, ["action", "branch", "slack-agent"]);
|
|
411
|
-
const setting =
|
|
421
|
+
refuseUnknownFlags(ctx, {}, ["action", "branch", "slack-agent", "slack-channel"]);
|
|
422
|
+
const setting =
|
|
423
|
+
flags.action !== undefined ||
|
|
424
|
+
flags.branch !== undefined ||
|
|
425
|
+
flags["slack-agent"] !== undefined ||
|
|
426
|
+
flags["slack-channel"] !== undefined;
|
|
412
427
|
const result = setting
|
|
413
428
|
? await client.callTool("set_repo_change_settings", argsFromFlags(ARGS.set_repo_change_settings, flags))
|
|
414
429
|
: await client.callTool("get_repo_change_settings", {});
|
|
@@ -441,4 +456,30 @@ async function repoSuggestions(ctx) {
|
|
|
441
456
|
return 0;
|
|
442
457
|
}
|
|
443
458
|
|
|
459
|
+
/** `repo slack-targets`: the channels and people Send to Slack can use, with their ids. */
|
|
460
|
+
async function repoSlackTargets(ctx) {
|
|
461
|
+
const { client, flags, io } = ctx;
|
|
462
|
+
refuseUnknownFlags(ctx, {}, []);
|
|
463
|
+
const result = await client.callTool("list_slack_fix_targets", {});
|
|
464
|
+
printResult(io, flags, result, (r) =>
|
|
465
|
+
[
|
|
466
|
+
"Channels (repo settings --slack-channel <id>):",
|
|
467
|
+
...r.channels.map((c) => ` ${c.id} #${c.name}`),
|
|
468
|
+
"People (repo settings --slack-agent <id>):",
|
|
469
|
+
...r.people.map((p) => ` ${p.id} ${p.name}${p.is_bot ? " (bot)" : ""}`),
|
|
470
|
+
].join("\n")
|
|
471
|
+
);
|
|
472
|
+
return 0;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
/** `repo slack-test`: post a test into the Send to Slack channel. */
|
|
476
|
+
async function repoSlackTest(ctx) {
|
|
477
|
+
const { client, flags, io } = ctx;
|
|
478
|
+
refuseUnknownFlags(ctx, {}, []);
|
|
479
|
+
const result = await client.callTool("send_slack_test_message", {});
|
|
480
|
+
ok(ctx, result.message);
|
|
481
|
+
printResult(io, flags, result);
|
|
482
|
+
return 0;
|
|
483
|
+
}
|
|
484
|
+
|
|
444
485
|
export { ARGS };
|
package/lib/commands/site.mjs
CHANGED