@letterstory/cli 0.177.183 → 0.177.185
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 +24 -3
- package/lib/commands/visits.mjs +4 -2
- 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.185";
|
|
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
|
+
"share-website",
|
|
105
106
|
"background",
|
|
106
107
|
"directed",
|
|
107
108
|
"approve",
|
package/lib/commands/usage.mjs
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
// letterstory usage database connect (--project <ref> --key <sbp_…> | --url postgres://… | --existing)
|
|
13
13
|
// --host app.acme.com --schemas public --since … --until … Supabase or any Postgres
|
|
14
14
|
// letterstory usage shown [--days 1-90] statistics shown to agents, what agents get, who read them
|
|
15
|
-
// letterstory usage shown
|
|
15
|
+
// letterstory usage shown hide <choice_id> [--snapshot <snapshot_id>] withdraw the current website placement
|
|
16
16
|
// letterstory usage shown pr [--repo <owner/name>] [--base <branch>] put them on the website: one build, one pull request
|
|
17
17
|
// letterstory usage shown check [--url <page>] check a page serves them as the data says
|
|
18
18
|
// letterstory usage case-study [--days 7|30|90] the patterns and the latest case study
|
|
@@ -51,7 +51,24 @@ const paymentScopeArgs = {
|
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
export const ARGS = {
|
|
54
|
-
list_evidence_snapshots: {
|
|
54
|
+
list_evidence_snapshots: {
|
|
55
|
+
site_id: { flag: "site" },
|
|
56
|
+
activity: {
|
|
57
|
+
// Every flag is read up front so the write allowlist sees them, not only after --snapshot.
|
|
58
|
+
value: (flags) => {
|
|
59
|
+
const { snapshot, days, offset } = flags,
|
|
60
|
+
agentSite = flags["agent-site"];
|
|
61
|
+
return snapshot
|
|
62
|
+
? {
|
|
63
|
+
snapshot_id: snapshot,
|
|
64
|
+
agent_site_id: agentSite,
|
|
65
|
+
days: days ? Number(days) : 30,
|
|
66
|
+
offset: offset ? Number(offset) : 0,
|
|
67
|
+
}
|
|
68
|
+
: undefined;
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
55
72
|
draft_evidence_snapshot: {
|
|
56
73
|
tracking_from: { flag: "tracking-from" },
|
|
57
74
|
background: { flag: "background", type: "bool" },
|
|
@@ -70,6 +87,8 @@ export const ARGS = {
|
|
|
70
87
|
},
|
|
71
88
|
calculate_evidence_snapshot: { id: { positional: 0, required: true, label: "draft id" } },
|
|
72
89
|
publish_evidence_snapshot: {
|
|
90
|
+
website: { flag: "share-website", type: "bool" },
|
|
91
|
+
agent_site_id: { flag: "agent-site" },
|
|
73
92
|
id: { positional: 0, required: true, label: "reviewed draft id" },
|
|
74
93
|
approve: { value: (flags) => flags.approve === true },
|
|
75
94
|
},
|
|
@@ -112,6 +131,7 @@ export const ARGS = {
|
|
|
112
131
|
stop_agent_test: { test_id: { positional: 0, required: true, label: "test_id" } },
|
|
113
132
|
get_shown_statistics: { days: { flag: "days", type: "num" } },
|
|
114
133
|
set_shown_statistic: {
|
|
134
|
+
snapshot_id: { flag: "snapshot" },
|
|
115
135
|
choice_id: { positional: 0, required: true, label: "choice_id" },
|
|
116
136
|
shown: { value: (_flags, _positionals, extra) => extra.shown === true },
|
|
117
137
|
},
|
|
@@ -395,8 +415,9 @@ export async function cmdUsage(ctx) {
|
|
|
395
415
|
draft: "draft_evidence_snapshot",
|
|
396
416
|
calculate: "calculate_evidence_snapshot",
|
|
397
417
|
publish: "publish_evidence_snapshot",
|
|
418
|
+
share: "publish_evidence_snapshot",
|
|
398
419
|
}[ctx.positionals[1] || "list"];
|
|
399
|
-
if (!tool) throw new CliError("Use evidence list, draft, calculate or
|
|
420
|
+
if (!tool) throw new CliError("Use evidence list, draft, calculate or share");
|
|
400
421
|
printResult(io, flags, await client.callTool(tool, argsFromFlags(ARGS[tool], flags, ctx.positionals.slice(2))));
|
|
401
422
|
return 0;
|
|
402
423
|
}
|
package/lib/commands/visits.mjs
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
// letterstory visits transact prebuild <site-id>... [--dry-run] staff: build customers' agent sites, Letter paying
|
|
33
33
|
// letterstory visits transact asks [--since 7d] [--limit 50]
|
|
34
34
|
// letterstory visits transact learnings [--since 7d]
|
|
35
|
-
// letterstory visits transact site [publish|unpublish] [--domain ask.acme.com | --domain none] [--remove <slug>] [--dismiss "<question>"] the Agent Site tab
|
|
35
|
+
// letterstory visits transact site [publish|unpublish] [--domain ask.acme.com | --domain none] [--remove <slug>] [--dismiss "<question>"] [--forget <address>] the Agent Site tab
|
|
36
36
|
|
|
37
37
|
import { CliError } from "../client.mjs";
|
|
38
38
|
import { flagBool, flagStr, printResult, argsFromFlags } from "./shared.mjs";
|
|
@@ -208,6 +208,7 @@ export const ARGS = {
|
|
|
208
208
|
},
|
|
209
209
|
remove: { flag: "remove" },
|
|
210
210
|
dismiss: { flag: "dismiss" },
|
|
211
|
+
forget: { flag: "forget" },
|
|
211
212
|
},
|
|
212
213
|
visitors_export: {
|
|
213
214
|
site_id: "site",
|
|
@@ -463,7 +464,8 @@ async function visitsTransact(ctx) {
|
|
|
463
464
|
rest.positionals[0] === "unpublish" ||
|
|
464
465
|
flags.domain !== undefined ||
|
|
465
466
|
flags.remove !== undefined ||
|
|
466
|
-
flags.dismiss !== undefined
|
|
467
|
+
flags.dismiss !== undefined ||
|
|
468
|
+
flags.forget !== undefined;
|
|
467
469
|
const result = await call(rest, write ? "visitors_set_agent_site" : "visitors_get_agent_site");
|
|
468
470
|
printResult(io, flags, result, (r) => {
|
|
469
471
|
if (!r.available) return "Agent Sites aren't available yet";
|