@robbeverhelst/do 1.418.0 → 1.420.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 +520 -58
  2. package/package.json +1 -1
package/dist/do.js CHANGED
@@ -14420,7 +14420,7 @@ var configError = (message) => new CliError("config", message, EXIT.CONFIG);
14420
14420
 
14421
14421
  // src/meta.ts
14422
14422
  var CLI_NAME = "do";
14423
- var VERSION = "1.418.0";
14423
+ var VERSION = "1.420.0";
14424
14424
  var API_PREFIX = "/api/v1";
14425
14425
  var DEFAULT_API_URL = "http://localhost:3001";
14426
14426
 
@@ -28625,6 +28625,268 @@ var documentOperations = defineOperations({
28625
28625
  }
28626
28626
  });
28627
28627
 
28628
+ // ../../packages/schema/src/db/agent-chat-threads.ts
28629
+ var agentChatThreads = pgTable("agent_chat_threads", {
28630
+ id: text("id").primaryKey(),
28631
+ tenantId: text("tenant_id").notNull().references(() => tenants.id),
28632
+ userId: text("user_id").notNull().references(() => users.id, { onDelete: "cascade" }),
28633
+ title: text("title"),
28634
+ slug: text("slug"),
28635
+ standing: boolean4("standing").notNull().default(false),
28636
+ push: text("push").notNull().default("all"),
28637
+ areaIds: text("area_ids").array().notNull().default([]),
28638
+ peopleCapture: boolean4("people_capture").notNull().default(true),
28639
+ kind: text("kind"),
28640
+ anchorType: text("anchor_type"),
28641
+ anchorId: text("anchor_id"),
28642
+ parentId: text("parent_id"),
28643
+ notifyLevel: text("notify_level"),
28644
+ icon: text("icon"),
28645
+ description: text("description"),
28646
+ memoryScope: text("memory_scope"),
28647
+ lastMessageAt: timestamp("last_message_at", { withTimezone: true }),
28648
+ archivedAt: timestamp("archived_at", { withTimezone: true }),
28649
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
28650
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
28651
+ }, (t) => [
28652
+ index("agent_chat_threads_member_idx").on(t.tenantId, t.userId, t.updatedAt),
28653
+ uniqueIndex("agent_chat_threads_slug_uniq").on(t.tenantId, t.userId, t.slug).where(sql`${t.slug} is not null`)
28654
+ ]);
28655
+ var agentChatTurns = pgTable("agent_chat_turns", {
28656
+ id: text("id").primaryKey(),
28657
+ tenantId: text("tenant_id").notNull().references(() => tenants.id),
28658
+ threadId: text("thread_id").notNull().references(() => agentChatThreads.id, { onDelete: "cascade" }),
28659
+ userId: text("user_id").notNull().references(() => users.id, { onDelete: "cascade" }),
28660
+ question: text("question").notNull(),
28661
+ context: jsonb("context").$type().notNull(),
28662
+ reply: text("reply").notNull().default(""),
28663
+ status: text("status").notNull().default("streaming"),
28664
+ error: text("error"),
28665
+ since: text("since"),
28666
+ changes: jsonb("changes").$type().notNull().default([]),
28667
+ confirmations: jsonb("confirmations").$type().notNull().default([]),
28668
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
28669
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
28670
+ }, (t) => [index("agent_chat_turns_thread_idx").on(t.threadId, t.createdAt)]);
28671
+ var agentChatPosts = pgTable("agent_chat_posts", {
28672
+ id: text("id").primaryKey(),
28673
+ tenantId: text("tenant_id").notNull().references(() => tenants.id),
28674
+ threadId: text("thread_id").notNull().references(() => agentChatThreads.id, { onDelete: "cascade" }),
28675
+ userId: text("user_id").notNull().references(() => users.id, { onDelete: "cascade" }),
28676
+ author: text("author").notNull(),
28677
+ agentId: text("agent_id").references(() => agents.id),
28678
+ externalId: text("external_id"),
28679
+ kind: text("kind").notNull().default("message"),
28680
+ level: text("level"),
28681
+ text: text("text").notNull().default(""),
28682
+ final: boolean4("final").notNull().default(true),
28683
+ replyToId: text("reply_to_id"),
28684
+ relayOfPostId: text("relay_of_post_id").references(() => agentChatPosts.id, {
28685
+ onDelete: "set null"
28686
+ }),
28687
+ runStatus: text("run_status"),
28688
+ brief: jsonb("brief").$type(),
28689
+ card: jsonb("card").$type(),
28690
+ digestKey: text("digest_key"),
28691
+ title: text("title"),
28692
+ runSteps: jsonb("run_steps").$type(),
28693
+ runEndedAt: timestamp("run_ended_at", { withTimezone: true }),
28694
+ prompt: jsonb("prompt").$type(),
28695
+ receipt: jsonb("receipt").$type(),
28696
+ attachments: jsonb("attachments").$type().notNull().default([]),
28697
+ context: jsonb("context").$type(),
28698
+ deliveredAt: timestamp("delivered_at", { withTimezone: true }),
28699
+ seenAt: timestamp("seen_at", { withTimezone: true }),
28700
+ readAt: timestamp("read_at", { withTimezone: true }),
28701
+ fallbackAt: timestamp("fallback_at", { withTimezone: true }),
28702
+ fallbackAckedAt: timestamp("fallback_acked_at", { withTimezone: true }),
28703
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
28704
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
28705
+ deletedAt: timestamp("deleted_at", { withTimezone: true })
28706
+ }, (t) => [
28707
+ index("agent_chat_posts_thread_idx").on(t.threadId, t.createdAt),
28708
+ uniqueIndex("agent_chat_posts_external_uniq").on(t.tenantId, t.agentId, t.externalId).where(sql`${t.externalId} is not null`),
28709
+ index("agent_chat_posts_undelivered_idx").on(t.tenantId, t.createdAt).where(sql`${t.author} = 'member' and ${t.deliveredAt} is null`),
28710
+ index("agent_chat_posts_needs_you_unseen_idx").on(t.tenantId, t.userId, t.createdAt).where(sql`${t.author} = 'agent' and ${t.level} = 'needs_you' and ${t.seenAt} is null and ${t.deletedAt} is null`)
28711
+ ]);
28712
+
28713
+ // ../../packages/schema/src/db/echo-schedules.ts
28714
+ var ECHO_SCHEDULE_LEVELS = ["now", "today", "digest", "silent"];
28715
+ var ECHO_SCHEDULE_RUN_STATUSES = ["ok", "failed", "unanswered"];
28716
+ var echoSchedules = pgTable("echo_schedules", {
28717
+ id: text("id").primaryKey(),
28718
+ tenantId: text("tenant_id").notNull().references(() => tenants.id),
28719
+ userId: text("user_id").notNull().references(() => users.id, { onDelete: "cascade" }),
28720
+ key: text("key").notNull(),
28721
+ name: text("name").notNull(),
28722
+ threadId: text("thread_id").notNull().references(() => agentChatThreads.id, { onDelete: "cascade" }),
28723
+ agentId: text("agent_id").references(() => agents.id),
28724
+ desk: text("desk"),
28725
+ times: text("times").array().notNull(),
28726
+ everyMinutes: integer2("every_minutes"),
28727
+ weekdays: integer2("weekdays").array().notNull().default([]),
28728
+ level: text("level").notNull().default("today"),
28729
+ levelNote: text("level_note"),
28730
+ pausedAt: timestamp("paused_at", { withTimezone: true }),
28731
+ runRequestedAt: timestamp("run_requested_at", { withTimezone: true }),
28732
+ lastRunAt: timestamp("last_run_at", { withTimezone: true }),
28733
+ lastStatus: text("last_status"),
28734
+ lastNote: text("last_note"),
28735
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
28736
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
28737
+ }, (t) => [
28738
+ index("echo_schedules_member_idx").on(t.tenantId, t.userId),
28739
+ uniqueIndex("echo_schedules_key_uniq").on(t.tenantId, t.userId, t.key),
28740
+ check2("echo_schedules_level_chk", sql`${t.level} IN ('now', 'today', 'digest', 'silent')`),
28741
+ check2("echo_schedules_last_status_chk", sql`${t.lastStatus} IS NULL OR ${t.lastStatus} IN ('ok', 'failed', 'unanswered')`)
28742
+ ]);
28743
+
28744
+ // ../../packages/schema/src/contracts/echo-schedules.ts
28745
+ var echoScheduleLevelSchema = _enum2(ECHO_SCHEDULE_LEVELS);
28746
+ var echoScheduleRunStatusSchema = _enum2(ECHO_SCHEDULE_RUN_STATUSES);
28747
+ var clock = string2().regex(/^([01]\d|2[0-3]):[0-5]\d$/, "a time as HH:MM");
28748
+ var echoScheduleKeySchema = string2().regex(/^[a-z0-9][a-z0-9-]{0,39}$/, "lower-case letters, digits and dashes, at most 40");
28749
+ var times = array(clock).min(1).max(12);
28750
+ var weekdays = array(number2().int().min(1).max(7)).max(7).refine((d) => new Set(d).size === d.length, "each weekday once");
28751
+ var everyMinutes = number2().int().min(15).max(10080);
28752
+ var echoScheduleSchema = object({
28753
+ id: ulidSchema,
28754
+ key: string2(),
28755
+ name: string2(),
28756
+ thread: object({
28757
+ id: string2(),
28758
+ title: string2().nullable(),
28759
+ slug: string2().nullable(),
28760
+ icon: string2().nullable()
28761
+ }),
28762
+ agentId: string2().nullable(),
28763
+ desk: string2().nullable(),
28764
+ times: array(string2()),
28765
+ everyMinutes: number2().int().nullable(),
28766
+ weekdays: array(number2().int()),
28767
+ level: echoScheduleLevelSchema,
28768
+ levelNote: string2().nullable(),
28769
+ paused: boolean2(),
28770
+ runRequested: boolean2(),
28771
+ lastRunAt: exports_coerce.date().nullable(),
28772
+ lastStatus: echoScheduleRunStatusSchema.nullable(),
28773
+ lastNote: string2().nullable(),
28774
+ createdAt: exports_coerce.date(),
28775
+ updatedAt: exports_coerce.date()
28776
+ });
28777
+ var putEchoScheduleInputSchema = object({
28778
+ name: string2().trim().min(1).max(80),
28779
+ thread: string2().trim().min(1).max(40),
28780
+ desk: string2().trim().min(1).max(40).nullish(),
28781
+ times,
28782
+ everyMinutes: everyMinutes.nullish(),
28783
+ weekdays: weekdays.optional(),
28784
+ level: echoScheduleLevelSchema.optional(),
28785
+ levelNote: string2().trim().min(1).max(120).nullish()
28786
+ }).strict();
28787
+ var updateEchoScheduleInputSchema = object({
28788
+ level: echoScheduleLevelSchema.optional(),
28789
+ paused: boolean2().optional()
28790
+ }).strict().refine((v) => v.level !== undefined || v.paused !== undefined, "level or paused");
28791
+ var reportEchoScheduleRunInputSchema = object({
28792
+ status: echoScheduleRunStatusSchema,
28793
+ note: string2().trim().min(1).max(200).nullish(),
28794
+ at: exports_coerce.date().optional()
28795
+ }).strict();
28796
+ var echoScheduleKeyParamSchema = object({ key: echoScheduleKeySchema });
28797
+
28798
+ // ../../packages/schema/src/operations/echo-schedules.ts
28799
+ var NO_USER = "The key has no user identity (scheduled posts are per member).";
28800
+ var KEY = {
28801
+ key: {
28802
+ description: "The job's handle, the agent's own (`wake`, `pings`): lower-case letters, digits and dashes.",
28803
+ pattern: "^[a-z0-9][a-z0-9-]{0,39}$"
28804
+ }
28805
+ };
28806
+ var KEY_SCHEMA = { key: echoScheduleKeySchema };
28807
+ var VIEW = "`{ id, key, name, thread: { id, title, slug, icon }, agentId, desk, times, everyMinutes, weekdays, level, levelNote, paused, runRequested, lastRunAt, lastStatus, lastNote }`";
28808
+ var echoScheduleOperations = defineOperations({
28809
+ list: {
28810
+ method: "get",
28811
+ path: "/echo/schedules",
28812
+ scopes: ["agents:read"],
28813
+ tag: "Agents",
28814
+ summary: "List the scheduled posts",
28815
+ description: `Every job that posts into the member's threads on a clock, by name: ${VIEW}. \`times\` are \`HH:MM\` on the member's wall clock; with \`everyMinutes\` the job repeats from the first until midnight; \`weekdays\` are ISO (1 = Monday), empty for every day. \`level\` says how its posts land (\`now\` pushes, \`today\` a card in its thread, \`digest\` folded into one line, \`silent\` only in its history). A \`paused\` job doesn't run; \`runRequested\` asks for a run now.`,
28816
+ status: 200,
28817
+ response: { description: "The scheduled posts.", list: true },
28818
+ errors: { 403: NO_USER }
28819
+ },
28820
+ put: {
28821
+ method: "put",
28822
+ path: "/echo/schedules/{key}",
28823
+ pathParams: KEY,
28824
+ pathParamSchemas: KEY_SCHEMA,
28825
+ scopes: ["agents:write"],
28826
+ tag: "Agents",
28827
+ summary: "Declare a scheduled post",
28828
+ description: "The agent declares a job, or redeclares it: `name`, the member's standing `thread` it posts to (by slug), the `desk` that runs it, `times` (`HH:MM`, at most 12), `everyMinutes` (15 to 10080) and `weekdays`, and `level` with a `levelNote`. A new key makes the job (level `today` unless given); a known one updates it, keeping the member's level and pause. A thread the member doesn't have is a 404. The calling agent is recorded as the one that runs it.",
28829
+ body: putEchoScheduleInputSchema,
28830
+ status: 200,
28831
+ response: { description: "The scheduled post." },
28832
+ errors: { 400: true, 403: NO_USER, 404: "No such thread." }
28833
+ },
28834
+ update: {
28835
+ method: "patch",
28836
+ path: "/echo/schedules/{key}",
28837
+ pathParams: KEY,
28838
+ pathParamSchemas: KEY_SCHEMA,
28839
+ scopes: ["agents:write"],
28840
+ tag: "Agents",
28841
+ summary: "Change a scheduled post's level or pause it",
28842
+ description: "How its posts land (`level`: `now`, `today`, `digest` or `silent`) and whether it runs (`paused`). An unknown key is a 404.",
28843
+ body: updateEchoScheduleInputSchema,
28844
+ status: 200,
28845
+ response: { description: "The scheduled post." },
28846
+ errors: { 400: true, 403: NO_USER, 404: true }
28847
+ },
28848
+ runNow: {
28849
+ method: "post",
28850
+ path: "/echo/schedules/{key}/run",
28851
+ pathParams: KEY,
28852
+ pathParamSchemas: KEY_SCHEMA,
28853
+ scopes: ["agents:write"],
28854
+ tag: "Agents",
28855
+ summary: "Ask for a scheduled post now",
28856
+ description: "Asks the agent to run the job now: it reads `runRequested` on the job until it reports the run. A paused job is a 409. An unknown key is a 404.",
28857
+ status: 200,
28858
+ response: { description: "The scheduled post." },
28859
+ errors: { 403: NO_USER, 404: true, 409: "The job is paused." }
28860
+ },
28861
+ report: {
28862
+ method: "post",
28863
+ path: "/echo/schedules/{key}/runs",
28864
+ pathParams: KEY,
28865
+ pathParamSchemas: KEY_SCHEMA,
28866
+ scopes: ["agents:write"],
28867
+ tag: "Agents",
28868
+ summary: "Report a scheduled post's run",
28869
+ description: "The agent says how a run went (`status`: `ok`, `failed`, or `unanswered` for a check-in nobody answered), with a short `note` and when (`at`, default now). It clears a run asked for. An unknown key is a 404.",
28870
+ body: reportEchoScheduleRunInputSchema,
28871
+ status: 200,
28872
+ response: { description: "The scheduled post." },
28873
+ errors: { 400: true, 403: NO_USER, 404: true }
28874
+ },
28875
+ remove: {
28876
+ method: "delete",
28877
+ path: "/echo/schedules/{key}",
28878
+ pathParams: KEY,
28879
+ pathParamSchemas: KEY_SCHEMA,
28880
+ scopes: ["agents:write"],
28881
+ tag: "Agents",
28882
+ summary: "Remove a scheduled post",
28883
+ description: "The agent no longer runs the job. An unknown key is a 404.",
28884
+ status: 204,
28885
+ response: { description: "Removed." },
28886
+ errors: { 403: NO_USER, 404: true }
28887
+ }
28888
+ });
28889
+
28628
28890
  // ../../packages/schema/src/contracts/echo-threads.ts
28629
28891
  var echoTurnStatusSchema = _enum2(["streaming", "done", "error", "cancelled"]);
28630
28892
  var echoTurnConfirmationSchema = agentConfirmationSchema.extend({
@@ -28825,7 +29087,7 @@ var createEchoThreadInputSchema = object({
28825
29087
  }).strict();
28826
29088
 
28827
29089
  // ../../packages/schema/src/operations/echo-threads.ts
28828
- var NO_USER = "The key has no user identity (threads are per member).";
29090
+ var NO_USER2 = "The key has no user identity (threads are per member).";
28829
29091
  var echoThreadOperations = defineOperations({
28830
29092
  list: {
28831
29093
  method: "get",
@@ -28846,7 +29108,7 @@ var echoThreadOperations = defineOperations({
28846
29108
  querySchema: echoThreadsQuerySchema,
28847
29109
  status: 200,
28848
29110
  response: { description: "The member's threads.", list: true },
28849
- errors: { 400: true, 403: NO_USER }
29111
+ errors: { 400: true, 403: NO_USER2 }
28850
29112
  },
28851
29113
  create: {
28852
29114
  method: "post",
@@ -28859,7 +29121,7 @@ var echoThreadOperations = defineOperations({
28859
29121
  bodyOptional: true,
28860
29122
  status: 201,
28861
29123
  response: { description: "The new current thread." },
28862
- errors: { 403: NO_USER }
29124
+ errors: { 403: NO_USER2 }
28863
29125
  },
28864
29126
  current: {
28865
29127
  method: "get",
@@ -28870,7 +29132,7 @@ var echoThreadOperations = defineOperations({
28870
29132
  description: "The thread the agent panel opens on (the most recently used), with its turns oldest first: question, reply, `status` (`streaming` | `done` | `error` | `cancelled`), the change-feed cursor `since`, the changes and the confirmations. `{ thread: null }` before the first.",
28871
29133
  status: 200,
28872
29134
  response: { description: "`{ thread }`." },
28873
- errors: { 403: NO_USER }
29135
+ errors: { 403: NO_USER2 }
28874
29136
  },
28875
29137
  briefs: {
28876
29138
  method: "get",
@@ -28890,7 +29152,7 @@ var echoThreadOperations = defineOperations({
28890
29152
  querySchema: echoBriefsQuerySchema,
28891
29153
  status: 200,
28892
29154
  response: { description: "`{ briefs }`." },
28893
- errors: { 400: true, 403: NO_USER }
29155
+ errors: { 400: true, 403: NO_USER2 }
28894
29156
  },
28895
29157
  get: {
28896
29158
  method: "get",
@@ -28901,7 +29163,7 @@ var echoThreadOperations = defineOperations({
28901
29163
  description: "One of the member's threads with its turns, oldest first. Another member's thread is a 404.",
28902
29164
  status: 200,
28903
29165
  response: { description: "The thread." },
28904
- errors: { 403: NO_USER, 404: true }
29166
+ errors: { 403: NO_USER2, 404: true }
28905
29167
  },
28906
29168
  update: {
28907
29169
  method: "patch",
@@ -28913,7 +29175,7 @@ var echoThreadOperations = defineOperations({
28913
29175
  body: updateEchoThreadInputSchema,
28914
29176
  status: 200,
28915
29177
  response: { description: "The thread as the list shows it, with its `push`." },
28916
- errors: { 400: true, 403: NO_USER, 404: true }
29178
+ errors: { 400: true, 403: NO_USER2, 404: true }
28917
29179
  },
28918
29180
  addStanding: {
28919
29181
  method: "post",
@@ -28925,7 +29187,7 @@ var echoThreadOperations = defineOperations({
28925
29187
  body: createStandingThreadInputSchema,
28926
29188
  status: 201,
28927
29189
  response: { description: "The standing thread." },
28928
- errors: { 400: true, 403: NO_USER, 409: true }
29190
+ errors: { 400: true, 403: NO_USER2, 409: true }
28929
29191
  }
28930
29192
  });
28931
29193
 
@@ -34101,6 +34363,10 @@ var houseAssetSchema = object({
34101
34363
  readings: array(assetReadingSchema).default([]),
34102
34364
  loans: array(houseLoanSchema).default([])
34103
34365
  });
34366
+ var houseProjectSchema = object({
34367
+ id: string2(),
34368
+ linked: array(houseAssetLinkSchema)
34369
+ });
34104
34370
  var setAssetVisibilityInputSchema = object({ visibility: _enum2(NODE_VISIBILITY_VALUES) }).strict();
34105
34371
  var linkAssetPartInputSchema = object({ inventoryItemId: ulidSchema }).strict();
34106
34372
  var lendAssetInputSchema = object({
@@ -44636,7 +44902,7 @@ var PART_LABEL = {
44636
44902
  evening: "Evening",
44637
44903
  anytime: "Any time today"
44638
44904
  };
44639
- function clock(at, timezone) {
44905
+ function clock2(at, timezone) {
44640
44906
  return new Intl.DateTimeFormat("en-GB", {
44641
44907
  timeZone: timezone,
44642
44908
  hour: "2-digit",
@@ -44667,7 +44933,7 @@ function habitLines(day, mode) {
44667
44933
  if (h.week)
44668
44934
  meta.push(`${h.week.done} of ${h.week.target} this week`);
44669
44935
  if (h.last?.by && civilDay(h.last.at, day.timezone) === day.date) {
44670
- meta.push(`${h.last.by}, ${clock(h.last.at, day.timezone)}`);
44936
+ meta.push(`${h.last.by}, ${clock2(h.last.at, day.timezone)}`);
44671
44937
  }
44672
44938
  const tail = meta.length > 0 ? paint(mode, "dim", ` \xB7 ${meta.join(" \xB7 ")}`) : "";
44673
44939
  lines.push(` ${mark} ${h.title}${tail} ${paint(mode, "dim", h.habitId)}`);
@@ -50408,10 +50674,205 @@ var commands16 = [
50408
50674
  }
50409
50675
  ];
50410
50676
 
50677
+ // src/commands/echo-schedules.ts
50678
+ var LEVELS = ["now", "today", "digest", "silent"];
50679
+ var STATUSES = ["ok", "failed", "unanswered"];
50680
+ var DAYS = ["mon", "tue", "wed", "thu", "fri", "sat", "sun"];
50681
+ var KEY_ARG = {
50682
+ name: "key",
50683
+ required: true,
50684
+ description: "The job's handle (`wake`, `pings`): lower-case letters, digits and dashes."
50685
+ };
50686
+ function oneOf(value, allowed, what) {
50687
+ if (!allowed.includes(value))
50688
+ throw usageError(`${what} is one of ${allowed.join(", ")}`);
50689
+ return value;
50690
+ }
50691
+ function weekdaysOf(days) {
50692
+ return days.split(",").map((d) => {
50693
+ const i = DAYS.indexOf(d.trim().toLowerCase().slice(0, 3));
50694
+ if (i < 0)
50695
+ throw usageError(`--days takes mon,tue,\u2026,sun; got "${d}"`);
50696
+ return i + 1;
50697
+ });
50698
+ }
50699
+ var keyPath = (op, args) => pathOf(op, { key: requireArg(args, 0, "job key") });
50700
+ var commands17 = [
50701
+ {
50702
+ spec: {
50703
+ path: ["echo", "schedules", "list"],
50704
+ summary: "List your scheduled posts: the agent's jobs on a clock, by name.",
50705
+ args: [],
50706
+ flags: [],
50707
+ scopes: [...echoScheduleOperations.list.scopes],
50708
+ returns: "EchoSchedule[]",
50709
+ notes: "times are HH:MM on your wall clock; everyMinutes repeats from the first; paused jobs don't run; runRequested asks for a run now."
50710
+ },
50711
+ run: async ({ requireClient }) => ({
50712
+ data: await requireClient().getPage(pathOf(echoScheduleOperations.list)),
50713
+ render: renderList
50714
+ })
50715
+ },
50716
+ {
50717
+ spec: {
50718
+ path: ["echo", "schedules", "set"],
50719
+ summary: "Declare a scheduled post (the agent's): a new key makes it, a known key updates it.",
50720
+ args: [KEY_ARG],
50721
+ flags: [
50722
+ { name: "name", type: "string", description: "What it's called (Wake message)." },
50723
+ {
50724
+ name: "thread",
50725
+ type: "string",
50726
+ description: "The standing thread it posts to, by slug."
50727
+ },
50728
+ { name: "at", type: "string", description: "When, HH:MM, comma-separated (07:00,16:30)." },
50729
+ {
50730
+ name: "every",
50731
+ type: "string",
50732
+ description: "Repeat every N minutes from the first time."
50733
+ },
50734
+ { name: "days", type: "string", description: "Only on these days: mon,tue,\u2026,sun." },
50735
+ { name: "desk", type: "string", description: "The desk that runs it (build)." },
50736
+ {
50737
+ name: "level",
50738
+ type: "string",
50739
+ description: "A new job's level: now, today, digest or silent."
50740
+ },
50741
+ {
50742
+ name: "note",
50743
+ type: "string",
50744
+ description: "A word on the level (Now only on an incident)."
50745
+ }
50746
+ ],
50747
+ scopes: [...echoScheduleOperations.put.scopes],
50748
+ returns: "EchoSchedule",
50749
+ notes: "A redeclare keeps your level and pause. An unknown thread is a 404."
50750
+ },
50751
+ run: async ({ args, flags, requireClient }) => {
50752
+ const name = flagString(flags, "name");
50753
+ const thread = flagString(flags, "thread");
50754
+ const at = flagString(flags, "at");
50755
+ if (!name || !thread || !at)
50756
+ throw usageError("--name, --thread and --at are required");
50757
+ const every = flagString(flags, "every");
50758
+ const days = flagString(flags, "days");
50759
+ const desk = flagString(flags, "desk");
50760
+ const level = flagString(flags, "level");
50761
+ const note = flagString(flags, "note");
50762
+ return {
50763
+ data: await requireClient().put(keyPath(echoScheduleOperations.put, args), {
50764
+ name,
50765
+ thread,
50766
+ times: at.split(",").map((t) => t.trim()),
50767
+ ...every ? { everyMinutes: Number(every) } : {},
50768
+ ...days ? { weekdays: weekdaysOf(days) } : {},
50769
+ ...desk ? { desk } : {},
50770
+ ...level ? { level: oneOf(level, LEVELS, "--level") } : {},
50771
+ ...note ? { levelNote: note } : {}
50772
+ }),
50773
+ render: renderRecord
50774
+ };
50775
+ }
50776
+ },
50777
+ {
50778
+ spec: {
50779
+ path: ["echo", "schedules", "level"],
50780
+ summary: "Set how a scheduled post lands: now, today, digest or silent.",
50781
+ args: [
50782
+ KEY_ARG,
50783
+ { name: "level", required: true, description: "now, today, digest or silent." }
50784
+ ],
50785
+ flags: [],
50786
+ scopes: [...echoScheduleOperations.update.scopes],
50787
+ returns: "EchoSchedule",
50788
+ notes: "now pushes; today is a card in its thread; digest folds into one line; silent stays in its history."
50789
+ },
50790
+ run: async ({ args, requireClient }) => ({
50791
+ data: await requireClient().patch(keyPath(echoScheduleOperations.update, args), {
50792
+ level: oneOf(requireArg(args, 1, "level"), LEVELS, "level")
50793
+ }),
50794
+ render: renderRecord
50795
+ })
50796
+ },
50797
+ ...["pause", "resume"].map((verb) => ({
50798
+ spec: {
50799
+ path: ["echo", "schedules", verb],
50800
+ summary: verb === "pause" ? "Pause a scheduled post: the agent skips it." : "Resume a paused scheduled post.",
50801
+ args: [KEY_ARG],
50802
+ flags: [],
50803
+ scopes: [...echoScheduleOperations.update.scopes],
50804
+ returns: "EchoSchedule",
50805
+ notes: "An unknown key is a 404."
50806
+ },
50807
+ run: async ({ args, requireClient }) => ({
50808
+ data: await requireClient().patch(keyPath(echoScheduleOperations.update, args), {
50809
+ paused: verb === "pause"
50810
+ }),
50811
+ render: renderRecord
50812
+ })
50813
+ })),
50814
+ {
50815
+ spec: {
50816
+ path: ["echo", "schedules", "run"],
50817
+ summary: "Ask the agent to run a scheduled post now.",
50818
+ args: [KEY_ARG],
50819
+ flags: [],
50820
+ scopes: [...echoScheduleOperations.runNow.scopes],
50821
+ returns: "EchoSchedule",
50822
+ notes: "The job reads runRequested until the agent reports a run. A paused job is a 409."
50823
+ },
50824
+ run: async ({ args, requireClient }) => ({
50825
+ data: await requireClient().post(keyPath(echoScheduleOperations.runNow, args), {}),
50826
+ render: renderRecord
50827
+ })
50828
+ },
50829
+ {
50830
+ spec: {
50831
+ path: ["echo", "schedules", "ran"],
50832
+ summary: "Report a scheduled post's run (the agent's): ok, failed or unanswered.",
50833
+ args: [KEY_ARG, { name: "status", required: true, description: "ok, failed or unanswered." }],
50834
+ flags: [
50835
+ { name: "note", type: "string", description: "A word on the run (2 differences)." },
50836
+ { name: "at", type: "string", description: "When it ran (ISO); default now." }
50837
+ ],
50838
+ scopes: [...echoScheduleOperations.report.scopes],
50839
+ returns: "EchoSchedule",
50840
+ notes: "Clears a run asked for."
50841
+ },
50842
+ run: async ({ args, flags, requireClient }) => {
50843
+ const note = flagString(flags, "note");
50844
+ const at = flagString(flags, "at");
50845
+ return {
50846
+ data: await requireClient().post(keyPath(echoScheduleOperations.report, args), {
50847
+ status: oneOf(requireArg(args, 1, "status"), STATUSES, "status"),
50848
+ ...note ? { note } : {},
50849
+ ...at ? { at } : {}
50850
+ }),
50851
+ render: renderRecord
50852
+ };
50853
+ }
50854
+ },
50855
+ {
50856
+ spec: {
50857
+ path: ["echo", "schedules", "rm"],
50858
+ summary: "Remove a scheduled post (the agent no longer runs it).",
50859
+ args: [KEY_ARG],
50860
+ flags: [],
50861
+ scopes: [...echoScheduleOperations.remove.scopes],
50862
+ returns: "nothing",
50863
+ notes: "An unknown key is a 404."
50864
+ },
50865
+ run: async ({ args, requireClient }) => {
50866
+ await requireClient().delete(keyPath(echoScheduleOperations.remove, args));
50867
+ return { data: { removed: requireArg(args, 0, "job key") }, render: renderRecord };
50868
+ }
50869
+ }
50870
+ ];
50871
+
50411
50872
  // src/commands/files.ts
50412
50873
  import { readFileSync as readFileSync5, writeFileSync as writeFileSync2 } from "fs";
50413
50874
  import { basename as basename2 } from "path";
50414
- var commands17 = [
50875
+ var commands18 = [
50415
50876
  {
50416
50877
  spec: {
50417
50878
  path: ["files", "list"],
@@ -50581,7 +51042,7 @@ var commands17 = [
50581
51042
  ];
50582
51043
 
50583
51044
  // src/commands/food.ts
50584
- var commands18 = [
51045
+ var commands19 = [
50585
51046
  {
50586
51047
  spec: {
50587
51048
  path: ["foods", "search"],
@@ -51136,7 +51597,7 @@ var commands18 = [
51136
51597
  // src/commands/guest-lists.ts
51137
51598
  import { writeFileSync as writeFileSync3 } from "fs";
51138
51599
  import { basename as basename3 } from "path";
51139
- var commands19 = [
51600
+ var commands20 = [
51140
51601
  {
51141
51602
  spec: {
51142
51603
  path: ["guest-lists", "overview"],
@@ -51226,7 +51687,7 @@ var commands19 = [
51226
51687
  ];
51227
51688
 
51228
51689
  // src/commands/guests.ts
51229
- var commands20 = [
51690
+ var commands21 = [
51230
51691
  {
51231
51692
  spec: {
51232
51693
  path: ["guests", "sent"],
@@ -51311,7 +51772,7 @@ function renderItems(data, mode) {
51311
51772
  var habitArg = { name: "id", required: true, description: "The checklist habit's ULID." };
51312
51773
  var itemArg = { name: "item-id", required: true, description: "The item's ULID." };
51313
51774
  var NOT_CHECKLIST = "A habit that isn't a checklist answers 409.";
51314
- var commands21 = [
51775
+ var commands22 = [
51315
51776
  {
51316
51777
  spec: {
51317
51778
  path: ["habit", "items"],
@@ -51665,7 +52126,7 @@ function seasonFromFlags(flags) {
51665
52126
  const season = flagString(flags, "season");
51666
52127
  return season === undefined ? {} : { activeMonths: seasonFromFlag(season) };
51667
52128
  }
51668
- var commands22 = [
52129
+ var commands23 = [
51669
52130
  {
51670
52131
  spec: {
51671
52132
  path: ["habits", "create"],
@@ -52914,7 +53375,7 @@ function healthRecordHandlers() {
52914
53375
  }
52915
53376
  return out;
52916
53377
  }
52917
- var commands23 = pairCommands(HEALTH_COMMAND_SPECS, {
53378
+ var commands24 = pairCommands(HEALTH_COMMAND_SPECS, {
52918
53379
  ...healthRecordHandlers(),
52919
53380
  "health record": async ({ flags, requireClient }) => {
52920
53381
  const body = parseInput(logHealthInputSchema, readDataFlag(flags));
@@ -53229,7 +53690,7 @@ var commands23 = pairCommands(HEALTH_COMMAND_SPECS, {
53229
53690
  });
53230
53691
 
53231
53692
  // src/commands/house.ts
53232
- var commands24 = [
53693
+ var commands25 = [
53233
53694
  {
53234
53695
  spec: {
53235
53696
  path: ["house"],
@@ -53511,7 +53972,7 @@ function renderSorting(data, _mode) {
53511
53972
  ].join(`
53512
53973
  `);
53513
53974
  }
53514
- var commands25 = [
53975
+ var commands26 = [
53515
53976
  defineCommand({
53516
53977
  operation: inboxOperations.list,
53517
53978
  path: ["inbox"],
@@ -53603,7 +54064,7 @@ var commands25 = [
53603
54064
  ];
53604
54065
 
53605
54066
  // src/commands/incidents.ts
53606
- var commands26 = [
54067
+ var commands27 = [
53607
54068
  {
53608
54069
  spec: {
53609
54070
  path: ["incidents", "open"],
@@ -53832,7 +54293,7 @@ function journalDateArg(args, verb) {
53832
54293
  }
53833
54294
  return date;
53834
54295
  }
53835
- var commands27 = [
54296
+ var commands28 = [
53836
54297
  defineCommand({
53837
54298
  operation: journalOperations.day,
53838
54299
  path: ["journal", "day"],
@@ -54395,7 +54856,7 @@ function renderCreatedKey(data, mode) {
54395
54856
  ].join(`
54396
54857
  `);
54397
54858
  }
54398
- var commands28 = [
54859
+ var commands29 = [
54399
54860
  {
54400
54861
  spec: {
54401
54862
  path: ["keys", "list"],
@@ -54531,7 +54992,7 @@ var KIND_FLAG2 = {
54531
54992
  type: "string",
54532
54993
  description: "The kind of an unknown word (pages, eggs, health, note, or a word taught before); remembered for the Space."
54533
54994
  };
54534
- var commands29 = [
54995
+ var commands30 = [
54535
54996
  {
54536
54997
  spec: {
54537
54998
  path: ["log"],
@@ -54606,7 +55067,7 @@ var commands29 = [
54606
55067
  ];
54607
55068
 
54608
55069
  // src/commands/mail-campaigns.ts
54609
- var commands30 = [
55070
+ var commands31 = [
54610
55071
  {
54611
55072
  spec: {
54612
55073
  path: ["mail-campaigns", "list"],
@@ -54921,7 +55382,7 @@ async function serveMcp(io, target) {
54921
55382
  }
54922
55383
 
54923
55384
  // src/commands/mcp.ts
54924
- var commands31 = [
55385
+ var commands32 = [
54925
55386
  {
54926
55387
  spec: {
54927
55388
  path: ["mcp"],
@@ -54966,7 +55427,7 @@ var commands31 = [
54966
55427
  ];
54967
55428
 
54968
55429
  // src/commands/members.ts
54969
- var commands32 = [
55430
+ var commands33 = [
54970
55431
  {
54971
55432
  spec: {
54972
55433
  path: ["invite", "create"],
@@ -55091,7 +55552,7 @@ var commands32 = [
55091
55552
  ];
55092
55553
 
55093
55554
  // src/commands/metrics.ts
55094
- var commands33 = [
55555
+ var commands34 = [
55095
55556
  {
55096
55557
  spec: {
55097
55558
  path: ["metrics", "list"],
@@ -55219,7 +55680,7 @@ async function setModuleVisibility(args, requireClient, on) {
55219
55680
  render: renderRecord
55220
55681
  };
55221
55682
  }
55222
- var commands34 = [
55683
+ var commands35 = [
55223
55684
  {
55224
55685
  spec: {
55225
55686
  path: ["modules", "list"],
@@ -55448,7 +55909,7 @@ function shareFlag(flags) {
55448
55909
  function localMonth(now) {
55449
55910
  return `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, "0")}`;
55450
55911
  }
55451
- var commands35 = [
55912
+ var commands36 = [
55452
55913
  defineCommand({
55453
55914
  operation: moneyOperations.listAccounts,
55454
55915
  path: ["money", "accounts"],
@@ -56617,7 +57078,7 @@ var commands35 = [
56617
57078
  ];
56618
57079
 
56619
57080
  // src/commands/notes.ts
56620
- var commands36 = [
57081
+ var commands37 = [
56621
57082
  {
56622
57083
  spec: {
56623
57084
  path: ["notes", "backlinks"],
@@ -56739,7 +57200,7 @@ var commands36 = [
56739
57200
  ];
56740
57201
 
56741
57202
  // src/commands/orca.ts
56742
- var commands37 = [
57203
+ var commands38 = [
56743
57204
  {
56744
57205
  spec: {
56745
57206
  path: ["orca", "list"],
@@ -57105,7 +57566,7 @@ function linkBody(args) {
57105
57566
  return parseInput(familyTreeLinkInputSchema, { kind, a: ref, b: other });
57106
57567
  throw usageError("the kind is parent, child or partner");
57107
57568
  }
57108
- var commands38 = [
57569
+ var commands39 = [
57109
57570
  {
57110
57571
  spec: {
57111
57572
  path: ["people", "propose"],
@@ -57794,7 +58255,7 @@ var commands38 = [
57794
58255
 
57795
58256
  // src/commands/places.ts
57796
58257
  import { readFileSync as readFileSync10 } from "fs";
57797
- var commands39 = [
58258
+ var commands40 = [
57798
58259
  {
57799
58260
  spec: {
57800
58261
  path: ["places", "import"],
@@ -57851,7 +58312,7 @@ async function planDecision({ args, requireClient }, verb) {
57851
58312
  render: renderPlan
57852
58313
  };
57853
58314
  }
57854
- var commands40 = [
58315
+ var commands41 = [
57855
58316
  {
57856
58317
  spec: {
57857
58318
  path: ["plans", "list"],
@@ -58078,7 +58539,7 @@ var commands40 = [
58078
58539
  ];
58079
58540
 
58080
58541
  // src/commands/presets.ts
58081
- var commands41 = [
58542
+ var commands42 = [
58082
58543
  {
58083
58544
  spec: {
58084
58545
  path: ["presets", "list"],
@@ -58175,7 +58636,7 @@ function renderReviewSummary(data, mode) {
58175
58636
  return out.join(`
58176
58637
  `);
58177
58638
  }
58178
- var commands42 = [
58639
+ var commands43 = [
58179
58640
  {
58180
58641
  spec: {
58181
58642
  path: ["progress"],
@@ -58384,7 +58845,7 @@ function renderUpdates(data, mode) {
58384
58845
  return updates.map((u) => updateLine(u, mode)).join(`
58385
58846
  `);
58386
58847
  }
58387
- var commands43 = [
58848
+ var commands44 = [
58388
58849
  defineCommand({
58389
58850
  operation: projectOperations.update,
58390
58851
  path: ["projects", "set"],
@@ -58981,7 +59442,7 @@ var routineCommands = [
58981
59442
  }
58982
59443
  }
58983
59444
  ];
58984
- var commands44 = [
59445
+ var commands45 = [
58985
59446
  ...routineCommands,
58986
59447
  {
58987
59448
  spec: {
@@ -59104,7 +59565,7 @@ var commands44 = [
59104
59565
  ];
59105
59566
 
59106
59567
  // src/commands/rsvp-answers.ts
59107
- var commands45 = [
59568
+ var commands46 = [
59108
59569
  {
59109
59570
  spec: {
59110
59571
  path: ["rsvp-answers", "list"],
@@ -59158,7 +59619,7 @@ var commands45 = [
59158
59619
  ];
59159
59620
 
59160
59621
  // src/commands/rsvp-links.ts
59161
- var commands46 = [
59622
+ var commands47 = [
59162
59623
  {
59163
59624
  spec: {
59164
59625
  path: ["rsvp-links", "list"],
@@ -59254,7 +59715,7 @@ var commands46 = [
59254
59715
  ];
59255
59716
 
59256
59717
  // src/commands/rsvp-questions.ts
59257
- var commands47 = [
59718
+ var commands48 = [
59258
59719
  {
59259
59720
  spec: {
59260
59721
  path: ["rsvp-questions", "presets"],
@@ -59826,7 +60287,7 @@ function sessionFlags(flags) {
59826
60287
  body.occurredOn = on;
59827
60288
  return body;
59828
60289
  }
59829
- var commands48 = [
60290
+ var commands49 = [
59830
60291
  {
59831
60292
  spec: {
59832
60293
  path: ["runs", "change"],
@@ -60143,7 +60604,7 @@ var commands48 = [
60143
60604
  ];
60144
60605
 
60145
60606
  // src/commands/search.ts
60146
- var commands49 = [
60607
+ var commands50 = [
60147
60608
  {
60148
60609
  spec: {
60149
60610
  path: ["search"],
@@ -60176,7 +60637,7 @@ var commands49 = [
60176
60637
  ];
60177
60638
 
60178
60639
  // src/commands/seating-proposals.ts
60179
- var commands50 = [
60640
+ var commands51 = [
60180
60641
  {
60181
60642
  spec: {
60182
60643
  path: ["seating-proposals", "list"],
@@ -60263,7 +60724,7 @@ var commands50 = [
60263
60724
  ];
60264
60725
 
60265
60726
  // src/commands/sensors.ts
60266
- var commands51 = [
60727
+ var commands52 = [
60267
60728
  {
60268
60729
  spec: {
60269
60730
  path: ["sensors", "status"],
@@ -60423,7 +60884,7 @@ var commands51 = [
60423
60884
  ];
60424
60885
 
60425
60886
  // src/commands/settings.ts
60426
- var commands52 = [
60887
+ var commands53 = [
60427
60888
  {
60428
60889
  spec: {
60429
60890
  path: ["settings", "get"],
@@ -60457,7 +60918,7 @@ var commands52 = [
60457
60918
  ];
60458
60919
 
60459
60920
  // src/commands/sharing.ts
60460
- var commands53 = [
60921
+ var commands54 = [
60461
60922
  {
60462
60923
  spec: {
60463
60924
  path: ["share"],
@@ -60590,7 +61051,7 @@ var commands53 = [
60590
61051
  ];
60591
61052
 
60592
61053
  // src/commands/space.ts
60593
- var commands54 = [
61054
+ var commands55 = [
60594
61055
  {
60595
61056
  spec: {
60596
61057
  path: ["space", "address"],
@@ -60646,7 +61107,7 @@ var commands54 = [
60646
61107
  ];
60647
61108
 
60648
61109
  // src/commands/tap-tags.ts
60649
- var commands55 = [
61110
+ var commands56 = [
60650
61111
  {
60651
61112
  spec: {
60652
61113
  path: ["tap-tags", "tap"],
@@ -60674,7 +61135,7 @@ var BY = {
60674
61135
  type: "string",
60675
61136
  description: "The blocking task's ref (DO-147) or ULID."
60676
61137
  };
60677
- var commands56 = [
61138
+ var commands57 = [
60678
61139
  defineCommand({
60679
61140
  operation: taskBlockOperations.addBlocker,
60680
61141
  path: ["tasks", "block"],
@@ -60740,7 +61201,7 @@ function renderSeries(data, mode) {
60740
61201
  }).join(`
60741
61202
  `);
60742
61203
  }
60743
- var commands57 = [
61204
+ var commands58 = [
60744
61205
  defineCommand({
60745
61206
  operation: taskSeriesOperations.make,
60746
61207
  path: ["tasks", "make-series"],
@@ -60895,7 +61356,7 @@ function repeatFromFlags(flags) {
60895
61356
  out.anchor = "from_completion";
60896
61357
  return out;
60897
61358
  }
60898
- var commands58 = [
61359
+ var commands59 = [
60899
61360
  {
60900
61361
  spec: {
60901
61362
  path: ["capture"],
@@ -61353,7 +61814,7 @@ var commands58 = [
61353
61814
  ];
61354
61815
 
61355
61816
  // src/commands/time-blocks.ts
61356
- var commands59 = [
61817
+ var commands60 = [
61357
61818
  {
61358
61819
  spec: {
61359
61820
  path: ["time-blocks", "record"],
@@ -61545,7 +62006,7 @@ function renderLandedCounts(data, mode) {
61545
62006
  return out.join(`
61546
62007
  `);
61547
62008
  }
61548
- var commands60 = [
62009
+ var commands61 = [
61549
62010
  {
61550
62011
  spec: {
61551
62012
  path: ["today"],
@@ -61917,7 +62378,7 @@ function renderViews(data, mode) {
61917
62378
  function renderView(data, mode) {
61918
62379
  return renderViews([data], mode);
61919
62380
  }
61920
- var commands61 = [
62381
+ var commands62 = [
61921
62382
  defineCommand({
61922
62383
  operation: workViewOperations.list,
61923
62384
  path: ["views", "list"],
@@ -62036,7 +62497,7 @@ var commands61 = [
62036
62497
  ];
62037
62498
 
62038
62499
  // src/commands/worktree-links.ts
62039
- var commands62 = [
62500
+ var commands63 = [
62040
62501
  {
62041
62502
  spec: {
62042
62503
  path: ["worktree-links", "list"],
@@ -62204,7 +62665,8 @@ var FEATURE_COMMANDS = [
62204
62665
  ...commands59,
62205
62666
  ...commands60,
62206
62667
  ...commands61,
62207
- ...commands62
62668
+ ...commands62,
62669
+ ...commands63
62208
62670
  ];
62209
62671
 
62210
62672
  // src/registry.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robbeverhelst/do",
3
- "version": "1.418.0",
3
+ "version": "1.420.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",