@narumitw/pi-subagents 3.4.0 → 3.4.2
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/CHANGELOG.md +137 -0
- package/README.md +4 -3
- package/dist/chunks/{settings-ui-24GHO6E2.ts → settings-ui-KOX3DMZP.ts} +4 -1
- package/dist/chunks/{settings-ui-24GHO6E2.ts.map → settings-ui-KOX3DMZP.ts.map} +2 -2
- package/dist/index.ts +16 -16
- package/dist/index.ts.map +2 -2
- package/docs/messaging.md +3 -1
- package/package.json +7 -6
- package/src/message-renderers.ts +4 -10
- package/src/runtime.ts +1 -1
- package/src/settings-ui.ts +3 -0
- package/src/tools.ts +10 -6
package/docs/messaging.md
CHANGED
|
@@ -4,6 +4,8 @@ Main and child processes have separate `subagent_send` definitions. The main age
|
|
|
4
4
|
|
|
5
5
|
## Delivery and waiting
|
|
6
6
|
|
|
7
|
+
Child requests, responses, and terminal completions use Pi steering while the main agent is running. If it is idle, they start a new model turn. A completion does not require a pending `subagent_wait` call.
|
|
8
|
+
|
|
7
9
|
A main-originated request to a queued job waits for the child RPC prompt to be accepted, then uses Pi steering to reach the running child. After RPC accepts steering, the runtime interrupts active child response waits without consuming their original requests. The child may retry `subagent_wait` for a response it still needs.
|
|
8
10
|
|
|
9
11
|
Caller cancellation before RPC delivery starts rolls the request back. Once delivery starts, cancellation stops only the caller's wait: the request may still arrive and remains answerable until delivery fails or the job terminates. A wait timeout likewise stops only that wait, not the job or the underlying message request.
|
|
@@ -16,7 +18,7 @@ Each job may have up to four unresolved or answered-but-not-consumed requests ac
|
|
|
16
18
|
|
|
17
19
|
A job starts `queued`, becomes `running`, and reaches exactly one terminal state: `completed`, `partial`, `failed`, `timed_out`, or `cancelled`. Job execution timeouts start after Pi accepts the RPC prompt. The runtime retains up to 32 recent terminal records for up to 24 hours in the current extension session; inspection reports removed records through `omitted.jobs`.
|
|
18
20
|
|
|
19
|
-
Cancelling or terminalizing a job revokes its communication token and rejects pending child waits before stale output can replace the terminal state. Session replacement and shutdown cancel active work, suppress stale completion delivery, revoke credentials, close sockets, and stop the broker.
|
|
21
|
+
Cancelling or terminalizing a job revokes its communication token and rejects pending child waits before stale output can replace the terminal state. Session replacement and shutdown cancel active work, suppress stale completion delivery, revoke credentials, close sockets, and stop the broker.
|
|
20
22
|
|
|
21
23
|
The session starts one loopback TCP broker on `127.0.0.1` with an ephemeral port. Each job receives a random token bound to its job identity and session generation. The parent passes credentials through a private inherited pipe rather than the child's initial environment or command line. Child broker calls use request-scoped connections; response waits use abortable long polling.
|
|
22
24
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@narumitw/pi-subagents",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.2",
|
|
4
4
|
"description": "Subagent jobs with asynchronous main-agent messaging for Pi.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"dist",
|
|
19
19
|
"docs",
|
|
20
20
|
"README.md",
|
|
21
|
+
"CHANGELOG.md",
|
|
21
22
|
"LICENSE"
|
|
22
23
|
],
|
|
23
24
|
"pi": {
|
|
@@ -39,9 +40,9 @@
|
|
|
39
40
|
"typebox": "*"
|
|
40
41
|
},
|
|
41
42
|
"devDependencies": {
|
|
42
|
-
"@earendil-works/pi-ai": "1.
|
|
43
|
-
"@earendil-works/pi-coding-agent": "1.
|
|
44
|
-
"@earendil-works/pi-tui": "1.
|
|
43
|
+
"@earendil-works/pi-ai": "1.5.0",
|
|
44
|
+
"@earendil-works/pi-coding-agent": "1.5.0",
|
|
45
|
+
"@earendil-works/pi-tui": "1.5.0",
|
|
45
46
|
"@types/node": "26.6.5",
|
|
46
47
|
"esbuild": "0.28.2",
|
|
47
48
|
"typebox": "1.4.3",
|
|
@@ -53,7 +54,7 @@
|
|
|
53
54
|
"directory": "packages/pi-subagents"
|
|
54
55
|
},
|
|
55
56
|
"dependencies": {
|
|
56
|
-
"@narumitw/pi-tui-kit": "^0.
|
|
57
|
-
"ignore": "^7.0.
|
|
57
|
+
"@narumitw/pi-tui-kit": "^0.69.0",
|
|
58
|
+
"ignore": "^7.0.14"
|
|
58
59
|
}
|
|
59
60
|
}
|
package/src/message-renderers.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ExtensionAPI, getMarkdownTheme
|
|
1
|
+
import { type ExtensionAPI, getMarkdownTheme } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { Box, type Component, Markdown, Spacer, Text } from "@earendil-works/pi-tui";
|
|
3
3
|
import { sanitizeTerminalText } from "./message-broker.js";
|
|
4
4
|
|
|
@@ -31,15 +31,9 @@ export function registerMessageRenderers(pi: ExtensionAPI): void {
|
|
|
31
31
|
new Spacer(1),
|
|
32
32
|
];
|
|
33
33
|
if (!options.expanded) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
theme.fg("dim", keyText("app.tools.expand")) +
|
|
38
|
-
theme.fg("customMessageText", " to expand)"),
|
|
39
|
-
0,
|
|
40
|
-
0,
|
|
41
|
-
),
|
|
42
|
-
);
|
|
34
|
+
const expansionKey = options.keyText?.("app.tools.expand");
|
|
35
|
+
const hint = expansionKey ? theme.fg("muted", ` (${expansionKey} to expand)`) : "";
|
|
36
|
+
children.push(new Text(theme.fg("customMessageText", summary) + hint, 0, 0));
|
|
43
37
|
} else {
|
|
44
38
|
const content =
|
|
45
39
|
typeof message.content === "string"
|
package/src/runtime.ts
CHANGED
|
@@ -437,7 +437,7 @@ export class SubagentRuntime {
|
|
|
437
437
|
display: true,
|
|
438
438
|
details: payload,
|
|
439
439
|
},
|
|
440
|
-
{ deliverAs: "steer" },
|
|
440
|
+
{ deliverAs: "steer", triggerTurn: true },
|
|
441
441
|
);
|
|
442
442
|
} catch {
|
|
443
443
|
// Completion remains available through wait; inspect continues to report status.
|
package/src/settings-ui.ts
CHANGED
|
@@ -127,6 +127,9 @@ export async function showSubagentSettings(
|
|
|
127
127
|
() => complete("back"),
|
|
128
128
|
);
|
|
129
129
|
return {
|
|
130
|
+
get capturesViewportInput() {
|
|
131
|
+
return list.capturesViewportInput;
|
|
132
|
+
},
|
|
130
133
|
render(width: number) {
|
|
131
134
|
if (!current()) complete("stale");
|
|
132
135
|
renderedWidth = Number.isFinite(width) ? Math.max(0, Math.floor(width)) : 0;
|
package/src/tools.ts
CHANGED
|
@@ -60,9 +60,11 @@ const SpawnParameters = Type.Object(
|
|
|
60
60
|
),
|
|
61
61
|
tools: Type.Optional(
|
|
62
62
|
Type.Array(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
Type.Unsafe<(typeof CHILD_CORE_TOOL_NAMES)[number]>(
|
|
64
|
+
StringEnum(CHILD_CORE_TOOL_NAMES, {
|
|
65
|
+
description: "Available Pi core child work tool name.",
|
|
66
|
+
}),
|
|
67
|
+
),
|
|
66
68
|
{
|
|
67
69
|
description: "Child work tools. Defaults to read, grep, find, and ls. Communication tools are always added.",
|
|
68
70
|
maxItems: MAX_TOOLS,
|
|
@@ -114,9 +116,11 @@ const SpawnParameters = Type.Object(
|
|
|
114
116
|
),
|
|
115
117
|
),
|
|
116
118
|
thinkingLevel: Type.Optional(
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
119
|
+
Type.Unsafe<SubagentThinkingLevel>(
|
|
120
|
+
StringEnum(SUBAGENT_THINKING_LEVELS, {
|
|
121
|
+
description: "Child thinking level. Defaults to the main agent's effective level.",
|
|
122
|
+
}),
|
|
123
|
+
),
|
|
120
124
|
),
|
|
121
125
|
timeout: Type.Optional(Type.Number({ description: "Timeout in seconds (optional, no default timeout)" })),
|
|
122
126
|
},
|