@sjawhar/pi-envoy 16.37.1 → 16.38.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/dispatch.js +44 -1
- package/dist/envoy.js +20 -1
- package/package.json +1 -1
package/dist/dispatch.js
CHANGED
|
@@ -15432,6 +15432,22 @@ var dispatchToolSpecs = [
|
|
|
15432
15432
|
}),
|
|
15433
15433
|
validation: messageValidation
|
|
15434
15434
|
},
|
|
15435
|
+
{
|
|
15436
|
+
name: "dispatch_send_to_agent",
|
|
15437
|
+
example: {
|
|
15438
|
+
session: "01234567-0000-4000-8000-000000000001",
|
|
15439
|
+
body: "DSP-1: the rota is nowhere written down. Please write it up.",
|
|
15440
|
+
delivery: "aside"
|
|
15441
|
+
},
|
|
15442
|
+
description: "Hand a piece of work to one agent session, in that session's own conversation, which belongs to no " + "issue: the way to reach the agent already on the work - the session holding an issue's claim, or one " + "you are working with. Name the issue in the body, because this message carries none. It is not how " + "you reach a person (dispatch message, or dispatch ask for something only a person can do), and not a " + "note on an issue (dispatch message --issue), which everyone reading that issue sees; this reaches that " + "one session. It spends that session a turn, so send once and read the reply with " + "dispatch read --message <id> rather than sending again. The call is answered once its first delivery " + "attempt has settled. It needs a credential holding the person scope, and one without it is refused " + `403 OAUTH_SCOPE_REQUIRED, naming the scope. ${BODY_BLOCK_RULE}`,
|
|
15443
|
+
arguments: (z) => ({
|
|
15444
|
+
session: z.string({ min: 1 }).describe("The session to send to, by its bare session id. An issue's claim names the session holding it, " + "and dispatch whoami names this session's own."),
|
|
15445
|
+
body: z.string({ min: 1 }).describe(`The words the session reads. Name the issue they are about: this message carries none. ${BODY_BLOCK_RULE}`),
|
|
15446
|
+
delivery: z.enum(["btw", "aside", "steer"]).describe("How the words reach the session: btw waits for its next turn, aside reaches it while a turn " + "runs, and steer goes in as a keystroke at its terminal. A session advertises the modes it " + "takes, and Dispatch sends the mode you name rather than another."),
|
|
15447
|
+
in_reply_to: z.string().describe("Optional id of a message in this same session-to-session conversation, threading this message " + "under it; without it the message starts a conversation of its own.").optional()
|
|
15448
|
+
}),
|
|
15449
|
+
strict: true
|
|
15450
|
+
},
|
|
15435
15451
|
{
|
|
15436
15452
|
name: "dispatch_doc_edit",
|
|
15437
15453
|
example: {
|
|
@@ -18124,6 +18140,9 @@ class DispatchClient {
|
|
|
18124
18140
|
async message(issue, input) {
|
|
18125
18141
|
return this.#json("POST", ["api", "v1", "issues", await this.#resolveIssue(issue), "messages"], input);
|
|
18126
18142
|
}
|
|
18143
|
+
async agentMessage(sessionId, input) {
|
|
18144
|
+
return this.#json("POST", ["api", "v1", "agents", sessionId, "messages"], input);
|
|
18145
|
+
}
|
|
18127
18146
|
async messageReply(id, input, options = {}) {
|
|
18128
18147
|
return this.#json("POST", ["api", "v1", "messages", id, "reply"], input, options.followUp === true ? { follow_up: "true" } : undefined);
|
|
18129
18148
|
}
|
|
@@ -19836,6 +19855,9 @@ function itemBlockOf(value) {
|
|
|
19836
19855
|
function article(kind) {
|
|
19837
19856
|
return kind === "ask" ? "an ask" : `a ${kind}`;
|
|
19838
19857
|
}
|
|
19858
|
+
function conversationReadBack(messageId) {
|
|
19859
|
+
return `${commandLine("dispatch_read", { message: messageId })} reads the conversation back.`;
|
|
19860
|
+
}
|
|
19839
19861
|
function replyBlockProblem(field, kind, value) {
|
|
19840
19862
|
if (!/^dispatch:\/\/[^#]*#b-/.test(value))
|
|
19841
19863
|
return;
|
|
@@ -22255,7 +22277,7 @@ async function executeDispatchTool(input) {
|
|
|
22255
22277
|
details: { message: reply.id, in_reply_to: inReplyTo, posted: false }
|
|
22256
22278
|
};
|
|
22257
22279
|
}
|
|
22258
|
-
const readBack =
|
|
22280
|
+
const readBack = conversationReadBack(inReplyTo);
|
|
22259
22281
|
const parent = reply.in_reply_to ?? undefined;
|
|
22260
22282
|
const follows = parent === inReplyTo ? undefined : parent;
|
|
22261
22283
|
return {
|
|
@@ -22291,6 +22313,27 @@ async function executeDispatchTool(input) {
|
|
|
22291
22313
|
}
|
|
22292
22314
|
};
|
|
22293
22315
|
}
|
|
22316
|
+
case "dispatch_send_to_agent": {
|
|
22317
|
+
const session = stringArg(args, "session");
|
|
22318
|
+
const inReplyTo = optionalString(args, "in_reply_to");
|
|
22319
|
+
const message = await client.agentMessage(session, {
|
|
22320
|
+
body: stringArg(args, "body"),
|
|
22321
|
+
delivery: stringArg(args, "delivery"),
|
|
22322
|
+
...inReplyTo === undefined ? {} : { in_reply_to: inReplyTo }
|
|
22323
|
+
});
|
|
22324
|
+
const attempt = message.deliveries?.at(-1);
|
|
22325
|
+
const readBack = conversationReadBack(message.id);
|
|
22326
|
+
const arrival = attempt === undefined ? "Dispatch recorded no delivery attempt for it" : attempt.state === "failed" ? `its delivery failed: ${attempt.error ?? "the listener gave no reason"}` : attempt.state === "pending" ? "its delivery is still on its way" : `it reached that session as ${attempt.delivery}`;
|
|
22327
|
+
return {
|
|
22328
|
+
text: `Sent message ${message.id} to session ${session}; ${arrival}. ${readBack}`,
|
|
22329
|
+
details: {
|
|
22330
|
+
session,
|
|
22331
|
+
message: message.id,
|
|
22332
|
+
...attempt === undefined ? {} : { delivery: attempt.state },
|
|
22333
|
+
...inReplyTo === undefined ? {} : { in_reply_to: inReplyTo }
|
|
22334
|
+
}
|
|
22335
|
+
};
|
|
22336
|
+
}
|
|
22294
22337
|
case "dispatch_doc_edit": {
|
|
22295
22338
|
const resolved = await resolveDocument(documentOwner(), optionalString(args, "artifact"));
|
|
22296
22339
|
const ops = args.ops;
|
package/dist/envoy.js
CHANGED
|
@@ -30471,6 +30471,22 @@ var dispatchToolSpecs = [
|
|
|
30471
30471
|
}),
|
|
30472
30472
|
validation: messageValidation
|
|
30473
30473
|
},
|
|
30474
|
+
{
|
|
30475
|
+
name: "dispatch_send_to_agent",
|
|
30476
|
+
example: {
|
|
30477
|
+
session: "01234567-0000-4000-8000-000000000001",
|
|
30478
|
+
body: "DSP-1: the rota is nowhere written down. Please write it up.",
|
|
30479
|
+
delivery: "aside"
|
|
30480
|
+
},
|
|
30481
|
+
description: "Hand a piece of work to one agent session, in that session's own conversation, which belongs to no " + "issue: the way to reach the agent already on the work - the session holding an issue's claim, or one " + "you are working with. Name the issue in the body, because this message carries none. It is not how " + "you reach a person (dispatch message, or dispatch ask for something only a person can do), and not a " + "note on an issue (dispatch message --issue), which everyone reading that issue sees; this reaches that " + "one session. It spends that session a turn, so send once and read the reply with " + "dispatch read --message <id> rather than sending again. The call is answered once its first delivery " + "attempt has settled. It needs a credential holding the person scope, and one without it is refused " + `403 OAUTH_SCOPE_REQUIRED, naming the scope. ${BODY_BLOCK_RULE}`,
|
|
30482
|
+
arguments: (z) => ({
|
|
30483
|
+
session: z.string({ min: 1 }).describe("The session to send to, by its bare session id. An issue's claim names the session holding it, " + "and dispatch whoami names this session's own."),
|
|
30484
|
+
body: z.string({ min: 1 }).describe(`The words the session reads. Name the issue they are about: this message carries none. ${BODY_BLOCK_RULE}`),
|
|
30485
|
+
delivery: z.enum(["btw", "aside", "steer"]).describe("How the words reach the session: btw waits for its next turn, aside reaches it while a turn " + "runs, and steer goes in as a keystroke at its terminal. A session advertises the modes it " + "takes, and Dispatch sends the mode you name rather than another."),
|
|
30486
|
+
in_reply_to: z.string().describe("Optional id of a message in this same session-to-session conversation, threading this message " + "under it; without it the message starts a conversation of its own.").optional()
|
|
30487
|
+
}),
|
|
30488
|
+
strict: true
|
|
30489
|
+
},
|
|
30474
30490
|
{
|
|
30475
30491
|
name: "dispatch_doc_edit",
|
|
30476
30492
|
example: {
|
|
@@ -35923,6 +35939,9 @@ class DispatchClient {
|
|
|
35923
35939
|
async message(issue, input) {
|
|
35924
35940
|
return this.#json("POST", ["api", "v1", "issues", await this.#resolveIssue(issue), "messages"], input);
|
|
35925
35941
|
}
|
|
35942
|
+
async agentMessage(sessionId, input) {
|
|
35943
|
+
return this.#json("POST", ["api", "v1", "agents", sessionId, "messages"], input);
|
|
35944
|
+
}
|
|
35926
35945
|
async messageReply(id, input, options = {}) {
|
|
35927
35946
|
return this.#json("POST", ["api", "v1", "messages", id, "reply"], input, options.followUp === true ? { follow_up: "true" } : undefined);
|
|
35928
35947
|
}
|
|
@@ -42661,7 +42680,7 @@ var import_nats2 = __toESM(require_mod4(), 1);
|
|
|
42661
42680
|
|
|
42662
42681
|
// package.json
|
|
42663
42682
|
var name = "@sjawhar/pi-envoy";
|
|
42664
|
-
var version2 = "16.
|
|
42683
|
+
var version2 = "16.38.0";
|
|
42665
42684
|
var package_default = {
|
|
42666
42685
|
name,
|
|
42667
42686
|
version: version2,
|