@sjawhar/pi-legion-envoy 0.8.4 → 0.9.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/envoy.js
CHANGED
|
@@ -29979,7 +29979,7 @@ var DISPATCH_URGENCIES = ["low", "med", "high", "blocking"];
|
|
|
29979
29979
|
var DISPATCH_TOOL_DESCRIPTION = "Raise a durable question to the human as a Dispatch thread (a GitHub issue shown on the dashboard), or continue an existing thread with a follow-up question. The reader has NOT seen your transcript. Open a thread with `subject`; continue one with `thread`. The reply arrives in this session as a steer.";
|
|
29980
29980
|
var DISPATCH_ARGUMENTS = {
|
|
29981
29981
|
subject: "Open a new thread: one line naming the decision needed (the issue title). Omit when continuing a thread with `thread`.",
|
|
29982
|
-
thread:
|
|
29982
|
+
thread: 'Continue an existing thread: "<n>" (an open issue in the repo; a plain work issue is adopted as a thread) or "owner/name#<n>". When set, omit subject, urgency, repo, and parent.',
|
|
29983
29983
|
context: `What you are doing, what you found, why you are stuck \u2014 at most ${DISPATCH_CONTEXT_MAX} characters, at most three short paragraphs or a bullet list. The reader has NOT seen your transcript: no nouns you coined this session, no internal identifiers unless the question is about them. GitHub references (#N, owner/repo#N, URLs) may be bare; the dashboard unfurls them.`,
|
|
29984
29984
|
question: `The ask, at most ${DISPATCH_QUESTION_MAX} characters, as a list: current state \u2192 desired state \u2192 your recommendation and why; options go in \`ask\`.`,
|
|
29985
29985
|
ask: "Structured questions rendered as buttons on the dashboard. Each: { question, header?, options: [{ label, description? }], multiple?, custom? }. Use this whenever the answer is one of N choices.",
|
|
@@ -31329,6 +31329,34 @@ function toolFailure(error) {
|
|
|
31329
31329
|
return { content: [{ type: "text", text: messageFor(error) }], details: {}, isError: true };
|
|
31330
31330
|
}
|
|
31331
31331
|
|
|
31332
|
+
// extensions/envoy-message-renderer.ts
|
|
31333
|
+
import { Box, Spacer, Text } from "@oh-my-pi/pi-tui";
|
|
31334
|
+
var ENVOY_MESSAGE_COLLAPSED_LINES = 12;
|
|
31335
|
+
function renderEnvoyMessage(message, options, theme) {
|
|
31336
|
+
const box = new Box(1, 1, undefined, {
|
|
31337
|
+
chars: theme.boxRound,
|
|
31338
|
+
color: (text) => theme.fg("borderMuted", text)
|
|
31339
|
+
});
|
|
31340
|
+
box.setIgnoreTight(true);
|
|
31341
|
+
box.addChild(new Text(theme.fg("customMessageLabel", theme.bold(message.customType)), 0, 0));
|
|
31342
|
+
box.addChild(new Spacer(1));
|
|
31343
|
+
let text = message.content;
|
|
31344
|
+
if (!options.expanded) {
|
|
31345
|
+
const lines = text.split(`
|
|
31346
|
+
`);
|
|
31347
|
+
if (lines.length > ENVOY_MESSAGE_COLLAPSED_LINES) {
|
|
31348
|
+
text = `${lines.slice(0, ENVOY_MESSAGE_COLLAPSED_LINES).join(`
|
|
31349
|
+
`)}
|
|
31350
|
+
\u2026`;
|
|
31351
|
+
}
|
|
31352
|
+
}
|
|
31353
|
+
box.addChild(new Text(theme.fg("customMessageText", text), 0, 0));
|
|
31354
|
+
return box;
|
|
31355
|
+
}
|
|
31356
|
+
function registerEnvoyMessageRenderer(pi) {
|
|
31357
|
+
pi.registerMessageRenderer("envoy-message", renderEnvoyMessage);
|
|
31358
|
+
}
|
|
31359
|
+
|
|
31332
31360
|
// extensions/envoy-whoami-command.ts
|
|
31333
31361
|
import { copyToClipboard } from "@oh-my-pi/pi-coding-agent";
|
|
31334
31362
|
function registerEnvoyWhoamiCommand(api, cachedSessionID) {
|
|
@@ -31410,6 +31438,7 @@ function envoyExtension(pi) {
|
|
|
31410
31438
|
let activeSessionContext;
|
|
31411
31439
|
const inbox = [];
|
|
31412
31440
|
pi.on("resources_discover", async () => ({ skillPaths: [SKILLS_DIRECTORY] }));
|
|
31441
|
+
registerEnvoyMessageRenderer(pi);
|
|
31413
31442
|
const ensureConnection = async () => {
|
|
31414
31443
|
if (connection?.isClosed() === false)
|
|
31415
31444
|
return connection;
|
|
@@ -154,7 +154,8 @@ dispatch({
|
|
|
154
154
|
```
|
|
155
155
|
|
|
156
156
|
- `thread` replaces `subject`; `urgency`, `repo`, and `parent` are not accepted with it.
|
|
157
|
-
|
|
157
|
+
`thread` names an open issue in the repo; a plain work issue is adopted as a thread on
|
|
158
|
+
first use. The issue must be open and not a pull request, or the tool says so
|
|
158
159
|
(`#N is not a dispatch thread`, `#N is closed; open a new thread`).
|
|
159
160
|
- Same decision → same thread. A genuinely new decision → a new thread, even if it came
|
|
160
161
|
up in the reply.
|
|
@@ -50,6 +50,7 @@ into a state holder: daemon state and GitHub artifacts remain authoritative.
|
|
|
50
50
|
| Resync report | artifact-driven anomaly list (zero-owner trees, erroring issues) | Verify against fresh state, then dispatch/heal |
|
|
51
51
|
| Mention | Slack/GitHub @mention text | Answer, or route to the owning issue's architect role |
|
|
52
52
|
| Approval interpretation | ambiguous human comment on a gated issue | Decide whether it's an approval; if so, apply `human-approved` via the daemon |
|
|
53
|
+
| Closed-tree activity (comment, review, CI on a closed tree) | issue, root, event summary | Read the artifact; if work should resume, `legion admit <root>`; otherwise no action — the event is not held or redelivered |
|
|
53
54
|
| Direct user message | — | Always first |
|
|
54
55
|
|
|
55
56
|
## New issue triage
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sjawhar/pi-legion-envoy",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"omp": {
|
|
6
6
|
"extensions": [
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"dist"
|
|
16
16
|
],
|
|
17
17
|
"scripts": {
|
|
18
|
-
"build": "bun build extensions/envoy.ts extensions/legion.ts --outdir dist --target bun --format esm --external @oh-my-pi/pi-coding-agent",
|
|
18
|
+
"build": "bun build extensions/envoy.ts extensions/legion.ts --outdir dist --target bun --format esm --external @oh-my-pi/pi-coding-agent --external @oh-my-pi/pi-tui",
|
|
19
19
|
"prepack": "./scripts/prepack.sh",
|
|
20
20
|
"postpack": "rm -rf dist/skills",
|
|
21
21
|
"typecheck": "bunx tsc --noEmit",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"@legion/contracts": "0.10.0",
|
|
28
28
|
"@legion/envoy-client": "0.1.0",
|
|
29
29
|
"@legion/workspace": "0.1.0",
|
|
30
|
+
"@oh-my-pi/pi-tui": "^18.1.15",
|
|
30
31
|
"@toon-format/toon": "^4.1.1",
|
|
31
32
|
"@types/bun": "latest",
|
|
32
33
|
"nats": "^2.29.2",
|