@zhushanwen/pi-subagent-workflow 8.14.2 → 8.14.4
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/package.json +11 -10
- package/relay/relay.mjs +1 -1
- package/skills/subagent-ext-config/SKILL.md +1 -1
- package/src/host/__tests__/inflight-reporter.test.ts +1 -1
- package/src/host/__tests__/pi-host.test.ts +2 -2
- package/src/host/inflight-reporter.ts +1 -1
- package/src/host/pi-host.ts +4 -4
- package/src/index.ts +46 -410
- package/src/injectors/workflow-list-injector.ts +6 -1
- package/src/interface/__tests__/tool-subagents.test.ts +494 -0
- package/src/interface/bg-notify-render.ts +4 -27
- package/src/interface/commands.ts +3 -5
- package/src/interface/format.ts +3 -3
- package/src/interface/gui-mappers.ts +3 -3
- package/src/interface/helpers.ts +87 -29
- package/src/interface/id-preview.ts +12 -0
- package/src/interface/subagent-actions.ts +4 -6
- package/src/interface/subagent-tool-schema.ts +7 -17
- package/src/interface/subagent-tool.ts +5 -13
- package/src/interface/subagents.ts +2 -1
- package/src/interface/tool-result.ts +40 -0
- package/src/interface/tool-shared.ts +109 -0
- package/src/interface/tool-subagents.ts +310 -0
- package/src/interface/tool-workflow-script.ts +6 -10
- package/src/interface/tool-workflow.ts +41 -60
- package/src/jsonl-run-store.ts +65 -5
- package/src/session-lifecycle.ts +184 -40
- package/src/workflow-events.ts +576 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhushanwen/pi-subagent-workflow",
|
|
3
|
-
"version": "8.14.
|
|
3
|
+
"version": "8.14.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"description": "Unified subagent execution and multi-agent workflow orchestration for Pi — spawned-process agent runtime with sync/background modes, stateful workflow management with persistence, state machine, and execution tracing.",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"src/index.ts",
|
|
26
26
|
"src/jsonl-run-store.ts",
|
|
27
27
|
"src/session-lifecycle.ts",
|
|
28
|
+
"src/workflow-events.ts",
|
|
28
29
|
"src/host/",
|
|
29
30
|
"src/injectors/",
|
|
30
31
|
"src/interface/"
|
|
@@ -54,21 +55,21 @@
|
|
|
54
55
|
]
|
|
55
56
|
},
|
|
56
57
|
"dependencies": {
|
|
57
|
-
"@
|
|
58
|
-
"@
|
|
59
|
-
"@zhushanwen/pi-ext-guards": "0.4.
|
|
60
|
-
"@zhushanwen/pi-extension-logger": "0.6.
|
|
61
|
-
"@zhushanwen/subagent-core": "0.10.
|
|
62
|
-
"@zhushanwen/pi-subagent-cli": "0.4.
|
|
63
|
-
"@zhushanwen/zcode-subagent-cli": "0.3.
|
|
58
|
+
"@zhushanwen/extension-protocol": "0.12.0",
|
|
59
|
+
"@zhushanwen/session-delivery": "0.10.1",
|
|
60
|
+
"@zhushanwen/pi-ext-guards": "0.4.1",
|
|
61
|
+
"@zhushanwen/pi-extension-logger": "0.6.1",
|
|
62
|
+
"@zhushanwen/subagent-core": "0.10.5",
|
|
63
|
+
"@zhushanwen/pi-subagent-cli": "0.4.1",
|
|
64
|
+
"@zhushanwen/zcode-subagent-cli": "0.3.2"
|
|
64
65
|
},
|
|
65
66
|
"peerDependencies": {
|
|
66
67
|
"@earendil-works/pi-ai": "^0.84.4",
|
|
67
68
|
"@earendil-works/pi-coding-agent": "^0.84.4",
|
|
68
69
|
"@earendil-works/pi-tui": "^0.84.4",
|
|
69
70
|
"typebox": "*",
|
|
70
|
-
"@zhushanwen/pi-pending-notifications": "0.7.
|
|
71
|
-
"@zhushanwen/pi-structured-output": "5.1.
|
|
71
|
+
"@zhushanwen/pi-pending-notifications": "0.7.5",
|
|
72
|
+
"@zhushanwen/pi-structured-output": "5.1.8"
|
|
72
73
|
},
|
|
73
74
|
"peerDependenciesMeta": {
|
|
74
75
|
"@earendil-works/pi-coding-agent": {
|
package/relay/relay.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* subagent relay 代理 CLI
|
|
3
|
+
* subagent relay 代理 CLI。
|
|
4
4
|
*
|
|
5
5
|
* 角色:双面字节泵——extension 眼中的 pi 子进程(stdio 与 spawn 真实 pi 字节级同构:
|
|
6
6
|
* 逐行 JSONL RPC / get_state 握手由 extension 侧 session-runner 原样驱动,代理只搬运字节)
|
|
@@ -86,7 +86,7 @@ config.json 位于 pi agent 目录下的 `subagents/config.json`,随环境不
|
|
|
86
86
|
|
|
87
87
|
1. **新建 session**(必须——当前 session 不重读配置)。
|
|
88
88
|
2. 让主 agent 派一个 subagent(例:用 `subagents` 工具发个简单任务)。
|
|
89
|
-
3. taiji
|
|
89
|
+
3. taiji composer **任务托盘**(task tray)的 Subagents 面板看该项最左的引擎 icon(pi / zcode)——这是统一验证面。
|
|
90
90
|
4. journal 落点 `~/.taiji-dev/engines/<engineId>/` **仅适用非 pi 引擎**(zcode 分支建 journal);pi 分支不建 journal,pi 任务以 icon 为验证面。
|
|
91
91
|
|
|
92
92
|
## 常见错误排查
|
|
@@ -31,7 +31,7 @@ vi.mock("@zhushanwen/pi-extension-logger", () => extensionLoggerMock);
|
|
|
31
31
|
vi.mock("@zhushanwen/subagent-core", () => ({ getInFlightSnapshot: mockSnapshot }));
|
|
32
32
|
|
|
33
33
|
import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
34
|
-
import { INFLIGHT_REPORT_ACK, SUBAGENT_INFLIGHT_MARKER } from "@
|
|
34
|
+
import { INFLIGHT_REPORT_ACK, SUBAGENT_INFLIGHT_MARKER } from "@zhushanwen/extension-protocol";
|
|
35
35
|
|
|
36
36
|
import { createInFlightReporter } from "../inflight-reporter.ts";
|
|
37
37
|
|
|
@@ -41,12 +41,12 @@ const sessionDeliveryMock = vi.hoisted(() => ({
|
|
|
41
41
|
vi.mock("@earendil-works/pi-coding-agent", () => piCodingAgentMock);
|
|
42
42
|
vi.mock("@zhushanwen/pi-extension-logger", () => extensionLoggerMock);
|
|
43
43
|
vi.mock("@zhushanwen/pi-pending-notifications", () => pendingNotificationsMock);
|
|
44
|
-
vi.mock("@
|
|
44
|
+
vi.mock("@zhushanwen/session-delivery", () => sessionDeliveryMock);
|
|
45
45
|
|
|
46
46
|
import { getAgentDir } from "@earendil-works/pi-coding-agent";
|
|
47
47
|
import { getLogger } from "@zhushanwen/pi-extension-logger";
|
|
48
48
|
import { countActiveFromEntries } from "@zhushanwen/pi-pending-notifications";
|
|
49
|
-
import { createDelivery } from "@
|
|
49
|
+
import { createDelivery } from "@zhushanwen/session-delivery";
|
|
50
50
|
|
|
51
51
|
import { createPiHostServices, createPiNotifyDomainPorts } from "../pi-host.ts";
|
|
52
52
|
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
// (30min 有界),不丢 errs-safe 兜底。
|
|
38
38
|
|
|
39
39
|
import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
40
|
-
import { SUBAGENT_INFLIGHT_MARKER, callMarkerRpc, isInFlightReportAck } from "@
|
|
40
|
+
import { SUBAGENT_INFLIGHT_MARKER, callMarkerRpc, isInFlightReportAck } from "@zhushanwen/extension-protocol";
|
|
41
41
|
import { getInFlightSnapshot } from "@zhushanwen/subagent-core";
|
|
42
42
|
import { getLogger } from "@zhushanwen/pi-extension-logger";
|
|
43
43
|
import { toErrorMessage } from "@zhushanwen/pi-ext-guards";
|
package/src/host/pi-host.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
//
|
|
6
6
|
// 本文件属壳侧(shell),不进 core 切面——对 pi SDK 与 pi 宿主协作件
|
|
7
7
|
// (@earendil-works/pi-coding-agent / @zhushanwen/pi-extension-logger /
|
|
8
|
-
// @zhushanwen/pi-pending-notifications / @
|
|
8
|
+
// @zhushanwen/pi-pending-notifications / @zhushanwen/session-delivery)的运行时
|
|
9
9
|
// import 收敛在此层,core 闭包(D9 守卫对象)不得出现这些包。
|
|
10
10
|
//
|
|
11
11
|
// 端口语义:
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
// - countActiveFromEntries 适配:pi 侧真函数返回 CountActiveResult 对象,core
|
|
23
23
|
// 端口契约是 number(core 消费面只读 .count,notify-ports.ts 契约注释)——
|
|
24
24
|
// foundation 单元登记给本单元的适配责任。
|
|
25
|
-
// - createDelivery 透传:@
|
|
25
|
+
// - createDelivery 透传:@zhushanwen/session-delivery 的 createDelivery 与 core
|
|
26
26
|
// 的 Delivery* 结构化类型逐字段结构兼容(DeliveryHandle 的 sendChecked/depth
|
|
27
27
|
// 是结构超集成员,多不碍兼容)——结构兼容由本注入点 typecheck 守护,上游签名
|
|
28
28
|
// 漂移即红(notify-ports.ts「闭包红线」段)。
|
|
@@ -34,7 +34,7 @@ import { fileURLToPath } from "node:url";
|
|
|
34
34
|
import { getAgentDir } from "@earendil-works/pi-coding-agent";
|
|
35
35
|
import { getLogger } from "@zhushanwen/pi-extension-logger";
|
|
36
36
|
import { countActiveFromEntries } from "@zhushanwen/pi-pending-notifications";
|
|
37
|
-
import { createDelivery } from "@
|
|
37
|
+
import { createDelivery } from "@zhushanwen/session-delivery";
|
|
38
38
|
|
|
39
39
|
import type { DiscoveryRoot, HostServices } from "@zhushanwen/subagent-core";
|
|
40
40
|
import type { LogLevel } from "@zhushanwen/subagent-core";
|
|
@@ -43,7 +43,7 @@ import { toErrorMessage } from "@zhushanwen/pi-ext-guards";
|
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* core 包(@zhushanwen/subagent-core)agents/ 资产进 pi 发现面的注入根(C5⑥,
|
|
46
|
-
* convergence §5.4 检查点 2
|
|
46
|
+
* convergence §5.4 检查点 2)。
|
|
47
47
|
*
|
|
48
48
|
* 解析锚点 = `@zhushanwen/subagent-core/workflows/README.md`:`./workflows/*` 子入口
|
|
49
49
|
* 在 workspace TS 直引与 npm dist 两种发布形态下同径(publishConfig 保留该子入口),
|