@letterstory/cli 0.10.0 → 0.11.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/lib/cli.mjs CHANGED
@@ -40,7 +40,7 @@ import {
40
40
  } from "./commands.mjs";
41
41
 
42
42
  // Keep in sync with cli/package.json.
43
- export const VERSION = "0.10.0";
43
+ export const VERSION = "0.11.0";
44
44
 
45
45
  // Flags that never take a value. Listing them explicitly means `deploy get --json <id>`
46
46
  // can't accidentally swallow the id as --json's value.
@@ -278,6 +278,14 @@ Collection onboarding (your OWN blog, on your org's domain — no provisioning):
278
278
  and stock Headlines & Queue. Omit --collection
279
279
  to create a fresh one (--name, default Blog).
280
280
  The Planner stays OFF (manual approval).
281
+ ${bin === "phantom" ? "onboard" : "phantom-onboard"} sync-sitemap --collection <uuid>
282
+ Re-check an already-onboarded blog's sitemap
283
+ right now instead of waiting for its cadence
284
+ (default every 14 days). Skips pages whose
285
+ <lastmod> hasn't moved, imports new posts,
286
+ refreshes changed ones. Only for collections
287
+ with no CMS connected — once one is, use the
288
+ CMS pull/reconcile path instead.
281
289
  --watch polls to completion, printing each
282
290
  review note as it lands.
283
291
 
@@ -182,12 +182,48 @@ async function cmdOnboardCollection(ctx) {
182
182
  return 0;
183
183
  }
184
184
 
185
+ // `onboard sync-sitemap --collection <uuid>` — the periodic-refresh sibling: re-check a
186
+ // collection's sitemap right now instead of waiting for its cadence
187
+ // (collections.sitemap_sync_cadence_days). One-shot, no polling — the underlying work is
188
+ // bounded per run, so it returns synchronously.
189
+ async function cmdOnboardSyncSitemap(ctx) {
190
+ const { client, flags } = ctx;
191
+ const collectionId = flagStr(flags.collection);
192
+ if (!collectionId) {
193
+ throw new CliError("onboard sync-sitemap requires --collection <uuid>.");
194
+ }
195
+
196
+ ok(ctx, "Re-checking the sitemap…");
197
+ const result = await client.callTool("sync_collection_sitemap", { collection_id: collectionId });
198
+
199
+ printResult(ctx.io, flags, result, (r) =>
200
+ [
201
+ `Sitemap sync complete — ${r.checked} post${r.checked === 1 ? "" : "s"} checked.`,
202
+ ` created: ${r.created}`,
203
+ ` updated: ${r.updated}`,
204
+ ` unchanged: ${r.unchanged} (skipped — <lastmod> hadn't moved)`,
205
+ r.skipped ? ` skipped: ${r.skipped} (nothing readable)` : null,
206
+ r.failed
207
+ ? ` failed: ${r.failed}${r.failure_reasons?.length ? ` (${r.failure_reasons.join("; ")})` : ""}`
208
+ : null,
209
+ r.truncated ? ` capped this run — rerun (or wait for the cadence) to catch up the rest.` : null,
210
+ ]
211
+ .filter(Boolean)
212
+ .join("\n")
213
+ );
214
+ return 0;
215
+ }
216
+
185
217
  export async function cmdOnboard(ctx) {
186
218
  const { client, flags, io } = ctx;
187
219
  // `onboard collection …` — the client-blog variant (no <domain>; org from the key).
188
220
  if (ctx.positionals[0] === "collection") {
189
221
  return cmdOnboardCollection({ ...ctx, positionals: ctx.positionals.slice(1) });
190
222
  }
223
+ // `onboard sync-sitemap --collection <uuid>` — refresh an already-onboarded blog.
224
+ if (ctx.positionals[0] === "sync-sitemap") {
225
+ return cmdOnboardSyncSitemap({ ...ctx, positionals: ctx.positionals.slice(1) });
226
+ }
191
227
  const domain = requirePositional(ctx.positionals, 0, "domain");
192
228
  const overrides = overridesFromFlags(flags);
193
229
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "Spin up and manage Letterstory phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",