@robbeverhelst/do 1.159.1 → 1.160.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 +178 -2
- package/package.json +1 -1
package/dist/do.js
CHANGED
|
@@ -19652,9 +19652,16 @@ var agentPageContextSchema = object({
|
|
|
19652
19652
|
}).strict();
|
|
19653
19653
|
var agentChatInputSchema = object({
|
|
19654
19654
|
message: string2().trim().min(1).max(8000),
|
|
19655
|
-
context: agentPageContextSchema
|
|
19655
|
+
context: agentPageContextSchema,
|
|
19656
|
+
threadId: string2().trim().min(1).max(64).optional()
|
|
19656
19657
|
}).strict();
|
|
19657
19658
|
var agentChatEventSchema = discriminatedUnion("type", [
|
|
19659
|
+
object({
|
|
19660
|
+
type: literal("turn"),
|
|
19661
|
+
id: string2(),
|
|
19662
|
+
threadId: string2(),
|
|
19663
|
+
since: string2().nullable()
|
|
19664
|
+
}),
|
|
19658
19665
|
object({ type: literal("delta"), text: string2() }),
|
|
19659
19666
|
object({ type: literal("done") }),
|
|
19660
19667
|
object({ type: literal("error"), message: string2() })
|
|
@@ -20836,7 +20843,7 @@ function parseCapture2(input, now) {
|
|
|
20836
20843
|
|
|
20837
20844
|
// src/meta.ts
|
|
20838
20845
|
var CLI_NAME = "do";
|
|
20839
|
-
var VERSION = "1.
|
|
20846
|
+
var VERSION = "1.160.0";
|
|
20840
20847
|
var API_PREFIX = "/api/v1";
|
|
20841
20848
|
var DEFAULT_API_URL = "http://localhost:3001";
|
|
20842
20849
|
|
|
@@ -21448,6 +21455,25 @@ var COMMAND_SPECS = [
|
|
|
21448
21455
|
scopes: ["tasks:read"],
|
|
21449
21456
|
returns: "ReviewDayStat"
|
|
21450
21457
|
},
|
|
21458
|
+
{
|
|
21459
|
+
path: ["progress"],
|
|
21460
|
+
summary: "How the last 7/30/90 days went: tasks, habits and time blocks done per day.",
|
|
21461
|
+
args: [],
|
|
21462
|
+
flags: [
|
|
21463
|
+
{ name: "days", type: "string", description: "The range: 7 (default), 30 or 90 days." }
|
|
21464
|
+
],
|
|
21465
|
+
scopes: ["tasks:read", "habits:read"],
|
|
21466
|
+
returns: "ProgressResponse",
|
|
21467
|
+
notes: "GET /api/v1/progress \u2014 days are your saved timezone's. Includes the week/month vs the period before, best day, Areas and each habit's rate."
|
|
21468
|
+
},
|
|
21469
|
+
{
|
|
21470
|
+
path: ["progress", "day"],
|
|
21471
|
+
summary: "One day of Progress: what was done (and by whom) and what slipped.",
|
|
21472
|
+
args: [{ name: "date", required: true, description: "The day, YYYY-MM-DD." }],
|
|
21473
|
+
flags: [],
|
|
21474
|
+
scopes: ["tasks:read", "habits:read"],
|
|
21475
|
+
returns: "ProgressDayDetail"
|
|
21476
|
+
},
|
|
21451
21477
|
{
|
|
21452
21478
|
path: ["search"],
|
|
21453
21479
|
summary: "Search node titles and note bodies across the Space.",
|
|
@@ -21797,6 +21823,42 @@ var COMMAND_SPECS = [
|
|
|
21797
21823
|
returns: "None",
|
|
21798
21824
|
notes: "Owner/admin only. An Agent's key gets a 428 confirmation_required until the member confirms in the Echo panel."
|
|
21799
21825
|
},
|
|
21826
|
+
{
|
|
21827
|
+
path: ["echo", "threads", "list"],
|
|
21828
|
+
summary: "List your recent Echo threads, newest first.",
|
|
21829
|
+
args: [],
|
|
21830
|
+
flags: [{ name: "limit", type: "string", description: "How many, 1\u201350 (default 10)." }],
|
|
21831
|
+
scopes: ["agents:read"],
|
|
21832
|
+
returns: "EchoThreadSummary",
|
|
21833
|
+
notes: "The key's member's own threads; the title is the thread's first question."
|
|
21834
|
+
},
|
|
21835
|
+
{
|
|
21836
|
+
path: ["echo", "threads", "current"],
|
|
21837
|
+
summary: "Show the Echo thread the panel opens on, with its turns.",
|
|
21838
|
+
args: [],
|
|
21839
|
+
flags: [],
|
|
21840
|
+
scopes: ["agents:read"],
|
|
21841
|
+
returns: "{ thread: EchoThread | null }",
|
|
21842
|
+
notes: "The most recently used thread; `thread` is null before the first question."
|
|
21843
|
+
},
|
|
21844
|
+
{
|
|
21845
|
+
path: ["echo", "threads", "show"],
|
|
21846
|
+
summary: "Show one of your Echo threads, with its turns.",
|
|
21847
|
+
args: [{ name: "id", required: true, description: "Thread ULID (see `echo threads list`)." }],
|
|
21848
|
+
flags: [],
|
|
21849
|
+
scopes: ["agents:read"],
|
|
21850
|
+
returns: "EchoThread",
|
|
21851
|
+
notes: "Another member's thread is a 404."
|
|
21852
|
+
},
|
|
21853
|
+
{
|
|
21854
|
+
path: ["echo", "threads", "new"],
|
|
21855
|
+
summary: "Start a new Echo conversation (it becomes the current thread).",
|
|
21856
|
+
args: [],
|
|
21857
|
+
flags: [],
|
|
21858
|
+
scopes: ["agents:write"],
|
|
21859
|
+
returns: "EchoThread",
|
|
21860
|
+
notes: "When the current thread is still empty, that one is returned instead."
|
|
21861
|
+
},
|
|
21800
21862
|
{
|
|
21801
21863
|
path: ["settings", "get"],
|
|
21802
21864
|
summary: "Show the caller's settings for the Space.",
|
|
@@ -22914,6 +22976,26 @@ function shortDate(iso) {
|
|
|
22914
22976
|
return iso;
|
|
22915
22977
|
return d.toISOString().slice(0, 16).replace("T", " ");
|
|
22916
22978
|
}
|
|
22979
|
+
function renderEchoThread(data, mode) {
|
|
22980
|
+
const wrapped = data;
|
|
22981
|
+
const thread = wrapped && typeof wrapped === "object" && "thread" in wrapped ? wrapped.thread : data;
|
|
22982
|
+
if (!thread)
|
|
22983
|
+
return paint(mode, "dim", "No Echo thread yet.");
|
|
22984
|
+
const head = `${thread.title ?? "New conversation"} ${paint(mode, "dim", thread.id ?? "")}`;
|
|
22985
|
+
const turns = thread.turns ?? [];
|
|
22986
|
+
if (turns.length === 0)
|
|
22987
|
+
return `${head}
|
|
22988
|
+
${paint(mode, "dim", "(nothing asked yet)")}`;
|
|
22989
|
+
const lines = turns.flatMap((t) => {
|
|
22990
|
+
const note = t.status === "error" ? ` (failed: ${t.error ?? "error"})` : t.status === "cancelled" ? " (stopped)" : t.status === "streaming" ? " (still answering)" : "";
|
|
22991
|
+
return [
|
|
22992
|
+
` ${paint(mode, "bold", "You")} ${t.question ?? ""}`,
|
|
22993
|
+
` ${paint(mode, "bold", "Echo")} ${t.reply ?? ""}${paint(mode, "dim", note)}`
|
|
22994
|
+
];
|
|
22995
|
+
});
|
|
22996
|
+
return [head, ...lines].join(`
|
|
22997
|
+
`);
|
|
22998
|
+
}
|
|
22917
22999
|
function actorText(actor) {
|
|
22918
23000
|
if (!actor)
|
|
22919
23001
|
return "system";
|
|
@@ -22950,6 +23032,68 @@ function renderReview(data, mode) {
|
|
|
22950
23032
|
return days.map((d) => `${d.date ?? "?"} ${d.completedTasks ?? 0} task(s) \xB7 ${d.completedOccurrences ?? 0} habit/routine`).join(`
|
|
22951
23033
|
`);
|
|
22952
23034
|
}
|
|
23035
|
+
var percent = (share) => share === null || share === undefined ? "\u2013" : `${Math.round(share * 100)}%`;
|
|
23036
|
+
function delta(now, before) {
|
|
23037
|
+
const d = now - before;
|
|
23038
|
+
return d > 0 ? `+${d}` : d < 0 ? `\u2212${-d}` : "\xB10";
|
|
23039
|
+
}
|
|
23040
|
+
function renderProgress(data, mode) {
|
|
23041
|
+
const p = data;
|
|
23042
|
+
const t = p.today;
|
|
23043
|
+
const out = [
|
|
23044
|
+
paint(mode, "bold", `Progress \xB7 ${p.range?.from ?? "?"} \u2192 ${p.range?.to ?? "?"} (${p.range?.timezone ?? "?"})`)
|
|
23045
|
+
];
|
|
23046
|
+
if (t) {
|
|
23047
|
+
out.push(`Today ${t.tasksDone}/${t.tasksPlanned} tasks \xB7 ${t.habitsDone}/${t.habitsDue} habits \xB7 ${t.blocksDone}/${t.blocksPlanned} blocks \xB7 ${percent(t.completion)} done`);
|
|
23048
|
+
}
|
|
23049
|
+
const days = p.days ?? [];
|
|
23050
|
+
if (days.length > 0) {
|
|
23051
|
+
out.push("");
|
|
23052
|
+
for (const d of days) {
|
|
23053
|
+
const agents = d.tasksDoneAgents ? ` (+${d.tasksDoneAgents} by agents)` : "";
|
|
23054
|
+
out.push(`${d.date} ${d.tasksDoneMine} task(s)${agents} \xB7 ${d.habitsDone}/${d.habitsDue} habits \xB7 ${percent(d.completion)}`);
|
|
23055
|
+
}
|
|
23056
|
+
}
|
|
23057
|
+
const totals = p.totals;
|
|
23058
|
+
if (totals) {
|
|
23059
|
+
const line = (label, x) => `${label} ${x.tasksDone} tasks (${delta(x.tasksDone, x.previous.tasksDone)}) \xB7 ${x.habitsDone} habits (${delta(x.habitsDone, x.previous.habitsDone)}) \xB7 ${percent(x.completion)} done`;
|
|
23060
|
+
out.push("", line("This week ", totals.week), line("This month", totals.month));
|
|
23061
|
+
const best = totals.bestDay ? `${totals.bestDay.date} (${totals.bestDay.tasksDone})` : "\u2013";
|
|
23062
|
+
out.push(`Best day ${best} \xB7 ${totals.averagePerDay.tasksDone} tasks/day \xB7 on time ${totals.onTime}, late ${totals.late}`);
|
|
23063
|
+
}
|
|
23064
|
+
const areas = p.areas ?? [];
|
|
23065
|
+
if (areas.length > 0) {
|
|
23066
|
+
out.push("", paint(mode, "bold", "Areas"));
|
|
23067
|
+
for (const a of areas)
|
|
23068
|
+
out.push(` ${a.name}: ${a.tasksDone}`);
|
|
23069
|
+
}
|
|
23070
|
+
const habits = p.habits ?? [];
|
|
23071
|
+
if (habits.length > 0) {
|
|
23072
|
+
out.push("", paint(mode, "bold", "Habits"));
|
|
23073
|
+
for (const h of habits)
|
|
23074
|
+
out.push(` ${h.name}: ${h.done}/${h.due} (${percent(h.rate)})`);
|
|
23075
|
+
}
|
|
23076
|
+
return out.join(`
|
|
23077
|
+
`);
|
|
23078
|
+
}
|
|
23079
|
+
function renderProgressDay(data, mode) {
|
|
23080
|
+
const d = data;
|
|
23081
|
+
const done = d.done ?? [];
|
|
23082
|
+
const slipped = d.slipped ?? [];
|
|
23083
|
+
const out = [
|
|
23084
|
+
paint(mode, "bold", `${d.date ?? "?"} \xB7 ${done.length} done \xB7 ${slipped.length} slipped`)
|
|
23085
|
+
];
|
|
23086
|
+
for (const item of done) {
|
|
23087
|
+
const tags = [item.kind, item.owner === "agent" ? "agent" : null, item.late ? "late" : null].filter(Boolean).join(", ");
|
|
23088
|
+
out.push(` \u2713 ${item.title} ${paint(mode, "dim", `(${tags})`)}`);
|
|
23089
|
+
}
|
|
23090
|
+
for (const item of slipped)
|
|
23091
|
+
out.push(` \xB7 ${item.title} ${paint(mode, "dim", `(${item.kind})`)}`);
|
|
23092
|
+
if (done.length === 0 && slipped.length === 0)
|
|
23093
|
+
out.push(paint(mode, "dim", " (nothing that day)"));
|
|
23094
|
+
return out.join(`
|
|
23095
|
+
`);
|
|
23096
|
+
}
|
|
22953
23097
|
function renderSearch(data, mode) {
|
|
22954
23098
|
const hits = Array.isArray(data) ? data : [];
|
|
22955
23099
|
if (hits.length === 0)
|
|
@@ -23255,6 +23399,20 @@ var HANDLERS = {
|
|
|
23255
23399
|
}),
|
|
23256
23400
|
render: renderReview
|
|
23257
23401
|
}),
|
|
23402
|
+
progress: async ({ flags, requireClient }) => ({
|
|
23403
|
+
data: await requireClient().get("/progress", { query: { days: flagString(flags, "days") } }),
|
|
23404
|
+
render: renderProgress
|
|
23405
|
+
}),
|
|
23406
|
+
"progress day": async ({ args, requireClient }) => {
|
|
23407
|
+
const date = requireArg(args, 0, "date");
|
|
23408
|
+
if (!/^\d{4}-\d{2}-\d{2}$/.test(date)) {
|
|
23409
|
+
throw usageError("progress day needs a date as YYYY-MM-DD, e.g. `do progress day 2026-10-15`");
|
|
23410
|
+
}
|
|
23411
|
+
return {
|
|
23412
|
+
data: await requireClient().get(`/progress/days/${date}`),
|
|
23413
|
+
render: renderProgressDay
|
|
23414
|
+
};
|
|
23415
|
+
},
|
|
23258
23416
|
search: async ({ args, flags, requireClient }) => {
|
|
23259
23417
|
const q = args.join(" ").trim();
|
|
23260
23418
|
if (q.length === 0)
|
|
@@ -23513,6 +23671,24 @@ var HANDLERS = {
|
|
|
23513
23671
|
await requireClient().delete("/agent/connection");
|
|
23514
23672
|
return { data: { ok: true, removed: "agent connection" }, render: renderRecord };
|
|
23515
23673
|
},
|
|
23674
|
+
"echo threads list": async ({ flags, requireClient }) => ({
|
|
23675
|
+
data: await requireClient().getPage("/echo/threads", {
|
|
23676
|
+
query: { limit: flagString(flags, "limit") }
|
|
23677
|
+
}),
|
|
23678
|
+
render: renderList
|
|
23679
|
+
}),
|
|
23680
|
+
"echo threads current": async ({ requireClient }) => ({
|
|
23681
|
+
data: await requireClient().get("/echo/threads/current"),
|
|
23682
|
+
render: renderEchoThread
|
|
23683
|
+
}),
|
|
23684
|
+
"echo threads show": async ({ args, requireClient }) => ({
|
|
23685
|
+
data: await requireClient().get(`/echo/threads/${requireArg(args, 0, "thread id")}`),
|
|
23686
|
+
render: renderEchoThread
|
|
23687
|
+
}),
|
|
23688
|
+
"echo threads new": async ({ requireClient }) => ({
|
|
23689
|
+
data: await requireClient().post("/echo/threads", {}),
|
|
23690
|
+
render: renderEchoThread
|
|
23691
|
+
}),
|
|
23516
23692
|
"settings get": async ({ requireClient }) => ({
|
|
23517
23693
|
data: await requireClient().get("/settings"),
|
|
23518
23694
|
render: renderRecord
|
package/package.json
CHANGED