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,465 +0,0 @@
1
- import type { NativeSessionSourceMode } from './native-session.js';
2
- import type { PersonalAttachmentReference, PersonalSyncIdentity, SessionBodyStorageMode, SessionTitleSource } from './session-sync.js';
3
- export type BuiltinAgentType = 'claude' | 'codex' | 'workbuddy' | 'gemini' | 'cursor' | 'openclaw' | 'opencode' | 'pi' | 'pi-coding-agent' | 'manager';
4
- export type CustomAgentType = `custom:${string}`;
5
- /** Stable Agent Client Protocol integrations discovered on the target machine. */
6
- export type AcpAgentType = `acp:${string}`;
7
- export type AgentType = BuiltinAgentType | CustomAgentType | AcpAgentType;
8
- /** The external Codex owner stopped its last turn, so its native queue is paused. */
9
- export declare const CODEX_DESKTOP_SEND_UNAVAILABLE = "codex_desktop_send_unavailable";
10
- export declare const DISABLED_BUILTIN_AGENT_TYPES: readonly ["gemini", "openclaw"];
11
- export declare const AVAILABLE_BUILTIN_AGENT_TYPES: readonly ["claude", "codex", "workbuddy", "cursor", "opencode", "pi", "pi-coding-agent"];
12
- export type ModelInfo = {
13
- id: string;
14
- name: string;
15
- description?: string;
16
- provider?: string;
17
- isDefault?: boolean;
18
- supportedReasoningEfforts?: Array<{
19
- id: string;
20
- name: string;
21
- description?: string;
22
- }>;
23
- defaultReasoningEffort?: string;
24
- additionalSpeedTiers?: string[];
25
- };
26
- /** Runtime options returned by an active ACP session; absent before session/new or load. */
27
- export type AcpSessionOptions = {
28
- models: ModelInfo[];
29
- modes: Array<{
30
- id: string;
31
- name: string;
32
- description?: string;
33
- }>;
34
- };
35
- export type AgentConfigStatus = 'missing' | 'detected' | 'managed' | 'error';
36
- export type AgentConfigSummary = {
37
- /** Configuration state on the target machine; secrets are never included. */
38
- status: AgentConfigStatus;
39
- /** Where the daemon detected the configuration. */
40
- source?: 'env' | 'config-file' | 'keychain' | 'shennian' | 'unknown';
41
- tokenPresent?: boolean;
42
- /** Masked token suffix only, e.g. ••••abcd. */
43
- tokenHint?: string;
44
- /** Host part only; never includes credentials or paths. */
45
- baseUrlHost?: string;
46
- error?: string;
47
- updatedAt?: string;
48
- };
49
- export type AgentRuntimeSummary = {
50
- /** Version of the Agent CLI selected by the Shennian daemon. */
51
- cliVersion?: string;
52
- /** Version bundled with the locally installed desktop app, when detectable. */
53
- desktopVersion?: string;
54
- /** Compatibility is only reported when both versions are known. */
55
- compatibility?: 'compatible' | 'version_mismatch';
56
- /** Shennian never upgrades third-party Agents automatically. */
57
- upgradeAction?: 'manual';
58
- };
59
- export type AgentIntegration = 'deep' | 'acp';
60
- export type AgentAuthState = 'ready' | 'required' | 'unknown' | 'error';
61
- export type AcpCapabilitySummary = {
62
- protocolVersion: 1;
63
- listSessions: boolean;
64
- loadSession: boolean;
65
- resumeSession: boolean;
66
- closeSession: boolean;
67
- deleteSession: boolean;
68
- terminal: boolean;
69
- fileRead: boolean;
70
- fileWrite: boolean;
71
- permission: boolean;
72
- modelConfig: boolean;
73
- };
74
- export type AcpAuthMethodSummary = {
75
- id: string;
76
- name: string;
77
- type: 'agent' | 'terminal';
78
- };
79
- export type AgentDisplayMetadata = {
80
- name: string;
81
- abbreviation?: string;
82
- version?: string;
83
- };
84
- export type AcpCatalogPlatform = 'darwin-aarch64' | 'darwin-x86_64' | 'linux-aarch64' | 'linux-x86_64' | 'windows-aarch64' | 'windows-x86_64';
85
- export type AcpCatalogCandidate = {
86
- id: string;
87
- name: string;
88
- version: string;
89
- commands: string[];
90
- args: string[];
91
- /** Package hints are inspected locally only; the daemon never installs them. */
92
- npmPackage?: string;
93
- uvPackage?: string;
94
- website?: string;
95
- duplicateOf?: BuiltinAgentType;
96
- };
97
- export type AcpCatalogSnapshot = {
98
- revision: string;
99
- digest: string;
100
- fetchedAt: string;
101
- sourceVersion: string;
102
- platform: AcpCatalogPlatform;
103
- candidates: AcpCatalogCandidate[];
104
- };
105
- export type AcpExternalSessionInfo = {
106
- agentSessionId: string;
107
- cwd: string;
108
- title?: string;
109
- updatedAt?: string;
110
- };
111
- /** Complete scope for an external ACP session; vendor ids are never global. */
112
- export type AcpExternalSessionIdentity = {
113
- machineId: string;
114
- agentType: AcpAgentType;
115
- agentSessionId: string;
116
- };
117
- export type AgentInfo = {
118
- type: AgentType;
119
- models: ModelInfo[];
120
- /** True when this runtime can back an ordinary Shennian session. */
121
- supportsStandardSession?: boolean;
122
- /** User-facing grouping. Omitted by older daemons and interpreted as deep. */
123
- integration?: AgentIntegration;
124
- /** Non-secret metadata used for dynamic ACP display fallbacks. */
125
- display?: AgentDisplayMetadata;
126
- /** Stable ACP v1 capabilities negotiated with the installed local Agent. */
127
- acpCapabilities?: AcpCapabilitySummary;
128
- /** Non-secret authentication choices advertised during ACP initialize. */
129
- acpAuthMethods?: AcpAuthMethodSummary[];
130
- /** Conservative auth projection; authMethods alone never imply required. */
131
- authState?: AgentAuthState;
132
- /** Registry snapshot used to discover the Agent, when applicable. */
133
- catalogRevision?: string;
134
- /** True when this provider can back a stable Shennian Agent and managed Room session. */
135
- supportsManagedAgent?: boolean;
136
- /** True when managed Rooms can reuse this provider's ordinary native full-access launch path. */
137
- supportsManagedNativeFull?: boolean;
138
- /** True when Manager mode can create this provider as a worker. */
139
- supportsWorker?: boolean;
140
- /** True only after this real provider passed Manager-mode runtime validation. */
141
- supportsManagerMode?: boolean;
142
- /** True when a managed Room turn can receive explicit Room tools. */
143
- supportsRoomTools?: boolean;
144
- /** True when the public temporary Worker controller may target this runtime. */
145
- supportsExternalWorkerTarget?: boolean;
146
- /** Per-machine Agent provider config summary (additive, non-secret). */
147
- config?: AgentConfigSummary;
148
- /** Non-secret runtime version and compatibility summary. */
149
- runtime?: AgentRuntimeSummary;
150
- /** Conservative per-machine protection baseline; absent on older daemons. */
151
- managedAgentProtection?: import('./agent-workspace.ts').ManagedAgentRuntimeProtection;
152
- };
153
- export type SessionMode = 'standard' | 'manager';
154
- export type ManagerConfig = {
155
- defaultWorkerAgentType?: AgentType | null;
156
- defaultWorkerModelId?: string | null;
157
- };
158
- export declare function isAvailableBuiltinAgentType(value: string): value is BuiltinAgentType;
159
- export declare function isAvailableAgentType(value: string): value is AgentType;
160
- export declare function filterAvailableAgentTypes(values: readonly string[]): AgentType[];
161
- export declare function filterAvailableAgentInfos(agents?: readonly AgentInfo[]): AgentInfo[];
162
- export type SessionUserState = {
163
- userId: string;
164
- sessionId: string;
165
- pinnedAt?: string | null;
166
- lastReadAt?: string | null;
167
- /** Index watermark captured atomically when the user marks this session read. */
168
- lastReadBodyRevision?: number;
169
- lastReadVisibleMessageCount?: number;
170
- lastReadVisibleMessageId?: string | null;
171
- lastReadAttentionCount?: number;
172
- lastReadAttentionId?: string | null;
173
- manualUnread?: boolean;
174
- /** Local desired read watermark has not yet been acknowledged by Server. */
175
- readSyncPending?: boolean;
176
- updatedAt: string;
177
- };
178
- /** Exact lightweight index state the user actually saw before marking a Session read. */
179
- export type SessionReadWatermark = {
180
- bodyRevision: number;
181
- visibleMessageCount: number;
182
- lastVisibleMessageId: string | null;
183
- attentionCount: number;
184
- lastAttentionId: string | null;
185
- };
186
- export type SessionRunPhase = 'thinking' | 'tool_running' | 'streaming_text' | 'waiting_approval' | 'waiting_user_input';
187
- export type SessionActivitySnapshot = {
188
- sessionId: string;
189
- runId: string;
190
- runPhase: SessionRunPhase;
191
- startedAt: string;
192
- updatedAt: string;
193
- /** Number of tool calls observed in the active run. */
194
- toolCallCount?: number;
195
- /** True when the daemon owns a live control channel that can stop the active run. */
196
- canStop?: boolean;
197
- /** Optional owner projection for runs controlled by a native desktop host. */
198
- owner?: 'shennian' | 'external';
199
- /** Human-readable native owner. Older clients safely ignore this field. */
200
- ownerLabel?: string;
201
- /** External-owner lifecycle. `runPhase` remains the backwards-compatible projection. */
202
- lifecycle?: 'queued' | 'running';
203
- };
204
- export type ExternalChannelSessionStatus = {
205
- configured?: boolean;
206
- connected: boolean;
207
- type?: string | null;
208
- channelId?: string | null;
209
- machineId?: string | null;
210
- name?: string | null;
211
- canReply?: boolean | null;
212
- systemPrompt?: string | null;
213
- wechatRpaSource?: string | null;
214
- wechatRpaGroups?: Array<{
215
- name: string;
216
- }> | null;
217
- pollIntervalMs?: number | null;
218
- recentLimit?: number | null;
219
- idleSeconds?: number | null;
220
- forceForeground?: boolean | null;
221
- noRestore?: boolean | null;
222
- downloadAttachments?: boolean | null;
223
- downloadAttachmentsDir?: string | null;
224
- selfNickname?: string | null;
225
- cloudOcrUrl?: string | null;
226
- cloudOcrMode?: string | null;
227
- wechatRpaRuntimeState?: 'idle_waiting' | 'syncing' | 'interrupted' | 'retrying' | 'cooldown' | null;
228
- wechatRpaLastRunAt?: string | null;
229
- wechatRpaLastMessageAt?: string | null;
230
- wechatRpaLastInterruptedAt?: string | null;
231
- wechatRpaPendingReplyCount?: number | null;
232
- wechatRpaPendingReplies?: WeChatRpaPendingReplyProjection[] | null;
233
- wechatRpaLastError?: string | null;
234
- wechatRpaLastRunId?: string | null;
235
- wechatRpaLastTracePath?: string | null;
236
- wechatRpaLastTraceSummary?: string | null;
237
- wechatRpaRecentTaskSummaries?: WeChatRpaTaskSummary[] | null;
238
- wechatRpaLastCloudOcrAt?: string | null;
239
- wechatRpaLastCloudOcrPurpose?: string | null;
240
- wechatRpaLastCloudOcrRequestId?: string | null;
241
- wechatRpaLastCloudOcrImageHash?: string | null;
242
- wechatRpaLastCloudOcrUsage?: {
243
- inputTokens?: number;
244
- outputTokens?: number;
245
- totalTokens?: number;
246
- } | null;
247
- wechatRpaPreflightChecks?: WeChatRpaPreflightCheck[] | null;
248
- wechatRpaServerDecisionAvailable?: boolean | null;
249
- wechatRpaPrivacyConsentAccepted?: boolean | null;
250
- };
251
- export type WeChatRpaPendingReplyProjection = {
252
- replyId?: string | null;
253
- idempotencyKey: string;
254
- status: 'queued' | 'sending' | 'sent_unconfirmed' | string;
255
- conversationName?: string | null;
256
- reasonCode?: string | null;
257
- nextAttemptAt?: string | null;
258
- queuedAt?: string | null;
259
- lastAttemptAt?: string | null;
260
- attemptCount?: number | null;
261
- commitStage?: string | null;
262
- };
263
- export type WeChatRpaTaskSummary = {
264
- at: string;
265
- status: 'blocked' | 'failed' | 'interrupted' | 'sent' | 'received';
266
- runId?: string | null;
267
- summary: string;
268
- };
269
- export type WeChatRpaPreflightCode = 'ok' | 'mac_only' | 'platform_unsupported' | 'enterprise_required' | 'privacy_consent_required' | 'server_decision_unavailable' | 'same_machine_required' | 'local_agent_unavailable' | 'helper_not_ready' | 'permission_screen_recording_missing' | 'permission_accessibility_missing' | 'permission_automation_missing' | 'wechat_not_running' | 'wechat_window_unavailable' | 'wechat_window_unresponsive' | 'wechat_recovery_failed' | 'wechat_single_main_window_required' | 'pending_server_decision' | 'network_unavailable' | 'waiting_retry' | 'unknown';
270
- export type WeChatRpaPreflightCheck = {
271
- code: WeChatRpaPreflightCode;
272
- ok: boolean;
273
- severity?: 'blocking' | 'warning';
274
- message?: string;
275
- };
276
- export type NianSession = {
277
- id: string;
278
- /** Device-local lifecycle only; never sent as canonical session metadata. */
279
- localCreationState?: 'draft' | 'created';
280
- /** Client-local user-message sort watermark; not canonical server metadata. */
281
- lastUserMessageAt?: string | null;
282
- agentIdentityId?: string | null;
283
- machineId: string;
284
- userId: string;
285
- agentType: AgentType;
286
- /** Missing on legacy records/clients and normalized to standard, except legacy agentType=manager. */
287
- sessionMode?: SessionMode;
288
- /** Internal orchestration stays out of personal discovery; linked details remain readable. */
289
- nativeSessionVisibility?: 'user' | 'internal';
290
- managerConfig?: ManagerConfig | null;
291
- agentSessionId: string | null;
292
- sourceMode?: NativeSessionSourceMode | null;
293
- modelId?: string | null;
294
- /** Agent-owned conversations follow the Agent model until explicitly overridden. */
295
- modelSource?: 'agent' | 'session';
296
- /** Owner-only live Agent policy used when modelSource is agent. */
297
- agentDefaultModelId?: string | null;
298
- /** Owner-only live Agent prompt applied at the start of the next run. */
299
- agentSystemPrompt?: string | null;
300
- managerDefaultWorkerAgentType?: AgentType | null;
301
- managerDefaultWorkerModelId?: string | null;
302
- title: string;
303
- titleSource?: SessionTitleSource;
304
- titleRevision?: number;
305
- titleLockedByUser?: boolean;
306
- titleOriginEventId?: string | null;
307
- status: 'active' | 'completed' | 'failed';
308
- workDir: string;
309
- lastMessagePreview?: string | null;
310
- /** Stable identity and canonical timestamp of the displayed list preview. */
311
- lastMessagePreviewMessageId?: string | null;
312
- lastMessagePreviewAt?: string | null;
313
- /** Latest canonical timeline event visible to the user, including tool activity. */
314
- lastVisibleEventAt?: string | null;
315
- bodyStorageMode?: SessionBodyStorageMode;
316
- /**
317
- * False only for a Server-created shell that has not yet committed its first
318
- * canonical user message on the origin daemon.
319
- */
320
- localReady?: boolean;
321
- bodyRevision?: number;
322
- indexRevision?: number;
323
- /** Personal data authority generation; absent only for Room/legacy projections. */
324
- dataEpoch?: import('./session-sync.ts').SessionSyncDataEpoch;
325
- firstAvailableSeq?: number | null;
326
- visibleMessageCount?: number;
327
- lastVisibleMessageId?: string | null;
328
- /** Completed/error/approval results that require user attention. */
329
- attentionCount?: number;
330
- lastAttentionId?: string | null;
331
- lastBodyCommittedAt?: string | null;
332
- deletionRevision?: number;
333
- lastActivityAt: string;
334
- createdAt: string;
335
- updatedAt: string;
336
- deletedAt?: string | null;
337
- machineName?: string | null;
338
- ownerName?: string | null;
339
- ownerPhone?: string | null;
340
- ownerEmail?: string | null;
341
- canManage?: boolean;
342
- sharedMachineSession?: boolean;
343
- userState?: SessionUserState | null;
344
- activity?: SessionActivitySnapshot | null;
345
- externalChannel?: ExternalChannelSessionStatus | null;
346
- };
347
- export type SessionListProjection = Pick<NianSession, 'id' | 'machineId' | 'userId' | 'agentType' | 'sessionMode' | 'nativeSessionVisibility' | 'managerConfig' | 'agentSessionId' | 'modelId' | 'managerDefaultWorkerAgentType' | 'managerDefaultWorkerModelId' | 'title' | 'titleSource' | 'titleRevision' | 'titleLockedByUser' | 'titleOriginEventId' | 'status' | 'workDir' | 'lastMessagePreview' | 'lastMessagePreviewMessageId' | 'lastMessagePreviewAt' | 'lastVisibleEventAt' | 'bodyStorageMode' | 'bodyRevision' | 'indexRevision' | 'dataEpoch' | 'firstAvailableSeq' | 'visibleMessageCount' | 'lastVisibleMessageId' | 'attentionCount' | 'lastAttentionId' | 'lastBodyCommittedAt' | 'deletionRevision' | 'lastActivityAt' | 'createdAt' | 'updatedAt' | 'deletedAt' | 'machineName' | 'ownerName' | 'ownerPhone' | 'ownerEmail' | 'canManage' | 'sharedMachineSession' | 'activity' | 'externalChannel'>;
348
- export type ChatSendParams = PersonalSyncIdentity & {
349
- sessionId: string;
350
- text: string;
351
- agentType: string;
352
- sessionMode?: SessionMode;
353
- managerConfig?: ManagerConfig | null;
354
- workDir: string;
355
- agentSessionId?: string | null;
356
- modelId?: string;
357
- systemPrompt?: string | null;
358
- managerDefaultWorkerAgentType?: AgentType | null;
359
- managerDefaultWorkerModelId?: string | null;
360
- reasoningEffort?: string | null;
361
- clientMessageId?: string;
362
- sessionListProjection?: SessionListProjection[];
363
- attachments?: Array<PersonalAttachmentReference & {
364
- /** @deprecated Removed by the hard-cutover attachment migration. */
365
- previewData?: string;
366
- }>;
367
- externalChannel?: ExternalChannelSessionStatus | null;
368
- replyTarget?: string | null;
369
- };
370
- export type QueuedChatMessage = PersonalSyncIdentity & {
371
- id: string;
372
- sessionId: string;
373
- text: string;
374
- agentType: AgentType;
375
- sessionMode?: SessionMode;
376
- managerConfig?: ManagerConfig | null;
377
- workDir: string;
378
- agentSessionId?: string | null;
379
- modelId?: string | null;
380
- systemPrompt?: string | null;
381
- managerDefaultWorkerAgentType?: AgentType | null;
382
- managerDefaultWorkerModelId?: string | null;
383
- reasoningEffort?: string | null;
384
- clientMessageId?: string | null;
385
- attachments?: Array<PersonalAttachmentReference & {
386
- /** @deprecated Removed by the hard-cutover attachment migration. */
387
- previewData?: string;
388
- }>;
389
- externalChannel?: ExternalChannelSessionStatus | null;
390
- replyTarget?: string | null;
391
- createdAt: string;
392
- updatedAt: string;
393
- /** Presentation state for the shared pending-message panel. */
394
- pendingState?: 'waiting' | 'submitting' | 'provider_queued';
395
- /** Whether the current client may delete this item before Provider claim. */
396
- canDelete?: boolean;
397
- /** Whether the daemon currently has a truthful immediate-send path. */
398
- canPromote?: boolean;
399
- };
400
- export type ChatQueueSnapshot = PersonalSyncIdentity & {
401
- sessionId: string;
402
- busy: boolean;
403
- pending: QueuedChatMessage[];
404
- /** Owner-authored messages that may be deleted or promoted by the current UI. */
405
- controllablePending?: QueuedChatMessage[];
406
- /** All owner-authored pending items that belong in the shared composer panel. */
407
- visiblePending?: QueuedChatMessage[];
408
- };
409
- export type ChatEnqueueParams = ChatSendParams & {
410
- queueMessageId?: string;
411
- origin?: 'app' | 'external';
412
- /** Relay-attested. Clients must not set this field directly. */
413
- managedAgentDirect?: true;
414
- };
415
- export type ChatQueueGetParams = PersonalSyncIdentity & {
416
- sessionId: string;
417
- };
418
- export type ChatQueueEditParams = PersonalSyncIdentity & {
419
- sessionId: string;
420
- queueMessageId: string;
421
- text: string;
422
- attachments?: Array<PersonalAttachmentReference & {
423
- /** @deprecated Removed by the hard-cutover attachment migration. */
424
- previewData?: string;
425
- }>;
426
- };
427
- export type ChatQueueDeleteParams = PersonalSyncIdentity & {
428
- sessionId: string;
429
- queueMessageId: string;
430
- };
431
- export type ChatQueuePromoteParams = PersonalSyncIdentity & {
432
- sessionId: string;
433
- /** Send this owner-authored pending message now without merging adjacent items. */
434
- queueMessageId: string;
435
- };
436
- export type ChatQueuePromoteResult = {
437
- queue: ChatQueueSnapshot;
438
- promotedMessageIds: string[];
439
- mode: 'injected' | 'restarted' | 'idle';
440
- };
441
- export type SessionResumeParams = PersonalSyncIdentity & {
442
- sessionId: string;
443
- agentSessionId: string | null;
444
- };
445
- export type SessionHistoryParams = PersonalSyncIdentity & {
446
- sessionId: string;
447
- limit?: number;
448
- before?: number;
449
- };
450
- export type FsLsParams = {
451
- path: string;
452
- rootPath?: string;
453
- };
454
- export type FsReadParams = {
455
- path: string;
456
- rootPath?: string;
457
- };
458
- /** Visibility is separate from access: an Owner can still open linked internal details. */
459
- export declare function isInternalSession(session: {
460
- id: string;
461
- nativeSessionVisibility?: string | null;
462
- agentType?: string;
463
- sessionMode?: string | null;
464
- agentIdentityId?: string | null;
465
- }): boolean;
@@ -1,38 +0,0 @@
1
- import type { PersonalSyncIdentity } from './session-sync.ts';
2
- export declare const SESSION_TOOL_DETAIL_LIMITS: {
3
- readonly defaultMaxBytes: number;
4
- readonly minMaxBytes: number;
5
- readonly maxMaxBytes: number;
6
- readonly responseTtlMs: number;
7
- readonly relayTimeoutMs: number;
8
- };
9
- export type ToolDetailStatus = 'available' | 'not_found' | 'unsupported' | 'unavailable';
10
- export type ToolDetailUnavailableReason = 'not_found' | 'revision_mismatch' | 'machine_offline' | 'request_timeout' | 'response_too_large' | 'unsupported';
11
- export type ToolDetailSource = 'local-session-store' | 'local-tool-index' | 'native-local-index' | 'unavailable';
12
- export type ToolDetailRef = {
13
- runId?: string;
14
- sourceSeq?: number;
15
- toolIndex?: number;
16
- };
17
- export type SessionToolDetailRequest = PersonalSyncIdentity & {
18
- sessionId: string;
19
- toolCallId: string;
20
- detailRevision: number;
21
- maxBytes?: number;
22
- };
23
- export type SessionToolDetailResponse = PersonalSyncIdentity & {
24
- sessionId: string;
25
- toolCallId: string;
26
- detailRevision: number;
27
- detailStatus: ToolDetailStatus;
28
- status?: 'running' | 'completed' | 'failed';
29
- command?: string;
30
- argsSummary?: unknown;
31
- result?: string;
32
- resultOmitted: boolean;
33
- redacted: boolean;
34
- byteSize: number;
35
- expiresAt: string;
36
- source: ToolDetailSource;
37
- reason?: ToolDetailUnavailableReason;
38
- };
@@ -1,116 +0,0 @@
1
- import type { AgentType, SessionRunPhase } from './session.ts';
2
- export type VoiceChiefConversationBrief = {
3
- conversationId: string;
4
- title: string;
5
- agentType: AgentType;
6
- modelId?: string | null;
7
- status: 'active' | 'completed' | 'failed';
8
- runPhase?: SessionRunPhase | null;
9
- canStop?: boolean;
10
- lastActivityAt: string;
11
- lastMessagePreview?: string | null;
12
- };
13
- export type VoiceChiefProjectBrief = {
14
- projectId: string;
15
- displayName: string;
16
- summary: string;
17
- machineId: string;
18
- machineName: string;
19
- machineStatus: 'online' | 'offline' | 'unknown';
20
- recentProgress: string[];
21
- conversations: VoiceChiefConversationBrief[];
22
- };
23
- export type VoiceChiefReadableMessage = {
24
- id: string;
25
- role: 'user' | 'agent';
26
- ts: number;
27
- text: string;
28
- };
29
- export type VoiceChiefOperationStatus = {
30
- status: 'ok' | 'created' | 'delivered' | 'stopped' | 'scheduled' | 'cancelled' | 'ended' | 'unavailable' | 'failed';
31
- message: string;
32
- projectId?: string;
33
- projectName?: string;
34
- conversationId?: string;
35
- conversationTitle?: string;
36
- };
37
- export type VoiceChiefToolCallDebug = {
38
- callId: string;
39
- name: string;
40
- argumentsJson: string;
41
- createdAt: string;
42
- };
43
- export type VoiceChiefTaskCompletionNotifyMode = 'message' | 'call';
44
- export type VoiceChiefVoiceId = 'longanqian' | 'longanlingxin' | 'longanlingxi' | 'longanxiaoxin' | 'longanlufeng';
45
- export type VoiceChiefVoiceOption = {
46
- id: VoiceChiefVoiceId;
47
- labelKey: string;
48
- default?: boolean;
49
- };
50
- export type VoiceChiefPreferences = {
51
- voice: VoiceChiefVoiceId;
52
- options: VoiceChiefVoiceOption[];
53
- };
54
- export type VoiceChiefClientFrame = {
55
- type: 'start';
56
- projectHint?: string;
57
- voice?: string;
58
- debugTools?: boolean;
59
- incomingCallId?: string;
60
- initialPrompt?: string;
61
- reason?: string;
62
- reconnectAttempt?: number;
63
- timeZone?: string;
64
- } | {
65
- type: 'playback_complete';
66
- responseId: string;
67
- } | {
68
- type: 'ping';
69
- } | {
70
- type: 'end';
71
- };
72
- export type VoiceChiefServerFrame = {
73
- type: 'ready';
74
- conversationId: string;
75
- inputSampleRate: 16_000;
76
- outputSampleRate: 24_000;
77
- projects: VoiceChiefProjectBrief[];
78
- } | {
79
- type: 'status';
80
- state: 'connecting' | 'listening' | 'thinking' | 'speaking' | 'ended';
81
- } | {
82
- type: 'input_transcript';
83
- text: string;
84
- final: boolean;
85
- } | {
86
- type: 'output_transcript';
87
- text: string;
88
- final: boolean;
89
- responseId?: string;
90
- } | {
91
- type: 'audio_start';
92
- responseId: string;
93
- sampleRate: 24_000;
94
- } | {
95
- type: 'audio_done';
96
- responseId: string;
97
- } | {
98
- type: 'audio_cancel';
99
- responseId: string;
100
- } | ({
101
- type: 'operation_status';
102
- } & VoiceChiefOperationStatus) | {
103
- type: 'tool_call';
104
- call: VoiceChiefToolCallDebug;
105
- } | {
106
- type: 'hang_up';
107
- reason?: string;
108
- delayMs?: number;
109
- } | {
110
- type: 'pong';
111
- } | {
112
- type: 'error';
113
- code: string;
114
- message: string;
115
- recoverable: boolean;
116
- };