@robbeverhelst/do 1.180.1 → 1.182.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 +76 -12
  2. package/package.json +1 -1
package/dist/do.js CHANGED
@@ -20154,7 +20154,11 @@ var saveAgentConnectionInputSchema = object({
20154
20154
  });
20155
20155
  var agentPageContextSchema = object({
20156
20156
  route: string2().trim().min(1).max(500).startsWith("/"),
20157
- nodeId: string2().trim().min(1).max(64).nullable()
20157
+ nodeId: string2().trim().min(1).max(64).nullable(),
20158
+ focusArea: object({
20159
+ id: string2().trim().min(1).max(64),
20160
+ title: string2().trim().min(1).max(200)
20161
+ }).nullish()
20158
20162
  }).strict();
20159
20163
  var agentChatInputSchema = object({
20160
20164
  message: string2().trim().min(1).max(8000),
@@ -20275,6 +20279,25 @@ var runStatusSchema = _enum2(["running", "needs_you", "done", "failed", "stopped
20275
20279
  var externalIdSchema = string2().min(1).max(200).regex(/^[\x21-\x7e]+$/, "printable ASCII without spaces");
20276
20280
  var AGENT_POST_TEXT_MAX = 64000;
20277
20281
  var postTextSchema = string2().max(AGENT_POST_TEXT_MAX);
20282
+ var briefVerbSchema = object({
20283
+ label: string2().trim().min(1).max(24),
20284
+ href: string2().max(2000).regex(/^(\/(?!\/)|https:\/\/)/, "a path in do (`/tasks`) or an https link").optional(),
20285
+ say: string2().trim().min(1).max(500).optional()
20286
+ }).strict().refine((v) => v.href === undefined !== (v.say === undefined), {
20287
+ message: "a verb has either href or say"
20288
+ });
20289
+ var briefRowSchema = object({
20290
+ text: string2().trim().min(1).max(200),
20291
+ meta: string2().trim().max(200).optional(),
20292
+ icon: string2().max(24).optional(),
20293
+ verb: briefVerbSchema.optional()
20294
+ }).strict();
20295
+ var BRIEF_ROWS_MAX = 8;
20296
+ var briefSchema = object({
20297
+ label: string2().trim().min(1).max(40),
20298
+ title: string2().trim().min(1).max(200),
20299
+ rows: array(briefRowSchema).max(BRIEF_ROWS_MAX).default([])
20300
+ }).strict();
20278
20301
  var gatewayMemberSchema = object({
20279
20302
  id: string2().min(1),
20280
20303
  name: string2(),
@@ -20322,15 +20345,17 @@ var agentPostInputSchema = object({
20322
20345
  attachments: array(ulidSchema).max(20).default([]),
20323
20346
  final: boolean3().default(true),
20324
20347
  run: postRunSchema.optional(),
20325
- recovered: boolean3().optional()
20348
+ recovered: boolean3().optional(),
20349
+ brief: briefSchema.optional()
20326
20350
  });
20327
20351
  var agentPostEditSchema = object({
20328
20352
  text: postTextSchema.optional(),
20329
20353
  final: boolean3().optional(),
20330
20354
  level: postLevelSchema.optional(),
20331
- run: postRunSchema.optional()
20355
+ run: postRunSchema.optional(),
20356
+ brief: briefSchema.optional()
20332
20357
  }).refine((e) => Object.values(e).some((v) => v !== undefined), {
20333
- message: "send text, final, level or run"
20358
+ message: "send text, final, level, run or brief"
20334
20359
  });
20335
20360
  var agentPostResultSchema = object({ postId: ulidSchema, created: boolean3() });
20336
20361
  var promptOptionSchema = object({
@@ -21647,7 +21672,7 @@ function parseCapture2(input, now) {
21647
21672
 
21648
21673
  // src/meta.ts
21649
21674
  var CLI_NAME = "do";
21650
- var VERSION = "1.180.1";
21675
+ var VERSION = "1.182.0";
21651
21676
  var API_PREFIX = "/api/v1";
21652
21677
  var DEFAULT_API_URL = "http://localhost:3001";
21653
21678
 
@@ -23085,6 +23110,11 @@ var COMMAND_SPECS = [
23085
23110
  type: "boolean",
23086
23111
  description: "Not final yet (a reply still being edited)."
23087
23112
  },
23113
+ {
23114
+ name: "brief",
23115
+ type: "string",
23116
+ description: `A brief's sections as JSON: {"label":"HQ brief","title":"\u2026","rows":[{"text":"\u2026","meta":"\u2026","icon":"tasks","verb":{"label":"Start","href":"/tasks"}}]} (a verb has href or say). Makes the post a brief; shows as a card on Now until the day ends.`
23117
+ },
23088
23118
  { name: "edit", type: "string", description: "Edit this post (its id) instead: its text." },
23089
23119
  { name: "delete", type: "string", description: "Take this post (its id) back." }
23090
23120
  ],
@@ -23134,6 +23164,11 @@ var COMMAND_SPECS = [
23134
23164
  type: "boolean",
23135
23165
  description: "Not final yet (a reply still being edited)."
23136
23166
  },
23167
+ {
23168
+ name: "brief",
23169
+ type: "string",
23170
+ description: `A brief's sections as JSON: {"label":"HQ brief","title":"\u2026","rows":[{"text":"\u2026","meta":"\u2026","icon":"tasks","verb":{"label":"Start","href":"/tasks"}}]} (a verb has href or say). Makes the post a brief; shows as a card on Now until the day ends.`
23171
+ },
23137
23172
  { name: "edit", type: "string", description: "Edit this post (its id) instead: its text." },
23138
23173
  { name: "delete", type: "string", description: "Take this post (its id) back." }
23139
23174
  ],
@@ -23193,6 +23228,21 @@ var COMMAND_SPECS = [
23193
23228
  returns: "EchoThreadSummary",
23194
23229
  notes: "For later and Silent posts never push. The home thread and conversations start at all, a standing thread you add at needs_you."
23195
23230
  },
23231
+ {
23232
+ path: ["echo", "briefs"],
23233
+ summary: "Show today's briefs from the agent, as Now shows them.",
23234
+ args: [],
23235
+ flags: [
23236
+ {
23237
+ name: "since",
23238
+ type: "string",
23239
+ description: "ISO 8601: where your day starts (default: local midnight)."
23240
+ }
23241
+ ],
23242
+ scopes: ["agents:read"],
23243
+ returns: "{ briefs: EchoBriefCard[] }",
23244
+ notes: "Brief posts with sections, oldest first, at most 12; silent ones and archived threads are left out."
23245
+ },
23196
23246
  {
23197
23247
  path: ["echo", "threads", "add"],
23198
23248
  summary: "Add a standing thread of your own (Build, Business), pinned under the agent's.",
@@ -25854,6 +25904,13 @@ var HANDLERS = {
25854
25904
  }),
25855
25905
  render: renderRecord
25856
25906
  }),
25907
+ "echo briefs": async ({ flags, requireClient }) => {
25908
+ const since = flagString(flags, "since") ?? startOfToday().toISOString();
25909
+ return {
25910
+ data: await requireClient().get("/echo/threads/briefs", { query: { since } }),
25911
+ render: renderRecord
25912
+ };
25913
+ },
25857
25914
  "echo threads add": echoThreadAdd,
25858
25915
  "echo thread add": echoThreadAdd,
25859
25916
  "echo threads rename": async ({ args, requireClient }) => {
@@ -26412,6 +26469,10 @@ function standardLink(flags) {
26412
26469
  return { kind: "metric", key: metric };
26413
26470
  return null;
26414
26471
  }
26472
+ function startOfToday() {
26473
+ const now = new Date;
26474
+ return new Date(now.getFullYear(), now.getMonth(), now.getDate());
26475
+ }
26415
26476
  async function echoThreadAdd({ args, flags, requireClient }) {
26416
26477
  const title = args.join(" ").trim();
26417
26478
  if (!title)
@@ -26536,12 +26597,14 @@ async function agentPost({ io, args, flags, requireClient }) {
26536
26597
  return { data: { ok: true, deleted: remove }, render: renderRecord };
26537
26598
  }
26538
26599
  const text = await postText(io, args);
26600
+ const brief = flagString(flags, "brief") === undefined ? undefined : readDataFlag(flags, "brief");
26539
26601
  const edit = flagString(flags, "edit");
26540
26602
  if (edit !== undefined) {
26541
26603
  const body = parseInput(agentPostEditSchema, {
26542
26604
  text,
26543
26605
  ...flagBool(flags, "draft") ? { final: false } : {},
26544
- level: flagString(flags, "level")
26606
+ level: flagString(flags, "level"),
26607
+ brief
26545
26608
  });
26546
26609
  return {
26547
26610
  data: await client.patch(`/agent/posts/${encodeURIComponent(edit)}`, body),
@@ -26554,9 +26617,10 @@ async function agentPost({ io, args, flags, requireClient }) {
26554
26617
  externalId: flagString(flags, "external-id") ?? `cli:${ulid3()}`,
26555
26618
  thread: ULID.test(thread) ? { id: thread.toUpperCase() } : { slug: thread, ...member ? { memberId: member } : {} },
26556
26619
  text,
26557
- kind: flagString(flags, "kind"),
26620
+ kind: flagString(flags, "kind") ?? (brief ? "brief" : undefined),
26558
26621
  level: flagString(flags, "level"),
26559
- final: !flagBool(flags, "draft")
26622
+ final: !flagBool(flags, "draft"),
26623
+ brief
26560
26624
  });
26561
26625
  return { data: await client.post("/agent/posts", body), render: renderRecord };
26562
26626
  }
@@ -26612,18 +26676,18 @@ function mergePreview(before, changes) {
26612
26676
  }
26613
26677
  return changes;
26614
26678
  }
26615
- function readDataFlag(flags) {
26616
- const raw = flagString(flags, "data");
26679
+ function readDataFlag(flags, name = "data") {
26680
+ const raw = flagString(flags, name);
26617
26681
  if (raw === undefined)
26618
26682
  return {};
26619
26683
  let parsed;
26620
26684
  try {
26621
26685
  parsed = JSON.parse(raw);
26622
26686
  } catch (err) {
26623
- throw usageError(`--data is not valid JSON: ${err.message}`);
26687
+ throw usageError(`--${name} is not valid JSON: ${err.message}`);
26624
26688
  }
26625
26689
  if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
26626
- throw usageError("--data must be a JSON object");
26690
+ throw usageError(`--${name} must be a JSON object`);
26627
26691
  }
26628
26692
  return parsed;
26629
26693
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robbeverhelst/do",
3
- "version": "1.180.1",
3
+ "version": "1.182.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",