@letterstory/cli 0.177.146 → 0.177.148
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 +9 -3
- package/lib/commands/admin.mjs +2 -1
- package/lib/commands/visits.mjs +21 -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.148";
|
|
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,7 +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
|
-
// visits transact add folder|page: leave it out of the set.
|
|
105
|
+
// visits transact add folder|page|connection: leave it out of the set (a connection: switch it off).
|
|
106
106
|
"uncheck",
|
|
107
107
|
"clear-choice",
|
|
108
108
|
"oauth",
|
|
@@ -135,6 +135,8 @@ export const BOOLEAN_FLAGS = new Set([
|
|
|
135
135
|
"check",
|
|
136
136
|
// admin invariants: press every startable row as a check too.
|
|
137
137
|
"presses",
|
|
138
|
+
// admin lost-posts: held posts back to the rework with the draft unchanged.
|
|
139
|
+
"rework",
|
|
138
140
|
// admin targets check: check every target again, checked or not.
|
|
139
141
|
"recheck",
|
|
140
142
|
// build list: also move the builds' open changes along while polling.
|
|
@@ -1213,7 +1215,7 @@ Admin (STAFF key — --staff-key / LETTERSTORY_STAFF_API_KEY; acts before an org
|
|
|
1213
1215
|
what they hold, grouped with ids. Exits 1 on any.
|
|
1214
1216
|
admin dropoff [crossing] [--days 30] Where new accounts stopped in an onboarding crossing
|
|
1215
1217
|
(default letter): the count per step and who. Read only.
|
|
1216
|
-
admin lost-posts [--code lost_guard,lost_provider] [--days 7] [--org <id>] [--limit 200] [--apply]
|
|
1218
|
+
admin lost-posts [--code lost_guard,lost_provider|held_guard] [--rework] [--days 7] [--org <id>] [--limit 200] [--apply]
|
|
1217
1219
|
Letterbase posts lost on our side (a publish guard dropped
|
|
1218
1220
|
the finished post, a provider outage failed the slot) and
|
|
1219
1221
|
never published. Lists what it would requeue; --apply puts
|
|
@@ -2128,6 +2130,10 @@ Visits (Visitors: AI agents reading your site, and AI answers sending people to
|
|
|
2128
2130
|
visits connectors | disconnect <id> The site's host connectors
|
|
2129
2131
|
visits transact [on|off] [--site <id>|--host <h>] Transact: agents' questions answered from your sources, cited
|
|
2130
2132
|
visits transact add folder <path> [--uncheck] | page <url> [--uncheck] | site <host> | file <path> | text --title <t> --text <t>
|
|
2133
|
+
visits transact add connection code|events|database [--uncheck]
|
|
2134
|
+
Look into your product's code, events or database when the pages don't answer
|
|
2135
|
+
visits transact pr [--repo owner/name] [--base <branch>] [--site <id>|--host <h>]
|
|
2136
|
+
One pull request: the line for agents, and answers to what they asked
|
|
2131
2137
|
visits transact source <source-id>|--folder <path> | remove <id> | test "<question>"
|
|
2132
2138
|
visits transact asks [--since 7d] [--limit <n>] What agents asked, answered, and asks per agent visit
|
|
2133
2139
|
|
package/lib/commands/admin.mjs
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
// admin letterpress endings [--days N] [--write-cases] (how turns and repo changes ended when not done, by owner)
|
|
25
25
|
// admin letterpress settings|flip|set … (recipes:read / recipes:write)
|
|
26
26
|
// admin invariants [--org <id>,…] [--limit N] [--presses] (staff)
|
|
27
|
-
// admin lost-posts [--code lost_guard,lost_provider|held_guard] [--days N] [--org <id>] [--limit N] [--apply] (staff)
|
|
27
|
+
// admin lost-posts [--code lost_guard,lost_provider|held_guard] [--rework] [--days N] [--org <id>] [--limit N] [--apply] (staff)
|
|
28
28
|
// admin demo guide|list|show|set|reset|check|ideas … (demo:read / demo:write)
|
|
29
29
|
// admin deployments [--health down|failing|blocked|setting_up|live|paused|archived] [--org <id>] [--q <text>] [--archived] [--test] [--no-host] (fleet:read)
|
|
30
30
|
// admin deployments move <app-id> --to <org-id> (--dry-run | --yes) (fleet:onboard)
|
|
@@ -74,6 +74,7 @@ export const ARGS = {
|
|
|
74
74
|
requeue_lost_posts: {
|
|
75
75
|
dry_run: { value: (flags) => !flagBool(flags.apply) },
|
|
76
76
|
codes: { value: (flags) => (flags.code ? flagCsv(flags.code) : undefined) },
|
|
77
|
+
rework: { flag: "rework", type: "bool" },
|
|
77
78
|
days: { flag: "days", type: "num" },
|
|
78
79
|
org_id: { flag: "org" },
|
|
79
80
|
limit: { flag: "limit", type: "num" },
|
package/lib/commands/visits.mjs
CHANGED
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
// letterstory visits transact [on|off] [--host acme.com] Transact: agents' questions answered from your sources, cited
|
|
25
25
|
// letterstory visits transact add folder /blog [--uncheck] | page <url> [--uncheck] | site docs.acme.com
|
|
26
26
|
// letterstory visits transact add file ./faq.pdf | text --title Support --text "…"
|
|
27
|
+
// letterstory visits transact add connection code|events|database [--uncheck] look into it when the pages don't answer
|
|
28
|
+
// letterstory visits transact pr [--repo owner/name] [--base branch] the line and the missed answers, as one pull request
|
|
27
29
|
// letterstory visits transact source <source-id> | --folder /docs
|
|
28
30
|
// letterstory visits transact remove <source-id>
|
|
29
31
|
// letterstory visits transact test "What does it cost?"
|
|
@@ -115,9 +117,12 @@ export const ARGS = {
|
|
|
115
117
|
site_id: "site",
|
|
116
118
|
kind: {
|
|
117
119
|
positional: 0,
|
|
118
|
-
label: "kind (folder | page | site | file | text)",
|
|
120
|
+
label: "kind (folder | page | site | file | text | connection)",
|
|
119
121
|
required: true,
|
|
120
|
-
enum: ["folder", "page", "site", "file", "text"],
|
|
122
|
+
enum: ["folder", "page", "site", "file", "text", "connection"],
|
|
123
|
+
},
|
|
124
|
+
connection: {
|
|
125
|
+
value: (flags, positionals) => (positionals[0] === "connection" ? positionals[1] : undefined),
|
|
121
126
|
},
|
|
122
127
|
path: {
|
|
123
128
|
value: (flags, positionals) =>
|
|
@@ -159,6 +164,7 @@ export const ARGS = {
|
|
|
159
164
|
site_id: "site",
|
|
160
165
|
source_id: { positional: 0, label: "source id", required: true },
|
|
161
166
|
},
|
|
167
|
+
visitors_open_transact_pr: { site_id: "site", host: "host", repo: "repo", base_branch: "base" },
|
|
162
168
|
visitors_list_transact_asks: { site_id: "site", days, limit: { flag: "limit", type: "num" } },
|
|
163
169
|
visitors_export: {
|
|
164
170
|
site_id: "site",
|
|
@@ -333,10 +339,17 @@ function transactLines(t) {
|
|
|
333
339
|
const what = s.snapshot ? `snapshot, ${s.chars} characters` : `${s.pages} ${s.pages === 1 ? "page" : "pages"}`;
|
|
334
340
|
lines.push(` ${s.id} ${s.kind} ${s.title} ${what} cited ${s.times_cited}`);
|
|
335
341
|
}
|
|
342
|
+
if (t.connections?.length) lines.push("", "Connections (looked into when the pages don't answer):");
|
|
343
|
+
for (const c of t.connections ?? [])
|
|
344
|
+
lines.push(
|
|
345
|
+
c.connected
|
|
346
|
+
? ` [${c.checked ? "x" : " "}] ${c.connection} ${c.title} cited ${c.times_cited}${c.source_id ? ` ${c.source_id}` : ""}`
|
|
347
|
+
: ` [-] ${c.connection} ${c.title} not connected`
|
|
348
|
+
);
|
|
336
349
|
return lines;
|
|
337
350
|
}
|
|
338
351
|
|
|
339
|
-
/** `visits transact`: read it; `on` / `off`; `add <kind> …`; `source <id>`; `remove <id>`; `test "…"`; `asks`. */
|
|
352
|
+
/** `visits transact`: read it; `on` / `off`; `add <kind> …`; `source <id>`; `remove <id>`; `test "…"`; `pr`; `asks`. */
|
|
340
353
|
async function visitsTransact(ctx) {
|
|
341
354
|
const { flags, io } = ctx;
|
|
342
355
|
const sub = ctx.positionals[0];
|
|
@@ -379,6 +392,10 @@ async function visitsTransact(ctx) {
|
|
|
379
392
|
);
|
|
380
393
|
return 0;
|
|
381
394
|
}
|
|
395
|
+
if (sub === "pr") {
|
|
396
|
+
printResult(io, flags, await call(rest, "visitors_open_transact_pr"));
|
|
397
|
+
return 0;
|
|
398
|
+
}
|
|
382
399
|
if (sub === "asks") {
|
|
383
400
|
const result = await call(rest, "visitors_list_transact_asks");
|
|
384
401
|
printResult(io, flags, result, (r) => {
|
|
@@ -394,7 +411,7 @@ async function visitsTransact(ctx) {
|
|
|
394
411
|
return 0;
|
|
395
412
|
}
|
|
396
413
|
if (sub !== undefined)
|
|
397
|
-
throw new CliError("Usage: visits transact [on|off|add <kind>|source <id>|remove <id>|test|asks]");
|
|
414
|
+
throw new CliError("Usage: visits transact [on|off|add <kind>|source <id>|remove <id>|test|pr|asks]");
|
|
398
415
|
const result = await call(ctx, "visitors_get_transact");
|
|
399
416
|
printResult(io, flags, result, (t) => transactLines(t).join("\n"));
|
|
400
417
|
return 0;
|