@robbeverhelst/do 1.181.0 → 1.183.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.
- package/dist/do.js +71 -11
- package/package.json +1 -1
package/dist/do.js
CHANGED
|
@@ -20279,6 +20279,25 @@ var runStatusSchema = _enum2(["running", "needs_you", "done", "failed", "stopped
|
|
|
20279
20279
|
var externalIdSchema = string2().min(1).max(200).regex(/^[\x21-\x7e]+$/, "printable ASCII without spaces");
|
|
20280
20280
|
var AGENT_POST_TEXT_MAX = 64000;
|
|
20281
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();
|
|
20282
20301
|
var gatewayMemberSchema = object({
|
|
20283
20302
|
id: string2().min(1),
|
|
20284
20303
|
name: string2(),
|
|
@@ -20326,15 +20345,17 @@ var agentPostInputSchema = object({
|
|
|
20326
20345
|
attachments: array(ulidSchema).max(20).default([]),
|
|
20327
20346
|
final: boolean3().default(true),
|
|
20328
20347
|
run: postRunSchema.optional(),
|
|
20329
|
-
recovered: boolean3().optional()
|
|
20348
|
+
recovered: boolean3().optional(),
|
|
20349
|
+
brief: briefSchema.optional()
|
|
20330
20350
|
});
|
|
20331
20351
|
var agentPostEditSchema = object({
|
|
20332
20352
|
text: postTextSchema.optional(),
|
|
20333
20353
|
final: boolean3().optional(),
|
|
20334
20354
|
level: postLevelSchema.optional(),
|
|
20335
|
-
run: postRunSchema.optional()
|
|
20355
|
+
run: postRunSchema.optional(),
|
|
20356
|
+
brief: briefSchema.optional()
|
|
20336
20357
|
}).refine((e) => Object.values(e).some((v) => v !== undefined), {
|
|
20337
|
-
message: "send text, final, level or
|
|
20358
|
+
message: "send text, final, level, run or brief"
|
|
20338
20359
|
});
|
|
20339
20360
|
var agentPostResultSchema = object({ postId: ulidSchema, created: boolean3() });
|
|
20340
20361
|
var promptOptionSchema = object({
|
|
@@ -21651,7 +21672,7 @@ function parseCapture2(input, now) {
|
|
|
21651
21672
|
|
|
21652
21673
|
// src/meta.ts
|
|
21653
21674
|
var CLI_NAME = "do";
|
|
21654
|
-
var VERSION = "1.
|
|
21675
|
+
var VERSION = "1.183.0";
|
|
21655
21676
|
var API_PREFIX = "/api/v1";
|
|
21656
21677
|
var DEFAULT_API_URL = "http://localhost:3001";
|
|
21657
21678
|
|
|
@@ -23089,6 +23110,11 @@ var COMMAND_SPECS = [
|
|
|
23089
23110
|
type: "boolean",
|
|
23090
23111
|
description: "Not final yet (a reply still being edited)."
|
|
23091
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
|
+
},
|
|
23092
23118
|
{ name: "edit", type: "string", description: "Edit this post (its id) instead: its text." },
|
|
23093
23119
|
{ name: "delete", type: "string", description: "Take this post (its id) back." }
|
|
23094
23120
|
],
|
|
@@ -23138,6 +23164,11 @@ var COMMAND_SPECS = [
|
|
|
23138
23164
|
type: "boolean",
|
|
23139
23165
|
description: "Not final yet (a reply still being edited)."
|
|
23140
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
|
+
},
|
|
23141
23172
|
{ name: "edit", type: "string", description: "Edit this post (its id) instead: its text." },
|
|
23142
23173
|
{ name: "delete", type: "string", description: "Take this post (its id) back." }
|
|
23143
23174
|
],
|
|
@@ -23197,6 +23228,21 @@ var COMMAND_SPECS = [
|
|
|
23197
23228
|
returns: "EchoThreadSummary",
|
|
23198
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."
|
|
23199
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
|
+
},
|
|
23200
23246
|
{
|
|
23201
23247
|
path: ["echo", "threads", "add"],
|
|
23202
23248
|
summary: "Add a standing thread of your own (Build, Business), pinned under the agent's.",
|
|
@@ -25858,6 +25904,13 @@ var HANDLERS = {
|
|
|
25858
25904
|
}),
|
|
25859
25905
|
render: renderRecord
|
|
25860
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
|
+
},
|
|
25861
25914
|
"echo threads add": echoThreadAdd,
|
|
25862
25915
|
"echo thread add": echoThreadAdd,
|
|
25863
25916
|
"echo threads rename": async ({ args, requireClient }) => {
|
|
@@ -26416,6 +26469,10 @@ function standardLink(flags) {
|
|
|
26416
26469
|
return { kind: "metric", key: metric };
|
|
26417
26470
|
return null;
|
|
26418
26471
|
}
|
|
26472
|
+
function startOfToday() {
|
|
26473
|
+
const now = new Date;
|
|
26474
|
+
return new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
|
26475
|
+
}
|
|
26419
26476
|
async function echoThreadAdd({ args, flags, requireClient }) {
|
|
26420
26477
|
const title = args.join(" ").trim();
|
|
26421
26478
|
if (!title)
|
|
@@ -26540,12 +26597,14 @@ async function agentPost({ io, args, flags, requireClient }) {
|
|
|
26540
26597
|
return { data: { ok: true, deleted: remove }, render: renderRecord };
|
|
26541
26598
|
}
|
|
26542
26599
|
const text = await postText(io, args);
|
|
26600
|
+
const brief = flagString(flags, "brief") === undefined ? undefined : readDataFlag(flags, "brief");
|
|
26543
26601
|
const edit = flagString(flags, "edit");
|
|
26544
26602
|
if (edit !== undefined) {
|
|
26545
26603
|
const body = parseInput(agentPostEditSchema, {
|
|
26546
26604
|
text,
|
|
26547
26605
|
...flagBool(flags, "draft") ? { final: false } : {},
|
|
26548
|
-
level: flagString(flags, "level")
|
|
26606
|
+
level: flagString(flags, "level"),
|
|
26607
|
+
brief
|
|
26549
26608
|
});
|
|
26550
26609
|
return {
|
|
26551
26610
|
data: await client.patch(`/agent/posts/${encodeURIComponent(edit)}`, body),
|
|
@@ -26558,9 +26617,10 @@ async function agentPost({ io, args, flags, requireClient }) {
|
|
|
26558
26617
|
externalId: flagString(flags, "external-id") ?? `cli:${ulid3()}`,
|
|
26559
26618
|
thread: ULID.test(thread) ? { id: thread.toUpperCase() } : { slug: thread, ...member ? { memberId: member } : {} },
|
|
26560
26619
|
text,
|
|
26561
|
-
kind: flagString(flags, "kind"),
|
|
26620
|
+
kind: flagString(flags, "kind") ?? (brief ? "brief" : undefined),
|
|
26562
26621
|
level: flagString(flags, "level"),
|
|
26563
|
-
final: !flagBool(flags, "draft")
|
|
26622
|
+
final: !flagBool(flags, "draft"),
|
|
26623
|
+
brief
|
|
26564
26624
|
});
|
|
26565
26625
|
return { data: await client.post("/agent/posts", body), render: renderRecord };
|
|
26566
26626
|
}
|
|
@@ -26616,18 +26676,18 @@ function mergePreview(before, changes) {
|
|
|
26616
26676
|
}
|
|
26617
26677
|
return changes;
|
|
26618
26678
|
}
|
|
26619
|
-
function readDataFlag(flags) {
|
|
26620
|
-
const raw = flagString(flags,
|
|
26679
|
+
function readDataFlag(flags, name = "data") {
|
|
26680
|
+
const raw = flagString(flags, name);
|
|
26621
26681
|
if (raw === undefined)
|
|
26622
26682
|
return {};
|
|
26623
26683
|
let parsed;
|
|
26624
26684
|
try {
|
|
26625
26685
|
parsed = JSON.parse(raw);
|
|
26626
26686
|
} catch (err) {
|
|
26627
|
-
throw usageError(
|
|
26687
|
+
throw usageError(`--${name} is not valid JSON: ${err.message}`);
|
|
26628
26688
|
}
|
|
26629
26689
|
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
26630
|
-
throw usageError(
|
|
26690
|
+
throw usageError(`--${name} must be a JSON object`);
|
|
26631
26691
|
}
|
|
26632
26692
|
return parsed;
|
|
26633
26693
|
}
|
package/package.json
CHANGED