@robbeverhelst/do 1.41.0 → 1.43.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.
Files changed (2) hide show
  1. package/dist/do.js +162 -2
  2. package/package.json +1 -1
package/dist/do.js CHANGED
@@ -20652,7 +20652,12 @@ var apiKeyScopeSchema = exports_external.enum([
20652
20652
  "comments:write",
20653
20653
  "roles:read",
20654
20654
  "links:read",
20655
- "links:write"
20655
+ "links:write",
20656
+ "collections:read",
20657
+ "collections:write",
20658
+ "presets:read",
20659
+ "presets:install",
20660
+ "*"
20656
20661
  ]);
20657
20662
  var apiKeySchema = createSelectSchema(apiKeys, {
20658
20663
  scopes: exports_external.array(apiKeyScopeSchema),
@@ -23301,7 +23306,7 @@ function parseCapture2(input) {
23301
23306
 
23302
23307
  // src/meta.ts
23303
23308
  var CLI_NAME = "do";
23304
- var VERSION = "1.41.0";
23309
+ var VERSION = "1.43.0";
23305
23310
  var API_PREFIX = "/api/v1";
23306
23311
  var DEFAULT_API_URL = "http://localhost:3001";
23307
23312
 
@@ -23591,6 +23596,102 @@ var ENTITIES = [
23591
23596
  canDelete: true
23592
23597
  }
23593
23598
  },
23599
+ {
23600
+ name: "library",
23601
+ path: "/library",
23602
+ readScope: "collections:read",
23603
+ returns: "ShoppingList",
23604
+ canGet: true,
23605
+ listFlags: [],
23606
+ write: {
23607
+ scope: "collections:write",
23608
+ createSchema: createShoppingListInputSchema,
23609
+ createInput: "CreateShoppingListInput",
23610
+ updateSchema: updateShoppingListInputSchema,
23611
+ updateInput: "UpdateShoppingListInput",
23612
+ canDelete: true
23613
+ }
23614
+ },
23615
+ {
23616
+ name: "watchlist",
23617
+ path: "/watchlist",
23618
+ readScope: "collections:read",
23619
+ returns: "ShoppingList",
23620
+ canGet: true,
23621
+ listFlags: [],
23622
+ write: {
23623
+ scope: "collections:write",
23624
+ createSchema: createShoppingListInputSchema,
23625
+ createInput: "CreateShoppingListInput",
23626
+ updateSchema: updateShoppingListInputSchema,
23627
+ updateInput: "UpdateShoppingListInput",
23628
+ canDelete: true
23629
+ }
23630
+ },
23631
+ {
23632
+ name: "games",
23633
+ path: "/games",
23634
+ readScope: "collections:read",
23635
+ returns: "ShoppingList",
23636
+ canGet: true,
23637
+ listFlags: [],
23638
+ write: {
23639
+ scope: "collections:write",
23640
+ createSchema: createShoppingListInputSchema,
23641
+ createInput: "CreateShoppingListInput",
23642
+ updateSchema: updateShoppingListInputSchema,
23643
+ updateInput: "UpdateShoppingListInput",
23644
+ canDelete: true
23645
+ }
23646
+ },
23647
+ {
23648
+ name: "cellar",
23649
+ path: "/cellar",
23650
+ readScope: "collections:read",
23651
+ returns: "ShoppingList",
23652
+ canGet: true,
23653
+ listFlags: [],
23654
+ write: {
23655
+ scope: "collections:write",
23656
+ createSchema: createShoppingListInputSchema,
23657
+ createInput: "CreateShoppingListInput",
23658
+ updateSchema: updateShoppingListInputSchema,
23659
+ updateInput: "UpdateShoppingListInput",
23660
+ canDelete: true
23661
+ }
23662
+ },
23663
+ {
23664
+ name: "places",
23665
+ path: "/places",
23666
+ readScope: "collections:read",
23667
+ returns: "ShoppingList",
23668
+ canGet: true,
23669
+ listFlags: [],
23670
+ write: {
23671
+ scope: "collections:write",
23672
+ createSchema: createShoppingListInputSchema,
23673
+ createInput: "CreateShoppingListInput",
23674
+ updateSchema: updateShoppingListInputSchema,
23675
+ updateInput: "UpdateShoppingListInput",
23676
+ canDelete: true
23677
+ }
23678
+ },
23679
+ {
23680
+ name: "music",
23681
+ path: "/music",
23682
+ readScope: "collections:read",
23683
+ returns: "ShoppingList",
23684
+ canGet: true,
23685
+ listFlags: [],
23686
+ write: {
23687
+ scope: "collections:write",
23688
+ createSchema: createShoppingListInputSchema,
23689
+ createInput: "CreateShoppingListInput",
23690
+ updateSchema: updateShoppingListInputSchema,
23691
+ updateInput: "UpdateShoppingListInput",
23692
+ canDelete: true
23693
+ }
23694
+ },
23594
23695
  {
23595
23696
  name: "inventory-items",
23596
23697
  path: "/inventory-items",
@@ -23781,6 +23882,30 @@ var COMMAND_SPECS = [
23781
23882
  scopes: ["settings:write"],
23782
23883
  returns: "UserSettings"
23783
23884
  },
23885
+ {
23886
+ path: ["presets", "list"],
23887
+ summary: "List the preset gallery (key \xB7 name \xB7 entity).",
23888
+ args: [],
23889
+ flags: [
23890
+ {
23891
+ name: "entity",
23892
+ type: "string",
23893
+ description: "Filter to one gallery facet (habit|list|library|watchlist|games|cellar|places|music|routine|area|project|recipe|contact|challenge|automation)."
23894
+ }
23895
+ ],
23896
+ scopes: ["presets:read"],
23897
+ returns: "Preset",
23898
+ notes: "The catalog is code-defined; --entity filters it client-side."
23899
+ },
23900
+ {
23901
+ path: ["presets", "install"],
23902
+ summary: "Install a preset into the Space; prints the nodes it created.",
23903
+ args: [{ name: "key", required: true, description: "Preset catalog key (kebab-case)." }],
23904
+ flags: [],
23905
+ scopes: ["presets:install"],
23906
+ returns: "PresetInstallResult",
23907
+ notes: "Authors content as the caller, so it needs a key minted while logged in."
23908
+ },
23784
23909
  {
23785
23910
  path: ["invite", "create"],
23786
23911
  summary: "Create a Space invite (email/link/guest).",
@@ -24244,6 +24369,27 @@ function idOf(row) {
24244
24369
  }
24245
24370
  return;
24246
24371
  }
24372
+ function renderPresetList(data, mode) {
24373
+ if (!Array.isArray(data))
24374
+ return renderRecord(data, mode);
24375
+ if (data.length === 0)
24376
+ return paint(mode, "dim", "(no presets)");
24377
+ const lines = data.map((p) => {
24378
+ const key = paint(mode, "bold", p.key ?? "(no key)");
24379
+ const facet = p.entity ? paint(mode, "dim", ` [${p.entity}]`) : "";
24380
+ return ` ${key} ${p.name ?? ""}${facet}`;
24381
+ });
24382
+ return [`${data.length} preset(s):`, ...lines].join(`
24383
+ `);
24384
+ }
24385
+ function renderPresetInstall(data, mode) {
24386
+ const r = data;
24387
+ const header = `installed ${paint(mode, "bold", r.key ?? "(preset)")} \u2014 ${r.nodeCount ?? 0} node(s) created`;
24388
+ const facet = r.entity ? [` entity: ${r.entity}`] : [];
24389
+ const ids = (r.nodeIds ?? []).map((id) => ` ${paint(mode, "dim", id)}`);
24390
+ return [header, ...facet, ...ids].join(`
24391
+ `);
24392
+ }
24247
24393
  function renderHelp(data, mode) {
24248
24394
  const m = data;
24249
24395
  const lines = [];
@@ -24487,6 +24633,20 @@ var HANDLERS = {
24487
24633
  const body = parseInput(updateUserSettingsInputSchema, readDataFlag(flags));
24488
24634
  return { data: await requireClient().patch("/settings", body), render: renderRecord };
24489
24635
  },
24636
+ "presets list": async ({ flags, requireClient }) => {
24637
+ const entity = flagString(flags, "entity");
24638
+ if (entity !== undefined && !presetEntitySchema.safeParse(entity).success) {
24639
+ throw usageError(`--entity must be one of: ${presetEntitySchema.options.join(", ")}`);
24640
+ }
24641
+ const catalog2 = presetSchema.array().parse(await requireClient().get("/presets"));
24642
+ const presets2 = entity ? catalog2.filter((p) => p.entity === entity) : catalog2;
24643
+ return { data: presets2, render: renderPresetList };
24644
+ },
24645
+ "presets install": async ({ args, requireClient }) => {
24646
+ const key = requireArg(args, 0, "preset key");
24647
+ const result = presetInstallResultSchema.parse(await requireClient().post(`/presets/${encodeURIComponent(key)}/install`, undefined));
24648
+ return { data: result, render: renderPresetInstall };
24649
+ },
24490
24650
  "invite create": async ({ flags, requireClient }) => {
24491
24651
  const body = parseInput(createInviteInputSchema, { id: ulid3(), ...readDataFlag(flags) });
24492
24652
  return { data: await requireClient().post("/invites", body), render: renderRecord };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robbeverhelst/do",
3
- "version": "1.41.0",
3
+ "version": "1.43.0",
4
4
  "private": false,
5
5
  "description": "do — the agent-drivable CLI over the public /api/v1 surface",
6
6
  "type": "module",