shennian 0.3.36 → 0.3.38

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.
Files changed (216) hide show
  1. package/README.md +1 -0
  2. package/dist/publish-build-manifest.json +75 -170
  3. package/dist/src/agents/detect.js +1 -1
  4. package/dist/src/agents/manager.d.ts +36 -0
  5. package/dist/src/agents/manager.js +11 -6
  6. package/dist/src/agents/model-registry/service.js +1 -1
  7. package/dist/src/agents/platform-instructions.d.ts +2 -2
  8. package/dist/src/agents/platform-instructions.js +6 -14
  9. package/dist/src/agents/workbuddy.js +2 -2
  10. package/dist/src/commands/agent.d.ts +6 -1
  11. package/dist/src/commands/agent.js +3 -6
  12. package/dist/src/commands/integration.d.ts +1 -0
  13. package/dist/src/commands/integration.js +2 -1
  14. package/dist/src/commands/manager.js +1 -1
  15. package/dist/src/commands/pair-authorization.d.ts +3 -0
  16. package/dist/src/commands/pair-authorization.js +1 -0
  17. package/dist/src/commands/pair-browser.js +1 -1
  18. package/dist/src/commands/room.d.ts +9 -17
  19. package/dist/src/commands/room.js +3 -8
  20. package/dist/src/commands/runtime.d.ts +2 -0
  21. package/dist/src/commands/runtime.js +6 -0
  22. package/dist/src/daemon-ipc/client.d.ts +1 -1
  23. package/dist/src/daemon-ipc/json.d.ts +3 -0
  24. package/dist/src/daemon-ipc/json.js +1 -0
  25. package/dist/src/daemon-ipc/protocol.d.ts +1 -1
  26. package/dist/src/daemon-ipc/server.d.ts +1 -1
  27. package/dist/src/index.js +3 -2
  28. package/dist/src/manager/registry.d.ts +21 -0
  29. package/dist/src/manager/registry.js +2 -2
  30. package/dist/src/manager/runtime.d.ts +5 -1
  31. package/dist/src/manager/runtime.js +14 -13
  32. package/dist/src/room/activation-service.d.ts +6 -0
  33. package/dist/src/room/activation-service.js +5 -8
  34. package/dist/src/room/attachment-cache.d.ts +2 -1
  35. package/dist/src/room/attachment-cache.js +2 -2
  36. package/dist/src/room/device-authorization-client.d.ts +39 -1
  37. package/dist/src/room/managed-context.d.ts +45 -0
  38. package/dist/src/room/managed-context.js +1 -0
  39. package/dist/src/room/managed-prompt-composer.d.ts +32 -0
  40. package/dist/src/room/managed-prompt-composer.js +24 -0
  41. package/dist/src/room/managed-room-ipc.d.ts +16 -0
  42. package/dist/src/room/managed-room-ipc.js +1 -0
  43. package/dist/src/room/mirror-sync-service.d.ts +2 -5
  44. package/dist/src/room/mirror-sync-service.js +1 -1
  45. package/dist/src/room/public-attachment-cache.d.ts +34 -0
  46. package/dist/src/room/public-attachment-cache.js +2 -0
  47. package/dist/src/room/public-room-client.d.ts +36 -0
  48. package/dist/src/room/public-room-client.js +1 -0
  49. package/dist/src/room/room-action-client.d.ts +3 -1
  50. package/dist/src/room/room-action-client.js +1 -1
  51. package/dist/src/room/session-registry.d.ts +7 -0
  52. package/dist/src/room/session-registry.js +2 -2
  53. package/dist/src/session/handlers/chat.d.ts +5 -1
  54. package/dist/src/session/handlers/chat.js +2 -2
  55. package/dist/src/session/manager.d.ts +1 -20
  56. package/dist/src/session/manager.js +1 -1
  57. package/dist/src/session/queue.js +3 -3
  58. package/dist/src/session/store.d.ts +9 -1
  59. package/dist/src/session/store.js +3 -3
  60. package/dist/src/session/types.d.ts +2 -1
  61. package/node_modules/@shennian/wire/dist/agent-capabilities.d.ts +0 -1
  62. package/node_modules/@shennian/wire/dist/agent-capabilities.js +0 -1
  63. package/node_modules/@shennian/wire/dist/agent-workspace.d.ts +0 -1
  64. package/node_modules/@shennian/wire/dist/agent-workspace.js +0 -1
  65. package/node_modules/@shennian/wire/dist/envelope.d.ts +0 -1
  66. package/node_modules/@shennian/wire/dist/envelope.js +0 -1
  67. package/node_modules/@shennian/wire/dist/events.d.ts +0 -1
  68. package/node_modules/@shennian/wire/dist/events.js +0 -1
  69. package/node_modules/@shennian/wire/dist/external-message-format.d.ts +0 -1
  70. package/node_modules/@shennian/wire/dist/external-message-format.js +0 -1
  71. package/node_modules/@shennian/wire/dist/frames.d.ts +0 -1
  72. package/node_modules/@shennian/wire/dist/frames.js +0 -1
  73. package/node_modules/@shennian/wire/dist/fs.d.ts +0 -1
  74. package/node_modules/@shennian/wire/dist/fs.js +0 -1
  75. package/node_modules/@shennian/wire/dist/index.d.ts +0 -1
  76. package/node_modules/@shennian/wire/dist/index.js +0 -1
  77. package/node_modules/@shennian/wire/dist/machine.d.ts +0 -1
  78. package/node_modules/@shennian/wire/dist/machine.js +0 -1
  79. package/node_modules/@shennian/wire/dist/message-payload.d.ts +0 -1
  80. package/node_modules/@shennian/wire/dist/message-payload.js +0 -1
  81. package/node_modules/@shennian/wire/dist/methods.d.ts +0 -1
  82. package/node_modules/@shennian/wire/dist/methods.js +0 -1
  83. package/node_modules/@shennian/wire/dist/native-session.d.ts +0 -1
  84. package/node_modules/@shennian/wire/dist/native-session.js +0 -1
  85. package/node_modules/@shennian/wire/dist/project.d.ts +0 -1
  86. package/node_modules/@shennian/wire/dist/project.js +0 -1
  87. package/node_modules/@shennian/wire/dist/room.d.ts +44 -1
  88. package/node_modules/@shennian/wire/dist/room.js +0 -1
  89. package/node_modules/@shennian/wire/dist/session.d.ts +18 -3
  90. package/node_modules/@shennian/wire/dist/session.js +0 -2
  91. package/node_modules/@shennian/wire/dist/tool-detail.d.ts +0 -1
  92. package/node_modules/@shennian/wire/dist/tool-detail.js +0 -1
  93. package/node_modules/@shennian/wire/dist/voice-chief.d.ts +0 -1
  94. package/node_modules/@shennian/wire/dist/voice-chief.js +0 -1
  95. package/node_modules/@shennian/wire/package.json +1 -0
  96. package/package.json +2 -2
  97. package/dist/src/integrations/claude-room-plugin-lifecycle.d.ts +0 -47
  98. package/dist/src/integrations/claude-room-plugin-lifecycle.js +0 -1
  99. package/dist/src/integrations/codex-room-plugin-lifecycle.d.ts +0 -49
  100. package/dist/src/integrations/codex-room-plugin-lifecycle.js +0 -1
  101. package/dist/src/integrations/room-plugin-bundles.d.ts +0 -23
  102. package/dist/src/integrations/room-plugin-bundles.js +0 -1
  103. package/dist/src/integrations/room-plugin-lifecycle-common.d.ts +0 -17
  104. package/dist/src/integrations/room-plugin-lifecycle-common.js +0 -1
  105. package/dist/src/integrations/room-plugin-shared.d.ts +0 -25
  106. package/dist/src/integrations/room-plugin-shared.js +0 -4
  107. package/dist/src/integrations/room-session-hook.d.ts +0 -30
  108. package/dist/src/integrations/room-session-hook.js +0 -2
  109. package/dist/src/integrations/workbuddy-plugin-bundle.d.ts +0 -16
  110. package/dist/src/integrations/workbuddy-plugin-bundle.js +0 -1
  111. package/dist/src/integrations/workbuddy-plugin-lifecycle.d.ts +0 -62
  112. package/dist/src/integrations/workbuddy-plugin-lifecycle.js +0 -2
  113. package/dist/src/integrations/workbuddy-session-hook.d.ts +0 -22
  114. package/dist/src/integrations/workbuddy-session-hook.js +0 -1
  115. package/dist/src/room/agent-tool.d.ts +0 -63
  116. package/dist/src/room/agent-tool.js +0 -1
  117. package/dist/src/room/authorized-action-coordinator.d.ts +0 -40
  118. package/dist/src/room/authorized-action-coordinator.js +0 -1
  119. package/dist/src/room/authorized-action-ipc.d.ts +0 -11
  120. package/dist/src/room/authorized-action-ipc.js +0 -1
  121. package/dist/src/room/host-session-observation-ipc.d.ts +0 -9
  122. package/dist/src/room/host-session-observation-ipc.js +0 -1
  123. package/dist/src/room/invocation-token-ipc.d.ts +0 -9
  124. package/dist/src/room/invocation-token-ipc.js +0 -1
  125. package/dist/src/room/invocation-token.d.ts +0 -53
  126. package/dist/src/room/invocation-token.js +0 -1
  127. package/dist/src/room/jsonl-mirror.d.ts +0 -73
  128. package/dist/src/room/jsonl-mirror.js +0 -6
  129. package/dist/src/room/managed-room-session-runtime.d.ts +0 -18
  130. package/dist/src/room/managed-room-session-runtime.js +0 -1
  131. package/dist/src/room/managed-room-session.d.ts +0 -144
  132. package/dist/src/room/managed-room-session.js +0 -2
  133. package/dist/src/room/operator-ipc.d.ts +0 -13
  134. package/dist/src/room/operator-ipc.js +0 -1
  135. package/dist/src/room/pending-authorized-actions.d.ts +0 -69
  136. package/dist/src/room/pending-authorized-actions.js +0 -3
  137. package/dist/src/room/room-action-ipc.d.ts +0 -34
  138. package/dist/src/room/room-action-ipc.js +0 -1
  139. package/dist/src/room/room-action-schema.d.ts +0 -3
  140. package/dist/src/room/room-action-schema.js +0 -1
  141. package/dist/src/room/room-authorized-action-executor.d.ts +0 -23
  142. package/dist/src/room/room-authorized-action-executor.js +0 -1
  143. package/dist/src/room/room-binding-ipc.d.ts +0 -31
  144. package/dist/src/room/room-binding-ipc.js +0 -1
  145. package/dist/src/room/session-registry-ipc.d.ts +0 -14
  146. package/dist/src/room/session-registry-ipc.js +0 -1
  147. package/dist/src/room/tool-schema.d.ts +0 -120
  148. package/dist/src/room/tool-schema.js +0 -1
  149. package/dist/src/room/tool-server.d.ts +0 -11
  150. package/dist/src/room/tool-server.js +0 -3
  151. package/node_modules/@shennian/wire/dist/__tests__/message-payload.test.d.ts +0 -2
  152. package/node_modules/@shennian/wire/dist/__tests__/message-payload.test.d.ts.map +0 -1
  153. package/node_modules/@shennian/wire/dist/__tests__/message-payload.test.js +0 -23
  154. package/node_modules/@shennian/wire/dist/__tests__/message-payload.test.js.map +0 -1
  155. package/node_modules/@shennian/wire/dist/__tests__/mock.test.d.ts +0 -2
  156. package/node_modules/@shennian/wire/dist/__tests__/mock.test.d.ts.map +0 -1
  157. package/node_modules/@shennian/wire/dist/__tests__/mock.test.js +0 -66
  158. package/node_modules/@shennian/wire/dist/__tests__/mock.test.js.map +0 -1
  159. package/node_modules/@shennian/wire/dist/__tests__/types.test.d.ts +0 -2
  160. package/node_modules/@shennian/wire/dist/__tests__/types.test.d.ts.map +0 -1
  161. package/node_modules/@shennian/wire/dist/__tests__/types.test.js +0 -159
  162. package/node_modules/@shennian/wire/dist/__tests__/types.test.js.map +0 -1
  163. package/node_modules/@shennian/wire/dist/agent-capabilities.d.ts.map +0 -1
  164. package/node_modules/@shennian/wire/dist/agent-capabilities.js.map +0 -1
  165. package/node_modules/@shennian/wire/dist/agent-workspace.d.ts.map +0 -1
  166. package/node_modules/@shennian/wire/dist/agent-workspace.js.map +0 -1
  167. package/node_modules/@shennian/wire/dist/envelope.d.ts.map +0 -1
  168. package/node_modules/@shennian/wire/dist/envelope.js.map +0 -1
  169. package/node_modules/@shennian/wire/dist/events.d.ts.map +0 -1
  170. package/node_modules/@shennian/wire/dist/events.js.map +0 -1
  171. package/node_modules/@shennian/wire/dist/external-message-format.d.ts.map +0 -1
  172. package/node_modules/@shennian/wire/dist/external-message-format.js.map +0 -1
  173. package/node_modules/@shennian/wire/dist/frames.d.ts.map +0 -1
  174. package/node_modules/@shennian/wire/dist/frames.js.map +0 -1
  175. package/node_modules/@shennian/wire/dist/fs.d.ts.map +0 -1
  176. package/node_modules/@shennian/wire/dist/fs.js.map +0 -1
  177. package/node_modules/@shennian/wire/dist/index.d.ts.map +0 -1
  178. package/node_modules/@shennian/wire/dist/index.js.map +0 -1
  179. package/node_modules/@shennian/wire/dist/machine.d.ts.map +0 -1
  180. package/node_modules/@shennian/wire/dist/machine.js.map +0 -1
  181. package/node_modules/@shennian/wire/dist/message-payload.d.ts.map +0 -1
  182. package/node_modules/@shennian/wire/dist/message-payload.js.map +0 -1
  183. package/node_modules/@shennian/wire/dist/methods.d.ts.map +0 -1
  184. package/node_modules/@shennian/wire/dist/methods.js.map +0 -1
  185. package/node_modules/@shennian/wire/dist/mock/fixtures.d.ts +0 -39
  186. package/node_modules/@shennian/wire/dist/mock/fixtures.d.ts.map +0 -1
  187. package/node_modules/@shennian/wire/dist/mock/fixtures.js +0 -99
  188. package/node_modules/@shennian/wire/dist/mock/fixtures.js.map +0 -1
  189. package/node_modules/@shennian/wire/dist/mock/index.d.ts +0 -3
  190. package/node_modules/@shennian/wire/dist/mock/index.d.ts.map +0 -1
  191. package/node_modules/@shennian/wire/dist/mock/index.js +0 -4
  192. package/node_modules/@shennian/wire/dist/mock/index.js.map +0 -1
  193. package/node_modules/@shennian/wire/dist/mock/routes.d.ts +0 -96
  194. package/node_modules/@shennian/wire/dist/mock/routes.d.ts.map +0 -1
  195. package/node_modules/@shennian/wire/dist/mock/routes.js +0 -40
  196. package/node_modules/@shennian/wire/dist/mock/routes.js.map +0 -1
  197. package/node_modules/@shennian/wire/dist/native-session.d.ts.map +0 -1
  198. package/node_modules/@shennian/wire/dist/native-session.js.map +0 -1
  199. package/node_modules/@shennian/wire/dist/project.d.ts.map +0 -1
  200. package/node_modules/@shennian/wire/dist/project.js.map +0 -1
  201. package/node_modules/@shennian/wire/dist/queue.d.ts +0 -15
  202. package/node_modules/@shennian/wire/dist/queue.d.ts.map +0 -1
  203. package/node_modules/@shennian/wire/dist/queue.js +0 -2
  204. package/node_modules/@shennian/wire/dist/queue.js.map +0 -1
  205. package/node_modules/@shennian/wire/dist/room.d.ts.map +0 -1
  206. package/node_modules/@shennian/wire/dist/room.js.map +0 -1
  207. package/node_modules/@shennian/wire/dist/session.d.ts.map +0 -1
  208. package/node_modules/@shennian/wire/dist/session.js.map +0 -1
  209. package/node_modules/@shennian/wire/dist/skills.d.ts +0 -61
  210. package/node_modules/@shennian/wire/dist/skills.d.ts.map +0 -1
  211. package/node_modules/@shennian/wire/dist/skills.js +0 -2
  212. package/node_modules/@shennian/wire/dist/skills.js.map +0 -1
  213. package/node_modules/@shennian/wire/dist/tool-detail.d.ts.map +0 -1
  214. package/node_modules/@shennian/wire/dist/tool-detail.js.map +0 -1
  215. package/node_modules/@shennian/wire/dist/voice-chief.d.ts.map +0 -1
  216. package/node_modules/@shennian/wire/dist/voice-chief.js.map +0 -1
package/README.md CHANGED
@@ -3,6 +3,7 @@
3
3
  > Shennian AI Agent 控制面的本机后台服务 / CLI
4
4
  >
5
5
  > **架构设计** → [docs/architecture/cli/](../../docs/architecture/cli/)
6
+ > - [CLI 设计哲学](../../docs/architecture/cli/design-philosophy.md) — CLI、Skill、daemon、身份与宿主适配边界
6
7
  > - [Daemon 架构](../../docs/architecture/cli/daemon.md) — 模块拓扑、数据流、守护进程
7
8
  > - [Agent Adapters](../../docs/architecture/cli/agent-adapters.md) — 5 种 agent 的适配与归一化
8
9
  > - [开源 Agent Protocol](../../docs/architecture/cli/agent-protocol.md) — 第三方 agent 接入协议
@@ -2,7 +2,7 @@
2
2
  "schemaVersion": 1,
3
3
  "jsMinified": true,
4
4
  "minifier": "esbuild",
5
- "fileCount": 130,
5
+ "fileCount": 111,
6
6
  "files": [
7
7
  {
8
8
  "file": "bin/shennian.js",
@@ -56,8 +56,8 @@
56
56
  },
57
57
  {
58
58
  "file": "src/agents/detect.js",
59
- "beforeBytes": 1817,
60
- "afterBytes": 904
59
+ "beforeBytes": 1506,
60
+ "afterBytes": 701
61
61
  },
62
62
  {
63
63
  "file": "src/agents/external-channel-instructions.js",
@@ -71,8 +71,8 @@
71
71
  },
72
72
  {
73
73
  "file": "src/agents/manager.js",
74
- "beforeBytes": 6489,
75
- "afterBytes": 3499
74
+ "beforeBytes": 10395,
75
+ "afterBytes": 5613
76
76
  },
77
77
  {
78
78
  "file": "src/agents/model-registry/cache.js",
@@ -96,8 +96,8 @@
96
96
  },
97
97
  {
98
98
  "file": "src/agents/model-registry/service.js",
99
- "beforeBytes": 2880,
100
- "afterBytes": 1209
99
+ "beforeBytes": 3048,
100
+ "afterBytes": 1321
101
101
  },
102
102
  {
103
103
  "file": "src/agents/model-registry/types.js",
@@ -126,8 +126,8 @@
126
126
  },
127
127
  {
128
128
  "file": "src/agents/platform-instructions.js",
129
- "beforeBytes": 3550,
130
- "afterBytes": 2047
129
+ "beforeBytes": 2829,
130
+ "afterBytes": 1705
131
131
  },
132
132
  {
133
133
  "file": "src/agents/runtime-compatibility.js",
@@ -136,13 +136,13 @@
136
136
  },
137
137
  {
138
138
  "file": "src/agents/workbuddy.js",
139
- "beforeBytes": 14907,
140
- "afterBytes": 7558
139
+ "beforeBytes": 14265,
140
+ "afterBytes": 7150
141
141
  },
142
142
  {
143
143
  "file": "src/commands/agent.js",
144
- "beforeBytes": 6216,
145
- "afterBytes": 3443
144
+ "beforeBytes": 7536,
145
+ "afterBytes": 4438
146
146
  },
147
147
  {
148
148
  "file": "src/commands/daemon-process.js",
@@ -166,18 +166,23 @@
166
166
  },
167
167
  {
168
168
  "file": "src/commands/integration.js",
169
- "beforeBytes": 4173,
170
- "afterBytes": 2491
169
+ "beforeBytes": 815,
170
+ "afterBytes": 468
171
171
  },
172
172
  {
173
173
  "file": "src/commands/manager.js",
174
- "beforeBytes": 6882,
175
- "afterBytes": 4465
174
+ "beforeBytes": 6902,
175
+ "afterBytes": 4479
176
+ },
177
+ {
178
+ "file": "src/commands/pair-authorization.js",
179
+ "beforeBytes": 1255,
180
+ "afterBytes": 746
176
181
  },
177
182
  {
178
183
  "file": "src/commands/pair-browser.js",
179
- "beforeBytes": 6558,
180
- "afterBytes": 3650
184
+ "beforeBytes": 6544,
185
+ "afterBytes": 3636
181
186
  },
182
187
  {
183
188
  "file": "src/commands/pair-qr.js",
@@ -191,8 +196,13 @@
191
196
  },
192
197
  {
193
198
  "file": "src/commands/room.js",
194
- "beforeBytes": 11089,
195
- "afterBytes": 5750
199
+ "beforeBytes": 14862,
200
+ "afterBytes": 8665
201
+ },
202
+ {
203
+ "file": "src/commands/runtime.js",
204
+ "beforeBytes": 4986,
205
+ "afterBytes": 2765
196
206
  },
197
207
  {
198
208
  "file": "src/commands/tools.js",
@@ -214,6 +224,11 @@
214
224
  "beforeBytes": 2754,
215
225
  "afterBytes": 1393
216
226
  },
227
+ {
228
+ "file": "src/daemon-ipc/json.js",
229
+ "beforeBytes": 11,
230
+ "afterBytes": 1
231
+ },
217
232
  {
218
233
  "file": "src/daemon-ipc/paths.js",
219
234
  "beforeBytes": 1010,
@@ -266,53 +281,8 @@
266
281
  },
267
282
  {
268
283
  "file": "src/index.js",
269
- "beforeBytes": 26427,
270
- "afterBytes": 13597
271
- },
272
- {
273
- "file": "src/integrations/claude-room-plugin-lifecycle.js",
274
- "beforeBytes": 11692,
275
- "afterBytes": 6435
276
- },
277
- {
278
- "file": "src/integrations/codex-room-plugin-lifecycle.js",
279
- "beforeBytes": 13989,
280
- "afterBytes": 7423
281
- },
282
- {
283
- "file": "src/integrations/room-plugin-bundles.js",
284
- "beforeBytes": 5035,
285
- "afterBytes": 2787
286
- },
287
- {
288
- "file": "src/integrations/room-plugin-lifecycle-common.js",
289
- "beforeBytes": 4324,
290
- "afterBytes": 2202
291
- },
292
- {
293
- "file": "src/integrations/room-plugin-shared.js",
294
- "beforeBytes": 10445,
295
- "afterBytes": 6666
296
- },
297
- {
298
- "file": "src/integrations/room-session-hook.js",
299
- "beforeBytes": 12856,
300
- "afterBytes": 6456
301
- },
302
- {
303
- "file": "src/integrations/workbuddy-plugin-bundle.js",
304
- "beforeBytes": 2256,
305
- "afterBytes": 1258
306
- },
307
- {
308
- "file": "src/integrations/workbuddy-plugin-lifecycle.js",
309
- "beforeBytes": 15998,
310
- "afterBytes": 8237
311
- },
312
- {
313
- "file": "src/integrations/workbuddy-session-hook.js",
314
- "beforeBytes": 2622,
315
- "afterBytes": 1252
284
+ "beforeBytes": 21131,
285
+ "afterBytes": 11117
316
286
  },
317
287
  {
318
288
  "file": "src/log-reporter.js",
@@ -326,8 +296,8 @@
326
296
  },
327
297
  {
328
298
  "file": "src/manager/registry.js",
329
- "beforeBytes": 11834,
330
- "afterBytes": 5843
299
+ "beforeBytes": 13897,
300
+ "afterBytes": 6747
331
301
  },
332
302
  {
333
303
  "file": "src/manager/retired-external-channel-compat.js",
@@ -336,8 +306,8 @@
336
306
  },
337
307
  {
338
308
  "file": "src/manager/runtime.js",
339
- "beforeBytes": 68697,
340
- "afterBytes": 34863
309
+ "beforeBytes": 71951,
310
+ "afterBytes": 36578
341
311
  },
342
312
  {
343
313
  "file": "src/native-fusion/codex-parser.js",
@@ -401,44 +371,24 @@
401
371
  },
402
372
  {
403
373
  "file": "src/room/activation-service.js",
404
- "beforeBytes": 16619,
405
- "afterBytes": 9832
406
- },
407
- {
408
- "file": "src/room/agent-tool.js",
409
- "beforeBytes": 5020,
410
- "afterBytes": 3009
374
+ "beforeBytes": 15508,
375
+ "afterBytes": 7310
411
376
  },
412
377
  {
413
378
  "file": "src/room/attachment-cache.js",
414
- "beforeBytes": 12422,
415
- "afterBytes": 5892
379
+ "beforeBytes": 12558,
380
+ "afterBytes": 6015
416
381
  },
417
382
  {
418
383
  "file": "src/room/attachment-upload.js",
419
384
  "beforeBytes": 4871,
420
385
  "afterBytes": 2617
421
386
  },
422
- {
423
- "file": "src/room/authorized-action-coordinator.js",
424
- "beforeBytes": 3558,
425
- "afterBytes": 1690
426
- },
427
- {
428
- "file": "src/room/authorized-action-ipc.js",
429
- "beforeBytes": 7421,
430
- "afterBytes": 3693
431
- },
432
387
  {
433
388
  "file": "src/room/device-authorization-client.js",
434
389
  "beforeBytes": 3803,
435
390
  "afterBytes": 2160
436
391
  },
437
- {
438
- "file": "src/room/host-session-observation-ipc.js",
439
- "beforeBytes": 4071,
440
- "afterBytes": 2166
441
- },
442
392
  {
443
393
  "file": "src/room/host-session-observations.js",
444
394
  "beforeBytes": 9376,
@@ -450,19 +400,14 @@
450
400
  "afterBytes": 3363
451
401
  },
452
402
  {
453
- "file": "src/room/invocation-token-ipc.js",
454
- "beforeBytes": 3247,
455
- "afterBytes": 1723
456
- },
457
- {
458
- "file": "src/room/invocation-token.js",
459
- "beforeBytes": 7288,
460
- "afterBytes": 3803
403
+ "file": "src/room/managed-context.js",
404
+ "beforeBytes": 4442,
405
+ "afterBytes": 2478
461
406
  },
462
407
  {
463
- "file": "src/room/jsonl-mirror.js",
464
- "beforeBytes": 17632,
465
- "afterBytes": 9201
408
+ "file": "src/room/managed-prompt-composer.js",
409
+ "beforeBytes": 4423,
410
+ "afterBytes": 4204
466
411
  },
467
412
  {
468
413
  "file": "src/room/managed-room-binding.js",
@@ -470,79 +415,39 @@
470
415
  "afterBytes": 3316
471
416
  },
472
417
  {
473
- "file": "src/room/managed-room-session-runtime.js",
474
- "beforeBytes": 6393,
475
- "afterBytes": 3293
476
- },
477
- {
478
- "file": "src/room/managed-room-session.js",
479
- "beforeBytes": 17354,
480
- "afterBytes": 8762
418
+ "file": "src/room/managed-room-ipc.js",
419
+ "beforeBytes": 7797,
420
+ "afterBytes": 3832
481
421
  },
482
422
  {
483
423
  "file": "src/room/mirror-sync-service.js",
484
- "beforeBytes": 7686,
485
- "afterBytes": 3515
424
+ "beforeBytes": 7714,
425
+ "afterBytes": 3498
486
426
  },
487
427
  {
488
- "file": "src/room/operator-ipc.js",
489
- "beforeBytes": 8566,
490
- "afterBytes": 4401
428
+ "file": "src/room/public-attachment-cache.js",
429
+ "beforeBytes": 10361,
430
+ "afterBytes": 5048
491
431
  },
492
432
  {
493
- "file": "src/room/pending-authorized-actions.js",
494
- "beforeBytes": 15111,
495
- "afterBytes": 8340
433
+ "file": "src/room/public-room-client.js",
434
+ "beforeBytes": 5637,
435
+ "afterBytes": 3101
496
436
  },
497
437
  {
498
438
  "file": "src/room/room-action-client.js",
499
- "beforeBytes": 23011,
500
- "afterBytes": 11555
501
- },
502
- {
503
- "file": "src/room/room-action-ipc.js",
504
- "beforeBytes": 16387,
505
- "afterBytes": 7413
506
- },
507
- {
508
- "file": "src/room/room-action-schema.js",
509
- "beforeBytes": 6434,
510
- "afterBytes": 3065
511
- },
512
- {
513
- "file": "src/room/room-authorized-action-executor.js",
514
- "beforeBytes": 6641,
515
- "afterBytes": 3594
439
+ "beforeBytes": 23331,
440
+ "afterBytes": 11775
516
441
  },
517
442
  {
518
443
  "file": "src/room/room-binding-client.js",
519
444
  "beforeBytes": 7028,
520
445
  "afterBytes": 4032
521
446
  },
522
- {
523
- "file": "src/room/room-binding-ipc.js",
524
- "beforeBytes": 5545,
525
- "afterBytes": 2843
526
- },
527
- {
528
- "file": "src/room/session-registry-ipc.js",
529
- "beforeBytes": 7514,
530
- "afterBytes": 3827
531
- },
532
447
  {
533
448
  "file": "src/room/session-registry.js",
534
- "beforeBytes": 26358,
535
- "afterBytes": 14831
536
- },
537
- {
538
- "file": "src/room/tool-schema.js",
539
- "beforeBytes": 5223,
540
- "afterBytes": 3212
541
- },
542
- {
543
- "file": "src/room/tool-server.js",
544
- "beforeBytes": 8507,
545
- "afterBytes": 4475
449
+ "beforeBytes": 27208,
450
+ "afterBytes": 15357
546
451
  },
547
452
  {
548
453
  "file": "src/session/archive-zip.js",
@@ -566,8 +471,8 @@
566
471
  },
567
472
  {
568
473
  "file": "src/session/handlers/chat.js",
569
- "beforeBytes": 29613,
570
- "afterBytes": 12377
474
+ "beforeBytes": 31135,
475
+ "afterBytes": 13184
571
476
  },
572
477
  {
573
478
  "file": "src/session/handlers/control.js",
@@ -601,8 +506,8 @@
601
506
  },
602
507
  {
603
508
  "file": "src/session/manager.js",
604
- "beforeBytes": 21721,
605
- "afterBytes": 11139
509
+ "beforeBytes": 18103,
510
+ "afterBytes": 9204
606
511
  },
607
512
  {
608
513
  "file": "src/session/projection.js",
@@ -611,8 +516,8 @@
611
516
  },
612
517
  {
613
518
  "file": "src/session/queue.js",
614
- "beforeBytes": 14491,
615
- "afterBytes": 6801
519
+ "beforeBytes": 15015,
520
+ "afterBytes": 7165
616
521
  },
617
522
  {
618
523
  "file": "src/session/remote-attachments.js",
@@ -621,8 +526,8 @@
621
526
  },
622
527
  {
623
528
  "file": "src/session/store.js",
624
- "beforeBytes": 3925,
625
- "afterBytes": 1918
529
+ "beforeBytes": 4333,
530
+ "afterBytes": 2212
626
531
  },
627
532
  {
628
533
  "file": "src/session/tool-summary.js",
@@ -1 +1 @@
1
- import{AVAILABLE_BUILTIN_AGENT_TYPES as s}from"@shennian/wire";import{loadConfig as r}from"../config/index.js";import{getCommandVersion as d,resolveBuiltinCommand as a}from"./command-spec.js";const i=s.filter(e=>e!=="pi"&&e!=="manager");function c(e){const t=e.models?.length?e.models:e.model?[e.model]:[],n=e.defaultModel??e.model;return t.map(o=>({id:o,name:o,isDefault:o===n}))}function g(){const e=[{type:"manager",command:"shennian",args:["manager"],version:void 0,models:[{id:"codex",name:"Codex",provider:"shennian",isDefault:!0},{id:"claude",name:"Claude Code",provider:"shennian"}]}];for(const n of i){const o=a(n);if(!o)continue;const m=d(o);e.push({type:n,command:o.command,args:o.args,version:m})}const t=r();for(const[n,o]of Object.entries(t.customAgents??{}))e.push({type:`custom:${n}`,command:o.command,args:[],version:o.caps.version,models:c(o.caps)});return e}export{g as detectAgents};
1
+ import{AVAILABLE_BUILTIN_AGENT_TYPES as s}from"@shennian/wire";import{loadConfig as r}from"../config/index.js";import{getCommandVersion as c,resolveBuiltinCommand as d}from"./command-spec.js";const i=s.filter(o=>o!=="pi");function l(o){const n=o.models?.length?o.models:o.model?[o.model]:[],t=o.defaultModel??o.model;return n.map(e=>({id:e,name:e,isDefault:e===t}))}function g(){const o=[];for(const t of i){const e=d(t);if(!e)continue;const m=c(e);o.push({type:t,command:e.command,args:e.args,version:m})}const n=r();for(const[t,e]of Object.entries(n.customAgents??{}))o.push({type:`custom:${t}`,command:e.command,args:[],version:e.caps.version,models:l(e.caps)});return o}export{g as detectAgents};
@@ -1,4 +1,39 @@
1
+ import type { AgentSendContext, AgentSendResult } from './adapter.js';
1
2
  import { AgentAdapter } from './adapter.js';
3
+ import type { ChatAttachmentMeta, ExternalChannelSessionStatus } from '@shennian/wire';
4
+ type ManagerModelId = 'codex' | 'claude';
5
+ /** Decorates a real provider Adapter with Manager session capabilities. New
6
+ * sessions use this class and keep their real agentType/modelId. */
7
+ export declare class ManagerModeAdapter extends AgentAdapter {
8
+ private readonly inner;
9
+ private readonly substrate;
10
+ readonly type: import("@shennian/wire").AgentType;
11
+ private sessionId;
12
+ private workDir;
13
+ private agentSessionId;
14
+ private configured;
15
+ constructor(inner: AgentAdapter, substrate: ManagerModelId);
16
+ configure(options: {
17
+ sessionId?: string;
18
+ externalChannel?: ExternalChannelSessionStatus | null;
19
+ env?: NodeJS.ProcessEnv;
20
+ }): void;
21
+ start(sessionId: string, workDir: string, agentSessionId?: string | null): Promise<void>;
22
+ send(text: string, modelId?: string, reasoningEffort?: string, attachments?: ChatAttachmentMeta[], agentSystemPrompt?: string | null, context?: AgentSendContext): Promise<void | AgentSendResult>;
23
+ resume(agentSessionId: string): Promise<void>;
24
+ stop(): Promise<void>;
25
+ getStatus(): Promise<{
26
+ active: boolean;
27
+ runId?: string | null;
28
+ runPhase?: import("@shennian/wire").SessionRunPhase | null;
29
+ canStop?: boolean;
30
+ }> | Promise<{
31
+ active: false;
32
+ }>;
33
+ setTitle(agentSessionId: string, title: string, workDir?: string): Promise<void>;
34
+ private applyEnvironment;
35
+ }
36
+ export declare function combineManagerInstructions(managerInstructions: string, systemPrompt?: string | null): string;
2
37
  export declare class ManagerAdapter extends AgentAdapter {
3
38
  readonly type: "manager";
4
39
  private inner;
@@ -14,3 +49,4 @@ export declare class ManagerAdapter extends AgentAdapter {
14
49
  private wrapEvent;
15
50
  private withManagerEnv;
16
51
  }
52
+ export {};
@@ -1,13 +1,18 @@
1
- import{AgentAdapter as h,registerAgent as l}from"./adapter.js";import{CodexAdapter as g}from"./codex.js";import{ClaudeAdapter as m}from"./claude.js";import{MANAGER_SYSTEM_PROMPT as I,buildManagerPrompt as f}from"../manager/prompt.js";import{getManagerRuntimeService as o}from"../manager/runtime.js";import a from"node:fs";import d from"node:path";import{PLATFORM_OUTPUT_INSTRUCTIONS as p}from"./platform-instructions.js";function S(s){return s==="claude"?"claude":"codex"}function w(s){return s.replace(/[^a-zA-Z0-9_.-]/g,"_")}function M(s){const e=d.join(s,"AGENTS.md");try{return a.readFileSync(e,"utf8").trim()}catch{return""}}function y(s,e){return d.join(s,".shennian","runtime","manager",w(e),"instructions.md")}function u(s,e){const n=M(s),t=o(),r=t?.getManagerExternalChannelSystemPrompt(e)??"",i=typeof t?.getManagerWorkerDefaults=="function"?t.getManagerWorkerDefaults(e):void 0,c=i?.agentType?`\u9ED8\u8BA4 worker Agent\uFF1A${i.agentType}${i.modelId?`
2
- \u9ED8\u8BA4 worker \u6A21\u578B\uFF1A${i.modelId}`:""}\u3002\u9664\u975E\u7528\u6237\u660E\u786E\u8981\u6C42\u6216\u4EFB\u52A1\u660E\u663E\u9700\u8981\u5176\u4ED6 Agent/\u6A21\u578B\uFF0C\u521B\u5EFA worker \u65F6\u4F18\u5148\u4F7F\u7528\u8FD9\u4E2A\u9ED8\u8BA4\u7EC4\u5408\u3002`:"";return`${["# Shennian Manager Instructions","This file is generated by Shennian for a Manager Agent substrate session. Do not edit it by hand.",n?`## Project Instructions
1
+ import{AgentAdapter as g,registerAgent as I}from"./adapter.js";import{CodexAdapter as p}from"./codex.js";import{ClaudeAdapter as f}from"./claude.js";import{MANAGER_SYSTEM_PROMPT as y,buildManagerPrompt as l}from"../manager/prompt.js";import{getManagerRuntimeService as o}from"../manager/runtime.js";import d from"node:fs";import c from"node:path";import{PLATFORM_OUTPUT_INSTRUCTIONS as S}from"./platform-instructions.js";function w(i){return i==="claude"?"claude":"codex"}function M(i){return i.replace(/[^a-zA-Z0-9_.-]/g,"_")}function v(i){const e=c.join(i,"AGENTS.md");try{return d.readFileSync(e,"utf8").trim()}catch{return""}}function k(i,e){return c.join(i,".shennian","runtime","manager",M(e),"instructions.md")}function h(i,e){const n=v(i),t=o(),r=t?.getManagerExternalChannelSystemPrompt(e)??"",s=typeof t?.getManagerWorkerDefaults=="function"?t.getManagerWorkerDefaults(e):void 0,a=s?.agentType?`\u9ED8\u8BA4 worker Agent\uFF1A${s.agentType}${s.modelId?`
2
+ \u9ED8\u8BA4 worker \u6A21\u578B\uFF1A${s.modelId}`:""}\u3002\u9664\u975E\u7528\u6237\u660E\u786E\u8981\u6C42\u6216\u4EFB\u52A1\u660E\u663E\u9700\u8981\u5176\u4ED6 Agent/\u6A21\u578B\uFF0C\u521B\u5EFA worker \u65F6\u4F18\u5148\u4F7F\u7528\u8FD9\u4E2A\u9ED8\u8BA4\u7EC4\u5408\u3002`:"";return`${["# Shennian Manager Instructions","This file is generated by Shennian for a Manager Agent substrate session. Do not edit it by hand.",n?`## Project Instructions
3
3
 
4
4
  ${n}`:"",`## Manager Instructions
5
5
 
6
- ${I}`,c?`## Worker Defaults
6
+ ${y}`,a?`## Worker Defaults
7
7
 
8
- ${c}`:"",r?`## External Message Channel Instructions
8
+ ${a}`:"",r?`## External Message Channel Instructions
9
9
 
10
- ${r}`:"",p].filter(Boolean).join(`
10
+ ${r}`:"",S].filter(Boolean).join(`
11
11
 
12
12
  `)}
13
- `}function k(s,e){const n=y(s,e),t=u(s,e);a.mkdirSync(d.dirname(n),{recursive:!0});try{if(a.readFileSync(n,"utf8")===t)return n}catch{}return a.writeFileSync(n,t),n}class A extends h{type="manager";inner=null;sessionId="";workDir="";agentSessionId=null;modelId="codex";async start(e,n,t){this.sessionId=e,this.workDir=n,this.agentSessionId=t??null,o()?.registerManager({sessionId:e,agentSessionId:this.agentSessionId,workDir:n,modelId:this.modelId,status:"idle"})}async send(e,n){const t=S(n);if(!this.inner||t!==this.modelId){await this.inner?.stop().catch(()=>{}),this.inner?.removeAllListeners(),this.modelId=t;const r=k(this.workDir,this.sessionId),i=u(this.workDir,this.sessionId);this.inner=t==="claude"?new m({systemPrompt:i,hidden:!0}):new g({modelInstructionsFile:r,hidden:!0}),this.bindInner(this.inner),await this.inner.start(this.sessionId,this.workDir,this.agentSessionId),o()?.bindManagerAdapterEvents(this.sessionId,this.inner)}o()?.registerManager({sessionId:this.sessionId,agentSessionId:this.agentSessionId,workDir:this.workDir,modelId:this.modelId,status:"running"}),await o()?.ready(),await this.withManagerEnv(()=>this.inner.send(f(e)))}async resume(e){this.agentSessionId=e,this.inner&&await this.inner.resume(e)}async stop(){await this.inner?.stop()}bindInner(e){e.on("agentEvent",n=>{n.agentSessionId&&(this.agentSessionId=n.agentSessionId),this.emit("agentEvent",this.wrapEvent(n))}),e.on("error",n=>this.emit("error",n))}wrapEvent(e){return{...e,source:e.source??this.modelId,agentSessionId:e.agentSessionId??this.agentSessionId??void 0}}async withManagerEnv(e){const n=o()?.getInjectedEnv(this.sessionId,this.agentSessionId,this.workDir,this.modelId)??{},t=new Map;for(const[r,i]of Object.entries(n))t.set(r,process.env[r]),process.env[r]=i;try{return await e()}finally{for(const[r,i]of t)i===void 0?delete process.env[r]:process.env[r]=i}}}l("manager",()=>new A);export{A as ManagerAdapter};
13
+ `}function E(i,e){const n=k(i,e),t=h(i,e);d.mkdirSync(c.dirname(n),{recursive:!0});try{if(d.readFileSync(n,"utf8")===t)return n}catch{}return d.writeFileSync(n,t),n}class R extends g{inner;substrate;type;sessionId="";workDir="";agentSessionId=null;configured={};constructor(e,n){super(),this.inner=e,this.substrate=n,this.type=e.type,e.on("agentEvent",t=>{t.agentSessionId&&(this.agentSessionId=t.agentSessionId),this.emit("agentEvent",{...t,source:t.source??n})}),e.on("error",t=>this.emit("error",t))}configure(e){this.configured=e,this.applyEnvironment()}async start(e,n,t){this.sessionId=e,this.workDir=n,this.agentSessionId=t??null,this.applyEnvironment(),await this.inner.start(e,n,t),o()?.registerManager({sessionId:e,agentSessionId:this.agentSessionId,workDir:n,modelId:this.substrate,agentType:this.type==="claude"?"claude":"codex",status:"idle"}),o()?.bindManagerAdapterEvents(e,this.inner)}async send(e,n,t,r,s,a){o()?.registerManager({sessionId:this.sessionId,agentSessionId:this.agentSessionId,workDir:this.workDir,modelId:this.substrate,agentType:this.type==="claude"?"claude":"codex",providerModelId:n??null,status:"running"}),await o()?.ready(),this.applyEnvironment();const u=h(this.workDir,this.sessionId),m=A(u,s);return this.inner.send(l(e),n,t,r,m,a)}async resume(e){this.agentSessionId=e,await this.inner.resume(e)}async stop(){await this.inner.stop()}getStatus(){return this.inner.getStatus?.()??Promise.resolve({active:!1})}setTitle(e,n,t){return this.inner.setTitle?.(e,n,t)??Promise.resolve()}applyEnvironment(){const e=this.sessionId?o()?.getInjectedEnv(this.sessionId,this.agentSessionId,this.workDir,this.substrate)??{}:{};this.inner.configure?.({...this.configured,sessionId:this.configured.sessionId??this.sessionId,env:{...this.configured.env??{},...e}})}}function A(i,e){const n=e?.trim()??"";if(!n)return i;const r=["[\u667A\u80FD\u4F53\u79C1\u6709\u7CFB\u7EDF\u63D0\u793A\u8BCD]","[\u667A\u80FD\u4F53\u8EAB\u4EFD]"].map(s=>n.indexOf(s)).filter(s=>s>=0).sort((s,a)=>s-a)[0]??-1;return n.startsWith("[\u795E\u5FF5\u53D7\u7BA1\u4F1A\u8BDD\u89C4\u5219]")&&r>=0?`${n.slice(0,r)}[\u4F1A\u8BDD\u6A21\u5F0F]
14
+ ${i.trim()}
15
+
16
+ ${n.slice(r)}`:`${i.trim()}
17
+
18
+ ${n}`}class b extends g{type="manager";inner=null;sessionId="";workDir="";agentSessionId=null;modelId="codex";async start(e,n,t){this.sessionId=e,this.workDir=n,this.agentSessionId=t??null,o()?.registerManager({sessionId:e,agentSessionId:this.agentSessionId,workDir:n,modelId:this.modelId,agentType:"manager",status:"idle"})}async send(e,n){const t=w(n);if(!this.inner||t!==this.modelId){await this.inner?.stop().catch(()=>{}),this.inner?.removeAllListeners(),this.modelId=t;const r=E(this.workDir,this.sessionId),s=h(this.workDir,this.sessionId);this.inner=t==="claude"?new f({systemPrompt:s,hidden:!0}):new p({modelInstructionsFile:r,hidden:!0}),this.bindInner(this.inner),await this.inner.start(this.sessionId,this.workDir,this.agentSessionId),o()?.bindManagerAdapterEvents(this.sessionId,this.inner)}o()?.registerManager({sessionId:this.sessionId,agentSessionId:this.agentSessionId,workDir:this.workDir,modelId:this.modelId,agentType:"manager",status:"running"}),await o()?.ready(),await this.withManagerEnv(()=>this.inner.send(l(e)))}async resume(e){this.agentSessionId=e,this.inner&&await this.inner.resume(e)}async stop(){await this.inner?.stop()}bindInner(e){e.on("agentEvent",n=>{n.agentSessionId&&(this.agentSessionId=n.agentSessionId),this.emit("agentEvent",this.wrapEvent(n))}),e.on("error",n=>this.emit("error",n))}wrapEvent(e){return{...e,source:e.source??this.modelId,agentSessionId:e.agentSessionId??this.agentSessionId??void 0}}async withManagerEnv(e){const n=o()?.getInjectedEnv(this.sessionId,this.agentSessionId,this.workDir,this.modelId)??{},t=new Map;for(const[r,s]of Object.entries(n))t.set(r,process.env[r]),process.env[r]=s;try{return await e()}finally{for(const[r,s]of t)s===void 0?delete process.env[r]:process.env[r]=s}}}I("manager",()=>new b);export{b as ManagerAdapter,R as ManagerModeAdapter,A as combineManagerInstructions};
@@ -1 +1 @@
1
- import{getAgentConfigSummary as u}from"../config-status.js";import{isCacheFresh as h,readCache as m,writeCache as p}from"./cache.js";import{discoverModelsForAgent as y}from"./discovery.js";import{getAgentRuntimeSummary as g}from"../runtime-compatibility.js";function v(o){const s=new Set,e=[];for(const t of o)!t.id||s.has(t.id)||(s.add(t.id),e.push(t));return e}function I(o){const s=m();return o.map(e=>{const t=u(e.type),r=g(e);return{type:e.type,models:s.agents[e.type]?.models??e.models??[],...t?{config:t}:{},...r?{runtime:r}:{}}})}async function q(o,s){const e=m();for(const t of o)delete e.agents[t.type];return p(e),A(o,s)}async function A(o,s){const e=m();let t=!1;const r=[];for(const n of o){const c=e.agents[n.type];let i;if(h(c,n.version))i=c.models;else{let f=null;try{f=v(await y(n,s)),i=f.length>0?f:c?.models??n.models??[]}catch{i=c?.models??n.models??[]}if(f&&f.length>0){const l={version:n.version,refreshedAt:Date.now(),models:i};JSON.stringify(c)!==JSON.stringify(l)&&(e.agents[n.type]=l,t=!0)}}const a=u(n.type),d=g(n);r.push({type:n.type,models:i,...a?{config:a}:{},...d?{runtime:d}:{}})}return t&&p(e),r}export{I as getCachedAgentInfos,q as refreshAgentInfos,A as resolveAgentInfos};
1
+ import{getAgentConfigSummary as m}from"../config-status.js";import{isCacheFresh as g,readCache as d,writeCache as l}from"./cache.js";import{discoverModelsForAgent as h}from"./discovery.js";import{getAgentRuntimeSummary as y}from"../runtime-compatibility.js";function v(n){const s=new Set,e=[];for(const t of n)!t.id||s.has(t.id)||(s.add(t.id),e.push(t));return e}function w(n){const s=d();return n.map(e=>{const t=m(e.type),r=y(e);return{type:e.type,models:s.agents[e.type]?.models??e.models??[],supportsManagerMode:e.type==="codex"||e.type==="claude",...t?{config:t}:{},...r?{runtime:r}:{}}})}async function I(n,s){const e=d();for(const t of n)delete e.agents[t.type];return l(e),x(n,s)}async function x(n,s){const e=d();let t=!1;const r=[];for(const o of n){const c=e.agents[o.type];let i;if(g(c,o.version))i=c.models;else{let f=null;try{f=v(await h(o,s)),i=f.length>0?f:c?.models??o.models??[]}catch{i=c?.models??o.models??[]}if(f&&f.length>0){const u={version:o.version,refreshedAt:Date.now(),models:i};JSON.stringify(c)!==JSON.stringify(u)&&(e.agents[o.type]=u,t=!0)}}const a=m(o.type),p=y(o);r.push({type:o.type,models:i,supportsManagerMode:o.type==="codex"||o.type==="claude",...a?{config:a}:{},...p?{runtime:p}:{}})}return t&&l(e),r}export{w as getCachedAgentInfos,I as refreshAgentInfos,x as resolveAgentInfos};
@@ -1,5 +1,5 @@
1
1
  import type { ExternalChannelSessionStatus } from '@shennian/wire';
2
- export declare const PLATFORM_OUTPUT_INSTRUCTIONS = "## Shennian Output Instructions\n\nWhen you mention a local file that the user may want to open in Shennian, format it as a Markdown link using the exact local path:\n\n- Use [filename.ext](</absolute/path/to/filename.ext>) for absolute Unix, macOS, or Windows paths.\n- Use [filename.ext](<relative/path/to/filename.ext>) for paths relative to the current working directory.\n- Do not use file:// URLs for local files.\n- Do not put user-openable file paths only inside code blocks.\n- Keep normal http:// and https:// links unchanged.";
3
- export declare function buildPlatformInstructions(workDir: string, externalChannel?: ExternalChannelSessionStatus | null, sessionId?: string, agentSystemPrompt?: string | null): string;
2
+ export declare const PLATFORM_OUTPUT_INSTRUCTIONS = "When you mention a local file that the user may want to open, format it as a Markdown link using the exact local path:\n\n- Use [filename.ext](</absolute/path/to/filename.ext>) for absolute Unix, macOS, or Windows paths.\n- Use [filename.ext](<relative/path/to/filename.ext>) for paths relative to the current working directory.\n- Do not use file:// URLs for local files.\n- Do not put user-openable file paths only inside code blocks.\n- Keep normal http:// and https:// links unchanged.";
3
+ export declare function buildPlatformInstructions(_workDir: string, _externalChannel?: ExternalChannelSessionStatus | null, _sessionId?: string, agentSystemPrompt?: string | null): string;
4
4
  export declare function buildInlineChannelPreamble(workDir: string, externalChannel?: ExternalChannelSessionStatus | null, sessionId?: string, agentSystemPrompt?: string | null): string;
5
5
  export declare function ensurePlatformInstructionsFile(workDir: string, externalChannel?: ExternalChannelSessionStatus | null, sessionId?: string, agentSystemPrompt?: string | null): string;
@@ -1,25 +1,17 @@
1
- import a from"node:fs";import s from"node:path";import{createHash as u}from"node:crypto";import{resolveShennianPath as f}from"../config/index.js";import{buildExternalChannelInstructions as l}from"./external-channel-instructions.js";const h=`## Shennian Output Instructions
2
-
3
- When you mention a local file that the user may want to open in Shennian, format it as a Markdown link using the exact local path:
1
+ import s from"node:fs";import a from"node:path";import{createHash as c}from"node:crypto";import{resolveShennianPath as u}from"../config/index.js";import{buildExternalChannelInstructions as f}from"./external-channel-instructions.js";const h=`When you mention a local file that the user may want to open, format it as a Markdown link using the exact local path:
4
2
 
5
3
  - Use [filename.ext](</absolute/path/to/filename.ext>) for absolute Unix, macOS, or Windows paths.
6
4
  - Use [filename.ext](<relative/path/to/filename.ext>) for paths relative to the current working directory.
7
5
  - Do not use file:// URLs for local files.
8
6
  - Do not put user-openable file paths only inside code blocks.
9
- - Keep normal http:// and https:// links unchanged.`;function m(t){const e=s.join(t,"AGENTS.md");try{return a.readFileSync(e,"utf8").trim()}catch{return""}}function p(t,e,i,o){const r=m(t),n=l(e,s.resolve(t),i);return`${["# Shennian Agent Instructions",r?`## Project Instructions
10
-
11
- ${r}`:"",h,o?.trim()?`## Agent Instructions
12
-
13
- ${o.trim()}`:"",n?`## External Message Channel Instructions
14
-
15
- ${n}`:""].filter(Boolean).join(`
7
+ - Keep normal http:// and https:// links unchanged.`;function m(e,o,r,t){return`${[t?.trim()??"",h].filter(Boolean).join(`
16
8
 
17
9
  `)}
18
- `}function g(t,e,i,o){const r=l(e,s.resolve(t),i),n=[o?.trim()?`## \u667A\u80FD\u4F53\u63D0\u793A\u8BCD
10
+ `}function y(e,o,r,t){const i=f(o,a.resolve(e),r),n=[t?.trim()?`## \u667A\u80FD\u4F53\u63D0\u793A\u8BCD
19
11
 
20
- ${o.trim()}`:"",r?`## \u5916\u90E8\u6D88\u606F\u901A\u9053\u8BF4\u660E
12
+ ${t.trim()}`:"",i?`## \u5916\u90E8\u6D88\u606F\u901A\u9053\u8BF4\u660E
21
13
 
22
- ${r}`:""].filter(Boolean);return n.length?`# \u795E\u5FF5\u8FD0\u884C\u6307\u4EE4\uFF08\u7CFB\u7EDF\u6307\u4EE4\uFF0C\u975E\u7528\u6237\u8F93\u5165\uFF0C\u8BF7\u9075\u5FAA\u540E\u518D\u56DE\u5E94\u4E0B\u65B9\u7528\u6237\u6D88\u606F\uFF09
14
+ ${i}`:""].filter(Boolean);return n.length?`# \u795E\u5FF5\u8FD0\u884C\u6307\u4EE4\uFF08\u7CFB\u7EDF\u6307\u4EE4\uFF0C\u975E\u7528\u6237\u8F93\u5165\uFF0C\u8BF7\u9075\u5FAA\u540E\u518D\u56DE\u5E94\u4E0B\u65B9\u7528\u6237\u6D88\u606F\uFF09
23
15
 
24
16
  ${n.join(`
25
17
 
@@ -27,4 +19,4 @@ ${n.join(`
27
19
 
28
20
  ---
29
21
 
30
- `:""}function y(t,e,i,o){const r=u("sha256").update(`${s.resolve(t)}:${i??""}:${JSON.stringify(e??null)}:${o??""}`).digest("hex").slice(0,16),n=f("runtime","agent-instructions",`${r}.md`),c=p(t,e,i,o);a.mkdirSync(s.dirname(n),{recursive:!0});try{if(a.readFileSync(n,"utf8")===c)return n}catch{}return a.writeFileSync(n,c),n}export{h as PLATFORM_OUTPUT_INSTRUCTIONS,g as buildInlineChannelPreamble,p as buildPlatformInstructions,y as ensurePlatformInstructionsFile};
22
+ `:""}function k(e,o,r,t){const i=c("sha256").update(`${a.resolve(e)}:${r??""}:${JSON.stringify(o??null)}:${t??""}`).digest("hex").slice(0,16),n=u("runtime","agent-instructions",`${i}.md`),l=m(e,o,r,t);s.mkdirSync(a.dirname(n),{recursive:!0});try{if(s.readFileSync(n,"utf8")===l)return n}catch{}return s.writeFileSync(n,l),n}export{h as PLATFORM_OUTPUT_INSTRUCTIONS,y as buildInlineChannelPreamble,m as buildPlatformInstructions,k as ensurePlatformInstructionsFile};
@@ -1,3 +1,3 @@
1
- import{spawnSync as w}from"node:child_process";import{createInterface as k}from"node:readline";import{randomUUID as I}from"node:crypto";import S from"node:path";import{AgentAdapter as x,registerAgent as _}from"./adapter.js";import{resolveBuiltinCommand as E,spawnAgentCommand as B}from"./command-spec.js";import{buildAgentProcessEnv as P}from"../agent-env.js";import{buildPlatformInstructions as T,ensurePlatformInstructionsFile as W}from"./platform-instructions.js";import{ensureWorkBuddyRoomPluginBundle as C}from"../integrations/workbuddy-plugin-bundle.js";import{roomMcpHostToolName as A}from"../integrations/room-plugin-shared.js";import{resolveWindowsSystemRoot as R}from"../windows-shell.js";const D=new Set(["minimal","low","medium","high","xhigh","max"]);function O(s){const t=s?.trim();return t&&t!=="auto"?t:void 0}function q(s){const t=s?.trim();if(t){if(D.has(t))return t;throw new Error(`Unsupported WorkBuddy reasoning effort "${t}". Supported values: minimal, low, medium, high, xhigh, max.`)}}function $(s,t,e){if(!s)return[];if(t==="win32"){if(!e)throw new Error("WorkBuddy system prompt file is required on Windows.");return["--system-prompt-file",e]}return["--append-system-prompt",s]}function F(s){const t=s.split(/\n\n(?=<[^>\n]+>\n)/);return(t[t.length-1]??s).replace(/^\[群消息\][ \t]+<[^>\n]+>\n/,"").replace(/^\[群消息\]\n?/,"").replace(/^<[^>\n]+>\n/,"").trim()}function f(s,t=process.platform,e=N){t==="win32"&&s.pid&&e(s.pid)||s.kill("SIGTERM")}function N(s){const t=S.win32.join(R(),"System32","taskkill.exe");return w(t,["/pid",String(s),"/T","/F"],{stdio:"ignore",windowsHide:!0,timeout:5e3}).status===0}class z extends x{type="workbuddy";process=null;agentSessionId=null;workDir=null;seq=0;runId="";terminalState="open";hasEmittedText=!1;runPhase=null;externalChannel=null;shennianSessionId=null;extraEnv={};configure(t){this.shennianSessionId=t.sessionId??null,this.externalChannel=t.externalChannel??null,this.extraEnv=t.env??{}}async start(t,e,n){this.workDir=e,this.seq=0,n&&(this.agentSessionId=n)}async send(t,e,n,o,a,r){await this.killProcess(),this.runId=I(),this.resetRunState();const u=r?.source==="room_activation",i=["-p",u?F(t):t,"--output-format","stream-json","--verbose","--permission-mode",u?"dontAsk":"auto","--setting-sources","user,project,local"],h=O(e);h&&i.push("--model",h);const m=C(),l=A("workbuddy");u?i.push("--allowedTools",l,"--tools",`NoDefer(${l})`,"--mcp-config",m.mcpFile,"--strict-mcp-config","--disallowedTools","mcp__shennian_room__shennian_agent","--max-turns","2"):i.push("--allowedTools",l,"--tools",`*,NoDefer(${l})`),i.push("--plugin-dir",m.pluginRoot);const p=this.shennianSessionId?.startsWith("room-managed-")&&!this.agentSessionId&&!u?null:T(this.workDir??process.cwd(),this.externalChannel,this.shennianSessionId??void 0,a);if(p){const y=process.platform==="win32"?W(this.workDir??process.cwd(),this.externalChannel,this.shennianSessionId??void 0,a):void 0;i.push(...$(p,process.platform,y))}const c=q(n);c&&i.push("--effort",c),this.agentSessionId&&i.push("--resume",this.agentSessionId),this.spawnAndParse(i)}async resume(t){await this.killProcess(),this.agentSessionId=t,this.resetRunState()}async stop(){await this.killProcess()}async getStatus(){return{active:this.process!=null&&this.terminalState==="open",runId:this.runId||null,runPhase:this.runPhase,canStop:this.process!=null&&this.terminalState==="open"}}spawnAndParse(t){const e=E("workbuddy");if(!e){this.emit("error",new Error("WorkBuddy was not found. Install WorkBuddy Desktop or the CodeBuddy CLI, then retry."));return}const n=B(e,t,{cwd:this.workDir??void 0,stdio:["ignore","pipe","pipe"],env:P(this.extraEnv)});this.process=n,k({input:n.stdout}).on("line",r=>{if(r.trim())try{this.handleStreamEvent(JSON.parse(r))}catch{}});let a="";n.stderr?.on("data",r=>{a=`${a}${r.toString()}`.slice(-8e3)}),n.on("close",r=>{this.process===n&&(this.process=null,this.runPhase=null,this.handleProcessClose(r,a))}),n.on("error",r=>{if(this.process!==n)return;this.process=null,this.runPhase=null;const u=r.code==="ENOENT";this.emitErrorIfOpen({state:"error",message:u?"WorkBuddy was not found. Install WorkBuddy Desktop or the CodeBuddy CLI, then retry.":d(r.message)})})}handleStreamEvent(t){if(t.type==="system"&&t.subtype==="init"&&t.session_id){this.agentSessionId=t.session_id,this.runPhase="thinking",this.emitEvent({state:"start",agentSessionId:t.session_id});return}if(t.type==="control_request"&&t.request?.subtype==="can_use_tool"){this.runPhase="waiting_approval",this.emitEvent({state:"approval-pending",name:t.request.tool_name,args:t.request.input,approval:{title:`WorkBuddy \u8BF7\u6C42\u4F7F\u7528 ${t.request.tool_name||"\u5DE5\u5177"}`,source:"workbuddy",actionHint:"\u8BF7\u5728 WorkBuddy \u6216\u795E\u5FF5\u4E2D\u786E\u8BA4\u540E\u7EE7\u7EED\u3002"}});return}if(t.type==="assistant"){const n=t.message?.content;if(n?.length)for(const o of n)this.handleContentBlock(o);else t.text&&this.emitText(t.text,!!t.thinking);return}if(t.type!=="result")return;if(t.subtype==="tool_result"){this.runPhase="tool_running",this.emitEvent({state:"tool-result",name:t.name,result:g(t.content)});return}if(t.subtype==="error"||t.error){this.emitErrorIfOpen({state:"error",message:d(t.error||t.result||"WorkBuddy failed.")});return}!this.hasEmittedText&&t.result&&this.emitText(t.result,!1),t.session_id&&(this.agentSessionId=t.session_id);const e=t.usage??t.message?.usage;this.emitFinalIfOpen({state:"final",agentSessionId:this.agentSessionId??void 0,usage:e?{inputTokens:e.input_tokens??0,outputTokens:e.output_tokens??0}:void 0})}handleContentBlock(t){t.type==="text"&&t.text?this.emitText(t.text,!1):t.type==="thinking"&&t.thinking?this.emitText(t.thinking,!0):t.type==="tool_use"?(this.runPhase="tool_running",this.emitEvent({state:"tool-call",name:t.name,args:t.input})):t.type==="tool_result"&&this.emitEvent({state:"tool-result",name:t.name,result:g(t.content)})}emitText(t,e){this.runPhase=e?"thinking":"streaming_text";const n=!e&&this.hasEmittedText?`
1
+ import{spawnSync as g}from"node:child_process";import{createInterface as y}from"node:readline";import{randomUUID as w}from"node:crypto";import k from"node:path";import{AgentAdapter as I,registerAgent as S}from"./adapter.js";import{resolveBuiltinCommand as x,spawnAgentCommand as E}from"./command-spec.js";import{buildAgentProcessEnv as _}from"../agent-env.js";import{buildPlatformInstructions as B,ensurePlatformInstructionsFile as P}from"./platform-instructions.js";import{resolveWindowsSystemRoot as T}from"../windows-shell.js";const W=new Set(["minimal","low","medium","high","xhigh","max"]);function C(s){const t=s?.trim();return t&&t!=="auto"?t:void 0}function A(s){const t=s?.trim();if(t){if(W.has(t))return t;throw new Error(`Unsupported WorkBuddy reasoning effort "${t}". Supported values: minimal, low, medium, high, xhigh, max.`)}}function O(s,t,e){if(!s)return[];if(t==="win32"){if(!e)throw new Error("WorkBuddy system prompt file is required on Windows.");return["--system-prompt-file",e]}return["--append-system-prompt",s]}function q(s){const t=s.split(/\n\n(?=<[^>\n]+>\n)/);return(t[t.length-1]??s).replace(/^\[群消息\][ \t]+<[^>\n]+>\n/,"").replace(/^\[群消息\]\n?/,"").replace(/^<[^>\n]+>\n/,"").trim()}function p(s,t=process.platform,e=R){t==="win32"&&s.pid&&e(s.pid)||s.kill("SIGTERM")}function R(s){const t=k.win32.join(T(),"System32","taskkill.exe");return g(t,["/pid",String(s),"/T","/F"],{stdio:"ignore",windowsHide:!0,timeout:5e3}).status===0}class D extends I{type="workbuddy";process=null;agentSessionId=null;workDir=null;seq=0;runId="";terminalState="open";hasEmittedText=!1;runPhase=null;externalChannel=null;shennianSessionId=null;extraEnv={};configure(t){this.shennianSessionId=t.sessionId??null,this.externalChannel=t.externalChannel??null,this.extraEnv=t.env??{}}async start(t,e,n){this.workDir=e,this.seq=0,n&&(this.agentSessionId=n)}async send(t,e,n,o,a,r){await this.killProcess(),this.runId=w(),this.resetRunState();const u=r?.source==="room_activation",i=["-p",u?q(t):t,"--output-format","stream-json","--verbose","--permission-mode","bypassPermissions","--setting-sources","user,project,local"],d=C(e);d&&i.push("--model",d),i.push("--tools","default"),u&&i.push("--max-turns","8");const h=this.shennianSessionId?.startsWith("room-managed-")&&!this.agentSessionId&&!u?null:B(this.workDir??process.cwd(),this.externalChannel,this.shennianSessionId??void 0,a);if(h){const c=process.platform==="win32"?P(this.workDir??process.cwd(),this.externalChannel,this.shennianSessionId??void 0,a):void 0;i.push(...O(h,process.platform,c))}const m=A(n);m&&i.push("--effort",m),this.agentSessionId&&i.push("--resume",this.agentSessionId),this.spawnAndParse(i)}async resume(t){await this.killProcess(),this.agentSessionId=t,this.resetRunState()}async stop(){await this.killProcess()}async getStatus(){return{active:this.process!=null&&this.terminalState==="open",runId:this.runId||null,runPhase:this.runPhase,canStop:this.process!=null&&this.terminalState==="open"}}spawnAndParse(t){const e=x("workbuddy");if(!e){this.emit("error",new Error("WorkBuddy was not found. Install WorkBuddy Desktop or the CodeBuddy CLI, then retry."));return}const n=E(e,t,{cwd:this.workDir??void 0,stdio:["ignore","pipe","pipe"],env:_(this.extraEnv)});this.process=n,y({input:n.stdout}).on("line",r=>{if(r.trim())try{this.handleStreamEvent(JSON.parse(r))}catch{}});let a="";n.stderr?.on("data",r=>{a=`${a}${r.toString()}`.slice(-8e3)}),n.on("close",r=>{this.process===n&&(this.process=null,this.runPhase=null,this.handleProcessClose(r,a))}),n.on("error",r=>{if(this.process!==n)return;this.process=null,this.runPhase=null;const u=r.code==="ENOENT";this.emitErrorIfOpen({state:"error",message:u?"WorkBuddy was not found. Install WorkBuddy Desktop or the CodeBuddy CLI, then retry.":l(r.message)})})}handleStreamEvent(t){if(t.type==="system"&&t.subtype==="init"&&t.session_id){this.agentSessionId=t.session_id,this.runPhase="thinking",this.emitEvent({state:"start",agentSessionId:t.session_id});return}if(t.type==="control_request"&&t.request?.subtype==="can_use_tool"){this.runPhase="waiting_approval",this.emitEvent({state:"approval-pending",name:t.request.tool_name,args:t.request.input,approval:{title:`WorkBuddy \u8BF7\u6C42\u4F7F\u7528 ${t.request.tool_name||"\u5DE5\u5177"}`,source:"workbuddy",actionHint:"\u8BF7\u5728 WorkBuddy \u6216\u795E\u5FF5\u4E2D\u786E\u8BA4\u540E\u7EE7\u7EED\u3002"}});return}if(t.type==="assistant"){const n=t.message?.content;if(n?.length)for(const o of n)this.handleContentBlock(o);else t.text&&this.emitText(t.text,!!t.thinking);return}if(t.type!=="result")return;if(t.subtype==="tool_result"){this.runPhase="tool_running",this.emitEvent({state:"tool-result",name:t.name,result:f(t.content)});return}if(t.subtype==="error"||t.error){this.emitErrorIfOpen({state:"error",message:l(t.error||t.result||"WorkBuddy failed.")});return}!this.hasEmittedText&&t.result&&this.emitText(t.result,!1),t.session_id&&(this.agentSessionId=t.session_id);const e=t.usage??t.message?.usage;this.emitFinalIfOpen({state:"final",agentSessionId:this.agentSessionId??void 0,usage:e?{inputTokens:e.input_tokens??0,outputTokens:e.output_tokens??0}:void 0})}handleContentBlock(t){t.type==="text"&&t.text?this.emitText(t.text,!1):t.type==="thinking"&&t.thinking?this.emitText(t.thinking,!0):t.type==="tool_use"?(this.runPhase="tool_running",this.emitEvent({state:"tool-call",name:t.name,args:t.input})):t.type==="tool_result"&&this.emitEvent({state:"tool-result",name:t.name,result:f(t.content)})}emitText(t,e){this.runPhase=e?"thinking":"streaming_text";const n=!e&&this.hasEmittedText?`
2
2
 
3
- `:"";this.emitEvent({state:"delta",text:n+t,thinking:e||void 0}),e||(this.hasEmittedText=!0)}handleProcessClose(t,e){if(t!==0&&t!==null){this.emitErrorIfOpen({state:"error",message:d(e)||`WorkBuddy exited with code ${t}.`});return}this.emitFinalIfOpen({state:"final",agentSessionId:this.agentSessionId??void 0})}emitFinalIfOpen(t){this.terminalState==="open"&&(this.terminalState="final",this.runPhase=null,this.emitEvent(t))}emitErrorIfOpen(t){this.terminalState==="open"&&(this.terminalState="error",this.runPhase=null,this.emitEvent(t))}emitEvent(t){this.emit("agentEvent",{...t,runId:this.runId,seq:this.seq++})}resetRunState(){this.seq=0,this.terminalState="open",this.hasEmittedText=!1,this.runPhase=null}async killProcess(){const t=this.process;t&&(this.process=null,this.runPhase=null,f(t),await new Promise(e=>{let n=!1;const o=()=>{n||(n=!0,e())};t.once("close",o),setTimeout(()=>{f(t),o()},3e3).unref?.()}))}}function g(s){if(typeof s=="string")return s;try{return JSON.stringify(s)}catch{return"[unserializable WorkBuddy tool result]"}}function d(s){return s.replace(/(Authorization\s*:\s*)Bearer\s+[A-Za-z0-9._~+/-]+/gi,"$1Bearer [redacted]").replace(/(api[-_ ]?key|access[-_ ]?token|refresh[-_ ]?token|connector[-_ ]?token)(\s*[:=]\s*)[^\s,;]+/gi,"$1$2[redacted]").trim().slice(0,2e3)}_("workbuddy",()=>new z);export{z as WorkBuddyAdapter,O as normalizeWorkBuddyModelId,q as normalizeWorkBuddyReasoningEffort,d as sanitizeWorkBuddyError,f as terminateWorkBuddyProcess,F as workBuddyRoomActivationText,$ as workBuddySystemPromptArgs};
3
+ `:"";this.emitEvent({state:"delta",text:n+t,thinking:e||void 0}),e||(this.hasEmittedText=!0)}handleProcessClose(t,e){if(t!==0&&t!==null){this.emitErrorIfOpen({state:"error",message:l(e)||`WorkBuddy exited with code ${t}.`});return}this.emitFinalIfOpen({state:"final",agentSessionId:this.agentSessionId??void 0})}emitFinalIfOpen(t){this.terminalState==="open"&&(this.terminalState="final",this.runPhase=null,this.emitEvent(t))}emitErrorIfOpen(t){this.terminalState==="open"&&(this.terminalState="error",this.runPhase=null,this.emitEvent(t))}emitEvent(t){this.emit("agentEvent",{...t,runId:this.runId,seq:this.seq++})}resetRunState(){this.seq=0,this.terminalState="open",this.hasEmittedText=!1,this.runPhase=null}async killProcess(){const t=this.process;t&&(this.process=null,this.runPhase=null,p(t),await new Promise(e=>{let n=!1;const o=()=>{n||(n=!0,e())};t.once("close",o),setTimeout(()=>{p(t),o()},3e3).unref?.()}))}}function f(s){if(typeof s=="string")return s;try{return JSON.stringify(s)}catch{return"[unserializable WorkBuddy tool result]"}}function l(s){return s.replace(/(Authorization\s*:\s*)Bearer\s+[A-Za-z0-9._~+/-]+/gi,"$1Bearer [redacted]").replace(/(api[-_ ]?key|access[-_ ]?token|refresh[-_ ]?token|connector[-_ ]?token)(\s*[:=]\s*)[^\s,;]+/gi,"$1$2[redacted]").trim().slice(0,2e3)}S("workbuddy",()=>new D);export{D as WorkBuddyAdapter,C as normalizeWorkBuddyModelId,A as normalizeWorkBuddyReasoningEffort,l as sanitizeWorkBuddyError,p as terminateWorkBuddyProcess,q as workBuddyRoomActivationText,O as workBuddySystemPromptArgs};
@@ -1,2 +1,7 @@
1
1
  import type { Command } from 'commander';
2
- export declare function registerAgentCommand(program: Command): void;
2
+ type FetchLike = typeof fetch;
3
+ type AgentCommandOptions = {
4
+ fetchImpl?: FetchLike;
5
+ };
6
+ export declare function registerAgentCommand(program: Command, options?: AgentCommandOptions): void;
7
+ export {};