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,37 +0,0 @@
1
- export type ScheduleRule = {
2
- kind: 'once';
3
- at: number;
4
- } | {
5
- kind: 'interval';
6
- anchor: number;
7
- everyMs: number;
8
- } | {
9
- kind: 'calendar';
10
- hour: number;
11
- minute: number;
12
- weekdays?: number[];
13
- monthDay?: number;
14
- };
15
- export type ConversationSchedule = {
16
- id: string;
17
- sessionId: string;
18
- bindingId?: string;
19
- roomId?: string;
20
- agentIdentityId?: string;
21
- prompt: string;
22
- timeDescription: string;
23
- timezone: string;
24
- rule: ScheduleRule;
25
- state: 'active' | 'paused' | 'ended' | 'deleted';
26
- version: number;
27
- nextDueAt: number | null;
28
- createdAt: number;
29
- updatedAt: number;
30
- last?: {
31
- at: number;
32
- state: 'delivered' | 'skipped' | 'failed' | 'dispatching';
33
- reason?: string;
34
- messageId?: string;
35
- };
36
- };
37
- export type ScheduleAction = 'list' | 'create' | 'update' | 'pause' | 'resume' | 'delete';
@@ -1,406 +0,0 @@
1
- import type { Envelope } from './envelope.ts';
2
- import type { ProjectFsOpaqueCapability } from './project-fs.ts';
3
- import type { AgentType, ManagerConfig, SessionMode } from './session.ts';
4
- export declare const SESSION_SYNC_PROTOCOL_VERSION: 2;
5
- export type SessionSyncProtocolVersion = typeof SESSION_SYNC_PROTOCOL_VERSION;
6
- /**
7
- * Monotonic authority generation for personal Session data. This is shared by
8
- * daemon, Server and App; implementations must not carry a private cache epoch.
9
- */
10
- export declare const SESSION_SYNC_DATA_EPOCH: 2;
11
- export type SessionSyncDataEpoch = typeof SESSION_SYNC_DATA_EPOCH;
12
- export declare const SESSION_SYNC_RELEASE_GATE: {
13
- readonly minCliVersion: "0.3.65";
14
- readonly minAppBuild: {
15
- readonly ios: 51;
16
- readonly android: 12;
17
- };
18
- readonly minDesktopVersion: "0.4.0";
19
- };
20
- export declare const SESSION_SYNC_REQUIRED_CAPABILITIES: readonly ["session_index_v1", "session_body_revision_v1", "session_history_subscription_v1", "local_canonical_v1", "session_title_authority_v1", "session_title_seed_v1", "session_tool_detail_v1", "voice_session_body_relay_v1", "native_source_tombstone_v1", "session_durable_send_v1", "daemon_installation_identity_v1", "session_user_boundary_v1", "session_terminal_outbox_v1", "session_list_preview_v1", "session_attention_v1", "session_data_epoch_v2", "session_structured_rejection_v2", "machine_personal_authority_v2"];
21
- /**
22
- * Additive capabilities are advertised by new daemons but are not part of the
23
- * epoch-wide minimum gate. This lets the App roll out background replication
24
- * while old daemons keep serving the compatible visible-session snapshot path.
25
- */
26
- export declare const SESSION_SYNC_ADDITIVE_CAPABILITIES: readonly ["session_body_replica_v1", "session_body_replica_stream_v1", "active_run_recovery_v1", "external_updater_v1", "room_message_delivery_v1"];
27
- export declare const SESSION_SYNC_ADVERTISED_CAPABILITIES: readonly ["session_index_v1", "session_body_revision_v1", "session_history_subscription_v1", "local_canonical_v1", "session_title_authority_v1", "session_title_seed_v1", "session_tool_detail_v1", "voice_session_body_relay_v1", "native_source_tombstone_v1", "session_durable_send_v1", "daemon_installation_identity_v1", "session_user_boundary_v1", "session_terminal_outbox_v1", "session_list_preview_v1", "session_attention_v1", "session_data_epoch_v2", "session_structured_rejection_v2", "machine_personal_authority_v2", "session_body_replica_v1", "session_body_replica_stream_v1", "active_run_recovery_v1", "external_updater_v1", "room_message_delivery_v1"];
28
- export declare const SESSION_SYNC_EVENT_NAMES: readonly ["session.index.updated", "session.body.delta", "session.body.replica.delta", "session.body.replica.error"];
29
- export declare const SESSION_HISTORY_LIMITS: {
30
- readonly defaultSnapshotMessages: 100;
31
- readonly maxSnapshotMessages: 500;
32
- readonly defaultPageMessages: 100;
33
- readonly maxPageMessages: 500;
34
- readonly maxDeltaMutations: 200;
35
- readonly maxMutationBytes: number;
36
- readonly maxReplicaPageBytes: number;
37
- readonly maxSubscriptionsPerClient: 4;
38
- readonly maxSubscriptionsPerSession: 8;
39
- readonly maxReplicaStreamsPerDaemon: 8;
40
- };
41
- /**
42
- * Known capabilities accepted by the handshake projection. A capability can be
43
- * known before a daemon is allowed to advertise it; advertisement must follow
44
- * the implementation-specific rollout gate.
45
- */
46
- export type SessionSyncCapability = (typeof SESSION_SYNC_ADVERTISED_CAPABILITIES)[number] | ProjectFsOpaqueCapability;
47
- export type SessionSyncEventName = (typeof SESSION_SYNC_EVENT_NAMES)[number];
48
- export type SessionBodyStorageMode = 'machine_local';
49
- export type NativeCleanupPolicy = 'none' | 'auto';
50
- export type PersonalSyncIdentity = {
51
- protocolVersion: SessionSyncProtocolVersion;
52
- dataEpoch: SessionSyncDataEpoch;
53
- daemonInstallationId: string;
54
- };
55
- export type SessionTitleSource = 'shennian_manual' | 'agent_native' | 'shennian_generated' | 'first_user_fallback';
56
- export declare const SESSION_TITLE_SOURCE_PRIORITY: Readonly<Record<SessionTitleSource, number>>;
57
- export declare function isSessionTitleSource(value: unknown): value is SessionTitleSource;
58
- export type SessionTitleSetParams = PersonalSyncIdentity & {
59
- sessionId: string;
60
- agentType: AgentType;
61
- agentSessionId: string | null;
62
- workDir: string;
63
- title: string;
64
- titleSource: 'shennian_manual';
65
- titleRevision: number;
66
- titleOriginEventId: string;
67
- };
68
- export type SessionTitleGenerationEligibility = 'agent_native_unavailable' | 'terminal' | 'grace_elapsed';
69
- /**
70
- * Ephemeral daemon -> Server request. titleSeed must never be persisted or
71
- * placed in an at-least-once event buffer by either side.
72
- */
73
- export type SessionTitleGenerateParams = PersonalSyncIdentity & {
74
- sessionId: string;
75
- requestId: string;
76
- titleSeed: string;
77
- baseTitleRevision: number;
78
- eligibility: SessionTitleGenerationEligibility;
79
- };
80
- export type SessionTitleGenerateResponse = {
81
- generated: true;
82
- title: string;
83
- titleSource: 'shennian_generated';
84
- titleRevision: number;
85
- titleOriginEventId: string;
86
- } | {
87
- generated: false;
88
- reason: 'not_eligible' | 'superseded' | 'generator_unavailable' | 'generation_failed';
89
- };
90
- export type SessionSyncErrorCode = 'upgrade_required' | 'epoch_mismatch' | 'session_deleted' | 'ownership_transferred' | 'token_revoked' | 'room_authority_conflict' | 'invalid_payload' | 'invalid_identity' | 'revision_gap' | 'snapshot_compacted' | 'machine_offline' | 'history_unavailable' | 'subscription_not_found' | 'subscription_limit_exceeded' | 'response_too_large' | 'temporary_unavailable';
91
- export declare const SESSION_SYNC_REQUIRED_ACTIONS: readonly ["retry", "reset_epoch", "purge_session", "quarantine_record", "refresh_machine_ownership", "upgrade_client", "stop"];
92
- export type SessionSyncRequiredAction = (typeof SESSION_SYNC_REQUIRED_ACTIONS)[number];
93
- export type SessionSyncRejection = {
94
- code: SessionSyncErrorCode;
95
- retryable: boolean;
96
- requiredAction: SessionSyncRequiredAction;
97
- authoritativeEpoch?: SessionSyncDataEpoch;
98
- authoritativeRevision?: number;
99
- message?: string;
100
- };
101
- /** Privacy-safe regression cases shared by the cross-client hard-cut tests. */
102
- export declare const PERSONAL_SYNC_FAILURE_FIXTURES: readonly [{
103
- readonly id: "legacy_index_replay_after_server_reset";
104
- readonly ingress: "session.index.updated";
105
- readonly condition: "stale_data_epoch";
106
- readonly expectedCode: "epoch_mismatch";
107
- readonly expectedAction: "reset_epoch";
108
- }, {
109
- readonly id: "personal_index_targets_room_session";
110
- readonly ingress: "session.index.updated";
111
- readonly condition: "room_binding_exists";
112
- readonly expectedCode: "room_authority_conflict";
113
- readonly expectedAction: "quarantine_record";
114
- }, {
115
- readonly id: "history_response_not_durably_applied";
116
- readonly ingress: "session.history.open";
117
- readonly condition: "network_success_cache_revision_zero";
118
- readonly expectedCode: "revision_gap";
119
- readonly expectedAction: "stop";
120
- }, {
121
- readonly id: "native_path_move_replays_attention";
122
- readonly ingress: "session.index.updated";
123
- readonly condition: "same_source_event_identity";
124
- readonly expectedCode: "invalid_payload";
125
- readonly expectedAction: "quarantine_record";
126
- }];
127
- export type SessionSyncError = {
128
- code: SessionSyncErrorCode;
129
- message?: string;
130
- requiredProtocolVersion?: SessionSyncProtocolVersion;
131
- requiredCapabilities?: SessionSyncCapability[];
132
- expectedRevision?: number;
133
- actualRevision?: number;
134
- retryable: boolean;
135
- requiredAction: SessionSyncRequiredAction;
136
- authoritativeEpoch?: SessionSyncDataEpoch;
137
- authoritativeRevision?: number;
138
- };
139
- export type PersonalAttachmentReference = {
140
- path: string;
141
- name: string;
142
- mimeType: string;
143
- kind: 'file' | 'image' | 'folder';
144
- byteSize: number;
145
- sha256: string;
146
- };
147
- export type SessionDeliveryState = 'queued' | 'committed' | 'executing' | 'completed' | 'failed' | 'cancelled';
148
- export type SessionDurableSendAck<TState extends SessionDeliveryState = SessionDeliveryState> = PersonalSyncIdentity & {
149
- sessionId: string;
150
- clientMessageId: string;
151
- messageId: string;
152
- deliveryState: TState;
153
- bodyRevision: number;
154
- committedAt: string;
155
- };
156
- export type SessionMessageStatusParams = PersonalSyncIdentity & {
157
- sessionId: string;
158
- clientMessageId: string;
159
- };
160
- export type SessionMessageStatusResponse = (PersonalSyncIdentity & {
161
- state: 'not_found';
162
- sessionId: string;
163
- clientMessageId: string;
164
- }) | {
165
- [TState in SessionDeliveryState]: {
166
- state: TState;
167
- } & SessionDurableSendAck<TState>;
168
- }[SessionDeliveryState];
169
- export declare function getMissingSessionSyncCapabilities(capabilities: readonly string[] | null | undefined): SessionSyncCapability[];
170
- export declare function hasRequiredSessionSyncCapabilities(capabilities: readonly string[] | null | undefined): capabilities is readonly SessionSyncCapability[];
171
- export type SessionHistoryOpenParams = PersonalSyncIdentity & {
172
- sessionId: string;
173
- subscriptionId: string;
174
- cachedBodyRevision?: number;
175
- limit?: number;
176
- beforeSequence?: number;
177
- };
178
- export type SessionHistorySyncParams = PersonalSyncIdentity & {
179
- sessionId: string;
180
- syncId: string;
181
- afterRevision: number;
182
- limit?: number;
183
- };
184
- export type SessionHistoryMessage = {
185
- sequence: number;
186
- revision: number;
187
- message: Envelope;
188
- deliveryState?: SessionDeliveryState;
189
- };
190
- export type SessionHistorySnapshot = PersonalSyncIdentity & {
191
- sessionId: string;
192
- subscriptionId: string;
193
- storageMode: SessionBodyStorageMode;
194
- snapshotRevision: number;
195
- firstAvailableSeq: number | null;
196
- lastAvailableSeq: number | null;
197
- hasOlder: boolean;
198
- messages: SessionHistoryMessage[];
199
- };
200
- export type SessionHistoryPageParams = PersonalSyncIdentity & {
201
- sessionId: string;
202
- subscriptionId: string;
203
- beforeSequence: number;
204
- limit?: number;
205
- };
206
- export type SessionHistoryPage = PersonalSyncIdentity & {
207
- sessionId: string;
208
- subscriptionId: string;
209
- snapshotRevision: number;
210
- firstAvailableSeq: number | null;
211
- hasOlder: boolean;
212
- messages: SessionHistoryMessage[];
213
- };
214
- export type VoiceSessionBodyWindowParams = PersonalSyncIdentity & {
215
- sessionId: string;
216
- callId: string;
217
- bodyRevision?: number;
218
- limit?: number;
219
- maxBytes?: number;
220
- };
221
- export type VoiceSessionBodyWindow = PersonalSyncIdentity & {
222
- sessionId: string;
223
- callId: string;
224
- bodyRevision: number;
225
- messages: Envelope[];
226
- truncated: boolean;
227
- };
228
- export type SessionHistoryCloseParams = PersonalSyncIdentity & {
229
- sessionId: string;
230
- subscriptionId: string;
231
- };
232
- export type SessionHistoryCloseResponse = PersonalSyncIdentity & {
233
- sessionId: string;
234
- subscriptionId: string;
235
- closed: true;
236
- };
237
- export type SessionBodyMutation = PersonalSyncIdentity & {
238
- sessionId: string;
239
- subscriptionId: string;
240
- revision: number;
241
- mutation: 'append' | 'upsert' | 'tombstone';
242
- messageId: string;
243
- sequence: number;
244
- message?: Envelope;
245
- deliveryState?: SessionDeliveryState;
246
- };
247
- export type SessionBodyDeltaEvent = PersonalSyncIdentity & {
248
- sessionId: string;
249
- subscriptionId: string;
250
- fromRevision: number;
251
- toRevision: number;
252
- mutations: SessionBodyMutation[];
253
- };
254
- /**
255
- * One-shot, resumable body replication page. Unlike history.open this does not
256
- * create a live subscription. Mutations remain contiguous from fromRevision;
257
- * targetRevision is the daemon high-water captured for this page.
258
- */
259
- export type SessionHistorySyncPage = PersonalSyncIdentity & {
260
- sessionId: string;
261
- syncId: string;
262
- fromRevision: number;
263
- toRevision: number;
264
- targetRevision: number;
265
- hasMore: boolean;
266
- mutations: SessionBodyMutation[];
267
- };
268
- /**
269
- * One foreground App installation owns at most one body replica stream for a
270
- * daemon generation. The daemon registers the stream before capturing these
271
- * high-water marks, so mutations committed during subscribe cannot be lost.
272
- */
273
- export type SessionBodyReplicaSubscribeParams = PersonalSyncIdentity & {
274
- appInstallationId: string;
275
- streamId: string;
276
- generation: number;
277
- };
278
- export type SessionBodyReplicaHighWater = {
279
- sessionId: string;
280
- bodyRevision: number;
281
- };
282
- export type SessionBodyReplicaSubscribeResponse = PersonalSyncIdentity & {
283
- appInstallationId: string;
284
- streamId: string;
285
- generation: number;
286
- highWatermarks: SessionBodyReplicaHighWater[];
287
- };
288
- export type SessionBodyReplicaUnsubscribeParams = PersonalSyncIdentity & {
289
- appInstallationId: string;
290
- streamId: string;
291
- generation: number;
292
- };
293
- export type SessionBodyReplicaUnsubscribeResponse = PersonalSyncIdentity & {
294
- appInstallationId: string;
295
- streamId: string;
296
- generation: number;
297
- closed: true;
298
- };
299
- export type SessionBodyReplicaDeltaBatch = {
300
- sessionId: string;
301
- fromRevision: number;
302
- toRevision: number;
303
- mutations: SessionBodyMutation[];
304
- };
305
- export type SessionBodyReplicaDeltaEvent = PersonalSyncIdentity & {
306
- appInstallationId: string;
307
- streamId: string;
308
- generation: number;
309
- batches: SessionBodyReplicaDeltaBatch[];
310
- };
311
- export type SessionBodyReplicaErrorEvent = {
312
- streamId: string;
313
- generation?: number;
314
- appInstallationId?: string;
315
- rejection: SessionSyncRejection;
316
- };
317
- /**
318
- * Machine-authored personal-session projection. Ownership, machine display
319
- * fields and viewer permissions are server authority and therefore never
320
- * accepted from a daemon payload.
321
- */
322
- export type DaemonSessionIndexProjection = {
323
- nativeSessionVisibility?: 'user' | 'internal';
324
- id: string;
325
- agentType: AgentType;
326
- sessionMode?: SessionMode;
327
- managerConfig?: ManagerConfig | null;
328
- agentSessionId: string | null;
329
- modelId: string | null;
330
- managerDefaultWorkerAgentType?: AgentType | null;
331
- managerDefaultWorkerModelId?: string | null;
332
- title: string;
333
- titleSource: SessionTitleSource;
334
- titleRevision: number;
335
- titleLockedByUser: boolean;
336
- titleOriginEventId: string | null;
337
- status: 'active' | 'completed' | 'failed';
338
- workDir: string;
339
- lastMessagePreview: string | null;
340
- /** Stable identity and canonical timestamp of lastMessagePreview. */
341
- lastMessagePreviewMessageId: string | null;
342
- lastMessagePreviewAt: string | null;
343
- /** Latest canonical user-visible text or tool event; optional for older daemons. */
344
- lastVisibleEventAt?: string | null;
345
- bodyStorageMode: SessionBodyStorageMode;
346
- /**
347
- * Set only after the daemon has durably committed the first canonical user
348
- * message. A pre-user agent/tool projection is never publishable.
349
- */
350
- localReady: true;
351
- firstUserBoundary: {
352
- role: 'user';
353
- messageId: string;
354
- bodyRevision: number;
355
- };
356
- bodyRevision: number;
357
- indexRevision: number;
358
- firstAvailableSeq: number | null;
359
- visibleMessageCount: number;
360
- lastVisibleMessageId: string | null;
361
- /** User-attention results, independent from canonical body/message cardinality. */
362
- attentionCount: number;
363
- lastAttentionId: string | null;
364
- lastBodyCommittedAt: string | null;
365
- deletionRevision: number;
366
- lastActivityAt: string;
367
- createdAt: string;
368
- updatedAt: string;
369
- deletedAt: string | null;
370
- };
371
- export type SessionIndexUpdate = PersonalSyncIdentity & {
372
- session: DaemonSessionIndexProjection;
373
- };
374
- export type NativeSourceDeletionRef = {
375
- agentType: AgentType;
376
- sourceSessionKey: string;
377
- };
378
- /**
379
- * Durable Server tombstone command. The daemon must persist every source
380
- * barrier before deleting any derived local state or acknowledging revision.
381
- */
382
- export type SessionDeletionCommand = {
383
- sessionId: string;
384
- deletionRevision: number;
385
- deletedAt: string;
386
- /** Origin working directory; required by project-scoped lifecycle tools such as Gemini. */
387
- workDir?: string;
388
- nativeCleanupPolicy: NativeCleanupPolicy;
389
- sources: NativeSourceDeletionRef[];
390
- };
391
- export type SessionDeletionsSyncParams = PersonalSyncIdentity & {
392
- afterRevision: number;
393
- };
394
- export type SessionDeletionsSyncResponse = PersonalSyncIdentity & {
395
- /** Highest pruned revision the daemon may durably baseline before applying returned commands. */
396
- baselineRevision: number;
397
- latestRevision: number;
398
- deletions: SessionDeletionCommand[];
399
- };
400
- export type SessionDeletionsAckParams = PersonalSyncIdentity & {
401
- deletionRevision: number;
402
- };
403
- export type SessionDeletionsAckResponse = PersonalSyncIdentity & {
404
- deletionRevision: number;
405
- acknowledged: true;
406
- };