@jstn-sdk/ma 0.1.4 → 0.1.5
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.
- package/.codex/config.toml +2 -0
- package/.codex/hooks.json +1 -1
- package/.codex/prompts/enforcement.md +3 -3
- package/.codex/prompts/onboarding.md +14 -29
- package/README.md +129 -472
- package/bin/ma.js +103 -54
- package/docs/README.md +1 -2
- package/docs/getting-started.md +37 -402
- package/docs/mcp-setup.md +134 -3
- package/docs/onboarding.md +11 -41
- package/docs/qa/release-readiness-0.1.5.md +77 -0
- package/docs/release-spec.md +103 -81
- package/docs/skills-publishing.md +54 -187
- package/docs/skills.md +141 -78
- package/mcp/collections.json +1 -1
- package/mcp/fallback.json +1 -1
- package/mcp/servers.json +1 -1
- package/package.json +14 -17
- package/plugins/meta-architect/.app.json +1 -1
- package/plugins/meta-architect/.mcp.json +1 -1
- package/plugins/meta-architect/README.md +10 -23
- package/plugins/meta-architect/skills/meta-architect/SKILL.md +23 -17
- package/plugins/meta-architect/skills/meta-architect-arch/SKILL.md +24 -0
- package/plugins/meta-architect/skills/meta-architect-build/SKILL.md +25 -0
- package/plugins/meta-architect/skills/meta-architect-flow/SKILL.md +23 -0
- package/plugins/meta-architect/skills/meta-architect-sage/SKILL.md +23 -0
- package/plugins/meta-architect/skills/meta-architect-vet/SKILL.md +23 -0
- package/plugins/meta-architect/skills/meta-architect-vibe/SKILL.md +24 -0
- package/prompts/architect.md +216 -0
- package/prompts/builder.md +10 -0
- package/prompts/flow.md +9 -0
- package/prompts/release-manager.md +10 -0
- package/prompts/sage.md +10 -0
- package/prompts/security-reviewer.md +10 -0
- package/prompts/verifier.md +10 -0
- package/prompts/vibe.md +10 -0
- package/scripts/doctor.js +0 -8
- package/scripts/skills-install.js +36 -4
- package/scripts/skills-manifest.js +1 -1
- package/scripts/skills-validate.js +40 -78
- package/skills/index.json +22 -22
- package/skills/meta-architect/SKILL.md +23 -17
- package/skills/meta-architect/agents/openai.yaml +3 -3
- package/skills/meta-architect/references/core-release-rules.md +2 -2
- package/skills/meta-architect-arch/SKILL.md +24 -0
- package/skills/meta-architect-arch/agents/openai.yaml +4 -0
- package/skills/meta-architect-build/SKILL.md +25 -0
- package/skills/meta-architect-build/agents/openai.yaml +4 -0
- package/skills/meta-architect-flow/SKILL.md +23 -0
- package/skills/meta-architect-flow/agents/openai.yaml +4 -0
- package/skills/meta-architect-sage/SKILL.md +23 -0
- package/skills/meta-architect-sage/agents/openai.yaml +4 -0
- package/skills/meta-architect-vet/SKILL.md +23 -0
- package/skills/meta-architect-vet/agents/openai.yaml +4 -0
- package/skills/meta-architect-vibe/SKILL.md +24 -0
- package/skills/meta-architect-vibe/agents/openai.yaml +4 -0
- package/sprint/00-idea.md +1 -1
- package/sprint/01-architecture.md +1 -1
- package/sprint/02-oss-evidence.md +1 -1
- package/sprint/03-logic.md +1 -1
- package/sprint/04-security.md +2 -2
- package/sprint/05-dx-ux.md +1 -1
- package/src/decision-log.js +4 -4
- package/src/doctor.js +30 -0
- package/src/launcher.js +17 -21
- package/src/mcp-live-client.js +1 -1
- package/src/paths.js +32 -8
- package/src/release-state.js +3 -3
- package/src/setup.js +375 -0
- package/src/skills.js +166 -309
- package/templates/AGENTS.md +6 -6
- package/templates/model-instructions/core.md +1 -1
- package/.agents/plugins/marketplace.json +0 -20
- package/docs/assets/meta-architect-logo.png +0 -0
- package/docs/assets/meta-architect-logo.svg +0 -8
- package/docs/installed-sdk.md +0 -60
- package/docs/qa/release-readiness-0.1.4.md +0 -79
- package/plugins/meta-architect/.codex-plugin/plugin.json +0 -23
- package/plugins/meta-architect/skills/arch/SKILL.md +0 -27
- package/plugins/meta-architect/skills/arch/agents/openai.yaml +0 -4
- package/plugins/meta-architect/skills/build/SKILL.md +0 -24
- package/plugins/meta-architect/skills/build/agents/openai.yaml +0 -4
- package/plugins/meta-architect/skills/flow/SKILL.md +0 -24
- package/plugins/meta-architect/skills/flow/agents/openai.yaml +0 -4
- package/plugins/meta-architect/skills/meta-architect/agents/openai.yaml +0 -4
- package/plugins/meta-architect/skills/meta-architect/references/core-release-rules.md +0 -13
- package/plugins/meta-architect/skills/sage/SKILL.md +0 -24
- package/plugins/meta-architect/skills/sage/agents/openai.yaml +0 -4
- package/plugins/meta-architect/skills/vet/SKILL.md +0 -25
- package/plugins/meta-architect/skills/vet/agents/openai.yaml +0 -4
- package/plugins/meta-architect/skills/vibe/SKILL.md +0 -24
- package/plugins/meta-architect/skills/vibe/agents/openai.yaml +0 -4
- package/scripts/plugin-sync.js +0 -92
- package/scripts/postinstall.js +0 -23
- package/scripts/release-metadata.js +0 -94
- package/scripts/release-sync.js +0 -359
- package/scripts/release-verify.js +0 -153
- package/scripts/setup-npmrc.js +0 -39
- package/skills/arch/SKILL.md +0 -27
- package/skills/arch/agents/openai.yaml +0 -4
- package/skills/build/SKILL.md +0 -24
- package/skills/build/agents/openai.yaml +0 -4
- package/skills/flow/SKILL.md +0 -24
- package/skills/flow/agents/openai.yaml +0 -4
- package/skills/sage/SKILL.md +0 -24
- package/skills/sage/agents/openai.yaml +0 -4
- package/skills/vet/SKILL.md +0 -25
- package/skills/vet/agents/openai.yaml +0 -4
- package/skills/vibe/SKILL.md +0 -24
- package/skills/vibe/agents/openai.yaml +0 -4
- package/src/runtime-artifacts.js +0 -363
- package/src/skill-installer.js +0 -198
|
@@ -1,30 +1,36 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: meta-architect
|
|
3
|
-
description: "Use when
|
|
3
|
+
description: "Use when Codex needs the full Meta-Architect runtime layer in this repo: architecture, evidence, logic, security, experience, and build workflows operating through skill tags inside Codex. Trigger for requests about Meta-Architect orchestration, build gating, GitMCP-backed evidence, branch/worktree planning, or releasing through `development` and `prod`."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Meta-Architect
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Meta-Architect is the umbrella runtime skill for the Codex-hosted workflow in this repository.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
## Canonical runtime usage
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
1. Install `@openai/codex` and `meta-architect`
|
|
13
|
+
2. Launch `ma --madmax --high`
|
|
14
|
+
3. Operate through `$arch`, `$sage`, `$flow`, `$vet`, `$vibe`, `$build`
|
|
13
15
|
|
|
14
|
-
|
|
15
|
-
2. Continue with `$sage` to validate core stack choices against official docs or approved repo-backed sources.
|
|
16
|
-
3. Run `$flow` to map states, transitions, invariants, and blockers.
|
|
17
|
-
4. Run `$vet` to review trust boundaries, auth, data handling, and abuse paths.
|
|
18
|
-
5. Run `$vibe` to review developer and user experience quality.
|
|
19
|
-
6. Finish with `$build` to decide whether implementation is ready, what remains blocked, and what the exact next execution step should be.
|
|
16
|
+
## Secondary helper usage
|
|
20
17
|
|
|
21
|
-
|
|
18
|
+
Use helper commands only for scripted validation, diagnostics, or repo-local maintenance:
|
|
19
|
+
- `ma status`
|
|
20
|
+
- `ma idea "..."`
|
|
21
|
+
- `ma run ...`
|
|
22
|
+
- `ma merge`
|
|
23
|
+
- `ma release`
|
|
24
|
+
- `ma doctor`
|
|
25
|
+
- `ma setup`
|
|
22
26
|
|
|
23
|
-
|
|
24
|
-
- Keep the workflow architecture-first. Do not jump into code before the architecture and review lanes are grounded.
|
|
25
|
-
- Prefer official docs, upstream repos, and repo-configured GitMCP sources when validating tooling choices.
|
|
26
|
-
- End each lane with a clear result shape: decision, evidence, blockers, and exact next trigger.
|
|
27
|
+
## Expected outputs
|
|
27
28
|
|
|
28
|
-
|
|
29
|
+
- appended decisions in `.omx/decisions.json`
|
|
30
|
+
- gate updates in `.omx/release.json`
|
|
31
|
+
- evidence updates under `.omx/evidence/`
|
|
32
|
+
- explicit blockers and next allowed triggers when work is blocked
|
|
29
33
|
|
|
30
|
-
|
|
34
|
+
## Contract rule
|
|
35
|
+
|
|
36
|
+
Do not treat helper commands as the primary story. The primary story is always the Codex session launched with `ma --madmax --high`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
interface:
|
|
2
|
-
display_name: "
|
|
3
|
-
short_description: "
|
|
4
|
-
default_prompt: "Use $meta-architect to run the
|
|
2
|
+
display_name: "Meta-Architect"
|
|
3
|
+
short_description: "Codex-native runtime orchestration and gated build workflows"
|
|
4
|
+
default_prompt: "Use $meta-architect inside Codex to run the gated Meta-Architect runtime workflow in this repo."
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Core Release Rules
|
|
2
2
|
|
|
3
|
-
- Required status fields live in `.
|
|
3
|
+
- Required status fields live in `.omx/decisions.json` and `.omx/release.json`.
|
|
4
4
|
- `$build` is blocked unless:
|
|
5
5
|
- `idea_status = CLEAR`
|
|
6
6
|
- `architecture_status = APPROVED`
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
- `experience_status = GREEN` or `WAIVED`
|
|
11
11
|
- Feature work merges into `development`, never directly into `prod`.
|
|
12
12
|
- Release promotion is allowed only from `development` or approved `release/*`.
|
|
13
|
-
- Use
|
|
13
|
+
- Use `ma status`, `ma merge`, and `ma release` instead of manual state edits.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: meta-architect-arch
|
|
3
|
+
description: "Use when Codex needs to run or explain the Meta-Architect `$arch` lane for architecture, stack rationale, subsystem layout, and blueprint decisions. Trigger for requests about architecture design inside a Meta-Architect-managed repo or for producing the first design artifact after the idea is captured."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Meta-Architect Arch
|
|
7
|
+
|
|
8
|
+
Use `$arch` inside the Codex-hosted Meta-Architect runtime to produce the first architecture blueprint.
|
|
9
|
+
|
|
10
|
+
## Canonical trigger
|
|
11
|
+
|
|
12
|
+
- `$arch`
|
|
13
|
+
|
|
14
|
+
## Secondary helper path
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
ma idea "Build a fintech operations dashboard"
|
|
18
|
+
ma run '$arch'
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Expected result
|
|
22
|
+
|
|
23
|
+
- architecture decision appended to `.omx/decisions.json`
|
|
24
|
+
- `architecture_status = APPROVED` in `.omx/release.json`
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: meta-architect-build
|
|
3
|
+
description: "Use when Codex needs to run or inspect the Meta-Architect `$build` lane for gate evaluation, branch suggestions, worktree planning, and build readiness. Trigger for requests about whether the build is unlocked, which gate is blocking, or what feature branches and worktree commands should be used next."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Meta-Architect Build
|
|
7
|
+
|
|
8
|
+
Use `$build` inside the Codex-hosted Meta-Architect runtime to evaluate gate readiness and prepare bounded implementation work.
|
|
9
|
+
|
|
10
|
+
## Canonical trigger
|
|
11
|
+
|
|
12
|
+
- `$build`
|
|
13
|
+
|
|
14
|
+
## Secondary helper path
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
ma status
|
|
18
|
+
ma run '$build'
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Expected result
|
|
22
|
+
|
|
23
|
+
- blocked builds explain the exact gate failures
|
|
24
|
+
- ready builds set `build_status = READY`
|
|
25
|
+
- suggested `feature/*` branches and optional worktree commands are printed
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: meta-architect-flow
|
|
3
|
+
description: "Use when Codex needs to run or inspect the Meta-Architect `$flow` lane for business logic, state transitions, and blockers. Trigger for requests about logic maps, dead ends, state validation, or whether the workflow is ready to proceed to security review."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Meta-Architect Flow
|
|
7
|
+
|
|
8
|
+
Use `$flow` inside the Codex-hosted Meta-Architect runtime to review logic, state transitions, and blockers.
|
|
9
|
+
|
|
10
|
+
## Canonical trigger
|
|
11
|
+
|
|
12
|
+
- `$flow`
|
|
13
|
+
|
|
14
|
+
## Secondary helper path
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
ma run '$flow'
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Expected result
|
|
21
|
+
|
|
22
|
+
- logic review appended to `.omx/decisions.json`
|
|
23
|
+
- `logic_status` becomes `GREEN` or `RED`
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: meta-architect-sage
|
|
3
|
+
description: "Use when Codex needs to run or inspect the Meta-Architect `$sage` lane for OSS evidence binding through GitMCP and MCP. Trigger for requests about verifying repos, collecting evidence from configured GitMCP endpoints, or checking whether a recommendation is VERIFIED, PARTIAL, or MISSING."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Meta-Architect Sage
|
|
7
|
+
|
|
8
|
+
Use `$sage` inside the Codex-hosted Meta-Architect runtime to bind architecture choices to approved GitMCP evidence.
|
|
9
|
+
|
|
10
|
+
## Canonical trigger
|
|
11
|
+
|
|
12
|
+
- `$sage`
|
|
13
|
+
|
|
14
|
+
## Secondary helper path
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
ma run '$sage'
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Expected result
|
|
21
|
+
|
|
22
|
+
- `.omx/evidence/sources.json` records validated endpoints and live-probe metadata
|
|
23
|
+
- `evidence_status` moves to `VERIFIED`, `PARTIAL`, or `MISSING`
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: meta-architect-vet
|
|
3
|
+
description: "Use when Codex needs to run or inspect the Meta-Architect `$vet` lane for security review, risk logging, and CVE-style findings. Trigger for requests about security posture, safer alternatives, audit evidence, or whether the build should stay blocked on security grounds."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Meta-Architect Vet
|
|
7
|
+
|
|
8
|
+
Use `$vet` inside the Codex-hosted Meta-Architect runtime to review security posture and release-sensitive findings.
|
|
9
|
+
|
|
10
|
+
## Canonical trigger
|
|
11
|
+
|
|
12
|
+
- `$vet`
|
|
13
|
+
|
|
14
|
+
## Secondary helper path
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
ma run '$vet'
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Expected result
|
|
21
|
+
|
|
22
|
+
- `.omx/evidence/audits.json` and `.omx/evidence/cves.json` are updated
|
|
23
|
+
- `security_status` becomes `GREEN` or `RED`
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: meta-architect-vibe
|
|
3
|
+
description: "Use when Codex needs to run or inspect the Meta-Architect `$vibe` lane for developer-experience and user-experience review before build execution. Trigger for requests about DX friction, UX risks, operator flow quality, or whether the experience gate should be GREEN or WAIVED."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Meta-Architect Vibe
|
|
7
|
+
|
|
8
|
+
Use `$vibe` inside the Codex-hosted Meta-Architect runtime to review developer and user experience before build planning.
|
|
9
|
+
|
|
10
|
+
## Canonical trigger
|
|
11
|
+
|
|
12
|
+
- `$vibe`
|
|
13
|
+
|
|
14
|
+
## Secondary helper path
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
ma run '$vibe'
|
|
18
|
+
ma run '$vibe' --waive --reason "Accepted for this release line"
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Expected result
|
|
22
|
+
|
|
23
|
+
- `.omx/evidence/outcomes.json` is updated
|
|
24
|
+
- `experience_status` becomes `GREEN`, `RED`, or `WAIVED`
|
package/sprint/00-idea.md
CHANGED
|
@@ -12,7 +12,7 @@ Capture a project idea, clarify scope and constraints, and move the repository f
|
|
|
12
12
|
|
|
13
13
|
## Expected outputs
|
|
14
14
|
|
|
15
|
-
- idea decision entry in `.
|
|
15
|
+
- idea decision entry in `.omx/decisions.json`
|
|
16
16
|
- `idea_status = CLEAR` when the brief is good enough to proceed
|
|
17
17
|
|
|
18
18
|
## Exit criteria
|
|
@@ -11,7 +11,7 @@ Produce a structured first-pass architecture blueprint, stack rationale, and dow
|
|
|
11
11
|
|
|
12
12
|
## Expected outputs
|
|
13
13
|
|
|
14
|
-
- architecture decision in `.
|
|
14
|
+
- architecture decision in `.omx/decisions.json`
|
|
15
15
|
- `architecture_status = APPROVED`
|
|
16
16
|
|
|
17
17
|
## Exit criteria
|
package/sprint/03-logic.md
CHANGED
|
@@ -11,7 +11,7 @@ Record a structured first-pass logic/state review and block progress if prerequi
|
|
|
11
11
|
|
|
12
12
|
## Expected outputs
|
|
13
13
|
|
|
14
|
-
- logic review entry in `.
|
|
14
|
+
- logic review entry in `.omx/decisions.json`
|
|
15
15
|
- `logic_status = GREEN | RED`
|
|
16
16
|
|
|
17
17
|
## Exit criteria
|
package/sprint/04-security.md
CHANGED
|
@@ -10,8 +10,8 @@ Record a baseline security pass and keep the workflow blocked if prerequisites a
|
|
|
10
10
|
|
|
11
11
|
## Expected outputs
|
|
12
12
|
|
|
13
|
-
- `.
|
|
14
|
-
- `.
|
|
13
|
+
- `.omx/evidence/audits.json`
|
|
14
|
+
- `.omx/evidence/cves.json`
|
|
15
15
|
- `security_status = GREEN | RED`
|
|
16
16
|
|
|
17
17
|
## Exit criteria
|
package/sprint/05-dx-ux.md
CHANGED
package/src/decision-log.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { readJson, writeJson } from "./fs-utils.js";
|
|
2
|
-
import {
|
|
2
|
+
import { getDecisionsPath } from "./paths.js";
|
|
3
3
|
|
|
4
4
|
function validateDecisionShape(entry) {
|
|
5
5
|
const required = ["decision", "status", "evidence", "blockers", "next_allowed_triggers"];
|
|
@@ -11,7 +11,7 @@ function validateDecisionShape(entry) {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export async function loadDecisionLog() {
|
|
14
|
-
const parsed = await readJson(
|
|
14
|
+
const parsed = await readJson(getDecisionsPath());
|
|
15
15
|
|
|
16
16
|
if (!parsed || typeof parsed !== "object" || !Array.isArray(parsed.decisions)) {
|
|
17
17
|
throw new Error("Decision log must be an object with a decisions array");
|
|
@@ -28,7 +28,7 @@ export async function appendDecision(entry) {
|
|
|
28
28
|
timestamp: new Date().toISOString(),
|
|
29
29
|
});
|
|
30
30
|
|
|
31
|
-
await writeJson(
|
|
31
|
+
await writeJson(getDecisionsPath(), log);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
export async function updateDecisionStatuses(statusUpdates) {
|
|
@@ -36,5 +36,5 @@ export async function updateDecisionStatuses(statusUpdates) {
|
|
|
36
36
|
for (const [field, value] of Object.entries(statusUpdates)) {
|
|
37
37
|
log[field] = value;
|
|
38
38
|
}
|
|
39
|
-
await writeJson(
|
|
39
|
+
await writeJson(getDecisionsPath(), log);
|
|
40
40
|
}
|
package/src/doctor.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { getRepoRoot } from "./paths.js";
|
|
4
|
+
|
|
5
|
+
const checks = [
|
|
6
|
+
"AGENTS.md",
|
|
7
|
+
".codex/config.toml",
|
|
8
|
+
".codex/hooks.json",
|
|
9
|
+
".codex/agents/architect.toml",
|
|
10
|
+
".codex/prompts/enforcement.md",
|
|
11
|
+
".omx/decisions.json",
|
|
12
|
+
".omx/release.json",
|
|
13
|
+
"mcp/servers.json",
|
|
14
|
+
"templates/AGENTS.md",
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
export function runDoctor() {
|
|
18
|
+
const repoRoot = getRepoRoot();
|
|
19
|
+
let failures = 0;
|
|
20
|
+
|
|
21
|
+
for (const relativePath of checks) {
|
|
22
|
+
const ok = fs.existsSync(path.join(repoRoot, relativePath));
|
|
23
|
+
console.log(`${ok ? "[OK]" : "[MISSING]"} ${relativePath}`);
|
|
24
|
+
if (!ok) {
|
|
25
|
+
failures += 1;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return failures === 0 ? 0 : 1;
|
|
30
|
+
}
|
package/src/launcher.js
CHANGED
|
@@ -1,56 +1,52 @@
|
|
|
1
1
|
import { spawnSync } from "node:child_process";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
|
|
4
|
-
const
|
|
4
|
+
const maintenanceCommands = new Set([
|
|
5
5
|
"setup",
|
|
6
6
|
"init",
|
|
7
|
+
"doctor",
|
|
7
8
|
"idea",
|
|
8
9
|
"skills",
|
|
9
|
-
"sdk-path",
|
|
10
10
|
"status",
|
|
11
|
+
"run",
|
|
11
12
|
"merge",
|
|
12
13
|
"release",
|
|
13
|
-
"run",
|
|
14
14
|
]);
|
|
15
15
|
|
|
16
16
|
export function shouldDelegateToCodex(args) {
|
|
17
17
|
if (args.length === 0) {
|
|
18
|
-
return
|
|
18
|
+
return false;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
const first = args[0];
|
|
22
|
+
return first.startsWith("-") || !maintenanceCommands.has(first);
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
function normalizeCodexArgs(args) {
|
|
25
|
+
export function normalizeCodexArgs(args) {
|
|
25
26
|
return args.filter((arg) => arg !== "--madmax" && arg !== "--high");
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
function resolveCodexCommand() {
|
|
29
|
-
|
|
30
|
-
return process.env.MA_CODEX_BIN;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return "codex";
|
|
30
|
+
return process.env.MA_CODEX_BIN ?? "codex";
|
|
34
31
|
}
|
|
35
32
|
|
|
36
33
|
export function runCodex(args) {
|
|
37
34
|
const codexCommand = resolveCodexCommand();
|
|
38
35
|
const codexArgs = normalizeCodexArgs(args);
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const result = spawnSync(command, finalArgs, { stdio: "inherit" });
|
|
36
|
+
const useNode = path.extname(codexCommand) === ".js" || path.extname(codexCommand) === ".mjs";
|
|
37
|
+
const command = useNode ? process.execPath : codexCommand;
|
|
38
|
+
const finalArgs = useNode ? [codexCommand, ...codexArgs] : codexArgs;
|
|
39
|
+
const result = spawnSync(command, finalArgs, {
|
|
40
|
+
stdio: "inherit",
|
|
41
|
+
});
|
|
46
42
|
|
|
47
43
|
if (result.error) {
|
|
48
44
|
if (result.error.code === "ENOENT") {
|
|
49
|
-
throw new Error("Codex not found. Install it with: npm
|
|
45
|
+
throw new Error("Codex CLI not found. Install it with: npm i -g @openai/codex");
|
|
50
46
|
}
|
|
51
47
|
|
|
52
|
-
throw new Error(`Failed to start Codex: ${result.error.message}`);
|
|
48
|
+
throw new Error(`Failed to start Codex CLI: ${result.error.message}`);
|
|
53
49
|
}
|
|
54
50
|
|
|
55
|
-
return
|
|
51
|
+
return result.status ?? 1;
|
|
56
52
|
}
|
package/src/mcp-live-client.js
CHANGED
package/src/paths.js
CHANGED
|
@@ -5,22 +5,46 @@ const __filename = fileURLToPath(import.meta.url);
|
|
|
5
5
|
const __dirname = path.dirname(__filename);
|
|
6
6
|
|
|
7
7
|
export const packageRoot = path.resolve(__dirname, "..");
|
|
8
|
+
export function getPackageRoot() {
|
|
9
|
+
return packageRoot;
|
|
10
|
+
}
|
|
11
|
+
|
|
8
12
|
export function getRepoRoot() {
|
|
9
|
-
return
|
|
13
|
+
return path.resolve(process.env.MA_ROOT ?? process.cwd());
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function resolveRepoPath(...parts) {
|
|
17
|
+
return path.join(getRepoRoot(), ...parts);
|
|
10
18
|
}
|
|
11
19
|
|
|
12
|
-
export function
|
|
13
|
-
return
|
|
20
|
+
export function getOmxRoot() {
|
|
21
|
+
return resolveRepoPath(".omx");
|
|
14
22
|
}
|
|
15
23
|
|
|
16
|
-
export function
|
|
17
|
-
return path.join(
|
|
24
|
+
export function getReleaseStatePath() {
|
|
25
|
+
return path.join(getOmxRoot(), "release.json");
|
|
18
26
|
}
|
|
19
27
|
|
|
20
|
-
export function
|
|
21
|
-
return path.join(
|
|
28
|
+
export function getDecisionsPath() {
|
|
29
|
+
return path.join(getOmxRoot(), "decisions.json");
|
|
22
30
|
}
|
|
23
31
|
|
|
24
32
|
export function getMcpServersPath() {
|
|
25
|
-
return
|
|
33
|
+
return resolveRepoPath("mcp", "servers.json");
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function getSourcesPath() {
|
|
37
|
+
return path.join(getOmxRoot(), "evidence", "sources.json");
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function getAuditsPath() {
|
|
41
|
+
return path.join(getOmxRoot(), "evidence", "audits.json");
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function getOutcomesPath() {
|
|
45
|
+
return path.join(getOmxRoot(), "evidence", "outcomes.json");
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function getCvesPath() {
|
|
49
|
+
return path.join(getOmxRoot(), "evidence", "cves.json");
|
|
26
50
|
}
|
package/src/release-state.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from "node:fs/promises";
|
|
2
2
|
import { writeJson } from "./fs-utils.js";
|
|
3
|
-
import {
|
|
3
|
+
import { getReleaseStatePath } from "./paths.js";
|
|
4
4
|
|
|
5
5
|
const allowedStatuses = {
|
|
6
6
|
idea_status: ["DRAFT", "CLEAR", "BLOCKED"],
|
|
@@ -43,7 +43,7 @@ export function validateReleaseState(state) {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
export async function loadReleaseState() {
|
|
46
|
-
const raw = await fs.readFile(
|
|
46
|
+
const raw = await fs.readFile(getReleaseStatePath(), "utf8");
|
|
47
47
|
const parsed = JSON.parse(raw);
|
|
48
48
|
return validateReleaseState(parsed);
|
|
49
49
|
}
|
|
@@ -54,6 +54,6 @@ export async function saveReleaseState(state) {
|
|
|
54
54
|
...state,
|
|
55
55
|
updatedAt: new Date().toISOString(),
|
|
56
56
|
};
|
|
57
|
-
await writeJson(
|
|
57
|
+
await writeJson(getReleaseStatePath(), next);
|
|
58
58
|
return next;
|
|
59
59
|
}
|