claudecode-omc 4.8.3 → 4.9.3
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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +3 -3
- package/README.de.md +26 -0
- package/README.es.md +26 -0
- package/README.fr.md +26 -0
- package/README.it.md +26 -0
- package/README.ja.md +26 -0
- package/README.ko.md +26 -0
- package/README.md +80 -133
- package/README.pt.md +26 -0
- package/README.ru.md +26 -0
- package/README.tr.md +26 -0
- package/README.vi.md +26 -0
- package/README.zh.md +26 -0
- package/agents/analyst.md +1 -0
- package/agents/architect.md +1 -0
- package/agents/code-reviewer.md +1 -0
- package/agents/code-simplifier.md +1 -0
- package/agents/critic.md +1 -0
- package/agents/debugger.md +1 -0
- package/agents/designer.md +1 -0
- package/agents/document-specialist.md +1 -0
- package/agents/executor.md +1 -0
- package/agents/explore.md +21 -19
- package/agents/git-master.md +1 -0
- package/agents/planner.md +1 -0
- package/agents/qa-tester.md +1 -0
- package/agents/scientist.md +1 -0
- package/agents/security-reviewer.md +1 -0
- package/agents/test-engineer.md +1 -0
- package/agents/tracer.md +161 -0
- package/agents/verifier.md +21 -13
- package/agents/writer.md +1 -0
- package/bridge/cli.cjs +37704 -25194
- package/bridge/gyoshu_bridge.py +60 -15
- package/bridge/mcp-server.cjs +1323 -503
- package/bridge/runtime-cli.cjs +1220 -328
- package/bridge/team-bridge.cjs +140 -112
- package/bridge/team-mcp.cjs +325 -107
- package/bridge/team.js +2572 -1462
- package/dist/__tests__/agent-registry.test.js +5 -3
- package/dist/__tests__/agent-registry.test.js.map +1 -1
- package/dist/__tests__/auto-slash-aliases.test.js +149 -68
- package/dist/__tests__/auto-slash-aliases.test.js.map +1 -1
- package/dist/__tests__/auto-update.test.js +502 -3
- package/dist/__tests__/auto-update.test.js.map +1 -1
- package/dist/__tests__/background-cleanup-directory.test.d.ts +2 -0
- package/dist/__tests__/background-cleanup-directory.test.d.ts.map +1 -0
- package/dist/__tests__/background-cleanup-directory.test.js +57 -0
- package/dist/__tests__/background-cleanup-directory.test.js.map +1 -0
- package/dist/__tests__/bedrock-lm-suffix-hook.test.d.ts +24 -0
- package/dist/__tests__/bedrock-lm-suffix-hook.test.d.ts.map +1 -0
- package/dist/__tests__/bedrock-lm-suffix-hook.test.js +210 -0
- package/dist/__tests__/bedrock-lm-suffix-hook.test.js.map +1 -0
- package/dist/__tests__/cleanup-validation.test.js +5 -3
- package/dist/__tests__/cleanup-validation.test.js.map +1 -1
- package/dist/__tests__/consolidation-contracts.test.js +1 -2
- package/dist/__tests__/consolidation-contracts.test.js.map +1 -1
- package/dist/__tests__/context-guard-stop.test.js +20 -0
- package/dist/__tests__/context-guard-stop.test.js.map +1 -1
- package/dist/__tests__/context-safety.test.js +51 -22
- package/dist/__tests__/context-safety.test.js.map +1 -1
- package/dist/__tests__/deep-interview-provider-options.test.d.ts +2 -0
- package/dist/__tests__/deep-interview-provider-options.test.d.ts.map +1 -0
- package/dist/__tests__/deep-interview-provider-options.test.js +79 -0
- package/dist/__tests__/deep-interview-provider-options.test.js.map +1 -0
- package/dist/__tests__/delegation-enforcement-levels.test.js +4 -0
- package/dist/__tests__/delegation-enforcement-levels.test.js.map +1 -1
- package/dist/__tests__/delegation-enforcer.test.js +12 -0
- package/dist/__tests__/delegation-enforcer.test.js.map +1 -1
- package/dist/__tests__/doctor-conflicts.test.js +111 -24
- package/dist/__tests__/doctor-conflicts.test.js.map +1 -1
- package/dist/__tests__/featured-contributors-generator.test.d.ts +2 -0
- package/dist/__tests__/featured-contributors-generator.test.d.ts.map +1 -0
- package/dist/__tests__/featured-contributors-generator.test.js +118 -0
- package/dist/__tests__/featured-contributors-generator.test.js.map +1 -0
- package/dist/__tests__/hooks/learner/bridge.test.js +27 -1
- package/dist/__tests__/hooks/learner/bridge.test.js.map +1 -1
- package/dist/__tests__/hooks/learner/transliteration-map.test.d.ts +8 -0
- package/dist/__tests__/hooks/learner/transliteration-map.test.d.ts.map +1 -0
- package/dist/__tests__/hooks/learner/transliteration-map.test.js +183 -0
- package/dist/__tests__/hooks/learner/transliteration-map.test.js.map +1 -0
- package/dist/__tests__/hooks-command-escaping.test.d.ts +2 -0
- package/dist/__tests__/hooks-command-escaping.test.d.ts.map +1 -0
- package/dist/__tests__/hooks-command-escaping.test.js +41 -0
- package/dist/__tests__/hooks-command-escaping.test.js.map +1 -0
- package/dist/__tests__/hooks.test.js +13 -9
- package/dist/__tests__/hooks.test.js.map +1 -1
- package/dist/__tests__/hud/background-tasks.test.d.ts +2 -0
- package/dist/__tests__/hud/background-tasks.test.d.ts.map +1 -0
- package/dist/__tests__/hud/background-tasks.test.js +90 -0
- package/dist/__tests__/hud/background-tasks.test.js.map +1 -0
- package/dist/__tests__/hud/context.test.d.ts +2 -0
- package/dist/__tests__/hud/context.test.d.ts.map +1 -0
- package/dist/__tests__/hud/context.test.js +47 -0
- package/dist/__tests__/hud/context.test.js.map +1 -0
- package/dist/__tests__/hud/defaults.test.js +11 -0
- package/dist/__tests__/hud/defaults.test.js.map +1 -1
- package/dist/__tests__/hud/git.test.js +2 -1
- package/dist/__tests__/hud/git.test.js.map +1 -1
- package/dist/__tests__/hud/mission-board-state.test.js +32 -0
- package/dist/__tests__/hud/mission-board-state.test.js.map +1 -1
- package/dist/__tests__/hud/mission-board.test.js +1 -0
- package/dist/__tests__/hud/mission-board.test.js.map +1 -1
- package/dist/__tests__/hud/omc-state.test.d.ts +2 -0
- package/dist/__tests__/hud/omc-state.test.d.ts.map +1 -0
- package/dist/__tests__/hud/omc-state.test.js +123 -0
- package/dist/__tests__/hud/omc-state.test.js.map +1 -0
- package/dist/__tests__/hud/render-rate-limits-priority.test.js +1 -0
- package/dist/__tests__/hud/render-rate-limits-priority.test.js.map +1 -1
- package/dist/__tests__/hud/render.test.js +125 -0
- package/dist/__tests__/hud/render.test.js.map +1 -1
- package/dist/__tests__/hud/state.test.js +104 -47
- package/dist/__tests__/hud/state.test.js.map +1 -1
- package/dist/__tests__/hud/stdin.test.d.ts +2 -0
- package/dist/__tests__/hud/stdin.test.d.ts.map +1 -0
- package/dist/__tests__/hud/stdin.test.js +108 -0
- package/dist/__tests__/hud/stdin.test.js.map +1 -0
- package/dist/__tests__/hud/token-usage.test.d.ts +2 -0
- package/dist/__tests__/hud/token-usage.test.d.ts.map +1 -0
- package/dist/__tests__/hud/token-usage.test.js +143 -0
- package/dist/__tests__/hud/token-usage.test.js.map +1 -0
- package/dist/__tests__/hud/usage-api-lock.test.js +6 -3
- package/dist/__tests__/hud/usage-api-lock.test.js.map +1 -1
- package/dist/__tests__/hud/usage-api-stale.test.js +4 -2
- package/dist/__tests__/hud/usage-api-stale.test.js.map +1 -1
- package/dist/__tests__/hud/usage-api.test.js +128 -1
- package/dist/__tests__/hud/usage-api.test.js.map +1 -1
- package/dist/__tests__/hud/version-display.test.js +1 -0
- package/dist/__tests__/hud/version-display.test.js.map +1 -1
- package/dist/__tests__/hud/watch-mode-init.test.js +25 -3
- package/dist/__tests__/hud/watch-mode-init.test.js.map +1 -1
- package/dist/__tests__/hud-marketplace-resolution.test.js +25 -0
- package/dist/__tests__/hud-marketplace-resolution.test.js.map +1 -1
- package/dist/__tests__/hud-windows.test.js +11 -0
- package/dist/__tests__/hud-windows.test.js.map +1 -1
- package/dist/__tests__/installer-mcp-config.test.d.ts +2 -0
- package/dist/__tests__/installer-mcp-config.test.d.ts.map +1 -0
- package/dist/__tests__/installer-mcp-config.test.js +119 -0
- package/dist/__tests__/installer-mcp-config.test.js.map +1 -0
- package/dist/__tests__/installer-omc-reference.test.d.ts +2 -0
- package/dist/__tests__/installer-omc-reference.test.d.ts.map +1 -0
- package/dist/__tests__/installer-omc-reference.test.js +85 -0
- package/dist/__tests__/installer-omc-reference.test.js.map +1 -0
- package/dist/__tests__/job-management-sqlite.test.js +1 -1
- package/dist/__tests__/job-state-db.test.js +1 -1
- package/dist/__tests__/jobid-collision-safety.test.d.ts +10 -0
- package/dist/__tests__/jobid-collision-safety.test.d.ts.map +1 -0
- package/dist/__tests__/jobid-collision-safety.test.js +51 -0
- package/dist/__tests__/jobid-collision-safety.test.js.map +1 -0
- package/dist/__tests__/live-data.test.js +21 -0
- package/dist/__tests__/live-data.test.js.map +1 -1
- package/dist/__tests__/load-agent-prompt.test.js +10 -0
- package/dist/__tests__/load-agent-prompt.test.js.map +1 -1
- package/dist/__tests__/lsp-servers.test.js +14 -2
- package/dist/__tests__/lsp-servers.test.js.map +1 -1
- package/dist/__tests__/marketplace-metadata.test.d.ts +2 -0
- package/dist/__tests__/marketplace-metadata.test.d.ts.map +1 -0
- package/dist/__tests__/marketplace-metadata.test.js +20 -0
- package/dist/__tests__/marketplace-metadata.test.js.map +1 -0
- package/dist/__tests__/mcp-comm-inbox-dedup.test.d.ts +2 -0
- package/dist/__tests__/mcp-comm-inbox-dedup.test.d.ts.map +1 -0
- package/dist/__tests__/mcp-comm-inbox-dedup.test.js +105 -0
- package/dist/__tests__/mcp-comm-inbox-dedup.test.js.map +1 -0
- package/dist/__tests__/mnemosyne/finder.test.js +10 -0
- package/dist/__tests__/mnemosyne/finder.test.js.map +1 -1
- package/dist/__tests__/mode-names-ralplan.test.d.ts +2 -0
- package/dist/__tests__/mode-names-ralplan.test.d.ts.map +1 -0
- package/dist/__tests__/mode-names-ralplan.test.js +31 -0
- package/dist/__tests__/mode-names-ralplan.test.js.map +1 -0
- package/dist/__tests__/model-routing-esm.test.d.ts +2 -0
- package/dist/__tests__/model-routing-esm.test.d.ts.map +1 -0
- package/dist/__tests__/model-routing-esm.test.js +26 -0
- package/dist/__tests__/model-routing-esm.test.js.map +1 -0
- package/dist/__tests__/notepad.test.js +20 -0
- package/dist/__tests__/notepad.test.js.map +1 -1
- package/dist/__tests__/omc-cli-rendering.test.d.ts +2 -0
- package/dist/__tests__/omc-cli-rendering.test.d.ts.map +1 -0
- package/dist/__tests__/omc-cli-rendering.test.js +33 -0
- package/dist/__tests__/omc-cli-rendering.test.js.map +1 -0
- package/dist/__tests__/omc-tools-server.test.js +5 -5
- package/dist/__tests__/outbox-reader-partial-lines.test.d.ts +2 -0
- package/dist/__tests__/outbox-reader-partial-lines.test.d.ts.map +1 -0
- package/dist/__tests__/outbox-reader-partial-lines.test.js +49 -0
- package/dist/__tests__/outbox-reader-partial-lines.test.js.map +1 -0
- package/dist/__tests__/package-dir-resolution-regression.test.js +30 -0
- package/dist/__tests__/package-dir-resolution-regression.test.js.map +1 -1
- package/dist/__tests__/pipeline-signal-regex-escape.test.d.ts +2 -0
- package/dist/__tests__/pipeline-signal-regex-escape.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline-signal-regex-escape.test.js +32 -0
- package/dist/__tests__/pipeline-signal-regex-escape.test.js.map +1 -0
- package/dist/__tests__/plugin-setup-devpaths.test.d.ts +2 -0
- package/dist/__tests__/plugin-setup-devpaths.test.d.ts.map +1 -0
- package/dist/__tests__/plugin-setup-devpaths.test.js +47 -0
- package/dist/__tests__/plugin-setup-devpaths.test.js.map +1 -0
- package/dist/__tests__/pre-compact-cwd.test.js +1 -1
- package/dist/__tests__/pre-tool-enforcer.test.js +101 -2
- package/dist/__tests__/pre-tool-enforcer.test.js.map +1 -1
- package/dist/__tests__/project-memory-merge.test.js +17 -0
- package/dist/__tests__/project-memory-merge.test.js.map +1 -1
- package/dist/__tests__/providers/bitbucket.test.js +70 -56
- package/dist/__tests__/providers/bitbucket.test.js.map +1 -1
- package/dist/__tests__/providers/gitea.test.js +36 -0
- package/dist/__tests__/providers/gitea.test.js.map +1 -1
- package/dist/__tests__/purge-stale-cache.test.js +17 -2
- package/dist/__tests__/purge-stale-cache.test.js.map +1 -1
- package/dist/__tests__/rate-limit-wait/daemon-bootstrap.test.js +7 -3
- package/dist/__tests__/rate-limit-wait/daemon-bootstrap.test.js.map +1 -1
- package/dist/__tests__/rate-limit-wait/integration.test.js +9 -5
- package/dist/__tests__/rate-limit-wait/integration.test.js.map +1 -1
- package/dist/__tests__/rate-limit-wait/tmux-detector.test.js +11 -11
- package/dist/__tests__/rate-limit-wait/tmux-detector.test.js.map +1 -1
- package/dist/__tests__/repo-slug-dots.test.d.ts +2 -0
- package/dist/__tests__/repo-slug-dots.test.d.ts.map +1 -0
- package/dist/__tests__/repo-slug-dots.test.js +24 -0
- package/dist/__tests__/repo-slug-dots.test.js.map +1 -0
- package/dist/__tests__/routing-force-inherit.test.js +31 -0
- package/dist/__tests__/routing-force-inherit.test.js.map +1 -1
- package/dist/__tests__/runtime-task-orphan.test.d.ts +2 -0
- package/dist/__tests__/runtime-task-orphan.test.d.ts.map +1 -0
- package/dist/__tests__/runtime-task-orphan.test.js +103 -0
- package/dist/__tests__/runtime-task-orphan.test.js.map +1 -0
- package/dist/__tests__/session-start-script-context.test.js +85 -0
- package/dist/__tests__/session-start-script-context.test.js.map +1 -1
- package/dist/__tests__/session-start-timeout-cleanup.test.d.ts +2 -0
- package/dist/__tests__/session-start-timeout-cleanup.test.d.ts.map +1 -0
- package/dist/__tests__/session-start-timeout-cleanup.test.js +26 -0
- package/dist/__tests__/session-start-timeout-cleanup.test.js.map +1 -0
- package/dist/__tests__/session-summary-pid-tracking.test.d.ts +2 -0
- package/dist/__tests__/session-summary-pid-tracking.test.d.ts.map +1 -0
- package/dist/__tests__/session-summary-pid-tracking.test.js +107 -0
- package/dist/__tests__/session-summary-pid-tracking.test.js.map +1 -0
- package/dist/__tests__/setup-claude-md-script.test.d.ts +2 -0
- package/dist/__tests__/setup-claude-md-script.test.d.ts.map +1 -0
- package/dist/__tests__/setup-claude-md-script.test.js +292 -0
- package/dist/__tests__/setup-claude-md-script.test.js.map +1 -0
- package/dist/__tests__/shared-state-locking.test.d.ts +10 -0
- package/dist/__tests__/shared-state-locking.test.d.ts.map +1 -0
- package/dist/__tests__/shared-state-locking.test.js +61 -0
- package/dist/__tests__/shared-state-locking.test.js.map +1 -0
- package/dist/__tests__/skills.test.js +135 -7
- package/dist/__tests__/skills.test.js.map +1 -1
- package/dist/__tests__/slack-fallback-removal.test.d.ts +2 -0
- package/dist/__tests__/slack-fallback-removal.test.d.ts.map +1 -0
- package/dist/__tests__/slack-fallback-removal.test.js +16 -0
- package/dist/__tests__/slack-fallback-removal.test.js.map +1 -0
- package/dist/__tests__/ssrf-guard.test.js +12 -0
- package/dist/__tests__/ssrf-guard.test.js.map +1 -1
- package/dist/__tests__/team-ops-task-locking.test.d.ts +2 -0
- package/dist/__tests__/team-ops-task-locking.test.d.ts.map +1 -0
- package/dist/__tests__/team-ops-task-locking.test.js +66 -0
- package/dist/__tests__/team-ops-task-locking.test.js.map +1 -0
- package/dist/__tests__/team-server-validation.test.js +6 -5
- package/dist/__tests__/team-server-validation.test.js.map +1 -1
- package/dist/__tests__/team-status-failed-count.test.d.ts +2 -0
- package/dist/__tests__/team-status-failed-count.test.d.ts.map +1 -0
- package/dist/__tests__/team-status-failed-count.test.js +91 -0
- package/dist/__tests__/team-status-failed-count.test.js.map +1 -0
- package/dist/__tests__/team-status-tmux-provider.test.d.ts +2 -0
- package/dist/__tests__/team-status-tmux-provider.test.d.ts.map +1 -0
- package/dist/__tests__/team-status-tmux-provider.test.js +39 -0
- package/dist/__tests__/team-status-tmux-provider.test.js.map +1 -0
- package/dist/__tests__/tier0-docs-consistency.test.js +42 -0
- package/dist/__tests__/tier0-docs-consistency.test.js.map +1 -1
- package/dist/__tests__/tools/ast-tools.test.d.ts +2 -0
- package/dist/__tests__/tools/ast-tools.test.d.ts.map +1 -0
- package/dist/__tests__/tools/ast-tools.test.js +74 -0
- package/dist/__tests__/tools/ast-tools.test.js.map +1 -0
- package/dist/__tests__/visual-verdict-skill.test.d.ts +2 -0
- package/dist/__tests__/visual-verdict-skill.test.d.ts.map +1 -0
- package/dist/__tests__/visual-verdict-skill.test.js +26 -0
- package/dist/__tests__/visual-verdict-skill.test.js.map +1 -0
- package/dist/__tests__/webhook-timeout-cleanup.test.d.ts +2 -0
- package/dist/__tests__/webhook-timeout-cleanup.test.d.ts.map +1 -0
- package/dist/__tests__/webhook-timeout-cleanup.test.js +18 -0
- package/dist/__tests__/webhook-timeout-cleanup.test.js.map +1 -0
- package/dist/__tests__/worktree-metadata-locking.test.d.ts +2 -0
- package/dist/__tests__/worktree-metadata-locking.test.d.ts.map +1 -0
- package/dist/__tests__/worktree-metadata-locking.test.js +51 -0
- package/dist/__tests__/worktree-metadata-locking.test.js.map +1 -0
- package/dist/agents/definitions.d.ts +2 -1
- package/dist/agents/definitions.d.ts.map +1 -1
- package/dist/agents/definitions.js +6 -1
- package/dist/agents/definitions.js.map +1 -1
- package/dist/agents/index.d.ts +1 -0
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +1 -0
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/tracer.d.ts +11 -0
- package/dist/agents/tracer.d.ts.map +1 -0
- package/dist/agents/tracer.js +40 -0
- package/dist/agents/tracer.js.map +1 -0
- package/dist/agents/utils.d.ts.map +1 -1
- package/dist/agents/utils.js +2 -0
- package/dist/agents/utils.js.map +1 -1
- package/dist/autoresearch/__tests__/contracts.test.d.ts +2 -0
- package/dist/autoresearch/__tests__/contracts.test.d.ts.map +1 -0
- package/dist/autoresearch/__tests__/contracts.test.js +90 -0
- package/dist/autoresearch/__tests__/contracts.test.js.map +1 -0
- package/dist/autoresearch/__tests__/runtime-parity-extra.test.d.ts +2 -0
- package/dist/autoresearch/__tests__/runtime-parity-extra.test.d.ts.map +1 -0
- package/dist/autoresearch/__tests__/runtime-parity-extra.test.js +352 -0
- package/dist/autoresearch/__tests__/runtime-parity-extra.test.js.map +1 -0
- package/dist/autoresearch/__tests__/runtime.test.d.ts +2 -0
- package/dist/autoresearch/__tests__/runtime.test.d.ts.map +1 -0
- package/dist/autoresearch/__tests__/runtime.test.js +210 -0
- package/dist/autoresearch/__tests__/runtime.test.js.map +1 -0
- package/dist/autoresearch/__tests__/setup-contract.test.d.ts +2 -0
- package/dist/autoresearch/__tests__/setup-contract.test.d.ts.map +1 -0
- package/dist/autoresearch/__tests__/setup-contract.test.js +57 -0
- package/dist/autoresearch/__tests__/setup-contract.test.js.map +1 -0
- package/dist/autoresearch/contracts.d.ts +31 -0
- package/dist/autoresearch/contracts.d.ts.map +1 -0
- package/dist/autoresearch/contracts.js +189 -0
- package/dist/autoresearch/contracts.js.map +1 -0
- package/dist/autoresearch/runtime.d.ts +137 -0
- package/dist/autoresearch/runtime.d.ts.map +1 -0
- package/dist/autoresearch/runtime.js +1103 -0
- package/dist/autoresearch/runtime.js.map +1 -0
- package/dist/autoresearch/setup-contract.d.ts +18 -0
- package/dist/autoresearch/setup-contract.d.ts.map +1 -0
- package/dist/autoresearch/setup-contract.js +96 -0
- package/dist/autoresearch/setup-contract.js.map +1 -0
- package/dist/cli/__tests__/ask.test.js +32 -130
- package/dist/cli/__tests__/ask.test.js.map +1 -1
- package/dist/cli/__tests__/autoresearch-guided.test.d.ts +2 -0
- package/dist/cli/__tests__/autoresearch-guided.test.d.ts.map +1 -0
- package/dist/cli/__tests__/autoresearch-guided.test.js +389 -0
- package/dist/cli/__tests__/autoresearch-guided.test.js.map +1 -0
- package/dist/cli/__tests__/autoresearch-intake.test.d.ts +2 -0
- package/dist/cli/__tests__/autoresearch-intake.test.d.ts.map +1 -0
- package/dist/cli/__tests__/autoresearch-intake.test.js +131 -0
- package/dist/cli/__tests__/autoresearch-intake.test.js.map +1 -0
- package/dist/cli/__tests__/autoresearch-setup-session.test.d.ts +2 -0
- package/dist/cli/__tests__/autoresearch-setup-session.test.d.ts.map +1 -0
- package/dist/cli/__tests__/autoresearch-setup-session.test.js +73 -0
- package/dist/cli/__tests__/autoresearch-setup-session.test.js.map +1 -0
- package/dist/cli/__tests__/autoresearch.test.d.ts +2 -0
- package/dist/cli/__tests__/autoresearch.test.d.ts.map +1 -0
- package/dist/cli/__tests__/autoresearch.test.js +148 -0
- package/dist/cli/__tests__/autoresearch.test.js.map +1 -0
- package/dist/cli/__tests__/hud-watch.test.d.ts +2 -0
- package/dist/cli/__tests__/hud-watch.test.d.ts.map +1 -0
- package/dist/cli/__tests__/hud-watch.test.js +56 -0
- package/dist/cli/__tests__/hud-watch.test.js.map +1 -0
- package/dist/cli/__tests__/launch.test.js +82 -5
- package/dist/cli/__tests__/launch.test.js.map +1 -1
- package/dist/cli/__tests__/team.test.js +44 -2
- package/dist/cli/__tests__/team.test.js.map +1 -1
- package/dist/cli/__tests__/tmux-utils.test.js +41 -1
- package/dist/cli/__tests__/tmux-utils.test.js.map +1 -1
- package/dist/cli/autoresearch-guided.d.ts +37 -0
- package/dist/cli/autoresearch-guided.d.ts.map +1 -0
- package/dist/cli/autoresearch-guided.js +312 -0
- package/dist/cli/autoresearch-guided.js.map +1 -0
- package/dist/cli/autoresearch-intake.d.ts +60 -0
- package/dist/cli/autoresearch-intake.d.ts.map +1 -0
- package/dist/cli/autoresearch-intake.js +325 -0
- package/dist/cli/autoresearch-intake.js.map +1 -0
- package/dist/cli/autoresearch-setup-session.d.ts +15 -0
- package/dist/cli/autoresearch-setup-session.d.ts.map +1 -0
- package/dist/cli/autoresearch-setup-session.js +133 -0
- package/dist/cli/autoresearch-setup-session.js.map +1 -0
- package/dist/cli/autoresearch.d.ts +19 -0
- package/dist/cli/autoresearch.d.ts.map +1 -0
- package/dist/cli/autoresearch.js +330 -0
- package/dist/cli/autoresearch.js.map +1 -0
- package/dist/cli/commands/__tests__/team.test.js +88 -1
- package/dist/cli/commands/__tests__/team.test.js.map +1 -1
- package/dist/cli/commands/doctor-conflicts.d.ts +2 -0
- package/dist/cli/commands/doctor-conflicts.d.ts.map +1 -1
- package/dist/cli/commands/doctor-conflicts.js +44 -1
- package/dist/cli/commands/doctor-conflicts.js.map +1 -1
- package/dist/cli/commands/ralphthon.d.ts +30 -0
- package/dist/cli/commands/ralphthon.d.ts.map +1 -0
- package/dist/cli/commands/ralphthon.js +361 -0
- package/dist/cli/commands/ralphthon.js.map +1 -0
- package/dist/cli/commands/team.d.ts +39 -0
- package/dist/cli/commands/team.d.ts.map +1 -1
- package/dist/cli/commands/team.js +178 -19
- package/dist/cli/commands/team.js.map +1 -1
- package/dist/cli/commands/teleport.js +5 -5
- package/dist/cli/commands/teleport.js.map +1 -1
- package/dist/cli/hud-watch.d.ts +15 -0
- package/dist/cli/hud-watch.d.ts.map +1 -0
- package/dist/cli/hud-watch.js +37 -0
- package/dist/cli/hud-watch.js.map +1 -0
- package/dist/cli/index.d.ts +0 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +39 -180
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/launch.d.ts +9 -1
- package/dist/cli/launch.d.ts.map +1 -1
- package/dist/cli/launch.js +25 -4
- package/dist/cli/launch.js.map +1 -1
- package/dist/cli/team.d.ts +1 -0
- package/dist/cli/team.d.ts.map +1 -1
- package/dist/cli/team.js +42 -54
- package/dist/cli/team.js.map +1 -1
- package/dist/cli/tmux-utils.d.ts +3 -2
- package/dist/cli/tmux-utils.d.ts.map +1 -1
- package/dist/cli/tmux-utils.js +16 -3
- package/dist/cli/tmux-utils.js.map +1 -1
- package/dist/config/__tests__/loader.test.js +121 -67
- package/dist/config/__tests__/loader.test.js.map +1 -1
- package/dist/config/__tests__/models.test.js +114 -1
- package/dist/config/__tests__/models.test.js.map +1 -1
- package/dist/config/__tests__/plan-output.test.d.ts +2 -0
- package/dist/config/__tests__/plan-output.test.d.ts.map +1 -0
- package/dist/config/__tests__/plan-output.test.js +41 -0
- package/dist/config/__tests__/plan-output.test.js.map +1 -0
- package/dist/config/index.d.ts +2 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +2 -1
- package/dist/config/index.js.map +1 -1
- package/dist/config/loader.d.ts +1 -1
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +280 -215
- package/dist/config/loader.js.map +1 -1
- package/dist/config/models.d.ts +33 -0
- package/dist/config/models.d.ts.map +1 -1
- package/dist/config/models.js +57 -0
- package/dist/config/models.js.map +1 -1
- package/dist/config/plan-output.d.ts +12 -0
- package/dist/config/plan-output.d.ts.map +1 -0
- package/dist/config/plan-output.js +67 -0
- package/dist/config/plan-output.js.map +1 -0
- package/dist/constants/names.d.ts +1 -5
- package/dist/constants/names.d.ts.map +1 -1
- package/dist/constants/names.js +1 -6
- package/dist/constants/names.js.map +1 -1
- package/dist/features/auto-update.d.ts +8 -0
- package/dist/features/auto-update.d.ts.map +1 -1
- package/dist/features/auto-update.js +218 -24
- package/dist/features/auto-update.js.map +1 -1
- package/dist/features/boulder-state/storage.d.ts.map +1 -1
- package/dist/features/boulder-state/storage.js +15 -10
- package/dist/features/boulder-state/storage.js.map +1 -1
- package/dist/features/builtin-skills/runtime-guidance.d.ts +9 -0
- package/dist/features/builtin-skills/runtime-guidance.d.ts.map +1 -0
- package/dist/features/builtin-skills/runtime-guidance.js +35 -0
- package/dist/features/builtin-skills/runtime-guidance.js.map +1 -0
- package/dist/features/builtin-skills/skills.d.ts.map +1 -1
- package/dist/features/builtin-skills/skills.js +32 -7
- package/dist/features/builtin-skills/skills.js.map +1 -1
- package/dist/features/continuation-enforcement.d.ts.map +1 -1
- package/dist/features/continuation-enforcement.js +3 -2
- package/dist/features/continuation-enforcement.js.map +1 -1
- package/dist/features/delegation-categories/__tests__/index.test.d.ts.map +1 -0
- package/dist/features/delegation-categories/__tests__/index.test.js +19 -0
- package/dist/features/delegation-categories/__tests__/index.test.js.map +1 -0
- package/dist/features/delegation-enforcer.d.ts.map +1 -1
- package/dist/features/delegation-enforcer.js +62 -3
- package/dist/features/delegation-enforcer.js.map +1 -1
- package/dist/features/magic-keywords.d.ts +1 -1
- package/dist/features/magic-keywords.d.ts.map +1 -1
- package/dist/features/magic-keywords.js +42 -12
- package/dist/features/magic-keywords.js.map +1 -1
- package/dist/features/model-routing/__tests__/index.test.d.ts +2 -0
- package/dist/features/model-routing/__tests__/index.test.d.ts.map +1 -0
- package/dist/features/model-routing/__tests__/index.test.js +21 -0
- package/dist/features/model-routing/__tests__/index.test.js.map +1 -0
- package/dist/features/model-routing/index.d.ts.map +1 -1
- package/dist/features/model-routing/index.js +3 -2
- package/dist/features/model-routing/index.js.map +1 -1
- package/dist/features/model-routing/signals.js +1 -1
- package/dist/features/model-routing/signals.js.map +1 -1
- package/dist/features/model-routing/types.d.ts +1 -1
- package/dist/features/rate-limit-wait/daemon.d.ts.map +1 -1
- package/dist/features/rate-limit-wait/daemon.js +11 -22
- package/dist/features/rate-limit-wait/daemon.js.map +1 -1
- package/dist/features/rate-limit-wait/tmux-detector.js +6 -6
- package/dist/features/rate-limit-wait/tmux-detector.js.map +1 -1
- package/dist/features/rate-limit-wait/types.d.ts +3 -3
- package/dist/features/rate-limit-wait/types.d.ts.map +1 -1
- package/dist/features/state-manager/index.d.ts +2 -2
- package/dist/features/state-manager/index.d.ts.map +1 -1
- package/dist/features/state-manager/index.js +12 -8
- package/dist/features/state-manager/index.js.map +1 -1
- package/dist/features/state-manager/types.d.ts +2 -2
- package/dist/features/state-manager/types.d.ts.map +1 -1
- package/dist/features/state-manager/types.js +2 -2
- package/dist/features/state-manager/types.js.map +1 -1
- package/dist/features/task-decomposer/index.js +3 -1
- package/dist/features/task-decomposer/index.js.map +1 -1
- package/dist/features/verification/index.d.ts.map +1 -1
- package/dist/features/verification/index.js +4 -2
- package/dist/features/verification/index.js.map +1 -1
- package/dist/hooks/__tests__/background-process-guard.test.js +151 -3
- package/dist/hooks/__tests__/background-process-guard.test.js.map +1 -1
- package/dist/hooks/__tests__/bridge-openclaw.test.js +15 -0
- package/dist/hooks/__tests__/bridge-openclaw.test.js.map +1 -1
- package/dist/hooks/__tests__/bridge-routing.test.js +130 -0
- package/dist/hooks/__tests__/bridge-routing.test.js.map +1 -1
- package/dist/hooks/__tests__/bridge-team-worker-guard.test.js +1 -1
- package/dist/hooks/__tests__/bridge-team-worker-guard.test.js.map +1 -1
- package/dist/hooks/__tests__/bridge.test.js +101 -0
- package/dist/hooks/__tests__/bridge.test.js.map +1 -1
- package/dist/hooks/__tests__/team-worker-heartbeat.test.d.ts +10 -0
- package/dist/hooks/__tests__/team-worker-heartbeat.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/team-worker-heartbeat.test.js +87 -0
- package/dist/hooks/__tests__/team-worker-heartbeat.test.js.map +1 -0
- package/dist/hooks/auto-slash-command/executor.d.ts.map +1 -1
- package/dist/hooks/auto-slash-command/executor.js +134 -70
- package/dist/hooks/auto-slash-command/executor.js.map +1 -1
- package/dist/hooks/auto-slash-command/live-data.d.ts.map +1 -1
- package/dist/hooks/auto-slash-command/live-data.js +12 -0
- package/dist/hooks/auto-slash-command/live-data.js.map +1 -1
- package/dist/hooks/autopilot/__tests__/prompts.test.js +61 -52
- package/dist/hooks/autopilot/__tests__/prompts.test.js.map +1 -1
- package/dist/hooks/autopilot/__tests__/state.test.js +34 -34
- package/dist/hooks/autopilot/adapters/execution-adapter.d.ts +1 -1
- package/dist/hooks/autopilot/adapters/execution-adapter.d.ts.map +1 -1
- package/dist/hooks/autopilot/adapters/execution-adapter.js +6 -5
- package/dist/hooks/autopilot/adapters/execution-adapter.js.map +1 -1
- package/dist/hooks/autopilot/adapters/ralplan-adapter.d.ts +1 -1
- package/dist/hooks/autopilot/adapters/ralplan-adapter.d.ts.map +1 -1
- package/dist/hooks/autopilot/adapters/ralplan-adapter.js +8 -7
- package/dist/hooks/autopilot/adapters/ralplan-adapter.js.map +1 -1
- package/dist/hooks/autopilot/enforcement.d.ts +2 -2
- package/dist/hooks/autopilot/enforcement.d.ts.map +1 -1
- package/dist/hooks/autopilot/enforcement.js +98 -70
- package/dist/hooks/autopilot/enforcement.js.map +1 -1
- package/dist/hooks/autopilot/pipeline-types.d.ts +8 -6
- package/dist/hooks/autopilot/pipeline-types.d.ts.map +1 -1
- package/dist/hooks/autopilot/pipeline-types.js +9 -9
- package/dist/hooks/autopilot/pipeline-types.js.map +1 -1
- package/dist/hooks/autopilot/pipeline.d.ts +3 -3
- package/dist/hooks/autopilot/pipeline.d.ts.map +1 -1
- package/dist/hooks/autopilot/pipeline.js +51 -36
- package/dist/hooks/autopilot/pipeline.js.map +1 -1
- package/dist/hooks/autopilot/prompts.d.ts +4 -2
- package/dist/hooks/autopilot/prompts.d.ts.map +1 -1
- package/dist/hooks/autopilot/prompts.js +31 -24
- package/dist/hooks/autopilot/prompts.js.map +1 -1
- package/dist/hooks/autopilot/state.d.ts.map +1 -1
- package/dist/hooks/autopilot/state.js +21 -14
- package/dist/hooks/autopilot/state.js.map +1 -1
- package/dist/hooks/bridge.d.ts.map +1 -1
- package/dist/hooks/bridge.js +329 -71
- package/dist/hooks/bridge.js.map +1 -1
- package/dist/hooks/code-simplifier/index.d.ts +3 -2
- package/dist/hooks/code-simplifier/index.d.ts.map +1 -1
- package/dist/hooks/code-simplifier/index.js +15 -12
- package/dist/hooks/code-simplifier/index.js.map +1 -1
- package/dist/hooks/comment-checker/index.d.ts.map +1 -1
- package/dist/hooks/comment-checker/index.js +0 -17
- package/dist/hooks/comment-checker/index.js.map +1 -1
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +0 -8
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/keyword-detector/__tests__/index.test.js +304 -0
- package/dist/hooks/keyword-detector/__tests__/index.test.js.map +1 -1
- package/dist/hooks/keyword-detector/index.d.ts.map +1 -1
- package/dist/hooks/keyword-detector/index.js +46 -16
- package/dist/hooks/keyword-detector/index.js.map +1 -1
- package/dist/hooks/learner/bridge.d.ts +1 -0
- package/dist/hooks/learner/bridge.d.ts.map +1 -1
- package/dist/hooks/learner/bridge.js +30 -19
- package/dist/hooks/learner/bridge.js.map +1 -1
- package/dist/hooks/learner/constants.d.ts +2 -0
- package/dist/hooks/learner/constants.d.ts.map +1 -1
- package/dist/hooks/learner/constants.js +2 -0
- package/dist/hooks/learner/constants.js.map +1 -1
- package/dist/hooks/learner/finder.d.ts.map +1 -1
- package/dist/hooks/learner/finder.js +25 -20
- package/dist/hooks/learner/finder.js.map +1 -1
- package/dist/hooks/learner/transliteration-map.d.ts +30 -0
- package/dist/hooks/learner/transliteration-map.d.ts.map +1 -0
- package/dist/hooks/learner/transliteration-map.js +51 -0
- package/dist/hooks/learner/transliteration-map.js.map +1 -0
- package/dist/hooks/non-interactive-env/index.d.ts.map +1 -1
- package/dist/hooks/non-interactive-env/index.js +5 -5
- package/dist/hooks/non-interactive-env/index.js.map +1 -1
- package/dist/hooks/non-interactive-env/index.test.d.ts +2 -0
- package/dist/hooks/non-interactive-env/index.test.d.ts.map +1 -0
- package/dist/hooks/non-interactive-env/index.test.js +30 -0
- package/dist/hooks/non-interactive-env/index.test.js.map +1 -0
- package/dist/hooks/notepad/index.d.ts.map +1 -1
- package/dist/hooks/notepad/index.js +20 -6
- package/dist/hooks/notepad/index.js.map +1 -1
- package/dist/hooks/omc-orchestrator/index.d.ts.map +1 -1
- package/dist/hooks/omc-orchestrator/index.js +6 -2
- package/dist/hooks/omc-orchestrator/index.js.map +1 -1
- package/dist/hooks/permission-handler/__tests__/index.test.js +9 -1
- package/dist/hooks/permission-handler/__tests__/index.test.js.map +1 -1
- package/dist/hooks/permission-handler/index.d.ts +2 -0
- package/dist/hooks/permission-handler/index.d.ts.map +1 -1
- package/dist/hooks/permission-handler/index.js +67 -7
- package/dist/hooks/permission-handler/index.js.map +1 -1
- package/dist/hooks/persistent-mode/__tests__/idle-cooldown.test.js +79 -15
- package/dist/hooks/persistent-mode/__tests__/idle-cooldown.test.js.map +1 -1
- package/dist/hooks/persistent-mode/__tests__/ralph-verification-flow.test.js +1 -1
- package/dist/hooks/persistent-mode/__tests__/ralph-verification-flow.test.js.map +1 -1
- package/dist/hooks/persistent-mode/__tests__/skill-state-stop.test.js +36 -1
- package/dist/hooks/persistent-mode/__tests__/skill-state-stop.test.js.map +1 -1
- package/dist/hooks/persistent-mode/__tests__/team-ralplan-stop.test.js +113 -2
- package/dist/hooks/persistent-mode/__tests__/team-ralplan-stop.test.js.map +1 -1
- package/dist/hooks/persistent-mode/index.d.ts +1 -1
- package/dist/hooks/persistent-mode/index.d.ts.map +1 -1
- package/dist/hooks/persistent-mode/index.js +50 -14
- package/dist/hooks/persistent-mode/index.js.map +1 -1
- package/dist/hooks/persistent-mode/session-isolation.test.js +20 -14
- package/dist/hooks/persistent-mode/session-isolation.test.js.map +1 -1
- package/dist/hooks/persistent-mode/stop-hook-blocking.test.js +173 -5
- package/dist/hooks/persistent-mode/stop-hook-blocking.test.js.map +1 -1
- package/dist/hooks/project-memory/__tests__/formatter.test.js +244 -191
- package/dist/hooks/project-memory/__tests__/formatter.test.js.map +1 -1
- package/dist/hooks/project-memory/__tests__/integration.test.js +185 -101
- package/dist/hooks/project-memory/__tests__/integration.test.js.map +1 -1
- package/dist/hooks/project-memory/__tests__/pre-compact.test.d.ts +5 -0
- package/dist/hooks/project-memory/__tests__/pre-compact.test.d.ts.map +1 -0
- package/dist/hooks/project-memory/__tests__/pre-compact.test.js +121 -0
- package/dist/hooks/project-memory/__tests__/pre-compact.test.js.map +1 -0
- package/dist/hooks/project-memory/formatter.d.ts +2 -2
- package/dist/hooks/project-memory/formatter.d.ts.map +1 -1
- package/dist/hooks/project-memory/formatter.js +167 -92
- package/dist/hooks/project-memory/formatter.js.map +1 -1
- package/dist/hooks/project-memory/hot-path-tracker.d.ts +3 -3
- package/dist/hooks/project-memory/hot-path-tracker.d.ts.map +1 -1
- package/dist/hooks/project-memory/hot-path-tracker.js +71 -27
- package/dist/hooks/project-memory/hot-path-tracker.js.map +1 -1
- package/dist/hooks/project-memory/index.d.ts +0 -20
- package/dist/hooks/project-memory/index.d.ts.map +1 -1
- package/dist/hooks/project-memory/index.js +37 -39
- package/dist/hooks/project-memory/index.js.map +1 -1
- package/dist/hooks/project-memory/pre-compact.d.ts.map +1 -1
- package/dist/hooks/project-memory/pre-compact.js +2 -1
- package/dist/hooks/project-memory/pre-compact.js.map +1 -1
- package/dist/hooks/project-memory/types.d.ts +11 -6
- package/dist/hooks/project-memory/types.d.ts.map +1 -1
- package/dist/hooks/ralph/verifier.d.ts.map +1 -1
- package/dist/hooks/ralph/verifier.js +2 -1
- package/dist/hooks/ralph/verifier.js.map +1 -1
- package/dist/hooks/recovery/session-recovery.d.ts.map +1 -1
- package/dist/hooks/recovery/session-recovery.js +7 -4
- package/dist/hooks/recovery/session-recovery.js.map +1 -1
- package/dist/hooks/session-end/__tests__/mode-state-cleanup.test.js +28 -0
- package/dist/hooks/session-end/__tests__/mode-state-cleanup.test.js.map +1 -1
- package/dist/hooks/session-end/__tests__/session-end-timeout.test.d.ts +2 -0
- package/dist/hooks/session-end/__tests__/session-end-timeout.test.d.ts.map +1 -0
- package/dist/hooks/session-end/__tests__/session-end-timeout.test.js +91 -0
- package/dist/hooks/session-end/__tests__/session-end-timeout.test.js.map +1 -0
- package/dist/hooks/session-end/__tests__/team-cleanup.test.d.ts +2 -0
- package/dist/hooks/session-end/__tests__/team-cleanup.test.d.ts.map +1 -0
- package/dist/hooks/session-end/__tests__/team-cleanup.test.js +150 -0
- package/dist/hooks/session-end/__tests__/team-cleanup.test.js.map +1 -0
- package/dist/hooks/session-end/index.d.ts +9 -0
- package/dist/hooks/session-end/index.d.ts.map +1 -1
- package/dist/hooks/session-end/index.js +178 -30
- package/dist/hooks/session-end/index.js.map +1 -1
- package/dist/hooks/setup/__tests__/windows-patch.test.js +8 -7
- package/dist/hooks/setup/__tests__/windows-patch.test.js.map +1 -1
- package/dist/hooks/setup/index.d.ts +1 -1
- package/dist/hooks/setup/index.js +3 -3
- package/dist/hooks/setup/index.js.map +1 -1
- package/dist/hooks/skill-bridge.cjs +48 -16
- package/dist/hooks/skill-state/__tests__/skill-state.test.js +74 -8
- package/dist/hooks/skill-state/__tests__/skill-state.test.js.map +1 -1
- package/dist/hooks/skill-state/index.d.ts +18 -4
- package/dist/hooks/skill-state/index.d.ts.map +1 -1
- package/dist/hooks/skill-state/index.js +43 -7
- package/dist/hooks/skill-state/index.js.map +1 -1
- package/dist/hooks/subagent-tracker/__tests__/index.test.js +42 -1
- package/dist/hooks/subagent-tracker/__tests__/index.test.js.map +1 -1
- package/dist/hooks/subagent-tracker/index.d.ts +5 -0
- package/dist/hooks/subagent-tracker/index.d.ts.map +1 -1
- package/dist/hooks/subagent-tracker/index.js +62 -49
- package/dist/hooks/subagent-tracker/index.js.map +1 -1
- package/dist/hooks/team-dispatch-hook.d.ts.map +1 -1
- package/dist/hooks/team-dispatch-hook.js +4 -2
- package/dist/hooks/team-dispatch-hook.js.map +1 -1
- package/dist/hooks/team-leader-nudge-hook.d.ts +6 -0
- package/dist/hooks/team-leader-nudge-hook.d.ts.map +1 -1
- package/dist/hooks/team-leader-nudge-hook.js +113 -15
- package/dist/hooks/team-leader-nudge-hook.js.map +1 -1
- package/dist/hooks/team-worker-hook.d.ts.map +1 -1
- package/dist/hooks/team-worker-hook.js +6 -3
- package/dist/hooks/team-worker-hook.js.map +1 -1
- package/dist/hud/background-cleanup.d.ts +3 -3
- package/dist/hud/background-cleanup.d.ts.map +1 -1
- package/dist/hud/background-cleanup.js +9 -9
- package/dist/hud/background-cleanup.js.map +1 -1
- package/dist/hud/background-tasks.d.ts +7 -0
- package/dist/hud/background-tasks.d.ts.map +1 -1
- package/dist/hud/background-tasks.js +83 -0
- package/dist/hud/background-tasks.js.map +1 -1
- package/dist/hud/elements/context.d.ts +12 -2
- package/dist/hud/elements/context.d.ts.map +1 -1
- package/dist/hud/elements/context.js +86 -35
- package/dist/hud/elements/context.js.map +1 -1
- package/dist/hud/elements/git.d.ts +4 -0
- package/dist/hud/elements/git.d.ts.map +1 -1
- package/dist/hud/elements/git.js +39 -9
- package/dist/hud/elements/git.js.map +1 -1
- package/dist/hud/elements/index.d.ts +1 -0
- package/dist/hud/elements/index.d.ts.map +1 -1
- package/dist/hud/elements/index.js +1 -0
- package/dist/hud/elements/index.js.map +1 -1
- package/dist/hud/elements/session-summary.d.ts +23 -0
- package/dist/hud/elements/session-summary.d.ts.map +1 -0
- package/dist/hud/elements/session-summary.js +23 -0
- package/dist/hud/elements/session-summary.js.map +1 -0
- package/dist/hud/elements/token-usage.d.ts +8 -0
- package/dist/hud/elements/token-usage.d.ts.map +1 -0
- package/dist/hud/elements/token-usage.js +24 -0
- package/dist/hud/elements/token-usage.js.map +1 -0
- package/dist/hud/index.d.ts +4 -0
- package/dist/hud/index.d.ts.map +1 -1
- package/dist/hud/index.js +165 -32
- package/dist/hud/index.js.map +1 -1
- package/dist/hud/mission-board.d.ts.map +1 -1
- package/dist/hud/mission-board.js +8 -2
- package/dist/hud/mission-board.js.map +1 -1
- package/dist/hud/omc-state.d.ts +5 -5
- package/dist/hud/omc-state.d.ts.map +1 -1
- package/dist/hud/omc-state.js +20 -16
- package/dist/hud/omc-state.js.map +1 -1
- package/dist/hud/render.d.ts +1 -1
- package/dist/hud/render.d.ts.map +1 -1
- package/dist/hud/render.js +69 -54
- package/dist/hud/render.js.map +1 -1
- package/dist/hud/state.d.ts +3 -3
- package/dist/hud/state.d.ts.map +1 -1
- package/dist/hud/state.js +110 -57
- package/dist/hud/state.js.map +1 -1
- package/dist/hud/stdin.d.ts +8 -1
- package/dist/hud/stdin.d.ts.map +1 -1
- package/dist/hud/stdin.js +60 -13
- package/dist/hud/stdin.js.map +1 -1
- package/dist/hud/transcript.d.ts.map +1 -1
- package/dist/hud/transcript.js +148 -35
- package/dist/hud/transcript.js.map +1 -1
- package/dist/hud/types.d.ts +30 -13
- package/dist/hud/types.d.ts.map +1 -1
- package/dist/hud/types.js +24 -0
- package/dist/hud/types.js.map +1 -1
- package/dist/hud/usage-api.d.ts.map +1 -1
- package/dist/hud/usage-api.js +53 -24
- package/dist/hud/usage-api.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/installer/__tests__/claude-md-merge.test.js +23 -0
- package/dist/installer/__tests__/claude-md-merge.test.js.map +1 -1
- package/dist/installer/__tests__/hook-templates.test.js +50 -5
- package/dist/installer/__tests__/hook-templates.test.js.map +1 -1
- package/dist/installer/__tests__/mcp-registry.test.d.ts +2 -0
- package/dist/installer/__tests__/mcp-registry.test.d.ts.map +1 -0
- package/dist/installer/__tests__/mcp-registry.test.js +316 -0
- package/dist/installer/__tests__/mcp-registry.test.js.map +1 -0
- package/dist/installer/__tests__/session-start-template.test.d.ts +2 -0
- package/dist/installer/__tests__/session-start-template.test.d.ts.map +1 -0
- package/dist/installer/__tests__/session-start-template.test.js +95 -0
- package/dist/installer/__tests__/session-start-template.test.js.map +1 -0
- package/dist/installer/hooks.d.ts +0 -14
- package/dist/installer/hooks.d.ts.map +1 -1
- package/dist/installer/hooks.js +0 -33
- package/dist/installer/hooks.js.map +1 -1
- package/dist/installer/index.d.ts +2 -0
- package/dist/installer/index.d.ts.map +1 -1
- package/dist/installer/index.js +71 -7
- package/dist/installer/index.js.map +1 -1
- package/dist/installer/mcp-registry.d.ts +48 -0
- package/dist/installer/mcp-registry.d.ts.map +1 -0
- package/dist/installer/mcp-registry.js +453 -0
- package/dist/installer/mcp-registry.js.map +1 -0
- package/dist/interop/omx-team-state.d.ts +2 -0
- package/dist/interop/omx-team-state.d.ts.map +1 -1
- package/dist/interop/omx-team-state.js.map +1 -1
- package/dist/interop/shared-state.d.ts.map +1 -1
- package/dist/interop/shared-state.js +21 -18
- package/dist/interop/shared-state.js.map +1 -1
- package/dist/lib/__tests__/mode-state-io.test.js +58 -8
- package/dist/lib/__tests__/mode-state-io.test.js.map +1 -1
- package/dist/lib/__tests__/swallowed-error.test.d.ts +2 -0
- package/dist/lib/__tests__/swallowed-error.test.d.ts.map +1 -0
- package/dist/lib/__tests__/swallowed-error.test.js +19 -0
- package/dist/lib/__tests__/swallowed-error.test.js.map +1 -0
- package/dist/lib/featured-contributors.d.ts +54 -0
- package/dist/lib/featured-contributors.d.ts.map +1 -0
- package/dist/lib/featured-contributors.js +290 -0
- package/dist/lib/featured-contributors.js.map +1 -0
- package/dist/lib/file-lock.d.ts.map +1 -1
- package/dist/lib/file-lock.js +49 -51
- package/dist/lib/file-lock.js.map +1 -1
- package/dist/lib/mode-names.d.ts +1 -0
- package/dist/lib/mode-names.d.ts.map +1 -1
- package/dist/lib/mode-names.js +5 -0
- package/dist/lib/mode-names.js.map +1 -1
- package/dist/lib/mode-state-io.d.ts +2 -0
- package/dist/lib/mode-state-io.d.ts.map +1 -1
- package/dist/lib/mode-state-io.js +57 -11
- package/dist/lib/mode-state-io.js.map +1 -1
- package/dist/lib/project-memory-merge.d.ts.map +1 -1
- package/dist/lib/project-memory-merge.js +2 -0
- package/dist/lib/project-memory-merge.js.map +1 -1
- package/dist/lib/shared-memory.d.ts.map +1 -1
- package/dist/lib/shared-memory.js +40 -21
- package/dist/lib/shared-memory.js.map +1 -1
- package/dist/lib/swallowed-error.d.ts +4 -0
- package/dist/lib/swallowed-error.d.ts.map +1 -0
- package/dist/lib/swallowed-error.js +26 -0
- package/dist/lib/swallowed-error.js.map +1 -0
- package/dist/lib/worktree-paths.d.ts +1 -0
- package/dist/lib/worktree-paths.d.ts.map +1 -1
- package/dist/lib/worktree-paths.js +1 -0
- package/dist/lib/worktree-paths.js.map +1 -1
- package/dist/mcp/__tests__/prompt-injection.test.js +15 -0
- package/dist/mcp/__tests__/prompt-injection.test.js.map +1 -1
- package/dist/mcp/__tests__/standalone-shutdown.test.d.ts +2 -0
- package/dist/mcp/__tests__/standalone-shutdown.test.d.ts.map +1 -0
- package/dist/mcp/__tests__/standalone-shutdown.test.js +57 -0
- package/dist/mcp/__tests__/standalone-shutdown.test.js.map +1 -0
- package/dist/mcp/__tests__/team-cleanup.test.js +5 -5
- package/dist/mcp/job-management.d.ts +4 -0
- package/dist/mcp/job-management.d.ts.map +1 -1
- package/dist/mcp/job-management.js +30 -10
- package/dist/mcp/job-management.js.map +1 -1
- package/dist/mcp/omc-tools-server.d.ts +2 -0
- package/dist/mcp/omc-tools-server.d.ts.map +1 -1
- package/dist/mcp/omc-tools-server.js +10 -2
- package/dist/mcp/omc-tools-server.js.map +1 -1
- package/dist/mcp/prompt-injection.d.ts.map +1 -1
- package/dist/mcp/prompt-injection.js +25 -4
- package/dist/mcp/prompt-injection.js.map +1 -1
- package/dist/mcp/prompt-persistence.js +1 -1
- package/dist/mcp/prompt-persistence.js.map +1 -1
- package/dist/mcp/standalone-server.js +15 -4
- package/dist/mcp/standalone-server.js.map +1 -1
- package/dist/mcp/standalone-shutdown.d.ts +25 -0
- package/dist/mcp/standalone-shutdown.d.ts.map +1 -0
- package/dist/mcp/standalone-shutdown.js +68 -0
- package/dist/mcp/standalone-shutdown.js.map +1 -0
- package/dist/mcp/team-job-convergence.d.ts +0 -1
- package/dist/mcp/team-job-convergence.d.ts.map +1 -1
- package/dist/mcp/team-job-convergence.js +0 -9
- package/dist/mcp/team-job-convergence.js.map +1 -1
- package/dist/mcp/team-server.d.ts.map +1 -1
- package/dist/mcp/team-server.js +18 -11
- package/dist/mcp/team-server.js.map +1 -1
- package/dist/notifications/__tests__/reply-listener.test.js +57 -1
- package/dist/notifications/__tests__/reply-listener.test.js.map +1 -1
- package/dist/notifications/config.d.ts.map +1 -1
- package/dist/notifications/config.js +36 -3
- package/dist/notifications/config.js.map +1 -1
- package/dist/notifications/dispatcher.d.ts.map +1 -1
- package/dist/notifications/dispatcher.js +18 -14
- package/dist/notifications/dispatcher.js.map +1 -1
- package/dist/notifications/redact.d.ts.map +1 -1
- package/dist/notifications/redact.js +10 -1
- package/dist/notifications/redact.js.map +1 -1
- package/dist/notifications/reply-listener.d.ts +2 -0
- package/dist/notifications/reply-listener.d.ts.map +1 -1
- package/dist/notifications/reply-listener.js +17 -24
- package/dist/notifications/reply-listener.js.map +1 -1
- package/dist/notifications/session-registry.d.ts +1 -1
- package/dist/notifications/session-registry.d.ts.map +1 -1
- package/dist/notifications/session-registry.js +37 -43
- package/dist/notifications/session-registry.js.map +1 -1
- package/dist/notifications/types.d.ts +2 -0
- package/dist/notifications/types.d.ts.map +1 -1
- package/dist/planning/__tests__/artifacts.test.d.ts +2 -0
- package/dist/planning/__tests__/artifacts.test.d.ts.map +1 -0
- package/dist/planning/__tests__/artifacts.test.js +303 -0
- package/dist/planning/__tests__/artifacts.test.js.map +1 -0
- package/dist/planning/artifacts.d.ts +29 -0
- package/dist/planning/artifacts.d.ts.map +1 -0
- package/dist/planning/artifacts.js +144 -0
- package/dist/planning/artifacts.js.map +1 -0
- package/dist/platform/process-utils.d.ts +1 -0
- package/dist/platform/process-utils.d.ts.map +1 -1
- package/dist/platform/process-utils.js +7 -3
- package/dist/platform/process-utils.js.map +1 -1
- package/dist/providers/bitbucket.d.ts +2 -2
- package/dist/providers/bitbucket.d.ts.map +1 -1
- package/dist/providers/bitbucket.js +11 -12
- package/dist/providers/bitbucket.js.map +1 -1
- package/dist/providers/gitea.d.ts.map +1 -1
- package/dist/providers/gitea.js +8 -2
- package/dist/providers/gitea.js.map +1 -1
- package/dist/providers/index.d.ts +4 -0
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +49 -26
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/types.d.ts +2 -2
- package/dist/providers/types.d.ts.map +1 -1
- package/dist/ralphthon/__tests__/cli.test.d.ts +5 -0
- package/dist/ralphthon/__tests__/cli.test.d.ts.map +1 -0
- package/dist/ralphthon/__tests__/cli.test.js +103 -0
- package/dist/ralphthon/__tests__/cli.test.js.map +1 -0
- package/dist/ralphthon/__tests__/orchestrator.test.d.ts +5 -0
- package/dist/ralphthon/__tests__/orchestrator.test.d.ts.map +1 -0
- package/dist/ralphthon/__tests__/orchestrator.test.js +393 -0
- package/dist/ralphthon/__tests__/orchestrator.test.js.map +1 -0
- package/dist/ralphthon/__tests__/prd.test.d.ts +5 -0
- package/dist/ralphthon/__tests__/prd.test.d.ts.map +1 -0
- package/dist/ralphthon/__tests__/prd.test.js +454 -0
- package/dist/ralphthon/__tests__/prd.test.js.map +1 -0
- package/dist/ralphthon/deep-interview-prompt.d.ts +2 -0
- package/dist/ralphthon/deep-interview-prompt.d.ts.map +1 -0
- package/dist/ralphthon/deep-interview-prompt.js +20 -0
- package/dist/ralphthon/deep-interview-prompt.js.map +1 -0
- package/dist/ralphthon/index.d.ts +13 -0
- package/dist/ralphthon/index.d.ts.map +1 -0
- package/dist/ralphthon/index.js +14 -0
- package/dist/ralphthon/index.js.map +1 -0
- package/dist/ralphthon/orchestrator.d.ts +112 -0
- package/dist/ralphthon/orchestrator.d.ts.map +1 -0
- package/dist/ralphthon/orchestrator.js +453 -0
- package/dist/ralphthon/orchestrator.js.map +1 -0
- package/dist/ralphthon/prd.d.ts +111 -0
- package/dist/ralphthon/prd.d.ts.map +1 -0
- package/dist/ralphthon/prd.js +345 -0
- package/dist/ralphthon/prd.js.map +1 -0
- package/dist/ralphthon/types.d.ts +213 -0
- package/dist/ralphthon/types.d.ts.map +1 -0
- package/dist/ralphthon/types.js +21 -0
- package/dist/ralphthon/types.js.map +1 -0
- package/dist/shared/types.d.ts +25 -16
- package/dist/shared/types.d.ts.map +1 -1
- package/dist/skills/__tests__/mingw-escape.test.js +15 -0
- package/dist/skills/__tests__/mingw-escape.test.js.map +1 -1
- package/dist/team/__tests__/allocation-policy.test.d.ts +2 -0
- package/dist/team/__tests__/allocation-policy.test.d.ts.map +1 -0
- package/dist/team/__tests__/allocation-policy.test.js +125 -0
- package/dist/team/__tests__/allocation-policy.test.js.map +1 -0
- package/dist/team/__tests__/api-interop.cleanup.test.d.ts +2 -0
- package/dist/team/__tests__/api-interop.cleanup.test.d.ts.map +1 -0
- package/dist/team/__tests__/api-interop.cleanup.test.js +129 -0
- package/dist/team/__tests__/api-interop.cleanup.test.js.map +1 -0
- package/dist/team/__tests__/api-interop.cwd-resolution.test.js +22 -0
- package/dist/team/__tests__/api-interop.cwd-resolution.test.js.map +1 -1
- package/dist/team/__tests__/api-interop.dispatch.test.js +59 -0
- package/dist/team/__tests__/api-interop.dispatch.test.js.map +1 -1
- package/dist/team/__tests__/audit-log.test.js +0 -1
- package/dist/team/__tests__/audit-log.test.js.map +1 -1
- package/dist/team/__tests__/bridge-integration.test.js.map +1 -1
- package/dist/team/__tests__/events.swallowed-error.test.d.ts +2 -0
- package/dist/team/__tests__/events.swallowed-error.test.d.ts.map +1 -0
- package/dist/team/__tests__/events.swallowed-error.test.js +33 -0
- package/dist/team/__tests__/events.swallowed-error.test.js.map +1 -0
- package/dist/team/__tests__/followup-planner.test.d.ts +2 -0
- package/dist/team/__tests__/followup-planner.test.d.ts.map +1 -0
- package/dist/team/__tests__/followup-planner.test.js +197 -0
- package/dist/team/__tests__/followup-planner.test.js.map +1 -0
- package/dist/team/__tests__/governance-enforcement.test.d.ts +2 -0
- package/dist/team/__tests__/governance-enforcement.test.d.ts.map +1 -0
- package/dist/team/__tests__/governance-enforcement.test.js +138 -0
- package/dist/team/__tests__/governance-enforcement.test.js.map +1 -0
- package/dist/team/__tests__/governance.test.d.ts +2 -0
- package/dist/team/__tests__/governance.test.d.ts.map +1 -0
- package/dist/team/__tests__/governance.test.js +38 -0
- package/dist/team/__tests__/governance.test.js.map +1 -0
- package/dist/team/__tests__/idle-nudge.test.js +9 -0
- package/dist/team/__tests__/idle-nudge.test.js.map +1 -1
- package/dist/team/__tests__/leader-nudge-guidance.test.d.ts +2 -0
- package/dist/team/__tests__/leader-nudge-guidance.test.d.ts.map +1 -0
- package/dist/team/__tests__/leader-nudge-guidance.test.js +37 -0
- package/dist/team/__tests__/leader-nudge-guidance.test.js.map +1 -0
- package/dist/team/__tests__/lifecycle-profile.test.d.ts +2 -0
- package/dist/team/__tests__/lifecycle-profile.test.d.ts.map +1 -0
- package/dist/team/__tests__/lifecycle-profile.test.js +46 -0
- package/dist/team/__tests__/lifecycle-profile.test.js.map +1 -0
- package/dist/team/__tests__/model-contract.test.js +84 -3
- package/dist/team/__tests__/model-contract.test.js.map +1 -1
- package/dist/team/__tests__/phase1-foundation.test.d.ts +2 -0
- package/dist/team/__tests__/phase1-foundation.test.d.ts.map +1 -0
- package/dist/team/__tests__/phase1-foundation.test.js +151 -0
- package/dist/team/__tests__/phase1-foundation.test.js.map +1 -0
- package/dist/team/__tests__/role-router.test.d.ts +2 -0
- package/dist/team/__tests__/role-router.test.d.ts.map +1 -0
- package/dist/team/__tests__/role-router.test.js +122 -0
- package/dist/team/__tests__/role-router.test.js.map +1 -0
- package/dist/team/__tests__/runtime-prompt-mode.test.js +4 -1
- package/dist/team/__tests__/runtime-prompt-mode.test.js.map +1 -1
- package/dist/team/__tests__/runtime-v2.dispatch.test.js +114 -6
- package/dist/team/__tests__/runtime-v2.dispatch.test.js.map +1 -1
- package/dist/team/__tests__/runtime-v2.monitor.test.js +45 -0
- package/dist/team/__tests__/runtime-v2.monitor.test.js.map +1 -1
- package/dist/team/__tests__/runtime-v2.shutdown-pane-cleanup.test.d.ts +2 -0
- package/dist/team/__tests__/runtime-v2.shutdown-pane-cleanup.test.d.ts.map +1 -0
- package/dist/team/__tests__/runtime-v2.shutdown-pane-cleanup.test.js +110 -0
- package/dist/team/__tests__/runtime-v2.shutdown-pane-cleanup.test.js.map +1 -0
- package/dist/team/__tests__/scaling.test.d.ts +2 -0
- package/dist/team/__tests__/scaling.test.d.ts.map +1 -0
- package/dist/team/__tests__/scaling.test.js +44 -0
- package/dist/team/__tests__/scaling.test.js.map +1 -0
- package/dist/team/__tests__/shell-affinity.test.d.ts +2 -0
- package/dist/team/__tests__/shell-affinity.test.d.ts.map +1 -0
- package/dist/team/__tests__/shell-affinity.test.js +98 -0
- package/dist/team/__tests__/shell-affinity.test.js.map +1 -0
- package/dist/team/__tests__/state-paths.test.js +4 -1
- package/dist/team/__tests__/state-paths.test.js.map +1 -1
- package/dist/team/__tests__/task-file-ops.test.js +6 -4
- package/dist/team/__tests__/task-file-ops.test.js.map +1 -1
- package/dist/team/__tests__/team-leader-nudge-hook.logging.test.d.ts +2 -0
- package/dist/team/__tests__/team-leader-nudge-hook.logging.test.d.ts.map +1 -0
- package/dist/team/__tests__/team-leader-nudge-hook.logging.test.js +63 -0
- package/dist/team/__tests__/team-leader-nudge-hook.logging.test.js.map +1 -0
- package/dist/team/__tests__/team-leader-nudge-hook.test.d.ts +2 -0
- package/dist/team/__tests__/team-leader-nudge-hook.test.d.ts.map +1 -0
- package/dist/team/__tests__/team-leader-nudge-hook.test.js +90 -0
- package/dist/team/__tests__/team-leader-nudge-hook.test.js.map +1 -0
- package/dist/team/__tests__/tmux-comm.test.js +5 -4
- package/dist/team/__tests__/tmux-comm.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.create-team.test.js +46 -2
- package/dist/team/__tests__/tmux-session.create-team.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.kill-team-session.test.js +45 -13
- package/dist/team/__tests__/tmux-session.kill-team-session.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.test.js +50 -58
- package/dist/team/__tests__/tmux-session.test.js.map +1 -1
- package/dist/team/__tests__/unified-team.test.js.map +1 -1
- package/dist/team/__tests__/worker-bootstrap.test.js +50 -5
- package/dist/team/__tests__/worker-bootstrap.test.js.map +1 -1
- package/dist/team/__tests__/worker-canonicalization.test.d.ts +2 -0
- package/dist/team/__tests__/worker-canonicalization.test.d.ts.map +1 -0
- package/dist/team/__tests__/worker-canonicalization.test.js +35 -0
- package/dist/team/__tests__/worker-canonicalization.test.js.map +1 -0
- package/dist/team/__tests__/worker-health.test.js.map +1 -1
- package/dist/team/__tests__/worker-restart.test.js +3 -1
- package/dist/team/__tests__/worker-restart.test.js.map +1 -1
- package/dist/team/allocation-policy.d.ts +34 -0
- package/dist/team/allocation-policy.d.ts.map +1 -0
- package/dist/team/allocation-policy.js +92 -0
- package/dist/team/allocation-policy.js.map +1 -0
- package/dist/team/api-interop.d.ts +1 -1
- package/dist/team/api-interop.d.ts.map +1 -1
- package/dist/team/api-interop.js +51 -6
- package/dist/team/api-interop.js.map +1 -1
- package/dist/team/audit-log.d.ts.map +1 -1
- package/dist/team/audit-log.js +3 -2
- package/dist/team/audit-log.js.map +1 -1
- package/dist/team/events.d.ts.map +1 -1
- package/dist/team/events.js +6 -4
- package/dist/team/events.js.map +1 -1
- package/dist/team/followup-planner.d.ts +32 -0
- package/dist/team/followup-planner.d.ts.map +1 -0
- package/dist/team/followup-planner.js +82 -0
- package/dist/team/followup-planner.js.map +1 -0
- package/dist/team/git-worktree.d.ts.map +1 -1
- package/dist/team/git-worktree.js +20 -10
- package/dist/team/git-worktree.js.map +1 -1
- package/dist/team/governance.d.ts +18 -0
- package/dist/team/governance.d.ts.map +1 -0
- package/dist/team/governance.js +68 -0
- package/dist/team/governance.js.map +1 -0
- package/dist/team/index.d.ts +2 -1
- package/dist/team/index.d.ts.map +1 -1
- package/dist/team/index.js +1 -0
- package/dist/team/index.js.map +1 -1
- package/dist/team/leader-nudge-guidance.d.ts +23 -0
- package/dist/team/leader-nudge-guidance.d.ts.map +1 -0
- package/dist/team/leader-nudge-guidance.js +44 -0
- package/dist/team/leader-nudge-guidance.js.map +1 -0
- package/dist/team/mcp-comm.d.ts.map +1 -1
- package/dist/team/mcp-comm.js +17 -3
- package/dist/team/mcp-comm.js.map +1 -1
- package/dist/team/mcp-team-bridge.d.ts.map +1 -1
- package/dist/team/mcp-team-bridge.js +11 -48
- package/dist/team/mcp-team-bridge.js.map +1 -1
- package/dist/team/merge-coordinator.d.ts +3 -1
- package/dist/team/merge-coordinator.d.ts.map +1 -1
- package/dist/team/merge-coordinator.js +27 -5
- package/dist/team/merge-coordinator.js.map +1 -1
- package/dist/team/model-contract.d.ts +17 -0
- package/dist/team/model-contract.d.ts.map +1 -1
- package/dist/team/model-contract.js +49 -2
- package/dist/team/model-contract.js.map +1 -1
- package/dist/team/monitor.d.ts.map +1 -1
- package/dist/team/monitor.js +69 -2
- package/dist/team/monitor.js.map +1 -1
- package/dist/team/outbox-reader.d.ts.map +1 -1
- package/dist/team/outbox-reader.js +13 -10
- package/dist/team/outbox-reader.js.map +1 -1
- package/dist/team/phase-controller.js +2 -2
- package/dist/team/phase-controller.js.map +1 -1
- package/dist/team/role-router.d.ts +36 -0
- package/dist/team/role-router.d.ts.map +1 -0
- package/dist/team/role-router.js +215 -0
- package/dist/team/role-router.js.map +1 -0
- package/dist/team/runtime-cli.d.ts.map +1 -1
- package/dist/team/runtime-cli.js +35 -0
- package/dist/team/runtime-cli.js.map +1 -1
- package/dist/team/runtime-v2.d.ts +1 -0
- package/dist/team/runtime-v2.d.ts.map +1 -1
- package/dist/team/runtime-v2.js +164 -49
- package/dist/team/runtime-v2.js.map +1 -1
- package/dist/team/runtime.d.ts.map +1 -1
- package/dist/team/runtime.js +29 -15
- package/dist/team/runtime.js.map +1 -1
- package/dist/team/scaling.d.ts.map +1 -1
- package/dist/team/scaling.js +12 -3
- package/dist/team/scaling.js.map +1 -1
- package/dist/team/state/tasks.js +1 -1
- package/dist/team/state/tasks.js.map +1 -1
- package/dist/team/state-paths.js +2 -2
- package/dist/team/state-paths.js.map +1 -1
- package/dist/team/task-file-ops.d.ts.map +1 -1
- package/dist/team/task-file-ops.js +3 -43
- package/dist/team/task-file-ops.js.map +1 -1
- package/dist/team/task-router.d.ts.map +1 -1
- package/dist/team/task-router.js +31 -1
- package/dist/team/task-router.js.map +1 -1
- package/dist/team/team-ops.d.ts.map +1 -1
- package/dist/team/team-ops.js +93 -49
- package/dist/team/team-ops.js.map +1 -1
- package/dist/team/team-registration.d.ts.map +1 -1
- package/dist/team/team-registration.js +18 -14
- package/dist/team/team-registration.js.map +1 -1
- package/dist/team/team-status.d.ts +1 -1
- package/dist/team/team-status.d.ts.map +1 -1
- package/dist/team/team-status.js +8 -5
- package/dist/team/team-status.js.map +1 -1
- package/dist/team/tmux-comm.d.ts.map +1 -1
- package/dist/team/tmux-comm.js +5 -2
- package/dist/team/tmux-comm.js.map +1 -1
- package/dist/team/tmux-session.d.ts +32 -5
- package/dist/team/tmux-session.d.ts.map +1 -1
- package/dist/team/tmux-session.js +179 -50
- package/dist/team/tmux-session.js.map +1 -1
- package/dist/team/types.d.ts +16 -3
- package/dist/team/types.d.ts.map +1 -1
- package/dist/team/types.js.map +1 -1
- package/dist/team/worker-bootstrap.d.ts.map +1 -1
- package/dist/team/worker-bootstrap.js +36 -23
- package/dist/team/worker-bootstrap.js.map +1 -1
- package/dist/team/worker-canonicalization.d.ts +8 -0
- package/dist/team/worker-canonicalization.d.ts.map +1 -0
- package/dist/team/worker-canonicalization.js +98 -0
- package/dist/team/worker-canonicalization.js.map +1 -0
- package/dist/tools/__tests__/cancel-integration.test.js +57 -2
- package/dist/tools/__tests__/cancel-integration.test.js.map +1 -1
- package/dist/tools/__tests__/deepinit-manifest.test.d.ts +7 -0
- package/dist/tools/__tests__/deepinit-manifest.test.d.ts.map +1 -0
- package/dist/tools/__tests__/deepinit-manifest.test.js +559 -0
- package/dist/tools/__tests__/deepinit-manifest.test.js.map +1 -0
- package/dist/tools/__tests__/state-tools.test.js +16 -0
- package/dist/tools/__tests__/state-tools.test.js.map +1 -1
- package/dist/tools/ast-tools.d.ts.map +1 -1
- package/dist/tools/ast-tools.js +11 -2
- package/dist/tools/ast-tools.js.map +1 -1
- package/dist/tools/deepinit-manifest.d.ts +88 -0
- package/dist/tools/deepinit-manifest.d.ts.map +1 -0
- package/dist/tools/deepinit-manifest.js +373 -0
- package/dist/tools/deepinit-manifest.js.map +1 -0
- package/dist/tools/diagnostics/tsc-runner.js +2 -2
- package/dist/tools/diagnostics/tsc-runner.js.map +1 -1
- package/dist/tools/lsp/__tests__/client-devcontainer.test.d.ts +2 -0
- package/dist/tools/lsp/__tests__/client-devcontainer.test.d.ts.map +1 -0
- package/dist/tools/lsp/__tests__/client-devcontainer.test.js +185 -0
- package/dist/tools/lsp/__tests__/client-devcontainer.test.js.map +1 -0
- package/dist/tools/lsp/__tests__/client-singleton.test.d.ts +2 -0
- package/dist/tools/lsp/__tests__/client-singleton.test.d.ts.map +1 -0
- package/dist/tools/lsp/__tests__/client-singleton.test.js +17 -0
- package/dist/tools/lsp/__tests__/client-singleton.test.js.map +1 -0
- package/dist/tools/lsp/__tests__/client-timeout-env.test.js +18 -2
- package/dist/tools/lsp/__tests__/client-timeout-env.test.js.map +1 -1
- package/dist/tools/lsp/__tests__/devcontainer.test.d.ts +2 -0
- package/dist/tools/lsp/__tests__/devcontainer.test.d.ts.map +1 -0
- package/dist/tools/lsp/__tests__/devcontainer.test.js +311 -0
- package/dist/tools/lsp/__tests__/devcontainer.test.js.map +1 -0
- package/dist/tools/lsp/client.d.ts +17 -3
- package/dist/tools/lsp/client.d.ts.map +1 -1
- package/dist/tools/lsp/client.js +228 -77
- package/dist/tools/lsp/client.js.map +1 -1
- package/dist/tools/lsp/devcontainer.d.ts +12 -0
- package/dist/tools/lsp/devcontainer.d.ts.map +1 -0
- package/dist/tools/lsp/devcontainer.js +276 -0
- package/dist/tools/lsp/devcontainer.js.map +1 -0
- package/dist/tools/lsp/index.d.ts +2 -0
- package/dist/tools/lsp/index.d.ts.map +1 -1
- package/dist/tools/lsp/index.js +1 -0
- package/dist/tools/lsp/index.js.map +1 -1
- package/dist/tools/lsp/servers.d.ts +1 -0
- package/dist/tools/lsp/servers.d.ts.map +1 -1
- package/dist/tools/lsp/servers.js +20 -5
- package/dist/tools/lsp/servers.js.map +1 -1
- package/dist/tools/lsp/utils.d.ts.map +1 -1
- package/dist/tools/lsp/utils.js +7 -1
- package/dist/tools/lsp/utils.js.map +1 -1
- package/dist/tools/python-repl/__tests__/bridge-manager-cleanup.test.js +34 -1
- package/dist/tools/python-repl/__tests__/bridge-manager-cleanup.test.js.map +1 -1
- package/dist/tools/python-repl/bridge-manager.d.ts +2 -0
- package/dist/tools/python-repl/bridge-manager.d.ts.map +1 -1
- package/dist/tools/python-repl/bridge-manager.js +38 -2
- package/dist/tools/python-repl/bridge-manager.js.map +1 -1
- package/dist/tools/python-repl/socket-client.d.ts.map +1 -1
- package/dist/tools/python-repl/socket-client.js +37 -7
- package/dist/tools/python-repl/socket-client.js.map +1 -1
- package/dist/tools/python-repl/tool.d.ts.map +1 -1
- package/dist/tools/python-repl/tool.js +1 -5
- package/dist/tools/python-repl/tool.js.map +1 -1
- package/dist/tools/state-tools.d.ts.map +1 -1
- package/dist/tools/state-tools.js +193 -57
- package/dist/tools/state-tools.js.map +1 -1
- package/dist/tools/trace-tools.d.ts.map +1 -1
- package/dist/tools/trace-tools.js +7 -5
- package/dist/tools/trace-tools.js.map +1 -1
- package/dist/tools/types.d.ts +16 -0
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/utils/__tests__/paths.test.js +86 -1
- package/dist/utils/__tests__/paths.test.js.map +1 -1
- package/dist/utils/jsonc.d.ts.map +1 -1
- package/dist/utils/jsonc.js +6 -2
- package/dist/utils/jsonc.js.map +1 -1
- package/dist/utils/omc-cli-rendering.d.ts +8 -0
- package/dist/utils/omc-cli-rendering.d.ts.map +1 -0
- package/dist/utils/omc-cli-rendering.js +37 -0
- package/dist/utils/omc-cli-rendering.js.map +1 -0
- package/dist/utils/paths.d.ts +32 -1
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +103 -8
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/skill-resources.d.ts +7 -0
- package/dist/utils/skill-resources.d.ts.map +1 -0
- package/dist/utils/skill-resources.js +53 -0
- package/dist/utils/skill-resources.js.map +1 -0
- package/dist/utils/ssrf-guard.d.ts.map +1 -1
- package/dist/utils/ssrf-guard.js +22 -0
- package/dist/utils/ssrf-guard.js.map +1 -1
- package/docs/ARCHITECTURE.md +468 -37
- package/docs/CLAUDE.md +1 -1
- package/docs/COMPATIBILITY.md +18 -1
- package/docs/LOCAL_PLUGIN_INSTALL.md +17 -3
- package/docs/MIGRATION.md +8 -46
- package/docs/PERFORMANCE-MONITORING.md +2 -2
- package/docs/REFERENCE.md +99 -58
- package/docs/design/SKILLS_2_0_ADAPTATION.md +115 -0
- package/docs/ko/ARCHITECTURE.md +1 -1
- package/docs/ko/MIGRATION.md +7 -47
- package/docs/ko/REFERENCE.md +1 -15
- package/docs/partials/features.md +1 -32
- package/docs/partials/mode-hierarchy.md +7 -22
- package/docs/partials/verification-tiers.md +1 -1
- package/docs/plans/2026-02-26-skill-optimization-design.md +3 -3
- package/docs/shared/features.md +1 -32
- package/docs/shared/mode-hierarchy.md +7 -22
- package/docs/shared/verification-tiers.md +1 -1
- package/hooks/hooks.json +21 -31
- package/package.json +1 -1
- package/scripts/cleanup-orphans.mjs +12 -9
- package/scripts/context-guard-stop.mjs +13 -5
- package/scripts/context-safety.mjs +12 -149
- package/scripts/eval-autoresearch-json.mjs +49 -0
- package/scripts/eval-autoresearch-timed-json.mjs +62 -0
- package/scripts/generate-featured-contributors.ts +43 -0
- package/scripts/keyword-detector.mjs +136 -36
- package/scripts/persistent-mode.cjs +87 -25
- package/scripts/persistent-mode.mjs +37 -17
- package/scripts/plugin-setup.mjs +19 -16
- package/scripts/post-tool-verifier.mjs +25 -20
- package/scripts/pre-tool-enforcer.mjs +184 -6
- package/scripts/project-memory-session.mjs +5 -1
- package/scripts/release.ts +511 -0
- package/scripts/run-provider-advisor.js +10 -4
- package/scripts/session-end.mjs +3 -2
- package/scripts/session-start.mjs +118 -4
- package/scripts/session-summary.mjs +241 -0
- package/scripts/setup-claude-md.sh +140 -3
- package/scripts/skill-injector.mjs +2 -1
- package/scripts/sync-metadata.ts +41 -7
- package/scripts/sync-version.sh +42 -0
- package/skills/AGENTS.md +108 -74
- package/skills/ai-slop-cleaner/SKILL.md +120 -117
- package/skills/analyze/SKILL.md +42 -0
- package/skills/ask/SKILL.md +4 -2
- package/skills/autopilot/SKILL.md +1 -0
- package/skills/bdd-generator/SKILL.md +60 -0
- package/skills/cancel/SKILL.md +62 -0
- package/skills/ccg/SKILL.md +7 -13
- package/skills/configure-notifications/SKILL.md +1 -0
- package/skills/deep-dive/SKILL.md +476 -0
- package/skills/deep-interview/SKILL.md +109 -14
- package/skills/deepinit/SKILL.md +1 -0
- package/skills/e2e/SKILL.md +55 -0
- package/skills/electron-driver/SKILL.md +51 -0
- package/skills/electron-driver/scripts/driver-template.js +46 -0
- package/skills/external-context/SKILL.md +1 -0
- package/skills/hud/SKILL.md +6 -5
- package/skills/learner/SKILL.md +63 -57
- package/skills/mcp-setup/SKILL.md +1 -0
- package/skills/multi-model-research/SKILL.md +51 -0
- package/skills/omc-doctor/SKILL.md +6 -5
- package/skills/omc-reference/SKILL.md +141 -0
- package/skills/omc-setup/SKILL.md +11 -2
- package/skills/omc-setup/phases/01-install-claude-md.md +11 -1
- package/skills/omc-setup/phases/02-configure.md +3 -1
- package/skills/omc-teams/SKILL.md +9 -5
- package/skills/plan/SKILL.md +23 -7
- package/skills/planning-with-files/SKILL.md +49 -0
- package/skills/planning-with-files/examples.md +17 -0
- package/skills/planning-with-files/reference.md +21 -0
- package/skills/planning-with-files/scripts/check-complete.ps1 +28 -0
- package/skills/planning-with-files/scripts/check-complete.sh +31 -0
- package/skills/planning-with-files/scripts/init-session.ps1 +31 -0
- package/skills/planning-with-files/scripts/init-session.sh +36 -0
- package/skills/planning-with-files/scripts/session-catchup.py +66 -0
- package/skills/planning-with-files/templates/findings.md +24 -0
- package/skills/planning-with-files/templates/progress.md +38 -0
- package/skills/planning-with-files/templates/task_plan.md +53 -0
- package/skills/project-session-manager/SKILL.md +3 -2
- package/skills/ralph/SKILL.md +17 -1
- package/skills/ralplan/SKILL.md +4 -1
- package/skills/release/SKILL.md +1 -0
- package/skills/sciomc/SKILL.md +1 -0
- package/skills/setup/SKILL.md +9 -8
- package/skills/skill-creator/SKILL.md +311 -0
- package/skills/skill-creator/references/upstream-anthropic-skill-creator.md +485 -0
- package/skills/skill-debugger/README.md +52 -0
- package/skills/skill-debugger/SKILL.md +146 -270
- package/skills/skill-quality-analyzer/HOW_TO_USE.md +92 -185
- package/skills/skill-quality-analyzer/README.md +39 -35
- package/skills/skill-quality-analyzer/SKILL.md +105 -196
- package/skills/skill-tester/README.md +31 -23
- package/skills/skill-tester/SKILL.md +116 -266
- package/skills/start-dev/SKILL.md +45 -0
- package/skills/tdd-generator/SKILL.md +51 -0
- package/skills/team/SKILL.md +1 -0
- package/skills/test-coverage/SKILL.md +40 -0
- package/skills/test-gen/SKILL.md +70 -0
- package/skills/trace/SKILL.md +262 -0
- package/skills/ultraqa/SKILL.md +1 -0
- package/skills/ultrawork/SKILL.md +1 -0
- package/skills/visual-verdict/SKILL.md +77 -0
- package/skills/writer-memory/SKILL.md +1 -0
- package/templates/hooks/keyword-detector.mjs +89 -25
- package/templates/hooks/persistent-mode.mjs +33 -9
- package/templates/hooks/post-tool-use-failure.mjs +2 -5
- package/templates/hooks/pre-tool-use.mjs +47 -1
- package/templates/hooks/session-start.mjs +105 -14
- package/templates/hooks/stop-continuation.mjs +7 -1
- package/dist/__tests__/codex-backoff.test.d.ts +0 -2
- package/dist/__tests__/codex-backoff.test.d.ts.map +0 -1
- package/dist/__tests__/codex-backoff.test.js +0 -143
- package/dist/__tests__/codex-backoff.test.js.map +0 -1
- package/dist/__tests__/codex-callsite-normalization.test.js +0 -112
- package/dist/__tests__/compatibility-security.test.d.ts +0 -13
- package/dist/__tests__/compatibility-security.test.d.ts.map +0 -1
- package/dist/__tests__/compatibility-security.test.js +0 -403
- package/dist/__tests__/compatibility-security.test.js.map +0 -1
- package/dist/__tests__/compatibility.test.d.ts +0 -7
- package/dist/__tests__/compatibility.test.d.ts.map +0 -1
- package/dist/__tests__/compatibility.test.js +0 -484
- package/dist/__tests__/compatibility.test.js.map +0 -1
- package/dist/__tests__/example.test.d.ts +0 -2
- package/dist/__tests__/example.test.d.ts.map +0 -1
- package/dist/__tests__/example.test.js +0 -20
- package/dist/__tests__/example.test.js.map +0 -1
- package/dist/__tests__/hud/analytics-display.test.d.ts +0 -2
- package/dist/__tests__/hud/analytics-display.test.d.ts.map +0 -1
- package/dist/__tests__/hud/analytics-display.test.js +0 -236
- package/dist/__tests__/hud/analytics-display.test.js.map +0 -1
- package/dist/__tests__/hud/top-agents.test.d.ts +0 -8
- package/dist/__tests__/hud/top-agents.test.d.ts.map +0 -1
- package/dist/__tests__/hud/top-agents.test.js +0 -158
- package/dist/__tests__/hud/top-agents.test.js.map +0 -1
- package/dist/__tests__/inline-prompt-integration.test.d.ts +0 -2
- package/dist/__tests__/inline-prompt-integration.test.d.ts.map +0 -1
- package/dist/__tests__/inline-prompt-integration.test.js +0 -411
- package/dist/__tests__/inline-prompt-integration.test.js.map +0 -1
- package/dist/__tests__/inline-success-shape.test.d.ts +0 -2
- package/dist/__tests__/inline-success-shape.test.d.ts.map +0 -1
- package/dist/__tests__/inline-success-shape.test.js +0 -130
- package/dist/__tests__/inline-success-shape.test.js.map +0 -1
- package/dist/__tests__/mcp-fallback-429.test.d.ts +0 -2
- package/dist/__tests__/mcp-fallback-429.test.d.ts.map +0 -1
- package/dist/__tests__/mcp-fallback-429.test.js +0 -193
- package/dist/__tests__/mcp-fallback-429.test.js.map +0 -1
- package/dist/__tests__/mcp-server-workflows.test.d.ts +0 -2
- package/dist/__tests__/mcp-server-workflows.test.d.ts.map +0 -1
- package/dist/__tests__/mcp-server-workflows.test.js +0 -301
- package/dist/__tests__/mcp-server-workflows.test.js.map +0 -1
- package/dist/__tests__/multi-model-mcp-integration.test.d.ts +0 -2
- package/dist/__tests__/multi-model-mcp-integration.test.d.ts.map +0 -1
- package/dist/__tests__/multi-model-mcp-integration.test.js +0 -69
- package/dist/__tests__/multi-model-mcp-integration.test.js.map +0 -1
- package/dist/__tests__/multi-model-mcp.test.d.ts +0 -2
- package/dist/__tests__/multi-model-mcp.test.d.ts.map +0 -1
- package/dist/__tests__/multi-model-mcp.test.js +0 -145
- package/dist/__tests__/multi-model-mcp.test.js.map +0 -1
- package/dist/__tests__/omc-shorthand.test.d.ts +0 -2
- package/dist/__tests__/omc-shorthand.test.d.ts.map +0 -1
- package/dist/__tests__/omc-shorthand.test.js +0 -73
- package/dist/__tests__/omc-shorthand.test.js.map +0 -1
- package/dist/__tests__/prompt-file-only.test.d.ts +0 -2
- package/dist/__tests__/prompt-file-only.test.d.ts.map +0 -1
- package/dist/__tests__/prompt-file-only.test.js +0 -263
- package/dist/__tests__/prompt-file-only.test.js.map +0 -1
- package/dist/__tests__/session-catalog.test.d.ts +0 -2
- package/dist/__tests__/session-catalog.test.d.ts.map +0 -1
- package/dist/__tests__/session-catalog.test.js +0 -195
- package/dist/__tests__/session-catalog.test.js.map +0 -1
- package/dist/__tests__/session-migration.test.d.ts +0 -2
- package/dist/__tests__/session-migration.test.d.ts.map +0 -1
- package/dist/__tests__/session-migration.test.js +0 -155
- package/dist/__tests__/session-migration.test.js.map +0 -1
- package/dist/__tests__/shell-path.test.d.ts +0 -5
- package/dist/__tests__/shell-path.test.d.ts.map +0 -1
- package/dist/__tests__/shell-path.test.js +0 -70
- package/dist/__tests__/shell-path.test.js.map +0 -1
- package/dist/__tests__/smoke-functional.test.d.ts +0 -8
- package/dist/__tests__/smoke-functional.test.d.ts.map +0 -1
- package/dist/__tests__/smoke-functional.test.js +0 -450
- package/dist/__tests__/smoke-functional.test.js.map +0 -1
- package/dist/__tests__/smoke-team-worker.test.d.ts +0 -15
- package/dist/__tests__/smoke-team-worker.test.d.ts.map +0 -1
- package/dist/__tests__/smoke-team-worker.test.js +0 -483
- package/dist/__tests__/smoke-team-worker.test.js.map +0 -1
- package/dist/__tests__/validate-and-read-file.test.d.ts +0 -2
- package/dist/__tests__/validate-and-read-file.test.d.ts.map +0 -1
- package/dist/__tests__/validate-and-read-file.test.js +0 -84
- package/dist/__tests__/validate-and-read-file.test.js.map +0 -1
- package/dist/__tests__/worker-adapter.test.d.ts +0 -5
- package/dist/__tests__/worker-adapter.test.d.ts.map +0 -1
- package/dist/__tests__/worker-adapter.test.js +0 -211
- package/dist/__tests__/worker-adapter.test.js.map +0 -1
- package/dist/agents/coordinator-deprecated.d.ts +0 -18
- package/dist/agents/coordinator-deprecated.d.ts.map +0 -1
- package/dist/agents/coordinator-deprecated.js +0 -38
- package/dist/agents/coordinator-deprecated.js.map +0 -1
- package/dist/agents/deep-executor.d.ts +0 -15
- package/dist/agents/deep-executor.d.ts.map +0 -1
- package/dist/agents/deep-executor.js +0 -45
- package/dist/agents/deep-executor.js.map +0 -1
- package/dist/agents/delegation-validator.d.ts +0 -31
- package/dist/agents/delegation-validator.d.ts.map +0 -1
- package/dist/agents/delegation-validator.js +0 -75
- package/dist/agents/delegation-validator.js.map +0 -1
- package/dist/agents/harsh-critic.d.ts +0 -14
- package/dist/agents/harsh-critic.d.ts.map +0 -1
- package/dist/agents/harsh-critic.js +0 -42
- package/dist/agents/harsh-critic.js.map +0 -1
- package/dist/agents/preamble.d.ts +0 -38
- package/dist/agents/preamble.d.ts.map +0 -1
- package/dist/agents/preamble.js +0 -122
- package/dist/agents/preamble.js.map +0 -1
- package/dist/agents/prompt-generator.d.ts +0 -96
- package/dist/agents/prompt-generator.d.ts.map +0 -1
- package/dist/agents/prompt-generator.js +0 -141
- package/dist/agents/prompt-generator.js.map +0 -1
- package/dist/agents/researcher.d.ts +0 -12
- package/dist/agents/researcher.d.ts.map +0 -1
- package/dist/agents/researcher.js +0 -40
- package/dist/agents/researcher.js.map +0 -1
- package/dist/agents/vision.d.ts +0 -11
- package/dist/agents/vision.d.ts.map +0 -1
- package/dist/agents/vision.js +0 -40
- package/dist/agents/vision.js.map +0 -1
- package/dist/cli/commands/__tests__/cleanup.test.d.ts +0 -2
- package/dist/cli/commands/__tests__/cleanup.test.d.ts.map +0 -1
- package/dist/cli/commands/__tests__/cleanup.test.js +0 -37
- package/dist/cli/commands/__tests__/cleanup.test.js.map +0 -1
- package/dist/compatibility/discovery.d.ts +0 -58
- package/dist/compatibility/discovery.d.ts.map +0 -1
- package/dist/compatibility/discovery.js +0 -620
- package/dist/compatibility/discovery.js.map +0 -1
- package/dist/compatibility/index.d.ts +0 -51
- package/dist/compatibility/index.d.ts.map +0 -1
- package/dist/compatibility/index.js +0 -72
- package/dist/compatibility/index.js.map +0 -1
- package/dist/compatibility/mcp-bridge.d.ts +0 -143
- package/dist/compatibility/mcp-bridge.d.ts.map +0 -1
- package/dist/compatibility/mcp-bridge.js +0 -540
- package/dist/compatibility/mcp-bridge.js.map +0 -1
- package/dist/compatibility/permission-adapter.d.ts +0 -79
- package/dist/compatibility/permission-adapter.d.ts.map +0 -1
- package/dist/compatibility/permission-adapter.js +0 -369
- package/dist/compatibility/permission-adapter.js.map +0 -1
- package/dist/compatibility/registry.d.ts +0 -161
- package/dist/compatibility/registry.d.ts.map +0 -1
- package/dist/compatibility/registry.js +0 -389
- package/dist/compatibility/registry.js.map +0 -1
- package/dist/compatibility/types.d.ts +0 -249
- package/dist/compatibility/types.d.ts.map +0 -1
- package/dist/compatibility/types.js +0 -8
- package/dist/compatibility/types.js.map +0 -1
- package/dist/features/model-routing/__tests__/external-model-policy.test.d.ts +0 -2
- package/dist/features/model-routing/__tests__/external-model-policy.test.d.ts.map +0 -1
- package/dist/features/model-routing/__tests__/external-model-policy.test.js +0 -476
- package/dist/features/model-routing/__tests__/external-model-policy.test.js.map +0 -1
- package/dist/features/model-routing/external-model-policy.d.ts +0 -27
- package/dist/features/model-routing/external-model-policy.d.ts.map +0 -1
- package/dist/features/model-routing/external-model-policy.js +0 -145
- package/dist/features/model-routing/external-model-policy.js.map +0 -1
- package/dist/features/verification/example.d.ts +0 -49
- package/dist/features/verification/example.d.ts.map +0 -1
- package/dist/features/verification/example.js +0 -237
- package/dist/features/verification/example.js.map +0 -1
- package/dist/hooks/setup/__tests__/github-star.test.d.ts +0 -8
- package/dist/hooks/setup/__tests__/github-star.test.d.ts.map +0 -1
- package/dist/hooks/setup/__tests__/github-star.test.js +0 -208
- package/dist/hooks/setup/__tests__/github-star.test.js.map +0 -1
- package/dist/hooks/setup/github-star.d.ts +0 -37
- package/dist/hooks/setup/github-star.d.ts.map +0 -1
- package/dist/hooks/setup/github-star.js +0 -123
- package/dist/hooks/setup/github-star.js.map +0 -1
- package/dist/hooks/swarm/__tests__/addMoreTasks.test.d.ts +0 -2
- package/dist/hooks/swarm/__tests__/addMoreTasks.test.d.ts.map +0 -1
- package/dist/hooks/swarm/__tests__/addMoreTasks.test.js +0 -203
- package/dist/hooks/swarm/__tests__/addMoreTasks.test.js.map +0 -1
- package/dist/hooks/swarm/__tests__/aggressive-swarm.integration.test.d.ts +0 -2
- package/dist/hooks/swarm/__tests__/aggressive-swarm.integration.test.d.ts.map +0 -1
- package/dist/hooks/swarm/__tests__/aggressive-swarm.integration.test.js +0 -273
- package/dist/hooks/swarm/__tests__/aggressive-swarm.integration.test.js.map +0 -1
- package/dist/hooks/swarm/__tests__/claiming.test.d.ts +0 -2
- package/dist/hooks/swarm/__tests__/claiming.test.d.ts.map +0 -1
- package/dist/hooks/swarm/__tests__/claiming.test.js +0 -170
- package/dist/hooks/swarm/__tests__/claiming.test.js.map +0 -1
- package/dist/hooks/swarm/__tests__/index.test.d.ts.map +0 -1
- package/dist/hooks/swarm/__tests__/index.test.js +0 -157
- package/dist/hooks/swarm/__tests__/index.test.js.map +0 -1
- package/dist/hooks/swarm/__tests__/migration.test.d.ts +0 -2
- package/dist/hooks/swarm/__tests__/migration.test.d.ts.map +0 -1
- package/dist/hooks/swarm/__tests__/migration.test.js +0 -140
- package/dist/hooks/swarm/__tests__/migration.test.js.map +0 -1
- package/dist/hooks/swarm/__tests__/mode-registry.test.d.ts +0 -2
- package/dist/hooks/swarm/__tests__/mode-registry.test.d.ts.map +0 -1
- package/dist/hooks/swarm/__tests__/mode-registry.test.js +0 -177
- package/dist/hooks/swarm/__tests__/mode-registry.test.js.map +0 -1
- package/dist/hooks/swarm/__tests__/priority-claiming.test.d.ts +0 -2
- package/dist/hooks/swarm/__tests__/priority-claiming.test.d.ts.map +0 -1
- package/dist/hooks/swarm/__tests__/priority-claiming.test.js +0 -122
- package/dist/hooks/swarm/__tests__/priority-claiming.test.js.map +0 -1
- package/dist/hooks/swarm/__tests__/types.test.d.ts +0 -2
- package/dist/hooks/swarm/__tests__/types.test.d.ts.map +0 -1
- package/dist/hooks/swarm/__tests__/types.test.js +0 -73
- package/dist/hooks/swarm/__tests__/types.test.js.map +0 -1
- package/dist/hooks/swarm/claiming.d.ts +0 -123
- package/dist/hooks/swarm/claiming.d.ts.map +0 -1
- package/dist/hooks/swarm/claiming.js +0 -639
- package/dist/hooks/swarm/claiming.js.map +0 -1
- package/dist/hooks/swarm/index.d.ts +0 -261
- package/dist/hooks/swarm/index.d.ts.map +0 -1
- package/dist/hooks/swarm/index.js +0 -485
- package/dist/hooks/swarm/index.js.map +0 -1
- package/dist/hooks/swarm/state.d.ts +0 -131
- package/dist/hooks/swarm/state.d.ts.map +0 -1
- package/dist/hooks/swarm/state.js +0 -690
- package/dist/hooks/swarm/state.js.map +0 -1
- package/dist/hooks/swarm/types.d.ts +0 -138
- package/dist/hooks/swarm/types.d.ts.map +0 -1
- package/dist/hooks/swarm/types.js +0 -22
- package/dist/hooks/swarm/types.js.map +0 -1
- package/dist/hooks/ultrapilot/decomposer.d.ts +0 -141
- package/dist/hooks/ultrapilot/decomposer.d.ts.map +0 -1
- package/dist/hooks/ultrapilot/decomposer.js +0 -379
- package/dist/hooks/ultrapilot/decomposer.js.map +0 -1
- package/dist/hooks/ultrapilot/index.d.ts +0 -121
- package/dist/hooks/ultrapilot/index.d.ts.map +0 -1
- package/dist/hooks/ultrapilot/index.js +0 -353
- package/dist/hooks/ultrapilot/index.js.map +0 -1
- package/dist/hooks/ultrapilot/state.d.ts +0 -72
- package/dist/hooks/ultrapilot/state.d.ts.map +0 -1
- package/dist/hooks/ultrapilot/state.js +0 -275
- package/dist/hooks/ultrapilot/state.js.map +0 -1
- package/dist/hooks/ultrapilot/types.d.ts +0 -115
- package/dist/hooks/ultrapilot/types.d.ts.map +0 -1
- package/dist/hooks/ultrapilot/types.js +0 -36
- package/dist/hooks/ultrapilot/types.js.map +0 -1
- package/dist/interop/__tests__/worker-adapter-integration.test.d.ts +0 -2
- package/dist/interop/__tests__/worker-adapter-integration.test.d.ts.map +0 -1
- package/dist/interop/__tests__/worker-adapter-integration.test.js +0 -219
- package/dist/interop/__tests__/worker-adapter-integration.test.js.map +0 -1
- package/dist/interop/__tests__/worker-adapter.test.d.ts +0 -2
- package/dist/interop/__tests__/worker-adapter.test.d.ts.map +0 -1
- package/dist/interop/__tests__/worker-adapter.test.js +0 -408
- package/dist/interop/__tests__/worker-adapter.test.js.map +0 -1
- package/dist/interop/adapter-types.d.ts +0 -39
- package/dist/interop/adapter-types.d.ts.map +0 -1
- package/dist/interop/adapter-types.js +0 -9
- package/dist/interop/adapter-types.js.map +0 -1
- package/dist/interop/worker-adapter.d.ts +0 -116
- package/dist/interop/worker-adapter.d.ts.map +0 -1
- package/dist/interop/worker-adapter.js +0 -324
- package/dist/interop/worker-adapter.js.map +0 -1
- package/dist/mcp/__tests__/codex-reasoning-effort.test.d.ts +0 -2
- package/dist/mcp/__tests__/codex-reasoning-effort.test.d.ts.map +0 -1
- package/dist/mcp/__tests__/codex-reasoning-effort.test.js +0 -175
- package/dist/mcp/__tests__/codex-reasoning-effort.test.js.map +0 -1
- package/dist/mcp/__tests__/job-state-db-deprecation.test.d.ts +0 -2
- package/dist/mcp/__tests__/job-state-db-deprecation.test.d.ts.map +0 -1
- package/dist/mcp/__tests__/job-state-db-deprecation.test.js +0 -119
- package/dist/mcp/__tests__/job-state-db-deprecation.test.js.map +0 -1
- package/dist/mcp/__tests__/shared-exec.test.d.ts +0 -2
- package/dist/mcp/__tests__/shared-exec.test.d.ts.map +0 -1
- package/dist/mcp/__tests__/shared-exec.test.js +0 -151
- package/dist/mcp/__tests__/shared-exec.test.js.map +0 -1
- package/dist/mcp/__tests__/team-server-deprecation.test.d.ts +0 -2
- package/dist/mcp/__tests__/team-server-deprecation.test.d.ts.map +0 -1
- package/dist/mcp/__tests__/team-server-deprecation.test.js +0 -56
- package/dist/mcp/__tests__/team-server-deprecation.test.js.map +0 -1
- package/dist/mcp/cli-detection.d.ts +0 -22
- package/dist/mcp/cli-detection.d.ts.map +0 -1
- package/dist/mcp/cli-detection.js +0 -77
- package/dist/mcp/cli-detection.js.map +0 -1
- package/dist/mcp/codex-core.d.ts +0 -119
- package/dist/mcp/codex-core.d.ts.map +0 -1
- package/dist/mcp/codex-core.js +0 -942
- package/dist/mcp/codex-core.js.map +0 -1
- package/dist/mcp/codex-request-normalizer.js +0 -59
- package/dist/mcp/codex-server.d.ts +0 -20
- package/dist/mcp/codex-server.d.ts.map +0 -1
- package/dist/mcp/codex-server.js +0 -81
- package/dist/mcp/codex-server.js.map +0 -1
- package/dist/mcp/codex-standalone-server.d.ts +0 -8
- package/dist/mcp/codex-standalone-server.d.ts.map +0 -1
- package/dist/mcp/codex-standalone-server.js +0 -81
- package/dist/mcp/codex-standalone-server.js.map +0 -1
- package/dist/mcp/gemini-core.d.ts +0 -75
- package/dist/mcp/gemini-core.d.ts.map +0 -1
- package/dist/mcp/gemini-core.js +0 -674
- package/dist/mcp/gemini-core.js.map +0 -1
- package/dist/mcp/gemini-server.d.ts +0 -20
- package/dist/mcp/gemini-server.d.ts.map +0 -1
- package/dist/mcp/gemini-server.js +0 -69
- package/dist/mcp/gemini-server.js.map +0 -1
- package/dist/mcp/gemini-standalone-server.d.ts +0 -8
- package/dist/mcp/gemini-standalone-server.d.ts.map +0 -1
- package/dist/mcp/gemini-standalone-server.js +0 -72
- package/dist/mcp/gemini-standalone-server.js.map +0 -1
- package/dist/mcp/job-state-db.d.ts +0 -2
- package/dist/mcp/job-state-db.d.ts.map +0 -1
- package/dist/mcp/job-state-db.js +0 -3
- package/dist/mcp/job-state-db.js.map +0 -1
- package/dist/mcp/shared-exec.d.ts +0 -50
- package/dist/mcp/shared-exec.d.ts.map +0 -1
- package/dist/mcp/shared-exec.js +0 -182
- package/dist/mcp/shared-exec.js.map +0 -1
- package/dist/team/__tests__/cli-path-resolution.test.d.ts +0 -2
- package/dist/team/__tests__/cli-path-resolution.test.d.ts.map +0 -1
- package/dist/team/__tests__/cli-path-resolution.test.js +0 -281
- package/dist/team/__tests__/cli-path-resolution.test.js.map +0 -1
- package/dist/team/__tests__/layout-stabilizer.test.d.ts +0 -2
- package/dist/team/__tests__/layout-stabilizer.test.d.ts.map +0 -1
- package/dist/team/__tests__/layout-stabilizer.test.js +0 -217
- package/dist/team/__tests__/layout-stabilizer.test.js.map +0 -1
- package/dist/team/__tests__/pane-readiness.test.d.ts +0 -2
- package/dist/team/__tests__/pane-readiness.test.d.ts.map +0 -1
- package/dist/team/__tests__/pane-readiness.test.js +0 -185
- package/dist/team/__tests__/pane-readiness.test.js.map +0 -1
- package/dist/team/__tests__/runtime-gemini-prompt.test.d.ts +0 -2
- package/dist/team/__tests__/runtime-gemini-prompt.test.d.ts.map +0 -1
- package/dist/team/__tests__/runtime-gemini-prompt.test.js +0 -153
- package/dist/team/__tests__/runtime-gemini-prompt.test.js.map +0 -1
- package/dist/team/__tests__/runtime-interop-spawn-regression.test.d.ts +0 -2
- package/dist/team/__tests__/runtime-interop-spawn-regression.test.d.ts.map +0 -1
- package/dist/team/__tests__/runtime-interop-spawn-regression.test.js +0 -139
- package/dist/team/__tests__/runtime-interop-spawn-regression.test.js.map +0 -1
- package/dist/team/__tests__/shell-path.test.d.ts +0 -2
- package/dist/team/__tests__/shell-path.test.d.ts.map +0 -1
- package/dist/team/__tests__/shell-path.test.js +0 -193
- package/dist/team/__tests__/shell-path.test.js.map +0 -1
- package/dist/team/__tests__/wait-for-shell-ready.test.d.ts +0 -2
- package/dist/team/__tests__/wait-for-shell-ready.test.d.ts.map +0 -1
- package/dist/team/__tests__/wait-for-shell-ready.test.js +0 -242
- package/dist/team/__tests__/wait-for-shell-ready.test.js.map +0 -1
- package/dist/team/shell-path.d.ts +0 -21
- package/dist/team/shell-path.d.ts.map +0 -1
- package/dist/team/shell-path.js +0 -73
- package/dist/team/shell-path.js.map +0 -1
- package/scripts/ask-codex.sh +0 -24
- package/scripts/ask-gemini.sh +0 -24
- package/scripts/build-gemini-server.mjs +0 -74
- package/scripts/test-codex-gemini-team.mjs +0 -78
- package/skills/skill-development/SKILL.md +0 -218
- package/skills/skill-development/references/description-patterns.md +0 -160
- package/skills/skill-development/references/format-guide.md +0 -203
- package/skills/test-gen/skill.md +0 -531
- /package/dist/{hooks/swarm → features/delegation-categories}/__tests__/index.test.d.ts +0 -0
package/dist/mcp/codex-core.js
DELETED
|
@@ -1,942 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Codex MCP Core - Shared business logic for Codex CLI integration
|
|
3
|
-
*
|
|
4
|
-
* This module contains all the business logic for the Codex MCP integration.
|
|
5
|
-
* It is imported by both the in-process SDK server (codex-server.ts) and the
|
|
6
|
-
* standalone stdio server to eliminate code duplication.
|
|
7
|
-
*
|
|
8
|
-
* This module is SDK-agnostic and contains no dependencies on @anthropic-ai/claude-agent-sdk.
|
|
9
|
-
*/
|
|
10
|
-
import { spawn } from 'child_process';
|
|
11
|
-
import { appendFileSync, existsSync, mkdirSync, readFileSync, realpathSync, unlinkSync, writeFileSync } from 'fs';
|
|
12
|
-
import { resolve, relative, sep, isAbsolute, join } from 'path';
|
|
13
|
-
import { createStdoutCollector, safeWriteOutputFile } from './shared-exec.js';
|
|
14
|
-
import { detectCodexCli } from './cli-detection.js';
|
|
15
|
-
import { getWorktreeRoot } from '../lib/worktree-paths.js';
|
|
16
|
-
import { isExternalPromptAllowed } from './mcp-config.js';
|
|
17
|
-
import { resolveSystemPrompt, buildPromptWithSystemContext, wrapUntrustedCliResponse, isValidAgentRoleName, VALID_AGENT_ROLES, singleErrorBlock, inlineSuccessBlocks, validateContextFilePaths } from './prompt-injection.js';
|
|
18
|
-
import { persistPrompt, persistResponse, getExpectedResponsePath, getPromptsDir, slugify, generatePromptId } from './prompt-persistence.js';
|
|
19
|
-
import { writeJobStatus, getStatusFilePath, readJobStatus } from './prompt-persistence.js';
|
|
20
|
-
import { resolveExternalModel, buildFallbackChain, CODEX_MODEL_FALLBACKS, } from '../features/model-routing/external-model-policy.js';
|
|
21
|
-
import { loadConfig } from '../config/loader.js';
|
|
22
|
-
// Module-scoped PID registry - tracks PIDs spawned by this process
|
|
23
|
-
const spawnedPids = new Set();
|
|
24
|
-
export function isSpawnedPid(pid) {
|
|
25
|
-
return spawnedPids.has(pid);
|
|
26
|
-
}
|
|
27
|
-
export function clearSpawnedPids() {
|
|
28
|
-
spawnedPids.clear();
|
|
29
|
-
}
|
|
30
|
-
// Model name validation: alphanumeric start, then alphanumeric/dots/hyphens/underscores, max 64 chars
|
|
31
|
-
const MODEL_NAME_REGEX = /^[a-z0-9][a-z0-9._-]{0,63}$/i;
|
|
32
|
-
function validateModelName(model) {
|
|
33
|
-
if (!MODEL_NAME_REGEX.test(model)) {
|
|
34
|
-
throw new Error(`Invalid model name: "${model}". Model names must match pattern: alphanumeric start, followed by alphanumeric, dots, hyphens, or underscores (max 64 chars).`);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
// Default model can be overridden via environment variable
|
|
38
|
-
export const CODEX_DEFAULT_MODEL = process.env.OMC_CODEX_DEFAULT_MODEL || 'gpt-5.3-codex';
|
|
39
|
-
export const CODEX_TIMEOUT = Math.min(Math.max(5000, parseInt(process.env.OMC_CODEX_TIMEOUT || '3600000', 10) || 3600000), 3600000);
|
|
40
|
-
// Rate limit backoff configuration (configurable via environment variables)
|
|
41
|
-
export const RATE_LIMIT_RETRY_COUNT = Math.min(10, Math.max(1, parseInt(process.env.OMC_CODEX_RATE_LIMIT_RETRY_COUNT || '3', 10) || 3));
|
|
42
|
-
export const RATE_LIMIT_INITIAL_DELAY = Math.max(1000, parseInt(process.env.OMC_CODEX_RATE_LIMIT_INITIAL_DELAY || '5000', 10) || 5000);
|
|
43
|
-
export const RATE_LIMIT_MAX_DELAY = Math.max(5000, parseInt(process.env.OMC_CODEX_RATE_LIMIT_MAX_DELAY || '60000', 10) || 60000);
|
|
44
|
-
// Re-export CODEX_MODEL_FALLBACKS for backward compatibility
|
|
45
|
-
export { CODEX_MODEL_FALLBACKS };
|
|
46
|
-
// Codex is best for analytical/planning tasks (recommended, not enforced)
|
|
47
|
-
export const CODEX_RECOMMENDED_ROLES = ['architect', 'planner', 'critic', 'analyst', 'code-reviewer', 'security-reviewer', 'test-engineer'];
|
|
48
|
-
// Valid reasoning effort levels for Codex CLI (via -c model_reasoning_effort=<value>)
|
|
49
|
-
// Default (when omitted): inherits from ~/.codex/config.toml (Codex CLI default is "medium")
|
|
50
|
-
export const VALID_REASONING_EFFORTS = ['minimal', 'low', 'medium', 'high', 'xhigh'];
|
|
51
|
-
export const MAX_FILE_SIZE = 5 * 1024 * 1024; // 5MB per file
|
|
52
|
-
export const MAX_STDOUT_BYTES = 10 * 1024 * 1024; // 10MB stdout cap
|
|
53
|
-
const RATE_LIMIT_OR_DISCONNECT_REGEX = /429|rate.?limit|too many requests|quota.?exceeded|resource.?exhausted|stream disconnected|transport closed|econnreset|epipe/i;
|
|
54
|
-
const RETRYABLE_MODEL_OR_RATE_LIMIT_OR_DISCONNECT_REGEX = /model error|model_not_found|model is not supported|429|rate.?limit|too many requests|quota.?exceeded|resource.?exhausted|stream disconnected|transport closed|econnreset|epipe/i;
|
|
55
|
-
/**
|
|
56
|
-
* Compute exponential backoff delay with jitter for rate limit retries.
|
|
57
|
-
* Returns delay in ms: min(initialDelay * 2^attempt, maxDelay) * random(0.5, 1.0)
|
|
58
|
-
*/
|
|
59
|
-
export function computeBackoffDelay(attempt, initialDelay = RATE_LIMIT_INITIAL_DELAY, maxDelay = RATE_LIMIT_MAX_DELAY) {
|
|
60
|
-
const exponential = initialDelay * Math.pow(2, attempt);
|
|
61
|
-
const capped = Math.min(exponential, maxDelay);
|
|
62
|
-
const jitter = capped * (0.5 + Math.random() * 0.5);
|
|
63
|
-
return Math.round(jitter);
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Sleep for the specified duration. Exported for test mockability.
|
|
67
|
-
*/
|
|
68
|
-
export function sleep(ms) {
|
|
69
|
-
return new Promise(resolve => setTimeout(resolve, ms));
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Check if Codex JSONL output contains a model-not-found error
|
|
73
|
-
*/
|
|
74
|
-
export function isModelError(output) {
|
|
75
|
-
const lines = output.trim().split('\n').filter(l => l.trim());
|
|
76
|
-
for (const line of lines) {
|
|
77
|
-
try {
|
|
78
|
-
const event = JSON.parse(line);
|
|
79
|
-
if (event.type === 'error' || event.type === 'turn.failed') {
|
|
80
|
-
const msg = typeof event.message === 'string' ? event.message :
|
|
81
|
-
typeof event.error?.message === 'string' ? event.error.message : '';
|
|
82
|
-
if (/model_not_found|model is not supported/i.test(msg)) {
|
|
83
|
-
return { isError: true, message: msg };
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
catch { /* skip non-JSON lines */ }
|
|
88
|
-
}
|
|
89
|
-
return { isError: false, message: '' };
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Check if an error message or output indicates a rate-limit (429) error
|
|
93
|
-
* that should trigger a fallback to the next model in the chain.
|
|
94
|
-
*/
|
|
95
|
-
export function isRateLimitError(output, stderr = '') {
|
|
96
|
-
const combined = `${output}\n${stderr}`;
|
|
97
|
-
// Check for 429/rate-limit and transport disconnect signatures in stdout/stderr
|
|
98
|
-
if (RATE_LIMIT_OR_DISCONNECT_REGEX.test(combined)) {
|
|
99
|
-
// Extract a meaningful message
|
|
100
|
-
const lines = combined.split('\n').filter(l => l.trim());
|
|
101
|
-
for (const line of lines) {
|
|
102
|
-
try {
|
|
103
|
-
const event = JSON.parse(line);
|
|
104
|
-
const msg = typeof event.message === 'string' ? event.message :
|
|
105
|
-
typeof event.error?.message === 'string' ? event.error.message : '';
|
|
106
|
-
if (RATE_LIMIT_OR_DISCONNECT_REGEX.test(msg)) {
|
|
107
|
-
return { isError: true, message: msg };
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
catch { /* check raw line */ }
|
|
111
|
-
if (RATE_LIMIT_OR_DISCONNECT_REGEX.test(line)) {
|
|
112
|
-
return { isError: true, message: line.trim() };
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
return { isError: true, message: 'Retryable rate-limit/transport error detected' };
|
|
116
|
-
}
|
|
117
|
-
return { isError: false, message: '' };
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Check if an error is retryable (model error OR rate limit error)
|
|
121
|
-
*/
|
|
122
|
-
export function isRetryableError(output, stderr = '') {
|
|
123
|
-
const modelErr = isModelError(output);
|
|
124
|
-
if (modelErr.isError) {
|
|
125
|
-
return { isError: true, message: modelErr.message, type: 'model' };
|
|
126
|
-
}
|
|
127
|
-
const rateErr = isRateLimitError(output, stderr);
|
|
128
|
-
if (rateErr.isError) {
|
|
129
|
-
return { isError: true, message: rateErr.message, type: 'rate_limit' };
|
|
130
|
-
}
|
|
131
|
-
return { isError: false, message: '', type: 'none' };
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Parse Codex JSONL output to extract the final text response
|
|
135
|
-
*
|
|
136
|
-
* Codex CLI (--json mode) emits JSONL events. We extract text from:
|
|
137
|
-
* - item.completed with item.type === "agent_message" (final response text)
|
|
138
|
-
* - message events with content (string or array of {type: "text", text})
|
|
139
|
-
* - output_text events with text
|
|
140
|
-
*
|
|
141
|
-
* Note: Codex may also write to the output_file directly via shell commands.
|
|
142
|
-
* If it does, callers should prefer the file content over parsed stdout.
|
|
143
|
-
*/
|
|
144
|
-
export function parseCodexOutput(output) {
|
|
145
|
-
const lines = output.trim().split('\n').filter(l => l.trim());
|
|
146
|
-
const messages = [];
|
|
147
|
-
for (const line of lines) {
|
|
148
|
-
try {
|
|
149
|
-
const event = JSON.parse(line);
|
|
150
|
-
// Handle item.completed events (primary format from current Codex CLI)
|
|
151
|
-
if (event.type === 'item.completed' && event.item) {
|
|
152
|
-
const item = event.item;
|
|
153
|
-
// agent_message contains the final response text
|
|
154
|
-
if (item.type === 'agent_message' && item.text) {
|
|
155
|
-
messages.push(item.text);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
// Handle message events with text content (older/alternative format)
|
|
159
|
-
if (event.type === 'message' && event.content) {
|
|
160
|
-
if (typeof event.content === 'string') {
|
|
161
|
-
messages.push(event.content);
|
|
162
|
-
}
|
|
163
|
-
else if (Array.isArray(event.content)) {
|
|
164
|
-
for (const part of event.content) {
|
|
165
|
-
if (part.type === 'text' && part.text) {
|
|
166
|
-
messages.push(part.text);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
// Handle output_text events
|
|
172
|
-
if (event.type === 'output_text' && event.text) {
|
|
173
|
-
messages.push(event.text);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
catch {
|
|
177
|
-
// Skip non-JSON lines (progress indicators, etc.)
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
return messages.join('\n') || output; // Fallback to raw output
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Execute Codex CLI command and return the response
|
|
184
|
-
*/
|
|
185
|
-
export function executeCodex(prompt, model, cwd, reasoningEffort) {
|
|
186
|
-
return new Promise((resolve, reject) => {
|
|
187
|
-
validateModelName(model);
|
|
188
|
-
let settled = false;
|
|
189
|
-
const args = ['exec', '-m', model, '--json', '--full-auto', '--skip-git-repo-check'];
|
|
190
|
-
// Per-call reasoning effort override via Codex CLI -c flag
|
|
191
|
-
if (reasoningEffort && VALID_REASONING_EFFORTS.includes(reasoningEffort)) {
|
|
192
|
-
args.push('-c', `model_reasoning_effort="${reasoningEffort}"`);
|
|
193
|
-
}
|
|
194
|
-
const child = spawn('codex', args, {
|
|
195
|
-
stdio: ['pipe', 'pipe', 'pipe'],
|
|
196
|
-
...(cwd ? { cwd } : {}),
|
|
197
|
-
// shell: true needed on Windows for .cmd/.bat executables.
|
|
198
|
-
// Safe: args are array-based and model names are regex-validated.
|
|
199
|
-
...(process.platform === 'win32' ? { shell: true } : {})
|
|
200
|
-
});
|
|
201
|
-
// Manual timeout handling to ensure proper cleanup
|
|
202
|
-
const timeoutHandle = setTimeout(() => {
|
|
203
|
-
if (!settled) {
|
|
204
|
-
settled = true;
|
|
205
|
-
child.kill('SIGTERM');
|
|
206
|
-
reject(new Error(`Codex timed out after ${CODEX_TIMEOUT}ms`));
|
|
207
|
-
}
|
|
208
|
-
}, CODEX_TIMEOUT);
|
|
209
|
-
const collector = createStdoutCollector(MAX_STDOUT_BYTES);
|
|
210
|
-
let stderr = '';
|
|
211
|
-
child.stdout.on('data', (data) => {
|
|
212
|
-
collector.append(data.toString());
|
|
213
|
-
});
|
|
214
|
-
child.stderr.on('data', (data) => {
|
|
215
|
-
stderr += data.toString();
|
|
216
|
-
});
|
|
217
|
-
child.on('close', (code) => {
|
|
218
|
-
if (!settled) {
|
|
219
|
-
settled = true;
|
|
220
|
-
clearTimeout(timeoutHandle);
|
|
221
|
-
const stdout = collector.toString();
|
|
222
|
-
if (code === 0 || stdout.trim()) {
|
|
223
|
-
const retryable = isRetryableError(stdout, stderr);
|
|
224
|
-
if (retryable.isError) {
|
|
225
|
-
reject(new Error(`Codex ${retryable.type === 'rate_limit' ? 'rate limit' : 'model'} error: ${retryable.message}`));
|
|
226
|
-
}
|
|
227
|
-
else {
|
|
228
|
-
resolve(parseCodexOutput(stdout));
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
else {
|
|
232
|
-
// Check stderr for rate limit errors before generic failure
|
|
233
|
-
const retryableExit = isRateLimitError(stderr, stdout);
|
|
234
|
-
if (retryableExit.isError) {
|
|
235
|
-
reject(new Error(`Codex rate limit error: ${retryableExit.message}`));
|
|
236
|
-
}
|
|
237
|
-
else {
|
|
238
|
-
reject(new Error(`Codex exited with code ${code}: ${stderr || 'No output'}`));
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
});
|
|
243
|
-
child.on('error', (err) => {
|
|
244
|
-
if (!settled) {
|
|
245
|
-
settled = true;
|
|
246
|
-
clearTimeout(timeoutHandle);
|
|
247
|
-
child.kill('SIGTERM');
|
|
248
|
-
reject(new Error(`Failed to spawn Codex CLI: ${err.message}`));
|
|
249
|
-
}
|
|
250
|
-
});
|
|
251
|
-
// Pipe prompt via stdin with error handling
|
|
252
|
-
child.stdin.on('error', (err) => {
|
|
253
|
-
if (!settled) {
|
|
254
|
-
settled = true;
|
|
255
|
-
clearTimeout(timeoutHandle);
|
|
256
|
-
child.kill('SIGTERM');
|
|
257
|
-
reject(new Error(`Stdin write error: ${err.message}`));
|
|
258
|
-
}
|
|
259
|
-
});
|
|
260
|
-
child.stdin.write(prompt);
|
|
261
|
-
child.stdin.end();
|
|
262
|
-
});
|
|
263
|
-
}
|
|
264
|
-
/**
|
|
265
|
-
* Execute Codex CLI with model fallback chain and exponential backoff on rate limits.
|
|
266
|
-
* Falls back on model_not_found or rate limit errors when model was not explicitly provided.
|
|
267
|
-
* When model IS explicit, retries the same model with backoff on rate limit.
|
|
268
|
-
*/
|
|
269
|
-
export async function executeCodexWithFallback(prompt, model, cwd, fallbackChain,
|
|
270
|
-
/** @internal Testing overrides */
|
|
271
|
-
overrides, reasoningEffort) {
|
|
272
|
-
const exec = overrides?.executor ?? executeCodex;
|
|
273
|
-
const sleepFn = overrides?.sleepFn ?? sleep;
|
|
274
|
-
const modelExplicit = model !== undefined && model !== null && model !== '';
|
|
275
|
-
const effectiveModel = model || CODEX_DEFAULT_MODEL;
|
|
276
|
-
// If model was explicitly provided, retry with backoff on rate limit (no fallback chain)
|
|
277
|
-
if (modelExplicit) {
|
|
278
|
-
let lastError = null;
|
|
279
|
-
for (let attempt = 0; attempt <= RATE_LIMIT_RETRY_COUNT; attempt++) {
|
|
280
|
-
try {
|
|
281
|
-
const response = await exec(prompt, effectiveModel, cwd, reasoningEffort);
|
|
282
|
-
return { response, usedFallback: false, actualModel: effectiveModel };
|
|
283
|
-
}
|
|
284
|
-
catch (err) {
|
|
285
|
-
lastError = err;
|
|
286
|
-
if (!RATE_LIMIT_OR_DISCONNECT_REGEX.test(lastError.message)) {
|
|
287
|
-
throw lastError; // Non-rate-limit error, throw immediately
|
|
288
|
-
}
|
|
289
|
-
if (attempt < RATE_LIMIT_RETRY_COUNT) {
|
|
290
|
-
const delay = computeBackoffDelay(attempt, RATE_LIMIT_INITIAL_DELAY, RATE_LIMIT_MAX_DELAY);
|
|
291
|
-
await sleepFn(delay);
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
throw lastError || new Error('Codex rate limit: all retries exhausted');
|
|
296
|
-
}
|
|
297
|
-
// Use provided fallback chain or build from defaults
|
|
298
|
-
const chain = fallbackChain || CODEX_MODEL_FALLBACKS;
|
|
299
|
-
const modelsToTry = chain.includes(effectiveModel)
|
|
300
|
-
? chain.slice(chain.indexOf(effectiveModel))
|
|
301
|
-
: [effectiveModel, ...chain];
|
|
302
|
-
let lastError = null;
|
|
303
|
-
let rateLimitAttempt = 0;
|
|
304
|
-
for (const tryModel of modelsToTry) {
|
|
305
|
-
try {
|
|
306
|
-
const response = await exec(prompt, tryModel, cwd, reasoningEffort);
|
|
307
|
-
return {
|
|
308
|
-
response,
|
|
309
|
-
usedFallback: tryModel !== effectiveModel,
|
|
310
|
-
actualModel: tryModel,
|
|
311
|
-
};
|
|
312
|
-
}
|
|
313
|
-
catch (err) {
|
|
314
|
-
lastError = err;
|
|
315
|
-
// Retry on model errors and rate limit errors
|
|
316
|
-
if (!RETRYABLE_MODEL_OR_RATE_LIMIT_OR_DISCONNECT_REGEX.test(lastError.message)) {
|
|
317
|
-
throw lastError; // Non-retryable error, don't retry
|
|
318
|
-
}
|
|
319
|
-
// Add backoff delay for rate limit errors before trying next model
|
|
320
|
-
if (RATE_LIMIT_OR_DISCONNECT_REGEX.test(lastError.message)) {
|
|
321
|
-
const delay = computeBackoffDelay(rateLimitAttempt, RATE_LIMIT_INITIAL_DELAY, RATE_LIMIT_MAX_DELAY);
|
|
322
|
-
await sleepFn(delay);
|
|
323
|
-
rateLimitAttempt++;
|
|
324
|
-
}
|
|
325
|
-
// Continue to next model in chain (no delay for model errors)
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
throw lastError || new Error('All Codex models in fallback chain failed');
|
|
329
|
-
}
|
|
330
|
-
/**
|
|
331
|
-
* Execute Codex CLI in background with fallback chain, writing status and response files upon completion
|
|
332
|
-
*/
|
|
333
|
-
export function executeCodexBackground(fullPrompt, modelInput, jobMeta, workingDirectory, reasoningEffort) {
|
|
334
|
-
try {
|
|
335
|
-
const modelExplicit = modelInput !== undefined && modelInput !== null && modelInput !== '';
|
|
336
|
-
const effectiveModel = modelInput || CODEX_DEFAULT_MODEL;
|
|
337
|
-
// Build fallback chain
|
|
338
|
-
const modelsToTry = modelExplicit
|
|
339
|
-
? [effectiveModel] // No fallback if model explicitly provided
|
|
340
|
-
: (CODEX_MODEL_FALLBACKS.includes(effectiveModel)
|
|
341
|
-
? CODEX_MODEL_FALLBACKS.slice(CODEX_MODEL_FALLBACKS.indexOf(effectiveModel))
|
|
342
|
-
: [effectiveModel, ...CODEX_MODEL_FALLBACKS]);
|
|
343
|
-
// Helper to try spawning with a specific model
|
|
344
|
-
const trySpawnWithModel = (tryModel, remainingModels, rateLimitAttempt = 0) => {
|
|
345
|
-
validateModelName(tryModel);
|
|
346
|
-
const args = ['exec', '-m', tryModel, '--json', '--full-auto', '--skip-git-repo-check'];
|
|
347
|
-
// Per-call reasoning effort override for background execution
|
|
348
|
-
if (reasoningEffort && VALID_REASONING_EFFORTS.includes(reasoningEffort)) {
|
|
349
|
-
args.push('-c', `model_reasoning_effort="${reasoningEffort}"`);
|
|
350
|
-
}
|
|
351
|
-
const child = spawn('codex', args, {
|
|
352
|
-
detached: process.platform !== 'win32',
|
|
353
|
-
stdio: ['pipe', 'pipe', 'pipe'],
|
|
354
|
-
...(workingDirectory ? { cwd: workingDirectory } : {}),
|
|
355
|
-
// shell: true needed on Windows for .cmd/.bat executables.
|
|
356
|
-
// Safe: args are array-based and model names are regex-validated.
|
|
357
|
-
...(process.platform === 'win32' ? { shell: true } : {})
|
|
358
|
-
});
|
|
359
|
-
if (!child.pid) {
|
|
360
|
-
return { error: 'Failed to get process ID' };
|
|
361
|
-
}
|
|
362
|
-
const pid = child.pid;
|
|
363
|
-
spawnedPids.add(pid);
|
|
364
|
-
child.unref();
|
|
365
|
-
// Write initial spawned status
|
|
366
|
-
const initialStatus = {
|
|
367
|
-
provider: 'codex',
|
|
368
|
-
jobId: jobMeta.jobId,
|
|
369
|
-
slug: jobMeta.slug,
|
|
370
|
-
status: 'spawned',
|
|
371
|
-
pid,
|
|
372
|
-
promptFile: jobMeta.promptFile,
|
|
373
|
-
responseFile: jobMeta.responseFile,
|
|
374
|
-
model: tryModel,
|
|
375
|
-
agentRole: jobMeta.agentRole,
|
|
376
|
-
spawnedAt: new Date().toISOString(),
|
|
377
|
-
};
|
|
378
|
-
writeJobStatus(initialStatus, workingDirectory);
|
|
379
|
-
const collector = createStdoutCollector(MAX_STDOUT_BYTES);
|
|
380
|
-
const partialFile = jobMeta.responseFile + '.partial';
|
|
381
|
-
let stderr = '';
|
|
382
|
-
let settled = false;
|
|
383
|
-
const cleanupPartial = () => {
|
|
384
|
-
try {
|
|
385
|
-
if (existsSync(partialFile))
|
|
386
|
-
unlinkSync(partialFile);
|
|
387
|
-
}
|
|
388
|
-
catch { /* ignore */ }
|
|
389
|
-
};
|
|
390
|
-
const timeoutHandle = setTimeout(() => {
|
|
391
|
-
if (!settled) {
|
|
392
|
-
settled = true;
|
|
393
|
-
spawnedPids.delete(pid);
|
|
394
|
-
try {
|
|
395
|
-
// Detached children are process-group leaders on POSIX.
|
|
396
|
-
if (process.platform !== 'win32')
|
|
397
|
-
process.kill(-pid, 'SIGTERM');
|
|
398
|
-
else
|
|
399
|
-
child.kill('SIGTERM');
|
|
400
|
-
}
|
|
401
|
-
catch {
|
|
402
|
-
// ignore
|
|
403
|
-
}
|
|
404
|
-
cleanupPartial();
|
|
405
|
-
writeJobStatus({
|
|
406
|
-
...initialStatus,
|
|
407
|
-
status: 'timeout',
|
|
408
|
-
completedAt: new Date().toISOString(),
|
|
409
|
-
error: `Codex timed out after ${CODEX_TIMEOUT}ms`,
|
|
410
|
-
}, workingDirectory);
|
|
411
|
-
}
|
|
412
|
-
}, CODEX_TIMEOUT);
|
|
413
|
-
child.stdout?.on('data', (data) => {
|
|
414
|
-
collector.append(data.toString());
|
|
415
|
-
try {
|
|
416
|
-
appendFileSync(partialFile, data);
|
|
417
|
-
}
|
|
418
|
-
catch { /* ignore */ }
|
|
419
|
-
});
|
|
420
|
-
child.stderr?.on('data', (data) => { stderr += data.toString(); });
|
|
421
|
-
// Update to running after stdin write
|
|
422
|
-
child.stdin?.on('error', (err) => {
|
|
423
|
-
if (settled)
|
|
424
|
-
return;
|
|
425
|
-
settled = true;
|
|
426
|
-
clearTimeout(timeoutHandle);
|
|
427
|
-
cleanupPartial();
|
|
428
|
-
writeJobStatus({
|
|
429
|
-
...initialStatus,
|
|
430
|
-
status: 'failed',
|
|
431
|
-
completedAt: new Date().toISOString(),
|
|
432
|
-
error: `Stdin write error: ${err.message}`,
|
|
433
|
-
}, workingDirectory);
|
|
434
|
-
});
|
|
435
|
-
child.stdin?.write(fullPrompt);
|
|
436
|
-
child.stdin?.end();
|
|
437
|
-
writeJobStatus({ ...initialStatus, status: 'running' }, workingDirectory);
|
|
438
|
-
child.on('close', (code) => {
|
|
439
|
-
if (settled)
|
|
440
|
-
return;
|
|
441
|
-
settled = true;
|
|
442
|
-
clearTimeout(timeoutHandle);
|
|
443
|
-
spawnedPids.delete(pid);
|
|
444
|
-
cleanupPartial();
|
|
445
|
-
const stdout = collector.toString();
|
|
446
|
-
// Check if user killed this job - if so, don't overwrite the killed status
|
|
447
|
-
const currentStatus = readJobStatus('codex', jobMeta.slug, jobMeta.jobId, workingDirectory);
|
|
448
|
-
if (currentStatus?.killedByUser) {
|
|
449
|
-
return; // Status already set by kill_job, don't overwrite
|
|
450
|
-
}
|
|
451
|
-
if (code === 0 || stdout.trim()) {
|
|
452
|
-
// Check for retryable errors (model errors + rate limit/429 errors)
|
|
453
|
-
const retryableErr = isRetryableError(stdout, stderr);
|
|
454
|
-
if (retryableErr.isError) {
|
|
455
|
-
const isRateLimit = retryableErr.type === 'rate_limit';
|
|
456
|
-
// Rate limit with explicit model: retry same model with backoff
|
|
457
|
-
if (isRateLimit && modelExplicit && rateLimitAttempt < RATE_LIMIT_RETRY_COUNT) {
|
|
458
|
-
const delay = computeBackoffDelay(rateLimitAttempt, RATE_LIMIT_INITIAL_DELAY, RATE_LIMIT_MAX_DELAY);
|
|
459
|
-
setTimeout(() => {
|
|
460
|
-
const retryResult = trySpawnWithModel(tryModel, remainingModels, rateLimitAttempt + 1);
|
|
461
|
-
if ('error' in retryResult) {
|
|
462
|
-
writeJobStatus({
|
|
463
|
-
...initialStatus,
|
|
464
|
-
status: 'failed',
|
|
465
|
-
completedAt: new Date().toISOString(),
|
|
466
|
-
error: `Rate limit retry failed for model ${tryModel}: ${retryResult.error}`,
|
|
467
|
-
}, workingDirectory);
|
|
468
|
-
}
|
|
469
|
-
}, delay);
|
|
470
|
-
return;
|
|
471
|
-
}
|
|
472
|
-
// Fallback chain: try next model (with backoff for rate limit, immediate for model errors)
|
|
473
|
-
if (remainingModels.length > 0) {
|
|
474
|
-
const nextModel = remainingModels[0];
|
|
475
|
-
const newRemainingModels = remainingModels.slice(1);
|
|
476
|
-
if (isRateLimit) {
|
|
477
|
-
const delay = computeBackoffDelay(rateLimitAttempt, RATE_LIMIT_INITIAL_DELAY, RATE_LIMIT_MAX_DELAY);
|
|
478
|
-
setTimeout(() => {
|
|
479
|
-
const retryResult = trySpawnWithModel(nextModel, newRemainingModels, rateLimitAttempt + 1);
|
|
480
|
-
if ('error' in retryResult) {
|
|
481
|
-
writeJobStatus({
|
|
482
|
-
...initialStatus,
|
|
483
|
-
status: 'failed',
|
|
484
|
-
completedAt: new Date().toISOString(),
|
|
485
|
-
error: `Fallback spawn failed for model ${nextModel}: ${retryResult.error}`,
|
|
486
|
-
}, workingDirectory);
|
|
487
|
-
}
|
|
488
|
-
}, delay);
|
|
489
|
-
}
|
|
490
|
-
else {
|
|
491
|
-
const retryResult = trySpawnWithModel(nextModel, newRemainingModels, rateLimitAttempt);
|
|
492
|
-
if ('error' in retryResult) {
|
|
493
|
-
writeJobStatus({
|
|
494
|
-
...initialStatus,
|
|
495
|
-
status: 'failed',
|
|
496
|
-
completedAt: new Date().toISOString(),
|
|
497
|
-
error: `Fallback spawn failed for model ${nextModel}: ${retryResult.error}`,
|
|
498
|
-
}, workingDirectory);
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
return;
|
|
502
|
-
}
|
|
503
|
-
// No remaining models and no retries left
|
|
504
|
-
writeJobStatus({
|
|
505
|
-
...initialStatus,
|
|
506
|
-
status: 'failed',
|
|
507
|
-
completedAt: new Date().toISOString(),
|
|
508
|
-
error: `All models in fallback chain failed. Last error (${retryableErr.type}): ${retryableErr.message}`,
|
|
509
|
-
}, workingDirectory);
|
|
510
|
-
return;
|
|
511
|
-
}
|
|
512
|
-
const response = parseCodexOutput(stdout);
|
|
513
|
-
const usedFallback = tryModel !== effectiveModel;
|
|
514
|
-
persistResponse({
|
|
515
|
-
provider: 'codex',
|
|
516
|
-
agentRole: jobMeta.agentRole,
|
|
517
|
-
model: tryModel,
|
|
518
|
-
promptId: jobMeta.jobId,
|
|
519
|
-
slug: jobMeta.slug,
|
|
520
|
-
response,
|
|
521
|
-
workingDirectory,
|
|
522
|
-
usedFallback,
|
|
523
|
-
fallbackModel: usedFallback ? tryModel : undefined,
|
|
524
|
-
});
|
|
525
|
-
writeJobStatus({
|
|
526
|
-
...initialStatus,
|
|
527
|
-
model: tryModel,
|
|
528
|
-
status: 'completed',
|
|
529
|
-
completedAt: new Date().toISOString(),
|
|
530
|
-
usedFallback: usedFallback || undefined,
|
|
531
|
-
fallbackModel: usedFallback ? tryModel : undefined,
|
|
532
|
-
}, workingDirectory);
|
|
533
|
-
}
|
|
534
|
-
else {
|
|
535
|
-
// Check if the failure is a retryable error (429/rate limit) before giving up
|
|
536
|
-
const retryableExit = isRetryableError(stderr, stdout);
|
|
537
|
-
if (retryableExit.isError) {
|
|
538
|
-
const isRateLimit = retryableExit.type === 'rate_limit';
|
|
539
|
-
// Rate limit with explicit model: retry same model with backoff
|
|
540
|
-
if (isRateLimit && modelExplicit && rateLimitAttempt < RATE_LIMIT_RETRY_COUNT) {
|
|
541
|
-
const delay = computeBackoffDelay(rateLimitAttempt, RATE_LIMIT_INITIAL_DELAY, RATE_LIMIT_MAX_DELAY);
|
|
542
|
-
setTimeout(() => {
|
|
543
|
-
const retryResult = trySpawnWithModel(tryModel, remainingModels, rateLimitAttempt + 1);
|
|
544
|
-
if ('error' in retryResult) {
|
|
545
|
-
writeJobStatus({
|
|
546
|
-
...initialStatus,
|
|
547
|
-
status: 'failed',
|
|
548
|
-
completedAt: new Date().toISOString(),
|
|
549
|
-
error: `Rate limit retry failed for model ${tryModel}: ${retryResult.error}`,
|
|
550
|
-
}, workingDirectory);
|
|
551
|
-
}
|
|
552
|
-
}, delay);
|
|
553
|
-
return;
|
|
554
|
-
}
|
|
555
|
-
// Fallback chain: try next model (with backoff for rate limit, immediate for model errors)
|
|
556
|
-
if (remainingModels.length > 0) {
|
|
557
|
-
const nextModel = remainingModels[0];
|
|
558
|
-
const newRemainingModels = remainingModels.slice(1);
|
|
559
|
-
if (isRateLimit) {
|
|
560
|
-
const delay = computeBackoffDelay(rateLimitAttempt, RATE_LIMIT_INITIAL_DELAY, RATE_LIMIT_MAX_DELAY);
|
|
561
|
-
setTimeout(() => {
|
|
562
|
-
const retryResult = trySpawnWithModel(nextModel, newRemainingModels, rateLimitAttempt + 1);
|
|
563
|
-
if ('error' in retryResult) {
|
|
564
|
-
writeJobStatus({
|
|
565
|
-
...initialStatus,
|
|
566
|
-
status: 'failed',
|
|
567
|
-
completedAt: new Date().toISOString(),
|
|
568
|
-
error: `Fallback spawn failed for model ${nextModel}: ${retryResult.error}`,
|
|
569
|
-
}, workingDirectory);
|
|
570
|
-
}
|
|
571
|
-
}, delay);
|
|
572
|
-
}
|
|
573
|
-
else {
|
|
574
|
-
const retryResult = trySpawnWithModel(nextModel, newRemainingModels, rateLimitAttempt);
|
|
575
|
-
if ('error' in retryResult) {
|
|
576
|
-
writeJobStatus({
|
|
577
|
-
...initialStatus,
|
|
578
|
-
status: 'failed',
|
|
579
|
-
completedAt: new Date().toISOString(),
|
|
580
|
-
error: `Fallback spawn failed for model ${nextModel}: ${retryResult.error}`,
|
|
581
|
-
}, workingDirectory);
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
return;
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
writeJobStatus({
|
|
588
|
-
...initialStatus,
|
|
589
|
-
status: 'failed',
|
|
590
|
-
completedAt: new Date().toISOString(),
|
|
591
|
-
error: `Codex exited with code ${code}: ${stderr || 'No output'}`,
|
|
592
|
-
}, workingDirectory);
|
|
593
|
-
}
|
|
594
|
-
});
|
|
595
|
-
child.on('error', (err) => {
|
|
596
|
-
if (settled)
|
|
597
|
-
return;
|
|
598
|
-
settled = true;
|
|
599
|
-
clearTimeout(timeoutHandle);
|
|
600
|
-
cleanupPartial();
|
|
601
|
-
writeJobStatus({
|
|
602
|
-
...initialStatus,
|
|
603
|
-
status: 'failed',
|
|
604
|
-
completedAt: new Date().toISOString(),
|
|
605
|
-
error: `Failed to spawn Codex CLI: ${err.message}`,
|
|
606
|
-
}, workingDirectory);
|
|
607
|
-
});
|
|
608
|
-
return { pid };
|
|
609
|
-
};
|
|
610
|
-
// Start execution with the first model in the chain
|
|
611
|
-
return trySpawnWithModel(modelsToTry[0], modelsToTry.slice(1));
|
|
612
|
-
}
|
|
613
|
-
catch (err) {
|
|
614
|
-
return { error: `Failed to start background execution: ${err.message}` };
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
/**
|
|
618
|
-
* Handle ask_codex tool invocation with all business logic
|
|
619
|
-
*
|
|
620
|
-
* This function contains ALL the tool handler logic and can be used by both
|
|
621
|
-
* the SDK server and the standalone stdio server.
|
|
622
|
-
*/
|
|
623
|
-
export async function handleAskCodex(args) {
|
|
624
|
-
if (!args || typeof args !== 'object' || Array.isArray(args)) {
|
|
625
|
-
return singleErrorBlock('Invalid request: args must be an object.');
|
|
626
|
-
}
|
|
627
|
-
const { agent_role, context_files } = args;
|
|
628
|
-
// Resolve reasoning effort: explicit parameter takes precedence, otherwise omit (use CLI default)
|
|
629
|
-
const resolvedEffort = typeof args.reasoning_effort === 'string' && VALID_REASONING_EFFORTS.includes(args.reasoning_effort)
|
|
630
|
-
? args.reasoning_effort
|
|
631
|
-
: undefined;
|
|
632
|
-
// Resolve model based on configuration and agent role
|
|
633
|
-
const config = loadConfig();
|
|
634
|
-
const resolved = resolveExternalModel(config.externalModels, {
|
|
635
|
-
agentRole: args.agent_role,
|
|
636
|
-
explicitProvider: 'codex',
|
|
637
|
-
explicitModel: args.model, // user explicitly passed model
|
|
638
|
-
});
|
|
639
|
-
// Build fallback chain with resolved model as first candidate
|
|
640
|
-
const fallbackChain = buildFallbackChain('codex', resolved.model, config.externalModels);
|
|
641
|
-
// Use resolved model (with env var fallback for backward compatibility)
|
|
642
|
-
const model = resolved.model || CODEX_DEFAULT_MODEL;
|
|
643
|
-
// Derive baseDir from working_directory if provided
|
|
644
|
-
let baseDir = args.working_directory || process.cwd();
|
|
645
|
-
let baseDirReal;
|
|
646
|
-
const pathPolicy = process.env.OMC_ALLOW_EXTERNAL_WORKDIR === '1' ? 'permissive' : 'strict';
|
|
647
|
-
try {
|
|
648
|
-
baseDirReal = realpathSync(baseDir);
|
|
649
|
-
baseDir = baseDirReal;
|
|
650
|
-
}
|
|
651
|
-
catch (err) {
|
|
652
|
-
const errorToken = 'E_WORKDIR_INVALID';
|
|
653
|
-
return singleErrorBlock(`${errorToken}: working_directory '${args.working_directory}' does not exist or is not accessible.
|
|
654
|
-
Error: ${err.message}
|
|
655
|
-
Resolved working directory: ${baseDir}
|
|
656
|
-
Path policy: ${pathPolicy}
|
|
657
|
-
Suggested: ensure the working directory exists and is accessible`);
|
|
658
|
-
}
|
|
659
|
-
// Security: validate working_directory is within worktree (unless bypass enabled)
|
|
660
|
-
if (pathPolicy === 'strict') {
|
|
661
|
-
const worktreeRoot = getWorktreeRoot(baseDirReal);
|
|
662
|
-
if (worktreeRoot) {
|
|
663
|
-
let worktreeReal;
|
|
664
|
-
try {
|
|
665
|
-
worktreeReal = realpathSync(worktreeRoot);
|
|
666
|
-
}
|
|
667
|
-
catch {
|
|
668
|
-
// If worktree root can't be resolved, skip boundary check rather than break
|
|
669
|
-
worktreeReal = '';
|
|
670
|
-
}
|
|
671
|
-
if (worktreeReal) {
|
|
672
|
-
const relToWorktree = relative(worktreeReal, baseDirReal);
|
|
673
|
-
if (relToWorktree.startsWith('..') || isAbsolute(relToWorktree)) {
|
|
674
|
-
const errorToken = 'E_WORKDIR_INVALID';
|
|
675
|
-
return singleErrorBlock(`${errorToken}: working_directory '${args.working_directory}' is outside the project worktree (${worktreeRoot}).
|
|
676
|
-
Requested: ${args.working_directory}
|
|
677
|
-
Resolved working directory: ${baseDirReal}
|
|
678
|
-
Worktree root: ${worktreeRoot}
|
|
679
|
-
Path policy: ${pathPolicy}
|
|
680
|
-
Suggested: use a working_directory within the project worktree, or set OMC_ALLOW_EXTERNAL_WORKDIR=1 to bypass`);
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
}
|
|
684
|
-
}
|
|
685
|
-
// Validate agent_role - must be non-empty and pass character validation
|
|
686
|
-
if (typeof agent_role !== 'string' || !agent_role.trim()) {
|
|
687
|
-
return singleErrorBlock('agent_role is required and must be a non-empty string.');
|
|
688
|
-
}
|
|
689
|
-
if (!isValidAgentRoleName(agent_role)) {
|
|
690
|
-
return singleErrorBlock(`Invalid agent_role: "${agent_role}". Role names must contain only lowercase letters, numbers, and hyphens. Recommended for Codex: ${CODEX_RECOMMENDED_ROLES.join(', ')}`);
|
|
691
|
-
}
|
|
692
|
-
// Validate agent_role exists in discovered roles (allowlist enforcement)
|
|
693
|
-
if (!VALID_AGENT_ROLES.includes(agent_role)) {
|
|
694
|
-
return singleErrorBlock(`Unknown agent_role: "${agent_role}". Available roles: ${VALID_AGENT_ROLES.join(', ')}. Recommended for Codex: ${CODEX_RECOMMENDED_ROLES.join(', ')}`);
|
|
695
|
-
}
|
|
696
|
-
// Determine inline intent: caller provided `prompt` field without a defined `prompt_file` field.
|
|
697
|
-
// Defined-value precedence: if `prompt_file` key exists with a non-undefined value, file mode wins.
|
|
698
|
-
// This handles JSON-RPC serializers that emit `prompt_file: undefined` as "not provided".
|
|
699
|
-
// Separate intent detection (field presence) from content validation (non-empty).
|
|
700
|
-
const inlinePrompt = typeof args.prompt === 'string' ? args.prompt : undefined;
|
|
701
|
-
const hasPromptFileField = Object.prototype.hasOwnProperty.call(args, 'prompt_file') && args.prompt_file !== undefined;
|
|
702
|
-
const promptFileInput = hasPromptFileField && typeof args.prompt_file === 'string' ? args.prompt_file.trim() || undefined : undefined;
|
|
703
|
-
let resolvedPromptFile = promptFileInput;
|
|
704
|
-
let resolvedOutputFile = typeof args.output_file === 'string' ? args.output_file : undefined;
|
|
705
|
-
const hasInlineIntent = inlinePrompt !== undefined && !hasPromptFileField;
|
|
706
|
-
const isInlineMode = hasInlineIntent && inlinePrompt.trim().length > 0;
|
|
707
|
-
// Reject empty/whitespace inline prompt with explicit error BEFORE any side effects
|
|
708
|
-
if (hasInlineIntent && !inlinePrompt?.trim()) {
|
|
709
|
-
return singleErrorBlock('Inline prompt is empty. Provide a non-empty prompt string.');
|
|
710
|
-
}
|
|
711
|
-
// Reject oversized inline prompts before any persistence
|
|
712
|
-
const MAX_INLINE_PROMPT_BYTES = 256 * 1024; // 256 KB
|
|
713
|
-
if (isInlineMode && Buffer.byteLength(inlinePrompt, 'utf-8') > MAX_INLINE_PROMPT_BYTES) {
|
|
714
|
-
return singleErrorBlock(`Inline prompt exceeds maximum size (${MAX_INLINE_PROMPT_BYTES} bytes). Use prompt_file for large prompts.`);
|
|
715
|
-
}
|
|
716
|
-
// Inline mode is foreground only - check BEFORE any file persistence to avoid leaks
|
|
717
|
-
if (isInlineMode && args.background) {
|
|
718
|
-
return singleErrorBlock('Inline prompt mode is foreground only. Use prompt_file for background execution.');
|
|
719
|
-
}
|
|
720
|
-
// Explicit type error for non-string prompt_file (e.g., null, number, object)
|
|
721
|
-
if (hasPromptFileField && !promptFileInput) {
|
|
722
|
-
return singleErrorBlock('prompt_file must be a non-empty string when provided. Received non-string or empty value.');
|
|
723
|
-
}
|
|
724
|
-
let inlineRequestId;
|
|
725
|
-
// Handle inline prompt: auto-persist to file for audit trail
|
|
726
|
-
if (isInlineMode) {
|
|
727
|
-
inlineRequestId = generatePromptId();
|
|
728
|
-
try {
|
|
729
|
-
const promptsDir = getPromptsDir(baseDir);
|
|
730
|
-
mkdirSync(promptsDir, { recursive: true });
|
|
731
|
-
const slug = slugify(inlinePrompt);
|
|
732
|
-
const inlinePromptFile = join(promptsDir, `codex-inline-${slug}-${inlineRequestId}.md`);
|
|
733
|
-
writeFileSync(inlinePromptFile, inlinePrompt, { encoding: 'utf-8', mode: 0o600 });
|
|
734
|
-
const resolvedPromptFileLocal = inlinePromptFile;
|
|
735
|
-
const resolvedOutputFileLocal = (!resolvedOutputFile || !resolvedOutputFile.trim())
|
|
736
|
-
? join(promptsDir, `codex-inline-response-${slug}-${inlineRequestId}.md`)
|
|
737
|
-
: resolvedOutputFile;
|
|
738
|
-
resolvedPromptFile = resolvedPromptFileLocal;
|
|
739
|
-
resolvedOutputFile = resolvedOutputFileLocal;
|
|
740
|
-
}
|
|
741
|
-
catch (err) {
|
|
742
|
-
const reason = err instanceof Error ? err.message : 'unknown error';
|
|
743
|
-
return singleErrorBlock(`Failed to persist inline prompt (${reason}). Check working directory permissions and disk space.`);
|
|
744
|
-
}
|
|
745
|
-
}
|
|
746
|
-
// Validate that at least one prompt source is provided.
|
|
747
|
-
// Use type-guarded promptFileInput to avoid .trim() TypeError on non-string values.
|
|
748
|
-
const effectivePromptFile = resolvedPromptFile;
|
|
749
|
-
if (!effectivePromptFile || !effectivePromptFile.trim()) {
|
|
750
|
-
return singleErrorBlock("Either 'prompt' (inline) or 'prompt_file' (file path) is required.");
|
|
751
|
-
}
|
|
752
|
-
// output_file is required in file mode.
|
|
753
|
-
// Use typeof guard to avoid .trim() TypeError on non-string values.
|
|
754
|
-
const effectiveOutputFile = resolvedOutputFile;
|
|
755
|
-
if (!effectiveOutputFile || !effectiveOutputFile.trim()) {
|
|
756
|
-
return singleErrorBlock('output_file is required. Specify a path where the response should be written.');
|
|
757
|
-
}
|
|
758
|
-
// Resolve prompt from prompt_file (validated non-empty above)
|
|
759
|
-
let resolvedPrompt;
|
|
760
|
-
const promptFile = effectivePromptFile;
|
|
761
|
-
const resolvedPath = resolve(baseDir, promptFile);
|
|
762
|
-
const cwdReal = realpathSync(baseDir);
|
|
763
|
-
const relPath = relative(cwdReal, resolvedPath);
|
|
764
|
-
if (!isExternalPromptAllowed() && (relPath === '..' || relPath.startsWith('..' + sep) || isAbsolute(relPath))) {
|
|
765
|
-
const errorToken = 'E_PATH_OUTSIDE_WORKDIR_PROMPT';
|
|
766
|
-
return singleErrorBlock(`${errorToken}: prompt_file '${promptFile}' resolves outside working_directory '${baseDirReal}'.
|
|
767
|
-
Requested: ${promptFile}
|
|
768
|
-
Working directory: ${baseDirReal}
|
|
769
|
-
Resolved working directory: ${baseDirReal}
|
|
770
|
-
Path policy: ${pathPolicy}
|
|
771
|
-
Suggested: place the prompt file within the working directory or set working_directory to a common ancestor`);
|
|
772
|
-
}
|
|
773
|
-
// BEFORE reading, resolve symlinks and validate boundary
|
|
774
|
-
let resolvedReal;
|
|
775
|
-
try {
|
|
776
|
-
resolvedReal = realpathSync(resolvedPath);
|
|
777
|
-
}
|
|
778
|
-
catch (err) {
|
|
779
|
-
const errorToken = 'E_PATH_RESOLUTION_FAILED';
|
|
780
|
-
return singleErrorBlock(`${errorToken}: Failed to resolve prompt_file '${promptFile}'.
|
|
781
|
-
Error: ${err.message}
|
|
782
|
-
Resolved working directory: ${baseDirReal}
|
|
783
|
-
Path policy: ${pathPolicy}
|
|
784
|
-
Suggested: ensure the prompt file exists and is accessible`);
|
|
785
|
-
}
|
|
786
|
-
const relReal = relative(cwdReal, resolvedReal);
|
|
787
|
-
if (!isExternalPromptAllowed() && (relReal === '..' || relReal.startsWith('..' + sep) || isAbsolute(relReal))) {
|
|
788
|
-
const errorToken = 'E_PATH_OUTSIDE_WORKDIR_PROMPT';
|
|
789
|
-
return singleErrorBlock(`${errorToken}: prompt_file '${promptFile}' resolves to a path outside working_directory '${baseDirReal}'.
|
|
790
|
-
Requested: ${promptFile}
|
|
791
|
-
Resolved path: ${resolvedReal}
|
|
792
|
-
Working directory: ${baseDirReal}
|
|
793
|
-
Resolved working directory: ${baseDirReal}
|
|
794
|
-
Path policy: ${pathPolicy}
|
|
795
|
-
Suggested: place the prompt file within the working directory or set working_directory to a common ancestor`);
|
|
796
|
-
}
|
|
797
|
-
// Now safe to read from the validated real path
|
|
798
|
-
try {
|
|
799
|
-
resolvedPrompt = readFileSync(resolvedReal, 'utf-8');
|
|
800
|
-
}
|
|
801
|
-
catch (err) {
|
|
802
|
-
return singleErrorBlock(`Failed to read prompt_file '${promptFile}': ${err.message}`);
|
|
803
|
-
}
|
|
804
|
-
// Check for empty prompt
|
|
805
|
-
if (!resolvedPrompt.trim()) {
|
|
806
|
-
return singleErrorBlock(`prompt_file '${promptFile}' is empty.`);
|
|
807
|
-
}
|
|
808
|
-
// Add headless execution context so Codex produces comprehensive output
|
|
809
|
-
const userPrompt = `[HEADLESS SESSION] You are running non-interactively in a headless pipeline. Produce your FULL, comprehensive analysis directly in your response. Do NOT ask for clarification or confirmation - work thoroughly with all provided context. Do NOT write brief acknowledgments - your response IS the deliverable.
|
|
810
|
-
|
|
811
|
-
${resolvedPrompt}`;
|
|
812
|
-
// Check CLI availability
|
|
813
|
-
const detection = detectCodexCli();
|
|
814
|
-
if (!detection.available) {
|
|
815
|
-
return singleErrorBlock(`Codex CLI is not available: ${detection.error}\n\n${detection.installHint}`);
|
|
816
|
-
}
|
|
817
|
-
// Resolve system prompt from agent role
|
|
818
|
-
const resolvedSystemPrompt = resolveSystemPrompt(undefined, agent_role, 'codex');
|
|
819
|
-
// Build file context — validate paths first to prevent path traversal and prompt injection
|
|
820
|
-
let fileContext;
|
|
821
|
-
if (context_files && context_files.length > 0) {
|
|
822
|
-
const { validPaths, errors } = validateContextFilePaths(context_files, baseDirReal, isExternalPromptAllowed());
|
|
823
|
-
if (errors.length > 0) {
|
|
824
|
-
console.warn('[codex-core] context_files validation rejected paths:', errors.join('; '));
|
|
825
|
-
}
|
|
826
|
-
if (validPaths.length > 0) {
|
|
827
|
-
fileContext = `The following files are available for reference. Use your file tools to read them as needed:\n${validPaths.map(f => `- ${f}`).join('\n')}`;
|
|
828
|
-
}
|
|
829
|
-
}
|
|
830
|
-
// Combine: system prompt > file context > user prompt
|
|
831
|
-
const fullPrompt = buildPromptWithSystemContext(userPrompt, fileContext, resolvedSystemPrompt);
|
|
832
|
-
// Persist prompt for audit trail
|
|
833
|
-
const promptResult = persistPrompt({
|
|
834
|
-
provider: 'codex',
|
|
835
|
-
agentRole: agent_role,
|
|
836
|
-
model,
|
|
837
|
-
files: context_files,
|
|
838
|
-
prompt: resolvedPrompt,
|
|
839
|
-
fullPrompt,
|
|
840
|
-
workingDirectory: baseDir,
|
|
841
|
-
});
|
|
842
|
-
// Compute expected response path for immediate return
|
|
843
|
-
const expectedResponsePath = promptResult
|
|
844
|
-
? getExpectedResponsePath('codex', promptResult.slug, promptResult.id, baseDir)
|
|
845
|
-
: undefined;
|
|
846
|
-
// Background mode: return immediately with job metadata
|
|
847
|
-
if (args.background) {
|
|
848
|
-
if (!promptResult) {
|
|
849
|
-
return singleErrorBlock('Failed to persist prompt for background execution');
|
|
850
|
-
}
|
|
851
|
-
const statusFilePath = getStatusFilePath('codex', promptResult.slug, promptResult.id, baseDir);
|
|
852
|
-
const result = executeCodexBackground(fullPrompt, args.model, {
|
|
853
|
-
provider: 'codex',
|
|
854
|
-
jobId: promptResult.id,
|
|
855
|
-
slug: promptResult.slug,
|
|
856
|
-
agentRole: agent_role,
|
|
857
|
-
model: model, // This is the effective model for metadata
|
|
858
|
-
promptFile: promptResult.filePath,
|
|
859
|
-
responseFile: expectedResponsePath,
|
|
860
|
-
}, baseDir, resolvedEffort);
|
|
861
|
-
if ('error' in result) {
|
|
862
|
-
return singleErrorBlock(`Failed to spawn background job: ${result.error}`);
|
|
863
|
-
}
|
|
864
|
-
return {
|
|
865
|
-
content: [{
|
|
866
|
-
type: 'text',
|
|
867
|
-
text: [
|
|
868
|
-
`**Mode:** Background (non-blocking)`,
|
|
869
|
-
`**Job ID:** ${promptResult.id}`,
|
|
870
|
-
`**Agent Role:** ${agent_role}`,
|
|
871
|
-
`**Model:** ${model}`,
|
|
872
|
-
`**PID:** ${result.pid}`,
|
|
873
|
-
`**Prompt File:** ${promptResult.filePath}`,
|
|
874
|
-
`**Response File:** ${expectedResponsePath}`,
|
|
875
|
-
`**Partial Output:** ${expectedResponsePath}.partial (tail -f to stream live)`,
|
|
876
|
-
`**Status File:** ${statusFilePath}`,
|
|
877
|
-
``,
|
|
878
|
-
`Job dispatched. Check response file existence or read status file for completion.`,
|
|
879
|
-
].join('\n')
|
|
880
|
-
}]
|
|
881
|
-
};
|
|
882
|
-
}
|
|
883
|
-
// Build parameter visibility block
|
|
884
|
-
const paramLines = [
|
|
885
|
-
`**Agent Role:** ${agent_role}`,
|
|
886
|
-
resolvedEffort ? `**Reasoning Effort:** ${resolvedEffort}` : null,
|
|
887
|
-
context_files?.length ? `**Files:** ${context_files.join(', ')}` : null,
|
|
888
|
-
promptResult ? `**Prompt File:** ${promptResult.filePath}` : null,
|
|
889
|
-
expectedResponsePath ? `**Response File:** ${expectedResponsePath}` : null,
|
|
890
|
-
`**Resolved Working Directory:** ${baseDirReal}`,
|
|
891
|
-
`**Path Policy:** ${pathPolicy}`,
|
|
892
|
-
].filter(Boolean).join('\n');
|
|
893
|
-
try {
|
|
894
|
-
const { response, usedFallback, actualModel } = await executeCodexWithFallback(fullPrompt, args.model, baseDir, fallbackChain, undefined, resolvedEffort);
|
|
895
|
-
// Persist response to disk (audit trail)
|
|
896
|
-
if (promptResult) {
|
|
897
|
-
persistResponse({
|
|
898
|
-
provider: 'codex',
|
|
899
|
-
agentRole: agent_role,
|
|
900
|
-
model: actualModel,
|
|
901
|
-
promptId: promptResult.id,
|
|
902
|
-
slug: promptResult.slug,
|
|
903
|
-
response,
|
|
904
|
-
workingDirectory: baseDir,
|
|
905
|
-
usedFallback,
|
|
906
|
-
fallbackModel: usedFallback ? actualModel : undefined,
|
|
907
|
-
});
|
|
908
|
-
}
|
|
909
|
-
// Always write parsed JSONL response to output_file.
|
|
910
|
-
// We no longer use -o (--output-last-message) because it only captures the
|
|
911
|
-
// last agent message, which may be a brief acknowledgment. The JSONL-parsed
|
|
912
|
-
// stdout contains ALL agent messages and is always more comprehensive.
|
|
913
|
-
if (effectiveOutputFile) {
|
|
914
|
-
const writeResult = safeWriteOutputFile(effectiveOutputFile, response, baseDirReal, '[codex-core]');
|
|
915
|
-
if (!writeResult.success) {
|
|
916
|
-
return singleErrorBlock(`${paramLines}\n\n---\n\n${writeResult.errorMessage}\n\nresolved_working_directory: ${baseDirReal}\npath_policy: ${pathPolicy}`);
|
|
917
|
-
}
|
|
918
|
-
}
|
|
919
|
-
const responseLines = [paramLines];
|
|
920
|
-
const fallbackLine = usedFallback ? `Fallback: used model ${actualModel}` : undefined;
|
|
921
|
-
if (fallbackLine) {
|
|
922
|
-
responseLines.push(fallbackLine);
|
|
923
|
-
}
|
|
924
|
-
// In inline mode, return metadata + raw response as separate content blocks
|
|
925
|
-
if (isInlineMode) {
|
|
926
|
-
responseLines.push(`**Request ID:** ${inlineRequestId}`);
|
|
927
|
-
const metadataText = responseLines.join('\n');
|
|
928
|
-
const wrappedResponse = wrapUntrustedCliResponse(response, { source: 'inline-cli-response', tool: 'ask_codex' });
|
|
929
|
-
return inlineSuccessBlocks(metadataText, wrappedResponse);
|
|
930
|
-
}
|
|
931
|
-
return {
|
|
932
|
-
content: [{
|
|
933
|
-
type: 'text',
|
|
934
|
-
text: responseLines.join('\n')
|
|
935
|
-
}]
|
|
936
|
-
};
|
|
937
|
-
}
|
|
938
|
-
catch (err) {
|
|
939
|
-
return singleErrorBlock(`${paramLines}\n\n---\n\nCodex CLI error: ${err.message}`);
|
|
940
|
-
}
|
|
941
|
-
}
|
|
942
|
-
//# sourceMappingURL=codex-core.js.map
|