@evalops/maestro 0.10.23 → 0.10.25

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 (376) hide show
  1. package/README.md +4 -4
  2. package/dist/agent/agent.d.ts +2 -2
  3. package/dist/agent/agent.d.ts.map +1 -1
  4. package/dist/agent/agent.js +1 -1
  5. package/dist/agent/agent.js.map +1 -1
  6. package/dist/agent/keys.d.ts +2 -5
  7. package/dist/agent/keys.d.ts.map +1 -1
  8. package/dist/agent/keys.js +4 -5
  9. package/dist/agent/keys.js.map +1 -1
  10. package/dist/agent/modes.d.ts +2 -2
  11. package/dist/agent/modes.d.ts.map +1 -1
  12. package/dist/agent/modes.js +6 -7
  13. package/dist/agent/modes.js.map +1 -1
  14. package/dist/agent/providers/anthropic.d.ts.map +1 -1
  15. package/dist/agent/providers/anthropic.js +4 -4
  16. package/dist/agent/providers/anthropic.js.map +1 -1
  17. package/dist/agent/providers/google.js +1 -1
  18. package/dist/agent/swarm/executor.d.ts +2 -0
  19. package/dist/agent/swarm/executor.d.ts.map +1 -1
  20. package/dist/agent/swarm/executor.js +208 -35
  21. package/dist/agent/swarm/executor.js.map +1 -1
  22. package/dist/agent/swarm/types.d.ts +2 -0
  23. package/dist/agent/swarm/types.d.ts.map +1 -1
  24. package/dist/agent/swarm/types.js.map +1 -1
  25. package/dist/agent/tool-capability-types.d.ts +36 -0
  26. package/dist/agent/tool-capability-types.d.ts.map +1 -0
  27. package/dist/agent/tool-capability-types.js +2 -0
  28. package/dist/agent/tool-capability-types.js.map +1 -0
  29. package/dist/agent/transport/tool-execution-bridge.d.ts +13 -0
  30. package/dist/agent/transport/tool-execution-bridge.d.ts.map +1 -1
  31. package/dist/agent/transport/tool-execution-bridge.js +28 -15
  32. package/dist/agent/transport/tool-execution-bridge.js.map +1 -1
  33. package/dist/agent/transport/transport-utils.d.ts.map +1 -1
  34. package/dist/agent/transport/transport-utils.js +2 -3
  35. package/dist/agent/transport/transport-utils.js.map +1 -1
  36. package/dist/agent/transport.js +1 -1
  37. package/dist/agent/transport.js.map +1 -1
  38. package/dist/agent/type-guards.d.ts +1 -1
  39. package/dist/agent/type-guards.js +1 -1
  40. package/dist/agent/type-guards.js.map +1 -1
  41. package/dist/agent/types.d.ts +5 -3
  42. package/dist/agent/types.d.ts.map +1 -1
  43. package/dist/agent/types.js +2 -2
  44. package/dist/agent/types.js.map +1 -1
  45. package/dist/app-server/daemon-lifecycle-api.d.ts +31 -0
  46. package/dist/app-server/daemon-lifecycle-api.d.ts.map +1 -0
  47. package/dist/app-server/daemon-lifecycle-api.js +259 -0
  48. package/dist/app-server/daemon-lifecycle-api.js.map +1 -0
  49. package/dist/app-server/external-agent-import-api.d.ts +30 -0
  50. package/dist/app-server/external-agent-import-api.d.ts.map +1 -0
  51. package/dist/app-server/external-agent-import-api.js +553 -0
  52. package/dist/app-server/external-agent-import-api.js.map +1 -0
  53. package/dist/app-server/host-control-api.d.ts +30 -0
  54. package/dist/app-server/host-control-api.d.ts.map +1 -0
  55. package/dist/app-server/host-control-api.js +343 -0
  56. package/dist/app-server/host-control-api.js.map +1 -0
  57. package/dist/app-server/in-process-client.d.ts +2 -2
  58. package/dist/app-server/in-process-client.d.ts.map +1 -1
  59. package/dist/app-server/in-process-client.js.map +1 -1
  60. package/dist/app-server/network-governance-api.d.ts +26 -0
  61. package/dist/app-server/network-governance-api.d.ts.map +1 -0
  62. package/dist/app-server/network-governance-api.js +476 -0
  63. package/dist/app-server/network-governance-api.js.map +1 -0
  64. package/dist/app-server/plugin-bundle-api.d.ts +17 -0
  65. package/dist/app-server/plugin-bundle-api.d.ts.map +1 -0
  66. package/dist/app-server/plugin-bundle-api.js +219 -0
  67. package/dist/app-server/plugin-bundle-api.js.map +1 -0
  68. package/dist/app-server/policy-control-api.d.ts +14 -0
  69. package/dist/app-server/policy-control-api.d.ts.map +1 -0
  70. package/dist/app-server/policy-control-api.js +200 -0
  71. package/dist/app-server/policy-control-api.js.map +1 -0
  72. package/dist/app-server/protocol-modes-api.d.ts +22 -0
  73. package/dist/app-server/protocol-modes-api.d.ts.map +1 -0
  74. package/dist/app-server/protocol-modes-api.js +124 -0
  75. package/dist/app-server/protocol-modes-api.js.map +1 -0
  76. package/dist/app-server/sandbox-proof-api.d.ts +21 -0
  77. package/dist/app-server/sandbox-proof-api.d.ts.map +1 -0
  78. package/dist/app-server/sandbox-proof-api.js +127 -0
  79. package/dist/app-server/sandbox-proof-api.js.map +1 -0
  80. package/dist/app-server/session-api.d.ts +93 -3
  81. package/dist/app-server/session-api.d.ts.map +1 -1
  82. package/dist/app-server/session-api.js +706 -18
  83. package/dist/app-server/session-api.js.map +1 -1
  84. package/dist/audit/logger.d.ts +1 -1
  85. package/dist/bootstrap/auth-setup.d.ts.map +1 -1
  86. package/dist/bootstrap/auth-setup.js +17 -2
  87. package/dist/bootstrap/auth-setup.js.map +1 -1
  88. package/dist/bootstrap/model-resolution-setup.d.ts.map +1 -1
  89. package/dist/bootstrap/model-resolution-setup.js +19 -4
  90. package/dist/bootstrap/model-resolution-setup.js.map +1 -1
  91. package/dist/cli/args.d.ts +2 -2
  92. package/dist/cli/args.d.ts.map +1 -1
  93. package/dist/cli/args.js +2 -2
  94. package/dist/cli/args.js.map +1 -1
  95. package/dist/cli/commands/a2a.d.ts.map +1 -1
  96. package/dist/cli/commands/a2a.js +226 -14
  97. package/dist/cli/commands/a2a.js.map +1 -1
  98. package/dist/cli/commands/anthropic.d.ts +1 -1
  99. package/dist/cli/commands/anthropic.d.ts.map +1 -1
  100. package/dist/cli/commands/anthropic.js +3 -68
  101. package/dist/cli/commands/anthropic.js.map +1 -1
  102. package/dist/cli/commands/modes.js +1 -1
  103. package/dist/cli/commands/modes.js.map +1 -1
  104. package/dist/cli/help.d.ts.map +1 -1
  105. package/dist/cli/help.js +5 -7
  106. package/dist/cli/help.js.map +1 -1
  107. package/dist/cli/rpc-mode.d.ts +1 -1
  108. package/dist/cli/rpc-mode.js +1 -1
  109. package/dist/cli/rpc-mode.js.map +1 -1
  110. package/dist/cli/session.js +1 -1
  111. package/dist/cli/session.js.map +1 -1
  112. package/dist/cli-tui/commands/command-catalog.d.ts.map +1 -1
  113. package/dist/cli-tui/commands/command-catalog.js +7 -12
  114. package/dist/cli-tui/commands/command-catalog.js.map +1 -1
  115. package/dist/cli-tui/commands/subcommands/auth-commands.d.ts +1 -1
  116. package/dist/cli-tui/commands/subcommands/auth-commands.d.ts.map +1 -1
  117. package/dist/cli-tui/commands/subcommands/auth-commands.js +4 -12
  118. package/dist/cli-tui/commands/subcommands/auth-commands.js.map +1 -1
  119. package/dist/cli-tui/custom-editor.d.ts +1 -1
  120. package/dist/cli-tui/custom-editor.js +2 -2
  121. package/dist/cli-tui/custom-editor.js.map +1 -1
  122. package/dist/cli-tui/oauth/oauth-flow-controller.d.ts.map +1 -1
  123. package/dist/cli-tui/oauth/oauth-flow-controller.js +19 -23
  124. package/dist/cli-tui/oauth/oauth-flow-controller.js.map +1 -1
  125. package/dist/cli-tui/selectors/model-selector.d.ts.map +1 -1
  126. package/dist/cli-tui/selectors/model-selector.js +0 -1
  127. package/dist/cli-tui/selectors/model-selector.js.map +1 -1
  128. package/dist/cli-tui/selectors/oauth-selector-view.d.ts +2 -2
  129. package/dist/cli-tui/selectors/oauth-selector-view.d.ts.map +1 -1
  130. package/dist/cli-tui/selectors/oauth-selector-view.js.map +1 -1
  131. package/dist/cli-tui/selectors/oauth-selector.d.ts +2 -2
  132. package/dist/cli-tui/selectors/oauth-selector.d.ts.map +1 -1
  133. package/dist/cli-tui/selectors/oauth-selector.js +3 -4
  134. package/dist/cli-tui/selectors/oauth-selector.js.map +1 -1
  135. package/dist/cli-tui/tui-renderer/mcp-events-setup.js +1 -1
  136. package/dist/cli-tui/tui-renderer/mcp-events-setup.js.map +1 -1
  137. package/dist/cli-tui/tui-renderer.js +2 -2
  138. package/dist/cli-tui/tui-renderer.js.map +1 -1
  139. package/dist/cli-tui/utils/footer-utils.d.ts +1 -1
  140. package/dist/cli-tui/utils/footer-utils.js +1 -1
  141. package/dist/cli-tui/utils/footer-utils.js.map +1 -1
  142. package/dist/cli.js +15156 -14232
  143. package/dist/commands/prompts.d.ts +1 -1
  144. package/dist/commands/prompts.js +1 -1
  145. package/dist/commands/prompts.js.map +1 -1
  146. package/dist/config/constants.d.ts +2 -2
  147. package/dist/config/constants.d.ts.map +1 -1
  148. package/dist/config/constants.js +2 -2
  149. package/dist/config/constants.js.map +1 -1
  150. package/dist/config/index.d.ts +1 -1
  151. package/dist/config/index.js +1 -1
  152. package/dist/config/index.js.map +1 -1
  153. package/dist/config/toml-config.js +3 -3
  154. package/dist/config/toml-config.js.map +1 -1
  155. package/dist/db/client.d.ts +2 -2
  156. package/dist/db/client.js +2 -2
  157. package/dist/db/client.js.map +1 -1
  158. package/dist/db/migrate.d.ts +1 -1
  159. package/dist/db/migrate.js +1 -1
  160. package/dist/db/migrate.js.map +1 -1
  161. package/dist/db/schema.d.ts +2 -2
  162. package/dist/db/schema.js +1 -1
  163. package/dist/db/schema.js.map +1 -1
  164. package/dist/errors/index.d.ts +2 -2
  165. package/dist/errors/index.js +2 -2
  166. package/dist/errors/index.js.map +1 -1
  167. package/dist/main.d.ts +4 -5
  168. package/dist/main.d.ts.map +1 -1
  169. package/dist/main.js +17 -14
  170. package/dist/main.js.map +1 -1
  171. package/dist/mcp/config.d.ts +15 -2
  172. package/dist/mcp/config.d.ts.map +1 -1
  173. package/dist/mcp/config.js +50 -26
  174. package/dist/mcp/config.js.map +1 -1
  175. package/dist/mcp/fathom-cua.d.ts.map +1 -1
  176. package/dist/mcp/fathom-cua.js +10 -0
  177. package/dist/mcp/fathom-cua.js.map +1 -1
  178. package/dist/mcp/manager.d.ts.map +1 -1
  179. package/dist/mcp/manager.js +32 -1
  180. package/dist/mcp/manager.js.map +1 -1
  181. package/dist/mcp/tool-bridge.d.ts.map +1 -1
  182. package/dist/mcp/tool-bridge.js +12 -3
  183. package/dist/mcp/tool-bridge.js.map +1 -1
  184. package/dist/mcp/tool-capabilities.d.ts +5 -0
  185. package/dist/mcp/tool-capabilities.d.ts.map +1 -0
  186. package/dist/mcp/tool-capabilities.js +271 -0
  187. package/dist/mcp/tool-capabilities.js.map +1 -0
  188. package/dist/mcp/types.d.ts +6 -1
  189. package/dist/mcp/types.d.ts.map +1 -1
  190. package/dist/mcp/types.js.map +1 -1
  191. package/dist/models/config-loader.d.ts +1 -1
  192. package/dist/models/factory-integration.d.ts +1 -1
  193. package/dist/models/factory-integration.js +1 -1
  194. package/dist/models/factory-integration.js.map +1 -1
  195. package/dist/node_modules/@evalops/contracts/dist/index.d.ts +3 -3
  196. package/dist/node_modules/@evalops/contracts/dist/index.js +2 -2
  197. package/dist/node_modules/@evalops/contracts/dist/index.js.map +1 -1
  198. package/dist/node_modules/@evalops/contracts/dist/maestro-app-server.d.ts +1182 -14
  199. package/dist/node_modules/@evalops/contracts/dist/maestro-app-server.d.ts.map +1 -1
  200. package/dist/node_modules/@evalops/contracts/dist/maestro-app-server.js +450 -1
  201. package/dist/node_modules/@evalops/contracts/dist/maestro-app-server.js.map +1 -1
  202. package/dist/node_modules/@evalops/contracts/package.json +1 -1
  203. package/dist/node_modules/@evalops/tui/package.json +1 -1
  204. package/dist/oauth/connectors.d.ts +2 -2
  205. package/dist/oauth/connectors.d.ts.map +1 -1
  206. package/dist/oauth/connectors.js +3 -5
  207. package/dist/oauth/connectors.js.map +1 -1
  208. package/dist/oauth/github-copilot.d.ts +1 -1
  209. package/dist/oauth/github-copilot.js +1 -1
  210. package/dist/oauth/github-copilot.js.map +1 -1
  211. package/dist/oauth/index.d.ts +10 -8
  212. package/dist/oauth/index.d.ts.map +1 -1
  213. package/dist/oauth/index.js +54 -31
  214. package/dist/oauth/index.js.map +1 -1
  215. package/dist/oauth/openai.d.ts +1 -1
  216. package/dist/oauth/openai.js +2 -2
  217. package/dist/oauth/openai.js.map +1 -1
  218. package/dist/platform/a2a-completion-audit.d.ts +41 -0
  219. package/dist/platform/a2a-completion-audit.d.ts.map +1 -0
  220. package/dist/platform/a2a-completion-audit.js +177 -0
  221. package/dist/platform/a2a-completion-audit.js.map +1 -0
  222. package/dist/platform/a2a-task-ledger.d.ts.map +1 -1
  223. package/dist/platform/a2a-task-ledger.js +17 -0
  224. package/dist/platform/a2a-task-ledger.js.map +1 -1
  225. package/dist/platform/a2a-telemetry-inspect.d.ts +58 -0
  226. package/dist/platform/a2a-telemetry-inspect.d.ts.map +1 -0
  227. package/dist/platform/a2a-telemetry-inspect.js +224 -0
  228. package/dist/platform/a2a-telemetry-inspect.js.map +1 -0
  229. package/dist/platform/agent-registry-client.d.ts +8 -0
  230. package/dist/platform/agent-registry-client.d.ts.map +1 -1
  231. package/dist/platform/agent-registry-client.js +9 -1
  232. package/dist/platform/agent-registry-client.js.map +1 -1
  233. package/dist/providers/api-keys.d.ts +2 -2
  234. package/dist/providers/api-keys.js +2 -2
  235. package/dist/providers/api-keys.js.map +1 -1
  236. package/dist/providers/auth.d.ts +3 -6
  237. package/dist/providers/auth.d.ts.map +1 -1
  238. package/dist/providers/auth.js +1 -40
  239. package/dist/providers/auth.js.map +1 -1
  240. package/dist/rpc/index.d.ts +2 -2
  241. package/dist/rpc/index.js +2 -2
  242. package/dist/rpc/index.js.map +1 -1
  243. package/dist/rpc/rpc-types.d.ts +1 -1
  244. package/dist/rpc/rpc-types.js +1 -1
  245. package/dist/rpc/rpc-types.js.map +1 -1
  246. package/dist/safety/nested-agent-guard.js +1 -1
  247. package/dist/safety/nested-agent-guard.js.map +1 -1
  248. package/dist/safety/policy.d.ts +2 -2
  249. package/dist/safety/policy.js +2 -2
  250. package/dist/safety/policy.js.map +1 -1
  251. package/dist/safety/validators/network-policy-validator.d.ts +8 -0
  252. package/dist/safety/validators/network-policy-validator.d.ts.map +1 -1
  253. package/dist/safety/validators/network-policy-validator.js +29 -4
  254. package/dist/safety/validators/network-policy-validator.js.map +1 -1
  255. package/dist/sandbox/local-sandbox.d.ts +1 -1
  256. package/dist/sandbox/local-sandbox.js +1 -1
  257. package/dist/sandbox/local-sandbox.js.map +1 -1
  258. package/dist/server/app-context.d.ts +2 -0
  259. package/dist/server/app-context.d.ts.map +1 -1
  260. package/dist/server/app-context.js.map +1 -1
  261. package/dist/server/handlers/attachments.d.ts.map +1 -1
  262. package/dist/server/handlers/attachments.js +1 -0
  263. package/dist/server/handlers/attachments.js.map +1 -1
  264. package/dist/server/handlers/models.d.ts.map +1 -1
  265. package/dist/server/handlers/models.js +3 -1
  266. package/dist/server/handlers/models.js.map +1 -1
  267. package/dist/server/handlers/session-attachments.d.ts.map +1 -1
  268. package/dist/server/handlers/session-attachments.js +2 -0
  269. package/dist/server/handlers/session-attachments.js.map +1 -1
  270. package/dist/server/handlers/sessions.js +1 -1
  271. package/dist/server/handlers/sessions.js.map +1 -1
  272. package/dist/server/handlers/status.d.ts +2 -0
  273. package/dist/server/handlers/status.d.ts.map +1 -1
  274. package/dist/server/handlers/status.js +3 -2
  275. package/dist/server/handlers/status.js.map +1 -1
  276. package/dist/server/headless-runtime-service.d.ts.map +1 -1
  277. package/dist/server/headless-runtime-service.js +32 -3
  278. package/dist/server/headless-runtime-service.js.map +1 -1
  279. package/dist/server/hosted-session-manager.d.ts +2 -0
  280. package/dist/server/hosted-session-manager.d.ts.map +1 -1
  281. package/dist/server/hosted-session-manager.js +9 -0
  282. package/dist/server/hosted-session-manager.js.map +1 -1
  283. package/dist/server/model-selection.d.ts.map +1 -1
  284. package/dist/server/model-selection.js +9 -1
  285. package/dist/server/model-selection.js.map +1 -1
  286. package/dist/server/rate-limiter.d.ts +1 -1
  287. package/dist/server/rate-limiter.js +1 -1
  288. package/dist/server/rate-limiter.js.map +1 -1
  289. package/dist/server/router.d.ts +2 -2
  290. package/dist/server/router.js.map +1 -1
  291. package/dist/server/session-serialization.d.ts +9 -9
  292. package/dist/server/session-serialization.js +15 -15
  293. package/dist/server/session-serialization.js.map +1 -1
  294. package/dist/session/manager.d.ts +5 -0
  295. package/dist/session/manager.d.ts.map +1 -1
  296. package/dist/session/manager.js +56 -8
  297. package/dist/session/manager.js.map +1 -1
  298. package/dist/session/session-catalog.d.ts +2 -0
  299. package/dist/session/session-catalog.d.ts.map +1 -1
  300. package/dist/session/session-catalog.js +6 -0
  301. package/dist/session/session-catalog.js.map +1 -1
  302. package/dist/session/session-context.d.ts +2 -0
  303. package/dist/session/session-context.d.ts.map +1 -1
  304. package/dist/session/session-context.js +15 -0
  305. package/dist/session/session-context.js.map +1 -1
  306. package/dist/session/types.d.ts +7 -0
  307. package/dist/session/types.d.ts.map +1 -1
  308. package/dist/session/types.js.map +1 -1
  309. package/dist/session/wire-format.generated.d.ts +1 -0
  310. package/dist/session/wire-format.generated.d.ts.map +1 -1
  311. package/dist/session/wire-format.generated.js +1 -0
  312. package/dist/session/wire-format.generated.js.map +1 -1
  313. package/dist/shared-memory/contract.d.ts +4 -4
  314. package/dist/shared-memory/contract.js +2 -2
  315. package/dist/shared-memory/contract.js.map +1 -1
  316. package/dist/telemetry/index.d.ts +2 -2
  317. package/dist/telemetry/index.d.ts.map +1 -1
  318. package/dist/telemetry/index.js +2 -2
  319. package/dist/telemetry/index.js.map +1 -1
  320. package/dist/telemetry/maestro-event-bus.d.ts +57 -0
  321. package/dist/telemetry/maestro-event-bus.d.ts.map +1 -1
  322. package/dist/telemetry/maestro-event-bus.js +59 -1
  323. package/dist/telemetry/maestro-event-bus.js.map +1 -1
  324. package/dist/telemetry/maestro-event-catalog.d.ts +17 -1
  325. package/dist/telemetry/maestro-event-catalog.d.ts.map +1 -1
  326. package/dist/telemetry/maestro-event-catalog.js +24 -0
  327. package/dist/telemetry/maestro-event-catalog.js.map +1 -1
  328. package/dist/telemetry/mcp-beacon.d.ts +2 -0
  329. package/dist/telemetry/mcp-beacon.d.ts.map +1 -1
  330. package/dist/telemetry/mcp-beacon.js +15 -0
  331. package/dist/telemetry/mcp-beacon.js.map +1 -1
  332. package/dist/telemetry/metrics.d.ts +62 -0
  333. package/dist/telemetry/metrics.d.ts.map +1 -1
  334. package/dist/telemetry/metrics.js +84 -0
  335. package/dist/telemetry/metrics.js.map +1 -1
  336. package/dist/telemetry.d.ts +44 -0
  337. package/dist/telemetry.d.ts.map +1 -1
  338. package/dist/telemetry.js +84 -2
  339. package/dist/telemetry.js.map +1 -1
  340. package/dist/theme/theme-loader.js +2 -2
  341. package/dist/theme/theme-loader.js.map +1 -1
  342. package/dist/theme/theme-schema.json +2 -2
  343. package/dist/theme/theme.d.ts +1 -1
  344. package/dist/theme/theme.js.map +1 -1
  345. package/dist/tools/background/task-types.d.ts +1 -1
  346. package/dist/tools/extract-document.d.ts +1 -0
  347. package/dist/tools/extract-document.d.ts.map +1 -1
  348. package/dist/tools/extract-document.js +2 -1
  349. package/dist/tools/extract-document.js.map +1 -1
  350. package/dist/tools/index.d.ts +55 -55
  351. package/dist/tools/index.js +1 -1
  352. package/dist/tools/index.js.map +1 -1
  353. package/dist/tools/tool-dsl.d.ts +1 -1
  354. package/dist/tools/tool-dsl.js +1 -1
  355. package/dist/tools/tool-dsl.js.map +1 -1
  356. package/dist/utils/document-extractor.d.ts +1 -0
  357. package/dist/utils/document-extractor.d.ts.map +1 -1
  358. package/dist/utils/document-extractor.js +320 -40
  359. package/dist/utils/document-extractor.js.map +1 -1
  360. package/dist/utils/logger.d.ts +1 -1
  361. package/dist/utils/logger.js +1 -1
  362. package/dist/utils/logger.js.map +1 -1
  363. package/dist/version.json +2 -2
  364. package/dist/web-server.d.ts +1 -1
  365. package/dist/web-server.d.ts.map +1 -1
  366. package/dist/web-server.js +12 -8
  367. package/dist/web-server.js.map +1 -1
  368. package/package.json +4 -2
  369. package/dist/oauth/anthropic.d.ts +0 -17
  370. package/dist/oauth/anthropic.d.ts.map +0 -1
  371. package/dist/oauth/anthropic.js +0 -81
  372. package/dist/oauth/anthropic.js.map +0 -1
  373. package/dist/providers/anthropic-auth.d.ts +0 -75
  374. package/dist/providers/anthropic-auth.d.ts.map +0 -1
  375. package/dist/providers/anthropic-auth.js +0 -221
  376. package/dist/providers/anthropic-auth.js.map +0 -1
@@ -1,2 +1,2 @@
1
- export declare function handleAnthropicCommand(subcommand?: string, params?: string[]): Promise<void>;
1
+ export declare function handleAnthropicCommand(): Promise<void>;
2
2
  //# sourceMappingURL=anthropic.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"anthropic.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/anthropic.ts"],"names":[],"mappings":"AAmBA,wBAAsB,sBAAsB,CAC3C,UAAU,CAAC,EAAE,MAAM,EACnB,MAAM,GAAE,MAAM,EAAO,GACnB,OAAO,CAAC,IAAI,CAAC,CAmBf"}
1
+ {"version":3,"file":"anthropic.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/anthropic.ts"],"names":[],"mappings":"AAEA,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC,CAO5D"}
@@ -1,71 +1,6 @@
1
- import { stdin, stdout } from "node:process";
2
- import { createInterface } from "node:readline/promises";
3
1
  import chalk from "chalk";
4
- import { CLAUDE_CODE_BETA_HEADER, deleteAnthropicOAuthCredential, exchangeAnthropicAuthorizationCode, generateAnthropicLoginUrl, getFreshAnthropicOAuthCredential, getStoredAnthropicOAuthCredential, saveAnthropicOAuthCredential, } from "../../providers/anthropic-auth.js";
5
- function parseMode(value) {
6
- if (!value)
7
- return "pro";
8
- return value === "console" ? "console" : "pro";
9
- }
10
- export async function handleAnthropicCommand(subcommand, params = []) {
11
- switch (subcommand) {
12
- case "login":
13
- await handleLogin(parseMode(params[0]));
14
- return;
15
- case "logout":
16
- await handleLogout();
17
- return;
18
- case "status":
19
- await handleStatus();
20
- return;
21
- default:
22
- console.error(chalk.red('Unknown anthropic subcommand. Try "maestro anthropic login", "logout", or "status".'));
23
- process.exit(1);
24
- }
25
- }
26
- async function handleLogin(mode) {
27
- console.log(chalk.bold("Maestro Claude Code login"));
28
- const { url, verifier } = await generateAnthropicLoginUrl(mode);
29
- console.log(chalk.gray(url));
30
- const rl = createInterface({ input: stdin, output: stdout });
31
- const code = (await rl.question("2. Paste the code shown in the browser: "))?.trim();
32
- rl.close();
33
- if (!code) {
34
- console.error(chalk.red("Authorization code is required."));
35
- process.exit(1);
36
- }
37
- const tokens = await exchangeAnthropicAuthorizationCode(code, verifier);
38
- if (!tokens) {
39
- console.error(chalk.red("Failed to exchange the authorization code. Please try again."));
40
- process.exit(1);
41
- }
42
- await saveAnthropicOAuthCredential({
43
- accessToken: tokens.accessToken,
44
- refreshToken: tokens.refreshToken,
45
- expiresAt: tokens.expiresAt,
46
- mode,
47
- });
48
- console.log(chalk.green("Claude Code credentials saved."));
49
- console.log(chalk.dim("Future runs can use --auth claude or set it as default. Credentials refresh automatically."));
50
- }
51
- async function handleLogout() {
52
- await deleteAnthropicOAuthCredential();
53
- console.log(chalk.green("Removed stored Claude Code credentials."));
54
- }
55
- async function handleStatus() {
56
- const stored = await getStoredAnthropicOAuthCredential();
57
- if (!stored) {
58
- console.log(chalk.yellow("No stored Claude Code credentials."));
59
- console.log(chalk.dim('Run "maestro anthropic login" to link a Claude Pro/Max subscription.'));
60
- return;
61
- }
62
- const remainingMs = Math.max(0, stored.expiresAt - Date.now());
63
- const minutes = Math.round(remainingMs / 60000);
64
- console.log(chalk.green("Stored Claude Code credentials detected."));
65
- console.log(chalk.dim(`Access token expires in ~${minutes} minute${minutes === 1 ? "" : "s"} (auto-refresh enabled).`));
66
- const fresh = await getFreshAnthropicOAuthCredential();
67
- if (fresh) {
68
- console.log(chalk.dim(`Beta headers applied: ${CLAUDE_CODE_BETA_HEADER}`));
69
- }
2
+ export async function handleAnthropicCommand() {
3
+ console.error(chalk.red("Anthropic OAuth login has been removed. Set ANTHROPIC_API_KEY to use Anthropic models, or run `maestro codex login` for the default Codex flow."));
4
+ process.exit(1);
70
5
  }
71
6
  //# sourceMappingURL=anthropic.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"anthropic.js","sourceRoot":"","sources":["../../../src/cli/commands/anthropic.ts"],"names":[],"mappings":"AAAA,OAAO,E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C,MAAM,EAAE,CAAC;QACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,oCAAoC,CAAC,CAAC,CAAC;QAChE,OAAO,CAAC,GAAG,CACV,KAAK,CAAC,GAAG,CACR,sEAAsE,CACtE,CACD,CAAC;QACF,OAAO;IACR,CAAC;IACD,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAC/D,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,CAAC;IAChD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAC,CAAC;IACrE,OAAO,CAAC,GAAG,CACV,KAAK,CAAC,GAAG,CACR,4BAA4B,OAAO,UAAU,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,0BAA0B,CAC/F,CACD,CAAC;IACF,MAAM,KAAK,GAAG,MAAM,gCAAgC,EAAE,CAAC;IACvD,IAAI,KAAK,EAAE,CAAC;QACX,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,yBAAyB,uBAAuB,EAAE,CAAC,CAAC,CAAC;IAC5E,CAAC;AACF,CAAC","sourcesContent":["import { stdin, stdout } from \"node:process\";\nimport { createInterface } from \"node:readline/promises\";\nimport chalk from \"chalk\";\nimport {\n\ttype AnthropicLoginMode,\n\tCLAUDE_CODE_BETA_HEADER,\n\tdeleteAnthropicOAuthCredential,\n\texchangeAnthropicAuthorizationCode,\n\tgenerateAnthropicLoginUrl,\n\tgetFreshAnthropicOAuthCredential,\n\tgetStoredAnthropicOAuthCredential,\n\tsaveAnthropicOAuthCredential,\n} from \"../../providers/anthropic-auth.js\";\n\nfunction parseMode(value?: string): AnthropicLoginMode {\n\tif (!value) return \"pro\";\n\treturn value === \"console\" ? \"console\" : \"pro\";\n}\n\nexport async function handleAnthropicCommand(\n\tsubcommand?: string,\n\tparams: string[] = [],\n): Promise<void> {\n\tswitch (subcommand) {\n\t\tcase \"login\":\n\t\t\tawait handleLogin(parseMode(params[0]));\n\t\t\treturn;\n\t\tcase \"logout\":\n\t\t\tawait handleLogout();\n\t\t\treturn;\n\t\tcase \"status\":\n\t\t\tawait handleStatus();\n\t\t\treturn;\n\t\tdefault:\n\t\t\tconsole.error(\n\t\t\t\tchalk.red(\n\t\t\t\t\t'Unknown anthropic subcommand. Try \"maestro anthropic login\", \"logout\", or \"status\".',\n\t\t\t\t),\n\t\t\t);\n\t\t\tprocess.exit(1);\n\t}\n}\n\nasync function handleLogin(mode: AnthropicLoginMode): Promise<void> {\n\tconsole.log(chalk.bold(\"Maestro Claude Code login\"));\n\tconst { url, verifier } = await generateAnthropicLoginUrl(mode);\n\tconsole.log(chalk.gray(url));\n\tconst rl = createInterface({ input: stdin, output: stdout });\n\tconst code = (\n\t\tawait rl.question(\"2. Paste the code shown in the browser: \")\n\t)?.trim();\n\trl.close();\n\tif (!code) {\n\t\tconsole.error(chalk.red(\"Authorization code is required.\"));\n\t\tprocess.exit(1);\n\t}\n\tconst tokens = await exchangeAnthropicAuthorizationCode(code, verifier);\n\tif (!tokens) {\n\t\tconsole.error(\n\t\t\tchalk.red(\"Failed to exchange the authorization code. Please try again.\"),\n\t\t);\n\t\tprocess.exit(1);\n\t}\n\tawait saveAnthropicOAuthCredential({\n\t\taccessToken: tokens.accessToken,\n\t\trefreshToken: tokens.refreshToken,\n\t\texpiresAt: tokens.expiresAt,\n\t\tmode,\n\t});\n\tconsole.log(chalk.green(\"Claude Code credentials saved.\"));\n\tconsole.log(\n\t\tchalk.dim(\n\t\t\t\"Future runs can use --auth claude or set it as default. Credentials refresh automatically.\",\n\t\t),\n\t);\n}\n\nasync function handleLogout(): Promise<void> {\n\tawait deleteAnthropicOAuthCredential();\n\tconsole.log(chalk.green(\"Removed stored Claude Code credentials.\"));\n}\n\nasync function handleStatus(): Promise<void> {\n\tconst stored = await getStoredAnthropicOAuthCredential();\n\tif (!stored) {\n\t\tconsole.log(chalk.yellow(\"No stored Claude Code credentials.\"));\n\t\tconsole.log(\n\t\t\tchalk.dim(\n\t\t\t\t'Run \"maestro anthropic login\" to link a Claude Pro/Max subscription.',\n\t\t\t),\n\t\t);\n\t\treturn;\n\t}\n\tconst remainingMs = Math.max(0, stored.expiresAt - Date.now());\n\tconst minutes = Math.round(remainingMs / 60000);\n\tconsole.log(chalk.green(\"Stored Claude Code credentials detected.\"));\n\tconsole.log(\n\t\tchalk.dim(\n\t\t\t`Access token expires in ~${minutes} minute${minutes === 1 ? \"\" : \"s\"} (auto-refresh enabled).`,\n\t\t),\n\t);\n\tconst fresh = await getFreshAnthropicOAuthCredential();\n\tif (fresh) {\n\t\tconsole.log(chalk.dim(`Beta headers applied: ${CLAUDE_CODE_BETA_HEADER}`));\n\t}\n}\n"]}
1
+ {"version":3,"file":"anthropic.js","sourceRoot":"","sources":["../../../src/cli/commands/anthropic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,CAAC,KAAK,UAAU,sBAAsB;IAC3C,OAAO,CAAC,KAAK,CACZ,KAAK,CAAC,GAAG,CACR,iJAAiJ,CACjJ,CACD,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC","sourcesContent":["import chalk from \"chalk\";\n\nexport async function handleAnthropicCommand(): Promise<void> {\n\tconsole.error(\n\t\tchalk.red(\n\t\t\t\"Anthropic OAuth login has been removed. Set ANTHROPIC_API_KEY to use Anthropic models, or run `maestro codex login` for the default Codex flow.\",\n\t\t),\n\t);\n\tprocess.exit(1);\n}\n"]}
@@ -10,7 +10,7 @@ const PROVIDERS = [
10
10
  ];
11
11
  function parseProvider(provider) {
12
12
  if (!provider) {
13
- return "anthropic";
13
+ return "openai-codex";
14
14
  }
15
15
  if (PROVIDERS.includes(provider)) {
16
16
  return provider;
@@ -1 +1 @@
1
- {"version":3,"file":"modes.js","sourceRoot":"","sources":["../../../src/cli/commands/modes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAIN,WAAW,EACX,aAAa,EACb,eAAe,EACf,eAAe,EACf,SAAS,EACT,uBAAuB,GACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,cAAc,GAEd,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AAErE,MAAM,SAAS,GAAoB;IAClC,WAAW;IACX,QAAQ;IACR,cAAc;IACd,QAAQ;CACR,CAAC;AA0CF,SAAS,aAAa,CAAC,QAA4B;IAClD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACf,OAAO,WAAW,CAAC;IACpB,CAAC;IACD,IAAI,SAAS,CAAC,QAAQ,CAAC,QAAyB,CAAC,EAAE,CAAC;QACnD,OAAO,QAAyB,CAAC;IAClC,CAAC;IACD,MAAM,IAAI,KAAK,CACd,qBAAqB,QAAQ,2BAA2B,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC9E,CAAC;AACH,CAAC;AAED,SAAS,gBAAgB;IACxB,OAAO,MAAM,CAAC,IAAI,CAAC,cAAc,CAAmB,CAAC;AACtD,CAAC;AAED,SAAS,oBAAoB,CAC5B,IAAe,EACf,QAAuB;IAEvB,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IACnC,OAAO;QACN,IAAI;QACJ,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,OAAO,EAAE;YACR,IAAI,EAAE,MAAM,CAAC,WAAW;YACxB,QAAQ;YACR,KAAK,EAAE,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC;SACtC;QACD,QAAQ,EAAE;YACT,IAAI,EAAE,MAAM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,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;QAC1B,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;QACnC,MAAM,+BAA+B,CAAC,kBAAkB,EAAE;YACzD,SAAS,EAAE,QAAQ,IAAI,EAAE;YACzB,WAAW,EAAE,MAAM;YACnB,KAAK,EAAE,MAAM,CAAC,YAAY;YAC1B,MAAM,EAAE,oBAAoB;SAC5B,CAAC,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QAClB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAClD,OAAO;IACR,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,WAAW,CAAC,CAAC,CAAC;AACjD,CAAC","sourcesContent":["import chalk from \"chalk\";\nimport {\n\ttype AgentMode,\n\ttype ModelProvider,\n\ttype ResolvedSubagentDispatch,\n\tgetAllModes,\n\tgetModeConfig,\n\tgetModelForMode,\n\tgetModelForTier,\n\tparseMode,\n\tresolveSubagentDispatch,\n} from \"../../agent/modes.js\";\nimport {\n\tSUBAGENT_SPECS,\n\ttype SubagentType,\n} from \"../../agent/subagent-specs.js\";\nimport { recordStagedRolloutSurfaceUsage } from \"../../telemetry.js\";\n\nconst PROVIDERS: ModelProvider[] = [\n\t\"anthropic\",\n\t\"openai\",\n\t\"openai-codex\",\n\t\"google\",\n];\n\ntype ModeCommandOptions = {\n\tprovider?: string;\n\tjson?: boolean;\n\tincludeHidden?: boolean;\n};\n\ntype ModeDescription = {\n\tmode: AgentMode;\n\tdisplayName: string;\n\tdescription: string;\n\tvisible: boolean;\n\tprimary: {\n\t\ttier: string;\n\t\tprovider: ModelProvider;\n\t\tmodel: string;\n\t};\n\tfallback: {\n\t\ttier: string;\n\t\tprovider: ModelProvider;\n\t\tmodel: string;\n\t};\n\treasoningEffort: string;\n\tthinking: {\n\t\tenabled: boolean;\n\t\tbudget: number;\n\t};\n\tcontext: {\n\t\textended: boolean;\n\t};\n\tretries: number;\n\tcostMultiplier: number;\n\tspeedHint: number;\n\tsubagents: Array<\n\t\tResolvedSubagentDispatch & {\n\t\t\tdisplayName: string;\n\t\t\tdescription: string;\n\t\t}\n\t>;\n};\n\nfunction parseProvider(provider: string | undefined): ModelProvider {\n\tif (!provider) {\n\t\treturn \"anthropic\";\n\t}\n\tif (PROVIDERS.includes(provider as ModelProvider)) {\n\t\treturn provider as ModelProvider;\n\t}\n\tthrow new Error(\n\t\t`Unknown provider \"${provider}\". Supported providers: ${PROVIDERS.join(\", \")}`,\n\t);\n}\n\nfunction allSubagentTypes(): SubagentType[] {\n\treturn Object.keys(SUBAGENT_SPECS) as SubagentType[];\n}\n\nfunction buildModeDescription(\n\tmode: AgentMode,\n\tprovider: ModelProvider,\n): ModeDescription {\n\tconst config = getModeConfig(mode);\n\treturn {\n\t\tmode,\n\t\tdisplayName: config.displayName,\n\t\tdescription: config.description,\n\t\tvisible: config.visible,\n\t\tprimary: {\n\t\t\ttier: config.primaryTier,\n\t\t\tprovider,\n\t\t\tmodel: getModelForMode(mode, provider),\n\t\t},\n\t\tfallback: {\n\t\t\ttier: config.fallbackTier,\n\t\t\tprovider,\n\t\t\tmodel: getModelForTier(config.fallbackTier, provider),\n\t\t},\n\t\treasoningEffort:\n\t\t\tconfig.reasoningEffort ?? (config.enableThinking ? \"medium\" : \"low\"),\n\t\tthinking: {\n\t\t\tenabled: config.enableThinking,\n\t\t\tbudget: config.thinkingBudget,\n\t\t},\n\t\tcontext: {\n\t\t\textended: config.useExtendedContext,\n\t\t},\n\t\tretries: config.maxRetries,\n\t\tcostMultiplier: config.costMultiplier,\n\t\tspeedHint: config.speedHint,\n\t\tsubagents: allSubagentTypes().map((type) => {\n\t\t\tconst dispatch = resolveSubagentDispatch(mode, type, provider);\n\t\t\tconst spec = SUBAGENT_SPECS[type];\n\t\t\treturn {\n\t\t\t\t...dispatch,\n\t\t\t\tdisplayName: spec.displayName,\n\t\t\t\tdescription: spec.description,\n\t\t\t};\n\t\t}),\n\t};\n}\n\nfunction pad(value: string, width: number): string {\n\treturn value.length >= width ? value : value.padEnd(width);\n}\n\nfunction renderModeDescription(description: ModeDescription): string {\n\tconst visibility = description.visible ? \"visible\" : \"hidden\";\n\tconst lines = [\n\t\t`Mode: ${description.displayName} (${description.mode})`,\n\t\tdescription.description,\n\t\t\"\",\n\t\t`Visibility: ${visibility}`,\n\t\t`Primary: ${description.primary.tier} -> ${description.primary.provider}/${description.primary.model}`,\n\t\t`Fallback: ${description.fallback.tier} -> ${description.fallback.provider}/${description.fallback.model}`,\n\t\t`Reasoning: ${description.reasoningEffort}`,\n\t\t`Thinking: ${description.thinking.enabled ? \"enabled\" : \"disabled\"} (budget ${description.thinking.budget})`,\n\t\t`Context: ${description.context.extended ? \"extended\" : \"standard\"}`,\n\t\t`Retries: ${description.retries}`,\n\t\t\"\",\n\t\t`Subagent dispatch (provider: ${description.primary.provider})`,\n\t\t`${pad(\"Type\", 12)} ${pad(\"Source\", 8)} ${pad(\"Provider\", 14)} ${pad(\"Model\", 34)} ${pad(\"Effort\", 8)} Tier`,\n\t\t`${\"-\".repeat(12)} ${\"-\".repeat(8)} ${\"-\".repeat(14)} ${\"-\".repeat(34)} ${\"-\".repeat(8)} ${\"-\".repeat(8)}`,\n\t];\n\n\tfor (const dispatch of description.subagents) {\n\t\tlines.push(\n\t\t\t[\n\t\t\t\tpad(dispatch.type, 12),\n\t\t\t\tpad(dispatch.source, 8),\n\t\t\t\tpad(dispatch.provider, 14),\n\t\t\t\tpad(dispatch.model, 34),\n\t\t\t\tpad(dispatch.reasoningEffort, 8),\n\t\t\t\tdispatch.modelTier ?? \"-\",\n\t\t\t].join(\" \"),\n\t\t);\n\t}\n\n\treturn lines.join(\"\\n\");\n}\n\nfunction renderModesList(includeHidden: boolean): string {\n\tconst lines = [\"Agent modes:\", \"\"];\n\tfor (const { mode, config } of getAllModes({ includeHidden })) {\n\t\tconst hiddenSuffix = config.visible === false ? \" [hidden]\" : \"\";\n\t\tlines.push(`${mode}${hiddenSuffix}`);\n\t\tlines.push(` ${config.description}`);\n\t\tlines.push(` describe: maestro modes describe ${mode}`);\n\t}\n\treturn lines.join(\"\\n\");\n}\n\nfunction usage(): string {\n\treturn [\n\t\t\"Usage:\",\n\t\t\" maestro modes list\",\n\t\t\" maestro modes describe <mode> [--provider <provider>] [--json]\",\n\t\t\"\",\n\t\t\"Examples:\",\n\t\t\" maestro modes describe smart\",\n\t\t\" maestro modes describe frontier --provider openai --json\",\n\t].join(\"\\n\");\n}\n\nexport async function handleModesCommand(\n\tsubcommand: string | undefined,\n\tmessages: string[] = [],\n\toptions: ModeCommandOptions = {},\n): Promise<void> {\n\tconst provider = parseProvider(options.provider);\n\tconst command = subcommand ?? \"list\";\n\n\tif (command === \"help\" || command === \"--help\" || command === \"-h\") {\n\t\tconsole.log(usage());\n\t\treturn;\n\t}\n\n\tif (command === \"list\") {\n\t\tconsole.log(renderModesList(options.includeHidden === true));\n\t\treturn;\n\t}\n\n\tconst modeName = command === \"describe\" ? messages[0] : command;\n\tconst mode = modeName ? parseMode(modeName) : null;\n\tif (!mode) {\n\t\tconst suffix = modeName ? `: ${modeName}` : \"\";\n\t\tconsole.error(chalk.red(`Unknown mode${suffix}`));\n\t\tconsole.log(chalk.dim(usage()));\n\t\tprocess.exit(1);\n\t}\n\n\tconst description = buildModeDescription(mode, provider);\n\tif (!description.visible) {\n\t\tconst config = getModeConfig(mode);\n\t\tawait recordStagedRolloutSurfaceUsage(\"hidden_mode_used\", {\n\t\t\tsurfaceId: `mode:${mode}`,\n\t\t\tsurfaceType: \"mode\",\n\t\t\towner: config.rolloutOwner,\n\t\t\tsource: \"cli:modes:describe\",\n\t\t});\n\t}\n\n\tif (options.json) {\n\t\tconsole.log(JSON.stringify(description, null, 2));\n\t\treturn;\n\t}\n\n\tconsole.log(renderModeDescription(description));\n}\n"]}
1
+ {"version":3,"file":"modes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C1B,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;QACnC,MAAM,+BAA+B,CAAC,kBAAkB,EAAE;YACzD,SAAS,EAAE,QAAQ,IAAI,EAAE;YACzB,WAAW,EAAE,MAAM;YACnB,KAAK,EAAE,MAAM,CAAC,YAAY;YAC1B,MAAM,EAAE,oBAAoB;SAC5B,CAAC,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QAClB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAClD,OAAO;IACR,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,WAAW,CAAC,CAAC,CAAC;AACjD,CAAC","sourcesContent":["import chalk from \"chalk\";\nimport {\n\ttype AgentMode,\n\ttype ModelProvider,\n\ttype ResolvedSubagentDispatch,\n\tgetAllModes,\n\tgetModeConfig,\n\tgetModelForMode,\n\tgetModelForTier,\n\tparseMode,\n\tresolveSubagentDispatch,\n} from \"../../agent/modes.js\";\nimport {\n\tSUBAGENT_SPECS,\n\ttype SubagentType,\n} from \"../../agent/subagent-specs.js\";\nimport { recordStagedRolloutSurfaceUsage } from \"../../telemetry.js\";\n\nconst PROVIDERS: ModelProvider[] = [\n\t\"anthropic\",\n\t\"openai\",\n\t\"openai-codex\",\n\t\"google\",\n];\n\ntype ModeCommandOptions = {\n\tprovider?: string;\n\tjson?: boolean;\n\tincludeHidden?: boolean;\n};\n\ntype ModeDescription = {\n\tmode: AgentMode;\n\tdisplayName: string;\n\tdescription: string;\n\tvisible: boolean;\n\tprimary: {\n\t\ttier: string;\n\t\tprovider: ModelProvider;\n\t\tmodel: string;\n\t};\n\tfallback: {\n\t\ttier: string;\n\t\tprovider: ModelProvider;\n\t\tmodel: string;\n\t};\n\treasoningEffort: string;\n\tthinking: {\n\t\tenabled: boolean;\n\t\tbudget: number;\n\t};\n\tcontext: {\n\t\textended: boolean;\n\t};\n\tretries: number;\n\tcostMultiplier: number;\n\tspeedHint: number;\n\tsubagents: Array<\n\t\tResolvedSubagentDispatch & {\n\t\t\tdisplayName: string;\n\t\t\tdescription: string;\n\t\t}\n\t>;\n};\n\nfunction parseProvider(provider: string | undefined): ModelProvider {\n\tif (!provider) {\n\t\treturn \"openai-codex\";\n\t}\n\tif (PROVIDERS.includes(provider as ModelProvider)) {\n\t\treturn provider as ModelProvider;\n\t}\n\tthrow new Error(\n\t\t`Unknown provider \"${provider}\". Supported providers: ${PROVIDERS.join(\", \")}`,\n\t);\n}\n\nfunction allSubagentTypes(): SubagentType[] {\n\treturn Object.keys(SUBAGENT_SPECS) as SubagentType[];\n}\n\nfunction buildModeDescription(\n\tmode: AgentMode,\n\tprovider: ModelProvider,\n): ModeDescription {\n\tconst config = getModeConfig(mode);\n\treturn {\n\t\tmode,\n\t\tdisplayName: config.displayName,\n\t\tdescription: config.description,\n\t\tvisible: config.visible,\n\t\tprimary: {\n\t\t\ttier: config.primaryTier,\n\t\t\tprovider,\n\t\t\tmodel: getModelForMode(mode, provider),\n\t\t},\n\t\tfallback: {\n\t\t\ttier: config.fallbackTier,\n\t\t\tprovider,\n\t\t\tmodel: getModelForTier(config.fallbackTier, provider),\n\t\t},\n\t\treasoningEffort:\n\t\t\tconfig.reasoningEffort ?? (config.enableThinking ? \"medium\" : \"low\"),\n\t\tthinking: {\n\t\t\tenabled: config.enableThinking,\n\t\t\tbudget: config.thinkingBudget,\n\t\t},\n\t\tcontext: {\n\t\t\textended: config.useExtendedContext,\n\t\t},\n\t\tretries: config.maxRetries,\n\t\tcostMultiplier: config.costMultiplier,\n\t\tspeedHint: config.speedHint,\n\t\tsubagents: allSubagentTypes().map((type) => {\n\t\t\tconst dispatch = resolveSubagentDispatch(mode, type, provider);\n\t\t\tconst spec = SUBAGENT_SPECS[type];\n\t\t\treturn {\n\t\t\t\t...dispatch,\n\t\t\t\tdisplayName: spec.displayName,\n\t\t\t\tdescription: spec.description,\n\t\t\t};\n\t\t}),\n\t};\n}\n\nfunction pad(value: string, width: number): string {\n\treturn value.length >= width ? value : value.padEnd(width);\n}\n\nfunction renderModeDescription(description: ModeDescription): string {\n\tconst visibility = description.visible ? \"visible\" : \"hidden\";\n\tconst lines = [\n\t\t`Mode: ${description.displayName} (${description.mode})`,\n\t\tdescription.description,\n\t\t\"\",\n\t\t`Visibility: ${visibility}`,\n\t\t`Primary: ${description.primary.tier} -> ${description.primary.provider}/${description.primary.model}`,\n\t\t`Fallback: ${description.fallback.tier} -> ${description.fallback.provider}/${description.fallback.model}`,\n\t\t`Reasoning: ${description.reasoningEffort}`,\n\t\t`Thinking: ${description.thinking.enabled ? \"enabled\" : \"disabled\"} (budget ${description.thinking.budget})`,\n\t\t`Context: ${description.context.extended ? \"extended\" : \"standard\"}`,\n\t\t`Retries: ${description.retries}`,\n\t\t\"\",\n\t\t`Subagent dispatch (provider: ${description.primary.provider})`,\n\t\t`${pad(\"Type\", 12)} ${pad(\"Source\", 8)} ${pad(\"Provider\", 14)} ${pad(\"Model\", 34)} ${pad(\"Effort\", 8)} Tier`,\n\t\t`${\"-\".repeat(12)} ${\"-\".repeat(8)} ${\"-\".repeat(14)} ${\"-\".repeat(34)} ${\"-\".repeat(8)} ${\"-\".repeat(8)}`,\n\t];\n\n\tfor (const dispatch of description.subagents) {\n\t\tlines.push(\n\t\t\t[\n\t\t\t\tpad(dispatch.type, 12),\n\t\t\t\tpad(dispatch.source, 8),\n\t\t\t\tpad(dispatch.provider, 14),\n\t\t\t\tpad(dispatch.model, 34),\n\t\t\t\tpad(dispatch.reasoningEffort, 8),\n\t\t\t\tdispatch.modelTier ?? \"-\",\n\t\t\t].join(\" \"),\n\t\t);\n\t}\n\n\treturn lines.join(\"\\n\");\n}\n\nfunction renderModesList(includeHidden: boolean): string {\n\tconst lines = [\"Agent modes:\", \"\"];\n\tfor (const { mode, config } of getAllModes({ includeHidden })) {\n\t\tconst hiddenSuffix = config.visible === false ? \" [hidden]\" : \"\";\n\t\tlines.push(`${mode}${hiddenSuffix}`);\n\t\tlines.push(` ${config.description}`);\n\t\tlines.push(` describe: maestro modes describe ${mode}`);\n\t}\n\treturn lines.join(\"\\n\");\n}\n\nfunction usage(): string {\n\treturn [\n\t\t\"Usage:\",\n\t\t\" maestro modes list\",\n\t\t\" maestro modes describe <mode> [--provider <provider>] [--json]\",\n\t\t\"\",\n\t\t\"Examples:\",\n\t\t\" maestro modes describe smart\",\n\t\t\" maestro modes describe frontier --provider openai --json\",\n\t].join(\"\\n\");\n}\n\nexport async function handleModesCommand(\n\tsubcommand: string | undefined,\n\tmessages: string[] = [],\n\toptions: ModeCommandOptions = {},\n): Promise<void> {\n\tconst provider = parseProvider(options.provider);\n\tconst command = subcommand ?? \"list\";\n\n\tif (command === \"help\" || command === \"--help\" || command === \"-h\") {\n\t\tconsole.log(usage());\n\t\treturn;\n\t}\n\n\tif (command === \"list\") {\n\t\tconsole.log(renderModesList(options.includeHidden === true));\n\t\treturn;\n\t}\n\n\tconst modeName = command === \"describe\" ? messages[0] : command;\n\tconst mode = modeName ? parseMode(modeName) : null;\n\tif (!mode) {\n\t\tconst suffix = modeName ? `: ${modeName}` : \"\";\n\t\tconsole.error(chalk.red(`Unknown mode${suffix}`));\n\t\tconsole.log(chalk.dim(usage()));\n\t\tprocess.exit(1);\n\t}\n\n\tconst description = buildModeDescription(mode, provider);\n\tif (!description.visible) {\n\t\tconst config = getModeConfig(mode);\n\t\tawait recordStagedRolloutSurfaceUsage(\"hidden_mode_used\", {\n\t\t\tsurfaceId: `mode:${mode}`,\n\t\t\tsurfaceType: \"mode\",\n\t\t\towner: config.rolloutOwner,\n\t\t\tsource: \"cli:modes:describe\",\n\t\t});\n\t}\n\n\tif (options.json) {\n\t\tconsole.log(JSON.stringify(description, null, 2));\n\t\treturn;\n\t}\n\n\tconsole.log(renderModeDescription(description));\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"AAyFA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,SAAS,CACxB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;IAAE,aAAa,CAAC,EAAE,OAAO,CAAA;CAAE,QAwRrC"}
1
+ {"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"AAyFA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,SAAS,CACxB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;IAAE,aAAa,CAAC,EAAE,OAAO,CAAA;CAAE,QAsRrC"}
package/dist/cli/help.js CHANGED
@@ -23,8 +23,8 @@
23
23
  */
24
24
  import { badge, heading, muted, sectionHeading } from "../style/theme.js";
25
25
  const CLI_OPTIONS = [
26
- { text: "--provider <name> Provider name (default: anthropic)" },
27
- { text: "-m, --model <id> Model ID (default: claude-sonnet-4-5)" },
26
+ { text: "--provider <name> Provider name (default: openai-codex)" },
27
+ { text: "-m, --model <id> Model ID (default: gpt-5.5)" },
28
28
  { text: "--task-budget <tokens> API-side Anthropic task budget in tokens" },
29
29
  {
30
30
  text: "--models <patterns> Comma-separated patterns for Ctrl+P model cycling",
@@ -41,7 +41,7 @@ const CLI_OPTIONS = [
41
41
  },
42
42
  { text: "--mode <mode> Output mode: text (default), json, or rpc" },
43
43
  {
44
- text: "--auth <mode> Credential mode: auto (default), api-key, claude",
44
+ text: "--auth <mode> Credential mode: auto (default), api-key",
45
45
  },
46
46
  {
47
47
  text: "--approval-mode <mode> Action approvals: prompt (default in TUI), auto, fail",
@@ -107,7 +107,7 @@ export function printHelp(version, options) {
107
107
  const hiddenSupportSection = includeHidden
108
108
  ? `${sectionHeading("Hidden Support Flags")}${muted(" Hidden flags are external support surfaces. Keep them in docs/CONVENTIONS/staged-rollout-registry.json with an owner, telemetry event, and promotion/removal target.")}`
109
109
  : null;
110
- const examples = `${sectionHeading("Examples")}${muted(` # Interactive mode (no messages = interactive TUI)
110
+ const examples = `${sectionHeading("Examples")}${muted(` # Interactive mode (defaults to openai-codex/gpt-5.5 after \`maestro codex login\`)
111
111
  maestro
112
112
 
113
113
  # Single message
@@ -122,7 +122,7 @@ export function printHelp(version, options) {
122
122
  # Use different model
123
123
  maestro --provider openai --model gpt-4o-mini "Help me refactor this code"
124
124
 
125
- # Use Codex subscription models after \`maestro codex login\`
125
+ # Use Codex subscription models explicitly
126
126
  maestro --provider openai-codex --model gpt-5.5 "Plan this migration"
127
127
  maestro codex doctor
128
128
 
@@ -191,8 +191,6 @@ export function printHelp(version, options) {
191
191
  OPENAI_CODEX_TOKEN - OpenAI Codex ChatGPT access token
192
192
  OPENAI_CODEX_ACCOUNT_ID - ChatGPT account id when using a raw Codex token
193
193
  ANTHROPIC_API_KEY - Anthropic API key
194
- CLAUDE_CODE_TOKEN - Claude Code access token for --auth claude
195
- ANTHROPIC_OAUTH_TOKEN - Alternate env for Claude Code bearer tokens
196
194
  MAESTRO_AGENT_DIR - Session storage directory (default: ~/.maestro/agent)
197
195
  MAESTRO_SANDBOX_MODE - Sandbox mode: read-only, workspace-write, danger-full-access
198
196
  MAESTRO_CHANGELOG - Set to off/false/hide/hidden/skip/0 to hide startup changelog banner
@@ -1 +1 @@
1
- {"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAO1E,MAAM,WAAW,GAAoB;IACpC,EAAE,IAAI,EAAE,4DAA4D,EAAE;IACtE,EAAE,IAAI,EAAE,+DAA+D,EAAE;IACzE,EAAE,IAAI,EAAE,iEAAiE,EAAE;IAC3E;QACC,IAAI,EAAE,2EAA2E;KACjF;IACD;QACC,IAAI,EAAE,4FAA4F;KAClG;IACD,EAAE,IAAI,EAAE,wDAAwD,EAAE;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YAAY;QACZ,aAAa;QACb,YAAY;QACZ,WAAW;QACX,UAAU;QACV,aAAa;QACb,qBAAqB;QACrB,mBAAmB;QACnB,eAAe;QACf,iBAAiB;QACjB,GAAG,cAAc,CAAC,MAAM,CAAC,GAAG,KAAK,CAChC,cAAc,EACd,qBAAqB,EACrB,MAAM,CACN,EAAE;QACH,gBAAgB;QAChB,KAAK;KACL;SACC,MAAM,CAAC,CAAC,OAAO,EAAqB,EAAE,CAAC,OAAO,KAAK,IAAI,CAAC;SACxD,IAAI,CAAC,MAAM,CAAC,CACd,CAAC;AACH,CAAC","sourcesContent":["/**\n * @fileoverview CLI Help Output Module\n *\n * This module generates and displays the `--help` output for the Maestro CLI.\n * It provides a comprehensive overview of:\n *\n * - **Usage syntax** and common invocation patterns\n * - **Command-line options** for provider, model, session management, etc.\n * - **Environment variables** for API keys and configuration\n * - **Available tools** and their capabilities\n * - **Subcommands** like `maestro exec` for headless execution\n * - **Session management** commands and workflows\n *\n * ## Styling\n *\n * The output uses the application's theme system for consistent terminal styling:\n * - `heading()` - Main title styling\n * - `sectionHeading()` - Section headers\n * - `muted()` - De-emphasized text for descriptions\n * - `badge()` - Highlighted tips and hints\n *\n * @module cli/help\n */\nimport { badge, heading, muted, sectionHeading } from \"../style/theme.js\";\n\ninterface CliHelpOption {\n\ttext: string;\n\thidden?: boolean;\n}\n\nconst CLI_OPTIONS: CliHelpOption[] = [\n\t{ text: \"--provider <name> Provider name (default: anthropic)\" },\n\t{ text: \"-m, --model <id> Model ID (default: claude-sonnet-4-5)\" },\n\t{ text: \"--task-budget <tokens> API-side Anthropic task budget in tokens\" },\n\t{\n\t\ttext: \"--models <patterns> Comma-separated patterns for Ctrl+P model cycling\",\n\t},\n\t{\n\t\ttext: \"--tools <names> Comma-separated tool names to enable (e.g., read,search,list,find)\",\n\t},\n\t{ text: \"--api-key <key> API key (defaults to env vars)\" },\n\t{\n\t\ttext: \"--system-prompt <text> System prompt (default: coding assistant prompt)\",\n\t},\n\t{\n\t\ttext: \"--append-system-prompt <text> Append instructions to the system prompt\",\n\t},\n\t{ text: \"--mode <mode> Output mode: text (default), json, or rpc\" },\n\t{\n\t\ttext: \"--auth <mode> Credential mode: auto (default), api-key, claude\",\n\t},\n\t{\n\t\ttext: \"--approval-mode <mode> Action approvals: prompt (default in TUI), auto, fail\",\n\t},\n\t{\n\t\ttext: \"--sandbox <mode> Sandbox mode: read-only, workspace-write, danger-full-access, native, docker, local, none\",\n\t},\n\t{\n\t\ttext: \"--port <n> Port for `maestro web` (defaults to PORT env or 8080)\",\n\t},\n\t{ text: \"--continue, -c Continue previous session\" },\n\t{ text: \"--resume, -r Select a session to resume\" },\n\t{ text: \"--session <path> Use specific session file\" },\n\t{ text: \"--no-session Don't save session (ephemeral)\" },\n\t{ text: \"--safe-mode Enable extra safety restrictions\" },\n\t{\n\t\ttext: \"--replay <path|uri> Open a scripted deterministic replay session\",\n\t},\n\t{\n\t\ttext: \"--record-scenario <path> Record assistant turns as a replay fixture\",\n\t},\n\t{ text: \"--help, -h Show this help\" },\n\t{\n\t\ttext: \"--help-hidden Show hidden support and staged-rollout flags\",\n\t\thidden: true,\n\t},\n\t{\n\t\ttext: \"--list-modes-all List visible and hidden agent modes\",\n\t\thidden: true,\n\t},\n];\n\nfunction renderHelpOptions(options: CliHelpOption[], includeHidden: boolean) {\n\treturn options\n\t\t.filter((option) => includeHidden || option.hidden !== true)\n\t\t.map((option) => ` ${muted(option.text)}`)\n\t\t.join(\"\\n\");\n}\n\n/**\n * Prints the complete CLI help message to stdout.\n *\n * This function is invoked when the user runs `maestro --help` or `maestro -h`.\n * It formats and displays all available options, commands, and usage examples\n * using the terminal theme for consistent styling.\n *\n * @param version - The current Maestro version string (e.g., \"1.2.3\")\n *\n * @example\n * ```typescript\n * import { printHelp } from \"./help.js\";\n * import { version } from \"../../package.json\";\n *\n * if (args.includes(\"--help\")) {\n * printHelp(version);\n * process.exit(0);\n * }\n * ```\n */\nexport function printHelp(\n\tversion: string,\n\toptions?: { includeHidden?: boolean },\n) {\n\tconst includeHidden = options?.includeHidden === true;\n\tconst header = `${heading(\"Maestro\")} ${muted(\n\t\t`v${version} by EvalOps — AI coding assistant with read, list, search, diff, bash, edit, write, todo tools`,\n\t)}`;\n\tconst usage = `${sectionHeading(\"Usage\")}${muted(\n\t\t\"maestro [options] [messages...]\",\n\t)}`;\n\tconst renderedOptions = `${sectionHeading(\"Options\")}${renderHelpOptions(\n\t\tCLI_OPTIONS,\n\t\tincludeHidden,\n\t)}`;\n\tconst hiddenSupportSection = includeHidden\n\t\t? `${sectionHeading(\"Hidden Support Flags\")}${muted(\n\t\t\t\t\" Hidden flags are external support surfaces. Keep them in docs/CONVENTIONS/staged-rollout-registry.json with an owner, telemetry event, and promotion/removal target.\",\n\t\t\t)}`\n\t\t: null;\n\tconst examples = `${sectionHeading(\"Examples\")}${muted(\n\t\t` # Interactive mode (no messages = interactive TUI)\n maestro\n\n # Single message\n maestro \"List all .ts files in src/\"\n\n # Multiple messages\n maestro \"Read package.json\" \"What dependencies do we have?\"\n\n # Continue previous session\n maestro --continue \"What did we discuss?\"\n\n # Use different model\n maestro --provider openai --model gpt-4o-mini \"Help me refactor this code\"\n\n # Use Codex subscription models after \\`maestro codex login\\`\n maestro --provider openai-codex --model gpt-5.5 \"Plan this migration\"\n maestro codex doctor\n\n # Bootstrap EvalOps login, API key, and agent registration in one flow\n maestro init\n\n # Use EvalOps managed gateway models after \\`maestro init\\`\n maestro --provider evalops --model gpt-4o-mini \"Say hello in one sentence\"\n\n # Confirm managed mode sinks and EvalOps org identity\n maestro status\n\n # Inspect mode-level subagent model dispatch before running a swarm\n maestro modes describe smart\n\n # Explain which instruction files and MCP context sources are visible\n maestro context explain\n\n # Compare context sources between two workspaces\n maestro context diff ./before ./after\n\n # Include live MCP resources and prompts in context diagnostics\n maestro context explain --live-mcp\n\n # Export a portable session log\n maestro export <session-id> ./session.jsonl --format jsonl\n\n # Export a portable JSON archive with secret redaction\n maestro export <session-id> ./session.json --format json --redact-secrets\n\n # Import a portable session log into this workspace\n maestro import ./session.json\n\n # Scaffold and validate progressive skill packages\n maestro skill new processing-incidents --description \"Process incident reports. Use when the user asks for incident triage.\"\n maestro skill lint .maestro/skills\n\n # Start a hosted EvalOps runner session and wait for attach readiness\n maestro remote start --workspace ws_123 --repo evalops/foo --branch main --ttl 90m --wait --verify\n\n # Run a single-session hosted runtime pod entrypoint\n maestro hosted-runner --runner-session-id mrs_abc --workspace-root /workspace --listen 0.0.0.0:8080\n\n # Show usage analytics for the last 7 days\n maestro stats\n\n # Show usage analytics for one session\n maestro stats --session <session-id>\n\n # Reconstruct the timeline, trajectory, and evidence coverage for a saved run\n maestro run inspect <session-id> --json\n maestro run promote <session-id>\n\n # Validate and run a deterministic scenario fixture\n maestro scenario validate ./test/fixtures/agent-trajectory-scenarios/local-diagnostic-success.json\n maestro scenario run ./test/fixtures/agent-trajectory-scenarios/local-diagnostic-success.json --junit ./tmp/scenario.xml\n\n # Open a real agent session backed by a scripted model fixture\n maestro --replay ./test/fixtures/scripted-replay/basic-tool-call.json\n maestro --replay gs://evalops-prod-maestro-scenario-fixtures/maestro/scenarios/example.json\n\n # Record a live run into a replayable scripted scenario\n maestro --record-scenario ./tmp/recorded-scenario.json \"inspect package.json\"`,\n\t)}`;\n\tconst env = `${sectionHeading(\"Environment Variables:\")}${muted(\n\t\t` GEMINI_API_KEY - Google Gemini API key\n OPENAI_API_KEY - OpenAI API key\n OPENAI_CODEX_TOKEN - OpenAI Codex ChatGPT access token\n OPENAI_CODEX_ACCOUNT_ID - ChatGPT account id when using a raw Codex token\n ANTHROPIC_API_KEY - Anthropic API key\n CLAUDE_CODE_TOKEN - Claude Code access token for --auth claude\n ANTHROPIC_OAUTH_TOKEN - Alternate env for Claude Code bearer tokens\n MAESTRO_AGENT_DIR - Session storage directory (default: ~/.maestro/agent)\n MAESTRO_SANDBOX_MODE - Sandbox mode: read-only, workspace-write, danger-full-access\n MAESTRO_CHANGELOG - Set to off/false/hide/hidden/skip/0 to hide startup changelog banner\n MAESTRO_TUI_MINIMAL - Set to 1/true to disable animations and reduce TUI effects (SSH-friendly)\n MAESTRO_TUI_TOOL_MAX_CHARS - Max chars shown per tool output panel (0 = unlimited)\n MAESTRO_TUI_TOOL_MAX_LINES - Max lines shown per tool output panel (0 = unlimited)\n MAESTRO_MEMORY_BASE - Durable memory service base URL\n MAESTRO_MEMORY_ACCESS_TOKEN - Override bearer token for durable memory service\n MAESTRO_MEMORY_TEAM_ID - Optional team scope for durable memory service\n MAESTRO_SHARED_MEMORY_BASE - Shared memory base URL (Cloudflare Durable Objects worker)\n MAESTRO_SHARED_MEMORY_API_KEY - API key for shared memory service\n MAESTRO_REMOTE_RUNNER_URL - Hosted runner control-plane URL (default: https://runner.evalops.dev)\n MAESTRO_REMOTE_RUNNER_TOKEN - Hosted runner bearer token override\n MAESTRO_REMOTE_RUNNER_ORG_ID - EvalOps organization id for hosted runner sessions\n MAESTRO_REMOTE_RUNNER_WORKSPACE_ID - EvalOps workspace id for hosted runner sessions\n CODING_AGENT_DIR - Legacy session directory override (fallback)`,\n\t)}`;\n\tconst execSection = `${sectionHeading(\"maestro exec\")}${muted(\n\t\t` maestro exec \"Summarize recent changes\" --json\n\n Flags:\n --json Stream JSONL thread/turn events\n --output-schema <file|json> Validate final assistant JSON against a schema\n --output-last-message <path> Write the final assistant message to disk\n --full-auto | --read-only Force approval policy (auto or fail)\n --sandbox <mode> Run in sandbox: read-only, workspace-write, danger-full-access, native, docker, local, none\n --resume <sessionId> Resume a prior exec session by id\n --last Resume the most recent exec session`,\n\t)}`;\n\tconst webSection = `${sectionHeading(\"maestro web\")}${muted(\n\t\t` # Start the bundled web UI + API server\n maestro web\n\n # Use a custom port\n maestro web --port 3000`,\n\t)}`;\n\tconst portabilitySection = `${sectionHeading(\"Session Portability\")}${muted(\n\t\t` maestro export <session-id> [output-path] --format json|jsonl [--redact-secrets]\n maestro import <file.json|file.jsonl>\n\n Notes:\n - json preserves the full session in a portable wrapper object\n - jsonl preserves the append-only session log verbatim unless redaction is requested\n - --redact-secrets scrubs detected credentials from exported payloads\n - import restores the session into the current workspace session directory`,\n\t)}`;\n\tconst modesSection = `${sectionHeading(\"maestro modes\")}${muted(\n\t\t` maestro modes list\n maestro modes describe <mode> [--provider <provider>] [--json]\n\n Prints the mode primary/fallback model policy and resolved subagent dispatch\n table, including cross-provider overrides such as smart-mode coder lanes\n routed to openai-codex/gpt-5.5.`,\n\t)}`;\n\tconst memorySection = `${sectionHeading(\"maestro memory\")}${muted(\n\t\t` maestro memory [status] Show shared memory service status\n maestro memory session <id> Show per-session metrics\n maestro memory audit <id> [n] Show recent sync audit entries\n maestro memory export <id> Export metrics log as JSONL\n maestro memory watch [id] [ms] Poll status/metrics continuously`,\n\t)}`;\n\tconst skillSection = `${sectionHeading(\"maestro skill\")}${muted(\n\t\t` maestro skill list List available progressive skills\n maestro skill inspect <name> Print one skill package manifest\n maestro skill install <source> Validate and install an OSS skill package\n maestro skill publish-check <src> Validate an OSS skill package for publishing\n maestro skill new <name> Scaffold SKILL.md, reference/, scripts/, toolbox/, and mcp.json.example\n maestro skill lint [path...] Validate frontmatter, budget, mcp.json includeTools, and toolbox shape`,\n\t)}`;\n\tconst remoteSection = `${sectionHeading(\"maestro remote\")}${muted(\n\t\t` maestro remote start --workspace <id> --repo <repo> --branch <branch> [--ttl 90m] [--wait] [--verify]\n maestro remote list --workspace <id> [--state running]\n maestro remote attach <session-id> [--verify] [--print-env]\n maestro remote extend <session-id> --ttl 2h\n maestro remote stop <session-id> [--reason <text>]`,\n\t)}`;\n\tconst operatingPlaneSection = `${sectionHeading(\"maestro operating-plane\")}${muted(\n\t\t` maestro operating-plane status --thread-id <slack-thread> [--evidence-id <id>] [--auth-subject <subject>]\n maestro operating-plane status --trace-id <id> --json\n\n Fetches the Platform operating-plane ledger and prints a content-free value\n proof report with identity, model/tool/approval/trace/evidence/cost status,\n allowed evidence ids/revisions, blockers, next actions, and withheld reasons.`,\n\t)}`;\n\tconst runSection = `${sectionHeading(\"maestro run\")}${muted(\n\t\t` maestro run inspect <session-id> [--json]\n maestro run ledger <session-id>\n maestro run replay <session-id>\n maestro run promote <session-id>\n\n Reconstructs a saved session into a timeline plus canonical agent trajectory\n with prompt, tool, file-change, artifact, policy, diagnostic, compaction,\n pending-wait, and MCP-context coverage. The ledger/replay/promote commands\n expose the local AgentRuntime projection and dry-run Platform promotion plan.`,\n\t)}`;\n\tconst initSection = `${sectionHeading(\"maestro init\")}${muted(\n\t\t` maestro init Login, create or reuse an API key, and register this agent\n maestro init --rotate-key Replace the stored agent MCP API key\n maestro init --mcp-url <url> Override the EvalOps agent MCP endpoint\n maestro init --capability code:write Declare an agent-registry capability\n maestro init --json Emit machine-readable bootstrap output`,\n\t)}`;\n\tconst hostedRunnerSection = `${sectionHeading(\"maestro hosted-runner\")}${muted(\n\t\t` maestro hosted-runner --runner-session-id <id> --workspace-root <path> [--listen 0.0.0.0:8080]\n\n Env mode:\n MAESTRO_RUNNER_SESSION_ID=mrs_abc MAESTRO_WORKSPACE_ROOT=/workspace maestro hosted-runner`,\n\t)}`;\n\tconst sessionsSection = `${sectionHeading(\"Session Metadata\")}${muted(\n\t\t` /session favorite|unfavorite Toggle favorite for current session\n /session summary \"<text>\" Save a manual summary for current session\n /sessions summarize <id> Auto-summarize a saved session`,\n\t)}`;\n\tconst sessionsDiscovery = `${sectionHeading(\"Session Commands\")}${muted(\n\t\t` /session [info|favorite|unfavorite|summary \"<text>\"]\n /sessions [list|load <id>|favorite <id>|unfavorite <id>|summarize <id>]\n (Also available via TUI command palette)`,\n\t)}`;\n\tconst tools = `${sectionHeading(\"Available Tools\")}${muted(\n\t\t` read - Read file contents\n list - List files in a directory\n find - Fast file search using fd (glob patterns)\n search - Search files with ripgrep-style filtering\n parallel_ripgrep - Run multiple ripgrep patterns in parallel and merge line ranges\n diff - Show git diffs (workspace, staged, or ranges)\n bash - Execute bash commands\n edit - Edit files with find/replace\n write - Write files (creates/overwrites)\n todo - Create TodoWrite-style checklists\n\n Read-only tools: read,list,find,search,parallel_ripgrep,diff,status\n Example: maestro --tools read,list,find,search,parallel_ripgrep,diff \"Analyze this code\"`,\n\t)}`;\n\n\tconst frameworkSection = `${sectionHeading(\"Framework Preference\")}${muted(\n\t\t` /framework <id> Set default stack (fastapi, express, node)\n /framework <id> --workspace Set workspace-scoped default\n /framework list Show available options\n Precedence: policy (locked) > policy > env override > env default > workspace > user file > none`,\n\t)}`;\n\n\tconsole.log(\n\t\t[\n\t\t\theader,\n\t\t\tusage,\n\t\t\trenderedOptions,\n\t\t\thiddenSupportSection,\n\t\t\texamples,\n\t\t\tenv,\n\t\t\texecSection,\n\t\t\twebSection,\n\t\t\tportabilitySection,\n\t\t\tmodesSection,\n\t\t\tmemorySection,\n\t\t\tskillSection,\n\t\t\tinitSection,\n\t\t\trunSection,\n\t\t\tremoteSection,\n\t\t\toperatingPlaneSection,\n\t\t\thostedRunnerSection,\n\t\t\tsessionsSection,\n\t\t\tsessionsDiscovery,\n\t\t\t`${sectionHeading(\"Tips\")}${badge(\n\t\t\t\t\"Need models?\",\n\t\t\t\t\"maestro models list\",\n\t\t\t\t\"info\",\n\t\t\t)}`,\n\t\t\tframeworkSection,\n\t\t\ttools,\n\t\t]\n\t\t\t.filter((section): section is string => section !== null)\n\t\t\t.join(\"\\n\\n\"),\n\t);\n}\n"]}
1
+ {"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAO1E,MAAM,WAAW,GAAoB;IACpC,EAAE,IAAI,EAAE,+DAA+D,EAAE;IACzE,EAAE,IAAI,EAAE,qDAAqD,EAAE;IAC/D,EAAE,IAAI,EAAE,iEAAiE,EAAE;IAC3E;QACC,IAAI,EAAE,2EAA2E;KACjF;IACD;QACC,IAAI,EAAE,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R,GAAG;QACH,WAAW;QACX,UAAU;QACV,kBAAkB;QAClB,YAAY;QACZ,aAAa;QACb,YAAY;QACZ,WAAW;QACX,UAAU;QACV,aAAa;QACb,qBAAqB;QACrB,mBAAmB;QACnB,eAAe;QACf,iBAAiB;QACjB,GAAG,cAAc,CAAC,MAAM,CAAC,GAAG,KAAK,CAChC,cAAc,EACd,qBAAqB,EACrB,MAAM,CACN,EAAE;QACH,gBAAgB;QAChB,KAAK;KACL;SACC,MAAM,CAAC,CAAC,OAAO,EAAqB,EAAE,CAAC,OAAO,KAAK,IAAI,CAAC;SACxD,IAAI,CAAC,MAAM,CAAC,CACd,CAAC;AACH,CAAC","sourcesContent":["/**\n * @fileoverview CLI Help Output Module\n *\n * This module generates and displays the `--help` output for the Maestro CLI.\n * It provides a comprehensive overview of:\n *\n * - **Usage syntax** and common invocation patterns\n * - **Command-line options** for provider, model, session management, etc.\n * - **Environment variables** for API keys and configuration\n * - **Available tools** and their capabilities\n * - **Subcommands** like `maestro exec` for headless execution\n * - **Session management** commands and workflows\n *\n * ## Styling\n *\n * The output uses the application's theme system for consistent terminal styling:\n * - `heading()` - Main title styling\n * - `sectionHeading()` - Section headers\n * - `muted()` - De-emphasized text for descriptions\n * - `badge()` - Highlighted tips and hints\n *\n * @module cli/help\n */\nimport { badge, heading, muted, sectionHeading } from \"../style/theme.js\";\n\ninterface CliHelpOption {\n\ttext: string;\n\thidden?: boolean;\n}\n\nconst CLI_OPTIONS: CliHelpOption[] = [\n\t{ text: \"--provider <name> Provider name (default: openai-codex)\" },\n\t{ text: \"-m, --model <id> Model ID (default: gpt-5.5)\" },\n\t{ text: \"--task-budget <tokens> API-side Anthropic task budget in tokens\" },\n\t{\n\t\ttext: \"--models <patterns> Comma-separated patterns for Ctrl+P model cycling\",\n\t},\n\t{\n\t\ttext: \"--tools <names> Comma-separated tool names to enable (e.g., read,search,list,find)\",\n\t},\n\t{ text: \"--api-key <key> API key (defaults to env vars)\" },\n\t{\n\t\ttext: \"--system-prompt <text> System prompt (default: coding assistant prompt)\",\n\t},\n\t{\n\t\ttext: \"--append-system-prompt <text> Append instructions to the system prompt\",\n\t},\n\t{ text: \"--mode <mode> Output mode: text (default), json, or rpc\" },\n\t{\n\t\ttext: \"--auth <mode> Credential mode: auto (default), api-key\",\n\t},\n\t{\n\t\ttext: \"--approval-mode <mode> Action approvals: prompt (default in TUI), auto, fail\",\n\t},\n\t{\n\t\ttext: \"--sandbox <mode> Sandbox mode: read-only, workspace-write, danger-full-access, native, docker, local, none\",\n\t},\n\t{\n\t\ttext: \"--port <n> Port for `maestro web` (defaults to PORT env or 8080)\",\n\t},\n\t{ text: \"--continue, -c Continue previous session\" },\n\t{ text: \"--resume, -r Select a session to resume\" },\n\t{ text: \"--session <path> Use specific session file\" },\n\t{ text: \"--no-session Don't save session (ephemeral)\" },\n\t{ text: \"--safe-mode Enable extra safety restrictions\" },\n\t{\n\t\ttext: \"--replay <path|uri> Open a scripted deterministic replay session\",\n\t},\n\t{\n\t\ttext: \"--record-scenario <path> Record assistant turns as a replay fixture\",\n\t},\n\t{ text: \"--help, -h Show this help\" },\n\t{\n\t\ttext: \"--help-hidden Show hidden support and staged-rollout flags\",\n\t\thidden: true,\n\t},\n\t{\n\t\ttext: \"--list-modes-all List visible and hidden agent modes\",\n\t\thidden: true,\n\t},\n];\n\nfunction renderHelpOptions(options: CliHelpOption[], includeHidden: boolean) {\n\treturn options\n\t\t.filter((option) => includeHidden || option.hidden !== true)\n\t\t.map((option) => ` ${muted(option.text)}`)\n\t\t.join(\"\\n\");\n}\n\n/**\n * Prints the complete CLI help message to stdout.\n *\n * This function is invoked when the user runs `maestro --help` or `maestro -h`.\n * It formats and displays all available options, commands, and usage examples\n * using the terminal theme for consistent styling.\n *\n * @param version - The current Maestro version string (e.g., \"1.2.3\")\n *\n * @example\n * ```typescript\n * import { printHelp } from \"./help.js\";\n * import { version } from \"../../package.json\";\n *\n * if (args.includes(\"--help\")) {\n * printHelp(version);\n * process.exit(0);\n * }\n * ```\n */\nexport function printHelp(\n\tversion: string,\n\toptions?: { includeHidden?: boolean },\n) {\n\tconst includeHidden = options?.includeHidden === true;\n\tconst header = `${heading(\"Maestro\")} ${muted(\n\t\t`v${version} by EvalOps — AI coding assistant with read, list, search, diff, bash, edit, write, todo tools`,\n\t)}`;\n\tconst usage = `${sectionHeading(\"Usage\")}${muted(\n\t\t\"maestro [options] [messages...]\",\n\t)}`;\n\tconst renderedOptions = `${sectionHeading(\"Options\")}${renderHelpOptions(\n\t\tCLI_OPTIONS,\n\t\tincludeHidden,\n\t)}`;\n\tconst hiddenSupportSection = includeHidden\n\t\t? `${sectionHeading(\"Hidden Support Flags\")}${muted(\n\t\t\t\t\" Hidden flags are external support surfaces. Keep them in docs/CONVENTIONS/staged-rollout-registry.json with an owner, telemetry event, and promotion/removal target.\",\n\t\t\t)}`\n\t\t: null;\n\tconst examples = `${sectionHeading(\"Examples\")}${muted(\n\t\t` # Interactive mode (defaults to openai-codex/gpt-5.5 after \\`maestro codex login\\`)\n maestro\n\n # Single message\n maestro \"List all .ts files in src/\"\n\n # Multiple messages\n maestro \"Read package.json\" \"What dependencies do we have?\"\n\n # Continue previous session\n maestro --continue \"What did we discuss?\"\n\n # Use different model\n maestro --provider openai --model gpt-4o-mini \"Help me refactor this code\"\n\n # Use Codex subscription models explicitly\n maestro --provider openai-codex --model gpt-5.5 \"Plan this migration\"\n maestro codex doctor\n\n # Bootstrap EvalOps login, API key, and agent registration in one flow\n maestro init\n\n # Use EvalOps managed gateway models after \\`maestro init\\`\n maestro --provider evalops --model gpt-4o-mini \"Say hello in one sentence\"\n\n # Confirm managed mode sinks and EvalOps org identity\n maestro status\n\n # Inspect mode-level subagent model dispatch before running a swarm\n maestro modes describe smart\n\n # Explain which instruction files and MCP context sources are visible\n maestro context explain\n\n # Compare context sources between two workspaces\n maestro context diff ./before ./after\n\n # Include live MCP resources and prompts in context diagnostics\n maestro context explain --live-mcp\n\n # Export a portable session log\n maestro export <session-id> ./session.jsonl --format jsonl\n\n # Export a portable JSON archive with secret redaction\n maestro export <session-id> ./session.json --format json --redact-secrets\n\n # Import a portable session log into this workspace\n maestro import ./session.json\n\n # Scaffold and validate progressive skill packages\n maestro skill new processing-incidents --description \"Process incident reports. Use when the user asks for incident triage.\"\n maestro skill lint .maestro/skills\n\n # Start a hosted EvalOps runner session and wait for attach readiness\n maestro remote start --workspace ws_123 --repo evalops/foo --branch main --ttl 90m --wait --verify\n\n # Run a single-session hosted runtime pod entrypoint\n maestro hosted-runner --runner-session-id mrs_abc --workspace-root /workspace --listen 0.0.0.0:8080\n\n # Show usage analytics for the last 7 days\n maestro stats\n\n # Show usage analytics for one session\n maestro stats --session <session-id>\n\n # Reconstruct the timeline, trajectory, and evidence coverage for a saved run\n maestro run inspect <session-id> --json\n maestro run promote <session-id>\n\n # Validate and run a deterministic scenario fixture\n maestro scenario validate ./test/fixtures/agent-trajectory-scenarios/local-diagnostic-success.json\n maestro scenario run ./test/fixtures/agent-trajectory-scenarios/local-diagnostic-success.json --junit ./tmp/scenario.xml\n\n # Open a real agent session backed by a scripted model fixture\n maestro --replay ./test/fixtures/scripted-replay/basic-tool-call.json\n maestro --replay gs://evalops-prod-maestro-scenario-fixtures/maestro/scenarios/example.json\n\n # Record a live run into a replayable scripted scenario\n maestro --record-scenario ./tmp/recorded-scenario.json \"inspect package.json\"`,\n\t)}`;\n\tconst env = `${sectionHeading(\"Environment Variables:\")}${muted(\n\t\t` GEMINI_API_KEY - Google Gemini API key\n OPENAI_API_KEY - OpenAI API key\n OPENAI_CODEX_TOKEN - OpenAI Codex ChatGPT access token\n OPENAI_CODEX_ACCOUNT_ID - ChatGPT account id when using a raw Codex token\n ANTHROPIC_API_KEY - Anthropic API key\n MAESTRO_AGENT_DIR - Session storage directory (default: ~/.maestro/agent)\n MAESTRO_SANDBOX_MODE - Sandbox mode: read-only, workspace-write, danger-full-access\n MAESTRO_CHANGELOG - Set to off/false/hide/hidden/skip/0 to hide startup changelog banner\n MAESTRO_TUI_MINIMAL - Set to 1/true to disable animations and reduce TUI effects (SSH-friendly)\n MAESTRO_TUI_TOOL_MAX_CHARS - Max chars shown per tool output panel (0 = unlimited)\n MAESTRO_TUI_TOOL_MAX_LINES - Max lines shown per tool output panel (0 = unlimited)\n MAESTRO_MEMORY_BASE - Durable memory service base URL\n MAESTRO_MEMORY_ACCESS_TOKEN - Override bearer token for durable memory service\n MAESTRO_MEMORY_TEAM_ID - Optional team scope for durable memory service\n MAESTRO_SHARED_MEMORY_BASE - Shared memory base URL (Cloudflare Durable Objects worker)\n MAESTRO_SHARED_MEMORY_API_KEY - API key for shared memory service\n MAESTRO_REMOTE_RUNNER_URL - Hosted runner control-plane URL (default: https://runner.evalops.dev)\n MAESTRO_REMOTE_RUNNER_TOKEN - Hosted runner bearer token override\n MAESTRO_REMOTE_RUNNER_ORG_ID - EvalOps organization id for hosted runner sessions\n MAESTRO_REMOTE_RUNNER_WORKSPACE_ID - EvalOps workspace id for hosted runner sessions\n CODING_AGENT_DIR - Legacy session directory override (fallback)`,\n\t)}`;\n\tconst execSection = `${sectionHeading(\"maestro exec\")}${muted(\n\t\t` maestro exec \"Summarize recent changes\" --json\n\n Flags:\n --json Stream JSONL thread/turn events\n --output-schema <file|json> Validate final assistant JSON against a schema\n --output-last-message <path> Write the final assistant message to disk\n --full-auto | --read-only Force approval policy (auto or fail)\n --sandbox <mode> Run in sandbox: read-only, workspace-write, danger-full-access, native, docker, local, none\n --resume <sessionId> Resume a prior exec session by id\n --last Resume the most recent exec session`,\n\t)}`;\n\tconst webSection = `${sectionHeading(\"maestro web\")}${muted(\n\t\t` # Start the bundled web UI + API server\n maestro web\n\n # Use a custom port\n maestro web --port 3000`,\n\t)}`;\n\tconst portabilitySection = `${sectionHeading(\"Session Portability\")}${muted(\n\t\t` maestro export <session-id> [output-path] --format json|jsonl [--redact-secrets]\n maestro import <file.json|file.jsonl>\n\n Notes:\n - json preserves the full session in a portable wrapper object\n - jsonl preserves the append-only session log verbatim unless redaction is requested\n - --redact-secrets scrubs detected credentials from exported payloads\n - import restores the session into the current workspace session directory`,\n\t)}`;\n\tconst modesSection = `${sectionHeading(\"maestro modes\")}${muted(\n\t\t` maestro modes list\n maestro modes describe <mode> [--provider <provider>] [--json]\n\n Prints the mode primary/fallback model policy and resolved subagent dispatch\n table, including cross-provider overrides such as smart-mode coder lanes\n routed to openai-codex/gpt-5.5.`,\n\t)}`;\n\tconst memorySection = `${sectionHeading(\"maestro memory\")}${muted(\n\t\t` maestro memory [status] Show shared memory service status\n maestro memory session <id> Show per-session metrics\n maestro memory audit <id> [n] Show recent sync audit entries\n maestro memory export <id> Export metrics log as JSONL\n maestro memory watch [id] [ms] Poll status/metrics continuously`,\n\t)}`;\n\tconst skillSection = `${sectionHeading(\"maestro skill\")}${muted(\n\t\t` maestro skill list List available progressive skills\n maestro skill inspect <name> Print one skill package manifest\n maestro skill install <source> Validate and install an OSS skill package\n maestro skill publish-check <src> Validate an OSS skill package for publishing\n maestro skill new <name> Scaffold SKILL.md, reference/, scripts/, toolbox/, and mcp.json.example\n maestro skill lint [path...] Validate frontmatter, budget, mcp.json includeTools, and toolbox shape`,\n\t)}`;\n\tconst remoteSection = `${sectionHeading(\"maestro remote\")}${muted(\n\t\t` maestro remote start --workspace <id> --repo <repo> --branch <branch> [--ttl 90m] [--wait] [--verify]\n maestro remote list --workspace <id> [--state running]\n maestro remote attach <session-id> [--verify] [--print-env]\n maestro remote extend <session-id> --ttl 2h\n maestro remote stop <session-id> [--reason <text>]`,\n\t)}`;\n\tconst operatingPlaneSection = `${sectionHeading(\"maestro operating-plane\")}${muted(\n\t\t` maestro operating-plane status --thread-id <slack-thread> [--evidence-id <id>] [--auth-subject <subject>]\n maestro operating-plane status --trace-id <id> --json\n\n Fetches the Platform operating-plane ledger and prints a content-free value\n proof report with identity, model/tool/approval/trace/evidence/cost status,\n allowed evidence ids/revisions, blockers, next actions, and withheld reasons.`,\n\t)}`;\n\tconst runSection = `${sectionHeading(\"maestro run\")}${muted(\n\t\t` maestro run inspect <session-id> [--json]\n maestro run ledger <session-id>\n maestro run replay <session-id>\n maestro run promote <session-id>\n\n Reconstructs a saved session into a timeline plus canonical agent trajectory\n with prompt, tool, file-change, artifact, policy, diagnostic, compaction,\n pending-wait, and MCP-context coverage. The ledger/replay/promote commands\n expose the local AgentRuntime projection and dry-run Platform promotion plan.`,\n\t)}`;\n\tconst initSection = `${sectionHeading(\"maestro init\")}${muted(\n\t\t` maestro init Login, create or reuse an API key, and register this agent\n maestro init --rotate-key Replace the stored agent MCP API key\n maestro init --mcp-url <url> Override the EvalOps agent MCP endpoint\n maestro init --capability code:write Declare an agent-registry capability\n maestro init --json Emit machine-readable bootstrap output`,\n\t)}`;\n\tconst hostedRunnerSection = `${sectionHeading(\"maestro hosted-runner\")}${muted(\n\t\t` maestro hosted-runner --runner-session-id <id> --workspace-root <path> [--listen 0.0.0.0:8080]\n\n Env mode:\n MAESTRO_RUNNER_SESSION_ID=mrs_abc MAESTRO_WORKSPACE_ROOT=/workspace maestro hosted-runner`,\n\t)}`;\n\tconst sessionsSection = `${sectionHeading(\"Session Metadata\")}${muted(\n\t\t` /session favorite|unfavorite Toggle favorite for current session\n /session summary \"<text>\" Save a manual summary for current session\n /sessions summarize <id> Auto-summarize a saved session`,\n\t)}`;\n\tconst sessionsDiscovery = `${sectionHeading(\"Session Commands\")}${muted(\n\t\t` /session [info|favorite|unfavorite|summary \"<text>\"]\n /sessions [list|load <id>|favorite <id>|unfavorite <id>|summarize <id>]\n (Also available via TUI command palette)`,\n\t)}`;\n\tconst tools = `${sectionHeading(\"Available Tools\")}${muted(\n\t\t` read - Read file contents\n list - List files in a directory\n find - Fast file search using fd (glob patterns)\n search - Search files with ripgrep-style filtering\n parallel_ripgrep - Run multiple ripgrep patterns in parallel and merge line ranges\n diff - Show git diffs (workspace, staged, or ranges)\n bash - Execute bash commands\n edit - Edit files with find/replace\n write - Write files (creates/overwrites)\n todo - Create TodoWrite-style checklists\n\n Read-only tools: read,list,find,search,parallel_ripgrep,diff,status\n Example: maestro --tools read,list,find,search,parallel_ripgrep,diff \"Analyze this code\"`,\n\t)}`;\n\n\tconst frameworkSection = `${sectionHeading(\"Framework Preference\")}${muted(\n\t\t` /framework <id> Set default stack (fastapi, express, node)\n /framework <id> --workspace Set workspace-scoped default\n /framework list Show available options\n Precedence: policy (locked) > policy > env override > env default > workspace > user file > none`,\n\t)}`;\n\n\tconsole.log(\n\t\t[\n\t\t\theader,\n\t\t\tusage,\n\t\t\trenderedOptions,\n\t\t\thiddenSupportSection,\n\t\t\texamples,\n\t\t\tenv,\n\t\t\texecSection,\n\t\t\twebSection,\n\t\t\tportabilitySection,\n\t\t\tmodesSection,\n\t\t\tmemorySection,\n\t\t\tskillSection,\n\t\t\tinitSection,\n\t\t\trunSection,\n\t\t\tremoteSection,\n\t\t\toperatingPlaneSection,\n\t\t\thostedRunnerSection,\n\t\t\tsessionsSection,\n\t\t\tsessionsDiscovery,\n\t\t\t`${sectionHeading(\"Tips\")}${badge(\n\t\t\t\t\"Need models?\",\n\t\t\t\t\"maestro models list\",\n\t\t\t\t\"info\",\n\t\t\t)}`,\n\t\t\tframeworkSection,\n\t\t\ttools,\n\t\t]\n\t\t\t.filter((section): section is string => section !== null)\n\t\t\t.join(\"\\n\\n\"),\n\t);\n}\n"]}
@@ -2,7 +2,7 @@
2
2
  * RPC Mode - JSON-over-stdio protocol for programmatic agent control.
3
3
  *
4
4
  * Moved from main.ts. Provides a line-based JSON protocol for IDE integrations,
5
- * language servers, and other tools that embed Composer functionality.
5
+ * language servers, and other tools that embed Maestro functionality.
6
6
  *
7
7
  * ## Protocol
8
8
  *
@@ -2,7 +2,7 @@
2
2
  * RPC Mode - JSON-over-stdio protocol for programmatic agent control.
3
3
  *
4
4
  * Moved from main.ts. Provides a line-based JSON protocol for IDE integrations,
5
- * language servers, and other tools that embed Composer functionality.
5
+ * language servers, and other tools that embed Maestro functionality.
6
6
  *
7
7
  * ## Protocol
8
8
  *
@@ -1 +1 @@
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,YAAY;oBAClB,OAAO,EACN,MAAM,CAAC,OAAO,IAAI,aAAa,MAAM,CAAC,cAAc,WAAW;oBAChE,mBAAmB,EAAE,MAAM,CAAC,mBAAmB,IAAI,CAAC;oBACpD,YAAY,EAAE,MAAM,CAAC,YAAY,IAAI,CAAC;oBACtC,IAAI,EAAE,KAAK;oBACX,kBAAkB;oBAClB,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;iBACnC,CAAC;gBACF,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,CAAC;YAC9C,CAAC;QACF,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACzB,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;QAChE,CAAC;IACF,CAAC,CAAC,CAAC;IAEH,4DAA4D;IAC5D,OAAO,IAAI,OAAO,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["/**\n * RPC Mode - JSON-over-stdio protocol for programmatic agent control.\n *\n * Moved from main.ts. Provides a line-based JSON protocol for IDE integrations,\n * language servers, and other tools that embed Composer functionality.\n *\n * ## Protocol\n *\n * **Input (stdin)**: JSON objects, one per line\n * ```json\n * {\"type\": \"prompt\", \"message\": \"Hello\"}\n * {\"type\": \"abort\"}\n * {\"type\": \"compact\", \"customInstructions\": \"Focus on...\"}\n * ```\n *\n * **Output (stdout)**: Agent events as JSON objects, one per line\n *\n * @module cli/rpc-mode\n */\n\nimport type { Agent } from \"../agent/agent.js\";\nimport { buildCompactionHookContext } from \"../agent/compaction-hooks.js\";\nimport {\n\tcollectBackgroundTaskMessagesForCompaction,\n\tcollectMcpMessagesForCompaction,\n\tcollectPlanMessagesForCompaction,\n} from \"../agent/compaction-restoration.js\";\nimport { performCompaction } from \"../agent/compaction.js\";\nimport {\n\tbuildCompactionEvent,\n\trunWithPromptRecovery,\n} from \"../agent/prompt-recovery.js\";\nimport type {\n\tAgentEvent,\n\tAppMessage,\n\tAssistantMessage,\n} from \"../agent/types.js\";\nimport {\n\tcollectPersistedSessionStartHookMessages,\n\trunUserPromptWithRecovery,\n} from \"../agent/user-prompt-runtime.js\";\nimport {\n\tcreateRenderableMessage,\n\trenderMessageToPlainText,\n} from \"../conversation/render-model.js\";\nimport { mcpManager } from \"../mcp/index.js\";\nimport { withMcpPostKeepMessages } from \"../mcp/prompt-recovery.js\";\nimport type { SessionManager } from \"../session/manager.js\";\n\nasync function collectRpcPostKeepMessages(\n\tsessionManager: SessionManager,\n\tcwd: string,\n\tpreservedMessages: AppMessage[],\n): Promise<AppMessage[]> {\n\tconst [\n\t\tplanMessages,\n\t\tbackgroundTaskMessages,\n\t\tmcpMessages,\n\t\tsessionStartMessages,\n\t] = await Promise.all([\n\t\tPromise.resolve(collectPlanMessagesForCompaction(preservedMessages)),\n\t\tPromise.resolve(\n\t\t\tcollectBackgroundTaskMessagesForCompaction(preservedMessages),\n\t\t),\n\t\tPromise.resolve(\n\t\t\tcollectMcpMessagesForCompaction(\n\t\t\t\tpreservedMessages,\n\t\t\t\tmcpManager.getStatus().servers,\n\t\t\t),\n\t\t),\n\t\tcollectPersistedSessionStartHookMessages({\n\t\t\tsessionManager,\n\t\t\tcwd,\n\t\t\tsource: \"compact\",\n\t\t}),\n\t]);\n\treturn [\n\t\t...planMessages,\n\t\t...backgroundTaskMessages,\n\t\t...mcpMessages,\n\t\t...sessionStartMessages,\n\t];\n}\n\n/**\n * Run the CLI in RPC mode.\n *\n * The process runs indefinitely until stdin closes or it receives\n * a termination signal.\n */\nexport async function runRpcMode(\n\tagent: Agent,\n\tsessionManager: SessionManager,\n): Promise<void> {\n\t// Subscribe to all events and emit as JSON for client consumption\n\tagent.subscribe((event) => {\n\t\tconsole.log(JSON.stringify(event));\n\t});\n\n\t// Set up JSON-over-stdin readline interface\n\tconst readline = await import(\"node:readline\");\n\tconst rl = readline.createInterface({\n\t\tinput: process.stdin,\n\t\toutput: process.stdout,\n\t\tterminal: false,\n\t});\n\n\t// Process incoming RPC commands line by line\n\trl.on(\"line\", async (line: string) => {\n\t\ttry {\n\t\t\tconst input = JSON.parse(line);\n\n\t\t\tif (input.type === \"prompt\" && input.message) {\n\t\t\t\tawait runUserPromptWithRecovery({\n\t\t\t\t\tagent,\n\t\t\t\t\tsessionManager,\n\t\t\t\t\tcwd: process.cwd(),\n\t\t\t\t\tprompt: input.message,\n\t\t\t\t\texecute: () => agent.prompt(input.message),\n\t\t\t\t\tgetPostKeepMessages: withMcpPostKeepMessages(),\n\t\t\t\t\tcallbacks: {\n\t\t\t\t\t\tonCompacted: (result) => {\n\t\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t\tJSON.stringify(buildCompactionEvent(result, { auto: true })),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t} else if (input.type === \"abort\") {\n\t\t\t\tagent.abort();\n\t\t\t} else if (input.type === \"get_messages\") {\n\t\t\t\tconsole.log(\n\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\ttype: \"messages\",\n\t\t\t\t\t\tmessages: agent.state.messages,\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t} else if (input.type === \"get_state\") {\n\t\t\t\tconsole.log(\n\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\tstate: {\n\t\t\t\t\t\t\tmodel: agent.state.model,\n\t\t\t\t\t\t\tmessages: agent.state.messages,\n\t\t\t\t\t\t\tisStreaming: agent.state.isStreaming,\n\t\t\t\t\t\t\terror: agent.state.error,\n\t\t\t\t\t\t\tthinkingLevel: agent.state.thinkingLevel,\n\t\t\t\t\t\t\tsession: agent.state.session,\n\t\t\t\t\t\t\tqueuedMessageCount: agent.getQueuedMessageCount(),\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t} else if (input.type === \"continue\") {\n\t\t\t\tawait runWithPromptRecovery({\n\t\t\t\t\tagent,\n\t\t\t\t\tsessionManager,\n\t\t\t\t\thookContext: buildCompactionHookContext(\n\t\t\t\t\t\tsessionManager,\n\t\t\t\t\t\tprocess.cwd(),\n\t\t\t\t\t),\n\t\t\t\t\texecute: () => agent.continue(input.options),\n\t\t\t\t\tgetPostKeepMessages: (preservedMessages) =>\n\t\t\t\t\t\tcollectRpcPostKeepMessages(\n\t\t\t\t\t\t\tsessionManager,\n\t\t\t\t\t\t\tprocess.cwd(),\n\t\t\t\t\t\t\tpreservedMessages,\n\t\t\t\t\t\t),\n\t\t\t\t\tcallbacks: {\n\t\t\t\t\t\tonCompacted: (result) => {\n\t\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t\tJSON.stringify(buildCompactionEvent(result, { auto: true })),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t} else if (input.type === \"compact\") {\n\t\t\t\tconst customInstructions = input.customInstructions as\n\t\t\t\t\t| string\n\t\t\t\t\t| undefined;\n\n\t\t\t\tconst result = await performCompaction({\n\t\t\t\t\tagent,\n\t\t\t\t\tsessionManager,\n\t\t\t\t\tauto: false,\n\t\t\t\t\ttrigger: \"manual\",\n\t\t\t\t\thookContext: buildCompactionHookContext(\n\t\t\t\t\t\tsessionManager,\n\t\t\t\t\t\tprocess.cwd(),\n\t\t\t\t\t),\n\t\t\t\t\tgetPostKeepMessages: (preservedMessages) =>\n\t\t\t\t\t\tcollectRpcPostKeepMessages(\n\t\t\t\t\t\t\tsessionManager,\n\t\t\t\t\t\t\tprocess.cwd(),\n\t\t\t\t\t\t\tpreservedMessages,\n\t\t\t\t\t\t),\n\t\t\t\t\tcustomInstructions,\n\t\t\t\t\trenderSummaryText: (summary: AssistantMessage) => {\n\t\t\t\t\t\tconst renderable = createRenderableMessage(summary as AppMessage);\n\t\t\t\t\t\treturn renderable\n\t\t\t\t\t\t\t? renderMessageToPlainText(renderable).trim()\n\t\t\t\t\t\t\t: \"\";\n\t\t\t\t\t},\n\t\t\t\t});\n\n\t\t\t\tif (!result.success) {\n\t\t\t\t\tconsole.log(\n\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\terror: result.error,\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Emit compaction event\n\t\t\t\tconst compactionEvent: AgentEvent = {\n\t\t\t\t\ttype: \"compaction\",\n\t\t\t\t\tsummary:\n\t\t\t\t\t\tresult.summary ?? `Compacted ${result.compactedCount} messages`,\n\t\t\t\t\tfirstKeptEntryIndex: result.firstKeptEntryIndex ?? 0,\n\t\t\t\t\ttokensBefore: result.tokensBefore ?? 0,\n\t\t\t\t\tauto: false,\n\t\t\t\t\tcustomInstructions,\n\t\t\t\t\ttimestamp: new Date().toISOString(),\n\t\t\t\t};\n\t\t\t\tconsole.log(JSON.stringify(compactionEvent));\n\t\t\t}\n\t\t} catch (error: unknown) {\n\t\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\t\tconsole.log(JSON.stringify({ type: \"error\", error: message }));\n\t\t}\n\t});\n\n\t// Keep process alive indefinitely - exits when stdin closes\n\treturn new Promise(() => {});\n}\n"]}
1
+ {"version":3,"file":"rpc-mode.js","sourceRoot":"","sources":["../../src/cli/rpc-mode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EACN,0CAA0C,EAC1C,+BAA+B,EAC/B,gCAAgC,GAChC,MAAM,oCAAoC,CAA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I,IAAI,EAAE,CAAC,WAAW,EAAE;iBACnC,CAAC;gBACF,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,CAAC;YAC9C,CAAC;QACF,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACzB,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;QAChE,CAAC;IACF,CAAC,CAAC,CAAC;IAEH,4DAA4D;IAC5D,OAAO,IAAI,OAAO,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["/**\n * RPC Mode - JSON-over-stdio protocol for programmatic agent control.\n *\n * Moved from main.ts. Provides a line-based JSON protocol for IDE integrations,\n * language servers, and other tools that embed Maestro functionality.\n *\n * ## Protocol\n *\n * **Input (stdin)**: JSON objects, one per line\n * ```json\n * {\"type\": \"prompt\", \"message\": \"Hello\"}\n * {\"type\": \"abort\"}\n * {\"type\": \"compact\", \"customInstructions\": \"Focus on...\"}\n * ```\n *\n * **Output (stdout)**: Agent events as JSON objects, one per line\n *\n * @module cli/rpc-mode\n */\n\nimport type { Agent } from \"../agent/agent.js\";\nimport { buildCompactionHookContext } from \"../agent/compaction-hooks.js\";\nimport {\n\tcollectBackgroundTaskMessagesForCompaction,\n\tcollectMcpMessagesForCompaction,\n\tcollectPlanMessagesForCompaction,\n} from \"../agent/compaction-restoration.js\";\nimport { performCompaction } from \"../agent/compaction.js\";\nimport {\n\tbuildCompactionEvent,\n\trunWithPromptRecovery,\n} from \"../agent/prompt-recovery.js\";\nimport type {\n\tAgentEvent,\n\tAppMessage,\n\tAssistantMessage,\n} from \"../agent/types.js\";\nimport {\n\tcollectPersistedSessionStartHookMessages,\n\trunUserPromptWithRecovery,\n} from \"../agent/user-prompt-runtime.js\";\nimport {\n\tcreateRenderableMessage,\n\trenderMessageToPlainText,\n} from \"../conversation/render-model.js\";\nimport { mcpManager } from \"../mcp/index.js\";\nimport { withMcpPostKeepMessages } from \"../mcp/prompt-recovery.js\";\nimport type { SessionManager } from \"../session/manager.js\";\n\nasync function collectRpcPostKeepMessages(\n\tsessionManager: SessionManager,\n\tcwd: string,\n\tpreservedMessages: AppMessage[],\n): Promise<AppMessage[]> {\n\tconst [\n\t\tplanMessages,\n\t\tbackgroundTaskMessages,\n\t\tmcpMessages,\n\t\tsessionStartMessages,\n\t] = await Promise.all([\n\t\tPromise.resolve(collectPlanMessagesForCompaction(preservedMessages)),\n\t\tPromise.resolve(\n\t\t\tcollectBackgroundTaskMessagesForCompaction(preservedMessages),\n\t\t),\n\t\tPromise.resolve(\n\t\t\tcollectMcpMessagesForCompaction(\n\t\t\t\tpreservedMessages,\n\t\t\t\tmcpManager.getStatus().servers,\n\t\t\t),\n\t\t),\n\t\tcollectPersistedSessionStartHookMessages({\n\t\t\tsessionManager,\n\t\t\tcwd,\n\t\t\tsource: \"compact\",\n\t\t}),\n\t]);\n\treturn [\n\t\t...planMessages,\n\t\t...backgroundTaskMessages,\n\t\t...mcpMessages,\n\t\t...sessionStartMessages,\n\t];\n}\n\n/**\n * Run the CLI in RPC mode.\n *\n * The process runs indefinitely until stdin closes or it receives\n * a termination signal.\n */\nexport async function runRpcMode(\n\tagent: Agent,\n\tsessionManager: SessionManager,\n): Promise<void> {\n\t// Subscribe to all events and emit as JSON for client consumption\n\tagent.subscribe((event) => {\n\t\tconsole.log(JSON.stringify(event));\n\t});\n\n\t// Set up JSON-over-stdin readline interface\n\tconst readline = await import(\"node:readline\");\n\tconst rl = readline.createInterface({\n\t\tinput: process.stdin,\n\t\toutput: process.stdout,\n\t\tterminal: false,\n\t});\n\n\t// Process incoming RPC commands line by line\n\trl.on(\"line\", async (line: string) => {\n\t\ttry {\n\t\t\tconst input = JSON.parse(line);\n\n\t\t\tif (input.type === \"prompt\" && input.message) {\n\t\t\t\tawait runUserPromptWithRecovery({\n\t\t\t\t\tagent,\n\t\t\t\t\tsessionManager,\n\t\t\t\t\tcwd: process.cwd(),\n\t\t\t\t\tprompt: input.message,\n\t\t\t\t\texecute: () => agent.prompt(input.message),\n\t\t\t\t\tgetPostKeepMessages: withMcpPostKeepMessages(),\n\t\t\t\t\tcallbacks: {\n\t\t\t\t\t\tonCompacted: (result) => {\n\t\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t\tJSON.stringify(buildCompactionEvent(result, { auto: true })),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t} else if (input.type === \"abort\") {\n\t\t\t\tagent.abort();\n\t\t\t} else if (input.type === \"get_messages\") {\n\t\t\t\tconsole.log(\n\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\ttype: \"messages\",\n\t\t\t\t\t\tmessages: agent.state.messages,\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t} else if (input.type === \"get_state\") {\n\t\t\t\tconsole.log(\n\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\tstate: {\n\t\t\t\t\t\t\tmodel: agent.state.model,\n\t\t\t\t\t\t\tmessages: agent.state.messages,\n\t\t\t\t\t\t\tisStreaming: agent.state.isStreaming,\n\t\t\t\t\t\t\terror: agent.state.error,\n\t\t\t\t\t\t\tthinkingLevel: agent.state.thinkingLevel,\n\t\t\t\t\t\t\tsession: agent.state.session,\n\t\t\t\t\t\t\tqueuedMessageCount: agent.getQueuedMessageCount(),\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t} else if (input.type === \"continue\") {\n\t\t\t\tawait runWithPromptRecovery({\n\t\t\t\t\tagent,\n\t\t\t\t\tsessionManager,\n\t\t\t\t\thookContext: buildCompactionHookContext(\n\t\t\t\t\t\tsessionManager,\n\t\t\t\t\t\tprocess.cwd(),\n\t\t\t\t\t),\n\t\t\t\t\texecute: () => agent.continue(input.options),\n\t\t\t\t\tgetPostKeepMessages: (preservedMessages) =>\n\t\t\t\t\t\tcollectRpcPostKeepMessages(\n\t\t\t\t\t\t\tsessionManager,\n\t\t\t\t\t\t\tprocess.cwd(),\n\t\t\t\t\t\t\tpreservedMessages,\n\t\t\t\t\t\t),\n\t\t\t\t\tcallbacks: {\n\t\t\t\t\t\tonCompacted: (result) => {\n\t\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t\tJSON.stringify(buildCompactionEvent(result, { auto: true })),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t} else if (input.type === \"compact\") {\n\t\t\t\tconst customInstructions = input.customInstructions as\n\t\t\t\t\t| string\n\t\t\t\t\t| undefined;\n\n\t\t\t\tconst result = await performCompaction({\n\t\t\t\t\tagent,\n\t\t\t\t\tsessionManager,\n\t\t\t\t\tauto: false,\n\t\t\t\t\ttrigger: \"manual\",\n\t\t\t\t\thookContext: buildCompactionHookContext(\n\t\t\t\t\t\tsessionManager,\n\t\t\t\t\t\tprocess.cwd(),\n\t\t\t\t\t),\n\t\t\t\t\tgetPostKeepMessages: (preservedMessages) =>\n\t\t\t\t\t\tcollectRpcPostKeepMessages(\n\t\t\t\t\t\t\tsessionManager,\n\t\t\t\t\t\t\tprocess.cwd(),\n\t\t\t\t\t\t\tpreservedMessages,\n\t\t\t\t\t\t),\n\t\t\t\t\tcustomInstructions,\n\t\t\t\t\trenderSummaryText: (summary: AssistantMessage) => {\n\t\t\t\t\t\tconst renderable = createRenderableMessage(summary as AppMessage);\n\t\t\t\t\t\treturn renderable\n\t\t\t\t\t\t\t? renderMessageToPlainText(renderable).trim()\n\t\t\t\t\t\t\t: \"\";\n\t\t\t\t\t},\n\t\t\t\t});\n\n\t\t\t\tif (!result.success) {\n\t\t\t\t\tconsole.log(\n\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\terror: result.error,\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Emit compaction event\n\t\t\t\tconst compactionEvent: AgentEvent = {\n\t\t\t\t\ttype: \"compaction\",\n\t\t\t\t\tsummary:\n\t\t\t\t\t\tresult.summary ?? `Compacted ${result.compactedCount} messages`,\n\t\t\t\t\tfirstKeptEntryIndex: result.firstKeptEntryIndex ?? 0,\n\t\t\t\t\ttokensBefore: result.tokensBefore ?? 0,\n\t\t\t\t\tauto: false,\n\t\t\t\t\tcustomInstructions,\n\t\t\t\t\ttimestamp: new Date().toISOString(),\n\t\t\t\t};\n\t\t\t\tconsole.log(JSON.stringify(compactionEvent));\n\t\t\t}\n\t\t} catch (error: unknown) {\n\t\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\t\tconsole.log(JSON.stringify({ type: \"error\", error: message }));\n\t\t}\n\t});\n\n\t// Keep process alive indefinitely - exits when stdin closes\n\treturn new Promise(() => {});\n}\n"]}
@@ -2,7 +2,7 @@
2
2
  * @fileoverview CLI Session Selection UI
3
3
  *
4
4
  * This module provides an interactive terminal UI for selecting and resuming
5
- * previous Composer sessions. It wraps the TUI session selector component
5
+ * previous Maestro sessions. It wraps the TUI session selector component
6
6
  * in a Promise-based API for use in CLI flows.
7
7
  *
8
8
  * ## Usage
@@ -1 +1 @@
1
- {"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/cli/session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAGlF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAClC,cAA8B;IAE9B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC9B,MAAM,EAAE,GAAG,IAAI,GAAG,CAAC,IAAI,eAAe,EAAE,CAAC,CAAC;QAC1C,IAAI,QAAQ,GAAG,KAAK,CAAC;QAErB,MAAM,QAAQ,GAAG,IAAI,wBAAwB,CAC5C,cAAc,EACd,CAAC,IAAY,EAAE,EAAE;YAChB,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACf,QAAQ,GAAG,IAAI,CAAC;gBAChB,EAAE,CAAC,IAAI,EAAE,CAAC;gBACV,OAAO,CAAC,IAAI,CAAC,CAAC;YACf,CAAC;QACF,CAAC,EACD,GAAG,EAAE;YACJ,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACf,QAAQ,GAAG,IAAI,CAAC;gBAChB,EAAE,CAAC,IAAI,EAAE,CAAC;gBACV,OAAO,CAAC,IAAI,CAAC,CAAC;YACf,CAAC;QACF,CAAC,CACD,CAAC;QAEF,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACtB,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC,CAAC;QACvC,EAAE,CAAC,KAAK,EAAE,CAAC;IACZ,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * @fileoverview CLI Session Selection UI\n *\n * This module provides an interactive terminal UI for selecting and resuming\n * previous Composer sessions. It wraps the TUI session selector component\n * in a Promise-based API for use in CLI flows.\n *\n * ## Usage\n *\n * The `selectSession` function is invoked when:\n * - User runs `maestro --resume` or `maestro -r`\n * - User wants to pick from a list of previous sessions\n *\n * ## UI Behavior\n *\n * - Displays a searchable list of previous sessions\n * - Sessions show timestamp, summary (if available), and favorite status\n * - Arrow keys navigate, Enter selects, Escape cancels\n * - Returns the session path on selection, or null on cancel\n *\n * @module cli/session\n */\nimport { ProcessTerminal, TUI } from \"@evalops/tui\";\nimport { SessionSelectorComponent } from \"../cli-tui/session/session-selector.js\";\nimport type { SessionManager } from \"../session/manager.js\";\n\n/**\n * Opens an interactive session selector in the terminal.\n *\n * This function creates a temporary TUI instance to display a list of\n * available sessions. The user can navigate and select a session to resume,\n * or cancel to return to the CLI.\n *\n * @param sessionManager - The session manager instance for loading session metadata\n * @returns Promise resolving to the selected session path, or null if cancelled\n *\n * @example\n * ```typescript\n * const sessionPath = await selectSession(sessionManager);\n * if (sessionPath) {\n * // Load and resume the selected session\n * const session = await sessionManager.load(sessionPath);\n * } else {\n * // User cancelled, start fresh session\n * }\n * ```\n */\nexport async function selectSession(\n\tsessionManager: SessionManager,\n): Promise<string | null> {\n\treturn new Promise((resolve) => {\n\t\tconst ui = new TUI(new ProcessTerminal());\n\t\tlet resolved = false;\n\n\t\tconst selector = new SessionSelectorComponent(\n\t\t\tsessionManager,\n\t\t\t(path: string) => {\n\t\t\t\tif (!resolved) {\n\t\t\t\t\tresolved = true;\n\t\t\t\t\tui.stop();\n\t\t\t\t\tresolve(path);\n\t\t\t\t}\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tif (!resolved) {\n\t\t\t\t\tresolved = true;\n\t\t\t\t\tui.stop();\n\t\t\t\t\tresolve(null);\n\t\t\t\t}\n\t\t\t},\n\t\t);\n\n\t\tui.addChild(selector);\n\t\tui.setFocus(selector.getSessionList());\n\t\tui.start();\n\t});\n}\n"]}
1
+ {"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/cli/session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAGlF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAClC,cAA8B;IAE9B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC9B,MAAM,EAAE,GAAG,IAAI,GAAG,CAAC,IAAI,eAAe,EAAE,CAAC,CAAC;QAC1C,IAAI,QAAQ,GAAG,KAAK,CAAC;QAErB,MAAM,QAAQ,GAAG,IAAI,wBAAwB,CAC5C,cAAc,EACd,CAAC,IAAY,EAAE,EAAE;YAChB,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACf,QAAQ,GAAG,IAAI,CAAC;gBAChB,EAAE,CAAC,IAAI,EAAE,CAAC;gBACV,OAAO,CAAC,IAAI,CAAC,CAAC;YACf,CAAC;QACF,CAAC,EACD,GAAG,EAAE;YACJ,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACf,QAAQ,GAAG,IAAI,CAAC;gBAChB,EAAE,CAAC,IAAI,EAAE,CAAC;gBACV,OAAO,CAAC,IAAI,CAAC,CAAC;YACf,CAAC;QACF,CAAC,CACD,CAAC;QAEF,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACtB,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC,CAAC;QACvC,EAAE,CAAC,KAAK,EAAE,CAAC;IACZ,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * @fileoverview CLI Session Selection UI\n *\n * This module provides an interactive terminal UI for selecting and resuming\n * previous Maestro sessions. It wraps the TUI session selector component\n * in a Promise-based API for use in CLI flows.\n *\n * ## Usage\n *\n * The `selectSession` function is invoked when:\n * - User runs `maestro --resume` or `maestro -r`\n * - User wants to pick from a list of previous sessions\n *\n * ## UI Behavior\n *\n * - Displays a searchable list of previous sessions\n * - Sessions show timestamp, summary (if available), and favorite status\n * - Arrow keys navigate, Enter selects, Escape cancels\n * - Returns the session path on selection, or null on cancel\n *\n * @module cli/session\n */\nimport { ProcessTerminal, TUI } from \"@evalops/tui\";\nimport { SessionSelectorComponent } from \"../cli-tui/session/session-selector.js\";\nimport type { SessionManager } from \"../session/manager.js\";\n\n/**\n * Opens an interactive session selector in the terminal.\n *\n * This function creates a temporary TUI instance to display a list of\n * available sessions. The user can navigate and select a session to resume,\n * or cancel to return to the CLI.\n *\n * @param sessionManager - The session manager instance for loading session metadata\n * @returns Promise resolving to the selected session path, or null if cancelled\n *\n * @example\n * ```typescript\n * const sessionPath = await selectSession(sessionManager);\n * if (sessionPath) {\n * // Load and resume the selected session\n * const session = await sessionManager.load(sessionPath);\n * } else {\n * // User cancelled, start fresh session\n * }\n * ```\n */\nexport async function selectSession(\n\tsessionManager: SessionManager,\n): Promise<string | null> {\n\treturn new Promise((resolve) => {\n\t\tconst ui = new TUI(new ProcessTerminal());\n\t\tlet resolved = false;\n\n\t\tconst selector = new SessionSelectorComponent(\n\t\t\tsessionManager,\n\t\t\t(path: string) => {\n\t\t\t\tif (!resolved) {\n\t\t\t\t\tresolved = true;\n\t\t\t\t\tui.stop();\n\t\t\t\t\tresolve(path);\n\t\t\t\t}\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tif (!resolved) {\n\t\t\t\t\tresolved = true;\n\t\t\t\t\tui.stop();\n\t\t\t\t\tresolve(null);\n\t\t\t\t}\n\t\t\t},\n\t\t);\n\n\t\tui.addChild(selector);\n\t\tui.setFocus(selector.getSessionList());\n\t\tui.start();\n\t});\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"command-catalog.d.ts","sourceRoot":"","sources":["../../../src/cli-tui/commands/command-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,oBAAY,gBAAgB;IAC3B,KAAK,UAAU;IACf,QAAQ,cAAc;IACtB,WAAW,gBAAgB;IAC3B,IAAI,SAAS;CACb;AAED,oBAAY,qBAAqB;IAChC,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,UAAU,gBAAgB;CAC1B;AAED,KAAK,2BAA2B,GAAG;IAClC,UAAU,EAAE,MAAM,eAAe,CA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mBAAmB,GAAG,eAAe,GAChD,2BAA2B,GAAG;IAC7B,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;CAC3B,CAAC;AAqDH,eAAO,MAAM,uBAAuB,EAAE,SAAS,mBAAmB,EAyoBjE,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,SAAS,mBAAmB,EAepE,CAAC"}
@@ -597,26 +597,21 @@ export const PRIMARY_COMMAND_CATALOG = [
597
597
  tags: ["tools"],
598
598
  }),
599
599
  withArgs("login", "login", {
600
- description: "Authenticate with Claude Pro/Max via OAuth",
601
- usage: "/login [mode] or /login [provider:mode]",
600
+ description: "Authenticate with OpenAI Codex by default",
601
+ usage: "/login [provider]",
602
602
  tags: ["auth"],
603
603
  arguments: [
604
604
  {
605
- name: "argument",
605
+ name: "provider",
606
606
  type: "string",
607
607
  required: false,
608
- description: "Login mode (pro/console) or provider:mode format (e.g., anthropic:pro)",
608
+ description: "OAuth provider (openai-codex by default)",
609
609
  },
610
610
  ],
611
- examples: [
612
- "/login",
613
- "/login pro",
614
- "/login console",
615
- "/login anthropic:pro",
616
- ],
611
+ examples: ["/login", "/login openai-codex", "/login openai"],
617
612
  }),
618
613
  withArgs("logout", "logout", {
619
- description: "Remove stored Claude OAuth credentials",
614
+ description: "Remove stored OAuth credentials",
620
615
  usage: "/logout [provider]",
621
616
  tags: ["auth"],
622
617
  arguments: [
@@ -627,7 +622,7 @@ export const PRIMARY_COMMAND_CATALOG = [
627
622
  description: "OAuth provider to logout from (optional)",
628
623
  },
629
624
  ],
630
- examples: ["/logout", "/logout anthropic"],
625
+ examples: ["/logout", "/logout openai-codex"],
631
626
  }),
632
627
  quit("quit", "quit", {
633
628
  description: "Exit composer (same as ctrl+c twice)",