shennian 0.5.0 → 0.5.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.
Files changed (342) hide show
  1. package/README.md +2 -2
  2. package/dist/publish-build-manifest.json +165 -125
  3. package/dist/src/agents/acp/adapter.js +2 -2
  4. package/dist/src/agents/acp/capability-cache.js +2 -2
  5. package/dist/src/agents/acp/catalog.js +2 -2
  6. package/dist/src/agents/acp/manifests.js +2 -2
  7. package/dist/src/agents/claude.js +8 -6
  8. package/dist/src/agents/codex.js +2 -2
  9. package/dist/src/agents/command-spec.js +4 -4
  10. package/dist/src/agents/cursor.js +1 -1
  11. package/dist/src/agents/custom-recovery-conformance.js +2 -2
  12. package/dist/src/agents/gemini.js +1 -1
  13. package/dist/src/agents/model-registry/discovery.js +3 -3
  14. package/dist/src/agents/model-registry/service.js +1 -1
  15. package/dist/src/agents/model-registry.js +1 -1
  16. package/dist/src/agents/openclaw.js +2 -2
  17. package/dist/src/agents/opencode.js +1 -1
  18. package/dist/src/agents/pi-coding-agent.js +3 -4
  19. package/dist/src/agents/pi-session-ownership.js +2 -2
  20. package/dist/src/agents/spawn-errors.js +1 -0
  21. package/dist/src/agents/windows-agent-paths.js +1 -0
  22. package/dist/src/commands/agent-readiness.js +2 -2
  23. package/dist/src/commands/daemon-service-spec.js +1 -1
  24. package/dist/src/commands/daemon.js +6 -6
  25. package/dist/src/commands/queue.js +1 -0
  26. package/dist/src/commands/room.js +3 -3
  27. package/dist/src/config/index.js +2 -2
  28. package/dist/src/fs/atomic-rename.js +1 -0
  29. package/dist/src/index.js +3 -3
  30. package/dist/src/native-fusion/claude-entry-parser.js +7 -0
  31. package/dist/src/native-fusion/local-repository.js +2 -2
  32. package/dist/src/native-fusion/native-source-deletions.js +2 -2
  33. package/dist/src/native-fusion/parsers.js +1 -3
  34. package/dist/src/native-fusion/state.js +2 -2
  35. package/dist/src/personal-sync/epoch.js +2 -2
  36. package/dist/src/personal-sync/identity.js +2 -2
  37. package/dist/src/relay/client.js +1 -1
  38. package/dist/src/room/activation-service.js +6 -6
  39. package/dist/src/room/attachment-cache.js +2 -2
  40. package/dist/src/room/host-session-observations.js +2 -2
  41. package/dist/src/room/managed-context.js +1 -1
  42. package/dist/src/room/managed-room-ipc.js +2 -2
  43. package/dist/src/room/mirror-sync-service.js +1 -1
  44. package/dist/src/room/public-attachment-cache.js +2 -2
  45. package/dist/src/room/room-error-guidance.js +1 -0
  46. package/dist/src/room/session-registry.js +2 -2
  47. package/dist/src/security/managed-agent-policy.js +1 -1
  48. package/dist/src/security/managed-agent-runtime.js +1 -1
  49. package/dist/src/session/attachment-transfer-store.js +2 -2
  50. package/dist/src/session/canonical-store.js +5 -5
  51. package/dist/src/session/deletion-sync-state.js +2 -2
  52. package/dist/src/session/handlers/agent-workspace-validation.js +1 -1
  53. package/dist/src/session/handlers/chat-adapter-config.js +1 -1
  54. package/dist/src/session/handlers/chat-events.js +2 -2
  55. package/dist/src/session/handlers/chat-recovery.js +1 -1
  56. package/dist/src/session/handlers/chat.js +1 -1
  57. package/dist/src/session/manager.js +1 -1
  58. package/dist/src/session/native-cleanup-outbox.js +2 -2
  59. package/dist/src/session/queue-diagnostics.js +1 -0
  60. package/dist/src/session/queue-dispatch-failure.js +1 -0
  61. package/dist/src/session/queue-helpers.js +5 -5
  62. package/dist/src/session/queue-retry.js +1 -1
  63. package/dist/src/session/queue-storage.js +2 -2
  64. package/dist/src/session/queue.js +1 -1
  65. package/dist/src/session/room-reply-notice.js +1 -0
  66. package/dist/src/session/run-recovery/journal.js +2 -2
  67. package/dist/src/session/run-stall.js +1 -0
  68. package/dist/src/session/store.js +2 -2
  69. package/dist/src/session/tool-detail-store.js +2 -2
  70. package/node_modules/@shennian/wire/dist/agent-capabilities.js +1 -1
  71. package/node_modules/@shennian/wire/dist/agent-workspace.js +1 -144
  72. package/node_modules/@shennian/wire/dist/envelope.js +1 -1
  73. package/node_modules/@shennian/wire/dist/events.js +1 -1
  74. package/node_modules/@shennian/wire/dist/external-message-format.js +3 -70
  75. package/node_modules/@shennian/wire/dist/frames.js +1 -1
  76. package/node_modules/@shennian/wire/dist/fs.js +2 -7
  77. package/node_modules/@shennian/wire/dist/index.js +1 -21
  78. package/node_modules/@shennian/wire/dist/machine.js +1 -1
  79. package/node_modules/@shennian/wire/dist/message-payload.js +8 -307
  80. package/node_modules/@shennian/wire/dist/methods.js +1 -3
  81. package/node_modules/@shennian/wire/dist/native-session.js +1 -1
  82. package/node_modules/@shennian/wire/dist/project-fs.js +1 -462
  83. package/node_modules/@shennian/wire/dist/project-path.js +1 -25
  84. package/node_modules/@shennian/wire/dist/project.js +1 -3
  85. package/node_modules/@shennian/wire/dist/relay-connectivity.js +1 -29
  86. package/node_modules/@shennian/wire/dist/room.js +1 -20
  87. package/node_modules/@shennian/wire/dist/schedule.js +1 -1
  88. package/node_modules/@shennian/wire/dist/session-sync.js +1 -123
  89. package/node_modules/@shennian/wire/dist/session.js +1 -60
  90. package/node_modules/@shennian/wire/dist/tool-detail.js +1 -9
  91. package/node_modules/@shennian/wire/dist/voice-chief.js +1 -3
  92. package/package.json +3 -8
  93. package/dist/bin/shennian.d.ts +0 -2
  94. package/dist/src/agent-env.d.ts +0 -44
  95. package/dist/src/agents/acp/adapter.d.ts +0 -82
  96. package/dist/src/agents/acp/auth-state.d.ts +0 -3
  97. package/dist/src/agents/acp/auth.d.ts +0 -7
  98. package/dist/src/agents/acp/capability-cache.d.ts +0 -14
  99. package/dist/src/agents/acp/catalog.d.ts +0 -11
  100. package/dist/src/agents/acp/client-services.d.ts +0 -37
  101. package/dist/src/agents/acp/discovery.d.ts +0 -10
  102. package/dist/src/agents/acp/events.d.ts +0 -4
  103. package/dist/src/agents/acp/manifests.d.ts +0 -63
  104. package/dist/src/agents/acp/metrics.d.ts +0 -24
  105. package/dist/src/agents/acp/package-commands.d.ts +0 -4
  106. package/dist/src/agents/acp/process-client.d.ts +0 -41
  107. package/dist/src/agents/acp/process-tree.d.ts +0 -2
  108. package/dist/src/agents/acp/types.d.ts +0 -31
  109. package/dist/src/agents/acp/watcher.d.ts +0 -22
  110. package/dist/src/agents/adapter.d.ts +0 -180
  111. package/dist/src/agents/auth-status.d.ts +0 -4
  112. package/dist/src/agents/claude-managed-permissions.d.ts +0 -33
  113. package/dist/src/agents/claude.d.ts +0 -69
  114. package/dist/src/agents/codex-managed-permissions.d.ts +0 -32
  115. package/dist/src/agents/codex-managed-room-tools.d.ts +0 -41
  116. package/dist/src/agents/codex-protocol.d.ts +0 -103
  117. package/dist/src/agents/codex-runtime.d.ts +0 -91
  118. package/dist/src/agents/codex-utils.d.ts +0 -29
  119. package/dist/src/agents/codex.d.ts +0 -59
  120. package/dist/src/agents/command-spec.d.ts +0 -55
  121. package/dist/src/agents/config-status.d.ts +0 -18
  122. package/dist/src/agents/cursor-managed-permissions.d.ts +0 -28
  123. package/dist/src/agents/cursor.d.ts +0 -44
  124. package/dist/src/agents/custom-managed-runtime.d.ts +0 -37
  125. package/dist/src/agents/custom-recovery-conformance.d.ts +0 -2
  126. package/dist/src/agents/custom.d.ts +0 -62
  127. package/dist/src/agents/detect.d.ts +0 -23
  128. package/dist/src/agents/event-terminal-gate.d.ts +0 -16
  129. package/dist/src/agents/external-channel-instructions.d.ts +0 -4
  130. package/dist/src/agents/gemini.d.ts +0 -32
  131. package/dist/src/agents/manager.d.ts +0 -57
  132. package/dist/src/agents/model-registry/cache.d.ts +0 -4
  133. package/dist/src/agents/model-registry/discovery.d.ts +0 -4
  134. package/dist/src/agents/model-registry/opencode-api.d.ts +0 -2
  135. package/dist/src/agents/model-registry/parsers.d.ts +0 -20
  136. package/dist/src/agents/model-registry/runner.d.ts +0 -6
  137. package/dist/src/agents/model-registry/service.d.ts +0 -10
  138. package/dist/src/agents/model-registry/types.d.ts +0 -39
  139. package/dist/src/agents/model-registry.d.ts +0 -17
  140. package/dist/src/agents/native-capabilities.d.ts +0 -10
  141. package/dist/src/agents/openclaw.d.ts +0 -29
  142. package/dist/src/agents/opencode-managed-permissions.d.ts +0 -25
  143. package/dist/src/agents/opencode.d.ts +0 -46
  144. package/dist/src/agents/pi-coding-agent-managed-permissions.d.ts +0 -7
  145. package/dist/src/agents/pi-coding-agent.d.ts +0 -63
  146. package/dist/src/agents/pi-managed-extension.d.ts +0 -12
  147. package/dist/src/agents/pi-managed-model-broker.d.ts +0 -27
  148. package/dist/src/agents/pi-managed-model-broker.js +0 -1
  149. package/dist/src/agents/pi-rpc-client.d.ts +0 -31
  150. package/dist/src/agents/pi-session-ownership.d.ts +0 -2
  151. package/dist/src/agents/platform-instructions.d.ts +0 -5
  152. package/dist/src/agents/runtime-compatibility.d.ts +0 -11
  153. package/dist/src/agents/workbuddy-managed-permissions.d.ts +0 -37
  154. package/dist/src/agents/workbuddy.d.ts +0 -63
  155. package/dist/src/commands/agent-readiness.d.ts +0 -17
  156. package/dist/src/commands/agent.d.ts +0 -2
  157. package/dist/src/commands/daemon-instance-lock.d.ts +0 -21
  158. package/dist/src/commands/daemon-process.d.ts +0 -6
  159. package/dist/src/commands/daemon-service-spec.d.ts +0 -26
  160. package/dist/src/commands/daemon-start-wait.d.ts +0 -9
  161. package/dist/src/commands/daemon-state.d.ts +0 -57
  162. package/dist/src/commands/daemon-windows.d.ts +0 -33
  163. package/dist/src/commands/daemon.d.ts +0 -67
  164. package/dist/src/commands/integration.d.ts +0 -3
  165. package/dist/src/commands/logout.d.ts +0 -3
  166. package/dist/src/commands/manager.d.ts +0 -2
  167. package/dist/src/commands/pair-authorization.d.ts +0 -3
  168. package/dist/src/commands/pair-browser.d.ts +0 -44
  169. package/dist/src/commands/pair-qr.d.ts +0 -4
  170. package/dist/src/commands/pair.d.ts +0 -19
  171. package/dist/src/commands/room.d.ts +0 -16
  172. package/dist/src/commands/runtime.d.ts +0 -2
  173. package/dist/src/commands/schedule.d.ts +0 -2
  174. package/dist/src/commands/tools.d.ts +0 -2
  175. package/dist/src/commands/upgrade.d.ts +0 -31
  176. package/dist/src/commands/worker.d.ts +0 -11
  177. package/dist/src/config/index.d.ts +0 -58
  178. package/dist/src/daemon-ipc/agent-readiness.d.ts +0 -15
  179. package/dist/src/daemon-ipc/client.d.ts +0 -8
  180. package/dist/src/daemon-ipc/control.d.ts +0 -16
  181. package/dist/src/daemon-ipc/json.d.ts +0 -3
  182. package/dist/src/daemon-ipc/paths.d.ts +0 -15
  183. package/dist/src/daemon-ipc/protocol.d.ts +0 -31
  184. package/dist/src/daemon-ipc/secret.d.ts +0 -3
  185. package/dist/src/daemon-ipc/server.d.ts +0 -20
  186. package/dist/src/daemon-log.d.ts +0 -9
  187. package/dist/src/env-path.d.ts +0 -15
  188. package/dist/src/fs/boundary.d.ts +0 -23
  189. package/dist/src/fs/handler.d.ts +0 -26
  190. package/dist/src/fs/security.d.ts +0 -2
  191. package/dist/src/fs/text-decoder.d.ts +0 -10
  192. package/dist/src/index.d.ts +0 -1
  193. package/dist/src/log-redaction.d.ts +0 -4
  194. package/dist/src/log-reporter.d.ts +0 -41
  195. package/dist/src/manager/prompt.d.ts +0 -2
  196. package/dist/src/manager/registry.d.ts +0 -184
  197. package/dist/src/manager/retired-external-channel-compat.d.ts +0 -78
  198. package/dist/src/manager/runtime.d.ts +0 -90
  199. package/dist/src/manager/worker-ipc.d.ts +0 -28
  200. package/dist/src/manager/worker-markdown.d.ts +0 -10
  201. package/dist/src/native-fusion/codex-files.d.ts +0 -10
  202. package/dist/src/native-fusion/codex-message-parser.d.ts +0 -9
  203. package/dist/src/native-fusion/codex-parser.d.ts +0 -8
  204. package/dist/src/native-fusion/codex-user-input.d.ts +0 -11
  205. package/dist/src/native-fusion/config.d.ts +0 -1
  206. package/dist/src/native-fusion/file-identity.d.ts +0 -9
  207. package/dist/src/native-fusion/file-watcher.d.ts +0 -26
  208. package/dist/src/native-fusion/local-repository.d.ts +0 -90
  209. package/dist/src/native-fusion/native-source-deletions.d.ts +0 -47
  210. package/dist/src/native-fusion/opencode-parser.d.ts +0 -29
  211. package/dist/src/native-fusion/parser-common.d.ts +0 -35
  212. package/dist/src/native-fusion/parsers.d.ts +0 -13
  213. package/dist/src/native-fusion/service.d.ts +0 -64
  214. package/dist/src/native-fusion/session-header.d.ts +0 -13
  215. package/dist/src/native-fusion/session-native-sources.d.ts +0 -24
  216. package/dist/src/native-fusion/source-visibility-audit.d.ts +0 -16
  217. package/dist/src/native-fusion/source-visibility.d.ts +0 -25
  218. package/dist/src/native-fusion/state.d.ts +0 -4
  219. package/dist/src/native-fusion/types.d.ts +0 -82
  220. package/dist/src/personal-sync/epoch.d.ts +0 -17
  221. package/dist/src/personal-sync/identity.d.ts +0 -1
  222. package/dist/src/personal-sync/machine-authority.d.ts +0 -12
  223. package/dist/src/personal-sync/metrics.d.ts +0 -25
  224. package/dist/src/personal-sync/paths.d.ts +0 -5
  225. package/dist/src/region.d.ts +0 -15
  226. package/dist/src/relay/client.d.ts +0 -81
  227. package/dist/src/room/activation-audit.d.ts +0 -15
  228. package/dist/src/room/activation-policy.d.ts +0 -8
  229. package/dist/src/room/activation-service.d.ts +0 -77
  230. package/dist/src/room/attachment-cache.d.ts +0 -44
  231. package/dist/src/room/attachment-upload.d.ts +0 -20
  232. package/dist/src/room/device-authorization-client.d.ts +0 -91
  233. package/dist/src/room/host-session-observations.d.ts +0 -54
  234. package/dist/src/room/invite-bootstrap.d.ts +0 -49
  235. package/dist/src/room/invite-qr.d.ts +0 -6
  236. package/dist/src/room/live-delivery.d.ts +0 -5
  237. package/dist/src/room/managed-context.d.ts +0 -49
  238. package/dist/src/room/managed-prompt-composer.d.ts +0 -47
  239. package/dist/src/room/managed-room-binding.d.ts +0 -69
  240. package/dist/src/room/managed-room-ipc.d.ts +0 -65
  241. package/dist/src/room/mirror-sync-service.d.ts +0 -49
  242. package/dist/src/room/public-attachment-cache.d.ts +0 -34
  243. package/dist/src/room/public-room-client.d.ts +0 -37
  244. package/dist/src/room/registration-authority.d.ts +0 -4
  245. package/dist/src/room/room-action-client-types.d.ts +0 -137
  246. package/dist/src/room/room-action-client.d.ts +0 -116
  247. package/dist/src/room/room-binding-client.d.ts +0 -62
  248. package/dist/src/room/session-registry.d.ts +0 -158
  249. package/dist/src/runtime-distribution.d.ts +0 -7
  250. package/dist/src/schedules/personal-context.d.ts +0 -2
  251. package/dist/src/schedules/server-client.d.ts +0 -19
  252. package/dist/src/security/managed-agent-credential-paths.d.ts +0 -6
  253. package/dist/src/security/managed-agent-executable.d.ts +0 -19
  254. package/dist/src/security/managed-agent-policy.d.ts +0 -66
  255. package/dist/src/security/managed-agent-runtime.d.ts +0 -44
  256. package/dist/src/session/archive-zip.d.ts +0 -10
  257. package/dist/src/session/attachment-reference.d.ts +0 -2
  258. package/dist/src/session/attachment-transfer-store.d.ts +0 -45
  259. package/dist/src/session/canonical-store.d.ts +0 -104
  260. package/dist/src/session/deletion-sync-state.d.ts +0 -20
  261. package/dist/src/session/deletion-sync-validation.d.ts +0 -2
  262. package/dist/src/session/deletion-synchronizer.d.ts +0 -9
  263. package/dist/src/session/handlers/agent-capabilities.d.ts +0 -3
  264. package/dist/src/session/handlers/agent-config.d.ts +0 -7
  265. package/dist/src/session/handlers/agent-control.d.ts +0 -4
  266. package/dist/src/session/handlers/agent-workspace-validation.d.ts +0 -28
  267. package/dist/src/session/handlers/agents.d.ts +0 -11
  268. package/dist/src/session/handlers/chat-adapter-config.d.ts +0 -11
  269. package/dist/src/session/handlers/chat-context.d.ts +0 -31
  270. package/dist/src/session/handlers/chat-events.d.ts +0 -5
  271. package/dist/src/session/handlers/chat-recovery.d.ts +0 -4
  272. package/dist/src/session/handlers/chat-session-lifecycle.d.ts +0 -9
  273. package/dist/src/session/handlers/chat.d.ts +0 -6
  274. package/dist/src/session/handlers/control.d.ts +0 -5
  275. package/dist/src/session/handlers/fs.d.ts +0 -14
  276. package/dist/src/session/handlers/message-status.d.ts +0 -3
  277. package/dist/src/session/handlers/pi-validation-session.d.ts +0 -7
  278. package/dist/src/session/handlers/pi-validation-session.js +0 -1
  279. package/dist/src/session/handlers/project-fs.d.ts +0 -11
  280. package/dist/src/session/handlers/remote-access.d.ts +0 -4
  281. package/dist/src/session/handlers/room-managed.d.ts +0 -6
  282. package/dist/src/session/handlers/session-refresh.d.ts +0 -3
  283. package/dist/src/session/handlers/title.d.ts +0 -3
  284. package/dist/src/session/handlers/tool-detail.d.ts +0 -3
  285. package/dist/src/session/handlers/voice-window.d.ts +0 -3
  286. package/dist/src/session/history-subscriptions.d.ts +0 -29
  287. package/dist/src/session/index-publisher.d.ts +0 -3
  288. package/dist/src/session/manager-event-authority.d.ts +0 -3
  289. package/dist/src/session/manager.d.ts +0 -95
  290. package/dist/src/session/native-cleanup-outbox.d.ts +0 -64
  291. package/dist/src/session/native-session-lifecycle.d.ts +0 -56
  292. package/dist/src/session/project-fs-store.d.ts +0 -43
  293. package/dist/src/session/projection.d.ts +0 -3
  294. package/dist/src/session/queue-control.d.ts +0 -27
  295. package/dist/src/session/queue-helpers.d.ts +0 -20
  296. package/dist/src/session/queue-message.d.ts +0 -35
  297. package/dist/src/session/queue-retry.d.ts +0 -11
  298. package/dist/src/session/queue-storage.d.ts +0 -8
  299. package/dist/src/session/queue-types.d.ts +0 -31
  300. package/dist/src/session/queue.d.ts +0 -73
  301. package/dist/src/session/queued-chat-dispatch.d.ts +0 -12
  302. package/dist/src/session/run-recovery/barrier.d.ts +0 -12
  303. package/dist/src/session/run-recovery/coordinator.d.ts +0 -32
  304. package/dist/src/session/run-recovery/journal.d.ts +0 -30
  305. package/dist/src/session/run-recovery/schema.d.ts +0 -48
  306. package/dist/src/session/store.d.ts +0 -128
  307. package/dist/src/session/tool-detail-store.d.ts +0 -17
  308. package/dist/src/session/turn-trigger.d.ts +0 -43
  309. package/dist/src/session/types.d.ts +0 -93
  310. package/dist/src/tools/markdown-to-pdf.d.ts +0 -42
  311. package/dist/src/upgrade/channel.d.ts +0 -5
  312. package/dist/src/upgrade/distribution.d.ts +0 -21
  313. package/dist/src/upgrade/engine.d.ts +0 -104
  314. package/dist/src/upgrade/scheduler.d.ts +0 -60
  315. package/dist/src/upgrade/updater-bootstrap.d.ts +0 -12
  316. package/dist/src/upgrade/updater-launcher.d.ts +0 -37
  317. package/dist/src/upgrade/updater-protocol.d.ts +0 -40
  318. package/dist/src/upgrade/updater-service-entry.d.ts +0 -7
  319. package/dist/src/upgrade/updater-worker.d.ts +0 -57
  320. package/dist/src/windows-shell.d.ts +0 -6
  321. package/node_modules/@shennian/wire/dist/agent-capabilities.d.ts +0 -16
  322. package/node_modules/@shennian/wire/dist/agent-workspace.d.ts +0 -133
  323. package/node_modules/@shennian/wire/dist/envelope.d.ts +0 -7
  324. package/node_modules/@shennian/wire/dist/events.d.ts +0 -125
  325. package/node_modules/@shennian/wire/dist/external-message-format.d.ts +0 -37
  326. package/node_modules/@shennian/wire/dist/frames.d.ts +0 -33
  327. package/node_modules/@shennian/wire/dist/fs.d.ts +0 -107
  328. package/node_modules/@shennian/wire/dist/index.d.ts +0 -21
  329. package/node_modules/@shennian/wire/dist/machine.d.ts +0 -160
  330. package/node_modules/@shennian/wire/dist/message-payload.d.ts +0 -71
  331. package/node_modules/@shennian/wire/dist/methods.d.ts +0 -5
  332. package/node_modules/@shennian/wire/dist/native-session.d.ts +0 -20
  333. package/node_modules/@shennian/wire/dist/project-fs.d.ts +0 -146
  334. package/node_modules/@shennian/wire/dist/project-path.d.ts +0 -4
  335. package/node_modules/@shennian/wire/dist/project.d.ts +0 -16
  336. package/node_modules/@shennian/wire/dist/relay-connectivity.d.ts +0 -30
  337. package/node_modules/@shennian/wire/dist/room.d.ts +0 -190
  338. package/node_modules/@shennian/wire/dist/schedule.d.ts +0 -37
  339. package/node_modules/@shennian/wire/dist/session-sync.d.ts +0 -406
  340. package/node_modules/@shennian/wire/dist/session.d.ts +0 -465
  341. package/node_modules/@shennian/wire/dist/tool-detail.d.ts +0 -38
  342. package/node_modules/@shennian/wire/dist/voice-chief.d.ts +0 -116
@@ -1,22 +0,0 @@
1
- export declare class AcpDiscoveryWatcher {
2
- private readonly refresh;
3
- private readonly options;
4
- private watcher;
5
- private debounceTimer;
6
- private intervalTimer;
7
- private catalogTimer;
8
- private running;
9
- private rerun;
10
- constructor(refresh: () => Promise<void>, options?: {
11
- directory?: string;
12
- intervalMs?: number;
13
- catalogIntervalMs?: number;
14
- debounceMs?: number;
15
- });
16
- start(): void;
17
- stop(): void;
18
- /** Public so platform watcher adapters and deterministic tests share one debounce path. */
19
- notifyManifestChanged(): void;
20
- private schedule;
21
- private trigger;
22
- }
@@ -1,180 +0,0 @@
1
- import type { AgentType, ChatAttachmentMeta, ExternalChannelSessionStatus, ModelInfo, SessionRunPhase } from '@shennian/wire';
2
- import { EventEmitter } from 'node:events';
3
- import type { ManagedRoomExecutor } from '../room/managed-room-ipc.js';
4
- import type { CompiledManagedAgentPolicy } from '../security/managed-agent-policy.js';
5
- export type AgentEvent = {
6
- state: string;
7
- runId: string;
8
- seq: number;
9
- text?: string;
10
- thinking?: boolean;
11
- runPhase?: SessionRunPhase;
12
- name?: string;
13
- toolCallId?: string;
14
- toolStatus?: 'running' | 'completed' | 'failed';
15
- args?: Record<string, unknown>;
16
- result?: string;
17
- durationMs?: number;
18
- message?: string;
19
- errorCode?: 'acp_auth_required' | 'auth_required' | 'auth_retrying';
20
- approval?: {
21
- title?: string;
22
- content?: string;
23
- source?: string;
24
- actionHint?: string;
25
- };
26
- permission?: {
27
- id: string;
28
- sessionId?: string;
29
- agentSessionId?: string;
30
- runId?: string;
31
- toolCallId: string;
32
- options: Array<{
33
- id: string;
34
- name: string;
35
- kind: 'allow_once' | 'allow_always' | 'reject_once' | 'reject_always';
36
- }>;
37
- };
38
- usage?: {
39
- inputTokens: number;
40
- outputTokens: number;
41
- };
42
- title?: string;
43
- source?: string;
44
- agentSessionId?: string;
45
- };
46
- export type AgentSendResult = {
47
- deliveryMode?: 'direct' | 'external_owner_queue';
48
- queuedSubmissionId?: string;
49
- };
50
- export type AgentSendContext = {
51
- source: 'room_activation' | 'managed_private' | 'upgrade_recovery';
52
- /** Marks internal recovery input; it must never be persisted as user-authored text. */
53
- recovery?: 'upgrade';
54
- };
55
- export type AgentActiveInput = {
56
- text: string;
57
- attachments?: ChatAttachmentMeta[];
58
- clientMessageId?: string;
59
- };
60
- export type ImportedAgentMessage = {
61
- /** Stable within repeated imports of the same provider session. */
62
- sourceId: string;
63
- role: 'user' | 'agent';
64
- payload: string;
65
- };
66
- export type AgentSessionOptions = {
67
- models: ModelInfo[];
68
- modes: Array<{
69
- id: string;
70
- name: string;
71
- description?: string;
72
- }>;
73
- };
74
- export type AgentStartOptions = {
75
- /** Test-only callers can disable provider-native history persistence. */
76
- persistNativeSession?: boolean;
77
- /** Internal ownership hint, not a guarantee about a third-party client's sidebar. */
78
- nativeSessionVisibility?: 'user' | 'internal';
79
- };
80
- export type AgentRecoveryCapabilities = {
81
- inspectTerminal: boolean;
82
- reattachRun: boolean;
83
- resumeRun: boolean;
84
- resumeSession: boolean;
85
- };
86
- export type AgentRecoveryInput = {
87
- sessionId: string;
88
- shennianRunId: string;
89
- workDir: string;
90
- agentSessionId: string | null;
91
- modelId?: string | null;
92
- reasoningEffort?: string | null;
93
- providerRunId: string | null;
94
- lastObservedEventSeq: number;
95
- continueDispatchState: 'none' | 'intent' | 'accepted';
96
- systemPrompt?: string | null;
97
- sendContext?: AgentSendContext;
98
- /** Durable provider-level de-duplication fence, invoked immediately before Continue. */
99
- beforeContinueDispatch?: () => void;
100
- };
101
- export type AgentRecoveryInspection = {
102
- state: 'terminal' | 'active' | 'interrupted' | 'unknown';
103
- providerRunId?: string | null;
104
- runPhase?: SessionRunPhase | null;
105
- };
106
- export type AgentRecoveryResult = {
107
- result: 'terminal_reconciled';
108
- } | {
109
- result: 'reattached';
110
- } | {
111
- result: 'resumed';
112
- } | {
113
- result: 'continued';
114
- } | {
115
- result: 'interrupted_by_upgrade';
116
- reason: 'resume_unsupported' | 'missing_agent_session';
117
- } | {
118
- result: 'recovery_failed';
119
- reason: 'continue_dispatch_outcome_unknown' | 'provider_session_missing' | 'provider_identity_mismatch' | 'authentication_required' | 'permission_context_unavailable' | 'provider_error';
120
- message?: string;
121
- };
122
- export interface AgentAdapterEvents {
123
- agentEvent: [event: AgentEvent];
124
- nativeSession: [provider: AgentType, agentSessionId: string];
125
- error: [error: Error];
126
- }
127
- /** Adapters emit nativeSession(provider, id) synchronously before sending a turn.
128
- * The session lifecycle listener durably registers ownership; a listener error
129
- * must abort the turn, not be swallowed as a best-effort telemetry failure. */
130
- export declare abstract class AgentAdapter extends EventEmitter<AgentAdapterEvents> {
131
- abstract readonly type: AgentType;
132
- /** Explicit fail-closed default; resumable adapters must opt in. */
133
- get recoveryCapabilities(): AgentRecoveryCapabilities;
134
- /** Explicit fail-closed capability for adding input to the current provider turn. */
135
- get supportsActiveInput(): boolean;
136
- injectActiveInput?(input: AgentActiveInput): Promise<void>;
137
- configure?(options: {
138
- sessionId?: string;
139
- externalChannel?: ExternalChannelSessionStatus | null;
140
- env?: NodeJS.ProcessEnv;
141
- managedAgentPolicy?: CompiledManagedAgentPolicy | null;
142
- managedRoomContextToken?: string | null;
143
- managedRoomExecutor?: ManagedRoomExecutor | null;
144
- }): void;
145
- getStatus?(): Promise<{
146
- active: boolean;
147
- runId?: string | null;
148
- runPhase?: SessionRunPhase | null;
149
- canStop?: boolean;
150
- }>;
151
- setTitle?(agentSessionId: string, title: string, workDir?: string): Promise<void>;
152
- respondToPermission?(permissionId: string, optionId: string): Promise<void>;
153
- authenticate?(methodId: string): Promise<void>;
154
- hasPendingAuthenticationRetry?(): boolean;
155
- resumeAfterExternalAuthentication?(): Promise<void>;
156
- getSessionOptions?(): AgentSessionOptions;
157
- logout?(): Promise<void>;
158
- listExternalSessions?(options?: {
159
- cwd?: string;
160
- }): Promise<import('@shennian/wire').AcpExternalSessionInfo[]>;
161
- loadExternalSession?(agentSessionId: string): Promise<ImportedAgentMessage[]>;
162
- closeExternalSession?(agentSessionId: string): Promise<void>;
163
- deleteExternalSession?(agentSessionId: string): Promise<void>;
164
- abstract start(sessionId: string, workDir: string, agentSessionId?: string | null, options?: AgentStartOptions): Promise<void>;
165
- prepareSend?(text: string, modelId?: string, reasoningEffort?: string, attachments?: ChatAttachmentMeta[], systemPrompt?: string | null, context?: AgentSendContext): Promise<void>;
166
- abstract send(text: string, modelId?: string, reasoningEffort?: string, attachments?: ChatAttachmentMeta[], systemPrompt?: string | null, context?: AgentSendContext): Promise<void | AgentSendResult>;
167
- abstract resume(agentSessionId: string): Promise<void>;
168
- abstract stop(): Promise<void>;
169
- inspectInterruptedRun(input: AgentRecoveryInput): Promise<AgentRecoveryInspection>;
170
- /**
171
- * The coordinator starts this adapter with the exact persisted native
172
- * Session before calling recoverInterruptedRun. No original prompt/history
173
- * is accepted by this API, so a recovery cannot accidentally replay it.
174
- */
175
- recoverInterruptedRun(input: AgentRecoveryInput): Promise<AgentRecoveryResult>;
176
- }
177
- export declare function registerAgent(type: AgentType, factory: () => AgentAdapter): void;
178
- export declare function unregisterAgent(type: AgentType): void;
179
- export declare function createAgent(type: AgentType): AgentAdapter | null;
180
- export declare function getRegisteredAgents(): AgentType[];
@@ -1,4 +0,0 @@
1
- import type { AgentAuthState, BuiltinAgentType } from '@shennian/wire';
2
- import { type ResolvedCommandSpec } from './command-spec.js';
3
- export declare function parseBuiltinAuthStatus(agent: 'codex' | 'claude', code: number | null, stdout: string, stderr: string): AgentAuthState;
4
- export declare function probeBuiltinAuthStatus(agent: BuiltinAgentType, spec: ResolvedCommandSpec, version?: string): Promise<AgentAuthState>;
@@ -1,33 +0,0 @@
1
- import type { ManagedAgentEnforcement } from '@shennian/wire';
2
- import type { ManagedAgentRuntimeSecurityDeclaration } from '../security/managed-agent-runtime.js';
3
- type JsonObject = Record<string, unknown>;
4
- export type ClaudeManagedPermissionOptions = {
5
- /** Exact runtime files required by Shennian's managed Room transport. */
6
- internalReadPaths?: readonly string[];
7
- /** Exact local sockets required by Shennian's managed Room transport. */
8
- internalUnixSockets?: readonly string[];
9
- shellSubprocessPolicy?: {
10
- inherit: 'none';
11
- allowedEnvKeys: readonly string[];
12
- deniedEnvKeys: readonly string[];
13
- };
14
- };
15
- export type ClaudeManagedPermissionConfig = {
16
- /** One-invocation-only settings passed inline through --settings. */
17
- settings: JsonObject;
18
- args: string[];
19
- };
20
- /**
21
- * v2.1.260 is the first evidence baseline used by Shennian: it includes
22
- * restricted mode, source isolation, fail-closed sandbox startup, credential
23
- * scrubbing, outside-workspace read blocking, and the macOS fix for that read
24
- * boundary. Unknown and older builds therefore resolve as unverified.
25
- */
26
- export declare const CLAUDE_MANAGED_RUNTIME_SECURITY: ManagedAgentRuntimeSecurityDeclaration;
27
- /**
28
- * Converts the daemon-verified effective policy into Claude Code's native,
29
- * invocation-scoped permission and sandbox configuration. It never writes to
30
- * ~/.claude or the project's .claude directory.
31
- */
32
- export declare function compileClaudeManagedPermissions(enforcement: ManagedAgentEnforcement, resolvedWorkDir: string, options?: ClaudeManagedPermissionOptions): ClaudeManagedPermissionConfig;
33
- export {};
@@ -1,69 +0,0 @@
1
- import { AgentAdapter, type AgentSendContext, type AgentStartOptions } from './adapter.js';
2
- import type { ChatAttachmentMeta, ExternalChannelSessionStatus } from '@shennian/wire';
3
- import { type CompiledManagedAgentPolicy } from '../security/managed-agent-policy.js';
4
- export declare function normalizeClaudeModelId(modelId?: string | null): string;
5
- export declare function normalizeClaudeReasoningEffort(reasoningEffort?: string | null): string | undefined;
6
- export declare function resetClaudeCapabilityCacheForTests(): void;
7
- export declare function shouldForwardClaudeStderrLine(line: string): boolean;
8
- export declare function supportsClaudeReasoningEffort(): boolean;
9
- export declare class ClaudeAdapter extends AgentAdapter {
10
- private readonly options;
11
- readonly type: "claude";
12
- get recoveryCapabilities(): {
13
- inspectTerminal: boolean;
14
- reattachRun: boolean;
15
- resumeRun: boolean;
16
- resumeSession: boolean;
17
- };
18
- private process;
19
- private agentSessionId;
20
- private sessionId;
21
- private workDir;
22
- private seq;
23
- private runId;
24
- private hasEmittedText;
25
- private terminalState;
26
- private authenticationRetrying;
27
- private pendingSuccess;
28
- private persistNativeSession;
29
- private managedAgentPolicy;
30
- constructor(options?: {
31
- systemPrompt?: string;
32
- hidden?: boolean;
33
- });
34
- private externalChannel;
35
- private shennianSessionId;
36
- private extraEnv;
37
- configure(options: {
38
- sessionId?: string;
39
- externalChannel?: ExternalChannelSessionStatus | null;
40
- env?: NodeJS.ProcessEnv;
41
- managedAgentPolicy?: CompiledManagedAgentPolicy | null;
42
- }): void;
43
- start(sessionId: string, workDir: string, agentSessionId?: string | null, options?: AgentStartOptions): Promise<void>;
44
- send(text: string, modelId?: string, reasoningEffort?: string, _attachments?: ChatAttachmentMeta[], agentSystemPrompt?: string | null, context?: AgentSendContext): Promise<void>;
45
- resume(agentSessionId: string): Promise<void>;
46
- stop(): Promise<void>;
47
- private spawnAndParse;
48
- private buildManagedPermissionConfig;
49
- private buildProcessEnv;
50
- private handleStreamEvent;
51
- private handleProcessClose;
52
- private emitFinalIfOpen;
53
- private emitErrorIfOpen;
54
- private resetRunState;
55
- private emitEvent;
56
- private killProcess;
57
- }
58
- export declare function resolveClaudeManagedInternalAccess(): {
59
- readPaths: string[];
60
- unixSockets: string[];
61
- };
62
- /**
63
- * Resolve the smallest useful read boundary for the installed Shennian CLI.
64
- * npm's bin entry is a symlink into dist/bin, while runtime dependencies such
65
- * as commander live under the package-root node_modules directory. Allowing
66
- * only the entry point or dist therefore makes every Room CLI call fail inside
67
- * Claude's native sandbox.
68
- */
69
- export declare function resolveClaudeShennianCliReadPaths(commandPath: string): string[];
@@ -1,32 +0,0 @@
1
- import type { ManagedAgentEnforcement } from '@shennian/wire';
2
- import type { ManagedAgentRuntimeSecurityDeclaration } from '../security/managed-agent-runtime.js';
3
- export declare const CODEX_MANAGED_PERMISSION_PROFILE_ID = "shennian-managed";
4
- type JsonObject = Record<string, unknown>;
5
- export type CodexManagedPermissionOptions = {
6
- /** Effective MCP server ids read from Codex before the thread starts. */
7
- configuredMcpServerNames?: readonly string[];
8
- shellSubprocessPolicy?: {
9
- inherit: 'none';
10
- allowedEnvKeys: readonly string[];
11
- deniedEnvKeys: readonly string[];
12
- };
13
- };
14
- export type CodexManagedPermissionConfig = {
15
- profileId: typeof CODEX_MANAGED_PERMISSION_PROFILE_ID;
16
- threadConfig: JsonObject;
17
- };
18
- /**
19
- * Codex 0.138+ permission profiles are available on all supported local
20
- * platforms. A profile is still verified at thread start; registration alone
21
- * never permits a silent fallback to a legacy sandbox.
22
- */
23
- export declare const CODEX_MANAGED_RUNTIME_SECURITY: ManagedAgentRuntimeSecurityDeclaration;
24
- /**
25
- * Compile one immutable Codex thread configuration from daemon-verified
26
- * effective permissions. The config is passed only as an app-server thread
27
- * override and never written into the user's global Codex configuration.
28
- */
29
- export declare function compileCodexManagedPermissions(enforcement: ManagedAgentEnforcement, resolvedWorkDir: string, options?: CodexManagedPermissionOptions): CodexManagedPermissionConfig;
30
- export declare function extractCodexMcpServerNames(configReadResponse: unknown): string[];
31
- export declare function assertCodexManagedPermissionProfile(response: unknown, expectedProfileId?: string): void;
32
- export {};
@@ -1,41 +0,0 @@
1
- import type { ManagedRoomDynamicContentItem, ManagedRoomExecutor } from '../room/managed-room-ipc.js';
2
- export type CodexDynamicToolSpec = {
3
- type: 'function';
4
- name: string;
5
- description: string;
6
- inputSchema: Record<string, unknown>;
7
- };
8
- export type CodexDynamicToolCallParams = {
9
- threadId?: unknown;
10
- turnId?: unknown;
11
- callId?: unknown;
12
- namespace?: unknown;
13
- tool?: unknown;
14
- arguments?: unknown;
15
- };
16
- export type CodexDynamicToolCallResponse = {
17
- success: boolean;
18
- contentItems: ManagedRoomDynamicContentItem[];
19
- };
20
- export declare const CODEX_MANAGED_ROOM_DYNAMIC_TOOLS: CodexDynamicToolSpec[];
21
- export declare const CODEX_MANAGED_MANAGER_DYNAMIC_TOOLS: CodexDynamicToolSpec[];
22
- /**
23
- * Per-adapter, per-turn capability binding for Codex app-server dynamic tools.
24
- * The short Room token never enters Codex's process or persisted rollout.
25
- */
26
- export declare class CodexManagedRoomToolBinding {
27
- private token;
28
- private executor;
29
- private threadId;
30
- private turnId;
31
- private generation;
32
- private consumedCallIds;
33
- private abortController;
34
- configure(token: string | null | undefined, executor: ManagedRoomExecutor | null | undefined): void;
35
- isConfigured(): boolean;
36
- bindThread(threadId: string): void;
37
- bindTurn(threadId: string, turnId: string): boolean;
38
- deactivateTurn(): void;
39
- reset(): void;
40
- execute(params: CodexDynamicToolCallParams): Promise<CodexDynamicToolCallResponse>;
41
- }
@@ -1,103 +0,0 @@
1
- import type { ChatAttachmentMeta } from '@shennian/wire';
2
- export declare function isCodexActiveWriterError(error: unknown): boolean;
3
- export declare function isCodexPaginatedHistoryUnsupportedError(error: unknown): boolean;
4
- export declare function isCodexExcludeTurnsUnsupportedError(error: unknown): boolean;
5
- export declare function isCodexProjectApiUnsupportedError(error: unknown): boolean;
6
- export type CodexUsage = {
7
- input_tokens?: number;
8
- cached_input_tokens?: number;
9
- output_tokens?: number;
10
- prompt_tokens?: number;
11
- completion_tokens?: number;
12
- };
13
- export type CodexItem = {
14
- id?: string;
15
- type?: string;
16
- text?: string;
17
- command?: string;
18
- aggregated_output?: string;
19
- exit_code?: number | null;
20
- status?: string;
21
- server?: string;
22
- tool?: string;
23
- arguments?: Record<string, unknown> | null;
24
- result?: unknown;
25
- error?: {
26
- message?: string;
27
- } | null;
28
- message?: string;
29
- query?: string;
30
- changes?: Array<{
31
- path: string;
32
- kind: string;
33
- }>;
34
- items?: Array<{
35
- text: string;
36
- completed: boolean;
37
- }>;
38
- approval_id?: string;
39
- approvalId?: string;
40
- reason?: string;
41
- title?: string;
42
- prompt?: string;
43
- };
44
- export type ManagedTurnReplay = {
45
- text: string;
46
- modelId?: string;
47
- reasoningEffort?: string;
48
- attachments?: ChatAttachmentMeta[];
49
- recoveryCount: number;
50
- };
51
- export type CodexStreamEvent = {
52
- type?: string;
53
- event?: string;
54
- item?: CodexItem;
55
- content?: string;
56
- text?: string;
57
- name?: string;
58
- arguments?: Record<string, unknown>;
59
- input?: Record<string, unknown>;
60
- output?: string;
61
- result?: string;
62
- error?: string | {
63
- message?: string;
64
- };
65
- message?: string;
66
- reason?: string;
67
- title?: string;
68
- prompt?: string;
69
- usage?: CodexUsage;
70
- };
71
- export type JsonRpcMessage = {
72
- id?: number | string;
73
- method?: string;
74
- params?: Record<string, unknown>;
75
- result?: unknown;
76
- error?: {
77
- message?: string;
78
- code?: number;
79
- };
80
- };
81
- export type CodexThreadStatus = {
82
- type?: string;
83
- activeFlags?: string[];
84
- };
85
- export type PendingRequest = {
86
- resolve: (value: unknown) => void;
87
- reject: (error: Error) => void;
88
- timer: NodeJS.Timeout;
89
- };
90
- export type CodexProject = {
91
- id?: string;
92
- roots?: Array<{
93
- path?: string;
94
- }>;
95
- };
96
- export type CodexProjectListResponse = {
97
- data?: CodexProject[];
98
- nextCursor?: string | null;
99
- };
100
- export declare function selectCodexProjectIdForWorkDir(projects: CodexProject[], workDir: string): string | undefined;
101
- export declare function buildCodexTextInput(text: string, attachments?: ChatAttachmentMeta[]): Record<string, unknown>;
102
- export declare function buildCodexQueuedText(text: string, attachments?: ChatAttachmentMeta[]): string;
103
- export declare function buildCodexQueueArgs(threadId: string, text: string, attachments?: ChatAttachmentMeta[]): string[];
@@ -1,91 +0,0 @@
1
- import type { ChatAttachmentMeta, ExternalChannelSessionStatus } from '@shennian/wire';
2
- import type { ChildProcess } from 'node:child_process';
3
- import type { ManagedRoomExecutor } from '../room/managed-room-ipc.js';
4
- import type { CompiledManagedAgentPolicy } from '../security/managed-agent-policy.js';
5
- import { AgentAdapter, type AgentEvent } from './adapter.js';
6
- import type { CodexManagedPermissionConfig } from './codex-managed-permissions.js';
7
- import { CodexManagedRoomToolBinding } from './codex-managed-room-tools.js';
8
- import type { CodexItem, CodexStreamEvent, CodexThreadStatus, JsonRpcMessage, ManagedTurnReplay, PendingRequest } from './codex-protocol.js';
9
- export declare abstract class CodexRuntime extends AgentAdapter {
10
- protected readonly options: {
11
- modelInstructionsFile?: string;
12
- hidden?: boolean;
13
- isThreadTailInterrupted?: (threadId: string) => boolean;
14
- };
15
- protected process: ChildProcess | null;
16
- protected workDir: string | null;
17
- protected seq: number;
18
- protected runId: string;
19
- protected pendingUsage: AgentEvent['usage'] | undefined;
20
- protected agentSessionId: string | null;
21
- protected hasEmittedText: boolean;
22
- protected textTail: string;
23
- protected terminalState: 'open' | 'final' | 'error';
24
- protected forceCloseTimer: NodeJS.Timeout | null;
25
- protected stderrBuf: string;
26
- protected rpcSeq: number;
27
- protected pendingRequests: Map<number, PendingRequest>;
28
- protected appServerReady: Promise<void> | null;
29
- protected appServerStartupError: Error | null;
30
- protected activeTurnId: string | null;
31
- protected deltaItemIds: Set<string>;
32
- protected lastTransientStatus: string;
33
- protected agentSystemPrompt: string;
34
- protected managedAgentPolicy: CompiledManagedAgentPolicy | null;
35
- protected managedPermissionConfig: CodexManagedPermissionConfig | null;
36
- protected configurationRestartRequired: boolean;
37
- protected readonly managedRoomTools: CodexManagedRoomToolBinding;
38
- protected configuredManagedRoomContextToken: string | null;
39
- protected configuredManagedRoomExecutor: ManagedRoomExecutor | null;
40
- protected managedRoomToolThreadId: string | null;
41
- protected managedRoomCapabilityExpectedForTurn: boolean;
42
- protected managedRoomTurnBindingFailed: boolean;
43
- protected preparedExternalOwnerThreadId: string | null;
44
- protected managedTurnReplay: ManagedTurnReplay | null;
45
- protected managedAsyncRecovery: Promise<void> | null;
46
- protected persistNativeSession: boolean;
47
- protected nativeSessionVisibility: 'user' | 'internal';
48
- constructor(options?: {
49
- modelInstructionsFile?: string;
50
- hidden?: boolean;
51
- isThreadTailInterrupted?: (threadId: string) => boolean;
52
- });
53
- protected externalChannel: ExternalChannelSessionStatus | null;
54
- protected shennianSessionId: string | null;
55
- protected extraEnv: NodeJS.ProcessEnv;
56
- protected abstract ensureAppServer(modelId?: string): Promise<void>;
57
- protected abstract logManagedThreadLifecycle(event: string, details: Record<string, unknown>): void;
58
- protected abstract startFreshManagedTurnWithReadinessRetry(threadId: string, text: string, modelId?: string, reasoningEffort?: string, attachments?: ChatAttachmentMeta[]): Promise<{
59
- turn?: {
60
- id?: string;
61
- };
62
- }>;
63
- protected sendRpc(method: string, params: unknown, timeoutMs?: number): Promise<unknown>;
64
- protected handleAppServerMessage(msg: JsonRpcMessage): void;
65
- protected scheduleManagedAsyncRolloutRecovery(message: string): boolean;
66
- protected recoverManagedTurnAfterAsyncRolloutFailure(): Promise<void>;
67
- protected handleManagedRoomToolCall(id: number | string, params: Record<string, unknown>): Promise<void>;
68
- protected writeAppServerResponse(id: number | string, result: unknown): void;
69
- protected mapThreadStatusToRunPhase(status: CodexThreadStatus | null): 'thinking' | 'waiting_approval' | 'waiting_user_input';
70
- protected handleAppServerNonJsonStdout(line: string): void;
71
- protected failAppServerStartup(error: Error): void;
72
- protected handleAppServerCompletedItem(params: Record<string, unknown>): void;
73
- protected handleAppServerUsage(params: Record<string, unknown>): void;
74
- protected handleCodexItemLine(obj: CodexStreamEvent): void;
75
- protected handleStreamEvent(obj: CodexStreamEvent): void;
76
- protected emitEvent(partial: Omit<AgentEvent, 'runId' | 'seq'>): void;
77
- protected isApprovalLikeName(name: unknown): boolean;
78
- protected emitApprovalPending(source: Record<string, unknown> | CodexItem): void;
79
- protected killProcess(preserveConfiguredManagedRoomContext?: boolean): Promise<void>;
80
- protected rejectAllPending(error: Error): void;
81
- protected handleProcessClose(code: number | null, stderrBuf: string): void;
82
- protected emitFinalIfOpen(): void;
83
- protected emitErrorIfOpen(message: string): void;
84
- protected resetRunState(): void;
85
- protected clearConfiguredManagedRoomContext(): void;
86
- protected emitTransientStatus(message: string): void;
87
- protected resetTextState(): void;
88
- protected emitText(text: string, mode?: 'delta' | 'block'): void;
89
- protected scheduleProcessClose(): void;
90
- protected clearForceCloseTimer(): void;
91
- }
@@ -1,29 +0,0 @@
1
- export declare function makeThreadTitle(text: string): string;
2
- export declare const CODEX_APP_SERVER_CLIENT_INFO: {
3
- readonly name: "codex-tui";
4
- readonly title: "Codex TUI";
5
- readonly version: "0.0.0";
6
- };
7
- export declare function isCodexCollabAgentToolName(name: string): boolean;
8
- export declare function isCodexCollabAgentItem(item: Record<string, unknown>): boolean;
9
- export declare function isCodexLegacyCollabAgentItem(item: {
10
- type?: string;
11
- tool?: string;
12
- }): boolean;
13
- export declare function normalizeTitleText(text: string): string;
14
- export declare function normalizeCodexModelId(modelId?: string | null): string | undefined;
15
- export declare function normalizeCodexReasoningEffort(reasoningEffort?: string | null): string | undefined;
16
- export declare function isMissingCodexRolloutError(error: unknown): boolean;
17
- export declare function isCodexUnsupportedEffortError(error: unknown): boolean;
18
- export declare function extractAppServerErrorMessage(params: Record<string, unknown>): string;
19
- export declare function isTransientCodexErrorMessage(message: string): boolean;
20
- export declare function formatTransientCodexStatus(message: string): string;
21
- export declare function formatCodexErrorMessage(message: string): string;
22
- export declare function stripGitDirectiveArtifacts(text: string): string;
23
- export declare function safeStringify(value: unknown): string;
24
- export declare function normalizeCodexStderr(stderr: string): string;
25
- export declare function looksLikeMissingNodeOnWindows(text: string): boolean;
26
- export declare function normalizeTerminalText(text: string): string;
27
- export declare function looksLikeCodexInteractiveAuthPrompt(text: string): boolean;
28
- export declare function isIgnorableCodexStderrLine(line: string): boolean;
29
- export declare function looksLikeFatalCodexStderr(stderr: string): boolean;
@@ -1,59 +0,0 @@
1
- import type { SessionRunPhase } from '@shennian/wire';
2
- import { type ChatAttachmentMeta, type ExternalChannelSessionStatus } from '@shennian/wire';
3
- import type { ManagedRoomExecutor } from '../room/managed-room-ipc.js';
4
- import { type CompiledManagedAgentPolicy } from '../security/managed-agent-policy.js';
5
- import { type AgentActiveInput, type AgentSendContext, type AgentSendResult, type AgentStartOptions } from './adapter.js';
6
- export { buildCodexQueueArgs, buildCodexQueuedText, isCodexActiveWriterError, isCodexExcludeTurnsUnsupportedError, isCodexPaginatedHistoryUnsupportedError, isCodexProjectApiUnsupportedError, selectCodexProjectIdForWorkDir, } from './codex-protocol.js';
7
- export { isCodexUnsupportedEffortError, isMissingCodexRolloutError, normalizeCodexModelId, normalizeCodexReasoningEffort, } from './codex-utils.js';
8
- import { CodexRuntime } from './codex-runtime.js';
9
- export declare class CodexAdapter extends CodexRuntime {
10
- get supportsActiveInput(): boolean;
11
- injectActiveInput(input: AgentActiveInput): Promise<void>;
12
- readonly type: "codex";
13
- get recoveryCapabilities(): {
14
- inspectTerminal: boolean;
15
- reattachRun: boolean;
16
- resumeRun: boolean;
17
- resumeSession: boolean;
18
- };
19
- configure(options: {
20
- sessionId?: string;
21
- externalChannel?: ExternalChannelSessionStatus | null;
22
- env?: NodeJS.ProcessEnv;
23
- managedAgentPolicy?: CompiledManagedAgentPolicy | null;
24
- managedRoomContextToken?: string | null;
25
- managedRoomExecutor?: ManagedRoomExecutor | null;
26
- }): void;
27
- private configurationFingerprint;
28
- private buildProcessEnv;
29
- start(sessionId: string, workDir: string, agentSessionId?: string | null, options?: AgentStartOptions): Promise<void>;
30
- prepareSend(_text: string, modelId?: string, _reasoningEffort?: string, _attachments?: ChatAttachmentMeta[], agentSystemPrompt?: string | null, context?: AgentSendContext): Promise<void>;
31
- send(text: string, modelId?: string, reasoningEffort?: string, attachments?: ChatAttachmentMeta[], agentSystemPrompt?: string | null, context?: AgentSendContext): Promise<void | AgentSendResult>;
32
- private isThreadTailInterrupted;
33
- private enqueueForExternalOwner;
34
- resume(agentSessionId: string): Promise<void>;
35
- setTitle(agentSessionId: string, title: string, workDir?: string): Promise<void>;
36
- stop(): Promise<void>;
37
- getStatus(): Promise<{
38
- active: boolean;
39
- runId?: string | null;
40
- runPhase?: SessionRunPhase | null;
41
- canStop?: boolean;
42
- }>;
43
- private spawnCodex;
44
- private spawnAppServer;
45
- protected ensureAppServer(modelId?: string): Promise<void>;
46
- private initializeAppServer;
47
- private notifyNativeSession;
48
- private buildManagedPermissionConfig;
49
- private resolveCodexProjectId;
50
- private startTurnWithRecovery;
51
- protected startFreshManagedTurnWithReadinessRetry(threadId: string, text: string, codexModelId?: string, reasoningEffort?: string, attachments?: ChatAttachmentMeta[]): Promise<{
52
- turn?: {
53
- id?: string;
54
- };
55
- }>;
56
- protected logManagedThreadLifecycle(event: string, details: Record<string, unknown>): void;
57
- private startTurn;
58
- private interruptActiveTurn;
59
- }