@robbeverhelst/do 1.170.0 → 1.172.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 +143 -23
  2. package/package.json +1 -1
package/dist/do.js CHANGED
@@ -3606,7 +3606,8 @@ var areas = pgTable("areas", {
3606
3606
  reviewCadence: reviewCadence("review_cadence"),
3607
3607
  archivedAt: timestamp("archived_at", { withTimezone: true }),
3608
3608
  purpose: text("purpose"),
3609
- standards: jsonb("standards").$type().notNull().default(sql`'[]'::jsonb`)
3609
+ standards: jsonb("standards").$type().notNull().default(sql`'[]'::jsonb`),
3610
+ restingUntil: date("resting_until", { mode: "string" })
3610
3611
  }, (t) => [
3611
3612
  index("areas_tenant_idx").on(t.tenantId),
3612
3613
  check("areas_standards_chk", sql`jsonb_typeof(${t.standards}) = 'array' AND jsonb_array_length(${t.standards}) <= 5`)
@@ -19217,16 +19218,18 @@ var createAreaInputSchema = createInsertSchema(areas, {
19217
19218
  id: ulidSchema,
19218
19219
  icon: areaIconSchema.nullish(),
19219
19220
  purpose: areaPurposeSchema.nullish()
19220
- }).omit({ tenantId: true, archivedAt: true, standards: true }).extend({ title: string2().min(1) });
19221
+ }).omit({ tenantId: true, archivedAt: true, standards: true, restingUntil: true }).extend({ title: string2().min(1) });
19221
19222
  var updateAreaInputSchema = createUpdateSchema(areas, {
19222
19223
  icon: areaIconSchema.nullish(),
19223
19224
  archivedAt: exports_coerce.date().nullish(),
19224
19225
  purpose: areaPurposeSchema.nullish(),
19225
- standards: array(areaStandardInputSchema).max(5).optional()
19226
+ standards: array(areaStandardInputSchema).max(5).optional(),
19227
+ restingUntil: exports_iso.date().nullish()
19226
19228
  }).omit({ id: true, tenantId: true }).extend({ title: string2().min(1).optional() }).strict();
19227
19229
  var areaViewSchema = areaSchema.extend({
19228
19230
  title: string2(),
19229
19231
  archivedAt: exports_coerce.date().nullable().default(null),
19232
+ restingUntil: exports_iso.date().nullable().default(null),
19230
19233
  createdAt: exports_coerce.date(),
19231
19234
  updatedAt: exports_coerce.date(),
19232
19235
  deletedAt: exports_coerce.date().nullable(),
@@ -19247,6 +19250,38 @@ var areaDetailSchema = areaViewSchema.extend({
19247
19250
  tasks: array(taskViewSchema),
19248
19251
  notes: array(noteViewSchema)
19249
19252
  });
19253
+ var areaOwnerLensSchema = _enum2(["mine", "agents", "all"]);
19254
+ var areaOverviewQuerySchema = object({
19255
+ owner: areaOwnerLensSchema.default("mine")
19256
+ });
19257
+ var areaAttentionKindSchema = _enum2(["busier", "steady", "quiet", "resting"]);
19258
+ var areaAttentionSchema = object({
19259
+ kind: areaAttentionKindSchema,
19260
+ word: string2().min(1),
19261
+ reason: string2().nullable()
19262
+ });
19263
+ var areaMovingLineSchema = object({
19264
+ kind: _enum2(["project", "task", "habits"]),
19265
+ id: string2().nullable(),
19266
+ title: string2(),
19267
+ detail: string2().nullable()
19268
+ });
19269
+ var areaOverviewItemSchema = object({
19270
+ id: string2(),
19271
+ title: string2(),
19272
+ color: areaSchema.shape.color,
19273
+ icon: string2().nullable(),
19274
+ purpose: string2().nullable().default(null),
19275
+ attention: areaAttentionSchema,
19276
+ moving: array(areaMovingLineSchema).max(2),
19277
+ waiting: number2().int().min(0),
19278
+ standardsWorthALook: number2().int().min(0).default(0),
19279
+ restingUntil: exports_iso.date().nullable()
19280
+ });
19281
+ var areaOverviewSchema = object({
19282
+ owner: areaOwnerLensSchema,
19283
+ areas: array(areaOverviewItemSchema)
19284
+ });
19250
19285
 
19251
19286
  // ../../packages/schema/src/presets/facets.ts
19252
19287
  var PANTRY_DISPLAY_KIND = "pantry";
@@ -21299,7 +21334,7 @@ function parseCapture2(input, now) {
21299
21334
 
21300
21335
  // src/meta.ts
21301
21336
  var CLI_NAME = "do";
21302
- var VERSION = "1.170.0";
21337
+ var VERSION = "1.172.0";
21303
21338
  var API_PREFIX = "/api/v1";
21304
21339
  var DEFAULT_API_URL = "http://localhost:3001";
21305
21340
 
@@ -21536,7 +21571,7 @@ var ENTITIES = [
21536
21571
  DUE_BEFORE_FLAG,
21537
21572
  {
21538
21573
  name: "owner",
21539
- description: "owner: me, member:<id|email>, agent:<id|name>[/<desk>], any or none (agent:Echo = every desk)"
21574
+ description: "owner: me, member:<id|email>, agent:<id|name>[/<desk>], any or none (agent:<name> = every desk)"
21540
21575
  },
21541
21576
  {
21542
21577
  name: "waitingOn",
@@ -21546,7 +21581,7 @@ var ENTITIES = [
21546
21581
  { name: "completedBefore", description: "finished before this instant (ISO or date)" },
21547
21582
  {
21548
21583
  name: "proposed",
21549
- description: "only tasks Proposed by Echo (made by an Agent for a member, not accepted yet); --proposed=false for only the plan",
21584
+ description: "only tasks Proposed by the agent (made by an Agent for a member, not accepted yet); --proposed=false for only the plan",
21550
21585
  boolean: true
21551
21586
  },
21552
21587
  {
@@ -22053,7 +22088,7 @@ var COMMAND_SPECS = [
22053
22088
  },
22054
22089
  {
22055
22090
  path: ["tasks", "accept"],
22056
- summary: "Accept a task Proposed by Echo: it joins the plan as suggested (day, Deadline, Area kept).",
22091
+ summary: "Accept a task Proposed by the agent: it joins the plan as suggested (day, Deadline, Area kept).",
22057
22092
  args: [{ name: "id", required: true, description: "Task ULID." }],
22058
22093
  flags: [],
22059
22094
  scopes: ["tasks:write"],
@@ -22062,7 +22097,7 @@ var COMMAND_SPECS = [
22062
22097
  },
22063
22098
  {
22064
22099
  path: ["tasks", "dismiss"],
22065
- summary: "Not now on a task Proposed by Echo: it leaves the Inbox for a week, still proposed.",
22100
+ summary: "Not now on a task Proposed by the agent: it leaves the Inbox for a week, still proposed.",
22066
22101
  args: [{ name: "id", required: true, description: "Task ULID." }],
22067
22102
  flags: [],
22068
22103
  scopes: ["tasks:write"],
@@ -22150,7 +22185,7 @@ var COMMAND_SPECS = [
22150
22185
  ],
22151
22186
  scopes: ["habits:write"],
22152
22187
  returns: "HabitSummary",
22153
- notes: `POST /api/v1/habits/check-in. Title or alias, case-insensitive; several matches \u2192 409 with error.details.candidates (id, title, aliases), none \u2192 404 naming close titles; a habit counted from Google Fit, Strava or GitHub \u2192 409. --set writes the difference to the day's total as its own check-in. An Agent's key records the check-in as that Agent's ("Echo, 07:12"). --note puts a short note on it ("drill done, felt heavy" \u2192 --note "felt heavy"); the reply's lastCheckIn.id is the check-in, for \`do habit note\` later.`
22188
+ notes: `POST /api/v1/habits/check-in. Title or alias, case-insensitive; several matches \u2192 409 with error.details.candidates (id, title, aliases), none \u2192 404 naming close titles; a habit counted from Google Fit, Strava or GitHub \u2192 409. --set writes the difference to the day's total as its own check-in. An Agent's key records the check-in as that Agent's ("<agent>, 07:12"). --note puts a short note on it ("drill done, felt heavy" \u2192 --note "felt heavy"); the reply's lastCheckIn.id is the check-in, for \`do habit note\` later.`
22154
22189
  },
22155
22190
  {
22156
22191
  path: ["habit", "alias", "add"],
@@ -22434,7 +22469,7 @@ var COMMAND_SPECS = [
22434
22469
  ],
22435
22470
  scopes: ["orca:write"],
22436
22471
  returns: "OrcaSendMessageResult",
22437
- notes: "An Agent's key gets a 428 confirmation_required; it runs once the member confirms in the Echo panel (#678)."
22472
+ notes: "An Agent's key gets a 428 confirmation_required; it runs once the member confirms in do's agent panel (#678)."
22438
22473
  },
22439
22474
  {
22440
22475
  path: ["orca", "restart"],
@@ -22522,7 +22557,7 @@ var COMMAND_SPECS = [
22522
22557
  },
22523
22558
  {
22524
22559
  path: ["agent", "connection", "get"],
22525
- summary: "Show the agent runtime the Echo panel's chat goes to (never its key).",
22560
+ summary: "Show the agent runtime the agent panel's chat goes to (never its key).",
22526
22561
  args: [],
22527
22562
  flags: [],
22528
22563
  scopes: ["agents:read"],
@@ -22531,7 +22566,7 @@ var COMMAND_SPECS = [
22531
22566
  },
22532
22567
  {
22533
22568
  path: ["agent", "connection", "set"],
22534
- summary: "Point the Echo panel at an agent runtime (replaces the connection).",
22569
+ summary: "Point the agent panel at an agent runtime (replaces the connection).",
22535
22570
  args: [],
22536
22571
  flags: [
22537
22572
  { name: "endpoint", type: "string", description: "The runtime's base URL (required)." },
@@ -22548,9 +22583,9 @@ var COMMAND_SPECS = [
22548
22583
  {
22549
22584
  name: "auto-file",
22550
22585
  type: "boolean",
22551
- description: "Let Echo file new captures (needs --agent)."
22586
+ description: "Let the agent file new captures (needs --agent)."
22552
22587
  },
22553
- { name: "no-auto-file", type: "boolean", description: "Stop Echo filing new captures." },
22588
+ { name: "no-auto-file", type: "boolean", description: "Stop the agent filing new captures." },
22554
22589
  {
22555
22590
  name: "key-stdin",
22556
22591
  type: "boolean",
@@ -22571,7 +22606,7 @@ var COMMAND_SPECS = [
22571
22606
  ],
22572
22607
  scopes: ["agents:write"],
22573
22608
  returns: "None",
22574
- notes: "Owner/admin only. An Agent's key gets a 428 confirmation_required until the member confirms in the Echo panel."
22609
+ notes: "Owner/admin only. An Agent's key gets a 428 confirmation_required until the member confirms in do's agent panel."
22575
22610
  },
22576
22611
  {
22577
22612
  path: ["agent", "post"],
@@ -22664,7 +22699,7 @@ var COMMAND_SPECS = [
22664
22699
  },
22665
22700
  {
22666
22701
  path: ["echo", "threads", "list"],
22667
- summary: "List your recent Echo threads, newest first.",
22702
+ summary: "List your recent agent threads, newest first.",
22668
22703
  args: [],
22669
22704
  flags: [{ name: "limit", type: "string", description: "How many, 1\u201350 (default 10)." }],
22670
22705
  scopes: ["agents:read"],
@@ -22673,7 +22708,7 @@ var COMMAND_SPECS = [
22673
22708
  },
22674
22709
  {
22675
22710
  path: ["echo", "threads", "current"],
22676
- summary: "Show the Echo thread the panel opens on, with its turns.",
22711
+ summary: "Show the agent thread the panel opens on, with its turns.",
22677
22712
  args: [],
22678
22713
  flags: [],
22679
22714
  scopes: ["agents:read"],
@@ -22682,7 +22717,7 @@ var COMMAND_SPECS = [
22682
22717
  },
22683
22718
  {
22684
22719
  path: ["echo", "threads", "show"],
22685
- summary: "Show one of your Echo threads, with its turns.",
22720
+ summary: "Show one of your agent threads, with its turns.",
22686
22721
  args: [{ name: "id", required: true, description: "Thread ULID (see `echo threads list`)." }],
22687
22722
  flags: [],
22688
22723
  scopes: ["agents:read"],
@@ -22691,7 +22726,7 @@ var COMMAND_SPECS = [
22691
22726
  },
22692
22727
  {
22693
22728
  path: ["echo", "threads", "new"],
22694
- summary: "Start a new Echo conversation (it becomes the current thread).",
22729
+ summary: "Start a new agent conversation (it becomes the current thread).",
22695
22730
  args: [],
22696
22731
  flags: [],
22697
22732
  scopes: ["agents:write"],
@@ -22958,7 +22993,7 @@ var COMMAND_SPECS = [
22958
22993
  flags: STANDARD_LINK_FLAGS,
22959
22994
  scopes: ["areas:write"],
22960
22995
  returns: "AreaDetail",
22961
- notes: "POST /api/v1/areas/:id/standards. Echo adds standards only after the member said yes; the change list keeps Undo."
22996
+ notes: "POST /api/v1/areas/:id/standards. The agent adds standards only after the member said yes; the change list keeps Undo."
22962
22997
  },
22963
22998
  {
22964
22999
  path: ["areas", "standards", "link"],
@@ -22987,6 +23022,45 @@ var COMMAND_SPECS = [
22987
23022
  returns: "AreaDetail",
22988
23023
  notes: "DELETE /api/v1/areas/:id/standards/:standardId."
22989
23024
  },
23025
+ {
23026
+ path: ["areas", "overview"],
23027
+ summary: "How each Area is going, in words: attention against its own usual, what's moving, and what waits on you.",
23028
+ args: [],
23029
+ flags: [
23030
+ {
23031
+ name: "owner",
23032
+ type: "string",
23033
+ description: "Whose work counts: mine (default; agents' work doesn't), agents or all."
23034
+ }
23035
+ ],
23036
+ scopes: ["areas:read"],
23037
+ returns: "AreaOverview",
23038
+ notes: 'GET /api/v1/areas/overview. Words, never a score: "Busier than usual", "Steady", "Quiet for three weeks", "Resting", each with a short reason. The only count is what waits on you. Resting Areas come last.'
23039
+ },
23040
+ {
23041
+ path: ["areas", "rest"],
23042
+ summary: "Rest an Area until a day: it keeps everything and folds to the foot of the overview.",
23043
+ args: [{ name: "id", required: true, description: "Area ULID." }],
23044
+ flags: [
23045
+ {
23046
+ name: "until",
23047
+ type: "string",
23048
+ description: "The day it's back (YYYY-MM-DD). Required."
23049
+ }
23050
+ ],
23051
+ scopes: ["areas:write"],
23052
+ returns: "AreaView",
23053
+ notes: "PATCH /api/v1/areas/{id} { restingUntil }. Between active and archived: its attention reads Resting, back in that month. Bring it back early with `do areas back`."
23054
+ },
23055
+ {
23056
+ path: ["areas", "back"],
23057
+ summary: "Bring a resting Area back today.",
23058
+ args: [{ name: "id", required: true, description: "Area ULID." }],
23059
+ flags: [],
23060
+ scopes: ["areas:write"],
23061
+ returns: "AreaView",
23062
+ notes: "PATCH /api/v1/areas/{id} { restingUntil: null }. Nothing was lost while it rested."
23063
+ },
22990
23064
  {
22991
23065
  path: ["places", "import"],
22992
23066
  summary: "Import the rooms of the house once from Gaard's house.json.",
@@ -23630,7 +23704,7 @@ function suggestionText(s) {
23630
23704
  s.owner ? `owner ${ownerText(s.owner)}` : null,
23631
23705
  s.scheduledAt ? shortDate(s.scheduledAt) : null
23632
23706
  ].filter(Boolean);
23633
- return `${s.by?.name ?? "Echo"} suggests ${parts.join(", ")}`;
23707
+ return `${s.by?.name ?? "The agent"} suggests ${parts.join(", ")}`;
23634
23708
  }
23635
23709
  function worktreeText(link) {
23636
23710
  const where = link.branch ?? link.path ?? link.worktreeId ?? "";
@@ -23705,6 +23779,31 @@ function renderFromEarlier(data, mode) {
23705
23779
  ].join(`
23706
23780
  `);
23707
23781
  }
23782
+ function renderAreaOverview(data, mode) {
23783
+ const d = data;
23784
+ const all = d.areas ?? [];
23785
+ if (all.length === 0)
23786
+ return paint(mode, "dim", "No areas yet.");
23787
+ const active = all.filter((a) => a.attention.kind !== "resting");
23788
+ const resting = all.filter((a) => a.attention.kind === "resting");
23789
+ const lens = d.owner === "agents" ? "Agents" : d.owner === "all" ? "All" : "Mine";
23790
+ const out = [paint(mode, "bold", `Your areas \xB7 ${lens}`)];
23791
+ for (const a of active) {
23792
+ const waiting = a.waiting ? paint(mode, "yellow", ` ${a.waiting} waiting`) : "";
23793
+ out.push(` ${paint(mode, "bold", a.title)}${waiting} ${paint(mode, "dim", a.id)}`);
23794
+ if (a.purpose)
23795
+ out.push(` ${paint(mode, "dim", a.purpose)}`);
23796
+ const reason = a.attention.reason ? paint(mode, "dim", ` \xB7 ${a.attention.reason}`) : "";
23797
+ out.push(` ${a.attention.word}${reason}`);
23798
+ for (const m of a.moving ?? [])
23799
+ out.push(` \xB7 ${m.title}${m.detail ? `, ${m.detail}` : ""}`);
23800
+ }
23801
+ if (resting.length > 0) {
23802
+ out.push("", paint(mode, "dim", `Resting: ${resting.map((a) => `${a.title}${a.attention.reason ? `, ${a.attention.reason.replace(/^B/, "b")}` : ""}`).join("; ")}.`));
23803
+ }
23804
+ return out.join(`
23805
+ `);
23806
+ }
23708
23807
  function renderFromEarlierAnswer(data, mode) {
23709
23808
  const d = data;
23710
23809
  const n = d.tasks ?? 0;
@@ -24029,7 +24128,7 @@ function renderEchoThread(data, mode) {
24029
24128
  const wrapped = data;
24030
24129
  const thread = wrapped && typeof wrapped === "object" && "thread" in wrapped ? wrapped.thread : data;
24031
24130
  if (!thread)
24032
- return paint(mode, "dim", "No Echo thread yet.");
24131
+ return paint(mode, "dim", "No thread yet.");
24033
24132
  const head = `${thread.title ?? "New conversation"} ${paint(mode, "dim", thread.id ?? "")}`;
24034
24133
  const turns = thread.turns ?? [];
24035
24134
  const posts = thread.posts ?? [];
@@ -24045,7 +24144,7 @@ ${paint(mode, "dim", "(nothing asked yet)")}`;
24045
24144
  order: i,
24046
24145
  lines: [
24047
24146
  ` ${paint(mode, "bold", "You")} ${t.question ?? ""}`,
24048
- ` ${paint(mode, "bold", "Echo")} ${t.reply ?? ""}${paint(mode, "dim", note)}`
24147
+ ` ${paint(mode, "bold", "Agent")} ${t.reply ?? ""}${paint(mode, "dim", note)}`
24049
24148
  ]
24050
24149
  };
24051
24150
  }),
@@ -25200,6 +25299,27 @@ var HANDLERS = {
25200
25299
  const area = await requireClient().delete(`/areas/${id}/standards/${standard}`);
25201
25300
  return { data: area.standards ?? [], render: renderStandards };
25202
25301
  },
25302
+ "areas overview": async ({ flags, requireClient }) => {
25303
+ const owner = flagString(flags, "owner");
25304
+ const query = parseInput(areaOverviewQuerySchema, owner ? { owner } : {});
25305
+ return {
25306
+ data: await requireClient().get("/areas/overview", { query }),
25307
+ render: renderAreaOverview
25308
+ };
25309
+ },
25310
+ "areas rest": async ({ args, flags, requireClient }) => {
25311
+ const id = requireArg(args, 0, "area id");
25312
+ const until = flagString(flags, "until");
25313
+ if (!until)
25314
+ throw usageError("areas rest needs --until <YYYY-MM-DD>, the day it's back");
25315
+ const input = parseInput(updateAreaInputSchema, { restingUntil: until });
25316
+ return { data: await requireClient().patch(`/areas/${id}`, input), render: renderRecord };
25317
+ },
25318
+ "areas back": async ({ args, requireClient }) => {
25319
+ const id = requireArg(args, 0, "area id");
25320
+ const input = parseInput(updateAreaInputSchema, { restingUntil: null });
25321
+ return { data: await requireClient().patch(`/areas/${id}`, input), render: renderRecord };
25322
+ },
25203
25323
  "places import": async ({ args, flags, requireClient }) => {
25204
25324
  const path = requireArg(args, 0, "house.json path");
25205
25325
  let file;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robbeverhelst/do",
3
- "version": "1.170.0",
3
+ "version": "1.172.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",