@letterstory/cli 0.96.0 → 0.97.0
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/README.md +1 -1
- package/lib/cli.mjs +7 -5
- package/lib/commands/admin.mjs +11 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -353,7 +353,7 @@ long-running agent can watch the fleet on a schedule without a browser.
|
|
|
353
353
|
# every client against itself on share of voice, mention rate and page access, with what we
|
|
354
354
|
# did for it. Needs fleet:read; `run` and `ask` spend Fable tokens and need fleet:query.
|
|
355
355
|
letterstory admin patterns --period 30d
|
|
356
|
-
letterstory admin patterns
|
|
356
|
+
letterstory admin patterns chain --dimension arenaVersion --outcome cited14 # what each kernel/arena/research change did
|
|
357
357
|
letterstory admin patterns reports # Fable's weekly reports and runs, newest first
|
|
358
358
|
letterstory admin patterns report <id> # one report's markdown
|
|
359
359
|
letterstory admin patterns run # a report now (takes minutes)
|
package/lib/cli.mjs
CHANGED
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
} from "./commands.mjs";
|
|
59
59
|
|
|
60
60
|
// Keep in sync with cli/package.json.
|
|
61
|
-
export const VERSION = "0.
|
|
61
|
+
export const VERSION = "0.97.0";
|
|
62
62
|
|
|
63
63
|
// Flags that never take a value. Listing them explicitly means `deploy get --json <id>`
|
|
64
64
|
// can't accidentally swallow the id as --json's value. Every `type: "bool"` flag (and its
|
|
@@ -660,10 +660,12 @@ Admin (STAFF key — --staff-key / LETTERSTORY_STAFF_API_KEY; acts before an org
|
|
|
660
660
|
Client patterns: every client's share of voice,
|
|
661
661
|
mention rate and page access against itself, with
|
|
662
662
|
what we did for it. Needs fleet:read.
|
|
663
|
-
admin patterns
|
|
664
|
-
What each
|
|
665
|
-
|
|
666
|
-
|
|
663
|
+
admin patterns chain [--dimension kernel|kernelVersion|arena|arenaVersion|researchPrompt] [--outcome cited14|read14|named|impressions14|clicks14|cited28|impressions28]
|
|
664
|
+
What each change to the writing chain did (kernel,
|
|
665
|
+
version, research arena, arena version, research
|
|
666
|
+
prompt): the client's change minus the comparison,
|
|
667
|
+
what changed with it, pooled by transition.
|
|
668
|
+
"kernels" = --dimension kernelVersion. Needs fleet:read.
|
|
667
669
|
admin patterns reports [--kind reports|weekly|run|ask] | report <id>
|
|
668
670
|
Fable's weekly reports, runs and Ask Fable answers.
|
|
669
671
|
admin patterns run | ask "<question>" Run a Fable report now, or ask Fable a question
|
package/lib/commands/admin.mjs
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// routes, because they exist precisely to act BEFORE an org exists.
|
|
5
5
|
//
|
|
6
6
|
// admin ask "which kernels are hooked up to the most clients?" [--sql] [--json]
|
|
7
|
-
// admin patterns [--period 14d|30d] [--segment "…"] |
|
|
7
|
+
// admin patterns [--period 14d|30d] [--segment "…"] | chain [--dimension kernel|kernelVersion|arena|arenaVersion|researchPrompt] [--outcome cited14] | reports [--kind reports|weekly|run|ask] | report <id> | run | ask "<question>" (fleet:read / fleet:query)
|
|
8
8
|
// admin experiments list|show|new|update|note|started|spend|conclude|abandon … (tuning:experiment)
|
|
9
9
|
// admin tuning-context [--q "<question>"] (tuning:experiment)
|
|
10
10
|
// admin tuning-import <brief-results.json> [--experiment <id>] (tuning:experiment)
|
|
@@ -273,25 +273,25 @@ async function cmdAdminPatterns(ctx) {
|
|
|
273
273
|
}
|
|
274
274
|
return;
|
|
275
275
|
}
|
|
276
|
+
case "chain":
|
|
276
277
|
case "kernels": {
|
|
277
278
|
const params = new URLSearchParams();
|
|
278
|
-
|
|
279
|
+
const dimension = flagStr(ctx.flags.dimension) ?? (sub === "kernels" ? "kernelVersion" : undefined);
|
|
280
|
+
if (dimension) params.set("dimension", dimension);
|
|
279
281
|
if (flagStr(ctx.flags.outcome)) params.set("outcome", flagStr(ctx.flags.outcome));
|
|
280
|
-
const result = await staffRequest(ctx, "GET", `${PATTERNS}/
|
|
282
|
+
const result = await staffRequest(ctx, "GET", `${PATTERNS}/chain${params.size ? `?${params}` : ""}`);
|
|
281
283
|
if (json) return printResult(ctx.io, ctx.flags, result);
|
|
282
284
|
const fmt = (v) => (v == null ? "—" : `${v >= 0 ? "+" : "−"}${Math.abs(v).toFixed(3)}`);
|
|
283
|
-
ctx.io.log(
|
|
284
|
-
`Kernel changes on ${result.outcome}, by ${result.by} (effect = change minus clients that held still):`
|
|
285
|
-
);
|
|
285
|
+
ctx.io.log(`Changes to ${result.dimension} on ${result.outcome} (effect = change minus the comparison):`);
|
|
286
286
|
for (const t of result.transitions)
|
|
287
287
|
ctx.io.log(
|
|
288
|
-
` ${`${t.from} → ${t.to}`.padEnd(
|
|
288
|
+
` ${`${t.from} → ${t.to}`.padEnd(34)} ${fmt(t.effect)} (${fmt(t.lo)} to ${fmt(t.hi)}) ${t.verdict} · ${t.swaps} changes${t.confounded ? `, ${t.confounded} with another` : ""}, ${t.clients} clients`
|
|
289
289
|
);
|
|
290
290
|
if (!result.transitions.length) ctx.io.log(" none yet");
|
|
291
|
-
ctx.io.log(`\
|
|
292
|
-
for (const k of result.
|
|
291
|
+
ctx.io.log(`\nEvery value (descriptive):`);
|
|
292
|
+
for (const k of result.values)
|
|
293
293
|
ctx.io.log(
|
|
294
|
-
` ${k.label.padEnd(
|
|
294
|
+
` ${k.label.padEnd(26)} ${String(k.posts).padStart(6)} posts ${String(k.clients).padStart(4)} clients ${k.outcome ? k.outcome.mean.toFixed(3) : "—"}`
|
|
295
295
|
);
|
|
296
296
|
return;
|
|
297
297
|
}
|
|
@@ -334,9 +334,7 @@ async function cmdAdminPatterns(ctx) {
|
|
|
334
334
|
return;
|
|
335
335
|
}
|
|
336
336
|
default:
|
|
337
|
-
throw new CliError(
|
|
338
|
-
'Usage: admin patterns [show] | kernels | reports | report <id> | run | ask "<question>"'
|
|
339
|
-
);
|
|
337
|
+
throw new CliError('Usage: admin patterns [show] | chain | reports | report <id> | run | ask "<question>"');
|
|
340
338
|
}
|
|
341
339
|
}
|
|
342
340
|
|