agent-composer 0.2.2 → 0.3.0

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/README.md CHANGED
@@ -77,7 +77,7 @@ Two files at the consumer-project root, both gitignored or partially gitignored:
77
77
  "roles": {
78
78
  "researcher": { "provider": "cli", "cli": ["codex", "--search", "--ask-for-approval", "never", "exec", "--ephemeral", "--sandbox", "read-only"], "timeoutMs": 180000, "retries": 0 },
79
79
  "coder": { "provider": "anthropic", "baseUrl": "https://api.z.ai/api/anthropic", "apiKeyEnv": "ANTHROPIC_AUTH_TOKEN" },
80
- "coderCli": { "provider": "cli", "cli": ["codex", "exec", "--ephemeral", "--sandbox", "workspace-write", "-c", "approval_policy=\"never\""], "retries": 0 },
80
+ "coderCli": { "provider": "cli", "cli": ["codex", "exec", "--ephemeral", "--sandbox", "workspace-write", "-c", "approval_policy=\"never\"", "-c", "model_reasoning_effort=\"medium\""], "timeoutMs": 900000, "retries": 0 },
81
81
  "reviewer": { "provider": "cli", "cli": ["agy", "--dangerously-skip-permissions", "--print-timeout", "90s", "-p"], "timeoutMs": 120000, "retries": 0 },
82
82
  "reviewerClaude": {
83
83
  "provider": "cli",
@@ -105,6 +105,9 @@ main session receives a short outcome instead of raw event output. Composer
105
105
  refuses explicit `codex exec --sandbox danger-full-access` and
106
106
  `--dangerously-bypass-approvals-and-sandbox` configs by default; set
107
107
  `COMPOSER_ALLOW_DANGEROUS_CODEX=1` only inside an external sandbox.
108
+ The default Codex coding lane sets `timeoutMs` to 15 minutes and overrides
109
+ the nested Codex run to `model_reasoning_effort="medium"` so it does not
110
+ inherit slower global high-effort settings intended for the main orchestrator.
108
111
  Keep `reviewer` as the default gate. Use `reviewerClaude` only when the user
109
112
  asks for Claude review or when a risky diff needs an expensive second opinion.
110
113
 
@@ -124,7 +127,7 @@ small SDK harness:
124
127
  - CLI calls append best-effort timing records to
125
128
  `/tmp/composer-cli-usage.jsonl`; GLM calls append timing/cache records to
126
129
  `/tmp/composer-glm-usage.jsonl`. These files contain durations and character
127
- counts, not prompts.
130
+ counts plus success/error status, not prompts.
128
131
 
129
132
  **`.env.json`** (NEVER commit) — credentials only:
130
133
 
@@ -225,7 +228,7 @@ Five resilience layers ensure unattended `/evolve` runs cannot damage the host r
225
228
 
226
229
  ## Security model
227
230
 
228
- - **`agent-composer` publish surface**: `dist/`, `plugin/`, `composer.config.schema.json`, `README.md`, `package.json`. No tests, no source, no `.env*` (gitignored). Current npm dry-run package size is 83.2 KB.
231
+ - **`agent-composer` publish surface**: `dist/`, `plugin/`, `composer.config.schema.json`, `README.md`, `package.json`. No tests, no source, no `.env*` (gitignored). Current npm dry-run package size is 84.4 KB.
229
232
  - **Spend caps**: per-call (`maxUsdPerCall`, default $0.50) and per-session (`maxUsdPerSession`, default $5.00) enforced in the runner before any external API call. Configurable per project.
230
233
  - **Self-evolution scope** (see ADR 0003): five layers gate any SKILL.md mutation — diff-path regex, text deny-list, stat gate, human-promote-only, audit trail. Auto-promote is permanently off the table.
231
234
  - **Boundary hook**: PreToolUse fail-closed denial of `Edit`/`Update`/`Write`/`NotebookEdit` in the orchestrator session, plus MCP write/edit/exec variants. Native Bash is allowed for inspection and verification. The C0.5 subagent tools allowlist is append-only.
@@ -37,9 +37,200 @@
37
37
  },
38
38
  "spendAuthorization": {
39
39
  "$ref": "#/$defs/spendAuthorization"
40
+ },
41
+ "codexReview": {
42
+ "$ref": "#/$defs/codexReview"
43
+ },
44
+ "codexRescue": {
45
+ "$ref": "#/$defs/codexRescue"
40
46
  }
41
47
  },
42
48
  "$defs": {
49
+ "codexReview": {
50
+ "type": "object",
51
+ "required": [
52
+ "enabled"
53
+ ],
54
+ "additionalProperties": false,
55
+ "description": "Optional Codex review-gate settings. Composer owns the trigger points; omit or disable to keep review-gate off.",
56
+ "properties": {
57
+ "enabled": {
58
+ "type": "boolean",
59
+ "description": "Master opt-in switch. false keeps Codex review-gate shipped off."
60
+ },
61
+ "triggers": {
62
+ "type": "object",
63
+ "additionalProperties": false,
64
+ "description": "Composer trigger points that may request Codex review.",
65
+ "properties": {
66
+ "preCommit": {
67
+ "type": "boolean",
68
+ "description": "Run Codex review before commit when enabled."
69
+ },
70
+ "postPlan": {
71
+ "type": "boolean",
72
+ "description": "Run Codex review after planning when enabled."
73
+ }
74
+ }
75
+ },
76
+ "preCommitCommand": {
77
+ "type": "string",
78
+ "enum": [
79
+ "review",
80
+ "adversarial-review"
81
+ ],
82
+ "description": "Codex companion verb for pre-commit review. Omitted = review."
83
+ },
84
+ "postPlanCommand": {
85
+ "type": "string",
86
+ "enum": [
87
+ "review",
88
+ "adversarial-review"
89
+ ],
90
+ "description": "Codex companion verb for post-plan review. Omitted = adversarial-review."
91
+ },
92
+ "mode": {
93
+ "type": "string",
94
+ "enum": [
95
+ "ask",
96
+ "auto"
97
+ ],
98
+ "description": "ask: require user confirmation before invoking Codex. auto: invoke without asking. Omitted = ask."
99
+ },
100
+ "execution": {
101
+ "type": "string",
102
+ "enum": [
103
+ "foreground",
104
+ "background"
105
+ ],
106
+ "description": "foreground: wait for Codex review. background: launch review asynchronously. Omitted = background."
107
+ },
108
+ "scope": {
109
+ "type": "string",
110
+ "enum": [
111
+ "auto",
112
+ "working-tree",
113
+ "branch"
114
+ ],
115
+ "description": "auto: infer review scope. working-tree: review local changes. branch: review against base. Omitted = auto."
116
+ },
117
+ "base": {
118
+ "type": "string",
119
+ "minLength": 1,
120
+ "description": "Base branch for branch-scoped review. Omitted = main."
121
+ },
122
+ "model": {
123
+ "type": "string",
124
+ "minLength": 1,
125
+ "description": "Optional Codex model passed to codex-companion via --model."
126
+ },
127
+ "preCommitHook": {
128
+ "$ref": "#/$defs/codexPreCommitHook"
129
+ },
130
+ "warmCache": {
131
+ "$ref": "#/$defs/codexWarmCache"
132
+ },
133
+ "notify": {
134
+ "$ref": "#/$defs/codexReviewNotify"
135
+ }
136
+ }
137
+ },
138
+ "codexWarmCache": {
139
+ "type": "object",
140
+ "additionalProperties": false,
141
+ "description": "Optional background warm cache for the mechanical Codex pre-commit gate. Omitted or disabled = off.",
142
+ "properties": {
143
+ "enabled": {
144
+ "type": "boolean",
145
+ "default": false,
146
+ "description": "If true, Stop hooks may warm a cached Codex review verdict for the current diff."
147
+ },
148
+ "maxAgeMinutes": {
149
+ "type": "integer",
150
+ "minimum": 1,
151
+ "default": 30,
152
+ "description": "Maximum age for cached pre-commit verdicts. Omitted = 30."
153
+ },
154
+ "timeoutMs": {
155
+ "type": "integer",
156
+ "minimum": 1,
157
+ "default": 300000,
158
+ "description": "Warm review wall-clock timeout in milliseconds. Omitted = 300000."
159
+ }
160
+ }
161
+ },
162
+ "codexReviewNotify": {
163
+ "type": "object",
164
+ "additionalProperties": false,
165
+ "description": "Optional user notifications for Codex review-gate activity.",
166
+ "properties": {
167
+ "desktop": {
168
+ "type": "boolean",
169
+ "default": false,
170
+ "description": "If true, use macOS desktop notifications for sync review start and deny events."
171
+ }
172
+ }
173
+ },
174
+ "codexRescue": {
175
+ "type": "object",
176
+ "additionalProperties": false,
177
+ "description": "Optional guidance-only Codex Rescue integration settings.",
178
+ "properties": {
179
+ "enabled": {
180
+ "type": "boolean",
181
+ "default": true,
182
+ "description": "If true, skills may suggest Codex Rescue for stuck or failing work."
183
+ },
184
+ "mode": {
185
+ "type": "string",
186
+ "enum": [
187
+ "ask",
188
+ "auto"
189
+ ],
190
+ "default": "ask",
191
+ "description": "ask: request confirmation before rescue. auto: allow documented rescue flow to proceed."
192
+ },
193
+ "model": {
194
+ "type": "string",
195
+ "minLength": 1,
196
+ "default": "gpt-5.4-mini",
197
+ "description": "Model label used in Codex Rescue guidance."
198
+ }
199
+ }
200
+ },
201
+ "codexPreCommitHook": {
202
+ "type": "object",
203
+ "required": [
204
+ "enabled"
205
+ ],
206
+ "additionalProperties": false,
207
+ "description": "Optional mechanical PreToolUse gate for git commit. Omitted or disabled = off.",
208
+ "properties": {
209
+ "enabled": {
210
+ "type": "boolean",
211
+ "description": "Opt-in switch for the mechanical pre-commit gate."
212
+ },
213
+ "blockOnSeverity": {
214
+ "type": "string",
215
+ "enum": [
216
+ "critical",
217
+ "high",
218
+ "medium",
219
+ "low"
220
+ ],
221
+ "description": "Minimum finding severity that blocks commit. Omitted = high."
222
+ },
223
+ "timeoutMs": {
224
+ "type": "integer",
225
+ "minimum": 1,
226
+ "description": "Review wall-clock timeout in milliseconds. Omitted = 120000."
227
+ },
228
+ "failClosed": {
229
+ "type": "boolean",
230
+ "description": "If true, reviewer unavailability blocks commit. Omitted = false."
231
+ }
232
+ }
233
+ },
43
234
  "spendAuthorization": {
44
235
  "type": "object",
45
236
  "required": [
@@ -0,0 +1,21 @@
1
+ import type { ComposerConfig } from "../config/schema.js";
2
+ export interface CodexPluginRoot {
3
+ root: string;
4
+ version: string | null;
5
+ }
6
+ export interface DoctorCheck {
7
+ name: string;
8
+ status: "pass" | "warn" | "fail";
9
+ detail: string;
10
+ }
11
+ export interface DoctorReport {
12
+ checks: DoctorCheck[];
13
+ healthy: boolean;
14
+ }
15
+ export declare function resolveCodexPluginRoot(pluginsDir: string): CodexPluginRoot | null;
16
+ export declare function buildConfigChecks(config: ComposerConfig): DoctorCheck[];
17
+ export declare function isHealthy(checks: DoctorCheck[]): boolean;
18
+ export declare function runDoctor(opts: {
19
+ cwd: string;
20
+ verbose?: boolean;
21
+ }): Promise<DoctorReport>;
@@ -0,0 +1,383 @@
1
+ // Optional Codex review-gate diagnostics.
2
+ //
3
+ // The doctor is intentionally resilient: missing optional integrations are
4
+ // reported as checks instead of throwing out of the CLI.
5
+ import { existsSync, readdirSync, readFileSync } from "node:fs";
6
+ import { homedir } from "node:os";
7
+ import { join, resolve } from "node:path";
8
+ import { spawnSync } from "node:child_process";
9
+ import { loadConfig } from "../config/loader.js";
10
+ const DEFAULT_CODEX_REVIEW = {
11
+ enabled: false,
12
+ triggers: {
13
+ preCommit: false,
14
+ postPlan: false,
15
+ },
16
+ preCommitCommand: "review",
17
+ postPlanCommand: "adversarial-review",
18
+ mode: "ask",
19
+ execution: "background",
20
+ scope: "auto",
21
+ base: "main",
22
+ preCommitHook: {
23
+ enabled: false,
24
+ blockOnSeverity: "high",
25
+ timeoutMs: 120000,
26
+ failClosed: false,
27
+ },
28
+ warmCache: {
29
+ enabled: false,
30
+ maxAgeMinutes: 30,
31
+ timeoutMs: 300000,
32
+ },
33
+ notify: {
34
+ desktop: false,
35
+ },
36
+ };
37
+ const DEFAULT_CODEX_RESCUE = {
38
+ enabled: true,
39
+ mode: "ask",
40
+ model: "gpt-5.4-mini",
41
+ };
42
+ export function resolveCodexPluginRoot(pluginsDir) {
43
+ const marketplaceRoot = join(pluginsDir, "marketplaces", "openai-codex", "plugins", "codex");
44
+ const marketplace = readCodexPluginRoot(marketplaceRoot);
45
+ if (marketplace)
46
+ return marketplace;
47
+ const cacheBase = join(pluginsDir, "cache", "openai-codex", "codex");
48
+ const cacheRoots = listSemverDirectories(cacheBase)
49
+ .sort((a, b) => compareSemver(b.version, a.version))
50
+ .map((entry) => readCodexPluginRoot(entry.root))
51
+ .filter((entry) => entry !== null);
52
+ return cacheRoots[0] ?? null;
53
+ }
54
+ export function buildConfigChecks(config) {
55
+ const codexReview = config.codexReview;
56
+ const resolved = resolveCodexReview(codexReview);
57
+ const rescue = resolveCodexRescue(config.codexRescue);
58
+ const enabledCheck = codexReview
59
+ ? reviewEnabledCheck(resolved)
60
+ : {
61
+ name: "config: codexReview",
62
+ status: "warn",
63
+ detail: "Codex review-gate is OFF (optional)",
64
+ };
65
+ return [
66
+ enabledCheck,
67
+ {
68
+ name: "config: codexReview triggers",
69
+ status: "pass",
70
+ detail: `preCommit=${resolved.triggers.preCommit}, postPlan=${resolved.triggers.postPlan}`,
71
+ },
72
+ {
73
+ name: "config: codexReview defaults",
74
+ status: "pass",
75
+ detail: `preCommitCommand=${resolved.preCommitCommand}, ` +
76
+ `postPlanCommand=${resolved.postPlanCommand}, ` +
77
+ `mode=${resolved.mode}, execution=${resolved.execution}, ` +
78
+ `scope=${resolved.scope}, base=${resolved.base}, ` +
79
+ `model=${resolved.model ?? "unset"}`,
80
+ },
81
+ preCommitHookCheck(resolved),
82
+ preCommitCommandCheck(resolved),
83
+ warmCacheCheck(resolved),
84
+ {
85
+ name: "config: codexReview notify",
86
+ status: "pass",
87
+ detail: `desktop=${resolved.notify.desktop ? "on" : "off"}`,
88
+ },
89
+ {
90
+ name: "config: codexRescue",
91
+ status: "pass",
92
+ detail: `enabled=${rescue.enabled}, mode=${rescue.mode}, model=${rescue.model}`,
93
+ },
94
+ ];
95
+ }
96
+ export function isHealthy(checks) {
97
+ return checks.every((check) => check.status !== "fail");
98
+ }
99
+ export async function runDoctor(opts) {
100
+ const config = loadConfigCheck(opts.cwd);
101
+ const codexCli = checkCodexCli();
102
+ const pluginRoot = resolveCodexPluginRoot(join(homedir(), ".claude", "plugins"));
103
+ const pluginCheck = checkCodexPluginRoot(pluginRoot);
104
+ const setupChecks = pluginRoot ? queryCodexSetup(pluginRoot.root) : [];
105
+ const configChecks = config.ok ? buildConfigChecks(config.config) : [config.check];
106
+ const checks = [codexCli, pluginCheck, ...setupChecks, ...configChecks];
107
+ const report = { checks, healthy: isHealthy(checks) };
108
+ if (opts.verbose !== false)
109
+ printReport(report);
110
+ return report;
111
+ }
112
+ function readCodexPluginRoot(root) {
113
+ const pluginJson = join(root, ".claude-plugin", "plugin.json");
114
+ const companion = join(root, "scripts", "codex-companion.mjs");
115
+ if (!existsSync(pluginJson) || !existsSync(companion))
116
+ return null;
117
+ return { root, version: readPluginVersion(pluginJson) };
118
+ }
119
+ function readPluginVersion(pluginJson) {
120
+ try {
121
+ const parsed = JSON.parse(readFileSync(pluginJson, "utf8"));
122
+ if (isRecord(parsed) && typeof parsed["version"] === "string")
123
+ return parsed["version"];
124
+ return null;
125
+ }
126
+ catch {
127
+ return null;
128
+ }
129
+ }
130
+ function listSemverDirectories(base) {
131
+ try {
132
+ if (!existsSync(base))
133
+ return [];
134
+ return readdirSync(base, { withFileTypes: true })
135
+ .filter((entry) => entry.isDirectory() && parseSemver(entry.name) !== null)
136
+ .map((entry) => ({ root: join(base, entry.name), version: entry.name }));
137
+ }
138
+ catch {
139
+ return [];
140
+ }
141
+ }
142
+ function parseSemver(version) {
143
+ const match = /^(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/.exec(version);
144
+ if (!match)
145
+ return null;
146
+ const major = Number(match[1]);
147
+ const minor = Number(match[2]);
148
+ const patch = Number(match[3]);
149
+ if (!Number.isSafeInteger(major) || !Number.isSafeInteger(minor) || !Number.isSafeInteger(patch))
150
+ return null;
151
+ return [major, minor, patch];
152
+ }
153
+ function compareSemver(a, b) {
154
+ const left = parseSemver(a) ?? [0, 0, 0];
155
+ const right = parseSemver(b) ?? [0, 0, 0];
156
+ return left[0] - right[0] || left[1] - right[1] || left[2] - right[2] || a.localeCompare(b);
157
+ }
158
+ function resolveCodexReview(codexReview) {
159
+ return {
160
+ enabled: codexReview?.enabled ?? DEFAULT_CODEX_REVIEW.enabled,
161
+ triggers: {
162
+ preCommit: codexReview?.triggers?.preCommit ?? DEFAULT_CODEX_REVIEW.triggers.preCommit,
163
+ postPlan: codexReview?.triggers?.postPlan ?? DEFAULT_CODEX_REVIEW.triggers.postPlan,
164
+ },
165
+ preCommitCommand: codexReview?.preCommitCommand ?? DEFAULT_CODEX_REVIEW.preCommitCommand,
166
+ postPlanCommand: codexReview?.postPlanCommand ?? DEFAULT_CODEX_REVIEW.postPlanCommand,
167
+ mode: codexReview?.mode ?? DEFAULT_CODEX_REVIEW.mode,
168
+ execution: codexReview?.execution ?? DEFAULT_CODEX_REVIEW.execution,
169
+ scope: codexReview?.scope ?? DEFAULT_CODEX_REVIEW.scope,
170
+ base: codexReview?.base ?? DEFAULT_CODEX_REVIEW.base,
171
+ model: codexReview?.model ?? DEFAULT_CODEX_REVIEW.model,
172
+ preCommitHook: {
173
+ enabled: codexReview?.preCommitHook?.enabled ?? DEFAULT_CODEX_REVIEW.preCommitHook.enabled,
174
+ blockOnSeverity: codexReview?.preCommitHook?.blockOnSeverity ?? DEFAULT_CODEX_REVIEW.preCommitHook.blockOnSeverity,
175
+ timeoutMs: codexReview?.preCommitHook?.timeoutMs ?? DEFAULT_CODEX_REVIEW.preCommitHook.timeoutMs,
176
+ failClosed: codexReview?.preCommitHook?.failClosed ?? DEFAULT_CODEX_REVIEW.preCommitHook.failClosed,
177
+ },
178
+ warmCache: {
179
+ enabled: codexReview?.warmCache?.enabled ?? DEFAULT_CODEX_REVIEW.warmCache.enabled,
180
+ maxAgeMinutes: codexReview?.warmCache?.maxAgeMinutes ?? DEFAULT_CODEX_REVIEW.warmCache.maxAgeMinutes,
181
+ timeoutMs: codexReview?.warmCache?.timeoutMs ?? DEFAULT_CODEX_REVIEW.warmCache.timeoutMs,
182
+ },
183
+ notify: {
184
+ desktop: codexReview?.notify?.desktop ?? DEFAULT_CODEX_REVIEW.notify.desktop,
185
+ },
186
+ };
187
+ }
188
+ function resolveCodexRescue(codexRescue) {
189
+ return {
190
+ enabled: codexRescue?.enabled ?? DEFAULT_CODEX_RESCUE.enabled,
191
+ mode: codexRescue?.mode ?? DEFAULT_CODEX_RESCUE.mode,
192
+ model: codexRescue?.model ?? DEFAULT_CODEX_RESCUE.model,
193
+ };
194
+ }
195
+ function reviewEnabledCheck(resolved) {
196
+ return resolved.enabled
197
+ ? {
198
+ name: "config: codexReview",
199
+ status: "pass",
200
+ detail: "Codex review-gate is ON",
201
+ }
202
+ : {
203
+ name: "config: codexReview",
204
+ status: "warn",
205
+ detail: "Codex review-gate is OFF (optional)",
206
+ };
207
+ }
208
+ function preCommitHookCheck(resolved) {
209
+ const hook = resolved.preCommitHook;
210
+ return hook.enabled
211
+ ? {
212
+ name: "config: codexReview preCommitHook",
213
+ status: "pass",
214
+ detail: `mechanical gate enabled=${hook.enabled}, ` +
215
+ `blockOnSeverity=${hook.blockOnSeverity}, failClosed=${hook.failClosed}`,
216
+ }
217
+ : {
218
+ name: "config: codexReview preCommitHook",
219
+ status: "warn",
220
+ detail: "mechanical pre-commit gate OFF",
221
+ };
222
+ }
223
+ function preCommitCommandCheck(resolved) {
224
+ if (resolved.preCommitHook.enabled && resolved.preCommitCommand === "review") {
225
+ return {
226
+ name: "config: codexReview preCommitCommand",
227
+ status: "warn",
228
+ detail: "preCommitCommand 'review' returns free-text only — the mechanical gate cannot extract a verdict; use 'adversarial-review'",
229
+ };
230
+ }
231
+ return {
232
+ name: "config: codexReview preCommitCommand",
233
+ status: "pass",
234
+ detail: `preCommitCommand=${resolved.preCommitCommand}`,
235
+ };
236
+ }
237
+ function warmCacheCheck(resolved) {
238
+ const warmCache = resolved.warmCache;
239
+ if (warmCache.enabled && !resolved.preCommitHook.enabled) {
240
+ return {
241
+ name: "config: codexReview warmCache",
242
+ status: "warn",
243
+ detail: `warm cache is inert without preCommitHook, maxAgeMinutes=${warmCache.maxAgeMinutes}`,
244
+ };
245
+ }
246
+ if (warmCache.enabled && !resolved.enabled) {
247
+ return {
248
+ name: "config: codexReview warmCache",
249
+ status: "warn",
250
+ detail: `on but inert because codexReview.enabled=false, maxAgeMinutes=${warmCache.maxAgeMinutes}`,
251
+ };
252
+ }
253
+ return {
254
+ name: "config: codexReview warmCache",
255
+ status: "pass",
256
+ detail: `${warmCache.enabled ? "on" : "off"}, maxAgeMinutes=${warmCache.maxAgeMinutes}`,
257
+ };
258
+ }
259
+ function loadConfigCheck(cwd) {
260
+ const previousCwd = process.cwd();
261
+ try {
262
+ process.chdir(resolve(cwd));
263
+ const configPath = process.env["COMPOSER_CONFIG"] ?? "composer.config.json";
264
+ return { ok: true, config: loadConfig(configPath) };
265
+ }
266
+ catch (error) {
267
+ return {
268
+ ok: false,
269
+ check: {
270
+ name: "config",
271
+ status: "fail",
272
+ detail: `config: ${errorMessage(error)}`,
273
+ },
274
+ };
275
+ }
276
+ finally {
277
+ process.chdir(previousCwd);
278
+ }
279
+ }
280
+ function checkCodexCli() {
281
+ try {
282
+ const result = spawnSync("codex", ["--version"], { encoding: "utf8", timeout: 10000 });
283
+ if (result.error || result.status !== 0)
284
+ return codexCliMissingCheck();
285
+ const version = result.stdout.trim() || result.stderr.trim() || "version reported";
286
+ return { name: "codex CLI", status: "pass", detail: version };
287
+ }
288
+ catch {
289
+ return codexCliMissingCheck();
290
+ }
291
+ }
292
+ function codexCliMissingCheck() {
293
+ return {
294
+ name: "codex CLI",
295
+ status: "fail",
296
+ detail: "codex CLI not found — install with: npm install -g @openai/codex",
297
+ };
298
+ }
299
+ function checkCodexPluginRoot(pluginRoot) {
300
+ if (!pluginRoot) {
301
+ return {
302
+ name: "codex plugin",
303
+ status: "fail",
304
+ detail: "codex plugin for Claude Code not found",
305
+ };
306
+ }
307
+ const version = pluginRoot.version ? `v${pluginRoot.version}` : "unknown version";
308
+ return {
309
+ name: "codex plugin",
310
+ status: "pass",
311
+ detail: `codex plugin ${version} at ${pluginRoot.root}`,
312
+ };
313
+ }
314
+ function queryCodexSetup(pluginRoot) {
315
+ try {
316
+ const script = join(pluginRoot, "scripts", "codex-companion.mjs");
317
+ const result = spawnSync("node", [script, "setup", "--json"], { encoding: "utf8", timeout: 30000 });
318
+ if (result.error || result.status !== 0)
319
+ return [codexSetupWarn(result.stderr || result.error?.message || "command failed")];
320
+ const parsed = JSON.parse(result.stdout);
321
+ return [authCheck(parsed), reviewGateCheck(parsed)];
322
+ }
323
+ catch (error) {
324
+ return [codexSetupWarn(errorMessage(error))];
325
+ }
326
+ }
327
+ function codexSetupWarn(reason) {
328
+ return {
329
+ name: "codex setup",
330
+ status: "warn",
331
+ detail: `could not query codex setup: ${reason}`,
332
+ };
333
+ }
334
+ function authCheck(payload) {
335
+ const authenticated = findBoolean(payload, ["authenticated", "codexAuthenticated", "loggedIn"]);
336
+ if (authenticated === undefined) {
337
+ return {
338
+ name: "codex auth",
339
+ status: "warn",
340
+ detail: "could not determine auth state",
341
+ };
342
+ }
343
+ return authenticated
344
+ ? { name: "codex auth", status: "pass", detail: "codex authenticated" }
345
+ : { name: "codex auth", status: "warn", detail: "codex is not authenticated" };
346
+ }
347
+ function reviewGateCheck(payload) {
348
+ const enabled = findBoolean(payload, ["reviewGateEnabled"]);
349
+ const state = enabled === undefined ? "unknown" : enabled ? "enabled" : "disabled";
350
+ return {
351
+ name: "codex plugin reviewGateEnabled",
352
+ status: "warn",
353
+ detail: `plugin global stop-gate is ${state}; composer drives review at its own trigger points, so it is not required`,
354
+ };
355
+ }
356
+ function findBoolean(value, keys) {
357
+ if (!isRecord(value))
358
+ return undefined;
359
+ for (const key of keys) {
360
+ if (typeof value[key] === "boolean")
361
+ return value[key];
362
+ }
363
+ for (const nested of Object.values(value)) {
364
+ const found = findBoolean(nested, keys);
365
+ if (found !== undefined)
366
+ return found;
367
+ }
368
+ return undefined;
369
+ }
370
+ function isRecord(value) {
371
+ return typeof value === "object" && value !== null && !Array.isArray(value);
372
+ }
373
+ function errorMessage(error) {
374
+ return error instanceof Error ? error.message : String(error);
375
+ }
376
+ function printReport(report) {
377
+ process.stdout.write("composer doctor\n");
378
+ for (const check of report.checks) {
379
+ process.stdout.write(`${check.status.toUpperCase()} ${check.name}: ${check.detail}\n`);
380
+ }
381
+ process.stdout.write(`summary: ${report.healthy ? "healthy" : "unhealthy"} (${report.checks.length} checks)\n`);
382
+ }
383
+ //# sourceMappingURL=doctor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/cli/doctor.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,yDAAyD;AAEzD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAsDjD,MAAM,oBAAo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