@maiaos/cli 0.1.0-canary.10 → 0.1.0-canary.100

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 (539) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +21 -15
  3. package/dist/address-space/address-space.js +21 -2
  4. package/dist/address-space/index.js +1 -1
  5. package/dist/agents/client.d.ts +48 -27
  6. package/dist/agents/client.js +10 -3
  7. package/dist/agents/commands.d.ts +1 -0
  8. package/dist/agents/commands.js +24 -2
  9. package/dist/agents/index.d.ts +1 -1
  10. package/dist/agents/index.js +1 -1
  11. package/dist/agents/input.js +6 -0
  12. package/dist/agents/output/format.js +11 -0
  13. package/dist/agents/tree/tree.js +16 -4
  14. package/dist/bin/maia.NOTICES.txt +1 -1
  15. package/dist/bin/maia.cdx.json +70 -19
  16. package/dist/bin/maia.mjs +1 -1
  17. package/dist/board/client.d.ts +27 -0
  18. package/dist/board/client.js +40 -0
  19. package/dist/board/commands.d.ts +28 -0
  20. package/dist/board/commands.js +52 -0
  21. package/dist/board/index.d.ts +3 -0
  22. package/dist/board/index.js +3 -0
  23. package/dist/board/input.js +339 -0
  24. package/dist/board/output/format.js +175 -0
  25. package/dist/board/output/index.js +2 -0
  26. package/dist/board/plan.js +47 -0
  27. package/dist/board/tree/index.js +2 -0
  28. package/dist/board/tree/tree.js +161 -0
  29. package/dist/cli/cli.d.ts +11 -3
  30. package/dist/cli/cli.js +215 -12
  31. package/dist/cli/index.d.ts +1 -1
  32. package/dist/cli/index.js +1 -1
  33. package/dist/cli/log-level.d.ts +11 -0
  34. package/dist/cli/log-level.js +14 -0
  35. package/dist/command-line/context.d.ts +25 -7
  36. package/dist/command-line/emit/index.d.ts +4 -0
  37. package/dist/command-line/emit/index.js +4 -0
  38. package/dist/command-line/{output.d.ts → emit/output.d.ts} +7 -3
  39. package/dist/command-line/{output.js → emit/output.js} +13 -5
  40. package/dist/command-line/{rows.d.ts → emit/rows.d.ts} +2 -0
  41. package/dist/command-line/{rows.js → emit/rows.js} +6 -0
  42. package/dist/command-line/index.d.ts +6 -6
  43. package/dist/command-line/index.js +5 -6
  44. package/dist/command-line/input/arguments.d.ts +6 -0
  45. package/dist/command-line/input/arguments.js +20 -0
  46. package/dist/command-line/input/index.d.ts +3 -2
  47. package/dist/command-line/input/index.js +3 -2
  48. package/dist/command-line/input/manager-options.d.ts +10 -0
  49. package/dist/command-line/input/manager-options.js +38 -0
  50. package/dist/command-line/input/prompt.d.ts +1 -0
  51. package/dist/command-line/input/prompt.js +1 -0
  52. package/dist/command-line/two-phase/index.d.ts +2 -0
  53. package/dist/command-line/two-phase/index.js +2 -0
  54. package/dist/command-line/{two-phase.d.ts → two-phase/two-phase.d.ts} +14 -14
  55. package/dist/command-line/{two-phase.js → two-phase/two-phase.js} +11 -11
  56. package/dist/command-receipt/command.js +1 -1
  57. package/dist/command-tree/commands.d.ts +1 -1
  58. package/dist/command-tree/commands.js +1 -5
  59. package/dist/command-tree/deprecated.d.ts +2 -0
  60. package/dist/command-tree/deprecated.js +29 -0
  61. package/dist/command-tree/grammar.js +2 -0
  62. package/dist/command-tree/help.d.ts +2 -2
  63. package/dist/command-tree/help.js +13 -15
  64. package/dist/command-tree/index.d.ts +1 -0
  65. package/dist/command-tree/index.js +1 -0
  66. package/dist/command-tree/local.js +27 -7
  67. package/dist/command-tree/placeholder.js +1 -1
  68. package/dist/command-tree/row.d.ts +1 -0
  69. package/dist/command-tree/tree.d.ts +2 -1
  70. package/dist/command-tree/tree.js +35 -4
  71. package/dist/connection/client.d.ts +72 -18
  72. package/dist/connection/client.js +1 -0
  73. package/dist/connection/executors/executors.d.ts +18 -0
  74. package/dist/connection/executors/executors.js +95 -0
  75. package/dist/connection/executors/index.d.ts +2 -0
  76. package/dist/connection/executors/index.js +2 -0
  77. package/dist/connection/executors/reading.js +22 -0
  78. package/dist/connection/index.d.ts +1 -0
  79. package/dist/connection/index.js +1 -0
  80. package/dist/connection/input.js +4 -4
  81. package/dist/connection/login.d.ts +1 -1
  82. package/dist/connection/login.js +4 -3
  83. package/dist/connection/output/format.js +6 -3
  84. package/dist/connection/output/index.d.ts +1 -1
  85. package/dist/connection/output/index.js +1 -1
  86. package/dist/connection/resolve.d.ts +5 -0
  87. package/dist/connection/setup-file.js +227 -0
  88. package/dist/connection/setup-project.js +138 -0
  89. package/dist/connection/system.js +126 -61
  90. package/dist/connection/tree/tree.js +179 -10
  91. package/dist/container/client.d.ts +2 -0
  92. package/dist/events/commands.js +65 -0
  93. package/dist/events/index.js +2 -0
  94. package/dist/events/tree/index.js +2 -0
  95. package/dist/events/tree/tree.js +17 -0
  96. package/dist/fleet/fleet.d.ts +7 -8
  97. package/dist/fleet/fleet.js +18 -6
  98. package/dist/fleet/index.d.ts +1 -1
  99. package/dist/fleet/index.js +1 -1
  100. package/dist/github/client.d.ts +189 -0
  101. package/dist/github/client.js +16 -0
  102. package/dist/github/commands.d.ts +17 -0
  103. package/dist/github/commands.js +81 -0
  104. package/dist/github/index.d.ts +3 -0
  105. package/dist/github/index.js +3 -0
  106. package/dist/github/input.js +114 -0
  107. package/dist/github/output/format.js +78 -0
  108. package/dist/github/output/index.js +2 -0
  109. package/dist/github/tree/index.js +2 -0
  110. package/dist/github/tree/tree.js +28 -0
  111. package/dist/goal/client.d.ts +246 -0
  112. package/dist/goal/client.js +13 -0
  113. package/dist/goal/commands.d.ts +22 -0
  114. package/dist/goal/commands.js +110 -0
  115. package/dist/goal/index.d.ts +4 -0
  116. package/dist/goal/index.js +4 -0
  117. package/dist/goal/input.js +118 -0
  118. package/dist/goal/output/format.js +29 -0
  119. package/dist/goal/output/index.js +2 -0
  120. package/dist/goal/pause.d.ts +16 -0
  121. package/dist/goal/pause.js +91 -0
  122. package/dist/goal/tree/index.js +2 -0
  123. package/dist/goal/tree/tree.js +49 -0
  124. package/dist/hold/client.d.ts +2 -0
  125. package/dist/hold/tree/tree.js +2 -2
  126. package/dist/import/batch/batch.js +196 -0
  127. package/dist/import/batch/index.js +3 -0
  128. package/dist/import/batch/manifest.js +108 -0
  129. package/dist/import/client.d.ts +3 -3
  130. package/dist/import/client.js +1 -1
  131. package/dist/import/commands.d.ts +2 -0
  132. package/dist/import/commands.js +104 -18
  133. package/dist/import/detach.d.ts +12 -0
  134. package/dist/import/detach.js +70 -0
  135. package/dist/import/index.d.ts +2 -1
  136. package/dist/import/index.js +2 -1
  137. package/dist/import/input.js +68 -11
  138. package/dist/import/output.js +57 -8
  139. package/dist/inbox/client.d.ts +310 -0
  140. package/dist/inbox/client.js +15 -0
  141. package/dist/inbox/index.d.ts +2 -0
  142. package/dist/inbox/index.js +2 -0
  143. package/dist/integration/client.d.ts +607 -1
  144. package/dist/integration/client.js +41 -1
  145. package/dist/integration/commands.d.ts +16 -0
  146. package/dist/integration/commands.js +93 -10
  147. package/dist/integration/index.d.ts +1 -1
  148. package/dist/integration/index.js +1 -1
  149. package/dist/local-node/client.d.ts +13 -1
  150. package/dist/local-node/client.js +191 -235
  151. package/dist/local-node/index.d.ts +1 -1
  152. package/dist/local-node/index.js +1 -1
  153. package/dist/local-node/launch/index.d.ts +2 -0
  154. package/dist/local-node/launch/index.js +2 -0
  155. package/dist/local-node/launch/launch.d.ts +19 -0
  156. package/dist/local-node/launch/launch.js +60 -0
  157. package/dist/login/commands.js +7 -1
  158. package/dist/login/gateway.js +36 -13
  159. package/dist/login/menu.js +2 -1
  160. package/dist/login/vendor-account.js +3 -2
  161. package/dist/login/vendor-input.js +5 -4
  162. package/dist/mcp/calls.js +47 -222
  163. package/dist/mcp/routing.d.ts +3 -2
  164. package/dist/mcp/routing.js +39 -8
  165. package/dist/mcp/server.d.ts +10 -1
  166. package/dist/mcp/server.js +16 -6
  167. package/dist/migrate/classes.js +158 -0
  168. package/dist/migrate/commands.js +46 -0
  169. package/dist/migrate/format.js +199 -0
  170. package/dist/migrate/index.js +2 -0
  171. package/dist/migrate/item.js +59 -0
  172. package/dist/migrate/plan.js +79 -0
  173. package/dist/migrate/tree/index.js +2 -0
  174. package/dist/migrate/tree/tree.js +23 -0
  175. package/dist/node-update/client.d.ts +17 -0
  176. package/dist/node-update/client.js +27 -0
  177. package/dist/node-update/commands.d.ts +20 -0
  178. package/dist/node-update/commands.js +150 -0
  179. package/dist/node-update/index.d.ts +4 -0
  180. package/dist/node-update/index.js +4 -0
  181. package/dist/node-update/output.d.ts +12 -0
  182. package/dist/node-update/output.js +165 -0
  183. package/dist/node-update/tree/index.js +2 -0
  184. package/dist/node-update/tree/tree.js +73 -0
  185. package/dist/pairing/client.d.ts +13 -0
  186. package/dist/pairing/client.js +36 -0
  187. package/dist/pairing/commands.d.ts +15 -0
  188. package/dist/pairing/commands.js +131 -0
  189. package/dist/pairing/index.d.ts +4 -0
  190. package/dist/pairing/index.js +4 -0
  191. package/dist/pairing/output.d.ts +12 -0
  192. package/dist/pairing/output.js +53 -0
  193. package/dist/pairing/tree/index.js +2 -0
  194. package/dist/pairing/tree/tree.js +35 -0
  195. package/dist/panel/client.d.ts +9 -0
  196. package/dist/panel/client.js +24 -0
  197. package/dist/panel/commands.d.ts +19 -0
  198. package/dist/panel/commands.js +112 -0
  199. package/dist/panel/index.d.ts +3 -0
  200. package/dist/panel/index.js +3 -0
  201. package/dist/panel/tree/index.js +2 -0
  202. package/dist/panel/tree/tree.js +14 -0
  203. package/dist/port-lease/client.d.ts +3 -0
  204. package/dist/principal/client.d.ts +9 -0
  205. package/dist/principal/client.js +7 -0
  206. package/dist/principal/commands.d.ts +14 -0
  207. package/dist/principal/commands.js +84 -0
  208. package/dist/principal/index.d.ts +4 -0
  209. package/dist/principal/index.js +4 -0
  210. package/dist/principal/output.d.ts +8 -0
  211. package/dist/principal/output.js +43 -0
  212. package/dist/principal/tree/index.js +2 -0
  213. package/dist/principal/tree/tree.js +31 -0
  214. package/dist/project-guard/client.d.ts +13 -0
  215. package/dist/project-guard/input.js +15 -1
  216. package/dist/project-guard/output/format.js +5 -0
  217. package/dist/project-instructions/client.d.ts +56 -0
  218. package/dist/project-instructions/client.js +7 -0
  219. package/dist/project-instructions/commands.d.ts +13 -0
  220. package/dist/project-instructions/commands.js +89 -0
  221. package/dist/project-instructions/index.d.ts +3 -0
  222. package/dist/project-instructions/index.js +3 -0
  223. package/dist/project-instructions/input.js +33 -0
  224. package/dist/project-instructions/output/format.js +22 -0
  225. package/dist/project-instructions/output/index.js +2 -0
  226. package/dist/project-knowledge/change.js +22 -0
  227. package/dist/project-knowledge/client.d.ts +127 -0
  228. package/dist/project-knowledge/client.js +17 -0
  229. package/dist/project-knowledge/commands.d.ts +14 -0
  230. package/dist/project-knowledge/commands.js +100 -0
  231. package/dist/project-knowledge/index.d.ts +3 -0
  232. package/dist/project-knowledge/index.js +3 -0
  233. package/dist/project-knowledge/input.js +32 -0
  234. package/dist/project-knowledge/output/format.js +64 -0
  235. package/dist/project-knowledge/output/index.js +2 -0
  236. package/dist/project-knowledge/sources.js +108 -0
  237. package/dist/project-knowledge/upload.js +27 -0
  238. package/dist/project-workspace/discover.d.ts +11 -0
  239. package/dist/project-workspace/discover.js +48 -0
  240. package/dist/project-workspace/git-reads.d.ts +12 -0
  241. package/dist/project-workspace/git-reads.js +71 -0
  242. package/dist/project-workspace/index.d.ts +2 -0
  243. package/dist/project-workspace/index.js +2 -0
  244. package/dist/project-workspace/metadata-client.d.ts +2 -0
  245. package/dist/project-workspace/output/human.js +1 -1
  246. package/dist/project-workspace/tree/tree.js +105 -5
  247. package/dist/reach/client.d.ts +9 -0
  248. package/dist/reach/client.js +7 -0
  249. package/dist/reach/commands.d.ts +14 -0
  250. package/dist/reach/commands.js +72 -0
  251. package/dist/reach/index.d.ts +3 -0
  252. package/dist/reach/index.js +3 -0
  253. package/dist/reach/output.js +41 -0
  254. package/dist/reach/tree/index.js +2 -0
  255. package/dist/reach/tree/tree.js +28 -0
  256. package/dist/reference/resolve.js +2 -1
  257. package/dist/remote-node/client.d.ts +85 -0
  258. package/dist/remote-node/commands.d.ts +1 -0
  259. package/dist/remote-node/commands.js +61 -18
  260. package/dist/remote-node/connector.d.ts +16 -0
  261. package/dist/remote-node/connector.js +10 -3
  262. package/dist/remote-node/index.d.ts +1 -1
  263. package/dist/remote-node/index.js +1 -1
  264. package/dist/remote-node/lifecycle.js +66 -0
  265. package/dist/remote-node/reachability.js +31 -18
  266. package/dist/remote-node/reading.js +31 -0
  267. package/dist/remote-node/text.js +68 -5
  268. package/dist/remote-node/tree/tree.js +26 -3
  269. package/dist/routine/client.d.ts +547 -13
  270. package/dist/routine/client.js +19 -1
  271. package/dist/routine/commands.d.ts +5 -0
  272. package/dist/routine/commands.js +73 -15
  273. package/dist/routine/index.d.ts +2 -1
  274. package/dist/routine/index.js +2 -1
  275. package/dist/routine/input.js +66 -3
  276. package/dist/routine/output/format.js +80 -19
  277. package/dist/routine/output/index.js +1 -1
  278. package/dist/routine/portable/import-files.js +74 -0
  279. package/dist/routine/portable/import-output.js +21 -0
  280. package/dist/routine/portable/import.js +274 -0
  281. package/dist/routine/portable/index.js +3 -0
  282. package/dist/routine/portable/portable.js +185 -0
  283. package/dist/routine/tree/tree.js +80 -8
  284. package/dist/routine/trigger/commands.d.ts +20 -0
  285. package/dist/routine/trigger/commands.js +74 -0
  286. package/dist/routine/trigger/format.js +42 -0
  287. package/dist/routine/trigger/index.d.ts +2 -0
  288. package/dist/routine/trigger/index.js +2 -0
  289. package/dist/routine/trigger/input.js +81 -0
  290. package/dist/run-ledger/client.d.ts +47 -0
  291. package/dist/secret/client.d.ts +39 -0
  292. package/dist/secret/client.js +6 -0
  293. package/dist/secret/commands.d.ts +12 -0
  294. package/dist/secret/commands.js +91 -0
  295. package/dist/secret/index.d.ts +3 -0
  296. package/dist/secret/index.js +3 -0
  297. package/dist/secret/input.js +22 -0
  298. package/dist/secret/output/format.js +10 -0
  299. package/dist/secret/output/index.js +2 -0
  300. package/dist/secret/tree/index.js +2 -0
  301. package/dist/secret/tree/tree.js +16 -0
  302. package/dist/session/agent-permission.d.ts +3 -2
  303. package/dist/session/approval/client.d.ts +9 -5
  304. package/dist/session/approval/client.js +2 -2
  305. package/dist/session/approval/commands.d.ts +8 -0
  306. package/dist/session/approval/commands.js +267 -21
  307. package/dist/session/approval/index.d.ts +1 -1
  308. package/dist/session/approval/index.js +1 -1
  309. package/dist/session/approval/output/format.js +53 -1
  310. package/dist/session/approval/output/index.js +1 -1
  311. package/dist/session/attach-render.js +6 -0
  312. package/dist/session/attach.d.ts +1 -1
  313. package/dist/session/attach.js +7 -2
  314. package/dist/session/client.d.ts +19 -13
  315. package/dist/session/client.js +39 -19
  316. package/dist/session/coding-client.d.ts +2 -0
  317. package/dist/session/coding-client.js +1 -2
  318. package/dist/session/coding-commands.js +24 -7
  319. package/dist/session/command/commands.js +109 -0
  320. package/dist/session/command/index.js +2 -0
  321. package/dist/session/commands.d.ts +6 -1
  322. package/dist/session/commands.js +417 -73
  323. package/dist/session/create-tasks.js +24 -51
  324. package/dist/session/creation/creation.js +51 -0
  325. package/dist/session/creation/index.js +2 -0
  326. package/dist/session/fork/fork.js +135 -0
  327. package/dist/session/fork/index.js +2 -0
  328. package/dist/session/git-status.d.ts +11 -0
  329. package/dist/session/git-status.js +30 -0
  330. package/dist/session/index.d.ts +4 -3
  331. package/dist/session/index.js +3 -2
  332. package/dist/session/interaction/client.d.ts +3 -0
  333. package/dist/session/move/index.js +2 -0
  334. package/dist/session/move/move.js +439 -0
  335. package/dist/session/output/held.js +28 -0
  336. package/dist/session/output/human.js +73 -10
  337. package/dist/session/output/tasks.js +68 -7
  338. package/dist/session/setup/index.js +2 -0
  339. package/dist/session/setup/setup.js +69 -0
  340. package/dist/session/spawn/caps.js +128 -0
  341. package/dist/session/spawn/index.js +5 -0
  342. package/dist/session/spawn/spawn.js +203 -0
  343. package/dist/session/spawn/standing.js +62 -0
  344. package/dist/session/spawn/supervision.js +62 -0
  345. package/dist/session/switch/index.js +2 -0
  346. package/dist/session/switch/switch.js +103 -0
  347. package/dist/session/tree/tree.js +372 -32
  348. package/dist/session/turn/attachments.js +54 -0
  349. package/dist/session/turn/client.d.ts +9 -1
  350. package/dist/session/turn/client.js +20 -1
  351. package/dist/session/turn/commands.d.ts +8 -1
  352. package/dist/session/turn/commands.js +253 -36
  353. package/dist/session/turn/index.d.ts +3 -3
  354. package/dist/session/turn/index.js +1 -1
  355. package/dist/session/turn/output.d.ts +34 -2
  356. package/dist/session/turn/output.js +52 -2
  357. package/dist/skills-sync/client.d.ts +9 -0
  358. package/dist/skills-sync/client.js +7 -0
  359. package/dist/skills-sync/commands.d.ts +15 -0
  360. package/dist/skills-sync/commands.js +241 -0
  361. package/dist/skills-sync/index.d.ts +3 -0
  362. package/dist/skills-sync/index.js +3 -0
  363. package/dist/skills-sync/output.js +168 -0
  364. package/dist/skills-sync/set-file.js +23 -0
  365. package/dist/skills-sync/tree/index.js +2 -0
  366. package/dist/skills-sync/tree/tree.js +38 -0
  367. package/dist/status/client.d.ts +21 -3
  368. package/dist/status/command.js +6 -3
  369. package/dist/status/doctor.d.ts +5 -1
  370. package/dist/status/doctor.js +14 -7
  371. package/dist/status/output/compact.d.ts +3 -0
  372. package/dist/status/output/compact.js +17 -7
  373. package/dist/status/output/human.js +25 -0
  374. package/dist/team-workspace/client.d.ts +1 -0
  375. package/dist/terminal/control-commands.js +26 -9
  376. package/dist/terminal/keys.js +62 -0
  377. package/dist/terminal/output/compact-list.js +3 -0
  378. package/dist/terminal/output/human.js +2 -2
  379. package/dist/terminal/tree/tree.js +1 -1
  380. package/dist/text-input/index.js +2 -0
  381. package/dist/text-input/text-input.js +35 -0
  382. package/dist/webhooks/client.d.ts +157 -0
  383. package/dist/webhooks/client.js +8 -0
  384. package/dist/webhooks/commands.d.ts +17 -0
  385. package/dist/webhooks/commands.js +76 -0
  386. package/dist/webhooks/index.d.ts +3 -0
  387. package/dist/webhooks/index.js +3 -0
  388. package/dist/webhooks/input.js +125 -0
  389. package/dist/webhooks/output/format.js +75 -0
  390. package/dist/webhooks/output/index.js +2 -0
  391. package/dist/webhooks/tree/index.js +2 -0
  392. package/dist/webhooks/tree/tree.js +49 -0
  393. package/guidance/maia-cli/SKILL.md +1 -1
  394. package/guidance/maia-node/SKILL.md +54 -0
  395. package/guidance/maia-orchestration/SKILL.md +1 -2
  396. package/guidance/maia-sessions/SKILL.md +110 -0
  397. package/package.json +7 -6
  398. package/dist/address-space/address-space.d.ts +0 -38
  399. package/dist/address-space/index.d.ts +0 -2
  400. package/dist/agents/input.d.ts +0 -130
  401. package/dist/agents/output/format.d.ts +0 -8
  402. package/dist/agents/output/index.d.ts +0 -2
  403. package/dist/agents/tree/index.d.ts +0 -2
  404. package/dist/agents/tree/tree.d.ts +0 -3
  405. package/dist/bootstrap/exit.d.ts +0 -14
  406. package/dist/bootstrap/exit.js +0 -42
  407. package/dist/bootstrap/index.d.ts +0 -3
  408. package/dist/bootstrap/index.js +0 -3
  409. package/dist/bootstrap/process.d.ts +0 -5
  410. package/dist/bootstrap/process.js +0 -23
  411. package/dist/bootstrap/run.d.ts +0 -25
  412. package/dist/bootstrap/run.js +0 -95
  413. package/dist/bootstrap/stdio.d.ts +0 -4
  414. package/dist/bootstrap/stdio.js +0 -9
  415. package/dist/cli/environment.d.ts +0 -8
  416. package/dist/cli/services.d.ts +0 -4
  417. package/dist/command-line/context.js +0 -2
  418. package/dist/command-line/input/stdin-stream.d.ts +0 -4
  419. package/dist/command-line/json-decoder.d.ts +0 -3
  420. package/dist/command-receipt/command.d.ts +0 -4
  421. package/dist/command-receipt/compact-list.d.ts +0 -20
  422. package/dist/command-receipt/index.d.ts +0 -3
  423. package/dist/command-tree/completion.d.ts +0 -6
  424. package/dist/command-tree/local.d.ts +0 -3
  425. package/dist/command-tree/row.js +0 -2
  426. package/dist/connection/access/format.d.ts +0 -8
  427. package/dist/connection/access/input.d.ts +0 -53
  428. package/dist/connection/input.d.ts +0 -50
  429. package/dist/connection/signin.d.ts +0 -4
  430. package/dist/connection/tree/index.d.ts +0 -2
  431. package/dist/connection/tree/tree.d.ts +0 -3
  432. package/dist/container/output/format.d.ts +0 -11
  433. package/dist/container/output/index.d.ts +0 -2
  434. package/dist/context/client.d.ts +0 -7
  435. package/dist/context/commands.d.ts +0 -3
  436. package/dist/context/index.d.ts +0 -3
  437. package/dist/dashboard/cockpit-client.d.ts +0 -6
  438. package/dist/dashboard/cockpit-client.js +0 -27
  439. package/dist/dashboard/cockpits.d.ts +0 -29
  440. package/dist/dashboard/cockpits.js +0 -65
  441. package/dist/dashboard/dashboard.d.ts +0 -7
  442. package/dist/dashboard/draw.d.ts +0 -15
  443. package/dist/dashboard/frame.d.ts +0 -4
  444. package/dist/dashboard/index.d.ts +0 -2
  445. package/dist/dashboard/modes.d.ts +0 -5
  446. package/dist/dashboard/node-connection.d.ts +0 -15
  447. package/dist/dashboard/node-connection.js +0 -51
  448. package/dist/dashboard/pi-tui.d.ts +0 -6
  449. package/dist/dashboard/status-bar.d.ts +0 -4
  450. package/dist/dashboard/terminal.d.ts +0 -53
  451. package/dist/dashboard/tree-model.d.ts +0 -28
  452. package/dist/dashboard/tree.d.ts +0 -10
  453. package/dist/development/cli.d.ts +0 -3
  454. package/dist/development/cli.js +0 -44
  455. package/dist/execution/tree/index.d.ts +0 -2
  456. package/dist/execution/tree/tree.d.ts +0 -3
  457. package/dist/hold/output/format.d.ts +0 -11
  458. package/dist/hold/output/index.d.ts +0 -2
  459. package/dist/hold/tree/index.d.ts +0 -2
  460. package/dist/hold/tree/tree.d.ts +0 -3
  461. package/dist/import/input.d.ts +0 -16
  462. package/dist/import/output.d.ts +0 -6
  463. package/dist/integration/output.d.ts +0 -22
  464. package/dist/login/failure.d.ts +0 -3
  465. package/dist/login/gateway.d.ts +0 -12
  466. package/dist/login/menu.d.ts +0 -4
  467. package/dist/login/output/format.d.ts +0 -16
  468. package/dist/login/output/index.d.ts +0 -2
  469. package/dist/login/vendor-account.d.ts +0 -95
  470. package/dist/login/vendor-input.d.ts +0 -14
  471. package/dist/mcp/calls.d.ts +0 -8
  472. package/dist/orchestration/output/compact-aggregate.d.ts +0 -121
  473. package/dist/orchestration/output/compact-run-list.d.ts +0 -20
  474. package/dist/orchestration/output/human.d.ts +0 -80
  475. package/dist/orchestration/output/index.d.ts +0 -4
  476. package/dist/orchestration/tree/index.d.ts +0 -2
  477. package/dist/orchestration/tree/tree.d.ts +0 -3
  478. package/dist/port-lease/input.d.ts +0 -65
  479. package/dist/port-lease/output/format.d.ts +0 -11
  480. package/dist/port-lease/output/index.d.ts +0 -2
  481. package/dist/presentation/output/format.d.ts +0 -11
  482. package/dist/presentation/output/index.d.ts +0 -3
  483. package/dist/project-guard/input.d.ts +0 -18
  484. package/dist/project-guard/output/format.d.ts +0 -11
  485. package/dist/project-guard/output/index.d.ts +0 -2
  486. package/dist/project-workspace/output/human.d.ts +0 -139
  487. package/dist/project-workspace/output/index.d.ts +0 -3
  488. package/dist/project-workspace/output/metadata.d.ts +0 -11
  489. package/dist/project-workspace/tree/index.d.ts +0 -2
  490. package/dist/project-workspace/tree/tree.d.ts +0 -3
  491. package/dist/provider/client.d.ts +0 -6
  492. package/dist/provider/commands.d.ts +0 -3
  493. package/dist/provider/index.d.ts +0 -3
  494. package/dist/reference/commands.d.ts +0 -3
  495. package/dist/reference/index.d.ts +0 -3
  496. package/dist/reference/resolve.d.ts +0 -31
  497. package/dist/reference/tree/index.d.ts +0 -2
  498. package/dist/reference/tree/tree.d.ts +0 -3
  499. package/dist/remote-node/reachability.d.ts +0 -64
  500. package/dist/remote-node/text.d.ts +0 -10
  501. package/dist/remote-node/tree/index.d.ts +0 -2
  502. package/dist/remote-node/tree/tree.d.ts +0 -3
  503. package/dist/routine/input.d.ts +0 -28
  504. package/dist/routine/output/format.d.ts +0 -23
  505. package/dist/routine/output/index.d.ts +0 -2
  506. package/dist/routine/tree/index.d.ts +0 -2
  507. package/dist/routine/tree/tree.d.ts +0 -3
  508. package/dist/run-ledger/input.d.ts +0 -42
  509. package/dist/run-ledger/output/format.d.ts +0 -11
  510. package/dist/run-ledger/output/index.d.ts +0 -2
  511. package/dist/session/approval/output/format.d.ts +0 -23
  512. package/dist/session/approval/output/index.d.ts +0 -2
  513. package/dist/session/attach-render.d.ts +0 -16
  514. package/dist/session/create-tasks.d.ts +0 -20
  515. package/dist/session/interaction/input.d.ts +0 -15
  516. package/dist/session/interaction/output/format.d.ts +0 -11
  517. package/dist/session/interaction/output/index.d.ts +0 -2
  518. package/dist/session/output/diff.d.ts +0 -3
  519. package/dist/session/output/failure.d.ts +0 -11
  520. package/dist/session/output/human.d.ts +0 -113
  521. package/dist/session/output/index.d.ts +0 -6
  522. package/dist/session/output/observe.d.ts +0 -4
  523. package/dist/session/output/tasks.d.ts +0 -34
  524. package/dist/session/task-file.d.ts +0 -5
  525. package/dist/session/tree/index.d.ts +0 -2
  526. package/dist/session/tree/tree.d.ts +0 -3
  527. package/dist/team-workspace/ceremony.d.ts +0 -19
  528. package/dist/team-workspace/confirmation.d.ts +0 -4
  529. package/dist/team-workspace/dependencies.js +0 -2
  530. package/dist/team-workspace/output.d.ts +0 -15
  531. package/dist/terminal/arguments.d.ts +0 -13
  532. package/dist/terminal/output/compact-list.d.ts +0 -148
  533. package/dist/terminal/output/human.d.ts +0 -42
  534. package/dist/terminal/output/index.d.ts +0 -3
  535. package/dist/terminal/tree/index.d.ts +0 -2
  536. package/dist/terminal/tree/tree.d.ts +0 -3
  537. /package/dist/command-line/{json-decoder.js → emit/json-decoder.js} +0 -0
  538. /package/dist/command-line/{json.d.ts → emit/json.d.ts} +0 -0
  539. /package/dist/command-line/{json.js → emit/json.js} +0 -0
@@ -19,10 +19,14 @@ const header = (item) => {
19
19
  case "error":
20
20
  return "error: ";
21
21
  case "file_change":
22
+ case "html":
22
23
  case "usage":
23
24
  return "";
24
25
  }
25
26
  };
27
+ const htmlLine = (item) => item.file === undefined
28
+ ? "html page\n"
29
+ : `html ${cell(item.file.path)} (${String(item.file.byteLength)} bytes)\n`;
26
30
  const footer = (record) => {
27
31
  const { item } = record;
28
32
  const status = record.status === "completed" ? "" : `[${record.status}]\n`;
@@ -30,6 +34,8 @@ const footer = (record) => {
30
34
  return `[exit ${String(item.exitCode)}]\n${status}`;
31
35
  if (item.kind === "file_change")
32
36
  return `${item.changes.map((change) => `${change.change} ${cell(change.path)}\n`).join("")}${status}`;
37
+ if (item.kind === "html")
38
+ return `${htmlLine(item)}${status}`;
33
39
  if (item.kind === "usage")
34
40
  return `tokens: ${String(item.inputTokens)} in (${String(item.cachedInputTokens)} cached), ${String(item.outputTokens)} out${item.modelCallCount === undefined ? "" : `, ${String(item.modelCallCount)} model call${item.modelCallCount === 1 ? "" : "s"}`}\n`;
35
41
  return status;
@@ -1,5 +1,5 @@
1
1
  import { type CommandContext, type CommandEffect } from "../command-line/index.js";
2
2
  import type { AttachSessionInput } from "./attach-client.js";
3
3
  export declare const readAttachCursor: (value: string | undefined) => AttachSessionInput["after"];
4
- export declare const runSessionAttach: (tokens: readonly string[], context: CommandContext) => CommandEffect;
4
+ export declare const sessionAttachRunner: (loadNative: () => Promise<(tokens: readonly string[], context: CommandContext) => CommandEffect>) => (tokens: readonly string[], context: CommandContext) => CommandEffect;
5
5
  //# sourceMappingURL=attach.d.ts.map
@@ -3,7 +3,7 @@ import * as Duration from "effect/Duration";
3
3
  import * as Effect from "effect/Effect";
4
4
  import * as Ref from "effect/Ref";
5
5
  import * as Stream from "effect/Stream";
6
- import { CliArgumentError, jsonLine, parseOptions, reportError, requirePositionals, } from "../command-line/index.js";
6
+ import { CliArgumentError, jsonLine, parseOptions, reportError, requirePositionals, TWO_PHASE_FLAGS, } from "../command-line/index.js";
7
7
  import { finishSessionAttachRender, initialAttachRenderState, renderSessionAttachFrame, } from "./attach-render.js";
8
8
  const MAX_IDLE_REATTACHES = 5;
9
9
  const REATTACH_BACKOFF = Duration.millis(100);
@@ -102,7 +102,12 @@ const follow = (attachment, idle) => Effect.gen(function* () {
102
102
  yield* Effect.sleep(Duration.times(REATTACH_BACKOFF, nextIdle));
103
103
  return yield* follow(attachment, nextIdle);
104
104
  });
105
- export const runSessionAttach = (tokens, context) => Effect.gen(function* () {
105
+ const NATIVE_FORM = ["--runtime", "--external-id", ...TWO_PHASE_FLAGS];
106
+ const namesNativeSession = (tokens) => tokens.some((token) => NATIVE_FORM.some((option) => token === option || token.startsWith(`${option}=`)));
107
+ export const sessionAttachRunner = (loadNative) => (tokens, context) => namesNativeSession(tokens)
108
+ ? Effect.promise(loadNative).pipe(Effect.flatMap((runNative) => runNative(tokens, context)))
109
+ : followSession(tokens, context);
110
+ const followSession = (tokens, context) => Effect.gen(function* () {
106
111
  const parsed = parseOptions(tokens, new Set(["--after"]), new Set(["--no-follow"]));
107
112
  requirePositionals(parsed.positionals, 1);
108
113
  const [sessionId = ""] = parsed.positionals;
@@ -1,27 +1,28 @@
1
- import type { Session, SessionCreateParameters, SessionCreateResult, SessionCreationInput, SessionCreationOutcome, SessionCreationPlan, SessionEventsListResult, SessionInboxAckResult, SessionInboxCheckResult, SessionListParameters, SessionListResult, SessionMessageSendResult, SessionObserveResult, SessionResumeResult, SessionShowResult, SessionSpawnResult, SessionStartResult, SessionStopResult, SessionWaitResult } from "@maiaos/sdk";
1
+ import type { Session, SessionCreateParameters, SessionCreateResult, SessionCreationInput, SessionCreationOutcome, SessionCreationPlan, SessionEventsListResult, SessionInboxAckResult, SessionInboxCheckResult, SessionListParameters, SessionListResult, SessionMessageSendResult, SessionObserveResult, SessionResumeResult, SessionShowResult, SessionStartResult, SessionStopResult, SessionWaitResult, SupervisedResumeClaim } from "@maiaos/sdk";
2
2
  import { type CliNodeEffect, type CliNodeOperations } from "../local-node/index.js";
3
3
  export type WaitSessionInput = {
4
+ readonly activities?: readonly string[];
4
5
  readonly sessionId: string;
5
- readonly states: readonly string[];
6
+ readonly states?: readonly string[];
6
7
  readonly timeoutMilliseconds: number;
7
8
  };
8
9
  export type CreateSessionInput = {
9
10
  readonly agentId?: SessionCreateParameters["agentId"];
10
11
  readonly baseRef?: string;
12
+ readonly branch?: string;
11
13
  readonly commandId?: string;
12
14
  readonly connectionId?: string;
15
+ readonly cwd?: string;
13
16
  readonly definitionRef?: SessionCreateParameters["definitionRef"];
14
17
  readonly effort?: SessionCreateParameters["effort"];
15
18
  readonly executor?: SessionCreateParameters["executor"];
19
+ readonly hostAuthority?: SessionCreateParameters["hostAuthority"];
20
+ readonly labels?: SessionCreateParameters["labels"];
16
21
  readonly model?: string;
22
+ readonly permission?: SessionCreateParameters["permission"];
17
23
  readonly role?: SessionCreateParameters["role"];
18
24
  readonly title?: string;
19
- readonly workspaceId: string;
20
- };
21
- type SpawnSessionInput = {
22
- readonly commandId?: string;
23
- readonly harness: "maia-agent" | "pi";
24
- readonly parentSessionId: string;
25
+ readonly wakeOnChildSettle?: SessionCreateParameters["wakeOnChildSettle"];
25
26
  readonly workspaceId: string;
26
27
  };
27
28
  export type ListSessionsInput = Omit<SessionListParameters, "states"> & {
@@ -32,6 +33,9 @@ export type StartSessionInput = {
32
33
  readonly expectedRevision: string;
33
34
  readonly sessionId: string;
34
35
  };
36
+ export type ResumeSessionInput = StartSessionInput & {
37
+ readonly parent?: SupervisedResumeClaim;
38
+ };
35
39
  type SendAttachedSessionMessageInput = {
36
40
  readonly body: string;
37
41
  readonly commandId?: string;
@@ -64,7 +68,7 @@ export declare const makeSessionClient: (node: CliNodeOperations) => {
64
68
  readonly commandId: string;
65
69
  readonly grantedAt: string;
66
70
  readonly inputDigest: string;
67
- readonly operationIds: readonly ("agents.change.confirm" | "agents.change.preview" | "agents.list" | "agents.show" | "approval.list" | "approval.respond" | "approval.show" | "connection.capacity.set" | "connection.create" | "connection.detect" | "connection.gateway.create" | "connection.grant.list" | "connection.grant.set.confirm" | "connection.grant.set.preview" | "connection.list" | "connection.login.start" | "connection.models.list" | "connection.pool.list" | "connection.pool.set.confirm" | "connection.pool.set.preview" | "connection.show" | "connection.state.set" | "connection.system.confirm" | "connection.system.preview" | "connection.upkeep.confirm" | "connection.upkeep.preview" | "connection.upkeep.refresh" | "connection.usage.show" | "container.create.confirm" | "container.create.preview" | "container.index.list" | "container.list" | "container.rename.confirm" | "container.rename.preview" | "container.show" | "context.show" | "discovery.sessions.list" | "execution.catalog.get" | "execution.checkpoint.create" | "execution.checkpoint.show" | "execution.command.run" | "execution.file.read" | "execution.placement.create" | "execution.placement.show" | "execution.relocation.apply" | "execution.relocation.plan" | "execution.relocation.reconcile" | "execution.relocation.show" | "execution.worktree.create" | "execution.worktree.import" | "execution.worktree.reconcile" | "execution.worktree.remove.apply" | "execution.worktree.remove.plan" | "execution.worktree.status" | "harness.installed.list" | "hold.list" | "hold.place.confirm" | "hold.place.preview" | "hold.release.confirm" | "hold.release.preview" | "integration.apply.claude-code" | "integration.apply.codex" | "integration.apply.pi-rpc" | "integration.plan.claude-code" | "integration.plan.codex" | "integration.plan.pi-rpc" | "integration.remove.claude-code" | "integration.remove.codex" | "integration.remove.pi-rpc" | "integration.status.claude-code" | "integration.status.codex" | "integration.status.pi-rpc" | "interaction.cancel" | "interaction.create" | "interaction.list" | "interaction.respond" | "interaction.show" | "monitor.bootstrap.create" | "node.remote.install.confirm" | "node.remote.install.preview" | "node.remote.list" | "node.remote.register.confirm" | "node.remote.register.preview" | "node.remote.remove.confirm" | "node.remote.remove.preview" | "node.shutdown" | "node.status" | "port.lease.acquire" | "port.lease.list" | "port.lease.release" | "port.lease.renew" | "presentation.catalog.show" | "presentation.project-list.show" | "presentation.session-list.show" | "presentation.workspace-directory.show" | "project.context.list" | "project.context.record" | "project.context.show" | "project.create.confirm" | "project.create.preview" | "project.guard.confirm" | "project.guard.preview" | "project.guard.show" | "project.list" | "project.register" | "project.rename.confirm" | "project.rename.preview" | "project.show" | "provider.pool.list" | "receipt.get" | "receipt.list" | "reference.resolve" | "routine.create.confirm" | "routine.create.preview" | "routine.disable.confirm" | "routine.disable.preview" | "routine.list" | "routine.pause" | "routine.resume" | "routine.run.confirm" | "routine.run.preview" | "routine.show" | "run.create" | "run.dispatch.settle-terminal" | "run.dispatch.show" | "run.inbox.ack" | "run.inbox.check" | "run.ledger.create" | "run.ledger.list" | "run.ledger.task.dispatch" | "run.ledger.task.list" | "run.ledger.task.settle" | "run.ledger.task.show" | "run.list" | "run.question.cancel" | "run.question.open" | "run.question.reply" | "run.show" | "run.task.list" | "run.task.show" | "runtime.probe" | "session.adopt.confirm" | "session.adopt.preview" | "session.agent-permission.confirm" | "session.agent-permission.preview" | "session.archive" | "session.create" | "session.diff" | "session.events.list" | "session.history.read" | "session.inbox.ack" | "session.inbox.check" | "session.list" | "session.message.send" | "session.observe" | "session.rename" | "session.resume" | "session.show" | "session.spawn" | "session.start" | "session.stop" | "session.wait" | "team-workspace.bootstrap.apply" | "team-workspace.bootstrap.preview" | "terminal.controller.acquire" | "terminal.controller.release" | "terminal.controller.renew" | "terminal.controller.request" | "terminal.controller.request.show" | "terminal.create" | "terminal.events.list" | "terminal.input.write" | "terminal.list" | "terminal.mutation.reconcile" | "terminal.observer.attach" | "terminal.observer.check" | "terminal.observer.detach" | "terminal.observer.resync" | "terminal.read" | "terminal.session.close" | "terminal.session.delete" | "terminal.session.resize" | "terminal.session.restart" | "terminal.session.signal" | "terminal.show" | "turn.cancel" | "turn.interrupt" | "turn.queue.list" | "turn.send" | "turn.show" | "turn.wait" | "voice.managed-turn.confirm" | "voice.managed-turn.preview" | "voice.orchestrator.context.show" | "voice.orchestrator.tool.call" | "voice.pi.relay" | "voice.pi.relay.preview" | "voice.pi.relay.reconcile" | "workspace.context.show" | "workspace.execution.configure" | "workspace.execution.show" | "workspace.list" | "workspace.membership.attach" | "workspace.repository.attach" | "workspace.select" | "workspace.show")[];
71
+ readonly operationIds: readonly ("agents.change.confirm" | "agents.change.preview" | "agents.detect" | "agents.list" | "agents.show" | "approval.list" | "approval.respond" | "approval.show" | "board.message.post" | "board.message.reply" | "board.path.read" | "board.task.assign" | "board.task.cancel" | "board.task.claim" | "board.task.complete" | "board.task.create" | "board.task.fail" | "board.task.list" | "board.task.needs.replace" | "board.task.plan" | "board.task.promote" | "board.task.release" | "board.task.renew" | "board.task.reopen" | "board.task.show" | "board.thread.show" | "connection.capacity.set" | "connection.create" | "connection.detect" | "connection.executors.list" | "connection.executors.show" | "connection.gateway.create" | "connection.github.create" | "connection.github.revoke" | "connection.github.show" | "connection.grant.list" | "connection.grant.set.confirm" | "connection.grant.set.preview" | "connection.list" | "connection.login.start" | "connection.models.list" | "connection.pool.list" | "connection.pool.set.confirm" | "connection.pool.set.preview" | "connection.show" | "connection.state.set" | "connection.system.confirm" | "connection.system.preview" | "connection.upkeep.confirm" | "connection.upkeep.preview" | "connection.upkeep.refresh" | "connection.usage.show" | "container.create.confirm" | "container.create.preview" | "container.index.list" | "container.list" | "container.rename.confirm" | "container.rename.preview" | "container.show" | "context.show" | "discovery.sessions.list" | "events.read" | "execution.catalog.get" | "execution.checkpoint.create" | "execution.checkpoint.show" | "execution.command.run" | "execution.file.read" | "execution.placement.create" | "execution.placement.show" | "execution.relocation.apply" | "execution.relocation.plan" | "execution.relocation.reconcile" | "execution.relocation.show" | "execution.worktree.create" | "execution.worktree.import" | "execution.worktree.reconcile" | "execution.worktree.remove.apply" | "execution.worktree.remove.plan" | "execution.worktree.status" | "goal.clear" | "goal.mark" | "goal.set" | "goal.show" | "goal.transition" | "goal.update" | "harness.installed.list" | "hold.list" | "hold.place.confirm" | "hold.place.preview" | "hold.release.confirm" | "hold.release.preview" | "inbox.list" | "inbox.respond" | "inbox.settle" | "inbox.show" | "inbox.snooze" | "integration.apply.antigravity" | "integration.apply.claude-code" | "integration.apply.codex" | "integration.apply.grok-cli" | "integration.apply.maia-agent" | "integration.apply.pi" | "integration.apply.pi-rpc" | "integration.plan.antigravity" | "integration.plan.claude-code" | "integration.plan.codex" | "integration.plan.grok-cli" | "integration.plan.maia-agent" | "integration.plan.pi" | "integration.plan.pi-rpc" | "integration.remove.antigravity" | "integration.remove.claude-code" | "integration.remove.codex" | "integration.remove.grok-cli" | "integration.remove.maia-agent" | "integration.remove.pi" | "integration.remove.pi-rpc" | "integration.status.antigravity" | "integration.status.claude-code" | "integration.status.codex" | "integration.status.grok-cli" | "integration.status.maia-agent" | "integration.status.pi" | "integration.status.pi-rpc" | "interaction.cancel" | "interaction.create" | "interaction.list" | "interaction.respond" | "interaction.show" | "monitor.bootstrap.create" | "node.pairing.confirm" | "node.pairing.preview" | "node.pairing.redeem" | "node.pairing.show" | "node.principal.confirm" | "node.principal.preview" | "node.principal.show" | "node.reach.confirm" | "node.reach.preview" | "node.reach.show" | "node.remote.install.confirm" | "node.remote.install.preview" | "node.remote.list" | "node.remote.register.confirm" | "node.remote.register.preview" | "node.remote.remove.confirm" | "node.remote.remove.preview" | "node.shutdown" | "node.status" | "node.update.apply.confirm" | "node.update.apply.preview" | "node.update.check" | "node.update.pause" | "node.update.policy.get" | "node.update.policy.set" | "node.update.resume" | "node.update.rollback.confirm" | "node.update.rollback.preview" | "node.update.show" | "node.update.status" | "port.lease.acquire" | "port.lease.list" | "port.lease.release" | "port.lease.renew" | "pr.link" | "pr.status" | "pr.watch" | "presentation.catalog.show" | "presentation.project-list.show" | "presentation.session-list.show" | "presentation.workspace-directory.show" | "project.context.list" | "project.context.record" | "project.context.show" | "project.create.confirm" | "project.create.preview" | "project.discover" | "project.guard.confirm" | "project.guard.preview" | "project.guard.show" | "project.instructions.change.confirm" | "project.instructions.change.preview" | "project.instructions.show" | "project.knowledge.add.chunk" | "project.knowledge.add.commit" | "project.knowledge.add.confirm" | "project.knowledge.add.preview" | "project.knowledge.list" | "project.knowledge.remove.confirm" | "project.knowledge.remove.preview" | "project.knowledge.search" | "project.list" | "project.register" | "project.rename.confirm" | "project.rename.preview" | "project.show" | "provider.pool.list" | "receipt.get" | "receipt.list" | "reference.resolve" | "routine.create.confirm" | "routine.create.preview" | "routine.disable.confirm" | "routine.disable.preview" | "routine.list" | "routine.move.confirm" | "routine.move.preview" | "routine.pause" | "routine.resume" | "routine.run.confirm" | "routine.run.preview" | "routine.runs" | "routine.show" | "routine.trigger.create.confirm" | "routine.trigger.create.preview" | "routine.trigger.disable" | "routine.trigger.list" | "routine.update.confirm" | "routine.update.preview" | "run.create" | "run.dispatch.settle-terminal" | "run.dispatch.show" | "run.inbox.ack" | "run.inbox.check" | "run.ledger.create" | "run.ledger.list" | "run.ledger.task.dispatch" | "run.ledger.task.list" | "run.ledger.task.settle" | "run.ledger.task.show" | "run.list" | "run.question.cancel" | "run.question.open" | "run.question.reply" | "run.show" | "run.task.list" | "run.task.show" | "runtime.probe" | "secret.request" | "secret.set.confirm" | "secret.set.preview" | "session.adopt.confirm" | "session.adopt.preview" | "session.agent-permission.confirm" | "session.agent-permission.preview" | "session.archive" | "session.command.confirm" | "session.command.list" | "session.command.preview" | "session.command.send" | "session.create" | "session.defaults.show" | "session.detach.confirm" | "session.detach.preview" | "session.diff" | "session.events.list" | "session.fork.confirm" | "session.fork.preview" | "session.git.status" | "session.history.read" | "session.inbox.ack" | "session.inbox.check" | "session.list" | "session.message.send" | "session.observe" | "session.pause.confirm" | "session.pause.preview" | "session.placement.show" | "session.rename" | "session.resume" | "session.setup.confirm" | "session.setup.preview" | "session.show" | "session.spawn-caps.confirm" | "session.spawn-caps.preview" | "session.spawn-caps.show" | "session.spawn.confirm" | "session.spawn.preview" | "session.spawn.record" | "session.start" | "session.stop" | "session.switch.confirm" | "session.switch.preview" | "session.wait" | "skills.sync.confirm" | "skills.sync.preview" | "skills.sync.show" | "team-workspace.bootstrap.apply" | "team-workspace.bootstrap.preview" | "terminal.controller.acquire" | "terminal.controller.release" | "terminal.controller.renew" | "terminal.controller.request" | "terminal.controller.request.show" | "terminal.create" | "terminal.events.list" | "terminal.input.write" | "terminal.list" | "terminal.mutation.reconcile" | "terminal.observer.attach" | "terminal.observer.check" | "terminal.observer.detach" | "terminal.observer.resync" | "terminal.read" | "terminal.session.close" | "terminal.session.delete" | "terminal.session.resize" | "terminal.session.restart" | "terminal.session.signal" | "terminal.show" | "turn.attachment.policy" | "turn.cancel" | "turn.interrupt" | "turn.queue.edit" | "turn.queue.list" | "turn.queue.promote" | "turn.send" | "turn.show" | "turn.steer.confirm" | "turn.steer.preview" | "turn.wait" | "voice.managed-turn.confirm" | "voice.managed-turn.preview" | "voice.orchestrator.context.show" | "voice.orchestrator.tool.call" | "voice.pi.relay" | "voice.pi.relay.preview" | "voice.pi.relay.reconcile" | "webhooks.change.confirm" | "webhooks.change.preview" | "webhooks.deliveries" | "webhooks.list" | "workspace.branches.list" | "workspace.code-host.show" | "workspace.context.show" | "workspace.execution.configure" | "workspace.execution.show" | "workspace.list" | "workspace.membership.attach" | "workspace.repository.attach" | "workspace.select" | "workspace.show")[];
68
72
  readonly revision: "1";
69
73
  };
70
74
  readonly method: "session.agent-permission.confirm";
@@ -75,6 +79,7 @@ export declare const makeSessionClient: (node: CliNodeOperations) => {
75
79
  readonly createdAt: string;
76
80
  readonly eventCursor: string;
77
81
  readonly method: string;
82
+ readonly proposedBy?: string | undefined;
78
83
  readonly receiptId: string;
79
84
  readonly schemaVersion: 1;
80
85
  readonly state: "succeeded";
@@ -101,7 +106,7 @@ export declare const makeSessionClient: (node: CliNodeOperations) => {
101
106
  readonly inputDigest: string;
102
107
  readonly issuedAt: string;
103
108
  readonly method: "session.agent-permission.preview";
104
- readonly operationIds: readonly ("agents.change.confirm" | "agents.change.preview" | "agents.list" | "agents.show" | "approval.list" | "approval.respond" | "approval.show" | "connection.capacity.set" | "connection.create" | "connection.detect" | "connection.gateway.create" | "connection.grant.list" | "connection.grant.set.confirm" | "connection.grant.set.preview" | "connection.list" | "connection.login.start" | "connection.models.list" | "connection.pool.list" | "connection.pool.set.confirm" | "connection.pool.set.preview" | "connection.show" | "connection.state.set" | "connection.system.confirm" | "connection.system.preview" | "connection.upkeep.confirm" | "connection.upkeep.preview" | "connection.upkeep.refresh" | "connection.usage.show" | "container.create.confirm" | "container.create.preview" | "container.index.list" | "container.list" | "container.rename.confirm" | "container.rename.preview" | "container.show" | "context.show" | "discovery.sessions.list" | "execution.catalog.get" | "execution.checkpoint.create" | "execution.checkpoint.show" | "execution.command.run" | "execution.file.read" | "execution.placement.create" | "execution.placement.show" | "execution.relocation.apply" | "execution.relocation.plan" | "execution.relocation.reconcile" | "execution.relocation.show" | "execution.worktree.create" | "execution.worktree.import" | "execution.worktree.reconcile" | "execution.worktree.remove.apply" | "execution.worktree.remove.plan" | "execution.worktree.status" | "harness.installed.list" | "hold.list" | "hold.place.confirm" | "hold.place.preview" | "hold.release.confirm" | "hold.release.preview" | "integration.apply.claude-code" | "integration.apply.codex" | "integration.apply.pi-rpc" | "integration.plan.claude-code" | "integration.plan.codex" | "integration.plan.pi-rpc" | "integration.remove.claude-code" | "integration.remove.codex" | "integration.remove.pi-rpc" | "integration.status.claude-code" | "integration.status.codex" | "integration.status.pi-rpc" | "interaction.cancel" | "interaction.create" | "interaction.list" | "interaction.respond" | "interaction.show" | "monitor.bootstrap.create" | "node.remote.install.confirm" | "node.remote.install.preview" | "node.remote.list" | "node.remote.register.confirm" | "node.remote.register.preview" | "node.remote.remove.confirm" | "node.remote.remove.preview" | "node.shutdown" | "node.status" | "port.lease.acquire" | "port.lease.list" | "port.lease.release" | "port.lease.renew" | "presentation.catalog.show" | "presentation.project-list.show" | "presentation.session-list.show" | "presentation.workspace-directory.show" | "project.context.list" | "project.context.record" | "project.context.show" | "project.create.confirm" | "project.create.preview" | "project.guard.confirm" | "project.guard.preview" | "project.guard.show" | "project.list" | "project.register" | "project.rename.confirm" | "project.rename.preview" | "project.show" | "provider.pool.list" | "receipt.get" | "receipt.list" | "reference.resolve" | "routine.create.confirm" | "routine.create.preview" | "routine.disable.confirm" | "routine.disable.preview" | "routine.list" | "routine.pause" | "routine.resume" | "routine.run.confirm" | "routine.run.preview" | "routine.show" | "run.create" | "run.dispatch.settle-terminal" | "run.dispatch.show" | "run.inbox.ack" | "run.inbox.check" | "run.ledger.create" | "run.ledger.list" | "run.ledger.task.dispatch" | "run.ledger.task.list" | "run.ledger.task.settle" | "run.ledger.task.show" | "run.list" | "run.question.cancel" | "run.question.open" | "run.question.reply" | "run.show" | "run.task.list" | "run.task.show" | "runtime.probe" | "session.adopt.confirm" | "session.adopt.preview" | "session.agent-permission.confirm" | "session.agent-permission.preview" | "session.archive" | "session.create" | "session.diff" | "session.events.list" | "session.history.read" | "session.inbox.ack" | "session.inbox.check" | "session.list" | "session.message.send" | "session.observe" | "session.rename" | "session.resume" | "session.show" | "session.spawn" | "session.start" | "session.stop" | "session.wait" | "team-workspace.bootstrap.apply" | "team-workspace.bootstrap.preview" | "terminal.controller.acquire" | "terminal.controller.release" | "terminal.controller.renew" | "terminal.controller.request" | "terminal.controller.request.show" | "terminal.create" | "terminal.events.list" | "terminal.input.write" | "terminal.list" | "terminal.mutation.reconcile" | "terminal.observer.attach" | "terminal.observer.check" | "terminal.observer.detach" | "terminal.observer.resync" | "terminal.read" | "terminal.session.close" | "terminal.session.delete" | "terminal.session.resize" | "terminal.session.restart" | "terminal.session.signal" | "terminal.show" | "turn.cancel" | "turn.interrupt" | "turn.queue.list" | "turn.send" | "turn.show" | "turn.wait" | "voice.managed-turn.confirm" | "voice.managed-turn.preview" | "voice.orchestrator.context.show" | "voice.orchestrator.tool.call" | "voice.pi.relay" | "voice.pi.relay.preview" | "voice.pi.relay.reconcile" | "workspace.context.show" | "workspace.execution.configure" | "workspace.execution.show" | "workspace.list" | "workspace.membership.attach" | "workspace.repository.attach" | "workspace.select" | "workspace.show")[];
109
+ readonly operationIds: readonly ("agents.change.confirm" | "agents.change.preview" | "agents.detect" | "agents.list" | "agents.show" | "approval.list" | "approval.respond" | "approval.show" | "board.message.post" | "board.message.reply" | "board.path.read" | "board.task.assign" | "board.task.cancel" | "board.task.claim" | "board.task.complete" | "board.task.create" | "board.task.fail" | "board.task.list" | "board.task.needs.replace" | "board.task.plan" | "board.task.promote" | "board.task.release" | "board.task.renew" | "board.task.reopen" | "board.task.show" | "board.thread.show" | "connection.capacity.set" | "connection.create" | "connection.detect" | "connection.executors.list" | "connection.executors.show" | "connection.gateway.create" | "connection.github.create" | "connection.github.revoke" | "connection.github.show" | "connection.grant.list" | "connection.grant.set.confirm" | "connection.grant.set.preview" | "connection.list" | "connection.login.start" | "connection.models.list" | "connection.pool.list" | "connection.pool.set.confirm" | "connection.pool.set.preview" | "connection.show" | "connection.state.set" | "connection.system.confirm" | "connection.system.preview" | "connection.upkeep.confirm" | "connection.upkeep.preview" | "connection.upkeep.refresh" | "connection.usage.show" | "container.create.confirm" | "container.create.preview" | "container.index.list" | "container.list" | "container.rename.confirm" | "container.rename.preview" | "container.show" | "context.show" | "discovery.sessions.list" | "events.read" | "execution.catalog.get" | "execution.checkpoint.create" | "execution.checkpoint.show" | "execution.command.run" | "execution.file.read" | "execution.placement.create" | "execution.placement.show" | "execution.relocation.apply" | "execution.relocation.plan" | "execution.relocation.reconcile" | "execution.relocation.show" | "execution.worktree.create" | "execution.worktree.import" | "execution.worktree.reconcile" | "execution.worktree.remove.apply" | "execution.worktree.remove.plan" | "execution.worktree.status" | "goal.clear" | "goal.mark" | "goal.set" | "goal.show" | "goal.transition" | "goal.update" | "harness.installed.list" | "hold.list" | "hold.place.confirm" | "hold.place.preview" | "hold.release.confirm" | "hold.release.preview" | "inbox.list" | "inbox.respond" | "inbox.settle" | "inbox.show" | "inbox.snooze" | "integration.apply.antigravity" | "integration.apply.claude-code" | "integration.apply.codex" | "integration.apply.grok-cli" | "integration.apply.maia-agent" | "integration.apply.pi" | "integration.apply.pi-rpc" | "integration.plan.antigravity" | "integration.plan.claude-code" | "integration.plan.codex" | "integration.plan.grok-cli" | "integration.plan.maia-agent" | "integration.plan.pi" | "integration.plan.pi-rpc" | "integration.remove.antigravity" | "integration.remove.claude-code" | "integration.remove.codex" | "integration.remove.grok-cli" | "integration.remove.maia-agent" | "integration.remove.pi" | "integration.remove.pi-rpc" | "integration.status.antigravity" | "integration.status.claude-code" | "integration.status.codex" | "integration.status.grok-cli" | "integration.status.maia-agent" | "integration.status.pi" | "integration.status.pi-rpc" | "interaction.cancel" | "interaction.create" | "interaction.list" | "interaction.respond" | "interaction.show" | "monitor.bootstrap.create" | "node.pairing.confirm" | "node.pairing.preview" | "node.pairing.redeem" | "node.pairing.show" | "node.principal.confirm" | "node.principal.preview" | "node.principal.show" | "node.reach.confirm" | "node.reach.preview" | "node.reach.show" | "node.remote.install.confirm" | "node.remote.install.preview" | "node.remote.list" | "node.remote.register.confirm" | "node.remote.register.preview" | "node.remote.remove.confirm" | "node.remote.remove.preview" | "node.shutdown" | "node.status" | "node.update.apply.confirm" | "node.update.apply.preview" | "node.update.check" | "node.update.pause" | "node.update.policy.get" | "node.update.policy.set" | "node.update.resume" | "node.update.rollback.confirm" | "node.update.rollback.preview" | "node.update.show" | "node.update.status" | "port.lease.acquire" | "port.lease.list" | "port.lease.release" | "port.lease.renew" | "pr.link" | "pr.status" | "pr.watch" | "presentation.catalog.show" | "presentation.project-list.show" | "presentation.session-list.show" | "presentation.workspace-directory.show" | "project.context.list" | "project.context.record" | "project.context.show" | "project.create.confirm" | "project.create.preview" | "project.discover" | "project.guard.confirm" | "project.guard.preview" | "project.guard.show" | "project.instructions.change.confirm" | "project.instructions.change.preview" | "project.instructions.show" | "project.knowledge.add.chunk" | "project.knowledge.add.commit" | "project.knowledge.add.confirm" | "project.knowledge.add.preview" | "project.knowledge.list" | "project.knowledge.remove.confirm" | "project.knowledge.remove.preview" | "project.knowledge.search" | "project.list" | "project.register" | "project.rename.confirm" | "project.rename.preview" | "project.show" | "provider.pool.list" | "receipt.get" | "receipt.list" | "reference.resolve" | "routine.create.confirm" | "routine.create.preview" | "routine.disable.confirm" | "routine.disable.preview" | "routine.list" | "routine.move.confirm" | "routine.move.preview" | "routine.pause" | "routine.resume" | "routine.run.confirm" | "routine.run.preview" | "routine.runs" | "routine.show" | "routine.trigger.create.confirm" | "routine.trigger.create.preview" | "routine.trigger.disable" | "routine.trigger.list" | "routine.update.confirm" | "routine.update.preview" | "run.create" | "run.dispatch.settle-terminal" | "run.dispatch.show" | "run.inbox.ack" | "run.inbox.check" | "run.ledger.create" | "run.ledger.list" | "run.ledger.task.dispatch" | "run.ledger.task.list" | "run.ledger.task.settle" | "run.ledger.task.show" | "run.list" | "run.question.cancel" | "run.question.open" | "run.question.reply" | "run.show" | "run.task.list" | "run.task.show" | "runtime.probe" | "secret.request" | "secret.set.confirm" | "secret.set.preview" | "session.adopt.confirm" | "session.adopt.preview" | "session.agent-permission.confirm" | "session.agent-permission.preview" | "session.archive" | "session.command.confirm" | "session.command.list" | "session.command.preview" | "session.command.send" | "session.create" | "session.defaults.show" | "session.detach.confirm" | "session.detach.preview" | "session.diff" | "session.events.list" | "session.fork.confirm" | "session.fork.preview" | "session.git.status" | "session.history.read" | "session.inbox.ack" | "session.inbox.check" | "session.list" | "session.message.send" | "session.observe" | "session.pause.confirm" | "session.pause.preview" | "session.placement.show" | "session.rename" | "session.resume" | "session.setup.confirm" | "session.setup.preview" | "session.show" | "session.spawn-caps.confirm" | "session.spawn-caps.preview" | "session.spawn-caps.show" | "session.spawn.confirm" | "session.spawn.preview" | "session.spawn.record" | "session.start" | "session.stop" | "session.switch.confirm" | "session.switch.preview" | "session.wait" | "skills.sync.confirm" | "skills.sync.preview" | "skills.sync.show" | "team-workspace.bootstrap.apply" | "team-workspace.bootstrap.preview" | "terminal.controller.acquire" | "terminal.controller.release" | "terminal.controller.renew" | "terminal.controller.request" | "terminal.controller.request.show" | "terminal.create" | "terminal.events.list" | "terminal.input.write" | "terminal.list" | "terminal.mutation.reconcile" | "terminal.observer.attach" | "terminal.observer.check" | "terminal.observer.detach" | "terminal.observer.resync" | "terminal.read" | "terminal.session.close" | "terminal.session.delete" | "terminal.session.resize" | "terminal.session.restart" | "terminal.session.signal" | "terminal.show" | "turn.attachment.policy" | "turn.cancel" | "turn.interrupt" | "turn.queue.edit" | "turn.queue.list" | "turn.queue.promote" | "turn.send" | "turn.show" | "turn.steer.confirm" | "turn.steer.preview" | "turn.wait" | "voice.managed-turn.confirm" | "voice.managed-turn.preview" | "voice.orchestrator.context.show" | "voice.orchestrator.tool.call" | "voice.pi.relay" | "voice.pi.relay.preview" | "voice.pi.relay.reconcile" | "webhooks.change.confirm" | "webhooks.change.preview" | "webhooks.deliveries" | "webhooks.list" | "workspace.branches.list" | "workspace.code-host.show" | "workspace.context.show" | "workspace.execution.configure" | "workspace.execution.show" | "workspace.list" | "workspace.membership.attach" | "workspace.repository.attach" | "workspace.select" | "workspace.show")[];
105
110
  readonly proof: string;
106
111
  }>;
107
112
  attachSession: (input: import("./attach-client.js").AttachSessionInput) => CliNodeEffect<import("./attach-client.js").SessionAttachStream>;
@@ -127,11 +132,12 @@ export declare const makeSessionClient: (node: CliNodeOperations) => {
127
132
  readonly stallAfterSeconds?: number;
128
133
  }) => CliNodeEffect<SessionObserveResult>;
129
134
  planSessions: (input: SessionCreationInput) => CliNodeEffect<SessionCreationPlan>;
130
- resumeSession: (input: StartSessionInput) => CliNodeEffect<SessionResumeResult>;
131
- runSessions: (plan: SessionCreationPlan) => CliNodeEffect<readonly SessionCreationOutcome[]>;
135
+ resumeSession: (input: ResumeSessionInput) => CliNodeEffect<SessionResumeResult>;
136
+ runSessions: (plan: SessionCreationPlan, options?: {
137
+ readonly until?: "created";
138
+ }) => CliNodeEffect<readonly SessionCreationOutcome[]>;
132
139
  sendAttachedSessionMessage: (input: SendAttachedSessionMessageInput) => CliNodeEffect<SessionMessageSendResult>;
133
140
  showSession: (sessionId: string) => CliNodeEffect<SessionShowResult>;
134
- spawnSession: (input: SpawnSessionInput) => CliNodeEffect<SessionSpawnResult>;
135
141
  startSession: (input: StartSessionInput) => CliNodeEffect<SessionStartResult>;
136
142
  stopSession: (input: StartSessionInput) => CliNodeEffect<SessionStopResult>;
137
143
  waitSession: (input: WaitSessionInput) => CliNodeEffect<SessionWaitResult>;
@@ -1,20 +1,44 @@
1
- import { MAX_SESSION_WAIT_MILLISECONDS, sessionCreateParametersSchema, sessionEventsListParametersSchema, sessionInboxAckParametersSchema, sessionInboxCheckParametersSchema, sessionListParametersSchema, sessionMessageSendParametersSchema, sessionObserveParametersSchema, sessionResumeParametersSchema, sessionShowParametersSchema, sessionSpawnParametersSchema, sessionStartParametersSchema, sessionStopParametersSchema, sessionWaitParametersSchema, } from "@maiaos/sdk";
1
+ import { MAX_SESSION_WAIT_MILLISECONDS, sessionCreateParametersSchema, sessionEventsListParametersSchema, sessionInboxAckParametersSchema, sessionInboxCheckParametersSchema, sessionListParametersSchema, sessionMessageSendParametersSchema, sessionObserveParametersSchema, sessionResumeParametersSchema, sessionShowParametersSchema, sessionStartParametersSchema, sessionStopParametersSchema, sessionWaitParametersSchema, } from "@maiaos/sdk";
2
2
  import * as Crypto from "effect/Crypto";
3
3
  import * as Effect from "effect/Effect";
4
4
  import { makeRelocateClient } from "../execution/index.js";
5
- import { commandIdentifier, repeatBoundedWait, } from "../local-node/index.js";
5
+ import { commandIdentifier, nodeAnswerOf, repeatBoundedWait, } from "../local-node/index.js";
6
6
  import { makeAgentPermissionCliClient } from "./agent-permission.js";
7
7
  import { makeAttachClient } from "./attach-client.js";
8
8
  import { makeCodingSessionClient } from "./coding-client.js";
9
+ import { toWorktreeRequest } from "./creation/index.js";
10
+ const keepingWords = (client, said) => {
11
+ const keep = (commandId, step) => Effect.tapError(step, (error) => Effect.sync(() => {
12
+ const answer = nodeAnswerOf(error);
13
+ if (answer !== undefined)
14
+ said.set(commandId, answer.message);
15
+ }));
16
+ return {
17
+ createSession: (parameters, options) => keep(parameters.commandId, client.createSession(parameters, options)),
18
+ listWorkspaces: (parameters, options) => client.listWorkspaces(parameters, options),
19
+ sendTurn: (parameters, options) => keep(parameters.commandId, client.sendTurn(parameters, options)),
20
+ showSession: (parameters, options) => client.showSession(parameters, options),
21
+ startSession: (parameters, options) => keep(parameters.commandId, client.startSession(parameters, options)),
22
+ };
23
+ };
24
+ const withWords = (outcome, said) => {
25
+ const { error } = outcome;
26
+ const message = error?.message === undefined && error?.commandId !== undefined
27
+ ? said.get(error.commandId)
28
+ : undefined;
29
+ return error === undefined || message === undefined
30
+ ? outcome
31
+ : { ...outcome, error: { ...error, message } };
32
+ };
9
33
  export const makeSessionClient = (node) => {
10
34
  const createSession = (input) => {
11
- const { baseRef, commandId: requestedCommandId, ...selection } = input;
35
+ const { baseRef, branch, commandId: requestedCommandId, ...selection } = input;
12
36
  return Effect.flatMap(commandIdentifier(requestedCommandId), (commandId) => {
13
37
  return node.runValidatedNodeOperation({
14
38
  ...selection,
15
39
  commandId,
16
40
  expectedRevision: "0",
17
- ...(baseRef === undefined ? {} : { worktree: { baseRef } }),
41
+ ...toWorktreeRequest({ baseRef, branch }),
18
42
  }, sessionCreateParametersSchema, (client, parameters, options) => client.createSession(parameters, options), { commandId });
19
43
  });
20
44
  };
@@ -28,8 +52,11 @@ export const makeSessionClient = (node) => {
28
52
  const waitSession = (input) => repeatBoundedWait({
29
53
  maxRequestMilliseconds: MAX_SESSION_WAIT_MILLISECONDS,
30
54
  once: (waitMilliseconds) => waitSessionOnce({
55
+ ...(input.activities === undefined
56
+ ? {}
57
+ : { activities: input.activities }),
31
58
  sessionId: input.sessionId,
32
- states: input.states,
59
+ ...(input.states === undefined ? {} : { states: input.states }),
33
60
  waitMilliseconds,
34
61
  }),
35
62
  satisfied: (value) => value.satisfied,
@@ -61,17 +88,6 @@ export const makeSessionClient = (node) => {
61
88
  return node.runDiscoveryOperation((options) => Effect.promise(() => import("@maiaos/sdk/node/effect")).pipe(Effect.flatMap((sdk) => sdk.acknowledgeAttachedSessionDeliveryEffect(parameters, options))));
62
89
  });
63
90
  };
64
- const spawnSession = (input) => {
65
- return Effect.flatMap(commandIdentifier(input.commandId), (commandId) => {
66
- return node.runValidatedNodeOperation({
67
- commandId,
68
- expectedRevision: "0",
69
- harness: input.harness,
70
- parentSessionId: input.parentSessionId,
71
- workspaceId: input.workspaceId,
72
- }, sessionSpawnParametersSchema, (client, parameters, options) => client.spawnSession(parameters, options), { commandId });
73
- });
74
- };
75
91
  const startSession = (input) => {
76
92
  return Effect.flatMap(commandIdentifier(input.commandId), (commandId) => {
77
93
  return node.runValidatedNodeOperation({
@@ -91,17 +107,22 @@ export const makeSessionClient = (node) => {
91
107
  });
92
108
  };
93
109
  const resumeSession = (input) => {
110
+ const supervised = input.parent === undefined ? {} : { parent: input.parent };
94
111
  return Effect.flatMap(commandIdentifier(input.commandId), (commandId) => {
95
112
  return node.runValidatedNodeOperation({
96
113
  commandId,
97
114
  expectedRevision: input.expectedRevision,
98
115
  sessionId: input.sessionId,
99
- }, sessionResumeParametersSchema, (client, parameters, options) => client.resumeSession(parameters, options), { commandId });
116
+ ...supervised,
117
+ }, sessionResumeParametersSchema, (client, { parent: _checked, ...parameters }, options) => client.resumeSession({ ...parameters, ...supervised }, options), { commandId });
100
118
  });
101
119
  };
102
120
  const withSdk = (operation) => Effect.flatMap(Crypto.Crypto, (crypto) => node.runNodeClientOperation((client) => Effect.promise(() => import("@maiaos/sdk/node/effect")).pipe(Effect.flatMap((sdk) => operation(sdk, client)), Effect.provideService(Crypto.Crypto, crypto))));
103
121
  const planSessions = (input) => withSdk((sdk, client) => sdk.planSessionCreationEffect(client, input));
104
- const runSessions = (plan) => withSdk((sdk, client) => sdk.createSessionsEffect(client, plan));
122
+ const runSessions = (plan, options) => withSdk((sdk, client) => {
123
+ const said = new Map();
124
+ return Effect.map(sdk.createSessionsEffect(keepingWords(client, said), plan, options), (outcomes) => outcomes.map((outcome) => withWords(outcome, said)));
125
+ });
105
126
  const awaitSessionRunning = (input) => withSdk((sdk, client) => sdk.awaitSessionRunningEffect(client, input.sessionId, input.deadlineMilliseconds));
106
127
  return {
107
128
  acknowledgeAttachedSessionDelivery,
@@ -116,7 +137,6 @@ export const makeSessionClient = (node) => {
116
137
  runSessions,
117
138
  sendAttachedSessionMessage,
118
139
  showSession,
119
- spawnSession,
120
140
  startSession,
121
141
  stopSession,
122
142
  waitSession,
@@ -8,6 +8,8 @@ export type ArchiveSessionInput = {
8
8
  readonly commandId?: string;
9
9
  readonly expectedRevision: string;
10
10
  readonly sessionId: string;
11
+ readonly summary?: string;
12
+ readonly transcriptPath?: string;
11
13
  };
12
14
  export declare const makeCodingSessionClient: (node: CliNodeOperations) => {
13
15
  archiveSession: (input: ArchiveSessionInput) => CliNodeEffect<SessionArchiveResult>;
@@ -3,9 +3,8 @@ import * as Effect from "effect/Effect";
3
3
  import { commandIdentifier, } from "../local-node/index.js";
4
4
  export const makeCodingSessionClient = (node) => ({
5
5
  archiveSession: (input) => Effect.flatMap(commandIdentifier(input.commandId), (commandId) => node.runValidatedNodeOperation({
6
+ ...input,
6
7
  commandId,
7
- expectedRevision: input.expectedRevision,
8
- sessionId: input.sessionId,
9
8
  }, sessionArchiveParametersSchema, (client, parameters, options) => client.archiveSession(parameters, options), { commandId })),
10
9
  diffSession: (input) => node.runValidatedNodeOperation({
11
10
  sessionId: input.sessionId,
@@ -29,19 +29,36 @@ const summarizeArchive = (result) => ({
29
29
  revision: result.session.revision,
30
30
  sessionId: result.session.id,
31
31
  state: result.session.state,
32
+ ...(result.summary === undefined ? {} : { summary: result.summary }),
33
+ ...(result.transcriptPath === undefined
34
+ ? {}
35
+ : { transcriptPath: result.transcriptPath }),
32
36
  });
33
- export const runSessionArchive = (tokens, context) => Effect.gen(function* () {
34
- const parsed = parseOptions(tokens, new Set(["--command-id", "--expected-revision"]));
37
+ const readArchiveInput = (tokens) => {
38
+ const parsed = parseOptions(tokens, new Set([
39
+ "--command-id",
40
+ "--expected-revision",
41
+ "--summary",
42
+ "--transcript",
43
+ ]));
35
44
  requirePositionals(parsed.positionals, 1);
36
- const { archiveSession } = context.dependencies;
37
- if (archiveSession === undefined)
38
- throw new CliArgumentError("Session archive is unavailable.");
39
45
  const commandId = parsed.options.get("--command-id");
40
- const result = yield* archiveSession({
46
+ const summary = parsed.options.get("--summary");
47
+ const transcriptPath = parsed.options.get("--transcript");
48
+ return {
41
49
  ...(commandId === undefined ? {} : { commandId }),
42
50
  expectedRevision: readExpectedRevision(parsed.options.get("--expected-revision")),
43
51
  sessionId: requireSessionId(parsed.positionals),
44
- });
52
+ ...(summary === undefined ? {} : { summary }),
53
+ ...(transcriptPath === undefined ? {} : { transcriptPath }),
54
+ };
55
+ };
56
+ export const runSessionArchive = (tokens, context) => Effect.gen(function* () {
57
+ const input = readArchiveInput(tokens);
58
+ const { archiveSession } = context.dependencies;
59
+ if (archiveSession === undefined)
60
+ throw new CliArgumentError("Session archive is unavailable.");
61
+ const result = yield* archiveSession(input);
45
62
  return writeSessionResult(result, context, (value) => ({
46
63
  command: "session.archive",
47
64
  result: summarizeArchive(value),
@@ -0,0 +1,109 @@
1
+ import { sessionCommandConfirmParametersSchema, } from "@maiaos/sdk";
2
+ import * as Effect from "effect/Effect";
3
+ import { cell, fields, writeNodeResult, } from "../../command-line/emit/index.js";
4
+ import { CliArgumentError, parseOptionsWith, readOptionalRevision, requirePositionals, } from "../../command-line/input/index.js";
5
+ import { confirmParameters, readTwoPhaseMode, runTwoPhase, TWO_PHASE_FLAGS, } from "../../command-line/two-phase/index.js";
6
+ import { changeAtRevision, commandIdentifier, } from "../../local-node/index.js";
7
+ import { requirePipedAlone } from "../fork/index.js";
8
+ const UNAVAILABLE = "Session commands are unavailable.";
9
+ const wired = (context) => {
10
+ const { call } = context.dependencies;
11
+ if (call === undefined)
12
+ throw new CliArgumentError(UNAVAILABLE);
13
+ return call;
14
+ };
15
+ const listText = ({ commands, executor, harnessVersion }) => {
16
+ const heading = `${cell(executor)} ${cell(harnessVersion ?? "(no harness version)")}\n`;
17
+ const rows = commands.map((command) => command.class === "refused"
18
+ ? `/${command.name}\trefused\t${command.reason}\t${command.operation ?? "-"}\n`
19
+ : `/${command.name}\t${command.class}\n`);
20
+ return heading + (rows.length === 0 ? "no commands\n" : rows.join(""));
21
+ };
22
+ const previewText = (preview) => fields([
23
+ ["Session", preview.sessionId],
24
+ ["Command", `/${preview.command}`],
25
+ ["Arguments", preview.arguments],
26
+ ["Class", preview.class],
27
+ ["Command ID", preview.commandId],
28
+ ["Revision", preview.expectedRevision],
29
+ ["Valid until", preview.validUntil],
30
+ ]);
31
+ const confirmedText = ({ class: kind, delivery, receipt, turn }) => fields([
32
+ ["Session", turn.sessionId],
33
+ ["Turn", turn.id],
34
+ ["Class", kind],
35
+ ["Delivery", delivery],
36
+ ["Receipt", receipt.receiptId],
37
+ ]);
38
+ const listed = {
39
+ toResult: (value) => ({ command: "session.command.list", result: value }),
40
+ toText: ({ result }) => listText(result),
41
+ };
42
+ const previewed = {
43
+ toResult: (value) => ({ command: "session.command.preview", result: value }),
44
+ toText: ({ result }) => previewText(result),
45
+ };
46
+ const confirmed = {
47
+ toResult: (value) => ({ command: "session.command.confirm", result: value }),
48
+ toText: ({ result }) => confirmedText(result),
49
+ };
50
+ export const runSessionCommandList = (tokens, context) => {
51
+ const parsed = parseOptionsWith(tokens, {
52
+ allowed: new Set(["--session"]),
53
+ allowedFlags: new Set(),
54
+ repeatable: new Set(),
55
+ });
56
+ requirePositionals(parsed.positionals, 0);
57
+ const sessionId = parsed.options.get("--session");
58
+ if (sessionId === undefined)
59
+ throw new CliArgumentError("Option '--session' is required.");
60
+ return Effect.map(wired(context)("session.command.list", { sessionId }), (result) => writeNodeResult(result, context, listed));
61
+ };
62
+ const previewCommand = (context, { options, positionals }) => {
63
+ requirePositionals(positionals, 2);
64
+ const [sessionId = "", command = ""] = positionals;
65
+ const named = readOptionalRevision(options);
66
+ const arguments_ = options.get("--arguments");
67
+ const call = wired(context);
68
+ const { showSession } = context.dependencies;
69
+ if (showSession === undefined)
70
+ throw new CliArgumentError(UNAVAILABLE);
71
+ return Effect.flatMap(commandIdentifier(options.get("--command-id")), (commandId) => changeAtRevision(named, {
72
+ change: (expectedRevision) => call("session.command.preview", {
73
+ ...(arguments_ === undefined ? {} : { arguments: arguments_ }),
74
+ command: command.replace(/^\//u, ""),
75
+ commandId,
76
+ expectedRevision,
77
+ sessionId,
78
+ }),
79
+ read: () => showSession(sessionId),
80
+ revisionOf: ({ session }) => ({ ok: true, value: session.revision }),
81
+ }));
82
+ };
83
+ const SEND_OPTIONS = {
84
+ allowed: new Set(["--arguments", "--command-id", "--expected-revision"]),
85
+ allowedFlags: new Set(TWO_PHASE_FLAGS),
86
+ repeatable: new Set(),
87
+ };
88
+ export const runSessionCommandSend = (tokens, context) => {
89
+ const parsed = parseOptionsWith(tokens, SEND_OPTIONS);
90
+ const mode = readTwoPhaseMode(parsed.flags, context);
91
+ if (mode === "confirm-stdin")
92
+ requirePipedAlone(parsed, "Session, command and command ID");
93
+ const call = wired(context);
94
+ return runTwoPhase({
95
+ confirm: (preview) => Effect.flatMap(confirmParameters(sessionCommandConfirmParametersSchema, preview, [
96
+ "class",
97
+ ]), (confirmation) => call("session.command.confirm", confirmation)),
98
+ context,
99
+ mode,
100
+ preview: () => previewCommand(context, parsed),
101
+ prompt: {
102
+ describe: previewText,
103
+ question: "Send this command to the Session's executor?",
104
+ },
105
+ writeConfirm: (result) => writeNodeResult(result, context, confirmed),
106
+ writePreview: (result) => writeNodeResult(result, context, previewed),
107
+ });
108
+ };
109
+ //# sourceMappingURL=commands.js.map
@@ -0,0 +1,2 @@
1
+ export { runSessionCommandList, runSessionCommandSend } from "./commands.js";
2
+ //# sourceMappingURL=index.js.map
@@ -1,14 +1,19 @@
1
- import { type CommandContext, type CommandEffect } from "../command-line/index.js";
1
+ import { Effect } from "effect";
2
+ import { CliArgumentError, type CommandContext, type CommandEffect } from "../command-line/index.js";
2
3
  export declare const runSessionCreate: (tokens: readonly string[], context: CommandContext) => CommandEffect;
3
4
  export declare const runSessionList: (tokens: readonly string[], context: CommandContext) => CommandEffect;
5
+ export declare const runSessionPlacementShow: (tokens: readonly string[], context: CommandContext) => CommandEffect;
6
+ export declare const runSessionDefaultsShow: (tokens: readonly string[], context: CommandContext) => CommandEffect;
4
7
  export declare const runSessionShow: (tokens: readonly string[], context: CommandContext) => CommandEffect;
5
8
  export declare const runSessionWait: (tokens: readonly string[], context: CommandContext) => CommandEffect;
6
9
  export declare const runSessionStart: (tokens: readonly string[], context: CommandContext) => CommandEffect;
7
10
  export declare const runSessionStop: (tokens: readonly string[], context: CommandContext) => CommandEffect;
8
11
  export declare const runSessionResume: (tokens: readonly string[], context: CommandContext) => CommandEffect;
12
+ export declare const runSessionReconcile: (tokens: readonly string[], context: CommandContext) => CommandEffect;
9
13
  export declare const runSessionEventsList: (tokens: readonly string[], context: CommandContext) => CommandEffect;
10
14
  export declare const runSessionObserve: (tokens: readonly string[], context: CommandContext) => CommandEffect;
11
15
  export declare const runSessionMessageSend: (tokens: readonly string[], context: CommandContext) => CommandEffect;
12
16
  export declare const runSessionInboxCheck: (tokens: readonly string[], context: CommandContext) => CommandEffect;
13
17
  export declare const runSessionInboxAck: (tokens: readonly string[], context: CommandContext) => CommandEffect;
18
+ export declare const runSessionSpawn: (tokens: readonly string[], context: CommandContext) => Effect.Effect<number, CliArgumentError, import("effect/Crypto").Crypto>;
14
19
  //# sourceMappingURL=commands.d.ts.map