@sjawhar/pi-legion-envoy 0.8.3 → 0.8.5
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 +31 -1
- package/dist/skills/github/SKILL.md +5 -0
- package/package.json +3 -2
package/dist/envoy.js
CHANGED
|
@@ -30972,6 +30972,7 @@ function renderInbound(raw, sessionID, subject) {
|
|
|
30972
30972
|
}
|
|
30973
30973
|
const payloadSummary = envelope.payload_summary ?? "unknown";
|
|
30974
30974
|
const message = envelope.payload !== undefined && envelope.payload !== envelope.payload_summary ? parsedPayload : undefined;
|
|
30975
|
+
const summaryIsHead = typeof message === "string" && envelope.payload_summary !== undefined && message.startsWith(envelope.payload_summary.endsWith("\u2026") ? envelope.payload_summary.slice(0, -1) : envelope.payload_summary);
|
|
30975
30976
|
const body = `${envelope.payload_summary ?? ""}
|
|
30976
30977
|
${envelope.payload ?? ""}`;
|
|
30977
30978
|
let foreignSession;
|
|
@@ -30999,7 +31000,7 @@ ${envelope.payload ?? ""}`;
|
|
|
30999
31000
|
...role === undefined ? {} : {
|
|
31000
31001
|
reply_role: `envoy_publish(topic="notifications.role.${role}", message="...")`
|
|
31001
31002
|
},
|
|
31002
|
-
summary: payloadSummary,
|
|
31003
|
+
...summaryIsHead ? {} : { summary: payloadSummary },
|
|
31003
31004
|
...message === undefined ? {} : { message },
|
|
31004
31005
|
...foreignSession === undefined ? {} : {
|
|
31005
31006
|
note: `body names session ${foreignSession}; the sender is ${envelope.source_session ?? "unknown"}`
|
|
@@ -31328,6 +31329,34 @@ function toolFailure(error) {
|
|
|
31328
31329
|
return { content: [{ type: "text", text: messageFor(error) }], details: {}, isError: true };
|
|
31329
31330
|
}
|
|
31330
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
|
+
|
|
31331
31360
|
// extensions/envoy-whoami-command.ts
|
|
31332
31361
|
import { copyToClipboard } from "@oh-my-pi/pi-coding-agent";
|
|
31333
31362
|
function registerEnvoyWhoamiCommand(api, cachedSessionID) {
|
|
@@ -31409,6 +31438,7 @@ function envoyExtension(pi) {
|
|
|
31409
31438
|
let activeSessionContext;
|
|
31410
31439
|
const inbox = [];
|
|
31411
31440
|
pi.on("resources_discover", async () => ({ skillPaths: [SKILLS_DIRECTORY] }));
|
|
31441
|
+
registerEnvoyMessageRenderer(pi);
|
|
31412
31442
|
const ensureConnection = async () => {
|
|
31413
31443
|
if (connection?.isClosed() === false)
|
|
31414
31444
|
return connection;
|
|
@@ -14,6 +14,11 @@ Requires `gh` CLI installed and authenticated:
|
|
|
14
14
|
gh auth login
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
+
**Inside a Legion worker workspace**, skip `gh auth login`/`gh auth setup-git`: `gh` on `PATH`
|
|
18
|
+
is a shim that execs `legion gh -- <args>` (`packages/pi-envoy/src/legion/gh-shim.ts`), which
|
|
19
|
+
redeems a fresh token from the daemon's grant on every invocation and hands it straight to the
|
|
20
|
+
real `gh` binary — it is already authenticated per call, independent of any local login state.
|
|
21
|
+
|
|
17
22
|
## Operations
|
|
18
23
|
|
|
19
24
|
### Search/List Issues (via project)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sjawhar/pi-legion-envoy",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.5",
|
|
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",
|