@robbeverhelst/do 1.307.0 → 1.308.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 +146 -59
  2. package/package.json +1 -1
package/dist/do.js CHANGED
@@ -28197,6 +28197,21 @@ var guestListOverviewSchema = object({
28197
28197
  invites: number2().int()
28198
28198
  })
28199
28199
  });
28200
+ var rsvpDigestQuerySchema = object({ since: exports_coerce.date().optional() }).strict();
28201
+ var rsvpDigestSchema = object({
28202
+ guestListId: string2(),
28203
+ since: exports_coerce.date(),
28204
+ households: array(object({
28205
+ householdId: string2().nullable(),
28206
+ household: string2(),
28207
+ answeredAt: exports_coerce.date(),
28208
+ coming: array(string2()),
28209
+ maybe: array(string2()),
28210
+ notComing: array(string2())
28211
+ })),
28212
+ waiting: number2().int().nonnegative(),
28213
+ text: string2()
28214
+ });
28200
28215
  var RSVP_TOKEN_RE = /^rsvp_[A-Za-z0-9_-]{43}$/;
28201
28216
  var RSVP_CODE_ALPHABET = "23456789ABCDEFGHJKMNPQRSTWXYZ";
28202
28217
  var RSVP_CODE_LENGTH = 6;
@@ -28502,7 +28517,7 @@ var mailProviderEventSchema = looseObject({
28502
28517
  }).optional()
28503
28518
  })
28504
28519
  });
28505
- var MAIL_CAMPAIGN_KINDS = ["message", "save_the_date", "invitation"];
28520
+ var MAIL_CAMPAIGN_KINDS = ["message", "save_the_date", "invitation", "reminder"];
28506
28521
  var mailCampaignKindSchema = _enum2(MAIL_CAMPAIGN_KINDS);
28507
28522
  var MAIL_TEMPLATES = [
28508
28523
  "message",
@@ -28565,7 +28580,8 @@ var mailRecipientHouseholdSchema = object({
28565
28580
  name: string2(),
28566
28581
  language: mailLanguageSchema,
28567
28582
  addresses: number2().int().nonnegative(),
28568
- status: householdMailStatusSchema.nullable()
28583
+ status: householdMailStatusSchema.nullable(),
28584
+ link: boolean3().nullable().default(null)
28569
28585
  });
28570
28586
  var mailCampaignViewSchema = mailCampaignSchema.extend({
28571
28587
  households: array(mailRecipientHouseholdSchema),
@@ -31735,6 +31751,21 @@ var guestListOperations = defineOperations({
31735
31751
  response: { description: "`{ toThank, thanked }`." },
31736
31752
  errors: { 404: true }
31737
31753
  },
31754
+ rsvpDigest: {
31755
+ method: "get",
31756
+ path: "/guest-lists/{id}/rsvp-digest",
31757
+ pathParams: list,
31758
+ scopes: ["contacts:read"],
31759
+ tag: "Guests",
31760
+ summary: "The RSVPs that came in",
31761
+ description: "For the agent's daily digest (wedding C8): each household whose answer came in or changed through its RSVP link since `since` (default: the last 24 hours), oldest first, with who's `coming`, `maybe` and `notComing` by name, how many households are still `waiting` (nobody answered yet), and the same as plain lines in `text` (\"Sam & Kai answered. Coming: Sam, Kai.\"). The couple get each answer as a do notification, never a mail.",
31762
+ query: [{ name: "since", description: "An ISO instant; default 24 hours ago." }],
31763
+ querySchema: rsvpDigestQuerySchema,
31764
+ operationId: "get_guest_list_rsvp_digest",
31765
+ status: 200,
31766
+ response: { description: "`{ guestListId, since, households, waiting, text }`." },
31767
+ errors: { 400: true, 404: true }
31768
+ },
31738
31769
  export: {
31739
31770
  method: "get",
31740
31771
  path: "/guest-lists/{id}/exports/{kind}",
@@ -32558,6 +32589,31 @@ var nodeOperations = defineOperations({
32558
32589
  }
32559
32590
  });
32560
32591
 
32592
+ // ../../packages/schema/src/operations/notes.ts
32593
+ var noteOperations = defineOperations({
32594
+ ...crudOperations({
32595
+ segment: "notes",
32596
+ tag: "Notes",
32597
+ noun: "note",
32598
+ read: "notes:read",
32599
+ write: "notes:write",
32600
+ create: createNoteInputSchema,
32601
+ update: updateNoteInputSchema,
32602
+ view: "Note"
32603
+ }),
32604
+ backlinks: {
32605
+ method: "get",
32606
+ path: "/notes/{id}/backlinks",
32607
+ scopes: ["notes:read"],
32608
+ tag: "Notes",
32609
+ summary: "List backlinks",
32610
+ description: "The notes that link to this note.",
32611
+ status: 200,
32612
+ response: { description: "The backlinking notes." },
32613
+ errors: { 404: true }
32614
+ }
32615
+ });
32616
+
32561
32617
  // ../../packages/schema/src/operations/occurrences.ts
32562
32618
  var occurrenceOperations = defineOperations({
32563
32619
  list: {
@@ -34828,7 +34884,7 @@ function parseCapture2(input, now) {
34828
34884
 
34829
34885
  // src/meta.ts
34830
34886
  var CLI_NAME = "do";
34831
- var VERSION = "1.307.0";
34887
+ var VERSION = "1.308.0";
34832
34888
  var API_PREFIX = "/api/v1";
34833
34889
  var DEFAULT_API_URL = "http://localhost:3001";
34834
34890
 
@@ -35361,26 +35417,17 @@ var ENTITIES = [
35361
35417
  createInput: "CreateRoutineInput",
35362
35418
  updateInput: "UpdateRoutineInput"
35363
35419
  }),
35364
- {
35420
+ entityFromOperations(noteOperations, {
35365
35421
  name: "notes",
35366
- path: "/notes",
35367
- readScopes: ["notes:read"],
35368
35422
  returns: "Note",
35369
- canGet: true,
35370
35423
  listFlags: [
35371
35424
  { name: "q", description: "full-text search over the title and body", query: "q" },
35372
35425
  { name: "area", description: "filter to notes filed under this area id", query: "areaId" },
35373
35426
  { name: "tag", description: "filter to notes carrying this tag", query: "tag" }
35374
35427
  ],
35375
- write: {
35376
- scopes: ["notes:write"],
35377
- createSchema: createNoteInputSchema,
35378
- createInput: "CreateNoteInput",
35379
- updateSchema: updateNoteInputSchema,
35380
- updateInput: "UpdateNoteInput",
35381
- canDelete: true
35382
- }
35383
- },
35428
+ createInput: "CreateNoteInput",
35429
+ updateInput: "UpdateNoteInput"
35430
+ }),
35384
35431
  {
35385
35432
  name: "contacts",
35386
35433
  path: "/contacts",
@@ -36461,7 +36508,7 @@ var COMMAND_SPECS = [
36461
36508
  description: "How long it takes, in minutes (overrides an estimate in the text)."
36462
36509
  }
36463
36510
  ],
36464
- scopes: ["tasks:write"],
36511
+ scopes: [...taskOperations.create.scopes],
36465
36512
  returns: "Task",
36466
36513
  grammar: {
36467
36514
  "#tag": "Adds a tag. Repeatable: '#home #urgent'.",
@@ -36477,9 +36524,9 @@ var COMMAND_SPECS = [
36477
36524
  summary: "Show today's actionable tasks (scheduled, due, overdue, in-progress), then the habits and routines due today.",
36478
36525
  args: [],
36479
36526
  flags: [],
36480
- scopes: ["tasks:read"],
36527
+ scopes: [...taskOperations.list.scopes],
36481
36528
  returns: "TodaySummary",
36482
- notes: "Tasks are composed client-side from GET /api/v1/tasks (the local day from your clock); habits and routines come from GET /api/v1/habits/today (your saved time zone's day) under `habits`, left out when the key lacks habits:read."
36529
+ notes: `Tasks are composed client-side from ${routeOf(taskOperations.list)} (the local day from your clock); habits and routines come from ${routeOf(habitOperations.today)} (your saved time zone's day) under \`habits\`, left out when the key lacks habits:read.`
36483
36530
  },
36484
36531
  {
36485
36532
  path: ["today", "earlier"],
@@ -36502,9 +36549,9 @@ var COMMAND_SPECS = [
36502
36549
  { name: "ids", required: true, description: "One or more task ids." }
36503
36550
  ],
36504
36551
  flags: [],
36505
- scopes: ["tasks:write"],
36552
+ scopes: [...todayOperations.rollover.scopes],
36506
36553
  returns: "RolloverResult",
36507
- notes: "POST /api/v1/today/rollover. `later` reads the day from `do today earlier` first. Let go is cancelled, never done, so it stays out of Landed; undo with `do task reopen`."
36554
+ notes: `${routeOf(todayOperations.rollover)}. \`later\` reads the day from \`do today earlier\` first. Let go is cancelled, never done, so it stays out of Landed; undo with \`do task reopen\`.`
36508
36555
  },
36509
36556
  {
36510
36557
  path: ["now"],
@@ -36960,7 +37007,7 @@ var COMMAND_SPECS = [
36960
37007
  description: "When it was finished (ISO); back-dates completedAt. Default: now."
36961
37008
  }
36962
37009
  ],
36963
- scopes: ["tasks:write"],
37010
+ scopes: [...new Set([...taskOperations.get.scopes, ...taskOperations.update.scopes])],
36964
37011
  returns: "Task",
36965
37012
  notes: "Sets completedAt (the basis of Landed); --at corrects it on an already-done task."
36966
37013
  },
@@ -37381,7 +37428,7 @@ var COMMAND_SPECS = [
37381
37428
  ],
37382
37429
  scopes: [...habitOperations.checkInByTitle.scopes],
37383
37430
  returns: "HabitSummary",
37384
- notes: `POST /api/v1/habits/check-in. Title or alias, case-insensitive; several matches \u2192 409 with error.details.candidates (id, title, aliases), none \u2192 404 naming close titles; a habit counted from Google Fit, Strava or GitHub \u2192 409. --set writes the difference to the day's total as its own check-in. An Agent's key records the check-in as that Agent's ("<agent>, 07:12"). --note puts a short note on it ("drill done, felt heavy" \u2192 --note "felt heavy"); the reply's lastCheckIn.id is the check-in, for \`do habit note\` later.`
37431
+ notes: `${routeOf(habitOperations.checkInByTitle)}. Title or alias, case-insensitive; several matches \u2192 409 with error.details.candidates (id, title, aliases), none \u2192 404 naming close titles; a habit counted from Google Fit, Strava or GitHub \u2192 409. --set writes the difference to the day's total as its own check-in. An Agent's key records the check-in as that Agent's ("<agent>, 07:12"). --note puts a short note on it ("drill done, felt heavy" \u2192 --note "felt heavy"); the reply's lastCheckIn.id is the check-in, for \`do habit note\` later.`
37385
37432
  },
37386
37433
  {
37387
37434
  path: ["habit", "alias", "add"],
@@ -37393,7 +37440,7 @@ var COMMAND_SPECS = [
37393
37440
  flags: [],
37394
37441
  scopes: [...habitOperations.addAlias.scopes],
37395
37442
  returns: "HabitSummary",
37396
- notes: "POST /api/v1/habits/:id/aliases. One already there (ignoring case) is a no-op; at most 12."
37443
+ notes: `${routeOf(habitOperations.addAlias)}. One already there (ignoring case) is a no-op; at most 12.`
37397
37444
  },
37398
37445
  {
37399
37446
  path: ["habit", "alias", "rm"],
@@ -37405,7 +37452,7 @@ var COMMAND_SPECS = [
37405
37452
  flags: [],
37406
37453
  scopes: [...habitOperations.removeAlias.scopes],
37407
37454
  returns: "HabitSummary",
37408
- notes: "DELETE /api/v1/habits/:id/aliases/:alias. 404 when the habit doesn't have it."
37455
+ notes: `${routeOf(habitOperations.removeAlias)}. 404 when the habit doesn't have it.`
37409
37456
  },
37410
37457
  {
37411
37458
  path: ["habits", "today"],
@@ -37568,7 +37615,7 @@ var COMMAND_SPECS = [
37568
37615
  ],
37569
37616
  scopes: ["habits:read", "habits:write"],
37570
37617
  returns: "AwayState",
37571
- notes: "GET/PUT /api/v1/habits/away. While away, habits leave Now, reminders stop and plants wait; tasks and events carry on. Reading needs habits:read, setting habits:write."
37618
+ notes: `${habitOperations.getAway.method.toUpperCase()}/${routeOf(habitOperations.setAway)}. While away, habits leave Now, reminders stop and plants wait; tasks and events carry on. Reading needs habits:read, setting habits:write.`
37572
37619
  },
37573
37620
  {
37574
37621
  path: ["tap-tags", "tap"],
@@ -37855,7 +37902,7 @@ var COMMAND_SPECS = [
37855
37902
  summary: "List the notes/entities whose body [[wikilinks]] reference a note.",
37856
37903
  args: [{ name: "id", required: true, description: "Note (node) ULID." }],
37857
37904
  flags: [],
37858
- scopes: ["notes:read"],
37905
+ scopes: [...noteOperations.backlinks.scopes],
37859
37906
  returns: "Backlink",
37860
37907
  notes: "The reverse of the links a note's body declares; cross-entity."
37861
37908
  },
@@ -38011,7 +38058,7 @@ var COMMAND_SPECS = [
38011
38058
  ],
38012
38059
  scopes: [...worktreeLinkOperations.set.scopes],
38013
38060
  returns: "WorktreeLink",
38014
- notes: "PUT /api/v1/worktree-links/{node}. --host and --worktree are required."
38061
+ notes: `${routeOf(worktreeLinkOperations.set)}. --host and --worktree are required.`
38015
38062
  },
38016
38063
  {
38017
38064
  path: ["worktree-links", "clear"],
@@ -38725,16 +38772,16 @@ var COMMAND_SPECS = [
38725
38772
  summary: "List feature-modules and whether each is enabled for the caller.",
38726
38773
  args: [],
38727
38774
  flags: [],
38728
- scopes: ["settings:read"],
38775
+ scopes: [...settingsOperations.get.scopes],
38729
38776
  returns: "ModuleStatus",
38730
- notes: "Reads enabledModules from GET /api/v1/settings; an empty set means every module is on."
38777
+ notes: `Reads enabledModules from ${routeOf(settingsOperations.get)}; an empty set means every module is on.`
38731
38778
  },
38732
38779
  {
38733
38780
  path: ["modules", "enable"],
38734
38781
  summary: "Enable a feature-module (surfaces it in nav / quick-add / \u2318K).",
38735
38782
  args: [{ name: "key", required: true, description: "Module key (see `do modules list`)." }],
38736
38783
  flags: [],
38737
- scopes: ["settings:read", "settings:write"],
38784
+ scopes: [...new Set([...settingsOperations.get.scopes, ...settingsOperations.update.scopes])],
38738
38785
  returns: "UserSettings",
38739
38786
  notes: "Reads then patches settings; only the module visibility list changes."
38740
38787
  },
@@ -38743,7 +38790,7 @@ var COMMAND_SPECS = [
38743
38790
  summary: "Disable a feature-module (hides its surfaces \u2014 nothing is deleted).",
38744
38791
  args: [{ name: "key", required: true, description: "Module key (see `do modules list`)." }],
38745
38792
  flags: [],
38746
- scopes: ["settings:read", "settings:write"],
38793
+ scopes: [...new Set([...settingsOperations.get.scopes, ...settingsOperations.update.scopes])],
38747
38794
  returns: "UserSettings",
38748
38795
  notes: "Reads then patches settings; only the module visibility list changes."
38749
38796
  },
@@ -38784,7 +38831,7 @@ var COMMAND_SPECS = [
38784
38831
  flags: [],
38785
38832
  scopes: [...collectionOperations.types.scopes],
38786
38833
  returns: "CollectionTypeSummary",
38787
- notes: "The Type registry is code-defined (ADR 0017); served from GET /api/v1/collection/types."
38834
+ notes: `The Type registry is code-defined (ADR 0017); served from ${routeOf(collectionOperations.types)}.`
38788
38835
  },
38789
38836
  {
38790
38837
  path: ["collection", "list"],
@@ -39104,16 +39151,16 @@ var COMMAND_SPECS = [
39104
39151
  summary: "Focus on one Area for the rest of the day: Now, Tasks and Calendar show only it.",
39105
39152
  args: [{ name: "id", required: false, description: "Area ULID (omit with --off)." }],
39106
39153
  flags: [{ name: "off", type: "boolean", description: "Show everything again." }],
39107
- scopes: ["settings:write"],
39154
+ scopes: [...settingsOperations.update.scopes],
39108
39155
  returns: "UserSettings",
39109
- notes: "PATCH /api/v1/settings { focusAreaId }. Clears itself at the end of the member's day (focusUntil); hidden tasks don't move or go overdue."
39156
+ notes: `${routeOf(settingsOperations.update)} { focusAreaId }. Clears itself at the end of the member's day (focusUntil); hidden tasks don't move or go overdue.`
39110
39157
  },
39111
39158
  {
39112
39159
  path: ["areas", "pin"],
39113
39160
  summary: "Pin an Area under Life in the desktop sidebar (up to five).",
39114
39161
  args: [{ name: "id", required: true, description: "Area ULID." }],
39115
39162
  flags: [],
39116
- scopes: ["settings:read", "settings:write"],
39163
+ scopes: [...new Set([...settingsOperations.get.scopes, ...settingsOperations.update.scopes])],
39117
39164
  returns: "UserSettings",
39118
39165
  notes: "Reads then patches settings.pinnedAreaIds; a pinned Area stays where it is."
39119
39166
  },
@@ -39122,7 +39169,7 @@ var COMMAND_SPECS = [
39122
39169
  summary: "Take an Area out of the desktop sidebar.",
39123
39170
  args: [{ name: "id", required: true, description: "Area ULID." }],
39124
39171
  flags: [],
39125
- scopes: ["settings:read", "settings:write"],
39172
+ scopes: [...new Set([...settingsOperations.get.scopes, ...settingsOperations.update.scopes])],
39126
39173
  returns: "UserSettings",
39127
39174
  notes: "Reads then patches settings.pinnedAreaIds."
39128
39175
  },
@@ -40779,6 +40826,17 @@ var COMMAND_SPECS = [
40779
40826
  returns: "ThankYouView",
40780
40827
  notes: 'Log a gift as a gift_received moment with sourceNodeId = the project: `do contact-moments create --data \'{"contactId":"<id>","kind":"gift_received","summary":"a moka pot","sourceNodeId":"<project>"}\'`. Mark the card sent: `do contact-moments update <id> --data \'{"thankedAt":"2027-07-10"}\'`.'
40781
40828
  },
40829
+ {
40830
+ path: ["guest-lists", "rsvp-digest"],
40831
+ summary: "The RSVPs that came in since a moment (default the last 24 hours), for a daily digest.",
40832
+ args: [{ name: "id", required: true, description: "The guest list's id." }],
40833
+ flags: [
40834
+ { name: "since", type: "string", description: "An ISO instant; default 24 hours ago." }
40835
+ ],
40836
+ scopes: [...guestListOperations.rsvpDigest.scopes],
40837
+ returns: "RsvpDigest",
40838
+ notes: "Each household that answered or changed its answer, with who's coming, maybe and not coming by name, how many households still wait, and the same as plain lines in `text`. The couple get each answer as a do notification, never a mail."
40839
+ },
40782
40840
  {
40783
40841
  path: ["guest-lists", "export"],
40784
40842
  summary: "Export for the caterer, the venue, the church or the RSVP answers (CSV) to stdout, or save the floor plan or the paper invitations (PDF) to a file.",
@@ -41108,7 +41166,7 @@ var COMMAND_SPECS = [
41108
41166
  ],
41109
41167
  scopes: [],
41110
41168
  returns: "LoginResult",
41111
- notes: "Writes ~/.config/do/config.json (0600) after a successful GET /api/v1/whoami."
41169
+ notes: `Writes ~/.config/do/config.json (0600) after a successful ${routeOf(whoamiOperations.whoami)}.`
41112
41170
  },
41113
41171
  {
41114
41172
  path: ["config", "set"],
@@ -43322,7 +43380,7 @@ var HANDLERS = {
43322
43380
  ...duration ? { durationMinutes: duration } : {}
43323
43381
  });
43324
43382
  const client = requireClient();
43325
- const task = await client.post("/tasks", input);
43383
+ const task = await client.post(pathOf(taskOperations.create), input);
43326
43384
  if (parsed.recurrence) {
43327
43385
  const rule = parseInput(createRecurrenceRuleInputSchema, {
43328
43386
  templateId: id,
@@ -43337,13 +43395,13 @@ var HANDLERS = {
43337
43395
  const tasks = [];
43338
43396
  let cursor;
43339
43397
  do {
43340
- const page = await client.getPage("/tasks", {
43398
+ const page = await client.getPage(pathOf(taskOperations.list), {
43341
43399
  query: { filter: "all", cursor }
43342
43400
  });
43343
43401
  tasks.push(...page.data);
43344
43402
  cursor = page.nextCursor ?? undefined;
43345
43403
  } while (cursor);
43346
- const habits = await client.get("/habits/today").catch((error) => {
43404
+ const habits = await client.get(pathOf(habitOperations.today)).catch((error) => {
43347
43405
  if (error instanceof CliError && (error.code === "auth" || error.exitCode === EXIT.NOT_FOUND))
43348
43406
  return;
43349
43407
  throw error;
@@ -43381,7 +43439,7 @@ var HANDLERS = {
43381
43439
  to = today.toISOString();
43382
43440
  body = { action: "reschedule", to, taskIds };
43383
43441
  } else if (answer === "later") {
43384
- const earlier = await client.get("/today/from-earlier", {
43442
+ const earlier = await client.get(pathOf(todayOperations.fromEarlier), {
43385
43443
  query: { from: today.toISOString() }
43386
43444
  });
43387
43445
  to = earlier.laterThisWeek;
@@ -43389,7 +43447,7 @@ var HANDLERS = {
43389
43447
  } else {
43390
43448
  body = { action: answer === "someday" ? "someday" : "drop", taskIds };
43391
43449
  }
43392
- const result = await client.post("/today/rollover", body);
43450
+ const result = await client.post(pathOf(todayOperations.rollover), body);
43393
43451
  return {
43394
43452
  data: { answer, ...to ? { to } : {}, ...result },
43395
43453
  render: renderFromEarlierAnswer
@@ -44300,7 +44358,7 @@ var HANDLERS = {
44300
44358
  "notes backlinks": async ({ args, requireClient }) => {
44301
44359
  const id = requireArg(args, 0, "note id");
44302
44360
  return {
44303
- data: await requireClient().get(`/notes/${id}/backlinks`),
44361
+ data: await requireClient().get(pathOf(noteOperations.backlinks, { id })),
44304
44362
  render: renderList
44305
44363
  };
44306
44364
  },
@@ -44308,14 +44366,17 @@ var HANDLERS = {
44308
44366
  const id = requireArg(args, 0, "task id");
44309
44367
  const at = flagString(flags, "at");
44310
44368
  const client = requireClient();
44311
- const current = await client.get(`/tasks/${id}`);
44369
+ const current = await client.get(pathOf(taskOperations.get, { id }));
44312
44370
  if (current.status === "done" && at === undefined)
44313
44371
  return { data: current, render: renderTask };
44314
44372
  const body = parseInput(updateTaskInputSchema, {
44315
44373
  status: "done",
44316
44374
  ...at !== undefined ? { completedAt: at } : {}
44317
44375
  });
44318
- return { data: await client.patch(`/tasks/${id}`, body), render: renderTask };
44376
+ return {
44377
+ data: await client.patch(pathOf(taskOperations.update, { id }), body),
44378
+ render: renderTask
44379
+ };
44319
44380
  },
44320
44381
  "task cancel": async ({ args, requireClient }) => {
44321
44382
  const id = requireArg(args, 0, "task id");
@@ -44720,10 +44781,16 @@ var HANDLERS = {
44720
44781
  if (off && until)
44721
44782
  throw usageError("`do away off` comes back now; it takes no --until");
44722
44783
  if (!off && !until) {
44723
- return { data: await requireClient().get("/habits/away"), render: renderAway };
44784
+ return {
44785
+ data: await requireClient().get(pathOf(habitOperations.getAway)),
44786
+ render: renderAway
44787
+ };
44724
44788
  }
44725
44789
  const input = parseInput(awayInputSchema, { until: off ? null : until });
44726
- return { data: await requireClient().put("/habits/away", input), render: renderAway };
44790
+ return {
44791
+ data: await requireClient().put(pathOf(habitOperations.setAway), input),
44792
+ render: renderAway
44793
+ };
44727
44794
  },
44728
44795
  "routine done": async ({ args, requireClient }) => {
44729
44796
  const id = requireArg(args, 0, "routine id");
@@ -44927,7 +44994,7 @@ var HANDLERS = {
44927
44994
  };
44928
44995
  },
44929
44996
  "modules list": async ({ requireClient }) => {
44930
- const settings = await requireClient().get("/settings");
44997
+ const settings = await requireClient().get(pathOf(settingsOperations.get));
44931
44998
  const enabled = new Set(effectiveEnabledModules(settings.enabledModules));
44932
44999
  const rows = FEATURE_MODULES.map((module) => ({
44933
45000
  key: module.key,
@@ -45206,7 +45273,10 @@ var HANDLERS = {
45206
45273
  if (id === undefined)
45207
45274
  throw usageError("areas focus needs an area id, or --off to show everything");
45208
45275
  const body = parseInput(updateUserSettingsInputSchema, { focusAreaId: id });
45209
- return { data: await requireClient().patch("/settings", body), render: renderRecord };
45276
+ return {
45277
+ data: await requireClient().patch(pathOf(settingsOperations.update), body),
45278
+ render: renderRecord
45279
+ };
45210
45280
  },
45211
45281
  "areas pin": async ({ args, requireClient }) => setAreaPinned(args, requireClient, true),
45212
45282
  "areas unpin": async ({ args, requireClient }) => setAreaPinned(args, requireClient, false),
@@ -45900,7 +45970,7 @@ var HANDLERS = {
45900
45970
  const input = await saveUpload(path);
45901
45971
  if (dryRun)
45902
45972
  return { ...input, screenshot: input.screenshot ? "(png)" : null };
45903
- return requireClient().post(`/runs/${id}/save-header`, input);
45973
+ return requireClient().post(pathOf(runOperations.uploadSaveHeader, { id }), input);
45904
45974
  };
45905
45975
  if (!flagBool(flags, "watch")) {
45906
45976
  return { data: await send(await resolveSave(target)), render: renderRecord };
@@ -46642,6 +46712,17 @@ var HANDLERS = {
46642
46712
  render: renderRecord
46643
46713
  };
46644
46714
  },
46715
+ "guest-lists rsvp-digest": async ({ args, flags, requireClient }) => {
46716
+ const id = requireArg(args, 0, "guest list id");
46717
+ const since = flagString(flags, "since");
46718
+ const query = parseInput(rsvpDigestQuerySchema, since ? { since } : {});
46719
+ return {
46720
+ data: await requireClient().get(pathOf(guestListOperations.rsvpDigest, { id }), {
46721
+ query: query.since ? { since: query.since.toISOString() } : {}
46722
+ }),
46723
+ render: renderRecord
46724
+ };
46725
+ },
46645
46726
  "guest-lists export": async ({ args, flags, requireClient }) => {
46646
46727
  const id = requireArg(args, 0, "guest list id");
46647
46728
  const kind = parseInput(guestExportKindSchema, flagString(flags, "kind") ?? "venue");
@@ -46857,7 +46938,7 @@ var HANDLERS = {
46857
46938
  if (!config.apiKey) {
46858
46939
  throw configError("provide --api-key <key> (or set DO_API_KEY) to log in");
46859
46940
  }
46860
- const auth = await requireClient().get("/whoami");
46941
+ const auth = await requireClient().get(pathOf(whoamiOperations.whoami));
46861
46942
  const path = writeConfigFile(io, { apiUrl: config.apiUrl, apiKey: config.apiKey });
46862
46943
  return {
46863
46944
  data: {
@@ -46935,20 +47016,26 @@ async function setModuleVisibility(args, requireClient, on) {
46935
47016
  throw usageError(`unknown module \`${key}\` \u2014 valid keys: ${MODULE_KEYS.join(", ")}`);
46936
47017
  }
46937
47018
  const client = requireClient();
46938
- const settings = await client.get("/settings");
47019
+ const settings = await client.get(pathOf(settingsOperations.get));
46939
47020
  const enabledModules = setModuleEnabled(settings.enabledModules, key, on);
46940
47021
  const body = parseInput(updateUserSettingsInputSchema, { enabledModules });
46941
- return { data: await client.patch("/settings", body), render: renderRecord };
47022
+ return {
47023
+ data: await client.patch(pathOf(settingsOperations.update), body),
47024
+ render: renderRecord
47025
+ };
46942
47026
  }
46943
47027
  async function setAreaPinned(args, requireClient, pinned) {
46944
47028
  const id = requireArg(args, 0, "area id");
46945
47029
  const client = requireClient();
46946
- const settings = await client.get("/settings");
47030
+ const settings = await client.get(pathOf(settingsOperations.get));
46947
47031
  const rest = (settings.pinnedAreaIds ?? []).filter((x) => x !== id);
46948
47032
  const body = parseInput(updateUserSettingsInputSchema, {
46949
47033
  pinnedAreaIds: pinned ? [...rest, id] : rest
46950
47034
  });
46951
- return { data: await client.patch("/settings", body), render: renderRecord };
47035
+ return {
47036
+ data: await client.patch(pathOf(settingsOperations.update), body),
47037
+ render: renderRecord
47038
+ };
46952
47039
  }
46953
47040
  function parseTitleTags(args) {
46954
47041
  const titleWords = [];
@@ -47272,10 +47359,10 @@ async function postText(io, args) {
47272
47359
  return text;
47273
47360
  }
47274
47361
  async function homeSlug(client) {
47275
- const me = await client.get("/whoami");
47362
+ const me = await client.get(pathOf(whoamiOperations.whoami));
47276
47363
  if (!me.agentId)
47277
47364
  throw usageError("this key isn't an Agent's: pass --thread <slug|id>");
47278
- const { data } = await client.getPage("/agents");
47365
+ const { data } = await client.getPage(pathOf(agentOperations.list));
47279
47366
  const agent = data.find((a) => a.id === me.agentId);
47280
47367
  if (!agent)
47281
47368
  throw usageError("couldn't read the agent's name: pass --thread <slug|id>");
@@ -47285,7 +47372,7 @@ var ULID = /^[0-9A-HJKMNP-TV-Z]{26}$/i;
47285
47372
  async function resolveAgentId(client, agent) {
47286
47373
  if (ULID.test(agent))
47287
47374
  return agent;
47288
- const { data } = await client.getPage("/agents");
47375
+ const { data } = await client.getPage(pathOf(agentOperations.list));
47289
47376
  const wanted = agent.trim().toLowerCase();
47290
47377
  const match = data.find((a) => a.name.toLowerCase() === wanted);
47291
47378
  if (!match) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robbeverhelst/do",
3
- "version": "1.307.0",
3
+ "version": "1.308.0",
4
4
  "private": false,
5
5
  "description": "do — the agent-drivable CLI over the public /api/v1 surface",
6
6
  "homepage": "https://github.com/robbeverhelst/do/tree/main/apps/cli",