Skip to content

Commit 9074e40

Browse files
claude-code-bestunraidclaude
authored
feat: 远程群控 (claude-code-best#243)
* feat: restore pipe IPC, LAN pipes, monitor tool, and PR-package features Core IPC system (UDS_INBOX): - PipeServer/PipeClient with UDS + TCP dual transport, NDJSON protocol - PipeRegistry: machineId-based role assignment, file locking - Master/slave attach, prompt relay, permission forwarding - Heartbeat lifecycle with parallel isPipeAlive probes - Commands: /pipes, /attach, /detach, /send, /claim-main, /pipe-status LAN Pipes (LAN_PIPES): - UDP multicast beacon (224.0.71.67:7101) for zero-config LAN discovery - PipeServer TCP listener, PipeClient TCP connect mode - Heartbeat auto-attaches LAN peers via TCP - Cross-machine attach allowed regardless of role - /pipes shows [LAN] peers with role + hostname/IP - SendMessageTool supports tcp: scheme with user consent Architecture — extracted hooks from REPL.tsx (~830 lines → ~20 lines): - usePipeIpc: lifecycle (bootstrap, handlers, heartbeat, cleanup) - usePipeRelay: slave→master message relay via module singleton - usePipePermissionForward: permission request/cancel forwarding - usePipeRouter: selected pipe input routing with role+IP labels - Shared ndjsonFramer.ts replaces 3 duplicate NDJSON parsers Key fixes applied during development: - Multicast binds to correct LAN interface (not WSL/Docker) - Beacon ref stored as module singleton (not Zustand state mutation) - Heartbeat preserves LAN peers in discoveredPipes and selectedPipes - Disconnect handler calls removeSlaveClient (fixes listener leak) - cleanupStaleEntries probes without lock, writes briefly under lock - getMachineId uses async execFile (not blocking execSync) - globalThis.__pipeSendToMaster replaced with setPipeRelay singleton - M key only toggles route mode when selector panel is expanded - User prompt displayed in message list on pipe broadcast - Broadcast notifications show [role] + hostname/IP for LAN peers Other restored features: - Monitor tool: /monitor command, MonitorTool, MonitorMcpTask lifecycle - Daemon supervisor and remoteControlServer command - Tools: SnipTool, SleepTool, ListPeersTool, SendUserFileTool, WebBrowserTool, WorkflowTool, and 10+ stub→implementation rewrites - Feature flags: UDS_INBOX, LAN_PIPES, MONITOR_TOOL, FORK_SUBAGENT, KAIROS, COORDINATOR_MODE, WORKFLOW_SCRIPTS, HISTORY_SNIP Tests: 2190 pass / 0 fail (15 new: lanBeacon 7, peerAddress 8) * fix: resolve merge conflicts and fix all tsc/test errors after main merge - Export ToolResultBlockParam from Tool.ts (14 tool files fixed) - Migrate ink imports from ../../ink.js to @anthropic/ink (7 files) - Fix toolUseID → toolUseId typo in monitor.ts and MonitorTool.tsx - Add fallback values for string|undefined type errors (8 locations) - Fix AppState type in assistant.ts, add NewInstallWizard stubs - Fix ParsedRepository.repo → .name in subscribe-pr.ts - Fix AgentId/string type mismatch in BackgroundTasksDialog.tsx - Fix PipeRelayFn return type in pipePermissionRelay.ts - Use PipeMessage type in usePipeRelay.ts - Fix lanBeacon.test.ts mock type assertions - Create missing MouseActionEvent class for ink package - Use ansi: color format instead of bare "green"/"red" - Resolve theme.permission access via getTheme() Result: 0 tsc errors, 2496 tests pass, 0 fail Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: 恢复 /poor 的说明 --------- Co-authored-by: unraid <local@unraid.local> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 86f534a commit 9074e40

124 files changed

Lines changed: 10959 additions & 578 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ src/utils/vendor/
1212

1313
# AI tool runtime directories
1414
.agents/
15+
.claude/
1516
.codex/
1617
.omx/
1718

DEV-LOG.md

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,185 @@
1010

1111
---
1212

13+
## Pipe IPC + LAN Pipes + Monitor Tool + 工具恢复 (2026-04-08 ~ 2026-04-11)
14+
15+
**分支**: `feat/pr-package-adapt`
16+
17+
### 背景
18+
19+
从 decompiled 代码恢复大量 stub 为完整实现,同时新增 LAN 跨机器通讯能力。本次 PR 覆盖:Pipe IPC 系统、LAN Pipes、Monitor Tool、20+ 工具/组件���复、REPL hook 架构重构。
20+
21+
### 实现
22+
23+
#### 1. PipeServer TCP 双模式(`src/utils/pipeTransport.ts`
24+
25+
从原始的纯 UDS 服务器扩展为 UDS + TCP 双模式:
26+
27+
- 提取 `setupSocket()` 共享方法,UDS 和 TCP 的 socket 处理逻辑完全一致
28+
- `start(options?: PipeServerOptions)` 新增可选参数 `{ enableTcp, tcpPort }`
29+
- 内部维护两个 `net.Server`(UDS + TCP),共享同一组 `clients: Set<Socket>``handlers`
30+
- TCP server 绑定 `0.0.0.0` + 动态端口(port=0 由 OS 分配)
31+
- `tcpAddress` getter 暴露 TCP 端口信息
32+
- `close()` 同时关闭两个 server
33+
- 新增类型:`PipeTransportMode``TcpEndpoint``PipeServerOptions`
34+
35+
PipeClient 对应扩展:
36+
- 构造函数新增可选 `TcpEndpoint` 参数
37+
- `connect()` 根据是否有 TCP endpoint 分派到 `connectTcp()``connectUds()`
38+
- TCP 连接不需要文件存在轮询,直接建立连接
39+
40+
#### 2. LAN Beacon — UDP Multicast 发现(`src/utils/lanBeacon.ts`,新文件)
41+
42+
零配置局域网 peer 发现:
43+
44+
- **协议**:UDP multicast 组 `224.0.71.67`("CC" ASCII),端口 `7101`,TTL=1
45+
- **Announce 包**:JSON `{ proto, pipeName, machineId, hostname, ip, tcpPort, role, ts }`
46+
- **广播间隔**:3 秒,首次在 socket bind 完成后立即发送
47+
- **Peer 超时**:15 秒无 announce 视为 lost
48+
- **事件**`peer-discovered``peer-lost`
49+
- **存储**:module-level singleton `getLanBeacon()`/`setLanBeacon()`,不挂在 Zustand state 上
50+
51+
关键修复:
52+
- `addMembership(group, localIp)` + `setMulticastInterface(localIp)` 指定 LAN 网卡,解决 Windows 上 WSL/Docker 虚拟网卡劫持 multicast 的问题
53+
- announce/cleanup 定时器移入 `bind()` 回调内,修复 socket 未就绪时发送的竞态
54+
55+
#### 3. Registry 扩展(`src/utils/pipeRegistry.ts`
56+
57+
- `PipeRegistryEntry` 新增 `tcpPort?``lanVisible?` 字段
58+
- `mergeWithLanPeers(registry, lanPeers)` 合并本地 registry 和 LAN beacon peers,本地优先
59+
60+
#### 4. Peer Address 扩展(`src/utils/peerAddress.ts`
61+
62+
- `parseAddress()` 新增 `tcp` scheme:`tcp:192.168.1.20:7100`
63+
- 新增 `parseTcpTarget()` 解析 `host:port` 字符串
64+
65+
#### 5. REPL 集成(`src/screens/REPL.tsx`
66+
67+
三个阶段的改动:
68+
69+
**Bootstrap**`createPipeServer()` 时根据 `feature('LAN_PIPES')` 传入 TCP 选项 → 启动 `LanBeacon` → 注册 entry 携带 tcpPort
70+
71+
**Heartbeat**(每 5 秒):
72+
- `refreshDiscoveredPipes()` 同时包含本地 subs 和 LAN beacon peers,防止 LAN peer 状态被覆盖
73+
- auto-attach 循环统一遍历本地 subs + LAN peers,LAN peers 通过 TCP endpoint 连接
74+
- cleanup 检查 LAN beacon peers 列表,避免误删存活的 LAN 连接
75+
- attach 请求携带 `machineId`,接收方区分 LAN peer(不要求 sub 角色)
76+
77+
**Cleanup**:通过 `getLanBeacon()` 获取并 `stop()``setLanBeacon(null)` 清除
78+
79+
#### 6. 命令更新
80+
81+
- `/pipes``src/commands/pipes/pipes.ts`):显示 `[LAN]` 标记的远端实例
82+
- `/attach``src/commands/attach/attach.ts`):自动查找 LAN beacon 获取 TCP endpoint
83+
- `SendMessageTool``src/tools/SendMessageTool/SendMessageTool.ts`):支持 `tcp:` scheme,权限检查要求用户确认
84+
85+
#### 7. Feature Flag
86+
87+
`LAN_PIPES` — 在 `scripts/dev.ts``build.ts` 的默认 features 列表中启用。所有 LAN 代码路径均通过 `feature('LAN_PIPES')` 门控。
88+
89+
#### 8. Pipe IPC 基础系统(`UDS_INBOX` feature)
90+
91+
- `PipeServer`/`PipeClient`:UDS 传输,NDJSON 协议(共享 `ndjsonFramer.ts`
92+
- `PipeRegistry`:machineId 绑定的角色分配(main/sub),文件锁,并行探测
93+
- Master/slave attach 流程、prompt 转发、permission 转发
94+
- Heartbeat 生命周期(5s 间隔,stale entry 清理,busy flag 防重叠)
95+
- 命令:`/pipes``/attach``/detach``/send``/claim-main``/pipe-status`
96+
97+
#### 9. Monitor Tool(`MONITOR_TOOL` feature)
98+
99+
- `MonitorTool`:AI 可调用的后台 shell 监控工具
100+
- `/monitor` 命令:用户快捷入口,Windows 兼容(watch → PowerShell 循环)
101+
- `MonitorMcpTask`:从 stub 恢复完整生命周期(register/complete/fail/kill)
102+
- `MonitorPermissionRequest`:React 权限确认 UI
103+
- `MonitorMcpDetailDialog`:Shift+Down 详情面板
104+
105+
#### 10. 工具恢复(stub → 实现)
106+
107+
- SnipTool、SleepTool、ListPeersTool、SendUserFileTool
108+
- WebBrowserTool、SubscribePRTool、PushNotificationTool
109+
- CtxInspectTool、TerminalCaptureTool、WorkflowTool
110+
- REPLTool (.js → .ts)、VerifyPlanExecutionTool (.js → .ts)、SuggestBackgroundPRTool (.js → .ts)
111+
- 组件 .ts → .tsx 重写:MonitorPermissionRequest、ReviewArtifactPermissionRequest、MonitorMcpDetailDialog、WorkflowDetailDialog、WorkflowPermissionRequest
112+
113+
#### 11. REPL Hook 架构重构
114+
115+
从 REPL.tsx 提取 ~830 行 Pipe IPC 内联代码为 4 个独立 hook:
116+
117+
| Hook | 行数 | 职责 |
118+
|------|------|------|
119+
| `usePipeIpc` | 623 | 生命周期:bootstrap、handlers、heartbeat、cleanup |
120+
| `usePipeRelay` | 38 | slave→master 消息回传(通过 `setPipeRelay` singleton) |
121+
| `usePipePermissionForward` | 159 | 权限请求转发 + 流式通知显示 |
122+
| `usePipeRouter` | 130 | selected pipe 输入路由 + role/IP 标签显示 |
123+
124+
共享工具:`ndjsonFramer.ts` 替换 3 份重复的 NDJSON 解析。
125+
126+
#### 12. Feature Flags 新增启用
127+
128+
UDS_INBOX、LAN_PIPES、MONITOR_TOOL、FORK_SUBAGENT、KAIROS、COORDINATOR_MODE、WORKFLOW_SCRIPTS、HISTORY_SNIP、CONTEXT_COLLAPSE
129+
130+
### 踩坑记录
131+
132+
1. **Multicast 绑错网卡**:Windows 上 `addMembership(group)` 不指定本地接口时,默认绑到 WSL/Docker 虚拟网卡(`172.19.112.1`),LAN 上的真实机器收不到。必须 `addMembership(group, localIp)` + `setMulticastInterface(localIp)`
133+
134+
2. **Beacon ref 丢失**:最初用 `(store.getState() as any)._lanBeacon` 挂载 beacon 引用,但 Zustand `setState` 展开 `prev` 时不包含 `_lanBeacon` 属性,下次读取就是 `undefined`。改为 module-level singleton 解决。
135+
136+
3. **Heartbeat 清洗 LAN 连接**`refreshDiscoveredPipes()` 每 5 秒用仅含本地 registry subs 的列表完全覆盖 `discoveredPipes` + `selectedPipes`,LAN peer 的发现和选择状态被持续清空。必须在 refresh 中同时包含 beacon peers。
137+
138+
4. **Heartbeat cleanup 误删**`!aliveSubNames.has(slaveName)` 导致 LAN peer(不在本地 registry)被判定为死连接每 5 秒清除一次。需要同时检查 beacon peers 列表。
139+
140+
5. **跨机器 attach 被拒**:两台机器各自为 `main`,attach handler 硬编码 `role !== 'sub'` 拒绝。通过 attach_request 携带 `machineId`,接收方对不同 machineId 的请求放行。
141+
142+
6. **`feature()` 使用约束**:Bun 的 `feature()` 是编译时常量,只能在 `if` 语句或三元条件中直接使用,不能赋值给变量(如 `const x = feature('...')`),否则构建报错。
143+
144+
### 已知限制
145+
146+
- TCP 无认证:同 LAN 内任何设备知道端口号即可连接
147+
- JSON.parse 无 schema 验证:code review 建议增加 Zod 校验
148+
- Beacon 明文广播 IP/hostname/machineId:建议后续 hash 处理
149+
- `getLocalIp()` 可能返回 VPN 地址:多网卡环境需更精确的接口选择
150+
151+
### 测试
152+
153+
- `src/utils/__tests__/lanBeacon.test.ts`:7 个测试(mock dgram)
154+
- `src/utils/__tests__/peerAddress.test.ts`:8 个测试(纯函数)
155+
- 全量:2190 pass / 0 fail
156+
157+
### 防火墙配置
158+
159+
**Windows**(管理员 PowerShell):
160+
```powershell
161+
New-NetFirewallRule -DisplayName "Claude Code LAN Beacon (UDP)" -Direction Inbound -Protocol UDP -LocalPort 7101 -Action Allow -Profile Private
162+
New-NetFirewallRule -DisplayName "Claude Code LAN Pipes (TCP)" -Direction Inbound -Protocol TCP -LocalPort 1024-65535 -Program (Get-Command bun).Source -Action Allow -Profile Private
163+
New-NetFirewallRule -DisplayName "Claude Code LAN Beacon Out (UDP)" -Direction Outbound -Protocol UDP -RemotePort 7101 -Action Allow -Profile Private
164+
```
165+
166+
**macOS**(首次运行时系统会弹出"允许接受传入连接"对话框,点击允许即可。手动放行):
167+
```bash
168+
# 如果使用 pf ���火墙,添加规则:
169+
echo "pass in proto udp from any to any port 7101" | sudo pfctl -ef -
170+
# 或��接在 System Settings → Network → Firewall 中允许 bun 进程
171+
```
172+
173+
**Linux**(firewalld):
174+
```bash
175+
sudo firewall-cmd --zone=trusted --add-port=7101/udp --permanent
176+
sudo firewall-cmd --zone=trusted --add-port=1024-65535/tcp --permanent
177+
sudo firewall-cmd --reload
178+
```
179+
180+
**Linux**(iptables):
181+
```bash
182+
sudo iptables -A INPUT -p udp --dport 7101 -j ACCEPT
183+
sudo iptables -A INPUT -p tcp --dport 1024:65535 -m owner --uid-owner $(id -u) -j ACCEPT
184+
sudo iptables-save | sudo tee /etc/iptables/rules.v4
185+
```
186+
187+
**通用验证**:确认网络为局域网(非公共 WiFi),路���器未开启 AP 隔离。
188+
189+
---
190+
191+
13192
## Daemon + Remote Control Server 还原 (2026-04-07)
14193

15194
**分支**: `feat/daemon-remote-control-server`

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
[文档在这里, 支持投稿 PR](https://ccb.agent-aura.top/) | [留影文档在这里](./Friends.md) | [Discord 群组](https://discord.gg/qZU6zS7Q)
1616

1717
-[x] V4 — 测试补全、[Buddy](https://ccb.agent-aura.top/docs/features/buddy)[Auto Mode](https://ccb.agent-aura.top/docs/safety/auto-mode)、环境变量 Feature 开关
18-
-[x] V5 — [Sentry](https://ccb.agent-aura.top/docs/internals/sentry-setup) / [GrowthBook](https://ccb.agent-aura.top/docs/internals/growthbook-adapter) 企业监控、[自定义 Login](https://ccb.agent-aura.top/docs/features/custom-platform-login)[OpenAI 兼容](https://ccb.agent-aura.top/docs/plans/openai-compatibility)[Web Search](https://ccb.agent-aura.top/docs/features/web-browser-tool)[Computer Use](https://ccb.agent-aura.top/docs/features/computer-use) / [Chrome Use](https://ccb.agent-aura.top/docs/features/claude-in-chrome-mcp)[Voice Mode](https://ccb.agent-aura.top/docs/features/voice-mode)[Bridge Mode](https://ccb.agent-aura.top/docs/features/bridge-mode)[Remote Control 私有部署](https://ccb.agent-aura.top/docs/features/remote-control-self-hosting)[/dream 记忆整理](https://ccb.agent-aura.top/docs/features/auto-dream)
18+
- ✅ [x] V5 — [Sentry](https://ccb.agent-aura.top/docs/internals/sentry-setup) / [GrowthBook](https://ccb.agent-aura.top/docs/internals/growthbook-adapter) 企业监控、[自定义 Login](https://ccb.agent-aura.top/docs/features/custom-platform-login)、[OpenAI 兼容](https://ccb.agent-aura.top/docs/plans/openai-compatibility)、[Web Search](https://ccb.agent-aura.top/docs/features/web-browser-tool)、[Computer Use](https://ccb.agent-aura.top/docs/features/computer-use) / [Chrome Use](https://ccb.agent-aura.top/docs/features/claude-in-chrome-mcp)、[Voice Mode](https://ccb.agent-aura.top/docs/features/voice-mode)、[Bridge Mode](https://ccb.agent-aura.top/docs/features/bridge-mode)、[Remote Control 私有部署](https://ccb.agent-aura.top/docs/features/remote-control-self-hosting)、[/dream 记忆整理](https://ccb.agent-aura.top/docs/features/auto-dream)、**全网独家支持 Claude 群控技术** — [Pipe IPC 多实例协作](https://ccb.agent-aura.top/docs/features/pipes-and-lan)(同机 main/sub 自动编排 + [LAN 跨机器零配置发现与通讯](https://ccb.agent-aura.top/docs/features/lan-pipes),`/pipes` 选择面板 + `Shift+↓` 交互 + 消息广播路由)
1919
- 🔮 [ ] V6 — 大规模重构石山代码,全面模块分包(全新分支,main 封存为历史版本)
2020

2121
- 🚀 [想要启动项目](#快速开始源码版)

build.ts

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ rmSync(outdir, { recursive: true, force: true })
1111
// Default features that match the official CLI build.
1212
// Additional features can be enabled via FEATURE_<NAME>=1 env vars.
1313
const DEFAULT_BUILD_FEATURES = [
14-
'BUDDY',
15-
'TRANSCRIPT_CLASSIFIER',
16-
'BRIDGE_MODE',
1714
'AGENT_TRIGGERS_REMOTE',
1815
'CHICAGO_MCP',
1916
'VOICE_MODE',
@@ -33,6 +30,28 @@ const DEFAULT_BUILD_FEATURES = [
3330
'ULTRAPLAN',
3431
// P2: daemon + remote control server
3532
'DAEMON',
33+
// PR-package restored features
34+
'WORKFLOW_SCRIPTS',
35+
'HISTORY_SNIP',
36+
'CONTEXT_COLLAPSE',
37+
'MONITOR_TOOL',
38+
'FORK_SUBAGENT',
39+
'UDS_INBOX',
40+
'KAIROS',
41+
'COORDINATOR_MODE',
42+
'LAN_PIPES',
43+
// 'REVIEW_ARTIFACT', // API 请求无响应,需进一步排查 schema 兼容性
44+
// PR-package restored features
45+
'WORKFLOW_SCRIPTS',
46+
'HISTORY_SNIP',
47+
'CONTEXT_COLLAPSE',
48+
'MONITOR_TOOL',
49+
'FORK_SUBAGENT',
50+
'UDS_INBOX',
51+
'KAIROS',
52+
'COORDINATOR_MODE',
53+
'LAN_PIPES',
54+
// 'REVIEW_ARTIFACT', // API 请求无响应,需进一步排查 schema 兼容性
3655
// P3: poor mode (disable extract_memories + prompt_suggestion)
3756
'POOR',
3857
]

docs/feature-exploration-plan.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ FEATURE_KAIROS=1 FEATURE_PROACTIVE=1 FEATURE_FORK_SUBAGENT=1 bun run dev
250250
| Feature | 引用 | 状态 | 说明 |
251251
|---------|------|------|------|
252252
| CHICAGO_MCP | 16 | N/A | Anthropic 内部 MCP 基础设施 |
253-
| UDS_INBOX | 17 | Stub | Unix 域套接字对等消息 |
253+
| UDS_INBOX | 17 | Experimental | 本机 UDS 消息层 + 本机 named-pipe 协调层 |
254254
| MONITOR_TOOL | 13 | Stub | 文件/进程监控工具 |
255255
| BG_SESSIONS | 11 | Stub | 后台会话管理 |
256256
| SHOT_STATS | 10 | 无实现 | 逐 prompt 统计 |

docs/feature-flags-audit-complete.md

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,38 +1005,32 @@ src/utils/swarm/ 目录(22 个文件):
10051005

10061006
## 28. UDS_INBOX
10071007

1008-
**编译时引用次数**: 18(单引号 17 + 双引号 1
1009-
**功能描述**: UDS(Unix Domain Socket)收件箱。允许 Claude Code 实例之间通过 Unix 套接字发送消息。
1010-
**分类**: PARTIAL
1011-
**缺失原因**: `src/utils/udsMessaging.ts` 仅 1 行,`src/utils/udsClient.ts` 仅 3 行(空壳),命令入口缺失
1008+
**编译时引用次数**: 18(历史快照
1009+
**功能描述**: 本机进程间通信能力。当前由两层组成:
1010+
1. `udsMessaging` / `udsClient`:通用 UDS 消息层,供 `SendMessageTool``/peers` 使用。
1011+
2. `pipeTransport` / `pipeRegistry`:会话级 named-pipe 协调层,供 `/pipes``/attach``/detach``/send``/pipe-status``/history``/claim-main` 使用。
10121012

1013-
**核心实现文件**:
1013+
**当前分类**: IMPLEMENTED / EXPERIMENTAL
10141014

1015-
| 文件路径 | 行数 | 功能说明 |
1016-
|----------|------|----------|
1017-
| src/tools/SendMessageTool/SendMessageTool.ts | 917 行 | 发送消息工具(完整实现) |
1018-
| src/tools/SendMessageTool/prompt.ts | 49 行 | 消息工具提示词 |
1019-
| src/utils/udsClient.ts | 3 行 | UDS 客户端(桩) |
1020-
| src/utils/udsMessaging.ts | 1 行 | UDS 消息(桩) |
1015+
**当前事实**:
1016+
- `src/utils/udsMessaging.ts``src/utils/udsClient.ts` 已实现,不再是空壳。
1017+
- `src/utils/pipeTransport.ts` 使用本机 named pipe / Unix socket;`localIp` / `hostname` / `machineId` 仅用于注册表展示与身份判定,不是已上线的局域网传输层。
1018+
- `src/screens/REPL.tsx` 内联承载当前有效的 pipe 控制平面;早期 hook 试验路径已清理。
10211019

1022-
**引用该标志的文件(10 个)**:
1023-
1. src/cli/print.ts — CLI 输出
1024-
2. src/commands.ts — 命令注册(引用 `commands/peers/index.js`
1025-
3. src/components/messages/UserTextMessage.tsx — 用户消息
1026-
4. src/main.tsx — 主入口
1027-
5. src/setup.ts — 初始化
1028-
6. src/tools.ts — 工具注册
1029-
7. src/tools/SendMessageTool/SendMessageTool.ts — 发送消息工具
1030-
8. src/tools/SendMessageTool/prompt.ts — 提示词
1031-
9. src/utils/concurrentSessions.ts — 并发会话
1032-
10. src/utils/messages/systemInit.ts — 系统初始化消息
1033-
1034-
**缺失文件**:
1035-
- src/commands/peers/index.ts — 命令入口缺失
1036-
- src/utils/udsMessaging.ts — 仅 1 行空壳
1037-
- src/utils/udsClient.ts — 仅 3 行空壳
1020+
**核心实现文件**:
10381021

1039-
**启用所需修复**: 需要实现 UDS 客户端和消息模块,并创建命令入口。
1022+
| 文件路径 | 功能说明 |
1023+
|----------|----------|
1024+
| src/utils/udsMessaging.ts | 通用 UDS server / inbox |
1025+
| src/utils/udsClient.ts | 通用 peer 发现、探活、发送 |
1026+
| src/utils/pipeTransport.ts | named-pipe server/client、探活、AppState 扩展 |
1027+
| src/utils/pipeRegistry.ts | main/sub 注册表、machineId、claim-main |
1028+
| src/commands/peers/peers.ts | UDS peer 可达性检查 |
1029+
| src/commands/pipes/pipes.ts | pipe 注册表检查与选择器入口 |
1030+
| src/commands/attach/attach.ts | master -> slave attach |
1031+
| src/screens/REPL.tsx | 当前生效的 REPL pipe bootstrap 与心跳 |
1032+
1033+
**备注**: 如需真实局域网通信,需要单独引入 TCP/WebSocket 传输、认证与发现机制;现有代码尚未实现该层。详见 `docs/features/uds-inbox.md`
10401034

10411035
---
10421036

0 commit comments

Comments
 (0)