@oxagen/cli 0.5.0 → 0.6.1

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 (702) hide show
  1. package/README.md +66 -3
  2. package/dist/agent/__tests__/code-graph.test.d.ts +2 -0
  3. package/dist/agent/__tests__/code-graph.test.d.ts.map +1 -0
  4. package/dist/agent/__tests__/code-graph.test.js +83 -0
  5. package/dist/agent/__tests__/code-graph.test.js.map +1 -0
  6. package/dist/agent/__tests__/evaluator.test.d.ts +2 -0
  7. package/dist/agent/__tests__/evaluator.test.d.ts.map +1 -0
  8. package/dist/agent/__tests__/evaluator.test.js +96 -0
  9. package/dist/agent/__tests__/evaluator.test.js.map +1 -0
  10. package/dist/agent/__tests__/fleet-memory.test.d.ts +2 -0
  11. package/dist/agent/__tests__/fleet-memory.test.d.ts.map +1 -0
  12. package/dist/agent/__tests__/fleet-memory.test.js +107 -0
  13. package/dist/agent/__tests__/fleet-memory.test.js.map +1 -0
  14. package/dist/agent/__tests__/fleet-store.test.d.ts +2 -0
  15. package/dist/agent/__tests__/fleet-store.test.d.ts.map +1 -0
  16. package/dist/agent/__tests__/fleet-store.test.js +93 -0
  17. package/dist/agent/__tests__/fleet-store.test.js.map +1 -0
  18. package/dist/agent/__tests__/git-isolation.test.d.ts +2 -0
  19. package/dist/agent/__tests__/git-isolation.test.d.ts.map +1 -0
  20. package/dist/agent/__tests__/git-isolation.test.js +119 -0
  21. package/dist/agent/__tests__/git-isolation.test.js.map +1 -0
  22. package/dist/agent/__tests__/judge.test.d.ts +2 -0
  23. package/dist/agent/__tests__/judge.test.d.ts.map +1 -0
  24. package/dist/agent/__tests__/judge.test.js +140 -0
  25. package/dist/agent/__tests__/judge.test.js.map +1 -0
  26. package/dist/agent/__tests__/loop-errors.test.d.ts +2 -0
  27. package/dist/agent/__tests__/loop-errors.test.d.ts.map +1 -0
  28. package/dist/agent/__tests__/loop-errors.test.js +75 -0
  29. package/dist/agent/__tests__/loop-errors.test.js.map +1 -0
  30. package/dist/agent/__tests__/loop-gating.test.d.ts +2 -0
  31. package/dist/agent/__tests__/loop-gating.test.d.ts.map +1 -0
  32. package/dist/agent/__tests__/loop-gating.test.js +94 -0
  33. package/dist/agent/__tests__/loop-gating.test.js.map +1 -0
  34. package/dist/agent/__tests__/model-router.test.d.ts +2 -0
  35. package/dist/agent/__tests__/model-router.test.d.ts.map +1 -0
  36. package/dist/agent/__tests__/model-router.test.js +138 -0
  37. package/dist/agent/__tests__/model-router.test.js.map +1 -0
  38. package/dist/agent/__tests__/orchestrator-isolation.test.d.ts +2 -0
  39. package/dist/agent/__tests__/orchestrator-isolation.test.d.ts.map +1 -0
  40. package/dist/agent/__tests__/orchestrator-isolation.test.js +134 -0
  41. package/dist/agent/__tests__/orchestrator-isolation.test.js.map +1 -0
  42. package/dist/agent/__tests__/orchestrator.test.d.ts +2 -0
  43. package/dist/agent/__tests__/orchestrator.test.d.ts.map +1 -0
  44. package/dist/agent/__tests__/orchestrator.test.js +201 -0
  45. package/dist/agent/__tests__/orchestrator.test.js.map +1 -0
  46. package/dist/agent/__tests__/permissions.test.d.ts +2 -0
  47. package/dist/agent/__tests__/permissions.test.d.ts.map +1 -0
  48. package/dist/agent/__tests__/permissions.test.js +206 -0
  49. package/dist/agent/__tests__/permissions.test.js.map +1 -0
  50. package/dist/agent/__tests__/pipeline-telemetry.test.d.ts +2 -0
  51. package/dist/agent/__tests__/pipeline-telemetry.test.d.ts.map +1 -0
  52. package/dist/agent/__tests__/pipeline-telemetry.test.js +158 -0
  53. package/dist/agent/__tests__/pipeline-telemetry.test.js.map +1 -0
  54. package/dist/agent/__tests__/pipeline.test.d.ts +2 -0
  55. package/dist/agent/__tests__/pipeline.test.d.ts.map +1 -0
  56. package/dist/agent/__tests__/pipeline.test.js +235 -0
  57. package/dist/agent/__tests__/pipeline.test.js.map +1 -0
  58. package/dist/agent/__tests__/planner.test.d.ts +2 -0
  59. package/dist/agent/__tests__/planner.test.d.ts.map +1 -0
  60. package/dist/agent/__tests__/planner.test.js +98 -0
  61. package/dist/agent/__tests__/planner.test.js.map +1 -0
  62. package/dist/agent/__tests__/prompt-enhancer.test.d.ts +2 -0
  63. package/dist/agent/__tests__/prompt-enhancer.test.d.ts.map +1 -0
  64. package/dist/agent/__tests__/prompt-enhancer.test.js +107 -0
  65. package/dist/agent/__tests__/prompt-enhancer.test.js.map +1 -0
  66. package/dist/agent/__tests__/rate-card.test.d.ts +2 -0
  67. package/dist/agent/__tests__/rate-card.test.d.ts.map +1 -0
  68. package/dist/agent/__tests__/rate-card.test.js +69 -0
  69. package/dist/agent/__tests__/rate-card.test.js.map +1 -0
  70. package/dist/agent/__tests__/system-prompt.test.d.ts +2 -0
  71. package/dist/agent/__tests__/system-prompt.test.d.ts.map +1 -0
  72. package/dist/agent/__tests__/system-prompt.test.js +29 -0
  73. package/dist/agent/__tests__/system-prompt.test.js.map +1 -0
  74. package/dist/agent/__tests__/trace-format-verbose.test.d.ts +2 -0
  75. package/dist/agent/__tests__/trace-format-verbose.test.d.ts.map +1 -0
  76. package/dist/agent/__tests__/trace-format-verbose.test.js +93 -0
  77. package/dist/agent/__tests__/trace-format-verbose.test.js.map +1 -0
  78. package/dist/agent/__tests__/trace-format.test.d.ts +2 -0
  79. package/dist/agent/__tests__/trace-format.test.d.ts.map +1 -0
  80. package/dist/agent/__tests__/trace-format.test.js +104 -0
  81. package/dist/agent/__tests__/trace-format.test.js.map +1 -0
  82. package/dist/agent/__tests__/trace-store.test.d.ts +2 -0
  83. package/dist/agent/__tests__/trace-store.test.d.ts.map +1 -0
  84. package/dist/agent/__tests__/trace-store.test.js +113 -0
  85. package/dist/agent/__tests__/trace-store.test.js.map +1 -0
  86. package/dist/agent/__tests__/verbose-log.test.d.ts +2 -0
  87. package/dist/agent/__tests__/verbose-log.test.d.ts.map +1 -0
  88. package/dist/agent/__tests__/verbose-log.test.js +69 -0
  89. package/dist/agent/__tests__/verbose-log.test.js.map +1 -0
  90. package/dist/agent/code-graph.d.ts +18 -0
  91. package/dist/agent/code-graph.d.ts.map +1 -0
  92. package/dist/agent/code-graph.js +119 -0
  93. package/dist/agent/code-graph.js.map +1 -0
  94. package/dist/agent/env.d.ts +11 -0
  95. package/dist/agent/env.d.ts.map +1 -0
  96. package/dist/agent/env.js +82 -0
  97. package/dist/agent/env.js.map +1 -0
  98. package/dist/agent/evaluator.d.ts +13 -0
  99. package/dist/agent/evaluator.d.ts.map +1 -0
  100. package/dist/agent/evaluator.js +150 -0
  101. package/dist/agent/evaluator.js.map +1 -0
  102. package/dist/agent/fleet/git-isolation.d.ts +142 -0
  103. package/dist/agent/fleet/git-isolation.d.ts.map +1 -0
  104. package/dist/agent/fleet/git-isolation.js +290 -0
  105. package/dist/agent/fleet/git-isolation.js.map +1 -0
  106. package/dist/agent/fleet/memory.d.ts +21 -0
  107. package/dist/agent/fleet/memory.d.ts.map +1 -0
  108. package/dist/agent/fleet/memory.js +129 -0
  109. package/dist/agent/fleet/memory.js.map +1 -0
  110. package/dist/agent/fleet/orchestrator.d.ts +108 -0
  111. package/dist/agent/fleet/orchestrator.d.ts.map +1 -0
  112. package/dist/agent/fleet/orchestrator.js +358 -0
  113. package/dist/agent/fleet/orchestrator.js.map +1 -0
  114. package/dist/agent/fleet/store.d.ts +13 -0
  115. package/dist/agent/fleet/store.d.ts.map +1 -0
  116. package/dist/agent/fleet/store.js +79 -0
  117. package/dist/agent/fleet/store.js.map +1 -0
  118. package/dist/agent/fleet/types.d.ts +107 -0
  119. package/dist/agent/fleet/types.d.ts.map +1 -0
  120. package/dist/agent/fleet/types.js +17 -0
  121. package/dist/agent/fleet/types.js.map +1 -0
  122. package/dist/agent/judge.d.ts +46 -0
  123. package/dist/agent/judge.d.ts.map +1 -0
  124. package/dist/agent/judge.js +182 -0
  125. package/dist/agent/judge.js.map +1 -0
  126. package/dist/agent/loop.d.ts +96 -0
  127. package/dist/agent/loop.d.ts.map +1 -0
  128. package/dist/agent/loop.js +233 -0
  129. package/dist/agent/loop.js.map +1 -0
  130. package/dist/agent/memory.d.ts +14 -0
  131. package/dist/agent/memory.d.ts.map +1 -0
  132. package/dist/agent/memory.js +118 -0
  133. package/dist/agent/memory.js.map +1 -0
  134. package/dist/agent/model-router.d.ts +65 -0
  135. package/dist/agent/model-router.d.ts.map +1 -0
  136. package/dist/agent/model-router.js +118 -0
  137. package/dist/agent/model-router.js.map +1 -0
  138. package/dist/agent/model.d.ts +9 -0
  139. package/dist/agent/model.d.ts.map +1 -0
  140. package/dist/agent/model.js +24 -0
  141. package/dist/agent/model.js.map +1 -0
  142. package/dist/agent/permissions.d.ts +103 -0
  143. package/dist/agent/permissions.d.ts.map +1 -0
  144. package/dist/agent/permissions.js +245 -0
  145. package/dist/agent/permissions.js.map +1 -0
  146. package/dist/agent/pipeline.d.ts +92 -0
  147. package/dist/agent/pipeline.d.ts.map +1 -0
  148. package/dist/agent/pipeline.js +371 -0
  149. package/dist/agent/pipeline.js.map +1 -0
  150. package/dist/agent/planner.d.ts +19 -0
  151. package/dist/agent/planner.d.ts.map +1 -0
  152. package/dist/agent/planner.js +139 -0
  153. package/dist/agent/planner.js.map +1 -0
  154. package/dist/agent/project-context.d.ts +13 -0
  155. package/dist/agent/project-context.d.ts.map +1 -0
  156. package/dist/agent/project-context.js +66 -0
  157. package/dist/agent/project-context.js.map +1 -0
  158. package/dist/agent/prompt-enhancer.d.ts +46 -0
  159. package/dist/agent/prompt-enhancer.d.ts.map +1 -0
  160. package/dist/agent/prompt-enhancer.js +137 -0
  161. package/dist/agent/prompt-enhancer.js.map +1 -0
  162. package/dist/agent/rate-card.d.ts +77 -0
  163. package/dist/agent/rate-card.d.ts.map +1 -0
  164. package/dist/agent/rate-card.js +99 -0
  165. package/dist/agent/rate-card.js.map +1 -0
  166. package/dist/agent/system-prompt.d.ts +14 -0
  167. package/dist/agent/system-prompt.d.ts.map +1 -0
  168. package/dist/agent/system-prompt.js +47 -0
  169. package/dist/agent/system-prompt.js.map +1 -0
  170. package/dist/agent/tools.d.ts +23 -0
  171. package/dist/agent/tools.d.ts.map +1 -0
  172. package/dist/agent/tools.js +354 -0
  173. package/dist/agent/tools.js.map +1 -0
  174. package/dist/agent/trace-format.d.ts +13 -0
  175. package/dist/agent/trace-format.d.ts.map +1 -0
  176. package/dist/agent/trace-format.js +188 -0
  177. package/dist/agent/trace-format.js.map +1 -0
  178. package/dist/agent/trace-store.d.ts +19 -0
  179. package/dist/agent/trace-store.d.ts.map +1 -0
  180. package/dist/agent/trace-store.js +82 -0
  181. package/dist/agent/trace-store.js.map +1 -0
  182. package/dist/agent/trace.d.ts +180 -0
  183. package/dist/agent/trace.d.ts.map +1 -0
  184. package/dist/agent/trace.js +2 -0
  185. package/dist/agent/trace.js.map +1 -0
  186. package/dist/agent/verbose-log.d.ts +8 -0
  187. package/dist/agent/verbose-log.d.ts.map +1 -0
  188. package/dist/agent/verbose-log.js +53 -0
  189. package/dist/agent/verbose-log.js.map +1 -0
  190. package/dist/agents/__tests__/loader.test.d.ts +2 -0
  191. package/dist/agents/__tests__/loader.test.d.ts.map +1 -0
  192. package/dist/agents/__tests__/loader.test.js +88 -0
  193. package/dist/agents/__tests__/loader.test.js.map +1 -0
  194. package/dist/agents/__tests__/tools.test.d.ts +2 -0
  195. package/dist/agents/__tests__/tools.test.d.ts.map +1 -0
  196. package/dist/agents/__tests__/tools.test.js +40 -0
  197. package/dist/agents/__tests__/tools.test.js.map +1 -0
  198. package/dist/agents/index.d.ts +12 -0
  199. package/dist/agents/index.d.ts.map +1 -0
  200. package/dist/agents/index.js +4 -0
  201. package/dist/agents/index.js.map +1 -0
  202. package/dist/agents/loader.d.ts +25 -0
  203. package/dist/agents/loader.d.ts.map +1 -0
  204. package/dist/agents/loader.js +133 -0
  205. package/dist/agents/loader.js.map +1 -0
  206. package/dist/agents/tools.d.ts +14 -0
  207. package/dist/agents/tools.d.ts.map +1 -0
  208. package/dist/agents/tools.js +21 -0
  209. package/dist/agents/tools.js.map +1 -0
  210. package/dist/agents/types.d.ts +27 -0
  211. package/dist/agents/types.d.ts.map +1 -0
  212. package/dist/agents/types.js +11 -0
  213. package/dist/agents/types.js.map +1 -0
  214. package/dist/agents/write.d.ts +10 -0
  215. package/dist/agents/write.d.ts.map +1 -0
  216. package/dist/agents/write.js +28 -0
  217. package/dist/agents/write.js.map +1 -0
  218. package/dist/commands/__tests__/agent.test.d.ts +2 -0
  219. package/dist/commands/__tests__/agent.test.d.ts.map +1 -0
  220. package/dist/commands/__tests__/agent.test.js +82 -0
  221. package/dist/commands/__tests__/agent.test.js.map +1 -0
  222. package/dist/commands/__tests__/command.test.d.ts +2 -0
  223. package/dist/commands/__tests__/command.test.d.ts.map +1 -0
  224. package/dist/commands/__tests__/command.test.js +73 -0
  225. package/dist/commands/__tests__/command.test.js.map +1 -0
  226. package/dist/commands/__tests__/cost.test.d.ts +2 -0
  227. package/dist/commands/__tests__/cost.test.d.ts.map +1 -0
  228. package/dist/commands/__tests__/cost.test.js +139 -0
  229. package/dist/commands/__tests__/cost.test.js.map +1 -0
  230. package/dist/commands/__tests__/graph.pull.test.d.ts +2 -0
  231. package/dist/commands/__tests__/graph.pull.test.d.ts.map +1 -0
  232. package/dist/commands/__tests__/graph.pull.test.js +259 -0
  233. package/dist/commands/__tests__/graph.pull.test.js.map +1 -0
  234. package/dist/commands/__tests__/mcp.test.d.ts +2 -0
  235. package/dist/commands/__tests__/mcp.test.d.ts.map +1 -0
  236. package/dist/commands/__tests__/mcp.test.js +88 -0
  237. package/dist/commands/__tests__/mcp.test.js.map +1 -0
  238. package/dist/commands/__tests__/replay.test.d.ts +2 -0
  239. package/dist/commands/__tests__/replay.test.d.ts.map +1 -0
  240. package/dist/commands/__tests__/replay.test.js +76 -0
  241. package/dist/commands/__tests__/replay.test.js.map +1 -0
  242. package/dist/commands/__tests__/rules.test.d.ts +2 -0
  243. package/dist/commands/__tests__/rules.test.d.ts.map +1 -0
  244. package/dist/commands/__tests__/rules.test.js +95 -0
  245. package/dist/commands/__tests__/rules.test.js.map +1 -0
  246. package/dist/commands/__tests__/settings.test.d.ts +2 -0
  247. package/dist/commands/__tests__/settings.test.d.ts.map +1 -0
  248. package/dist/commands/__tests__/settings.test.js +83 -0
  249. package/dist/commands/__tests__/settings.test.js.map +1 -0
  250. package/dist/commands/agent.d.ts +15 -0
  251. package/dist/commands/agent.d.ts.map +1 -0
  252. package/dist/commands/agent.js +58 -0
  253. package/dist/commands/agent.js.map +1 -0
  254. package/dist/commands/agent.skill.load.d.ts +3 -0
  255. package/dist/commands/agent.skill.load.d.ts.map +1 -0
  256. package/dist/commands/agent.skill.load.js +57 -0
  257. package/dist/commands/agent.skill.load.js.map +1 -0
  258. package/dist/commands/code.d.ts +14 -0
  259. package/dist/commands/code.d.ts.map +1 -0
  260. package/dist/commands/code.js +100 -0
  261. package/dist/commands/code.js.map +1 -0
  262. package/dist/commands/command.d.ts +17 -0
  263. package/dist/commands/command.d.ts.map +1 -0
  264. package/dist/commands/command.js +74 -0
  265. package/dist/commands/command.js.map +1 -0
  266. package/dist/commands/config.d.ts +2 -0
  267. package/dist/commands/config.d.ts.map +1 -0
  268. package/dist/commands/config.js +66 -0
  269. package/dist/commands/config.js.map +1 -0
  270. package/dist/commands/cost.d.ts +10 -0
  271. package/dist/commands/cost.d.ts.map +1 -0
  272. package/dist/commands/cost.js +140 -0
  273. package/dist/commands/cost.js.map +1 -0
  274. package/dist/commands/env.d.ts +19 -0
  275. package/dist/commands/env.d.ts.map +1 -0
  276. package/dist/commands/env.js +64 -0
  277. package/dist/commands/env.js.map +1 -0
  278. package/dist/commands/graph.pull.d.ts +15 -0
  279. package/dist/commands/graph.pull.d.ts.map +1 -0
  280. package/dist/commands/graph.pull.js +137 -0
  281. package/dist/commands/graph.pull.js.map +1 -0
  282. package/dist/commands/graph.search.d.ts +10 -0
  283. package/dist/commands/graph.search.d.ts.map +1 -0
  284. package/dist/commands/graph.search.js +25 -0
  285. package/dist/commands/graph.search.js.map +1 -0
  286. package/dist/commands/graph.status.d.ts +10 -0
  287. package/dist/commands/graph.status.d.ts.map +1 -0
  288. package/dist/commands/graph.status.js +75 -0
  289. package/dist/commands/graph.status.js.map +1 -0
  290. package/dist/commands/mcp.add.d.ts +13 -0
  291. package/dist/commands/mcp.add.d.ts.map +1 -0
  292. package/dist/commands/mcp.add.js +110 -0
  293. package/dist/commands/mcp.add.js.map +1 -0
  294. package/dist/commands/mcp.auth.d.ts +10 -0
  295. package/dist/commands/mcp.auth.d.ts.map +1 -0
  296. package/dist/commands/mcp.auth.js +132 -0
  297. package/dist/commands/mcp.auth.js.map +1 -0
  298. package/dist/commands/mcp.check.d.ts +10 -0
  299. package/dist/commands/mcp.check.d.ts.map +1 -0
  300. package/dist/commands/mcp.check.js +114 -0
  301. package/dist/commands/mcp.check.js.map +1 -0
  302. package/dist/commands/mcp.d.ts +18 -0
  303. package/dist/commands/mcp.d.ts.map +1 -0
  304. package/dist/commands/mcp.js +183 -0
  305. package/dist/commands/mcp.js.map +1 -0
  306. package/dist/commands/mcp.list.d.ts +9 -0
  307. package/dist/commands/mcp.list.d.ts.map +1 -0
  308. package/dist/commands/mcp.list.js +93 -0
  309. package/dist/commands/mcp.list.js.map +1 -0
  310. package/dist/commands/mcp.permit.d.ts +12 -0
  311. package/dist/commands/mcp.permit.d.ts.map +1 -0
  312. package/dist/commands/mcp.permit.js +117 -0
  313. package/dist/commands/mcp.permit.js.map +1 -0
  314. package/dist/commands/mcp.remove.d.ts +9 -0
  315. package/dist/commands/mcp.remove.d.ts.map +1 -0
  316. package/dist/commands/mcp.remove.js +65 -0
  317. package/dist/commands/mcp.remove.js.map +1 -0
  318. package/dist/commands/plugin.org.install_bulk.js +1 -1
  319. package/dist/commands/plugin.org.install_bulk.js.map +1 -1
  320. package/dist/commands/privacy.erase.test.js +7 -0
  321. package/dist/commands/privacy.erase.test.js.map +1 -1
  322. package/dist/commands/replay.d.ts +5 -0
  323. package/dist/commands/replay.d.ts.map +1 -0
  324. package/dist/commands/replay.js +28 -0
  325. package/dist/commands/replay.js.map +1 -0
  326. package/dist/commands/rules.d.ts +19 -0
  327. package/dist/commands/rules.d.ts.map +1 -0
  328. package/dist/commands/rules.js +96 -0
  329. package/dist/commands/rules.js.map +1 -0
  330. package/dist/commands/schema/schema.config.d.ts +3 -0
  331. package/dist/commands/schema/schema.config.d.ts.map +1 -0
  332. package/dist/commands/schema/schema.config.js +34 -0
  333. package/dist/commands/schema/schema.config.js.map +1 -0
  334. package/dist/commands/schema/schema.disable.d.ts +3 -0
  335. package/dist/commands/schema/schema.disable.d.ts.map +1 -0
  336. package/dist/commands/schema/schema.disable.js +22 -0
  337. package/dist/commands/schema/schema.disable.js.map +1 -0
  338. package/dist/commands/schema/schema.enable.d.ts +3 -0
  339. package/dist/commands/schema/schema.enable.d.ts.map +1 -0
  340. package/dist/commands/schema/schema.enable.js +22 -0
  341. package/dist/commands/schema/schema.enable.js.map +1 -0
  342. package/dist/commands/schema/schema.export.d.ts +3 -0
  343. package/dist/commands/schema/schema.export.d.ts.map +1 -0
  344. package/dist/commands/schema/schema.export.js +31 -0
  345. package/dist/commands/schema/schema.export.js.map +1 -0
  346. package/dist/commands/schema/schema.get.d.ts +3 -0
  347. package/dist/commands/schema/schema.get.d.ts.map +1 -0
  348. package/dist/commands/schema/schema.get.js +23 -0
  349. package/dist/commands/schema/schema.get.js.map +1 -0
  350. package/dist/commands/schema/schema.label.d.ts +5 -0
  351. package/dist/commands/schema/schema.label.d.ts.map +1 -0
  352. package/dist/commands/schema/schema.label.js +60 -0
  353. package/dist/commands/schema/schema.label.js.map +1 -0
  354. package/dist/commands/schema/schema.list.d.ts +3 -0
  355. package/dist/commands/schema/schema.list.d.ts.map +1 -0
  356. package/dist/commands/schema/schema.list.js +30 -0
  357. package/dist/commands/schema/schema.list.js.map +1 -0
  358. package/dist/commands/schema/schema.prop.d.ts +5 -0
  359. package/dist/commands/schema/schema.prop.d.ts.map +1 -0
  360. package/dist/commands/schema/schema.prop.js +72 -0
  361. package/dist/commands/schema/schema.prop.js.map +1 -0
  362. package/dist/commands/schema/schema.reconcile.d.ts +10 -0
  363. package/dist/commands/schema/schema.reconcile.d.ts.map +1 -0
  364. package/dist/commands/schema/schema.reconcile.js +65 -0
  365. package/dist/commands/schema/schema.reconcile.js.map +1 -0
  366. package/dist/commands/schema/schema.rel.d.ts +5 -0
  367. package/dist/commands/schema/schema.rel.d.ts.map +1 -0
  368. package/dist/commands/schema/schema.rel.js +65 -0
  369. package/dist/commands/schema/schema.rel.js.map +1 -0
  370. package/dist/commands/schema/schema.version.d.ts +7 -0
  371. package/dist/commands/schema/schema.version.d.ts.map +1 -0
  372. package/dist/commands/schema/schema.version.js +96 -0
  373. package/dist/commands/schema/schema.version.js.map +1 -0
  374. package/dist/commands/secret.d.ts +23 -0
  375. package/dist/commands/secret.d.ts.map +1 -0
  376. package/dist/commands/secret.js +90 -0
  377. package/dist/commands/secret.js.map +1 -0
  378. package/dist/commands/settings.d.ts +10 -0
  379. package/dist/commands/settings.d.ts.map +1 -0
  380. package/dist/commands/settings.js +117 -0
  381. package/dist/commands/settings.js.map +1 -0
  382. package/dist/commands/skill.create.d.ts +3 -0
  383. package/dist/commands/skill.create.d.ts.map +1 -0
  384. package/dist/commands/skill.create.js +52 -0
  385. package/dist/commands/skill.create.js.map +1 -0
  386. package/dist/commands/skill.enable.d.ts +3 -0
  387. package/dist/commands/skill.enable.d.ts.map +1 -0
  388. package/dist/commands/skill.enable.js +31 -0
  389. package/dist/commands/skill.enable.js.map +1 -0
  390. package/dist/commands.test.js +1291 -281
  391. package/dist/commands.test.js.map +1 -1
  392. package/dist/components/DevStatus.d.ts.map +1 -1
  393. package/dist/components/DevStatus.js +3 -2
  394. package/dist/components/DevStatus.js.map +1 -1
  395. package/dist/daemon/client.d.ts +30 -0
  396. package/dist/daemon/client.d.ts.map +1 -0
  397. package/dist/daemon/client.js +97 -0
  398. package/dist/daemon/client.js.map +1 -0
  399. package/dist/daemon/code-graph/builder.d.ts +6 -0
  400. package/dist/daemon/code-graph/builder.d.ts.map +1 -0
  401. package/dist/daemon/code-graph/builder.js +215 -0
  402. package/dist/daemon/code-graph/builder.js.map +1 -0
  403. package/dist/daemon/code-graph/query.d.ts +29 -0
  404. package/dist/daemon/code-graph/query.d.ts.map +1 -0
  405. package/dist/daemon/code-graph/query.js +98 -0
  406. package/dist/daemon/code-graph/query.js.map +1 -0
  407. package/dist/daemon/code-graph/types.d.ts +37 -0
  408. package/dist/daemon/code-graph/types.d.ts.map +1 -0
  409. package/dist/daemon/code-graph/types.js +5 -0
  410. package/dist/daemon/code-graph/types.js.map +1 -0
  411. package/dist/daemon/code-graph/watcher.d.ts +37 -0
  412. package/dist/daemon/code-graph/watcher.d.ts.map +1 -0
  413. package/dist/daemon/code-graph/watcher.js +79 -0
  414. package/dist/daemon/code-graph/watcher.js.map +1 -0
  415. package/dist/daemon/lifecycle.d.ts +6 -0
  416. package/dist/daemon/lifecycle.d.ts.map +1 -0
  417. package/dist/daemon/lifecycle.js +132 -0
  418. package/dist/daemon/lifecycle.js.map +1 -0
  419. package/dist/daemon/protocol.d.ts +113 -0
  420. package/dist/daemon/protocol.d.ts.map +1 -0
  421. package/dist/daemon/protocol.js +16 -0
  422. package/dist/daemon/protocol.js.map +1 -0
  423. package/dist/daemon/server.d.ts +26 -0
  424. package/dist/daemon/server.d.ts.map +1 -0
  425. package/dist/daemon/server.js +168 -0
  426. package/dist/daemon/server.js.map +1 -0
  427. package/dist/index.d.ts +1 -1
  428. package/dist/index.js +559 -357
  429. package/dist/index.js.map +1 -1
  430. package/dist/lib/api.d.ts +5 -0
  431. package/dist/lib/api.d.ts.map +1 -0
  432. package/dist/lib/api.js +52 -0
  433. package/dist/lib/api.js.map +1 -0
  434. package/dist/lib/config.d.ts +5 -0
  435. package/dist/lib/config.d.ts.map +1 -1
  436. package/dist/lib/config.js +8 -2
  437. package/dist/lib/config.js.map +1 -1
  438. package/dist/lib/differential-context.d.ts +46 -0
  439. package/dist/lib/differential-context.d.ts.map +1 -0
  440. package/dist/lib/differential-context.js +89 -0
  441. package/dist/lib/differential-context.js.map +1 -0
  442. package/dist/lib/resolve.d.ts +3 -0
  443. package/dist/lib/resolve.d.ts.map +1 -0
  444. package/dist/lib/resolve.js +29 -0
  445. package/dist/lib/resolve.js.map +1 -0
  446. package/dist/lib/structured-tool-io.d.ts +31 -0
  447. package/dist/lib/structured-tool-io.d.ts.map +1 -0
  448. package/dist/lib/structured-tool-io.js +56 -0
  449. package/dist/lib/structured-tool-io.js.map +1 -0
  450. package/dist/mcp/__tests__/client.test.d.ts +2 -0
  451. package/dist/mcp/__tests__/client.test.d.ts.map +1 -0
  452. package/dist/mcp/__tests__/client.test.js +101 -0
  453. package/dist/mcp/__tests__/client.test.js.map +1 -0
  454. package/dist/mcp/client.d.ts +89 -0
  455. package/dist/mcp/client.d.ts.map +1 -0
  456. package/dist/mcp/client.js +201 -0
  457. package/dist/mcp/client.js.map +1 -0
  458. package/dist/repl/__tests__/_queue_demo.test.d.ts +2 -0
  459. package/dist/repl/__tests__/_queue_demo.test.d.ts.map +1 -0
  460. package/dist/repl/__tests__/_queue_demo.test.js +40 -0
  461. package/dist/repl/__tests__/_queue_demo.test.js.map +1 -0
  462. package/dist/repl/__tests__/components.test.d.ts +2 -0
  463. package/dist/repl/__tests__/components.test.d.ts.map +1 -0
  464. package/dist/repl/__tests__/components.test.js +87 -0
  465. package/dist/repl/__tests__/components.test.js.map +1 -0
  466. package/dist/repl/__tests__/interactive.queue.test.d.ts +2 -0
  467. package/dist/repl/__tests__/interactive.queue.test.d.ts.map +1 -0
  468. package/dist/repl/__tests__/interactive.queue.test.js +124 -0
  469. package/dist/repl/__tests__/interactive.queue.test.js.map +1 -0
  470. package/dist/repl/components.d.ts +76 -0
  471. package/dist/repl/components.d.ts.map +1 -0
  472. package/dist/repl/components.js +182 -0
  473. package/dist/repl/components.js.map +1 -0
  474. package/dist/repl/interactive.d.ts +17 -0
  475. package/dist/repl/interactive.d.ts.map +1 -0
  476. package/dist/repl/interactive.js +439 -0
  477. package/dist/repl/interactive.js.map +1 -0
  478. package/dist/repl/one-shot.d.ts +25 -0
  479. package/dist/repl/one-shot.d.ts.map +1 -0
  480. package/dist/repl/one-shot.js +153 -0
  481. package/dist/repl/one-shot.js.map +1 -0
  482. package/dist/rules/__tests__/enforce.test.d.ts +2 -0
  483. package/dist/rules/__tests__/enforce.test.d.ts.map +1 -0
  484. package/dist/rules/__tests__/enforce.test.js +58 -0
  485. package/dist/rules/__tests__/enforce.test.js.map +1 -0
  486. package/dist/rules/__tests__/loader.test.d.ts +2 -0
  487. package/dist/rules/__tests__/loader.test.d.ts.map +1 -0
  488. package/dist/rules/__tests__/loader.test.js +54 -0
  489. package/dist/rules/__tests__/loader.test.js.map +1 -0
  490. package/dist/rules/enforce.d.ts +23 -0
  491. package/dist/rules/enforce.d.ts.map +1 -0
  492. package/dist/rules/enforce.js +36 -0
  493. package/dist/rules/enforce.js.map +1 -0
  494. package/dist/rules/index.d.ts +10 -0
  495. package/dist/rules/index.d.ts.map +1 -0
  496. package/dist/rules/index.js +4 -0
  497. package/dist/rules/index.js.map +1 -0
  498. package/dist/rules/loader.d.ts +10 -0
  499. package/dist/rules/loader.d.ts.map +1 -0
  500. package/dist/rules/loader.js +77 -0
  501. package/dist/rules/loader.js.map +1 -0
  502. package/dist/rules/types.d.ts +39 -0
  503. package/dist/rules/types.d.ts.map +1 -0
  504. package/dist/rules/types.js +16 -0
  505. package/dist/rules/types.js.map +1 -0
  506. package/dist/rules/write.d.ts +10 -0
  507. package/dist/rules/write.d.ts.map +1 -0
  508. package/dist/rules/write.js +28 -0
  509. package/dist/rules/write.js.map +1 -0
  510. package/dist/settings/__tests__/gate.test.d.ts +2 -0
  511. package/dist/settings/__tests__/gate.test.d.ts.map +1 -0
  512. package/dist/settings/__tests__/gate.test.js +137 -0
  513. package/dist/settings/__tests__/gate.test.js.map +1 -0
  514. package/dist/settings/__tests__/hooks.test.d.ts +2 -0
  515. package/dist/settings/__tests__/hooks.test.d.ts.map +1 -0
  516. package/dist/settings/__tests__/hooks.test.js +103 -0
  517. package/dist/settings/__tests__/hooks.test.js.map +1 -0
  518. package/dist/settings/__tests__/mcp-write.test.d.ts +2 -0
  519. package/dist/settings/__tests__/mcp-write.test.d.ts.map +1 -0
  520. package/dist/settings/__tests__/mcp-write.test.js +77 -0
  521. package/dist/settings/__tests__/mcp-write.test.js.map +1 -0
  522. package/dist/settings/__tests__/permissions-gate.test.d.ts +2 -0
  523. package/dist/settings/__tests__/permissions-gate.test.d.ts.map +1 -0
  524. package/dist/settings/__tests__/permissions-gate.test.js +75 -0
  525. package/dist/settings/__tests__/permissions-gate.test.js.map +1 -0
  526. package/dist/settings/__tests__/resolve.test.d.ts +2 -0
  527. package/dist/settings/__tests__/resolve.test.d.ts.map +1 -0
  528. package/dist/settings/__tests__/resolve.test.js +109 -0
  529. package/dist/settings/__tests__/resolve.test.js.map +1 -0
  530. package/dist/settings/__tests__/runtime.test.d.ts +2 -0
  531. package/dist/settings/__tests__/runtime.test.d.ts.map +1 -0
  532. package/dist/settings/__tests__/runtime.test.js +72 -0
  533. package/dist/settings/__tests__/runtime.test.js.map +1 -0
  534. package/dist/settings/__tests__/schema.test.d.ts +2 -0
  535. package/dist/settings/__tests__/schema.test.d.ts.map +1 -0
  536. package/dist/settings/__tests__/schema.test.js +55 -0
  537. package/dist/settings/__tests__/schema.test.js.map +1 -0
  538. package/dist/settings/__tests__/write.test.d.ts +2 -0
  539. package/dist/settings/__tests__/write.test.d.ts.map +1 -0
  540. package/dist/settings/__tests__/write.test.js +61 -0
  541. package/dist/settings/__tests__/write.test.js.map +1 -0
  542. package/dist/settings/gate.d.ts +34 -0
  543. package/dist/settings/gate.d.ts.map +1 -0
  544. package/dist/settings/gate.js +50 -0
  545. package/dist/settings/gate.js.map +1 -0
  546. package/dist/settings/hooks.d.ts +26 -0
  547. package/dist/settings/hooks.d.ts.map +1 -0
  548. package/dist/settings/hooks.js +115 -0
  549. package/dist/settings/hooks.js.map +1 -0
  550. package/dist/settings/index.d.ts +23 -0
  551. package/dist/settings/index.d.ts.map +1 -0
  552. package/dist/settings/index.js +23 -0
  553. package/dist/settings/index.js.map +1 -0
  554. package/dist/settings/mcp-write.d.ts +41 -0
  555. package/dist/settings/mcp-write.d.ts.map +1 -0
  556. package/dist/settings/mcp-write.js +61 -0
  557. package/dist/settings/mcp-write.js.map +1 -0
  558. package/dist/settings/permissions-gate.d.ts +19 -0
  559. package/dist/settings/permissions-gate.d.ts.map +1 -0
  560. package/dist/settings/permissions-gate.js +103 -0
  561. package/dist/settings/permissions-gate.js.map +1 -0
  562. package/dist/settings/resolve.d.ts +37 -0
  563. package/dist/settings/resolve.d.ts.map +1 -0
  564. package/dist/settings/resolve.js +169 -0
  565. package/dist/settings/resolve.js.map +1 -0
  566. package/dist/settings/runtime.d.ts +28 -0
  567. package/dist/settings/runtime.d.ts.map +1 -0
  568. package/dist/settings/runtime.js +45 -0
  569. package/dist/settings/runtime.js.map +1 -0
  570. package/dist/settings/schema.d.ts +1387 -0
  571. package/dist/settings/schema.d.ts.map +1 -0
  572. package/dist/settings/schema.js +146 -0
  573. package/dist/settings/schema.js.map +1 -0
  574. package/dist/settings/write.d.ts +37 -0
  575. package/dist/settings/write.d.ts.map +1 -0
  576. package/dist/settings/write.js +85 -0
  577. package/dist/settings/write.js.map +1 -0
  578. package/dist/slash/__tests__/expand.test.d.ts +2 -0
  579. package/dist/slash/__tests__/expand.test.d.ts.map +1 -0
  580. package/dist/slash/__tests__/expand.test.js +44 -0
  581. package/dist/slash/__tests__/expand.test.js.map +1 -0
  582. package/dist/slash/__tests__/loader.test.d.ts +2 -0
  583. package/dist/slash/__tests__/loader.test.d.ts.map +1 -0
  584. package/dist/slash/__tests__/loader.test.js +48 -0
  585. package/dist/slash/__tests__/loader.test.js.map +1 -0
  586. package/dist/slash/expand.d.ts +32 -0
  587. package/dist/slash/expand.d.ts.map +1 -0
  588. package/dist/slash/expand.js +48 -0
  589. package/dist/slash/expand.js.map +1 -0
  590. package/dist/slash/index.d.ts +11 -0
  591. package/dist/slash/index.d.ts.map +1 -0
  592. package/dist/slash/index.js +4 -0
  593. package/dist/slash/index.js.map +1 -0
  594. package/dist/slash/loader.d.ts +10 -0
  595. package/dist/slash/loader.d.ts.map +1 -0
  596. package/dist/slash/loader.js +64 -0
  597. package/dist/slash/loader.js.map +1 -0
  598. package/dist/slash/types.d.ts +24 -0
  599. package/dist/slash/types.d.ts.map +1 -0
  600. package/dist/slash/types.js +11 -0
  601. package/dist/slash/types.js.map +1 -0
  602. package/dist/slash/write.d.ts +10 -0
  603. package/dist/slash/write.d.ts.map +1 -0
  604. package/dist/slash/write.js +26 -0
  605. package/dist/slash/write.js.map +1 -0
  606. package/dist/tui/__tests__/app.test.d.ts +2 -0
  607. package/dist/tui/__tests__/app.test.d.ts.map +1 -0
  608. package/dist/tui/__tests__/app.test.js +136 -0
  609. package/dist/tui/__tests__/app.test.js.map +1 -0
  610. package/dist/tui/__tests__/banner.test.d.ts +2 -0
  611. package/dist/tui/__tests__/banner.test.d.ts.map +1 -0
  612. package/dist/tui/__tests__/banner.test.js +15 -0
  613. package/dist/tui/__tests__/banner.test.js.map +1 -0
  614. package/dist/tui/__tests__/command-form.test.d.ts +2 -0
  615. package/dist/tui/__tests__/command-form.test.d.ts.map +1 -0
  616. package/dist/tui/__tests__/command-form.test.js +96 -0
  617. package/dist/tui/__tests__/command-form.test.js.map +1 -0
  618. package/dist/tui/__tests__/command-tree.test.d.ts +2 -0
  619. package/dist/tui/__tests__/command-tree.test.d.ts.map +1 -0
  620. package/dist/tui/__tests__/command-tree.test.js +55 -0
  621. package/dist/tui/__tests__/command-tree.test.js.map +1 -0
  622. package/dist/tui/__tests__/runner.test.d.ts +2 -0
  623. package/dist/tui/__tests__/runner.test.d.ts.map +1 -0
  624. package/dist/tui/__tests__/runner.test.js +38 -0
  625. package/dist/tui/__tests__/runner.test.js.map +1 -0
  626. package/dist/tui/__tests__/theme.test.d.ts +2 -0
  627. package/dist/tui/__tests__/theme.test.d.ts.map +1 -0
  628. package/dist/tui/__tests__/theme.test.js +11 -0
  629. package/dist/tui/__tests__/theme.test.js.map +1 -0
  630. package/dist/tui/agent-view/activity-feed.d.ts +3 -0
  631. package/dist/tui/agent-view/activity-feed.d.ts.map +1 -0
  632. package/dist/tui/agent-view/activity-feed.js +34 -0
  633. package/dist/tui/agent-view/activity-feed.js.map +1 -0
  634. package/dist/tui/agent-view/budget-bar.d.ts +3 -0
  635. package/dist/tui/agent-view/budget-bar.d.ts.map +1 -0
  636. package/dist/tui/agent-view/budget-bar.js +53 -0
  637. package/dist/tui/agent-view/budget-bar.js.map +1 -0
  638. package/dist/tui/agent-view/compile-panel.d.ts +3 -0
  639. package/dist/tui/agent-view/compile-panel.d.ts.map +1 -0
  640. package/dist/tui/agent-view/compile-panel.js +34 -0
  641. package/dist/tui/agent-view/compile-panel.js.map +1 -0
  642. package/dist/tui/agent-view/index.d.ts +4 -0
  643. package/dist/tui/agent-view/index.d.ts.map +1 -0
  644. package/dist/tui/agent-view/index.js +31 -0
  645. package/dist/tui/agent-view/index.js.map +1 -0
  646. package/dist/tui/agent-view/memory-panel.d.ts +3 -0
  647. package/dist/tui/agent-view/memory-panel.d.ts.map +1 -0
  648. package/dist/tui/agent-view/memory-panel.js +80 -0
  649. package/dist/tui/agent-view/memory-panel.js.map +1 -0
  650. package/dist/tui/agent-view/session-panel.d.ts +3 -0
  651. package/dist/tui/agent-view/session-panel.d.ts.map +1 -0
  652. package/dist/tui/agent-view/session-panel.js +44 -0
  653. package/dist/tui/agent-view/session-panel.js.map +1 -0
  654. package/dist/tui/agent-view/status-bar.d.ts +7 -0
  655. package/dist/tui/agent-view/status-bar.d.ts.map +1 -0
  656. package/dist/tui/agent-view/status-bar.js +22 -0
  657. package/dist/tui/agent-view/status-bar.js.map +1 -0
  658. package/dist/tui/app.d.ts +9 -0
  659. package/dist/tui/app.d.ts.map +1 -0
  660. package/dist/tui/app.js +115 -0
  661. package/dist/tui/app.js.map +1 -0
  662. package/dist/tui/banner.d.ts +5 -0
  663. package/dist/tui/banner.d.ts.map +1 -0
  664. package/dist/tui/banner.js +17 -0
  665. package/dist/tui/banner.js.map +1 -0
  666. package/dist/tui/command-form.d.ts +9 -0
  667. package/dist/tui/command-form.d.ts.map +1 -0
  668. package/dist/tui/command-form.js +76 -0
  669. package/dist/tui/command-form.js.map +1 -0
  670. package/dist/tui/command-tree.d.ts +30 -0
  671. package/dist/tui/command-tree.d.ts.map +1 -0
  672. package/dist/tui/command-tree.js +43 -0
  673. package/dist/tui/command-tree.js.map +1 -0
  674. package/dist/tui/fleet-view/agent-row.d.ts +10 -0
  675. package/dist/tui/fleet-view/agent-row.d.ts.map +1 -0
  676. package/dist/tui/fleet-view/agent-row.js +80 -0
  677. package/dist/tui/fleet-view/agent-row.js.map +1 -0
  678. package/dist/tui/fleet-view/dispatch-input.d.ts +5 -0
  679. package/dist/tui/fleet-view/dispatch-input.d.ts.map +1 -0
  680. package/dist/tui/fleet-view/dispatch-input.js +36 -0
  681. package/dist/tui/fleet-view/dispatch-input.js.map +1 -0
  682. package/dist/tui/fleet-view/fleet-app.d.ts +11 -0
  683. package/dist/tui/fleet-view/fleet-app.d.ts.map +1 -0
  684. package/dist/tui/fleet-view/fleet-app.js +95 -0
  685. package/dist/tui/fleet-view/fleet-app.js.map +1 -0
  686. package/dist/tui/fleet-view/fleet-summary.d.ts +6 -0
  687. package/dist/tui/fleet-view/fleet-summary.d.ts.map +1 -0
  688. package/dist/tui/fleet-view/fleet-summary.js +19 -0
  689. package/dist/tui/fleet-view/fleet-summary.js.map +1 -0
  690. package/dist/tui/fleet-view/index.d.ts +16 -0
  691. package/dist/tui/fleet-view/index.d.ts.map +1 -0
  692. package/dist/tui/fleet-view/index.js +65 -0
  693. package/dist/tui/fleet-view/index.js.map +1 -0
  694. package/dist/tui/runner.d.ts +7 -0
  695. package/dist/tui/runner.d.ts.map +1 -0
  696. package/dist/tui/runner.js +36 -0
  697. package/dist/tui/runner.js.map +1 -0
  698. package/dist/tui/theme.d.ts +8 -0
  699. package/dist/tui/theme.d.ts.map +1 -0
  700. package/dist/tui/theme.js +10 -0
  701. package/dist/tui/theme.js.map +1 -0
  702. package/package.json +16 -7
package/dist/index.js CHANGED
@@ -1,364 +1,566 @@
1
- #!/usr/bin/env node
2
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ #!/usr/bin/env tsx
2
+ /**
3
+ * oxagen — agentic coding CLI powered by the Oxagen context engine.
4
+ *
5
+ * Usage:
6
+ * oxagen Interactive REPL (default)
7
+ * oxagen "fix the login bug" One-shot prompt
8
+ * oxagen agents [goal...] Agents screen — plan, dispatch & watch a fleet
9
+ * oxagen view Agent dashboard (memory, compile, sessions)
10
+ * oxagen daemon start|stop|status
11
+ * oxagen config [key] [value]
12
+ */
13
+ import { createRequire } from "node:module";
3
14
  import { Command } from "commander";
4
- import { render } from "ink";
5
- import React from "react";
6
- import { DevStatus } from "./components/DevStatus.js";
7
- import { version } from "../package.json" with { type: "json" };
8
- import { authLoginCommand } from "./commands/auth.login.js";
9
- import { authLogoutCommand } from "./commands/auth.logout.js";
10
- import { authWhoamiCommand } from "./commands/auth.whoami.js";
11
- import { orgListCommand } from "./commands/org.list.js";
12
- import { orgCreateCommand } from "./commands/org.create.js";
13
- import { orgMemberAddCommand } from "./commands/org.member.add.js";
14
- import { orgMemberRemoveCommand } from "./commands/org.member.remove.js";
15
- import { workspaceListCommand } from "./commands/workspace.list.js";
16
- import { workspaceCreateCommand } from "./commands/workspace.create.js";
17
- import { chatSendCommand } from "./commands/chat.send.js";
18
- import { conversationListCommand } from "./commands/conversation.list.js";
19
- import { conversationDeleteCommand } from "./commands/conversation.delete.js";
20
- import { conversationArchiveCommand } from "./commands/conversation.archive.js";
21
- import { conversationRenameCommand } from "./commands/conversation.rename.js";
22
- import { apiKeyCreateCommand } from "./commands/api-key.create.js";
23
- import { apiKeyRevokeCommand } from "./commands/api-key.revoke.js";
24
- import { notificationsListCommand } from "./commands/notifications.list.js";
25
- import { notificationsMarkCommand } from "./commands/notifications.mark.js";
26
- import { pluginListCommand } from "./commands/plugin.list.js";
27
- import { pluginInstallCommand } from "./commands/plugin.install.js";
28
- import { pluginUninstallCommand } from "./commands/plugin.uninstall.js";
29
- import { pluginOrgInstallCommand } from "./commands/plugin.org.install.js";
30
- import { pluginOrgUninstallCommand } from "./commands/plugin.org.uninstall.js";
31
- import { pluginCatalogGetCommand } from "./commands/plugin.catalog.get.js";
32
- import { billingStatusCommand } from "./commands/billing.status.js";
33
- import { billingCreditsPurchaseCommand } from "./commands/billing.credits.purchase.js";
34
- import { billingSubscriptionReadCommand } from "./commands/billing.subscription.read.js";
35
- import { agentMcpListCommand } from "./commands/agent.mcp.list.js";
36
- import { agentSkillListCommand } from "./commands/agent.skill.list.js";
37
- import { agentToolListCommand } from "./commands/agent.tool.list.js";
38
- import { agentApprovalResolveCommand } from "./commands/agent.approval.resolve.js";
39
- import { orgMemberRoleChangeCommand } from "./commands/org.member.role.change.js";
40
- import { archiveCreateCommand } from "./commands/archive.create.js";
41
- import { workflowRunCommand } from "./commands/workflow.run.js";
42
- import { userPreferencesGetCommand } from "./commands/user.preferences.get.js";
43
- import { userPreferencesUpdateCommand } from "./commands/user.preferences.update.js";
44
- import { workspaceMemberListCommand } from "./commands/workspace.member.list.js";
45
- import { workspaceInviteSendCommand } from "./commands/workspace.invite.send.js";
46
- import { conversationChatCommand } from "./commands/conversation.chat.js";
47
- import { imageCreateCommand } from "./commands/image.create.js";
48
- import { documentCreateCommand } from "./commands/document.create.js";
49
- import { automationListCommand } from "./commands/automation.list.js";
50
- import { automationEnableCommand } from "./commands/automation.enable.js";
51
- import { automationDisableCommand } from "./commands/automation.disable.js";
52
- import { imageListCommand } from "./commands/image.list.js";
53
- import { imageAnalyzeCommand } from "./commands/image.analyze.js";
54
- import { documentListCommand } from "./commands/document.list.js";
55
- import { documentReadCommand } from "./commands/document.read.js";
56
- import { formCreateCommand } from "./commands/form.create.js";
57
- import { formSubmitCommand } from "./commands/form.submit.js";
58
- import { automationCreateCommand } from "./commands/automation.create.js";
59
- import { automationUpdateCommand } from "./commands/automation.update.js";
60
- import { automationTriggerCommand } from "./commands/automation.trigger.js";
61
- import { skillWorkspaceListCommand } from "./commands/skill.workspace.list.js";
62
- import { skillWorkspaceInstallCommand } from "./commands/skill.workspace.install.js";
63
- import { skillVersionListCommand } from "./commands/skill.version.list.js";
64
- import { skillVersionGetCommand } from "./commands/skill.version.get.js";
65
- import { skillVersionUploadCommand } from "./commands/skill.version.upload.js";
66
- import { skillVersionActivateCommand } from "./commands/skill.version.activate.js";
67
- import { skillEditCommand } from "./commands/skill.edit.js";
68
- import { skillExportCommand } from "./commands/skill.export.js";
69
- import { skillMetricsReadCommand } from "./commands/skill.metrics.read.js";
70
- import { agentMemoryRecallCommand } from "./commands/agent.memory.recall.js";
71
- import { agentMemoryWriteCommand } from "./commands/agent.memory.write.js";
72
- import { videoGenerateCommand } from "./commands/video.generate.js";
73
- import { svgGenerateCommand } from "./commands/svg.generate.js";
74
- import { workspaceModelSettingsReadCommand } from "./commands/workspace.model.settings.read.js";
75
- import { workspaceModelSettingsWriteCommand } from "./commands/workspace.model.settings.write.js";
76
- import { orgMemberInviteAcceptCommand } from "./commands/org.member.invite.accept.js";
77
- import { pluginRegistryListCommand } from "./commands/plugin.registry.list.js";
78
- import { pluginCatalogBrowseCommand } from "./commands/plugin.catalog.browse.js";
79
- import { pluginCredentialReauthCommand } from "./commands/plugin.credential.reauth.js";
80
- import { imageGenerateCommand } from "./commands/image.generate.js";
81
- import { documentsGenerateCommand } from "./commands/documents.generate.js";
82
- import { pluginRegistryAddCommand } from "./commands/plugin.registry.add.js";
83
- import { agentMcpRegisterCommand } from "./commands/agent.mcp.register.js";
84
- import { agentMcpSetEnabledCommand } from "./commands/agent.mcp.set_enabled.js";
85
- import { agentMcpDeleteCommand } from "./commands/agent.mcp.delete.js";
86
- import { agentMcpConsentResolveCommand } from "./commands/agent.mcp.consent.resolve.js";
87
- import { agentMcpConsentListCommand } from "./commands/agent.mcp.consent.list.js";
88
- import { agentPlanApproveCommand } from "./commands/agent.plan.approve.js";
89
- import { agentPlanCreateCommand } from "./commands/agent.plan.create.js";
90
- import { agentTaskBackgroundReadCommand } from "./commands/agent.task.background.read.js";
91
- import { agentTaskBackgroundStartCommand } from "./commands/agent.task.background.start.js";
92
- import { agentTaskBackgroundCancelCommand } from "./commands/agent.task.background.cancel.js";
93
- import { assetUploadCommand } from "./commands/asset.upload.js";
94
- import { billingSubscriptionUpgradeStartCommand } from "./commands/billing.subscription.upgrade.start.js";
95
- import { brandkitApplyCommand } from "./commands/brandkit.apply.js";
96
- import { conversationPurgeCommand } from "./commands/conversation.purge.js";
97
- import { conversationFilesListCommand } from "./commands/conversation.files.list.js";
98
- import { documentsPdfCreateCommand } from "./commands/documents.pdf.create.js";
99
- import { markdownGenerateCommand } from "./commands/markdown.generate.js";
100
- import { mermaidGenerateCommand } from "./commands/mermaid.generate.js";
101
- import { formFillCommand } from "./commands/form.fill.js";
102
- import { orgMemberInviteDeclineCommand } from "./commands/org.member.invite.decline.js";
103
- import { organizationCreateCommand } from "./commands/organization.create.js";
104
- import { pluginCredentialSetSecretCommand } from "./commands/plugin.credential.set_secret.js";
105
- import { pluginOrgInstallBulkCommand } from "./commands/plugin.org.install_bulk.js";
106
- import { pluginOrgListCommand } from "./commands/plugin.org.list.js";
107
- import { pluginOrgSetEnabledCommand } from "./commands/plugin.org.set_enabled.js";
108
- import { pluginRegistryRemoveCommand } from "./commands/plugin.registry.remove.js";
109
- import { pluginSettingsSetAuthAlertsCommand } from "./commands/plugin.settings.set_auth_alerts.js";
110
- import { pluginWorkspaceSetEnabledCommand } from "./commands/plugin.workspace.set_enabled.js";
111
- import { systemInstallInstructionsCommand } from "./commands/system.install.instructions.js";
112
- import { workflowCancelCommand } from "./commands/workflow.cancel.js";
113
- import { workflowStatusCommand } from "./commands/workflow.status.js";
114
- import { userPreferencesReadCommand } from "./commands/user.preferences.read.js";
115
- import { userPreferencesWriteCommand } from "./commands/user.preferences.write.js";
116
- import { privacyExportCommand } from "./commands/privacy.export.js";
117
- import { privacyEraseCommand } from "./commands/privacy.erase.js";
118
- import { graphNodeUpsertCommand } from "./commands/graph.node.upsert.js";
119
- import { graphNodeGetCommand } from "./commands/graph.node.get.js";
120
- import { graphNodeDeleteCommand } from "./commands/graph.node.delete.js";
121
- import { graphNodeSearchCommand } from "./commands/graph.node.search.js";
122
- import { graphEdgeUpsertCommand } from "./commands/graph.edge.upsert.js";
123
- import { graphEdgeDeleteCommand } from "./commands/graph.edge.delete.js";
124
- import { graphCypherCommand } from "./commands/graph.cypher.js";
125
- import { ontologyQueryCommand } from "./commands/ontology.query.js";
126
- import { ontologyNeighborsCommand } from "./commands/ontology.neighbors.js";
127
- import { auditLogQueryCommand } from "./commands/audit.log.query.js";
128
- import { webSearchCommand } from "./commands/web.search.js";
129
- import { webFetchCommand } from "./commands/web.fetch.js";
130
- import { researchSwarmStartCommand } from "./commands/research.swarm.start.js";
131
- import { researchSwarmStatusCommand } from "./commands/research.swarm.status.js";
15
+ import pkg from "../package.json" with { type: "json" };
16
+ import { parseModeArg } from "./agent/permissions.js";
17
+ // The Oxagen context engine pulls in DuckDB, a native CommonJS dependency that
18
+ // references a bare `require`. Under pure-ESM execution that global is absent, so
19
+ // loading the store throws "require is not defined". Provide the shim before any
20
+ // code path dynamically imports the context engine.
21
+ {
22
+ const g = globalThis;
23
+ if (typeof g.require === "undefined")
24
+ g.require = createRequire(import.meta.url);
25
+ }
26
+ const { version } = pkg;
132
27
  const program = new Command();
133
28
  program
134
29
  .name("oxagen")
135
- .description("Oxagen developer CLI")
136
- .version(version);
30
+ .description("Agentic coding assistant — powered by the Oxagen context engine")
31
+ .version(version)
32
+ .argument("[prompt...]", "One-shot prompt (runs and exits)")
33
+ .option("-m, --model <slug>", "Gateway model slug (overrides config/default)")
34
+ .option("--agent <name>", "Run the one-shot prompt as a named agent definition")
35
+ .option("--readonly", "Read-only mode: read/search/explain only — no file edits or commands", false)
36
+ .option("--mode <mode>", "Permission mode: ask | accept-edits | bypass | readonly (REPL default: ask; one-shot ungated unless set)")
37
+ .option("--no-pipeline", "Skip prompt evaluation, context injection, and completeness judging")
38
+ .option("--verbose", "Capture + emit full per-turn telemetry (per-phase timing, model+token+cost, tool results)", false)
39
+ .action(async (promptWords, opts) => {
40
+ const prompt = promptWords.join(" ").trim();
41
+ let mode;
42
+ if (opts.mode) {
43
+ mode = parseModeArg(opts.mode);
44
+ if (!mode) {
45
+ process.stderr.write(`Error: invalid --mode "${opts.mode}". Use ask, accept-edits, bypass, or readonly.\n`);
46
+ process.exitCode = 1;
47
+ return;
48
+ }
49
+ }
50
+ const runOpts = {
51
+ model: opts.model,
52
+ readOnly: opts.readonly,
53
+ mode,
54
+ bare: opts.pipeline === false,
55
+ verbose: opts.verbose,
56
+ };
57
+ // --agent: run the prompt as a named agent (its prompt, tools, model).
58
+ if (opts.agent) {
59
+ if (!prompt) {
60
+ process.stderr.write("Error: --agent requires a prompt, e.g. `oxagen --agent reviewer \"…\"`.\n");
61
+ process.exitCode = 1;
62
+ return;
63
+ }
64
+ const { runAgentOneShot } = await import("./repl/one-shot.js");
65
+ await runAgentOneShot(prompt, opts.agent, runOpts);
66
+ return;
67
+ }
68
+ if (prompt) {
69
+ // One-shot mode: run prompt, stream response, exit
70
+ const { runOneShot } = await import("./repl/one-shot.js");
71
+ await runOneShot(prompt, runOpts);
72
+ }
73
+ else if (process.stdout.isTTY) {
74
+ // Interactive REPL mode
75
+ const { launchRepl } = await import("./repl/interactive.js");
76
+ await launchRepl(runOpts);
77
+ }
78
+ else {
79
+ // Piped input — read from stdin
80
+ const { runFromStdin } = await import("./repl/one-shot.js");
81
+ await runFromStdin(runOpts);
82
+ }
83
+ });
84
+ // ── view: agent dashboard ─────────────────────────────────────────────────────
85
+ program
86
+ .command("view")
87
+ .description("Launch the agent dashboard (memory, compile, sessions)")
88
+ .action(async () => {
89
+ const { launchAgentView } = await import("./tui/agent-view/index.js");
90
+ launchAgentView();
91
+ });
92
+ // ── agents: the agents screen (fleet) ─────────────────────────────────────────
93
+ program
94
+ .command("agents")
95
+ .description("Launch the agents screen — plan a goal, dispatch a fleet, watch it work")
96
+ .argument("[goal...]", "Goal to plan into tasks and run immediately")
97
+ .option("--concurrency <n>", "Max agents running at once", (v) => parseInt(v, 10), 4)
98
+ .option("--readonly", "Read-only agents: read/search/explain only — no file edits or commands", false)
99
+ .option("--isolate", "Run each agent in its own git worktree; commit + merge work back (no clobbering)", false)
100
+ .action(async (goal, opts) => {
101
+ const { launchFleetView } = await import("./tui/fleet-view/index.js");
102
+ await launchFleetView({
103
+ cwd: process.cwd(),
104
+ goal: goal.join(" ").trim() || undefined,
105
+ concurrency: opts.concurrency,
106
+ readOnly: opts.readonly,
107
+ isolate: opts.isolate,
108
+ });
109
+ });
110
+ // ── daemon: context daemon lifecycle ──────────────────────────────────────────
111
+ const daemon = program
112
+ .command("daemon")
113
+ .description("Manage the persistent context daemon");
114
+ daemon
115
+ .command("start")
116
+ .description("Start the context daemon (warm indexes, code graph)")
117
+ .option("--foreground", "Run in foreground (don't daemonize)", false)
118
+ .action(async (opts) => {
119
+ const { startDaemon } = await import("./daemon/lifecycle.js");
120
+ await startDaemon({ foreground: opts.foreground });
121
+ });
122
+ daemon
123
+ .command("stop")
124
+ .description("Stop the running context daemon")
125
+ .action(async () => {
126
+ const { stopDaemon } = await import("./daemon/lifecycle.js");
127
+ await stopDaemon();
128
+ });
129
+ daemon
130
+ .command("status")
131
+ .description("Show daemon health and uptime")
132
+ .action(async () => {
133
+ const { daemonStatus } = await import("./daemon/lifecycle.js");
134
+ await daemonStatus();
135
+ });
136
+ // ── replay: inspect how a past turn was handled ───────────────────────────────
137
+ program
138
+ .command("replay")
139
+ .description("Show how a past turn was handled (prompt, scores, context, model, judge)")
140
+ .argument("[turn]", "Turn index (1 = most recent) or id; omit for the latest")
141
+ .option("--list", "List recent turns instead of replaying one", false)
142
+ .action(async (turn, opts) => {
143
+ const { handleReplay } = await import("./commands/replay.js");
144
+ await handleReplay(turn, opts);
145
+ });
146
+ // ── cost: project + report model cost from the baked-in rate card ─────────────
137
147
  program
138
- .command("dev")
139
- .description("Show the current dev stack status")
140
- .action(() => {
141
- render(_jsx(DevStatus, {}));
142
- });
143
- // auth
144
- const auth = program.command("auth").description("Authentication commands");
145
- auth.addCommand(authLoginCommand);
146
- auth.addCommand(authLogoutCommand);
147
- auth.addCommand(authWhoamiCommand);
148
- // org
149
- const org = program.command("org").description("Organization commands");
150
- org.addCommand(orgListCommand);
151
- org.addCommand(orgCreateCommand);
152
- const orgMember = org.command("member").description("Org member management");
153
- orgMember.addCommand(orgMemberAddCommand);
154
- orgMember.addCommand(orgMemberRemoveCommand);
155
- orgMember.addCommand(orgMemberRoleChangeCommand);
156
- const orgMemberInvite = orgMember.command("invite").description("Org member invitations");
157
- orgMemberInvite.addCommand(orgMemberInviteAcceptCommand);
158
- orgMemberInvite.addCommand(orgMemberInviteDeclineCommand);
159
- org.addCommand(organizationCreateCommand);
160
- // workspace
161
- const workspace = program.command("workspace").description("Workspace commands");
162
- workspace.addCommand(workspaceListCommand);
163
- workspace.addCommand(workspaceCreateCommand);
164
- // chat
165
- const chat = program.command("chat").description("Chat and messaging commands");
166
- chat.addCommand(chatSendCommand);
167
- // conversation
168
- const conversation = program.command("conversation").description("Conversation management");
169
- conversation.addCommand(conversationListCommand);
170
- conversation.addCommand(conversationDeleteCommand);
171
- conversation.addCommand(conversationArchiveCommand);
172
- conversation.addCommand(conversationRenameCommand);
173
- // api-key
174
- const apiKey = program.command("api-key").description("API key management");
175
- apiKey.addCommand(apiKeyCreateCommand);
176
- apiKey.addCommand(apiKeyRevokeCommand);
177
- // notifications
178
- const notifications = program.command("notifications").description("Notification management");
179
- notifications.addCommand(notificationsListCommand);
180
- notifications.addCommand(notificationsMarkCommand);
181
- // plugin
182
- const plugin = program.command("plugin").description("Plugin marketplace commands");
183
- plugin.addCommand(pluginListCommand);
184
- plugin.addCommand(pluginInstallCommand);
185
- plugin.addCommand(pluginUninstallCommand);
186
- const pluginOrg = plugin.command("org").description("Plugin organization management");
187
- pluginOrg.addCommand(pluginOrgInstallCommand);
188
- pluginOrg.addCommand(pluginOrgUninstallCommand);
189
- const pluginCatalog = plugin.command("catalog").description("Plugin catalog");
190
- pluginCatalog.addCommand(pluginCatalogGetCommand);
191
- pluginCatalog.addCommand(pluginCatalogBrowseCommand);
192
- const pluginRegistry = plugin.command("registry").description("Plugin registry management");
193
- pluginRegistry.addCommand(pluginRegistryListCommand);
194
- pluginRegistry.addCommand(pluginRegistryAddCommand);
195
- pluginRegistry.addCommand(pluginRegistryRemoveCommand);
196
- const pluginCredential = plugin.command("credential").description("Plugin credential management");
197
- pluginCredential.addCommand(pluginCredentialReauthCommand);
198
- pluginCredential.addCommand(pluginCredentialSetSecretCommand);
199
- pluginOrg.addCommand(pluginOrgInstallBulkCommand);
200
- pluginOrg.addCommand(pluginOrgListCommand);
201
- pluginOrg.addCommand(pluginOrgSetEnabledCommand);
202
- const pluginSettings = plugin.command("settings").description("Plugin settings");
203
- pluginSettings.addCommand(pluginSettingsSetAuthAlertsCommand);
204
- pluginOrg.addCommand(pluginWorkspaceSetEnabledCommand);
205
- // billing
206
- const billing = program.command("billing").description("Billing and subscription commands");
207
- billing.addCommand(billingStatusCommand);
208
- billing.addCommand(billingCreditsPurchaseCommand);
209
- billing.addCommand(billingSubscriptionReadCommand);
210
- const billingSubscription = billing.command("subscription").description("Subscription management");
211
- billingSubscription.addCommand(billingSubscriptionUpgradeStartCommand);
212
- // agent
213
- const agent = program.command("agent").description("Agent commands");
214
- const agentMcp = agent.command("mcp").description("MCP server management");
215
- agentMcp.addCommand(agentMcpListCommand);
216
- const agentSkill = agent.command("skill").description("Agent skill management");
217
- agentSkill.addCommand(agentSkillListCommand);
218
- const agentTool = agent.command("tool").description("Agent tool management");
219
- agentTool.addCommand(agentToolListCommand);
220
- const agentApproval = agent.command("approval").description("Agent approval management");
221
- agentApproval.addCommand(agentApprovalResolveCommand);
222
- const agentMemory = agent.command("memory").description("Agent memory management");
223
- agentMemory.addCommand(agentMemoryRecallCommand);
224
- agentMemory.addCommand(agentMemoryWriteCommand);
225
- agentMcp.addCommand(agentMcpRegisterCommand);
226
- agentMcp.addCommand(agentMcpSetEnabledCommand);
227
- agentMcp.addCommand(agentMcpDeleteCommand);
228
- const agentMcpConsent = agentMcp.command("consent").description("External MCP tool consent grants");
229
- agentMcpConsent.addCommand(agentMcpConsentResolveCommand);
230
- agentMcpConsent.addCommand(agentMcpConsentListCommand);
231
- const agentPlan = agent.command("plan").description("Agent plan management");
232
- agentPlan.addCommand(agentPlanApproveCommand);
233
- agentPlan.addCommand(agentPlanCreateCommand);
234
- const agentTask = agent.command("task").description("Agent task management");
235
- const agentTaskBackground = agentTask.command("background").description("Background task management");
236
- agentTaskBackground.addCommand(agentTaskBackgroundReadCommand);
237
- agentTaskBackground.addCommand(agentTaskBackgroundStartCommand);
238
- agentTaskBackground.addCommand(agentTaskBackgroundCancelCommand);
239
- // archive
240
- const archive = program.command("archive").description("Archive management");
241
- archive.addCommand(archiveCreateCommand);
242
- // asset
243
- const asset = program.command("asset").description("Asset management");
244
- asset.addCommand(assetUploadCommand);
245
- // brandkit
246
- const brandkit = program.command("brandkit").description("Brand kit commands");
247
- brandkit.addCommand(brandkitApplyCommand);
248
- // workflow
249
- const workflow = program.command("workflow").description("Workflow automation");
250
- workflow.addCommand(workflowRunCommand);
251
- workflow.addCommand(workflowCancelCommand);
252
- workflow.addCommand(workflowStatusCommand);
253
- // system
254
- const system = program.command("system").description("System commands");
255
- system.addCommand(systemInstallInstructionsCommand);
256
- // user
257
- const user = program.command("user").description("User account commands");
258
- const userPreferences = user.command("preferences").description("User preference management");
259
- userPreferences.addCommand(userPreferencesGetCommand);
260
- userPreferences.addCommand(userPreferencesUpdateCommand);
261
- userPreferences.addCommand(userPreferencesReadCommand);
262
- userPreferences.addCommand(userPreferencesWriteCommand);
263
- // workspace member + invite
264
- const workspaceMember = workspace.command("member").description("Workspace member management");
265
- workspaceMember.addCommand(workspaceMemberListCommand);
266
- const workspaceInvite = workspace.command("invite").description("Workspace invitation management");
267
- workspaceInvite.addCommand(workspaceInviteSendCommand);
268
- const workspaceModel = workspace.command("model").description("Workspace model settings");
269
- const workspaceModelSettings = workspaceModel.command("settings").description("Model settings management");
270
- workspaceModelSettings.addCommand(workspaceModelSettingsReadCommand);
271
- workspaceModelSettings.addCommand(workspaceModelSettingsWriteCommand);
272
- // conversation chat + purge
273
- conversation.addCommand(conversationChatCommand);
274
- conversation.addCommand(conversationPurgeCommand);
275
- conversation.addCommand(conversationFilesListCommand);
276
- // image
277
- const image = program.command("image").description("Image generation commands");
278
- image.addCommand(imageCreateCommand);
279
- image.addCommand(imageListCommand);
280
- image.addCommand(imageAnalyzeCommand);
281
- image.addCommand(imageGenerateCommand);
282
- // document
283
- const document = program.command("document").description("Document management commands");
284
- document.addCommand(documentCreateCommand);
285
- document.addCommand(documentListCommand);
286
- document.addCommand(documentReadCommand);
287
- const documents = program.command("documents").description("Document generation commands");
288
- documents.addCommand(documentsGenerateCommand);
289
- documents.addCommand(documentsPdfCreateCommand);
290
- documents.addCommand(markdownGenerateCommand);
291
- // mermaid (diagram generation top-level group like svg/video)
292
- const mermaid = program.command("mermaid").description("Mermaid diagram generation commands");
293
- mermaid.addCommand(mermaidGenerateCommand);
294
- // automation
295
- const automation = program.command("automation").description("Automation management commands");
296
- automation.addCommand(automationListCommand);
297
- automation.addCommand(automationCreateCommand);
298
- automation.addCommand(automationUpdateCommand);
299
- automation.addCommand(automationEnableCommand);
300
- automation.addCommand(automationDisableCommand);
301
- automation.addCommand(automationTriggerCommand);
302
- // form
303
- const form = program.command("form").description("Form management commands");
304
- form.addCommand(formCreateCommand);
305
- form.addCommand(formSubmitCommand);
306
- form.addCommand(formFillCommand);
307
- // skill
308
- const skill = program.command("skill").description("Skill management commands");
309
- const skillWorkspace = skill.command("workspace").description("Workspace skill management");
310
- skillWorkspace.addCommand(skillWorkspaceListCommand);
311
- skillWorkspace.addCommand(skillWorkspaceInstallCommand);
312
- const skillVersion = skill.command("version").description("Skill version management");
313
- skillVersion.addCommand(skillVersionListCommand);
314
- skillVersion.addCommand(skillVersionGetCommand);
315
- skillVersion.addCommand(skillVersionUploadCommand);
316
- skillVersion.addCommand(skillVersionActivateCommand);
317
- skill.addCommand(skillEditCommand);
318
- skill.addCommand(skillExportCommand);
319
- skill.addCommand(skillMetricsReadCommand);
320
- // video
321
- const video = program.command("video").description("Video generation commands");
322
- video.addCommand(videoGenerateCommand);
323
- // svg
324
- const svg = program.command("svg").description("SVG generation commands");
325
- svg.addCommand(svgGenerateCommand);
326
- // privacy (GDPR Art.17 erasure + Art.20 portability)
327
- const privacy = program.command("privacy").description("GDPR privacy rights — data export and erasure");
328
- privacy.addCommand(privacyExportCommand);
329
- privacy.addCommand(privacyEraseCommand);
330
- // graph
331
- const graph = program.command("graph").description("Knowledge graph commands");
332
- const graphNode = graph.command("node").description("Graph node management");
333
- graphNode.addCommand(graphNodeUpsertCommand);
334
- graphNode.addCommand(graphNodeGetCommand);
335
- graphNode.addCommand(graphNodeDeleteCommand);
336
- graphNode.addCommand(graphNodeSearchCommand);
337
- const graphEdge = graph.command("edge").description("Graph edge management");
338
- graphEdge.addCommand(graphEdgeUpsertCommand);
339
- graphEdge.addCommand(graphEdgeDeleteCommand);
340
- graph.addCommand(graphCypherCommand);
341
- // ontology
342
- const ontology = program
343
- .command("ontology")
344
- .description("Typed knowledge-graph traversal commands");
345
- ontology.addCommand(ontologyQueryCommand);
346
- ontology.addCommand(ontologyNeighborsCommand);
347
- // audit
348
- const audit = program.command("audit").description("Audit-log commands");
349
- const auditLog = audit.command("log").description("Query the security & automation audit spines");
350
- auditLog.addCommand(auditLogQueryCommand);
351
- // web
352
- const web = program.command("web").description("Web intelligence commands");
353
- web.addCommand(webSearchCommand);
354
- web.addCommand(webFetchCommand);
355
- // research
356
- const research = program.command("research").description("Research swarm commands");
357
- const researchSwarm = research.command("swarm").description("Research swarm management");
358
- researchSwarm.addCommand(researchSwarmStartCommand);
359
- researchSwarm.addCommand(researchSwarmStatusCommand);
360
- program.parse(process.argv);
361
- if (program.args.length === 0) {
362
- program.outputHelp();
148
+ .command("cost")
149
+ // The root's global `-m, --model` is reused (commander binds it to the parent),
150
+ // so the action reads merged opts via optsWithGlobals() to see --model here.
151
+ .description("Project model cost from the baked-in rate card, or roll up this project's spend")
152
+ .option("--in <tokens>", "Input token count to price", (v) => parseInt(v, 10))
153
+ .option("--out <tokens>", "Output token count to price", (v) => parseInt(v, 10))
154
+ .option("--rates", "Print the baked-in rate card", false)
155
+ .option("--session", "Roll up what this project's recorded turns actually cost, by model", false)
156
+ .option("--json", "Output JSON", false)
157
+ .action(async (_opts, command) => {
158
+ const merged = command.optsWithGlobals();
159
+ const { handleCost } = await import("./commands/cost.js");
160
+ await handleCost(merged);
161
+ });
162
+ // ── graph: knowledge-graph search + pull + status ─────────────────────────────
163
+ const graph = program.command("graph").description("Query the knowledge graph");
164
+ graph
165
+ .command("search")
166
+ .description("Unified semantic (vector) search across the entire knowledge graph")
167
+ .requiredOption("-q, --query <text>", "Natural-language query to search by vector similarity")
168
+ .option("-k, --kinds <kinds>", "Comma-separated node kinds (entity,file,symbol,chunk,memory,execution,document,message)")
169
+ .option("-l, --labels <labels>", "Comma-separated domain labels (e.g. Person,SourceFile)")
170
+ .option("-n, --limit <n>", "Maximum number of results (1–50)", "10")
171
+ .option("--system", "Only return product-owned (system) nodes")
172
+ .option("--no-system", "Only return customer nodes (exclude system nodes)")
173
+ .action(async (opts) => {
174
+ const { handleGraphSearch } = await import("./commands/graph.search.js");
175
+ await handleGraphSearch(opts);
176
+ });
177
+ graph
178
+ .command("pull")
179
+ .description("Download an incremental snapshot of the workspace graph into a local DuckDB replica")
180
+ .option("--full", "Ignore the saved cursor and re-pull the entire graph", false)
181
+ .option("-l, --labels <csv>", "Comma-separated domain labels to filter (e.g. Person,SourceFile)")
182
+ .option("--no-system", "Exclude product-owned (system) nodes")
183
+ .option("--json", "Output summary as JSON")
184
+ .action(async (opts) => {
185
+ const { handleGraphPull } = await import("./commands/graph.pull.js");
186
+ await handleGraphPull({
187
+ full: opts.full,
188
+ labels: opts.labels,
189
+ noSystem: opts.system === false,
190
+ json: opts.json,
191
+ });
192
+ });
193
+ graph
194
+ .command("status")
195
+ .description("Show the state of the local workspace-graph replica")
196
+ .option("--json", "Output as JSON")
197
+ .action(async (opts) => {
198
+ const { handleGraphStatus } = await import("./commands/graph.status.js");
199
+ await handleGraphStatus(opts);
200
+ });
201
+ // ── config: local configuration ───────────────────────────────────────────────
202
+ program
203
+ .command("config")
204
+ .description("View or set configuration (api key, model, etc.)")
205
+ .argument("[key]", "Config key to get/set")
206
+ .argument("[value]", "Value to set (omit to read)")
207
+ .action(async (key, value) => {
208
+ const { handleConfig } = await import("./commands/config.js");
209
+ await handleConfig(key, value);
210
+ });
211
+ // ── settings: the unified settings.json driver ────────────────────────────────
212
+ const settings = program
213
+ .command("settings")
214
+ .description("Inspect and edit the unified settings.json (model, env, permissions, hooks, MCP)")
215
+ .action(async () => {
216
+ const { settingsShow } = await import("./commands/settings.js");
217
+ settingsShow();
218
+ });
219
+ settings
220
+ .command("show")
221
+ .description("Show the merged settings and which scope each file lives in")
222
+ .action(async () => {
223
+ const { settingsShow } = await import("./commands/settings.js");
224
+ settingsShow();
225
+ });
226
+ settings
227
+ .command("path")
228
+ .description("List the three scope files (user / project / local) and their status")
229
+ .action(async () => {
230
+ const { settingsPath } = await import("./commands/settings.js");
231
+ settingsPath();
232
+ });
233
+ settings
234
+ .command("get")
235
+ .description("Print a value by dotted key (e.g. permissions.defaultMode)")
236
+ .argument("<key>", "Dotted settings key")
237
+ .action(async (key) => {
238
+ const { settingsGet } = await import("./commands/settings.js");
239
+ settingsGet(key);
240
+ });
241
+ settings
242
+ .command("set")
243
+ .description("Set a value (model | apiUrl | env.NAME) in a scope")
244
+ .argument("<key>", "model, apiUrl, or env.NAME")
245
+ .argument("<value>", "Value to write")
246
+ .option("--scope <scope>", "user | project | local (default: project)")
247
+ .action(async (key, value, opts) => {
248
+ const { settingsSet } = await import("./commands/settings.js");
249
+ settingsSet(key, value, opts.scope);
250
+ });
251
+ settings
252
+ .command("validate")
253
+ .description("Validate every scope file against the settings schema")
254
+ .action(async () => {
255
+ const { settingsValidate } = await import("./commands/settings.js");
256
+ settingsValidate();
257
+ });
258
+ settings
259
+ .command("init")
260
+ .description("Write a documented starter settings.json (default: project scope)")
261
+ .option("--scope <scope>", "user | project | local (default: project)")
262
+ .action(async (opts) => {
263
+ const { settingsInit } = await import("./commands/settings.js");
264
+ settingsInit(opts.scope);
265
+ });
266
+ // ── agent: named agent definitions ────────────────────────────────────────────
267
+ const agent = program
268
+ .command("agent")
269
+ .description("Manage named agent definitions (run one with `oxagen --agent <name> \"…\"`)");
270
+ agent
271
+ .command("list")
272
+ .description("List available agents")
273
+ .action(async () => {
274
+ const { agentList } = await import("./commands/agent.js");
275
+ agentList();
276
+ });
277
+ agent
278
+ .command("show")
279
+ .description("Show an agent's definition and system prompt")
280
+ .argument("<name>", "Agent name")
281
+ .action(async (name) => {
282
+ const { agentShow } = await import("./commands/agent.js");
283
+ agentShow(name);
284
+ });
285
+ agent
286
+ .command("new")
287
+ .description("Scaffold a new agent at .oxagen/agents/<name>.md")
288
+ .argument("<name>", "Agent name")
289
+ .action(async (name) => {
290
+ const { agentNew } = await import("./commands/agent.js");
291
+ agentNew(name);
292
+ });
293
+ // ── command: user-defined slash commands ──────────────────────────────────────
294
+ const command = program
295
+ .command("command")
296
+ .description("Manage user-defined slash commands (invoke as `/name` in the REPL)");
297
+ command
298
+ .command("list")
299
+ .description("List available slash commands")
300
+ .action(async () => {
301
+ const { commandList } = await import("./commands/command.js");
302
+ commandList();
303
+ });
304
+ command
305
+ .command("show")
306
+ .description("Show a slash command's template")
307
+ .argument("<name>", "Command name")
308
+ .action(async (name) => {
309
+ const { commandShow } = await import("./commands/command.js");
310
+ commandShow(name);
311
+ });
312
+ command
313
+ .command("new")
314
+ .description("Scaffold a new slash command at .oxagen/commands/<name>.md")
315
+ .argument("<name>", "Command name")
316
+ .action(async (name) => {
317
+ const { commandNew } = await import("./commands/command.js");
318
+ commandNew(name);
319
+ });
320
+ command
321
+ .command("run")
322
+ .description("Expand a slash command's template with args and run it as a turn")
323
+ .argument("<name>", "Command name")
324
+ .argument("[args...]", "Arguments substituted into the template")
325
+ .action(async (name, args) => {
326
+ const { commandRun } = await import("./commands/command.js");
327
+ await commandRun(name, args ?? []);
328
+ });
329
+ // ── rules: workspace rules the agent must follow ──────────────────────────────
330
+ const rules = program
331
+ .command("rules")
332
+ .description("Manage workspace rules the agent is told about and hard-blocked from violating");
333
+ rules
334
+ .command("list")
335
+ .description("List rules (and which are hard-enforced)")
336
+ .action(async () => {
337
+ const { rulesList } = await import("./commands/rules.js");
338
+ rulesList();
339
+ });
340
+ rules
341
+ .command("show")
342
+ .description("Show a rule's text and guard")
343
+ .argument("<name>", "Rule name")
344
+ .action(async (name) => {
345
+ const { rulesShow } = await import("./commands/rules.js");
346
+ rulesShow(name);
347
+ });
348
+ rules
349
+ .command("new")
350
+ .description("Scaffold a new rule at .oxagen/rules/<name>.md")
351
+ .argument("<name>", "Rule name")
352
+ .action(async (name) => {
353
+ const { rulesNew } = await import("./commands/rules.js");
354
+ rulesNew(name);
355
+ });
356
+ rules
357
+ .command("check")
358
+ .description("Dry-run a proposed tool call against the guards (bash|edit|write|read)")
359
+ .argument("<tool>", "bash | edit | write | read")
360
+ .argument("<subject>", "The command (bash) or path (edit/write/read) to test")
361
+ .action(async (tool, subject) => {
362
+ const { rulesCheck } = await import("./commands/rules.js");
363
+ rulesCheck(tool, subject);
364
+ });
365
+ // ── mcp: external MCP servers ─────────────────────────────────────────────────
366
+ const collect = (val, prev) => prev.concat([val]);
367
+ const mcp = program
368
+ .command("mcp")
369
+ .description("Manage external MCP servers the agent loop connects to");
370
+ mcp
371
+ .command("add")
372
+ .description("Add an MCP server (stdio via --command, or http/sse/websocket via --url)")
373
+ .argument("<name>", "Server name (used in tool names: mcp__<name>__<tool>)")
374
+ .option("--command <command>", "stdio: the command to spawn (e.g. npx)")
375
+ .option("--arg <arg>", "stdio: a command argument (repeatable)", collect, [])
376
+ .option("--url <url>", "http/sse/websocket: the server URL")
377
+ .option("--transport <transport>", "streamable-http | sse | websocket (default streamable-http)")
378
+ .option("--auth <auth>", "none | bearer | header (default none)")
379
+ .option("--env-token <VAR>", "Env var holding the bearer token")
380
+ .option("--header <KEY=VALUE>", "Static header for header auth (repeatable)", collect, [])
381
+ .option("--scope <scope>", "user | project | local (default project)")
382
+ .action(async (name, opts) => {
383
+ const { mcpAdd } = await import("./commands/mcp.js");
384
+ mcpAdd(name, {
385
+ command: opts["command"],
386
+ arg: opts["arg"],
387
+ url: opts["url"],
388
+ transport: opts["transport"],
389
+ auth: opts["auth"],
390
+ envToken: opts["envToken"],
391
+ header: opts["header"],
392
+ scope: opts["scope"],
393
+ });
394
+ });
395
+ mcp
396
+ .command("list")
397
+ .description("List configured MCP servers")
398
+ .action(async () => {
399
+ const { mcpList } = await import("./commands/mcp.js");
400
+ mcpList();
401
+ });
402
+ mcp
403
+ .command("remove")
404
+ .description("Remove an MCP server")
405
+ .argument("<name>", "Server name")
406
+ .option("--scope <scope>", "Limit to a scope (default: auto-detect)")
407
+ .action(async (name, opts) => {
408
+ const { mcpRemove } = await import("./commands/mcp.js");
409
+ mcpRemove(name, opts.scope);
410
+ });
411
+ mcp
412
+ .command("enable")
413
+ .description("Enable a disabled MCP server")
414
+ .argument("<name>", "Server name")
415
+ .option("--scope <scope>", "Limit to a scope (default: auto-detect)")
416
+ .action(async (name, opts) => {
417
+ const { mcpSetEnabled } = await import("./commands/mcp.js");
418
+ mcpSetEnabled(name, true, opts.scope);
419
+ });
420
+ mcp
421
+ .command("disable")
422
+ .description("Disable an MCP server without removing it")
423
+ .argument("<name>", "Server name")
424
+ .option("--scope <scope>", "Limit to a scope (default: auto-detect)")
425
+ .action(async (name, opts) => {
426
+ const { mcpSetEnabled } = await import("./commands/mcp.js");
427
+ mcpSetEnabled(name, false, opts.scope);
428
+ });
429
+ mcp
430
+ .command("check")
431
+ .description("Connect to a server (or all enabled) and preview the tools it exposes")
432
+ .argument("[name]", "Server name (omit to check all enabled)")
433
+ .action(async (name) => {
434
+ const { mcpCheck } = await import("./commands/mcp.js");
435
+ await mcpCheck(name);
436
+ });
437
+ // ── env: workspace environments ───────────────────────────────────────────────
438
+ const env = program.command("env").description("Manage workspace environments");
439
+ env
440
+ .command("list")
441
+ .description("List environments in the active workspace")
442
+ .option("--json", "Output JSON")
443
+ .action(async (opts) => {
444
+ const { handleEnvList } = await import("./commands/env.js");
445
+ await handleEnvList(opts);
446
+ });
447
+ env
448
+ .command("get")
449
+ .description("Show one environment")
450
+ .argument("<idOrSlug>", "Environment public id or slug")
451
+ .action(async (idOrSlug) => {
452
+ const { handleEnvGet } = await import("./commands/env.js");
453
+ await handleEnvGet(idOrSlug, {});
454
+ });
455
+ env
456
+ .command("create")
457
+ .description("Create an environment")
458
+ .argument("<name>", "Display name")
459
+ .option("--slug <slug>", "Slug (defaults to a slugified name)")
460
+ .option("--description <text>", "Description")
461
+ .action(async (name, opts) => {
462
+ const { handleEnvCreate } = await import("./commands/env.js");
463
+ await handleEnvCreate(name, opts);
464
+ });
465
+ env
466
+ .command("update")
467
+ .description("Update an environment")
468
+ .argument("<idOrSlug>", "Environment public id or slug")
469
+ .option("--name <name>", "New display name")
470
+ .option("--slug <slug>", "New slug")
471
+ .option("--description <text>", "New description")
472
+ .option("--active", "Activate")
473
+ .option("--inactive", "Deactivate (not allowed on the default)")
474
+ .action(async (idOrSlug, opts) => {
475
+ const { handleEnvUpdate } = await import("./commands/env.js");
476
+ const active = opts.active ? true : opts.inactive ? false : undefined;
477
+ await handleEnvUpdate(idOrSlug, {
478
+ name: opts.name,
479
+ slug: opts.slug,
480
+ description: opts.description,
481
+ active,
482
+ });
483
+ });
484
+ env
485
+ .command("rm")
486
+ .description("Delete an environment (not the default)")
487
+ .argument("<idOrSlug>", "Environment public id or slug")
488
+ .action(async (idOrSlug) => {
489
+ const { handleEnvRemove } = await import("./commands/env.js");
490
+ await handleEnvRemove(idOrSlug);
491
+ });
492
+ env
493
+ .command("set-default")
494
+ .description("Promote an environment to the workspace default")
495
+ .argument("<idOrSlug>", "Environment public id or slug")
496
+ .action(async (idOrSlug) => {
497
+ const { handleEnvSetDefault } = await import("./commands/env.js");
498
+ await handleEnvSetDefault(idOrSlug);
499
+ });
500
+ // ── secret: credential vault ──────────────────────────────────────────────────
501
+ const secret = program.command("secret").description("Manage the workspace credential vault");
502
+ secret
503
+ .command("list")
504
+ .description("List vault keys (masked metadata)")
505
+ .option("--json", "Output JSON")
506
+ .action(async (opts) => {
507
+ const { handleSecretList } = await import("./commands/secret.js");
508
+ await handleSecretList(opts);
509
+ });
510
+ secret
511
+ .command("set")
512
+ .description("Set a secret's default value, or an override with --env")
513
+ .argument("<key>", "Secret key name")
514
+ .argument("<value>", "Value")
515
+ .option("--env <slug>", "Target environment (override); omit for the default value")
516
+ .option("--no-sensitive", "Store as plaintext config (default: sensitive/encrypted)")
517
+ .action(async (key, value, opts) => {
518
+ const { handleSecretSet } = await import("./commands/secret.js");
519
+ await handleSecretSet(key, value, opts);
520
+ });
521
+ secret
522
+ .command("rm")
523
+ .description("Delete a key, or just an environment override with --env")
524
+ .argument("<key>", "Secret key name")
525
+ .option("--env <slug>", "Remove only this environment's override")
526
+ .action(async (key, opts) => {
527
+ const { handleSecretRemove } = await import("./commands/secret.js");
528
+ await handleSecretRemove(key, opts);
529
+ });
530
+ secret
531
+ .command("reveal")
532
+ .description("Reveal a secret's plaintext value (recorded to the access log)")
533
+ .argument("<key>", "Secret key name")
534
+ .option("--env <slug>", "Resolve for this environment")
535
+ .action(async (key, opts) => {
536
+ const { handleSecretReveal } = await import("./commands/secret.js");
537
+ await handleSecretReveal(key, opts);
538
+ });
539
+ secret
540
+ .command("import")
541
+ .description("Import .env text (preview unless --yes)")
542
+ .option("--env <slug>", "Target environment overrides; omit for default values")
543
+ .option("-f, --file <path>", "Read from a file (else stdin)")
544
+ .option("--yes", "Commit (otherwise preview only)")
545
+ .action(async (opts) => {
546
+ const { handleSecretImport } = await import("./commands/secret.js");
547
+ await handleSecretImport(opts);
548
+ });
549
+ secret
550
+ .command("export")
551
+ .description("Export resolved secrets as .env (recorded to the access log)")
552
+ .option("--env <slug>", "Resolve for this environment")
553
+ .option("-o, --out <path>", "Write to a file (else stdout)")
554
+ .action(async (opts) => {
555
+ const { handleSecretExport } = await import("./commands/secret.js");
556
+ await handleSecretExport(opts);
557
+ });
558
+ async function main() {
559
+ // Project settings.json (env, apiUrl, model) into the environment before any
560
+ // command runs — filling only unset vars, so the shell always wins.
561
+ const { applySettingsToEnv } = await import("./settings/runtime.js");
562
+ applySettingsToEnv();
563
+ await program.parseAsync(process.argv);
363
564
  }
565
+ void main();
364
566
  //# sourceMappingURL=index.js.map