@robbeverhelst/do 1.179.0 → 1.180.1
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 +150 -2
- package/package.json +1 -1
package/dist/do.js
CHANGED
|
@@ -19269,13 +19269,20 @@ var areaViewSchema = areaSchema.extend({
|
|
|
19269
19269
|
var areaProjectSchema = projectViewSchema.extend({
|
|
19270
19270
|
tasks: array(taskViewSchema)
|
|
19271
19271
|
});
|
|
19272
|
+
var areaCollectionItemSchema = object({
|
|
19273
|
+
id: string2(),
|
|
19274
|
+
title: string2(),
|
|
19275
|
+
type: string2(),
|
|
19276
|
+
status: string2()
|
|
19277
|
+
});
|
|
19272
19278
|
var areaDetailSchema = areaViewSchema.extend({
|
|
19273
19279
|
standards: array(areaStandardViewSchema).default([]),
|
|
19274
19280
|
projects: array(areaProjectSchema),
|
|
19275
19281
|
habits: array(habitSummarySchema),
|
|
19276
19282
|
routines: array(routineViewSchema),
|
|
19277
19283
|
tasks: array(taskViewSchema),
|
|
19278
|
-
notes: array(noteViewSchema)
|
|
19284
|
+
notes: array(noteViewSchema),
|
|
19285
|
+
collectionItems: array(areaCollectionItemSchema).default([])
|
|
19279
19286
|
});
|
|
19280
19287
|
var areaOwnerLensSchema = _enum2(["mine", "agents", "all"]);
|
|
19281
19288
|
var areaOverviewQuerySchema = object({
|
|
@@ -21640,7 +21647,7 @@ function parseCapture2(input, now) {
|
|
|
21640
21647
|
|
|
21641
21648
|
// src/meta.ts
|
|
21642
21649
|
var CLI_NAME = "do";
|
|
21643
|
-
var VERSION = "1.
|
|
21650
|
+
var VERSION = "1.180.1";
|
|
21644
21651
|
var API_PREFIX = "/api/v1";
|
|
21645
21652
|
var DEFAULT_API_URL = "http://localhost:3001";
|
|
21646
21653
|
|
|
@@ -23186,6 +23193,80 @@ var COMMAND_SPECS = [
|
|
|
23186
23193
|
returns: "EchoThreadSummary",
|
|
23187
23194
|
notes: "For later and Silent posts never push. The home thread and conversations start at all, a standing thread you add at needs_you."
|
|
23188
23195
|
},
|
|
23196
|
+
{
|
|
23197
|
+
path: ["echo", "threads", "add"],
|
|
23198
|
+
summary: "Add a standing thread of your own (Build, Business), pinned under the agent's.",
|
|
23199
|
+
args: [{ name: "title", required: true, description: "Its name (`Build`)." }],
|
|
23200
|
+
flags: [
|
|
23201
|
+
{
|
|
23202
|
+
name: "slug",
|
|
23203
|
+
type: "string",
|
|
23204
|
+
description: "What the agent and scripts address it by (default: from the title)."
|
|
23205
|
+
},
|
|
23206
|
+
{ name: "areas", type: "string", description: "Area ids it covers, comma-separated." }
|
|
23207
|
+
],
|
|
23208
|
+
scopes: ["agents:write"],
|
|
23209
|
+
returns: "EchoThread",
|
|
23210
|
+
notes: "A slug you already use is a 409; an archived thread's slug brings that thread back. The agent can post to it with `do echo post --thread <slug>`."
|
|
23211
|
+
},
|
|
23212
|
+
{
|
|
23213
|
+
path: ["echo", "thread", "add"],
|
|
23214
|
+
summary: "Same as `echo threads add`.",
|
|
23215
|
+
args: [{ name: "title", required: true, description: "Its name (`Build`)." }],
|
|
23216
|
+
flags: [
|
|
23217
|
+
{
|
|
23218
|
+
name: "slug",
|
|
23219
|
+
type: "string",
|
|
23220
|
+
description: "What the agent and scripts address it by (default: from the title)."
|
|
23221
|
+
},
|
|
23222
|
+
{ name: "areas", type: "string", description: "Area ids it covers, comma-separated." }
|
|
23223
|
+
],
|
|
23224
|
+
scopes: ["agents:write"],
|
|
23225
|
+
returns: "EchoThread"
|
|
23226
|
+
},
|
|
23227
|
+
{
|
|
23228
|
+
path: ["echo", "threads", "rename"],
|
|
23229
|
+
summary: "Rename one of your agent threads.",
|
|
23230
|
+
args: [
|
|
23231
|
+
{ name: "thread", required: true, description: "Its id, or a standing thread's slug." },
|
|
23232
|
+
{ name: "title", required: true, description: "The new name." }
|
|
23233
|
+
],
|
|
23234
|
+
flags: [],
|
|
23235
|
+
scopes: ["agents:write"],
|
|
23236
|
+
returns: "EchoThreadSummary"
|
|
23237
|
+
},
|
|
23238
|
+
{
|
|
23239
|
+
path: ["echo", "threads", "link"],
|
|
23240
|
+
summary: "Set the Areas a standing thread covers, so its brief knows where to look.",
|
|
23241
|
+
args: [{ name: "thread", required: true, description: "Its id, or its slug." }],
|
|
23242
|
+
flags: [
|
|
23243
|
+
{
|
|
23244
|
+
name: "areas",
|
|
23245
|
+
type: "string",
|
|
23246
|
+
description: "Area ids, comma-separated (replaces the list; '' unlinks them all)."
|
|
23247
|
+
}
|
|
23248
|
+
],
|
|
23249
|
+
scopes: ["agents:write"],
|
|
23250
|
+
returns: "EchoThreadSummary",
|
|
23251
|
+
notes: "Links only: a thread never becomes an Area."
|
|
23252
|
+
},
|
|
23253
|
+
{
|
|
23254
|
+
path: ["echo", "threads", "archive"],
|
|
23255
|
+
summary: "Archive one of your agent threads.",
|
|
23256
|
+
args: [{ name: "thread", required: true, description: "Its id, or a standing thread's slug." }],
|
|
23257
|
+
flags: [],
|
|
23258
|
+
scopes: ["agents:write"],
|
|
23259
|
+
returns: "EchoThreadSummary",
|
|
23260
|
+
notes: "It leaves your list and its slug no longer reaches it. The home thread (the agent's) can't be archived."
|
|
23261
|
+
},
|
|
23262
|
+
{
|
|
23263
|
+
path: ["echo", "threads", "restore"],
|
|
23264
|
+
summary: "Bring an archived thread back.",
|
|
23265
|
+
args: [{ name: "id", required: true, description: "Thread ULID." }],
|
|
23266
|
+
flags: [],
|
|
23267
|
+
scopes: ["agents:write"],
|
|
23268
|
+
returns: "EchoThreadSummary"
|
|
23269
|
+
},
|
|
23189
23270
|
{
|
|
23190
23271
|
path: ["settings", "get"],
|
|
23191
23272
|
summary: "Show the caller's settings for the Space.",
|
|
@@ -25773,6 +25854,44 @@ var HANDLERS = {
|
|
|
25773
25854
|
}),
|
|
25774
25855
|
render: renderRecord
|
|
25775
25856
|
}),
|
|
25857
|
+
"echo threads add": echoThreadAdd,
|
|
25858
|
+
"echo thread add": echoThreadAdd,
|
|
25859
|
+
"echo threads rename": async ({ args, requireClient }) => {
|
|
25860
|
+
const client = requireClient();
|
|
25861
|
+
const id = await echoThreadId(client, requireArg(args, 0, "thread"));
|
|
25862
|
+
const title = args.slice(1).join(" ").trim();
|
|
25863
|
+
if (!title)
|
|
25864
|
+
throw usageError("missing required argument: <title>");
|
|
25865
|
+
return { data: await client.patch(`/echo/threads/${id}`, { title }), render: renderRecord };
|
|
25866
|
+
},
|
|
25867
|
+
"echo threads link": async ({ args, flags, requireClient }) => {
|
|
25868
|
+
const client = requireClient();
|
|
25869
|
+
const id = await echoThreadId(client, requireArg(args, 0, "thread"));
|
|
25870
|
+
const areas = flagString(flags, "areas");
|
|
25871
|
+
if (areas === undefined)
|
|
25872
|
+
throw usageError("pass --areas <id,id> (--areas '' unlinks them all)");
|
|
25873
|
+
const areaIds = splitList(areas);
|
|
25874
|
+
return {
|
|
25875
|
+
data: await client.patch(`/echo/threads/${id}`, { areaIds }),
|
|
25876
|
+
render: renderRecord
|
|
25877
|
+
};
|
|
25878
|
+
},
|
|
25879
|
+
"echo threads archive": async ({ args, requireClient }) => {
|
|
25880
|
+
const client = requireClient();
|
|
25881
|
+
const id = await echoThreadId(client, requireArg(args, 0, "thread"));
|
|
25882
|
+
return {
|
|
25883
|
+
data: await client.patch(`/echo/threads/${id}`, { archived: true }),
|
|
25884
|
+
render: renderRecord
|
|
25885
|
+
};
|
|
25886
|
+
},
|
|
25887
|
+
"echo threads restore": async ({ args, requireClient }) => {
|
|
25888
|
+
const client = requireClient();
|
|
25889
|
+
const id = requireArg(args, 0, "thread id");
|
|
25890
|
+
return {
|
|
25891
|
+
data: await client.patch(`/echo/threads/${id}`, { archived: false }),
|
|
25892
|
+
render: renderRecord
|
|
25893
|
+
};
|
|
25894
|
+
},
|
|
25776
25895
|
"settings get": async ({ requireClient }) => ({
|
|
25777
25896
|
data: await requireClient().get("/settings"),
|
|
25778
25897
|
render: renderRecord
|
|
@@ -26293,6 +26412,35 @@ function standardLink(flags) {
|
|
|
26293
26412
|
return { kind: "metric", key: metric };
|
|
26294
26413
|
return null;
|
|
26295
26414
|
}
|
|
26415
|
+
async function echoThreadAdd({ args, flags, requireClient }) {
|
|
26416
|
+
const title = args.join(" ").trim();
|
|
26417
|
+
if (!title)
|
|
26418
|
+
throw usageError("missing required argument: <title>");
|
|
26419
|
+
const slug = flagString(flags, "slug");
|
|
26420
|
+
const areas = flagString(flags, "areas");
|
|
26421
|
+
return {
|
|
26422
|
+
data: await requireClient().post("/echo/threads/standing", {
|
|
26423
|
+
title,
|
|
26424
|
+
...slug ? { slug } : {},
|
|
26425
|
+
...areas === undefined ? {} : { areaIds: splitList(areas) }
|
|
26426
|
+
}),
|
|
26427
|
+
render: renderEchoThread
|
|
26428
|
+
};
|
|
26429
|
+
}
|
|
26430
|
+
async function echoThreadId(client, ref) {
|
|
26431
|
+
if (ULID.test(ref))
|
|
26432
|
+
return ref;
|
|
26433
|
+
const threads = await client.get("/echo/threads", {
|
|
26434
|
+
query: { limit: "50" }
|
|
26435
|
+
});
|
|
26436
|
+
const found = threads.find((t) => t.slug === ref);
|
|
26437
|
+
if (!found)
|
|
26438
|
+
throw usageError(`no thread \`${ref}\` (see \`do echo threads list\`)`);
|
|
26439
|
+
return found.id;
|
|
26440
|
+
}
|
|
26441
|
+
function splitList(value) {
|
|
26442
|
+
return value.split(",").map((v) => v.trim()).filter((v) => v.length > 0);
|
|
26443
|
+
}
|
|
26296
26444
|
function requireArg(args, index, name) {
|
|
26297
26445
|
const value = args[index];
|
|
26298
26446
|
if (value === undefined || value.length === 0) {
|
package/package.json
CHANGED