@letterstory/cli 0.176.94 → 0.176.95
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 +2 -1
- package/lib/commands/collection.mjs +18 -1
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -86,7 +86,7 @@ import {
|
|
|
86
86
|
import { fetchParkedSections, withoutParked } from "./parked.mjs";
|
|
87
87
|
|
|
88
88
|
// Matches cli/package.json; publish-cli.yml rewrites both to the published version.
|
|
89
|
-
export const VERSION = "0.176.
|
|
89
|
+
export const VERSION = "0.176.95";
|
|
90
90
|
|
|
91
91
|
/** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
|
|
92
92
|
export const EXIT_PAYMENT_REQUIRED = 3;
|
|
@@ -563,6 +563,7 @@ Collections (the content engine as a primitive — one door, 'collection run'):
|
|
|
563
563
|
collection run-status <run-id> Status, steps, constraints, verification
|
|
564
564
|
collection runs [--collection <id>] [--status <s>] [--limit <n>]
|
|
565
565
|
collection approve <run-id> [--now] Answer the gate (--now publishes immediately)
|
|
566
|
+
collection start <run-id> Start a scheduled slot's writing now (it goes live at its slot)
|
|
566
567
|
collection move <run-id> --date YYYY-MM-DD Move a slot not yet written, or an approved written post, to another day
|
|
567
568
|
collection cancel <run-id>
|
|
568
569
|
collection inventory <id> Where every piece is; each finished draft's publish-on-its-own time
|
|
@@ -134,6 +134,9 @@ export const ARGS = {
|
|
|
134
134
|
cancel_collection_run: {
|
|
135
135
|
run_id: { positional: 0, label: "run-id", required: true },
|
|
136
136
|
},
|
|
137
|
+
start_collection_run: {
|
|
138
|
+
run_id: { positional: 0, label: "run-id", required: true },
|
|
139
|
+
},
|
|
137
140
|
reschedule_collection_run: {
|
|
138
141
|
run_id: { positional: 0, label: "run-id", required: true },
|
|
139
142
|
date: { flag: "date", required: true },
|
|
@@ -184,6 +187,8 @@ export async function cmdCollection(ctx) {
|
|
|
184
187
|
return collectionApprove(rest);
|
|
185
188
|
case "cancel":
|
|
186
189
|
return collectionCancel(rest);
|
|
190
|
+
case "start":
|
|
191
|
+
return collectionStart(rest);
|
|
187
192
|
case "move":
|
|
188
193
|
case "reschedule":
|
|
189
194
|
return collectionMove(rest);
|
|
@@ -197,7 +202,7 @@ export async function cmdCollection(ctx) {
|
|
|
197
202
|
return collectionMentions(rest);
|
|
198
203
|
default:
|
|
199
204
|
throw new CliError(
|
|
200
|
-
`Unknown collection subcommand: ${sub ?? "(none)"}. Try: list, overview, new, config, delete, run, add, queue, headline, run-status, runs, approve, move, cancel, inventory, links, mentions`
|
|
205
|
+
`Unknown collection subcommand: ${sub ?? "(none)"}. Try: list, overview, new, config, delete, run, add, queue, headline, run-status, runs, approve, start, move, cancel, inventory, links, mentions`
|
|
201
206
|
);
|
|
202
207
|
}
|
|
203
208
|
}
|
|
@@ -395,6 +400,18 @@ async function collectionCancel(ctx) {
|
|
|
395
400
|
return 0;
|
|
396
401
|
}
|
|
397
402
|
|
|
403
|
+
// `collection start <run-id>` — a slot on the calendar starts writing now; it still goes live at its slot
|
|
404
|
+
// (start_collection_run, the way a letterbase's writing automation starts its slot).
|
|
405
|
+
async function collectionStart(ctx) {
|
|
406
|
+
const result = await ctx.client.callTool(
|
|
407
|
+
"start_collection_run",
|
|
408
|
+
argsFromFlags(ARGS.start_collection_run, ctx.flags, ctx.positionals)
|
|
409
|
+
);
|
|
410
|
+
ok(ctx, toolField(result, "started") ? "Started: it is being written." : "Not started yet: see its step.");
|
|
411
|
+
printResult(ctx.io, ctx.flags, result);
|
|
412
|
+
return 0;
|
|
413
|
+
}
|
|
414
|
+
|
|
398
415
|
// `collection move <run-id> --date YYYY-MM-DD` — a slot not yet written, or a written post
|
|
399
416
|
// already approved, onto another day (reschedule_collection_run).
|
|
400
417
|
async function collectionMove(ctx) {
|