@robbeverhelst/do 1.419.0 → 1.421.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 +861 -59
  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.419.0";
14423
+ var VERSION = "1.421.0";
14424
14424
  var API_PREFIX = "/api/v1";
14425
14425
  var DEFAULT_API_URL = "http://localhost:3001";
14426
14426
 
@@ -17695,12 +17695,23 @@ var agents = pgTable("agents", {
17695
17695
  gatewayConnectedAt: timestamp("gateway_connected_at", { withTimezone: true }),
17696
17696
  gatewaySeenAt: timestamp("gateway_seen_at", { withTimezone: true }),
17697
17697
  gatewayDisconnectedAt: timestamp("gateway_disconnected_at", { withTimezone: true }),
17698
+ kind: text("kind"),
17699
+ about: text("about"),
17700
+ machine: text("machine"),
17701
+ account: text("account"),
17702
+ status: text("status"),
17703
+ statusText: text("status_text"),
17704
+ statusAt: timestamp("status_at", { withTimezone: true }),
17698
17705
  createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
17699
17706
  updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
17700
17707
  }, (t) => [
17701
17708
  index("agents_tenant_idx").on(t.tenantId),
17702
- uniqueIndex("agents_tenant_name_live_idx").on(t.tenantId, sql`lower(${t.name})`).where(sql`${t.revokedAt} IS NULL`)
17709
+ uniqueIndex("agents_tenant_name_live_idx").on(t.tenantId, sql`lower(${t.name})`).where(sql`${t.revokedAt} IS NULL`),
17710
+ check2("agents_kind_chk", sql`${t.kind} IS NULL OR ${t.kind} IN ('assistant', 'agent', 'lane', 'session')`),
17711
+ check2("agents_status_chk", sql`${t.status} IS NULL OR ${t.status} IN ('working', 'waiting', 'idle')`)
17703
17712
  ]);
17713
+ var AGENT_STATUSES = ["working", "waiting", "idle"];
17714
+ var AGENT_KINDS = ["assistant", "agent", "lane", "session"];
17704
17715
 
17705
17716
  // ../../packages/schema/src/contracts/agents.ts
17706
17717
  var agentSchema = createSelectSchema(agents, {
@@ -17709,6 +17720,13 @@ var agentSchema = createSelectSchema(agents, {
17709
17720
  gatewayConnectedAt: exports_coerce.date().nullable().default(null),
17710
17721
  gatewaySeenAt: exports_coerce.date().nullable().default(null),
17711
17722
  gatewayDisconnectedAt: exports_coerce.date().nullable().default(null),
17723
+ kind: string2().nullable().default(null),
17724
+ about: string2().nullable().default(null),
17725
+ machine: string2().nullable().default(null),
17726
+ account: string2().nullable().default(null),
17727
+ status: string2().nullable().default(null),
17728
+ statusText: string2().nullable().default(null),
17729
+ statusAt: exports_coerce.date().nullable().default(null),
17712
17730
  createdAt: exports_coerce.date(),
17713
17731
  updatedAt: exports_coerce.date()
17714
17732
  });
@@ -20618,6 +20636,175 @@ var agentPostOperations = defineOperations({
20618
20636
  }
20619
20637
  });
20620
20638
 
20639
+ // ../../packages/schema/src/db/agent-chat-threads.ts
20640
+ var agentChatThreads = pgTable("agent_chat_threads", {
20641
+ id: text("id").primaryKey(),
20642
+ tenantId: text("tenant_id").notNull().references(() => tenants.id),
20643
+ userId: text("user_id").notNull().references(() => users.id, { onDelete: "cascade" }),
20644
+ title: text("title"),
20645
+ slug: text("slug"),
20646
+ standing: boolean4("standing").notNull().default(false),
20647
+ push: text("push").notNull().default("all"),
20648
+ areaIds: text("area_ids").array().notNull().default([]),
20649
+ peopleCapture: boolean4("people_capture").notNull().default(true),
20650
+ kind: text("kind"),
20651
+ anchorType: text("anchor_type"),
20652
+ anchorId: text("anchor_id"),
20653
+ parentId: text("parent_id"),
20654
+ notifyLevel: text("notify_level"),
20655
+ icon: text("icon"),
20656
+ description: text("description"),
20657
+ memoryScope: text("memory_scope"),
20658
+ lastMessageAt: timestamp("last_message_at", { withTimezone: true }),
20659
+ archivedAt: timestamp("archived_at", { withTimezone: true }),
20660
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
20661
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
20662
+ }, (t) => [
20663
+ index("agent_chat_threads_member_idx").on(t.tenantId, t.userId, t.updatedAt),
20664
+ uniqueIndex("agent_chat_threads_slug_uniq").on(t.tenantId, t.userId, t.slug).where(sql`${t.slug} is not null`)
20665
+ ]);
20666
+ var agentChatTurns = pgTable("agent_chat_turns", {
20667
+ id: text("id").primaryKey(),
20668
+ tenantId: text("tenant_id").notNull().references(() => tenants.id),
20669
+ threadId: text("thread_id").notNull().references(() => agentChatThreads.id, { onDelete: "cascade" }),
20670
+ userId: text("user_id").notNull().references(() => users.id, { onDelete: "cascade" }),
20671
+ question: text("question").notNull(),
20672
+ context: jsonb("context").$type().notNull(),
20673
+ reply: text("reply").notNull().default(""),
20674
+ status: text("status").notNull().default("streaming"),
20675
+ error: text("error"),
20676
+ since: text("since"),
20677
+ changes: jsonb("changes").$type().notNull().default([]),
20678
+ confirmations: jsonb("confirmations").$type().notNull().default([]),
20679
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
20680
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
20681
+ }, (t) => [index("agent_chat_turns_thread_idx").on(t.threadId, t.createdAt)]);
20682
+ var agentChatPosts = pgTable("agent_chat_posts", {
20683
+ id: text("id").primaryKey(),
20684
+ tenantId: text("tenant_id").notNull().references(() => tenants.id),
20685
+ threadId: text("thread_id").notNull().references(() => agentChatThreads.id, { onDelete: "cascade" }),
20686
+ userId: text("user_id").notNull().references(() => users.id, { onDelete: "cascade" }),
20687
+ author: text("author").notNull(),
20688
+ agentId: text("agent_id").references(() => agents.id),
20689
+ externalId: text("external_id"),
20690
+ kind: text("kind").notNull().default("message"),
20691
+ level: text("level"),
20692
+ text: text("text").notNull().default(""),
20693
+ final: boolean4("final").notNull().default(true),
20694
+ replyToId: text("reply_to_id"),
20695
+ relayOfPostId: text("relay_of_post_id").references(() => agentChatPosts.id, {
20696
+ onDelete: "set null"
20697
+ }),
20698
+ runStatus: text("run_status"),
20699
+ brief: jsonb("brief").$type(),
20700
+ card: jsonb("card").$type(),
20701
+ digestKey: text("digest_key"),
20702
+ title: text("title"),
20703
+ runSteps: jsonb("run_steps").$type(),
20704
+ runEndedAt: timestamp("run_ended_at", { withTimezone: true }),
20705
+ prompt: jsonb("prompt").$type(),
20706
+ receipt: jsonb("receipt").$type(),
20707
+ attachments: jsonb("attachments").$type().notNull().default([]),
20708
+ context: jsonb("context").$type(),
20709
+ deliveredAt: timestamp("delivered_at", { withTimezone: true }),
20710
+ seenAt: timestamp("seen_at", { withTimezone: true }),
20711
+ readAt: timestamp("read_at", { withTimezone: true }),
20712
+ fallbackAt: timestamp("fallback_at", { withTimezone: true }),
20713
+ fallbackAckedAt: timestamp("fallback_acked_at", { withTimezone: true }),
20714
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
20715
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
20716
+ deletedAt: timestamp("deleted_at", { withTimezone: true })
20717
+ }, (t) => [
20718
+ index("agent_chat_posts_thread_idx").on(t.threadId, t.createdAt),
20719
+ uniqueIndex("agent_chat_posts_external_uniq").on(t.tenantId, t.agentId, t.externalId).where(sql`${t.externalId} is not null`),
20720
+ index("agent_chat_posts_undelivered_idx").on(t.tenantId, t.createdAt).where(sql`${t.author} = 'member' and ${t.deliveredAt} is null`),
20721
+ 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`)
20722
+ ]);
20723
+
20724
+ // ../../packages/schema/src/db/echo-handoffs.ts
20725
+ var ECHO_HANDOFF_STATES = ["sent", "seen", "picked", "done"];
20726
+ var echoHandoffs = pgTable("echo_handoffs", {
20727
+ id: text("id").primaryKey(),
20728
+ tenantId: text("tenant_id").notNull().references(() => tenants.id),
20729
+ userId: text("user_id").notNull().references(() => users.id, { onDelete: "cascade" }),
20730
+ key: text("key").notNull(),
20731
+ fromAgentId: text("from_agent_id").notNull().references(() => agents.id),
20732
+ toAgentId: text("to_agent_id").notNull().references(() => agents.id),
20733
+ what: text("what").notNull(),
20734
+ threadId: text("thread_id").references(() => agentChatThreads.id, { onDelete: "set null" }),
20735
+ state: text("state").notNull().default("sent"),
20736
+ sentAt: timestamp("sent_at", { withTimezone: true }).notNull(),
20737
+ seenAt: timestamp("seen_at", { withTimezone: true }),
20738
+ pickedAt: timestamp("picked_at", { withTimezone: true }),
20739
+ doneAt: timestamp("done_at", { withTimezone: true }),
20740
+ nudgedAt: timestamp("nudged_at", { withTimezone: true }),
20741
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
20742
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
20743
+ }, (t) => [
20744
+ index("echo_handoffs_member_idx").on(t.tenantId, t.userId),
20745
+ uniqueIndex("echo_handoffs_key_uniq").on(t.tenantId, t.userId, t.key),
20746
+ check2("echo_handoffs_state_chk", sql`${t.state} IN ('sent', 'seen', 'picked', 'done')`)
20747
+ ]);
20748
+
20749
+ // ../../packages/schema/src/contracts/echo-agents.ts
20750
+ var agentKindSchema = _enum2(AGENT_KINDS);
20751
+ var agentStatusSchema = _enum2(AGENT_STATUSES);
20752
+ var echoHandoffStateSchema = _enum2(ECHO_HANDOFF_STATES);
20753
+ var line4 = (max) => string2().trim().min(1).max(max);
20754
+ var agentProfileInputSchema = object({
20755
+ kind: agentKindSchema.nullish(),
20756
+ about: line4(160).nullish(),
20757
+ machine: line4(40).nullish(),
20758
+ account: line4(40).nullish(),
20759
+ status: agentStatusSchema.nullish(),
20760
+ statusText: line4(160).nullish()
20761
+ }).strict().refine((v) => Object.keys(v).length > 0, "send at least one field");
20762
+ var echoThreadRefSchema = object({
20763
+ id: string2(),
20764
+ title: string2().nullable(),
20765
+ slug: string2().nullable(),
20766
+ icon: string2().nullable()
20767
+ });
20768
+ var echoAgentSchema = object({
20769
+ id: ulidSchema,
20770
+ name: string2(),
20771
+ kind: agentKindSchema.nullable(),
20772
+ about: string2().nullable(),
20773
+ machine: string2().nullable(),
20774
+ account: string2().nullable(),
20775
+ status: agentStatusSchema.nullable(),
20776
+ statusText: string2().nullable(),
20777
+ statusAt: exports_coerce.date().nullable(),
20778
+ threads: array(echoThreadRefSchema),
20779
+ createdAt: exports_coerce.date()
20780
+ });
20781
+ var echoHandoffKeySchema = string2().regex(/^[a-z0-9][a-z0-9-]{0,59}$/, "lower-case letters, digits and dashes, at most 60");
20782
+ var echoHandoffSchema = object({
20783
+ id: ulidSchema,
20784
+ key: string2(),
20785
+ from: object({ id: string2(), name: string2() }),
20786
+ to: object({ id: string2(), name: string2() }),
20787
+ what: string2(),
20788
+ thread: echoThreadRefSchema.nullable(),
20789
+ state: echoHandoffStateSchema,
20790
+ sentAt: exports_coerce.date(),
20791
+ seenAt: exports_coerce.date().nullable(),
20792
+ pickedAt: exports_coerce.date().nullable(),
20793
+ doneAt: exports_coerce.date().nullable(),
20794
+ nudgedAt: exports_coerce.date().nullable(),
20795
+ updatedAt: exports_coerce.date()
20796
+ });
20797
+ var putEchoHandoffInputSchema = object({
20798
+ from: agentNameSchema,
20799
+ to: agentNameSchema,
20800
+ what: line4(300),
20801
+ thread: line4(40).nullish(),
20802
+ state: echoHandoffStateSchema.optional(),
20803
+ at: exports_coerce.date().optional()
20804
+ }).strict();
20805
+ var reassignEchoHandoffInputSchema = object({ to: ulidSchema }).strict();
20806
+ var echoHandoffKeyParamSchema = object({ key: echoHandoffKeySchema });
20807
+
20621
20808
  // ../../packages/schema/src/operations/agents.ts
20622
20809
  var agentOperations = defineOperations({
20623
20810
  list: {
@@ -20629,6 +20816,20 @@ var agentOperations = defineOperations({
20629
20816
  description: "The Space's live Agents (`id`, `name`), oldest first, to resolve an Agent by name.",
20630
20817
  status: 200,
20631
20818
  response: { description: "The Space's Agents.", list: true }
20819
+ },
20820
+ profile: {
20821
+ method: "patch",
20822
+ path: "/agents/{id}/profile",
20823
+ pathParams: { id: "The Agent's id (`GET /agents`)." },
20824
+ pathParamSchemas: { id: ulidSchema },
20825
+ scopes: ["agents:write"],
20826
+ tag: "Agents",
20827
+ summary: "Report an agent's profile and status",
20828
+ description: "What Echo \u203A Agents shows for the agent: its `kind` (`assistant`, `agent`, `lane` or `session`), `about` (a line on what it does), the `machine` and `account` it runs on, and its `status` (`working`, `waiting` or `idle`) with `statusText`, what it's on. An agent reports its own, or Echo for the agents it relays. A field sent replaces that one, null clears it; a new status stamps `statusAt`. An unknown or revoked id is a 404.",
20829
+ body: agentProfileInputSchema,
20830
+ status: 200,
20831
+ response: { description: "The Agent." },
20832
+ errors: { 400: true, 404: true }
20632
20833
  }
20633
20834
  });
20634
20835
 
@@ -28625,6 +28826,261 @@ var documentOperations = defineOperations({
28625
28826
  }
28626
28827
  });
28627
28828
 
28829
+ // ../../packages/schema/src/operations/echo-handoffs.ts
28830
+ var NO_USER = "The key has no user identity (handoffs are per member).";
28831
+ var KEY = {
28832
+ key: {
28833
+ description: "The handoff's handle, the agent's own (`renovate-fold`): lower-case letters, digits and dashes.",
28834
+ pattern: "^[a-z0-9][a-z0-9-]{0,59}$"
28835
+ }
28836
+ };
28837
+ var KEY_SCHEMA = { key: echoHandoffKeySchema };
28838
+ var VIEW = "`{ id, key, from: { id, name }, to: { id, name }, what, thread: { id, title, slug, icon } | null, state, sentAt, seenAt, pickedAt, doneAt, nudgedAt }`";
28839
+ var echoHandoffOperations = defineOperations({
28840
+ list: {
28841
+ method: "get",
28842
+ path: "/echo/handoffs",
28843
+ scopes: ["agents:read"],
28844
+ tag: "Agents",
28845
+ summary: "List the handoffs",
28846
+ description: `The handoffs between the member's agents, the newest first: every one not done, and those done in the last day: ${VIEW}. \`nudgedAt\` says the member nudged the one it went to; a \`to\` the agent didn't set means the member gave it to someone else.`,
28847
+ status: 200,
28848
+ response: { description: "The handoffs.", list: true },
28849
+ errors: { 403: NO_USER }
28850
+ },
28851
+ put: {
28852
+ method: "put",
28853
+ path: "/echo/handoffs/{key}",
28854
+ pathParams: KEY,
28855
+ pathParamSchemas: KEY_SCHEMA,
28856
+ scopes: ["agents:write"],
28857
+ tag: "Agents",
28858
+ summary: "Declare a handoff or move it along",
28859
+ description: "Who it's `from` and `to` (Agent names), `what`, the member's standing `thread` it belongs to (by slug) and its `state`: `sent`, `seen`, `picked` or `done`. A new key starts as `sent` unless given; a new state stamps its time (`at`, default now) and clears a nudge. An unknown agent or thread is a 404.",
28860
+ body: putEchoHandoffInputSchema,
28861
+ status: 200,
28862
+ response: { description: "The handoff." },
28863
+ errors: { 400: true, 403: NO_USER, 404: "No such agent or thread." }
28864
+ },
28865
+ nudge: {
28866
+ method: "post",
28867
+ path: "/echo/handoffs/{key}/nudge",
28868
+ pathParams: KEY,
28869
+ pathParamSchemas: KEY_SCHEMA,
28870
+ scopes: ["agents:write"],
28871
+ tag: "Agents",
28872
+ summary: "Nudge the agent a handoff went to",
28873
+ description: "Stamps `nudgedAt`, which the agent reads until the handoff moves on. A handoff already picked up or done is a 409. An unknown key is a 404.",
28874
+ status: 200,
28875
+ response: { description: "The handoff." },
28876
+ errors: { 403: NO_USER, 404: true, 409: "It was picked up already." }
28877
+ },
28878
+ reassign: {
28879
+ method: "patch",
28880
+ path: "/echo/handoffs/{key}",
28881
+ pathParams: KEY,
28882
+ pathParamSchemas: KEY_SCHEMA,
28883
+ scopes: ["agents:write"],
28884
+ tag: "Agents",
28885
+ summary: "Give a handoff to another agent",
28886
+ description: "The member gives it to another of the Space's agents (`to`, its id): it starts over as `sent` to that one. A handoff already done is a 409; an unknown key or agent is a 404.",
28887
+ body: reassignEchoHandoffInputSchema,
28888
+ status: 200,
28889
+ response: { description: "The handoff." },
28890
+ errors: { 400: true, 403: NO_USER, 404: true, 409: "It's done." }
28891
+ },
28892
+ remove: {
28893
+ method: "delete",
28894
+ path: "/echo/handoffs/{key}",
28895
+ pathParams: KEY,
28896
+ pathParamSchemas: KEY_SCHEMA,
28897
+ scopes: ["agents:write"],
28898
+ tag: "Agents",
28899
+ summary: "Remove a handoff",
28900
+ description: "The agent drops the handoff. An unknown key is a 404.",
28901
+ status: 204,
28902
+ response: { description: "Removed." },
28903
+ errors: { 403: NO_USER, 404: true }
28904
+ }
28905
+ });
28906
+
28907
+ // ../../packages/schema/src/db/echo-schedules.ts
28908
+ var ECHO_SCHEDULE_LEVELS = ["now", "today", "digest", "silent"];
28909
+ var ECHO_SCHEDULE_RUN_STATUSES = ["ok", "failed", "unanswered"];
28910
+ var echoSchedules = pgTable("echo_schedules", {
28911
+ id: text("id").primaryKey(),
28912
+ tenantId: text("tenant_id").notNull().references(() => tenants.id),
28913
+ userId: text("user_id").notNull().references(() => users.id, { onDelete: "cascade" }),
28914
+ key: text("key").notNull(),
28915
+ name: text("name").notNull(),
28916
+ threadId: text("thread_id").notNull().references(() => agentChatThreads.id, { onDelete: "cascade" }),
28917
+ agentId: text("agent_id").references(() => agents.id),
28918
+ desk: text("desk"),
28919
+ times: text("times").array().notNull(),
28920
+ everyMinutes: integer2("every_minutes"),
28921
+ weekdays: integer2("weekdays").array().notNull().default([]),
28922
+ level: text("level").notNull().default("today"),
28923
+ levelNote: text("level_note"),
28924
+ pausedAt: timestamp("paused_at", { withTimezone: true }),
28925
+ runRequestedAt: timestamp("run_requested_at", { withTimezone: true }),
28926
+ lastRunAt: timestamp("last_run_at", { withTimezone: true }),
28927
+ lastStatus: text("last_status"),
28928
+ lastNote: text("last_note"),
28929
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
28930
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
28931
+ }, (t) => [
28932
+ index("echo_schedules_member_idx").on(t.tenantId, t.userId),
28933
+ uniqueIndex("echo_schedules_key_uniq").on(t.tenantId, t.userId, t.key),
28934
+ check2("echo_schedules_level_chk", sql`${t.level} IN ('now', 'today', 'digest', 'silent')`),
28935
+ check2("echo_schedules_last_status_chk", sql`${t.lastStatus} IS NULL OR ${t.lastStatus} IN ('ok', 'failed', 'unanswered')`)
28936
+ ]);
28937
+
28938
+ // ../../packages/schema/src/contracts/echo-schedules.ts
28939
+ var echoScheduleLevelSchema = _enum2(ECHO_SCHEDULE_LEVELS);
28940
+ var echoScheduleRunStatusSchema = _enum2(ECHO_SCHEDULE_RUN_STATUSES);
28941
+ var clock = string2().regex(/^([01]\d|2[0-3]):[0-5]\d$/, "a time as HH:MM");
28942
+ var echoScheduleKeySchema = string2().regex(/^[a-z0-9][a-z0-9-]{0,39}$/, "lower-case letters, digits and dashes, at most 40");
28943
+ var times = array(clock).min(1).max(12);
28944
+ var weekdays = array(number2().int().min(1).max(7)).max(7).refine((d) => new Set(d).size === d.length, "each weekday once");
28945
+ var everyMinutes = number2().int().min(15).max(10080);
28946
+ var echoScheduleSchema = object({
28947
+ id: ulidSchema,
28948
+ key: string2(),
28949
+ name: string2(),
28950
+ thread: object({
28951
+ id: string2(),
28952
+ title: string2().nullable(),
28953
+ slug: string2().nullable(),
28954
+ icon: string2().nullable()
28955
+ }),
28956
+ agentId: string2().nullable(),
28957
+ desk: string2().nullable(),
28958
+ times: array(string2()),
28959
+ everyMinutes: number2().int().nullable(),
28960
+ weekdays: array(number2().int()),
28961
+ level: echoScheduleLevelSchema,
28962
+ levelNote: string2().nullable(),
28963
+ paused: boolean2(),
28964
+ runRequested: boolean2(),
28965
+ lastRunAt: exports_coerce.date().nullable(),
28966
+ lastStatus: echoScheduleRunStatusSchema.nullable(),
28967
+ lastNote: string2().nullable(),
28968
+ createdAt: exports_coerce.date(),
28969
+ updatedAt: exports_coerce.date()
28970
+ });
28971
+ var putEchoScheduleInputSchema = object({
28972
+ name: string2().trim().min(1).max(80),
28973
+ thread: string2().trim().min(1).max(40),
28974
+ desk: string2().trim().min(1).max(40).nullish(),
28975
+ times,
28976
+ everyMinutes: everyMinutes.nullish(),
28977
+ weekdays: weekdays.optional(),
28978
+ level: echoScheduleLevelSchema.optional(),
28979
+ levelNote: string2().trim().min(1).max(120).nullish()
28980
+ }).strict();
28981
+ var updateEchoScheduleInputSchema = object({
28982
+ level: echoScheduleLevelSchema.optional(),
28983
+ paused: boolean2().optional()
28984
+ }).strict().refine((v) => v.level !== undefined || v.paused !== undefined, "level or paused");
28985
+ var reportEchoScheduleRunInputSchema = object({
28986
+ status: echoScheduleRunStatusSchema,
28987
+ note: string2().trim().min(1).max(200).nullish(),
28988
+ at: exports_coerce.date().optional()
28989
+ }).strict();
28990
+ var echoScheduleKeyParamSchema = object({ key: echoScheduleKeySchema });
28991
+
28992
+ // ../../packages/schema/src/operations/echo-schedules.ts
28993
+ var NO_USER2 = "The key has no user identity (scheduled posts are per member).";
28994
+ var KEY2 = {
28995
+ key: {
28996
+ description: "The job's handle, the agent's own (`wake`, `pings`): lower-case letters, digits and dashes.",
28997
+ pattern: "^[a-z0-9][a-z0-9-]{0,39}$"
28998
+ }
28999
+ };
29000
+ var KEY_SCHEMA2 = { key: echoScheduleKeySchema };
29001
+ var VIEW2 = "`{ id, key, name, thread: { id, title, slug, icon }, agentId, desk, times, everyMinutes, weekdays, level, levelNote, paused, runRequested, lastRunAt, lastStatus, lastNote }`";
29002
+ var echoScheduleOperations = defineOperations({
29003
+ list: {
29004
+ method: "get",
29005
+ path: "/echo/schedules",
29006
+ scopes: ["agents:read"],
29007
+ tag: "Agents",
29008
+ summary: "List the scheduled posts",
29009
+ description: `Every job that posts into the member's threads on a clock, by name: ${VIEW2}. \`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.`,
29010
+ status: 200,
29011
+ response: { description: "The scheduled posts.", list: true },
29012
+ errors: { 403: NO_USER2 }
29013
+ },
29014
+ put: {
29015
+ method: "put",
29016
+ path: "/echo/schedules/{key}",
29017
+ pathParams: KEY2,
29018
+ pathParamSchemas: KEY_SCHEMA2,
29019
+ scopes: ["agents:write"],
29020
+ tag: "Agents",
29021
+ summary: "Declare a scheduled post",
29022
+ 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.",
29023
+ body: putEchoScheduleInputSchema,
29024
+ status: 200,
29025
+ response: { description: "The scheduled post." },
29026
+ errors: { 400: true, 403: NO_USER2, 404: "No such thread." }
29027
+ },
29028
+ update: {
29029
+ method: "patch",
29030
+ path: "/echo/schedules/{key}",
29031
+ pathParams: KEY2,
29032
+ pathParamSchemas: KEY_SCHEMA2,
29033
+ scopes: ["agents:write"],
29034
+ tag: "Agents",
29035
+ summary: "Change a scheduled post's level or pause it",
29036
+ description: "How its posts land (`level`: `now`, `today`, `digest` or `silent`) and whether it runs (`paused`). An unknown key is a 404.",
29037
+ body: updateEchoScheduleInputSchema,
29038
+ status: 200,
29039
+ response: { description: "The scheduled post." },
29040
+ errors: { 400: true, 403: NO_USER2, 404: true }
29041
+ },
29042
+ runNow: {
29043
+ method: "post",
29044
+ path: "/echo/schedules/{key}/run",
29045
+ pathParams: KEY2,
29046
+ pathParamSchemas: KEY_SCHEMA2,
29047
+ scopes: ["agents:write"],
29048
+ tag: "Agents",
29049
+ summary: "Ask for a scheduled post now",
29050
+ 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.",
29051
+ status: 200,
29052
+ response: { description: "The scheduled post." },
29053
+ errors: { 403: NO_USER2, 404: true, 409: "The job is paused." }
29054
+ },
29055
+ report: {
29056
+ method: "post",
29057
+ path: "/echo/schedules/{key}/runs",
29058
+ pathParams: KEY2,
29059
+ pathParamSchemas: KEY_SCHEMA2,
29060
+ scopes: ["agents:write"],
29061
+ tag: "Agents",
29062
+ summary: "Report a scheduled post's run",
29063
+ 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.",
29064
+ body: reportEchoScheduleRunInputSchema,
29065
+ status: 200,
29066
+ response: { description: "The scheduled post." },
29067
+ errors: { 400: true, 403: NO_USER2, 404: true }
29068
+ },
29069
+ remove: {
29070
+ method: "delete",
29071
+ path: "/echo/schedules/{key}",
29072
+ pathParams: KEY2,
29073
+ pathParamSchemas: KEY_SCHEMA2,
29074
+ scopes: ["agents:write"],
29075
+ tag: "Agents",
29076
+ summary: "Remove a scheduled post",
29077
+ description: "The agent no longer runs the job. An unknown key is a 404.",
29078
+ status: 204,
29079
+ response: { description: "Removed." },
29080
+ errors: { 403: NO_USER2, 404: true }
29081
+ }
29082
+ });
29083
+
28628
29084
  // ../../packages/schema/src/contracts/echo-threads.ts
28629
29085
  var echoTurnStatusSchema = _enum2(["streaming", "done", "error", "cancelled"]);
28630
29086
  var echoTurnConfirmationSchema = agentConfirmationSchema.extend({
@@ -28825,7 +29281,7 @@ var createEchoThreadInputSchema = object({
28825
29281
  }).strict();
28826
29282
 
28827
29283
  // ../../packages/schema/src/operations/echo-threads.ts
28828
- var NO_USER = "The key has no user identity (threads are per member).";
29284
+ var NO_USER3 = "The key has no user identity (threads are per member).";
28829
29285
  var echoThreadOperations = defineOperations({
28830
29286
  list: {
28831
29287
  method: "get",
@@ -28846,7 +29302,7 @@ var echoThreadOperations = defineOperations({
28846
29302
  querySchema: echoThreadsQuerySchema,
28847
29303
  status: 200,
28848
29304
  response: { description: "The member's threads.", list: true },
28849
- errors: { 400: true, 403: NO_USER }
29305
+ errors: { 400: true, 403: NO_USER3 }
28850
29306
  },
28851
29307
  create: {
28852
29308
  method: "post",
@@ -28859,7 +29315,7 @@ var echoThreadOperations = defineOperations({
28859
29315
  bodyOptional: true,
28860
29316
  status: 201,
28861
29317
  response: { description: "The new current thread." },
28862
- errors: { 403: NO_USER }
29318
+ errors: { 403: NO_USER3 }
28863
29319
  },
28864
29320
  current: {
28865
29321
  method: "get",
@@ -28870,7 +29326,7 @@ var echoThreadOperations = defineOperations({
28870
29326
  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
29327
  status: 200,
28872
29328
  response: { description: "`{ thread }`." },
28873
- errors: { 403: NO_USER }
29329
+ errors: { 403: NO_USER3 }
28874
29330
  },
28875
29331
  briefs: {
28876
29332
  method: "get",
@@ -28890,7 +29346,7 @@ var echoThreadOperations = defineOperations({
28890
29346
  querySchema: echoBriefsQuerySchema,
28891
29347
  status: 200,
28892
29348
  response: { description: "`{ briefs }`." },
28893
- errors: { 400: true, 403: NO_USER }
29349
+ errors: { 400: true, 403: NO_USER3 }
28894
29350
  },
28895
29351
  get: {
28896
29352
  method: "get",
@@ -28901,7 +29357,7 @@ var echoThreadOperations = defineOperations({
28901
29357
  description: "One of the member's threads with its turns, oldest first. Another member's thread is a 404.",
28902
29358
  status: 200,
28903
29359
  response: { description: "The thread." },
28904
- errors: { 403: NO_USER, 404: true }
29360
+ errors: { 403: NO_USER3, 404: true }
28905
29361
  },
28906
29362
  update: {
28907
29363
  method: "patch",
@@ -28913,7 +29369,7 @@ var echoThreadOperations = defineOperations({
28913
29369
  body: updateEchoThreadInputSchema,
28914
29370
  status: 200,
28915
29371
  response: { description: "The thread as the list shows it, with its `push`." },
28916
- errors: { 400: true, 403: NO_USER, 404: true }
29372
+ errors: { 400: true, 403: NO_USER3, 404: true }
28917
29373
  },
28918
29374
  addStanding: {
28919
29375
  method: "post",
@@ -28925,7 +29381,7 @@ var echoThreadOperations = defineOperations({
28925
29381
  body: createStandingThreadInputSchema,
28926
29382
  status: 201,
28927
29383
  response: { description: "The standing thread." },
28928
- errors: { 400: true, 403: NO_USER, 409: true }
29384
+ errors: { 400: true, 403: NO_USER3, 409: true }
28929
29385
  }
28930
29386
  });
28931
29387
 
@@ -44640,7 +45096,7 @@ var PART_LABEL = {
44640
45096
  evening: "Evening",
44641
45097
  anytime: "Any time today"
44642
45098
  };
44643
- function clock(at, timezone) {
45099
+ function clock2(at, timezone) {
44644
45100
  return new Intl.DateTimeFormat("en-GB", {
44645
45101
  timeZone: timezone,
44646
45102
  hour: "2-digit",
@@ -44671,7 +45127,7 @@ function habitLines(day, mode) {
44671
45127
  if (h.week)
44672
45128
  meta.push(`${h.week.done} of ${h.week.target} this week`);
44673
45129
  if (h.last?.by && civilDay(h.last.at, day.timezone) === day.date) {
44674
- meta.push(`${h.last.by}, ${clock(h.last.at, day.timezone)}`);
45130
+ meta.push(`${h.last.by}, ${clock2(h.last.at, day.timezone)}`);
44675
45131
  }
44676
45132
  const tail = meta.length > 0 ? paint(mode, "dim", ` \xB7 ${meta.join(" \xB7 ")}`) : "";
44677
45133
  lines.push(` ${mark} ${h.title}${tail} ${paint(mode, "dim", h.habitId)}`);
@@ -46284,6 +46740,41 @@ var commands = [
46284
46740
  },
46285
46741
  run: readOperation(agentOperations.list, renderList, {}, { paged: true })
46286
46742
  },
46743
+ {
46744
+ spec: {
46745
+ path: ["agents", "profile"],
46746
+ summary: "Report an agent's profile and status for Echo \u203A Agents (its own, or one Echo relays).",
46747
+ args: [{ name: "agent", required: true, description: "The Agent: its id or name." }],
46748
+ flags: [
46749
+ { name: "kind", type: "string", description: "assistant, agent, lane or session." },
46750
+ { name: "about", type: "string", description: "A line on what it does." },
46751
+ { name: "machine", type: "string", description: "The machine it runs on." },
46752
+ { name: "account", type: "string", description: "The account it runs on." },
46753
+ { name: "status", type: "string", description: "working, waiting or idle." },
46754
+ { name: "on", type: "string", description: "What it's on (Deploying v1.365)." }
46755
+ ],
46756
+ scopes: [...agentOperations.profile.scopes],
46757
+ returns: "Agent",
46758
+ notes: "Only the fields sent change; a status or what it's on stamps statusAt."
46759
+ },
46760
+ run: async ({ args, flags, requireClient }) => {
46761
+ const client = requireClient();
46762
+ const sent = Object.entries({
46763
+ kind: flagString(flags, "kind"),
46764
+ about: flagString(flags, "about"),
46765
+ machine: flagString(flags, "machine"),
46766
+ account: flagString(flags, "account"),
46767
+ status: flagString(flags, "status"),
46768
+ statusText: flagString(flags, "on")
46769
+ }).filter(([, v]) => v !== undefined);
46770
+ const body = parseInput(agentProfileInputSchema, Object.fromEntries(sent));
46771
+ const id = await resolveAgentId(client, requireArg(args, 0, "agent"));
46772
+ return {
46773
+ data: await client.patch(pathOf(agentOperations.profile, { id }), body),
46774
+ render: renderRecord
46775
+ };
46776
+ }
46777
+ },
46287
46778
  {
46288
46779
  spec: {
46289
46780
  path: ["agent", "connection", "get"],
@@ -50412,10 +50903,319 @@ var commands16 = [
50412
50903
  }
50413
50904
  ];
50414
50905
 
50906
+ // src/commands/echo-handoffs.ts
50907
+ var STATES = ["sent", "seen", "picked", "done"];
50908
+ var KEY_ARG = {
50909
+ name: "key",
50910
+ required: true,
50911
+ description: "The handoff's handle (`renovate-fold`): lower-case letters, digits and dashes."
50912
+ };
50913
+ var keyPath = (op, args) => pathOf(op, { key: requireArg(args, 0, "handoff key") });
50914
+ var commands17 = [
50915
+ {
50916
+ spec: {
50917
+ path: ["echo", "handoffs", "list"],
50918
+ summary: "List the handoffs between your agents: every one not done, and today's done.",
50919
+ args: [],
50920
+ flags: [],
50921
+ scopes: [...echoHandoffOperations.list.scopes],
50922
+ returns: "EchoHandoff[]",
50923
+ notes: "nudgedAt says you nudged the one it went to."
50924
+ },
50925
+ run: async ({ requireClient }) => ({
50926
+ data: await requireClient().getPage(pathOf(echoHandoffOperations.list)),
50927
+ render: renderList
50928
+ })
50929
+ },
50930
+ {
50931
+ spec: {
50932
+ path: ["echo", "handoffs", "set"],
50933
+ summary: "Declare a handoff, or move it along (the agent's): a new key starts it as sent.",
50934
+ args: [KEY_ARG],
50935
+ flags: [
50936
+ { name: "from", type: "string", description: "The agent handing it over, by name." },
50937
+ { name: "to", type: "string", description: "The agent it goes to, by name." },
50938
+ { name: "what", type: "string", description: "What's handed over." },
50939
+ { name: "thread", type: "string", description: "The standing thread it belongs to." },
50940
+ { name: "state", type: "string", description: "sent, seen, picked or done." },
50941
+ { name: "at", type: "string", description: "When it got there (ISO); default now." }
50942
+ ],
50943
+ scopes: [...echoHandoffOperations.put.scopes],
50944
+ returns: "EchoHandoff",
50945
+ notes: "A new state stamps its time and clears a nudge. An unknown agent or thread is a 404."
50946
+ },
50947
+ run: async ({ args, flags, requireClient }) => {
50948
+ const from = flagString(flags, "from");
50949
+ const to = flagString(flags, "to");
50950
+ const what = flagString(flags, "what");
50951
+ if (!from || !to || !what)
50952
+ throw usageError("--from, --to and --what are required");
50953
+ const thread = flagString(flags, "thread");
50954
+ const state = flagString(flags, "state");
50955
+ const at = flagString(flags, "at");
50956
+ if (state && !STATES.includes(state))
50957
+ throw usageError(`--state is one of ${STATES.join(", ")}`);
50958
+ return {
50959
+ data: await requireClient().put(keyPath(echoHandoffOperations.put, args), {
50960
+ from,
50961
+ to,
50962
+ what,
50963
+ ...thread ? { thread } : {},
50964
+ ...state ? { state } : {},
50965
+ ...at ? { at } : {}
50966
+ }),
50967
+ render: renderRecord
50968
+ };
50969
+ }
50970
+ },
50971
+ {
50972
+ spec: {
50973
+ path: ["echo", "handoffs", "nudge"],
50974
+ summary: "Nudge the agent a handoff went to.",
50975
+ args: [KEY_ARG],
50976
+ flags: [],
50977
+ scopes: [...echoHandoffOperations.nudge.scopes],
50978
+ returns: "EchoHandoff",
50979
+ notes: "One picked up or done already is a 409."
50980
+ },
50981
+ run: async ({ args, requireClient }) => ({
50982
+ data: await requireClient().post(keyPath(echoHandoffOperations.nudge, args), {}),
50983
+ render: renderRecord
50984
+ })
50985
+ },
50986
+ {
50987
+ spec: {
50988
+ path: ["echo", "handoffs", "give"],
50989
+ summary: "Give a handoff to another agent: it starts over as sent to them.",
50990
+ args: [KEY_ARG, { name: "to", required: true, description: "The agent's id." }],
50991
+ flags: [],
50992
+ scopes: [...echoHandoffOperations.reassign.scopes],
50993
+ returns: "EchoHandoff",
50994
+ notes: "One done already is a 409. See `do agents list` for the ids."
50995
+ },
50996
+ run: async ({ args, requireClient }) => ({
50997
+ data: await requireClient().patch(keyPath(echoHandoffOperations.reassign, args), {
50998
+ to: requireArg(args, 1, "agent id")
50999
+ }),
51000
+ render: renderRecord
51001
+ })
51002
+ },
51003
+ {
51004
+ spec: {
51005
+ path: ["echo", "handoffs", "rm"],
51006
+ summary: "Remove a handoff (the agent drops it).",
51007
+ args: [KEY_ARG],
51008
+ flags: [],
51009
+ scopes: [...echoHandoffOperations.remove.scopes],
51010
+ returns: "nothing",
51011
+ notes: "An unknown key is a 404."
51012
+ },
51013
+ run: async ({ args, requireClient }) => {
51014
+ await requireClient().delete(keyPath(echoHandoffOperations.remove, args));
51015
+ return { data: { removed: requireArg(args, 0, "handoff key") }, render: renderRecord };
51016
+ }
51017
+ }
51018
+ ];
51019
+
51020
+ // src/commands/echo-schedules.ts
51021
+ var LEVELS = ["now", "today", "digest", "silent"];
51022
+ var STATUSES = ["ok", "failed", "unanswered"];
51023
+ var DAYS = ["mon", "tue", "wed", "thu", "fri", "sat", "sun"];
51024
+ var KEY_ARG2 = {
51025
+ name: "key",
51026
+ required: true,
51027
+ description: "The job's handle (`wake`, `pings`): lower-case letters, digits and dashes."
51028
+ };
51029
+ function oneOf(value, allowed, what) {
51030
+ if (!allowed.includes(value))
51031
+ throw usageError(`${what} is one of ${allowed.join(", ")}`);
51032
+ return value;
51033
+ }
51034
+ function weekdaysOf(days) {
51035
+ return days.split(",").map((d) => {
51036
+ const i = DAYS.indexOf(d.trim().toLowerCase().slice(0, 3));
51037
+ if (i < 0)
51038
+ throw usageError(`--days takes mon,tue,\u2026,sun; got "${d}"`);
51039
+ return i + 1;
51040
+ });
51041
+ }
51042
+ var keyPath2 = (op, args) => pathOf(op, { key: requireArg(args, 0, "job key") });
51043
+ var commands18 = [
51044
+ {
51045
+ spec: {
51046
+ path: ["echo", "schedules", "list"],
51047
+ summary: "List your scheduled posts: the agent's jobs on a clock, by name.",
51048
+ args: [],
51049
+ flags: [],
51050
+ scopes: [...echoScheduleOperations.list.scopes],
51051
+ returns: "EchoSchedule[]",
51052
+ 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."
51053
+ },
51054
+ run: async ({ requireClient }) => ({
51055
+ data: await requireClient().getPage(pathOf(echoScheduleOperations.list)),
51056
+ render: renderList
51057
+ })
51058
+ },
51059
+ {
51060
+ spec: {
51061
+ path: ["echo", "schedules", "set"],
51062
+ summary: "Declare a scheduled post (the agent's): a new key makes it, a known key updates it.",
51063
+ args: [KEY_ARG2],
51064
+ flags: [
51065
+ { name: "name", type: "string", description: "What it's called (Wake message)." },
51066
+ {
51067
+ name: "thread",
51068
+ type: "string",
51069
+ description: "The standing thread it posts to, by slug."
51070
+ },
51071
+ { name: "at", type: "string", description: "When, HH:MM, comma-separated (07:00,16:30)." },
51072
+ {
51073
+ name: "every",
51074
+ type: "string",
51075
+ description: "Repeat every N minutes from the first time."
51076
+ },
51077
+ { name: "days", type: "string", description: "Only on these days: mon,tue,\u2026,sun." },
51078
+ { name: "desk", type: "string", description: "The desk that runs it (build)." },
51079
+ {
51080
+ name: "level",
51081
+ type: "string",
51082
+ description: "A new job's level: now, today, digest or silent."
51083
+ },
51084
+ {
51085
+ name: "note",
51086
+ type: "string",
51087
+ description: "A word on the level (Now only on an incident)."
51088
+ }
51089
+ ],
51090
+ scopes: [...echoScheduleOperations.put.scopes],
51091
+ returns: "EchoSchedule",
51092
+ notes: "A redeclare keeps your level and pause. An unknown thread is a 404."
51093
+ },
51094
+ run: async ({ args, flags, requireClient }) => {
51095
+ const name = flagString(flags, "name");
51096
+ const thread = flagString(flags, "thread");
51097
+ const at = flagString(flags, "at");
51098
+ if (!name || !thread || !at)
51099
+ throw usageError("--name, --thread and --at are required");
51100
+ const every = flagString(flags, "every");
51101
+ const days = flagString(flags, "days");
51102
+ const desk = flagString(flags, "desk");
51103
+ const level = flagString(flags, "level");
51104
+ const note = flagString(flags, "note");
51105
+ return {
51106
+ data: await requireClient().put(keyPath2(echoScheduleOperations.put, args), {
51107
+ name,
51108
+ thread,
51109
+ times: at.split(",").map((t) => t.trim()),
51110
+ ...every ? { everyMinutes: Number(every) } : {},
51111
+ ...days ? { weekdays: weekdaysOf(days) } : {},
51112
+ ...desk ? { desk } : {},
51113
+ ...level ? { level: oneOf(level, LEVELS, "--level") } : {},
51114
+ ...note ? { levelNote: note } : {}
51115
+ }),
51116
+ render: renderRecord
51117
+ };
51118
+ }
51119
+ },
51120
+ {
51121
+ spec: {
51122
+ path: ["echo", "schedules", "level"],
51123
+ summary: "Set how a scheduled post lands: now, today, digest or silent.",
51124
+ args: [
51125
+ KEY_ARG2,
51126
+ { name: "level", required: true, description: "now, today, digest or silent." }
51127
+ ],
51128
+ flags: [],
51129
+ scopes: [...echoScheduleOperations.update.scopes],
51130
+ returns: "EchoSchedule",
51131
+ notes: "now pushes; today is a card in its thread; digest folds into one line; silent stays in its history."
51132
+ },
51133
+ run: async ({ args, requireClient }) => ({
51134
+ data: await requireClient().patch(keyPath2(echoScheduleOperations.update, args), {
51135
+ level: oneOf(requireArg(args, 1, "level"), LEVELS, "level")
51136
+ }),
51137
+ render: renderRecord
51138
+ })
51139
+ },
51140
+ ...["pause", "resume"].map((verb) => ({
51141
+ spec: {
51142
+ path: ["echo", "schedules", verb],
51143
+ summary: verb === "pause" ? "Pause a scheduled post: the agent skips it." : "Resume a paused scheduled post.",
51144
+ args: [KEY_ARG2],
51145
+ flags: [],
51146
+ scopes: [...echoScheduleOperations.update.scopes],
51147
+ returns: "EchoSchedule",
51148
+ notes: "An unknown key is a 404."
51149
+ },
51150
+ run: async ({ args, requireClient }) => ({
51151
+ data: await requireClient().patch(keyPath2(echoScheduleOperations.update, args), {
51152
+ paused: verb === "pause"
51153
+ }),
51154
+ render: renderRecord
51155
+ })
51156
+ })),
51157
+ {
51158
+ spec: {
51159
+ path: ["echo", "schedules", "run"],
51160
+ summary: "Ask the agent to run a scheduled post now.",
51161
+ args: [KEY_ARG2],
51162
+ flags: [],
51163
+ scopes: [...echoScheduleOperations.runNow.scopes],
51164
+ returns: "EchoSchedule",
51165
+ notes: "The job reads runRequested until the agent reports a run. A paused job is a 409."
51166
+ },
51167
+ run: async ({ args, requireClient }) => ({
51168
+ data: await requireClient().post(keyPath2(echoScheduleOperations.runNow, args), {}),
51169
+ render: renderRecord
51170
+ })
51171
+ },
51172
+ {
51173
+ spec: {
51174
+ path: ["echo", "schedules", "ran"],
51175
+ summary: "Report a scheduled post's run (the agent's): ok, failed or unanswered.",
51176
+ args: [KEY_ARG2, { name: "status", required: true, description: "ok, failed or unanswered." }],
51177
+ flags: [
51178
+ { name: "note", type: "string", description: "A word on the run (2 differences)." },
51179
+ { name: "at", type: "string", description: "When it ran (ISO); default now." }
51180
+ ],
51181
+ scopes: [...echoScheduleOperations.report.scopes],
51182
+ returns: "EchoSchedule",
51183
+ notes: "Clears a run asked for."
51184
+ },
51185
+ run: async ({ args, flags, requireClient }) => {
51186
+ const note = flagString(flags, "note");
51187
+ const at = flagString(flags, "at");
51188
+ return {
51189
+ data: await requireClient().post(keyPath2(echoScheduleOperations.report, args), {
51190
+ status: oneOf(requireArg(args, 1, "status"), STATUSES, "status"),
51191
+ ...note ? { note } : {},
51192
+ ...at ? { at } : {}
51193
+ }),
51194
+ render: renderRecord
51195
+ };
51196
+ }
51197
+ },
51198
+ {
51199
+ spec: {
51200
+ path: ["echo", "schedules", "rm"],
51201
+ summary: "Remove a scheduled post (the agent no longer runs it).",
51202
+ args: [KEY_ARG2],
51203
+ flags: [],
51204
+ scopes: [...echoScheduleOperations.remove.scopes],
51205
+ returns: "nothing",
51206
+ notes: "An unknown key is a 404."
51207
+ },
51208
+ run: async ({ args, requireClient }) => {
51209
+ await requireClient().delete(keyPath2(echoScheduleOperations.remove, args));
51210
+ return { data: { removed: requireArg(args, 0, "job key") }, render: renderRecord };
51211
+ }
51212
+ }
51213
+ ];
51214
+
50415
51215
  // src/commands/files.ts
50416
51216
  import { readFileSync as readFileSync5, writeFileSync as writeFileSync2 } from "fs";
50417
51217
  import { basename as basename2 } from "path";
50418
- var commands17 = [
51218
+ var commands19 = [
50419
51219
  {
50420
51220
  spec: {
50421
51221
  path: ["files", "list"],
@@ -50585,7 +51385,7 @@ var commands17 = [
50585
51385
  ];
50586
51386
 
50587
51387
  // src/commands/food.ts
50588
- var commands18 = [
51388
+ var commands20 = [
50589
51389
  {
50590
51390
  spec: {
50591
51391
  path: ["foods", "search"],
@@ -51140,7 +51940,7 @@ var commands18 = [
51140
51940
  // src/commands/guest-lists.ts
51141
51941
  import { writeFileSync as writeFileSync3 } from "fs";
51142
51942
  import { basename as basename3 } from "path";
51143
- var commands19 = [
51943
+ var commands21 = [
51144
51944
  {
51145
51945
  spec: {
51146
51946
  path: ["guest-lists", "overview"],
@@ -51230,7 +52030,7 @@ var commands19 = [
51230
52030
  ];
51231
52031
 
51232
52032
  // src/commands/guests.ts
51233
- var commands20 = [
52033
+ var commands22 = [
51234
52034
  {
51235
52035
  spec: {
51236
52036
  path: ["guests", "sent"],
@@ -51315,7 +52115,7 @@ function renderItems(data, mode) {
51315
52115
  var habitArg = { name: "id", required: true, description: "The checklist habit's ULID." };
51316
52116
  var itemArg = { name: "item-id", required: true, description: "The item's ULID." };
51317
52117
  var NOT_CHECKLIST = "A habit that isn't a checklist answers 409.";
51318
- var commands21 = [
52118
+ var commands23 = [
51319
52119
  {
51320
52120
  spec: {
51321
52121
  path: ["habit", "items"],
@@ -51669,7 +52469,7 @@ function seasonFromFlags(flags) {
51669
52469
  const season = flagString(flags, "season");
51670
52470
  return season === undefined ? {} : { activeMonths: seasonFromFlag(season) };
51671
52471
  }
51672
- var commands22 = [
52472
+ var commands24 = [
51673
52473
  {
51674
52474
  spec: {
51675
52475
  path: ["habits", "create"],
@@ -52918,7 +53718,7 @@ function healthRecordHandlers() {
52918
53718
  }
52919
53719
  return out;
52920
53720
  }
52921
- var commands23 = pairCommands(HEALTH_COMMAND_SPECS, {
53721
+ var commands25 = pairCommands(HEALTH_COMMAND_SPECS, {
52922
53722
  ...healthRecordHandlers(),
52923
53723
  "health record": async ({ flags, requireClient }) => {
52924
53724
  const body = parseInput(logHealthInputSchema, readDataFlag(flags));
@@ -53233,7 +54033,7 @@ var commands23 = pairCommands(HEALTH_COMMAND_SPECS, {
53233
54033
  });
53234
54034
 
53235
54035
  // src/commands/house.ts
53236
- var commands24 = [
54036
+ var commands26 = [
53237
54037
  {
53238
54038
  spec: {
53239
54039
  path: ["house"],
@@ -53515,7 +54315,7 @@ function renderSorting(data, _mode) {
53515
54315
  ].join(`
53516
54316
  `);
53517
54317
  }
53518
- var commands25 = [
54318
+ var commands27 = [
53519
54319
  defineCommand({
53520
54320
  operation: inboxOperations.list,
53521
54321
  path: ["inbox"],
@@ -53607,7 +54407,7 @@ var commands25 = [
53607
54407
  ];
53608
54408
 
53609
54409
  // src/commands/incidents.ts
53610
- var commands26 = [
54410
+ var commands28 = [
53611
54411
  {
53612
54412
  spec: {
53613
54413
  path: ["incidents", "open"],
@@ -53836,7 +54636,7 @@ function journalDateArg(args, verb) {
53836
54636
  }
53837
54637
  return date;
53838
54638
  }
53839
- var commands27 = [
54639
+ var commands29 = [
53840
54640
  defineCommand({
53841
54641
  operation: journalOperations.day,
53842
54642
  path: ["journal", "day"],
@@ -54399,7 +55199,7 @@ function renderCreatedKey(data, mode) {
54399
55199
  ].join(`
54400
55200
  `);
54401
55201
  }
54402
- var commands28 = [
55202
+ var commands30 = [
54403
55203
  {
54404
55204
  spec: {
54405
55205
  path: ["keys", "list"],
@@ -54535,7 +55335,7 @@ var KIND_FLAG2 = {
54535
55335
  type: "string",
54536
55336
  description: "The kind of an unknown word (pages, eggs, health, note, or a word taught before); remembered for the Space."
54537
55337
  };
54538
- var commands29 = [
55338
+ var commands31 = [
54539
55339
  {
54540
55340
  spec: {
54541
55341
  path: ["log"],
@@ -54610,7 +55410,7 @@ var commands29 = [
54610
55410
  ];
54611
55411
 
54612
55412
  // src/commands/mail-campaigns.ts
54613
- var commands30 = [
55413
+ var commands32 = [
54614
55414
  {
54615
55415
  spec: {
54616
55416
  path: ["mail-campaigns", "list"],
@@ -54925,7 +55725,7 @@ async function serveMcp(io, target) {
54925
55725
  }
54926
55726
 
54927
55727
  // src/commands/mcp.ts
54928
- var commands31 = [
55728
+ var commands33 = [
54929
55729
  {
54930
55730
  spec: {
54931
55731
  path: ["mcp"],
@@ -54970,7 +55770,7 @@ var commands31 = [
54970
55770
  ];
54971
55771
 
54972
55772
  // src/commands/members.ts
54973
- var commands32 = [
55773
+ var commands34 = [
54974
55774
  {
54975
55775
  spec: {
54976
55776
  path: ["invite", "create"],
@@ -55095,7 +55895,7 @@ var commands32 = [
55095
55895
  ];
55096
55896
 
55097
55897
  // src/commands/metrics.ts
55098
- var commands33 = [
55898
+ var commands35 = [
55099
55899
  {
55100
55900
  spec: {
55101
55901
  path: ["metrics", "list"],
@@ -55223,7 +56023,7 @@ async function setModuleVisibility(args, requireClient, on) {
55223
56023
  render: renderRecord
55224
56024
  };
55225
56025
  }
55226
- var commands34 = [
56026
+ var commands36 = [
55227
56027
  {
55228
56028
  spec: {
55229
56029
  path: ["modules", "list"],
@@ -55452,7 +56252,7 @@ function shareFlag(flags) {
55452
56252
  function localMonth(now) {
55453
56253
  return `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, "0")}`;
55454
56254
  }
55455
- var commands35 = [
56255
+ var commands37 = [
55456
56256
  defineCommand({
55457
56257
  operation: moneyOperations.listAccounts,
55458
56258
  path: ["money", "accounts"],
@@ -56621,7 +57421,7 @@ var commands35 = [
56621
57421
  ];
56622
57422
 
56623
57423
  // src/commands/notes.ts
56624
- var commands36 = [
57424
+ var commands38 = [
56625
57425
  {
56626
57426
  spec: {
56627
57427
  path: ["notes", "backlinks"],
@@ -56743,7 +57543,7 @@ var commands36 = [
56743
57543
  ];
56744
57544
 
56745
57545
  // src/commands/orca.ts
56746
- var commands37 = [
57546
+ var commands39 = [
56747
57547
  {
56748
57548
  spec: {
56749
57549
  path: ["orca", "list"],
@@ -57109,7 +57909,7 @@ function linkBody(args) {
57109
57909
  return parseInput(familyTreeLinkInputSchema, { kind, a: ref, b: other });
57110
57910
  throw usageError("the kind is parent, child or partner");
57111
57911
  }
57112
- var commands38 = [
57912
+ var commands40 = [
57113
57913
  {
57114
57914
  spec: {
57115
57915
  path: ["people", "propose"],
@@ -57798,7 +58598,7 @@ var commands38 = [
57798
58598
 
57799
58599
  // src/commands/places.ts
57800
58600
  import { readFileSync as readFileSync10 } from "fs";
57801
- var commands39 = [
58601
+ var commands41 = [
57802
58602
  {
57803
58603
  spec: {
57804
58604
  path: ["places", "import"],
@@ -57855,7 +58655,7 @@ async function planDecision({ args, requireClient }, verb) {
57855
58655
  render: renderPlan
57856
58656
  };
57857
58657
  }
57858
- var commands40 = [
58658
+ var commands42 = [
57859
58659
  {
57860
58660
  spec: {
57861
58661
  path: ["plans", "list"],
@@ -58082,7 +58882,7 @@ var commands40 = [
58082
58882
  ];
58083
58883
 
58084
58884
  // src/commands/presets.ts
58085
- var commands41 = [
58885
+ var commands43 = [
58086
58886
  {
58087
58887
  spec: {
58088
58888
  path: ["presets", "list"],
@@ -58179,7 +58979,7 @@ function renderReviewSummary(data, mode) {
58179
58979
  return out.join(`
58180
58980
  `);
58181
58981
  }
58182
- var commands42 = [
58982
+ var commands44 = [
58183
58983
  {
58184
58984
  spec: {
58185
58985
  path: ["progress"],
@@ -58388,7 +59188,7 @@ function renderUpdates(data, mode) {
58388
59188
  return updates.map((u) => updateLine(u, mode)).join(`
58389
59189
  `);
58390
59190
  }
58391
- var commands43 = [
59191
+ var commands45 = [
58392
59192
  defineCommand({
58393
59193
  operation: projectOperations.update,
58394
59194
  path: ["projects", "set"],
@@ -58985,7 +59785,7 @@ var routineCommands = [
58985
59785
  }
58986
59786
  }
58987
59787
  ];
58988
- var commands44 = [
59788
+ var commands46 = [
58989
59789
  ...routineCommands,
58990
59790
  {
58991
59791
  spec: {
@@ -59108,7 +59908,7 @@ var commands44 = [
59108
59908
  ];
59109
59909
 
59110
59910
  // src/commands/rsvp-answers.ts
59111
- var commands45 = [
59911
+ var commands47 = [
59112
59912
  {
59113
59913
  spec: {
59114
59914
  path: ["rsvp-answers", "list"],
@@ -59162,7 +59962,7 @@ var commands45 = [
59162
59962
  ];
59163
59963
 
59164
59964
  // src/commands/rsvp-links.ts
59165
- var commands46 = [
59965
+ var commands48 = [
59166
59966
  {
59167
59967
  spec: {
59168
59968
  path: ["rsvp-links", "list"],
@@ -59258,7 +60058,7 @@ var commands46 = [
59258
60058
  ];
59259
60059
 
59260
60060
  // src/commands/rsvp-questions.ts
59261
- var commands47 = [
60061
+ var commands49 = [
59262
60062
  {
59263
60063
  spec: {
59264
60064
  path: ["rsvp-questions", "presets"],
@@ -59830,7 +60630,7 @@ function sessionFlags(flags) {
59830
60630
  body.occurredOn = on;
59831
60631
  return body;
59832
60632
  }
59833
- var commands48 = [
60633
+ var commands50 = [
59834
60634
  {
59835
60635
  spec: {
59836
60636
  path: ["runs", "change"],
@@ -60147,7 +60947,7 @@ var commands48 = [
60147
60947
  ];
60148
60948
 
60149
60949
  // src/commands/search.ts
60150
- var commands49 = [
60950
+ var commands51 = [
60151
60951
  {
60152
60952
  spec: {
60153
60953
  path: ["search"],
@@ -60180,7 +60980,7 @@ var commands49 = [
60180
60980
  ];
60181
60981
 
60182
60982
  // src/commands/seating-proposals.ts
60183
- var commands50 = [
60983
+ var commands52 = [
60184
60984
  {
60185
60985
  spec: {
60186
60986
  path: ["seating-proposals", "list"],
@@ -60267,7 +61067,7 @@ var commands50 = [
60267
61067
  ];
60268
61068
 
60269
61069
  // src/commands/sensors.ts
60270
- var commands51 = [
61070
+ var commands53 = [
60271
61071
  {
60272
61072
  spec: {
60273
61073
  path: ["sensors", "status"],
@@ -60427,7 +61227,7 @@ var commands51 = [
60427
61227
  ];
60428
61228
 
60429
61229
  // src/commands/settings.ts
60430
- var commands52 = [
61230
+ var commands54 = [
60431
61231
  {
60432
61232
  spec: {
60433
61233
  path: ["settings", "get"],
@@ -60461,7 +61261,7 @@ var commands52 = [
60461
61261
  ];
60462
61262
 
60463
61263
  // src/commands/sharing.ts
60464
- var commands53 = [
61264
+ var commands55 = [
60465
61265
  {
60466
61266
  spec: {
60467
61267
  path: ["share"],
@@ -60594,7 +61394,7 @@ var commands53 = [
60594
61394
  ];
60595
61395
 
60596
61396
  // src/commands/space.ts
60597
- var commands54 = [
61397
+ var commands56 = [
60598
61398
  {
60599
61399
  spec: {
60600
61400
  path: ["space", "address"],
@@ -60650,7 +61450,7 @@ var commands54 = [
60650
61450
  ];
60651
61451
 
60652
61452
  // src/commands/tap-tags.ts
60653
- var commands55 = [
61453
+ var commands57 = [
60654
61454
  {
60655
61455
  spec: {
60656
61456
  path: ["tap-tags", "tap"],
@@ -60678,7 +61478,7 @@ var BY = {
60678
61478
  type: "string",
60679
61479
  description: "The blocking task's ref (DO-147) or ULID."
60680
61480
  };
60681
- var commands56 = [
61481
+ var commands58 = [
60682
61482
  defineCommand({
60683
61483
  operation: taskBlockOperations.addBlocker,
60684
61484
  path: ["tasks", "block"],
@@ -60744,7 +61544,7 @@ function renderSeries(data, mode) {
60744
61544
  }).join(`
60745
61545
  `);
60746
61546
  }
60747
- var commands57 = [
61547
+ var commands59 = [
60748
61548
  defineCommand({
60749
61549
  operation: taskSeriesOperations.make,
60750
61550
  path: ["tasks", "make-series"],
@@ -60899,7 +61699,7 @@ function repeatFromFlags(flags) {
60899
61699
  out.anchor = "from_completion";
60900
61700
  return out;
60901
61701
  }
60902
- var commands58 = [
61702
+ var commands60 = [
60903
61703
  {
60904
61704
  spec: {
60905
61705
  path: ["capture"],
@@ -61357,7 +62157,7 @@ var commands58 = [
61357
62157
  ];
61358
62158
 
61359
62159
  // src/commands/time-blocks.ts
61360
- var commands59 = [
62160
+ var commands61 = [
61361
62161
  {
61362
62162
  spec: {
61363
62163
  path: ["time-blocks", "record"],
@@ -61549,7 +62349,7 @@ function renderLandedCounts(data, mode) {
61549
62349
  return out.join(`
61550
62350
  `);
61551
62351
  }
61552
- var commands60 = [
62352
+ var commands62 = [
61553
62353
  {
61554
62354
  spec: {
61555
62355
  path: ["today"],
@@ -61921,7 +62721,7 @@ function renderViews(data, mode) {
61921
62721
  function renderView(data, mode) {
61922
62722
  return renderViews([data], mode);
61923
62723
  }
61924
- var commands61 = [
62724
+ var commands63 = [
61925
62725
  defineCommand({
61926
62726
  operation: workViewOperations.list,
61927
62727
  path: ["views", "list"],
@@ -62040,7 +62840,7 @@ var commands61 = [
62040
62840
  ];
62041
62841
 
62042
62842
  // src/commands/worktree-links.ts
62043
- var commands62 = [
62843
+ var commands64 = [
62044
62844
  {
62045
62845
  spec: {
62046
62846
  path: ["worktree-links", "list"],
@@ -62208,7 +63008,9 @@ var FEATURE_COMMANDS = [
62208
63008
  ...commands59,
62209
63009
  ...commands60,
62210
63010
  ...commands61,
62211
- ...commands62
63011
+ ...commands62,
63012
+ ...commands63,
63013
+ ...commands64
62212
63014
  ];
62213
63015
 
62214
63016
  // src/registry.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robbeverhelst/do",
3
- "version": "1.419.0",
3
+ "version": "1.421.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",