@robbeverhelst/do 1.179.0 → 1.180.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 +142 -1
- package/package.json +1 -1
package/dist/do.js
CHANGED
|
@@ -21640,7 +21640,7 @@ function parseCapture2(input, now) {
|
|
|
21640
21640
|
|
|
21641
21641
|
// src/meta.ts
|
|
21642
21642
|
var CLI_NAME = "do";
|
|
21643
|
-
var VERSION = "1.
|
|
21643
|
+
var VERSION = "1.180.0";
|
|
21644
21644
|
var API_PREFIX = "/api/v1";
|
|
21645
21645
|
var DEFAULT_API_URL = "http://localhost:3001";
|
|
21646
21646
|
|
|
@@ -23186,6 +23186,80 @@ var COMMAND_SPECS = [
|
|
|
23186
23186
|
returns: "EchoThreadSummary",
|
|
23187
23187
|
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
23188
|
},
|
|
23189
|
+
{
|
|
23190
|
+
path: ["echo", "threads", "add"],
|
|
23191
|
+
summary: "Add a standing thread of your own (Build, Business), pinned under the agent's.",
|
|
23192
|
+
args: [{ name: "title", required: true, description: "Its name (`Build`)." }],
|
|
23193
|
+
flags: [
|
|
23194
|
+
{
|
|
23195
|
+
name: "slug",
|
|
23196
|
+
type: "string",
|
|
23197
|
+
description: "What the agent and scripts address it by (default: from the title)."
|
|
23198
|
+
},
|
|
23199
|
+
{ name: "areas", type: "string", description: "Area ids it covers, comma-separated." }
|
|
23200
|
+
],
|
|
23201
|
+
scopes: ["agents:write"],
|
|
23202
|
+
returns: "EchoThread",
|
|
23203
|
+
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>`."
|
|
23204
|
+
},
|
|
23205
|
+
{
|
|
23206
|
+
path: ["echo", "thread", "add"],
|
|
23207
|
+
summary: "Same as `echo threads add`.",
|
|
23208
|
+
args: [{ name: "title", required: true, description: "Its name (`Build`)." }],
|
|
23209
|
+
flags: [
|
|
23210
|
+
{
|
|
23211
|
+
name: "slug",
|
|
23212
|
+
type: "string",
|
|
23213
|
+
description: "What the agent and scripts address it by (default: from the title)."
|
|
23214
|
+
},
|
|
23215
|
+
{ name: "areas", type: "string", description: "Area ids it covers, comma-separated." }
|
|
23216
|
+
],
|
|
23217
|
+
scopes: ["agents:write"],
|
|
23218
|
+
returns: "EchoThread"
|
|
23219
|
+
},
|
|
23220
|
+
{
|
|
23221
|
+
path: ["echo", "threads", "rename"],
|
|
23222
|
+
summary: "Rename one of your agent threads.",
|
|
23223
|
+
args: [
|
|
23224
|
+
{ name: "thread", required: true, description: "Its id, or a standing thread's slug." },
|
|
23225
|
+
{ name: "title", required: true, description: "The new name." }
|
|
23226
|
+
],
|
|
23227
|
+
flags: [],
|
|
23228
|
+
scopes: ["agents:write"],
|
|
23229
|
+
returns: "EchoThreadSummary"
|
|
23230
|
+
},
|
|
23231
|
+
{
|
|
23232
|
+
path: ["echo", "threads", "link"],
|
|
23233
|
+
summary: "Set the Areas a standing thread covers, so its brief knows where to look.",
|
|
23234
|
+
args: [{ name: "thread", required: true, description: "Its id, or its slug." }],
|
|
23235
|
+
flags: [
|
|
23236
|
+
{
|
|
23237
|
+
name: "areas",
|
|
23238
|
+
type: "string",
|
|
23239
|
+
description: "Area ids, comma-separated (replaces the list; '' unlinks them all)."
|
|
23240
|
+
}
|
|
23241
|
+
],
|
|
23242
|
+
scopes: ["agents:write"],
|
|
23243
|
+
returns: "EchoThreadSummary",
|
|
23244
|
+
notes: "Links only: a thread never becomes an Area."
|
|
23245
|
+
},
|
|
23246
|
+
{
|
|
23247
|
+
path: ["echo", "threads", "archive"],
|
|
23248
|
+
summary: "Archive one of your agent threads.",
|
|
23249
|
+
args: [{ name: "thread", required: true, description: "Its id, or a standing thread's slug." }],
|
|
23250
|
+
flags: [],
|
|
23251
|
+
scopes: ["agents:write"],
|
|
23252
|
+
returns: "EchoThreadSummary",
|
|
23253
|
+
notes: "It leaves your list and its slug no longer reaches it. The home thread (the agent's) can't be archived."
|
|
23254
|
+
},
|
|
23255
|
+
{
|
|
23256
|
+
path: ["echo", "threads", "restore"],
|
|
23257
|
+
summary: "Bring an archived thread back.",
|
|
23258
|
+
args: [{ name: "id", required: true, description: "Thread ULID." }],
|
|
23259
|
+
flags: [],
|
|
23260
|
+
scopes: ["agents:write"],
|
|
23261
|
+
returns: "EchoThreadSummary"
|
|
23262
|
+
},
|
|
23189
23263
|
{
|
|
23190
23264
|
path: ["settings", "get"],
|
|
23191
23265
|
summary: "Show the caller's settings for the Space.",
|
|
@@ -25773,6 +25847,44 @@ var HANDLERS = {
|
|
|
25773
25847
|
}),
|
|
25774
25848
|
render: renderRecord
|
|
25775
25849
|
}),
|
|
25850
|
+
"echo threads add": echoThreadAdd,
|
|
25851
|
+
"echo thread add": echoThreadAdd,
|
|
25852
|
+
"echo threads rename": async ({ args, requireClient }) => {
|
|
25853
|
+
const client = requireClient();
|
|
25854
|
+
const id = await echoThreadId(client, requireArg(args, 0, "thread"));
|
|
25855
|
+
const title = args.slice(1).join(" ").trim();
|
|
25856
|
+
if (!title)
|
|
25857
|
+
throw usageError("missing required argument: <title>");
|
|
25858
|
+
return { data: await client.patch(`/echo/threads/${id}`, { title }), render: renderRecord };
|
|
25859
|
+
},
|
|
25860
|
+
"echo threads link": async ({ args, flags, requireClient }) => {
|
|
25861
|
+
const client = requireClient();
|
|
25862
|
+
const id = await echoThreadId(client, requireArg(args, 0, "thread"));
|
|
25863
|
+
const areas = flagString(flags, "areas");
|
|
25864
|
+
if (areas === undefined)
|
|
25865
|
+
throw usageError("pass --areas <id,id> (--areas '' unlinks them all)");
|
|
25866
|
+
const areaIds = splitList(areas);
|
|
25867
|
+
return {
|
|
25868
|
+
data: await client.patch(`/echo/threads/${id}`, { areaIds }),
|
|
25869
|
+
render: renderRecord
|
|
25870
|
+
};
|
|
25871
|
+
},
|
|
25872
|
+
"echo threads archive": async ({ args, requireClient }) => {
|
|
25873
|
+
const client = requireClient();
|
|
25874
|
+
const id = await echoThreadId(client, requireArg(args, 0, "thread"));
|
|
25875
|
+
return {
|
|
25876
|
+
data: await client.patch(`/echo/threads/${id}`, { archived: true }),
|
|
25877
|
+
render: renderRecord
|
|
25878
|
+
};
|
|
25879
|
+
},
|
|
25880
|
+
"echo threads restore": async ({ args, requireClient }) => {
|
|
25881
|
+
const client = requireClient();
|
|
25882
|
+
const id = requireArg(args, 0, "thread id");
|
|
25883
|
+
return {
|
|
25884
|
+
data: await client.patch(`/echo/threads/${id}`, { archived: false }),
|
|
25885
|
+
render: renderRecord
|
|
25886
|
+
};
|
|
25887
|
+
},
|
|
25776
25888
|
"settings get": async ({ requireClient }) => ({
|
|
25777
25889
|
data: await requireClient().get("/settings"),
|
|
25778
25890
|
render: renderRecord
|
|
@@ -26293,6 +26405,35 @@ function standardLink(flags) {
|
|
|
26293
26405
|
return { kind: "metric", key: metric };
|
|
26294
26406
|
return null;
|
|
26295
26407
|
}
|
|
26408
|
+
async function echoThreadAdd({ args, flags, requireClient }) {
|
|
26409
|
+
const title = args.join(" ").trim();
|
|
26410
|
+
if (!title)
|
|
26411
|
+
throw usageError("missing required argument: <title>");
|
|
26412
|
+
const slug = flagString(flags, "slug");
|
|
26413
|
+
const areas = flagString(flags, "areas");
|
|
26414
|
+
return {
|
|
26415
|
+
data: await requireClient().post("/echo/threads/standing", {
|
|
26416
|
+
title,
|
|
26417
|
+
...slug ? { slug } : {},
|
|
26418
|
+
...areas === undefined ? {} : { areaIds: splitList(areas) }
|
|
26419
|
+
}),
|
|
26420
|
+
render: renderEchoThread
|
|
26421
|
+
};
|
|
26422
|
+
}
|
|
26423
|
+
async function echoThreadId(client, ref) {
|
|
26424
|
+
if (ULID.test(ref))
|
|
26425
|
+
return ref;
|
|
26426
|
+
const threads = await client.get("/echo/threads", {
|
|
26427
|
+
query: { limit: "50" }
|
|
26428
|
+
});
|
|
26429
|
+
const found = threads.find((t) => t.slug === ref);
|
|
26430
|
+
if (!found)
|
|
26431
|
+
throw usageError(`no thread \`${ref}\` (see \`do echo threads list\`)`);
|
|
26432
|
+
return found.id;
|
|
26433
|
+
}
|
|
26434
|
+
function splitList(value) {
|
|
26435
|
+
return value.split(",").map((v) => v.trim()).filter((v) => v.length > 0);
|
|
26436
|
+
}
|
|
26296
26437
|
function requireArg(args, index, name) {
|
|
26297
26438
|
const value = args[index];
|
|
26298
26439
|
if (value === undefined || value.length === 0) {
|
package/package.json
CHANGED