@maiaos/cli 0.1.0-canary.63 → 0.1.0-canary.65

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 (334) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +15 -9
  3. package/dist/address-space/address-space.js +21 -2
  4. package/dist/address-space/index.js +1 -1
  5. package/dist/agents/client.d.ts +1 -0
  6. package/dist/agents/tree/tree.js +3 -3
  7. package/dist/bin/maia.NOTICES.txt +1 -1
  8. package/dist/bin/maia.cdx.json +70 -19
  9. package/dist/bin/maia.mjs +1 -1
  10. package/dist/board/client.d.ts +27 -0
  11. package/dist/board/client.js +40 -0
  12. package/dist/board/commands.d.ts +28 -0
  13. package/dist/board/commands.js +52 -0
  14. package/dist/board/index.d.ts +3 -0
  15. package/dist/board/index.js +3 -0
  16. package/dist/board/input.js +339 -0
  17. package/dist/board/output/format.js +175 -0
  18. package/dist/board/output/index.js +2 -0
  19. package/dist/board/plan.js +47 -0
  20. package/dist/board/tree/index.js +2 -0
  21. package/dist/board/tree/tree.js +161 -0
  22. package/dist/cli/cli.d.ts +3 -1
  23. package/dist/cli/cli.js +175 -6
  24. package/dist/cli/log-level.d.ts +11 -0
  25. package/dist/cli/log-level.js +14 -0
  26. package/dist/command-line/context.d.ts +18 -5
  27. package/dist/command-line/emit/output.d.ts +5 -1
  28. package/dist/command-line/emit/output.js +13 -5
  29. package/dist/command-line/index.d.ts +2 -2
  30. package/dist/command-line/index.js +1 -2
  31. package/dist/command-line/input/arguments.d.ts +3 -0
  32. package/dist/command-line/input/arguments.js +12 -0
  33. package/dist/command-line/input/index.d.ts +2 -2
  34. package/dist/command-line/input/index.js +2 -2
  35. package/dist/command-line/input/prompt.d.ts +1 -0
  36. package/dist/command-line/input/prompt.js +1 -0
  37. package/dist/command-line/two-phase/two-phase.d.ts +4 -4
  38. package/dist/command-line/two-phase/two-phase.js +9 -9
  39. package/dist/command-tree/commands.js +0 -4
  40. package/dist/command-tree/deprecated.d.ts +2 -0
  41. package/dist/command-tree/deprecated.js +29 -0
  42. package/dist/command-tree/grammar.js +2 -0
  43. package/dist/command-tree/help.d.ts +2 -2
  44. package/dist/command-tree/help.js +13 -15
  45. package/dist/command-tree/index.d.ts +1 -0
  46. package/dist/command-tree/index.js +1 -0
  47. package/dist/command-tree/local.js +10 -5
  48. package/dist/command-tree/placeholder.js +1 -1
  49. package/dist/command-tree/row.d.ts +1 -0
  50. package/dist/command-tree/tree.d.ts +2 -1
  51. package/dist/command-tree/tree.js +30 -4
  52. package/dist/connection/client.d.ts +36 -18
  53. package/dist/connection/client.js +1 -0
  54. package/dist/connection/executors/executors.d.ts +18 -0
  55. package/dist/connection/executors/executors.js +95 -0
  56. package/dist/connection/executors/index.d.ts +2 -0
  57. package/dist/connection/executors/index.js +2 -0
  58. package/dist/connection/executors/reading.js +22 -0
  59. package/dist/connection/index.d.ts +1 -0
  60. package/dist/connection/index.js +1 -0
  61. package/dist/connection/input.js +2 -2
  62. package/dist/connection/login.d.ts +1 -1
  63. package/dist/connection/login.js +4 -3
  64. package/dist/connection/output/format.js +2 -2
  65. package/dist/connection/output/index.d.ts +1 -1
  66. package/dist/connection/output/index.js +1 -1
  67. package/dist/connection/resolve.d.ts +1 -0
  68. package/dist/connection/setup-file.js +161 -0
  69. package/dist/connection/system.js +90 -45
  70. package/dist/connection/tree/tree.js +120 -7
  71. package/dist/container/client.d.ts +2 -0
  72. package/dist/fleet/fleet.d.ts +7 -8
  73. package/dist/fleet/fleet.js +18 -6
  74. package/dist/fleet/index.d.ts +1 -1
  75. package/dist/fleet/index.js +1 -1
  76. package/dist/github/client.d.ts +189 -0
  77. package/dist/github/client.js +16 -0
  78. package/dist/github/commands.d.ts +17 -0
  79. package/dist/github/commands.js +81 -0
  80. package/dist/github/index.d.ts +3 -0
  81. package/dist/github/index.js +3 -0
  82. package/dist/github/input.js +114 -0
  83. package/dist/github/output/format.js +78 -0
  84. package/dist/github/output/index.js +2 -0
  85. package/dist/github/tree/index.js +2 -0
  86. package/dist/github/tree/tree.js +28 -0
  87. package/dist/goal/client.d.ts +246 -0
  88. package/dist/goal/client.js +13 -0
  89. package/dist/goal/commands.d.ts +22 -0
  90. package/dist/goal/commands.js +110 -0
  91. package/dist/goal/index.d.ts +4 -0
  92. package/dist/goal/index.js +4 -0
  93. package/dist/goal/input.js +118 -0
  94. package/dist/goal/output/format.js +29 -0
  95. package/dist/goal/output/index.js +2 -0
  96. package/dist/goal/pause.d.ts +16 -0
  97. package/dist/goal/pause.js +91 -0
  98. package/dist/goal/tree/index.js +2 -0
  99. package/dist/goal/tree/tree.js +49 -0
  100. package/dist/hold/client.d.ts +2 -0
  101. package/dist/hold/tree/tree.js +2 -2
  102. package/dist/import/{batch.js → batch/batch.js} +5 -5
  103. package/dist/import/batch/index.js +3 -0
  104. package/dist/import/{manifest.js → batch/manifest.js} +7 -6
  105. package/dist/import/commands.d.ts +1 -0
  106. package/dist/import/commands.js +27 -15
  107. package/dist/import/detach.d.ts +12 -0
  108. package/dist/import/detach.js +70 -0
  109. package/dist/import/index.d.ts +2 -1
  110. package/dist/import/index.js +2 -1
  111. package/dist/import/input.js +32 -10
  112. package/dist/import/output.js +13 -8
  113. package/dist/inbox/client.d.ts +310 -0
  114. package/dist/inbox/client.js +15 -0
  115. package/dist/inbox/index.d.ts +2 -0
  116. package/dist/inbox/index.js +2 -0
  117. package/dist/integration/client.d.ts +307 -1
  118. package/dist/integration/client.js +21 -1
  119. package/dist/integration/commands.d.ts +8 -0
  120. package/dist/integration/commands.js +53 -10
  121. package/dist/integration/index.d.ts +1 -1
  122. package/dist/integration/index.js +1 -1
  123. package/dist/local-node/client.d.ts +11 -1
  124. package/dist/local-node/client.js +185 -235
  125. package/dist/local-node/index.d.ts +1 -1
  126. package/dist/local-node/index.js +1 -1
  127. package/dist/login/commands.js +7 -1
  128. package/dist/login/gateway.js +34 -11
  129. package/dist/login/menu.js +2 -1
  130. package/dist/login/vendor-account.js +3 -2
  131. package/dist/login/vendor-input.js +3 -2
  132. package/dist/mcp/calls.js +47 -226
  133. package/dist/mcp/routing.d.ts +3 -2
  134. package/dist/mcp/routing.js +37 -8
  135. package/dist/mcp/server.d.ts +10 -1
  136. package/dist/mcp/server.js +16 -6
  137. package/dist/migrate/classes.js +158 -0
  138. package/dist/migrate/commands.js +46 -0
  139. package/dist/migrate/format.js +199 -0
  140. package/dist/migrate/index.js +2 -0
  141. package/dist/migrate/item.js +59 -0
  142. package/dist/migrate/plan.js +79 -0
  143. package/dist/migrate/tree/index.js +2 -0
  144. package/dist/migrate/tree/tree.js +23 -0
  145. package/dist/node-update/client.d.ts +17 -0
  146. package/dist/node-update/client.js +27 -0
  147. package/dist/node-update/commands.d.ts +20 -0
  148. package/dist/node-update/commands.js +150 -0
  149. package/dist/node-update/index.d.ts +4 -0
  150. package/dist/node-update/index.js +4 -0
  151. package/dist/node-update/output.d.ts +12 -0
  152. package/dist/node-update/output.js +165 -0
  153. package/dist/node-update/tree/index.js +2 -0
  154. package/dist/node-update/tree/tree.js +73 -0
  155. package/dist/pairing/client.d.ts +13 -0
  156. package/dist/pairing/client.js +36 -0
  157. package/dist/pairing/commands.d.ts +15 -0
  158. package/dist/pairing/commands.js +131 -0
  159. package/dist/pairing/index.d.ts +4 -0
  160. package/dist/pairing/index.js +4 -0
  161. package/dist/pairing/output.d.ts +12 -0
  162. package/dist/pairing/output.js +53 -0
  163. package/dist/pairing/tree/index.js +2 -0
  164. package/dist/pairing/tree/tree.js +35 -0
  165. package/dist/panel/client.d.ts +9 -0
  166. package/dist/panel/client.js +24 -0
  167. package/dist/panel/commands.d.ts +19 -0
  168. package/dist/panel/commands.js +112 -0
  169. package/dist/panel/index.d.ts +3 -0
  170. package/dist/panel/index.js +3 -0
  171. package/dist/panel/tree/index.js +2 -0
  172. package/dist/panel/tree/tree.js +14 -0
  173. package/dist/port-lease/client.d.ts +3 -0
  174. package/dist/principal/client.d.ts +9 -0
  175. package/dist/principal/client.js +7 -0
  176. package/dist/principal/commands.d.ts +14 -0
  177. package/dist/principal/commands.js +84 -0
  178. package/dist/principal/index.d.ts +4 -0
  179. package/dist/principal/index.js +4 -0
  180. package/dist/principal/output.d.ts +8 -0
  181. package/dist/principal/output.js +43 -0
  182. package/dist/principal/tree/index.js +2 -0
  183. package/dist/principal/tree/tree.js +31 -0
  184. package/dist/project-guard/client.d.ts +1 -0
  185. package/dist/project-instructions/client.d.ts +56 -0
  186. package/dist/project-instructions/client.js +7 -0
  187. package/dist/project-instructions/commands.d.ts +13 -0
  188. package/dist/project-instructions/commands.js +89 -0
  189. package/dist/project-instructions/index.d.ts +3 -0
  190. package/dist/project-instructions/index.js +3 -0
  191. package/dist/project-instructions/input.js +33 -0
  192. package/dist/project-instructions/output/format.js +22 -0
  193. package/dist/project-instructions/output/index.js +2 -0
  194. package/dist/project-knowledge/change.js +22 -0
  195. package/dist/project-knowledge/client.d.ts +127 -0
  196. package/dist/project-knowledge/client.js +17 -0
  197. package/dist/project-knowledge/commands.d.ts +14 -0
  198. package/dist/project-knowledge/commands.js +100 -0
  199. package/dist/project-knowledge/index.d.ts +3 -0
  200. package/dist/project-knowledge/index.js +3 -0
  201. package/dist/project-knowledge/input.js +32 -0
  202. package/dist/project-knowledge/output/format.js +64 -0
  203. package/dist/project-knowledge/output/index.js +2 -0
  204. package/dist/project-knowledge/sources.js +108 -0
  205. package/dist/project-knowledge/upload.js +27 -0
  206. package/dist/project-workspace/git-reads.d.ts +12 -0
  207. package/dist/project-workspace/git-reads.js +71 -0
  208. package/dist/project-workspace/index.d.ts +1 -0
  209. package/dist/project-workspace/index.js +1 -0
  210. package/dist/project-workspace/metadata-client.d.ts +2 -0
  211. package/dist/project-workspace/output/human.js +1 -1
  212. package/dist/project-workspace/tree/tree.js +95 -5
  213. package/dist/reach/client.d.ts +9 -0
  214. package/dist/reach/client.js +7 -0
  215. package/dist/reach/commands.d.ts +14 -0
  216. package/dist/reach/commands.js +72 -0
  217. package/dist/reach/index.d.ts +3 -0
  218. package/dist/reach/index.js +3 -0
  219. package/dist/reach/output.js +41 -0
  220. package/dist/reach/tree/index.js +2 -0
  221. package/dist/reach/tree/tree.js +28 -0
  222. package/dist/remote-node/client.d.ts +85 -0
  223. package/dist/remote-node/commands.js +32 -17
  224. package/dist/remote-node/connector.d.ts +16 -0
  225. package/dist/remote-node/connector.js +2 -2
  226. package/dist/remote-node/reachability.js +31 -18
  227. package/dist/remote-node/reading.js +31 -0
  228. package/dist/remote-node/text.js +68 -5
  229. package/dist/remote-node/tree/tree.js +14 -3
  230. package/dist/routine/client.d.ts +547 -13
  231. package/dist/routine/client.js +19 -1
  232. package/dist/routine/commands.d.ts +5 -0
  233. package/dist/routine/commands.js +73 -15
  234. package/dist/routine/index.d.ts +2 -1
  235. package/dist/routine/index.js +2 -1
  236. package/dist/routine/input.js +66 -3
  237. package/dist/routine/output/format.js +80 -19
  238. package/dist/routine/output/index.js +1 -1
  239. package/dist/routine/portable/import-files.js +74 -0
  240. package/dist/routine/portable/import-output.js +21 -0
  241. package/dist/routine/portable/import.js +274 -0
  242. package/dist/routine/portable/index.js +3 -0
  243. package/dist/routine/portable/portable.js +185 -0
  244. package/dist/routine/tree/tree.js +80 -8
  245. package/dist/routine/trigger/commands.d.ts +20 -0
  246. package/dist/routine/trigger/commands.js +74 -0
  247. package/dist/routine/trigger/format.js +42 -0
  248. package/dist/routine/trigger/index.d.ts +2 -0
  249. package/dist/routine/trigger/index.js +2 -0
  250. package/dist/routine/trigger/input.js +81 -0
  251. package/dist/run-ledger/client.d.ts +45 -0
  252. package/dist/secret/client.d.ts +39 -0
  253. package/dist/secret/client.js +6 -0
  254. package/dist/secret/commands.d.ts +12 -0
  255. package/dist/secret/commands.js +91 -0
  256. package/dist/secret/index.d.ts +3 -0
  257. package/dist/secret/index.js +3 -0
  258. package/dist/secret/input.js +22 -0
  259. package/dist/secret/output/format.js +10 -0
  260. package/dist/secret/output/index.js +2 -0
  261. package/dist/secret/tree/index.js +2 -0
  262. package/dist/secret/tree/tree.js +16 -0
  263. package/dist/session/agent-permission.d.ts +3 -2
  264. package/dist/session/approval/client.d.ts +4 -3
  265. package/dist/session/approval/commands.d.ts +7 -0
  266. package/dist/session/approval/commands.js +176 -6
  267. package/dist/session/approval/index.d.ts +1 -1
  268. package/dist/session/approval/index.js +1 -1
  269. package/dist/session/approval/output/format.js +53 -1
  270. package/dist/session/approval/output/index.js +1 -1
  271. package/dist/session/attach.d.ts +1 -1
  272. package/dist/session/attach.js +7 -2
  273. package/dist/session/client.d.ts +12 -12
  274. package/dist/session/client.js +8 -17
  275. package/dist/session/command/commands.js +109 -0
  276. package/dist/session/command/index.js +2 -0
  277. package/dist/session/commands.d.ts +5 -1
  278. package/dist/session/commands.js +260 -55
  279. package/dist/session/create-tasks.js +3 -48
  280. package/dist/session/creation/creation.js +51 -0
  281. package/dist/session/creation/index.js +2 -0
  282. package/dist/session/fork/fork.js +135 -0
  283. package/dist/session/fork/index.js +2 -0
  284. package/dist/session/git-status.d.ts +11 -0
  285. package/dist/session/git-status.js +30 -0
  286. package/dist/session/index.d.ts +4 -3
  287. package/dist/session/index.js +3 -2
  288. package/dist/session/interaction/client.d.ts +3 -0
  289. package/dist/session/move/index.js +2 -0
  290. package/dist/session/move/move.js +439 -0
  291. package/dist/session/output/held.js +28 -0
  292. package/dist/session/output/human.js +34 -7
  293. package/dist/session/output/tasks.js +23 -6
  294. package/dist/session/setup/index.js +2 -0
  295. package/dist/session/setup/setup.js +69 -0
  296. package/dist/session/spawn/caps.js +128 -0
  297. package/dist/session/spawn/index.js +5 -0
  298. package/dist/session/spawn/spawn.js +203 -0
  299. package/dist/session/spawn/standing.js +62 -0
  300. package/dist/session/spawn/supervision.js +62 -0
  301. package/dist/session/switch/index.js +2 -0
  302. package/dist/session/switch/switch.js +103 -0
  303. package/dist/session/tree/tree.js +280 -18
  304. package/dist/session/turn/attachments.js +54 -0
  305. package/dist/session/turn/client.d.ts +3 -1
  306. package/dist/session/turn/client.js +6 -1
  307. package/dist/session/turn/commands.d.ts +5 -1
  308. package/dist/session/turn/commands.js +148 -27
  309. package/dist/session/turn/index.d.ts +2 -2
  310. package/dist/session/turn/index.js +1 -1
  311. package/dist/session/turn/output.d.ts +25 -1
  312. package/dist/session/turn/output.js +33 -0
  313. package/dist/skills-sync/client.d.ts +9 -0
  314. package/dist/skills-sync/client.js +7 -0
  315. package/dist/skills-sync/commands.d.ts +15 -0
  316. package/dist/skills-sync/commands.js +241 -0
  317. package/dist/skills-sync/index.d.ts +3 -0
  318. package/dist/skills-sync/index.js +3 -0
  319. package/dist/skills-sync/output.js +168 -0
  320. package/dist/skills-sync/set-file.js +23 -0
  321. package/dist/skills-sync/tree/index.js +2 -0
  322. package/dist/skills-sync/tree/tree.js +38 -0
  323. package/dist/status/client.d.ts +7 -0
  324. package/dist/status/command.js +3 -2
  325. package/dist/status/doctor.js +4 -3
  326. package/dist/team-workspace/client.d.ts +1 -0
  327. package/dist/text-input/index.js +2 -0
  328. package/dist/text-input/text-input.js +35 -0
  329. package/dist/webhooks/client.d.ts +10 -9
  330. package/dist/webhooks/input.js +2 -2
  331. package/dist/webhooks/tree/tree.js +4 -4
  332. package/guidance/maia-sessions/SKILL.md +37 -3
  333. package/package.json +6 -5
  334. package/dist/command-line/context.js +0 -2
@@ -0,0 +1,168 @@
1
+ import { cell, formatRows, tab } from "../command-line/emit/index.js";
2
+ import { LOCAL_NODE } from "../command-line/input/index.js";
3
+ const errorText = ({ code, message }) => cell(`${code}: ${message}`);
4
+ const shortDigest = (digest) => digest.slice(0, 19);
5
+ const quote = (value) => /^[\w./:@+=-]+$/u.test(value) ? value : `'${value.replaceAll("'", "'\\''")}'`;
6
+ const nodeFlag = (node) => node === LOCAL_NODE ? "" : `--node ${node} `;
7
+ const SHOW_TABLE = {
8
+ empty: "No Node was asked.",
9
+ headers: ["NODE", "STATE", "REVISION", "PIN", "DETAIL"],
10
+ };
11
+ const showRow = (entry) => {
12
+ if (entry.outcome === "failed")
13
+ return tab([cell(entry.node), "failed", "-", "-", errorText(entry.error)]);
14
+ const { node, shown } = entry;
15
+ const edits = shown.skills.filter(({ state }) => state !== "in_sync");
16
+ return tab([
17
+ cell(node),
18
+ shown.tampered ? `${shown.state} (pin tampered)` : shown.state,
19
+ shown.revision,
20
+ shown.pin === undefined ? "-" : shortDigest(shown.pin.digest),
21
+ edits.length === 0
22
+ ? "-"
23
+ : edits.map(({ name, state }) => `${name} ${state}`).join(", "),
24
+ ]);
25
+ };
26
+ const PREVIEW_TABLE = {
27
+ empty: "No Node was asked.",
28
+ headers: ["NODE", "OUTCOME", "STANDING", "DETAIL"],
29
+ };
30
+ const countText = (count, noun) => `${String(count)} ${noun}${count === 1 ? "" : "s"}`;
31
+ const previewDetail = (entry) => {
32
+ const { changes, conflicts } = entry.preview.plan;
33
+ if (conflicts.length > 0)
34
+ return `a local edit is in the way: ${conflicts
35
+ .map(({ name, reason }) => `${name} ${reason}`)
36
+ .join(", ")}`;
37
+ return countText(changes.length, "change");
38
+ };
39
+ const previewRow = (entry) => {
40
+ if (entry.outcome === "failed")
41
+ return tab([cell(entry.node), "failed", "-", errorText(entry.error)]);
42
+ return tab([
43
+ cell(entry.node),
44
+ entry.outcome,
45
+ entry.tampered ? `${entry.standing} (pin tampered)` : entry.standing,
46
+ cell(previewDetail(entry)),
47
+ ]);
48
+ };
49
+ const heldReason = (reason) => {
50
+ switch (reason) {
51
+ case "conflict":
52
+ return "a local edit is in the way; nothing was sent";
53
+ case "fleet_held":
54
+ return "another Node is not ready; nothing was sent";
55
+ case "preview_failed":
56
+ return "this Node gave no proof; nothing was sent";
57
+ }
58
+ };
59
+ const CONFIRM_TABLE = {
60
+ empty: "No Node was asked.",
61
+ headers: ["NODE", "OUTCOME", "DETAIL"],
62
+ };
63
+ const heldText = (entry) => {
64
+ const reason = `${entry.reason}: ${heldReason(entry.reason)}`;
65
+ return entry.reason === "preview_failed"
66
+ ? `${reason} (${errorText(entry.error)})`
67
+ : reason;
68
+ };
69
+ const confirmRow = (entry) => {
70
+ if (entry.outcome === "failed")
71
+ return tab([cell(entry.node), "failed", errorText(entry.error)]);
72
+ if (entry.outcome === "held")
73
+ return tab([cell(entry.node), "held", heldText(entry)]);
74
+ const { node, receipt } = entry;
75
+ return tab([
76
+ cell(node),
77
+ "applied",
78
+ `receipt ${receipt.receiptId}, revision ${receipt.revision}${receipt.replayed ? ", replayed" : ""}`,
79
+ ]);
80
+ };
81
+ const again = (next, nodes, tail) => [
82
+ "maia skills sync",
83
+ next.kind,
84
+ ...nodes.map(quote),
85
+ `--workspace ${next.workspace}`,
86
+ ...(next.setFile === undefined ? [] : [`--set ${quote(next.setFile)}`]),
87
+ tail,
88
+ ].join(" ");
89
+ const blockOf = (entry) => {
90
+ if (entry.outcome === "conflict" || entry.outcome === "failed")
91
+ return entry.outcome;
92
+ if (entry.outcome !== "held")
93
+ return undefined;
94
+ if (entry.reason === "conflict")
95
+ return "conflict";
96
+ return entry.reason === "preview_failed" ? "failed" : undefined;
97
+ };
98
+ const blockedNodes = (entries, block) => entries.flatMap((entry) => (blockOf(entry) === block ? [entry.node] : []));
99
+ const blockedNext = (next, entries) => {
100
+ const conflicts = blockedNodes(entries, "conflict");
101
+ return [
102
+ ...(conflicts.length === 0
103
+ ? []
104
+ : [
105
+ `Next: maia skills sync show ${conflicts.join(" ")} --workspace ${next.workspace}, keep or propose each local edit, then preview again.`,
106
+ ]),
107
+ ...blockedNodes(entries, "failed").map((node) => `Next: maia ${nodeFlag(node)}status, then preview again with --dry-run.`),
108
+ ];
109
+ };
110
+ const previewNext = (output, next) => output.ready
111
+ ? [
112
+ `Next: ${again(next, output.nodes.map(({ node }) => node), "--yes")}`,
113
+ ]
114
+ : [
115
+ "Nothing will be applied while a Node is not ready.",
116
+ ...blockedNext(next, output.nodes),
117
+ ];
118
+ const confirmNext = (output, next) => {
119
+ const unknown = output.nodes.flatMap((entry) => entry.outcome === "failed" && entry.error.code === "outcome_unknown"
120
+ ? [
121
+ `Next: maia ${nodeFlag(entry.node)}receipt show ${output.commandId}, because the outcome on ${cell(entry.node)} is unknown.`,
122
+ ]
123
+ : []);
124
+ const held = output.nodes.some(({ outcome }) => outcome === "held");
125
+ return [
126
+ ...(held ? ["Nothing was applied."] : []),
127
+ ...unknown,
128
+ ...blockedNext(next, output.nodes),
129
+ ];
130
+ };
131
+ const header = (output) => {
132
+ const first = output.nodes.find((entry) => entry.outcome !== "failed");
133
+ const target = first === undefined ? "" : `: ${shortDigest(first.preview.digest)}`;
134
+ return `Skills sync ${output.kind}, Workspace ${cell(output.workspace)}${target}\n`;
135
+ };
136
+ export const formatSkillsSyncResult = ({ result }, setFile) => {
137
+ if (result.method === "skills.sync.show")
138
+ return formatRows(result.nodes, showRow, SHOW_TABLE);
139
+ const next = {
140
+ commandId: result.commandId,
141
+ kind: result.kind,
142
+ workspace: result.workspace,
143
+ ...(setFile === undefined ? {} : { setFile }),
144
+ };
145
+ if (result.method === "skills.sync.preview")
146
+ return `${header(result)}${formatRows(result.nodes, previewRow, PREVIEW_TABLE)}${previewNext(result, next).join("\n")}\n`;
147
+ return `${formatRows(result.nodes, confirmRow, CONFIRM_TABLE)}${confirmNext(result, next).join("\n")}\n`;
148
+ };
149
+ const errorOf = (entry) => {
150
+ if (entry.outcome === "failed")
151
+ return entry.error;
152
+ return entry.outcome === "held" && entry.reason === "preview_failed"
153
+ ? entry.error
154
+ : undefined;
155
+ };
156
+ export const blockerOf = (output) => {
157
+ const nodes = output.nodes;
158
+ const failure = nodes.map(errorOf).find((error) => error !== undefined);
159
+ const conflicting = nodes.find((entry) => blockOf(entry) === "conflict");
160
+ if (failure !== undefined || conflicting === undefined)
161
+ return failure;
162
+ return {
163
+ code: "configuration_conflict",
164
+ message: `Node ${conflicting.node} holds a local edit that the set would overwrite, so nothing was applied.`,
165
+ retryable: false,
166
+ };
167
+ };
168
+ //# sourceMappingURL=output.js.map
@@ -0,0 +1,23 @@
1
+ import * as NodeFileSystem from "@effect/platform-node-shared/NodeFileSystem";
2
+ import { SKILLS_SYNC_LIMITS } from "@maiaos/sdk";
3
+ import * as Effect from "effect/Effect";
4
+ import * as FileSystem from "effect/FileSystem";
5
+ import { decodeJsonText } from "../command-line/emit/index.js";
6
+ import { CliArgumentError } from "../command-line/input/index.js";
7
+ const READ_LIMIT_BYTES = 2 * Math.ceil(SKILLS_SYNC_LIMITS.setBytes / 3) * 4;
8
+ const unreadable = () => new CliArgumentError("The set must name a readable file.");
9
+ const readSetText = (path) => Effect.gen(function* () {
10
+ const fs = yield* FileSystem.FileSystem;
11
+ const info = yield* fs.stat(path);
12
+ if (info.type !== "File")
13
+ return yield* unreadable();
14
+ if (Number(info.size) > READ_LIMIT_BYTES)
15
+ return yield* new CliArgumentError(`The set file must hold at most ${String(READ_LIMIT_BYTES)} bytes.`);
16
+ const bytes = yield* fs.readFile(path);
17
+ return yield* Effect.try({
18
+ catch: () => new CliArgumentError("The set file must be UTF-8."),
19
+ try: () => new TextDecoder("utf-8", { fatal: true }).decode(bytes),
20
+ });
21
+ }).pipe(Effect.catchTag("PlatformError", () => Effect.fail(unreadable())), Effect.provide(NodeFileSystem.layer));
22
+ export const readSetFile = (path) => Effect.flatMap(readSetText(path), (text) => decodeJsonText(text, () => new CliArgumentError("The set file must be one JSON document.")));
23
+ //# sourceMappingURL=set-file.js.map
@@ -0,0 +1,2 @@
1
+ export { SKILLS_SYNC_TREE } from "./tree.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,38 @@
1
+ const skills = () => import("../index.js");
2
+ export const SKILLS_SYNC_TREE = {
3
+ groups: [
4
+ ["skills", "Skills on the Nodes."],
5
+ [
6
+ "skills sync",
7
+ "One digest-pinned skills set per Workspace on named Nodes.",
8
+ ],
9
+ ],
10
+ leaves: [
11
+ [
12
+ "skills sync show <node>... --workspace <workspace-key>",
13
+ 1,
14
+ "skills.sync.show",
15
+ "Show each named Node's pinned set and any local edit.",
16
+ { remote: false, run: [skills, "runSkillsSyncShow"] },
17
+ ],
18
+ [
19
+ "skills sync apply --set <set.json> (<node>... --workspace <workspace-key> [--command-id <id>] [--dry-run | --yes] | --confirm-stdin)",
20
+ 1,
21
+ ["skills.sync.preview", "skills.sync.confirm"],
22
+ "Apply one set on each named Node, each writing its own receipt.",
23
+ { kind: "two-phase", remote: false, run: [skills, "runSkillsSyncApply"] },
24
+ ],
25
+ [
26
+ "skills sync rollback (<node>... --workspace <workspace-key> [--command-id <id>] [--dry-run | --yes] | --confirm-stdin)",
27
+ 1,
28
+ ["skills.sync.preview", "skills.sync.confirm"],
29
+ "Return every named Node to the set it pinned before its current one.",
30
+ {
31
+ kind: "two-phase",
32
+ remote: false,
33
+ run: [skills, "runSkillsSyncRollback"],
34
+ },
35
+ ],
36
+ ],
37
+ };
38
+ //# sourceMappingURL=tree.js.map
@@ -18,6 +18,12 @@ export declare const makeStatusClient: (node: CliNodeOperations) => {
18
18
  readonly userNamespaces: "allowed" | "no_nesting" | "restricted";
19
19
  } | undefined;
20
20
  readonly headlessApprovals?: "off" | "on" | undefined;
21
+ readonly host?: {
22
+ readonly diskFreePercent: number;
23
+ readonly loadPerCpu: number;
24
+ readonly memoryAvailablePercent: number;
25
+ readonly observedAt: string;
26
+ } | undefined;
21
27
  readonly hostAuthority?: "disabled" | "enabled" | undefined;
22
28
  readonly method: "node.status";
23
29
  readonly processResources: {
@@ -130,6 +136,7 @@ export declare const makeStatusClient: (node: CliNodeOperations) => {
130
136
  readonly schemaTag: string;
131
137
  readonly schemaVersion: number;
132
138
  };
139
+ readonly version?: string | undefined;
133
140
  }, unknown, import("effect/Crypto").Crypto>;
134
141
  };
135
142
  //# sourceMappingURL=client.d.ts.map
@@ -3,10 +3,11 @@ import * as Cause from "effect/Cause";
3
3
  import * as Effect from "effect/Effect";
4
4
  import * as Predicate from "effect/Predicate";
5
5
  import { reportError, requireNoArguments, writeNodeResult, writeSuccess, } from "../command-line/index.js";
6
+ import { discoveryError } from "../local-node/index.js";
6
7
  import { formatHumanStatus, projectStatusResult } from "./output/index.js";
7
8
  const createUnavailableError = () => ({
8
9
  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
+ message: "The local Maia node is unavailable: start it with 'maia-node', then retry.",
10
11
  retryable: true,
11
12
  });
12
13
  const unavailableError = (cause) => {
@@ -18,7 +19,7 @@ const unavailableError = (cause) => {
18
19
  (remote.data.code === "node_unavailable" ||
19
20
  remote.data.code === "invalid_argument")
20
21
  ? remote.data
21
- : createUnavailableError();
22
+ : (discoveryError(error) ?? createUnavailableError());
22
23
  };
23
24
  export const runNodeStatus = (tokens, context) => Effect.suspend(() => {
24
25
  requireNoArguments(tokens, "Status");
@@ -1,10 +1,11 @@
1
+ import { EXECUTOR_IDS, } from "@maiaos/sdk";
1
2
  import * as Effect from "effect/Effect";
2
3
  import * as Option from "effect/Option";
3
4
  import { LOCAL_NODE, requireNoArguments, writeSuccess, } from "../command-line/index.js";
4
5
  const EXIT_FAILED = 70;
5
- const vendorWords = (executor) => executor === "codex-cli"
6
+ const vendorWords = (executor) => executor === EXECUTOR_IDS.codex
6
7
  ? { integration: "codex", login: "codex" }
7
- : { integration: "claude-code", login: "claude" };
8
+ : { integration: EXECUTOR_IDS.claudeCode, login: "claude" };
8
9
  const answer = (effect) => effect === undefined
9
10
  ? Effect.undefined
10
11
  : Effect.map(Effect.orElseSucceed(effect, () => ({ ok: false })), (result) => (result.ok ? result.value : undefined));
@@ -78,7 +79,7 @@ const readLifecycle = (dependencies) => Effect.map(Effect.option(Effect.map(Effe
78
79
  const nodeCheck = (lifecycle) => lifecycle === undefined
79
80
  ? {
80
81
  code: "node",
81
- next: "maia-node --desktop, or pnpm dev:node in a dev worktree",
82
+ next: "maia-node",
82
83
  ok: false,
83
84
  }
84
85
  : { code: "node", detail: lifecycle, ok: true };
@@ -21,6 +21,7 @@ export declare const makeBootstrapClient: (node: CliNodeOperations) => {
21
21
  readonly createdAt: string;
22
22
  readonly eventCursor: string;
23
23
  readonly method: string;
24
+ readonly proposedBy?: string | undefined;
24
25
  readonly receiptId: string;
25
26
  readonly schemaVersion: 1;
26
27
  readonly state: "succeeded";
@@ -0,0 +1,2 @@
1
+ export { readTextFile, readTextInput } from "./text-input.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,35 @@
1
+ import * as NodeFileSystem from "@effect/platform-node-shared/NodeFileSystem";
2
+ import * as Effect from "effect/Effect";
3
+ import * as FileSystem from "effect/FileSystem";
4
+ import { CliArgumentError } from "../command-line/input/index.js";
5
+ const READ_LIMIT_BYTES = 1024 * 1024;
6
+ const STDIN_CHUNKS = 1024;
7
+ const STDIN = "-";
8
+ const unreadable = (option) => new CliArgumentError(`Option '${option}' must name a readable file.`);
9
+ export const readTextFile = (path, option = "--file") => Effect.gen(function* () {
10
+ const fs = yield* FileSystem.FileSystem;
11
+ const info = yield* fs.stat(path);
12
+ if (info.type !== "File")
13
+ return yield* unreadable(option);
14
+ if (Number(info.size) > READ_LIMIT_BYTES)
15
+ return yield* new CliArgumentError(`Option '${option}' must name a file of at most ${String(READ_LIMIT_BYTES)} bytes.`);
16
+ const bytes = yield* fs.readFile(path);
17
+ return yield* Effect.try({
18
+ catch: () => new CliArgumentError(`Option '${option}' must name a UTF-8 file.`),
19
+ try: () => new TextDecoder("utf-8", { fatal: true }).decode(bytes),
20
+ });
21
+ }).pipe(Effect.catchTag("PlatformError", () => Effect.fail(unreadable(option))), Effect.provide(NodeFileSystem.layer));
22
+ export const readTextInput = (file, { stdin, stdinIsTerminal }, noun) => {
23
+ if (file !== undefined && file !== STDIN)
24
+ return readTextFile(file);
25
+ if (file === undefined && stdinIsTerminal === true)
26
+ return Effect.fail(new CliArgumentError(`Give the ${noun} with '--file <path>', or on standard input.`));
27
+ return stdin === undefined
28
+ ? Effect.fail(new CliArgumentError("Standard input is unavailable."))
29
+ : stdin({
30
+ label: noun,
31
+ maxBytes: READ_LIMIT_BYTES,
32
+ maxChunks: STDIN_CHUNKS,
33
+ });
34
+ };
35
+ //# sourceMappingURL=text-input.js.map
@@ -16,6 +16,7 @@ export declare const makeWebhooksClient: (node: CliNodeOperations) => {
16
16
  readonly createdAt: string;
17
17
  readonly eventCursor: string;
18
18
  readonly method: string;
19
+ readonly proposedBy?: string | undefined;
19
20
  readonly receiptId: string;
20
21
  readonly schemaVersion: 1;
21
22
  readonly state: "succeeded";
@@ -37,13 +38,13 @@ export declare const makeWebhooksClient: (node: CliNodeOperations) => {
37
38
  readonly schemaVersion: "maia.webhook/v1";
38
39
  readonly spec: {
39
40
  readonly allowPrivate: boolean;
40
- readonly events: readonly ("admission.refused" | "node.started" | "node.stopping" | "session.adopted" | "session.blocked" | "session.ended" | "session.idle" | "session.runtime.failed" | "session.started" | "session.turn.completed" | "session.turn.failed" | "session.working" | "update.done" | "webhook.test")[];
41
+ readonly events: readonly ("admission.refused" | "approval.requested" | "approval.resolved" | "drift.raised" | "drift.settled" | "inbox.item.created" | "inbox.item.settled" | "node.health.changed" | "node.started" | "node.stopping" | "session.adopted" | "session.blocked" | "session.ended" | "session.idle" | "session.runtime.failed" | "session.started" | "session.turn.completed" | "session.turn.failed" | "session.working" | "update.done" | "webhook.test")[];
41
42
  readonly filters: readonly {
42
43
  readonly key: string;
43
44
  readonly value: string;
44
45
  }[];
45
- readonly secretEnv: string;
46
46
  readonly url: string;
47
+ readonly secretEnv: string;
47
48
  };
48
49
  readonly state: "active" | "removed";
49
50
  readonly updatedAt: string;
@@ -56,7 +57,7 @@ export declare const makeWebhooksClient: (node: CliNodeOperations) => {
56
57
  readonly errorClass?: string | undefined;
57
58
  readonly eventId: string;
58
59
  readonly id: string;
59
- readonly kind: "admission.refused" | "node.started" | "node.stopping" | "session.adopted" | "session.blocked" | "session.ended" | "session.idle" | "session.runtime.failed" | "session.started" | "session.turn.completed" | "session.turn.failed" | "session.working" | "update.done" | "webhook.test";
60
+ readonly kind: "admission.refused" | "approval.requested" | "approval.resolved" | "drift.raised" | "drift.settled" | "inbox.item.created" | "inbox.item.settled" | "node.health.changed" | "node.started" | "node.stopping" | "session.adopted" | "session.blocked" | "session.ended" | "session.idle" | "session.runtime.failed" | "session.started" | "session.turn.completed" | "session.turn.failed" | "session.working" | "update.done" | "webhook.test";
60
61
  readonly nextAttemptAt?: string | undefined;
61
62
  readonly state: "dead" | "delivered" | "denied" | "expired" | "in_flight" | "pending" | "retry";
62
63
  readonly updatedAt: string;
@@ -78,13 +79,13 @@ export declare const makeWebhooksClient: (node: CliNodeOperations) => {
78
79
  readonly schemaVersion: "maia.webhook/v1";
79
80
  readonly spec: {
80
81
  readonly allowPrivate: boolean;
81
- readonly events: readonly ("admission.refused" | "node.started" | "node.stopping" | "session.adopted" | "session.blocked" | "session.ended" | "session.idle" | "session.runtime.failed" | "session.started" | "session.turn.completed" | "session.turn.failed" | "session.working" | "update.done" | "webhook.test")[];
82
+ readonly events: readonly ("admission.refused" | "approval.requested" | "approval.resolved" | "drift.raised" | "drift.settled" | "inbox.item.created" | "inbox.item.settled" | "node.health.changed" | "node.started" | "node.stopping" | "session.adopted" | "session.blocked" | "session.ended" | "session.idle" | "session.runtime.failed" | "session.started" | "session.turn.completed" | "session.turn.failed" | "session.working" | "update.done" | "webhook.test")[];
82
83
  readonly filters: readonly {
83
84
  readonly key: string;
84
85
  readonly value: string;
85
86
  }[];
86
- readonly secretEnv: string;
87
87
  readonly url: string;
88
+ readonly secretEnv: string;
88
89
  };
89
90
  readonly state: "active" | "removed";
90
91
  readonly updatedAt: string;
@@ -97,13 +98,13 @@ export declare const makeWebhooksClient: (node: CliNodeOperations) => {
97
98
  readonly kind: "add";
98
99
  readonly spec: {
99
100
  readonly allowPrivate: boolean;
100
- readonly events: readonly ("admission.refused" | "node.started" | "node.stopping" | "session.adopted" | "session.blocked" | "session.ended" | "session.idle" | "session.runtime.failed" | "session.started" | "session.turn.completed" | "session.turn.failed" | "session.working" | "update.done" | "webhook.test")[];
101
+ readonly events: readonly ("admission.refused" | "approval.requested" | "approval.resolved" | "drift.raised" | "drift.settled" | "inbox.item.created" | "inbox.item.settled" | "node.health.changed" | "node.started" | "node.stopping" | "session.adopted" | "session.blocked" | "session.ended" | "session.idle" | "session.runtime.failed" | "session.started" | "session.turn.completed" | "session.turn.failed" | "session.working" | "update.done" | "webhook.test")[];
101
102
  readonly filters: readonly {
102
103
  readonly key: string;
103
104
  readonly value: string;
104
105
  }[];
105
- readonly secretEnv: string;
106
106
  readonly url: string;
107
+ readonly secretEnv: string;
107
108
  };
108
109
  } | {
109
110
  readonly expectedRevision: string;
@@ -134,13 +135,13 @@ export declare const makeWebhooksClient: (node: CliNodeOperations) => {
134
135
  readonly schemaVersion: "maia.webhook/v1";
135
136
  readonly spec: {
136
137
  readonly allowPrivate: boolean;
137
- readonly events: readonly ("admission.refused" | "node.started" | "node.stopping" | "session.adopted" | "session.blocked" | "session.ended" | "session.idle" | "session.runtime.failed" | "session.started" | "session.turn.completed" | "session.turn.failed" | "session.working" | "update.done" | "webhook.test")[];
138
+ readonly events: readonly ("admission.refused" | "approval.requested" | "approval.resolved" | "drift.raised" | "drift.settled" | "inbox.item.created" | "inbox.item.settled" | "node.health.changed" | "node.started" | "node.stopping" | "session.adopted" | "session.blocked" | "session.ended" | "session.idle" | "session.runtime.failed" | "session.started" | "session.turn.completed" | "session.turn.failed" | "session.working" | "update.done" | "webhook.test")[];
138
139
  readonly filters: readonly {
139
140
  readonly key: string;
140
141
  readonly value: string;
141
142
  }[];
142
- readonly secretEnv: string;
143
143
  readonly url: string;
144
+ readonly secretEnv: string;
144
145
  };
145
146
  readonly state: "active" | "removed";
146
147
  readonly updatedAt: string;
@@ -1,4 +1,4 @@
1
- import { webhookSpecSchema, } from "@maiaos/sdk";
1
+ import { WEBHOOK_SECRET_ENV_PREFIX, webhookSpecSchema, } from "@maiaos/sdk";
2
2
  import * as Effect from "effect/Effect";
3
3
  import { CliArgumentError, parseOptionsWith, readExpectedRevision, readPageSize, requirePositionals, } from "../command-line/input/index.js";
4
4
  import { TWO_PHASE_FLAGS } from "../command-line/two-phase/index.js";
@@ -50,7 +50,7 @@ const required = (options, name) => {
50
50
  throw new CliArgumentError(`Option '${name}' is required.`);
51
51
  return value;
52
52
  };
53
- const INVALID_SPEC = "The webhook is invalid: check '--url' (http or https, no credentials), '--secret-env' (an upper-case variable name), '--event' (a hook event) and '--label' (key=value, no comma).";
53
+ const INVALID_SPEC = `The webhook is invalid: check '--url' (http or https, no credentials), '--secret-env' (${WEBHOOK_SECRET_ENV_PREFIX} then 1 to 43 of A-Z, 0-9 and _), '--event' (a hook event) and '--label' (key=value, no comma).`;
54
54
  const labelFilter = (label) => {
55
55
  const [key, ...rest] = label.split("=");
56
56
  if (key === undefined || key === "" || rest.length === 0)
@@ -17,28 +17,28 @@ export const WEBHOOKS_TREE = {
17
17
  { run: [webhooks, "runWebhooksDeliveries"] },
18
18
  ],
19
19
  [
20
- "webhooks add (--url <http-url> --secret-env <VARIABLE> --event <kind>... [--label <key=value>...] [--project <project-id>] [--node-id <node-id>] [--allow-private] [--command-id <id>] [--dry-run] | --confirm-stdin)",
20
+ "webhooks add (--url <http-url> --secret-env <MAIA_WEBHOOK_SECRET_NAME> --event <kind>... [--label <key=value>...] [--project <project-id>] [--node-id <node-id>] [--allow-private] [--command-id <id>] [--dry-run | --yes] | --confirm-stdin)",
21
21
  1,
22
22
  ["webhooks.change.preview", "webhooks.change.confirm"],
23
23
  "Add a webhook after a preview.",
24
24
  { kind: "two-phase", run: [webhooks, "runWebhooksAdd"] },
25
25
  ],
26
26
  [
27
- "webhooks test (<webhook-id> --expected-revision <revision> [--command-id <id>] [--dry-run] | --confirm-stdin)",
27
+ "webhooks test (<webhook-id> --expected-revision <revision> [--command-id <id>] [--dry-run | --yes] | --confirm-stdin)",
28
28
  1,
29
29
  ["webhooks.change.preview", "webhooks.change.confirm"],
30
30
  "Send a test event to a webhook after a preview.",
31
31
  { kind: "two-phase", run: [webhooks, "runWebhooksTest"] },
32
32
  ],
33
33
  [
34
- "webhooks remove (<webhook-id> --expected-revision <revision> [--command-id <id>] [--dry-run] | --confirm-stdin)",
34
+ "webhooks remove (<webhook-id> --expected-revision <revision> [--command-id <id>] [--dry-run | --yes] | --confirm-stdin)",
35
35
  1,
36
36
  ["webhooks.change.preview", "webhooks.change.confirm"],
37
37
  "Remove a webhook and its deliveries after a preview.",
38
38
  { kind: "two-phase", run: [webhooks, "runWebhooksRemove"] },
39
39
  ],
40
40
  [
41
- "webhooks redeliver (<delivery-id> --expected-revision <revision> [--command-id <id>] [--dry-run] | --confirm-stdin)",
41
+ "webhooks redeliver (<delivery-id> --expected-revision <revision> [--command-id <id>] [--dry-run | --yes] | --confirm-stdin)",
42
42
  1,
43
43
  ["webhooks.change.preview", "webhooks.change.confirm"],
44
44
  "Send a delivery again after a preview.",
@@ -25,8 +25,9 @@ the CLI only reads and requests changes. Confirm each command on
25
25
  (outcome unknown), run `maia receipt show <command-id>` before any retry,
26
26
  and retry with the same id.
27
27
  5. A change to an existing Session carries its current
28
- `--expected-revision <revision>`. Exit code 75 also covers a full or held
29
- Node and guard limits, so read `error.code` first. For `revision_conflict`
28
+ `--expected-revision <revision>`; `session start` and `session turn send`
29
+ read it when none is named. Exit code 75 also covers a full or held Node
30
+ and guard limits, so read `error.code` first. For `revision_conflict`
30
31
  or `storage_conflict`, read the Session again and retry at its current
31
32
  revision only if it is idle and the change still applies; else observe or
32
33
  report. For `saturated`, `held` or `guard_*`, wait or report; never raise a
@@ -52,7 +53,11 @@ filters to Sessions that need attention.
52
53
  These work from a source build only. Use them when the caller accepts that.
53
54
 
54
55
  ```sh
55
- maia --json session start <session-id> --expected-revision <revision> --wait
56
+ maia --json session placement show --harness <executor-id>
57
+ maia --json session spawn <session-id> --harness <executor-id> --workspace <workspace-id> --to-node <name> --yes
58
+ maia --json session stop <session-id> --expected-revision <revision> --children
59
+ maia --json session reconcile <session-id>
60
+ maia --json session start <session-id> --wait
56
61
  maia --json session wait <session-id> --until running --timeout 5m
57
62
  maia --json session turn queue <session-id>
58
63
  maia --json session approval list --session <session-id>
@@ -61,6 +66,35 @@ maia --json session approval list --session <session-id>
61
66
  Send prompt text on stdin with `--prompt-stdin`, never on the command line.
62
67
  Exit code 74 means a wait reached its deadline.
63
68
 
69
+ `session placement show` asks every Node (or the one `--node` names) whether it
70
+ can take a Session of an executor: `ready`, `login`, `reason` and capacity. A
71
+ Node that is not ready also sends `refusal`, the limit as fields: `code`, and
72
+ where they apply `saturation`, `resource`, `measured` and `required`. Match on
73
+ those, never on `reason`. A
74
+ Node that did not answer is `unknown`, never ready. Maia never places a Session
75
+ for you: read the answers, pick one Node, and pass `--node <name>` to
76
+ `session create`. A create on a Node without the executor signed in is refused
77
+ with the reason, and no other Node takes it instead.
78
+
79
+ `session spawn` starts a child of one of your Sessions on any executor and any
80
+ Node, after a preview (`--dry-run` shows it, `--yes` confirms). The child never
81
+ holds more host authority or a wider permission mode than its parent; a wider
82
+ request is refused with `session_spawn_wider` (exit 77), and nothing is
83
+ created. `session stop --children` stops the parent, then its running children
84
+ on every Node; a child on a Node that did not answer is named with its error,
85
+ never counted as stopped. A child on another Node that stays silent past the
86
+ 12 s deadline is marked orphaned on the parent's Node (`session show` lists
87
+ it); `session resume` refuses it with `session_child_orphaned` until
88
+ `session reconcile <parent-session-id>` reaches its Node and stops it.
89
+
90
+ Each Node caps spawned children: depth 3, fan-out 8 and 4 live children per
91
+ parent by default, counted across every Node. The next child past a cap is
92
+ refused with `spawn_depth_exceeded`, `spawn_fan_out_exceeded` (exit 70) or
93
+ `spawn_concurrency_exceeded` (exit 75, retry once a child ends).
94
+ `session spawn-caps show` prints the caps; only a person raises them, with
95
+ `session spawn-caps set` and its confirmation. Never ask to raise a cap to fit
96
+ your plan: split the work or wait for a child to end.
97
+
64
98
  ## Do not
65
99
 
66
100
  - `session observe` is one snapshot and exits 0. To watch a Session, re-run it
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maiaos/cli",
3
- "version": "0.1.0-canary.63",
3
+ "version": "0.1.0-canary.65",
4
4
  "description": "The maia CLI and MCP server: start, drive, observe and stop swarms of Claude Code and Codex agents from a terminal, a script or another agent.",
5
5
  "keywords": [
6
6
  "maia",
@@ -24,6 +24,7 @@
24
24
  "url": "git+https://github.com/vllnt/maia.git",
25
25
  "directory": "apps/cli"
26
26
  },
27
+ "license": "MIT",
27
28
  "type": "module",
28
29
  "sideEffects": false,
29
30
  "types": "./dist/index.d.ts",
@@ -57,16 +58,16 @@
57
58
  "devDependencies": {
58
59
  "@types/node": "24.13.3",
59
60
  "@typescript/native": "npm:typescript@7.0.2",
60
- "@vllnt/typescript": "2.0.0-canary.a1749e0",
61
+ "@vllnt/typescript": "3.0.1",
61
62
  "eslint": "9.39.5",
62
63
  "typescript": "npm:@typescript/typescript6@6.0.2"
63
64
  },
64
65
  "dependencies": {
65
66
  "@earendil-works/pi-tui": "1.0.0",
66
67
  "@effect/platform-node-shared": "4.0.0",
67
- "@maiaos/agent": "0.1.0-canary.63",
68
- "@maiaos/client-core": "0.1.0-canary.63",
69
- "@maiaos/sdk": "0.1.0-canary.63",
68
+ "@maiaos/agent": "0.1.0-canary.65",
69
+ "@maiaos/client-core": "0.1.0-canary.65",
70
+ "@maiaos/sdk": "0.1.0-canary.65",
70
71
  "effect": "4.0.0"
71
72
  },
72
73
  "scripts": {
@@ -1,2 +0,0 @@
1
- export const LOCAL_NODE = "local";
2
- //# sourceMappingURL=context.js.map