@maiaos/protocol 0.1.0-canary.8 → 0.1.0-canary.81

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 (922) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +15 -6
  3. package/dist/agent/definition.d.ts +3 -3
  4. package/dist/agent/definition.d.ts.map +1 -1
  5. package/dist/agent/definition.js +1 -1
  6. package/dist/agent/definition.js.map +1 -1
  7. package/dist/agent/effect-schema.d.ts +2 -0
  8. package/dist/agent/effect-schema.d.ts.map +1 -1
  9. package/dist/agent/effect-schema.js +3 -0
  10. package/dist/agent/effect-schema.js.map +1 -1
  11. package/dist/agent/index.d.ts +1 -1
  12. package/dist/agent/index.d.ts.map +1 -1
  13. package/dist/agent/index.js +1 -1
  14. package/dist/agent/index.js.map +1 -1
  15. package/dist/agent/worker-operation.d.ts +42 -1
  16. package/dist/agent/worker-operation.d.ts.map +1 -1
  17. package/dist/agents/contract.d.ts +27 -0
  18. package/dist/agents/contract.d.ts.map +1 -1
  19. package/dist/agents/contract.js +4 -1
  20. package/dist/agents/contract.js.map +1 -1
  21. package/dist/agents/effect-schema.d.ts +53 -2
  22. package/dist/agents/effect-schema.d.ts.map +1 -1
  23. package/dist/agents/effect-schema.js +51 -10
  24. package/dist/agents/effect-schema.js.map +1 -1
  25. package/dist/agents/feature.d.ts +54 -4
  26. package/dist/agents/feature.d.ts.map +1 -1
  27. package/dist/agents/feature.js +52 -4
  28. package/dist/agents/feature.js.map +1 -1
  29. package/dist/agents/index.d.ts +1 -1
  30. package/dist/agents/index.d.ts.map +1 -1
  31. package/dist/agents/index.js +1 -1
  32. package/dist/agents/index.js.map +1 -1
  33. package/dist/approval/contract.d.ts +21 -5
  34. package/dist/approval/contract.d.ts.map +1 -1
  35. package/dist/approval/contract.js +2 -1
  36. package/dist/approval/contract.js.map +1 -1
  37. package/dist/approval/effect-schema.d.ts +1 -1
  38. package/dist/approval/effect-schema.d.ts.map +1 -1
  39. package/dist/approval/effect-schema.js +1 -1
  40. package/dist/approval/effect-schema.js.map +1 -1
  41. package/dist/approval/feature.d.ts +21 -2
  42. package/dist/approval/feature.d.ts.map +1 -1
  43. package/dist/approval/feature.js +21 -2
  44. package/dist/approval/feature.js.map +1 -1
  45. package/dist/approval/index.d.ts +1 -1
  46. package/dist/approval/index.d.ts.map +1 -1
  47. package/dist/approval/index.js +1 -1
  48. package/dist/approval/index.js.map +1 -1
  49. package/dist/approval/request-effect-schema.d.ts +40 -5
  50. package/dist/approval/request-effect-schema.d.ts.map +1 -1
  51. package/dist/approval/request-effect-schema.js +30 -7
  52. package/dist/approval/request-effect-schema.js.map +1 -1
  53. package/dist/approval/result-effect-schema.d.ts +14 -6
  54. package/dist/approval/result-effect-schema.d.ts.map +1 -1
  55. package/dist/board/contract.d.ts +1668 -0
  56. package/dist/board/contract.d.ts.map +1 -0
  57. package/dist/board/contract.js +108 -0
  58. package/dist/board/contract.js.map +1 -0
  59. package/dist/board/effect-schema.d.ts +6 -0
  60. package/dist/board/effect-schema.d.ts.map +1 -0
  61. package/dist/board/effect-schema.js +6 -0
  62. package/dist/board/effect-schema.js.map +1 -0
  63. package/dist/board/feature.d.ts +565 -0
  64. package/dist/board/feature.d.ts.map +1 -0
  65. package/dist/board/feature.js +535 -0
  66. package/dist/board/feature.js.map +1 -0
  67. package/dist/board/index.d.ts +3 -0
  68. package/dist/board/index.d.ts.map +1 -0
  69. package/dist/board/index.js +3 -0
  70. package/dist/board/index.js.map +1 -0
  71. package/dist/board/manage-effect-schema.d.ts +493 -0
  72. package/dist/board/manage-effect-schema.d.ts.map +1 -0
  73. package/dist/board/manage-effect-schema.js +73 -0
  74. package/dist/board/manage-effect-schema.js.map +1 -0
  75. package/dist/board/model-effect-schema.d.ts +111 -0
  76. package/dist/board/model-effect-schema.d.ts.map +1 -0
  77. package/dist/board/model-effect-schema.js +120 -0
  78. package/dist/board/model-effect-schema.js.map +1 -0
  79. package/dist/board/plan-effect-schema.d.ts +120 -0
  80. package/dist/board/plan-effect-schema.d.ts.map +1 -0
  81. package/dist/board/plan-effect-schema.js +108 -0
  82. package/dist/board/plan-effect-schema.js.map +1 -0
  83. package/dist/board/task-effect-schema.d.ts +1835 -0
  84. package/dist/board/task-effect-schema.d.ts.map +1 -0
  85. package/dist/board/task-effect-schema.js +275 -0
  86. package/dist/board/task-effect-schema.js.map +1 -0
  87. package/dist/board/thread-effect-schema.d.ts +633 -0
  88. package/dist/board/thread-effect-schema.d.ts.map +1 -0
  89. package/dist/board/thread-effect-schema.js +116 -0
  90. package/dist/board/thread-effect-schema.js.map +1 -0
  91. package/dist/command-receipt/contract.d.ts +3 -0
  92. package/dist/command-receipt/contract.d.ts.map +1 -1
  93. package/dist/command-receipt/effect-schema.d.ts +12 -0
  94. package/dist/command-receipt/effect-schema.d.ts.map +1 -1
  95. package/dist/command-receipt/effect-schema.js +7 -0
  96. package/dist/command-receipt/effect-schema.js.map +1 -1
  97. package/dist/command-receipt/feature.d.ts +10 -0
  98. package/dist/command-receipt/feature.d.ts.map +1 -1
  99. package/dist/command-receipt/feature.js +10 -0
  100. package/dist/command-receipt/feature.js.map +1 -1
  101. package/dist/connection/access-effect-schema.d.ts +4 -0
  102. package/dist/connection/access-effect-schema.d.ts.map +1 -1
  103. package/dist/connection/contract.d.ts +203 -2
  104. package/dist/connection/contract.d.ts.map +1 -1
  105. package/dist/connection/contract.js +7 -0
  106. package/dist/connection/contract.js.map +1 -1
  107. package/dist/connection/effect-schema.d.ts +194 -2
  108. package/dist/connection/effect-schema.d.ts.map +1 -1
  109. package/dist/connection/effect-schema.js +3 -0
  110. package/dist/connection/effect-schema.js.map +1 -1
  111. package/dist/connection/executors-effect-schema.d.ts +275 -0
  112. package/dist/connection/executors-effect-schema.d.ts.map +1 -0
  113. package/dist/connection/executors-effect-schema.js +80 -0
  114. package/dist/connection/executors-effect-schema.js.map +1 -0
  115. package/dist/connection/feature.d.ts +301 -10
  116. package/dist/connection/feature.d.ts.map +1 -1
  117. package/dist/connection/feature.js +381 -46
  118. package/dist/connection/feature.js.map +1 -1
  119. package/dist/connection/gateway-effect-schema.d.ts +7 -0
  120. package/dist/connection/gateway-effect-schema.d.ts.map +1 -1
  121. package/dist/connection/gateway-effect-schema.js +7 -0
  122. package/dist/connection/gateway-effect-schema.js.map +1 -1
  123. package/dist/connection/index.d.ts +1 -1
  124. package/dist/connection/index.d.ts.map +1 -1
  125. package/dist/connection/index.js +1 -1
  126. package/dist/connection/index.js.map +1 -1
  127. package/dist/connection/request-effect-schema.d.ts +23 -4
  128. package/dist/connection/request-effect-schema.d.ts.map +1 -1
  129. package/dist/connection/request-effect-schema.js +42 -14
  130. package/dist/connection/request-effect-schema.js.map +1 -1
  131. package/dist/connection/result-effect-schema.d.ts +98 -6
  132. package/dist/connection/result-effect-schema.d.ts.map +1 -1
  133. package/dist/connection/result-effect-schema.js +4 -3
  134. package/dist/connection/result-effect-schema.js.map +1 -1
  135. package/dist/connection/system-effect-schema.d.ts +16 -0
  136. package/dist/connection/system-effect-schema.d.ts.map +1 -1
  137. package/dist/connection/system-effect-schema.js +5 -5
  138. package/dist/connection/system-effect-schema.js.map +1 -1
  139. package/dist/container/contract.d.ts +2 -0
  140. package/dist/container/contract.d.ts.map +1 -1
  141. package/dist/container/effect-schema.d.ts +4 -0
  142. package/dist/container/effect-schema.d.ts.map +1 -1
  143. package/dist/container/portfolio-feature.d.ts +286 -0
  144. package/dist/container/portfolio-feature.d.ts.map +1 -1
  145. package/dist/container/portfolio-feature.js +131 -0
  146. package/dist/container/portfolio-feature.js.map +1 -1
  147. package/dist/coordinator-tool/index.d.ts +1 -1
  148. package/dist/coordinator-tool/index.d.ts.map +1 -1
  149. package/dist/coordinator-tool/index.js +1 -1
  150. package/dist/coordinator-tool/index.js.map +1 -1
  151. package/dist/coordinator-tool/input-schema.d.ts +0 -7
  152. package/dist/coordinator-tool/input-schema.d.ts.map +1 -1
  153. package/dist/coordinator-tool/input-schema.js +0 -38
  154. package/dist/coordinator-tool/input-schema.js.map +1 -1
  155. package/dist/coordinator-tool/registry.d.ts +21 -0
  156. package/dist/coordinator-tool/registry.d.ts.map +1 -1
  157. package/dist/coordinator-tool/registry.js +175 -4
  158. package/dist/coordinator-tool/registry.js.map +1 -1
  159. package/dist/discovery/contract.d.ts +140 -2
  160. package/dist/discovery/contract.d.ts.map +1 -1
  161. package/dist/discovery/contract.js +11 -1
  162. package/dist/discovery/contract.js.map +1 -1
  163. package/dist/discovery/effect-schema.d.ts +323 -6
  164. package/dist/discovery/effect-schema.d.ts.map +1 -1
  165. package/dist/discovery/effect-schema.js +157 -8
  166. package/dist/discovery/effect-schema.js.map +1 -1
  167. package/dist/discovery/feature.d.ts +82 -2
  168. package/dist/discovery/feature.d.ts.map +1 -1
  169. package/dist/discovery/feature.js +78 -2
  170. package/dist/discovery/feature.js.map +1 -1
  171. package/dist/discovery/index.d.ts +1 -1
  172. package/dist/discovery/index.d.ts.map +1 -1
  173. package/dist/discovery/index.js +1 -1
  174. package/dist/discovery/index.js.map +1 -1
  175. package/dist/envelope/effect-schema.d.ts +38 -17
  176. package/dist/envelope/effect-schema.d.ts.map +1 -1
  177. package/dist/envelope/effect-schema.js +30 -8
  178. package/dist/envelope/effect-schema.js.map +1 -1
  179. package/dist/envelope/envelope.d.ts +25 -3
  180. package/dist/envelope/envelope.d.ts.map +1 -1
  181. package/dist/envelope/envelope.js +37 -1
  182. package/dist/envelope/envelope.js.map +1 -1
  183. package/dist/envelope/index.d.ts +2 -2
  184. package/dist/envelope/index.d.ts.map +1 -1
  185. package/dist/envelope/index.js +2 -2
  186. package/dist/envelope/index.js.map +1 -1
  187. package/dist/envelope/policy.d.ts +11 -0
  188. package/dist/envelope/policy.d.ts.map +1 -1
  189. package/dist/envelope/policy.js +13 -0
  190. package/dist/envelope/policy.js.map +1 -1
  191. package/dist/event/contract.d.ts +47 -0
  192. package/dist/event/contract.d.ts.map +1 -1
  193. package/dist/event/contract.js +3 -0
  194. package/dist/event/contract.js.map +1 -1
  195. package/dist/event/effect-schema.d.ts +3 -1
  196. package/dist/event/effect-schema.d.ts.map +1 -1
  197. package/dist/event/effect-schema.js +3 -1
  198. package/dist/event/effect-schema.js.map +1 -1
  199. package/dist/event/envelope-effect-schema.d.ts +2 -0
  200. package/dist/event/envelope-effect-schema.d.ts.map +1 -1
  201. package/dist/event/envelope-effect-schema.js +2 -0
  202. package/dist/event/envelope-effect-schema.js.map +1 -1
  203. package/dist/event/feature.d.ts +35 -0
  204. package/dist/event/feature.d.ts.map +1 -0
  205. package/dist/event/feature.js +39 -0
  206. package/dist/event/feature.js.map +1 -0
  207. package/dist/event/format.d.ts +6 -0
  208. package/dist/event/format.d.ts.map +1 -1
  209. package/dist/event/format.js +6 -0
  210. package/dist/event/format.js.map +1 -1
  211. package/dist/event/index.d.ts +4 -1
  212. package/dist/event/index.d.ts.map +1 -1
  213. package/dist/event/index.js +4 -1
  214. package/dist/event/index.js.map +1 -1
  215. package/dist/event/lifecycle/effect-schema.d.ts +31 -0
  216. package/dist/event/lifecycle/effect-schema.d.ts.map +1 -0
  217. package/dist/event/lifecycle/effect-schema.js +36 -0
  218. package/dist/event/lifecycle/effect-schema.js.map +1 -0
  219. package/dist/event/lifecycle/index.d.ts +2 -0
  220. package/dist/event/lifecycle/index.d.ts.map +1 -0
  221. package/dist/event/lifecycle/index.js +2 -0
  222. package/dist/event/lifecycle/index.js.map +1 -0
  223. package/dist/event/lifecycle/schema.d.ts +20 -0
  224. package/dist/event/lifecycle/schema.d.ts.map +1 -0
  225. package/dist/event/lifecycle/schema.js +7 -0
  226. package/dist/event/lifecycle/schema.js.map +1 -0
  227. package/dist/event/read-effect-schema.d.ts +105 -0
  228. package/dist/event/read-effect-schema.d.ts.map +1 -0
  229. package/dist/event/read-effect-schema.js +64 -0
  230. package/dist/event/read-effect-schema.js.map +1 -0
  231. package/dist/event/registry.d.ts +5 -0
  232. package/dist/event/registry.d.ts.map +1 -1
  233. package/dist/event/registry.js +288 -8
  234. package/dist/event/registry.js.map +1 -1
  235. package/dist/event/session-activity-effect-schema.d.ts +36 -0
  236. package/dist/event/session-activity-effect-schema.d.ts.map +1 -0
  237. package/dist/event/session-activity-effect-schema.js +58 -0
  238. package/dist/event/session-activity-effect-schema.js.map +1 -0
  239. package/dist/event/session-activity.d.ts +30 -0
  240. package/dist/event/session-activity.d.ts.map +1 -0
  241. package/dist/event/session-activity.js +19 -0
  242. package/dist/event/session-activity.js.map +1 -0
  243. package/dist/event/update-effect-schema.d.ts +20 -0
  244. package/dist/event/update-effect-schema.d.ts.map +1 -0
  245. package/dist/event/update-effect-schema.js +29 -0
  246. package/dist/event/update-effect-schema.js.map +1 -0
  247. package/dist/event/update.d.ts +16 -0
  248. package/dist/event/update.d.ts.map +1 -0
  249. package/dist/event/update.js +6 -0
  250. package/dist/event/update.js.map +1 -0
  251. package/dist/event/waiting/effect-schema.d.ts +42 -0
  252. package/dist/event/waiting/effect-schema.d.ts.map +1 -0
  253. package/dist/event/waiting/effect-schema.js +51 -0
  254. package/dist/event/waiting/effect-schema.js.map +1 -0
  255. package/dist/event/waiting/index.d.ts +2 -0
  256. package/dist/event/waiting/index.d.ts.map +1 -0
  257. package/dist/event/waiting/index.js +2 -0
  258. package/dist/event/waiting/index.js.map +1 -0
  259. package/dist/event/waiting/schema.d.ts +23 -0
  260. package/dist/event/waiting/schema.d.ts.map +1 -0
  261. package/dist/event/waiting/schema.js +6 -0
  262. package/dist/event/waiting/schema.js.map +1 -0
  263. package/dist/event-stream/contract.d.ts +121 -0
  264. package/dist/event-stream/contract.d.ts.map +1 -0
  265. package/dist/event-stream/contract.js +5 -0
  266. package/dist/event-stream/contract.js.map +1 -0
  267. package/dist/event-stream/effect-schema.d.ts +118 -0
  268. package/dist/event-stream/effect-schema.d.ts.map +1 -0
  269. package/dist/event-stream/effect-schema.js +90 -0
  270. package/dist/event-stream/effect-schema.js.map +1 -0
  271. package/dist/event-stream/index.d.ts +2 -0
  272. package/dist/event-stream/index.d.ts.map +1 -0
  273. package/dist/event-stream/index.js +2 -0
  274. package/dist/event-stream/index.js.map +1 -0
  275. package/dist/execution/contract.d.ts +1 -0
  276. package/dist/execution/contract.d.ts.map +1 -1
  277. package/dist/execution/effect-schema.d.ts +6 -0
  278. package/dist/execution/effect-schema.d.ts.map +1 -1
  279. package/dist/execution/feature.d.ts +575 -0
  280. package/dist/execution/feature.d.ts.map +1 -0
  281. package/dist/execution/feature.js +543 -0
  282. package/dist/execution/feature.js.map +1 -0
  283. package/dist/execution/file-operation-contract.d.ts +1 -0
  284. package/dist/execution/file-operation-contract.d.ts.map +1 -1
  285. package/dist/execution/file-operation-effect-schema.d.ts +1 -0
  286. package/dist/execution/file-operation-effect-schema.d.ts.map +1 -1
  287. package/dist/execution/index.d.ts +1 -0
  288. package/dist/execution/index.d.ts.map +1 -1
  289. package/dist/execution/index.js +1 -0
  290. package/dist/execution/index.js.map +1 -1
  291. package/dist/execution/operation-contract.d.ts +1 -0
  292. package/dist/execution/operation-contract.d.ts.map +1 -1
  293. package/dist/execution/operation-effect-schema.d.ts +1 -0
  294. package/dist/execution/operation-effect-schema.d.ts.map +1 -1
  295. package/dist/execution/placement/contract.d.ts +4 -0
  296. package/dist/execution/placement/contract.d.ts.map +1 -1
  297. package/dist/execution/placement/effect-schema.d.ts +4 -0
  298. package/dist/execution/placement/effect-schema.d.ts.map +1 -1
  299. package/dist/execution/relocation/contract.d.ts +2 -0
  300. package/dist/execution/relocation/contract.d.ts.map +1 -1
  301. package/dist/execution/relocation/effect-schema.d.ts +4 -0
  302. package/dist/execution/relocation/effect-schema.d.ts.map +1 -1
  303. package/dist/execution/worktree/contract.d.ts +12 -0
  304. package/dist/execution/worktree/contract.d.ts.map +1 -1
  305. package/dist/execution/worktree/effect-schema.d.ts +20 -0
  306. package/dist/execution/worktree/effect-schema.d.ts.map +1 -1
  307. package/dist/execution/worktree/effect-schema.js +11 -0
  308. package/dist/execution/worktree/effect-schema.js.map +1 -1
  309. package/dist/executor/index.d.ts +2 -0
  310. package/dist/executor/index.d.ts.map +1 -0
  311. package/dist/executor/index.js +2 -0
  312. package/dist/executor/index.js.map +1 -0
  313. package/dist/executor/policy.d.ts +28 -0
  314. package/dist/executor/policy.d.ts.map +1 -0
  315. package/dist/executor/policy.js +49 -0
  316. package/dist/executor/policy.js.map +1 -0
  317. package/dist/feature/descriptor/descriptor.d.ts +42 -2
  318. package/dist/feature/descriptor/descriptor.d.ts.map +1 -1
  319. package/dist/feature/descriptor/descriptor.js.map +1 -1
  320. package/dist/feature/descriptor/index.d.ts +1 -1
  321. package/dist/feature/descriptor/index.d.ts.map +1 -1
  322. package/dist/feature/descriptor/index.js.map +1 -1
  323. package/dist/feature/index.d.ts +1 -1
  324. package/dist/feature/index.d.ts.map +1 -1
  325. package/dist/feature/index.js +1 -1
  326. package/dist/feature/index.js.map +1 -1
  327. package/dist/feature/node-status.d.ts +65 -1
  328. package/dist/feature/node-status.d.ts.map +1 -1
  329. package/dist/feature/node-status.js +59 -1
  330. package/dist/feature/node-status.js.map +1 -1
  331. package/dist/feature/registry.d.ts +59 -4
  332. package/dist/feature/registry.d.ts.map +1 -1
  333. package/dist/feature/registry.js +53 -0
  334. package/dist/feature/registry.js.map +1 -1
  335. package/dist/github/contract.d.ts +266 -0
  336. package/dist/github/contract.d.ts.map +1 -0
  337. package/dist/github/contract.js +30 -0
  338. package/dist/github/contract.js.map +1 -0
  339. package/dist/github/effect-schema.d.ts +488 -0
  340. package/dist/github/effect-schema.d.ts.map +1 -0
  341. package/dist/github/effect-schema.js +231 -0
  342. package/dist/github/effect-schema.js.map +1 -0
  343. package/dist/github/feature.d.ts +201 -0
  344. package/dist/github/feature.d.ts.map +1 -0
  345. package/dist/github/feature.js +195 -0
  346. package/dist/github/feature.js.map +1 -0
  347. package/dist/github/index.d.ts +3 -0
  348. package/dist/github/index.d.ts.map +1 -0
  349. package/dist/github/index.js +3 -0
  350. package/dist/github/index.js.map +1 -0
  351. package/dist/goal/contract.d.ts +449 -0
  352. package/dist/goal/contract.d.ts.map +1 -0
  353. package/dist/goal/contract.js +37 -0
  354. package/dist/goal/contract.js.map +1 -0
  355. package/dist/goal/effect-schema.d.ts +870 -0
  356. package/dist/goal/effect-schema.d.ts.map +1 -0
  357. package/dist/goal/effect-schema.js +349 -0
  358. package/dist/goal/effect-schema.js.map +1 -0
  359. package/dist/goal/feature.d.ts +256 -0
  360. package/dist/goal/feature.d.ts.map +1 -0
  361. package/dist/goal/feature.js +237 -0
  362. package/dist/goal/feature.js.map +1 -0
  363. package/dist/goal/index.d.ts +3 -0
  364. package/dist/goal/index.d.ts.map +1 -0
  365. package/dist/goal/index.js +3 -0
  366. package/dist/goal/index.js.map +1 -0
  367. package/dist/harness/installed/effect-schema.d.ts.map +1 -1
  368. package/dist/harness/installed/effect-schema.js +2 -1
  369. package/dist/harness/installed/effect-schema.js.map +1 -1
  370. package/dist/harness/installed/feature.d.ts +35 -0
  371. package/dist/harness/installed/feature.d.ts.map +1 -0
  372. package/dist/harness/installed/feature.js +39 -0
  373. package/dist/harness/installed/feature.js.map +1 -0
  374. package/dist/harness/installed/index.d.ts +1 -0
  375. package/dist/harness/installed/index.d.ts.map +1 -1
  376. package/dist/harness/installed/index.js +1 -0
  377. package/dist/harness/installed/index.js.map +1 -1
  378. package/dist/hold/contract.d.ts +2 -0
  379. package/dist/hold/contract.d.ts.map +1 -1
  380. package/dist/hold/effect-schema.d.ts +4 -0
  381. package/dist/hold/effect-schema.d.ts.map +1 -1
  382. package/dist/hold/feature.d.ts +155 -0
  383. package/dist/hold/feature.d.ts.map +1 -0
  384. package/dist/hold/feature.js +151 -0
  385. package/dist/hold/feature.js.map +1 -0
  386. package/dist/hold/index.d.ts +1 -0
  387. package/dist/hold/index.d.ts.map +1 -1
  388. package/dist/hold/index.js +1 -0
  389. package/dist/hold/index.js.map +1 -1
  390. package/dist/inbox/contract.d.ts +386 -0
  391. package/dist/inbox/contract.d.ts.map +1 -0
  392. package/dist/inbox/contract.js +20 -0
  393. package/dist/inbox/contract.js.map +1 -0
  394. package/dist/inbox/effect-schema.d.ts +750 -0
  395. package/dist/inbox/effect-schema.d.ts.map +1 -0
  396. package/dist/inbox/effect-schema.js +246 -0
  397. package/dist/inbox/effect-schema.js.map +1 -0
  398. package/dist/inbox/feature.d.ts +164 -0
  399. package/dist/inbox/feature.d.ts.map +1 -0
  400. package/dist/inbox/feature.js +160 -0
  401. package/dist/inbox/feature.js.map +1 -0
  402. package/dist/inbox/index.d.ts +3 -0
  403. package/dist/inbox/index.d.ts.map +1 -0
  404. package/dist/inbox/index.js +3 -0
  405. package/dist/inbox/index.js.map +1 -0
  406. package/dist/index.d.ts +28 -15
  407. package/dist/index.d.ts.map +1 -1
  408. package/dist/index.js +28 -15
  409. package/dist/index.js.map +1 -1
  410. package/dist/integration-authorization/claude-code-contract.d.ts +3 -0
  411. package/dist/integration-authorization/claude-code-contract.d.ts.map +1 -1
  412. package/dist/integration-authorization/contract.d.ts +141 -12
  413. package/dist/integration-authorization/contract.d.ts.map +1 -1
  414. package/dist/integration-authorization/contract.js +37 -1
  415. package/dist/integration-authorization/contract.js.map +1 -1
  416. package/dist/integration-authorization/effect-schema.d.ts +5961 -1583
  417. package/dist/integration-authorization/effect-schema.d.ts.map +1 -1
  418. package/dist/integration-authorization/effect-schema.js +157 -6
  419. package/dist/integration-authorization/effect-schema.js.map +1 -1
  420. package/dist/integration-authorization/feature.d.ts +845 -0
  421. package/dist/integration-authorization/feature.d.ts.map +1 -0
  422. package/dist/integration-authorization/feature.js +795 -0
  423. package/dist/integration-authorization/feature.js.map +1 -0
  424. package/dist/integration-authorization/index.d.ts +5 -0
  425. package/dist/integration-authorization/index.d.ts.map +1 -1
  426. package/dist/integration-authorization/index.js +5 -0
  427. package/dist/integration-authorization/index.js.map +1 -1
  428. package/dist/integration-authorization/pi-rpc-contract.d.ts +3 -0
  429. package/dist/integration-authorization/pi-rpc-contract.d.ts.map +1 -1
  430. package/dist/integration-authorization/policy.d.ts +6 -1
  431. package/dist/integration-authorization/policy.d.ts.map +1 -1
  432. package/dist/integration-authorization/policy.js +6 -1
  433. package/dist/integration-authorization/policy.js.map +1 -1
  434. package/dist/interaction/effect-schema.d.ts +1 -1
  435. package/dist/interaction/effect-schema.d.ts.map +1 -1
  436. package/dist/interaction/effect-schema.js +1 -1
  437. package/dist/interaction/effect-schema.js.map +1 -1
  438. package/dist/interaction/feature.d.ts +50 -0
  439. package/dist/interaction/feature.d.ts.map +1 -1
  440. package/dist/interaction/feature.js +48 -0
  441. package/dist/interaction/feature.js.map +1 -1
  442. package/dist/interaction/result-contract.d.ts +3 -0
  443. package/dist/interaction/result-contract.d.ts.map +1 -1
  444. package/dist/interaction/result-effect-schema.d.ts +6 -0
  445. package/dist/interaction/result-effect-schema.d.ts.map +1 -1
  446. package/dist/invocation-context/contract.d.ts +2 -1
  447. package/dist/invocation-context/contract.d.ts.map +1 -1
  448. package/dist/invocation-context/effect-schema.d.ts +12 -2
  449. package/dist/invocation-context/effect-schema.d.ts.map +1 -1
  450. package/dist/invocation-context/effect-schema.js +24 -3
  451. package/dist/invocation-context/effect-schema.js.map +1 -1
  452. package/dist/invocation-context/feature.d.ts +35 -0
  453. package/dist/invocation-context/feature.d.ts.map +1 -0
  454. package/dist/invocation-context/feature.js +39 -0
  455. package/dist/invocation-context/feature.js.map +1 -0
  456. package/dist/invocation-context/index.d.ts +1 -0
  457. package/dist/invocation-context/index.d.ts.map +1 -1
  458. package/dist/invocation-context/index.js +1 -0
  459. package/dist/invocation-context/index.js.map +1 -1
  460. package/dist/invocation-context/policy.d.ts +6 -1
  461. package/dist/invocation-context/policy.d.ts.map +1 -1
  462. package/dist/invocation-context/policy.js +7 -1
  463. package/dist/invocation-context/policy.js.map +1 -1
  464. package/dist/local-node/contract.d.ts +57 -18
  465. package/dist/local-node/contract.d.ts.map +1 -1
  466. package/dist/local-node/contract.js +3 -1
  467. package/dist/local-node/contract.js.map +1 -1
  468. package/dist/local-node/effect-schema.d.ts +3943 -1287
  469. package/dist/local-node/effect-schema.d.ts.map +1 -1
  470. package/dist/local-node/effect-schema.js +125 -10
  471. package/dist/local-node/effect-schema.js.map +1 -1
  472. package/dist/local-node/index.d.ts +2 -2
  473. package/dist/local-node/index.d.ts.map +1 -1
  474. package/dist/local-node/index.js +2 -2
  475. package/dist/local-node/index.js.map +1 -1
  476. package/dist/local-node/node-api/index.d.ts +2 -2
  477. package/dist/local-node/node-api/index.d.ts.map +1 -1
  478. package/dist/local-node/node-api/index.js +2 -2
  479. package/dist/local-node/node-api/index.js.map +1 -1
  480. package/dist/local-node/node-api/methods.d.ts +11 -215
  481. package/dist/local-node/node-api/methods.d.ts.map +1 -1
  482. package/dist/local-node/node-api/methods.js +149 -215
  483. package/dist/local-node/node-api/methods.js.map +1 -1
  484. package/dist/local-node/node-api/policy.d.ts +33 -0
  485. package/dist/local-node/node-api/policy.d.ts.map +1 -1
  486. package/dist/local-node/node-api/policy.js +33 -0
  487. package/dist/local-node/node-api/policy.js.map +1 -1
  488. package/dist/local-node/receipt-list.d.ts +6 -7
  489. package/dist/local-node/receipt-list.d.ts.map +1 -1
  490. package/dist/local-node/receipt-list.js +64 -7
  491. package/dist/local-node/receipt-list.js.map +1 -1
  492. package/dist/node-update/contract.d.ts +198 -0
  493. package/dist/node-update/contract.d.ts.map +1 -0
  494. package/dist/node-update/contract.js +22 -0
  495. package/dist/node-update/contract.js.map +1 -0
  496. package/dist/node-update/effect-schema.d.ts +435 -0
  497. package/dist/node-update/effect-schema.d.ts.map +1 -0
  498. package/dist/node-update/effect-schema.js +307 -0
  499. package/dist/node-update/effect-schema.js.map +1 -0
  500. package/dist/node-update/feature.d.ts +379 -0
  501. package/dist/node-update/feature.d.ts.map +1 -0
  502. package/dist/node-update/feature.js +363 -0
  503. package/dist/node-update/feature.js.map +1 -0
  504. package/dist/node-update/index.d.ts +3 -0
  505. package/dist/node-update/index.d.ts.map +1 -0
  506. package/dist/node-update/index.js +3 -0
  507. package/dist/node-update/index.js.map +1 -0
  508. package/dist/orchestration/contract.d.ts +6 -0
  509. package/dist/orchestration/contract.d.ts.map +1 -1
  510. package/dist/orchestration/effect-schema.d.ts +14 -2
  511. package/dist/orchestration/effect-schema.d.ts.map +1 -1
  512. package/dist/orchestration/effect-schema.js +2 -2
  513. package/dist/orchestration/effect-schema.js.map +1 -1
  514. package/dist/orchestration/feature.d.ts +235 -0
  515. package/dist/orchestration/feature.d.ts.map +1 -1
  516. package/dist/orchestration/feature.js +227 -0
  517. package/dist/orchestration/feature.js.map +1 -1
  518. package/dist/orchestration/topology.d.ts +11 -1
  519. package/dist/orchestration/topology.d.ts.map +1 -1
  520. package/dist/orchestration/topology.js +38 -29
  521. package/dist/orchestration/topology.js.map +1 -1
  522. package/dist/pairing/contract.d.ts +86 -0
  523. package/dist/pairing/contract.d.ts.map +1 -0
  524. package/dist/pairing/contract.js +12 -0
  525. package/dist/pairing/contract.js.map +1 -0
  526. package/dist/pairing/effect-schema.d.ts +166 -0
  527. package/dist/pairing/effect-schema.d.ts.map +1 -0
  528. package/dist/pairing/effect-schema.js +94 -0
  529. package/dist/pairing/effect-schema.js.map +1 -0
  530. package/dist/pairing/feature.d.ts +141 -0
  531. package/dist/pairing/feature.d.ts.map +1 -0
  532. package/dist/pairing/feature.js +139 -0
  533. package/dist/pairing/feature.js.map +1 -0
  534. package/dist/pairing/index.d.ts +3 -0
  535. package/dist/pairing/index.d.ts.map +1 -0
  536. package/dist/pairing/index.js +3 -0
  537. package/dist/pairing/index.js.map +1 -0
  538. package/dist/port-lease/contract.d.ts +3 -0
  539. package/dist/port-lease/contract.d.ts.map +1 -1
  540. package/dist/port-lease/feature.d.ts +21 -0
  541. package/dist/port-lease/feature.d.ts.map +1 -1
  542. package/dist/port-lease/feature.js +21 -0
  543. package/dist/port-lease/feature.js.map +1 -1
  544. package/dist/port-lease/result-effect-schema.d.ts +6 -0
  545. package/dist/port-lease/result-effect-schema.d.ts.map +1 -1
  546. package/dist/presentation/contract.d.ts +41 -2
  547. package/dist/presentation/contract.d.ts.map +1 -1
  548. package/dist/presentation/effect-schema.d.ts +37 -2
  549. package/dist/presentation/effect-schema.d.ts.map +1 -1
  550. package/dist/presentation/feature.d.ts +20 -0
  551. package/dist/presentation/feature.d.ts.map +1 -1
  552. package/dist/presentation/feature.js +20 -0
  553. package/dist/presentation/feature.js.map +1 -1
  554. package/dist/presentation/session-list-effect-schema.d.ts +37 -2
  555. package/dist/presentation/session-list-effect-schema.d.ts.map +1 -1
  556. package/dist/principal/contract.d.ts +104 -0
  557. package/dist/principal/contract.d.ts.map +1 -0
  558. package/dist/principal/contract.js +18 -0
  559. package/dist/principal/contract.js.map +1 -0
  560. package/dist/principal/effect-schema.d.ts +166 -0
  561. package/dist/principal/effect-schema.d.ts.map +1 -0
  562. package/dist/principal/effect-schema.js +93 -0
  563. package/dist/principal/effect-schema.js.map +1 -0
  564. package/dist/principal/feature.d.ts +111 -0
  565. package/dist/principal/feature.d.ts.map +1 -0
  566. package/dist/principal/feature.js +111 -0
  567. package/dist/principal/feature.js.map +1 -0
  568. package/dist/principal/index.d.ts +3 -0
  569. package/dist/principal/index.d.ts.map +1 -0
  570. package/dist/principal/index.js +3 -0
  571. package/dist/principal/index.js.map +1 -0
  572. package/dist/project-workspace/contract.d.ts +351 -2
  573. package/dist/project-workspace/contract.d.ts.map +1 -1
  574. package/dist/project-workspace/contract.js +34 -2
  575. package/dist/project-workspace/contract.js.map +1 -1
  576. package/dist/project-workspace/effect-schema.d.ts +403 -0
  577. package/dist/project-workspace/effect-schema.d.ts.map +1 -1
  578. package/dist/project-workspace/effect-schema.js +105 -1
  579. package/dist/project-workspace/effect-schema.js.map +1 -1
  580. package/dist/project-workspace/feature.d.ts +659 -1
  581. package/dist/project-workspace/feature.d.ts.map +1 -1
  582. package/dist/project-workspace/feature.js +625 -1
  583. package/dist/project-workspace/feature.js.map +1 -1
  584. package/dist/project-workspace/git-effect-schema.d.ts +93 -0
  585. package/dist/project-workspace/git-effect-schema.d.ts.map +1 -0
  586. package/dist/project-workspace/git-effect-schema.js +81 -0
  587. package/dist/project-workspace/git-effect-schema.js.map +1 -0
  588. package/dist/project-workspace/index.d.ts +2 -2
  589. package/dist/project-workspace/index.d.ts.map +1 -1
  590. package/dist/project-workspace/index.js +2 -2
  591. package/dist/project-workspace/index.js.map +1 -1
  592. package/dist/project-workspace/knowledge-effect-schema.d.ts +413 -0
  593. package/dist/project-workspace/knowledge-effect-schema.d.ts.map +1 -0
  594. package/dist/project-workspace/knowledge-effect-schema.js +232 -0
  595. package/dist/project-workspace/knowledge-effect-schema.js.map +1 -0
  596. package/dist/project-workspace/policy.d.ts +40 -0
  597. package/dist/project-workspace/policy.d.ts.map +1 -1
  598. package/dist/project-workspace/policy.js +39 -0
  599. package/dist/project-workspace/policy.js.map +1 -1
  600. package/dist/provider/feature.d.ts +35 -0
  601. package/dist/provider/feature.d.ts.map +1 -0
  602. package/dist/provider/feature.js +39 -0
  603. package/dist/provider/feature.js.map +1 -0
  604. package/dist/provider/index.d.ts +1 -0
  605. package/dist/provider/index.d.ts.map +1 -1
  606. package/dist/provider/index.js +1 -0
  607. package/dist/provider/index.js.map +1 -1
  608. package/dist/reach/address.d.ts +18 -0
  609. package/dist/reach/address.d.ts.map +1 -0
  610. package/dist/reach/address.js +42 -0
  611. package/dist/reach/address.js.map +1 -0
  612. package/dist/reach/contract.d.ts +68 -0
  613. package/dist/reach/contract.d.ts.map +1 -0
  614. package/dist/reach/contract.js +8 -0
  615. package/dist/reach/contract.js.map +1 -0
  616. package/dist/reach/effect-schema.d.ts +133 -0
  617. package/dist/reach/effect-schema.d.ts.map +1 -0
  618. package/dist/reach/effect-schema.js +68 -0
  619. package/dist/reach/effect-schema.js.map +1 -0
  620. package/dist/reach/feature.d.ts +106 -0
  621. package/dist/reach/feature.d.ts.map +1 -0
  622. package/dist/reach/feature.js +106 -0
  623. package/dist/reach/feature.js.map +1 -0
  624. package/dist/reach/index.d.ts +4 -0
  625. package/dist/reach/index.d.ts.map +1 -0
  626. package/dist/reach/index.js +4 -0
  627. package/dist/reach/index.js.map +1 -0
  628. package/dist/reference/feature.d.ts +5 -0
  629. package/dist/reference/feature.d.ts.map +1 -1
  630. package/dist/reference/feature.js +5 -0
  631. package/dist/reference/feature.js.map +1 -1
  632. package/dist/release/version.d.ts +2 -2
  633. package/dist/release/version.d.ts.map +1 -1
  634. package/dist/release/version.js +2 -2
  635. package/dist/release/version.js.map +1 -1
  636. package/dist/remote-node/bridge-effect-schema.js +2 -2
  637. package/dist/remote-node/contract.d.ts +103 -2
  638. package/dist/remote-node/contract.d.ts.map +1 -1
  639. package/dist/remote-node/effect-schema.d.ts +1 -1
  640. package/dist/remote-node/effect-schema.d.ts.map +1 -1
  641. package/dist/remote-node/effect-schema.js +1 -1
  642. package/dist/remote-node/effect-schema.js.map +1 -1
  643. package/dist/remote-node/feature.d.ts +185 -0
  644. package/dist/remote-node/feature.d.ts.map +1 -1
  645. package/dist/remote-node/feature.js +173 -0
  646. package/dist/remote-node/feature.js.map +1 -1
  647. package/dist/remote-node/request-effect-schema.d.ts +4 -4
  648. package/dist/remote-node/request-effect-schema.d.ts.map +1 -1
  649. package/dist/remote-node/request-effect-schema.js +2 -1
  650. package/dist/remote-node/request-effect-schema.js.map +1 -1
  651. package/dist/remote-node/result-effect-schema.d.ts +194 -1
  652. package/dist/remote-node/result-effect-schema.d.ts.map +1 -1
  653. package/dist/remote-node/result-effect-schema.js +13 -2
  654. package/dist/remote-node/result-effect-schema.js.map +1 -1
  655. package/dist/routine/contract.d.ts +644 -18
  656. package/dist/routine/contract.d.ts.map +1 -1
  657. package/dist/routine/contract.js +28 -2
  658. package/dist/routine/contract.js.map +1 -1
  659. package/dist/routine/effect-schema.d.ts +1489 -218
  660. package/dist/routine/effect-schema.d.ts.map +1 -1
  661. package/dist/routine/effect-schema.js +358 -20
  662. package/dist/routine/effect-schema.js.map +1 -1
  663. package/dist/routine/feature.d.ts +336 -11
  664. package/dist/routine/feature.d.ts.map +1 -1
  665. package/dist/routine/feature.js +318 -11
  666. package/dist/routine/feature.js.map +1 -1
  667. package/dist/routine/index.d.ts +1 -1
  668. package/dist/routine/index.d.ts.map +1 -1
  669. package/dist/routine/index.js +1 -1
  670. package/dist/routine/index.js.map +1 -1
  671. package/dist/routine/policy.d.ts +55 -3
  672. package/dist/routine/policy.d.ts.map +1 -1
  673. package/dist/routine/policy.js +46 -1
  674. package/dist/routine/policy.js.map +1 -1
  675. package/dist/run-ledger/contract.d.ts +47 -0
  676. package/dist/run-ledger/contract.d.ts.map +1 -1
  677. package/dist/run-ledger/feature.d.ts +32 -0
  678. package/dist/run-ledger/feature.d.ts.map +1 -1
  679. package/dist/run-ledger/feature.js +32 -0
  680. package/dist/run-ledger/feature.js.map +1 -1
  681. package/dist/run-ledger/result-effect-schema.d.ts +94 -0
  682. package/dist/run-ledger/result-effect-schema.d.ts.map +1 -1
  683. package/dist/runtime/effect-schema.d.ts.map +1 -1
  684. package/dist/runtime/effect-schema.js +2 -1
  685. package/dist/runtime/effect-schema.js.map +1 -1
  686. package/dist/runtime/feature.d.ts +35 -0
  687. package/dist/runtime/feature.d.ts.map +1 -0
  688. package/dist/runtime/feature.js +39 -0
  689. package/dist/runtime/feature.js.map +1 -0
  690. package/dist/runtime/index.d.ts +1 -0
  691. package/dist/runtime/index.d.ts.map +1 -1
  692. package/dist/runtime/index.js +1 -0
  693. package/dist/runtime/index.js.map +1 -1
  694. package/dist/runtime-schema/effect-json-schema.d.ts +9 -0
  695. package/dist/runtime-schema/effect-json-schema.d.ts.map +1 -0
  696. package/dist/runtime-schema/effect-json-schema.js +41 -0
  697. package/dist/runtime-schema/effect-json-schema.js.map +1 -0
  698. package/dist/runtime-schema/effect-schema.d.ts +1 -0
  699. package/dist/runtime-schema/effect-schema.d.ts.map +1 -1
  700. package/dist/runtime-schema/effect-schema.js +1 -0
  701. package/dist/runtime-schema/effect-schema.js.map +1 -1
  702. package/dist/secret/contract.d.ts +107 -0
  703. package/dist/secret/contract.d.ts.map +1 -0
  704. package/dist/secret/contract.js +34 -0
  705. package/dist/secret/contract.js.map +1 -0
  706. package/dist/secret/effect-schema.d.ts +185 -0
  707. package/dist/secret/effect-schema.d.ts.map +1 -0
  708. package/dist/secret/effect-schema.js +113 -0
  709. package/dist/secret/effect-schema.js.map +1 -0
  710. package/dist/secret/feature.d.ts +103 -0
  711. package/dist/secret/feature.d.ts.map +1 -0
  712. package/dist/secret/feature.js +103 -0
  713. package/dist/secret/feature.js.map +1 -0
  714. package/dist/secret/index.d.ts +3 -0
  715. package/dist/secret/index.d.ts.map +1 -0
  716. package/dist/secret/index.js +3 -0
  717. package/dist/secret/index.js.map +1 -0
  718. package/dist/session/agent-permission-contract.d.ts +6 -5
  719. package/dist/session/agent-permission-contract.d.ts.map +1 -1
  720. package/dist/session/agent-permission-effect-schema.d.ts +11 -9
  721. package/dist/session/agent-permission-effect-schema.d.ts.map +1 -1
  722. package/dist/session/agent-permission-effect-schema.js +2 -2
  723. package/dist/session/agent-permission-effect-schema.js.map +1 -1
  724. package/dist/session/contract.d.ts +968 -82
  725. package/dist/session/contract.d.ts.map +1 -1
  726. package/dist/session/contract.js +33 -4
  727. package/dist/session/contract.js.map +1 -1
  728. package/dist/session/defaults/contract.d.ts +19 -0
  729. package/dist/session/defaults/contract.d.ts.map +1 -0
  730. package/dist/session/defaults/contract.js +5 -0
  731. package/dist/session/defaults/contract.js.map +1 -0
  732. package/dist/session/defaults/effect-schema.d.ts +36 -0
  733. package/dist/session/defaults/effect-schema.d.ts.map +1 -0
  734. package/dist/session/defaults/effect-schema.js +28 -0
  735. package/dist/session/defaults/effect-schema.js.map +1 -0
  736. package/dist/session/defaults/index.d.ts +2 -0
  737. package/dist/session/defaults/index.d.ts.map +1 -0
  738. package/dist/session/defaults/index.js +2 -0
  739. package/dist/session/defaults/index.js.map +1 -0
  740. package/dist/session/effect-schema.d.ts +2844 -159
  741. package/dist/session/effect-schema.d.ts.map +1 -1
  742. package/dist/session/effect-schema.js +581 -52
  743. package/dist/session/effect-schema.js.map +1 -1
  744. package/dist/session/feature.d.ts +801 -16
  745. package/dist/session/feature.d.ts.map +1 -1
  746. package/dist/session/feature.js +761 -24
  747. package/dist/session/feature.js.map +1 -1
  748. package/dist/session/index.d.ts +6 -3
  749. package/dist/session/index.d.ts.map +1 -1
  750. package/dist/session/index.js +6 -3
  751. package/dist/session/index.js.map +1 -1
  752. package/dist/session/observation-contract.d.ts +2 -2
  753. package/dist/session/observation-effect-schema.d.ts +7 -2
  754. package/dist/session/observation-effect-schema.d.ts.map +1 -1
  755. package/dist/session/observation-effect-schema.js +6 -1
  756. package/dist/session/observation-effect-schema.js.map +1 -1
  757. package/dist/session/placement/contract.d.ts +35 -0
  758. package/dist/session/placement/contract.d.ts.map +1 -0
  759. package/dist/session/placement/contract.js +5 -0
  760. package/dist/session/placement/contract.js.map +1 -0
  761. package/dist/session/placement/effect-schema.d.ts +55 -0
  762. package/dist/session/placement/effect-schema.d.ts.map +1 -0
  763. package/dist/session/placement/effect-schema.js +76 -0
  764. package/dist/session/placement/effect-schema.js.map +1 -0
  765. package/dist/session/placement/index.d.ts +2 -0
  766. package/dist/session/placement/index.d.ts.map +1 -0
  767. package/dist/session/placement/index.js +2 -0
  768. package/dist/session/placement/index.js.map +1 -0
  769. package/dist/session/policy.d.ts +157 -0
  770. package/dist/session/policy.d.ts.map +1 -1
  771. package/dist/session/policy.js +185 -2
  772. package/dist/session/policy.js.map +1 -1
  773. package/dist/session/stop-resume-contract.d.ts +127 -2
  774. package/dist/session/stop-resume-contract.d.ts.map +1 -1
  775. package/dist/session/stop-resume-contract.js +5 -1
  776. package/dist/session/stop-resume-contract.js.map +1 -1
  777. package/dist/session/worktree-effect-schema.d.ts +55 -1
  778. package/dist/session/worktree-effect-schema.d.ts.map +1 -1
  779. package/dist/session/worktree-effect-schema.js +79 -3
  780. package/dist/session/worktree-effect-schema.js.map +1 -1
  781. package/dist/session-command/contract.d.ts +442 -0
  782. package/dist/session-command/contract.d.ts.map +1 -0
  783. package/dist/session-command/contract.js +12 -0
  784. package/dist/session-command/contract.js.map +1 -0
  785. package/dist/session-command/effect-schema.d.ts +875 -0
  786. package/dist/session-command/effect-schema.d.ts.map +1 -0
  787. package/dist/session-command/effect-schema.js +125 -0
  788. package/dist/session-command/effect-schema.js.map +1 -0
  789. package/dist/session-command/feature.d.ts +141 -0
  790. package/dist/session-command/feature.d.ts.map +1 -0
  791. package/dist/session-command/feature.js +137 -0
  792. package/dist/session-command/feature.js.map +1 -0
  793. package/dist/session-command/index.d.ts +4 -0
  794. package/dist/session-command/index.d.ts.map +1 -0
  795. package/dist/session-command/index.js +4 -0
  796. package/dist/session-command/index.js.map +1 -0
  797. package/dist/session-command/policy.d.ts +33 -0
  798. package/dist/session-command/policy.d.ts.map +1 -0
  799. package/dist/session-command/policy.js +60 -0
  800. package/dist/session-command/policy.js.map +1 -0
  801. package/dist/session-guard/contract.d.ts +35 -4
  802. package/dist/session-guard/contract.d.ts.map +1 -1
  803. package/dist/session-guard/contract.js +34 -5
  804. package/dist/session-guard/contract.js.map +1 -1
  805. package/dist/session-guard/feature.d.ts +66 -1
  806. package/dist/session-guard/feature.d.ts.map +1 -1
  807. package/dist/session-guard/feature.js +62 -1
  808. package/dist/session-guard/feature.js.map +1 -1
  809. package/dist/session-guard/index.d.ts +1 -1
  810. package/dist/session-guard/index.d.ts.map +1 -1
  811. package/dist/session-guard/index.js +1 -1
  812. package/dist/session-guard/index.js.map +1 -1
  813. package/dist/session-guard/request-effect-schema.d.ts +33 -0
  814. package/dist/session-guard/request-effect-schema.d.ts.map +1 -1
  815. package/dist/session-guard/request-effect-schema.js +22 -0
  816. package/dist/session-guard/request-effect-schema.js.map +1 -1
  817. package/dist/session-guard/result-effect-schema.d.ts +28 -0
  818. package/dist/session-guard/result-effect-schema.d.ts.map +1 -1
  819. package/dist/session-guard/result-effect-schema.js +3 -1
  820. package/dist/session-guard/result-effect-schema.js.map +1 -1
  821. package/dist/session-stream/contract.d.ts +2 -1
  822. package/dist/session-stream/contract.d.ts.map +1 -1
  823. package/dist/session-stream/effect-schema.d.ts +9 -8
  824. package/dist/session-stream/effect-schema.d.ts.map +1 -1
  825. package/dist/skills-sync/contract.d.ts +142 -0
  826. package/dist/skills-sync/contract.d.ts.map +1 -0
  827. package/dist/skills-sync/contract.js +13 -0
  828. package/dist/skills-sync/contract.js.map +1 -0
  829. package/dist/skills-sync/effect-schema.d.ts +312 -0
  830. package/dist/skills-sync/effect-schema.d.ts.map +1 -0
  831. package/dist/skills-sync/effect-schema.js +160 -0
  832. package/dist/skills-sync/effect-schema.js.map +1 -0
  833. package/dist/skills-sync/feature.d.ts +102 -0
  834. package/dist/skills-sync/feature.d.ts.map +1 -0
  835. package/dist/skills-sync/feature.js +102 -0
  836. package/dist/skills-sync/feature.js.map +1 -0
  837. package/dist/skills-sync/index.d.ts +3 -0
  838. package/dist/skills-sync/index.d.ts.map +1 -0
  839. package/dist/skills-sync/index.js +3 -0
  840. package/dist/skills-sync/index.js.map +1 -0
  841. package/dist/team-workspace/contract.d.ts +1 -0
  842. package/dist/team-workspace/contract.d.ts.map +1 -1
  843. package/dist/team-workspace/effect-schema.d.ts +2 -0
  844. package/dist/team-workspace/effect-schema.d.ts.map +1 -1
  845. package/dist/team-workspace/feature.d.ts +10 -0
  846. package/dist/team-workspace/feature.d.ts.map +1 -1
  847. package/dist/team-workspace/feature.js +10 -0
  848. package/dist/team-workspace/feature.js.map +1 -1
  849. package/dist/terminal/contract.d.ts +2 -0
  850. package/dist/terminal/contract.d.ts.map +1 -1
  851. package/dist/terminal/effect-schema.d.ts +6 -0
  852. package/dist/terminal/effect-schema.d.ts.map +1 -1
  853. package/dist/terminal/effect-schema.js +2 -0
  854. package/dist/terminal/effect-schema.js.map +1 -1
  855. package/dist/terminal/feature.d.ts +281 -0
  856. package/dist/terminal/feature.d.ts.map +1 -1
  857. package/dist/terminal/feature.js +289 -0
  858. package/dist/terminal/feature.js.map +1 -1
  859. package/dist/turn/contract.d.ts +633 -4
  860. package/dist/turn/contract.d.ts.map +1 -1
  861. package/dist/turn/contract.js +18 -4
  862. package/dist/turn/contract.js.map +1 -1
  863. package/dist/turn/effect-schema.d.ts +1507 -161
  864. package/dist/turn/effect-schema.d.ts.map +1 -1
  865. package/dist/turn/effect-schema.js +123 -10
  866. package/dist/turn/effect-schema.js.map +1 -1
  867. package/dist/turn/index.d.ts +2 -2
  868. package/dist/turn/index.d.ts.map +1 -1
  869. package/dist/turn/index.js +2 -2
  870. package/dist/turn/index.js.map +1 -1
  871. package/dist/turn/policy.d.ts +54 -0
  872. package/dist/turn/policy.d.ts.map +1 -1
  873. package/dist/turn/policy.js +74 -0
  874. package/dist/turn/policy.js.map +1 -1
  875. package/dist/voice/contract.d.ts +6 -6
  876. package/dist/voice/effect-schema.d.ts +10 -9
  877. package/dist/voice/effect-schema.d.ts.map +1 -1
  878. package/dist/voice/effect-schema.js +3 -1
  879. package/dist/voice/effect-schema.js.map +1 -1
  880. package/dist/voice/feature.d.ts +70 -2
  881. package/dist/voice/feature.d.ts.map +1 -1
  882. package/dist/voice/feature.js +32 -0
  883. package/dist/voice/feature.js.map +1 -1
  884. package/dist/voice/orchestrator-system-prompt.d.ts +2 -2
  885. package/dist/voice/orchestrator-system-prompt.js +2 -2
  886. package/dist/voice/relay-contract.d.ts +1 -0
  887. package/dist/voice/relay-contract.d.ts.map +1 -1
  888. package/dist/voice/relay-effect-schema.d.ts +2 -0
  889. package/dist/voice/relay-effect-schema.d.ts.map +1 -1
  890. package/dist/webhooks/contract.d.ts +358 -0
  891. package/dist/webhooks/contract.d.ts.map +1 -0
  892. package/dist/webhooks/contract.js +26 -0
  893. package/dist/webhooks/contract.js.map +1 -0
  894. package/dist/webhooks/effect-schema.d.ts +550 -0
  895. package/dist/webhooks/effect-schema.d.ts.map +1 -0
  896. package/dist/webhooks/effect-schema.js +197 -0
  897. package/dist/webhooks/effect-schema.js.map +1 -0
  898. package/dist/webhooks/feature.d.ts +125 -0
  899. package/dist/webhooks/feature.d.ts.map +1 -0
  900. package/dist/webhooks/feature.js +123 -0
  901. package/dist/webhooks/feature.js.map +1 -0
  902. package/dist/webhooks/hook-effect-schema.d.ts +69 -0
  903. package/dist/webhooks/hook-effect-schema.d.ts.map +1 -0
  904. package/dist/webhooks/hook-effect-schema.js +107 -0
  905. package/dist/webhooks/hook-effect-schema.js.map +1 -0
  906. package/dist/webhooks/index.d.ts +4 -0
  907. package/dist/webhooks/index.d.ts.map +1 -0
  908. package/dist/webhooks/index.js +4 -0
  909. package/dist/webhooks/index.js.map +1 -0
  910. package/dist/webhooks/policy.d.ts +16 -0
  911. package/dist/webhooks/policy.d.ts.map +1 -0
  912. package/dist/webhooks/policy.js +16 -0
  913. package/dist/webhooks/policy.js.map +1 -0
  914. package/package.json +9 -3
  915. package/dist/configuration/configuration.d.ts +0 -63
  916. package/dist/configuration/configuration.d.ts.map +0 -1
  917. package/dist/configuration/configuration.js +0 -93
  918. package/dist/configuration/configuration.js.map +0 -1
  919. package/dist/configuration/index.d.ts +0 -2
  920. package/dist/configuration/index.d.ts.map +0 -1
  921. package/dist/configuration/index.js +0 -2
  922. package/dist/configuration/index.js.map +0 -1
@@ -1,16 +1,22 @@
1
1
  import * as Schema from "effect/Schema";
2
- import { agentDefinitionReferenceEffectSchema } from "../agent/effect-schema.js";
2
+ import { agentDefinitionReferenceEffectSchema, agentIdentifierEffectSchema, } from "../agent/effect-schema.js";
3
+ import { approvalPromptEffectSchema } from "../approval/effect-schema.js";
4
+ import { boardHeldTaskEffectSchema, MAX_BOARD_HELD_TASKS, } from "../board/effect-schema.js";
3
5
  import { commandReceiptEffectSchema } from "../command-receipt/effect-schema.js";
4
6
  import { connectionModelIdEffectSchema } from "../connection/effect-schema.js";
5
7
  import { aggregateRevisionEffectSchema, failureDetailEffectSchema, protocolIdentifierEffectSchema, recordedAtEffectSchema, } from "../envelope/effect-schema.js";
6
8
  import { hasControlCharacter } from "../envelope/index.js";
9
+ import { sessionActivityEffectSchema, sessionStatusEffectSchema, } from "../event/effect-schema.js";
10
+ import { EXECUTOR_IDS } from "../executor/index.js";
7
11
  import { holdIdentifierEffectSchema } from "../hold/effect-schema.js";
12
+ import { remoteNodeNameEffectSchema } from "../remote-node/effect-schema.js";
8
13
  import { sessionRoleEffectSchema } from "../session-guard/effect-schema.js";
9
- import { sessionObserveParametersEffectSchema, sessionObserveResultEffectSchema, } from "./observation-effect-schema.js";
10
- import { MAX_SESSION_INBOX_CHECK_LIMIT, MAX_SESSION_MESSAGE_BODY_BYTES, MAX_SESSION_MESSAGE_SUBJECT_BYTES, MAX_SESSION_TITLE_LENGTH, MAX_SESSION_WAIT_MILLISECONDS, MAX_SESSION_WAIT_STATES, SESSION_ATTENTION_VALUES, SESSION_EFFORT_LEVELS, } from "./policy.js";
14
+ import { turnStateEffectSchema } from "../turn/effect-schema.js";
15
+ import { sessionExecutorKindEffectSchema, sessionObserveParametersEffectSchema, sessionObserveResultEffectSchema, } from "./observation-effect-schema.js";
16
+ import { DEFAULT_SESSION_SPAWN_CAPS, MAX_SESSION_INBOX_CHECK_LIMIT, MAX_SESSION_LABEL_KEY_LENGTH, MAX_SESSION_LABEL_VALUE_LENGTH, MAX_SESSION_LABELS, MAX_SESSION_MESSAGE_BODY_BYTES, MAX_SESSION_MESSAGE_SUBJECT_BYTES, MAX_SESSION_SETTLED_IDLE_SECONDS, MAX_SESSION_SPAWN_CHILD_COUNT, MAX_SESSION_SPAWN_DEPTH, MAX_SESSION_TITLE_LENGTH, MAX_SESSION_WAIT_MILLISECONDS, MAX_SESSION_WAIT_STATES, SESSION_ATTENTION_VALUES, SESSION_CHILD_TARGET_TYPE, SESSION_EFFORT_LEVELS, SESSION_PERMISSION_MODES, SESSION_SPAWN_CAP_BOUNDS, SESSION_SPAWN_CAPS_TARGET, sessionAcceptsModel, sessionEffortLevels, sessionPermissionModes, } from "./policy.js";
11
17
  import { sessionTurnEventEffectSchema } from "./turn-event-effect-schema.js";
12
18
  import { SESSION_EVENT_SCHEMA_VERSION, SESSION_SCHEMA_VERSION, } from "./version.js";
13
- import { sessionArchiveEffectSchema, sessionArchiveParametersEffectSchema, sessionDiffParametersEffectSchema, sessionDiffResultEffectSchema, sessionWorktreeCreatedEffectSchema, sessionWorktreeEffectSchema, sessionWorktreeRemovedEffectSchema, sessionWorktreeRequestEffectSchema, } from "./worktree-effect-schema.js";
19
+ import { gitRevisionEffectSchema, sessionArchiveEffectSchema, sessionArchiveParametersEffectSchema, sessionArchiveSummaryEffectSchema, sessionDiffParametersEffectSchema, sessionDiffResultEffectSchema, sessionGitStatusParametersEffectSchema, sessionGitStatusResultEffectSchema, sessionStartDirectoryEffectSchema, sessionTranscriptPathEffectSchema, sessionWorktreeCreatedEffectSchema, sessionWorktreeEffectSchema, sessionWorktreeRemovedEffectSchema, sessionWorktreeRequestEffectSchema, } from "./worktree-effect-schema.js";
14
20
  const MAX_PAGE_SIZE = 100;
15
21
  const MAX_EVENT_PAGE_SIZE = 32;
16
22
  const utf8 = new TextEncoder();
@@ -28,9 +34,16 @@ const revisionEffectSchema = aggregateRevisionEffectSchema;
28
34
  export const sessionTitleEffectSchema = Schema.String.check(Schema.isBetweenLength(1, MAX_SESSION_TITLE_LENGTH), Schema.makeFilter((value) => value.trim() === value && !hasControlCharacter(value), {
29
35
  expected: "a one-line title of 1 to 80 characters without surrounding spaces",
30
36
  }));
37
+ /**
38
+ * Up to 8 labels that tell a person or a bot which lane a Session belongs to
39
+ * (owner, lane, goal). A key is a lower-case name of up to 32 characters; a
40
+ * value is 1 to 64 printable ASCII characters without spaces or commas. A
41
+ * label is not a place for secrets: it shows in every Session list.
42
+ */
43
+ export const sessionLabelsEffectSchema = Schema.Record(Schema.String.check(Schema.isPattern(new RegExp(`^[a-z][a-z0-9_-]{0,${String(MAX_SESSION_LABEL_KEY_LENGTH - 1)}}$`, "u"))), Schema.String.check(Schema.isPattern(new RegExp(`^[\\x21-\\x2b\\x2d-\\x7e]{1,${String(MAX_SESSION_LABEL_VALUE_LENGTH)}}$`, "u")))).check(Schema.makeFilter((value) => Object.keys(value).length <= MAX_SESSION_LABELS, { expected: "at most 8 labels" }));
31
44
  /** 1 to 100 items. */
32
45
  export const pageSizeEffectSchema = Schema.Int.check(Schema.isGreaterThanOrEqualTo(1), Schema.isLessThanOrEqualTo(MAX_PAGE_SIZE));
33
- const sessionStateEffectSchema = Schema.Literals([
46
+ export const sessionStateEffectSchema = Schema.Literals([
34
47
  "idle",
35
48
  "starting",
36
49
  "running",
@@ -51,20 +64,35 @@ const sessionBaseFields = {
51
64
  workspaceId: protocolIdentifierEffectSchema,
52
65
  workspaceRevision: revisionEffectSchema,
53
66
  };
54
- export const sessionExecutorKindEffectSchema = Schema.Literals([
55
- "claude-code",
56
- "codex-cli",
67
+ export const sessionEffortEffectSchema = Schema.Literals(SESSION_EFFORT_LEVELS[EXECUTOR_IDS.codex]);
68
+ export const supportsEffort = (kind, effort) => sessionEffortLevels(kind).includes(effort);
69
+ /** A permission mode either vendor CLI documents; the Node checks it against the Session's executor kind. */
70
+ export const sessionPermissionEffectSchema = Schema.Literals([
71
+ ...SESSION_PERMISSION_MODES[EXECUTOR_IDS.claudeCode],
72
+ ...SESSION_PERMISSION_MODES[EXECUTOR_IDS.codex],
57
73
  ]);
58
- /** The Node issues an Agent's identifier when a person previews its creation. */
59
- export const agentIdentifierEffectSchema = protocolIdentifierEffectSchema.check(Schema.isPattern(/^agent_[a-f0-9]{32}$/u));
60
- export const sessionEffortEffectSchema = Schema.Literals(SESSION_EFFORT_LEVELS["codex-cli"]);
61
- export const supportsEffort = (kind, effort) => SESSION_EFFORT_LEVELS[kind].includes(effort);
74
+ export const supportsPermission = (kind, permission) => sessionPermissionModes(kind).includes(permission);
75
+ /** A prompt, when a reader may see it, goes with a status that says the Session waits on one, and its kind matches; options belong to a question. */
76
+ const promptMatchesStatus = (value) => {
77
+ if (value.prompt === undefined)
78
+ return true;
79
+ return value.status === "question"
80
+ ? value.prompt.kind === "question"
81
+ : value.status === "approval" &&
82
+ value.prompt.kind !== "question" &&
83
+ value.prompt.options === undefined;
84
+ };
85
+ /** Held tasks come with their count: every one up to the bound, the bound's worth past it. */
86
+ const heldTasksMatchCount = (value) => value.heldTasks === undefined || value.heldTaskCount === undefined
87
+ ? value.heldTasks === value.heldTaskCount
88
+ : value.heldTasks.length ===
89
+ Math.min(value.heldTaskCount, MAX_BOARD_HELD_TASKS);
62
90
  /**
63
91
  * Creation binds a vendor executor Session to one named account, once. A
64
- * Session on a gateway Connection may also fix the model the gateway serves,
65
- * and any executor Session may fix the effort its vendor CLI documents.
92
+ * Session may also fix its model, on a gateway Connection or an executor kind
93
+ * that takes one, and the effort its vendor CLI documents.
66
94
  */
67
- const sessionExecutorEffectSchema = Schema.Struct({
95
+ export const sessionExecutorEffectSchema = Schema.Struct({
68
96
  connectionId: protocolIdentifierEffectSchema,
69
97
  effort: Schema.optional(sessionEffortEffectSchema),
70
98
  kind: sessionExecutorKindEffectSchema,
@@ -72,11 +100,55 @@ const sessionExecutorEffectSchema = Schema.Struct({
72
100
  }).check(Schema.makeFilter((value) => value.effort === undefined || supportsEffort(value.kind, value.effort), { expected: "an effort level the executor kind supports" }));
73
101
  export const sessionEffectSchema = Schema.Struct({
74
102
  ...sessionBaseFields,
103
+ /** What the Session is doing; present on `session.list` and `session.show`. */
104
+ activity: Schema.optional(sessionActivityEffectSchema),
75
105
  agentDefinitionRef: Schema.optional(agentDefinitionReferenceEffectSchema),
106
+ /**
107
+ * `none` for a host-authority Session: the vendor harness runs as the
108
+ * Node's user with no Maia sandbox ([D-198](https://maia-os.vllnt.com/en/docs/decisions#d-198)).
109
+ * A sandboxed Session carries none.
110
+ */
111
+ containment: Schema.optional(Schema.Literal("none")),
76
112
  executor: Schema.optional(sessionExecutorEffectSchema),
77
113
  /** Why the runtime of a failed Session failed, when Maia knows. */
78
114
  failure: Schema.optional(failureDetailEffectSchema),
115
+ /** The count of board tasks the Session holds now; present on `session.list`, `session.show` and `session.wait`, with `heldTasks`. */
116
+ heldTaskCount: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),
117
+ /**
118
+ * The board tasks the Session holds now, newest claim first, at most
119
+ * `MAX_BOARD_HELD_TASKS`; `heldTaskCount` counts every one.
120
+ */
121
+ heldTasks: Schema.optional(Schema.Array(boardHeldTaskEffectSchema).check(Schema.isMaxLength(MAX_BOARD_HELD_TASKS))),
122
+ /** Set at creation; absent when the Session has no labels. */
123
+ labels: Schema.optional(sessionLabelsEffectSchema),
124
+ /** The Session's newest turn that ran (running or settled); a turn that never ran (queued, withdrawn or rejected) never counts; absent until one runs. */
125
+ latestTurnId: Schema.optional(protocolIdentifierEffectSchema),
126
+ /** How `latestTurnId` ended or is going; present on `session.list` and `session.show`. */
127
+ latestTurnState: Schema.optional(turnStateEffectSchema),
128
+ /** The Session that spawned or created this one, fixed at creation; absent for a top-level Session. */
129
+ parentSessionId: Schema.optional(protocolIdentifierEffectSchema),
130
+ /** The permission mode a host-authority Session passes to its vendor CLI, fixed at creation; none is the vendor default. */
131
+ permission: Schema.optional(sessionPermissionEffectSchema),
132
+ /**
133
+ * The prompt a `question` or `approval` Session waits on, with its text and
134
+ * options. `session.list` and `session.show` return it while `status` is
135
+ * one of the two and never otherwise: a `question` names a question
136
+ * prompt, an `approval` any other kind. A reader who may not read the
137
+ * approval (a Session principal listing its Project) gets the status without
138
+ * it.
139
+ */
140
+ prompt: Schema.optional(approvalPromptEffectSchema),
141
+ /**
142
+ * Why a recovering Session stopped retrying: its retries ran out and it waits
143
+ * for `session.resume` or a Node start. Absent while it still retries and in
144
+ * every other state.
145
+ */
146
+ recovery: Schema.optional(failureDetailEffectSchema),
79
147
  schemaVersion: Schema.Literal(SESSION_SCHEMA_VERSION),
148
+ /** Why `session.list` with `settled` returned this Session: `stopped` or `failed` by state, `idle` after its idle time. */
149
+ settledReason: Schema.optional(Schema.Literals(["failed", "idle", "stopped"])),
150
+ /** What the Session is doing; present on `session.list` and `session.show`. */
151
+ status: Schema.optional(sessionStatusEffectSchema),
80
152
  /** Set at creation or by a rename; otherwise the first line of the first turn. */
81
153
  title: Schema.optional(sessionTitleEffectSchema),
82
154
  /** A coding Session's own worktree; a reading Session has none. */
@@ -84,8 +156,11 @@ export const sessionEffectSchema = Schema.Struct({
84
156
  }).check(Schema.makeFilter((value) => (value.executor === undefined ||
85
157
  value.agentDefinitionRef === undefined) &&
86
158
  (value.worktree === undefined || value.executor !== undefined) &&
87
- (value.failure === undefined || value.state === "failed"), {
88
- expected: "an executor Session without an Agent definition, and a worktree only for an executor Session",
159
+ (value.failure === undefined || value.state === "failed") &&
160
+ (value.recovery === undefined || value.state === "recovering") &&
161
+ promptMatchesStatus(value) &&
162
+ heldTasksMatchCount(value), {
163
+ expected: "an executor Session without an Agent definition, a worktree only for an executor Session, a recovery reason only while recovering, a prompt only with its status, and held tasks with their count",
89
164
  }));
90
165
  const emptyPayloadEffectSchema = Schema.Record(Schema.String, Schema.Never);
91
166
  const createdPayloadEffectSchema = Schema.Struct({
@@ -95,8 +170,16 @@ const createdPayloadEffectSchema = Schema.Struct({
95
170
  workingDirectory: Schema.Literals(["original", "relocated"]),
96
171
  })),
97
172
  agentDefinitionRef: Schema.optional(agentDefinitionReferenceEffectSchema),
173
+ /** The actor that opted a host-authority Session out of the sandbox. */
174
+ authorizedBy: Schema.optional(protocolIdentifierEffectSchema),
175
+ /** `none` when the Session runs with host authority. */
176
+ containment: Schema.optional(Schema.Literal("none")),
177
+ /** Where a host-authority Session starts, as the caller asked. */
178
+ cwd: Schema.optional(sessionStartDirectoryEffectSchema),
98
179
  /** The account the Session binds to, named or picked by the Node. */
99
180
  executor: Schema.optional(sessionExecutorEffectSchema),
181
+ /** The permission mode a host-authority Session passes to its vendor CLI. */
182
+ permission: Schema.optional(sessionPermissionEffectSchema),
100
183
  projectId: protocolIdentifierEffectSchema,
101
184
  workspaceId: protocolIdentifierEffectSchema,
102
185
  workspaceRevision: revisionEffectSchema,
@@ -120,6 +203,11 @@ const sessionCreatedEventEffectSchema = sessionEventWithPayloadEffectSchema("ses
120
203
  const sessionStartRequestedEventEffectSchema = sessionEventWithPayloadEffectSchema("session.start.requested", emptyPayloadEffectSchema);
121
204
  const sessionRuntimeStartedEventEffectSchema = sessionEventWithPayloadEffectSchema("session.runtime.started", runtimeReadyPayloadEffectSchema);
122
205
  const sessionRuntimeRecoveryRequestedEventEffectSchema = sessionEventWithPayloadEffectSchema("session.runtime.recovery.requested", emptyPayloadEffectSchema);
206
+ /**
207
+ * Why a recovering Session stopped retrying changed: `recovery` holds the new
208
+ * reason, and its absence means a try started and cleared it.
209
+ */
210
+ const sessionRuntimeRecoveryUpdatedEventEffectSchema = sessionEventWithPayloadEffectSchema("session.runtime.recovery.updated", Schema.Struct({ recovery: Schema.optional(failureDetailEffectSchema) }));
123
211
  const sessionRuntimeResumedEventEffectSchema = sessionEventWithPayloadEffectSchema("session.runtime.resumed", runtimeReadyPayloadEffectSchema);
124
212
  /**
125
213
  * A person stopped the Session, directly or through the emergency hold that
@@ -147,6 +235,7 @@ export const sessionEventEffectSchema = Schema.Union([
147
235
  sessionStartRequestedEventEffectSchema,
148
236
  sessionRuntimeStartedEventEffectSchema,
149
237
  sessionRuntimeRecoveryRequestedEventEffectSchema,
238
+ sessionRuntimeRecoveryUpdatedEventEffectSchema,
150
239
  sessionRuntimeResumedEventEffectSchema,
151
240
  sessionRuntimeFailedEventEffectSchema,
152
241
  sessionStoppedEventEffectSchema,
@@ -161,6 +250,25 @@ const sessionCreateBaseFields = {
161
250
  expectedRevision: Schema.Literal("0"),
162
251
  workspaceId: protocolIdentifierEffectSchema,
163
252
  };
253
+ /**
254
+ * A permission mode needs host authority. Host authority needs an executor or
255
+ * an account, and takes no Agent, definition or worktree: those are the
256
+ * sandboxed worker's options. The one role it takes is `orchestrator` with an
257
+ * `owner` label: it records the manager slot
258
+ * ([D-201](https://maia-os.vllnt.com/en/docs/decisions#d-201)) and grants no credential. A
259
+ * mode must be one the executor kind defines.
260
+ */
261
+ const hostAuthorityAllowed = (value) => value.hostAuthority === undefined
262
+ ? value.permission === undefined
263
+ : (value.connectionId !== undefined || value.executor !== undefined) &&
264
+ value.agentId === undefined &&
265
+ value.definitionRef === undefined &&
266
+ value.worktree === undefined &&
267
+ (value.role === undefined ||
268
+ (value.role === "orchestrator" && value.labels?.owner !== undefined)) &&
269
+ (value.permission === undefined ||
270
+ value.executor === undefined ||
271
+ supportsPermission(value.executor, value.permission));
164
272
  /**
165
273
  * A Session runs on a named account (`connectionId`), on the account the Node
166
274
  * picks for an executor kind (`executor`), or as a Maia agent, optionally from
@@ -168,18 +276,27 @@ const sessionCreateBaseFields = {
168
276
  * both `connectionId` and `executor`, and optionally the `model`. An Agent
169
277
  * (`agentId`) supplies the harness, Connection, model and effort itself, so it
170
278
  * excludes every one of them. `role` (default `worker`) bounds what the
171
- * Session's own credential reaches. A vendor executor Session with `worktree`
172
- * is a coding Session: it gets its own worktree from the base ref of the
173
- * Workspace's repository and may write inside it.
279
+ * Session's own credential reaches. `hostAuthority` opts one executor Session
280
+ * out of the Maia sandbox ([D-198](https://maia-os.vllnt.com/en/docs/decisions#d-198)): it
281
+ * runs in an existing `cwd` as the Node's user, takes no worktree, Agent or
282
+ * role, and passes `permission` to its vendor CLI unchanged. A vendor
283
+ * executor Session with `worktree` is a coding Session: it gets its own
284
+ * worktree from the base ref of the Workspace's repository and may write
285
+ * inside it.
174
286
  */
175
287
  export const sessionCreateParametersEffectSchema = Schema.Struct({
176
288
  ...sessionCreateBaseFields,
177
289
  agentId: Schema.optional(agentIdentifierEffectSchema),
178
290
  connectionId: Schema.optional(protocolIdentifierEffectSchema),
291
+ /** Where the Session starts; the Node checks it against the Workspace root. */
292
+ cwd: Schema.optional(sessionStartDirectoryEffectSchema),
179
293
  definitionRef: Schema.optional(agentDefinitionReferenceEffectSchema),
180
294
  effort: Schema.optional(sessionEffortEffectSchema),
181
295
  executor: Schema.optional(sessionExecutorKindEffectSchema),
296
+ hostAuthority: Schema.optional(Schema.Literal(true)),
297
+ labels: Schema.optional(sessionLabelsEffectSchema),
182
298
  model: Schema.optional(connectionModelIdEffectSchema),
299
+ permission: Schema.optional(sessionPermissionEffectSchema),
183
300
  role: Schema.optional(sessionRoleEffectSchema),
184
301
  title: Schema.optional(sessionTitleEffectSchema),
185
302
  worktree: Schema.optional(sessionWorktreeRequestEffectSchema),
@@ -191,7 +308,10 @@ export const sessionCreateParametersEffectSchema = Schema.Struct({
191
308
  value.model === undefined)) &&
192
309
  (value.definitionRef === undefined ||
193
310
  (value.connectionId === undefined && value.executor === undefined)) &&
194
- (value.model === undefined || value.connectionId !== undefined) &&
311
+ (value.model === undefined ||
312
+ value.connectionId !== undefined ||
313
+ (value.executor !== undefined &&
314
+ sessionAcceptsModel(value.executor))) &&
195
315
  (value.effort === undefined ||
196
316
  ((value.connectionId !== undefined || value.executor !== undefined) &&
197
317
  (value.executor === undefined ||
@@ -199,39 +319,46 @@ export const sessionCreateParametersEffectSchema = Schema.Struct({
199
319
  (value.worktree === undefined ||
200
320
  value.agentId !== undefined ||
201
321
  value.connectionId !== undefined ||
202
- value.executor !== undefined), {
203
- expected: "an Agent alone, an Agent definition alone, or an executor connection or kind; a model only with a connection; an effort only for an executor Session, at a level its kind supports; a worktree only for an executor Session or an Agent",
322
+ value.executor !== undefined) &&
323
+ (value.cwd === undefined ||
324
+ ((value.connectionId !== undefined || value.executor !== undefined) &&
325
+ (value.worktree === undefined || !value.cwd.startsWith("/")))) &&
326
+ hostAuthorityAllowed(value), {
327
+ expected: "an Agent alone, an Agent definition alone, or an executor connection or kind; a model only with a connection or an executor kind that takes one; an effort only for an executor Session, at a level its kind supports; a worktree only for an executor Session or an Agent; a start directory only for an executor Session, relative to the worktree when there is one; host authority only for an executor Session without a worktree or Agent (its one role is orchestrator, with an owner label), and a permission mode only with it, at a value its kind supports",
204
328
  }));
205
- const sessionSpawnHarnessEffectSchema = Schema.Literals(["maia-agent", "pi"]);
206
- export const sessionSpawnParametersEffectSchema = Schema.Struct({
207
- ...sessionCreateBaseFields,
208
- definitionRef: Schema.optional(agentDefinitionReferenceEffectSchema),
209
- harness: sessionSpawnHarnessEffectSchema,
210
- parentSessionId: protocolIdentifierEffectSchema,
211
- });
212
329
  /**
213
330
  * One page of Sessions in creation order: of one Project, or of the whole
214
331
  * Node without `projectId`; without `afterCursor` the first page and without
215
332
  * `limit` `DEFAULT_SESSION_LIST_PAGE_SIZE` Sessions. `states` keeps Sessions
216
333
  * in those states; `attention` keeps Sessions the Node reports an attention
217
- * value for.
334
+ * value for; `parentSessionId` keeps the direct children of that Session.
218
335
  */
219
336
  export const sessionListParametersEffectSchema = Schema.Struct({
220
337
  afterCursor: Schema.optional(revisionEffectSchema),
221
338
  attention: Schema.optional(Schema.Boolean),
339
+ /** With `settled`: how long a Session is idle before it counts as settled; the Node's default is one day. */
340
+ idleForSeconds: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0), Schema.isLessThanOrEqualTo(MAX_SESSION_SETTLED_IDLE_SECONDS))),
341
+ /** Sessions that carry these labels, each with the given value. */
342
+ labels: Schema.optional(sessionLabelsEffectSchema),
222
343
  limit: Schema.optional(pageSizeEffectSchema),
344
+ /** Keeps the direct children of this Session; an unknown Session has none. */
345
+ parentSessionId: Schema.optional(protocolIdentifierEffectSchema),
223
346
  projectId: Schema.optional(protocolIdentifierEffectSchema),
347
+ /** Keeps non-archived Sessions that stopped, failed or sat idle for `idleForSeconds`. */
348
+ settled: Schema.optional(Schema.Literal(true)),
224
349
  states: Schema.optional(Schema.Array(sessionStateEffectSchema).check(Schema.isMinLength(1), Schema.isMaxLength(9))),
225
- });
350
+ }).check(Schema.makeFilter((value) => value.idleForSeconds === undefined || value.settled === true, { expected: "an idle time only with the settled filter" }));
226
351
  export const sessionShowParametersEffectSchema = Schema.Struct({
227
352
  sessionId: protocolIdentifierEffectSchema,
228
353
  });
229
354
  export const sessionWaitParametersEffectSchema = Schema.Struct({
355
+ /** The wait ends when the Session is in any of these activities. */
356
+ activities: Schema.optional(Schema.Array(sessionActivityEffectSchema).check(Schema.isMinLength(1), Schema.isMaxLength(4))),
230
357
  sessionId: protocolIdentifierEffectSchema,
231
358
  /** The wait ends when the Session is in any of these states. */
232
- states: Schema.Array(sessionStateEffectSchema).check(Schema.isMinLength(1), Schema.isMaxLength(MAX_SESSION_WAIT_STATES)),
359
+ states: Schema.optional(Schema.Array(sessionStateEffectSchema).check(Schema.isMinLength(1), Schema.isMaxLength(MAX_SESSION_WAIT_STATES))),
233
360
  waitMilliseconds: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0), Schema.isLessThanOrEqualTo(MAX_SESSION_WAIT_MILLISECONDS)),
234
- });
361
+ }).check(Schema.makeFilter((value) => value.states !== undefined || value.activities !== undefined, { expected: "states, activities or both to wait for" }));
235
362
  export const sessionEventsListParametersEffectSchema = Schema.Struct({
236
363
  afterSessionCursor: revisionEffectSchema,
237
364
  limit: Schema.Int.check(Schema.isGreaterThanOrEqualTo(1), Schema.isLessThanOrEqualTo(MAX_EVENT_PAGE_SIZE)),
@@ -242,6 +369,237 @@ export const sessionStartParametersEffectSchema = Schema.Struct({
242
369
  expectedRevision: revisionEffectSchema,
243
370
  sessionId: protocolIdentifierEffectSchema,
244
371
  });
372
+ /** The command ID leaves room for the `.start` and `.send` IDs a client derives from it. */
373
+ const sessionSuccessorCommandIdEffectSchema = protocolIdentifierEffectSchema.check(Schema.isMaxLength(122));
374
+ /** What a preview seals and its confirmation repeats: the input digest, its proof and the instant the proof expires. */
375
+ const sessionPreviewProof = {
376
+ inputDigest: Schema.String.check(Schema.isPattern(/^[a-f0-9]{64}$/u)),
377
+ proof: Schema.String.check(Schema.isPattern(/^[A-Za-z0-9_-]{43}$/u)),
378
+ validUntil: recordedAtEffectSchema,
379
+ };
380
+ /**
381
+ * What a person repeats to confirm a fork: the preview's digest and proof,
382
+ * bound to the Session revision it saw, the turn the fork stops at and, for a
383
+ * coding Session, the commit its new worktree starts from.
384
+ */
385
+ const sessionForkConfirmation = {
386
+ checkpoint: Schema.optional(gitRevisionEffectSchema),
387
+ commandId: sessionSuccessorCommandIdEffectSchema,
388
+ expectedRevision: revisionEffectSchema,
389
+ ...sessionPreviewProof,
390
+ sessionId: protocolIdentifierEffectSchema,
391
+ turnId: protocolIdentifierEffectSchema,
392
+ };
393
+ /** A fork stops at a completed turn of the Session; without `turnId` it takes the newest one. */
394
+ export const sessionForkPreviewParametersEffectSchema = Schema.Struct({
395
+ commandId: sessionSuccessorCommandIdEffectSchema,
396
+ sessionId: protocolIdentifierEffectSchema,
397
+ turnId: Schema.optional(protocolIdentifierEffectSchema),
398
+ });
399
+ export const sessionForkConfirmParametersEffectSchema = Schema.Struct(sessionForkConfirmation);
400
+ /**
401
+ * What a switch moves a Session to: an executor, a connection, a model or any
402
+ * mix. What the target leaves out stays as the Session has it, except that a
403
+ * new executor takes the Node's pick of its accounts, not the old account.
404
+ */
405
+ const sessionSwitchTargetEffectSchema = Schema.Struct({
406
+ connectionId: Schema.optional(protocolIdentifierEffectSchema),
407
+ executor: Schema.optional(sessionExecutorKindEffectSchema),
408
+ model: Schema.optional(connectionModelIdEffectSchema),
409
+ }).check(Schema.makeFilter((value) => value.connectionId !== undefined ||
410
+ value.executor !== undefined ||
411
+ value.model !== undefined, { expected: "an executor, a connection or a model to switch to" }));
412
+ /** What a person repeats to confirm a switch: the preview's digest and proof, bound to the Session revision it saw. */
413
+ const sessionSwitchConfirmation = {
414
+ commandId: sessionSuccessorCommandIdEffectSchema,
415
+ expectedRevision: revisionEffectSchema,
416
+ ...sessionPreviewProof,
417
+ sessionId: protocolIdentifierEffectSchema,
418
+ target: sessionSwitchTargetEffectSchema,
419
+ };
420
+ export const sessionSwitchPreviewParametersEffectSchema = Schema.Struct({
421
+ commandId: sessionSwitchConfirmation.commandId,
422
+ sessionId: protocolIdentifierEffectSchema,
423
+ target: sessionSwitchTargetEffectSchema,
424
+ });
425
+ export const sessionSwitchConfirmParametersEffectSchema = Schema.Struct(sessionSwitchConfirmation);
426
+ const sha256HexEffectSchema = Schema.String.check(Schema.isPattern(/^[a-f0-9]{64}$/u));
427
+ /**
428
+ * What a person repeats to confirm a Project setup script: the preview's
429
+ * digest and proof, bound to the Session revision it saw and to the digest of
430
+ * the script as the worktree holds it.
431
+ */
432
+ const sessionSetupConfirmation = {
433
+ commandId: protocolIdentifierEffectSchema,
434
+ expectedRevision: revisionEffectSchema,
435
+ ...sessionPreviewProof,
436
+ sessionId: protocolIdentifierEffectSchema,
437
+ setupDigest: sha256HexEffectSchema,
438
+ };
439
+ /** The script a coding Session's worktree would run: its command and the digest of each worktree file the command names. */
440
+ const sessionSetupScriptEffectSchema = Schema.Struct({
441
+ command: Schema.Array(Schema.String.check(Schema.isMaxLength(1024))).check(Schema.isBetweenLength(1, 32)),
442
+ files: Schema.Array(Schema.Struct({
443
+ path: Schema.String.check(Schema.isMaxLength(1024)),
444
+ sha256: sha256HexEffectSchema,
445
+ })).check(Schema.isMaxLength(32)),
446
+ });
447
+ export const sessionSetupPreviewParametersEffectSchema = Schema.Struct({
448
+ commandId: protocolIdentifierEffectSchema,
449
+ sessionId: protocolIdentifierEffectSchema,
450
+ });
451
+ export const sessionSetupConfirmParametersEffectSchema = Schema.Struct(sessionSetupConfirmation);
452
+ const spawnCapBounded = (bounds) => Schema.Int.check(Schema.isBetween(bounds));
453
+ /** The three numbers a Node holds every spawned child to (CAP). */
454
+ export const sessionSpawnCapsEffectSchema = Schema.Struct({
455
+ concurrency: spawnCapBounded(SESSION_SPAWN_CAP_BOUNDS.concurrency),
456
+ depth: spawnCapBounded(SESSION_SPAWN_CAP_BOUNDS.depth),
457
+ fanOut: spawnCapBounded(SESSION_SPAWN_CAP_BOUNDS.fanOut),
458
+ });
459
+ /** Revision `0` is the defaults of a Node whose caps no person has changed. */
460
+ export const sessionSpawnCapsRecordEffectSchema = Schema.Struct({
461
+ caps: sessionSpawnCapsEffectSchema,
462
+ revision: aggregateRevisionEffectSchema,
463
+ source: Schema.Literals(["default", "node"]),
464
+ updatedAt: Schema.optional(recordedAtEffectSchema),
465
+ }).check(Schema.makeFilter((value) => value.source === "default"
466
+ ? value.revision === "0" &&
467
+ value.updatedAt === undefined &&
468
+ value.caps.concurrency === DEFAULT_SESSION_SPAWN_CAPS.concurrency &&
469
+ value.caps.depth === DEFAULT_SESSION_SPAWN_CAPS.depth &&
470
+ value.caps.fanOut === DEFAULT_SESSION_SPAWN_CAPS.fanOut
471
+ : value.revision !== "0" && value.updatedAt !== undefined, {
472
+ expected: "the default caps at revision 0 without updatedAt, or changed caps with both",
473
+ }));
474
+ const childCount = Schema.Int.check(Schema.isBetween({ maximum: MAX_SESSION_SPAWN_CHILD_COUNT, minimum: 0 }));
475
+ /** A parent's children: every one it spawned (`total`), and those that have not ended (`live`). */
476
+ export const sessionSpawnChildrenEffectSchema = Schema.Struct({
477
+ live: childCount,
478
+ total: childCount,
479
+ }).check(Schema.makeFilter((value) => value.live <= value.total, {
480
+ expected: "no more live children than children",
481
+ }));
482
+ /** A Session's spawn depth: the spawns between it and the Session at the root of its tree, which has depth 0. */
483
+ export const sessionSpawnDepthEffectSchema = Schema.Int.check(Schema.isBetween({ maximum: MAX_SESSION_SPAWN_DEPTH, minimum: 0 }));
484
+ export const sessionSpawnCapsShowParametersEffectSchema = Schema.Struct({
485
+ sessionId: Schema.optional(protocolIdentifierEffectSchema),
486
+ });
487
+ /**
488
+ * What one Session uses of the caps on this Node: its children here, and its
489
+ * depth and role when this Node holds it. A client adds the children of every
490
+ * Node; an orchestrator's children all live on its own Node (D-346).
491
+ */
492
+ export const sessionSpawnStandingEffectSchema = Schema.Struct({
493
+ children: sessionSpawnChildrenEffectSchema,
494
+ depth: Schema.optional(sessionSpawnDepthEffectSchema),
495
+ role: Schema.optional(sessionRoleEffectSchema),
496
+ sessionId: protocolIdentifierEffectSchema,
497
+ });
498
+ export const sessionSpawnCapsShowResultEffectSchema = Schema.Struct({
499
+ caps: sessionSpawnCapsRecordEffectSchema,
500
+ method: Schema.Literal("session.spawn-caps.show"),
501
+ standing: Schema.optional(sessionSpawnStandingEffectSchema),
502
+ });
503
+ const spawnCapsChange = {
504
+ caps: sessionSpawnCapsEffectSchema,
505
+ commandId: protocolIdentifierEffectSchema,
506
+ expectedRevision: aggregateRevisionEffectSchema,
507
+ };
508
+ /** What a caps preview seals and its confirmation repeats. */
509
+ const spawnCapsConfirmation = {
510
+ inputDigest: Schema.String.check(Schema.isPattern(/^[a-f0-9]{64}$/u)),
511
+ proof: Schema.String.check(Schema.isPattern(/^[A-Za-z0-9_-]{43}$/u)),
512
+ validUntil: recordedAtEffectSchema,
513
+ };
514
+ /** A person previews new caps at the revision they read, then confirms that exact preview. */
515
+ export const sessionSpawnCapsPreviewParametersEffectSchema = Schema.Struct(spawnCapsChange);
516
+ export const sessionSpawnCapsConfirmParametersEffectSchema = Schema.Struct({
517
+ ...spawnCapsChange,
518
+ ...spawnCapsConfirmation,
519
+ });
520
+ /** The caps now and the caps the confirmation would leave, sealed for it. */
521
+ export const sessionSpawnCapsPreviewResultEffectSchema = Schema.Struct({
522
+ ...spawnCapsChange,
523
+ ...spawnCapsConfirmation,
524
+ current: sessionSpawnCapsRecordEffectSchema,
525
+ method: Schema.Literal("session.spawn-caps.preview"),
526
+ });
527
+ export const sessionSpawnCapsConfirmResultEffectSchema = Schema.Struct({
528
+ caps: sessionSpawnCapsRecordEffectSchema,
529
+ delivery: Schema.Literals(["new", "duplicate"]),
530
+ method: Schema.Literal("session.spawn-caps.confirm"),
531
+ receipt: commandReceiptEffectSchema,
532
+ }).check(Schema.makeFilter((result) => result.caps.source === "node" &&
533
+ result.receipt.method === result.method &&
534
+ result.receipt.target.type === SESSION_SPAWN_CAPS_TARGET.type &&
535
+ result.receipt.target.id === SESSION_SPAWN_CAPS_TARGET.id &&
536
+ result.receipt.aggregateRevision === result.caps.revision, { expected: "changed caps under their own receipt" }));
537
+ export const sessionSpawnCapsRequestEffectSchema = Schema.Union([
538
+ Schema.Struct({
539
+ method: Schema.Literal("session.spawn-caps.show"),
540
+ parameters: sessionSpawnCapsShowParametersEffectSchema,
541
+ }),
542
+ Schema.Struct({
543
+ method: Schema.Literal("session.spawn-caps.preview"),
544
+ parameters: sessionSpawnCapsPreviewParametersEffectSchema,
545
+ }),
546
+ Schema.Struct({
547
+ method: Schema.Literal("session.spawn-caps.confirm"),
548
+ parameters: sessionSpawnCapsConfirmParametersEffectSchema,
549
+ }),
550
+ ]);
551
+ export const sessionSpawnCapsResultEffectSchema = Schema.Union([
552
+ sessionSpawnCapsShowResultEffectSchema,
553
+ sessionSpawnCapsPreviewResultEffectSchema,
554
+ sessionSpawnCapsConfirmResultEffectSchema,
555
+ ]);
556
+ /**
557
+ * The grant a child's parent holds: host authority and the permission mode it
558
+ * passes to its vendor CLI. The caller read it from the parent's own Node. A
559
+ * Node that holds the parent checks it against the parent's record, and one
560
+ * that does not cannot, so it applies the grant as given. The parent's spawn
561
+ * depth and its children on every other Node come the same way, for the caps
562
+ * (CAP): a Node adds its own children of the parent to the claimed ones, and
563
+ * holds the depth to the larger of the claim and its own (D-329). The role
564
+ * comes from the parent's Node too: a Node that does not hold an orchestrator
565
+ * parent refuses its child, since an orchestrator's own Node counts every
566
+ * child it has (D-346).
567
+ */
568
+ const sessionSpawnParentEffectSchema = Schema.Struct({
569
+ children: sessionSpawnChildrenEffectSchema,
570
+ depth: sessionSpawnDepthEffectSchema,
571
+ hostAuthority: Schema.optional(Schema.Literal(true)),
572
+ permission: Schema.optional(sessionPermissionEffectSchema),
573
+ role: sessionRoleEffectSchema,
574
+ sessionId: protocolIdentifierEffectSchema,
575
+ }).check(Schema.makeFilter((value) => value.permission === undefined || value.hostAuthority === true, { expected: "a permission mode only with host authority" }));
576
+ /**
577
+ * An executor Session spawned under a parent that may live on another Node:
578
+ * the Workspace on this Node, the executor kind, and the grant the child asks
579
+ * for, which may not be wider than the parent's.
580
+ */
581
+ const sessionSpawnChild = {
582
+ commandId: sessionSuccessorCommandIdEffectSchema,
583
+ executor: sessionExecutorKindEffectSchema,
584
+ hostAuthority: Schema.optional(Schema.Literal(true)),
585
+ parent: sessionSpawnParentEffectSchema,
586
+ permission: Schema.optional(sessionPermissionEffectSchema),
587
+ workspaceId: protocolIdentifierEffectSchema,
588
+ };
589
+ const sessionSpawnGrantAllowed = (value) => value.permission === undefined ||
590
+ (value.hostAuthority === true &&
591
+ supportsPermission(value.executor, value.permission));
592
+ const sessionSpawnGrantFilter = Schema.makeFilter(sessionSpawnGrantAllowed, {
593
+ expected: "a permission mode only with host authority, at a value the executor kind supports",
594
+ });
595
+ /** What a person repeats to confirm a spawn: the preview's digest and proof, bound to the child, its grant and its parent. */
596
+ const sessionSpawnConfirmation = {
597
+ ...sessionSpawnChild,
598
+ expectedRevision: Schema.Literal("0"),
599
+ ...sessionPreviewProof,
600
+ };
601
+ export const sessionSpawnPreviewParametersEffectSchema = Schema.Struct(sessionSpawnChild).check(sessionSpawnGrantFilter);
602
+ export const sessionSpawnConfirmParametersEffectSchema = Schema.Struct(sessionSpawnConfirmation).check(sessionSpawnGrantFilter);
245
603
  /** A new title at the Session's current revision. */
246
604
  export const sessionRenameParametersEffectSchema = Schema.Struct({
247
605
  commandId: protocolIdentifierEffectSchema,
@@ -249,9 +607,24 @@ export const sessionRenameParametersEffectSchema = Schema.Struct({
249
607
  sessionId: protocolIdentifierEffectSchema,
250
608
  title: sessionTitleEffectSchema,
251
609
  });
252
- /** Stop and resume take the same compare-and-set input as start. */
610
+ /** Stop takes the same compare-and-set input as start. */
253
611
  export const sessionStopParametersEffectSchema = sessionStartParametersEffectSchema;
254
- export const sessionResumeParametersEffectSchema = sessionStartParametersEffectSchema;
612
+ /**
613
+ * A stopped or failed child that resumes is live again, so it counts against
614
+ * its parent's concurrency cap (D-336). The caller reads the parent's children
615
+ * on every Node but the one that holds the child, as a spawn does, and the
616
+ * Node adds the live children it holds. The Node refuses a child without this
617
+ * claim; a Session with no parent needs none.
618
+ */
619
+ const sessionResumeParentEffectSchema = Schema.Struct({
620
+ children: sessionSpawnChildrenEffectSchema,
621
+ sessionId: protocolIdentifierEffectSchema,
622
+ });
623
+ /** Resume takes the compare-and-set input of start, and the parent claim of a child. */
624
+ export const sessionResumeParametersEffectSchema = Schema.Struct({
625
+ ...sessionStartParametersEffectSchema.fields,
626
+ parent: Schema.optional(sessionResumeParentEffectSchema),
627
+ });
255
628
  export const sessionMessageSendParametersEffectSchema = Schema.Struct({
256
629
  body: mailboxBodyEffectSchema,
257
630
  commandId: protocolIdentifierEffectSchema,
@@ -357,21 +730,74 @@ export const sessionCreateResultEffectSchema = Schema.Struct({
357
730
  receipt: commandReceiptEffectSchema,
358
731
  session: sessionEffectSchema,
359
732
  });
360
- const sessionSpawnResultStructEffectSchema = Schema.Struct({
733
+ /** What a fork will do: the Session revision and turn it starts from, the commit a coding Session's worktree starts at, and the path that carries the context over. */
734
+ export const sessionForkPreviewResultEffectSchema = Schema.Struct({
735
+ ...sessionForkConfirmation,
736
+ method: Schema.Literal("session.fork.preview"),
737
+ path: Schema.Literal("context-handoff"),
738
+ });
739
+ /** The new Session under its create receipt, and `handoff`, the text of its first turn. */
740
+ const sessionSuccessorEffectFields = {
361
741
  delivery: Schema.Literals(["new", "duplicate"]),
362
- harness: sessionSpawnHarnessEffectSchema,
363
- method: Schema.Literal("session.spawn"),
364
- parentSessionId: protocolIdentifierEffectSchema,
742
+ handoff: Schema.String,
743
+ path: Schema.Literal("context-handoff"),
365
744
  receipt: commandReceiptEffectSchema,
366
745
  session: sessionEffectSchema,
746
+ sourceSessionId: protocolIdentifierEffectSchema,
747
+ };
748
+ /** The fork's Session: the source keeps its binding, its worktree and its history. */
749
+ export const sessionForkConfirmResultEffectSchema = Schema.Struct({
750
+ ...sessionSuccessorEffectFields,
751
+ method: Schema.Literal("session.fork.confirm"),
752
+ });
753
+ /** What a switch will do: the Session revision it starts from, and the path that carries the context over. */
754
+ export const sessionSwitchPreviewResultEffectSchema = Schema.Struct({
755
+ ...sessionSwitchConfirmation,
756
+ method: Schema.Literal("session.switch.preview"),
757
+ path: Schema.Literal("context-handoff"),
758
+ });
759
+ /** The successor Session, shaped as a fork's result: the source keeps its binding and its history. */
760
+ export const sessionSwitchConfirmResultEffectSchema = Schema.Struct({
761
+ ...sessionSuccessorEffectFields,
762
+ method: Schema.Literal("session.switch.confirm"),
367
763
  });
368
- export const sessionSpawnResultEffectSchema = sessionSpawnResultStructEffectSchema.check(Schema.makeFilter((value) => value.receipt.method === "session.spawn" &&
764
+ /** What confirming will approve: the script and its digest, and whether the Project has approved that digest already. */
765
+ export const sessionSetupPreviewResultEffectSchema = Schema.Struct({
766
+ ...sessionSetupConfirmation,
767
+ approved: Schema.Boolean,
768
+ method: Schema.Literal("session.setup.preview"),
769
+ setup: sessionSetupScriptEffectSchema,
770
+ });
771
+ /** The approval under its receipt: the Project runs a script with this digest without asking again. */
772
+ export const sessionSetupConfirmResultEffectSchema = Schema.Struct({
773
+ delivery: Schema.Literals(["new", "duplicate"]),
774
+ method: Schema.Literal("session.setup.confirm"),
775
+ receipt: commandReceiptEffectSchema,
776
+ sessionId: protocolIdentifierEffectSchema,
777
+ setupDigest: sha256HexEffectSchema,
778
+ }).check(Schema.makeFilter((result) => result.receipt.state === "succeeded" &&
779
+ result.receipt.method === result.method &&
780
+ result.receipt.target.type === "session" &&
781
+ result.receipt.target.id === result.sessionId, { expected: "a setup approval matching its receipt" }));
782
+ /** What a spawn will do: the child, its grant and its parent, sealed for the confirmation. */
783
+ export const sessionSpawnPreviewResultEffectSchema = Schema.Struct({
784
+ ...sessionSpawnConfirmation,
785
+ method: Schema.Literal("session.spawn.preview"),
786
+ }).check(sessionSpawnGrantFilter);
787
+ /** The child Session, created under a create receipt, and the parent it names. */
788
+ export const sessionSpawnConfirmResultEffectSchema = Schema.Struct({
789
+ delivery: Schema.Literals(["new", "duplicate"]),
790
+ method: Schema.Literal("session.spawn.confirm"),
791
+ parentSessionId: protocolIdentifierEffectSchema,
792
+ receipt: commandReceiptEffectSchema,
793
+ session: sessionEffectSchema,
794
+ }).check(Schema.makeFilter((value) => value.receipt.method === "session.create" &&
369
795
  value.receipt.state === "succeeded" &&
370
- value.receipt.target.id === value.session.id &&
371
796
  value.receipt.target.type === "session" &&
372
- value.session.id !== value.parentSessionId &&
373
- value.session.workspaceId.length > 0, {
374
- expected: "a spawned child Session receipt matching its parent and harness",
797
+ value.receipt.target.id === value.session.id &&
798
+ value.session.executor !== undefined &&
799
+ value.session.parentSessionId === value.parentSessionId, {
800
+ expected: "a spawned executor Session whose create receipt and parent match",
375
801
  }));
376
802
  /** Why a listed Session needs a person now; a listed Session that needs nothing is absent. */
377
803
  const sessionListAttentionEffectSchema = Schema.Struct({
@@ -389,10 +815,68 @@ export const sessionListResultEffectSchema = Schema.Struct({
389
815
  return (new Set(flagged).size === flagged.length &&
390
816
  flagged.every((id) => listed.has(id)));
391
817
  }, { expected: "attention only for listed Sessions, once each" }));
818
+ /**
819
+ * A child on another Node, as the Node that holds its parent records it
820
+ * (D-SPAWN, D-236). The client that created the child links it; a cancel its
821
+ * Node did not answer by the fleet ask deadline marks it `orphaned`, never
822
+ * stopped; a client that reached its Node again reconciles it, recording the
823
+ * state that Node reported. `observedState` is always a state the child's own
824
+ * Node reported.
825
+ */
826
+ export const sessionRemoteChildEffectSchema = Schema.Struct({
827
+ linkedAt: recordedAtEffectSchema,
828
+ node: remoteNodeNameEffectSchema,
829
+ observedState: Schema.optional(sessionStateEffectSchema),
830
+ orphanedAt: Schema.optional(recordedAtEffectSchema),
831
+ sessionId: protocolIdentifierEffectSchema,
832
+ state: Schema.Literals(["linked", "orphaned"]),
833
+ }).check(Schema.makeFilter((value) => (value.state === "orphaned") === (value.orphanedAt !== undefined), {
834
+ expected: "an orphaned child with the instant it was orphaned, and only then",
835
+ }));
836
+ /** The most children on other Nodes one parent records: the highest fan-out cap. */
837
+ const MAX_REMOTE_CHILDREN = SESSION_SPAWN_CAP_BOUNDS.fanOut.maximum;
838
+ /** `remoteChildren`: the parent's children on other Nodes this Node recorded, oldest link first; absent when there are none. */
392
839
  export const sessionShowResultEffectSchema = Schema.Struct({
393
840
  method: Schema.Literal("session.show"),
841
+ remoteChildren: Schema.optional(Schema.Array(sessionRemoteChildEffectSchema).check(Schema.isBetweenLength(1, MAX_REMOTE_CHILDREN))),
394
842
  session: sessionEffectSchema,
395
843
  });
844
+ /**
845
+ * What a client records of a child on another Node on the Node that holds
846
+ * its parent: `linked` after it created the child, `orphaned` when the
847
+ * child's Node gave no reply to a cancel by the fleet ask deadline, and
848
+ * `reconciled` with the state the child's Node reported once it answered
849
+ * again. `reconciled` must carry a state and `linked` may, each a state the
850
+ * child's Node reported; `orphaned` carries none.
851
+ */
852
+ export const sessionSpawnRecordParametersEffectSchema = Schema.Struct({
853
+ childSessionId: protocolIdentifierEffectSchema,
854
+ commandId: protocolIdentifierEffectSchema,
855
+ node: remoteNodeNameEffectSchema,
856
+ outcome: Schema.Literals(["linked", "orphaned", "reconciled"]),
857
+ parentSessionId: protocolIdentifierEffectSchema,
858
+ state: Schema.optional(sessionStateEffectSchema),
859
+ }).check(Schema.makeFilter((value) => value.childSessionId !== value.parentSessionId &&
860
+ (value.outcome === "reconciled"
861
+ ? value.state !== undefined
862
+ : value.outcome === "linked" || value.state === undefined), {
863
+ expected: "a child other than its parent; a state with reconciled, none with orphaned",
864
+ }));
865
+ /** The child record after the change, under its own receipt on the child. */
866
+ export const sessionSpawnRecordResultEffectSchema = Schema.Struct({
867
+ child: sessionRemoteChildEffectSchema,
868
+ delivery: Schema.Literals(["new", "duplicate"]),
869
+ method: Schema.Literal("session.spawn.record"),
870
+ parentSessionId: protocolIdentifierEffectSchema,
871
+ receipt: commandReceiptEffectSchema,
872
+ }).check(Schema.makeFilter((value) => value.receipt.state === "succeeded" &&
873
+ value.receipt.method === value.method &&
874
+ value.receipt.target.type === SESSION_CHILD_TARGET_TYPE &&
875
+ value.receipt.target.id === value.child.sessionId, { expected: "a child record under its own receipt" }));
876
+ export const sessionSpawnRecordRequestEffectSchema = Schema.Struct({
877
+ method: Schema.Literal("session.spawn.record"),
878
+ parameters: sessionSpawnRecordParametersEffectSchema,
879
+ });
396
880
  /** `satisfied` is false when the bounded wait ended first; `session` is then its last read. */
397
881
  export const sessionWaitResultEffectSchema = Schema.Struct({
398
882
  method: Schema.Literal("session.wait"),
@@ -404,6 +888,8 @@ export const sessionEventsListResultEffectSchema = Schema.Struct({
404
888
  items: Schema.Array(sessionEventEffectSchema).check(Schema.isMaxLength(MAX_EVENT_PAGE_SIZE)),
405
889
  method: Schema.Literal("session.events.list"),
406
890
  nextSessionCursor: Schema.optional(revisionEffectSchema),
891
+ /** Set when a prune removed events after the caller's cursor. Send `nextSessionCursor` as `afterSessionCursor`; with none, send the last item's cursor. On an empty page keep the cursor you sent, and send "0" if you have none. Never send this marker. */
892
+ oldestRetainedCursor: Schema.optional(revisionEffectSchema),
407
893
  sessionId: protocolIdentifierEffectSchema,
408
894
  });
409
895
  export const sessionStartResultEffectSchema = Schema.Struct({
@@ -444,6 +930,9 @@ export const sessionArchiveResultEffectSchema = Schema.Struct({
444
930
  method: Schema.Literal("session.archive"),
445
931
  receipt: commandReceiptEffectSchema,
446
932
  session: sessionEffectSchema,
933
+ /** The caller's summary and transcript path, as the archive recorded them. */
934
+ summary: Schema.optional(sessionArchiveSummaryEffectSchema),
935
+ transcriptPath: Schema.optional(sessionTranscriptPathEffectSchema),
447
936
  }).check(Schema.makeFilter(({ archive, receipt, session }) => receipt.method === "session.archive" &&
448
937
  receipt.target.type === "session" &&
449
938
  receipt.target.id === session.id &&
@@ -470,10 +959,6 @@ export const sessionRequestPayloadEffectSchema = Schema.Union([
470
959
  method: Schema.Literal("session.wait"),
471
960
  parameters: sessionWaitParametersEffectSchema,
472
961
  }),
473
- Schema.Struct({
474
- method: Schema.Literal("session.spawn"),
475
- parameters: sessionSpawnParametersEffectSchema,
476
- }),
477
962
  Schema.Struct({
478
963
  method: Schema.Literal("session.events.list"),
479
964
  parameters: sessionEventsListParametersEffectSchema,
@@ -510,6 +995,10 @@ export const sessionRequestPayloadEffectSchema = Schema.Union([
510
995
  method: Schema.Literal("session.diff"),
511
996
  parameters: sessionDiffParametersEffectSchema,
512
997
  }),
998
+ Schema.Struct({
999
+ method: Schema.Literal("session.git.status"),
1000
+ parameters: sessionGitStatusParametersEffectSchema,
1001
+ }),
513
1002
  Schema.Struct({
514
1003
  method: Schema.Literal("session.archive"),
515
1004
  parameters: sessionArchiveParametersEffectSchema,
@@ -518,6 +1007,38 @@ export const sessionRequestPayloadEffectSchema = Schema.Union([
518
1007
  method: Schema.Literal("session.rename"),
519
1008
  parameters: sessionRenameParametersEffectSchema,
520
1009
  }),
1010
+ Schema.Struct({
1011
+ method: Schema.Literal("session.fork.preview"),
1012
+ parameters: sessionForkPreviewParametersEffectSchema,
1013
+ }),
1014
+ Schema.Struct({
1015
+ method: Schema.Literal("session.fork.confirm"),
1016
+ parameters: sessionForkConfirmParametersEffectSchema,
1017
+ }),
1018
+ Schema.Struct({
1019
+ method: Schema.Literal("session.switch.preview"),
1020
+ parameters: sessionSwitchPreviewParametersEffectSchema,
1021
+ }),
1022
+ Schema.Struct({
1023
+ method: Schema.Literal("session.switch.confirm"),
1024
+ parameters: sessionSwitchConfirmParametersEffectSchema,
1025
+ }),
1026
+ Schema.Struct({
1027
+ method: Schema.Literal("session.setup.preview"),
1028
+ parameters: sessionSetupPreviewParametersEffectSchema,
1029
+ }),
1030
+ Schema.Struct({
1031
+ method: Schema.Literal("session.setup.confirm"),
1032
+ parameters: sessionSetupConfirmParametersEffectSchema,
1033
+ }),
1034
+ Schema.Struct({
1035
+ method: Schema.Literal("session.spawn.preview"),
1036
+ parameters: sessionSpawnPreviewParametersEffectSchema,
1037
+ }),
1038
+ Schema.Struct({
1039
+ method: Schema.Literal("session.spawn.confirm"),
1040
+ parameters: sessionSpawnConfirmParametersEffectSchema,
1041
+ }),
521
1042
  ]);
522
1043
  export const sessionSuccessResultEffectSchema = Schema.Union([
523
1044
  sessionCreateResultEffectSchema,
@@ -528,16 +1049,24 @@ export const sessionSuccessResultEffectSchema = Schema.Union([
528
1049
  sessionObserveResultEffectSchema,
529
1050
  sessionShowResultEffectSchema,
530
1051
  sessionWaitResultEffectSchema,
531
- sessionSpawnResultEffectSchema,
532
1052
  sessionEventsListResultEffectSchema,
533
1053
  sessionStartResultEffectSchema,
534
1054
  sessionStopResultEffectSchema,
535
1055
  sessionResumeResultEffectSchema,
536
1056
  sessionDiffResultEffectSchema,
1057
+ sessionGitStatusResultEffectSchema,
537
1058
  sessionArchiveResultEffectSchema,
538
1059
  sessionRenameResultEffectSchema,
1060
+ sessionForkPreviewResultEffectSchema,
1061
+ sessionForkConfirmResultEffectSchema,
1062
+ sessionSwitchPreviewResultEffectSchema,
1063
+ sessionSwitchConfirmResultEffectSchema,
1064
+ sessionSetupPreviewResultEffectSchema,
1065
+ sessionSetupConfirmResultEffectSchema,
1066
+ sessionSpawnPreviewResultEffectSchema,
1067
+ sessionSpawnConfirmResultEffectSchema,
539
1068
  ]);
540
1069
  export { agentPermissionRequestEffectSchema, agentPermissionResultEffectSchema, } from "./agent-permission-effect-schema.js";
541
- export { sessionObservationEffectSchema, sessionObserveResultEffectSchema, } from "./observation-effect-schema.js";
542
- export { sessionArchiveParametersEffectSchema, sessionDiffParametersEffectSchema, sessionDiffResultEffectSchema, } from "./worktree-effect-schema.js";
1070
+ export { sessionExecutorKindEffectSchema, sessionObservationEffectSchema, sessionObserveResultEffectSchema, } from "./observation-effect-schema.js";
1071
+ export { sessionArchiveParametersEffectSchema, sessionDiffParametersEffectSchema, sessionDiffResultEffectSchema, sessionGitStatusParametersEffectSchema, sessionGitStatusResultEffectSchema, } from "./worktree-effect-schema.js";
543
1072
  //# sourceMappingURL=effect-schema.js.map