@letterstory/cli 0.177.175 → 0.177.177
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 +2 -1
- package/lib/commands/usage.mjs +25 -0
- package/lib/commands/visits.mjs +4 -4
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -93,7 +93,7 @@ import {
|
|
|
93
93
|
import { fetchParkedSections, withoutParked } from "./parked.mjs";
|
|
94
94
|
|
|
95
95
|
// Matches cli/package.json; publish-cli.yml rewrites both to the published version.
|
|
96
|
-
export const VERSION = "0.177.
|
|
96
|
+
export const VERSION = "0.177.177";
|
|
97
97
|
|
|
98
98
|
/** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
|
|
99
99
|
export const EXIT_PAYMENT_REQUIRED = 3;
|
|
@@ -102,6 +102,7 @@ export const EXIT_PAYMENT_REQUIRED = 3;
|
|
|
102
102
|
// can't accidentally swallow the id as --json's value. Every `type: "bool"` flag (and its
|
|
103
103
|
// `negate` spelling) in a command's ARGS map must be listed; boolean-flags.test.ts enforces it.
|
|
104
104
|
export const BOOLEAN_FLAGS = new Set([
|
|
105
|
+
"approve",
|
|
105
106
|
"update",
|
|
106
107
|
// repo list: open changes past --limit are listed unless --newest-only.
|
|
107
108
|
"include-open",
|
package/lib/commands/usage.mjs
CHANGED
|
@@ -51,6 +51,20 @@ const paymentScopeArgs = {
|
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
export const ARGS = {
|
|
54
|
+
list_evidence_snapshots: { site_id: { flag: "site" } },
|
|
55
|
+
draft_evidence_snapshot: {
|
|
56
|
+
fresh: { flag: "fresh", type: "bool" },
|
|
57
|
+
choice_id: { flag: "choice" },
|
|
58
|
+
days: { flag: "days", type: "num" },
|
|
59
|
+
site_id: { flag: "site" },
|
|
60
|
+
prompt: { positional: 0, required: true, label: "prompt" },
|
|
61
|
+
},
|
|
62
|
+
calculate_evidence_snapshot: { id: { positional: 0, required: true, label: "draft id" } },
|
|
63
|
+
publish_evidence_snapshot: {
|
|
64
|
+
id: { positional: 0, required: true, label: "reviewed draft id" },
|
|
65
|
+
approve: { value: (flags) => flags.approve === true },
|
|
66
|
+
},
|
|
67
|
+
|
|
54
68
|
connect_usage_payments: {
|
|
55
69
|
host: { flag: "host" },
|
|
56
70
|
restricted_key: {
|
|
@@ -364,6 +378,17 @@ export async function cmdUsage(ctx) {
|
|
|
364
378
|
printResult(io, flags, await client.callTool(tool, argsFromFlags(ARGS[tool], flags, [])));
|
|
365
379
|
return 0;
|
|
366
380
|
}
|
|
381
|
+
if (ctx.positionals[0] === "evidence") {
|
|
382
|
+
const tool = {
|
|
383
|
+
list: "list_evidence_snapshots",
|
|
384
|
+
draft: "draft_evidence_snapshot",
|
|
385
|
+
calculate: "calculate_evidence_snapshot",
|
|
386
|
+
publish: "publish_evidence_snapshot",
|
|
387
|
+
}[ctx.positionals[1] || "list"];
|
|
388
|
+
if (!tool) throw new CliError("Use evidence list, draft, calculate or publish");
|
|
389
|
+
printResult(io, flags, await client.callTool(tool, argsFromFlags(ARGS[tool], flags, ctx.positionals.slice(2))));
|
|
390
|
+
return 0;
|
|
391
|
+
}
|
|
367
392
|
if (ctx.positionals[0] === "shown") {
|
|
368
393
|
const sub = ctx.positionals[1] ?? "status";
|
|
369
394
|
const rest = ctx.positionals.slice(2);
|
package/lib/commands/visits.mjs
CHANGED
|
@@ -173,7 +173,7 @@ export const ARGS = {
|
|
|
173
173
|
before: "before",
|
|
174
174
|
include_tests: { flag: "include-tests", type: "bool" },
|
|
175
175
|
},
|
|
176
|
-
visitors_list_transact_tests: { site_id: "site" },
|
|
176
|
+
visitors_list_transact_tests: { site_id: "site", host: "host" },
|
|
177
177
|
visitors_test_transact: {
|
|
178
178
|
draft: { flag: "draft", type: "bool" },
|
|
179
179
|
discovery: { flag: "discover", type: "bool" },
|
|
@@ -184,9 +184,9 @@ export const ARGS = {
|
|
|
184
184
|
site_id: "site",
|
|
185
185
|
source_id: { positional: 0, label: "source id", required: true },
|
|
186
186
|
},
|
|
187
|
-
visitors_list_transact_asks: { site_id: "site", days, limit: { flag: "limit", type: "num" } },
|
|
188
|
-
visitors_get_transact_learnings: { site_id: "site", days },
|
|
189
|
-
visitors_get_agent_site: { site_id: "site" },
|
|
187
|
+
visitors_list_transact_asks: { site_id: "site", host: "host", days, limit: { flag: "limit", type: "num" } },
|
|
188
|
+
visitors_get_transact_learnings: { site_id: "site", host: "host", days },
|
|
189
|
+
visitors_get_agent_site: { site_id: "site", host: "host" },
|
|
190
190
|
visitors_set_agent_site: {
|
|
191
191
|
site_id: "site",
|
|
192
192
|
publish: { value: (flags, positionals) => ({ publish: true, unpublish: false })[positionals[0]] },
|