@letterstory/cli 0.177.140 → 0.177.141
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/admin.mjs +31 -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.141";
|
|
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;
|
|
@@ -1209,6 +1209,8 @@ Admin (STAFF key — --staff-key / LETTERSTORY_STAFF_API_KEY; acts before an org
|
|
|
1209
1209
|
The Ideas invariants over production, read only: rows a
|
|
1210
1210
|
start would refuse, builds whose reading disagrees with
|
|
1211
1211
|
what they hold, grouped with ids. Exits 1 on any.
|
|
1212
|
+
admin dropoff [crossing] [--days 30] Where new accounts stopped in an onboarding crossing
|
|
1213
|
+
(default letter): the count per step and who. Read only.
|
|
1212
1214
|
admin lost-posts [--code lost_guard,lost_provider] [--days 7] [--org <id>] [--limit 200] [--apply]
|
|
1213
1215
|
Letterbase posts lost on our side (a publish guard dropped
|
|
1214
1216
|
the finished post, a provider outage failed the slot) and
|
package/lib/commands/admin.mjs
CHANGED
|
@@ -78,6 +78,10 @@ export const ARGS = {
|
|
|
78
78
|
org_id: { flag: "org" },
|
|
79
79
|
limit: { flag: "limit", type: "num" },
|
|
80
80
|
},
|
|
81
|
+
get_crossing_dropoff: {
|
|
82
|
+
crossing: { positional: 0, label: "crossing" },
|
|
83
|
+
days: { flag: "days", type: "num" },
|
|
84
|
+
},
|
|
81
85
|
check_ideas_invariants: {
|
|
82
86
|
org_ids: { value: (flags) => (flags.org ? flagCsv(flags.org) : undefined) },
|
|
83
87
|
limit: { flag: "limit", type: "num" },
|
|
@@ -110,6 +114,31 @@ async function cmdAdminInvariants(ctx) {
|
|
|
110
114
|
return result.total > 0 ? 1 : 0;
|
|
111
115
|
}
|
|
112
116
|
|
|
117
|
+
// `admin dropoff [crossing] [--days 30]` — where new accounts stopped in a crossing (default Letter's): the count per
|
|
118
|
+
// step and who. get_crossing_dropoff, read only.
|
|
119
|
+
async function cmdAdminDropoff(ctx) {
|
|
120
|
+
const { client, flags, io } = ctx;
|
|
121
|
+
const result = await client.callTool(
|
|
122
|
+
"get_crossing_dropoff",
|
|
123
|
+
argsFromFlags(ARGS.get_crossing_dropoff, flags, ctx.positionals)
|
|
124
|
+
);
|
|
125
|
+
printResult(io, flags, result, (r) =>
|
|
126
|
+
[
|
|
127
|
+
`${r.name}: ${r.entered} new account(s) in ${r.days} day(s), ${r.finished} finished, ${r.entered - r.finished} didn't.`,
|
|
128
|
+
...r.steps.map((s) =>
|
|
129
|
+
[
|
|
130
|
+
`\n${s.number ? `Step ${s.number} ` : ""}${s.title} ${s.count}`,
|
|
131
|
+
...s.accounts.map(
|
|
132
|
+
(a) =>
|
|
133
|
+
` ${a.company} ${a.email ?? "-"} since ${a.step_since.slice(0, 10)}${a.closed ? " (closed)" : ""}`
|
|
134
|
+
),
|
|
135
|
+
].join("\n")
|
|
136
|
+
),
|
|
137
|
+
].join("\n")
|
|
138
|
+
);
|
|
139
|
+
return 0;
|
|
140
|
+
}
|
|
141
|
+
|
|
113
142
|
// `admin lost-posts` — the replay for letterbase slots lost on Letter's side (lib/planner/lost-posts.ts): a finished
|
|
114
143
|
// post a publish guard dropped or holds, a slot a provider outage failed. Lists what it would requeue; --apply
|
|
115
144
|
// requeues them. requeue_lost_posts.
|
|
@@ -7747,11 +7776,12 @@ export async function cmdAdmin(ctx) {
|
|
|
7747
7776
|
if (sub === "demo") return cmdAdminDemo({ ...ctx, positionals: ctx.positionals.slice(1) });
|
|
7748
7777
|
if (sub === "targets") return cmdAdminTargets({ ...ctx, positionals: ctx.positionals.slice(1) });
|
|
7749
7778
|
if (sub === "invariants") return cmdAdminInvariants({ ...ctx, positionals: ctx.positionals.slice(1) });
|
|
7779
|
+
if (sub === "dropoff") return cmdAdminDropoff({ ...ctx, positionals: ctx.positionals.slice(1) });
|
|
7750
7780
|
if (sub === "lost-posts") return cmdAdminLostPosts({ ...ctx, positionals: ctx.positionals.slice(1) });
|
|
7751
7781
|
if (sub === "deployments" || sub === "deploys")
|
|
7752
7782
|
return cmdAdminDeployments({ ...ctx, positionals: ctx.positionals.slice(1) });
|
|
7753
7783
|
throw new CliError(
|
|
7754
|
-
'Usage: admin recipes … | admin letterpress … | admin demo … | admin targets … | admin invariants … | admin lost-posts … | admin deployments … | admin republish … | admin create-org --domain <bare-domain> [--onboard] … | admin ask "<question>" | admin patterns … | admin experiments … | admin fleet-experiments … | admin crm … | admin spend … | admin evals … | admin brand-detection … | admin tuning … | admin tuning-context | admin replays … (see --help)'
|
|
7784
|
+
'Usage: admin recipes … | admin letterpress … | admin demo … | admin targets … | admin invariants … | admin dropoff … | admin lost-posts … | admin deployments … | admin republish … | admin create-org --domain <bare-domain> [--onboard] … | admin ask "<question>" | admin patterns … | admin experiments … | admin fleet-experiments … | admin crm … | admin spend … | admin evals … | admin brand-detection … | admin tuning … | admin tuning-context | admin replays … (see --help)'
|
|
7755
7785
|
);
|
|
7756
7786
|
}
|
|
7757
7787
|
|