@letterstory/cli 0.177.181 → 0.177.183
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 +3 -1
- package/lib/commands/strategy.mjs +11 -2
- package/lib/commands/visits.mjs +12 -3
- 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.183";
|
|
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;
|
|
@@ -112,6 +112,8 @@ export const BOOLEAN_FLAGS = new Set([
|
|
|
112
112
|
// org overview: only what waits on someone (the More menu's closed read).
|
|
113
113
|
"needs-only",
|
|
114
114
|
"include-tests",
|
|
115
|
+
// visits transact asks --before: page the team's tests instead of agents' asks.
|
|
116
|
+
"tests",
|
|
115
117
|
"as-test",
|
|
116
118
|
"discover",
|
|
117
119
|
// visits transact add folder|page|connection: leave it out of the set (a connection: switch it off).
|
|
@@ -328,16 +328,25 @@ export async function cmdOnboarding(ctx) {
|
|
|
328
328
|
/** The onboarding's steps for its answer, the one it is on marked, and where it finishes. */
|
|
329
329
|
function signupPathLines(path) {
|
|
330
330
|
if (!path) return [];
|
|
331
|
-
|
|
331
|
+
// Finished: every step done (its `step` is null then).
|
|
332
|
+
const at = path.finished ? path.steps.length : path.steps.findIndex((s) => s.id === path.step);
|
|
332
333
|
const lines = path.steps.map((s, i) => `${i === at ? ">" : i < at ? "✓" : " "} ${i + 1}. ${s.title}`);
|
|
333
334
|
return [...lines, ` Finishes in ${path.finish}`];
|
|
334
335
|
}
|
|
335
336
|
|
|
337
|
+
/** Whether set-up is still open, as the app's Onboarding entry reads it, and what is next. */
|
|
338
|
+
function setupLines(setup) {
|
|
339
|
+
if (!setup) return [];
|
|
340
|
+
if (setup.complete) return ["Set-up: done"];
|
|
341
|
+
const next = setup.milestones.find((m) => m.id === setup.next);
|
|
342
|
+
return [`Set-up: next is ${next?.label ?? setup.next}`];
|
|
343
|
+
}
|
|
344
|
+
|
|
336
345
|
async function onboardingStatus(ctx) {
|
|
337
346
|
const { client, flags, io } = ctx;
|
|
338
347
|
const result = await client.callTool("get_onboarding_status", {});
|
|
339
348
|
printResult(io, flags, result, (r) =>
|
|
340
|
-
r.signup ? signupPathLines(r.signup).join("\n") : JSON.stringify(r, null, 2)
|
|
349
|
+
r.signup ? [...signupPathLines(r.signup), ...setupLines(r.setup)].join("\n") : JSON.stringify(r, null, 2)
|
|
341
350
|
);
|
|
342
351
|
return 0;
|
|
343
352
|
}
|
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>] the Agent Site tab
|
|
35
|
+
// letterstory visits transact site [publish|unpublish] [--domain ask.acme.com | --domain none] [--remove <slug>] [--dismiss "<question>"] the Agent Site tab
|
|
36
36
|
|
|
37
37
|
import { CliError } from "../client.mjs";
|
|
38
38
|
import { flagBool, flagStr, printResult, argsFromFlags } from "./shared.mjs";
|
|
@@ -185,7 +185,14 @@ export const ARGS = {
|
|
|
185
185
|
site_id: "site",
|
|
186
186
|
source_id: { positional: 0, label: "source id", required: true },
|
|
187
187
|
},
|
|
188
|
-
visitors_list_transact_asks: {
|
|
188
|
+
visitors_list_transact_asks: {
|
|
189
|
+
site_id: "site",
|
|
190
|
+
host: "host",
|
|
191
|
+
days,
|
|
192
|
+
limit: { flag: "limit", type: "num" },
|
|
193
|
+
before: { flag: "before" },
|
|
194
|
+
tests: { value: (flags) => (flagBool(flags.tests) ? true : undefined) },
|
|
195
|
+
},
|
|
189
196
|
visitors_get_transact_learnings: { site_id: "site", host: "host", days },
|
|
190
197
|
visitors_get_agent_site: { site_id: "site", host: "host" },
|
|
191
198
|
visitors_prebuild_agent_sites: {
|
|
@@ -200,6 +207,7 @@ export const ARGS = {
|
|
|
200
207
|
typeof flags.domain !== "string" ? undefined : flags.domain === "none" ? null : flags.domain,
|
|
201
208
|
},
|
|
202
209
|
remove: { flag: "remove" },
|
|
210
|
+
dismiss: { flag: "dismiss" },
|
|
203
211
|
},
|
|
204
212
|
visitors_export: {
|
|
205
213
|
site_id: "site",
|
|
@@ -454,7 +462,8 @@ async function visitsTransact(ctx) {
|
|
|
454
462
|
rest.positionals[0] === "publish" ||
|
|
455
463
|
rest.positionals[0] === "unpublish" ||
|
|
456
464
|
flags.domain !== undefined ||
|
|
457
|
-
flags.remove !== undefined
|
|
465
|
+
flags.remove !== undefined ||
|
|
466
|
+
flags.dismiss !== undefined;
|
|
458
467
|
const result = await call(rest, write ? "visitors_set_agent_site" : "visitors_get_agent_site");
|
|
459
468
|
printResult(io, flags, result, (r) => {
|
|
460
469
|
if (!r.available) return "Agent Sites aren't available yet";
|