@jstn-sdk/ma 0.1.13 → 0.14.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 (259) hide show
  1. package/.agents/plugins/marketplace.json +0 -0
  2. package/.codex/agents/Architect.toml +1 -0
  3. package/.codex/agents/Auditor.toml +1 -0
  4. package/.codex/agents/Builder.toml +1 -0
  5. package/.codex/agents/Flow.toml +1 -0
  6. package/.codex/agents/Sage.toml +1 -0
  7. package/.codex/agents/Vibe.toml +1 -0
  8. package/.codex/hooks.json +12 -2
  9. package/.codex/prompts/enforcement.md +0 -0
  10. package/.codex/prompts/onboarding.md +6 -1
  11. package/.codex/prompts/release-rules.md +0 -0
  12. package/.codex/prompts/skill-contract.md +0 -0
  13. package/COVERAGE.md +9 -9
  14. package/DEMO.md +15 -6
  15. package/LICENSE +0 -0
  16. package/README.md +127 -784
  17. package/bin/ma.js +591 -105
  18. package/data/clone-data.ledger.json +0 -0
  19. package/data/clone-data.proof.json +0 -0
  20. package/data/clone-data.rvf +0 -0
  21. package/docs/README.md +8 -2
  22. package/docs/assets/banner.png +0 -0
  23. package/docs/autonomous-tasks.md +46 -0
  24. package/docs/codex-integration.md +16 -0
  25. package/docs/getting-started.md +32 -8
  26. package/docs/installed-sdk.md +0 -0
  27. package/docs/mcp-setup.md +30 -1
  28. package/docs/qa/{release-issue-gates-0.1.13.json → release-issue-gates-0.14.1.json} +77 -77
  29. package/docs/qa/release-readiness-0.1.5.md +0 -0
  30. package/docs/qa/{release-readiness-0.1.13.md → release-readiness-0.14.1.md} +12 -12
  31. package/docs/quality.md +24 -0
  32. package/docs/reference/native-engineering-patterns.md +0 -0
  33. package/docs/reference/native-security-playbooks.md +0 -0
  34. package/docs/reference/native-source-selection.md +0 -0
  35. package/docs/reference/native-style-and-deslop.md +0 -0
  36. package/docs/release-spec.md +27 -14
  37. package/docs/skills.md +1 -1
  38. package/docs/vendor-plugin-publishing.md +49 -0
  39. package/index.js +73 -0
  40. package/mcp/collections.json +0 -0
  41. package/mcp/fallback.json +0 -0
  42. package/mcp/local/code-intel.js +185 -41
  43. package/mcp/local/context.js +180 -0
  44. package/mcp/local/memory.js +17 -6
  45. package/mcp/local/playbooks.js +0 -0
  46. package/mcp/local/quality.js +39 -0
  47. package/mcp/local/state.js +7 -3
  48. package/mcp/local/team-run.js +8 -3
  49. package/mcp/local/trace.js +0 -0
  50. package/mcp/local-capabilities.json +9 -0
  51. package/mcp/native-playbooks.json +0 -0
  52. package/mcp/servers.json +0 -0
  53. package/package.json +37 -6
  54. package/plugins/meta-architect/.app.json +1 -1
  55. package/plugins/meta-architect/.claude-plugin/plugin.json +12 -0
  56. package/plugins/meta-architect/.codex-plugin/plugin.json +1 -1
  57. package/plugins/meta-architect/.mcp.json +1 -1
  58. package/plugins/meta-architect/README.md +14 -2
  59. package/plugins/meta-architect/obsidian/main.js +137 -4
  60. package/plugins/meta-architect/obsidian/manifest.json +1 -1
  61. package/plugins/meta-architect/obsidian/styles.css +0 -0
  62. package/plugins/meta-architect/skills/align/SKILL.md +0 -0
  63. package/plugins/meta-architect/skills/align/agents/openai.yaml +0 -0
  64. package/plugins/meta-architect/skills/align/references/shared-language.md +0 -0
  65. package/plugins/meta-architect/skills/arch/SKILL.md +0 -0
  66. package/plugins/meta-architect/skills/arch/agents/openai.yaml +0 -0
  67. package/plugins/meta-architect/skills/build/SKILL.md +0 -0
  68. package/plugins/meta-architect/skills/build/agents/openai.yaml +0 -0
  69. package/plugins/meta-architect/skills/cleanup/SKILL.md +0 -0
  70. package/plugins/meta-architect/skills/cleanup/agents/openai.yaml +0 -0
  71. package/plugins/meta-architect/skills/cleanup/references/style-and-deslop.md +0 -0
  72. package/plugins/meta-architect/skills/diagnose/SKILL.md +0 -0
  73. package/plugins/meta-architect/skills/diagnose/agents/openai.yaml +0 -0
  74. package/plugins/meta-architect/skills/flow/SKILL.md +0 -0
  75. package/plugins/meta-architect/skills/flow/agents/openai.yaml +0 -0
  76. package/plugins/meta-architect/skills/maestro/SKILL.md +17 -1
  77. package/plugins/meta-architect/skills/maestro/agents/openai.yaml +0 -0
  78. package/plugins/meta-architect/skills/maestro/references/core-release-rules.md +2 -2
  79. package/plugins/meta-architect/skills/maestro/references/native-ingest-map.md +0 -0
  80. package/plugins/meta-architect/skills/sage/SKILL.md +0 -0
  81. package/plugins/meta-architect/skills/sage/agents/openai.yaml +0 -0
  82. package/plugins/meta-architect/skills/sage/references/source-selection.md +0 -0
  83. package/plugins/meta-architect/skills/tdd/SKILL.md +0 -0
  84. package/plugins/meta-architect/skills/tdd/agents/openai.yaml +0 -0
  85. package/plugins/meta-architect/skills/vet/SKILL.md +0 -0
  86. package/plugins/meta-architect/skills/vet/agents/openai.yaml +0 -0
  87. package/plugins/meta-architect/skills/vet/references/security-playbooks.md +0 -0
  88. package/plugins/meta-architect/skills/vibe/SKILL.md +0 -0
  89. package/plugins/meta-architect/skills/vibe/agents/openai.yaml +0 -0
  90. package/schemas/autonomous-task-queue.schema.json +58 -0
  91. package/schemas/handoff-packet.schema.json +36 -0
  92. package/schemas/setup-receipt.schema.json +28 -0
  93. package/schemas/skill-frontmatter.schema.json +20 -0
  94. package/schemas/support-bundle.schema.json +37 -0
  95. package/schemas/task-contract.schema.json +31 -0
  96. package/scripts/active-autonomy-hook.mjs +141 -11
  97. package/scripts/biome-staged.js +0 -0
  98. package/scripts/build-linux-packages.mjs +7 -3
  99. package/scripts/cleanup-test-fixtures.sh +55 -0
  100. package/scripts/context-hydration-hook.mjs +89 -0
  101. package/scripts/demo-smoke.js +285 -0
  102. package/scripts/doctor.js +10 -8
  103. package/scripts/install.sh +33 -4
  104. package/scripts/install.sh.sha256 +1 -0
  105. package/scripts/linux-package-lib.mjs +0 -0
  106. package/scripts/linux-package-smoke.mjs +2 -2
  107. package/scripts/package-size-check.mjs +26 -0
  108. package/scripts/plugin-build.js +314 -0
  109. package/scripts/plugin-publish.js +77 -0
  110. package/scripts/plugin-sync.js +83 -17
  111. package/scripts/prepack.js +9 -0
  112. package/scripts/ralph/prompt.md +0 -0
  113. package/scripts/release-metadata.js +0 -0
  114. package/scripts/release-sync.js +83 -7
  115. package/scripts/release-verify.js +131 -7
  116. package/scripts/setup-npmrc.js +48 -23
  117. package/scripts/skills-install.js +9 -2
  118. package/scripts/skills-manifest.js +2 -21
  119. package/scripts/skills-pack.js +2 -2
  120. package/scripts/skills-validate.js +5 -55
  121. package/skills/align/SKILL.md +0 -0
  122. package/skills/align/agents/openai.yaml +0 -0
  123. package/skills/align/references/shared-language.md +0 -0
  124. package/skills/arch/SKILL.md +0 -0
  125. package/skills/arch/agents/openai.yaml +0 -0
  126. package/skills/build/SKILL.md +0 -0
  127. package/skills/build/agents/openai.yaml +0 -0
  128. package/skills/cleanup/SKILL.md +0 -0
  129. package/skills/cleanup/agents/openai.yaml +0 -0
  130. package/skills/cleanup/references/style-and-deslop.md +0 -0
  131. package/skills/diagnose/SKILL.md +0 -0
  132. package/skills/diagnose/agents/openai.yaml +0 -0
  133. package/skills/flow/SKILL.md +0 -0
  134. package/skills/flow/agents/openai.yaml +0 -0
  135. package/skills/index.json +0 -0
  136. package/skills/maestro/SKILL.md +17 -1
  137. package/skills/maestro/agents/openai.yaml +0 -0
  138. package/skills/maestro/references/core-release-rules.md +2 -2
  139. package/skills/maestro/references/native-ingest-map.md +0 -0
  140. package/skills/sage/SKILL.md +0 -0
  141. package/skills/sage/agents/openai.yaml +0 -0
  142. package/skills/sage/references/source-selection.md +0 -0
  143. package/skills/tdd/SKILL.md +0 -0
  144. package/skills/tdd/agents/openai.yaml +0 -0
  145. package/skills/vet/SKILL.md +0 -0
  146. package/skills/vet/agents/openai.yaml +0 -0
  147. package/skills/vet/references/security-playbooks.md +0 -0
  148. package/skills/vibe/SKILL.md +0 -0
  149. package/skills/vibe/agents/openai.yaml +0 -0
  150. package/sprint/00-idea.md +0 -0
  151. package/sprint/01-architecture.md +0 -0
  152. package/sprint/02-oss-evidence.md +0 -0
  153. package/sprint/03-logic.md +0 -0
  154. package/sprint/04-security.md +0 -0
  155. package/sprint/05-dx-ux.md +0 -0
  156. package/sprint/06-build-plan.md +0 -0
  157. package/sprint/07-release.md +2 -2
  158. package/src/agents.js +281 -0
  159. package/src/bootstrap.js +272 -65
  160. package/src/build-gate.js +0 -0
  161. package/src/codex-app-server.js +291 -0
  162. package/src/decision-log.js +0 -0
  163. package/src/fs-utils.js +175 -4
  164. package/src/launcher.js +26 -23
  165. package/src/mcp-config.js +9 -1
  166. package/src/mcp-live-client.js +141 -8
  167. package/src/paths.js +6 -1
  168. package/src/policy.js +2 -2
  169. package/src/prelaunch.js +223 -0
  170. package/src/process-utils.js +62 -0
  171. package/src/quality/ai-quality-orchestrator.js +328 -0
  172. package/src/release-issue-gates.js +62 -0
  173. package/src/release-operations.js +72 -0
  174. package/src/release-state.js +0 -0
  175. package/src/runtime/active-autonomy-core.js +0 -0
  176. package/src/runtime/agent-compat.js +31 -0
  177. package/src/runtime/alignment-sentinel.js +0 -0
  178. package/src/runtime/architect-review.js +249 -11
  179. package/src/runtime/autonomous-tasks.js +585 -0
  180. package/src/runtime/build-readiness.js +0 -0
  181. package/src/runtime/code-graph-rehearse.js +0 -0
  182. package/src/runtime/codeburn-core.js +118 -0
  183. package/src/runtime/context-authority.js +40 -0
  184. package/src/runtime/context-economy-core.js +40 -0
  185. package/src/runtime/continuity-graph.js +201 -0
  186. package/src/runtime/continuity-notes.js +71 -26
  187. package/src/runtime/core-source-ingest.js +2 -2
  188. package/src/runtime/detached-provider.js +90 -13
  189. package/src/runtime/doctor-report.js +18 -0
  190. package/src/runtime/environment-awareness-core.js +0 -0
  191. package/src/runtime/exposure-catalog.js +0 -0
  192. package/src/runtime/graphify-core.js +167 -0
  193. package/src/runtime/guidance-stack.js +9 -2
  194. package/src/runtime/handoff-packets.js +92 -0
  195. package/src/runtime/headroom-core.js +104 -0
  196. package/src/runtime/helper-orchestration-core.js +0 -0
  197. package/src/runtime/hook-profiles.js +20 -0
  198. package/src/runtime/learning-loop-core.js +110 -4
  199. package/src/runtime/live-agent-verification.js +122 -0
  200. package/src/runtime/maestro-events.js +0 -0
  201. package/src/runtime/maestro-manager.js +0 -0
  202. package/src/runtime/maestro-output.js +58 -0
  203. package/src/runtime/maestro-state.js +0 -0
  204. package/src/runtime/managed-markdown.js +29 -0
  205. package/src/runtime/mcp-authority.js +147 -0
  206. package/src/runtime/mcp-policy.js +0 -0
  207. package/src/runtime/obsidian-integration-core.js +255 -17
  208. package/src/runtime/obsidian-plugin-bridge.js +344 -38
  209. package/src/runtime/orchestrator.js +0 -0
  210. package/src/runtime/pi-maestro-core.js +89 -0
  211. package/src/runtime/preferences.js +79 -0
  212. package/src/runtime/project-context.js +636 -0
  213. package/src/runtime/prompt-strategy-core.js +0 -0
  214. package/src/runtime/quorum-review.js +0 -0
  215. package/src/runtime/ralph-execution-core.js +0 -0
  216. package/src/runtime/redaction-gateway.js +218 -19
  217. package/src/runtime/runtime-state.js +94 -2
  218. package/src/runtime/schema-migrations.js +162 -0
  219. package/src/runtime/semantic-recording-core.js +0 -0
  220. package/src/runtime/signal-hooks.js +13 -0
  221. package/src/runtime/skills-registry-export.js +96 -8
  222. package/src/runtime/startup-path.js +0 -0
  223. package/src/runtime/task-contracts.js +83 -0
  224. package/src/runtime/universal-plugin-broker-core.js +373 -50
  225. package/src/runtime/workspace-intelligence-runtime.js +0 -0
  226. package/src/runtime/workspace-virtualizer.js +0 -0
  227. package/src/runtime/workspaces.js +0 -0
  228. package/src/runtime-artifacts.js +0 -0
  229. package/src/setup-lifecycle.js +359 -0
  230. package/src/skill-frontmatter.js +78 -0
  231. package/src/skill-installer.js +226 -71
  232. package/src/skills.js +309 -31
  233. package/src/state-sync.js +0 -0
  234. package/src/test-fixtures.js +543 -0
  235. package/src/tui/grid.js +67 -0
  236. package/src/tui/status-grid.js +23 -0
  237. package/support-bundle.json +114 -0
  238. package/templates/AGENTS.md +6 -2
  239. package/templates/catalog-manifest.json +0 -0
  240. package/templates/model-instructions/core.md +0 -0
  241. package/templates/model-instructions/release.md +0 -0
  242. package/templates/model-instructions/security.md +0 -0
  243. package/templates/quality/ai-quality-rules.yml +37 -0
  244. package/docs/assets/image/Screenshot(1).png +0 -0
  245. package/docs/assets/image/Screenshot(2).png +0 -0
  246. package/docs/assets/image/Screenshot(3).png +0 -0
  247. package/docs/assets/image/Screenshot(4).png +0 -0
  248. package/docs/assets/image/Screenshot(5).png +0 -0
  249. package/docs/assets/image/Screenshot(6).png +0 -0
  250. package/docs/assets/image/Screenshot(7).png +0 -0
  251. package/docs/assets/image/Screenshot(8).png +0 -0
  252. package/docs/assets/image/Screenshot(9).png +0 -0
  253. package/docs/assets/meta-architect-logo.png +0 -0
  254. package/docs/assets/meta-architect-logo.svg +0 -8
  255. package/docs/onboarding.md +0 -81
  256. package/docs/prompt-guidance-contract.md +0 -17
  257. package/docs/prompt-guidance-fragments/active-autonomy-core.md +0 -7
  258. package/docs/skills-publishing.md +0 -255
  259. package/scripts/postinstall.js +0 -23
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/skills/index.json CHANGED
File without changes
@@ -7,7 +7,7 @@ description: "Use when the user wants the singular Meta-Architect in-session aut
7
7
 
8
8
  ## Overview
9
9
 
10
- Use this skill inside Codex as the singular Meta-Architect umbrella surface and bounded autonomous manager. It inspects workflow state, chooses the smallest safe next step, manages the fixed gated design-and-review sequence one lane at a time, and routes helper handoffs when they are enough. There is no separate shipped `$meta-architect` skill.
10
+ Use this skill inside Codex as the singular Meta-Architect umbrella surface and persistent autonomous manager. It accepts one task or a durable batch, inspects workflow state, chooses the smallest safe next step, manages the fixed gated design-and-review sequence, and keeps resuming eligible work until each task is completed, blocked, cancelled, or failed. It never invents a second umbrella command. There is no separate shipped `$meta-architect` skill.
11
11
 
12
12
  ## Workflow
13
13
 
@@ -30,6 +30,19 @@ Use this skill inside Codex as the singular Meta-Architect umbrella surface and
30
30
  - `$build`
31
31
  5. End with a clear result shape: decision, evidence, blockers, the lane assignment if any, and the exact next trigger.
32
32
 
33
+ ## Autonomous task loop
34
+
35
+ For a task or batch, keep the manager loop active across turns:
36
+
37
+ 1. Normalize the request into the durable `.ma` task contract before dispatch.
38
+ 2. Discover the selected host, available skills, and required lane syntax without taking ownership of user-installed assets.
39
+ 3. Dispatch independent tasks with bounded concurrency and preserve dependency order for dependent tasks.
40
+ 4. Inspect, implement, test, review, repair, and verify. Route a failure back to its owning lane with the failure evidence attached.
41
+ 5. Persist checkpoints, receipts, and the next trigger after every transition so an interrupted process can resume safely.
42
+ 6. Continue unaffected batch tasks when one task is blocked, then return a batch summary with terminal states and unresolved blockers.
43
+
44
+ Routine local work continues without asking for another prompt. Stop only for credentials, destructive actions, production or external mutations, explicit approval gates, unsafe commands, unavailable required providers, or missing verification evidence.
45
+
33
46
  ## Output
34
47
 
35
48
  Produce:
@@ -43,6 +56,9 @@ Produce:
43
56
  ## Rules
44
57
 
45
58
  - Prefer the smallest next step that moves the workflow forward safely.
59
+ - Continue eligible work until the current task or batch reaches a terminal state; do not stop after a single successful lane.
60
+ - Treat persisted `.ma` state as the source for resume, deduplication, dependency ordering, cancellation, and bounded retries.
61
+ - Keep autonomous execution bounded by task dependencies, concurrency limits, deadlines, retry limits, and explicit safety gates.
46
62
  - Respect current gate state before recommending implementation or release work.
47
63
  - Be explicit when more evidence, planning, or validation is still needed.
48
64
  - Treat the in-session skill flow as primary. Use `ma ...` terminal helpers only when repo-local setup, inspection, or scripted state automation is explicitly the better support path.
File without changes
@@ -8,6 +8,6 @@
8
8
  - `logic_status = GREEN`
9
9
  - `security_status = GREEN`
10
10
  - `experience_status = GREEN` or `WAIVED`
11
- - Feature work merges into `development`, never directly into `prod`.
12
- - Release promotion is allowed only from `development` or approved `release/*`.
11
+ - Feature work merges into `dev`, never directly into `main`.
12
+ - Release promotion is allowed only from `dev` or approved `release/*`.
13
13
  - Use the helper command path only when repo-local state automation is explicitly needed; otherwise stay inside Codex and carry the gate decisions in the session.
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/sprint/00-idea.md CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -16,8 +16,8 @@ Move from completed bounded implementation to a controlled merge and release pat
16
16
 
17
17
  ## Exit criteria
18
18
 
19
- - merge follows `feature/* -> development`
20
- - release follows `development|release/* -> prod`
19
+ - merge follows `feature/* -> dev`
20
+ - release follows `dev|release/* -> main`
21
21
 
22
22
  ## Failure conditions
23
23
 
package/src/agents.js ADDED
@@ -0,0 +1,281 @@
1
+ import path from "node:path";
2
+ import { safeSpawnSync } from "./process-utils.js";
3
+
4
+ const definitions = {
5
+ codex: {
6
+ id: "codex",
7
+ displayName: "Codex CLI",
8
+ skillsDir: ".agents/skills",
9
+ globalSkillsDir: "~/.agents/skills",
10
+ isUniversal: true,
11
+ command: "codex",
12
+ surface: "cli",
13
+ vendor: "openai",
14
+ probeable: true,
15
+ },
16
+ "claude-code": {
17
+ id: "claude-code",
18
+ displayName: "Claude Code",
19
+ skillsDir: ".claude/skills",
20
+ globalSkillsDir: "~/.claude/skills",
21
+ isUniversal: false,
22
+ command: "claude",
23
+ surface: "cli",
24
+ vendor: "anthropic",
25
+ probeable: true,
26
+ },
27
+ cursor: {
28
+ id: "cursor",
29
+ displayName: "Cursor",
30
+ skillsDir: ".agents/skills",
31
+ globalSkillsDir: "~/.agents/skills",
32
+ isUniversal: true,
33
+ command: "cursor",
34
+ surface: "ide",
35
+ vendor: "cursor",
36
+ probeable: true,
37
+ },
38
+ opencode: {
39
+ id: "opencode",
40
+ displayName: "OpenCode",
41
+ skillsDir: ".agents/skills",
42
+ globalSkillsDir: "~/.config/opencode/skills",
43
+ isUniversal: true,
44
+ command: "opencode",
45
+ surface: "cli",
46
+ vendor: "sst",
47
+ probeable: true,
48
+ },
49
+ "gemini-cli": {
50
+ id: "gemini-cli",
51
+ displayName: "Gemini CLI",
52
+ skillsDir: ".agents/skills",
53
+ globalSkillsDir: "~/.gemini/skills",
54
+ isUniversal: true,
55
+ command: "gemini",
56
+ surface: "cli",
57
+ vendor: "google",
58
+ probeable: true,
59
+ },
60
+ amp: {
61
+ id: "amp",
62
+ displayName: "Amp",
63
+ skillsDir: ".agents/skills",
64
+ globalSkillsDir: "~/.config/agents/skills",
65
+ isUniversal: true,
66
+ command: "amp",
67
+ surface: "cli",
68
+ vendor: "sourcegraph",
69
+ probeable: true,
70
+ },
71
+ goose: {
72
+ id: "goose",
73
+ displayName: "Goose",
74
+ skillsDir: ".goose/skills",
75
+ globalSkillsDir: "~/.config/goose/skills",
76
+ isUniversal: false,
77
+ command: "goose",
78
+ surface: "cli",
79
+ vendor: "block",
80
+ probeable: true,
81
+ },
82
+ "hermes-agent": {
83
+ id: "hermes-agent",
84
+ displayName: "Hermes Agent",
85
+ skillsDir: ".hermes/skills",
86
+ globalSkillsDir: "~/.hermes/skills",
87
+ isUniversal: false,
88
+ command: "hermes",
89
+ surface: "cli",
90
+ vendor: "nous-research",
91
+ probeable: true,
92
+ },
93
+ pi: {
94
+ id: "pi",
95
+ displayName: "Pi Coding Agent",
96
+ skillsDir: ".pi/skills",
97
+ globalSkillsDir: "~/.pi/agent/skills",
98
+ isUniversal: false,
99
+ command: "pi",
100
+ surface: "cli",
101
+ vendor: "pi",
102
+ probeable: true,
103
+ },
104
+ windsurf: {
105
+ id: "windsurf",
106
+ displayName: "Windsurf",
107
+ skillsDir: ".windsurf/skills",
108
+ globalSkillsDir: "~/.codeium/windsurf/skills",
109
+ isUniversal: false,
110
+ command: null,
111
+ surface: "ide",
112
+ vendor: "windsurf",
113
+ probeable: false,
114
+ },
115
+ cline: {
116
+ id: "cline",
117
+ displayName: "Cline",
118
+ skillsDir: ".agents/skills",
119
+ globalSkillsDir: "~/.agents/skills",
120
+ isUniversal: true,
121
+ command: null,
122
+ surface: "ide",
123
+ vendor: "cline",
124
+ probeable: false,
125
+ },
126
+ continue: {
127
+ id: "continue",
128
+ displayName: "Continue",
129
+ skillsDir: ".continue/skills",
130
+ globalSkillsDir: "~/.continue/skills",
131
+ isUniversal: false,
132
+ command: "continue",
133
+ surface: "ide",
134
+ vendor: "continue",
135
+ probeable: true,
136
+ },
137
+ roo: {
138
+ id: "roo",
139
+ displayName: "Roo Code",
140
+ skillsDir: ".roo/skills",
141
+ globalSkillsDir: "~/.roo/skills",
142
+ isUniversal: false,
143
+ command: null,
144
+ surface: "ide",
145
+ vendor: "roo-code",
146
+ probeable: false,
147
+ },
148
+ "kiro-cli": {
149
+ id: "kiro-cli",
150
+ displayName: "Kiro CLI",
151
+ skillsDir: ".kiro/skills",
152
+ globalSkillsDir: "~/.kiro/skills",
153
+ isUniversal: false,
154
+ command: "kiro",
155
+ surface: "ide",
156
+ vendor: "amazon",
157
+ probeable: true,
158
+ },
159
+ junie: {
160
+ id: "junie",
161
+ displayName: "Junie",
162
+ skillsDir: ".junie/skills",
163
+ globalSkillsDir: "~/.junie/skills",
164
+ isUniversal: false,
165
+ command: null,
166
+ surface: "ide",
167
+ vendor: "jetbrains",
168
+ probeable: false,
169
+ },
170
+ "github-copilot": {
171
+ id: "github-copilot",
172
+ displayName: "GitHub Copilot",
173
+ skillsDir: ".agents/skills",
174
+ globalSkillsDir: "~/.copilot/skills",
175
+ isUniversal: true,
176
+ command: null,
177
+ surface: "ide",
178
+ vendor: "github",
179
+ probeable: false,
180
+ },
181
+ antigravity: {
182
+ id: "antigravity",
183
+ displayName: "Antigravity",
184
+ skillsDir: ".agents/skills",
185
+ globalSkillsDir: "~/.gemini/antigravity/skills",
186
+ isUniversal: true,
187
+ command: null,
188
+ surface: "ide",
189
+ vendor: "google",
190
+ probeable: false,
191
+ },
192
+ universal: {
193
+ id: "universal",
194
+ displayName: "Universal Agent Skills",
195
+ skillsDir: ".agents/skills",
196
+ globalSkillsDir: "~/.agents/skills",
197
+ isUniversal: true,
198
+ command: null,
199
+ surface: "generic",
200
+ vendor: "universal",
201
+ probeable: false,
202
+ },
203
+ };
204
+
205
+ export const agentRegistry = Object.freeze(
206
+ Object.fromEntries(
207
+ Object.entries(definitions).map(([id, definition]) => [id, Object.freeze(definition)]),
208
+ ),
209
+ );
210
+
211
+ export function getAgent(type = process.env.MA_AGENT || "codex") {
212
+ return agentRegistry[type] ?? agentRegistry.codex;
213
+ }
214
+
215
+ export function getNonUniversalAgents() {
216
+ return Object.values(agentRegistry).filter((agent) => !agent.isUniversal);
217
+ }
218
+
219
+ export function isUniversalAgent(type) {
220
+ return getAgent(type).isUniversal;
221
+ }
222
+
223
+ export function resolveAgentCommand(type = process.env.MA_AGENT || "codex") {
224
+ const agent = getAgent(type);
225
+ if (!agent.command) return null;
226
+ const envKey = `MA_${agent.id.replaceAll("-", "_").toUpperCase()}_BIN`;
227
+ return process.env[envKey]?.trim() || agent.command;
228
+ }
229
+
230
+ export function detectInstalled(type = process.env.MA_AGENT || "codex") {
231
+ const agent = getAgent(type);
232
+ const command = resolveAgentCommand(agent.id);
233
+ if (!command || !agent.probeable) {
234
+ return {
235
+ ...agent,
236
+ installed: false,
237
+ command: command ?? null,
238
+ version: "",
239
+ probe: "unsupported",
240
+ };
241
+ }
242
+ const script = [".js", ".mjs", ".cjs"].includes(path.extname(command));
243
+ const result = safeSpawnSync(
244
+ script ? process.execPath : command,
245
+ script ? [command, "--version"] : ["--version"],
246
+ {
247
+ encoding: "utf8",
248
+ shell: false,
249
+ timeout: 5_000,
250
+ },
251
+ );
252
+ return {
253
+ ...agent,
254
+ command,
255
+ installed: result.status === 0,
256
+ version: result.status === 0 ? result.stdout.trim() : "",
257
+ error: result.error?.message || result.stderr?.trim() || "",
258
+ };
259
+ }
260
+
261
+ export function listAgents() {
262
+ return Object.values(agentRegistry);
263
+ }
264
+
265
+ const slashInvocationAgents = new Set([
266
+ "cursor",
267
+ "windsurf",
268
+ "cline",
269
+ "continue",
270
+ "roo",
271
+ "kiro-cli",
272
+ "junie",
273
+ "github-copilot",
274
+ "antigravity",
275
+ ]);
276
+
277
+ export function getAgentInvocation(type, command = "maestro") {
278
+ if (type === "codex") return `$${command}`;
279
+ if (slashInvocationAgents.has(type)) return `/${command}`;
280
+ return command;
281
+ }