@maiaos/cli 0.1.0-canary.10

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 (513) hide show
  1. package/README.md +60 -0
  2. package/dist/address-space/address-space.d.ts +38 -0
  3. package/dist/address-space/address-space.js +130 -0
  4. package/dist/address-space/index.d.ts +2 -0
  5. package/dist/address-space/index.js +2 -0
  6. package/dist/agents/client.d.ts +171 -0
  7. package/dist/agents/client.js +8 -0
  8. package/dist/agents/commands.d.ts +7 -0
  9. package/dist/agents/commands.js +65 -0
  10. package/dist/agents/index.d.ts +3 -0
  11. package/dist/agents/index.js +3 -0
  12. package/dist/agents/input.d.ts +130 -0
  13. package/dist/agents/input.js +99 -0
  14. package/dist/agents/output/format.d.ts +8 -0
  15. package/dist/agents/output/format.js +47 -0
  16. package/dist/agents/output/index.d.ts +2 -0
  17. package/dist/agents/output/index.js +2 -0
  18. package/dist/agents/tree/index.d.ts +2 -0
  19. package/dist/agents/tree/index.js +2 -0
  20. package/dist/agents/tree/tree.d.ts +3 -0
  21. package/dist/agents/tree/tree.js +43 -0
  22. package/dist/bin/maia.NOTICES.txt +59 -0
  23. package/dist/bin/maia.cdx.json +168 -0
  24. package/dist/bin/maia.mjs +2 -0
  25. package/dist/bootstrap/exit.d.ts +14 -0
  26. package/dist/bootstrap/exit.js +42 -0
  27. package/dist/bootstrap/index.d.ts +3 -0
  28. package/dist/bootstrap/index.js +3 -0
  29. package/dist/bootstrap/process.d.ts +5 -0
  30. package/dist/bootstrap/process.js +23 -0
  31. package/dist/bootstrap/run.d.ts +25 -0
  32. package/dist/bootstrap/run.js +95 -0
  33. package/dist/bootstrap/stdio.d.ts +4 -0
  34. package/dist/bootstrap/stdio.js +9 -0
  35. package/dist/cli/cli.d.ts +17 -0
  36. package/dist/cli/cli.js +545 -0
  37. package/dist/cli/environment.d.ts +8 -0
  38. package/dist/cli/environment.js +12 -0
  39. package/dist/cli/index.d.ts +2 -0
  40. package/dist/cli/index.js +2 -0
  41. package/dist/cli/services.d.ts +4 -0
  42. package/dist/cli/services.js +4 -0
  43. package/dist/command-line/context.d.ts +188 -0
  44. package/dist/command-line/context.js +2 -0
  45. package/dist/command-line/index.d.ts +7 -0
  46. package/dist/command-line/index.js +7 -0
  47. package/dist/command-line/input/arguments.d.ts +62 -0
  48. package/dist/command-line/input/arguments.js +232 -0
  49. package/dist/command-line/input/index.d.ts +4 -0
  50. package/dist/command-line/input/index.js +4 -0
  51. package/dist/command-line/input/prompt.d.ts +8 -0
  52. package/dist/command-line/input/prompt.js +44 -0
  53. package/dist/command-line/input/stdin-stream.d.ts +4 -0
  54. package/dist/command-line/input/stdin-stream.js +3 -0
  55. package/dist/command-line/input/stdin.d.ts +12 -0
  56. package/dist/command-line/input/stdin.js +24 -0
  57. package/dist/command-line/json-decoder.d.ts +3 -0
  58. package/dist/command-line/json-decoder.js +3 -0
  59. package/dist/command-line/json.d.ts +4 -0
  60. package/dist/command-line/json.js +27 -0
  61. package/dist/command-line/output.d.ts +64 -0
  62. package/dist/command-line/output.js +113 -0
  63. package/dist/command-line/rows.d.ts +12 -0
  64. package/dist/command-line/rows.js +41 -0
  65. package/dist/command-line/two-phase.d.ts +62 -0
  66. package/dist/command-line/two-phase.js +173 -0
  67. package/dist/command-receipt/command.d.ts +4 -0
  68. package/dist/command-receipt/command.js +59 -0
  69. package/dist/command-receipt/compact-list.d.ts +20 -0
  70. package/dist/command-receipt/compact-list.js +29 -0
  71. package/dist/command-receipt/index.d.ts +3 -0
  72. package/dist/command-receipt/index.js +3 -0
  73. package/dist/command-tree/commands.d.ts +17 -0
  74. package/dist/command-tree/commands.js +41 -0
  75. package/dist/command-tree/completion.d.ts +6 -0
  76. package/dist/command-tree/completion.js +36 -0
  77. package/dist/command-tree/grammar.d.ts +18 -0
  78. package/dist/command-tree/grammar.js +160 -0
  79. package/dist/command-tree/help.d.ts +62 -0
  80. package/dist/command-tree/help.js +220 -0
  81. package/dist/command-tree/index.d.ts +8 -0
  82. package/dist/command-tree/index.js +6 -0
  83. package/dist/command-tree/local.d.ts +3 -0
  84. package/dist/command-tree/local.js +138 -0
  85. package/dist/command-tree/placeholder.d.ts +4 -0
  86. package/dist/command-tree/placeholder.js +5 -0
  87. package/dist/command-tree/row.d.ts +31 -0
  88. package/dist/command-tree/row.js +2 -0
  89. package/dist/command-tree/suggest.d.ts +3 -0
  90. package/dist/command-tree/suggest.js +81 -0
  91. package/dist/command-tree/tree.d.ts +35 -0
  92. package/dist/command-tree/tree.js +140 -0
  93. package/dist/connection/access/client.d.ts +13 -0
  94. package/dist/connection/access/client.js +19 -0
  95. package/dist/connection/access/commands.d.ts +6 -0
  96. package/dist/connection/access/commands.js +60 -0
  97. package/dist/connection/access/format.d.ts +8 -0
  98. package/dist/connection/access/format.js +61 -0
  99. package/dist/connection/access/index.d.ts +3 -0
  100. package/dist/connection/access/index.js +3 -0
  101. package/dist/connection/access/input.d.ts +53 -0
  102. package/dist/connection/access/input.js +83 -0
  103. package/dist/connection/client.d.ts +790 -0
  104. package/dist/connection/client.js +36 -0
  105. package/dist/connection/commands.d.ts +15 -0
  106. package/dist/connection/commands.js +118 -0
  107. package/dist/connection/index.d.ts +8 -0
  108. package/dist/connection/index.js +8 -0
  109. package/dist/connection/input.d.ts +50 -0
  110. package/dist/connection/input.js +90 -0
  111. package/dist/connection/login.d.ts +13 -0
  112. package/dist/connection/login.js +69 -0
  113. package/dist/connection/output/format.d.ts +32 -0
  114. package/dist/connection/output/format.js +94 -0
  115. package/dist/connection/output/index.d.ts +2 -0
  116. package/dist/connection/output/index.js +2 -0
  117. package/dist/connection/resolve.d.ts +60 -0
  118. package/dist/connection/resolve.js +30 -0
  119. package/dist/connection/signin.d.ts +4 -0
  120. package/dist/connection/signin.js +32 -0
  121. package/dist/connection/system.d.ts +5 -0
  122. package/dist/connection/system.js +294 -0
  123. package/dist/connection/tree/index.d.ts +2 -0
  124. package/dist/connection/tree/index.js +2 -0
  125. package/dist/connection/tree/tree.d.ts +3 -0
  126. package/dist/connection/tree/tree.js +260 -0
  127. package/dist/container/client.d.ts +142 -0
  128. package/dist/container/client.js +11 -0
  129. package/dist/container/commands.d.ts +7 -0
  130. package/dist/container/commands.js +100 -0
  131. package/dist/container/index.d.ts +3 -0
  132. package/dist/container/index.js +3 -0
  133. package/dist/container/output/format.d.ts +11 -0
  134. package/dist/container/output/format.js +27 -0
  135. package/dist/container/output/index.d.ts +2 -0
  136. package/dist/container/output/index.js +2 -0
  137. package/dist/context/client.d.ts +7 -0
  138. package/dist/context/client.js +21 -0
  139. package/dist/context/commands.d.ts +3 -0
  140. package/dist/context/commands.js +27 -0
  141. package/dist/context/index.d.ts +3 -0
  142. package/dist/context/index.js +3 -0
  143. package/dist/dashboard/cockpit-client.d.ts +6 -0
  144. package/dist/dashboard/cockpit-client.js +27 -0
  145. package/dist/dashboard/cockpits.d.ts +29 -0
  146. package/dist/dashboard/cockpits.js +65 -0
  147. package/dist/dashboard/dashboard.d.ts +7 -0
  148. package/dist/dashboard/dashboard.js +47 -0
  149. package/dist/dashboard/draw.d.ts +15 -0
  150. package/dist/dashboard/draw.js +30 -0
  151. package/dist/dashboard/frame.d.ts +4 -0
  152. package/dist/dashboard/frame.js +15 -0
  153. package/dist/dashboard/index.d.ts +2 -0
  154. package/dist/dashboard/index.js +2 -0
  155. package/dist/dashboard/modes.d.ts +5 -0
  156. package/dist/dashboard/modes.js +16 -0
  157. package/dist/dashboard/node-connection.d.ts +15 -0
  158. package/dist/dashboard/node-connection.js +51 -0
  159. package/dist/dashboard/pi-tui.d.ts +6 -0
  160. package/dist/dashboard/pi-tui.js +35 -0
  161. package/dist/dashboard/status-bar.d.ts +4 -0
  162. package/dist/dashboard/status-bar.js +60 -0
  163. package/dist/dashboard/terminal.d.ts +53 -0
  164. package/dist/dashboard/terminal.js +165 -0
  165. package/dist/dashboard/tree-model.d.ts +28 -0
  166. package/dist/dashboard/tree-model.js +97 -0
  167. package/dist/dashboard/tree.d.ts +10 -0
  168. package/dist/dashboard/tree.js +76 -0
  169. package/dist/development/cli.d.ts +3 -0
  170. package/dist/development/cli.js +44 -0
  171. package/dist/execution/client.d.ts +25 -0
  172. package/dist/execution/client.js +24 -0
  173. package/dist/execution/index.d.ts +3 -0
  174. package/dist/execution/index.js +3 -0
  175. package/dist/execution/relocation.d.ts +6 -0
  176. package/dist/execution/relocation.js +123 -0
  177. package/dist/execution/tree/index.d.ts +2 -0
  178. package/dist/execution/tree/index.js +2 -0
  179. package/dist/execution/tree/tree.d.ts +3 -0
  180. package/dist/execution/tree/tree.js +137 -0
  181. package/dist/fleet/fleet.d.ts +70 -0
  182. package/dist/fleet/fleet.js +91 -0
  183. package/dist/fleet/index.d.ts +2 -0
  184. package/dist/fleet/index.js +2 -0
  185. package/dist/hold/client.d.ts +137 -0
  186. package/dist/hold/client.js +12 -0
  187. package/dist/hold/commands.d.ts +5 -0
  188. package/dist/hold/commands.js +91 -0
  189. package/dist/hold/index.d.ts +3 -0
  190. package/dist/hold/index.js +3 -0
  191. package/dist/hold/output/format.d.ts +11 -0
  192. package/dist/hold/output/format.js +25 -0
  193. package/dist/hold/output/index.d.ts +2 -0
  194. package/dist/hold/output/index.js +2 -0
  195. package/dist/hold/tree/index.d.ts +2 -0
  196. package/dist/hold/tree/index.js +2 -0
  197. package/dist/hold/tree/tree.d.ts +3 -0
  198. package/dist/hold/tree/tree.js +97 -0
  199. package/dist/import/client.d.ts +14 -0
  200. package/dist/import/client.js +16 -0
  201. package/dist/import/commands.d.ts +5 -0
  202. package/dist/import/commands.js +75 -0
  203. package/dist/import/index.d.ts +3 -0
  204. package/dist/import/index.js +3 -0
  205. package/dist/import/input.d.ts +16 -0
  206. package/dist/import/input.js +92 -0
  207. package/dist/import/output.d.ts +6 -0
  208. package/dist/import/output.js +37 -0
  209. package/dist/index.d.ts +2 -0
  210. package/dist/index.js +2 -0
  211. package/dist/integration/client.d.ts +1284 -0
  212. package/dist/integration/client.js +24 -0
  213. package/dist/integration/commands.d.ts +10 -0
  214. package/dist/integration/commands.js +104 -0
  215. package/dist/integration/index.d.ts +3 -0
  216. package/dist/integration/index.js +3 -0
  217. package/dist/integration/output.d.ts +22 -0
  218. package/dist/integration/output.js +20 -0
  219. package/dist/local-node/call.d.ts +7 -0
  220. package/dist/local-node/call.js +13 -0
  221. package/dist/local-node/client.d.ts +72 -0
  222. package/dist/local-node/client.js +253 -0
  223. package/dist/local-node/index.d.ts +4 -0
  224. package/dist/local-node/index.js +4 -0
  225. package/dist/local-node/wait.d.ts +10 -0
  226. package/dist/local-node/wait.js +17 -0
  227. package/dist/login/agent-provider.d.ts +20 -0
  228. package/dist/login/agent-provider.js +109 -0
  229. package/dist/login/commands.d.ts +4 -0
  230. package/dist/login/commands.js +94 -0
  231. package/dist/login/failure.d.ts +3 -0
  232. package/dist/login/failure.js +14 -0
  233. package/dist/login/gateway.d.ts +12 -0
  234. package/dist/login/gateway.js +71 -0
  235. package/dist/login/index.d.ts +3 -0
  236. package/dist/login/index.js +2 -0
  237. package/dist/login/menu.d.ts +4 -0
  238. package/dist/login/menu.js +105 -0
  239. package/dist/login/output/format.d.ts +16 -0
  240. package/dist/login/output/format.js +31 -0
  241. package/dist/login/output/index.d.ts +2 -0
  242. package/dist/login/output/index.js +2 -0
  243. package/dist/login/vendor-account.d.ts +95 -0
  244. package/dist/login/vendor-account.js +75 -0
  245. package/dist/login/vendor-input.d.ts +14 -0
  246. package/dist/login/vendor-input.js +36 -0
  247. package/dist/mcp/calls.d.ts +8 -0
  248. package/dist/mcp/calls.js +236 -0
  249. package/dist/mcp/commands.d.ts +12 -0
  250. package/dist/mcp/commands.js +47 -0
  251. package/dist/mcp/index.d.ts +2 -0
  252. package/dist/mcp/index.js +2 -0
  253. package/dist/mcp/routing.d.ts +24 -0
  254. package/dist/mcp/routing.js +188 -0
  255. package/dist/mcp/server.d.ts +20 -0
  256. package/dist/mcp/server.js +80 -0
  257. package/dist/orchestration/client.d.ts +78 -0
  258. package/dist/orchestration/client.js +89 -0
  259. package/dist/orchestration/commands.d.ts +14 -0
  260. package/dist/orchestration/commands.js +312 -0
  261. package/dist/orchestration/index.d.ts +3 -0
  262. package/dist/orchestration/index.js +3 -0
  263. package/dist/orchestration/output/compact-aggregate.d.ts +121 -0
  264. package/dist/orchestration/output/compact-aggregate.js +110 -0
  265. package/dist/orchestration/output/compact-run-list.d.ts +20 -0
  266. package/dist/orchestration/output/compact-run-list.js +16 -0
  267. package/dist/orchestration/output/human.d.ts +80 -0
  268. package/dist/orchestration/output/human.js +252 -0
  269. package/dist/orchestration/output/index.d.ts +4 -0
  270. package/dist/orchestration/output/index.js +4 -0
  271. package/dist/orchestration/tree/index.d.ts +2 -0
  272. package/dist/orchestration/tree/index.js +2 -0
  273. package/dist/orchestration/tree/tree.d.ts +3 -0
  274. package/dist/orchestration/tree/tree.js +142 -0
  275. package/dist/port-lease/client.d.ts +160 -0
  276. package/dist/port-lease/client.js +11 -0
  277. package/dist/port-lease/commands.d.ts +6 -0
  278. package/dist/port-lease/commands.js +17 -0
  279. package/dist/port-lease/index.d.ts +3 -0
  280. package/dist/port-lease/index.js +3 -0
  281. package/dist/port-lease/input.d.ts +65 -0
  282. package/dist/port-lease/input.js +67 -0
  283. package/dist/port-lease/output/format.d.ts +11 -0
  284. package/dist/port-lease/output/format.js +24 -0
  285. package/dist/port-lease/output/index.d.ts +2 -0
  286. package/dist/port-lease/output/index.js +2 -0
  287. package/dist/presentation/client.d.ts +10 -0
  288. package/dist/presentation/client.js +9 -0
  289. package/dist/presentation/commands.d.ts +6 -0
  290. package/dist/presentation/commands.js +78 -0
  291. package/dist/presentation/index.d.ts +4 -0
  292. package/dist/presentation/index.js +3 -0
  293. package/dist/presentation/output/format.d.ts +11 -0
  294. package/dist/presentation/output/format.js +33 -0
  295. package/dist/presentation/output/index.d.ts +3 -0
  296. package/dist/presentation/output/index.js +2 -0
  297. package/dist/project-guard/client.d.ts +88 -0
  298. package/dist/project-guard/client.js +7 -0
  299. package/dist/project-guard/commands.d.ts +4 -0
  300. package/dist/project-guard/commands.js +48 -0
  301. package/dist/project-guard/index.d.ts +3 -0
  302. package/dist/project-guard/index.js +3 -0
  303. package/dist/project-guard/input.d.ts +18 -0
  304. package/dist/project-guard/input.js +47 -0
  305. package/dist/project-guard/output/format.d.ts +11 -0
  306. package/dist/project-guard/output/format.js +35 -0
  307. package/dist/project-guard/output/index.d.ts +2 -0
  308. package/dist/project-guard/output/index.js +2 -0
  309. package/dist/project-workspace/client.d.ts +86 -0
  310. package/dist/project-workspace/client.js +159 -0
  311. package/dist/project-workspace/commands.d.ts +30 -0
  312. package/dist/project-workspace/commands.js +710 -0
  313. package/dist/project-workspace/index.d.ts +5 -0
  314. package/dist/project-workspace/index.js +5 -0
  315. package/dist/project-workspace/metadata-client.d.ts +99 -0
  316. package/dist/project-workspace/metadata-client.js +8 -0
  317. package/dist/project-workspace/metadata-commands.d.ts +4 -0
  318. package/dist/project-workspace/metadata-commands.js +56 -0
  319. package/dist/project-workspace/output/human.d.ts +139 -0
  320. package/dist/project-workspace/output/human.js +115 -0
  321. package/dist/project-workspace/output/index.d.ts +3 -0
  322. package/dist/project-workspace/output/index.js +3 -0
  323. package/dist/project-workspace/output/metadata.d.ts +11 -0
  324. package/dist/project-workspace/output/metadata.js +17 -0
  325. package/dist/project-workspace/tree/index.d.ts +2 -0
  326. package/dist/project-workspace/tree/index.js +2 -0
  327. package/dist/project-workspace/tree/tree.d.ts +3 -0
  328. package/dist/project-workspace/tree/tree.js +212 -0
  329. package/dist/provider/client.d.ts +6 -0
  330. package/dist/provider/client.js +5 -0
  331. package/dist/provider/commands.d.ts +3 -0
  332. package/dist/provider/commands.js +38 -0
  333. package/dist/provider/index.d.ts +3 -0
  334. package/dist/provider/index.js +3 -0
  335. package/dist/reference/commands.d.ts +3 -0
  336. package/dist/reference/commands.js +41 -0
  337. package/dist/reference/index.d.ts +3 -0
  338. package/dist/reference/index.js +3 -0
  339. package/dist/reference/resolve.d.ts +31 -0
  340. package/dist/reference/resolve.js +304 -0
  341. package/dist/reference/tree/index.d.ts +2 -0
  342. package/dist/reference/tree/index.js +2 -0
  343. package/dist/reference/tree/tree.d.ts +3 -0
  344. package/dist/reference/tree/tree.js +17 -0
  345. package/dist/remote-node/client.d.ts +338 -0
  346. package/dist/remote-node/client.js +17 -0
  347. package/dist/remote-node/commands.d.ts +15 -0
  348. package/dist/remote-node/commands.js +342 -0
  349. package/dist/remote-node/connector.d.ts +67 -0
  350. package/dist/remote-node/connector.js +143 -0
  351. package/dist/remote-node/index.d.ts +4 -0
  352. package/dist/remote-node/index.js +4 -0
  353. package/dist/remote-node/reachability.d.ts +64 -0
  354. package/dist/remote-node/reachability.js +44 -0
  355. package/dist/remote-node/text.d.ts +10 -0
  356. package/dist/remote-node/text.js +111 -0
  357. package/dist/remote-node/tree/index.d.ts +2 -0
  358. package/dist/remote-node/tree/index.js +2 -0
  359. package/dist/remote-node/tree/tree.d.ts +3 -0
  360. package/dist/remote-node/tree/tree.js +71 -0
  361. package/dist/routine/client.d.ts +398 -0
  362. package/dist/routine/client.js +28 -0
  363. package/dist/routine/commands.d.ts +9 -0
  364. package/dist/routine/commands.js +109 -0
  365. package/dist/routine/index.d.ts +3 -0
  366. package/dist/routine/index.js +3 -0
  367. package/dist/routine/input.d.ts +28 -0
  368. package/dist/routine/input.js +44 -0
  369. package/dist/routine/output/format.d.ts +23 -0
  370. package/dist/routine/output/format.js +83 -0
  371. package/dist/routine/output/index.d.ts +2 -0
  372. package/dist/routine/output/index.js +2 -0
  373. package/dist/routine/tree/index.d.ts +2 -0
  374. package/dist/routine/tree/index.js +2 -0
  375. package/dist/routine/tree/tree.d.ts +3 -0
  376. package/dist/routine/tree/tree.js +70 -0
  377. package/dist/run-ledger/client.d.ts +358 -0
  378. package/dist/run-ledger/client.js +13 -0
  379. package/dist/run-ledger/commands.d.ts +8 -0
  380. package/dist/run-ledger/commands.js +19 -0
  381. package/dist/run-ledger/index.d.ts +3 -0
  382. package/dist/run-ledger/index.js +3 -0
  383. package/dist/run-ledger/input.d.ts +42 -0
  384. package/dist/run-ledger/input.js +107 -0
  385. package/dist/run-ledger/output/format.d.ts +11 -0
  386. package/dist/run-ledger/output/format.js +49 -0
  387. package/dist/run-ledger/output/index.d.ts +2 -0
  388. package/dist/run-ledger/output/index.js +2 -0
  389. package/dist/session/agent-permission.d.ts +63 -0
  390. package/dist/session/agent-permission.js +20 -0
  391. package/dist/session/approval/client.d.ts +117 -0
  392. package/dist/session/approval/client.js +7 -0
  393. package/dist/session/approval/commands.d.ts +7 -0
  394. package/dist/session/approval/commands.js +145 -0
  395. package/dist/session/approval/index.d.ts +3 -0
  396. package/dist/session/approval/index.js +3 -0
  397. package/dist/session/approval/output/format.d.ts +23 -0
  398. package/dist/session/approval/output/format.js +33 -0
  399. package/dist/session/approval/output/index.d.ts +2 -0
  400. package/dist/session/approval/output/index.js +2 -0
  401. package/dist/session/attach-client.d.ts +16 -0
  402. package/dist/session/attach-client.js +17 -0
  403. package/dist/session/attach-render.d.ts +16 -0
  404. package/dist/session/attach-render.js +162 -0
  405. package/dist/session/attach.d.ts +5 -0
  406. package/dist/session/attach.js +120 -0
  407. package/dist/session/client.d.ts +140 -0
  408. package/dist/session/client.js +129 -0
  409. package/dist/session/coding-client.d.ts +16 -0
  410. package/dist/session/coding-client.js +15 -0
  411. package/dist/session/coding-commands.d.ts +4 -0
  412. package/dist/session/coding-commands.js +50 -0
  413. package/dist/session/commands.d.ts +14 -0
  414. package/dist/session/commands.js +585 -0
  415. package/dist/session/create-tasks.d.ts +20 -0
  416. package/dist/session/create-tasks.js +128 -0
  417. package/dist/session/index.d.ts +9 -0
  418. package/dist/session/index.js +8 -0
  419. package/dist/session/interaction/client.d.ts +347 -0
  420. package/dist/session/interaction/client.js +15 -0
  421. package/dist/session/interaction/commands.d.ts +7 -0
  422. package/dist/session/interaction/commands.js +101 -0
  423. package/dist/session/interaction/index.d.ts +3 -0
  424. package/dist/session/interaction/index.js +3 -0
  425. package/dist/session/interaction/input.d.ts +15 -0
  426. package/dist/session/interaction/input.js +46 -0
  427. package/dist/session/interaction/output/format.d.ts +11 -0
  428. package/dist/session/interaction/output/format.js +4 -0
  429. package/dist/session/interaction/output/index.d.ts +2 -0
  430. package/dist/session/interaction/output/index.js +2 -0
  431. package/dist/session/output/diff.d.ts +3 -0
  432. package/dist/session/output/diff.js +23 -0
  433. package/dist/session/output/failure.d.ts +11 -0
  434. package/dist/session/output/failure.js +17 -0
  435. package/dist/session/output/human.d.ts +113 -0
  436. package/dist/session/output/human.js +82 -0
  437. package/dist/session/output/index.d.ts +6 -0
  438. package/dist/session/output/index.js +6 -0
  439. package/dist/session/output/observe.d.ts +4 -0
  440. package/dist/session/output/observe.js +46 -0
  441. package/dist/session/output/tasks.d.ts +34 -0
  442. package/dist/session/output/tasks.js +48 -0
  443. package/dist/session/rename.d.ts +3 -0
  444. package/dist/session/rename.js +37 -0
  445. package/dist/session/task-file.d.ts +5 -0
  446. package/dist/session/task-file.js +23 -0
  447. package/dist/session/tree/index.d.ts +2 -0
  448. package/dist/session/tree/index.js +2 -0
  449. package/dist/session/tree/tree.d.ts +3 -0
  450. package/dist/session/tree/tree.js +368 -0
  451. package/dist/session/turn/client.d.ts +28 -0
  452. package/dist/session/turn/client.js +51 -0
  453. package/dist/session/turn/commands.d.ts +8 -0
  454. package/dist/session/turn/commands.js +185 -0
  455. package/dist/session/turn/index.d.ts +4 -0
  456. package/dist/session/turn/index.js +3 -0
  457. package/dist/session/turn/output.d.ts +47 -0
  458. package/dist/session/turn/output.js +61 -0
  459. package/dist/status/client.d.ts +124 -0
  460. package/dist/status/client.js +5 -0
  461. package/dist/status/command.d.ts +4 -0
  462. package/dist/status/command.js +40 -0
  463. package/dist/status/doctor.d.ts +15 -0
  464. package/dist/status/doctor.js +111 -0
  465. package/dist/status/index.d.ts +5 -0
  466. package/dist/status/index.js +4 -0
  467. package/dist/status/output/compact.d.ts +32 -0
  468. package/dist/status/output/compact.js +49 -0
  469. package/dist/status/output/human.d.ts +7 -0
  470. package/dist/status/output/human.js +87 -0
  471. package/dist/status/output/index.d.ts +3 -0
  472. package/dist/status/output/index.js +3 -0
  473. package/dist/team-workspace/ceremony.d.ts +19 -0
  474. package/dist/team-workspace/ceremony.js +141 -0
  475. package/dist/team-workspace/client.d.ts +58 -0
  476. package/dist/team-workspace/client.js +6 -0
  477. package/dist/team-workspace/commands.d.ts +3 -0
  478. package/dist/team-workspace/commands.js +85 -0
  479. package/dist/team-workspace/confirmation.d.ts +4 -0
  480. package/dist/team-workspace/confirmation.js +8 -0
  481. package/dist/team-workspace/dependencies.d.ts +8 -0
  482. package/dist/team-workspace/dependencies.js +2 -0
  483. package/dist/team-workspace/index.d.ts +6 -0
  484. package/dist/team-workspace/index.js +5 -0
  485. package/dist/team-workspace/launcher.d.ts +17 -0
  486. package/dist/team-workspace/launcher.js +30 -0
  487. package/dist/team-workspace/output.d.ts +15 -0
  488. package/dist/team-workspace/output.js +28 -0
  489. package/dist/team-workspace/terminal.d.ts +9 -0
  490. package/dist/team-workspace/terminal.js +46 -0
  491. package/dist/terminal/arguments.d.ts +13 -0
  492. package/dist/terminal/arguments.js +79 -0
  493. package/dist/terminal/client.d.ts +83 -0
  494. package/dist/terminal/client.js +71 -0
  495. package/dist/terminal/commands.d.ts +7 -0
  496. package/dist/terminal/commands.js +143 -0
  497. package/dist/terminal/control-commands.d.ts +10 -0
  498. package/dist/terminal/control-commands.js +212 -0
  499. package/dist/terminal/index.d.ts +4 -0
  500. package/dist/terminal/index.js +4 -0
  501. package/dist/terminal/output/compact-list.d.ts +148 -0
  502. package/dist/terminal/output/compact-list.js +153 -0
  503. package/dist/terminal/output/human.d.ts +42 -0
  504. package/dist/terminal/output/human.js +55 -0
  505. package/dist/terminal/output/index.d.ts +3 -0
  506. package/dist/terminal/output/index.js +3 -0
  507. package/dist/terminal/tree/index.d.ts +2 -0
  508. package/dist/terminal/tree/index.js +2 -0
  509. package/dist/terminal/tree/tree.d.ts +3 -0
  510. package/dist/terminal/tree/tree.js +104 -0
  511. package/guidance/maia-cli/SKILL.md +58 -0
  512. package/guidance/maia-orchestration/SKILL.md +54 -0
  513. package/package.json +78 -0
@@ -0,0 +1,162 @@
1
+ import { isNewSessionRecord, reduceSessionAttach, sessionItemText, } from "@maiaos/sdk";
2
+ import { block, cell } from "../command-line/index.js";
3
+ import { formatFailureCell } from "./output/index.js";
4
+ const MAX_ARGUMENTS_SHOWN = 200;
5
+ const header = (item) => {
6
+ switch (item.kind) {
7
+ case "message":
8
+ return item.role === "user" ? "user> " : "assistant> ";
9
+ case "reasoning":
10
+ return "thinking> ";
11
+ case "command":
12
+ return `$ ${cell(item.command)}\n`;
13
+ case "tool_call":
14
+ return `tool ${cell(`${item.name} ${(item.arguments ?? "").slice(0, MAX_ARGUMENTS_SHOWN)}`)}\n`;
15
+ case "approval_request":
16
+ return item.approvalId === undefined
17
+ ? "approval? "
18
+ : `approval ${item.approvalId}? `;
19
+ case "error":
20
+ return "error: ";
21
+ case "file_change":
22
+ case "usage":
23
+ return "";
24
+ }
25
+ };
26
+ const footer = (record) => {
27
+ const { item } = record;
28
+ const status = record.status === "completed" ? "" : `[${record.status}]\n`;
29
+ if (item.kind === "command" && item.exitCode !== undefined)
30
+ return `[exit ${String(item.exitCode)}]\n${status}`;
31
+ if (item.kind === "file_change")
32
+ return `${item.changes.map((change) => `${change.change} ${cell(change.path)}\n`).join("")}${status}`;
33
+ if (item.kind === "usage")
34
+ 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
+ return status;
36
+ };
37
+ const emit = (rendered, text) => text.length === 0
38
+ ? rendered
39
+ : {
40
+ state: { ...rendered.state, lineOpen: !text.endsWith("\n") },
41
+ text: `${rendered.text}${text}`,
42
+ };
43
+ const INDENT = " ";
44
+ const emitBody = (rendered, text) => emit(rendered, text
45
+ .split("\n")
46
+ .map((line, index) => line.length > 0 && (index > 0 || !rendered.state.lineOpen)
47
+ ? `${INDENT}${line}`
48
+ : line)
49
+ .join("\n"));
50
+ const closeLine = (rendered) => {
51
+ const closed = rendered.state.lineOpen ? emit(rendered, "\n") : rendered;
52
+ return { ...closed, state: { ...closed.state, openItem: undefined } };
53
+ };
54
+ const onItemLine = (rendered, itemId) => {
55
+ if (rendered.state.openItem === itemId)
56
+ return rendered;
57
+ const closed = closeLine(rendered);
58
+ return { ...closed, state: { ...closed.state, openItem: itemId } };
59
+ };
60
+ const withShown = (rendered, itemId, shown) => ({
61
+ ...rendered,
62
+ state: {
63
+ ...rendered.state,
64
+ written: new Map(rendered.state.written).set(itemId, shown),
65
+ },
66
+ });
67
+ const writeItemText = (rendered, itemId, { cut = false, text }) => {
68
+ const shown = rendered.state.written.get(itemId) ?? "";
69
+ if (text.length < shown.length && shown.endsWith(text))
70
+ return withShown(rendered, itemId, text);
71
+ const extendsShown = text.startsWith(shown);
72
+ if (cut && !extendsShown) {
73
+ const positioned = onItemLine(rendered, itemId);
74
+ const separator = positioned.state.lineOpen ? "\n" : "";
75
+ return withShown(emitBody(emit(positioned, `${separator}…`), text), itemId, text);
76
+ }
77
+ if (!extendsShown || text.length === shown.length)
78
+ return rendered;
79
+ return withShown(emitBody(onItemLine(rendered, itemId), text.slice(shown.length)), itemId, text);
80
+ };
81
+ const renderStarted = (rendered, record) => {
82
+ const opened = emit(closeLine(rendered), header(record.item));
83
+ return writeItemText({
84
+ ...opened,
85
+ state: {
86
+ ...opened.state,
87
+ openItem: record.itemId,
88
+ written: new Map(opened.state.written).set(record.itemId, ""),
89
+ },
90
+ }, record.itemId, { text: sessionItemText(record.item) });
91
+ };
92
+ const renderDelta = (rendered, record) => {
93
+ const shown = rendered.state.written.get(record.itemId);
94
+ if (shown === undefined)
95
+ return rendered;
96
+ const appended = emitBody(onItemLine(rendered, record.itemId), record.delta);
97
+ return {
98
+ ...appended,
99
+ state: {
100
+ ...appended.state,
101
+ written: new Map(appended.state.written).set(record.itemId, shown + record.delta),
102
+ },
103
+ };
104
+ };
105
+ const renderCompleted = (rendered, record) => {
106
+ const started = rendered.state.written.has(record.itemId)
107
+ ? rendered
108
+ : renderStarted(rendered, { ...record, type: "item.started" });
109
+ const finished = writeItemText(started, record.itemId, {
110
+ text: sessionItemText(record.item),
111
+ });
112
+ const closed = emit(closeLine(finished), footer(record));
113
+ const written = new Map(closed.state.written);
114
+ written.delete(record.itemId);
115
+ return { ...closed, state: { ...closed.state, written } };
116
+ };
117
+ const renderRecord = (rendered, record) => {
118
+ switch (record.type) {
119
+ case "turn.started":
120
+ return emit(closeLine(rendered), `## turn ${record.turnId}\n`);
121
+ case "turn.completed":
122
+ return emit(closeLine(rendered), `## turn ${record.turnId} ${record.status}${record.failure === undefined ? "" : `: ${formatFailureCell(record.failure)}`}\n`);
123
+ case "item.started":
124
+ return renderStarted(rendered, record);
125
+ case "item.delta":
126
+ return renderDelta(rendered, record);
127
+ case "item.completed":
128
+ return renderCompleted(rendered, record);
129
+ }
130
+ };
131
+ const renderOpenItems = (rendered, openItems) => openItems.reduce((current, open) => {
132
+ if (!current.state.written.has(open.itemId))
133
+ return current;
134
+ return writeItemText(current, open.itemId, {
135
+ cut: open.truncated === true,
136
+ text: open.text,
137
+ });
138
+ }, rendered);
139
+ const renderFrameText = (state, frame) => {
140
+ const start = { state, text: "" };
141
+ if (frame.kind === "records")
142
+ return frame.data.records
143
+ .filter((record) => isNewSessionRecord(state.view, record))
144
+ .reduce(renderRecord, start);
145
+ if (frame.kind === "synchronized")
146
+ return renderOpenItems(start, frame.data.openItems);
147
+ if (frame.kind === "attached" && frame.data.mode === "snapshot")
148
+ return state.view.sequence === 0
149
+ ? start
150
+ : emit(closeLine({ state: { ...state, written: new Map() }, text: "" }), "-- resynchronized --\n");
151
+ return start;
152
+ };
153
+ export const initialAttachRenderState = (view) => ({ lineOpen: false, view, written: new Map() });
154
+ export const renderSessionAttachFrame = (state, frame) => {
155
+ const rendered = renderFrameText(state, frame);
156
+ return {
157
+ state: { ...rendered.state, view: reduceSessionAttach(state.view, frame) },
158
+ text: block(rendered.text),
159
+ };
160
+ };
161
+ export const finishSessionAttachRender = (state) => state.lineOpen ? "\n" : "";
162
+ //# sourceMappingURL=attach-render.js.map
@@ -0,0 +1,5 @@
1
+ import { type CommandContext, type CommandEffect } from "../command-line/index.js";
2
+ import type { AttachSessionInput } from "./attach-client.js";
3
+ export declare const readAttachCursor: (value: string | undefined) => AttachSessionInput["after"];
4
+ export declare const runSessionAttach: (tokens: readonly string[], context: CommandContext) => CommandEffect;
5
+ //# sourceMappingURL=attach.d.ts.map
@@ -0,0 +1,120 @@
1
+ import { initialSessionAttachView, protocolErrorSchema, sessionAttachCursor, } from "@maiaos/sdk";
2
+ import * as Duration from "effect/Duration";
3
+ import * as Effect from "effect/Effect";
4
+ import * as Ref from "effect/Ref";
5
+ import * as Stream from "effect/Stream";
6
+ import { CliArgumentError, jsonLine, parseOptions, reportError, requirePositionals, } from "../command-line/index.js";
7
+ import { finishSessionAttachRender, initialAttachRenderState, renderSessionAttachFrame, } from "./attach-render.js";
8
+ const MAX_IDLE_REATTACHES = 5;
9
+ const REATTACH_BACKOFF = Duration.millis(100);
10
+ const NODE_UNAVAILABLE = {
11
+ code: "node_unavailable",
12
+ message: "The Session stream is unavailable.",
13
+ retryable: true,
14
+ };
15
+ export const readAttachCursor = (value) => {
16
+ if (value === undefined)
17
+ return undefined;
18
+ const separator = value.lastIndexOf(":");
19
+ const epoch = value.slice(0, separator);
20
+ const sequence = value.slice(separator + 1);
21
+ if (separator <= 0 ||
22
+ !/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/u.test(epoch) ||
23
+ !/^(?:0|[1-9]\d{0,15})$/u.test(sequence) ||
24
+ !Number.isSafeInteger(Number(sequence)))
25
+ throw new CliArgumentError("Option '--after' must be '<epoch>:<sequence>' from a previous attach.");
26
+ return { epoch, sequence: Number(sequence) };
27
+ };
28
+ const writeFrame = (attachment, frame) => Ref.modify(attachment.state, (state) => {
29
+ const rendered = renderSessionAttachFrame(state, frame);
30
+ return [rendered.text, rendered.state];
31
+ }).pipe(Effect.map((text) => {
32
+ const { io, json } = attachment.context;
33
+ if (json)
34
+ io.stdout(jsonLine(frame));
35
+ else if (text.length > 0)
36
+ io.stdout(text);
37
+ }));
38
+ const finalFailure = (failure) => {
39
+ if (!(failure instanceof Error) || !("code" in failure))
40
+ return undefined;
41
+ const remote = protocolErrorSchema.safeParse("remoteError" in failure ? failure.remoteError : undefined);
42
+ if (remote.success)
43
+ return remote.data;
44
+ return failure.code === "transport_failure" ||
45
+ typeof failure.code !== "string"
46
+ ? undefined
47
+ : { code: failure.code, message: failure.message, retryable: false };
48
+ };
49
+ const framesOf = (attachment, stream) => attachment.follow
50
+ ? stream
51
+ : stream.pipe(Stream.takeUntil((frame) => frame.kind === "synchronized"));
52
+ const outcomeOf = (attachment, completed) => Ref.get(attachment.state).pipe(Effect.map(({ view }) => {
53
+ if (view.end?.kind === "error")
54
+ return {
55
+ error: {
56
+ code: view.end.code,
57
+ message: view.end.message,
58
+ retryable: false,
59
+ },
60
+ kind: "failed",
61
+ };
62
+ return completed && !attachment.follow
63
+ ? { kind: "ended" }
64
+ : { kind: "reattach" };
65
+ }));
66
+ const attachOnce = (attachment) => Effect.gen(function* () {
67
+ const { attachSession } = attachment.context.dependencies;
68
+ if (attachSession === undefined)
69
+ throw new CliArgumentError("Session attach is unavailable.");
70
+ const after = sessionAttachCursor((yield* Ref.get(attachment.state)).view);
71
+ const opened = yield* attachSession({
72
+ ...(after === undefined ? {} : { after }),
73
+ sessionId: attachment.sessionId,
74
+ });
75
+ if (!opened.ok)
76
+ return { error: opened.error, kind: "failed" };
77
+ const ran = yield* Effect.result(Stream.runForEach(framesOf(attachment, opened.value), (frame) => writeFrame(attachment, frame)));
78
+ const refusal = ran._tag === "Failure" ? finalFailure(ran.failure) : undefined;
79
+ if (refusal !== undefined)
80
+ return { error: refusal, kind: "failed" };
81
+ return yield* outcomeOf(attachment, ran._tag === "Success");
82
+ });
83
+ const finish = (attachment, outcome) => Ref.get(attachment.state).pipe(Effect.map((state) => {
84
+ if (!attachment.context.json)
85
+ attachment.context.io.stdout(finishSessionAttachRender(state));
86
+ return outcome.kind === "failed"
87
+ ? reportError(outcome.error, attachment.context)
88
+ : 0;
89
+ }));
90
+ const follow = (attachment, idle) => Effect.gen(function* () {
91
+ const before = (yield* Ref.get(attachment.state)).view.sequence;
92
+ const outcome = yield* attachOnce(attachment);
93
+ if (outcome.kind !== "reattach")
94
+ return yield* finish(attachment, outcome);
95
+ const progressed = (yield* Ref.get(attachment.state)).view.sequence > before;
96
+ const nextIdle = progressed ? 0 : idle + 1;
97
+ if (nextIdle > MAX_IDLE_REATTACHES)
98
+ return yield* finish(attachment, {
99
+ error: NODE_UNAVAILABLE,
100
+ kind: "failed",
101
+ });
102
+ yield* Effect.sleep(Duration.times(REATTACH_BACKOFF, nextIdle));
103
+ return yield* follow(attachment, nextIdle);
104
+ });
105
+ export const runSessionAttach = (tokens, context) => Effect.gen(function* () {
106
+ const parsed = parseOptions(tokens, new Set(["--after"]), new Set(["--no-follow"]));
107
+ requirePositionals(parsed.positionals, 1);
108
+ const [sessionId = ""] = parsed.positionals;
109
+ const after = readAttachCursor(parsed.options.get("--after"));
110
+ const view = after === undefined
111
+ ? initialSessionAttachView
112
+ : { ...initialSessionAttachView, ...after };
113
+ return yield* follow({
114
+ context,
115
+ follow: !parsed.flags.has("--no-follow"),
116
+ sessionId,
117
+ state: yield* Ref.make(initialAttachRenderState(view)),
118
+ }, 0);
119
+ });
120
+ //# sourceMappingURL=attach.js.map
@@ -0,0 +1,140 @@
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";
2
+ import { type CliNodeEffect, type CliNodeOperations } from "../local-node/index.js";
3
+ export type WaitSessionInput = {
4
+ readonly sessionId: string;
5
+ readonly states: readonly string[];
6
+ readonly timeoutMilliseconds: number;
7
+ };
8
+ export type CreateSessionInput = {
9
+ readonly agentId?: SessionCreateParameters["agentId"];
10
+ readonly baseRef?: string;
11
+ readonly commandId?: string;
12
+ readonly connectionId?: string;
13
+ readonly definitionRef?: SessionCreateParameters["definitionRef"];
14
+ readonly effort?: SessionCreateParameters["effort"];
15
+ readonly executor?: SessionCreateParameters["executor"];
16
+ readonly model?: string;
17
+ readonly role?: SessionCreateParameters["role"];
18
+ 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 workspaceId: string;
26
+ };
27
+ export type ListSessionsInput = Omit<SessionListParameters, "states"> & {
28
+ readonly states?: readonly string[];
29
+ };
30
+ export type StartSessionInput = {
31
+ readonly commandId?: string;
32
+ readonly expectedRevision: string;
33
+ readonly sessionId: string;
34
+ };
35
+ type SendAttachedSessionMessageInput = {
36
+ readonly body: string;
37
+ readonly commandId?: string;
38
+ readonly recipientSessionId: string;
39
+ readonly subject: string;
40
+ };
41
+ type AcknowledgeAttachedSessionDeliveryInput = {
42
+ readonly commandId?: string;
43
+ readonly deliveryId: string;
44
+ readonly expectedMailboxRevision: string;
45
+ };
46
+ export declare const makeSessionClient: (node: CliNodeOperations) => {
47
+ applyExecutionRelocation: (input: import("../execution/client.js").ApplyExecutionRelocationInput) => CliNodeEffect<import("@maiaos/sdk").ExecutionRelocationApplyResult>;
48
+ planExecutionRelocation: (input: import("../execution/client.js").PlanExecutionRelocationInput) => CliNodeEffect<import("@maiaos/sdk").ExecutionRelocationPlanResult>;
49
+ reconcileExecutionRelocation: (input: import("../execution/client.js").ReconcileExecutionRelocationInput) => CliNodeEffect<import("@maiaos/sdk").ExecutionRelocationReconcileResult>;
50
+ showExecutionRelocation: (relocationId: string) => CliNodeEffect<import("@maiaos/sdk").ExecutionRelocationShowResult>;
51
+ confirmAgentPermission: (input: import("@maiaos/sdk").AgentPermissionConfirmParameters) => CliNodeEffect<{
52
+ readonly delivery: "duplicate" | "new";
53
+ readonly grant: {
54
+ readonly definitionRef: {
55
+ readonly contentDigest: string;
56
+ readonly key: string;
57
+ readonly version: string;
58
+ };
59
+ readonly expectedSessionRevision: string;
60
+ readonly expectedWorkspaceRevision: string;
61
+ readonly sessionId: string;
62
+ readonly workspaceId: string;
63
+ readonly actorId: string;
64
+ readonly commandId: string;
65
+ readonly grantedAt: string;
66
+ 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")[];
68
+ readonly revision: "1";
69
+ };
70
+ readonly method: "session.agent-permission.confirm";
71
+ readonly receipt: {
72
+ readonly actorId: string;
73
+ readonly aggregateRevision: string;
74
+ readonly commandId: string;
75
+ readonly createdAt: string;
76
+ readonly eventCursor: string;
77
+ readonly method: string;
78
+ readonly receiptId: string;
79
+ readonly schemaVersion: 1;
80
+ readonly state: "succeeded";
81
+ readonly target: {
82
+ readonly id: string;
83
+ readonly type: string;
84
+ };
85
+ readonly updatedAt: string;
86
+ };
87
+ }>;
88
+ previewAgentPermission: (input: import("@maiaos/sdk").AgentPermissionPreviewParameters) => CliNodeEffect<{
89
+ readonly definitionRef: {
90
+ readonly contentDigest: string;
91
+ readonly key: string;
92
+ readonly version: string;
93
+ };
94
+ readonly expectedSessionRevision: string;
95
+ readonly expectedWorkspaceRevision: string;
96
+ readonly sessionId: string;
97
+ readonly workspaceId: string;
98
+ readonly actorId: string;
99
+ readonly commandId: string;
100
+ readonly expiresAt: string;
101
+ readonly inputDigest: string;
102
+ readonly issuedAt: string;
103
+ 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")[];
105
+ readonly proof: string;
106
+ }>;
107
+ attachSession: (input: import("./attach-client.js").AttachSessionInput) => CliNodeEffect<import("./attach-client.js").SessionAttachStream>;
108
+ archiveSession: (input: import("./coding-client.js").ArchiveSessionInput) => CliNodeEffect<import("@maiaos/sdk").SessionArchiveResult>;
109
+ diffSession: (input: import("./coding-client.js").DiffSessionInput) => CliNodeEffect<import("@maiaos/sdk").SessionDiffResult>;
110
+ acknowledgeAttachedSessionDelivery: (input: AcknowledgeAttachedSessionDeliveryInput) => CliNodeEffect<SessionInboxAckResult>;
111
+ awaitSessionRunning: (input: {
112
+ readonly deadlineMilliseconds: number;
113
+ readonly sessionId: string;
114
+ }) => CliNodeEffect<Session>;
115
+ checkAttachedSessionInbox: (input: {
116
+ readonly limit?: number;
117
+ }) => CliNodeEffect<SessionInboxCheckResult>;
118
+ createSession: (input: CreateSessionInput) => CliNodeEffect<SessionCreateResult>;
119
+ listSessionEvents: (input: {
120
+ readonly afterSessionCursor: string;
121
+ readonly limit: number;
122
+ readonly sessionId: string;
123
+ }) => CliNodeEffect<SessionEventsListResult>;
124
+ listSessions: (input: ListSessionsInput) => CliNodeEffect<SessionListResult>;
125
+ observeSessions: (input: {
126
+ readonly sessionIds?: readonly string[];
127
+ readonly stallAfterSeconds?: number;
128
+ }) => CliNodeEffect<SessionObserveResult>;
129
+ planSessions: (input: SessionCreationInput) => CliNodeEffect<SessionCreationPlan>;
130
+ resumeSession: (input: StartSessionInput) => CliNodeEffect<SessionResumeResult>;
131
+ runSessions: (plan: SessionCreationPlan) => CliNodeEffect<readonly SessionCreationOutcome[]>;
132
+ sendAttachedSessionMessage: (input: SendAttachedSessionMessageInput) => CliNodeEffect<SessionMessageSendResult>;
133
+ showSession: (sessionId: string) => CliNodeEffect<SessionShowResult>;
134
+ spawnSession: (input: SpawnSessionInput) => CliNodeEffect<SessionSpawnResult>;
135
+ startSession: (input: StartSessionInput) => CliNodeEffect<SessionStartResult>;
136
+ stopSession: (input: StartSessionInput) => CliNodeEffect<SessionStopResult>;
137
+ waitSession: (input: WaitSessionInput) => CliNodeEffect<SessionWaitResult>;
138
+ };
139
+ export {};
140
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1,129 @@
1
+ import { MAX_SESSION_WAIT_MILLISECONDS, sessionCreateParametersSchema, sessionEventsListParametersSchema, sessionInboxAckParametersSchema, sessionInboxCheckParametersSchema, sessionListParametersSchema, sessionMessageSendParametersSchema, sessionObserveParametersSchema, sessionResumeParametersSchema, sessionShowParametersSchema, sessionSpawnParametersSchema, sessionStartParametersSchema, sessionStopParametersSchema, sessionWaitParametersSchema, } from "@maiaos/sdk";
2
+ import * as Crypto from "effect/Crypto";
3
+ import * as Effect from "effect/Effect";
4
+ import { makeRelocateClient } from "../execution/index.js";
5
+ import { commandIdentifier, repeatBoundedWait, } from "../local-node/index.js";
6
+ import { makeAgentPermissionCliClient } from "./agent-permission.js";
7
+ import { makeAttachClient } from "./attach-client.js";
8
+ import { makeCodingSessionClient } from "./coding-client.js";
9
+ export const makeSessionClient = (node) => {
10
+ const createSession = (input) => {
11
+ const { baseRef, commandId: requestedCommandId, ...selection } = input;
12
+ return Effect.flatMap(commandIdentifier(requestedCommandId), (commandId) => {
13
+ return node.runValidatedNodeOperation({
14
+ ...selection,
15
+ commandId,
16
+ expectedRevision: "0",
17
+ ...(baseRef === undefined ? {} : { worktree: { baseRef } }),
18
+ }, sessionCreateParametersSchema, (client, parameters, options) => client.createSession(parameters, options), { commandId });
19
+ });
20
+ };
21
+ const listSessions = (input) => {
22
+ return node.runValidatedNodeOperation(input, sessionListParametersSchema, (client, parameters, options) => client.listSessions(parameters, options));
23
+ };
24
+ const showSession = (sessionId) => {
25
+ return node.runValidatedNodeOperation({ sessionId }, sessionShowParametersSchema, (client, parameters, options) => client.showSession(parameters, options));
26
+ };
27
+ const waitSessionOnce = (parameters) => node.runValidatedNodeOperation(parameters, sessionWaitParametersSchema, (client, validated, options) => client.waitSession(validated, options));
28
+ const waitSession = (input) => repeatBoundedWait({
29
+ maxRequestMilliseconds: MAX_SESSION_WAIT_MILLISECONDS,
30
+ once: (waitMilliseconds) => waitSessionOnce({
31
+ sessionId: input.sessionId,
32
+ states: input.states,
33
+ waitMilliseconds,
34
+ }),
35
+ satisfied: (value) => value.satisfied,
36
+ timeoutMilliseconds: input.timeoutMilliseconds,
37
+ });
38
+ const observeSessions = (input) => node.runValidatedNodeOperation(input, sessionObserveParametersSchema, (client, parameters, options) => client.observeSessions(parameters, options));
39
+ const listSessionEvents = (input) => {
40
+ return node.runValidatedNodeOperation(input, sessionEventsListParametersSchema, (client, parameters, options) => client.listSessionEvents(parameters, options));
41
+ };
42
+ const sendAttachedSessionMessage = (input) => {
43
+ return Effect.flatMap(commandIdentifier(input.commandId), (commandId) => {
44
+ const parameters = sessionMessageSendParametersSchema.parse({
45
+ ...input,
46
+ commandId,
47
+ });
48
+ return node.runDiscoveryOperation((options) => Effect.promise(() => import("@maiaos/sdk/node/effect")).pipe(Effect.flatMap((sdk) => sdk.sendAttachedSessionMessageEffect(parameters, options))));
49
+ });
50
+ };
51
+ const checkAttachedSessionInbox = (input) => {
52
+ const parameters = sessionInboxCheckParametersSchema.parse(input);
53
+ return node.runDiscoveryOperation((options) => Effect.promise(() => import("@maiaos/sdk/node/effect")).pipe(Effect.flatMap((sdk) => sdk.checkAttachedSessionInboxEffect(parameters, options))));
54
+ };
55
+ const acknowledgeAttachedSessionDelivery = (input) => {
56
+ return Effect.flatMap(commandIdentifier(input.commandId), (commandId) => {
57
+ const parameters = sessionInboxAckParametersSchema.parse({
58
+ ...input,
59
+ commandId,
60
+ });
61
+ return node.runDiscoveryOperation((options) => Effect.promise(() => import("@maiaos/sdk/node/effect")).pipe(Effect.flatMap((sdk) => sdk.acknowledgeAttachedSessionDeliveryEffect(parameters, options))));
62
+ });
63
+ };
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
+ const startSession = (input) => {
76
+ return Effect.flatMap(commandIdentifier(input.commandId), (commandId) => {
77
+ return node.runValidatedNodeOperation({
78
+ commandId,
79
+ expectedRevision: input.expectedRevision,
80
+ sessionId: input.sessionId,
81
+ }, sessionStartParametersSchema, (client, parameters, options) => client.startSession(parameters, options), { commandId });
82
+ });
83
+ };
84
+ const stopSession = (input) => {
85
+ return Effect.flatMap(commandIdentifier(input.commandId), (commandId) => {
86
+ return node.runValidatedNodeOperation({
87
+ commandId,
88
+ expectedRevision: input.expectedRevision,
89
+ sessionId: input.sessionId,
90
+ }, sessionStopParametersSchema, (client, parameters, options) => client.stopSession(parameters, options), { commandId });
91
+ });
92
+ };
93
+ const resumeSession = (input) => {
94
+ return Effect.flatMap(commandIdentifier(input.commandId), (commandId) => {
95
+ return node.runValidatedNodeOperation({
96
+ commandId,
97
+ expectedRevision: input.expectedRevision,
98
+ sessionId: input.sessionId,
99
+ }, sessionResumeParametersSchema, (client, parameters, options) => client.resumeSession(parameters, options), { commandId });
100
+ });
101
+ };
102
+ 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
+ const planSessions = (input) => withSdk((sdk, client) => sdk.planSessionCreationEffect(client, input));
104
+ const runSessions = (plan) => withSdk((sdk, client) => sdk.createSessionsEffect(client, plan));
105
+ const awaitSessionRunning = (input) => withSdk((sdk, client) => sdk.awaitSessionRunningEffect(client, input.sessionId, input.deadlineMilliseconds));
106
+ return {
107
+ acknowledgeAttachedSessionDelivery,
108
+ awaitSessionRunning,
109
+ checkAttachedSessionInbox,
110
+ createSession,
111
+ listSessionEvents,
112
+ listSessions,
113
+ observeSessions,
114
+ planSessions,
115
+ resumeSession,
116
+ runSessions,
117
+ sendAttachedSessionMessage,
118
+ showSession,
119
+ spawnSession,
120
+ startSession,
121
+ stopSession,
122
+ waitSession,
123
+ ...makeRelocateClient(node),
124
+ ...makeAgentPermissionCliClient(node),
125
+ ...makeCodingSessionClient(node),
126
+ ...makeAttachClient(node),
127
+ };
128
+ };
129
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1,16 @@
1
+ import type { SessionArchiveResult, SessionDiffResult } from "@maiaos/sdk";
2
+ import { type CliNodeEffect, type CliNodeOperations } from "../local-node/index.js";
3
+ export type DiffSessionInput = {
4
+ readonly sessionId: string;
5
+ readonly stat: boolean;
6
+ };
7
+ export type ArchiveSessionInput = {
8
+ readonly commandId?: string;
9
+ readonly expectedRevision: string;
10
+ readonly sessionId: string;
11
+ };
12
+ export declare const makeCodingSessionClient: (node: CliNodeOperations) => {
13
+ archiveSession: (input: ArchiveSessionInput) => CliNodeEffect<SessionArchiveResult>;
14
+ diffSession: (input: DiffSessionInput) => CliNodeEffect<SessionDiffResult>;
15
+ };
16
+ //# sourceMappingURL=coding-client.d.ts.map
@@ -0,0 +1,15 @@
1
+ import { sessionArchiveParametersSchema, sessionDiffParametersSchema, } from "@maiaos/sdk";
2
+ import * as Effect from "effect/Effect";
3
+ import { commandIdentifier, } from "../local-node/index.js";
4
+ export const makeCodingSessionClient = (node) => ({
5
+ archiveSession: (input) => Effect.flatMap(commandIdentifier(input.commandId), (commandId) => node.runValidatedNodeOperation({
6
+ commandId,
7
+ expectedRevision: input.expectedRevision,
8
+ sessionId: input.sessionId,
9
+ }, sessionArchiveParametersSchema, (client, parameters, options) => client.archiveSession(parameters, options), { commandId })),
10
+ diffSession: (input) => node.runValidatedNodeOperation({
11
+ sessionId: input.sessionId,
12
+ ...(input.stat ? { stat: true } : {}),
13
+ }, sessionDiffParametersSchema, (client, parameters, options) => client.diffSession(parameters, options)),
14
+ });
15
+ //# sourceMappingURL=coding-client.js.map
@@ -0,0 +1,4 @@
1
+ import { type CommandContext, type CommandEffect } from "../command-line/index.js";
2
+ export declare const runSessionDiff: (tokens: readonly string[], context: CommandContext) => CommandEffect;
3
+ export declare const runSessionArchive: (tokens: readonly string[], context: CommandContext) => CommandEffect;
4
+ //# sourceMappingURL=coding-commands.d.ts.map