@letterstory/cli 0.177.166 → 0.177.168
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/org.mjs +10 -3
- package/lib/commands/visits.mjs +29 -1
- 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.168";
|
|
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;
|
|
@@ -106,6 +106,8 @@ export const BOOLEAN_FLAGS = new Set([
|
|
|
106
106
|
// repo list: open changes past --limit are listed unless --newest-only.
|
|
107
107
|
"include-open",
|
|
108
108
|
"newest-only",
|
|
109
|
+
// org overview: only what waits on someone (the More menu's closed read).
|
|
110
|
+
"needs-only",
|
|
109
111
|
"include-tests",
|
|
110
112
|
"as-test",
|
|
111
113
|
"discover",
|
package/lib/commands/org.mjs
CHANGED
|
@@ -54,7 +54,11 @@ export const ARGS = {
|
|
|
54
54
|
undo_billing_plan_cancel: {},
|
|
55
55
|
update_billing_card: {},
|
|
56
56
|
list_integrations: {},
|
|
57
|
-
get_workspace_overview: {
|
|
57
|
+
get_workspace_overview: {
|
|
58
|
+
needs_only: {
|
|
59
|
+
value: (flags) => (flags["needs-only"] === undefined ? undefined : flagBool(flags["needs-only"])),
|
|
60
|
+
},
|
|
61
|
+
},
|
|
58
62
|
get_linear_connection: {},
|
|
59
63
|
list_linear_targets: { team_id: { flag: "team" } },
|
|
60
64
|
set_linear_target: {
|
|
@@ -155,8 +159,10 @@ const NEED_WORDS = {
|
|
|
155
159
|
*/
|
|
156
160
|
async function orgOverview(ctx) {
|
|
157
161
|
const { client, flags, io } = ctx;
|
|
158
|
-
refuseUnknownFlags(ctx, {}, []);
|
|
159
|
-
|
|
162
|
+
refuseUnknownFlags(ctx, {}, ["needs-only"]);
|
|
163
|
+
// --needs-only: only what waits on someone, as the app's closed More menu reads it.
|
|
164
|
+
const needsOnly = flagBool(flags["needs-only"]);
|
|
165
|
+
const result = await client.callTool("get_workspace_overview", needsOnly ? { needs_only: true } : {});
|
|
160
166
|
ok(ctx, result.message);
|
|
161
167
|
printResult(io, flags, result, (r) => {
|
|
162
168
|
const needs = r.needs.length
|
|
@@ -166,6 +172,7 @@ async function orgOverview(ctx) {
|
|
|
166
172
|
.filter(([, n]) => n > 0)
|
|
167
173
|
.map(([key, n]) => ` ${key.replace(/^\//, "")}: ${formatCount(n)}`);
|
|
168
174
|
const recent = r.recent.map((x) => ` ${x.name} (${x.kind === "sequence" ? "sequence" : "list"})`);
|
|
175
|
+
if (needsOnly) return needs.join("\n");
|
|
169
176
|
return [...needs, "", "Holds:", ...counts, ...(recent.length ? ["", "Recent:", ...recent] : [])].join("\n");
|
|
170
177
|
});
|
|
171
178
|
return 0;
|
package/lib/commands/visits.mjs
CHANGED
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
// letterstory visits transact test "What does it cost?"
|
|
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] the agent-optimized site
|
|
35
36
|
|
|
36
37
|
import { CliError } from "../client.mjs";
|
|
37
38
|
import { flagStr, printResult, argsFromFlags } from "./shared.mjs";
|
|
@@ -193,6 +194,15 @@ export const ARGS = {
|
|
|
193
194
|
},
|
|
194
195
|
visitors_list_transact_asks: { site_id: "site", days, limit: { flag: "limit", type: "num" } },
|
|
195
196
|
visitors_get_transact_learnings: { site_id: "site", days },
|
|
197
|
+
visitors_get_agent_site: { site_id: "site" },
|
|
198
|
+
visitors_set_agent_site: {
|
|
199
|
+
site_id: "site",
|
|
200
|
+
publish: { value: (flags, positionals) => ({ publish: true, unpublish: false })[positionals[0]] },
|
|
201
|
+
domain: {
|
|
202
|
+
value: (flags) =>
|
|
203
|
+
typeof flags.domain !== "string" ? undefined : flags.domain === "none" ? null : flags.domain,
|
|
204
|
+
},
|
|
205
|
+
},
|
|
196
206
|
visitors_export: {
|
|
197
207
|
site_id: "site",
|
|
198
208
|
days,
|
|
@@ -367,7 +377,7 @@ function transactLines(t) {
|
|
|
367
377
|
return lines;
|
|
368
378
|
}
|
|
369
379
|
|
|
370
|
-
/** `visits transact`: read it; `on` / `off`; `add <kind> …`; `source <id>`; `search "…"`; `remove <id>`; `test "…"`; `pr`; `asks`; `learnings`. */
|
|
380
|
+
/** `visits transact`: read it; `on` / `off`; `add <kind> …`; `source <id>`; `search "…"`; `remove <id>`; `test "…"`; `pr`; `asks`; `learnings`; `site`. */
|
|
371
381
|
async function visitsTransact(ctx) {
|
|
372
382
|
const { flags, io } = ctx;
|
|
373
383
|
const sub = ctx.positionals[0];
|
|
@@ -441,6 +451,24 @@ async function visitsTransact(ctx) {
|
|
|
441
451
|
printResult(io, flags, await call(rest, "visitors_open_transact_pr"));
|
|
442
452
|
return 0;
|
|
443
453
|
}
|
|
454
|
+
if (sub === "site") {
|
|
455
|
+
const write =
|
|
456
|
+
rest.positionals[0] === "publish" || rest.positionals[0] === "unpublish" || flags.domain !== undefined;
|
|
457
|
+
const result = await call(rest, write ? "visitors_set_agent_site" : "visitors_get_agent_site");
|
|
458
|
+
printResult(io, flags, result, (r) => {
|
|
459
|
+
if (!r.available) return "Agent-optimized Sites aren't available yet";
|
|
460
|
+
if (!r.published) return "Not published";
|
|
461
|
+
const lines = [`Staging: ${r.staging_url}`];
|
|
462
|
+
if (r.domain) {
|
|
463
|
+
lines.push(`Domain: ${r.domain.name} (${r.domain.status})`);
|
|
464
|
+
if (r.domain.status === "pending")
|
|
465
|
+
for (const rec of r.domain.records) lines.push(` ${rec.type} ${rec.name} ${rec.value}`);
|
|
466
|
+
}
|
|
467
|
+
lines.push(`${r.questions.length} questions`, ...r.questions.map((q) => ` ${q.question} ${q.url}`));
|
|
468
|
+
return lines.join("\n");
|
|
469
|
+
});
|
|
470
|
+
return 0;
|
|
471
|
+
}
|
|
444
472
|
if (sub === "learnings") {
|
|
445
473
|
const result = await call(rest, "visitors_get_transact_learnings");
|
|
446
474
|
printResult(
|