@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,47 @@
1
+ import type { FailureDetail, TurnInterruptResult, TurnQueueListResult, TurnShowResult, TurnTokenUsage, TurnWaitResult } from "@maiaos/sdk";
2
+ export type CliTurnMutation = {
3
+ readonly command: "turn.cancel" | "turn.interrupt" | "turn.send";
4
+ readonly result: {
5
+ readonly delivery: TurnInterruptResult["delivery"];
6
+ readonly receipt: TurnInterruptResult["receipt"];
7
+ readonly revision: string;
8
+ readonly sessionId: string;
9
+ readonly state: TurnInterruptResult["turn"]["state"];
10
+ readonly turnId: string;
11
+ };
12
+ };
13
+ export type CliTurnShow = {
14
+ readonly command: "turn.show";
15
+ readonly result: (TurnShowResult & {
16
+ readonly contentIncluded: true;
17
+ }) | {
18
+ readonly contentIncluded: false;
19
+ readonly method: "turn.show";
20
+ readonly turn: {
21
+ readonly failure?: FailureDetail;
22
+ readonly failureReason?: string;
23
+ readonly id: string;
24
+ readonly inputBytes: number;
25
+ readonly responseBytes?: number;
26
+ readonly revision: string;
27
+ readonly sessionId: string;
28
+ readonly sessionRevision: string;
29
+ readonly state: TurnShowResult["turn"]["state"];
30
+ readonly tokenUsage?: TurnTokenUsage;
31
+ };
32
+ };
33
+ };
34
+ export type CliTurnWait = {
35
+ readonly command: "turn.wait";
36
+ readonly result: TurnWaitResult;
37
+ };
38
+ export type CliTurnQueue = {
39
+ readonly command: "turn.queue.list";
40
+ readonly result: TurnQueueListResult;
41
+ };
42
+ export declare const formatTurnMutation: ({ result }: CliTurnMutation) => string;
43
+ export declare const formatTurnQueue: ({ result }: CliTurnQueue) => string;
44
+ export declare const formatTurnShow: ({ result }: CliTurnShow) => string;
45
+ export declare const formatTurnWait: ({ result }: CliTurnWait) => string;
46
+ export declare const turnWaitExitCode: (result: TurnWaitResult) => number;
47
+ //# sourceMappingURL=output.d.ts.map
@@ -0,0 +1,61 @@
1
+ import { block, cell, fields, formatRows, tab, } from "../../command-line/index.js";
2
+ import { formatFailure } from "../output/index.js";
3
+ export const formatTurnMutation = ({ result }) => fields([
4
+ ["turn", result.turnId],
5
+ ["state", result.state],
6
+ ["revision", result.revision],
7
+ ]);
8
+ const turnFields = (turn, reason) => fields([
9
+ ["turn", turn.id],
10
+ ["state", turn.state],
11
+ ["revision", turn.revision],
12
+ ["session", turn.sessionId],
13
+ ["reason", reason],
14
+ ]);
15
+ export const formatTurnQueue = ({ result }) => {
16
+ const { activeTurn, queue } = result;
17
+ const rows = [
18
+ ...(activeTurn === undefined
19
+ ? []
20
+ : [["-", activeTurn.state, activeTurn.id, activeTurn.revision, ""]]),
21
+ ...queue.map((entry) => [
22
+ String(entry.position),
23
+ "queued",
24
+ entry.id,
25
+ entry.revision,
26
+ cell(entry.inputPreview.replaceAll(/\s+/gu, " ")),
27
+ ]),
28
+ ];
29
+ return formatRows(rows, tab, {
30
+ empty: "no running or queued turn",
31
+ headers: ["POSITION", "STATE", "TURN", "REVISION", "INPUT"],
32
+ });
33
+ };
34
+ const formatUsage = (usage) => usage === undefined
35
+ ? ""
36
+ : `tokens: input ${String(usage.inputTokens)} (cached ${String(usage.cachedInputTokens)}), output ${String(usage.outputTokens)} (reasoning ${String(usage.reasoningOutputTokens)}), total ${String(usage.totalTokens)}${usage.modelCallCount === undefined ? "" : `, model calls ${String(usage.modelCallCount)}`}\n`;
37
+ const formatContent = (turn) => `input:\n${block(turn.input.text)}\n${turn.state === "completed" ? `response:\n${block(turn.responseText)}\n` : ""}`;
38
+ const shownContent = (result) => result.contentIncluded ? formatContent(result.turn) : "";
39
+ export const formatTurnShow = ({ result }) => {
40
+ const { turn } = result;
41
+ const failure = "failure" in turn &&
42
+ (turn.state === "failed" || turn.state === "outcome-unknown")
43
+ ? formatFailure(turn.failure, turn.state)
44
+ : "";
45
+ const usage = "tokenUsage" in turn ? formatUsage(turn.tokenUsage) : "";
46
+ return `${turnFields(turn)}${failure}${usage}${shownContent(result)}`;
47
+ };
48
+ export const formatTurnWait = ({ result }) => result.turns
49
+ .map((turn) => `${turnFields(turn, turn.failureReason)}${turn.state === "failed" || turn.state === "outcome-unknown" ? formatFailure(turn.failure, turn.state) : ""}`)
50
+ .join("\n");
51
+ const EXIT_FAILED = 70;
52
+ const EXIT_DEADLINE = 74;
53
+ const EXIT_OUTCOME_UNKNOWN = 76;
54
+ export const turnWaitExitCode = (result) => {
55
+ if (!result.satisfied)
56
+ return EXIT_DEADLINE;
57
+ if (result.turns.some((turn) => turn.state === "outcome-unknown"))
58
+ return EXIT_OUTCOME_UNKNOWN;
59
+ return result.turns.some((turn) => turn.state === "failed") ? EXIT_FAILED : 0;
60
+ };
61
+ //# sourceMappingURL=output.js.map
@@ -0,0 +1,124 @@
1
+ import type { MonitorBootstrapCreateResult } from "@maiaos/sdk";
2
+ import type { CliNodeEffect, CliNodeOperations } from "../local-node/index.js";
3
+ export declare const makeStatusClient: (node: CliNodeOperations) => {
4
+ createMonitorBootstrap: () => CliNodeEffect<MonitorBootstrapCreateResult>;
5
+ readStatus: () => import("effect/Effect").Effect<{
6
+ readonly instanceId: string;
7
+ readonly lifecycle: "draining" | "failed" | "ready" | "starting" | "stopped";
8
+ readonly pid: number;
9
+ readonly profile: string;
10
+ readonly startedAt: string;
11
+ readonly executorHost?: {
12
+ readonly bubblewrap: "found" | "missing";
13
+ readonly socat: "found" | "missing";
14
+ readonly userNamespaces: "allowed" | "no_nesting" | "restricted";
15
+ } | undefined;
16
+ readonly method: "node.status";
17
+ readonly processResources: {
18
+ readonly activeTrees: number;
19
+ readonly admission: {
20
+ readonly availableTrees: number;
21
+ readonly capacity: number;
22
+ readonly queuedSpawns: 0;
23
+ readonly state: "available" | "degraded" | "pressured" | "saturated" | "unavailable";
24
+ readonly usedTrees: number;
25
+ };
26
+ readonly capability: {
27
+ readonly hardLimitEnforcement: "enforced";
28
+ readonly metricSampling: "host_sampled";
29
+ readonly mode: "hard_containment";
30
+ readonly observedPressureTermination: "disabled";
31
+ readonly releaseQualified: false;
32
+ readonly sourceCandidate: true;
33
+ } | {
34
+ readonly hardLimitEnforcement: "unavailable";
35
+ readonly metricSampling: "host_sampled";
36
+ readonly mode: "macos_cooperative";
37
+ readonly observedPressureTermination: "disabled";
38
+ readonly releaseQualified: false;
39
+ readonly sourceCandidate: true;
40
+ } | {
41
+ readonly hardLimitEnforcement: "unavailable";
42
+ readonly metricSampling: "unavailable";
43
+ readonly mode: "unavailable";
44
+ readonly observedPressureTermination: "disabled";
45
+ readonly releaseQualified: false;
46
+ readonly sourceCandidate: false;
47
+ };
48
+ readonly cleanupUnknownTrees: number;
49
+ readonly fencedTrees: number;
50
+ readonly nextStep: "close_idle_terminal" | "inspect_cleanup_unknown" | "inspect_observed_pressure" | "none" | "run_node_in_delegated_cgroup" | "verify_native_host";
51
+ readonly observations: {
52
+ readonly cpuTimeMilliseconds: {
53
+ readonly availableTrees: number;
54
+ readonly budget: "declared_per_tree_limit" | "unavailable_not_declared";
55
+ readonly maximumValue?: number | undefined;
56
+ readonly state: "available" | "partial" | "unavailable";
57
+ readonly unavailableTrees: number;
58
+ readonly warningTrees: number;
59
+ };
60
+ readonly fileDescriptorCount: {
61
+ readonly availableTrees: number;
62
+ readonly budget: "declared_per_tree_limit" | "unavailable_not_declared";
63
+ readonly maximumValue?: number | undefined;
64
+ readonly state: "available" | "partial" | "unavailable";
65
+ readonly unavailableTrees: number;
66
+ readonly warningTrees: number;
67
+ };
68
+ readonly ioReadBytes: {
69
+ readonly availableTrees: number;
70
+ readonly budget: "declared_per_tree_limit" | "unavailable_not_declared";
71
+ readonly maximumValue?: number | undefined;
72
+ readonly state: "available" | "partial" | "unavailable";
73
+ readonly unavailableTrees: number;
74
+ readonly warningTrees: number;
75
+ };
76
+ readonly ioWriteBytes: {
77
+ readonly availableTrees: number;
78
+ readonly budget: "declared_per_tree_limit" | "unavailable_not_declared";
79
+ readonly maximumValue?: number | undefined;
80
+ readonly state: "available" | "partial" | "unavailable";
81
+ readonly unavailableTrees: number;
82
+ readonly warningTrees: number;
83
+ };
84
+ readonly observedPeakRssBytes: {
85
+ readonly availableTrees: number;
86
+ readonly budget: "declared_per_tree_limit" | "unavailable_not_declared";
87
+ readonly maximumValue?: number | undefined;
88
+ readonly state: "available" | "partial" | "unavailable";
89
+ readonly unavailableTrees: number;
90
+ readonly warningTrees: number;
91
+ };
92
+ readonly processCount: {
93
+ readonly availableTrees: number;
94
+ readonly budget: "declared_per_tree_limit" | "unavailable_not_declared";
95
+ readonly maximumValue?: number | undefined;
96
+ readonly state: "available" | "partial" | "unavailable";
97
+ readonly unavailableTrees: number;
98
+ readonly warningTrees: number;
99
+ };
100
+ readonly rssBytes: {
101
+ readonly availableTrees: number;
102
+ readonly budget: "declared_per_tree_limit" | "unavailable_not_declared";
103
+ readonly maximumValue?: number | undefined;
104
+ readonly state: "available" | "partial" | "unavailable";
105
+ readonly unavailableTrees: number;
106
+ readonly warningTrees: number;
107
+ };
108
+ readonly treeCount: number;
109
+ };
110
+ readonly pressure: "admission_degraded" | "cgroup_delegation_unavailable" | "cleanup_unknown" | "healthy" | "observed_pressure" | "warning";
111
+ readonly supervision: {
112
+ readonly trackedTrees: number;
113
+ readonly watcherFibers: number;
114
+ };
115
+ };
116
+ readonly storage: {
117
+ readonly integrity: "ok";
118
+ readonly journalMode: "wal";
119
+ readonly schemaTag: string;
120
+ readonly schemaVersion: number;
121
+ };
122
+ }, unknown, import("effect/Crypto").Crypto>;
123
+ };
124
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1,5 @@
1
+ export const makeStatusClient = (node) => ({
2
+ createMonitorBootstrap: () => node.runNodeClientOperation((client, options) => client.createMonitorBootstrap(options)),
3
+ readStatus: () => node.readStatus,
4
+ });
5
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1,4 @@
1
+ import { type CommandContext, type CommandEffect } from "../command-line/index.js";
2
+ export declare const runNodeStatus: (tokens: readonly string[], context: CommandContext) => CommandEffect;
3
+ export declare const runNodeMonitor: (tokens: readonly string[], context: CommandContext) => CommandEffect;
4
+ //# sourceMappingURL=command.d.ts.map
@@ -0,0 +1,40 @@
1
+ import { protocolErrorSchema } from "@maiaos/sdk";
2
+ import * as Cause from "effect/Cause";
3
+ import * as Effect from "effect/Effect";
4
+ import * as Predicate from "effect/Predicate";
5
+ import { reportError, requireNoArguments, writeNodeResult, writeSuccess, } from "../command-line/index.js";
6
+ import { formatHumanStatus, projectStatusResult } from "./output/index.js";
7
+ const createUnavailableError = () => ({
8
+ code: "node_unavailable",
9
+ message: "The local Maia node is unavailable: start it with 'maia-node --desktop', or 'pnpm dev:node' in a dev worktree, then retry.",
10
+ retryable: true,
11
+ });
12
+ const unavailableError = (cause) => {
13
+ const error = Cause.squash(cause);
14
+ const remote = Predicate.hasProperty(error, "remoteError")
15
+ ? protocolErrorSchema.safeParse(error.remoteError)
16
+ : undefined;
17
+ return remote?.success === true && remote.data.code === "node_unavailable"
18
+ ? remote.data
19
+ : createUnavailableError();
20
+ };
21
+ export const runNodeStatus = (tokens, context) => Effect.suspend(() => {
22
+ requireNoArguments(tokens, "Status");
23
+ return context.dependencies.readStatus();
24
+ }).pipe(Effect.flatMap((node) => Effect.sync(() => {
25
+ writeSuccess(projectStatusResult(node), context, () => formatHumanStatus({ command: "status", node }));
26
+ return 0;
27
+ })), Effect.catchCause((cause) => Cause.hasInterruptsOnly(cause)
28
+ ? Effect.interrupt
29
+ : Effect.sync(() => reportError(unavailableError(cause), context))));
30
+ export const runNodeMonitor = (tokens, context) => {
31
+ requireNoArguments(tokens, "Monitor");
32
+ const create = context.dependencies.createMonitorBootstrap;
33
+ return create === undefined
34
+ ? Effect.die(new Error("No monitor."))
35
+ : Effect.map(create(), (result) => writeNodeResult(result, context, {
36
+ toResult: (value) => ({ command: "monitor", result: value }),
37
+ toText: ({ result: value }) => `${value.url}\n`,
38
+ }));
39
+ };
40
+ //# sourceMappingURL=command.js.map
@@ -0,0 +1,15 @@
1
+ import { type CommandContext, type CommandEffect } from "../command-line/index.js";
2
+ export type DoctorCheck = {
3
+ readonly code: string;
4
+ readonly detail?: string;
5
+ readonly next?: string;
6
+ readonly ok: boolean;
7
+ };
8
+ export type CliDoctorResult = {
9
+ readonly checks: readonly DoctorCheck[];
10
+ readonly command: "doctor";
11
+ readonly ok: boolean;
12
+ readonly version: string;
13
+ };
14
+ export declare const runDoctor: (tokens: readonly string[], context: CommandContext) => CommandEffect;
15
+ //# sourceMappingURL=doctor.d.ts.map
@@ -0,0 +1,111 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as Option from "effect/Option";
3
+ import { requireNoArguments, writeSuccess, } from "../command-line/index.js";
4
+ const EXIT_FAILED = 70;
5
+ const vendorWords = (executor) => executor === "codex-cli"
6
+ ? { integration: "codex", login: "codex" }
7
+ : { integration: "claude-code", login: "claude" };
8
+ const answer = (effect) => effect === undefined
9
+ ? Effect.undefined
10
+ : Effect.map(Effect.orElseSucceed(effect, () => ({ ok: false })), (result) => (result.ok ? result.value : undefined));
11
+ const hasAccount = (item, connections) => item.connection?.state === "enabled" ||
12
+ (connections?.items ?? []).some((connection) => connection.executor === item.executor && connection.state === "enabled");
13
+ const workerPromptChecks = (item, version) => {
14
+ const code = `${item.executor}.worker-prompt`;
15
+ switch (item.workerPrompt) {
16
+ case undefined:
17
+ return [];
18
+ case "ok":
19
+ return [{ code, ok: true }];
20
+ case "inconclusive":
21
+ return [{ code, detail: "probe inconclusive", ok: true }];
22
+ case "failed":
23
+ return [
24
+ {
25
+ code,
26
+ detail: `skills.* keys no longer honored by ${version === undefined ? "this Codex" : `Codex ${version}`}`,
27
+ next: "update Maia",
28
+ ok: false,
29
+ },
30
+ ];
31
+ }
32
+ };
33
+ const vendorChecks = (item, connections) => {
34
+ const { integration, login } = vendorWords(item.executor);
35
+ if (!item.binary.found)
36
+ return [{ code: item.executor, detail: "not installed", ok: true }];
37
+ return [
38
+ {
39
+ code: `${item.executor}.account`,
40
+ next: `maia setup, or maia login ${login}`,
41
+ ok: hasAccount(item, connections),
42
+ },
43
+ {
44
+ code: `${item.executor}.executable`,
45
+ next: `maia integration plan ${integration}`,
46
+ ok: item.executableApproved,
47
+ },
48
+ ...workerPromptChecks(item, item.binary.version),
49
+ ].map((check) => check.ok && check.detail === undefined
50
+ ? { code: check.code, ok: true }
51
+ : check);
52
+ };
53
+ const nodeChecks = (detected, connections) => {
54
+ if (detected === undefined)
55
+ return [{ code: "vendors", next: "maia connection detect", ok: false }];
56
+ const checks = detected.executors.flatMap((item) => vendorChecks(item, connections));
57
+ const usable = detected.executors.some((item) => item.binary.found &&
58
+ item.executableApproved &&
59
+ hasAccount(item, connections));
60
+ return [
61
+ ...checks,
62
+ ...(usable
63
+ ? []
64
+ : [
65
+ {
66
+ code: "worker",
67
+ detail: "no Claude Code or Codex worker is ready",
68
+ next: "install Claude Code or Codex, then maia setup",
69
+ ok: false,
70
+ },
71
+ ]),
72
+ ];
73
+ };
74
+ const formatDoctor = (result) => `Maia doctor ${result.ok ? "ok" : "failed"}\n${result.checks
75
+ .map((check) => ` ${check.code}: ${check.ok ? "ok" : "failed"}${check.detail === undefined ? "" : ` (${check.detail})`}${check.ok || check.next === undefined ? "" : `; next: ${check.next}`}\n`)
76
+ .join("")}`;
77
+ const readLifecycle = (dependencies) => Effect.map(Effect.option(Effect.map(Effect.suspend(() => dependencies.readStatus()), (node) => node.lifecycle)), Option.getOrUndefined);
78
+ const nodeCheck = (lifecycle) => lifecycle === undefined
79
+ ? {
80
+ code: "node",
81
+ next: "maia-node --desktop, or pnpm dev:node in a dev worktree",
82
+ ok: false,
83
+ }
84
+ : { code: "node", detail: lifecycle, ok: true };
85
+ const readChecks = (context) => Effect.gen(function* () {
86
+ const { dependencies, version } = context;
87
+ const lifecycle = yield* readLifecycle(dependencies);
88
+ const base = [
89
+ { code: "cli", detail: version, ok: true },
90
+ nodeCheck(lifecycle),
91
+ ];
92
+ if (lifecycle === undefined)
93
+ return base;
94
+ const detected = yield* answer(dependencies.detectConnections?.({}));
95
+ const connections = yield* answer(dependencies.listConnections?.({ limit: 100 }));
96
+ return [...base, ...nodeChecks(detected, connections)];
97
+ });
98
+ export const runDoctor = (tokens, context) => Effect.gen(function* () {
99
+ requireNoArguments(tokens, "Doctor");
100
+ const checks = yield* readChecks(context);
101
+ const ok = checks.every((check) => check.ok);
102
+ const result = {
103
+ checks,
104
+ command: "doctor",
105
+ ok,
106
+ version: context.version,
107
+ };
108
+ writeSuccess(result, context, formatDoctor);
109
+ return ok ? 0 : EXIT_FAILED;
110
+ });
111
+ //# sourceMappingURL=doctor.js.map
@@ -0,0 +1,5 @@
1
+ export { makeStatusClient } from "./client.js";
2
+ export { runNodeMonitor, runNodeStatus } from "./command.js";
3
+ export { type CliDoctorResult, type DoctorCheck, runDoctor } from "./doctor.js";
4
+ export { type CliStatusResult } from "./output/index.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ export { makeStatusClient } from "./client.js";
2
+ export { runNodeMonitor, runNodeStatus } from "./command.js";
3
+ export { runDoctor } from "./doctor.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,32 @@
1
+ import type { LocalNodeStatusResult } from "@maiaos/sdk";
2
+ export declare const sumObservationWarningTrees: (observations: LocalNodeStatusResult["processResources"]["observations"]) => number;
3
+ export type CliCompactStatusResult = {
4
+ readonly command: "status";
5
+ readonly executorHost?: LocalNodeStatusResult["executorHost"];
6
+ readonly instanceId: LocalNodeStatusResult["instanceId"];
7
+ readonly lifecycle: LocalNodeStatusResult["lifecycle"];
8
+ readonly pid: LocalNodeStatusResult["pid"];
9
+ readonly processResources: {
10
+ readonly admission: {
11
+ readonly capacity: LocalNodeStatusResult["processResources"]["admission"]["capacity"];
12
+ readonly state: LocalNodeStatusResult["processResources"]["admission"]["state"];
13
+ readonly usedTrees: LocalNodeStatusResult["processResources"]["admission"]["usedTrees"];
14
+ };
15
+ readonly capability: {
16
+ readonly hardLimitEnforcement: LocalNodeStatusResult["processResources"]["capability"]["hardLimitEnforcement"];
17
+ readonly mode: LocalNodeStatusResult["processResources"]["capability"]["mode"];
18
+ readonly releaseQualified: LocalNodeStatusResult["processResources"]["capability"]["releaseQualified"];
19
+ };
20
+ readonly nextStep: LocalNodeStatusResult["processResources"]["nextStep"];
21
+ readonly pressure: LocalNodeStatusResult["processResources"]["pressure"];
22
+ readonly warningTrees: number;
23
+ };
24
+ readonly profile: LocalNodeStatusResult["profile"];
25
+ readonly storage: {
26
+ readonly integrity: LocalNodeStatusResult["storage"]["integrity"];
27
+ readonly journalMode: LocalNodeStatusResult["storage"]["journalMode"];
28
+ readonly schemaVersion: LocalNodeStatusResult["storage"]["schemaVersion"];
29
+ };
30
+ };
31
+ export declare const projectStatusResult: (node: LocalNodeStatusResult) => CliCompactStatusResult;
32
+ //# sourceMappingURL=compact.d.ts.map
@@ -0,0 +1,49 @@
1
+ const observedMetricKeys = [
2
+ "cpuTimeMilliseconds",
3
+ "fileDescriptorCount",
4
+ "ioReadBytes",
5
+ "ioWriteBytes",
6
+ "observedPeakRssBytes",
7
+ "processCount",
8
+ "rssBytes",
9
+ ];
10
+ const warningTreesFromMetric = (metric) => "warningTrees" in metric && typeof metric.warningTrees === "number"
11
+ ? metric.warningTrees
12
+ : undefined;
13
+ export const sumObservationWarningTrees = (observations) => observedMetricKeys.reduce((total, key) => {
14
+ const warningTrees = warningTreesFromMetric(observations[key]);
15
+ return warningTrees === undefined ? total : total + warningTrees;
16
+ }, 0);
17
+ const projectStatusAdmission = (admission) => ({
18
+ capacity: admission.capacity,
19
+ state: admission.state,
20
+ usedTrees: admission.usedTrees,
21
+ });
22
+ const projectStatusCapability = (capability) => ({
23
+ hardLimitEnforcement: capability.hardLimitEnforcement,
24
+ mode: capability.mode,
25
+ releaseQualified: capability.releaseQualified,
26
+ });
27
+ export const projectStatusResult = (node) => ({
28
+ command: "status",
29
+ ...(node.executorHost === undefined
30
+ ? {}
31
+ : { executorHost: node.executorHost }),
32
+ instanceId: node.instanceId,
33
+ lifecycle: node.lifecycle,
34
+ pid: node.pid,
35
+ processResources: {
36
+ admission: projectStatusAdmission(node.processResources.admission),
37
+ capability: projectStatusCapability(node.processResources.capability),
38
+ nextStep: node.processResources.nextStep,
39
+ pressure: node.processResources.pressure,
40
+ warningTrees: sumObservationWarningTrees(node.processResources.observations),
41
+ },
42
+ profile: node.profile,
43
+ storage: {
44
+ integrity: node.storage.integrity,
45
+ journalMode: node.storage.journalMode,
46
+ schemaVersion: node.storage.schemaVersion,
47
+ },
48
+ });
49
+ //# sourceMappingURL=compact.js.map
@@ -0,0 +1,7 @@
1
+ import type { LocalNodeStatusResult } from "@maiaos/sdk";
2
+ export type CliStatusResult = {
3
+ readonly command: "status";
4
+ readonly node: LocalNodeStatusResult;
5
+ };
6
+ export declare const formatHumanStatus: ({ node }: CliStatusResult) => string;
7
+ //# sourceMappingURL=human.d.ts.map
@@ -0,0 +1,87 @@
1
+ const processResourceNextStep = (nextStep) => {
2
+ switch (nextStep) {
3
+ case "close_idle_terminal":
4
+ return "close an idle Maia terminal, then retry";
5
+ case "inspect_cleanup_unknown":
6
+ return "inspect cleanup-unknown terminals and processes before restart";
7
+ case "inspect_observed_pressure":
8
+ return "inspect per-tree pressure warnings; termination stays disabled";
9
+ case "none":
10
+ return "none";
11
+ case "run_node_in_delegated_cgroup":
12
+ return "restart the Node in a cgroup delegated to its user: a systemd user unit with Delegate=yes and DelegateSubgroup=node, or systemd-run --user -p Delegate=yes -p DelegateSubgroup=node";
13
+ case "verify_native_host":
14
+ return "verify the native process host";
15
+ }
16
+ };
17
+ const OBSERVED_METRICS = [
18
+ ["cpu-ms", "cpuTimeMilliseconds"],
19
+ ["rss-bytes", "rssBytes"],
20
+ ["peak-rss-bytes", "observedPeakRssBytes"],
21
+ ["processes", "processCount"],
22
+ ["fds", "fileDescriptorCount"],
23
+ ["io-read-bytes", "ioReadBytes"],
24
+ ["io-write-bytes", "ioWriteBytes"],
25
+ ];
26
+ const formatMetric = (label, metric, trees) => {
27
+ const parts = [
28
+ metric.maximumValue === undefined
29
+ ? ""
30
+ : `max ${String(metric.maximumValue)}`,
31
+ metric.unavailableTrees === 0
32
+ ? ""
33
+ : `${String(metric.unavailableTrees)} of ${String(trees)} unmeasured`,
34
+ metric.warningTrees === 0 ? "" : `${String(metric.warningTrees)} warning`,
35
+ ].filter(Boolean);
36
+ return metric.budget === "declared_per_tree_limit" && parts.length > 0
37
+ ? [`${label} ${parts.join(", ")}`]
38
+ : [];
39
+ };
40
+ const processResourceLines = ({ admission, capability, cleanupUnknownTrees, fencedTrees, nextStep, observations, pressure, }) => {
41
+ const measured = OBSERVED_METRICS.flatMap(([label, key]) => formatMetric(label, observations[key], observations.treeCount));
42
+ return [
43
+ `process resources: ${pressure} (${capability.mode}; hard limits ${capability.hardLimitEnforcement})`,
44
+ `capacity: ${String(admission.usedTrees)}/${String(admission.capacity)} process trees in use${admission.state === "available" ? "" : `; ${admission.state}`}`,
45
+ ...(cleanupUnknownTrees === 0
46
+ ? []
47
+ : [
48
+ `ownership: ${String(fencedTrees)} fenced; ${String(cleanupUnknownTrees)} cleanup unknown`,
49
+ ]),
50
+ `observations: ${measured.length === 0 ? "none yet" : measured.join("; ")}`,
51
+ ...(nextStep === "none"
52
+ ? []
53
+ : [`next step: ${processResourceNextStep(nextStep)}`]),
54
+ ];
55
+ };
56
+ const BOTH = "refuses Codex and coding Claude Code Sessions";
57
+ const CODING_CLAUDE = "refuses coding Claude Code Sessions";
58
+ const executorHostLines = (host) => {
59
+ if (host === undefined)
60
+ return [];
61
+ const userNamespaces = {
62
+ allowed: "user namespaces: allowed",
63
+ ["no_nesting"]: `user namespaces: no_nesting (${CODING_CLAUDE}); next step: the owner sets kernel.apparmor_restrict_unprivileged_userns=0 and stops enforcing the unpriv_bwrap AppArmor profile`,
64
+ restricted: `user namespaces: restricted (${BOTH}); next step: the owner sets kernel.apparmor_restrict_unprivileged_userns=0`,
65
+ };
66
+ return [
67
+ host.bubblewrap === "found"
68
+ ? "bubblewrap: found"
69
+ : `bubblewrap: missing (${BOTH}); next step: the owner installs the bubblewrap package`,
70
+ host.socat === "found"
71
+ ? "socat: found"
72
+ : `socat: missing (${CODING_CLAUDE}); next step: the owner installs the socat package`,
73
+ userNamespaces[host.userNamespaces],
74
+ ];
75
+ };
76
+ export const formatHumanStatus = ({ node }) => {
77
+ const lines = [
78
+ `profile: ${node.profile}`,
79
+ `pid: ${String(node.pid)}`,
80
+ `instance: ${node.instanceId}`,
81
+ `storage: ${node.storage.integrity} (${node.storage.journalMode})`,
82
+ ...processResourceLines(node.processResources),
83
+ ...executorHostLines(node.executorHost),
84
+ ];
85
+ return `Maia node ${node.lifecycle}\n${lines.map((line) => ` ${line}\n`).join("")}`;
86
+ };
87
+ //# sourceMappingURL=human.js.map
@@ -0,0 +1,3 @@
1
+ export { type CliCompactStatusResult, projectStatusResult } from "./compact.js";
2
+ export { type CliStatusResult, formatHumanStatus } from "./human.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,3 @@
1
+ export { projectStatusResult } from "./compact.js";
2
+ export { formatHumanStatus } from "./human.js";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,19 @@
1
+ import { type ProtocolError, type TeamWorkspaceBootstrapPreviewParameters } from "@maiaos/sdk";
2
+ import * as Effect from "effect/Effect";
3
+ import * as Ref from "effect/Ref";
4
+ import { CliArgumentError, type CliDependencies, type CommandContext } from "../command-line/index.js";
5
+ import type { CliMutationRecovery } from "../local-node/index.js";
6
+ import type { BootstrapNode } from "./launcher.js";
7
+ export type BootstrapDependencies = Required<Pick<CliDependencies, "applyBootstrap" | "confirmOnTerminal" | "getReceipt" | "previewBootstrap" | "startBootstrapNode">>;
8
+ export type Ceremony = {
9
+ readonly context: CommandContext;
10
+ readonly dependencies: BootstrapDependencies;
11
+ readonly node: BootstrapNode;
12
+ readonly parameters: TeamWorkspaceBootstrapPreviewParameters;
13
+ readonly profile: string;
14
+ readonly sent: Ref.Ref<boolean>;
15
+ };
16
+ export declare const nodeUnavailable: (message: string) => ProtocolError;
17
+ export declare const recoveryFor: ({ parameters, profile, }: Pick<Ceremony, "parameters" | "profile">) => CliMutationRecovery;
18
+ export declare const runCeremony: (ceremony: Ceremony) => Effect.Effect<number, CliArgumentError, import("effect/Crypto").Crypto>;
19
+ //# sourceMappingURL=ceremony.d.ts.map