@letterstory/cli 0.175.14 → 0.175.16
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 +1 -1
- package/lib/commands/repo.mjs +17 -1
- package/lib/commands/vary.mjs +13 -2
- 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.16";
|
|
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;
|
package/lib/commands/repo.mjs
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
// repo list → list_repo_changes repo cancel → cancel_repo_change
|
|
6
6
|
// repo publish → publish_repo_change (Make PR on a preview)
|
|
7
7
|
// repo merge → merge_repo_change (merge its open PR, as a squash)
|
|
8
|
+
// repo retry → retry_repo_change (try a failed change again: same ask, fresh run)
|
|
8
9
|
// repo revise → revise_repo_change (ask for more on a preview or an open PR; --copy-edits-file for exact copy)
|
|
9
10
|
// repo say → send_repo_change_message (steer a build while its agent works)
|
|
10
11
|
// repo repos → list_github_app_repos repo branches → list_repo_branches
|
|
@@ -260,6 +261,7 @@ const ARGS = {
|
|
|
260
261
|
},
|
|
261
262
|
publish_repo_change: { run_id: { positional: 0, required: true, label: "run-id" } },
|
|
262
263
|
merge_repo_change: { run_id: { positional: 0, required: true, label: "run-id" } },
|
|
264
|
+
retry_repo_change: { run_id: { positional: 0, required: true, label: "run-id" } },
|
|
263
265
|
revise_repo_change: {
|
|
264
266
|
run_id: { positional: 0, required: true, label: "run-id" },
|
|
265
267
|
instructions: { value: (flags) => readTextInput(flags, "instructions", "instructions-file") },
|
|
@@ -374,6 +376,8 @@ export async function cmdRepo(ctx) {
|
|
|
374
376
|
return repoPublish(rest);
|
|
375
377
|
case "merge":
|
|
376
378
|
return repoMerge(rest);
|
|
379
|
+
case "retry":
|
|
380
|
+
return repoRetry(rest);
|
|
377
381
|
case "revise":
|
|
378
382
|
return repoRevise(rest);
|
|
379
383
|
case "say":
|
|
@@ -396,7 +400,7 @@ export async function cmdRepo(ctx) {
|
|
|
396
400
|
return repoSlackTest(rest);
|
|
397
401
|
default:
|
|
398
402
|
throw new CliError(
|
|
399
|
-
`Unknown repo subcommand: ${sub ?? "(none)"}. Try: start, fix-audit, install-letterprove, install-visitors, sites, set-site, reset-site, secrets, set-secret, delete-secret, status, list, publish, merge, revise, say, cancel, repos, branches, prs, settings, suggestions, slack-targets, slack-test`
|
|
403
|
+
`Unknown repo subcommand: ${sub ?? "(none)"}. Try: start, fix-audit, install-letterprove, install-visitors, sites, set-site, reset-site, secrets, set-secret, delete-secret, status, list, publish, merge, retry, revise, say, cancel, repos, branches, prs, settings, suggestions, slack-targets, slack-test`
|
|
400
404
|
);
|
|
401
405
|
}
|
|
402
406
|
}
|
|
@@ -733,6 +737,18 @@ async function repoMerge(ctx) {
|
|
|
733
737
|
return 0;
|
|
734
738
|
}
|
|
735
739
|
|
|
740
|
+
/** `repo retry <run-id>`: try a failed change again, as a fresh run with the same ask and options. */
|
|
741
|
+
async function repoRetry(ctx) {
|
|
742
|
+
const { client, flags, io } = ctx;
|
|
743
|
+
const result = await client.callTool(
|
|
744
|
+
"retry_repo_change",
|
|
745
|
+
argsFromFlags(ARGS.retry_repo_change, flags, ctx.positionals)
|
|
746
|
+
);
|
|
747
|
+
ok(ctx, result.message);
|
|
748
|
+
printResult(io, flags, result.run, describe);
|
|
749
|
+
return 0;
|
|
750
|
+
}
|
|
751
|
+
|
|
736
752
|
/** `repo say <run-id> <message…>` (or --message): steer a build while its agent works. */
|
|
737
753
|
async function repoSay(ctx) {
|
|
738
754
|
const { client, flags, io } = ctx;
|
package/lib/commands/vary.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// `vary` — Variationals from a terminal: A/B tests of a page's words and images on your own site
|
|
2
2
|
// (docs/architecture/variationals.md). Thin wrappers over the variationals tools (list_variationals,
|
|
3
3
|
// get_variational, create_variational, update_variational, save_variational_variant,
|
|
4
|
-
// remove_variational_variant, delete_variational), the same lib functions the app calls.
|
|
4
|
+
// remove_variational_variant, delete_variational, ship_variational_winner), the same lib functions the app calls.
|
|
5
5
|
//
|
|
6
6
|
// letterstory vary list [--status running]
|
|
7
7
|
// letterstory vary create --page https://acme.com/pricing [--name "Pricing headline"] [--goals-file goals.json]
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
// letterstory vary weights <id> a=50,b=50
|
|
14
14
|
// letterstory vary goals <id> --goals-file goals.json
|
|
15
15
|
// letterstory vary start <id> | pause <id> | end <id> [--winner b]
|
|
16
|
+
// letterstory vary ship <id> [--variant b] the winner written into the site's code, as a pull request
|
|
16
17
|
// letterstory vary remove-variant <id> <key>
|
|
17
18
|
// letterstory vary delete <id>
|
|
18
19
|
|
|
@@ -70,6 +71,10 @@ export const ARGS = {
|
|
|
70
71
|
name: "name",
|
|
71
72
|
goals: jsonFile("goals-file", "goals"),
|
|
72
73
|
},
|
|
74
|
+
ship_variational_winner: {
|
|
75
|
+
variational_id: variationalId,
|
|
76
|
+
variant: "variant",
|
|
77
|
+
},
|
|
73
78
|
update_variational: {
|
|
74
79
|
variational_id: variationalId,
|
|
75
80
|
name: "name",
|
|
@@ -148,6 +153,12 @@ export async function cmdVary(ctx) {
|
|
|
148
153
|
}
|
|
149
154
|
case "remove-variant":
|
|
150
155
|
return varyShow(rest, await call(rest, "remove_variational_variant"));
|
|
156
|
+
case "ship": {
|
|
157
|
+
refuseUnknownFlags(rest, ARGS.ship_variational_winner, []);
|
|
158
|
+
const result = await call(rest, "ship_variational_winner");
|
|
159
|
+
printResult(rest.io, rest.flags, result, (r) => r.message);
|
|
160
|
+
return 0;
|
|
161
|
+
}
|
|
151
162
|
case "delete": {
|
|
152
163
|
const result = await call(rest, "delete_variational");
|
|
153
164
|
printResult(rest.io, rest.flags, result, (r) => `Deleted ${r.deleted}.`);
|
|
@@ -155,7 +166,7 @@ export async function cmdVary(ctx) {
|
|
|
155
166
|
}
|
|
156
167
|
default:
|
|
157
168
|
throw new CliError(
|
|
158
|
-
"Usage: vary [list|get|page|create|update|weights|goals|start|pause|end|save-variant|remove-variant|delete]"
|
|
169
|
+
"Usage: vary [list|get|page|create|update|weights|goals|start|pause|end|save-variant|remove-variant|ship|delete]"
|
|
159
170
|
);
|
|
160
171
|
}
|
|
161
172
|
}
|