@jstn-sdk/rcs 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/plugins/marketplace.json +20 -0
- package/Cargo.lock +174 -0
- package/Cargo.toml +23 -0
- package/README.md +403 -0
- package/crates/rcs-explore/Cargo.toml +11 -0
- package/crates/rcs-explore/src/main.rs +2061 -0
- package/crates/rcs-mux/Cargo.toml +11 -0
- package/crates/rcs-mux/src/lib.rs +91 -0
- package/crates/rcs-mux/src/tmux.rs +282 -0
- package/crates/rcs-mux/src/types.rs +306 -0
- package/crates/rcs-runtime/Cargo.toml +17 -0
- package/crates/rcs-runtime/src/main.rs +125 -0
- package/crates/rcs-runtime/tests/execution.rs +212 -0
- package/crates/rcs-runtime-core/Cargo.toml +13 -0
- package/crates/rcs-runtime-core/src/authority.rs +239 -0
- package/crates/rcs-runtime-core/src/dispatch.rs +330 -0
- package/crates/rcs-runtime-core/src/engine.rs +853 -0
- package/crates/rcs-runtime-core/src/lib.rs +653 -0
- package/crates/rcs-runtime-core/src/mailbox.rs +261 -0
- package/crates/rcs-runtime-core/src/replay.rs +104 -0
- package/crates/rcs-sparkshell/Cargo.lock +7 -0
- package/crates/rcs-sparkshell/Cargo.toml +14 -0
- package/crates/rcs-sparkshell/src/codex_bridge.rs +454 -0
- package/crates/rcs-sparkshell/src/error.rs +45 -0
- package/crates/rcs-sparkshell/src/exec.rs +115 -0
- package/crates/rcs-sparkshell/src/main.rs +334 -0
- package/crates/rcs-sparkshell/src/prompt.rs +342 -0
- package/crates/rcs-sparkshell/src/registry/c_cpp.rs +9 -0
- package/crates/rcs-sparkshell/src/registry/csharp.rs +10 -0
- package/crates/rcs-sparkshell/src/registry/generic_shell.rs +11 -0
- package/crates/rcs-sparkshell/src/registry/git.rs +10 -0
- package/crates/rcs-sparkshell/src/registry/go.rs +9 -0
- package/crates/rcs-sparkshell/src/registry/java_kotlin.rs +9 -0
- package/crates/rcs-sparkshell/src/registry/mod.rs +85 -0
- package/crates/rcs-sparkshell/src/registry/node_js.rs +9 -0
- package/crates/rcs-sparkshell/src/registry/python.rs +9 -0
- package/crates/rcs-sparkshell/src/registry/ruby.rs +9 -0
- package/crates/rcs-sparkshell/src/registry/rust.rs +9 -0
- package/crates/rcs-sparkshell/src/registry/swift.rs +10 -0
- package/crates/rcs-sparkshell/src/test_support.rs +10 -0
- package/crates/rcs-sparkshell/src/threshold.rs +75 -0
- package/crates/rcs-sparkshell/tests/execution.rs +521 -0
- package/crates/rcs-sparkshell/tests/registry.rs +99 -0
- package/dist/adapt/__tests__/foundation.test.d.ts +2 -0
- package/dist/adapt/__tests__/foundation.test.d.ts.map +1 -0
- package/dist/adapt/__tests__/foundation.test.js +171 -0
- package/dist/adapt/__tests__/foundation.test.js.map +1 -0
- package/dist/adapt/__tests__/hermes.test.d.ts +2 -0
- package/dist/adapt/__tests__/hermes.test.d.ts.map +1 -0
- package/dist/adapt/__tests__/hermes.test.js +137 -0
- package/dist/adapt/__tests__/hermes.test.js.map +1 -0
- package/dist/adapt/contracts.d.ts +157 -0
- package/dist/adapt/contracts.d.ts.map +1 -0
- package/dist/adapt/contracts.js +10 -0
- package/dist/adapt/contracts.js.map +1 -0
- package/dist/adapt/hermes.d.ts +83 -0
- package/dist/adapt/hermes.d.ts.map +1 -0
- package/dist/adapt/hermes.js +371 -0
- package/dist/adapt/hermes.js.map +1 -0
- package/dist/adapt/index.d.ts +14 -0
- package/dist/adapt/index.d.ts.map +1 -0
- package/dist/adapt/index.js +293 -0
- package/dist/adapt/index.js.map +1 -0
- package/dist/adapt/openclaw.d.ts +7 -0
- package/dist/adapt/openclaw.d.ts.map +1 -0
- package/dist/adapt/openclaw.js +299 -0
- package/dist/adapt/openclaw.js.map +1 -0
- package/dist/adapt/paths.d.ts +3 -0
- package/dist/adapt/paths.d.ts.map +1 -0
- package/dist/adapt/paths.js +15 -0
- package/dist/adapt/paths.js.map +1 -0
- package/dist/adapt/registry.d.ts +4 -0
- package/dist/adapt/registry.d.ts.map +1 -0
- package/dist/adapt/registry.js +48 -0
- package/dist/adapt/registry.js.map +1 -0
- package/dist/agents/__tests__/definitions.test.d.ts +2 -0
- package/dist/agents/__tests__/definitions.test.d.ts.map +1 -0
- package/dist/agents/__tests__/definitions.test.js +62 -0
- package/dist/agents/__tests__/definitions.test.js.map +1 -0
- package/dist/agents/__tests__/native-config.test.d.ts +2 -0
- package/dist/agents/__tests__/native-config.test.d.ts.map +1 -0
- package/dist/agents/__tests__/native-config.test.js +278 -0
- package/dist/agents/__tests__/native-config.test.js.map +1 -0
- package/dist/agents/definitions.d.ts +25 -0
- package/dist/agents/definitions.d.ts.map +1 -0
- package/dist/agents/definitions.js +327 -0
- package/dist/agents/definitions.js.map +1 -0
- package/dist/agents/native-config.d.ts +51 -0
- package/dist/agents/native-config.d.ts.map +1 -0
- package/dist/agents/native-config.js +265 -0
- package/dist/agents/native-config.js.map +1 -0
- package/dist/agents/policy.d.ts +10 -0
- package/dist/agents/policy.d.ts.map +1 -0
- package/dist/agents/policy.js +61 -0
- package/dist/agents/policy.js.map +1 -0
- 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 +127 -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 +356 -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 +218 -0
- package/dist/autoresearch/__tests__/runtime.test.js.map +1 -0
- package/dist/autoresearch/__tests__/skill-validation.test.d.ts +2 -0
- package/dist/autoresearch/__tests__/skill-validation.test.d.ts.map +1 -0
- package/dist/autoresearch/__tests__/skill-validation.test.js +91 -0
- package/dist/autoresearch/__tests__/skill-validation.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 +197 -0
- package/dist/autoresearch/contracts.js.map +1 -0
- package/dist/autoresearch/runtime.d.ts +132 -0
- package/dist/autoresearch/runtime.d.ts.map +1 -0
- package/dist/autoresearch/runtime.js +1075 -0
- package/dist/autoresearch/runtime.js.map +1 -0
- package/dist/autoresearch/skill-validation.d.ts +13 -0
- package/dist/autoresearch/skill-validation.d.ts.map +1 -0
- package/dist/autoresearch/skill-validation.js +165 -0
- package/dist/autoresearch/skill-validation.js.map +1 -0
- package/dist/catalog/__tests__/generator.test.d.ts +2 -0
- package/dist/catalog/__tests__/generator.test.d.ts.map +1 -0
- package/dist/catalog/__tests__/generator.test.js +49 -0
- package/dist/catalog/__tests__/generator.test.js.map +1 -0
- package/dist/catalog/__tests__/plugin-bundle-ssot.test.d.ts +2 -0
- package/dist/catalog/__tests__/plugin-bundle-ssot.test.d.ts.map +1 -0
- package/dist/catalog/__tests__/plugin-bundle-ssot.test.js +83 -0
- package/dist/catalog/__tests__/plugin-bundle-ssot.test.js.map +1 -0
- package/dist/catalog/__tests__/schema.test.d.ts +2 -0
- package/dist/catalog/__tests__/schema.test.d.ts.map +1 -0
- package/dist/catalog/__tests__/schema.test.js +91 -0
- package/dist/catalog/__tests__/schema.test.js.map +1 -0
- package/dist/catalog/installable.d.ts +5 -0
- package/dist/catalog/installable.d.ts.map +1 -0
- package/dist/catalog/installable.js +13 -0
- package/dist/catalog/installable.js.map +1 -0
- package/dist/catalog/reader.d.ts +19 -0
- package/dist/catalog/reader.d.ts.map +1 -0
- package/dist/catalog/reader.js +63 -0
- package/dist/catalog/reader.js.map +1 -0
- package/dist/catalog/schema.d.ts +32 -0
- package/dist/catalog/schema.d.ts.map +1 -0
- package/dist/catalog/schema.js +107 -0
- package/dist/catalog/schema.js.map +1 -0
- package/dist/catalog/skill-mirror.d.ts +20 -0
- package/dist/catalog/skill-mirror.d.ts.map +1 -0
- package/dist/catalog/skill-mirror.js +104 -0
- package/dist/catalog/skill-mirror.js.map +1 -0
- package/dist/cli/__tests__/adapt-help.test.d.ts +2 -0
- package/dist/cli/__tests__/adapt-help.test.d.ts.map +1 -0
- package/dist/cli/__tests__/adapt-help.test.js +37 -0
- package/dist/cli/__tests__/adapt-help.test.js.map +1 -0
- package/dist/cli/__tests__/adapt.test.d.ts +2 -0
- package/dist/cli/__tests__/adapt.test.d.ts.map +1 -0
- package/dist/cli/__tests__/adapt.test.js +62 -0
- package/dist/cli/__tests__/adapt.test.js.map +1 -0
- package/dist/cli/__tests__/agents-init.test.d.ts +2 -0
- package/dist/cli/__tests__/agents-init.test.d.ts.map +1 -0
- package/dist/cli/__tests__/agents-init.test.js +184 -0
- package/dist/cli/__tests__/agents-init.test.js.map +1 -0
- package/dist/cli/__tests__/agents.test.d.ts +2 -0
- package/dist/cli/__tests__/agents.test.d.ts.map +1 -0
- package/dist/cli/__tests__/agents.test.js +137 -0
- package/dist/cli/__tests__/agents.test.js.map +1 -0
- package/dist/cli/__tests__/ask.test.d.ts +2 -0
- package/dist/cli/__tests__/ask.test.d.ts.map +1 -0
- package/dist/cli/__tests__/ask.test.js +265 -0
- package/dist/cli/__tests__/ask.test.js.map +1 -0
- 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 +365 -0
- package/dist/cli/__tests__/autoresearch-guided.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 +203 -0
- package/dist/cli/__tests__/autoresearch.test.js.map +1 -0
- package/dist/cli/__tests__/catalog-contract.test.d.ts +2 -0
- package/dist/cli/__tests__/catalog-contract.test.d.ts.map +1 -0
- package/dist/cli/__tests__/catalog-contract.test.js +18 -0
- package/dist/cli/__tests__/catalog-contract.test.js.map +1 -0
- package/dist/cli/__tests__/cleanup.test.d.ts +2 -0
- package/dist/cli/__tests__/cleanup.test.d.ts.map +1 -0
- package/dist/cli/__tests__/cleanup.test.js +419 -0
- package/dist/cli/__tests__/cleanup.test.js.map +1 -0
- package/dist/cli/__tests__/codex-plugin-layout.test.d.ts +2 -0
- package/dist/cli/__tests__/codex-plugin-layout.test.d.ts.map +1 -0
- package/dist/cli/__tests__/codex-plugin-layout.test.js +210 -0
- package/dist/cli/__tests__/codex-plugin-layout.test.js.map +1 -0
- package/dist/cli/__tests__/doctor-context-window-warning.test.d.ts +2 -0
- package/dist/cli/__tests__/doctor-context-window-warning.test.d.ts.map +1 -0
- package/dist/cli/__tests__/doctor-context-window-warning.test.js +122 -0
- package/dist/cli/__tests__/doctor-context-window-warning.test.js.map +1 -0
- package/dist/cli/__tests__/doctor-invalid-config.test.d.ts +2 -0
- package/dist/cli/__tests__/doctor-invalid-config.test.d.ts.map +1 -0
- package/dist/cli/__tests__/doctor-invalid-config.test.js +52 -0
- package/dist/cli/__tests__/doctor-invalid-config.test.js.map +1 -0
- package/dist/cli/__tests__/doctor-team.test.d.ts +2 -0
- package/dist/cli/__tests__/doctor-team.test.d.ts.map +1 -0
- package/dist/cli/__tests__/doctor-team.test.js +299 -0
- package/dist/cli/__tests__/doctor-team.test.js.map +1 -0
- package/dist/cli/__tests__/doctor-warning-copy.test.d.ts +2 -0
- package/dist/cli/__tests__/doctor-warning-copy.test.d.ts.map +1 -0
- package/dist/cli/__tests__/doctor-warning-copy.test.js +438 -0
- package/dist/cli/__tests__/doctor-warning-copy.test.js.map +1 -0
- package/dist/cli/__tests__/error-handling-warnings.test.d.ts +2 -0
- package/dist/cli/__tests__/error-handling-warnings.test.d.ts.map +1 -0
- package/dist/cli/__tests__/error-handling-warnings.test.js +52 -0
- package/dist/cli/__tests__/error-handling-warnings.test.js.map +1 -0
- package/dist/cli/__tests__/exec.test.d.ts +2 -0
- package/dist/cli/__tests__/exec.test.d.ts.map +1 -0
- package/dist/cli/__tests__/exec.test.js +213 -0
- package/dist/cli/__tests__/exec.test.js.map +1 -0
- package/dist/cli/__tests__/explore-windows-diagnostics.test.d.ts +2 -0
- package/dist/cli/__tests__/explore-windows-diagnostics.test.d.ts.map +1 -0
- package/dist/cli/__tests__/explore-windows-diagnostics.test.js +17 -0
- package/dist/cli/__tests__/explore-windows-diagnostics.test.js.map +1 -0
- package/dist/cli/__tests__/explore.test.d.ts +2 -0
- package/dist/cli/__tests__/explore.test.d.ts.map +1 -0
- package/dist/cli/__tests__/explore.test.js +1090 -0
- package/dist/cli/__tests__/explore.test.js.map +1 -0
- package/dist/cli/__tests__/hooks.test.d.ts +2 -0
- package/dist/cli/__tests__/hooks.test.d.ts.map +1 -0
- package/dist/cli/__tests__/hooks.test.js +55 -0
- package/dist/cli/__tests__/hooks.test.js.map +1 -0
- package/dist/cli/__tests__/index.test.d.ts +2 -0
- package/dist/cli/__tests__/index.test.d.ts.map +1 -0
- package/dist/cli/__tests__/index.test.js +2259 -0
- package/dist/cli/__tests__/index.test.js.map +1 -0
- package/dist/cli/__tests__/launch-fallback.test.d.ts +2 -0
- package/dist/cli/__tests__/launch-fallback.test.d.ts.map +1 -0
- package/dist/cli/__tests__/launch-fallback.test.js +661 -0
- package/dist/cli/__tests__/launch-fallback.test.js.map +1 -0
- package/dist/cli/__tests__/lifecycle-notifications.test.d.ts +2 -0
- package/dist/cli/__tests__/lifecycle-notifications.test.d.ts.map +1 -0
- package/dist/cli/__tests__/lifecycle-notifications.test.js +48 -0
- package/dist/cli/__tests__/lifecycle-notifications.test.js.map +1 -0
- package/dist/cli/__tests__/list.test.d.ts +2 -0
- package/dist/cli/__tests__/list.test.d.ts.map +1 -0
- package/dist/cli/__tests__/list.test.js +38 -0
- package/dist/cli/__tests__/list.test.js.map +1 -0
- package/dist/cli/__tests__/mcp-parity.test.d.ts +2 -0
- package/dist/cli/__tests__/mcp-parity.test.d.ts.map +1 -0
- package/dist/cli/__tests__/mcp-parity.test.js +228 -0
- package/dist/cli/__tests__/mcp-parity.test.js.map +1 -0
- package/dist/cli/__tests__/mcp-serve.test.d.ts +2 -0
- package/dist/cli/__tests__/mcp-serve.test.d.ts.map +1 -0
- package/dist/cli/__tests__/mcp-serve.test.js +64 -0
- package/dist/cli/__tests__/mcp-serve.test.js.map +1 -0
- package/dist/cli/__tests__/native-assets.test.d.ts +2 -0
- package/dist/cli/__tests__/native-assets.test.d.ts.map +1 -0
- package/dist/cli/__tests__/native-assets.test.js +308 -0
- package/dist/cli/__tests__/native-assets.test.js.map +1 -0
- package/dist/cli/__tests__/native-hook-dispatch-contract.test.d.ts +2 -0
- package/dist/cli/__tests__/native-hook-dispatch-contract.test.d.ts.map +1 -0
- package/dist/cli/__tests__/native-hook-dispatch-contract.test.js +11 -0
- package/dist/cli/__tests__/native-hook-dispatch-contract.test.js.map +1 -0
- package/dist/cli/__tests__/nested-help-routing.test.d.ts +2 -0
- package/dist/cli/__tests__/nested-help-routing.test.d.ts.map +1 -0
- package/dist/cli/__tests__/nested-help-routing.test.js +96 -0
- package/dist/cli/__tests__/nested-help-routing.test.js.map +1 -0
- package/dist/cli/__tests__/package-bin-contract.test.d.ts +2 -0
- package/dist/cli/__tests__/package-bin-contract.test.d.ts.map +1 -0
- package/dist/cli/__tests__/package-bin-contract.test.js +177 -0
- package/dist/cli/__tests__/package-bin-contract.test.js.map +1 -0
- package/dist/cli/__tests__/packaged-explore-harness-lock.d.ts +3 -0
- package/dist/cli/__tests__/packaged-explore-harness-lock.d.ts.map +1 -0
- package/dist/cli/__tests__/packaged-explore-harness-lock.js +67 -0
- package/dist/cli/__tests__/packaged-explore-harness-lock.js.map +1 -0
- package/dist/cli/__tests__/packaged-script-resolution.test.d.ts +2 -0
- package/dist/cli/__tests__/packaged-script-resolution.test.d.ts.map +1 -0
- package/dist/cli/__tests__/packaged-script-resolution.test.js +19 -0
- package/dist/cli/__tests__/packaged-script-resolution.test.js.map +1 -0
- package/dist/cli/__tests__/prompt-skill-sanitization.test.d.ts +2 -0
- package/dist/cli/__tests__/prompt-skill-sanitization.test.d.ts.map +1 -0
- package/dist/cli/__tests__/prompt-skill-sanitization.test.js +48 -0
- package/dist/cli/__tests__/prompt-skill-sanitization.test.js.map +1 -0
- package/dist/cli/__tests__/question.test.d.ts +2 -0
- package/dist/cli/__tests__/question.test.d.ts.map +1 -0
- package/dist/cli/__tests__/question.test.js +633 -0
- package/dist/cli/__tests__/question.test.js.map +1 -0
- package/dist/cli/__tests__/ralph-deslop-contract.test.d.ts +2 -0
- package/dist/cli/__tests__/ralph-deslop-contract.test.d.ts.map +1 -0
- package/dist/cli/__tests__/ralph-deslop-contract.test.js +28 -0
- package/dist/cli/__tests__/ralph-deslop-contract.test.js.map +1 -0
- package/dist/cli/__tests__/ralph-prd-deep-interview.test.d.ts +2 -0
- package/dist/cli/__tests__/ralph-prd-deep-interview.test.d.ts.map +1 -0
- package/dist/cli/__tests__/ralph-prd-deep-interview.test.js +24 -0
- package/dist/cli/__tests__/ralph-prd-deep-interview.test.js.map +1 -0
- package/dist/cli/__tests__/ralph-prd-smoke.test.d.ts +2 -0
- package/dist/cli/__tests__/ralph-prd-smoke.test.d.ts.map +1 -0
- package/dist/cli/__tests__/ralph-prd-smoke.test.js +167 -0
- package/dist/cli/__tests__/ralph-prd-smoke.test.js.map +1 -0
- package/dist/cli/__tests__/ralph.test.d.ts +2 -0
- package/dist/cli/__tests__/ralph.test.d.ts.map +1 -0
- package/dist/cli/__tests__/ralph.test.js +256 -0
- package/dist/cli/__tests__/ralph.test.js.map +1 -0
- package/dist/cli/__tests__/resume.test.d.ts +2 -0
- package/dist/cli/__tests__/resume.test.d.ts.map +1 -0
- package/dist/cli/__tests__/resume.test.js +84 -0
- package/dist/cli/__tests__/resume.test.js.map +1 -0
- package/dist/cli/__tests__/session-scoped-runtime.test.d.ts +2 -0
- package/dist/cli/__tests__/session-scoped-runtime.test.d.ts.map +1 -0
- package/dist/cli/__tests__/session-scoped-runtime.test.js +146 -0
- package/dist/cli/__tests__/session-scoped-runtime.test.js.map +1 -0
- package/dist/cli/__tests__/session-search-help.test.d.ts +2 -0
- package/dist/cli/__tests__/session-search-help.test.d.ts.map +1 -0
- package/dist/cli/__tests__/session-search-help.test.js +76 -0
- package/dist/cli/__tests__/session-search-help.test.js.map +1 -0
- package/dist/cli/__tests__/session-search.test.d.ts +2 -0
- package/dist/cli/__tests__/session-search.test.d.ts.map +1 -0
- package/dist/cli/__tests__/session-search.test.js +77 -0
- package/dist/cli/__tests__/session-search.test.js.map +1 -0
- package/dist/cli/__tests__/setup-agents-overwrite.test.d.ts +2 -0
- package/dist/cli/__tests__/setup-agents-overwrite.test.d.ts.map +1 -0
- package/dist/cli/__tests__/setup-agents-overwrite.test.js +457 -0
- package/dist/cli/__tests__/setup-agents-overwrite.test.js.map +1 -0
- package/dist/cli/__tests__/setup-gh-star.test.d.ts +2 -0
- package/dist/cli/__tests__/setup-gh-star.test.d.ts.map +1 -0
- package/dist/cli/__tests__/setup-gh-star.test.js +67 -0
- package/dist/cli/__tests__/setup-gh-star.test.js.map +1 -0
- package/dist/cli/__tests__/setup-hooks-shared-ownership.test.d.ts +2 -0
- package/dist/cli/__tests__/setup-hooks-shared-ownership.test.d.ts.map +1 -0
- package/dist/cli/__tests__/setup-hooks-shared-ownership.test.js +189 -0
- package/dist/cli/__tests__/setup-hooks-shared-ownership.test.js.map +1 -0
- package/dist/cli/__tests__/setup-install-mode.test.d.ts +2 -0
- package/dist/cli/__tests__/setup-install-mode.test.d.ts.map +1 -0
- package/dist/cli/__tests__/setup-install-mode.test.js +873 -0
- package/dist/cli/__tests__/setup-install-mode.test.js.map +1 -0
- package/dist/cli/__tests__/setup-prompts-overwrite.test.d.ts +2 -0
- package/dist/cli/__tests__/setup-prompts-overwrite.test.d.ts.map +1 -0
- package/dist/cli/__tests__/setup-prompts-overwrite.test.js +191 -0
- package/dist/cli/__tests__/setup-prompts-overwrite.test.js.map +1 -0
- package/dist/cli/__tests__/setup-refresh.test.d.ts +2 -0
- package/dist/cli/__tests__/setup-refresh.test.d.ts.map +1 -0
- package/dist/cli/__tests__/setup-refresh.test.js +591 -0
- package/dist/cli/__tests__/setup-refresh.test.js.map +1 -0
- package/dist/cli/__tests__/setup-scope.test.d.ts +2 -0
- package/dist/cli/__tests__/setup-scope.test.d.ts.map +1 -0
- package/dist/cli/__tests__/setup-scope.test.js +340 -0
- package/dist/cli/__tests__/setup-scope.test.js.map +1 -0
- package/dist/cli/__tests__/setup-skill-validation.test.d.ts +2 -0
- package/dist/cli/__tests__/setup-skill-validation.test.d.ts.map +1 -0
- package/dist/cli/__tests__/setup-skill-validation.test.js +44 -0
- package/dist/cli/__tests__/setup-skill-validation.test.js.map +1 -0
- package/dist/cli/__tests__/setup-skills-overwrite.test.d.ts +2 -0
- package/dist/cli/__tests__/setup-skills-overwrite.test.d.ts.map +1 -0
- package/dist/cli/__tests__/setup-skills-overwrite.test.js +295 -0
- package/dist/cli/__tests__/setup-skills-overwrite.test.js.map +1 -0
- package/dist/cli/__tests__/sidecar.test.d.ts +2 -0
- package/dist/cli/__tests__/sidecar.test.d.ts.map +1 -0
- package/dist/cli/__tests__/sidecar.test.js +24 -0
- package/dist/cli/__tests__/sidecar.test.js.map +1 -0
- package/dist/cli/__tests__/sparkshell-cli.test.d.ts +2 -0
- package/dist/cli/__tests__/sparkshell-cli.test.d.ts.map +1 -0
- package/dist/cli/__tests__/sparkshell-cli.test.js +400 -0
- package/dist/cli/__tests__/sparkshell-cli.test.js.map +1 -0
- package/dist/cli/__tests__/sparkshell-packaging.test.d.ts +2 -0
- package/dist/cli/__tests__/sparkshell-packaging.test.d.ts.map +1 -0
- package/dist/cli/__tests__/sparkshell-packaging.test.js +74 -0
- package/dist/cli/__tests__/sparkshell-packaging.test.js.map +1 -0
- package/dist/cli/__tests__/star-prompt.test.d.ts +2 -0
- package/dist/cli/__tests__/star-prompt.test.d.ts.map +1 -0
- package/dist/cli/__tests__/star-prompt.test.js +172 -0
- package/dist/cli/__tests__/star-prompt.test.js.map +1 -0
- package/dist/cli/__tests__/state.test.d.ts +2 -0
- package/dist/cli/__tests__/state.test.d.ts.map +1 -0
- package/dist/cli/__tests__/state.test.js +46 -0
- package/dist/cli/__tests__/state.test.js.map +1 -0
- package/dist/cli/__tests__/team-decompose.test.d.ts +2 -0
- package/dist/cli/__tests__/team-decompose.test.d.ts.map +1 -0
- package/dist/cli/__tests__/team-decompose.test.js +133 -0
- package/dist/cli/__tests__/team-decompose.test.js.map +1 -0
- package/dist/cli/__tests__/team.test.d.ts +2 -0
- package/dist/cli/__tests__/team.test.d.ts.map +1 -0
- package/dist/cli/__tests__/team.test.js +1820 -0
- package/dist/cli/__tests__/team.test.js.map +1 -0
- package/dist/cli/__tests__/uninstall.test.d.ts +2 -0
- package/dist/cli/__tests__/uninstall.test.d.ts.map +1 -0
- package/dist/cli/__tests__/uninstall.test.js +766 -0
- package/dist/cli/__tests__/uninstall.test.js.map +1 -0
- package/dist/cli/__tests__/update.test.d.ts +2 -0
- package/dist/cli/__tests__/update.test.d.ts.map +1 -0
- package/dist/cli/__tests__/update.test.js +589 -0
- package/dist/cli/__tests__/update.test.js.map +1 -0
- package/dist/cli/__tests__/version-sync-contract.test.d.ts +2 -0
- package/dist/cli/__tests__/version-sync-contract.test.d.ts.map +1 -0
- package/dist/cli/__tests__/version-sync-contract.test.js +41 -0
- package/dist/cli/__tests__/version-sync-contract.test.js.map +1 -0
- package/dist/cli/__tests__/version.test.d.ts +2 -0
- package/dist/cli/__tests__/version.test.d.ts.map +1 -0
- package/dist/cli/__tests__/version.test.js +21 -0
- package/dist/cli/__tests__/version.test.js.map +1 -0
- package/dist/cli/__tests__/windows-popup-loop-contract.test.d.ts +2 -0
- package/dist/cli/__tests__/windows-popup-loop-contract.test.d.ts.map +1 -0
- package/dist/cli/__tests__/windows-popup-loop-contract.test.js +31 -0
- package/dist/cli/__tests__/windows-popup-loop-contract.test.js.map +1 -0
- package/dist/cli/adapt.d.ts +6 -0
- package/dist/cli/adapt.d.ts.map +1 -0
- package/dist/cli/adapt.js +135 -0
- package/dist/cli/adapt.js.map +1 -0
- package/dist/cli/agents-init.d.ts +14 -0
- package/dist/cli/agents-init.d.ts.map +1 -0
- package/dist/cli/agents-init.js +274 -0
- package/dist/cli/agents-init.js.map +1 -0
- package/dist/cli/agents.d.ts +14 -0
- package/dist/cli/agents.d.ts.map +1 -0
- package/dist/cli/agents.js +267 -0
- package/dist/cli/agents.js.map +1 -0
- package/dist/cli/ask.d.ts +13 -0
- package/dist/cli/ask.d.ts.map +1 -0
- package/dist/cli/ask.js +178 -0
- package/dist/cli/ask.js.map +1 -0
- package/dist/cli/autoresearch-guided.d.ts +43 -0
- package/dist/cli/autoresearch-guided.d.ts.map +1 -0
- package/dist/cli/autoresearch-guided.js +282 -0
- package/dist/cli/autoresearch-guided.js.map +1 -0
- package/dist/cli/autoresearch-intake.d.ts +62 -0
- package/dist/cli/autoresearch-intake.d.ts.map +1 -0
- package/dist/cli/autoresearch-intake.js +336 -0
- package/dist/cli/autoresearch-intake.js.map +1 -0
- package/dist/cli/autoresearch.d.ts +16 -0
- package/dist/cli/autoresearch.d.ts.map +1 -0
- package/dist/cli/autoresearch.js +91 -0
- package/dist/cli/autoresearch.js.map +1 -0
- package/dist/cli/catalog-contract.d.ts +10 -0
- package/dist/cli/catalog-contract.d.ts.map +1 -0
- package/dist/cli/catalog-contract.js +34 -0
- package/dist/cli/catalog-contract.js.map +1 -0
- package/dist/cli/cleanup.d.ts +56 -0
- package/dist/cli/cleanup.d.ts.map +1 -0
- package/dist/cli/cleanup.js +400 -0
- package/dist/cli/cleanup.js.map +1 -0
- package/dist/cli/codex-home.d.ts +7 -0
- package/dist/cli/codex-home.d.ts.map +1 -0
- package/dist/cli/codex-home.js +26 -0
- package/dist/cli/codex-home.js.map +1 -0
- package/dist/cli/constants.d.ts +11 -0
- package/dist/cli/constants.d.ts.map +1 -0
- package/dist/cli/constants.js +11 -0
- package/dist/cli/constants.js.map +1 -0
- package/dist/cli/doctor.d.ts +18 -0
- package/dist/cli/doctor.d.ts.map +1 -0
- package/dist/cli/doctor.js +1072 -0
- package/dist/cli/doctor.js.map +1 -0
- package/dist/cli/explore.d.ts +30 -0
- package/dist/cli/explore.d.ts.map +1 -0
- package/dist/cli/explore.js +404 -0
- package/dist/cli/explore.js.map +1 -0
- package/dist/cli/hooks.d.ts +4 -0
- package/dist/cli/hooks.d.ts.map +1 -0
- package/dist/cli/hooks.js +201 -0
- package/dist/cli/hooks.js.map +1 -0
- package/dist/cli/index.d.ts +138 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +3117 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/list.d.ts +2 -0
- package/dist/cli/list.d.ts.map +1 -0
- package/dist/cli/list.js +40 -0
- package/dist/cli/list.js.map +1 -0
- package/dist/cli/mcp-parity.d.ts +22 -0
- package/dist/cli/mcp-parity.d.ts.map +1 -0
- package/dist/cli/mcp-parity.js +251 -0
- package/dist/cli/mcp-parity.js.map +1 -0
- package/dist/cli/mcp-serve.d.ts +13 -0
- package/dist/cli/mcp-serve.d.ts.map +1 -0
- package/dist/cli/mcp-serve.js +71 -0
- package/dist/cli/mcp-serve.js.map +1 -0
- package/dist/cli/native-assets.d.ts +51 -0
- package/dist/cli/native-assets.d.ts.map +1 -0
- package/dist/cli/native-assets.js +379 -0
- package/dist/cli/native-assets.js.map +1 -0
- package/dist/cli/plugin-marketplace.d.ts +13 -0
- package/dist/cli/plugin-marketplace.d.ts.map +1 -0
- package/dist/cli/plugin-marketplace.js +75 -0
- package/dist/cli/plugin-marketplace.js.map +1 -0
- package/dist/cli/question.d.ts +3 -0
- package/dist/cli/question.d.ts.map +1 -0
- package/dist/cli/question.js +227 -0
- package/dist/cli/question.js.map +1 -0
- package/dist/cli/ralph.d.ts +17 -0
- package/dist/cli/ralph.d.ts.map +1 -0
- package/dist/cli/ralph.js +313 -0
- package/dist/cli/ralph.js.map +1 -0
- package/dist/cli/rcs.d.ts +3 -0
- package/dist/cli/rcs.d.ts.map +1 -0
- package/dist/cli/rcs.js +127 -0
- package/dist/cli/rcs.js.map +1 -0
- package/dist/cli/session-search.d.ts +8 -0
- package/dist/cli/session-search.d.ts.map +1 -0
- package/dist/cli/session-search.js +138 -0
- package/dist/cli/session-search.js.map +1 -0
- package/dist/cli/setup-preferences.d.ts +20 -0
- package/dist/cli/setup-preferences.d.ts.map +1 -0
- package/dist/cli/setup-preferences.js +71 -0
- package/dist/cli/setup-preferences.js.map +1 -0
- package/dist/cli/setup.d.ts +55 -0
- package/dist/cli/setup.d.ts.map +1 -0
- package/dist/cli/setup.js +2056 -0
- package/dist/cli/setup.js.map +1 -0
- package/dist/cli/sparkshell.d.ts +33 -0
- package/dist/cli/sparkshell.d.ts.map +1 -0
- package/dist/cli/sparkshell.js +272 -0
- package/dist/cli/sparkshell.js.map +1 -0
- package/dist/cli/star-prompt.d.ts +31 -0
- package/dist/cli/star-prompt.d.ts.map +1 -0
- package/dist/cli/star-prompt.js +97 -0
- package/dist/cli/star-prompt.js.map +1 -0
- package/dist/cli/state.d.ts +8 -0
- package/dist/cli/state.d.ts.map +1 -0
- package/dist/cli/state.js +71 -0
- package/dist/cli/state.js.map +1 -0
- package/dist/cli/team.d.ts +42 -0
- package/dist/cli/team.d.ts.map +1 -0
- package/dist/cli/team.js +1293 -0
- package/dist/cli/team.js.map +1 -0
- package/dist/cli/tmux-hook.d.ts +3 -0
- package/dist/cli/tmux-hook.d.ts.map +1 -0
- package/dist/cli/tmux-hook.js +386 -0
- package/dist/cli/tmux-hook.js.map +1 -0
- package/dist/cli/uninstall.d.ts +13 -0
- package/dist/cli/uninstall.d.ts.map +1 -0
- package/dist/cli/uninstall.js +402 -0
- package/dist/cli/uninstall.js.map +1 -0
- package/dist/cli/update.d.ts +56 -0
- package/dist/cli/update.d.ts.map +1 -0
- package/dist/cli/update.js +333 -0
- package/dist/cli/update.js.map +1 -0
- package/dist/cli/version.d.ts +2 -0
- package/dist/cli/version.d.ts.map +1 -0
- package/dist/cli/version.js +17 -0
- package/dist/cli/version.js.map +1 -0
- package/dist/compat/__tests__/doctor-contract.test.d.ts +2 -0
- package/dist/compat/__tests__/doctor-contract.test.d.ts.map +1 -0
- package/dist/compat/__tests__/doctor-contract.test.js +108 -0
- package/dist/compat/__tests__/doctor-contract.test.js.map +1 -0
- package/dist/compat/__tests__/rust-runtime-compat.test.d.ts +2 -0
- package/dist/compat/__tests__/rust-runtime-compat.test.d.ts.map +1 -0
- package/dist/compat/__tests__/rust-runtime-compat.test.js +218 -0
- package/dist/compat/__tests__/rust-runtime-compat.test.js.map +1 -0
- package/dist/config/__tests__/codex-hooks.test.d.ts +2 -0
- package/dist/config/__tests__/codex-hooks.test.d.ts.map +1 -0
- package/dist/config/__tests__/codex-hooks.test.js +77 -0
- package/dist/config/__tests__/codex-hooks.test.js.map +1 -0
- package/dist/config/__tests__/generator-idempotent.test.d.ts +2 -0
- package/dist/config/__tests__/generator-idempotent.test.d.ts.map +1 -0
- package/dist/config/__tests__/generator-idempotent.test.js +882 -0
- package/dist/config/__tests__/generator-idempotent.test.js.map +1 -0
- package/dist/config/__tests__/generator-notify.test.d.ts +2 -0
- package/dist/config/__tests__/generator-notify.test.d.ts.map +1 -0
- package/dist/config/__tests__/generator-notify.test.js +343 -0
- package/dist/config/__tests__/generator-notify.test.js.map +1 -0
- package/dist/config/__tests__/generator-status-line-presets.test.d.ts +2 -0
- package/dist/config/__tests__/generator-status-line-presets.test.d.ts.map +1 -0
- package/dist/config/__tests__/generator-status-line-presets.test.js +203 -0
- package/dist/config/__tests__/generator-status-line-presets.test.js.map +1 -0
- package/dist/config/__tests__/mcp-registry.test.d.ts +2 -0
- package/dist/config/__tests__/mcp-registry.test.d.ts.map +1 -0
- package/dist/config/__tests__/mcp-registry.test.js +190 -0
- package/dist/config/__tests__/mcp-registry.test.js.map +1 -0
- package/dist/config/__tests__/models.test.d.ts +2 -0
- package/dist/config/__tests__/models.test.d.ts.map +1 -0
- package/dist/config/__tests__/models.test.js +224 -0
- package/dist/config/__tests__/models.test.js.map +1 -0
- package/dist/config/__tests__/wiki-config-contract.test.d.ts +2 -0
- package/dist/config/__tests__/wiki-config-contract.test.d.ts.map +1 -0
- package/dist/config/__tests__/wiki-config-contract.test.js +19 -0
- package/dist/config/__tests__/wiki-config-contract.test.js.map +1 -0
- package/dist/config/codex-hooks.d.ts +21 -0
- package/dist/config/codex-hooks.d.ts.map +1 -0
- package/dist/config/codex-hooks.js +198 -0
- package/dist/config/codex-hooks.js.map +1 -0
- package/dist/config/generator.d.ts +87 -0
- package/dist/config/generator.d.ts.map +1 -0
- package/dist/config/generator.js +1127 -0
- package/dist/config/generator.js.map +1 -0
- package/dist/config/mcp-registry.d.ts +35 -0
- package/dist/config/mcp-registry.d.ts.map +1 -0
- package/dist/config/mcp-registry.js +159 -0
- package/dist/config/mcp-registry.js.map +1 -0
- package/dist/config/models.d.ts +74 -0
- package/dist/config/models.d.ts.map +1 -0
- package/dist/config/models.js +214 -0
- package/dist/config/models.js.map +1 -0
- package/dist/config/rcs-first-party-mcp.d.ts +18 -0
- package/dist/config/rcs-first-party-mcp.d.ts.map +1 -0
- package/dist/config/rcs-first-party-mcp.js +76 -0
- package/dist/config/rcs-first-party-mcp.js.map +1 -0
- package/dist/document-refresh/__tests__/enforcer.test.d.ts +2 -0
- package/dist/document-refresh/__tests__/enforcer.test.d.ts.map +1 -0
- package/dist/document-refresh/__tests__/enforcer.test.js +128 -0
- package/dist/document-refresh/__tests__/enforcer.test.js.map +1 -0
- package/dist/document-refresh/config.d.ts +9 -0
- package/dist/document-refresh/config.d.ts.map +1 -0
- package/dist/document-refresh/config.js +70 -0
- package/dist/document-refresh/config.js.map +1 -0
- package/dist/document-refresh/enforcer.d.ts +43 -0
- package/dist/document-refresh/enforcer.d.ts.map +1 -0
- package/dist/document-refresh/enforcer.js +329 -0
- package/dist/document-refresh/enforcer.js.map +1 -0
- package/dist/exec/followup.d.ts +44 -0
- package/dist/exec/followup.d.ts.map +1 -0
- package/dist/exec/followup.js +349 -0
- package/dist/exec/followup.js.map +1 -0
- package/dist/hooks/__tests__/agents-overlay.test.d.ts +8 -0
- package/dist/hooks/__tests__/agents-overlay.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/agents-overlay.test.js +644 -0
- package/dist/hooks/__tests__/agents-overlay.test.js.map +1 -0
- package/dist/hooks/__tests__/analyze-routing-contract.test.d.ts +2 -0
- package/dist/hooks/__tests__/analyze-routing-contract.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/analyze-routing-contract.test.js +45 -0
- package/dist/hooks/__tests__/analyze-routing-contract.test.js.map +1 -0
- package/dist/hooks/__tests__/analyze-skill-contract.test.d.ts +2 -0
- package/dist/hooks/__tests__/analyze-skill-contract.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/analyze-skill-contract.test.js +48 -0
- package/dist/hooks/__tests__/analyze-skill-contract.test.js.map +1 -0
- package/dist/hooks/__tests__/anti-slop-workflow.test.d.ts +2 -0
- package/dist/hooks/__tests__/anti-slop-workflow.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/anti-slop-workflow.test.js +146 -0
- package/dist/hooks/__tests__/anti-slop-workflow.test.js.map +1 -0
- package/dist/hooks/__tests__/autopilot-skill-contract.test.d.ts +2 -0
- package/dist/hooks/__tests__/autopilot-skill-contract.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/autopilot-skill-contract.test.js +37 -0
- package/dist/hooks/__tests__/autopilot-skill-contract.test.js.map +1 -0
- package/dist/hooks/__tests__/clawhip-event-contract.test.d.ts +2 -0
- package/dist/hooks/__tests__/clawhip-event-contract.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/clawhip-event-contract.test.js +37 -0
- package/dist/hooks/__tests__/clawhip-event-contract.test.js.map +1 -0
- package/dist/hooks/__tests__/code-review-skill-contract.test.d.ts +2 -0
- package/dist/hooks/__tests__/code-review-skill-contract.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/code-review-skill-contract.test.js +56 -0
- package/dist/hooks/__tests__/code-review-skill-contract.test.js.map +1 -0
- package/dist/hooks/__tests__/codebase-map.test.d.ts +8 -0
- package/dist/hooks/__tests__/codebase-map.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/codebase-map.test.js +218 -0
- package/dist/hooks/__tests__/codebase-map.test.js.map +1 -0
- package/dist/hooks/__tests__/consensus-execution-handoff.test.d.ts +18 -0
- package/dist/hooks/__tests__/consensus-execution-handoff.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/consensus-execution-handoff.test.js +234 -0
- package/dist/hooks/__tests__/consensus-execution-handoff.test.js.map +1 -0
- package/dist/hooks/__tests__/debugger-log-recency-contract.test.d.ts +2 -0
- package/dist/hooks/__tests__/debugger-log-recency-contract.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/debugger-log-recency-contract.test.js +20 -0
- package/dist/hooks/__tests__/debugger-log-recency-contract.test.js.map +1 -0
- package/dist/hooks/__tests__/deep-interview-contract.test.d.ts +2 -0
- package/dist/hooks/__tests__/deep-interview-contract.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/deep-interview-contract.test.js +213 -0
- package/dist/hooks/__tests__/deep-interview-contract.test.js.map +1 -0
- package/dist/hooks/__tests__/explicit-terminal-stop-docs-contract.test.d.ts +2 -0
- package/dist/hooks/__tests__/explicit-terminal-stop-docs-contract.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/explicit-terminal-stop-docs-contract.test.js +43 -0
- package/dist/hooks/__tests__/explicit-terminal-stop-docs-contract.test.js.map +1 -0
- package/dist/hooks/__tests__/explicit-terminal-stop-model-docs-contract.test.d.ts +2 -0
- package/dist/hooks/__tests__/explicit-terminal-stop-model-docs-contract.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/explicit-terminal-stop-model-docs-contract.test.js +38 -0
- package/dist/hooks/__tests__/explicit-terminal-stop-model-docs-contract.test.js.map +1 -0
- package/dist/hooks/__tests__/explore-routing.test.d.ts +2 -0
- package/dist/hooks/__tests__/explore-routing.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/explore-routing.test.js +43 -0
- package/dist/hooks/__tests__/explore-routing.test.js.map +1 -0
- package/dist/hooks/__tests__/explore-sparkshell-guidance-contract.test.d.ts +2 -0
- package/dist/hooks/__tests__/explore-sparkshell-guidance-contract.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/explore-sparkshell-guidance-contract.test.js +69 -0
- package/dist/hooks/__tests__/explore-sparkshell-guidance-contract.test.js.map +1 -0
- package/dist/hooks/__tests__/keyword-detector.test.d.ts +2 -0
- package/dist/hooks/__tests__/keyword-detector.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/keyword-detector.test.js +1716 -0
- package/dist/hooks/__tests__/keyword-detector.test.js.map +1 -0
- package/dist/hooks/__tests__/notify-fallback-watcher.test.d.ts +2 -0
- package/dist/hooks/__tests__/notify-fallback-watcher.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/notify-fallback-watcher.test.js +3898 -0
- package/dist/hooks/__tests__/notify-fallback-watcher.test.js.map +1 -0
- package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.d.ts +2 -0
- package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js +786 -0
- package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js.map +1 -0
- package/dist/hooks/__tests__/notify-hook-auto-nudge.test.d.ts +2 -0
- package/dist/hooks/__tests__/notify-hook-auto-nudge.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js +2397 -0
- package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js.map +1 -0
- package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.d.ts +2 -0
- package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.js +160 -0
- package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.js.map +1 -0
- package/dist/hooks/__tests__/notify-hook-managed-tmux.test.d.ts +2 -0
- package/dist/hooks/__tests__/notify-hook-managed-tmux.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/notify-hook-managed-tmux.test.js +1178 -0
- package/dist/hooks/__tests__/notify-hook-managed-tmux.test.js.map +1 -0
- package/dist/hooks/__tests__/notify-hook-modules.test.d.ts +9 -0
- package/dist/hooks/__tests__/notify-hook-modules.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/notify-hook-modules.test.js +529 -0
- package/dist/hooks/__tests__/notify-hook-modules.test.js.map +1 -0
- package/dist/hooks/__tests__/notify-hook-native-dispatch-contract.test.d.ts +2 -0
- package/dist/hooks/__tests__/notify-hook-native-dispatch-contract.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/notify-hook-native-dispatch-contract.test.js +14 -0
- package/dist/hooks/__tests__/notify-hook-native-dispatch-contract.test.js.map +1 -0
- package/dist/hooks/__tests__/notify-hook-ralph-resume.test.d.ts +2 -0
- package/dist/hooks/__tests__/notify-hook-ralph-resume.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/notify-hook-ralph-resume.test.js +682 -0
- package/dist/hooks/__tests__/notify-hook-ralph-resume.test.js.map +1 -0
- package/dist/hooks/__tests__/notify-hook-regression-205.test.d.ts +9 -0
- package/dist/hooks/__tests__/notify-hook-regression-205.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/notify-hook-regression-205.test.js +255 -0
- package/dist/hooks/__tests__/notify-hook-regression-205.test.js.map +1 -0
- package/dist/hooks/__tests__/notify-hook-session-idle-dedupe.test.d.ts +2 -0
- package/dist/hooks/__tests__/notify-hook-session-idle-dedupe.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/notify-hook-session-idle-dedupe.test.js +162 -0
- package/dist/hooks/__tests__/notify-hook-session-idle-dedupe.test.js.map +1 -0
- package/dist/hooks/__tests__/notify-hook-session-scope.test.d.ts +2 -0
- package/dist/hooks/__tests__/notify-hook-session-scope.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/notify-hook-session-scope.test.js +301 -0
- package/dist/hooks/__tests__/notify-hook-session-scope.test.js.map +1 -0
- package/dist/hooks/__tests__/notify-hook-team-dispatch.test.d.ts +2 -0
- package/dist/hooks/__tests__/notify-hook-team-dispatch.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js +1510 -0
- package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js.map +1 -0
- package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.d.ts +2 -0
- package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js +2879 -0
- package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js.map +1 -0
- package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.d.ts +2 -0
- package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js +228 -0
- package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js.map +1 -0
- package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.d.ts +2 -0
- package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.js +35 -0
- package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.js.map +1 -0
- package/dist/hooks/__tests__/notify-hook-tmux-heal.test.d.ts +2 -0
- package/dist/hooks/__tests__/notify-hook-tmux-heal.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/notify-hook-tmux-heal.test.js +1589 -0
- package/dist/hooks/__tests__/notify-hook-tmux-heal.test.js.map +1 -0
- package/dist/hooks/__tests__/notify-hook-tmux-scrollback.test.d.ts +10 -0
- package/dist/hooks/__tests__/notify-hook-tmux-scrollback.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/notify-hook-tmux-scrollback.test.js +0 -0
- package/dist/hooks/__tests__/notify-hook-tmux-scrollback.test.js.map +1 -0
- package/dist/hooks/__tests__/notify-hook-visual-verdict.test.d.ts +11 -0
- package/dist/hooks/__tests__/notify-hook-visual-verdict.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/notify-hook-visual-verdict.test.js +266 -0
- package/dist/hooks/__tests__/notify-hook-visual-verdict.test.js.map +1 -0
- package/dist/hooks/__tests__/notify-hook-worker-idle.test.d.ts +2 -0
- package/dist/hooks/__tests__/notify-hook-worker-idle.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/notify-hook-worker-idle.test.js +895 -0
- package/dist/hooks/__tests__/notify-hook-worker-idle.test.js.map +1 -0
- package/dist/hooks/__tests__/openclaw-setup-contract.test.d.ts +2 -0
- package/dist/hooks/__tests__/openclaw-setup-contract.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/openclaw-setup-contract.test.js +61 -0
- package/dist/hooks/__tests__/openclaw-setup-contract.test.js.map +1 -0
- package/dist/hooks/__tests__/pre-context-gate-skills.test.d.ts +2 -0
- package/dist/hooks/__tests__/pre-context-gate-skills.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/pre-context-gate-skills.test.js +40 -0
- package/dist/hooks/__tests__/pre-context-gate-skills.test.js.map +1 -0
- package/dist/hooks/__tests__/prompt-guidance-catalog.test.d.ts +2 -0
- package/dist/hooks/__tests__/prompt-guidance-catalog.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/prompt-guidance-catalog.test.js +11 -0
- package/dist/hooks/__tests__/prompt-guidance-catalog.test.js.map +1 -0
- package/dist/hooks/__tests__/prompt-guidance-contract.test.d.ts +2 -0
- package/dist/hooks/__tests__/prompt-guidance-contract.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/prompt-guidance-contract.test.js +38 -0
- package/dist/hooks/__tests__/prompt-guidance-contract.test.js.map +1 -0
- package/dist/hooks/__tests__/prompt-guidance-fragments.test.d.ts +2 -0
- package/dist/hooks/__tests__/prompt-guidance-fragments.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/prompt-guidance-fragments.test.js +48 -0
- package/dist/hooks/__tests__/prompt-guidance-fragments.test.js.map +1 -0
- package/dist/hooks/__tests__/prompt-guidance-scenarios.test.d.ts +2 -0
- package/dist/hooks/__tests__/prompt-guidance-scenarios.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/prompt-guidance-scenarios.test.js +11 -0
- package/dist/hooks/__tests__/prompt-guidance-scenarios.test.js.map +1 -0
- package/dist/hooks/__tests__/prompt-guidance-test-helpers.d.ts +5 -0
- package/dist/hooks/__tests__/prompt-guidance-test-helpers.d.ts.map +1 -0
- package/dist/hooks/__tests__/prompt-guidance-test-helpers.js +34 -0
- package/dist/hooks/__tests__/prompt-guidance-test-helpers.js.map +1 -0
- package/dist/hooks/__tests__/prompt-guidance-wave-two.test.d.ts +2 -0
- package/dist/hooks/__tests__/prompt-guidance-wave-two.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/prompt-guidance-wave-two.test.js +65 -0
- package/dist/hooks/__tests__/prompt-guidance-wave-two.test.js.map +1 -0
- package/dist/hooks/__tests__/prompt-orchestration-boundary.test.d.ts +2 -0
- package/dist/hooks/__tests__/prompt-orchestration-boundary.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/prompt-orchestration-boundary.test.js +38 -0
- package/dist/hooks/__tests__/prompt-orchestration-boundary.test.js.map +1 -0
- package/dist/hooks/__tests__/prompt-refactor-contract.test.d.ts +2 -0
- package/dist/hooks/__tests__/prompt-refactor-contract.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/prompt-refactor-contract.test.js +22 -0
- package/dist/hooks/__tests__/prompt-refactor-contract.test.js.map +1 -0
- package/dist/hooks/__tests__/prompt-team-routing.test.d.ts +2 -0
- package/dist/hooks/__tests__/prompt-team-routing.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/prompt-team-routing.test.js +49 -0
- package/dist/hooks/__tests__/prompt-team-routing.test.js.map +1 -0
- package/dist/hooks/__tests__/session.test.d.ts +2 -0
- package/dist/hooks/__tests__/session.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/session.test.js +322 -0
- package/dist/hooks/__tests__/session.test.js.map +1 -0
- package/dist/hooks/__tests__/skill-guidance-contract.test.d.ts +2 -0
- package/dist/hooks/__tests__/skill-guidance-contract.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/skill-guidance-contract.test.js +29 -0
- package/dist/hooks/__tests__/skill-guidance-contract.test.js.map +1 -0
- package/dist/hooks/__tests__/task-size-detector.test.d.ts +2 -0
- package/dist/hooks/__tests__/task-size-detector.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/task-size-detector.test.js +330 -0
- package/dist/hooks/__tests__/task-size-detector.test.js.map +1 -0
- package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.d.ts +2 -0
- package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.js +28 -0
- package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.js.map +1 -0
- package/dist/hooks/__tests__/tmux-hook-engine-types-sync.test.d.ts +2 -0
- package/dist/hooks/__tests__/tmux-hook-engine-types-sync.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/tmux-hook-engine-types-sync.test.js +24 -0
- package/dist/hooks/__tests__/tmux-hook-engine-types-sync.test.js.map +1 -0
- package/dist/hooks/__tests__/tmux-hook-engine.test.d.ts +2 -0
- package/dist/hooks/__tests__/tmux-hook-engine.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/tmux-hook-engine.test.js +403 -0
- package/dist/hooks/__tests__/tmux-hook-engine.test.js.map +1 -0
- package/dist/hooks/__tests__/triage-config.test.d.ts +2 -0
- package/dist/hooks/__tests__/triage-config.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/triage-config.test.js +211 -0
- package/dist/hooks/__tests__/triage-config.test.js.map +1 -0
- package/dist/hooks/__tests__/triage-heuristic.test.d.ts +2 -0
- package/dist/hooks/__tests__/triage-heuristic.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/triage-heuristic.test.js +285 -0
- package/dist/hooks/__tests__/triage-heuristic.test.js.map +1 -0
- package/dist/hooks/__tests__/triage-state.test.d.ts +2 -0
- package/dist/hooks/__tests__/triage-state.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/triage-state.test.js +426 -0
- package/dist/hooks/__tests__/triage-state.test.js.map +1 -0
- package/dist/hooks/__tests__/visual-ralph-skill.test.d.ts +2 -0
- package/dist/hooks/__tests__/visual-ralph-skill.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/visual-ralph-skill.test.js +44 -0
- package/dist/hooks/__tests__/visual-ralph-skill.test.js.map +1 -0
- package/dist/hooks/__tests__/visual-verdict-loop.test.d.ts +2 -0
- package/dist/hooks/__tests__/visual-verdict-loop.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/visual-verdict-loop.test.js +35 -0
- package/dist/hooks/__tests__/visual-verdict-loop.test.js.map +1 -0
- package/dist/hooks/__tests__/wiki-docs-contract.test.d.ts +2 -0
- package/dist/hooks/__tests__/wiki-docs-contract.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/wiki-docs-contract.test.js +34 -0
- package/dist/hooks/__tests__/wiki-docs-contract.test.js.map +1 -0
- package/dist/hooks/agents-overlay.d.ts +51 -0
- package/dist/hooks/agents-overlay.d.ts.map +1 -0
- package/dist/hooks/agents-overlay.js +557 -0
- package/dist/hooks/agents-overlay.js.map +1 -0
- package/dist/hooks/code-simplifier/__tests__/index.test.d.ts +2 -0
- package/dist/hooks/code-simplifier/__tests__/index.test.d.ts.map +1 -0
- package/dist/hooks/code-simplifier/__tests__/index.test.js +187 -0
- package/dist/hooks/code-simplifier/__tests__/index.test.js.map +1 -0
- package/dist/hooks/code-simplifier/index.d.ts +80 -0
- package/dist/hooks/code-simplifier/index.d.ts.map +1 -0
- package/dist/hooks/code-simplifier/index.js +172 -0
- package/dist/hooks/code-simplifier/index.js.map +1 -0
- package/dist/hooks/codebase-map.d.ts +23 -0
- package/dist/hooks/codebase-map.d.ts.map +1 -0
- package/dist/hooks/codebase-map.js +233 -0
- package/dist/hooks/codebase-map.js.map +1 -0
- package/dist/hooks/explore-routing.d.ts +5 -0
- package/dist/hooks/explore-routing.d.ts.map +1 -0
- package/dist/hooks/explore-routing.js +47 -0
- package/dist/hooks/explore-routing.js.map +1 -0
- package/dist/hooks/extensibility/__tests__/dispatcher.test.d.ts +2 -0
- package/dist/hooks/extensibility/__tests__/dispatcher.test.d.ts.map +1 -0
- package/dist/hooks/extensibility/__tests__/dispatcher.test.js +242 -0
- package/dist/hooks/extensibility/__tests__/dispatcher.test.js.map +1 -0
- package/dist/hooks/extensibility/__tests__/events.test.d.ts +2 -0
- package/dist/hooks/extensibility/__tests__/events.test.d.ts.map +1 -0
- package/dist/hooks/extensibility/__tests__/events.test.js +125 -0
- package/dist/hooks/extensibility/__tests__/events.test.js.map +1 -0
- package/dist/hooks/extensibility/__tests__/example-hook-plugins.test.d.ts +2 -0
- package/dist/hooks/extensibility/__tests__/example-hook-plugins.test.d.ts.map +1 -0
- package/dist/hooks/extensibility/__tests__/example-hook-plugins.test.js +153 -0
- package/dist/hooks/extensibility/__tests__/example-hook-plugins.test.js.map +1 -0
- package/dist/hooks/extensibility/__tests__/loader.test.d.ts +2 -0
- package/dist/hooks/extensibility/__tests__/loader.test.d.ts.map +1 -0
- package/dist/hooks/extensibility/__tests__/loader.test.js +254 -0
- package/dist/hooks/extensibility/__tests__/loader.test.js.map +1 -0
- package/dist/hooks/extensibility/__tests__/logging.test.d.ts +2 -0
- package/dist/hooks/extensibility/__tests__/logging.test.d.ts.map +1 -0
- package/dist/hooks/extensibility/__tests__/logging.test.js +74 -0
- package/dist/hooks/extensibility/__tests__/logging.test.js.map +1 -0
- package/dist/hooks/extensibility/__tests__/plugin-runner.test.d.ts +2 -0
- package/dist/hooks/extensibility/__tests__/plugin-runner.test.d.ts.map +1 -0
- package/dist/hooks/extensibility/__tests__/plugin-runner.test.js +202 -0
- package/dist/hooks/extensibility/__tests__/plugin-runner.test.js.map +1 -0
- package/dist/hooks/extensibility/__tests__/runtime.test.d.ts +2 -0
- package/dist/hooks/extensibility/__tests__/runtime.test.d.ts.map +1 -0
- package/dist/hooks/extensibility/__tests__/runtime.test.js +198 -0
- package/dist/hooks/extensibility/__tests__/runtime.test.js.map +1 -0
- package/dist/hooks/extensibility/__tests__/sdk-public-surface.test.d.ts +2 -0
- package/dist/hooks/extensibility/__tests__/sdk-public-surface.test.d.ts.map +1 -0
- package/dist/hooks/extensibility/__tests__/sdk-public-surface.test.js +32 -0
- package/dist/hooks/extensibility/__tests__/sdk-public-surface.test.js.map +1 -0
- package/dist/hooks/extensibility/__tests__/sdk.test.d.ts +2 -0
- package/dist/hooks/extensibility/__tests__/sdk.test.d.ts.map +1 -0
- package/dist/hooks/extensibility/__tests__/sdk.test.js +479 -0
- package/dist/hooks/extensibility/__tests__/sdk.test.js.map +1 -0
- package/dist/hooks/extensibility/dispatcher.d.ts +4 -0
- package/dist/hooks/extensibility/dispatcher.d.ts.map +1 -0
- package/dist/hooks/extensibility/dispatcher.js +285 -0
- package/dist/hooks/extensibility/dispatcher.js.map +1 -0
- package/dist/hooks/extensibility/events.d.ts +18 -0
- package/dist/hooks/extensibility/events.d.ts.map +1 -0
- package/dist/hooks/extensibility/events.js +53 -0
- package/dist/hooks/extensibility/events.js.map +1 -0
- package/dist/hooks/extensibility/index.d.ts +6 -0
- package/dist/hooks/extensibility/index.d.ts.map +1 -0
- package/dist/hooks/extensibility/index.js +6 -0
- package/dist/hooks/extensibility/index.js.map +1 -0
- package/dist/hooks/extensibility/loader.d.ts +14 -0
- package/dist/hooks/extensibility/loader.d.ts.map +1 -0
- package/dist/hooks/extensibility/loader.js +117 -0
- package/dist/hooks/extensibility/loader.js.map +1 -0
- package/dist/hooks/extensibility/logging.d.ts +4 -0
- package/dist/hooks/extensibility/logging.d.ts.map +1 -0
- package/dist/hooks/extensibility/logging.js +21 -0
- package/dist/hooks/extensibility/logging.js.map +1 -0
- package/dist/hooks/extensibility/plugin-runner.d.ts +2 -0
- package/dist/hooks/extensibility/plugin-runner.d.ts.map +1 -0
- package/dist/hooks/extensibility/plugin-runner.js +69 -0
- package/dist/hooks/extensibility/plugin-runner.js.map +1 -0
- package/dist/hooks/extensibility/runtime.d.ts +3 -0
- package/dist/hooks/extensibility/runtime.d.ts.map +1 -0
- package/dist/hooks/extensibility/runtime.js +42 -0
- package/dist/hooks/extensibility/runtime.js.map +1 -0
- package/dist/hooks/extensibility/sdk/logging.d.ts +6 -0
- package/dist/hooks/extensibility/sdk/logging.d.ts.map +1 -0
- package/dist/hooks/extensibility/sdk/logging.js +32 -0
- package/dist/hooks/extensibility/sdk/logging.js.map +1 -0
- package/dist/hooks/extensibility/sdk/paths.d.ts +7 -0
- package/dist/hooks/extensibility/sdk/paths.d.ts.map +1 -0
- package/dist/hooks/extensibility/sdk/paths.js +22 -0
- package/dist/hooks/extensibility/sdk/paths.js.map +1 -0
- package/dist/hooks/extensibility/sdk/plugin-state.d.ts +5 -0
- package/dist/hooks/extensibility/sdk/plugin-state.d.ts.map +1 -0
- package/dist/hooks/extensibility/sdk/plugin-state.js +66 -0
- package/dist/hooks/extensibility/sdk/plugin-state.js.map +1 -0
- package/dist/hooks/extensibility/sdk/runtime-state.d.ts +3 -0
- package/dist/hooks/extensibility/sdk/runtime-state.d.ts.map +1 -0
- package/dist/hooks/extensibility/sdk/runtime-state.js +47 -0
- package/dist/hooks/extensibility/sdk/runtime-state.js.map +1 -0
- package/dist/hooks/extensibility/sdk/tmux.d.ts +10 -0
- package/dist/hooks/extensibility/sdk/tmux.d.ts.map +1 -0
- package/dist/hooks/extensibility/sdk/tmux.js +181 -0
- package/dist/hooks/extensibility/sdk/tmux.js.map +1 -0
- package/dist/hooks/extensibility/sdk.d.ts +11 -0
- package/dist/hooks/extensibility/sdk.d.ts.map +1 -0
- package/dist/hooks/extensibility/sdk.js +21 -0
- package/dist/hooks/extensibility/sdk.js.map +1 -0
- package/dist/hooks/extensibility/types.d.ts +175 -0
- package/dist/hooks/extensibility/types.d.ts.map +1 -0
- package/dist/hooks/extensibility/types.js +2 -0
- package/dist/hooks/extensibility/types.js.map +1 -0
- package/dist/hooks/keyword-detector.d.ts +163 -0
- package/dist/hooks/keyword-detector.d.ts.map +1 -0
- package/dist/hooks/keyword-detector.js +920 -0
- package/dist/hooks/keyword-detector.js.map +1 -0
- package/dist/hooks/keyword-registry.d.ts +15 -0
- package/dist/hooks/keyword-registry.d.ts.map +1 -0
- package/dist/hooks/keyword-registry.js +78 -0
- package/dist/hooks/keyword-registry.js.map +1 -0
- package/dist/hooks/prompt-guidance-contract.d.ts +20 -0
- package/dist/hooks/prompt-guidance-contract.d.ts.map +1 -0
- package/dist/hooks/prompt-guidance-contract.js +321 -0
- package/dist/hooks/prompt-guidance-contract.js.map +1 -0
- package/dist/hooks/session.d.ts +72 -0
- package/dist/hooks/session.d.ts.map +1 -0
- package/dist/hooks/session.js +332 -0
- package/dist/hooks/session.js.map +1 -0
- package/dist/hooks/task-size-detector.d.ts +72 -0
- package/dist/hooks/task-size-detector.d.ts.map +1 -0
- package/dist/hooks/task-size-detector.js +202 -0
- package/dist/hooks/task-size-detector.js.map +1 -0
- package/dist/hooks/triage-config.d.ts +33 -0
- package/dist/hooks/triage-config.d.ts.map +1 -0
- package/dist/hooks/triage-config.js +87 -0
- package/dist/hooks/triage-config.js.map +1 -0
- package/dist/hooks/triage-heuristic.d.ts +20 -0
- package/dist/hooks/triage-heuristic.d.ts.map +1 -0
- package/dist/hooks/triage-heuristic.js +287 -0
- package/dist/hooks/triage-heuristic.js.map +1 -0
- package/dist/hooks/triage-state.d.ts +63 -0
- package/dist/hooks/triage-state.d.ts.map +1 -0
- package/dist/hooks/triage-state.js +139 -0
- package/dist/hooks/triage-state.js.map +1 -0
- package/dist/hud/__tests__/authority.test.d.ts +2 -0
- package/dist/hud/__tests__/authority.test.d.ts.map +1 -0
- package/dist/hud/__tests__/authority.test.js +56 -0
- package/dist/hud/__tests__/authority.test.js.map +1 -0
- package/dist/hud/__tests__/colors.test.d.ts +2 -0
- package/dist/hud/__tests__/colors.test.d.ts.map +1 -0
- package/dist/hud/__tests__/colors.test.js +92 -0
- package/dist/hud/__tests__/colors.test.js.map +1 -0
- package/dist/hud/__tests__/hud-tmux-injection.test.d.ts +10 -0
- package/dist/hud/__tests__/hud-tmux-injection.test.d.ts.map +1 -0
- package/dist/hud/__tests__/hud-tmux-injection.test.js +150 -0
- package/dist/hud/__tests__/hud-tmux-injection.test.js.map +1 -0
- package/dist/hud/__tests__/index.test.d.ts +2 -0
- package/dist/hud/__tests__/index.test.d.ts.map +1 -0
- package/dist/hud/__tests__/index.test.js +180 -0
- package/dist/hud/__tests__/index.test.js.map +1 -0
- package/dist/hud/__tests__/reconcile.test.d.ts +2 -0
- package/dist/hud/__tests__/reconcile.test.d.ts.map +1 -0
- package/dist/hud/__tests__/reconcile.test.js +125 -0
- package/dist/hud/__tests__/reconcile.test.js.map +1 -0
- package/dist/hud/__tests__/render.test.d.ts +2 -0
- package/dist/hud/__tests__/render.test.d.ts.map +1 -0
- package/dist/hud/__tests__/render.test.js +573 -0
- package/dist/hud/__tests__/render.test.js.map +1 -0
- package/dist/hud/__tests__/state.test.d.ts +2 -0
- package/dist/hud/__tests__/state.test.d.ts.map +1 -0
- package/dist/hud/__tests__/state.test.js +618 -0
- package/dist/hud/__tests__/state.test.js.map +1 -0
- package/dist/hud/__tests__/types.test.d.ts +2 -0
- package/dist/hud/__tests__/types.test.d.ts.map +1 -0
- package/dist/hud/__tests__/types.test.js +79 -0
- package/dist/hud/__tests__/types.test.js.map +1 -0
- package/dist/hud/__tests__/watch.test.d.ts +2 -0
- package/dist/hud/__tests__/watch.test.d.ts.map +1 -0
- package/dist/hud/__tests__/watch.test.js +63 -0
- package/dist/hud/__tests__/watch.test.js.map +1 -0
- package/dist/hud/authority.d.ts +17 -0
- package/dist/hud/authority.d.ts.map +1 -0
- package/dist/hud/authority.js +55 -0
- package/dist/hud/authority.js.map +1 -0
- package/dist/hud/colors.d.ts +19 -0
- package/dist/hud/colors.d.ts.map +1 -0
- package/dist/hud/colors.js +56 -0
- package/dist/hud/colors.js.map +1 -0
- package/dist/hud/constants.d.ts +5 -0
- package/dist/hud/constants.d.ts.map +1 -0
- package/dist/hud/constants.js +5 -0
- package/dist/hud/constants.js.map +1 -0
- package/dist/hud/index.d.ts +54 -0
- package/dist/hud/index.d.ts.map +1 -0
- package/dist/hud/index.js +239 -0
- package/dist/hud/index.js.map +1 -0
- package/dist/hud/reconcile.d.ts +25 -0
- package/dist/hud/reconcile.d.ts.map +1 -0
- package/dist/hud/reconcile.js +73 -0
- package/dist/hud/reconcile.js.map +1 -0
- package/dist/hud/render.d.ts +14 -0
- package/dist/hud/render.d.ts.map +1 -0
- package/dist/hud/render.js +312 -0
- package/dist/hud/render.js.map +1 -0
- package/dist/hud/state.d.ts +26 -0
- package/dist/hud/state.d.ts.map +1 -0
- package/dist/hud/state.js +385 -0
- package/dist/hud/state.js.map +1 -0
- package/dist/hud/tmux.d.ts +27 -0
- package/dist/hud/tmux.d.ts.map +1 -0
- package/dist/hud/tmux.js +139 -0
- package/dist/hud/tmux.js.map +1 -0
- package/dist/hud/types.d.ts +130 -0
- package/dist/hud/types.d.ts.map +1 -0
- package/dist/hud/types.js +14 -0
- package/dist/hud/types.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/__tests__/bootstrap.test.d.ts +2 -0
- package/dist/mcp/__tests__/bootstrap.test.d.ts.map +1 -0
- package/dist/mcp/__tests__/bootstrap.test.js +207 -0
- package/dist/mcp/__tests__/bootstrap.test.js.map +1 -0
- package/dist/mcp/__tests__/code-intel-server.test.d.ts +2 -0
- package/dist/mcp/__tests__/code-intel-server.test.d.ts.map +1 -0
- package/dist/mcp/__tests__/code-intel-server.test.js +70 -0
- package/dist/mcp/__tests__/code-intel-server.test.js.map +1 -0
- package/dist/mcp/__tests__/memory-server.test.d.ts +2 -0
- package/dist/mcp/__tests__/memory-server.test.d.ts.map +1 -0
- package/dist/mcp/__tests__/memory-server.test.js +36 -0
- package/dist/mcp/__tests__/memory-server.test.js.map +1 -0
- package/dist/mcp/__tests__/memory-validation.test.d.ts +2 -0
- package/dist/mcp/__tests__/memory-validation.test.d.ts.map +1 -0
- package/dist/mcp/__tests__/memory-validation.test.js +29 -0
- package/dist/mcp/__tests__/memory-validation.test.js.map +1 -0
- package/dist/mcp/__tests__/path-traversal.test.d.ts +2 -0
- package/dist/mcp/__tests__/path-traversal.test.d.ts.map +1 -0
- package/dist/mcp/__tests__/path-traversal.test.js +83 -0
- package/dist/mcp/__tests__/path-traversal.test.js.map +1 -0
- package/dist/mcp/__tests__/server-lifecycle.test.d.ts +2 -0
- package/dist/mcp/__tests__/server-lifecycle.test.d.ts.map +1 -0
- package/dist/mcp/__tests__/server-lifecycle.test.js +260 -0
- package/dist/mcp/__tests__/server-lifecycle.test.js.map +1 -0
- package/dist/mcp/__tests__/state-paths.test.d.ts +2 -0
- package/dist/mcp/__tests__/state-paths.test.d.ts.map +1 -0
- package/dist/mcp/__tests__/state-paths.test.js +209 -0
- package/dist/mcp/__tests__/state-paths.test.js.map +1 -0
- package/dist/mcp/__tests__/state-server-ralph-phase.test.d.ts +2 -0
- package/dist/mcp/__tests__/state-server-ralph-phase.test.d.ts.map +1 -0
- package/dist/mcp/__tests__/state-server-ralph-phase.test.js +109 -0
- package/dist/mcp/__tests__/state-server-ralph-phase.test.js.map +1 -0
- package/dist/mcp/__tests__/state-server-schema.test.d.ts +2 -0
- package/dist/mcp/__tests__/state-server-schema.test.d.ts.map +1 -0
- package/dist/mcp/__tests__/state-server-schema.test.js +29 -0
- package/dist/mcp/__tests__/state-server-schema.test.js.map +1 -0
- package/dist/mcp/__tests__/state-server-team-tools.test.d.ts +2 -0
- package/dist/mcp/__tests__/state-server-team-tools.test.d.ts.map +1 -0
- package/dist/mcp/__tests__/state-server-team-tools.test.js +35 -0
- package/dist/mcp/__tests__/state-server-team-tools.test.js.map +1 -0
- package/dist/mcp/__tests__/state-server.test.d.ts +2 -0
- package/dist/mcp/__tests__/state-server.test.d.ts.map +1 -0
- package/dist/mcp/__tests__/state-server.test.js +965 -0
- package/dist/mcp/__tests__/state-server.test.js.map +1 -0
- package/dist/mcp/__tests__/trace-server.test.d.ts +2 -0
- package/dist/mcp/__tests__/trace-server.test.d.ts.map +1 -0
- package/dist/mcp/__tests__/trace-server.test.js +119 -0
- package/dist/mcp/__tests__/trace-server.test.js.map +1 -0
- package/dist/mcp/__tests__/wiki-server.test.d.ts +2 -0
- package/dist/mcp/__tests__/wiki-server.test.d.ts.map +1 -0
- package/dist/mcp/__tests__/wiki-server.test.js +30 -0
- package/dist/mcp/__tests__/wiki-server.test.js.map +1 -0
- package/dist/mcp/bootstrap.d.ts +39 -0
- package/dist/mcp/bootstrap.d.ts.map +1 -0
- package/dist/mcp/bootstrap.js +335 -0
- package/dist/mcp/bootstrap.js.map +1 -0
- package/dist/mcp/code-intel-server.d.ts +333 -0
- package/dist/mcp/code-intel-server.d.ts.map +1 -0
- package/dist/mcp/code-intel-server.js +605 -0
- package/dist/mcp/code-intel-server.js.map +1 -0
- package/dist/mcp/memory-server.d.ts +201 -0
- package/dist/mcp/memory-server.d.ts.map +1 -0
- package/dist/mcp/memory-server.js +441 -0
- package/dist/mcp/memory-server.js.map +1 -0
- package/dist/mcp/memory-validation.d.ts +9 -0
- package/dist/mcp/memory-validation.d.ts.map +1 -0
- package/dist/mcp/memory-validation.js +11 -0
- package/dist/mcp/memory-validation.js.map +1 -0
- package/dist/mcp/state-paths.d.ts +42 -0
- package/dist/mcp/state-paths.d.ts.map +1 -0
- package/dist/mcp/state-paths.js +290 -0
- package/dist/mcp/state-paths.js.map +1 -0
- package/dist/mcp/state-server.d.ts +222 -0
- package/dist/mcp/state-server.d.ts.map +1 -0
- package/dist/mcp/state-server.js +181 -0
- package/dist/mcp/state-server.js.map +1 -0
- package/dist/mcp/trace-server.d.ts +81 -0
- package/dist/mcp/trace-server.d.ts.map +1 -0
- package/dist/mcp/trace-server.js +271 -0
- package/dist/mcp/trace-server.js.map +1 -0
- package/dist/mcp/wiki-server.d.ts +181 -0
- package/dist/mcp/wiki-server.d.ts.map +1 -0
- package/dist/mcp/wiki-server.js +235 -0
- package/dist/mcp/wiki-server.js.map +1 -0
- package/dist/modes/__tests__/base-autoresearch-contract.test.d.ts +2 -0
- package/dist/modes/__tests__/base-autoresearch-contract.test.d.ts.map +1 -0
- package/dist/modes/__tests__/base-autoresearch-contract.test.js +123 -0
- package/dist/modes/__tests__/base-autoresearch-contract.test.js.map +1 -0
- package/dist/modes/__tests__/base-multi-state-compat.test.d.ts +2 -0
- package/dist/modes/__tests__/base-multi-state-compat.test.d.ts.map +1 -0
- package/dist/modes/__tests__/base-multi-state-compat.test.js +38 -0
- package/dist/modes/__tests__/base-multi-state-compat.test.js.map +1 -0
- package/dist/modes/__tests__/base-ralph-contract.test.d.ts +2 -0
- package/dist/modes/__tests__/base-ralph-contract.test.d.ts.map +1 -0
- package/dist/modes/__tests__/base-ralph-contract.test.js +64 -0
- package/dist/modes/__tests__/base-ralph-contract.test.js.map +1 -0
- package/dist/modes/__tests__/base-session-scope.test.d.ts +2 -0
- package/dist/modes/__tests__/base-session-scope.test.d.ts.map +1 -0
- package/dist/modes/__tests__/base-session-scope.test.js +98 -0
- package/dist/modes/__tests__/base-session-scope.test.js.map +1 -0
- package/dist/modes/__tests__/base-tmux-pane.test.d.ts +2 -0
- package/dist/modes/__tests__/base-tmux-pane.test.d.ts.map +1 -0
- package/dist/modes/__tests__/base-tmux-pane.test.js +39 -0
- package/dist/modes/__tests__/base-tmux-pane.test.js.map +1 -0
- package/dist/modes/base.d.ts +56 -0
- package/dist/modes/base.d.ts.map +1 -0
- package/dist/modes/base.js +241 -0
- package/dist/modes/base.js.map +1 -0
- package/dist/notifications/__tests__/config.test.d.ts +2 -0
- package/dist/notifications/__tests__/config.test.d.ts.map +1 -0
- package/dist/notifications/__tests__/config.test.js +269 -0
- package/dist/notifications/__tests__/config.test.js.map +1 -0
- package/dist/notifications/__tests__/custom-alias-enablement.test.d.ts +2 -0
- package/dist/notifications/__tests__/custom-alias-enablement.test.d.ts.map +1 -0
- package/dist/notifications/__tests__/custom-alias-enablement.test.js +84 -0
- package/dist/notifications/__tests__/custom-alias-enablement.test.js.map +1 -0
- package/dist/notifications/__tests__/dispatch-cooldown.test.d.ts +5 -0
- package/dist/notifications/__tests__/dispatch-cooldown.test.d.ts.map +1 -0
- package/dist/notifications/__tests__/dispatch-cooldown.test.js +100 -0
- package/dist/notifications/__tests__/dispatch-cooldown.test.js.map +1 -0
- package/dist/notifications/__tests__/dispatcher.test.d.ts +2 -0
- package/dist/notifications/__tests__/dispatcher.test.d.ts.map +1 -0
- package/dist/notifications/__tests__/dispatcher.test.js +202 -0
- package/dist/notifications/__tests__/dispatcher.test.js.map +1 -0
- package/dist/notifications/__tests__/formatter.test.d.ts +2 -0
- package/dist/notifications/__tests__/formatter.test.d.ts.map +1 -0
- package/dist/notifications/__tests__/formatter.test.js +270 -0
- package/dist/notifications/__tests__/formatter.test.js.map +1 -0
- package/dist/notifications/__tests__/hook-config.test.d.ts +5 -0
- package/dist/notifications/__tests__/hook-config.test.d.ts.map +1 -0
- package/dist/notifications/__tests__/hook-config.test.js +139 -0
- package/dist/notifications/__tests__/hook-config.test.js.map +1 -0
- package/dist/notifications/__tests__/idle-cooldown.test.d.ts +5 -0
- package/dist/notifications/__tests__/idle-cooldown.test.d.ts.map +1 -0
- package/dist/notifications/__tests__/idle-cooldown.test.js +209 -0
- package/dist/notifications/__tests__/idle-cooldown.test.js.map +1 -0
- package/dist/notifications/__tests__/index.test.d.ts +2 -0
- package/dist/notifications/__tests__/index.test.d.ts.map +1 -0
- package/dist/notifications/__tests__/index.test.js +188 -0
- package/dist/notifications/__tests__/index.test.js.map +1 -0
- package/dist/notifications/__tests__/lifecycle-dedupe.test.d.ts +2 -0
- package/dist/notifications/__tests__/lifecycle-dedupe.test.d.ts.map +1 -0
- package/dist/notifications/__tests__/lifecycle-dedupe.test.js +86 -0
- package/dist/notifications/__tests__/lifecycle-dedupe.test.js.map +1 -0
- package/dist/notifications/__tests__/notifier.test.d.ts +2 -0
- package/dist/notifications/__tests__/notifier.test.d.ts.map +1 -0
- package/dist/notifications/__tests__/notifier.test.js +239 -0
- package/dist/notifications/__tests__/notifier.test.js.map +1 -0
- package/dist/notifications/__tests__/profiles.test.d.ts +2 -0
- package/dist/notifications/__tests__/profiles.test.d.ts.map +1 -0
- package/dist/notifications/__tests__/profiles.test.js +404 -0
- package/dist/notifications/__tests__/profiles.test.js.map +1 -0
- package/dist/notifications/__tests__/reply-config.test.d.ts +2 -0
- package/dist/notifications/__tests__/reply-config.test.d.ts.map +1 -0
- package/dist/notifications/__tests__/reply-config.test.js +79 -0
- package/dist/notifications/__tests__/reply-config.test.js.map +1 -0
- package/dist/notifications/__tests__/reply-listener.test.d.ts +2 -0
- package/dist/notifications/__tests__/reply-listener.test.d.ts.map +1 -0
- package/dist/notifications/__tests__/reply-listener.test.js +723 -0
- package/dist/notifications/__tests__/reply-listener.test.js.map +1 -0
- package/dist/notifications/__tests__/session-idle-tail-dedupe.test.d.ts +2 -0
- package/dist/notifications/__tests__/session-idle-tail-dedupe.test.d.ts.map +1 -0
- package/dist/notifications/__tests__/session-idle-tail-dedupe.test.js +93 -0
- package/dist/notifications/__tests__/session-idle-tail-dedupe.test.js.map +1 -0
- package/dist/notifications/__tests__/session-registry.test.d.ts +2 -0
- package/dist/notifications/__tests__/session-registry.test.d.ts.map +1 -0
- package/dist/notifications/__tests__/session-registry.test.js +234 -0
- package/dist/notifications/__tests__/session-registry.test.js.map +1 -0
- package/dist/notifications/__tests__/session-status.test.d.ts +2 -0
- package/dist/notifications/__tests__/session-status.test.d.ts.map +1 -0
- package/dist/notifications/__tests__/session-status.test.js +249 -0
- package/dist/notifications/__tests__/session-status.test.js.map +1 -0
- package/dist/notifications/__tests__/temp-mode.test.d.ts +2 -0
- package/dist/notifications/__tests__/temp-mode.test.d.ts.map +1 -0
- package/dist/notifications/__tests__/temp-mode.test.js +172 -0
- package/dist/notifications/__tests__/temp-mode.test.js.map +1 -0
- package/dist/notifications/__tests__/template-engine.test.d.ts +5 -0
- package/dist/notifications/__tests__/template-engine.test.d.ts.map +1 -0
- package/dist/notifications/__tests__/template-engine.test.js +158 -0
- package/dist/notifications/__tests__/template-engine.test.js.map +1 -0
- package/dist/notifications/__tests__/tmux-detector.test.d.ts +2 -0
- package/dist/notifications/__tests__/tmux-detector.test.d.ts.map +1 -0
- package/dist/notifications/__tests__/tmux-detector.test.js +208 -0
- package/dist/notifications/__tests__/tmux-detector.test.js.map +1 -0
- package/dist/notifications/__tests__/tmux.test.d.ts +2 -0
- package/dist/notifications/__tests__/tmux.test.d.ts.map +1 -0
- package/dist/notifications/__tests__/tmux.test.js +285 -0
- package/dist/notifications/__tests__/tmux.test.js.map +1 -0
- package/dist/notifications/__tests__/verbosity.test.d.ts +2 -0
- package/dist/notifications/__tests__/verbosity.test.d.ts.map +1 -0
- package/dist/notifications/__tests__/verbosity.test.js +237 -0
- package/dist/notifications/__tests__/verbosity.test.js.map +1 -0
- package/dist/notifications/config.d.ts +65 -0
- package/dist/notifications/config.d.ts.map +1 -0
- package/dist/notifications/config.js +612 -0
- package/dist/notifications/config.js.map +1 -0
- package/dist/notifications/dispatch-cooldown.d.ts +36 -0
- package/dist/notifications/dispatch-cooldown.d.ts.map +1 -0
- package/dist/notifications/dispatch-cooldown.js +109 -0
- package/dist/notifications/dispatch-cooldown.js.map +1 -0
- package/dist/notifications/dispatcher.d.ts +15 -0
- package/dist/notifications/dispatcher.d.ts.map +1 -0
- package/dist/notifications/dispatcher.js +410 -0
- package/dist/notifications/dispatcher.js.map +1 -0
- package/dist/notifications/formatter.d.ts +30 -0
- package/dist/notifications/formatter.d.ts.map +1 -0
- package/dist/notifications/formatter.js +234 -0
- package/dist/notifications/formatter.js.map +1 -0
- package/dist/notifications/hook-config-types.d.ts +43 -0
- package/dist/notifications/hook-config-types.d.ts.map +1 -0
- package/dist/notifications/hook-config-types.js +8 -0
- package/dist/notifications/hook-config-types.js.map +1 -0
- package/dist/notifications/hook-config.d.ts +40 -0
- package/dist/notifications/hook-config.d.ts.map +1 -0
- package/dist/notifications/hook-config.js +127 -0
- package/dist/notifications/hook-config.js.map +1 -0
- package/dist/notifications/idle-cooldown.d.ts +61 -0
- package/dist/notifications/idle-cooldown.d.ts.map +1 -0
- package/dist/notifications/idle-cooldown.js +207 -0
- package/dist/notifications/idle-cooldown.js.map +1 -0
- package/dist/notifications/index.d.ts +40 -0
- package/dist/notifications/index.d.ts.map +1 -0
- package/dist/notifications/index.js +228 -0
- package/dist/notifications/index.js.map +1 -0
- package/dist/notifications/lifecycle-dedupe.d.ts +8 -0
- package/dist/notifications/lifecycle-dedupe.d.ts.map +1 -0
- package/dist/notifications/lifecycle-dedupe.js +112 -0
- package/dist/notifications/lifecycle-dedupe.js.map +1 -0
- package/dist/notifications/notifier.d.ts +44 -0
- package/dist/notifications/notifier.d.ts.map +1 -0
- package/dist/notifications/notifier.js +151 -0
- package/dist/notifications/notifier.js.map +1 -0
- package/dist/notifications/reply-listener.d.ts +123 -0
- package/dist/notifications/reply-listener.d.ts.map +1 -0
- package/dist/notifications/reply-listener.js +846 -0
- package/dist/notifications/reply-listener.js.map +1 -0
- package/dist/notifications/session-registry.d.ts +26 -0
- package/dist/notifications/session-registry.d.ts.map +1 -0
- package/dist/notifications/session-registry.js +293 -0
- package/dist/notifications/session-registry.js.map +1 -0
- package/dist/notifications/session-status.d.ts +25 -0
- package/dist/notifications/session-status.d.ts.map +1 -0
- package/dist/notifications/session-status.js +202 -0
- package/dist/notifications/session-status.js.map +1 -0
- package/dist/notifications/temp-contract.d.ts +22 -0
- package/dist/notifications/temp-contract.d.ts.map +1 -0
- package/dist/notifications/temp-contract.js +147 -0
- package/dist/notifications/temp-contract.js.map +1 -0
- package/dist/notifications/template-engine.d.ts +34 -0
- package/dist/notifications/template-engine.d.ts.map +1 -0
- package/dist/notifications/template-engine.js +249 -0
- package/dist/notifications/template-engine.js.map +1 -0
- package/dist/notifications/tmux-detector.d.ts +59 -0
- package/dist/notifications/tmux-detector.d.ts.map +1 -0
- package/dist/notifications/tmux-detector.js +129 -0
- package/dist/notifications/tmux-detector.js.map +1 -0
- package/dist/notifications/tmux.d.ts +44 -0
- package/dist/notifications/tmux.d.ts.map +1 -0
- package/dist/notifications/tmux.js +293 -0
- package/dist/notifications/tmux.js.map +1 -0
- package/dist/notifications/types.d.ts +224 -0
- package/dist/notifications/types.d.ts.map +1 -0
- package/dist/notifications/types.js +9 -0
- package/dist/notifications/types.js.map +1 -0
- package/dist/openclaw/__tests__/config.test.d.ts +6 -0
- package/dist/openclaw/__tests__/config.test.d.ts.map +1 -0
- package/dist/openclaw/__tests__/config.test.js +344 -0
- package/dist/openclaw/__tests__/config.test.js.map +1 -0
- package/dist/openclaw/__tests__/dispatcher.test.d.ts +5 -0
- package/dist/openclaw/__tests__/dispatcher.test.d.ts.map +1 -0
- package/dist/openclaw/__tests__/dispatcher.test.js +169 -0
- package/dist/openclaw/__tests__/dispatcher.test.js.map +1 -0
- package/dist/openclaw/__tests__/index.test.d.ts +6 -0
- package/dist/openclaw/__tests__/index.test.d.ts.map +1 -0
- package/dist/openclaw/__tests__/index.test.js +382 -0
- package/dist/openclaw/__tests__/index.test.js.map +1 -0
- package/dist/openclaw/config.d.ts +59 -0
- package/dist/openclaw/config.d.ts.map +1 -0
- package/dist/openclaw/config.js +400 -0
- package/dist/openclaw/config.js.map +1 -0
- package/dist/openclaw/dispatcher.d.ts +72 -0
- package/dist/openclaw/dispatcher.d.ts.map +1 -0
- package/dist/openclaw/dispatcher.js +259 -0
- package/dist/openclaw/dispatcher.js.map +1 -0
- package/dist/openclaw/index.d.ts +29 -0
- package/dist/openclaw/index.d.ts.map +1 -0
- package/dist/openclaw/index.js +149 -0
- package/dist/openclaw/index.js.map +1 -0
- package/dist/openclaw/types.d.ts +123 -0
- package/dist/openclaw/types.d.ts.map +1 -0
- package/dist/openclaw/types.js +12 -0
- package/dist/openclaw/types.js.map +1 -0
- package/dist/pipeline/__tests__/orchestrator.test.d.ts +2 -0
- package/dist/pipeline/__tests__/orchestrator.test.d.ts.map +1 -0
- package/dist/pipeline/__tests__/orchestrator.test.js +505 -0
- package/dist/pipeline/__tests__/orchestrator.test.js.map +1 -0
- package/dist/pipeline/__tests__/stages.test.d.ts +2 -0
- package/dist/pipeline/__tests__/stages.test.d.ts.map +1 -0
- package/dist/pipeline/__tests__/stages.test.js +754 -0
- package/dist/pipeline/__tests__/stages.test.js.map +1 -0
- package/dist/pipeline/index.d.ts +19 -0
- package/dist/pipeline/index.d.ts.map +1 -0
- package/dist/pipeline/index.js +14 -0
- package/dist/pipeline/index.js.map +1 -0
- package/dist/pipeline/orchestrator.d.ts +51 -0
- package/dist/pipeline/orchestrator.d.ts.map +1 -0
- package/dist/pipeline/orchestrator.js +324 -0
- package/dist/pipeline/orchestrator.js.map +1 -0
- package/dist/pipeline/review-verdict.d.ts +3 -0
- package/dist/pipeline/review-verdict.d.ts.map +1 -0
- package/dist/pipeline/review-verdict.js +14 -0
- package/dist/pipeline/review-verdict.js.map +1 -0
- package/dist/pipeline/stages/code-review.d.ts +33 -0
- package/dist/pipeline/stages/code-review.d.ts.map +1 -0
- package/dist/pipeline/stages/code-review.js +51 -0
- package/dist/pipeline/stages/code-review.js.map +1 -0
- package/dist/pipeline/stages/ralph-verify.d.ts +53 -0
- package/dist/pipeline/stages/ralph-verify.d.ts.map +1 -0
- package/dist/pipeline/stages/ralph-verify.js +89 -0
- package/dist/pipeline/stages/ralph-verify.js.map +1 -0
- package/dist/pipeline/stages/ralplan.d.ts +25 -0
- package/dist/pipeline/stages/ralplan.d.ts.map +1 -0
- package/dist/pipeline/stages/ralplan.js +107 -0
- package/dist/pipeline/stages/ralplan.js.map +1 -0
- package/dist/pipeline/stages/team-exec.d.ts +50 -0
- package/dist/pipeline/stages/team-exec.d.ts.map +1 -0
- package/dist/pipeline/stages/team-exec.js +263 -0
- package/dist/pipeline/stages/team-exec.js.map +1 -0
- package/dist/pipeline/types.d.ts +122 -0
- package/dist/pipeline/types.d.ts.map +1 -0
- package/dist/pipeline/types.js +8 -0
- package/dist/pipeline/types.js.map +1 -0
- 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 +544 -0
- package/dist/planning/__tests__/artifacts.test.js.map +1 -0
- package/dist/planning/artifact-names.d.ts +13 -0
- package/dist/planning/artifact-names.d.ts.map +1 -0
- package/dist/planning/artifact-names.js +108 -0
- package/dist/planning/artifact-names.js.map +1 -0
- package/dist/planning/artifacts.d.ts +61 -0
- package/dist/planning/artifacts.d.ts.map +1 -0
- package/dist/planning/artifacts.js +308 -0
- package/dist/planning/artifacts.js.map +1 -0
- package/dist/question/__tests__/client.test.d.ts +2 -0
- package/dist/question/__tests__/client.test.d.ts.map +1 -0
- package/dist/question/__tests__/client.test.js +90 -0
- package/dist/question/__tests__/client.test.js.map +1 -0
- package/dist/question/__tests__/deep-interview.test.d.ts +2 -0
- package/dist/question/__tests__/deep-interview.test.d.ts.map +1 -0
- package/dist/question/__tests__/deep-interview.test.js +209 -0
- package/dist/question/__tests__/deep-interview.test.js.map +1 -0
- package/dist/question/__tests__/policy.test.d.ts +2 -0
- package/dist/question/__tests__/policy.test.d.ts.map +1 -0
- package/dist/question/__tests__/policy.test.js +107 -0
- package/dist/question/__tests__/policy.test.js.map +1 -0
- package/dist/question/__tests__/renderer.test.d.ts +2 -0
- package/dist/question/__tests__/renderer.test.d.ts.map +1 -0
- package/dist/question/__tests__/renderer.test.js +707 -0
- package/dist/question/__tests__/renderer.test.js.map +1 -0
- package/dist/question/__tests__/state.test.d.ts +2 -0
- package/dist/question/__tests__/state.test.d.ts.map +1 -0
- package/dist/question/__tests__/state.test.js +102 -0
- package/dist/question/__tests__/state.test.js.map +1 -0
- package/dist/question/__tests__/types.test.d.ts +2 -0
- package/dist/question/__tests__/types.test.d.ts.map +1 -0
- package/dist/question/__tests__/types.test.js +65 -0
- package/dist/question/__tests__/types.test.js.map +1 -0
- package/dist/question/__tests__/ui.test.d.ts +2 -0
- package/dist/question/__tests__/ui.test.d.ts.map +1 -0
- package/dist/question/__tests__/ui.test.js +446 -0
- package/dist/question/__tests__/ui.test.js.map +1 -0
- package/dist/question/client.d.ts +64 -0
- package/dist/question/client.d.ts.map +1 -0
- package/dist/question/client.js +77 -0
- package/dist/question/client.js.map +1 -0
- package/dist/question/deep-interview.d.ts +31 -0
- package/dist/question/deep-interview.d.ts.map +1 -0
- package/dist/question/deep-interview.js +196 -0
- package/dist/question/deep-interview.js.map +1 -0
- package/dist/question/policy.d.ts +18 -0
- package/dist/question/policy.d.ts.map +1 -0
- package/dist/question/policy.js +77 -0
- package/dist/question/policy.js.map +1 -0
- package/dist/question/renderer.d.ts +46 -0
- package/dist/question/renderer.d.ts.map +1 -0
- package/dist/question/renderer.js +498 -0
- package/dist/question/renderer.js.map +1 -0
- package/dist/question/state.d.ts +21 -0
- package/dist/question/state.d.ts.map +1 -0
- package/dist/question/state.js +121 -0
- package/dist/question/state.js.map +1 -0
- package/dist/question/types.d.ts +91 -0
- package/dist/question/types.d.ts.map +1 -0
- package/dist/question/types.js +117 -0
- package/dist/question/types.js.map +1 -0
- package/dist/question/ui.d.ts +53 -0
- package/dist/question/ui.d.ts.map +1 -0
- package/dist/question/ui.js +435 -0
- package/dist/question/ui.js.map +1 -0
- package/dist/ralph/__tests__/persistence.test.d.ts +2 -0
- package/dist/ralph/__tests__/persistence.test.d.ts.map +1 -0
- package/dist/ralph/__tests__/persistence.test.js +116 -0
- package/dist/ralph/__tests__/persistence.test.js.map +1 -0
- package/dist/ralph/contract.d.ts +17 -0
- package/dist/ralph/contract.d.ts.map +1 -0
- package/dist/ralph/contract.js +108 -0
- package/dist/ralph/contract.js.map +1 -0
- package/dist/ralph/persistence.d.ts +29 -0
- package/dist/ralph/persistence.d.ts.map +1 -0
- package/dist/ralph/persistence.js +267 -0
- package/dist/ralph/persistence.js.map +1 -0
- package/dist/ralplan/__tests__/runtime.test.d.ts +2 -0
- package/dist/ralplan/__tests__/runtime.test.d.ts.map +1 -0
- package/dist/ralplan/__tests__/runtime.test.js +165 -0
- package/dist/ralplan/__tests__/runtime.test.js.map +1 -0
- package/dist/ralplan/runtime.d.ts +52 -0
- package/dist/ralplan/runtime.d.ts.map +1 -0
- package/dist/ralplan/runtime.js +202 -0
- package/dist/ralplan/runtime.js.map +1 -0
- package/dist/runtime/__tests__/bridge.test.d.ts +2 -0
- package/dist/runtime/__tests__/bridge.test.d.ts.map +1 -0
- package/dist/runtime/__tests__/bridge.test.js +194 -0
- package/dist/runtime/__tests__/bridge.test.js.map +1 -0
- package/dist/runtime/__tests__/run-loop.test.d.ts +2 -0
- package/dist/runtime/__tests__/run-loop.test.d.ts.map +1 -0
- package/dist/runtime/__tests__/run-loop.test.js +35 -0
- package/dist/runtime/__tests__/run-loop.test.js.map +1 -0
- package/dist/runtime/__tests__/run-outcome.test.d.ts +2 -0
- package/dist/runtime/__tests__/run-outcome.test.d.ts.map +1 -0
- package/dist/runtime/__tests__/run-outcome.test.js +102 -0
- package/dist/runtime/__tests__/run-outcome.test.js.map +1 -0
- package/dist/runtime/__tests__/run-state.test.d.ts +2 -0
- package/dist/runtime/__tests__/run-state.test.d.ts.map +1 -0
- package/dist/runtime/__tests__/run-state.test.js +37 -0
- package/dist/runtime/__tests__/run-state.test.js.map +1 -0
- package/dist/runtime/bridge.d.ts +214 -0
- package/dist/runtime/bridge.d.ts.map +1 -0
- package/dist/runtime/bridge.js +223 -0
- package/dist/runtime/bridge.js.map +1 -0
- package/dist/runtime/run-loop.d.ts +45 -0
- package/dist/runtime/run-loop.d.ts.map +1 -0
- package/dist/runtime/run-loop.js +51 -0
- package/dist/runtime/run-loop.js.map +1 -0
- package/dist/runtime/run-outcome.d.ts +46 -0
- package/dist/runtime/run-outcome.d.ts.map +1 -0
- package/dist/runtime/run-outcome.js +285 -0
- package/dist/runtime/run-outcome.js.map +1 -0
- package/dist/runtime/run-state.d.ts +40 -0
- package/dist/runtime/run-state.d.ts.map +1 -0
- package/dist/runtime/run-state.js +120 -0
- package/dist/runtime/run-state.js.map +1 -0
- package/dist/runtime/terminal-lifecycle.d.ts +11 -0
- package/dist/runtime/terminal-lifecycle.d.ts.map +1 -0
- package/dist/runtime/terminal-lifecycle.js +52 -0
- package/dist/runtime/terminal-lifecycle.js.map +1 -0
- package/dist/scripts/__tests__/codex-native-hook.test.d.ts +2 -0
- package/dist/scripts/__tests__/codex-native-hook.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/codex-native-hook.test.js +6788 -0
- package/dist/scripts/__tests__/codex-native-hook.test.js.map +1 -0
- package/dist/scripts/__tests__/generate-release-body.test.d.ts +2 -0
- package/dist/scripts/__tests__/generate-release-body.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/generate-release-body.test.js +233 -0
- package/dist/scripts/__tests__/generate-release-body.test.js.map +1 -0
- package/dist/scripts/__tests__/hook-derived-watcher.test.d.ts +2 -0
- package/dist/scripts/__tests__/hook-derived-watcher.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/hook-derived-watcher.test.js +195 -0
- package/dist/scripts/__tests__/hook-derived-watcher.test.js.map +1 -0
- package/dist/scripts/__tests__/postinstall.test.d.ts +2 -0
- package/dist/scripts/__tests__/postinstall.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/postinstall.test.js +92 -0
- package/dist/scripts/__tests__/postinstall.test.js.map +1 -0
- package/dist/scripts/__tests__/prompt-inventory.test.d.ts +2 -0
- package/dist/scripts/__tests__/prompt-inventory.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/prompt-inventory.test.js +56 -0
- package/dist/scripts/__tests__/prompt-inventory.test.js.map +1 -0
- package/dist/scripts/__tests__/run-test-files.test.d.ts +2 -0
- package/dist/scripts/__tests__/run-test-files.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/run-test-files.test.js +62 -0
- package/dist/scripts/__tests__/run-test-files.test.js.map +1 -0
- package/dist/scripts/__tests__/smoke-packed-install.test.d.ts +2 -0
- package/dist/scripts/__tests__/smoke-packed-install.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/smoke-packed-install.test.js +135 -0
- package/dist/scripts/__tests__/smoke-packed-install.test.js.map +1 -0
- package/dist/scripts/__tests__/test-reply-listener-live.test.d.ts +2 -0
- package/dist/scripts/__tests__/test-reply-listener-live.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/test-reply-listener-live.test.js +82 -0
- package/dist/scripts/__tests__/test-reply-listener-live.test.js.map +1 -0
- package/dist/scripts/__tests__/verify-native-agents.test.d.ts +2 -0
- package/dist/scripts/__tests__/verify-native-agents.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/verify-native-agents.test.js +166 -0
- package/dist/scripts/__tests__/verify-native-agents.test.js.map +1 -0
- package/dist/scripts/build-explore-harness.d.ts +3 -0
- package/dist/scripts/build-explore-harness.d.ts.map +1 -0
- package/dist/scripts/build-explore-harness.js +50 -0
- package/dist/scripts/build-explore-harness.js.map +1 -0
- package/dist/scripts/build-sparkshell.d.ts +2 -0
- package/dist/scripts/build-sparkshell.d.ts.map +1 -0
- package/dist/scripts/build-sparkshell.js +46 -0
- package/dist/scripts/build-sparkshell.js.map +1 -0
- package/dist/scripts/check-runtime-syntax.d.ts +3 -0
- package/dist/scripts/check-runtime-syntax.d.ts.map +1 -0
- package/dist/scripts/check-runtime-syntax.js +57 -0
- package/dist/scripts/check-runtime-syntax.js.map +1 -0
- package/dist/scripts/check-version-sync.d.ts +3 -0
- package/dist/scripts/check-version-sync.d.ts.map +1 -0
- package/dist/scripts/check-version-sync.js +49 -0
- package/dist/scripts/check-version-sync.js.map +1 -0
- package/dist/scripts/cleanup-explore-harness.d.ts +3 -0
- package/dist/scripts/cleanup-explore-harness.d.ts.map +1 -0
- package/dist/scripts/cleanup-explore-harness.js +16 -0
- package/dist/scripts/cleanup-explore-harness.js.map +1 -0
- package/dist/scripts/codex-execution-surface.d.ts +16 -0
- package/dist/scripts/codex-execution-surface.d.ts.map +1 -0
- package/dist/scripts/codex-execution-surface.js +42 -0
- package/dist/scripts/codex-execution-surface.js.map +1 -0
- package/dist/scripts/codex-native-hook.d.ts +25 -0
- package/dist/scripts/codex-native-hook.d.ts.map +1 -0
- package/dist/scripts/codex-native-hook.js +1879 -0
- package/dist/scripts/codex-native-hook.js.map +1 -0
- package/dist/scripts/codex-native-pre-post.d.ts +39 -0
- package/dist/scripts/codex-native-pre-post.d.ts.map +1 -0
- package/dist/scripts/codex-native-pre-post.js +824 -0
- package/dist/scripts/codex-native-pre-post.js.map +1 -0
- package/dist/scripts/eval/eval-candidate-handoff.d.ts +2 -0
- package/dist/scripts/eval/eval-candidate-handoff.d.ts.map +1 -0
- package/dist/scripts/eval/eval-candidate-handoff.js +11 -0
- package/dist/scripts/eval/eval-candidate-handoff.js.map +1 -0
- package/dist/scripts/eval/eval-cli-discoverability.d.ts +3 -0
- package/dist/scripts/eval/eval-cli-discoverability.d.ts.map +1 -0
- package/dist/scripts/eval/eval-cli-discoverability.js +37 -0
- package/dist/scripts/eval/eval-cli-discoverability.js.map +1 -0
- package/dist/scripts/eval/eval-fresh-run-tagging.d.ts +2 -0
- package/dist/scripts/eval/eval-fresh-run-tagging.d.ts.map +1 -0
- package/dist/scripts/eval/eval-fresh-run-tagging.js +11 -0
- package/dist/scripts/eval/eval-fresh-run-tagging.js.map +1 -0
- package/dist/scripts/eval/eval-help-consistency.d.ts +2 -0
- package/dist/scripts/eval/eval-help-consistency.d.ts.map +1 -0
- package/dist/scripts/eval/eval-help-consistency.js +12 -0
- package/dist/scripts/eval/eval-help-consistency.js.map +1 -0
- package/dist/scripts/eval/eval-in-action-cat-shellout-demo.d.ts +2 -0
- package/dist/scripts/eval/eval-in-action-cat-shellout-demo.d.ts.map +1 -0
- package/dist/scripts/eval/eval-in-action-cat-shellout-demo.js +31 -0
- package/dist/scripts/eval/eval-in-action-cat-shellout-demo.js.map +1 -0
- package/dist/scripts/eval/eval-parity-smoke.d.ts +2 -0
- package/dist/scripts/eval/eval-parity-smoke.d.ts.map +1 -0
- package/dist/scripts/eval/eval-parity-smoke.js +23 -0
- package/dist/scripts/eval/eval-parity-smoke.js.map +1 -0
- package/dist/scripts/eval/eval-parity-sweep.d.ts +2 -0
- package/dist/scripts/eval/eval-parity-sweep.d.ts.map +1 -0
- package/dist/scripts/eval/eval-parity-sweep.js +29 -0
- package/dist/scripts/eval/eval-parity-sweep.js.map +1 -0
- package/dist/scripts/eval/eval-resume-dirty-guard.d.ts +2 -0
- package/dist/scripts/eval/eval-resume-dirty-guard.d.ts.map +1 -0
- package/dist/scripts/eval/eval-resume-dirty-guard.js +11 -0
- package/dist/scripts/eval/eval-resume-dirty-guard.js.map +1 -0
- package/dist/scripts/eval/eval-security-path-traversal.d.ts +3 -0
- package/dist/scripts/eval/eval-security-path-traversal.d.ts.map +1 -0
- package/dist/scripts/eval/eval-security-path-traversal.js +35 -0
- package/dist/scripts/eval/eval-security-path-traversal.js.map +1 -0
- package/dist/scripts/fixtures/ask-advisor-stub.d.ts +3 -0
- package/dist/scripts/fixtures/ask-advisor-stub.d.ts.map +1 -0
- package/dist/scripts/fixtures/ask-advisor-stub.js +13 -0
- package/dist/scripts/fixtures/ask-advisor-stub.js.map +1 -0
- package/dist/scripts/generate-catalog-docs.d.ts +3 -0
- package/dist/scripts/generate-catalog-docs.d.ts.map +1 -0
- package/dist/scripts/generate-catalog-docs.js +99 -0
- package/dist/scripts/generate-catalog-docs.js.map +1 -0
- package/dist/scripts/generate-native-release-manifest.d.ts +3 -0
- package/dist/scripts/generate-native-release-manifest.d.ts.map +1 -0
- package/dist/scripts/generate-native-release-manifest.js +107 -0
- package/dist/scripts/generate-native-release-manifest.js.map +1 -0
- package/dist/scripts/generate-release-body.d.ts +35 -0
- package/dist/scripts/generate-release-body.d.ts.map +1 -0
- package/dist/scripts/generate-release-body.js +278 -0
- package/dist/scripts/generate-release-body.js.map +1 -0
- package/dist/scripts/hook-derived-watcher.d.ts +3 -0
- package/dist/scripts/hook-derived-watcher.d.ts.map +1 -0
- package/dist/scripts/hook-derived-watcher.js +556 -0
- package/dist/scripts/hook-derived-watcher.js.map +1 -0
- package/dist/scripts/notify-fallback-watcher.d.ts +3 -0
- package/dist/scripts/notify-fallback-watcher.d.ts.map +1 -0
- package/dist/scripts/notify-fallback-watcher.js +1755 -0
- package/dist/scripts/notify-fallback-watcher.js.map +1 -0
- package/dist/scripts/notify-hook/__tests__/operational-events.test.d.ts +2 -0
- package/dist/scripts/notify-hook/__tests__/operational-events.test.d.ts.map +1 -0
- package/dist/scripts/notify-hook/__tests__/operational-events.test.js +24 -0
- package/dist/scripts/notify-hook/__tests__/operational-events.test.js.map +1 -0
- package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.d.ts +2 -0
- package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.d.ts.map +1 -0
- package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.js +153 -0
- package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.js.map +1 -0
- package/dist/scripts/notify-hook/active-team.d.ts +9 -0
- package/dist/scripts/notify-hook/active-team.d.ts.map +1 -0
- package/dist/scripts/notify-hook/active-team.js +45 -0
- package/dist/scripts/notify-hook/active-team.js.map +1 -0
- package/dist/scripts/notify-hook/auto-nudge.d.ts +96 -0
- package/dist/scripts/notify-hook/auto-nudge.d.ts.map +1 -0
- package/dist/scripts/notify-hook/auto-nudge.js +696 -0
- package/dist/scripts/notify-hook/auto-nudge.js.map +1 -0
- package/dist/scripts/notify-hook/log.d.ts +6 -0
- package/dist/scripts/notify-hook/log.d.ts.map +1 -0
- package/dist/scripts/notify-hook/log.js +22 -0
- package/dist/scripts/notify-hook/log.js.map +1 -0
- package/dist/scripts/notify-hook/managed-tmux.d.ts +21 -0
- package/dist/scripts/notify-hook/managed-tmux.d.ts.map +1 -0
- package/dist/scripts/notify-hook/managed-tmux.js +556 -0
- package/dist/scripts/notify-hook/managed-tmux.js.map +1 -0
- package/dist/scripts/notify-hook/operational-events.d.ts +14 -0
- package/dist/scripts/notify-hook/operational-events.d.ts.map +1 -0
- package/dist/scripts/notify-hook/operational-events.js +255 -0
- package/dist/scripts/notify-hook/operational-events.js.map +1 -0
- package/dist/scripts/notify-hook/orchestration-intent.d.ts +18 -0
- package/dist/scripts/notify-hook/orchestration-intent.d.ts.map +1 -0
- package/dist/scripts/notify-hook/orchestration-intent.js +72 -0
- package/dist/scripts/notify-hook/orchestration-intent.js.map +1 -0
- package/dist/scripts/notify-hook/payload-parser.d.ts +13 -0
- package/dist/scripts/notify-hook/payload-parser.d.ts.map +1 -0
- package/dist/scripts/notify-hook/payload-parser.js +134 -0
- package/dist/scripts/notify-hook/payload-parser.js.map +1 -0
- package/dist/scripts/notify-hook/process-runner.d.ts +9 -0
- package/dist/scripts/notify-hook/process-runner.d.ts.map +1 -0
- package/dist/scripts/notify-hook/process-runner.js +102 -0
- package/dist/scripts/notify-hook/process-runner.js.map +1 -0
- package/dist/scripts/notify-hook/ralph-session-resume.d.ts +22 -0
- package/dist/scripts/notify-hook/ralph-session-resume.d.ts.map +1 -0
- package/dist/scripts/notify-hook/ralph-session-resume.js +300 -0
- package/dist/scripts/notify-hook/ralph-session-resume.js.map +1 -0
- package/dist/scripts/notify-hook/state-io.d.ts +21 -0
- package/dist/scripts/notify-hook/state-io.d.ts.map +1 -0
- package/dist/scripts/notify-hook/state-io.js +144 -0
- package/dist/scripts/notify-hook/state-io.js.map +1 -0
- package/dist/scripts/notify-hook/team-dispatch.d.ts +36 -0
- package/dist/scripts/notify-hook/team-dispatch.d.ts.map +1 -0
- package/dist/scripts/notify-hook/team-dispatch.js +1065 -0
- package/dist/scripts/notify-hook/team-dispatch.js.map +1 -0
- package/dist/scripts/notify-hook/team-leader-nudge.d.ts +23 -0
- package/dist/scripts/notify-hook/team-leader-nudge.d.ts.map +1 -0
- package/dist/scripts/notify-hook/team-leader-nudge.js +1055 -0
- package/dist/scripts/notify-hook/team-leader-nudge.js.map +1 -0
- package/dist/scripts/notify-hook/team-tmux-guard.d.ts +14 -0
- package/dist/scripts/notify-hook/team-tmux-guard.d.ts.map +1 -0
- package/dist/scripts/notify-hook/team-tmux-guard.js +161 -0
- package/dist/scripts/notify-hook/team-tmux-guard.js.map +1 -0
- package/dist/scripts/notify-hook/team-worker-posttooluse.d.ts +34 -0
- package/dist/scripts/notify-hook/team-worker-posttooluse.d.ts.map +1 -0
- package/dist/scripts/notify-hook/team-worker-posttooluse.js +434 -0
- package/dist/scripts/notify-hook/team-worker-posttooluse.js.map +1 -0
- package/dist/scripts/notify-hook/team-worker.d.ts +33 -0
- package/dist/scripts/notify-hook/team-worker.d.ts.map +1 -0
- package/dist/scripts/notify-hook/team-worker.js +697 -0
- package/dist/scripts/notify-hook/team-worker.js.map +1 -0
- package/dist/scripts/notify-hook/tmux-injection.d.ts +8 -0
- package/dist/scripts/notify-hook/tmux-injection.d.ts.map +1 -0
- package/dist/scripts/notify-hook/tmux-injection.js +578 -0
- package/dist/scripts/notify-hook/tmux-injection.js.map +1 -0
- package/dist/scripts/notify-hook/utils.d.ts +9 -0
- package/dist/scripts/notify-hook/utils.d.ts.map +1 -0
- package/dist/scripts/notify-hook/utils.js +36 -0
- package/dist/scripts/notify-hook/utils.js.map +1 -0
- package/dist/scripts/notify-hook/visual-verdict.d.ts +29 -0
- package/dist/scripts/notify-hook/visual-verdict.d.ts.map +1 -0
- package/dist/scripts/notify-hook/visual-verdict.js +145 -0
- package/dist/scripts/notify-hook/visual-verdict.js.map +1 -0
- package/dist/scripts/notify-hook.d.ts +20 -0
- package/dist/scripts/notify-hook.d.ts.map +1 -0
- package/dist/scripts/notify-hook.js +716 -0
- package/dist/scripts/notify-hook.js.map +1 -0
- package/dist/scripts/postinstall.d.ts +18 -0
- package/dist/scripts/postinstall.d.ts.map +1 -0
- package/dist/scripts/postinstall.js +66 -0
- package/dist/scripts/postinstall.js.map +1 -0
- package/dist/scripts/prompt-inventory.d.ts +29 -0
- package/dist/scripts/prompt-inventory.d.ts.map +1 -0
- package/dist/scripts/prompt-inventory.js +178 -0
- package/dist/scripts/prompt-inventory.js.map +1 -0
- package/dist/scripts/run-provider-advisor.d.ts +3 -0
- package/dist/scripts/run-provider-advisor.d.ts.map +1 -0
- package/dist/scripts/run-provider-advisor.js +171 -0
- package/dist/scripts/run-provider-advisor.js.map +1 -0
- package/dist/scripts/run-test-files.d.ts +2 -0
- package/dist/scripts/run-test-files.d.ts.map +1 -0
- package/dist/scripts/run-test-files.js +71 -0
- package/dist/scripts/run-test-files.js.map +1 -0
- package/dist/scripts/smoke-packed-install.d.ts +18 -0
- package/dist/scripts/smoke-packed-install.d.ts.map +1 -0
- package/dist/scripts/smoke-packed-install.js +144 -0
- package/dist/scripts/smoke-packed-install.js.map +1 -0
- package/dist/scripts/sync-plugin-mirror.d.ts +14 -0
- package/dist/scripts/sync-plugin-mirror.d.ts.map +1 -0
- package/dist/scripts/sync-plugin-mirror.js +282 -0
- package/dist/scripts/sync-plugin-mirror.js.map +1 -0
- package/dist/scripts/sync-prompt-guidance-fragments.d.ts +3 -0
- package/dist/scripts/sync-prompt-guidance-fragments.d.ts.map +1 -0
- package/dist/scripts/sync-prompt-guidance-fragments.js +50 -0
- package/dist/scripts/sync-prompt-guidance-fragments.js.map +1 -0
- package/dist/scripts/team-hardening-benchmark.d.ts +3 -0
- package/dist/scripts/team-hardening-benchmark.d.ts.map +1 -0
- package/dist/scripts/team-hardening-benchmark.js +91 -0
- package/dist/scripts/team-hardening-benchmark.js.map +1 -0
- package/dist/scripts/test-reply-listener-live.d.ts +24 -0
- package/dist/scripts/test-reply-listener-live.d.ts.map +1 -0
- package/dist/scripts/test-reply-listener-live.js +138 -0
- package/dist/scripts/test-reply-listener-live.js.map +1 -0
- package/dist/scripts/test-sparkshell.d.ts +2 -0
- package/dist/scripts/test-sparkshell.d.ts.map +1 -0
- package/dist/scripts/test-sparkshell.js +25 -0
- package/dist/scripts/test-sparkshell.js.map +1 -0
- package/dist/scripts/tmux-hook-engine.d.ts +45 -0
- package/dist/scripts/tmux-hook-engine.d.ts.map +1 -0
- package/dist/scripts/tmux-hook-engine.js +313 -0
- package/dist/scripts/tmux-hook-engine.js.map +1 -0
- package/dist/scripts/verify-native-agents.d.ts +16 -0
- package/dist/scripts/verify-native-agents.d.ts.map +1 -0
- package/dist/scripts/verify-native-agents.js +188 -0
- package/dist/scripts/verify-native-agents.js.map +1 -0
- package/dist/scripts/verify-native-release-assets.d.ts +3 -0
- package/dist/scripts/verify-native-release-assets.d.ts.map +1 -0
- package/dist/scripts/verify-native-release-assets.js +62 -0
- package/dist/scripts/verify-native-release-assets.js.map +1 -0
- package/dist/session-history/__tests__/search.test.d.ts +2 -0
- package/dist/session-history/__tests__/search.test.d.ts.map +1 -0
- package/dist/session-history/__tests__/search.test.js +150 -0
- package/dist/session-history/__tests__/search.test.js.map +1 -0
- package/dist/session-history/search.d.ts +31 -0
- package/dist/session-history/search.d.ts.map +1 -0
- package/dist/session-history/search.js +331 -0
- package/dist/session-history/search.js.map +1 -0
- package/dist/sidecar/__tests__/boundary.test.d.ts +2 -0
- package/dist/sidecar/__tests__/boundary.test.d.ts.map +1 -0
- package/dist/sidecar/__tests__/boundary.test.js +48 -0
- package/dist/sidecar/__tests__/boundary.test.js.map +1 -0
- package/dist/sidecar/__tests__/collector.test.d.ts +2 -0
- package/dist/sidecar/__tests__/collector.test.d.ts.map +1 -0
- package/dist/sidecar/__tests__/collector.test.js +162 -0
- package/dist/sidecar/__tests__/collector.test.js.map +1 -0
- package/dist/sidecar/__tests__/render.test.d.ts +2 -0
- package/dist/sidecar/__tests__/render.test.d.ts.map +1 -0
- package/dist/sidecar/__tests__/render.test.js +67 -0
- package/dist/sidecar/__tests__/render.test.js.map +1 -0
- package/dist/sidecar/__tests__/tmux.test.d.ts +2 -0
- package/dist/sidecar/__tests__/tmux.test.d.ts.map +1 -0
- package/dist/sidecar/__tests__/tmux.test.js +30 -0
- package/dist/sidecar/__tests__/tmux.test.js.map +1 -0
- package/dist/sidecar/__tests__/watch.test.d.ts +2 -0
- package/dist/sidecar/__tests__/watch.test.d.ts.map +1 -0
- package/dist/sidecar/__tests__/watch.test.js +42 -0
- package/dist/sidecar/__tests__/watch.test.js.map +1 -0
- package/dist/sidecar/collector.d.ts +4 -0
- package/dist/sidecar/collector.d.ts.map +1 -0
- package/dist/sidecar/collector.js +377 -0
- package/dist/sidecar/collector.js.map +1 -0
- package/dist/sidecar/index.d.ts +25 -0
- package/dist/sidecar/index.d.ts.map +1 -0
- package/dist/sidecar/index.js +165 -0
- package/dist/sidecar/index.js.map +1 -0
- package/dist/sidecar/render.d.ts +3 -0
- package/dist/sidecar/render.d.ts.map +1 -0
- package/dist/sidecar/render.js +72 -0
- package/dist/sidecar/render.js.map +1 -0
- package/dist/sidecar/tmux.d.ts +13 -0
- package/dist/sidecar/tmux.d.ts.map +1 -0
- package/dist/sidecar/tmux.js +44 -0
- package/dist/sidecar/tmux.js.map +1 -0
- package/dist/sidecar/types.d.ts +125 -0
- package/dist/sidecar/types.d.ts.map +1 -0
- package/dist/sidecar/types.js +2 -0
- package/dist/sidecar/types.js.map +1 -0
- package/dist/state/__tests__/mode-state-context.test.d.ts +2 -0
- package/dist/state/__tests__/mode-state-context.test.d.ts.map +1 -0
- package/dist/state/__tests__/mode-state-context.test.js +35 -0
- package/dist/state/__tests__/mode-state-context.test.js.map +1 -0
- package/dist/state/__tests__/operations-ralph-phase.test.d.ts +2 -0
- package/dist/state/__tests__/operations-ralph-phase.test.d.ts.map +1 -0
- package/dist/state/__tests__/operations-ralph-phase.test.js +103 -0
- package/dist/state/__tests__/operations-ralph-phase.test.js.map +1 -0
- package/dist/state/__tests__/operations.test.d.ts +2 -0
- package/dist/state/__tests__/operations.test.d.ts.map +1 -0
- package/dist/state/__tests__/operations.test.js +439 -0
- package/dist/state/__tests__/operations.test.js.map +1 -0
- package/dist/state/__tests__/path-traversal.test.d.ts +2 -0
- package/dist/state/__tests__/path-traversal.test.d.ts.map +1 -0
- package/dist/state/__tests__/path-traversal.test.js +49 -0
- package/dist/state/__tests__/path-traversal.test.js.map +1 -0
- package/dist/state/__tests__/skill-active.test.d.ts +2 -0
- package/dist/state/__tests__/skill-active.test.d.ts.map +1 -0
- package/dist/state/__tests__/skill-active.test.js +160 -0
- package/dist/state/__tests__/skill-active.test.js.map +1 -0
- package/dist/state/__tests__/workflow-transition.test.d.ts +2 -0
- package/dist/state/__tests__/workflow-transition.test.d.ts.map +1 -0
- package/dist/state/__tests__/workflow-transition.test.js +77 -0
- package/dist/state/__tests__/workflow-transition.test.js.map +1 -0
- package/dist/state/mode-state-context.d.ts +12 -0
- package/dist/state/mode-state-context.d.ts.map +1 -0
- package/dist/state/mode-state-context.js +28 -0
- package/dist/state/mode-state-context.js.map +1 -0
- package/dist/state/operations.d.ts +11 -0
- package/dist/state/operations.d.ts.map +1 -0
- package/dist/state/operations.js +363 -0
- package/dist/state/operations.js.map +1 -0
- package/dist/state/paths.d.ts +3 -0
- package/dist/state/paths.d.ts.map +1 -0
- package/dist/state/paths.js +2 -0
- package/dist/state/paths.js.map +1 -0
- package/dist/state/skill-active.d.ts +55 -0
- package/dist/state/skill-active.d.ts.map +1 -0
- package/dist/state/skill-active.js +269 -0
- package/dist/state/skill-active.js.map +1 -0
- package/dist/state/workflow-transition-reconcile.d.ts +15 -0
- package/dist/state/workflow-transition-reconcile.d.ts.map +1 -0
- package/dist/state/workflow-transition-reconcile.js +113 -0
- package/dist/state/workflow-transition-reconcile.js.map +1 -0
- package/dist/state/workflow-transition.d.ts +22 -0
- package/dist/state/workflow-transition.d.ts.map +1 -0
- package/dist/state/workflow-transition.js +191 -0
- package/dist/state/workflow-transition.js.map +1 -0
- package/dist/subagents/__tests__/tracker.test.d.ts +2 -0
- package/dist/subagents/__tests__/tracker.test.d.ts.map +1 -0
- package/dist/subagents/__tests__/tracker.test.js +47 -0
- package/dist/subagents/__tests__/tracker.test.js.map +1 -0
- package/dist/subagents/tracker.d.ts +52 -0
- package/dist/subagents/tracker.d.ts.map +1 -0
- package/dist/subagents/tracker.js +175 -0
- package/dist/subagents/tracker.js.map +1 -0
- 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 +111 -0
- package/dist/team/__tests__/allocation-policy.test.js.map +1 -0
- package/dist/team/__tests__/api-interop.test.d.ts +2 -0
- package/dist/team/__tests__/api-interop.test.d.ts.map +1 -0
- package/dist/team/__tests__/api-interop.test.js +2262 -0
- package/dist/team/__tests__/api-interop.test.js.map +1 -0
- package/dist/team/__tests__/commit-hygiene.test.d.ts +2 -0
- package/dist/team/__tests__/commit-hygiene.test.d.ts.map +1 -0
- package/dist/team/__tests__/commit-hygiene.test.js +93 -0
- package/dist/team/__tests__/commit-hygiene.test.js.map +1 -0
- package/dist/team/__tests__/cross-rebase-smoke.test.d.ts +2 -0
- package/dist/team/__tests__/cross-rebase-smoke.test.d.ts.map +1 -0
- package/dist/team/__tests__/cross-rebase-smoke.test.js +161 -0
- package/dist/team/__tests__/cross-rebase-smoke.test.js.map +1 -0
- package/dist/team/__tests__/current-task-baseline.test.d.ts +2 -0
- package/dist/team/__tests__/current-task-baseline.test.d.ts.map +1 -0
- package/dist/team/__tests__/current-task-baseline.test.js +87 -0
- package/dist/team/__tests__/current-task-baseline.test.js.map +1 -0
- package/dist/team/__tests__/delegation-policy.test.d.ts +2 -0
- package/dist/team/__tests__/delegation-policy.test.d.ts.map +1 -0
- package/dist/team/__tests__/delegation-policy.test.js +69 -0
- package/dist/team/__tests__/delegation-policy.test.js.map +1 -0
- package/dist/team/__tests__/delivery-e2e-smoke.test.d.ts +2 -0
- package/dist/team/__tests__/delivery-e2e-smoke.test.d.ts.map +1 -0
- package/dist/team/__tests__/delivery-e2e-smoke.test.js +679 -0
- package/dist/team/__tests__/delivery-e2e-smoke.test.js.map +1 -0
- package/dist/team/__tests__/events.test.d.ts +2 -0
- package/dist/team/__tests__/events.test.d.ts.map +1 -0
- package/dist/team/__tests__/events.test.js +313 -0
- package/dist/team/__tests__/events.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 +84 -0
- package/dist/team/__tests__/followup-planner.test.js.map +1 -0
- package/dist/team/__tests__/hardening-e2e.test.d.ts +2 -0
- package/dist/team/__tests__/hardening-e2e.test.d.ts.map +1 -0
- package/dist/team/__tests__/hardening-e2e.test.js +98 -0
- package/dist/team/__tests__/hardening-e2e.test.js.map +1 -0
- package/dist/team/__tests__/hook-primary-e2e-contract.test.d.ts +2 -0
- package/dist/team/__tests__/hook-primary-e2e-contract.test.d.ts.map +1 -0
- package/dist/team/__tests__/hook-primary-e2e-contract.test.js +78 -0
- package/dist/team/__tests__/hook-primary-e2e-contract.test.js.map +1 -0
- package/dist/team/__tests__/idle-nudge.test.d.ts +2 -0
- package/dist/team/__tests__/idle-nudge.test.d.ts.map +1 -0
- package/dist/team/__tests__/idle-nudge.test.js +230 -0
- package/dist/team/__tests__/idle-nudge.test.js.map +1 -0
- package/dist/team/__tests__/leader-activity.test.d.ts +2 -0
- package/dist/team/__tests__/leader-activity.test.d.ts.map +1 -0
- package/dist/team/__tests__/leader-activity.test.js +261 -0
- package/dist/team/__tests__/leader-activity.test.js.map +1 -0
- package/dist/team/__tests__/mcp-comm.test.d.ts +2 -0
- package/dist/team/__tests__/mcp-comm.test.d.ts.map +1 -0
- package/dist/team/__tests__/mcp-comm.test.js +289 -0
- package/dist/team/__tests__/mcp-comm.test.js.map +1 -0
- package/dist/team/__tests__/model-contract.test.d.ts +2 -0
- package/dist/team/__tests__/model-contract.test.d.ts.map +1 -0
- package/dist/team/__tests__/model-contract.test.js +171 -0
- package/dist/team/__tests__/model-contract.test.js.map +1 -0
- package/dist/team/__tests__/orchestrator.test.d.ts +2 -0
- package/dist/team/__tests__/orchestrator.test.d.ts.map +1 -0
- package/dist/team/__tests__/orchestrator.test.js +111 -0
- package/dist/team/__tests__/orchestrator.test.js.map +1 -0
- package/dist/team/__tests__/phase-controller.test.d.ts +2 -0
- package/dist/team/__tests__/phase-controller.test.d.ts.map +1 -0
- package/dist/team/__tests__/phase-controller.test.js +50 -0
- package/dist/team/__tests__/phase-controller.test.js.map +1 -0
- package/dist/team/__tests__/rebalance-policy.test.d.ts +2 -0
- package/dist/team/__tests__/rebalance-policy.test.d.ts.map +1 -0
- package/dist/team/__tests__/rebalance-policy.test.js +168 -0
- package/dist/team/__tests__/rebalance-policy.test.js.map +1 -0
- package/dist/team/__tests__/repo-aware-decomposition.test.d.ts +2 -0
- package/dist/team/__tests__/repo-aware-decomposition.test.d.ts.map +1 -0
- package/dist/team/__tests__/repo-aware-decomposition.test.js +136 -0
- package/dist/team/__tests__/repo-aware-decomposition.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 +263 -0
- package/dist/team/__tests__/role-router.test.js.map +1 -0
- package/dist/team/__tests__/runtime-cli.test.d.ts +2 -0
- package/dist/team/__tests__/runtime-cli.test.d.ts.map +1 -0
- package/dist/team/__tests__/runtime-cli.test.js +304 -0
- package/dist/team/__tests__/runtime-cli.test.js.map +1 -0
- package/dist/team/__tests__/runtime.test.d.ts +2 -0
- package/dist/team/__tests__/runtime.test.d.ts.map +1 -0
- package/dist/team/__tests__/runtime.test.js +5734 -0
- package/dist/team/__tests__/runtime.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 +1005 -0
- package/dist/team/__tests__/scaling.test.js.map +1 -0
- package/dist/team/__tests__/shutdown-fallback.test.d.ts +2 -0
- package/dist/team/__tests__/shutdown-fallback.test.d.ts.map +1 -0
- package/dist/team/__tests__/shutdown-fallback.test.js +125 -0
- package/dist/team/__tests__/shutdown-fallback.test.js.map +1 -0
- package/dist/team/__tests__/state-root.test.d.ts +2 -0
- package/dist/team/__tests__/state-root.test.d.ts.map +1 -0
- package/dist/team/__tests__/state-root.test.js +195 -0
- package/dist/team/__tests__/state-root.test.js.map +1 -0
- package/dist/team/__tests__/state.test.d.ts +2 -0
- package/dist/team/__tests__/state.test.d.ts.map +1 -0
- package/dist/team/__tests__/state.test.js +1859 -0
- package/dist/team/__tests__/state.test.js.map +1 -0
- package/dist/team/__tests__/team-identity.test.d.ts +2 -0
- package/dist/team/__tests__/team-identity.test.d.ts.map +1 -0
- package/dist/team/__tests__/team-identity.test.js +166 -0
- package/dist/team/__tests__/team-identity.test.js.map +1 -0
- package/dist/team/__tests__/team-ops-contract.test.d.ts +2 -0
- package/dist/team/__tests__/team-ops-contract.test.d.ts.map +1 -0
- package/dist/team/__tests__/team-ops-contract.test.js +96 -0
- package/dist/team/__tests__/team-ops-contract.test.js.map +1 -0
- package/dist/team/__tests__/tmux-claude-workers-demo.test.d.ts +2 -0
- package/dist/team/__tests__/tmux-claude-workers-demo.test.d.ts.map +1 -0
- package/dist/team/__tests__/tmux-claude-workers-demo.test.js +191 -0
- package/dist/team/__tests__/tmux-claude-workers-demo.test.js.map +1 -0
- package/dist/team/__tests__/tmux-session.test.d.ts +2 -0
- package/dist/team/__tests__/tmux-session.test.d.ts.map +1 -0
- package/dist/team/__tests__/tmux-session.test.js +3785 -0
- package/dist/team/__tests__/tmux-session.test.js.map +1 -0
- package/dist/team/__tests__/tmux-test-fixture.d.ts +20 -0
- package/dist/team/__tests__/tmux-test-fixture.d.ts.map +1 -0
- package/dist/team/__tests__/tmux-test-fixture.js +152 -0
- package/dist/team/__tests__/tmux-test-fixture.js.map +1 -0
- package/dist/team/__tests__/tmux-test-fixture.test.d.ts +2 -0
- package/dist/team/__tests__/tmux-test-fixture.test.d.ts.map +1 -0
- package/dist/team/__tests__/tmux-test-fixture.test.js +113 -0
- package/dist/team/__tests__/tmux-test-fixture.test.js.map +1 -0
- package/dist/team/__tests__/worker-bootstrap.test.d.ts +2 -0
- package/dist/team/__tests__/worker-bootstrap.test.d.ts.map +1 -0
- package/dist/team/__tests__/worker-bootstrap.test.js +685 -0
- package/dist/team/__tests__/worker-bootstrap.test.js.map +1 -0
- package/dist/team/__tests__/worker-runtime-identity.test.d.ts +2 -0
- package/dist/team/__tests__/worker-runtime-identity.test.d.ts.map +1 -0
- package/dist/team/__tests__/worker-runtime-identity.test.js +250 -0
- package/dist/team/__tests__/worker-runtime-identity.test.js.map +1 -0
- package/dist/team/__tests__/worktree.test.d.ts +2 -0
- package/dist/team/__tests__/worktree.test.d.ts.map +1 -0
- package/dist/team/__tests__/worktree.test.js +317 -0
- package/dist/team/__tests__/worktree.test.js.map +1 -0
- package/dist/team/allocation-policy.d.ts +29 -0
- package/dist/team/allocation-policy.d.ts.map +1 -0
- package/dist/team/allocation-policy.js +153 -0
- package/dist/team/allocation-policy.js.map +1 -0
- package/dist/team/api-interop.d.ts +20 -0
- package/dist/team/api-interop.d.ts.map +1 -0
- package/dist/team/api-interop.js +1083 -0
- package/dist/team/api-interop.js.map +1 -0
- package/dist/team/commit-hygiene.d.ts +79 -0
- package/dist/team/commit-hygiene.d.ts.map +1 -0
- package/dist/team/commit-hygiene.js +364 -0
- package/dist/team/commit-hygiene.js.map +1 -0
- package/dist/team/contracts.d.ts +26 -0
- package/dist/team/contracts.d.ts.map +1 -0
- package/dist/team/contracts.js +103 -0
- package/dist/team/contracts.js.map +1 -0
- package/dist/team/current-task-baseline.d.ts +32 -0
- package/dist/team/current-task-baseline.d.ts.map +1 -0
- package/dist/team/current-task-baseline.js +85 -0
- package/dist/team/current-task-baseline.js.map +1 -0
- package/dist/team/dag-schema.d.ts +38 -0
- package/dist/team/dag-schema.d.ts.map +1 -0
- package/dist/team/dag-schema.js +221 -0
- package/dist/team/dag-schema.js.map +1 -0
- package/dist/team/delegation-policy.d.ts +3 -0
- package/dist/team/delegation-policy.d.ts.map +1 -0
- package/dist/team/delegation-policy.js +82 -0
- package/dist/team/delegation-policy.js.map +1 -0
- package/dist/team/delivery-log.d.ts +14 -0
- package/dist/team/delivery-log.d.ts.map +1 -0
- package/dist/team/delivery-log.js +35 -0
- package/dist/team/delivery-log.js.map +1 -0
- package/dist/team/followup-planner.d.ts +44 -0
- package/dist/team/followup-planner.d.ts.map +1 -0
- package/dist/team/followup-planner.js +200 -0
- package/dist/team/followup-planner.js.map +1 -0
- package/dist/team/idle-nudge.d.ts +53 -0
- package/dist/team/idle-nudge.d.ts.map +1 -0
- package/dist/team/idle-nudge.js +141 -0
- package/dist/team/idle-nudge.js.map +1 -0
- package/dist/team/leader-activity.d.ts +15 -0
- package/dist/team/leader-activity.d.ts.map +1 -0
- package/dist/team/leader-activity.js +224 -0
- package/dist/team/leader-activity.js.map +1 -0
- package/dist/team/mcp-comm.d.ts +73 -0
- package/dist/team/mcp-comm.d.ts.map +1 -0
- package/dist/team/mcp-comm.js +314 -0
- package/dist/team/mcp-comm.js.map +1 -0
- package/dist/team/model-contract.d.ts +26 -0
- package/dist/team/model-contract.d.ts.map +1 -0
- package/dist/team/model-contract.js +204 -0
- package/dist/team/model-contract.js.map +1 -0
- package/dist/team/orchestrator.d.ts +47 -0
- package/dist/team/orchestrator.d.ts.map +1 -0
- package/dist/team/orchestrator.js +131 -0
- package/dist/team/orchestrator.js.map +1 -0
- package/dist/team/pane-status.d.ts +149 -0
- package/dist/team/pane-status.d.ts.map +1 -0
- package/dist/team/pane-status.js +558 -0
- package/dist/team/pane-status.js.map +1 -0
- package/dist/team/phase-controller.d.ts +12 -0
- package/dist/team/phase-controller.d.ts.map +1 -0
- package/dist/team/phase-controller.js +142 -0
- package/dist/team/phase-controller.js.map +1 -0
- package/dist/team/progress-evidence.d.ts +2 -0
- package/dist/team/progress-evidence.d.ts.map +1 -0
- package/dist/team/progress-evidence.js +77 -0
- package/dist/team/progress-evidence.js.map +1 -0
- package/dist/team/rebalance-policy.d.ts +19 -0
- package/dist/team/rebalance-policy.d.ts.map +1 -0
- package/dist/team/rebalance-policy.js +48 -0
- package/dist/team/rebalance-policy.js.map +1 -0
- package/dist/team/reminder-intents.d.ts +11 -0
- package/dist/team/reminder-intents.d.ts.map +1 -0
- package/dist/team/reminder-intents.js +40 -0
- package/dist/team/reminder-intents.js.map +1 -0
- package/dist/team/repo-aware-decomposition.d.ts +63 -0
- package/dist/team/repo-aware-decomposition.d.ts.map +1 -0
- package/dist/team/repo-aware-decomposition.js +231 -0
- package/dist/team/repo-aware-decomposition.js.map +1 -0
- package/dist/team/role-router.d.ts +32 -0
- package/dist/team/role-router.d.ts.map +1 -0
- package/dist/team/role-router.js +298 -0
- package/dist/team/role-router.js.map +1 -0
- package/dist/team/runtime-cli.d.ts +74 -0
- package/dist/team/runtime-cli.d.ts.map +1 -0
- package/dist/team/runtime-cli.js +363 -0
- package/dist/team/runtime-cli.js.map +1 -0
- package/dist/team/runtime.d.ts +154 -0
- package/dist/team/runtime.d.ts.map +1 -0
- package/dist/team/runtime.js +3925 -0
- package/dist/team/runtime.js.map +1 -0
- package/dist/team/scaling.d.ts +59 -0
- package/dist/team/scaling.d.ts.map +1 -0
- package/dist/team/scaling.js +598 -0
- package/dist/team/scaling.js.map +1 -0
- package/dist/team/state/approvals.d.ts +25 -0
- package/dist/team/state/approvals.d.ts.map +1 -0
- package/dist/team/state/approvals.js +31 -0
- package/dist/team/state/approvals.js.map +1 -0
- package/dist/team/state/config.d.ts +2 -0
- package/dist/team/state/config.d.ts.map +1 -0
- package/dist/team/state/config.js +2 -0
- package/dist/team/state/config.js.map +1 -0
- package/dist/team/state/dispatch-lock.d.ts +3 -0
- package/dist/team/state/dispatch-lock.d.ts.map +1 -0
- package/dist/team/state/dispatch-lock.js +81 -0
- package/dist/team/state/dispatch-lock.js.map +1 -0
- package/dist/team/state/dispatch.d.ts +69 -0
- package/dist/team/state/dispatch.d.ts.map +1 -0
- package/dist/team/state/dispatch.js +308 -0
- package/dist/team/state/dispatch.js.map +1 -0
- package/dist/team/state/events.d.ts +26 -0
- package/dist/team/state/events.d.ts.map +1 -0
- package/dist/team/state/events.js +145 -0
- package/dist/team/state/events.js.map +1 -0
- package/dist/team/state/index.d.ts +11 -0
- package/dist/team/state/index.d.ts.map +1 -0
- package/dist/team/state/index.js +11 -0
- package/dist/team/state/index.js.map +1 -0
- package/dist/team/state/io.d.ts +2 -0
- package/dist/team/state/io.d.ts.map +1 -0
- package/dist/team/state/io.js +2 -0
- package/dist/team/state/io.js.map +1 -0
- package/dist/team/state/locks.d.ts +16 -0
- package/dist/team/state/locks.d.ts.map +1 -0
- package/dist/team/state/locks.js +201 -0
- package/dist/team/state/locks.js.map +1 -0
- package/dist/team/state/mailbox.d.ts +42 -0
- package/dist/team/state/mailbox.d.ts.map +1 -0
- package/dist/team/state/mailbox.js +213 -0
- package/dist/team/state/mailbox.js.map +1 -0
- package/dist/team/state/monitor.d.ts +108 -0
- package/dist/team/state/monitor.d.ts.map +1 -0
- package/dist/team/state/monitor.js +193 -0
- package/dist/team/state/monitor.js.map +1 -0
- package/dist/team/state/shutdown.d.ts +2 -0
- package/dist/team/state/shutdown.d.ts.map +1 -0
- package/dist/team/state/shutdown.js +2 -0
- package/dist/team/state/shutdown.js.map +1 -0
- package/dist/team/state/summary.d.ts +2 -0
- package/dist/team/state/summary.d.ts.map +1 -0
- package/dist/team/state/summary.js +2 -0
- package/dist/team/state/summary.js.map +1 -0
- package/dist/team/state/tasks.d.ts +53 -0
- package/dist/team/state/tasks.d.ts.map +1 -0
- package/dist/team/state/tasks.js +260 -0
- package/dist/team/state/tasks.js.map +1 -0
- package/dist/team/state/types.d.ts +336 -0
- package/dist/team/state/types.d.ts.map +1 -0
- package/dist/team/state/types.js +3 -0
- package/dist/team/state/types.js.map +1 -0
- package/dist/team/state/workers.d.ts +2 -0
- package/dist/team/state/workers.d.ts.map +1 -0
- package/dist/team/state/workers.js +2 -0
- package/dist/team/state/workers.js.map +1 -0
- package/dist/team/state-root.d.ts +40 -0
- package/dist/team/state-root.d.ts.map +1 -0
- package/dist/team/state-root.js +293 -0
- package/dist/team/state-root.js.map +1 -0
- package/dist/team/state.d.ts +455 -0
- package/dist/team/state.d.ts.map +1 -0
- package/dist/team/state.js +1436 -0
- package/dist/team/state.js.map +1 -0
- package/dist/team/team-identity.d.ts +26 -0
- package/dist/team/team-identity.d.ts.map +1 -0
- package/dist/team/team-identity.js +169 -0
- package/dist/team/team-identity.js.map +1 -0
- package/dist/team/team-ops.d.ts +66 -0
- package/dist/team/team-ops.d.ts.map +1 -0
- package/dist/team/team-ops.js +79 -0
- package/dist/team/team-ops.js.map +1 -0
- package/dist/team/tmux-session.d.ts +186 -0
- package/dist/team/tmux-session.d.ts.map +1 -0
- package/dist/team/tmux-session.js +1770 -0
- package/dist/team/tmux-session.js.map +1 -0
- package/dist/team/worker-bootstrap.d.ts +85 -0
- package/dist/team/worker-bootstrap.d.ts.map +1 -0
- package/dist/team/worker-bootstrap.js +767 -0
- package/dist/team/worker-bootstrap.js.map +1 -0
- package/dist/team/worktree.d.ts +69 -0
- package/dist/team/worktree.d.ts.map +1 -0
- package/dist/team/worktree.js +437 -0
- package/dist/team/worktree.js.map +1 -0
- package/dist/utils/__tests__/agents-md.test.d.ts +2 -0
- package/dist/utils/__tests__/agents-md.test.d.ts.map +1 -0
- package/dist/utils/__tests__/agents-md.test.js +52 -0
- package/dist/utils/__tests__/agents-md.test.js.map +1 -0
- package/dist/utils/__tests__/agents-model-table.test.d.ts +2 -0
- package/dist/utils/__tests__/agents-model-table.test.d.ts.map +1 -0
- package/dist/utils/__tests__/agents-model-table.test.js +104 -0
- package/dist/utils/__tests__/agents-model-table.test.js.map +1 -0
- package/dist/utils/__tests__/dep-versions.test.d.ts +2 -0
- package/dist/utils/__tests__/dep-versions.test.d.ts.map +1 -0
- package/dist/utils/__tests__/dep-versions.test.js +46 -0
- package/dist/utils/__tests__/dep-versions.test.js.map +1 -0
- package/dist/utils/__tests__/package.test.d.ts +2 -0
- package/dist/utils/__tests__/package.test.d.ts.map +1 -0
- package/dist/utils/__tests__/package.test.js +21 -0
- package/dist/utils/__tests__/package.test.js.map +1 -0
- package/dist/utils/__tests__/paths.test.d.ts +2 -0
- package/dist/utils/__tests__/paths.test.d.ts.map +1 -0
- package/dist/utils/__tests__/paths.test.js +541 -0
- package/dist/utils/__tests__/paths.test.js.map +1 -0
- package/dist/utils/__tests__/platform-command.test.d.ts +2 -0
- package/dist/utils/__tests__/platform-command.test.d.ts.map +1 -0
- package/dist/utils/__tests__/platform-command.test.js +410 -0
- package/dist/utils/__tests__/platform-command.test.js.map +1 -0
- package/dist/utils/__tests__/repo-deps.test.d.ts +2 -0
- package/dist/utils/__tests__/repo-deps.test.d.ts.map +1 -0
- package/dist/utils/__tests__/repo-deps.test.js +71 -0
- package/dist/utils/__tests__/repo-deps.test.js.map +1 -0
- package/dist/utils/agents-md.d.ts +8 -0
- package/dist/utils/agents-md.d.ts.map +1 -0
- package/dist/utils/agents-md.js +57 -0
- package/dist/utils/agents-md.js.map +1 -0
- package/dist/utils/agents-model-table.d.ts +16 -0
- package/dist/utils/agents-model-table.d.ts.map +1 -0
- package/dist/utils/agents-model-table.js +88 -0
- package/dist/utils/agents-model-table.js.map +1 -0
- package/dist/utils/git-layout.d.ts +8 -0
- package/dist/utils/git-layout.d.ts.map +1 -0
- package/dist/utils/git-layout.js +58 -0
- package/dist/utils/git-layout.js.map +1 -0
- package/dist/utils/package.d.ts +9 -0
- package/dist/utils/package.d.ts.map +1 -0
- package/dist/utils/package.js +31 -0
- package/dist/utils/package.js.map +1 -0
- package/dist/utils/paths.d.ts +84 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +263 -0
- package/dist/utils/paths.js.map +1 -0
- package/dist/utils/platform-command.d.ts +26 -0
- package/dist/utils/platform-command.d.ts.map +1 -0
- package/dist/utils/platform-command.js +270 -0
- package/dist/utils/platform-command.js.map +1 -0
- package/dist/utils/repo-deps.d.ts +20 -0
- package/dist/utils/repo-deps.d.ts.map +1 -0
- package/dist/utils/repo-deps.js +78 -0
- package/dist/utils/repo-deps.js.map +1 -0
- package/dist/utils/safe-json.d.ts +3 -0
- package/dist/utils/safe-json.d.ts.map +1 -0
- package/dist/utils/safe-json.js +19 -0
- package/dist/utils/safe-json.js.map +1 -0
- package/dist/utils/sleep.d.ts +3 -0
- package/dist/utils/sleep.d.ts.map +1 -0
- package/dist/utils/sleep.js +24 -0
- package/dist/utils/sleep.js.map +1 -0
- package/dist/verification/__tests__/ci-rust-gates.test.d.ts +2 -0
- package/dist/verification/__tests__/ci-rust-gates.test.d.ts.map +1 -0
- package/dist/verification/__tests__/ci-rust-gates.test.js +89 -0
- package/dist/verification/__tests__/ci-rust-gates.test.js.map +1 -0
- package/dist/verification/__tests__/dev-merge-issue-close-workflow.test.d.ts +2 -0
- package/dist/verification/__tests__/dev-merge-issue-close-workflow.test.d.ts.map +1 -0
- package/dist/verification/__tests__/dev-merge-issue-close-workflow.test.js +54 -0
- package/dist/verification/__tests__/dev-merge-issue-close-workflow.test.js.map +1 -0
- package/dist/verification/__tests__/explore-harness-release-workflow.test.d.ts +2 -0
- package/dist/verification/__tests__/explore-harness-release-workflow.test.d.ts.map +1 -0
- package/dist/verification/__tests__/explore-harness-release-workflow.test.js +73 -0
- package/dist/verification/__tests__/explore-harness-release-workflow.test.js.map +1 -0
- package/dist/verification/__tests__/native-release-manifest.test.d.ts +2 -0
- package/dist/verification/__tests__/native-release-manifest.test.d.ts.map +1 -0
- package/dist/verification/__tests__/native-release-manifest.test.js +80 -0
- package/dist/verification/__tests__/native-release-manifest.test.js.map +1 -0
- package/dist/verification/__tests__/pr-check-workflow.test.d.ts +2 -0
- package/dist/verification/__tests__/pr-check-workflow.test.d.ts.map +1 -0
- package/dist/verification/__tests__/pr-check-workflow.test.js +27 -0
- package/dist/verification/__tests__/pr-check-workflow.test.js.map +1 -0
- package/dist/verification/__tests__/ralph-persistence-gate.test.d.ts +2 -0
- package/dist/verification/__tests__/ralph-persistence-gate.test.d.ts.map +1 -0
- package/dist/verification/__tests__/ralph-persistence-gate.test.js +55 -0
- package/dist/verification/__tests__/ralph-persistence-gate.test.js.map +1 -0
- package/dist/verification/__tests__/rust-runtime-thin-adapter-gate.test.d.ts +2 -0
- package/dist/verification/__tests__/rust-runtime-thin-adapter-gate.test.d.ts.map +1 -0
- package/dist/verification/__tests__/rust-runtime-thin-adapter-gate.test.js +32 -0
- package/dist/verification/__tests__/rust-runtime-thin-adapter-gate.test.js.map +1 -0
- package/dist/verification/__tests__/verifier.test.d.ts +2 -0
- package/dist/verification/__tests__/verifier.test.d.ts.map +1 -0
- package/dist/verification/__tests__/verifier.test.js +113 -0
- package/dist/verification/__tests__/verifier.test.js.map +1 -0
- package/dist/verification/verifier.d.ts +37 -0
- package/dist/verification/verifier.d.ts.map +1 -0
- package/dist/verification/verifier.js +100 -0
- package/dist/verification/verifier.js.map +1 -0
- package/dist/visual/__tests__/verdict.test.d.ts +2 -0
- package/dist/visual/__tests__/verdict.test.d.ts.map +1 -0
- package/dist/visual/__tests__/verdict.test.js +81 -0
- package/dist/visual/__tests__/verdict.test.js.map +1 -0
- package/dist/visual/constants.d.ts +4 -0
- package/dist/visual/constants.d.ts.map +1 -0
- package/dist/visual/constants.js +3 -0
- package/dist/visual/constants.js.map +1 -0
- package/dist/visual/verdict.d.ts +17 -0
- package/dist/visual/verdict.d.ts.map +1 -0
- package/dist/visual/verdict.js +61 -0
- package/dist/visual/verdict.js.map +1 -0
- package/dist/wiki/__tests__/cjk-tokenize.test.d.ts +12 -0
- package/dist/wiki/__tests__/cjk-tokenize.test.d.ts.map +1 -0
- package/dist/wiki/__tests__/cjk-tokenize.test.js +139 -0
- package/dist/wiki/__tests__/cjk-tokenize.test.js.map +1 -0
- package/dist/wiki/__tests__/crlf-parse.test.d.ts +2 -0
- package/dist/wiki/__tests__/crlf-parse.test.d.ts.map +1 -0
- package/dist/wiki/__tests__/crlf-parse.test.js +24 -0
- package/dist/wiki/__tests__/crlf-parse.test.js.map +1 -0
- package/dist/wiki/__tests__/escape-newline.test.d.ts +2 -0
- package/dist/wiki/__tests__/escape-newline.test.d.ts.map +1 -0
- package/dist/wiki/__tests__/escape-newline.test.js +45 -0
- package/dist/wiki/__tests__/escape-newline.test.js.map +1 -0
- package/dist/wiki/__tests__/ingest.test.d.ts +5 -0
- package/dist/wiki/__tests__/ingest.test.d.ts.map +1 -0
- package/dist/wiki/__tests__/ingest.test.js +181 -0
- package/dist/wiki/__tests__/ingest.test.js.map +1 -0
- package/dist/wiki/__tests__/lint.test.d.ts +5 -0
- package/dist/wiki/__tests__/lint.test.d.ts.map +1 -0
- package/dist/wiki/__tests__/lint.test.js +163 -0
- package/dist/wiki/__tests__/lint.test.js.map +1 -0
- package/dist/wiki/__tests__/query.test.d.ts +5 -0
- package/dist/wiki/__tests__/query.test.d.ts.map +1 -0
- package/dist/wiki/__tests__/query.test.js +141 -0
- package/dist/wiki/__tests__/query.test.js.map +1 -0
- package/dist/wiki/__tests__/reserved-file-guard.test.d.ts +2 -0
- package/dist/wiki/__tests__/reserved-file-guard.test.d.ts.map +1 -0
- package/dist/wiki/__tests__/reserved-file-guard.test.js +44 -0
- package/dist/wiki/__tests__/reserved-file-guard.test.js.map +1 -0
- package/dist/wiki/__tests__/session-hooks.test.d.ts +5 -0
- package/dist/wiki/__tests__/session-hooks.test.d.ts.map +1 -0
- package/dist/wiki/__tests__/session-hooks.test.js +36 -0
- package/dist/wiki/__tests__/session-hooks.test.js.map +1 -0
- package/dist/wiki/__tests__/slug-nonascii.test.d.ts +2 -0
- package/dist/wiki/__tests__/slug-nonascii.test.d.ts.map +1 -0
- package/dist/wiki/__tests__/slug-nonascii.test.js +30 -0
- package/dist/wiki/__tests__/slug-nonascii.test.js.map +1 -0
- package/dist/wiki/__tests__/storage.test.d.ts +5 -0
- package/dist/wiki/__tests__/storage.test.d.ts.map +1 -0
- package/dist/wiki/__tests__/storage.test.js +278 -0
- package/dist/wiki/__tests__/storage.test.js.map +1 -0
- package/dist/wiki/__tests__/test-helpers.d.ts +31 -0
- package/dist/wiki/__tests__/test-helpers.d.ts.map +1 -0
- package/dist/wiki/__tests__/test-helpers.js +108 -0
- package/dist/wiki/__tests__/test-helpers.js.map +1 -0
- package/dist/wiki/index.d.ts +14 -0
- package/dist/wiki/index.d.ts.map +1 -0
- package/dist/wiki/index.js +17 -0
- package/dist/wiki/index.js.map +1 -0
- package/dist/wiki/ingest.d.ts +20 -0
- package/dist/wiki/ingest.d.ts.map +1 -0
- package/dist/wiki/ingest.js +115 -0
- package/dist/wiki/ingest.js.map +1 -0
- package/dist/wiki/lifecycle.d.ts +20 -0
- package/dist/wiki/lifecycle.d.ts.map +1 -0
- package/dist/wiki/lifecycle.js +212 -0
- package/dist/wiki/lifecycle.js.map +1 -0
- package/dist/wiki/lint.d.ts +25 -0
- package/dist/wiki/lint.d.ts.map +1 -0
- package/dist/wiki/lint.js +166 -0
- package/dist/wiki/lint.js.map +1 -0
- package/dist/wiki/query.d.ts +36 -0
- package/dist/wiki/query.d.ts.map +1 -0
- package/dist/wiki/query.js +138 -0
- package/dist/wiki/query.js.map +1 -0
- package/dist/wiki/storage.d.ts +33 -0
- package/dist/wiki/storage.d.ts.map +1 -0
- package/dist/wiki/storage.js +322 -0
- package/dist/wiki/storage.js.map +1 -0
- package/dist/wiki/types.d.ts +83 -0
- package/dist/wiki/types.d.ts.map +1 -0
- package/dist/wiki/types.js +15 -0
- package/dist/wiki/types.js.map +1 -0
- package/docs/STATE_MODEL.md +280 -0
- package/docs/adapt.md +49 -0
- package/docs/agents.html +96 -0
- package/docs/benchmarks/tetris-benchmark-comparison-20260306.png +0 -0
- package/docs/clawhip-event-contract.md +83 -0
- package/docs/codex-native-hooks.md +153 -0
- package/docs/contracts/autoresearch-command-contract.md +106 -0
- package/docs/contracts/autoresearch-command-review.md +97 -0
- package/docs/contracts/autoresearch-ux-deep-interview-review.md +114 -0
- package/docs/contracts/explicit-terminal-stop-model.md +96 -0
- package/docs/contracts/multi-state-transition-contract.md +115 -0
- package/docs/contracts/multi-state-transition-review.md +134 -0
- package/docs/contracts/mux-operation-space.md +49 -0
- package/docs/contracts/ralph-cancel-contract.md +23 -0
- package/docs/contracts/ralph-state-contract.md +95 -0
- package/docs/contracts/repo-aware-team-dag-decomposition.md +98 -0
- package/docs/contracts/runtime-authority-backlog-replay-readiness.md +40 -0
- package/docs/contracts/runtime-command-event-snapshot-schema.md +133 -0
- package/docs/contracts/rust-runtime-thin-adapter-contract.md +69 -0
- package/docs/contracts/team-delivery-state-contract.md +95 -0
- package/docs/contracts/team-runtime-state-contract.md +48 -0
- package/docs/contracts/team-startup-dispatch-latency.md +114 -0
- package/docs/getting-started.html +91 -0
- package/docs/guidance-schema.md +69 -0
- package/docs/hooks-extension.md +146 -0
- package/docs/index.html +117 -0
- package/docs/integrations.html +59 -0
- package/docs/interop-team-mutation-contract.md +98 -0
- package/docs/issues/team-ralph-followup-team.md +38 -0
- package/docs/migration-mainline-post-v0.4.4.md +90 -0
- package/docs/openclaw-integration.de.md +44 -0
- package/docs/openclaw-integration.es.md +44 -0
- package/docs/openclaw-integration.fr.md +44 -0
- package/docs/openclaw-integration.it.md +44 -0
- package/docs/openclaw-integration.ja.md +44 -0
- package/docs/openclaw-integration.ko.md +82 -0
- package/docs/openclaw-integration.md +378 -0
- package/docs/openclaw-integration.pt.md +44 -0
- package/docs/openclaw-integration.ru.md +44 -0
- package/docs/openclaw-integration.tr.md +44 -0
- package/docs/openclaw-integration.uk.md +44 -0
- package/docs/openclaw-integration.vi.md +44 -0
- package/docs/openclaw-integration.zh-TW.md +44 -0
- package/docs/openclaw-integration.zh.md +44 -0
- package/docs/plugin-bundle-ssot.md +52 -0
- package/docs/prompt-guidance-contract.md +233 -0
- package/docs/prompt-guidance-fragments/core-operating-principles.md +16 -0
- package/docs/prompt-guidance-fragments/core-verification-and-sequencing.md +6 -0
- package/docs/prompt-guidance-fragments/executor-constraints.md +13 -0
- package/docs/prompt-guidance-fragments/executor-output.md +1 -0
- package/docs/prompt-guidance-fragments/executor-shared.md +7 -0
- package/docs/prompt-guidance-fragments/leader-specialist-routing.md +6 -0
- package/docs/prompt-guidance-fragments/planner-constraints.md +12 -0
- package/docs/prompt-guidance-fragments/planner-investigation.md +1 -0
- package/docs/prompt-guidance-fragments/planner-output.md +1 -0
- package/docs/prompt-guidance-fragments/planner-shared.md +7 -0
- package/docs/prompt-guidance-fragments/verifier-constraints.md +10 -0
- package/docs/prompt-guidance-fragments/verifier-investigation.md +1 -0
- package/docs/prompt-guidance-fragments/verifier-shared.md +4 -0
- package/docs/prompt-migration-changelog.md +152 -0
- package/docs/prs/dev-deprecate-team-ralph.md +100 -0
- package/docs/prs/dev-fix-ralph-live-pane-invariant.md +34 -0
- package/docs/prs/dev-issue-715-team-brain-role-split.md +22 -0
- package/docs/prs/dev-team-ralph-workflow-positioning.md +38 -0
- package/docs/prs/experimental-dev-omx-sparkshell.md +56 -0
- package/docs/qa/ci-speedups-after-prompt-worker-fix.md +91 -0
- package/docs/qa/deep-interview-phase-1-validation.md +117 -0
- package/docs/qa/explore-sparkshell-heavy-manual-stress.md +244 -0
- package/docs/qa/ralph-persistence-gate.md +59 -0
- package/docs/qa/recent-bug-regression-hardening-2026-04-11.md +24 -0
- package/docs/qa/release-no-publish-0.15.0.md +33 -0
- package/docs/qa/release-readiness-0.11.13.md +39 -0
- package/docs/qa/release-readiness-0.12.0.md +80 -0
- package/docs/qa/release-readiness-0.12.1.md +33 -0
- package/docs/qa/release-readiness-0.12.2.md +33 -0
- package/docs/qa/release-readiness-0.12.3.md +30 -0
- package/docs/qa/release-readiness-0.12.5.md +69 -0
- package/docs/qa/release-readiness-0.12.6.md +59 -0
- package/docs/qa/release-readiness-0.13.0.md +64 -0
- package/docs/qa/release-readiness-0.13.1.md +39 -0
- package/docs/qa/release-readiness-0.14.0.md +55 -0
- package/docs/qa/release-readiness-0.14.1.md +44 -0
- package/docs/qa/release-readiness-0.14.2.md +65 -0
- package/docs/qa/release-readiness-0.14.3.md +42 -0
- package/docs/qa/release-readiness-0.14.4.md +40 -0
- package/docs/qa/release-readiness-0.15.0.md +65 -0
- package/docs/qa/release-readiness-0.15.1.md +44 -0
- package/docs/qa/release-readiness-0.8.1.md +37 -0
- package/docs/qa/release-readiness-0.8.2.md +39 -0
- package/docs/qa/release-readiness-0.8.3.md +43 -0
- package/docs/qa/release-readiness-0.8.4.md +39 -0
- package/docs/qa/release-readiness-0.9.0.md +78 -0
- package/docs/qa/release-readiness-0.9.1.md +43 -0
- package/docs/qa/release-readiness-follow-up.md +26 -0
- package/docs/qa/remaining-suite-drift-2026-03-19.md +105 -0
- package/docs/qa/research-specialist-eval-surface-2026-04-18.md +42 -0
- package/docs/qa/runtime-team-seam-audit-2026-04-01.md +128 -0
- package/docs/qa/rust-runtime-thin-adapter-gate.md +40 -0
- package/docs/qa-plan-0.4.2.md +85 -0
- package/docs/qa-report-0.4.2.md +55 -0
- package/docs/readme/README.de.md +27 -0
- package/docs/readme/README.el.md +27 -0
- package/docs/readme/README.es.md +27 -0
- package/docs/readme/README.fr.md +27 -0
- package/docs/readme/README.it.md +27 -0
- package/docs/readme/README.ja.md +27 -0
- package/docs/readme/README.ko.md +27 -0
- package/docs/readme/README.md +53 -0
- package/docs/readme/README.pl.md +27 -0
- package/docs/readme/README.pt.md +27 -0
- package/docs/readme/README.ru.md +27 -0
- package/docs/readme/README.tr.md +27 -0
- package/docs/readme/README.uk.md +27 -0
- package/docs/readme/README.vi.md +27 -0
- package/docs/readme/README.zh-TW.md +27 -0
- package/docs/readme/README.zh.md +27 -0
- package/docs/reference/player-psychology-command-surfaces.md +30 -0
- package/docs/reference/player-psychology-framework.md +64 -0
- package/docs/reference/project-wiki.md +79 -0
- package/docs/reference/psychology-example-mastery-combat.md +7 -0
- package/docs/reference/psychology-example-simulator-farming.md +7 -0
- package/docs/reference/psychology-example-social-roleplay.md +7 -0
- package/docs/reference/psychology-rubric-healthy-retention.md +13 -0
- package/docs/reference/psychology-rubric-mastery-depth.md +11 -0
- package/docs/reference/psychology-rubric-progression-clarity.md +12 -0
- package/docs/reference/psychology-rubric-social-value-vs-spam.md +11 -0
- package/docs/reference/psychology-rubric-status-visibility.md +11 -0
- package/docs/reference/ralph-parity-matrix.md +25 -0
- package/docs/reference/ralph-upstream-baseline.md +34 -0
- package/docs/reference/rcs-config-schema-routing.md +264 -0
- package/docs/reference/roblox-pre-action-protocol.md +122 -0
- package/docs/reference/team-allocation-rebalance-policy.md +60 -0
- package/docs/release-body-0.9.0.md +104 -0
- package/docs/release-body-0.9.1.md +41 -0
- package/docs/release-notes-v0.1.0.md +53 -0
- package/docs/reports/macos-m1-high-cpu-usage-2026-04-16.md +78 -0
- package/docs/reports/open-prs-dev-readiness-2026-04-09.md +45 -0
- package/docs/runtime-model-metadata-cleanup.md +37 -0
- package/docs/shared/agent-tiers.md +56 -0
- package/docs/shared/omx-character-spark-initiative.jpg +0 -0
- package/docs/skills.html +132 -0
- package/docs/style.css +179 -0
- package/docs/troubleshooting.md +120 -0
- package/docs/wiki-feature.md +35 -0
- package/package.json +108 -0
- package/plugins/roblox-ai-os-creator-skills/.app.json +3 -0
- package/plugins/roblox-ai-os-creator-skills/.codex-plugin/plugin.json +30 -0
- package/plugins/roblox-ai-os-creator-skills/.mcp.json +44 -0
- package/plugins/roblox-ai-os-creator-skills/docs/reference/player-psychology-command-surfaces.md +30 -0
- package/plugins/roblox-ai-os-creator-skills/docs/reference/player-psychology-framework.md +64 -0
- package/plugins/roblox-ai-os-creator-skills/docs/reference/psychology-example-mastery-combat.md +7 -0
- package/plugins/roblox-ai-os-creator-skills/docs/reference/psychology-example-simulator-farming.md +7 -0
- package/plugins/roblox-ai-os-creator-skills/docs/reference/psychology-example-social-roleplay.md +7 -0
- package/plugins/roblox-ai-os-creator-skills/docs/reference/psychology-rubric-healthy-retention.md +13 -0
- package/plugins/roblox-ai-os-creator-skills/docs/reference/psychology-rubric-mastery-depth.md +11 -0
- package/plugins/roblox-ai-os-creator-skills/docs/reference/psychology-rubric-progression-clarity.md +12 -0
- package/plugins/roblox-ai-os-creator-skills/docs/reference/psychology-rubric-social-value-vs-spam.md +11 -0
- package/plugins/roblox-ai-os-creator-skills/docs/reference/psychology-rubric-status-visibility.md +11 -0
- package/plugins/roblox-ai-os-creator-skills/docs/reference/roblox-pre-action-protocol.md +122 -0
- package/plugins/roblox-ai-os-creator-skills/skills/ai-slop-cleaner/SKILL.md +139 -0
- package/plugins/roblox-ai-os-creator-skills/skills/analyze/SKILL.md +148 -0
- package/plugins/roblox-ai-os-creator-skills/skills/ask-claude/SKILL.md +61 -0
- package/plugins/roblox-ai-os-creator-skills/skills/ask-gemini/SKILL.md +61 -0
- package/plugins/roblox-ai-os-creator-skills/skills/autoforge/SKILL.md +18 -0
- package/plugins/roblox-ai-os-creator-skills/skills/autopilot/SKILL.md +163 -0
- package/plugins/roblox-ai-os-creator-skills/skills/autoresearch/SKILL.md +68 -0
- package/plugins/roblox-ai-os-creator-skills/skills/blueprint/SKILL.md +22 -0
- package/plugins/roblox-ai-os-creator-skills/skills/blueprint-loop/SKILL.md +19 -0
- package/plugins/roblox-ai-os-creator-skills/skills/blueprint-psych/SKILL.md +21 -0
- package/plugins/roblox-ai-os-creator-skills/skills/blueprint-retention/SKILL.md +15 -0
- package/plugins/roblox-ai-os-creator-skills/skills/blueprint-social/SKILL.md +15 -0
- package/plugins/roblox-ai-os-creator-skills/skills/brief/SKILL.md +27 -0
- package/plugins/roblox-ai-os-creator-skills/skills/brief-audience/SKILL.md +19 -0
- package/plugins/roblox-ai-os-creator-skills/skills/brief-motivation/SKILL.md +22 -0
- package/plugins/roblox-ai-os-creator-skills/skills/cancel/SKILL.md +399 -0
- package/plugins/roblox-ai-os-creator-skills/skills/code-review/SKILL.md +290 -0
- package/plugins/roblox-ai-os-creator-skills/skills/configure-notifications/SKILL.md +287 -0
- package/plugins/roblox-ai-os-creator-skills/skills/crew/SKILL.md +10 -0
- package/plugins/roblox-ai-os-creator-skills/skills/deep-interview/SKILL.md +468 -0
- package/plugins/roblox-ai-os-creator-skills/skills/doctor/SKILL.md +239 -0
- package/plugins/roblox-ai-os-creator-skills/skills/forge/SKILL.md +30 -0
- package/plugins/roblox-ai-os-creator-skills/skills/forge-community/SKILL.md +16 -0
- package/plugins/roblox-ai-os-creator-skills/skills/forge-daily-loop/SKILL.md +15 -0
- package/plugins/roblox-ai-os-creator-skills/skills/forge-event-loop/SKILL.md +15 -0
- package/plugins/roblox-ai-os-creator-skills/skills/forge-fomo/SKILL.md +16 -0
- package/plugins/roblox-ai-os-creator-skills/skills/forge-mastery/SKILL.md +16 -0
- package/plugins/roblox-ai-os-creator-skills/skills/forge-progression/SKILL.md +16 -0
- package/plugins/roblox-ai-os-creator-skills/skills/forge-reward-loop/SKILL.md +19 -0
- package/plugins/roblox-ai-os-creator-skills/skills/forge-status/SKILL.md +17 -0
- package/plugins/roblox-ai-os-creator-skills/skills/help/SKILL.md +75 -0
- package/plugins/roblox-ai-os-creator-skills/skills/hud/SKILL.md +98 -0
- package/plugins/roblox-ai-os-creator-skills/skills/note/SKILL.md +62 -0
- package/plugins/roblox-ai-os-creator-skills/skills/pipeline/SKILL.md +86 -0
- package/plugins/roblox-ai-os-creator-skills/skills/plan/SKILL.md +277 -0
- package/plugins/roblox-ai-os-creator-skills/skills/ralph/SKILL.md +269 -0
- package/plugins/roblox-ai-os-creator-skills/skills/ralplan/SKILL.md +162 -0
- package/plugins/roblox-ai-os-creator-skills/skills/rcs-setup/SKILL.md +135 -0
- package/plugins/roblox-ai-os-creator-skills/skills/security-review/SKILL.md +300 -0
- package/plugins/roblox-ai-os-creator-skills/skills/skill/SKILL.md +835 -0
- package/plugins/roblox-ai-os-creator-skills/skills/team/SKILL.md +510 -0
- package/plugins/roblox-ai-os-creator-skills/skills/trace/SKILL.md +33 -0
- package/plugins/roblox-ai-os-creator-skills/skills/ultraqa/SKILL.md +143 -0
- package/plugins/roblox-ai-os-creator-skills/skills/ultrawork/SKILL.md +175 -0
- package/plugins/roblox-ai-os-creator-skills/skills/visual-ralph/SKILL.md +153 -0
- package/plugins/roblox-ai-os-creator-skills/skills/visual-verdict/SKILL.md +76 -0
- package/plugins/roblox-ai-os-creator-skills/skills/wiki/SKILL.md +57 -0
- package/plugins/roblox-ai-os-creator-skills/skills/worker/SKILL.md +106 -0
- package/plugins/roblox-ai-os-creator-skills/templates/psychology/dopamine-loop-map.md +13 -0
- package/plugins/roblox-ai-os-creator-skills/templates/psychology/event-fomo-design-sheet.md +11 -0
- package/plugins/roblox-ai-os-creator-skills/templates/psychology/player-motivation-profile.md +14 -0
- package/plugins/roblox-ai-os-creator-skills/templates/psychology/retention-design-sheet.md +12 -0
- package/plugins/roblox-ai-os-creator-skills/templates/psychology/social-mechanic-spec.md +11 -0
- package/plugins/roblox-ai-os-creator-skills/templates/roblox/pre-action-plan.md +84 -0
- package/prompts/analyst.md +135 -0
- package/prompts/api-reviewer.md +113 -0
- package/prompts/architect.md +111 -0
- package/prompts/build-fixer.md +115 -0
- package/prompts/code-reviewer.md +137 -0
- package/prompts/code-simplifier.md +134 -0
- package/prompts/critic.md +80 -0
- package/prompts/debugger.md +117 -0
- package/prompts/dependency-expert.md +129 -0
- package/prompts/designer.md +126 -0
- package/prompts/executor.md +108 -0
- package/prompts/explore-harness.md +64 -0
- package/prompts/explore.md +85 -0
- package/prompts/git-master.md +114 -0
- package/prompts/information-architect.md +226 -0
- package/prompts/performance-reviewer.md +109 -0
- package/prompts/planner.md +110 -0
- package/prompts/product-analyst.md +304 -0
- package/prompts/product-manager.md +245 -0
- package/prompts/qa-tester.md +124 -0
- package/prompts/quality-reviewer.md +123 -0
- package/prompts/quality-strategist.md +274 -0
- package/prompts/researcher.md +98 -0
- package/prompts/security-reviewer.md +143 -0
- package/prompts/sisyphus-lite.md +111 -0
- package/prompts/style-reviewer.md +102 -0
- package/prompts/team-executor.md +57 -0
- package/prompts/team-orchestrator.md +8 -0
- package/prompts/test-engineer.md +130 -0
- package/prompts/ux-researcher.md +327 -0
- package/prompts/verifier.md +85 -0
- package/prompts/vision.md +98 -0
- package/prompts/writer.md +109 -0
- package/skills/ai-slop-cleaner/SKILL.md +139 -0
- package/skills/analyze/SKILL.md +148 -0
- package/skills/ask-claude/SKILL.md +61 -0
- package/skills/ask-gemini/SKILL.md +61 -0
- package/skills/autoforge/SKILL.md +18 -0
- package/skills/autopilot/SKILL.md +163 -0
- package/skills/autoresearch/SKILL.md +68 -0
- package/skills/blueprint/SKILL.md +22 -0
- package/skills/blueprint-loop/SKILL.md +19 -0
- package/skills/blueprint-psych/SKILL.md +21 -0
- package/skills/blueprint-retention/SKILL.md +15 -0
- package/skills/blueprint-social/SKILL.md +15 -0
- package/skills/brief/SKILL.md +27 -0
- package/skills/brief-audience/SKILL.md +19 -0
- package/skills/brief-motivation/SKILL.md +22 -0
- package/skills/build-fix/SKILL.md +145 -0
- package/skills/cancel/SKILL.md +399 -0
- package/skills/code-review/SKILL.md +290 -0
- package/skills/configure-notifications/SKILL.md +287 -0
- package/skills/crew/SKILL.md +10 -0
- package/skills/deep-interview/SKILL.md +468 -0
- package/skills/deepsearch/SKILL.md +38 -0
- package/skills/doctor/SKILL.md +239 -0
- package/skills/ecomode/SKILL.md +114 -0
- package/skills/forge/SKILL.md +30 -0
- package/skills/forge-community/SKILL.md +16 -0
- package/skills/forge-daily-loop/SKILL.md +15 -0
- package/skills/forge-event-loop/SKILL.md +15 -0
- package/skills/forge-fomo/SKILL.md +16 -0
- package/skills/forge-mastery/SKILL.md +16 -0
- package/skills/forge-progression/SKILL.md +16 -0
- package/skills/forge-reward-loop/SKILL.md +19 -0
- package/skills/forge-status/SKILL.md +17 -0
- package/skills/frontend-ui-ux/SKILL.md +34 -0
- package/skills/git-master/SKILL.md +29 -0
- package/skills/help/SKILL.md +75 -0
- package/skills/hud/SKILL.md +98 -0
- package/skills/note/SKILL.md +62 -0
- package/skills/pipeline/SKILL.md +86 -0
- package/skills/plan/SKILL.md +277 -0
- package/skills/ralph/SKILL.md +269 -0
- package/skills/ralph-init/SKILL.md +46 -0
- package/skills/ralplan/SKILL.md +162 -0
- package/skills/rcs-setup/SKILL.md +135 -0
- package/skills/review/SKILL.md +38 -0
- package/skills/security-review/SKILL.md +300 -0
- package/skills/skill/SKILL.md +835 -0
- package/skills/swarm/SKILL.md +25 -0
- package/skills/tdd/SKILL.md +106 -0
- package/skills/team/SKILL.md +510 -0
- package/skills/trace/SKILL.md +33 -0
- package/skills/ultraqa/SKILL.md +143 -0
- package/skills/ultrawork/SKILL.md +175 -0
- package/skills/visual-ralph/SKILL.md +153 -0
- package/skills/visual-verdict/SKILL.md +76 -0
- package/skills/web-clone/SKILL.md +24 -0
- package/skills/wiki/SKILL.md +57 -0
- package/skills/worker/SKILL.md +106 -0
- package/src/scripts/__tests__/codex-native-hook.test.ts +8498 -0
- package/src/scripts/__tests__/generate-release-body.test.ts +275 -0
- package/src/scripts/__tests__/hook-derived-watcher.test.ts +241 -0
- package/src/scripts/__tests__/postinstall.test.ts +113 -0
- package/src/scripts/__tests__/prompt-inventory.test.ts +64 -0
- package/src/scripts/__tests__/run-test-files.test.ts +72 -0
- package/src/scripts/__tests__/smoke-packed-install.test.ts +155 -0
- package/src/scripts/__tests__/test-reply-listener-live.test.ts +101 -0
- package/src/scripts/__tests__/verify-native-agents.test.ts +204 -0
- package/src/scripts/ask-claude.sh +17 -0
- package/src/scripts/ask-gemini.sh +14 -0
- package/src/scripts/build-explore-harness.ts +54 -0
- package/src/scripts/build-sparkshell.ts +52 -0
- package/src/scripts/check-runtime-syntax.ts +63 -0
- package/src/scripts/check-version-sync.ts +50 -0
- package/src/scripts/cleanup-explore-harness.ts +17 -0
- package/src/scripts/codex-execution-surface.ts +73 -0
- package/src/scripts/codex-native-hook.ts +2531 -0
- package/src/scripts/codex-native-pre-post.ts +945 -0
- package/src/scripts/demo-claude-workers.sh +241 -0
- package/src/scripts/demo-team-e2e.sh +181 -0
- package/src/scripts/eval/eval-adaptive-sort-optimization.py +24 -0
- package/src/scripts/eval/eval-candidate-handoff.ts +8 -0
- package/src/scripts/eval/eval-cli-discoverability.ts +40 -0
- package/src/scripts/eval/eval-fresh-run-tagging.ts +8 -0
- package/src/scripts/eval/eval-help-consistency.ts +11 -0
- package/src/scripts/eval/eval-in-action-cat-shellout-demo.ts +31 -0
- package/src/scripts/eval/eval-ml-kaggle-model-optimization.py +29 -0
- package/src/scripts/eval/eval-noisy-bayesopt-highdim.py +44 -0
- package/src/scripts/eval/eval-noisy-latent-subspace-discovery.py +44 -0
- package/src/scripts/eval/eval-parity-smoke.ts +20 -0
- package/src/scripts/eval/eval-parity-sweep.ts +26 -0
- package/src/scripts/eval/eval-resume-dirty-guard.ts +8 -0
- package/src/scripts/eval/eval-security-path-traversal.ts +38 -0
- package/src/scripts/fixtures/ask-advisor-stub.ts +12 -0
- package/src/scripts/generate-catalog-docs.ts +112 -0
- package/src/scripts/generate-native-release-manifest.ts +147 -0
- package/src/scripts/generate-release-body.ts +327 -0
- package/src/scripts/hook-derived-watcher.ts +648 -0
- package/src/scripts/notify-fallback-watcher.ts +2011 -0
- package/src/scripts/notify-hook/__tests__/operational-events.test.ts +24 -0
- package/src/scripts/notify-hook/__tests__/team-worker-posttooluse.test.ts +180 -0
- package/src/scripts/notify-hook/active-team.ts +55 -0
- package/src/scripts/notify-hook/auto-nudge.ts +756 -0
- package/src/scripts/notify-hook/log.ts +30 -0
- package/src/scripts/notify-hook/managed-tmux.ts +586 -0
- package/src/scripts/notify-hook/operational-events.ts +282 -0
- package/src/scripts/notify-hook/orchestration-intent.ts +82 -0
- package/src/scripts/notify-hook/payload-parser.ts +143 -0
- package/src/scripts/notify-hook/process-runner.ts +109 -0
- package/src/scripts/notify-hook/ralph-session-resume.ts +362 -0
- package/src/scripts/notify-hook/state-io.ts +182 -0
- package/src/scripts/notify-hook/team-dispatch.ts +1142 -0
- package/src/scripts/notify-hook/team-leader-nudge.ts +1100 -0
- package/src/scripts/notify-hook/team-tmux-guard.ts +187 -0
- package/src/scripts/notify-hook/team-worker-posttooluse.ts +536 -0
- package/src/scripts/notify-hook/team-worker.ts +700 -0
- package/src/scripts/notify-hook/tmux-injection.ts +617 -0
- package/src/scripts/notify-hook/utils.ts +31 -0
- package/src/scripts/notify-hook/visual-verdict.ts +158 -0
- package/src/scripts/notify-hook.ts +778 -0
- package/src/scripts/postinstall-bootstrap.js +23 -0
- package/src/scripts/postinstall.ts +107 -0
- package/src/scripts/prompt-inventory.ts +218 -0
- package/src/scripts/run-autoresearch-showcase.sh +75 -0
- package/src/scripts/run-provider-advisor.ts +205 -0
- package/src/scripts/run-test-files.ts +87 -0
- package/src/scripts/smoke-packed-install.ts +186 -0
- package/src/scripts/sync-plugin-mirror.ts +412 -0
- package/src/scripts/sync-prompt-guidance-fragments.ts +55 -0
- package/src/scripts/team-hardening-benchmark.ts +90 -0
- package/src/scripts/test-reply-listener-live.ts +188 -0
- package/src/scripts/test-sparkshell.ts +29 -0
- package/src/scripts/tmux-hook-engine.ts +349 -0
- package/src/scripts/verify-native-agents.ts +245 -0
- package/src/scripts/verify-native-release-assets.ts +68 -0
- package/templates/AGENTS.md +347 -0
- package/templates/catalog-manifest.json +614 -0
- package/templates/model-instructions/explore-lightweight-AGENTS.md +11 -0
- package/templates/model-instructions/sparkshell-lightweight-AGENTS.md +10 -0
- package/templates/psychology/dopamine-loop-map.md +13 -0
- package/templates/psychology/event-fomo-design-sheet.md +11 -0
- package/templates/psychology/player-motivation-profile.md +14 -0
- package/templates/psychology/retention-design-sheet.md +12 -0
- package/templates/psychology/social-mechanic-spec.md +11 -0
- package/templates/roblox/pre-action-plan.md +84 -0
|
@@ -0,0 +1,3117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* roblox-ai-os-creator-skills CLI
|
|
3
|
+
* Multi-agent orchestration for OpenAI Codex CLI
|
|
4
|
+
*/
|
|
5
|
+
import { execFileSync, spawn } from "child_process";
|
|
6
|
+
import { basename, dirname, join } from "path";
|
|
7
|
+
import { writeSync } from "fs";
|
|
8
|
+
import { existsSync, mkdirSync, readFileSync, rmSync, statSync, writeFileSync } from "fs";
|
|
9
|
+
import { copyFile, cp, lstat, mkdir, readdir, rm, symlink } from "fs/promises";
|
|
10
|
+
import { constants as osConstants } from "os";
|
|
11
|
+
import { setup, SETUP_SCOPES } from "./setup.js";
|
|
12
|
+
import { uninstall } from "./uninstall.js";
|
|
13
|
+
import { version } from "./version.js";
|
|
14
|
+
import { tmuxHookCommand } from "./tmux-hook.js";
|
|
15
|
+
import { hooksCommand } from "./hooks.js";
|
|
16
|
+
import { hudCommand } from "../hud/index.js";
|
|
17
|
+
import { sidecarCommand } from "../sidecar/index.js";
|
|
18
|
+
import { teamCommand } from "./team.js";
|
|
19
|
+
import { ralphCommand } from "./ralph.js";
|
|
20
|
+
import { askCommand } from "./ask.js";
|
|
21
|
+
import { questionCommand } from "./question.js";
|
|
22
|
+
import { stateCommand } from "./state.js";
|
|
23
|
+
import { cleanupCommand, cleanupRcsMcpProcesses, findLaunchSafeCleanupCandidates, } from "./cleanup.js";
|
|
24
|
+
import { exploreCommand } from "./explore.js";
|
|
25
|
+
import { sparkshellCommand } from "./sparkshell.js";
|
|
26
|
+
import { agentsInitCommand } from "./agents-init.js";
|
|
27
|
+
import { agentsCommand } from "./agents.js";
|
|
28
|
+
import { sessionCommand } from "./session-search.js";
|
|
29
|
+
import { autoresearchCommand } from "./autoresearch.js";
|
|
30
|
+
import { mcpParityCommand } from "./mcp-parity.js";
|
|
31
|
+
import { mcpServeCommand } from "./mcp-serve.js";
|
|
32
|
+
import { adaptCommand } from "./adapt.js";
|
|
33
|
+
import { listCommand } from "./list.js";
|
|
34
|
+
import { MADMAX_FLAG, CODEX_BYPASS_FLAG, HIGH_REASONING_FLAG, XHIGH_REASONING_FLAG, SPARK_FLAG, MADMAX_SPARK_FLAG, CONFIG_FLAG, LONG_CONFIG_FLAG, } from "./constants.js";
|
|
35
|
+
import { getBaseStateDir, getStateDir, listModeStateFilesWithScopePreference, } from "../mcp/state-paths.js";
|
|
36
|
+
import { resolveCodexConfigPathForLaunch, resolveCodexHomeForLaunch, resolveProjectLocalCodexHomeForLaunch, } from "./codex-home.js";
|
|
37
|
+
export { readPersistedSetupPreferences, readPersistedSetupScope, resolveCodexConfigPathForLaunch, resolveCodexHomeForLaunch, resolveProjectLocalCodexHomeForLaunch, } from "./codex-home.js";
|
|
38
|
+
import { SKILL_ACTIVE_STATE_MODE, syncCanonicalSkillStateForMode } from "../state/skill-active.js";
|
|
39
|
+
import { isTrackedWorkflowMode } from "../state/workflow-transition.js";
|
|
40
|
+
import { maybeCheckAndPromptUpdate, runImmediateUpdate } from "./update.js";
|
|
41
|
+
import { maybePromptGithubStar } from "./star-prompt.js";
|
|
42
|
+
import { generateOverlay, removeSessionModelInstructionsFile, resolveSessionOrchestrationMode, sessionModelInstructionsPath, writeSessionModelInstructionsFile, } from "../hooks/agents-overlay.js";
|
|
43
|
+
import { readSessionState, writeSessionStart, writeSessionEnd, resetSessionMetrics, } from "../hooks/session.js";
|
|
44
|
+
import { buildClientAttachedReconcileHookName, buildReconcileHudResizeArgs, buildRegisterClientAttachedReconcileArgs, buildRegisterResizeHookArgs, buildResizeHookName, buildResizeHookTarget, buildScheduleDelayedHudResizeArgs, buildUnregisterClientAttachedReconcileArgs, buildUnregisterResizeHookArgs, enableMouseScrolling, isMsysOrGitBash, isNativeWindows, isTmuxAvailable, mitigateCopyModeUnderlineArtifacts, } from "../team/tmux-session.js";
|
|
45
|
+
import { getPackageRoot } from "../utils/package.js";
|
|
46
|
+
import { codexConfigPath, rememberRcsLaunchContext, resolveRcsEntryPath } from "../utils/paths.js";
|
|
47
|
+
import { cleanCodexModelAvailabilityNuxIfNeeded, repairConfigIfNeeded } from "../config/generator.js";
|
|
48
|
+
import { HUD_TMUX_HEIGHT_LINES } from "../hud/constants.js";
|
|
49
|
+
import { createHudWatchPane as createSharedHudWatchPane, killTmuxPane as killSharedTmuxPane, listCurrentWindowHudPaneIds, parsePaneIdFromTmuxOutput, } from "../hud/tmux.js";
|
|
50
|
+
export { parseTmuxPaneSnapshot, isHudWatchPane, findHudWatchPaneIds } from "../hud/tmux.js";
|
|
51
|
+
rememberRcsLaunchContext();
|
|
52
|
+
import { classifySpawnError, resolveTmuxBinaryForPlatform, spawnPlatformCommandSync, } from "../utils/platform-command.js";
|
|
53
|
+
import { buildHookEvent } from "../hooks/extensibility/events.js";
|
|
54
|
+
import { dispatchHookEvent } from "../hooks/extensibility/dispatcher.js";
|
|
55
|
+
import { collectInheritableTeamWorkerArgs as collectInheritableTeamWorkerArgsShared, resolveTeamWorkerLaunchArgs, resolveTeamLowComplexityDefaultModel, } from "../team/model-contract.js";
|
|
56
|
+
import { parseWorktreeMode, planWorktreeTarget, ensureWorktree, } from "../team/worktree.js";
|
|
57
|
+
import { ensureReusableNodeModules } from "../utils/repo-deps.js";
|
|
58
|
+
import { RCS_NOTIFY_TEMP_CONTRACT_ENV, parseNotifyTempContractFromArgs, serializeNotifyTempContract, } from "../notifications/temp-contract.js";
|
|
59
|
+
import { execInjectCommand } from "../exec/followup.js";
|
|
60
|
+
export function resolveNotifyFallbackWatcherScript(pkgRoot = getPackageRoot()) {
|
|
61
|
+
return resolveDistScript(pkgRoot, "notify-fallback-watcher.js");
|
|
62
|
+
}
|
|
63
|
+
function writeStdoutLine(line) {
|
|
64
|
+
const rendered = `${line}\n`;
|
|
65
|
+
if (process.stdout.isTTY)
|
|
66
|
+
process.stdout.write(rendered);
|
|
67
|
+
else
|
|
68
|
+
writeSync(1, rendered);
|
|
69
|
+
}
|
|
70
|
+
export function resolveHookDerivedWatcherScript(pkgRoot = getPackageRoot()) {
|
|
71
|
+
return resolveDistScript(pkgRoot, "hook-derived-watcher.js");
|
|
72
|
+
}
|
|
73
|
+
export function resolveNotifyHookScript(pkgRoot = getPackageRoot()) {
|
|
74
|
+
return resolveDistScript(pkgRoot, "notify-hook.js");
|
|
75
|
+
}
|
|
76
|
+
function resolveDistScript(pkgRoot, scriptName) {
|
|
77
|
+
return join(pkgRoot, "dist", "scripts", scriptName);
|
|
78
|
+
}
|
|
79
|
+
export const HELP = `
|
|
80
|
+
Roblox Creator Skills (rcs) - Creator workflow runtime for Codex CLI
|
|
81
|
+
|
|
82
|
+
Usage:
|
|
83
|
+
rcs Launch Codex CLI (detached tmux by default on supported interactive terminals)
|
|
84
|
+
rcs exec Run codex exec non-interactively with RCS AGENTS/overlay injection
|
|
85
|
+
rcs exec inject <session-id> --prompt <text>
|
|
86
|
+
Queue audited follow-up instructions for a running non-interactive exec job
|
|
87
|
+
rcs setup Install skills, prompts, MCP servers, and scope-specific AGENTS.md
|
|
88
|
+
(user scope prompts for legacy vs plugin skill delivery when needed)
|
|
89
|
+
rcs update Check npm now, update the global install immediately, then refresh setup
|
|
90
|
+
rcs uninstall Remove RCS configuration and clean up installed artifacts
|
|
91
|
+
rcs doctor Check installation health
|
|
92
|
+
rcs list List packaged RCS skills and native agent prompts (--json)
|
|
93
|
+
rcs cleanup Kill orphaned RCS MCP server processes and remove stale RCS /tmp directories
|
|
94
|
+
rcs doctor --team Check team/swarm runtime health diagnostics
|
|
95
|
+
rcs ask Ask local provider CLI (claude|gemini) and write artifact output
|
|
96
|
+
rcs question RCS-owned blocking question UI entrypoint for agent-invoked user questions
|
|
97
|
+
rcs adapt Scaffold RCS-owned adapter foundations for persistent external targets
|
|
98
|
+
rcs resume Resume a previous interactive Codex session
|
|
99
|
+
rcs explore Default read-only exploration entrypoint (may adaptively use sparkshell backend)
|
|
100
|
+
rcs session Search prior local session transcripts and history artifacts
|
|
101
|
+
rcs agents-init [path]
|
|
102
|
+
Bootstrap lightweight AGENTS.md files for a repo/subtree
|
|
103
|
+
rcs agents Manage Codex native agent TOML files
|
|
104
|
+
rcs deepinit [path]
|
|
105
|
+
Alias for agents-init (lightweight AGENTS bootstrap only)
|
|
106
|
+
rcs team Spawn parallel worker panes in tmux and bootstrap inbox/task state
|
|
107
|
+
rcs ralph Launch Codex with ralph persistence mode active
|
|
108
|
+
rcs autoresearch [DEPRECATED] Use $autoresearch; direct CLI launch removed
|
|
109
|
+
rcs version Show version information
|
|
110
|
+
rcs tmux-hook Manage tmux prompt injection workaround (init|status|validate|test)
|
|
111
|
+
rcs hooks Manage hook plugins (init|status|validate|test)
|
|
112
|
+
rcs hud Show HUD statusline (--watch, --json, --preset=NAME)
|
|
113
|
+
rcs sidecar Show read-only team/multi-agent visualization (--watch, --json, --tmux)
|
|
114
|
+
rcs state Read/write/list RCS mode state via CLI parity surface
|
|
115
|
+
rcs notepad CLI parity for RCS notepad MCP tools
|
|
116
|
+
rcs project-memory
|
|
117
|
+
CLI parity for RCS project-memory MCP tools
|
|
118
|
+
rcs trace CLI parity for RCS trace MCP tools
|
|
119
|
+
rcs code-intel
|
|
120
|
+
CLI parity for RCS code-intel MCP tools
|
|
121
|
+
rcs wiki CLI parity for RCS wiki MCP tools
|
|
122
|
+
rcs mcp-serve Launch an RCS stdio MCP server target (plugin/runtime use)
|
|
123
|
+
rcs sparkshell <command> [args...]
|
|
124
|
+
rcs sparkshell --tmux-pane <pane-id> [--tail-lines <100-1000>]
|
|
125
|
+
Run native sparkshell sidecar for direct command execution or explicit tmux-pane summarization
|
|
126
|
+
(also used as an adaptive backend for qualifying read-only explore tasks)
|
|
127
|
+
rcs help Show this help message
|
|
128
|
+
rcs status Show active modes and state
|
|
129
|
+
rcs cancel Cancel active execution modes
|
|
130
|
+
rcs reasoning Show or set model reasoning effort (low|medium|high|xhigh)
|
|
131
|
+
|
|
132
|
+
Creator workflow triggers (use inside Codex sessions):
|
|
133
|
+
$brief Capture goals, constraints, genre, audience, and outcome
|
|
134
|
+
$blueprint Generate structured design and planning artifacts
|
|
135
|
+
$forge Generate concrete creator-facing deliverables and specs
|
|
136
|
+
$crew Orchestrate multi-role creator workflows
|
|
137
|
+
$autoforge Run the end-to-end creator workflow with minimal supervision
|
|
138
|
+
|
|
139
|
+
Psychology-aware creator triggers:
|
|
140
|
+
$brief:audience Target fantasy, habit patterns, pain language, return motive
|
|
141
|
+
$brief:motivation Driver ranking + anti-pattern risk scan
|
|
142
|
+
$blueprint:psych Player psychology blueprint
|
|
143
|
+
$blueprint:loop Session, daily, weekly, and comeback loop map
|
|
144
|
+
$blueprint:retention D1/D7/D30 retention assumptions and cadence
|
|
145
|
+
$blueprint:social Social machine design
|
|
146
|
+
$forge:reward-loop Reward loop specification
|
|
147
|
+
$forge:daily-loop Daily return motivator spec
|
|
148
|
+
$forge:event-loop Event and urgency loop spec
|
|
149
|
+
$forge:progression XP, level, prestige, rebirth, and unlock ladders
|
|
150
|
+
$forge:status Prestige and visible status systems
|
|
151
|
+
$forge:fomo Fair urgency mechanics with guardrails
|
|
152
|
+
$forge:mastery Skill-expression and optimization systems
|
|
153
|
+
$forge:community Social stickiness systems
|
|
154
|
+
|
|
155
|
+
Options:
|
|
156
|
+
--yolo Launch Codex in yolo mode (shorthand for: rcs launch --yolo)
|
|
157
|
+
--high Launch Codex with high reasoning effort
|
|
158
|
+
(shorthand for: -c model_reasoning_effort="high")
|
|
159
|
+
--xhigh Launch Codex with xhigh reasoning effort
|
|
160
|
+
(shorthand for: -c model_reasoning_effort="xhigh")
|
|
161
|
+
--madmax DANGEROUS: bypass Codex approvals and sandbox
|
|
162
|
+
(alias for --dangerously-bypass-approvals-and-sandbox)
|
|
163
|
+
--spark Use the Codex spark model (~1.3x faster) for team workers only
|
|
164
|
+
Workers get the configured low-complexity team model; leader model unchanged
|
|
165
|
+
--madmax-spark spark model for workers + bypass approvals for leader and workers
|
|
166
|
+
(shorthand for: --spark --madmax)
|
|
167
|
+
--notify-temp Enable temporary notification routing for this run/session only
|
|
168
|
+
--direct Launch the interactive leader directly without RCS tmux/HUD management
|
|
169
|
+
--tmux Launch the interactive leader session in detached tmux
|
|
170
|
+
--discord Select Discord provider for temporary notification mode
|
|
171
|
+
--slack Select Slack provider for temporary notification mode
|
|
172
|
+
--telegram Select Telegram provider for temporary notification mode
|
|
173
|
+
--custom <name>
|
|
174
|
+
Select custom/OpenClaw gateway name for temporary notification mode
|
|
175
|
+
-w, --worktree[=<name>]
|
|
176
|
+
Launch Codex in a git worktree (detached when no name is given)
|
|
177
|
+
--force Force reinstall (overwrite existing files)
|
|
178
|
+
--merge-agents
|
|
179
|
+
Merge RCS-managed AGENTS.md sections into an existing AGENTS.md
|
|
180
|
+
instead of overwriting user-authored content
|
|
181
|
+
--dry-run Show what would be done without doing it
|
|
182
|
+
--plugin Use Codex plugin delivery for rcs setup and remove legacy RCS-managed user/project components
|
|
183
|
+
--legacy Use legacy setup delivery for rcs setup, overriding persisted plugin mode
|
|
184
|
+
--install-mode <legacy|plugin>
|
|
185
|
+
Explicit setup install mode (canonical form; --legacy/--plugin are aliases)
|
|
186
|
+
--keep-config Skip config.toml cleanup during uninstall
|
|
187
|
+
--purge Remove .rcs/ cache directory during uninstall
|
|
188
|
+
--verbose Show detailed output
|
|
189
|
+
--scope Setup scope for "rcs setup" only:
|
|
190
|
+
user | project
|
|
191
|
+
|
|
192
|
+
Launch policy:
|
|
193
|
+
RCS_LAUNCH_POLICY=direct|tmux|detached-tmux|auto
|
|
194
|
+
Choose the default leader launch policy when no CLI policy flag is present
|
|
195
|
+
unset RCS_LAUNCH_POLICY
|
|
196
|
+
Return to the auto/default policy (detached tmux on supported interactive terminals)
|
|
197
|
+
rcs --direct --yolo
|
|
198
|
+
Run this launch without RCS tmux/HUD management
|
|
199
|
+
RCS_LAUNCH_POLICY=direct rcs --yolo
|
|
200
|
+
Use direct launch from the environment
|
|
201
|
+
RCS_LAUNCH_POLICY=direct rcs --tmux --yolo
|
|
202
|
+
CLI policy flags override the environment for one launch
|
|
203
|
+
Config files are intentionally not used for launch policy in this release.
|
|
204
|
+
`;
|
|
205
|
+
const REASONING_KEY = "model_reasoning_effort";
|
|
206
|
+
const MODEL_INSTRUCTIONS_FILE_KEY = "model_instructions_file";
|
|
207
|
+
const TEAM_WORKER_LAUNCH_ARGS_ENV = "RCS_TEAM_WORKER_LAUNCH_ARGS";
|
|
208
|
+
const TEAM_INHERIT_LEADER_FLAGS_ENV = "RCS_TEAM_INHERIT_LEADER_FLAGS";
|
|
209
|
+
const RCS_BYPASS_DEFAULT_SYSTEM_PROMPT_ENV = "RCS_BYPASS_DEFAULT_SYSTEM_PROMPT";
|
|
210
|
+
const RCS_MODEL_INSTRUCTIONS_FILE_ENV = "RCS_MODEL_INSTRUCTIONS_FILE";
|
|
211
|
+
const RCS_INSTANCE_OPTION = "@rcs_instance_id";
|
|
212
|
+
const RCS_RALPH_APPEND_INSTRUCTIONS_FILE_ENV = "RCS_RALPH_APPEND_INSTRUCTIONS_FILE";
|
|
213
|
+
const RCS_AUTORESEARCH_APPEND_INSTRUCTIONS_FILE_ENV = "RCS_AUTORESEARCH_APPEND_INSTRUCTIONS_FILE";
|
|
214
|
+
const REASONING_MODES = ["low", "medium", "high", "xhigh"];
|
|
215
|
+
const REASONING_MODE_SET = new Set(REASONING_MODES);
|
|
216
|
+
const REASONING_USAGE = "Usage: rcs reasoning <low|medium|high|xhigh>";
|
|
217
|
+
const ALLOWED_SHELLS = new Set([
|
|
218
|
+
"/bin/sh",
|
|
219
|
+
"/bin/bash",
|
|
220
|
+
"/bin/zsh",
|
|
221
|
+
"/bin/dash",
|
|
222
|
+
"/bin/fish",
|
|
223
|
+
"/usr/bin/sh",
|
|
224
|
+
"/usr/bin/bash",
|
|
225
|
+
"/usr/bin/zsh",
|
|
226
|
+
"/usr/bin/dash",
|
|
227
|
+
"/usr/bin/fish",
|
|
228
|
+
"/usr/local/bin/bash",
|
|
229
|
+
"/usr/local/bin/zsh",
|
|
230
|
+
"/usr/local/bin/fish",
|
|
231
|
+
"/opt/local/bin/zsh",
|
|
232
|
+
"/opt/homebrew/bin/zsh",
|
|
233
|
+
]);
|
|
234
|
+
const WINDOWS_DETACHED_BOOTSTRAP_DELAY_MS = 2500;
|
|
235
|
+
const CODEX_VERSION_FLAGS = new Set(["--version", "-V"]);
|
|
236
|
+
const TMUX_EXTENDED_KEYS_MODE = "always";
|
|
237
|
+
const TMUX_EXTENDED_KEYS_FALLBACK_MODE = "off";
|
|
238
|
+
const TMUX_EXTENDED_KEYS_LEASE_DIR = "tmux-extended-keys";
|
|
239
|
+
const TMUX_EXTENDED_KEYS_LOCK_RETRY_MS = 20;
|
|
240
|
+
const TMUX_EXTENDED_KEYS_LOCK_MAX_ATTEMPTS = 100;
|
|
241
|
+
const TMUX_EXTENDED_KEYS_LOCK_STALE_MS = 30_000;
|
|
242
|
+
const NESTED_HELP_COMMANDS = new Set([
|
|
243
|
+
"ask",
|
|
244
|
+
"question",
|
|
245
|
+
"cleanup",
|
|
246
|
+
"adapt",
|
|
247
|
+
"autoresearch",
|
|
248
|
+
"agents",
|
|
249
|
+
"agents-init",
|
|
250
|
+
"deepinit",
|
|
251
|
+
"exec",
|
|
252
|
+
"hooks",
|
|
253
|
+
"list",
|
|
254
|
+
"hud",
|
|
255
|
+
"sidecar",
|
|
256
|
+
"state",
|
|
257
|
+
"wiki",
|
|
258
|
+
"mcp-serve",
|
|
259
|
+
"ralph",
|
|
260
|
+
"resume",
|
|
261
|
+
"session",
|
|
262
|
+
"sparkshell",
|
|
263
|
+
"team",
|
|
264
|
+
"tmux-hook",
|
|
265
|
+
]);
|
|
266
|
+
export function resolveSetupInstallModeArg(args) {
|
|
267
|
+
let value;
|
|
268
|
+
const setValue = (next, source) => {
|
|
269
|
+
if (value && value !== next) {
|
|
270
|
+
throw new Error(`Conflicting setup install mode flags: ${source} selects ${next}, but another flag already selected ${value}`);
|
|
271
|
+
}
|
|
272
|
+
value = next;
|
|
273
|
+
};
|
|
274
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
275
|
+
const arg = args[index];
|
|
276
|
+
if (arg === "--plugin") {
|
|
277
|
+
setValue("plugin", arg);
|
|
278
|
+
continue;
|
|
279
|
+
}
|
|
280
|
+
if (arg === "--legacy") {
|
|
281
|
+
setValue("legacy", arg);
|
|
282
|
+
continue;
|
|
283
|
+
}
|
|
284
|
+
if (arg === "--install-mode") {
|
|
285
|
+
const next = args[index + 1];
|
|
286
|
+
if (!next || next.startsWith("-")) {
|
|
287
|
+
throw new Error(`Missing setup install mode value after --install-mode. Expected one of: legacy, plugin`);
|
|
288
|
+
}
|
|
289
|
+
if (next !== "legacy" && next !== "plugin") {
|
|
290
|
+
throw new Error(`Invalid setup install mode: ${next}. Expected one of: legacy, plugin`);
|
|
291
|
+
}
|
|
292
|
+
setValue(next, arg);
|
|
293
|
+
index += 1;
|
|
294
|
+
continue;
|
|
295
|
+
}
|
|
296
|
+
if (arg.startsWith("--install-mode=")) {
|
|
297
|
+
const next = arg.slice("--install-mode=".length);
|
|
298
|
+
if (next !== "legacy" && next !== "plugin") {
|
|
299
|
+
throw new Error(`Invalid setup install mode: ${next}. Expected one of: legacy, plugin`);
|
|
300
|
+
}
|
|
301
|
+
setValue(next, "--install-mode");
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
return value;
|
|
305
|
+
}
|
|
306
|
+
export function resolveSetupScopeArg(args) {
|
|
307
|
+
let value;
|
|
308
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
309
|
+
const arg = args[index];
|
|
310
|
+
if (arg === "--scope") {
|
|
311
|
+
const next = args[index + 1];
|
|
312
|
+
if (!next || next.startsWith("-")) {
|
|
313
|
+
throw new Error(`Missing setup scope value after --scope. Expected one of: ${SETUP_SCOPES.join(", ")}`);
|
|
314
|
+
}
|
|
315
|
+
value = next;
|
|
316
|
+
index += 1;
|
|
317
|
+
continue;
|
|
318
|
+
}
|
|
319
|
+
if (arg.startsWith("--scope=")) {
|
|
320
|
+
value = arg.slice("--scope=".length);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
if (!value)
|
|
324
|
+
return undefined;
|
|
325
|
+
if (SETUP_SCOPES.includes(value)) {
|
|
326
|
+
return value;
|
|
327
|
+
}
|
|
328
|
+
throw new Error(`Invalid setup scope: ${value}. Expected one of: ${SETUP_SCOPES.join(", ")}`);
|
|
329
|
+
}
|
|
330
|
+
export function resolveCliInvocation(args) {
|
|
331
|
+
const firstArg = args[0];
|
|
332
|
+
if (firstArg === "--help" || firstArg === "-h") {
|
|
333
|
+
return { command: "help", launchArgs: [] };
|
|
334
|
+
}
|
|
335
|
+
if (firstArg === "--version" || firstArg === "-v") {
|
|
336
|
+
return { command: "version", launchArgs: [] };
|
|
337
|
+
}
|
|
338
|
+
if (!firstArg || firstArg.startsWith("--")) {
|
|
339
|
+
return { command: "launch", launchArgs: firstArg ? args : [] };
|
|
340
|
+
}
|
|
341
|
+
if (firstArg === "launch") {
|
|
342
|
+
return { command: "launch", launchArgs: args.slice(1) };
|
|
343
|
+
}
|
|
344
|
+
if (firstArg === "exec") {
|
|
345
|
+
return { command: "exec", launchArgs: args.slice(1) };
|
|
346
|
+
}
|
|
347
|
+
if (firstArg === "resume") {
|
|
348
|
+
return { command: "resume", launchArgs: args.slice(1) };
|
|
349
|
+
}
|
|
350
|
+
return { command: firstArg, launchArgs: [] };
|
|
351
|
+
}
|
|
352
|
+
export function resolveNotifyTempContract(args, env = process.env) {
|
|
353
|
+
return parseNotifyTempContractFromArgs(args, env);
|
|
354
|
+
}
|
|
355
|
+
export function commandOwnsLocalHelp(command) {
|
|
356
|
+
return NESTED_HELP_COMMANDS.has(command);
|
|
357
|
+
}
|
|
358
|
+
const RCS_LAUNCH_POLICY_ENV = "RCS_LAUNCH_POLICY";
|
|
359
|
+
let warnedInvalidEnvLaunchPolicy = false;
|
|
360
|
+
function splitLeaderLaunchPolicyArgs(args) {
|
|
361
|
+
const remainingArgs = [];
|
|
362
|
+
let explicitPolicy;
|
|
363
|
+
let passthroughOnly = false;
|
|
364
|
+
for (const arg of args) {
|
|
365
|
+
if (passthroughOnly) {
|
|
366
|
+
remainingArgs.push(arg);
|
|
367
|
+
continue;
|
|
368
|
+
}
|
|
369
|
+
if (arg === "--") {
|
|
370
|
+
passthroughOnly = true;
|
|
371
|
+
remainingArgs.push(arg);
|
|
372
|
+
continue;
|
|
373
|
+
}
|
|
374
|
+
if (arg === "--direct") {
|
|
375
|
+
explicitPolicy = "direct";
|
|
376
|
+
continue;
|
|
377
|
+
}
|
|
378
|
+
if (arg === "--tmux") {
|
|
379
|
+
explicitPolicy = "detached-tmux";
|
|
380
|
+
continue;
|
|
381
|
+
}
|
|
382
|
+
remainingArgs.push(arg);
|
|
383
|
+
}
|
|
384
|
+
return { explicitPolicy, remainingArgs };
|
|
385
|
+
}
|
|
386
|
+
export function resolveLeaderLaunchPolicyOverride(args) {
|
|
387
|
+
return splitLeaderLaunchPolicyArgs(args).explicitPolicy;
|
|
388
|
+
}
|
|
389
|
+
export function resolveEnvLaunchPolicyOverride(env = process.env) {
|
|
390
|
+
const rawValue = env[RCS_LAUNCH_POLICY_ENV]?.trim();
|
|
391
|
+
if (!rawValue)
|
|
392
|
+
return undefined;
|
|
393
|
+
const value = rawValue.toLowerCase();
|
|
394
|
+
if (value === "auto")
|
|
395
|
+
return undefined;
|
|
396
|
+
if (value === "direct")
|
|
397
|
+
return "direct";
|
|
398
|
+
if (value === "tmux" || value === "detached-tmux")
|
|
399
|
+
return "detached-tmux";
|
|
400
|
+
if (!warnedInvalidEnvLaunchPolicy) {
|
|
401
|
+
warnedInvalidEnvLaunchPolicy = true;
|
|
402
|
+
console.warn(`[rcs] warning: invalid ${RCS_LAUNCH_POLICY_ENV}="${rawValue}". ` +
|
|
403
|
+
"Expected direct, tmux, detached-tmux, or auto. Falling back to auto/default launch policy.");
|
|
404
|
+
}
|
|
405
|
+
return undefined;
|
|
406
|
+
}
|
|
407
|
+
export function resolveEffectiveLeaderLaunchPolicyOverride(args, env = process.env) {
|
|
408
|
+
return (resolveLeaderLaunchPolicyOverride(args) ?? resolveEnvLaunchPolicyOverride(env));
|
|
409
|
+
}
|
|
410
|
+
export function resolveCodexLaunchPolicy(env = process.env, _platform = process.platform, tmuxAvailable = isTmuxAvailable(), nativeWindows = isNativeWindows(), stdinIsTTY = Boolean(process.stdin.isTTY), stdoutIsTTY = Boolean(process.stdout.isTTY), explicitPolicy) {
|
|
411
|
+
if (explicitPolicy === "direct")
|
|
412
|
+
return "direct";
|
|
413
|
+
if (env.TMUX)
|
|
414
|
+
return "inside-tmux";
|
|
415
|
+
if (explicitPolicy === "detached-tmux")
|
|
416
|
+
return tmuxAvailable ? "detached-tmux" : "direct";
|
|
417
|
+
if (_platform === "win32")
|
|
418
|
+
return "direct";
|
|
419
|
+
if (nativeWindows)
|
|
420
|
+
return "direct";
|
|
421
|
+
if (!stdinIsTTY || !stdoutIsTTY)
|
|
422
|
+
return "direct";
|
|
423
|
+
return tmuxAvailable ? "detached-tmux" : "direct";
|
|
424
|
+
}
|
|
425
|
+
function resolveTmuxExecutableForLaunch() {
|
|
426
|
+
return resolveTmuxBinaryForPlatform() || "tmux";
|
|
427
|
+
}
|
|
428
|
+
export function runtimeCodexHomePath(cwd, sessionId) {
|
|
429
|
+
return join(cwd, ".rcs", "runtime", "codex-home", sessionId);
|
|
430
|
+
}
|
|
431
|
+
async function linkOrCopyCodexHomeEntry(source, destination) {
|
|
432
|
+
const stat = await lstat(source);
|
|
433
|
+
try {
|
|
434
|
+
await symlink(source, destination, stat.isDirectory() && process.platform === "win32" ? "junction" : undefined);
|
|
435
|
+
}
|
|
436
|
+
catch {
|
|
437
|
+
if (stat.isDirectory()) {
|
|
438
|
+
await cp(source, destination, { recursive: true, force: true, verbatimSymlinks: true });
|
|
439
|
+
return;
|
|
440
|
+
}
|
|
441
|
+
await copyFile(source, destination);
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* Project-scope setup keeps durable Codex config under <repo>/.codex, but the
|
|
446
|
+
* Codex TUI also stores model-availability NUX counters in CODEX_HOME/config.toml.
|
|
447
|
+
* Launch against a session mirror so those runtime writes never dirty the
|
|
448
|
+
* durable project config while preserving the project config as the launch input.
|
|
449
|
+
*/
|
|
450
|
+
export async function prepareRuntimeCodexHomeForProjectLaunch(cwd, sessionId, projectCodexHome) {
|
|
451
|
+
const runtimeCodexHome = runtimeCodexHomePath(cwd, sessionId);
|
|
452
|
+
await rm(runtimeCodexHome, { recursive: true, force: true });
|
|
453
|
+
await mkdir(runtimeCodexHome, { recursive: true });
|
|
454
|
+
if (!existsSync(projectCodexHome))
|
|
455
|
+
return runtimeCodexHome;
|
|
456
|
+
for (const entry of await readdir(projectCodexHome, { withFileTypes: true })) {
|
|
457
|
+
const source = join(projectCodexHome, entry.name);
|
|
458
|
+
const destination = join(runtimeCodexHome, entry.name);
|
|
459
|
+
if (entry.name === "config.toml") {
|
|
460
|
+
await copyFile(source, destination);
|
|
461
|
+
continue;
|
|
462
|
+
}
|
|
463
|
+
await linkOrCopyCodexHomeEntry(source, destination);
|
|
464
|
+
}
|
|
465
|
+
return runtimeCodexHome;
|
|
466
|
+
}
|
|
467
|
+
export async function prepareCodexHomeForLaunch(cwd, sessionId, env = process.env) {
|
|
468
|
+
const projectLocalCodexHomeForCleanup = resolveProjectLocalCodexHomeForLaunch(cwd, env);
|
|
469
|
+
if (projectLocalCodexHomeForCleanup) {
|
|
470
|
+
const runtimeCodexHome = await prepareRuntimeCodexHomeForProjectLaunch(cwd, sessionId, projectLocalCodexHomeForCleanup);
|
|
471
|
+
return {
|
|
472
|
+
codexHomeOverride: runtimeCodexHome,
|
|
473
|
+
projectLocalCodexHomeForCleanup,
|
|
474
|
+
runtimeCodexHomeForCleanup: runtimeCodexHome,
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
return {
|
|
478
|
+
codexHomeOverride: resolveCodexHomeForLaunch(cwd, env),
|
|
479
|
+
projectLocalCodexHomeForCleanup,
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
async function cleanupRuntimeCodexHome(runtimeCodexHomeForCleanup) {
|
|
483
|
+
if (!runtimeCodexHomeForCleanup)
|
|
484
|
+
return;
|
|
485
|
+
await rm(runtimeCodexHomeForCleanup, { recursive: true, force: true });
|
|
486
|
+
}
|
|
487
|
+
function execTmuxFileSync(args, options) {
|
|
488
|
+
return execFileSync(resolveTmuxExecutableForLaunch(), args, {
|
|
489
|
+
...(options ?? {}),
|
|
490
|
+
...(process.platform === "win32" ? { windowsHide: true } : {}),
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
function hasErrnoCode(error, code) {
|
|
494
|
+
return Boolean(error &&
|
|
495
|
+
typeof error === "object" &&
|
|
496
|
+
"code" in error &&
|
|
497
|
+
error.code === code);
|
|
498
|
+
}
|
|
499
|
+
function isMissingTmuxLaunchNoise(error) {
|
|
500
|
+
return error instanceof Error && /spawnSync tmux ENOENT/i.test(error.message);
|
|
501
|
+
}
|
|
502
|
+
function logCliOperationFailure(error) {
|
|
503
|
+
if (isMissingTmuxLaunchNoise(error))
|
|
504
|
+
return;
|
|
505
|
+
process.stderr.write(`[cli/index] operation failed: ${error}
|
|
506
|
+
`);
|
|
507
|
+
}
|
|
508
|
+
function tmuxFailureMessage(error) {
|
|
509
|
+
if (!error || typeof error !== "object")
|
|
510
|
+
return String(error);
|
|
511
|
+
const err = error;
|
|
512
|
+
const stderr = typeof err.stderr === "string" ? err.stderr : err.stderr?.toString();
|
|
513
|
+
const stdout = typeof err.stdout === "string" ? err.stdout : err.stdout?.toString();
|
|
514
|
+
const detail = (stderr || stdout || err.message || String(error)).trim();
|
|
515
|
+
return detail.replace(/\s+/g, " ");
|
|
516
|
+
}
|
|
517
|
+
function isUnsupportedTmuxExtendedKeysFailure(error) {
|
|
518
|
+
const message = tmuxFailureMessage(error).toLowerCase();
|
|
519
|
+
return (message.includes("extended-keys") &&
|
|
520
|
+
/(?:invalid|unknown|unsupported) (?:option|flag|argument)|no such option|unknown option/.test(message));
|
|
521
|
+
}
|
|
522
|
+
function isBenignMissingTmuxServerMessage(message) {
|
|
523
|
+
return (/no server running/i.test(message) ||
|
|
524
|
+
/error connecting to .*\(No such file or directory\)/i.test(message));
|
|
525
|
+
}
|
|
526
|
+
export function checkDetachedTmuxLaunchHealth() {
|
|
527
|
+
try {
|
|
528
|
+
execTmuxFileSync(["list-sessions"], {
|
|
529
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
530
|
+
encoding: "utf-8",
|
|
531
|
+
});
|
|
532
|
+
return { usable: true };
|
|
533
|
+
}
|
|
534
|
+
catch (err) {
|
|
535
|
+
const reason = tmuxFailureMessage(err);
|
|
536
|
+
if (isBenignMissingTmuxServerMessage(reason)) {
|
|
537
|
+
return { usable: true };
|
|
538
|
+
}
|
|
539
|
+
return { usable: false, reason };
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
function warnDetachedTmuxFallback(reason) {
|
|
543
|
+
const suffix = reason ? ` (${reason})` : "";
|
|
544
|
+
console.warn(`[rcs] warning: tmux is installed but its server/socket is unusable${suffix}. Falling back to direct Codex launch.`);
|
|
545
|
+
}
|
|
546
|
+
function resolveTmuxAwareLaunchPolicy(explicitLaunchPolicy, nativeWindows) {
|
|
547
|
+
const launchPolicy = resolveCodexLaunchPolicy(process.env, process.platform, undefined, nativeWindows, undefined, undefined, explicitLaunchPolicy);
|
|
548
|
+
if (launchPolicy !== "detached-tmux") {
|
|
549
|
+
return { launchPolicy, effectiveExplicitLaunchPolicy: explicitLaunchPolicy };
|
|
550
|
+
}
|
|
551
|
+
const tmuxHealth = checkDetachedTmuxLaunchHealth();
|
|
552
|
+
if (tmuxHealth.usable) {
|
|
553
|
+
return { launchPolicy, effectiveExplicitLaunchPolicy: explicitLaunchPolicy };
|
|
554
|
+
}
|
|
555
|
+
warnDetachedTmuxFallback(tmuxHealth.reason);
|
|
556
|
+
return { launchPolicy: "direct", effectiveExplicitLaunchPolicy: "direct" };
|
|
557
|
+
}
|
|
558
|
+
export function resolveSignalExitCode(signal) {
|
|
559
|
+
if (!signal)
|
|
560
|
+
return 1;
|
|
561
|
+
const signalNumber = osConstants.signals[signal];
|
|
562
|
+
if (typeof signalNumber === "number" && Number.isFinite(signalNumber)) {
|
|
563
|
+
return 128 + signalNumber;
|
|
564
|
+
}
|
|
565
|
+
return 1;
|
|
566
|
+
}
|
|
567
|
+
export function classifyCodexExecFailure(error) {
|
|
568
|
+
if (!error || typeof error !== "object") {
|
|
569
|
+
return {
|
|
570
|
+
kind: "launch-error",
|
|
571
|
+
message: String(error),
|
|
572
|
+
};
|
|
573
|
+
}
|
|
574
|
+
const err = error;
|
|
575
|
+
const code = typeof err.code === "string" ? err.code : undefined;
|
|
576
|
+
const message = typeof err.message === "string" && err.message.length > 0
|
|
577
|
+
? err.message
|
|
578
|
+
: "unknown codex launch failure";
|
|
579
|
+
const hasExitStatus = typeof err.status === "number";
|
|
580
|
+
const hasSignal = typeof err.signal === "string" && err.signal.length > 0;
|
|
581
|
+
if (hasExitStatus || hasSignal) {
|
|
582
|
+
return {
|
|
583
|
+
kind: "exit",
|
|
584
|
+
code,
|
|
585
|
+
message,
|
|
586
|
+
exitCode: hasExitStatus
|
|
587
|
+
? err.status
|
|
588
|
+
: resolveSignalExitCode(err.signal),
|
|
589
|
+
signal: hasSignal ? err.signal : undefined,
|
|
590
|
+
};
|
|
591
|
+
}
|
|
592
|
+
return {
|
|
593
|
+
kind: "launch-error",
|
|
594
|
+
code,
|
|
595
|
+
message,
|
|
596
|
+
};
|
|
597
|
+
}
|
|
598
|
+
function runCodexBlocking(cwd, launchArgs, codexEnv) {
|
|
599
|
+
const { result } = spawnPlatformCommandSync("codex", launchArgs, {
|
|
600
|
+
cwd,
|
|
601
|
+
stdio: "inherit",
|
|
602
|
+
env: codexEnv,
|
|
603
|
+
encoding: "utf-8",
|
|
604
|
+
});
|
|
605
|
+
if (result.error) {
|
|
606
|
+
const errno = result.error;
|
|
607
|
+
const kind = classifySpawnError(errno);
|
|
608
|
+
if (kind === "missing") {
|
|
609
|
+
console.error("[rcs] failed to launch codex: executable not found in PATH");
|
|
610
|
+
}
|
|
611
|
+
else if (kind === "blocked") {
|
|
612
|
+
console.error(`[rcs] failed to launch codex: executable is present but blocked in the current environment (${errno.code || "blocked"})`);
|
|
613
|
+
}
|
|
614
|
+
else {
|
|
615
|
+
console.error(`[rcs] failed to launch codex: ${errno.message}`);
|
|
616
|
+
}
|
|
617
|
+
throw result.error;
|
|
618
|
+
}
|
|
619
|
+
if (result.status !== 0) {
|
|
620
|
+
process.exitCode =
|
|
621
|
+
typeof result.status === "number"
|
|
622
|
+
? result.status
|
|
623
|
+
: resolveSignalExitCode(result.signal);
|
|
624
|
+
if (result.signal) {
|
|
625
|
+
console.error(`[rcs] codex exited due to signal ${result.signal}`);
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
export function buildHudPaneCleanupTargets(existingPaneIds, createdPaneId, leaderPaneId) {
|
|
630
|
+
const targets = new Set(existingPaneIds.filter((id) => id.startsWith("%")));
|
|
631
|
+
if (createdPaneId && createdPaneId.startsWith("%")) {
|
|
632
|
+
targets.add(createdPaneId);
|
|
633
|
+
}
|
|
634
|
+
// Guard: never kill the leader's own pane under any circumstances.
|
|
635
|
+
if (leaderPaneId && leaderPaneId.startsWith("%")) {
|
|
636
|
+
targets.delete(leaderPaneId);
|
|
637
|
+
}
|
|
638
|
+
return [...targets];
|
|
639
|
+
}
|
|
640
|
+
export async function main(args) {
|
|
641
|
+
const knownCommands = new Set([
|
|
642
|
+
"launch",
|
|
643
|
+
"exec",
|
|
644
|
+
"setup",
|
|
645
|
+
"update",
|
|
646
|
+
"list",
|
|
647
|
+
"agents",
|
|
648
|
+
"agents-init",
|
|
649
|
+
"deepinit",
|
|
650
|
+
"uninstall",
|
|
651
|
+
"doctor",
|
|
652
|
+
"cleanup",
|
|
653
|
+
"ask",
|
|
654
|
+
"question",
|
|
655
|
+
"autoresearch",
|
|
656
|
+
"explore",
|
|
657
|
+
"sparkshell",
|
|
658
|
+
"team",
|
|
659
|
+
"ralph",
|
|
660
|
+
"session",
|
|
661
|
+
"resume",
|
|
662
|
+
"version",
|
|
663
|
+
"tmux-hook",
|
|
664
|
+
"hooks",
|
|
665
|
+
"hud",
|
|
666
|
+
"sidecar",
|
|
667
|
+
"state",
|
|
668
|
+
"mcp-serve",
|
|
669
|
+
"status",
|
|
670
|
+
"cancel",
|
|
671
|
+
"help",
|
|
672
|
+
"--help",
|
|
673
|
+
"-h",
|
|
674
|
+
]);
|
|
675
|
+
const firstArg = args[0];
|
|
676
|
+
const { command, launchArgs } = resolveCliInvocation(args);
|
|
677
|
+
const flags = new Set(args.filter((a) => a.startsWith("--")));
|
|
678
|
+
const options = {
|
|
679
|
+
force: flags.has("--force"),
|
|
680
|
+
mergeAgents: flags.has("--merge-agents"),
|
|
681
|
+
dryRun: flags.has("--dry-run"),
|
|
682
|
+
verbose: flags.has("--verbose"),
|
|
683
|
+
team: flags.has("--team"),
|
|
684
|
+
};
|
|
685
|
+
if (flags.has("--help") && !commandOwnsLocalHelp(command)) {
|
|
686
|
+
console.log(HELP);
|
|
687
|
+
return;
|
|
688
|
+
}
|
|
689
|
+
try {
|
|
690
|
+
switch (command) {
|
|
691
|
+
case "launch":
|
|
692
|
+
await launchWithHud(launchArgs);
|
|
693
|
+
break;
|
|
694
|
+
case "resume":
|
|
695
|
+
await launchWithHud(["resume", ...launchArgs]);
|
|
696
|
+
break;
|
|
697
|
+
case "setup":
|
|
698
|
+
await setup({
|
|
699
|
+
force: options.force,
|
|
700
|
+
mergeAgents: options.mergeAgents,
|
|
701
|
+
dryRun: options.dryRun,
|
|
702
|
+
verbose: options.verbose,
|
|
703
|
+
scope: resolveSetupScopeArg(args.slice(1)),
|
|
704
|
+
installMode: resolveSetupInstallModeArg(args.slice(1)),
|
|
705
|
+
});
|
|
706
|
+
break;
|
|
707
|
+
case "update":
|
|
708
|
+
await runImmediateUpdate(process.cwd());
|
|
709
|
+
break;
|
|
710
|
+
case "list":
|
|
711
|
+
await listCommand(args.slice(1));
|
|
712
|
+
break;
|
|
713
|
+
case "agents":
|
|
714
|
+
await agentsCommand(args.slice(1));
|
|
715
|
+
break;
|
|
716
|
+
case "agents-init":
|
|
717
|
+
await agentsInitCommand(args.slice(1));
|
|
718
|
+
break;
|
|
719
|
+
case "deepinit":
|
|
720
|
+
await agentsInitCommand(args.slice(1));
|
|
721
|
+
break;
|
|
722
|
+
case "uninstall":
|
|
723
|
+
await uninstall({
|
|
724
|
+
dryRun: options.dryRun,
|
|
725
|
+
keepConfig: flags.has("--keep-config"),
|
|
726
|
+
verbose: options.verbose,
|
|
727
|
+
purge: flags.has("--purge"),
|
|
728
|
+
scope: resolveSetupScopeArg(args.slice(1)),
|
|
729
|
+
});
|
|
730
|
+
break;
|
|
731
|
+
case "doctor": {
|
|
732
|
+
const { doctor } = await import("./doctor.js");
|
|
733
|
+
await doctor(options);
|
|
734
|
+
break;
|
|
735
|
+
}
|
|
736
|
+
case "ask":
|
|
737
|
+
await askCommand(args.slice(1));
|
|
738
|
+
break;
|
|
739
|
+
case "question":
|
|
740
|
+
await questionCommand(args.slice(1));
|
|
741
|
+
break;
|
|
742
|
+
case "adapt":
|
|
743
|
+
await adaptCommand(args.slice(1));
|
|
744
|
+
break;
|
|
745
|
+
case "cleanup":
|
|
746
|
+
await cleanupCommand(args.slice(1));
|
|
747
|
+
break;
|
|
748
|
+
case "autoresearch":
|
|
749
|
+
await autoresearchCommand(args.slice(1));
|
|
750
|
+
break;
|
|
751
|
+
case "explore":
|
|
752
|
+
await exploreCommand(args.slice(1));
|
|
753
|
+
break;
|
|
754
|
+
case "exec":
|
|
755
|
+
if (launchArgs[0] === "inject") {
|
|
756
|
+
await execInjectCommand(launchArgs);
|
|
757
|
+
}
|
|
758
|
+
else {
|
|
759
|
+
await execWithOverlay(launchArgs);
|
|
760
|
+
}
|
|
761
|
+
break;
|
|
762
|
+
case "sparkshell":
|
|
763
|
+
await sparkshellCommand(args.slice(1));
|
|
764
|
+
break;
|
|
765
|
+
case "team":
|
|
766
|
+
await teamCommand(args.slice(1), options);
|
|
767
|
+
break;
|
|
768
|
+
case "session":
|
|
769
|
+
await sessionCommand(args.slice(1));
|
|
770
|
+
break;
|
|
771
|
+
case "ralph":
|
|
772
|
+
await ralphCommand(args.slice(1));
|
|
773
|
+
break;
|
|
774
|
+
case "version":
|
|
775
|
+
version();
|
|
776
|
+
break;
|
|
777
|
+
case "hud":
|
|
778
|
+
await hudCommand(args.slice(1));
|
|
779
|
+
break;
|
|
780
|
+
case "sidecar":
|
|
781
|
+
await sidecarCommand(args.slice(1));
|
|
782
|
+
break;
|
|
783
|
+
case "state":
|
|
784
|
+
await stateCommand(args.slice(1));
|
|
785
|
+
break;
|
|
786
|
+
case "notepad":
|
|
787
|
+
await mcpParityCommand("notepad", args.slice(1));
|
|
788
|
+
break;
|
|
789
|
+
case "project-memory":
|
|
790
|
+
await mcpParityCommand("project-memory", args.slice(1));
|
|
791
|
+
break;
|
|
792
|
+
case "trace":
|
|
793
|
+
await mcpParityCommand("trace", args.slice(1));
|
|
794
|
+
break;
|
|
795
|
+
case "code-intel":
|
|
796
|
+
await mcpParityCommand("code-intel", args.slice(1));
|
|
797
|
+
break;
|
|
798
|
+
case "wiki":
|
|
799
|
+
await mcpParityCommand("wiki", args.slice(1));
|
|
800
|
+
break;
|
|
801
|
+
case "mcp-serve":
|
|
802
|
+
await mcpServeCommand(args.slice(1));
|
|
803
|
+
break;
|
|
804
|
+
case "tmux-hook":
|
|
805
|
+
await tmuxHookCommand(args.slice(1));
|
|
806
|
+
break;
|
|
807
|
+
case "hooks":
|
|
808
|
+
await hooksCommand(args.slice(1));
|
|
809
|
+
break;
|
|
810
|
+
case "status":
|
|
811
|
+
await showStatus();
|
|
812
|
+
break;
|
|
813
|
+
case "cancel":
|
|
814
|
+
await cancelModes();
|
|
815
|
+
break;
|
|
816
|
+
case "reasoning":
|
|
817
|
+
await reasoningCommand(args.slice(1));
|
|
818
|
+
break;
|
|
819
|
+
case "help":
|
|
820
|
+
case "--help":
|
|
821
|
+
case "-h":
|
|
822
|
+
console.log(HELP);
|
|
823
|
+
break;
|
|
824
|
+
default:
|
|
825
|
+
if (firstArg &&
|
|
826
|
+
firstArg.startsWith("-") &&
|
|
827
|
+
!knownCommands.has(firstArg)) {
|
|
828
|
+
await launchWithHud(args);
|
|
829
|
+
break;
|
|
830
|
+
}
|
|
831
|
+
console.error(`Unknown command: ${command}`);
|
|
832
|
+
console.log(HELP);
|
|
833
|
+
process.exit(1);
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
catch (err) {
|
|
837
|
+
console.error(`Error: ${err instanceof Error ? err.message : err}`);
|
|
838
|
+
process.exit(1);
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
async function showStatus() {
|
|
842
|
+
const { readFile } = await import("fs/promises");
|
|
843
|
+
const cwd = process.cwd();
|
|
844
|
+
try {
|
|
845
|
+
const refs = await listModeStateFilesWithScopePreference(cwd);
|
|
846
|
+
const states = refs.map((ref) => ref.path);
|
|
847
|
+
if (states.length === 0) {
|
|
848
|
+
writeStdoutLine("No active modes.");
|
|
849
|
+
return;
|
|
850
|
+
}
|
|
851
|
+
for (const path of states) {
|
|
852
|
+
const content = await readFile(path, "utf-8");
|
|
853
|
+
let state;
|
|
854
|
+
try {
|
|
855
|
+
state = JSON.parse(content);
|
|
856
|
+
}
|
|
857
|
+
catch (err) {
|
|
858
|
+
logCliOperationFailure(err);
|
|
859
|
+
continue;
|
|
860
|
+
}
|
|
861
|
+
const file = basename(path);
|
|
862
|
+
const mode = file.replace("-state.json", "");
|
|
863
|
+
writeStdoutLine(`${mode}: ${state.active === true ? "ACTIVE" : "inactive"} (phase: ${String(state.current_phase || "n/a")})`);
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
catch (err) {
|
|
867
|
+
logCliOperationFailure(err);
|
|
868
|
+
writeStdoutLine("No active modes.");
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
async function reasoningCommand(args) {
|
|
872
|
+
const mode = args[0];
|
|
873
|
+
const configPath = codexConfigPath();
|
|
874
|
+
if (!mode) {
|
|
875
|
+
if (!existsSync(configPath)) {
|
|
876
|
+
console.log(`model_reasoning_effort is not set (${configPath} does not exist).`);
|
|
877
|
+
console.log(REASONING_USAGE);
|
|
878
|
+
return;
|
|
879
|
+
}
|
|
880
|
+
const { readFile } = await import("fs/promises");
|
|
881
|
+
const content = await readFile(configPath, "utf-8");
|
|
882
|
+
const current = readTopLevelTomlString(content, REASONING_KEY);
|
|
883
|
+
if (current) {
|
|
884
|
+
console.log(`Current ${REASONING_KEY}: ${current}`);
|
|
885
|
+
return;
|
|
886
|
+
}
|
|
887
|
+
console.log(`${REASONING_KEY} is not set in ${configPath}.`);
|
|
888
|
+
console.log(REASONING_USAGE);
|
|
889
|
+
return;
|
|
890
|
+
}
|
|
891
|
+
if (!REASONING_MODE_SET.has(mode)) {
|
|
892
|
+
throw new Error(`Invalid reasoning mode "${mode}". Expected one of: ${REASONING_MODES.join(", ")}.\n${REASONING_USAGE}`);
|
|
893
|
+
}
|
|
894
|
+
const { mkdir, readFile, writeFile } = await import("fs/promises");
|
|
895
|
+
await mkdir(dirname(configPath), { recursive: true });
|
|
896
|
+
const existing = existsSync(configPath)
|
|
897
|
+
? await readFile(configPath, "utf-8")
|
|
898
|
+
: "";
|
|
899
|
+
const updated = upsertTopLevelTomlString(existing, REASONING_KEY, mode);
|
|
900
|
+
await writeFile(configPath, updated);
|
|
901
|
+
console.log(`Set ${REASONING_KEY}="${mode}" in ${configPath}`);
|
|
902
|
+
}
|
|
903
|
+
export async function launchWithHud(args) {
|
|
904
|
+
if (isNativeWindows()) {
|
|
905
|
+
const { result } = spawnPlatformCommandSync("tmux", ["-V"], {
|
|
906
|
+
encoding: "utf-8",
|
|
907
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
908
|
+
});
|
|
909
|
+
if (result.error) {
|
|
910
|
+
const errno = result.error;
|
|
911
|
+
const kind = classifySpawnError(errno);
|
|
912
|
+
if (kind === "missing") {
|
|
913
|
+
console.warn("[rcs] warning: tmux was not found on native Windows. Continuing without tmux/HUD.\n" +
|
|
914
|
+
"[rcs] To enable tmux-backed features, install psmux:\n" +
|
|
915
|
+
"[rcs] winget install psmux\n" +
|
|
916
|
+
"[rcs] See: https://github.com/marlocarlo/psmux");
|
|
917
|
+
}
|
|
918
|
+
else {
|
|
919
|
+
console.warn(`[rcs] warning: tmux probe failed on native Windows (${errno.code || errno.message}). Continuing without tmux/HUD.`);
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
else if (result.status !== 0 && !isTmuxAvailable()) {
|
|
923
|
+
const stderr = (result.stderr || "").trim();
|
|
924
|
+
console.warn(`[rcs] warning: tmux reported an error on native Windows${stderr ? ` (${stderr})` : ""}. Continuing without tmux/HUD.`);
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
const launchCwd = process.cwd();
|
|
928
|
+
const parsedWorktree = parseWorktreeMode(args);
|
|
929
|
+
const notifyTempResult = resolveNotifyTempContract(parsedWorktree.remainingArgs, process.env);
|
|
930
|
+
const explicitLaunchPolicy = resolveEffectiveLeaderLaunchPolicyOverride(notifyTempResult.passthroughArgs, process.env);
|
|
931
|
+
const persistentCodexHomeForLaunch = resolveCodexHomeForLaunch(launchCwd, process.env);
|
|
932
|
+
const { launchPolicy, effectiveExplicitLaunchPolicy } = resolveTmuxAwareLaunchPolicy(explicitLaunchPolicy, isNativeWindows());
|
|
933
|
+
const enableNotifyFallbackAuthority = launchPolicy === "direct";
|
|
934
|
+
const workerSparkModel = resolveWorkerSparkModel(notifyTempResult.passthroughArgs, persistentCodexHomeForLaunch);
|
|
935
|
+
const normalizedArgs = normalizeCodexLaunchArgs(notifyTempResult.passthroughArgs);
|
|
936
|
+
let cwd = launchCwd;
|
|
937
|
+
let worktreeDirty = false;
|
|
938
|
+
if (parsedWorktree.mode.enabled) {
|
|
939
|
+
const planned = planWorktreeTarget({
|
|
940
|
+
cwd: launchCwd,
|
|
941
|
+
scope: "launch",
|
|
942
|
+
mode: parsedWorktree.mode,
|
|
943
|
+
});
|
|
944
|
+
const ensured = ensureWorktree(planned, { allowDirtyReuse: true });
|
|
945
|
+
if (ensured.enabled) {
|
|
946
|
+
cwd = ensured.worktreePath;
|
|
947
|
+
if (ensured.dirty) {
|
|
948
|
+
worktreeDirty = true;
|
|
949
|
+
process.stderr.write(`[rcs] Caution: worktree at ${cwd} has uncommitted changes.\n` +
|
|
950
|
+
` The session will launch as-is. Resolve the dirty state with RCS after launch, then proceed with your task.\n`);
|
|
951
|
+
}
|
|
952
|
+
const depBootstrap = ensureReusableNodeModules(cwd);
|
|
953
|
+
if (depBootstrap.strategy === "symlink") {
|
|
954
|
+
console.log(`[rcs] Reusing node_modules from ${depBootstrap.sourceNodeModulesPath}`);
|
|
955
|
+
}
|
|
956
|
+
else if (depBootstrap.strategy === "missing" && depBootstrap.warning) {
|
|
957
|
+
console.warn(`[rcs] ${depBootstrap.warning}`);
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
const sessionId = `rcs-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
962
|
+
try {
|
|
963
|
+
await maybeCheckAndPromptUpdate(cwd);
|
|
964
|
+
}
|
|
965
|
+
catch (err) {
|
|
966
|
+
logCliOperationFailure(err);
|
|
967
|
+
// Non-fatal: update checks must never block launch
|
|
968
|
+
}
|
|
969
|
+
try {
|
|
970
|
+
await maybePromptGithubStar();
|
|
971
|
+
}
|
|
972
|
+
catch (err) {
|
|
973
|
+
logCliOperationFailure(err);
|
|
974
|
+
// Non-fatal: star prompt must never block launch
|
|
975
|
+
}
|
|
976
|
+
// ── Phase 0.5: config repair ────────────────────────────────────────────
|
|
977
|
+
// After an rcs version upgrade the OLD setup code (still in memory) may
|
|
978
|
+
// have written a config.toml with duplicate [tui] sections. Codex CLI's
|
|
979
|
+
// TOML parser rejects duplicates, so we repair before spawning the CLI.
|
|
980
|
+
try {
|
|
981
|
+
const repaired = await repairConfigIfNeeded(resolveCodexConfigPathForLaunch(launchCwd, process.env), getPackageRoot());
|
|
982
|
+
if (repaired) {
|
|
983
|
+
console.log("[rcs] Repaired managed config.toml compatibility issue.");
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
catch {
|
|
987
|
+
// Non-fatal: repair failure must not block launch
|
|
988
|
+
}
|
|
989
|
+
const preparedCodexHome = await prepareCodexHomeForLaunch(launchCwd, sessionId, process.env);
|
|
990
|
+
const codexHomeOverride = preparedCodexHome.codexHomeOverride;
|
|
991
|
+
const projectLocalCodexHomeForCleanup = preparedCodexHome.projectLocalCodexHomeForCleanup;
|
|
992
|
+
// ── Phase 1: preLaunch ──────────────────────────────────────────────────
|
|
993
|
+
try {
|
|
994
|
+
await preLaunch(cwd, sessionId, notifyTempResult.contract, codexHomeOverride, enableNotifyFallbackAuthority, worktreeDirty);
|
|
995
|
+
}
|
|
996
|
+
catch (err) {
|
|
997
|
+
// preLaunch errors must NOT prevent Codex from starting
|
|
998
|
+
console.error(`[rcs] preLaunch warning: ${err instanceof Error ? err.message : err}`);
|
|
999
|
+
}
|
|
1000
|
+
// ── Phase 2: run ────────────────────────────────────────────────────────
|
|
1001
|
+
let postLaunchHandledExternally = false;
|
|
1002
|
+
try {
|
|
1003
|
+
const notifyTempContractRaw = notifyTempResult.contract.active
|
|
1004
|
+
? serializeNotifyTempContract(notifyTempResult.contract)
|
|
1005
|
+
: null;
|
|
1006
|
+
const launchResult = runCodex(cwd, normalizedArgs, sessionId, workerSparkModel, codexHomeOverride, notifyTempContractRaw, effectiveExplicitLaunchPolicy, projectLocalCodexHomeForCleanup, preparedCodexHome.runtimeCodexHomeForCleanup);
|
|
1007
|
+
postLaunchHandledExternally = launchResult.postLaunchHandledExternally;
|
|
1008
|
+
}
|
|
1009
|
+
finally {
|
|
1010
|
+
// ── Phase 3: postLaunch ─────────────────────────────────────────────
|
|
1011
|
+
if (!postLaunchHandledExternally) {
|
|
1012
|
+
await postLaunch(cwd, sessionId, codexHomeOverride, enableNotifyFallbackAuthority, projectLocalCodexHomeForCleanup);
|
|
1013
|
+
await cleanupRuntimeCodexHome(preparedCodexHome.runtimeCodexHomeForCleanup).catch(logCliOperationFailure);
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
export async function execWithOverlay(args) {
|
|
1018
|
+
const launchCwd = process.cwd();
|
|
1019
|
+
const parsedWorktree = parseWorktreeMode(args);
|
|
1020
|
+
const notifyTempResult = resolveNotifyTempContract(parsedWorktree.remainingArgs, process.env);
|
|
1021
|
+
const normalizedArgs = normalizeCodexLaunchArgs(notifyTempResult.passthroughArgs);
|
|
1022
|
+
let cwd = launchCwd;
|
|
1023
|
+
let worktreeDirty = false;
|
|
1024
|
+
if (parsedWorktree.mode.enabled) {
|
|
1025
|
+
const planned = planWorktreeTarget({
|
|
1026
|
+
cwd: launchCwd,
|
|
1027
|
+
scope: "launch",
|
|
1028
|
+
mode: parsedWorktree.mode,
|
|
1029
|
+
});
|
|
1030
|
+
const ensured = ensureWorktree(planned, { allowDirtyReuse: true });
|
|
1031
|
+
if (ensured.enabled) {
|
|
1032
|
+
cwd = ensured.worktreePath;
|
|
1033
|
+
if (ensured.dirty) {
|
|
1034
|
+
worktreeDirty = true;
|
|
1035
|
+
process.stderr.write(`[rcs] Caution: worktree at ${cwd} has uncommitted changes.\n` +
|
|
1036
|
+
` The session will launch as-is. Resolve the dirty state with RCS after launch, then proceed with your task.\n`);
|
|
1037
|
+
}
|
|
1038
|
+
const depBootstrap = ensureReusableNodeModules(cwd);
|
|
1039
|
+
if (depBootstrap.strategy === "symlink") {
|
|
1040
|
+
console.log(`[rcs] Reusing node_modules from ${depBootstrap.sourceNodeModulesPath}`);
|
|
1041
|
+
}
|
|
1042
|
+
else if (depBootstrap.strategy === "missing" && depBootstrap.warning) {
|
|
1043
|
+
console.warn(`[rcs] ${depBootstrap.warning}`);
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
const sessionId = `rcs-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
1048
|
+
try {
|
|
1049
|
+
await maybeCheckAndPromptUpdate(cwd);
|
|
1050
|
+
}
|
|
1051
|
+
catch (err) {
|
|
1052
|
+
logCliOperationFailure(err);
|
|
1053
|
+
}
|
|
1054
|
+
try {
|
|
1055
|
+
await maybePromptGithubStar();
|
|
1056
|
+
}
|
|
1057
|
+
catch (err) {
|
|
1058
|
+
logCliOperationFailure(err);
|
|
1059
|
+
}
|
|
1060
|
+
try {
|
|
1061
|
+
const repaired = await repairConfigIfNeeded(resolveCodexConfigPathForLaunch(launchCwd, process.env), getPackageRoot());
|
|
1062
|
+
if (repaired) {
|
|
1063
|
+
console.log("[rcs] Repaired managed config.toml compatibility issue.");
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
catch {
|
|
1067
|
+
// Non-fatal
|
|
1068
|
+
}
|
|
1069
|
+
const preparedCodexHome = await prepareCodexHomeForLaunch(launchCwd, sessionId, process.env);
|
|
1070
|
+
const codexHomeOverride = preparedCodexHome.codexHomeOverride;
|
|
1071
|
+
const projectLocalCodexHomeForCleanup = preparedCodexHome.projectLocalCodexHomeForCleanup;
|
|
1072
|
+
try {
|
|
1073
|
+
await preLaunch(cwd, sessionId, notifyTempResult.contract, codexHomeOverride, true, worktreeDirty);
|
|
1074
|
+
}
|
|
1075
|
+
catch (err) {
|
|
1076
|
+
console.error(`[rcs] preLaunch warning: ${err instanceof Error ? err.message : err}`);
|
|
1077
|
+
}
|
|
1078
|
+
try {
|
|
1079
|
+
const notifyTempContractRaw = notifyTempResult.contract.active
|
|
1080
|
+
? serializeNotifyTempContract(notifyTempResult.contract)
|
|
1081
|
+
: null;
|
|
1082
|
+
const codexArgs = injectModelInstructionsBypassArgs(cwd, ["exec", ...normalizedArgs], process.env, sessionModelInstructionsPath(cwd, sessionId));
|
|
1083
|
+
const codexEnvBase = codexHomeOverride
|
|
1084
|
+
? { ...process.env, CODEX_HOME: codexHomeOverride }
|
|
1085
|
+
: process.env;
|
|
1086
|
+
const codexEnv = notifyTempContractRaw
|
|
1087
|
+
? {
|
|
1088
|
+
...codexEnvBase,
|
|
1089
|
+
[RCS_NOTIFY_TEMP_CONTRACT_ENV]: notifyTempContractRaw,
|
|
1090
|
+
}
|
|
1091
|
+
: codexEnvBase;
|
|
1092
|
+
runCodexBlocking(cwd, codexArgs, codexEnv);
|
|
1093
|
+
}
|
|
1094
|
+
finally {
|
|
1095
|
+
await postLaunch(cwd, sessionId, codexHomeOverride, true, projectLocalCodexHomeForCleanup);
|
|
1096
|
+
await cleanupRuntimeCodexHome(preparedCodexHome.runtimeCodexHomeForCleanup).catch(logCliOperationFailure);
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
export function normalizeCodexLaunchArgs(args) {
|
|
1100
|
+
const parsed = parseWorktreeMode(args);
|
|
1101
|
+
const launchPolicyParsed = splitLeaderLaunchPolicyArgs(parsed.remainingArgs);
|
|
1102
|
+
const normalized = [];
|
|
1103
|
+
let wantsBypass = false;
|
|
1104
|
+
let hasBypass = false;
|
|
1105
|
+
let reasoningMode = null;
|
|
1106
|
+
for (const arg of launchPolicyParsed.remainingArgs) {
|
|
1107
|
+
if (arg === MADMAX_FLAG) {
|
|
1108
|
+
wantsBypass = true;
|
|
1109
|
+
continue;
|
|
1110
|
+
}
|
|
1111
|
+
if (arg === CODEX_BYPASS_FLAG) {
|
|
1112
|
+
wantsBypass = true;
|
|
1113
|
+
if (!hasBypass) {
|
|
1114
|
+
normalized.push(arg);
|
|
1115
|
+
hasBypass = true;
|
|
1116
|
+
}
|
|
1117
|
+
continue;
|
|
1118
|
+
}
|
|
1119
|
+
if (arg === HIGH_REASONING_FLAG) {
|
|
1120
|
+
reasoningMode = "high";
|
|
1121
|
+
continue;
|
|
1122
|
+
}
|
|
1123
|
+
if (arg === XHIGH_REASONING_FLAG) {
|
|
1124
|
+
reasoningMode = "xhigh";
|
|
1125
|
+
continue;
|
|
1126
|
+
}
|
|
1127
|
+
if (arg === SPARK_FLAG) {
|
|
1128
|
+
// Spark model is injected into worker env only (not the leader). Consume flag.
|
|
1129
|
+
continue;
|
|
1130
|
+
}
|
|
1131
|
+
if (arg === MADMAX_SPARK_FLAG) {
|
|
1132
|
+
// Bypass applies to leader; spark model goes to workers only. Consume flag.
|
|
1133
|
+
wantsBypass = true;
|
|
1134
|
+
continue;
|
|
1135
|
+
}
|
|
1136
|
+
normalized.push(arg);
|
|
1137
|
+
}
|
|
1138
|
+
if (wantsBypass && !hasBypass) {
|
|
1139
|
+
normalized.push(CODEX_BYPASS_FLAG);
|
|
1140
|
+
}
|
|
1141
|
+
if (reasoningMode) {
|
|
1142
|
+
normalized.push(CONFIG_FLAG, `${REASONING_KEY}="${reasoningMode}"`);
|
|
1143
|
+
}
|
|
1144
|
+
return normalized;
|
|
1145
|
+
}
|
|
1146
|
+
/**
|
|
1147
|
+
* Returns the spark model string if --spark or --madmax-spark appears in the
|
|
1148
|
+
* raw (pre-normalize) args, or undefined if neither flag is present.
|
|
1149
|
+
* Used to route the spark model to team workers without affecting the leader.
|
|
1150
|
+
*/
|
|
1151
|
+
export function resolveWorkerSparkModel(args, codexHomeOverride) {
|
|
1152
|
+
for (const arg of args) {
|
|
1153
|
+
if (arg === SPARK_FLAG || arg === MADMAX_SPARK_FLAG) {
|
|
1154
|
+
return resolveTeamLowComplexityDefaultModel(codexHomeOverride);
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
return undefined;
|
|
1158
|
+
}
|
|
1159
|
+
function isModelInstructionsOverride(value) {
|
|
1160
|
+
return new RegExp(`^${MODEL_INSTRUCTIONS_FILE_KEY}\\s*=`).test(value.trim());
|
|
1161
|
+
}
|
|
1162
|
+
function hasModelInstructionsOverride(args) {
|
|
1163
|
+
for (let i = 0; i < args.length; i++) {
|
|
1164
|
+
const arg = args[i];
|
|
1165
|
+
if (arg === CONFIG_FLAG || arg === LONG_CONFIG_FLAG) {
|
|
1166
|
+
const maybeValue = args[i + 1];
|
|
1167
|
+
if (typeof maybeValue === "string" &&
|
|
1168
|
+
isModelInstructionsOverride(maybeValue)) {
|
|
1169
|
+
return true;
|
|
1170
|
+
}
|
|
1171
|
+
continue;
|
|
1172
|
+
}
|
|
1173
|
+
if (arg.startsWith(`${LONG_CONFIG_FLAG}=`)) {
|
|
1174
|
+
const inlineValue = arg.slice(`${LONG_CONFIG_FLAG}=`.length);
|
|
1175
|
+
if (isModelInstructionsOverride(inlineValue))
|
|
1176
|
+
return true;
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
return false;
|
|
1180
|
+
}
|
|
1181
|
+
function shouldBypassDefaultSystemPrompt(env) {
|
|
1182
|
+
return env[RCS_BYPASS_DEFAULT_SYSTEM_PROMPT_ENV] !== "0";
|
|
1183
|
+
}
|
|
1184
|
+
function buildModelInstructionsOverride(cwd, env, defaultFilePath) {
|
|
1185
|
+
const filePath = env[RCS_MODEL_INSTRUCTIONS_FILE_ENV] ||
|
|
1186
|
+
defaultFilePath ||
|
|
1187
|
+
join(cwd, "AGENTS.md");
|
|
1188
|
+
return `${MODEL_INSTRUCTIONS_FILE_KEY}="${escapeTomlString(filePath)}"`;
|
|
1189
|
+
}
|
|
1190
|
+
function tryReadGitValue(cwd, args) {
|
|
1191
|
+
try {
|
|
1192
|
+
const value = execFileSync("git", args, {
|
|
1193
|
+
cwd,
|
|
1194
|
+
encoding: "utf-8",
|
|
1195
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
1196
|
+
timeout: 2000,
|
|
1197
|
+
}).trim();
|
|
1198
|
+
return value || undefined;
|
|
1199
|
+
}
|
|
1200
|
+
catch {
|
|
1201
|
+
return undefined;
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
function extractIssueNumber(text) {
|
|
1205
|
+
const explicit = text.match(/\bissue\s*#(\d+)\b/i);
|
|
1206
|
+
if (explicit)
|
|
1207
|
+
return Number.parseInt(explicit[1], 10);
|
|
1208
|
+
const generic = text.match(/(^|[^\w/])#(\d+)\b/);
|
|
1209
|
+
return generic ? Number.parseInt(generic[2], 10) : undefined;
|
|
1210
|
+
}
|
|
1211
|
+
export function resolveNativeSessionName(cwd, sessionId, env = process.env) {
|
|
1212
|
+
if (env.TMUX) {
|
|
1213
|
+
try {
|
|
1214
|
+
const tmuxPaneTarget = env.TMUX_PANE?.trim();
|
|
1215
|
+
const displayArgs = tmuxPaneTarget
|
|
1216
|
+
? ["display-message", "-p", "-t", tmuxPaneTarget, "#S"]
|
|
1217
|
+
: ["display-message", "-p", "#S"];
|
|
1218
|
+
const tmuxSession = execTmuxFileSync(displayArgs, {
|
|
1219
|
+
encoding: "utf-8",
|
|
1220
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
1221
|
+
timeout: 2000,
|
|
1222
|
+
}).trim();
|
|
1223
|
+
if (tmuxSession)
|
|
1224
|
+
return tmuxSession;
|
|
1225
|
+
}
|
|
1226
|
+
catch {
|
|
1227
|
+
// best effort only
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
return buildTmuxSessionName(cwd, sessionId);
|
|
1231
|
+
}
|
|
1232
|
+
function tagTmuxSessionWithInstance(sessionName, sessionId) {
|
|
1233
|
+
const target = sessionName.trim();
|
|
1234
|
+
const instanceId = sessionId.trim();
|
|
1235
|
+
if (!target || !instanceId)
|
|
1236
|
+
return;
|
|
1237
|
+
execFileSync("tmux", ["set-option", "-t", target, RCS_INSTANCE_OPTION, instanceId], {
|
|
1238
|
+
stdio: ["ignore", "ignore", "ignore"],
|
|
1239
|
+
timeout: 2000,
|
|
1240
|
+
});
|
|
1241
|
+
}
|
|
1242
|
+
function tagCurrentTmuxSessionWithInstance(sessionId) {
|
|
1243
|
+
if (!process.env.TMUX)
|
|
1244
|
+
return;
|
|
1245
|
+
try {
|
|
1246
|
+
const tmuxPaneTarget = process.env.TMUX_PANE;
|
|
1247
|
+
const displayArgs = tmuxPaneTarget
|
|
1248
|
+
? ["display-message", "-p", "-t", tmuxPaneTarget, "#S"]
|
|
1249
|
+
: ["display-message", "-p", "#S"];
|
|
1250
|
+
const sessionName = execFileSync("tmux", displayArgs, {
|
|
1251
|
+
encoding: "utf-8",
|
|
1252
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
1253
|
+
timeout: 2000,
|
|
1254
|
+
}).trim();
|
|
1255
|
+
if (sessionName)
|
|
1256
|
+
tagTmuxSessionWithInstance(sessionName, sessionId);
|
|
1257
|
+
}
|
|
1258
|
+
catch {
|
|
1259
|
+
// Best effort only: launch should not fail just because tmux tagging failed.
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
function buildNativeHookBaseContext(cwd, sessionId, normalizedEvent, extra = {}) {
|
|
1263
|
+
const repoPath = tryReadGitValue(cwd, ["rev-parse", "--show-toplevel"]) || cwd;
|
|
1264
|
+
const branch = tryReadGitValue(cwd, ["rev-parse", "--abbrev-ref", "HEAD"]);
|
|
1265
|
+
const issueNumber = extractIssueNumber([branch, basename(cwd)].filter(Boolean).join(" "));
|
|
1266
|
+
return {
|
|
1267
|
+
normalized_event: normalizedEvent,
|
|
1268
|
+
session_name: resolveNativeSessionName(cwd, sessionId),
|
|
1269
|
+
repo_path: repoPath,
|
|
1270
|
+
repo_name: basename(repoPath),
|
|
1271
|
+
worktree_path: cwd,
|
|
1272
|
+
...(branch ? { branch } : {}),
|
|
1273
|
+
...(issueNumber !== undefined ? { issue_number: issueNumber } : {}),
|
|
1274
|
+
...extra,
|
|
1275
|
+
};
|
|
1276
|
+
}
|
|
1277
|
+
export function injectModelInstructionsBypassArgs(cwd, args, env = process.env, defaultFilePath) {
|
|
1278
|
+
if (!shouldBypassDefaultSystemPrompt(env))
|
|
1279
|
+
return [...args];
|
|
1280
|
+
if (hasModelInstructionsOverride(args))
|
|
1281
|
+
return [...args];
|
|
1282
|
+
return [
|
|
1283
|
+
...args,
|
|
1284
|
+
CONFIG_FLAG,
|
|
1285
|
+
buildModelInstructionsOverride(cwd, env, defaultFilePath),
|
|
1286
|
+
];
|
|
1287
|
+
}
|
|
1288
|
+
export function collectInheritableTeamWorkerArgs(codexArgs) {
|
|
1289
|
+
return collectInheritableTeamWorkerArgsShared(codexArgs);
|
|
1290
|
+
}
|
|
1291
|
+
export function resolveTeamWorkerLaunchArgsEnv(existingRaw, codexArgs, inheritLeaderFlags = true, defaultModel) {
|
|
1292
|
+
const inheritedArgs = inheritLeaderFlags
|
|
1293
|
+
? collectInheritableTeamWorkerArgs(codexArgs)
|
|
1294
|
+
: [];
|
|
1295
|
+
const normalized = resolveTeamWorkerLaunchArgs({
|
|
1296
|
+
existingRaw,
|
|
1297
|
+
inheritedArgs,
|
|
1298
|
+
fallbackModel: defaultModel,
|
|
1299
|
+
});
|
|
1300
|
+
if (normalized.length === 0)
|
|
1301
|
+
return null;
|
|
1302
|
+
return normalized.join(" ");
|
|
1303
|
+
}
|
|
1304
|
+
export function readTopLevelTomlString(content, key) {
|
|
1305
|
+
let inTopLevel = true;
|
|
1306
|
+
const lines = content.split(/\r?\n/);
|
|
1307
|
+
for (const line of lines) {
|
|
1308
|
+
const trimmed = line.trim();
|
|
1309
|
+
if (!trimmed || trimmed.startsWith("#"))
|
|
1310
|
+
continue;
|
|
1311
|
+
if (/^\[[^[\]]+\]\s*(#.*)?$/.test(trimmed)) {
|
|
1312
|
+
inTopLevel = false;
|
|
1313
|
+
continue;
|
|
1314
|
+
}
|
|
1315
|
+
if (!inTopLevel)
|
|
1316
|
+
continue;
|
|
1317
|
+
const match = line.match(/^\s*([A-Za-z0-9_.-]+)\s*=\s*(.*?)\s*(?:#.*)?$/);
|
|
1318
|
+
if (!match || match[1] !== key)
|
|
1319
|
+
continue;
|
|
1320
|
+
return parseTomlStringValue(match[2]);
|
|
1321
|
+
}
|
|
1322
|
+
return null;
|
|
1323
|
+
}
|
|
1324
|
+
export function upsertTopLevelTomlString(content, key, value) {
|
|
1325
|
+
const eol = content.includes("\r\n") ? "\r\n" : "\n";
|
|
1326
|
+
const assignment = `${key} = "${escapeTomlString(value)}"`;
|
|
1327
|
+
if (!content.trim()) {
|
|
1328
|
+
return assignment + eol;
|
|
1329
|
+
}
|
|
1330
|
+
const lines = content.split(/\r?\n/);
|
|
1331
|
+
let replaced = false;
|
|
1332
|
+
let inTopLevel = true;
|
|
1333
|
+
for (let i = 0; i < lines.length; i++) {
|
|
1334
|
+
const line = lines[i];
|
|
1335
|
+
const trimmed = line.trim();
|
|
1336
|
+
if (!trimmed || trimmed.startsWith("#"))
|
|
1337
|
+
continue;
|
|
1338
|
+
if (/^\[[^[\]]+\]\s*(#.*)?$/.test(trimmed)) {
|
|
1339
|
+
inTopLevel = false;
|
|
1340
|
+
continue;
|
|
1341
|
+
}
|
|
1342
|
+
if (!inTopLevel)
|
|
1343
|
+
continue;
|
|
1344
|
+
const match = line.match(/^\s*([A-Za-z0-9_.-]+)\s*=/);
|
|
1345
|
+
if (match && match[1] === key) {
|
|
1346
|
+
lines[i] = assignment;
|
|
1347
|
+
replaced = true;
|
|
1348
|
+
break;
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1351
|
+
if (!replaced) {
|
|
1352
|
+
const firstTableIndex = lines.findIndex((line) => /^\s*\[[^[\]]+\]\s*(#.*)?$/.test(line.trim()));
|
|
1353
|
+
if (firstTableIndex >= 0) {
|
|
1354
|
+
lines.splice(firstTableIndex, 0, assignment);
|
|
1355
|
+
}
|
|
1356
|
+
else {
|
|
1357
|
+
lines.push(assignment);
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
let out = lines.join(eol);
|
|
1361
|
+
if (!out.endsWith(eol))
|
|
1362
|
+
out += eol;
|
|
1363
|
+
return out;
|
|
1364
|
+
}
|
|
1365
|
+
function parseTomlStringValue(value) {
|
|
1366
|
+
const trimmed = value.trim();
|
|
1367
|
+
if (trimmed.startsWith('"') && trimmed.endsWith('"') && trimmed.length >= 2) {
|
|
1368
|
+
return trimmed.slice(1, -1);
|
|
1369
|
+
}
|
|
1370
|
+
if (trimmed.startsWith("'") && trimmed.endsWith("'") && trimmed.length >= 2) {
|
|
1371
|
+
return trimmed.slice(1, -1);
|
|
1372
|
+
}
|
|
1373
|
+
return trimmed;
|
|
1374
|
+
}
|
|
1375
|
+
function escapeTomlString(value) {
|
|
1376
|
+
return value.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
1377
|
+
}
|
|
1378
|
+
function sanitizeTmuxToken(value) {
|
|
1379
|
+
const cleaned = value
|
|
1380
|
+
.toLowerCase()
|
|
1381
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
1382
|
+
.replace(/^-+|-+$/g, "");
|
|
1383
|
+
return cleaned || "unknown";
|
|
1384
|
+
}
|
|
1385
|
+
export function buildTmuxSessionName(cwd, sessionId) {
|
|
1386
|
+
const parentPath = dirname(cwd);
|
|
1387
|
+
const parentDir = basename(parentPath);
|
|
1388
|
+
const dirName = basename(cwd);
|
|
1389
|
+
const grandparentPath = dirname(parentPath);
|
|
1390
|
+
const grandparentDir = basename(grandparentPath);
|
|
1391
|
+
const repoDir = parentDir.endsWith(".rcs-worktrees")
|
|
1392
|
+
? parentDir.slice(0, -".rcs-worktrees".length)
|
|
1393
|
+
: parentDir === "worktrees" && grandparentDir === ".rcs"
|
|
1394
|
+
? basename(dirname(grandparentPath))
|
|
1395
|
+
: null;
|
|
1396
|
+
const dirToken = repoDir
|
|
1397
|
+
? sanitizeTmuxToken(`${repoDir}-${dirName}`)
|
|
1398
|
+
: sanitizeTmuxToken(dirName);
|
|
1399
|
+
let branchToken = "detached";
|
|
1400
|
+
const branch = tryReadGitValue(cwd, ["rev-parse", "--abbrev-ref", "HEAD"]);
|
|
1401
|
+
if (branch)
|
|
1402
|
+
branchToken = sanitizeTmuxToken(branch);
|
|
1403
|
+
const sessionToken = sanitizeTmuxToken(sessionId.replace(/^rcs-/, ""));
|
|
1404
|
+
const prefix = `rcs-${dirToken}-${branchToken}`;
|
|
1405
|
+
const name = `${prefix}-${sessionToken}`;
|
|
1406
|
+
if (name.length <= 120)
|
|
1407
|
+
return name;
|
|
1408
|
+
const prefixBudget = Math.max(4, 120 - sessionToken.length - 1);
|
|
1409
|
+
const trimmedPrefix = prefix.slice(0, prefixBudget).replace(/-+$/g, "");
|
|
1410
|
+
return `${trimmedPrefix}-${sessionToken}`.slice(0, 120);
|
|
1411
|
+
}
|
|
1412
|
+
export function buildDetachedTmuxSessionName(cwd, sessionId) {
|
|
1413
|
+
return buildTmuxSessionName(cwd, sessionId);
|
|
1414
|
+
}
|
|
1415
|
+
function parseWindowIndexFromTmuxOutput(rawOutput) {
|
|
1416
|
+
const windowIndex = rawOutput.split("\n")[0]?.trim() || "";
|
|
1417
|
+
return /^[0-9]+$/.test(windowIndex) ? windowIndex : null;
|
|
1418
|
+
}
|
|
1419
|
+
export function detectDetachedSessionWindowIndex(sessionName) {
|
|
1420
|
+
try {
|
|
1421
|
+
const output = execTmuxFileSync(["display-message", "-p", "-t", sessionName, "#{window_index}"], { encoding: "utf-8" });
|
|
1422
|
+
return parseWindowIndexFromTmuxOutput(output);
|
|
1423
|
+
}
|
|
1424
|
+
catch (err) {
|
|
1425
|
+
logCliOperationFailure(err);
|
|
1426
|
+
return null;
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
function escapeShellDoubleQuotedValue(value) {
|
|
1430
|
+
return value.replace(/["\\$`]/g, "\\$&");
|
|
1431
|
+
}
|
|
1432
|
+
function sanitizeTmuxLeaseKey(value) {
|
|
1433
|
+
const cleaned = value
|
|
1434
|
+
.toLowerCase()
|
|
1435
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
1436
|
+
.replace(/^-+|-+$/g, "");
|
|
1437
|
+
return cleaned || "default";
|
|
1438
|
+
}
|
|
1439
|
+
function blockMs(ms) {
|
|
1440
|
+
const delay = Math.max(1, Math.floor(ms));
|
|
1441
|
+
const shared = new SharedArrayBuffer(4);
|
|
1442
|
+
const view = new Int32Array(shared);
|
|
1443
|
+
Atomics.wait(view, 0, 0, delay);
|
|
1444
|
+
}
|
|
1445
|
+
function tmuxExtendedKeysLeaseRoot(cwd) {
|
|
1446
|
+
return join(cwd, ".rcs", "state", TMUX_EXTENDED_KEYS_LEASE_DIR);
|
|
1447
|
+
}
|
|
1448
|
+
function resolveTmuxSocketPath(execFileSyncImpl = (file, tmuxArgs) => execFileSync(file, tmuxArgs, {
|
|
1449
|
+
encoding: "utf-8",
|
|
1450
|
+
})) {
|
|
1451
|
+
return (execTmuxSync(["display-message", "-p", "#{socket_path}"], execFileSyncImpl) ||
|
|
1452
|
+
"default");
|
|
1453
|
+
}
|
|
1454
|
+
function tmuxExtendedKeysLeasePath(cwd, socketPath) {
|
|
1455
|
+
return join(tmuxExtendedKeysLeaseRoot(cwd), `${sanitizeTmuxLeaseKey(socketPath)}.json`);
|
|
1456
|
+
}
|
|
1457
|
+
function isTmuxExtendedKeysLeaseHolderRecord(holder) {
|
|
1458
|
+
if (!holder || typeof holder !== "object")
|
|
1459
|
+
return false;
|
|
1460
|
+
const record = holder;
|
|
1461
|
+
if (typeof record.id !== "string" || !record.id.trim())
|
|
1462
|
+
return false;
|
|
1463
|
+
if (!Number.isSafeInteger(record.pid) || Number(record.pid) <= 0)
|
|
1464
|
+
return false;
|
|
1465
|
+
if (record.platform !== undefined && typeof record.platform !== "string")
|
|
1466
|
+
return false;
|
|
1467
|
+
if (record.linuxStartTicks !== undefined &&
|
|
1468
|
+
!Number.isSafeInteger(record.linuxStartTicks))
|
|
1469
|
+
return false;
|
|
1470
|
+
return true;
|
|
1471
|
+
}
|
|
1472
|
+
function isTmuxExtendedKeysLeaseHolder(holder) {
|
|
1473
|
+
return typeof holder === "string" || isTmuxExtendedKeysLeaseHolderRecord(holder);
|
|
1474
|
+
}
|
|
1475
|
+
function readTmuxExtendedKeysLeaseState(leasePath) {
|
|
1476
|
+
if (!existsSync(leasePath))
|
|
1477
|
+
return null;
|
|
1478
|
+
try {
|
|
1479
|
+
const parsed = JSON.parse(readFileSync(leasePath, "utf-8"));
|
|
1480
|
+
if (typeof parsed.originalMode !== "string" ||
|
|
1481
|
+
!Array.isArray(parsed.holders) ||
|
|
1482
|
+
!parsed.holders.every(isTmuxExtendedKeysLeaseHolder)) {
|
|
1483
|
+
return null;
|
|
1484
|
+
}
|
|
1485
|
+
return {
|
|
1486
|
+
originalMode: parsed.originalMode,
|
|
1487
|
+
holders: [...parsed.holders],
|
|
1488
|
+
};
|
|
1489
|
+
}
|
|
1490
|
+
catch {
|
|
1491
|
+
return null;
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
function writeTmuxExtendedKeysLeaseState(leasePath, state) {
|
|
1495
|
+
mkdirSync(dirname(leasePath), { recursive: true });
|
|
1496
|
+
writeFileSync(leasePath, JSON.stringify(state, null, 2));
|
|
1497
|
+
}
|
|
1498
|
+
function parseTmuxExtendedKeysLeaseHolderPid(holder) {
|
|
1499
|
+
const match = /^([1-9]\d*)-/.exec(holder);
|
|
1500
|
+
if (!match)
|
|
1501
|
+
return null;
|
|
1502
|
+
const pid = Number.parseInt(match[1], 10);
|
|
1503
|
+
return Number.isSafeInteger(pid) && pid > 0 ? pid : null;
|
|
1504
|
+
}
|
|
1505
|
+
function getTmuxExtendedKeysLeaseHolderId(holder) {
|
|
1506
|
+
return typeof holder === "string" ? holder : holder.id;
|
|
1507
|
+
}
|
|
1508
|
+
function getTmuxExtendedKeysLeaseHolderPid(holder) {
|
|
1509
|
+
if (typeof holder === "string")
|
|
1510
|
+
return parseTmuxExtendedKeysLeaseHolderPid(holder);
|
|
1511
|
+
return Number.isSafeInteger(holder.pid) && holder.pid > 0 ? holder.pid : null;
|
|
1512
|
+
}
|
|
1513
|
+
function parseLinuxProcStartTicks(statContent) {
|
|
1514
|
+
const commandEnd = statContent.lastIndexOf(")");
|
|
1515
|
+
if (commandEnd === -1)
|
|
1516
|
+
return null;
|
|
1517
|
+
const remainder = statContent.slice(commandEnd + 1).trim();
|
|
1518
|
+
const fields = remainder.split(/\s+/);
|
|
1519
|
+
if (fields.length <= 19)
|
|
1520
|
+
return null;
|
|
1521
|
+
const startTicks = Number(fields[19]);
|
|
1522
|
+
return Number.isSafeInteger(startTicks) ? startTicks : null;
|
|
1523
|
+
}
|
|
1524
|
+
function readLinuxProcessStartTicks(pid) {
|
|
1525
|
+
try {
|
|
1526
|
+
return parseLinuxProcStartTicks(readFileSync(`/proc/${pid}/stat`, "utf-8"));
|
|
1527
|
+
}
|
|
1528
|
+
catch {
|
|
1529
|
+
return null;
|
|
1530
|
+
}
|
|
1531
|
+
}
|
|
1532
|
+
function createTmuxExtendedKeysLeaseHolder(id, pid) {
|
|
1533
|
+
const linuxStartTicks = process.platform === "linux"
|
|
1534
|
+
? readLinuxProcessStartTicks(pid) ?? undefined
|
|
1535
|
+
: undefined;
|
|
1536
|
+
return {
|
|
1537
|
+
id,
|
|
1538
|
+
pid,
|
|
1539
|
+
platform: process.platform,
|
|
1540
|
+
...(linuxStartTicks !== undefined ? { linuxStartTicks } : {}),
|
|
1541
|
+
};
|
|
1542
|
+
}
|
|
1543
|
+
function isProcessAlive(pid) {
|
|
1544
|
+
try {
|
|
1545
|
+
process.kill(pid, 0);
|
|
1546
|
+
return true;
|
|
1547
|
+
}
|
|
1548
|
+
catch (err) {
|
|
1549
|
+
const code = err && typeof err === "object" && "code" in err
|
|
1550
|
+
? String(err.code)
|
|
1551
|
+
: "";
|
|
1552
|
+
return code === "EPERM";
|
|
1553
|
+
}
|
|
1554
|
+
}
|
|
1555
|
+
function isTmuxExtendedKeysLeaseHolderAlive(holder) {
|
|
1556
|
+
const pid = getTmuxExtendedKeysLeaseHolderPid(holder);
|
|
1557
|
+
if (pid === null || !isProcessAlive(pid))
|
|
1558
|
+
return false;
|
|
1559
|
+
if (typeof holder === "string")
|
|
1560
|
+
return true;
|
|
1561
|
+
if (holder.platform !== "linux" || process.platform !== "linux")
|
|
1562
|
+
return true;
|
|
1563
|
+
if (holder.linuxStartTicks === undefined)
|
|
1564
|
+
return true;
|
|
1565
|
+
return readLinuxProcessStartTicks(pid) === holder.linuxStartTicks;
|
|
1566
|
+
}
|
|
1567
|
+
function reapDeadTmuxExtendedKeysLeaseHolders(state) {
|
|
1568
|
+
return {
|
|
1569
|
+
originalMode: state.originalMode,
|
|
1570
|
+
holders: state.holders.filter(isTmuxExtendedKeysLeaseHolderAlive),
|
|
1571
|
+
};
|
|
1572
|
+
}
|
|
1573
|
+
function withTmuxExtendedKeysLeaseLock(cwd, socketPath, run) {
|
|
1574
|
+
const leaseRoot = tmuxExtendedKeysLeaseRoot(cwd);
|
|
1575
|
+
mkdirSync(leaseRoot, { recursive: true });
|
|
1576
|
+
const lockPath = join(leaseRoot, `${sanitizeTmuxLeaseKey(socketPath)}.lock`);
|
|
1577
|
+
for (let attempt = 0; attempt < TMUX_EXTENDED_KEYS_LOCK_MAX_ATTEMPTS; attempt++) {
|
|
1578
|
+
try {
|
|
1579
|
+
mkdirSync(lockPath);
|
|
1580
|
+
try {
|
|
1581
|
+
writeFileSync(join(lockPath, "pid"), String(process.pid));
|
|
1582
|
+
return run();
|
|
1583
|
+
}
|
|
1584
|
+
finally {
|
|
1585
|
+
rmSync(lockPath, { recursive: true, force: true });
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1588
|
+
catch (err) {
|
|
1589
|
+
const code = err && typeof err === "object" && "code" in err
|
|
1590
|
+
? String(err.code)
|
|
1591
|
+
: "";
|
|
1592
|
+
if (code !== "EEXIST")
|
|
1593
|
+
throw err;
|
|
1594
|
+
const lockStat = statSync(lockPath, { throwIfNoEntry: false });
|
|
1595
|
+
if (lockStat && Date.now() - lockStat.mtimeMs > TMUX_EXTENDED_KEYS_LOCK_STALE_MS) {
|
|
1596
|
+
let holderAlive = false;
|
|
1597
|
+
try {
|
|
1598
|
+
const holderPid = Number.parseInt(readFileSync(join(lockPath, "pid"), "utf-8").trim(), 10);
|
|
1599
|
+
if (Number.isFinite(holderPid) && holderPid > 0) {
|
|
1600
|
+
process.kill(holderPid, 0);
|
|
1601
|
+
holderAlive = true;
|
|
1602
|
+
}
|
|
1603
|
+
}
|
|
1604
|
+
catch {
|
|
1605
|
+
// PID file missing/unreadable or process dead (ESRCH) — treat as stale
|
|
1606
|
+
}
|
|
1607
|
+
if (!holderAlive) {
|
|
1608
|
+
rmSync(lockPath, { recursive: true, force: true });
|
|
1609
|
+
continue;
|
|
1610
|
+
}
|
|
1611
|
+
}
|
|
1612
|
+
blockMs(TMUX_EXTENDED_KEYS_LOCK_RETRY_MS);
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1615
|
+
throw new Error(`timed out waiting for tmux extended-keys lease lock: ${lockPath}`);
|
|
1616
|
+
}
|
|
1617
|
+
function buildDetachedSessionLeaderCommand(cwd, sessionName, codexCmd, sessionId, codexHomeOverride, projectLocalCodexHomeForCleanup, runtimeCodexHomeForCleanup) {
|
|
1618
|
+
const detachedPostLaunchHelper = sessionId
|
|
1619
|
+
? `${buildDetachedSessionPostLaunchHelperCommand(cwd, sessionId, codexHomeOverride, projectLocalCodexHomeForCleanup, runtimeCodexHomeForCleanup)} >/dev/null 2>&1 || true;`
|
|
1620
|
+
: "";
|
|
1621
|
+
const wrapped = [
|
|
1622
|
+
buildTmuxExtendedKeysAcquireShellSnippet(cwd),
|
|
1623
|
+
'exec 3<&0;',
|
|
1624
|
+
'rcs_codex_pid="";',
|
|
1625
|
+
"rcs_detached_session_cleanup() {",
|
|
1626
|
+
"status=$?;",
|
|
1627
|
+
"trap - 0 INT TERM HUP;",
|
|
1628
|
+
'if [ -n "$rcs_codex_pid" ] && kill -0 "$rcs_codex_pid" 2>/dev/null; then',
|
|
1629
|
+
'kill -TERM "$rcs_codex_pid" 2>/dev/null || true;',
|
|
1630
|
+
'wait "$rcs_codex_pid" 2>/dev/null || true;',
|
|
1631
|
+
"fi;",
|
|
1632
|
+
'exec 3<&- 2>/dev/null || true;',
|
|
1633
|
+
buildTmuxExtendedKeysReleaseShellSnippet(cwd),
|
|
1634
|
+
detachedPostLaunchHelper,
|
|
1635
|
+
'if [ "$status" -lt 128 ]; then',
|
|
1636
|
+
`tmux kill-session -t "${escapeShellDoubleQuotedValue(sessionName)}" >/dev/null 2>&1 || true;`,
|
|
1637
|
+
"fi;",
|
|
1638
|
+
"exit $status;",
|
|
1639
|
+
"};",
|
|
1640
|
+
"trap rcs_detached_session_cleanup 0 INT TERM HUP;",
|
|
1641
|
+
`${codexCmd} <&3 &`,
|
|
1642
|
+
"rcs_codex_pid=$!;",
|
|
1643
|
+
'wait "$rcs_codex_pid";',
|
|
1644
|
+
].join(" ");
|
|
1645
|
+
return `/bin/sh -c ${quoteShellArg(wrapped)}`;
|
|
1646
|
+
}
|
|
1647
|
+
function buildDetachedSessionPostLaunchHelperCommand(cwd, sessionId, codexHomeOverride, projectLocalCodexHomeForCleanup, runtimeCodexHomeForCleanup) {
|
|
1648
|
+
const cwdLiteral = JSON.stringify(cwd);
|
|
1649
|
+
const sessionIdLiteral = JSON.stringify(sessionId);
|
|
1650
|
+
const codexHomeLiteral = typeof codexHomeOverride === "string" && codexHomeOverride.length > 0
|
|
1651
|
+
? JSON.stringify(codexHomeOverride)
|
|
1652
|
+
: "undefined";
|
|
1653
|
+
const projectLocalCleanupLiteral = typeof projectLocalCodexHomeForCleanup === "string" &&
|
|
1654
|
+
projectLocalCodexHomeForCleanup.length > 0
|
|
1655
|
+
? JSON.stringify(projectLocalCodexHomeForCleanup)
|
|
1656
|
+
: "undefined";
|
|
1657
|
+
const runtimeCodexHomeCleanupLiteral = typeof runtimeCodexHomeForCleanup === "string" &&
|
|
1658
|
+
runtimeCodexHomeForCleanup.length > 0
|
|
1659
|
+
? JSON.stringify(runtimeCodexHomeForCleanup)
|
|
1660
|
+
: "undefined";
|
|
1661
|
+
const moduleUrlLiteral = JSON.stringify(import.meta.url);
|
|
1662
|
+
const script = [
|
|
1663
|
+
`const mod = await import(${moduleUrlLiteral});`,
|
|
1664
|
+
`await mod.runDetachedSessionPostLaunch(${cwdLiteral}, ${sessionIdLiteral}, ${codexHomeLiteral}, ${projectLocalCleanupLiteral}, ${runtimeCodexHomeCleanupLiteral});`,
|
|
1665
|
+
].join(" ");
|
|
1666
|
+
return `${quoteShellArg(process.execPath)} --input-type=module -e ${quoteShellArg(script)}`;
|
|
1667
|
+
}
|
|
1668
|
+
function execTmuxSync(args, execFileSyncImpl = (file, tmuxArgs) => execFileSync(file, tmuxArgs, {
|
|
1669
|
+
encoding: "utf-8",
|
|
1670
|
+
...(process.platform === "win32" ? { windowsHide: true } : {}),
|
|
1671
|
+
})) {
|
|
1672
|
+
return execFileSyncImpl(resolveTmuxExecutableForLaunch(), [...args]).trim();
|
|
1673
|
+
}
|
|
1674
|
+
export function acquireTmuxExtendedKeysLease(cwd, execFileSyncImpl = (file, tmuxArgs) => execFileSync(file, tmuxArgs, {
|
|
1675
|
+
encoding: "utf-8",
|
|
1676
|
+
...(process.platform === "win32" ? { windowsHide: true } : {}),
|
|
1677
|
+
}), ownerPid = process.pid) {
|
|
1678
|
+
try {
|
|
1679
|
+
const socketPath = resolveTmuxSocketPath(execFileSyncImpl);
|
|
1680
|
+
const leasePath = tmuxExtendedKeysLeasePath(cwd, socketPath);
|
|
1681
|
+
const holderPid = Number.isSafeInteger(ownerPid) && ownerPid > 0 ? ownerPid : process.pid;
|
|
1682
|
+
const leaseId = `${holderPid}-${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
1683
|
+
withTmuxExtendedKeysLeaseLock(cwd, socketPath, () => {
|
|
1684
|
+
const stateRaw = readTmuxExtendedKeysLeaseState(leasePath);
|
|
1685
|
+
const state = stateRaw ? reapDeadTmuxExtendedKeysLeaseHolders(stateRaw) : null;
|
|
1686
|
+
if (stateRaw && state?.holders.length === 0) {
|
|
1687
|
+
execTmuxSync(["set-option", "-sq", "extended-keys", state.originalMode], execFileSyncImpl);
|
|
1688
|
+
rmSync(leasePath, { force: true });
|
|
1689
|
+
}
|
|
1690
|
+
if (!state || state.holders.length === 0) {
|
|
1691
|
+
const previousMode = execTmuxSync(["show-options", "-sv", "extended-keys"], execFileSyncImpl) ||
|
|
1692
|
+
TMUX_EXTENDED_KEYS_FALLBACK_MODE;
|
|
1693
|
+
execTmuxSync(["set-option", "-sq", "extended-keys", TMUX_EXTENDED_KEYS_MODE], execFileSyncImpl);
|
|
1694
|
+
writeTmuxExtendedKeysLeaseState(leasePath, {
|
|
1695
|
+
originalMode: previousMode,
|
|
1696
|
+
holders: [createTmuxExtendedKeysLeaseHolder(leaseId, holderPid)],
|
|
1697
|
+
});
|
|
1698
|
+
return;
|
|
1699
|
+
}
|
|
1700
|
+
state.holders.push(createTmuxExtendedKeysLeaseHolder(leaseId, holderPid));
|
|
1701
|
+
writeTmuxExtendedKeysLeaseState(leasePath, state);
|
|
1702
|
+
});
|
|
1703
|
+
return `${socketPath}\t${leaseId}`;
|
|
1704
|
+
}
|
|
1705
|
+
catch (err) {
|
|
1706
|
+
if (!isUnsupportedTmuxExtendedKeysFailure(err)) {
|
|
1707
|
+
logCliOperationFailure(err);
|
|
1708
|
+
}
|
|
1709
|
+
return null;
|
|
1710
|
+
}
|
|
1711
|
+
}
|
|
1712
|
+
export function releaseTmuxExtendedKeysLease(cwd, leaseHandle, execFileSyncImpl = (file, tmuxArgs) => execFileSync(file, tmuxArgs, {
|
|
1713
|
+
encoding: "utf-8",
|
|
1714
|
+
...(process.platform === "win32" ? { windowsHide: true } : {}),
|
|
1715
|
+
})) {
|
|
1716
|
+
if (!leaseHandle.trim())
|
|
1717
|
+
return;
|
|
1718
|
+
const [socketPathRaw = "", leaseId = ""] = leaseHandle.split("\t");
|
|
1719
|
+
const socketPath = socketPathRaw.trim() || "default";
|
|
1720
|
+
if (!leaseId)
|
|
1721
|
+
return;
|
|
1722
|
+
try {
|
|
1723
|
+
const leasePath = tmuxExtendedKeysLeasePath(cwd, socketPath);
|
|
1724
|
+
withTmuxExtendedKeysLeaseLock(cwd, socketPath, () => {
|
|
1725
|
+
const stateRaw = readTmuxExtendedKeysLeaseState(leasePath);
|
|
1726
|
+
const state = stateRaw ? reapDeadTmuxExtendedKeysLeaseHolders(stateRaw) : null;
|
|
1727
|
+
if (!state || state.holders.length === 0) {
|
|
1728
|
+
if (stateRaw) {
|
|
1729
|
+
execTmuxSync(["set-option", "-sq", "extended-keys", stateRaw.originalMode], execFileSyncImpl);
|
|
1730
|
+
}
|
|
1731
|
+
rmSync(leasePath, { force: true });
|
|
1732
|
+
return;
|
|
1733
|
+
}
|
|
1734
|
+
const holders = state.holders.filter((holder) => getTmuxExtendedKeysLeaseHolderId(holder) !== leaseId);
|
|
1735
|
+
if (holders.length > 0) {
|
|
1736
|
+
writeTmuxExtendedKeysLeaseState(leasePath, {
|
|
1737
|
+
originalMode: state.originalMode,
|
|
1738
|
+
holders,
|
|
1739
|
+
});
|
|
1740
|
+
return;
|
|
1741
|
+
}
|
|
1742
|
+
execTmuxSync(["set-option", "-sq", "extended-keys", state.originalMode], execFileSyncImpl);
|
|
1743
|
+
rmSync(leasePath, { force: true });
|
|
1744
|
+
});
|
|
1745
|
+
}
|
|
1746
|
+
catch (err) {
|
|
1747
|
+
if (!isUnsupportedTmuxExtendedKeysFailure(err)) {
|
|
1748
|
+
logCliOperationFailure(err);
|
|
1749
|
+
}
|
|
1750
|
+
}
|
|
1751
|
+
}
|
|
1752
|
+
function buildTmuxExtendedKeysHelperCommand(cwd, operation) {
|
|
1753
|
+
const cwdLiteral = JSON.stringify(cwd);
|
|
1754
|
+
const moduleUrlLiteral = JSON.stringify(import.meta.url);
|
|
1755
|
+
const script = operation === "acquire"
|
|
1756
|
+
? `const mod = await import(${moduleUrlLiteral}); const ownerPid = Number.parseInt(process.argv[1] ?? "", 10); const lease = mod.acquireTmuxExtendedKeysLease(${cwdLiteral}, undefined, Number.isSafeInteger(ownerPid) && ownerPid > 0 ? ownerPid : undefined); if (lease) process.stdout.write(lease);`
|
|
1757
|
+
: `const mod = await import(${moduleUrlLiteral}); mod.releaseTmuxExtendedKeysLease(${cwdLiteral}, process.argv[1] ?? "");`;
|
|
1758
|
+
return `${quoteShellArg(process.execPath)} --input-type=module -e ${quoteShellArg(script)}`;
|
|
1759
|
+
}
|
|
1760
|
+
function buildTmuxExtendedKeysAcquireShellSnippet(cwd) {
|
|
1761
|
+
return `RCS_TMUX_EXTENDED_KEYS_LEASE=$(${buildTmuxExtendedKeysHelperCommand(cwd, "acquire")} "$$" 2>/dev/null || true);`;
|
|
1762
|
+
}
|
|
1763
|
+
function buildTmuxExtendedKeysReleaseShellSnippet(cwd) {
|
|
1764
|
+
return `if [ -n "\${RCS_TMUX_EXTENDED_KEYS_LEASE:-}" ]; then ${buildTmuxExtendedKeysHelperCommand(cwd, "release")} "\${RCS_TMUX_EXTENDED_KEYS_LEASE}" >/dev/null 2>&1 || true; fi;`;
|
|
1765
|
+
}
|
|
1766
|
+
export function withTmuxExtendedKeys(cwd, run, execFileSyncImpl = (file, tmuxArgs) => execFileSync(file, tmuxArgs, {
|
|
1767
|
+
encoding: "utf-8",
|
|
1768
|
+
...(process.platform === "win32" ? { windowsHide: true } : {}),
|
|
1769
|
+
})) {
|
|
1770
|
+
const leaseHandle = acquireTmuxExtendedKeysLease(cwd, execFileSyncImpl);
|
|
1771
|
+
try {
|
|
1772
|
+
return run();
|
|
1773
|
+
}
|
|
1774
|
+
finally {
|
|
1775
|
+
if (leaseHandle)
|
|
1776
|
+
releaseTmuxExtendedKeysLease(cwd, leaseHandle, execFileSyncImpl);
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
export function buildDetachedSessionBootstrapSteps(sessionName, cwd, codexCmd, hudCmd, workerLaunchArgs, codexHomeOverride, notifyTempContractRaw, nativeWindows = false, sessionId, projectLocalCodexHomeForCleanup, runtimeCodexHomeForCleanup) {
|
|
1780
|
+
const detachedLeaderCmd = nativeWindows
|
|
1781
|
+
? "powershell.exe"
|
|
1782
|
+
: buildDetachedSessionLeaderCommand(cwd, sessionName, codexCmd, sessionId, codexHomeOverride, projectLocalCodexHomeForCleanup, runtimeCodexHomeForCleanup);
|
|
1783
|
+
const newSessionArgs = [
|
|
1784
|
+
"new-session",
|
|
1785
|
+
"-d",
|
|
1786
|
+
"-P",
|
|
1787
|
+
"-F",
|
|
1788
|
+
"#{pane_id}",
|
|
1789
|
+
"-s",
|
|
1790
|
+
sessionName,
|
|
1791
|
+
"-c",
|
|
1792
|
+
cwd,
|
|
1793
|
+
...(workerLaunchArgs
|
|
1794
|
+
? ["-e", `${TEAM_WORKER_LAUNCH_ARGS_ENV}=${workerLaunchArgs}`]
|
|
1795
|
+
: []),
|
|
1796
|
+
...(sessionId ? ["-e", `RCS_SESSION_ID=${sessionId}`] : []),
|
|
1797
|
+
...(codexHomeOverride ? ["-e", `CODEX_HOME=${codexHomeOverride}`] : []),
|
|
1798
|
+
...(notifyTempContractRaw
|
|
1799
|
+
? ["-e", `${RCS_NOTIFY_TEMP_CONTRACT_ENV}=${notifyTempContractRaw}`]
|
|
1800
|
+
: []),
|
|
1801
|
+
detachedLeaderCmd,
|
|
1802
|
+
];
|
|
1803
|
+
const splitCaptureArgs = [
|
|
1804
|
+
"split-window",
|
|
1805
|
+
"-v",
|
|
1806
|
+
"-l",
|
|
1807
|
+
String(HUD_TMUX_HEIGHT_LINES),
|
|
1808
|
+
"-d",
|
|
1809
|
+
"-t",
|
|
1810
|
+
sessionName,
|
|
1811
|
+
"-c",
|
|
1812
|
+
cwd,
|
|
1813
|
+
"-P",
|
|
1814
|
+
"-F",
|
|
1815
|
+
"#{pane_id}",
|
|
1816
|
+
hudCmd,
|
|
1817
|
+
];
|
|
1818
|
+
return [
|
|
1819
|
+
{ name: "new-session", args: newSessionArgs },
|
|
1820
|
+
...(sessionId
|
|
1821
|
+
? [
|
|
1822
|
+
{
|
|
1823
|
+
name: "tag-session",
|
|
1824
|
+
args: ["set-option", "-t", sessionName, RCS_INSTANCE_OPTION, sessionId],
|
|
1825
|
+
},
|
|
1826
|
+
]
|
|
1827
|
+
: []),
|
|
1828
|
+
{ name: "split-and-capture-hud-pane", args: splitCaptureArgs },
|
|
1829
|
+
];
|
|
1830
|
+
}
|
|
1831
|
+
async function readLaunchAppendInstructions() {
|
|
1832
|
+
const appendixCandidates = [
|
|
1833
|
+
process.env[RCS_RALPH_APPEND_INSTRUCTIONS_FILE_ENV]?.trim(),
|
|
1834
|
+
process.env[RCS_AUTORESEARCH_APPEND_INSTRUCTIONS_FILE_ENV]?.trim(),
|
|
1835
|
+
].filter((value) => typeof value === "string" && value.length > 0);
|
|
1836
|
+
if (appendixCandidates.length === 0)
|
|
1837
|
+
return "";
|
|
1838
|
+
const appendixPath = appendixCandidates[0];
|
|
1839
|
+
if (!existsSync(appendixPath)) {
|
|
1840
|
+
throw new Error(`launch instructions file not found: ${appendixPath}`);
|
|
1841
|
+
}
|
|
1842
|
+
const { readFile } = await import("fs/promises");
|
|
1843
|
+
return (await readFile(appendixPath, "utf-8")).trim();
|
|
1844
|
+
}
|
|
1845
|
+
export function buildDetachedSessionFinalizeSteps(sessionName, hudPaneId, hookWindowIndex, enableMouse, nativeWindows = false) {
|
|
1846
|
+
const steps = [];
|
|
1847
|
+
if (!nativeWindows && hudPaneId && hookWindowIndex) {
|
|
1848
|
+
const hookTarget = buildResizeHookTarget(sessionName, hookWindowIndex);
|
|
1849
|
+
const hookName = buildResizeHookName("launch", sessionName, hookWindowIndex, hudPaneId);
|
|
1850
|
+
const clientAttachedHookName = buildClientAttachedReconcileHookName("launch", sessionName, hookWindowIndex, hudPaneId);
|
|
1851
|
+
steps.push({
|
|
1852
|
+
name: "register-resize-hook",
|
|
1853
|
+
args: buildRegisterResizeHookArgs(hookTarget, hookName, hudPaneId, HUD_TMUX_HEIGHT_LINES),
|
|
1854
|
+
});
|
|
1855
|
+
steps.push({
|
|
1856
|
+
name: "register-client-attached-reconcile",
|
|
1857
|
+
args: buildRegisterClientAttachedReconcileArgs(hookTarget, clientAttachedHookName, hudPaneId, HUD_TMUX_HEIGHT_LINES),
|
|
1858
|
+
});
|
|
1859
|
+
steps.push({
|
|
1860
|
+
name: "schedule-delayed-resize",
|
|
1861
|
+
args: buildScheduleDelayedHudResizeArgs(hudPaneId, undefined, HUD_TMUX_HEIGHT_LINES),
|
|
1862
|
+
});
|
|
1863
|
+
steps.push({
|
|
1864
|
+
name: "reconcile-hud-resize",
|
|
1865
|
+
args: buildReconcileHudResizeArgs(hudPaneId, HUD_TMUX_HEIGHT_LINES),
|
|
1866
|
+
});
|
|
1867
|
+
}
|
|
1868
|
+
if (enableMouse) {
|
|
1869
|
+
steps.push({
|
|
1870
|
+
name: "set-mouse",
|
|
1871
|
+
args: ["set-option", "-t", sessionName, "mouse", "on"],
|
|
1872
|
+
});
|
|
1873
|
+
steps.push({
|
|
1874
|
+
name: "sanitize-copy-mode-style",
|
|
1875
|
+
args: [],
|
|
1876
|
+
});
|
|
1877
|
+
}
|
|
1878
|
+
steps.push({
|
|
1879
|
+
name: "attach-session",
|
|
1880
|
+
args: ["attach-session", "-t", sessionName],
|
|
1881
|
+
});
|
|
1882
|
+
return steps;
|
|
1883
|
+
}
|
|
1884
|
+
export function buildDetachedSessionRollbackSteps(sessionName, hookTarget, hookName, clientAttachedHookName) {
|
|
1885
|
+
const steps = [];
|
|
1886
|
+
if (hookTarget && clientAttachedHookName) {
|
|
1887
|
+
steps.push({
|
|
1888
|
+
name: "unregister-client-attached-reconcile",
|
|
1889
|
+
args: buildUnregisterClientAttachedReconcileArgs(hookTarget, clientAttachedHookName),
|
|
1890
|
+
});
|
|
1891
|
+
}
|
|
1892
|
+
if (hookTarget && hookName) {
|
|
1893
|
+
steps.push({
|
|
1894
|
+
name: "unregister-resize-hook",
|
|
1895
|
+
args: buildUnregisterResizeHookArgs(hookTarget, hookName),
|
|
1896
|
+
});
|
|
1897
|
+
}
|
|
1898
|
+
steps.push({
|
|
1899
|
+
name: "kill-session",
|
|
1900
|
+
args: ["kill-session", "-t", sessionName],
|
|
1901
|
+
});
|
|
1902
|
+
return steps;
|
|
1903
|
+
}
|
|
1904
|
+
export function buildNotifyTempStartupMessages(contract, hasValidProviders) {
|
|
1905
|
+
const providers = contract.canonicalSelectors.length > 0
|
|
1906
|
+
? contract.canonicalSelectors.join(",")
|
|
1907
|
+
: "none";
|
|
1908
|
+
const infoLines = [
|
|
1909
|
+
`notify temp: active | providers=${providers} | persistent-routing=bypassed`,
|
|
1910
|
+
];
|
|
1911
|
+
const warningLines = [...contract.warnings];
|
|
1912
|
+
if (!hasValidProviders) {
|
|
1913
|
+
warningLines.push("notify temp: no valid providers resolved; notifications skipped");
|
|
1914
|
+
}
|
|
1915
|
+
return { infoLines, warningLines };
|
|
1916
|
+
}
|
|
1917
|
+
export function buildNotifyFallbackWatcherEnv(env = process.env, options = {}) {
|
|
1918
|
+
const nextEnv = { ...env };
|
|
1919
|
+
delete nextEnv.TMUX;
|
|
1920
|
+
delete nextEnv.TMUX_PANE;
|
|
1921
|
+
return {
|
|
1922
|
+
...nextEnv,
|
|
1923
|
+
...(options.codexHomeOverride ? { CODEX_HOME: options.codexHomeOverride } : {}),
|
|
1924
|
+
...(options.sessionId ? { RCS_SESSION_ID: options.sessionId } : {}),
|
|
1925
|
+
RCS_HUD_AUTHORITY: options.enableAuthority ? "1" : "0",
|
|
1926
|
+
};
|
|
1927
|
+
}
|
|
1928
|
+
export function shouldEnableNotifyFallbackWatcher(env = process.env, platform = process.platform) {
|
|
1929
|
+
const toggle = String(env.RCS_NOTIFY_FALLBACK ?? "").trim();
|
|
1930
|
+
if (platform === "win32") {
|
|
1931
|
+
return toggle === "1";
|
|
1932
|
+
}
|
|
1933
|
+
return toggle !== "0";
|
|
1934
|
+
}
|
|
1935
|
+
export async function cleanupLaunchOrphanedMcpProcesses(dependencies = {}) {
|
|
1936
|
+
return cleanupRcsMcpProcesses([], {
|
|
1937
|
+
...dependencies,
|
|
1938
|
+
selectCandidates: dependencies.selectCandidates ?? findLaunchSafeCleanupCandidates,
|
|
1939
|
+
writeLine: dependencies.writeLine ?? (() => { }),
|
|
1940
|
+
});
|
|
1941
|
+
}
|
|
1942
|
+
const POST_LAUNCH_MODE_STATE_RETRY_DELAY_MS = 10;
|
|
1943
|
+
const POST_LAUNCH_MODE_STATE_MAX_READ_ATTEMPTS = 2;
|
|
1944
|
+
function isLikelyTransientModeStateParseFailure(raw, err) {
|
|
1945
|
+
const trimmed = raw.trim();
|
|
1946
|
+
if (trimmed.length === 0)
|
|
1947
|
+
return true;
|
|
1948
|
+
if (!(err instanceof SyntaxError))
|
|
1949
|
+
return false;
|
|
1950
|
+
if (!trimmed.startsWith("{") || trimmed.endsWith("}"))
|
|
1951
|
+
return false;
|
|
1952
|
+
return (/Unexpected end of JSON input/.test(err.message) ||
|
|
1953
|
+
/Unterminated string in JSON/.test(err.message) ||
|
|
1954
|
+
/Expected double-quoted property name in JSON/.test(err.message) ||
|
|
1955
|
+
/Expected property name or '}' in JSON/.test(err.message) ||
|
|
1956
|
+
/Expected ':' after property name in JSON/.test(err.message) ||
|
|
1957
|
+
/Expected ',' or '}' after property value in JSON/.test(err.message));
|
|
1958
|
+
}
|
|
1959
|
+
async function readPostLaunchModeStateFile(path, dependencies = {}) {
|
|
1960
|
+
const readFile = dependencies.readFile ?? (await import("fs/promises")).readFile;
|
|
1961
|
+
const sleep = dependencies.sleep
|
|
1962
|
+
?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
1963
|
+
for (let attempt = 1; attempt <= POST_LAUNCH_MODE_STATE_MAX_READ_ATTEMPTS; attempt += 1) {
|
|
1964
|
+
try {
|
|
1965
|
+
const raw = await readFile(path, "utf-8");
|
|
1966
|
+
const trimmed = raw.trim();
|
|
1967
|
+
if (trimmed.length === 0) {
|
|
1968
|
+
if (attempt < POST_LAUNCH_MODE_STATE_MAX_READ_ATTEMPTS) {
|
|
1969
|
+
await sleep(POST_LAUNCH_MODE_STATE_RETRY_DELAY_MS);
|
|
1970
|
+
continue;
|
|
1971
|
+
}
|
|
1972
|
+
return { kind: "recoverable" };
|
|
1973
|
+
}
|
|
1974
|
+
let parsed;
|
|
1975
|
+
try {
|
|
1976
|
+
parsed = JSON.parse(raw);
|
|
1977
|
+
}
|
|
1978
|
+
catch (err) {
|
|
1979
|
+
if (isLikelyTransientModeStateParseFailure(raw, err)) {
|
|
1980
|
+
if (attempt < POST_LAUNCH_MODE_STATE_MAX_READ_ATTEMPTS) {
|
|
1981
|
+
await sleep(POST_LAUNCH_MODE_STATE_RETRY_DELAY_MS);
|
|
1982
|
+
continue;
|
|
1983
|
+
}
|
|
1984
|
+
return { kind: "recoverable" };
|
|
1985
|
+
}
|
|
1986
|
+
return {
|
|
1987
|
+
kind: "malformed",
|
|
1988
|
+
message: err instanceof Error ? err.message : String(err),
|
|
1989
|
+
};
|
|
1990
|
+
}
|
|
1991
|
+
if (!parsed || Array.isArray(parsed) || typeof parsed !== "object") {
|
|
1992
|
+
return { kind: "malformed", message: "mode state must be a JSON object" };
|
|
1993
|
+
}
|
|
1994
|
+
return { kind: "ok", state: parsed };
|
|
1995
|
+
}
|
|
1996
|
+
catch (err) {
|
|
1997
|
+
const error = err;
|
|
1998
|
+
if (error?.code === "ENOENT")
|
|
1999
|
+
return { kind: "missing" };
|
|
2000
|
+
return {
|
|
2001
|
+
kind: "malformed",
|
|
2002
|
+
message: err instanceof Error ? err.message : String(err),
|
|
2003
|
+
};
|
|
2004
|
+
}
|
|
2005
|
+
}
|
|
2006
|
+
return { kind: "recoverable" };
|
|
2007
|
+
}
|
|
2008
|
+
function buildRecoveredPostLaunchModeState(mode, completedAt) {
|
|
2009
|
+
return {
|
|
2010
|
+
active: false,
|
|
2011
|
+
mode,
|
|
2012
|
+
current_phase: "cancelled",
|
|
2013
|
+
completed_at: completedAt,
|
|
2014
|
+
last_turn_at: completedAt,
|
|
2015
|
+
};
|
|
2016
|
+
}
|
|
2017
|
+
function buildRecoveredPostLaunchSkillActiveState(completedAt) {
|
|
2018
|
+
return {
|
|
2019
|
+
version: 1,
|
|
2020
|
+
active: false,
|
|
2021
|
+
skill: "",
|
|
2022
|
+
phase: "complete",
|
|
2023
|
+
updated_at: completedAt,
|
|
2024
|
+
active_skills: [],
|
|
2025
|
+
};
|
|
2026
|
+
}
|
|
2027
|
+
export async function cleanupPostLaunchModeStateFiles(cwd, sessionId, dependencies = {}) {
|
|
2028
|
+
const readdir = dependencies.readdir ?? (await import("fs/promises")).readdir;
|
|
2029
|
+
const writeFile = dependencies.writeFile ?? (await import("fs/promises")).writeFile;
|
|
2030
|
+
const writeWarn = dependencies.writeWarn ?? console.warn;
|
|
2031
|
+
const now = dependencies.now ?? (() => new Date());
|
|
2032
|
+
const scopedDirs = [getBaseStateDir(cwd), getStateDir(cwd, sessionId)];
|
|
2033
|
+
for (const stateDir of scopedDirs) {
|
|
2034
|
+
const files = await readdir(stateDir).catch(() => []);
|
|
2035
|
+
for (const file of files) {
|
|
2036
|
+
if (!file.endsWith("-state.json") || file === "session.json")
|
|
2037
|
+
continue;
|
|
2038
|
+
const path = join(stateDir, file);
|
|
2039
|
+
const mode = file.slice(0, -"-state.json".length);
|
|
2040
|
+
const result = await readPostLaunchModeStateFile(path, dependencies);
|
|
2041
|
+
if (result.kind !== "ok") {
|
|
2042
|
+
if (result.kind === "recoverable") {
|
|
2043
|
+
try {
|
|
2044
|
+
const completedAt = now().toISOString();
|
|
2045
|
+
await writeFile(path, JSON.stringify(mode === SKILL_ACTIVE_STATE_MODE
|
|
2046
|
+
? buildRecoveredPostLaunchSkillActiveState(completedAt)
|
|
2047
|
+
: buildRecoveredPostLaunchModeState(mode, completedAt), null, 2));
|
|
2048
|
+
if (isTrackedWorkflowMode(mode)) {
|
|
2049
|
+
await syncCanonicalSkillStateForMode({
|
|
2050
|
+
cwd,
|
|
2051
|
+
mode,
|
|
2052
|
+
active: false,
|
|
2053
|
+
currentPhase: "cancelled",
|
|
2054
|
+
sessionId: stateDir === getStateDir(cwd, sessionId) ? sessionId : undefined,
|
|
2055
|
+
nowIso: completedAt,
|
|
2056
|
+
source: "postLaunchCleanup",
|
|
2057
|
+
});
|
|
2058
|
+
}
|
|
2059
|
+
}
|
|
2060
|
+
catch (err) {
|
|
2061
|
+
writeWarn(`[rcs] postLaunch: failed to recover mode state ${path}: ${err instanceof Error ? err.message : err}`);
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
else if (result.kind === "malformed") {
|
|
2065
|
+
writeWarn(`[rcs] postLaunch: skipped malformed mode state ${path}: ${result.message}`);
|
|
2066
|
+
}
|
|
2067
|
+
continue;
|
|
2068
|
+
}
|
|
2069
|
+
const skillStateStillVisible = mode === SKILL_ACTIVE_STATE_MODE
|
|
2070
|
+
&& Array.isArray(result.state.active_skills)
|
|
2071
|
+
&& result.state.active_skills.length > 0;
|
|
2072
|
+
if (result.state.active !== true && !skillStateStillVisible)
|
|
2073
|
+
continue;
|
|
2074
|
+
try {
|
|
2075
|
+
const completedAt = now().toISOString();
|
|
2076
|
+
if (mode === SKILL_ACTIVE_STATE_MODE) {
|
|
2077
|
+
result.state.active = false;
|
|
2078
|
+
result.state.phase = "complete";
|
|
2079
|
+
result.state.updated_at = completedAt;
|
|
2080
|
+
result.state.active_skills = [];
|
|
2081
|
+
await writeFile(path, JSON.stringify(result.state, null, 2));
|
|
2082
|
+
continue;
|
|
2083
|
+
}
|
|
2084
|
+
result.state.active = false;
|
|
2085
|
+
result.state.current_phase = "cancelled";
|
|
2086
|
+
result.state.completed_at = completedAt;
|
|
2087
|
+
await writeFile(path, JSON.stringify(result.state, null, 2));
|
|
2088
|
+
if (isTrackedWorkflowMode(mode)) {
|
|
2089
|
+
await syncCanonicalSkillStateForMode({
|
|
2090
|
+
cwd,
|
|
2091
|
+
mode,
|
|
2092
|
+
active: false,
|
|
2093
|
+
currentPhase: "cancelled",
|
|
2094
|
+
sessionId: stateDir === getStateDir(cwd, sessionId) ? sessionId : undefined,
|
|
2095
|
+
nowIso: completedAt,
|
|
2096
|
+
source: "postLaunchCleanup",
|
|
2097
|
+
});
|
|
2098
|
+
}
|
|
2099
|
+
}
|
|
2100
|
+
catch (err) {
|
|
2101
|
+
writeWarn(`[rcs] postLaunch: failed to update mode state ${path}: ${err instanceof Error ? err.message : err}`);
|
|
2102
|
+
}
|
|
2103
|
+
}
|
|
2104
|
+
}
|
|
2105
|
+
}
|
|
2106
|
+
export async function reapPostLaunchOrphanedMcpProcesses(dependencies = {}) {
|
|
2107
|
+
const cleanup = dependencies.cleanup ?? cleanupLaunchOrphanedMcpProcesses;
|
|
2108
|
+
const writeInfo = dependencies.writeInfo ?? console.log;
|
|
2109
|
+
const writeWarn = dependencies.writeWarn ?? console.warn;
|
|
2110
|
+
const writeError = dependencies.writeError ?? ((line) => process.stderr.write(line));
|
|
2111
|
+
try {
|
|
2112
|
+
const result = await cleanup();
|
|
2113
|
+
if (result.terminatedCount > 0) {
|
|
2114
|
+
writeInfo(`[rcs] postLaunch: reaped ${result.terminatedCount} orphaned RCS MCP process(es).`);
|
|
2115
|
+
}
|
|
2116
|
+
if (result.failedPids.length > 0) {
|
|
2117
|
+
writeWarn(`[rcs] postLaunch: failed to reap ${result.failedPids.length} orphaned RCS MCP process(es); continuing cleanup.`);
|
|
2118
|
+
}
|
|
2119
|
+
}
|
|
2120
|
+
catch (err) {
|
|
2121
|
+
writeError(`[cli/index] postLaunch MCP cleanup failed: ${err}\n`);
|
|
2122
|
+
}
|
|
2123
|
+
}
|
|
2124
|
+
/**
|
|
2125
|
+
* preLaunch: Prepare environment before Codex starts.
|
|
2126
|
+
* 1. Best-effort launch-safe orphan cleanup for detached RCS MCP processes
|
|
2127
|
+
* 2. Generate runtime overlay + write session-scoped model instructions file
|
|
2128
|
+
* 3. Write session.json
|
|
2129
|
+
*
|
|
2130
|
+
* Automatic broad stale-session cleanup remains disabled here. Only detached
|
|
2131
|
+
* RCS MCP processes without a live Codex ancestor are reaped so new launches
|
|
2132
|
+
* do not accumulate stale processes from prior crashed/closed sessions.
|
|
2133
|
+
*/
|
|
2134
|
+
async function preLaunch(cwd, sessionId, notifyTempContract, codexHomeOverride, enableNotifyFallbackAuthority = false, worktreeDirty = false) {
|
|
2135
|
+
// 1. Best-effort launch-safe orphan cleanup
|
|
2136
|
+
try {
|
|
2137
|
+
const cleanup = await cleanupLaunchOrphanedMcpProcesses();
|
|
2138
|
+
if (cleanup.terminatedCount > 0) {
|
|
2139
|
+
console.log(`[rcs] Reaped ${cleanup.terminatedCount} orphaned RCS MCP process(es) before launch.`);
|
|
2140
|
+
}
|
|
2141
|
+
if (cleanup.failedPids.length > 0) {
|
|
2142
|
+
console.warn(`[rcs] Failed to reap ${cleanup.failedPids.length} orphaned RCS MCP process(es); continuing launch.`);
|
|
2143
|
+
}
|
|
2144
|
+
}
|
|
2145
|
+
catch (err) {
|
|
2146
|
+
logCliOperationFailure(err);
|
|
2147
|
+
// Non-fatal
|
|
2148
|
+
}
|
|
2149
|
+
// 2. Generate runtime overlay + write session-scoped model instructions file
|
|
2150
|
+
const orchestrationMode = await resolveSessionOrchestrationMode(cwd, sessionId);
|
|
2151
|
+
const overlay = await generateOverlay(cwd, sessionId, { orchestrationMode });
|
|
2152
|
+
const launchAppendix = await readLaunchAppendInstructions();
|
|
2153
|
+
const dirtyWorktreeGuidance = worktreeDirty
|
|
2154
|
+
? `\n\n## Session start: dirty worktree detected\n\nThis worktree has uncommitted changes that were present when the session launched.\nBefore executing the requested task, resolve the dirty state first:\n1. Review uncommitted changes with \`git status\` and \`git diff\`.\n2. Commit, stash, or discard changes as appropriate.\n3. Then proceed with the original task.`
|
|
2155
|
+
: "";
|
|
2156
|
+
const sessionInstructions = launchAppendix.trim().length > 0
|
|
2157
|
+
? `${overlay}
|
|
2158
|
+
|
|
2159
|
+
${launchAppendix}${dirtyWorktreeGuidance}`
|
|
2160
|
+
: `${overlay}${dirtyWorktreeGuidance}`;
|
|
2161
|
+
await writeSessionModelInstructionsFile(cwd, sessionId, sessionInstructions);
|
|
2162
|
+
// 3. Write session state
|
|
2163
|
+
await resetSessionMetrics(cwd, sessionId);
|
|
2164
|
+
await writeSessionStart(cwd, sessionId);
|
|
2165
|
+
tagCurrentTmuxSessionWithInstance(sessionId);
|
|
2166
|
+
// 4. Start notify fallback watcher (best effort)
|
|
2167
|
+
try {
|
|
2168
|
+
await startNotifyFallbackWatcher(cwd, { codexHomeOverride, enableAuthority: enableNotifyFallbackAuthority, sessionId });
|
|
2169
|
+
}
|
|
2170
|
+
catch (err) {
|
|
2171
|
+
logCliOperationFailure(err);
|
|
2172
|
+
// Non-fatal
|
|
2173
|
+
}
|
|
2174
|
+
// 5. Start derived watcher (best effort, opt-in)
|
|
2175
|
+
try {
|
|
2176
|
+
await startHookDerivedWatcher(cwd);
|
|
2177
|
+
}
|
|
2178
|
+
catch (err) {
|
|
2179
|
+
logCliOperationFailure(err);
|
|
2180
|
+
// Non-fatal
|
|
2181
|
+
}
|
|
2182
|
+
// 6. Emit temp notification startup summary + warnings, then send session-start lifecycle notification (best effort)
|
|
2183
|
+
try {
|
|
2184
|
+
if (notifyTempContract?.active) {
|
|
2185
|
+
process.env[RCS_NOTIFY_TEMP_CONTRACT_ENV] =
|
|
2186
|
+
serializeNotifyTempContract(notifyTempContract);
|
|
2187
|
+
const { getNotificationConfig } = await import("../notifications/config.js");
|
|
2188
|
+
const resolved = getNotificationConfig();
|
|
2189
|
+
const startup = buildNotifyTempStartupMessages(notifyTempContract, Boolean(resolved?.enabled));
|
|
2190
|
+
for (const info of startup.infoLines) {
|
|
2191
|
+
console.log(`[rcs] ${info}`);
|
|
2192
|
+
}
|
|
2193
|
+
for (const warning of startup.warningLines) {
|
|
2194
|
+
console.warn(`[rcs] ${warning}`);
|
|
2195
|
+
}
|
|
2196
|
+
}
|
|
2197
|
+
else {
|
|
2198
|
+
delete process.env[RCS_NOTIFY_TEMP_CONTRACT_ENV];
|
|
2199
|
+
}
|
|
2200
|
+
const { notifyLifecycle } = await import("../notifications/index.js");
|
|
2201
|
+
await notifyLifecycle("session-start", {
|
|
2202
|
+
sessionId,
|
|
2203
|
+
projectPath: cwd,
|
|
2204
|
+
projectName: basename(cwd),
|
|
2205
|
+
});
|
|
2206
|
+
}
|
|
2207
|
+
catch (err) {
|
|
2208
|
+
logCliOperationFailure(err);
|
|
2209
|
+
// Non-fatal: notification failures must never block launch
|
|
2210
|
+
}
|
|
2211
|
+
// 7. Dispatch native hook event (best effort)
|
|
2212
|
+
try {
|
|
2213
|
+
await emitNativeHookEvent(cwd, "session-start", {
|
|
2214
|
+
session_id: sessionId,
|
|
2215
|
+
context: buildNativeHookBaseContext(cwd, sessionId, "started", {
|
|
2216
|
+
project_path: cwd,
|
|
2217
|
+
project_name: basename(cwd),
|
|
2218
|
+
status: "started",
|
|
2219
|
+
}),
|
|
2220
|
+
});
|
|
2221
|
+
}
|
|
2222
|
+
catch (err) {
|
|
2223
|
+
logCliOperationFailure(err);
|
|
2224
|
+
// Non-fatal
|
|
2225
|
+
}
|
|
2226
|
+
}
|
|
2227
|
+
/**
|
|
2228
|
+
* runCodex: Launch Codex CLI (blocks until exit).
|
|
2229
|
+
* All 3 paths (new tmux, existing tmux, no tmux) block via execSync/execFileSync.
|
|
2230
|
+
*/
|
|
2231
|
+
function runCodex(cwd, args, sessionId, workerDefaultModel, codexHomeOverride, notifyTempContractRaw, explicitLaunchPolicy, projectLocalCodexHomeForCleanup, runtimeCodexHomeForCleanup) {
|
|
2232
|
+
const launchArgs = injectModelInstructionsBypassArgs(cwd, args, process.env, sessionModelInstructionsPath(cwd, sessionId));
|
|
2233
|
+
const nativeWindows = isNativeWindows();
|
|
2234
|
+
const rcsBin = resolveRcsEntryPath();
|
|
2235
|
+
if (!rcsBin) {
|
|
2236
|
+
throw new Error("Unable to resolve RCS launcher path for tmux HUD bootstrap");
|
|
2237
|
+
}
|
|
2238
|
+
const hudCmd = nativeWindows
|
|
2239
|
+
? buildWindowsPromptCommand("node", [rcsBin, "hud", "--watch"])
|
|
2240
|
+
: buildTmuxPaneCommand("env", [`RCS_SESSION_ID=${sessionId}`, "node", rcsBin, "hud", "--watch"]);
|
|
2241
|
+
const inheritLeaderFlags = process.env[TEAM_INHERIT_LEADER_FLAGS_ENV] !== "0";
|
|
2242
|
+
const workerLaunchArgs = resolveTeamWorkerLaunchArgsEnv(process.env[TEAM_WORKER_LAUNCH_ARGS_ENV], launchArgs, inheritLeaderFlags, workerDefaultModel);
|
|
2243
|
+
const codexBaseEnv = codexHomeOverride
|
|
2244
|
+
? { ...process.env, CODEX_HOME: codexHomeOverride }
|
|
2245
|
+
: process.env;
|
|
2246
|
+
const codexEnvWithSession = { ...codexBaseEnv, RCS_SESSION_ID: sessionId };
|
|
2247
|
+
const codexEnv = workerLaunchArgs
|
|
2248
|
+
? { ...codexEnvWithSession, [TEAM_WORKER_LAUNCH_ARGS_ENV]: workerLaunchArgs }
|
|
2249
|
+
: codexEnvWithSession;
|
|
2250
|
+
const codexEnvWithNotify = notifyTempContractRaw
|
|
2251
|
+
? { ...codexEnv, [RCS_NOTIFY_TEMP_CONTRACT_ENV]: notifyTempContractRaw }
|
|
2252
|
+
: codexEnv;
|
|
2253
|
+
const { launchPolicy } = resolveTmuxAwareLaunchPolicy(explicitLaunchPolicy, nativeWindows);
|
|
2254
|
+
if (isCodexVersionRequest(launchArgs)) {
|
|
2255
|
+
runCodexBlocking(cwd, launchArgs, codexEnvWithNotify);
|
|
2256
|
+
return { postLaunchHandledExternally: false };
|
|
2257
|
+
}
|
|
2258
|
+
if (launchPolicy === "inside-tmux") {
|
|
2259
|
+
// Already in tmux: launch codex in current pane, HUD in bottom split
|
|
2260
|
+
const currentPaneId = process.env.TMUX_PANE;
|
|
2261
|
+
const staleHudPaneIds = listHudWatchPaneIdsInCurrentWindow(currentPaneId);
|
|
2262
|
+
for (const paneId of staleHudPaneIds) {
|
|
2263
|
+
killTmuxPane(paneId);
|
|
2264
|
+
}
|
|
2265
|
+
let hudPaneId = null;
|
|
2266
|
+
try {
|
|
2267
|
+
hudPaneId = createHudWatchPane(cwd, hudCmd);
|
|
2268
|
+
}
|
|
2269
|
+
catch (err) {
|
|
2270
|
+
logCliOperationFailure(err);
|
|
2271
|
+
// HUD split failed, continue without it
|
|
2272
|
+
}
|
|
2273
|
+
// Enable mouse scrolling at session start so scroll works before team
|
|
2274
|
+
// expansion. Previously this was only called from createTeamSession().
|
|
2275
|
+
// Opt-out: set RCS_MOUSE=0. (closes #128)
|
|
2276
|
+
if (process.env.RCS_MOUSE !== "0") {
|
|
2277
|
+
try {
|
|
2278
|
+
const tmuxPaneTarget = process.env.TMUX_PANE;
|
|
2279
|
+
const displayArgs = tmuxPaneTarget
|
|
2280
|
+
? ["display-message", "-p", "-t", tmuxPaneTarget, "#S"]
|
|
2281
|
+
: ["display-message", "-p", "#S"];
|
|
2282
|
+
const tmuxSession = execTmuxFileSync(displayArgs, {
|
|
2283
|
+
encoding: "utf-8",
|
|
2284
|
+
}).trim();
|
|
2285
|
+
if (tmuxSession)
|
|
2286
|
+
enableMouseScrolling(tmuxSession);
|
|
2287
|
+
}
|
|
2288
|
+
catch (err) {
|
|
2289
|
+
logCliOperationFailure(err);
|
|
2290
|
+
// Non-fatal: mouse scrolling is a convenience feature
|
|
2291
|
+
}
|
|
2292
|
+
}
|
|
2293
|
+
const activePaneId = process.env.TMUX_PANE?.trim();
|
|
2294
|
+
if (activePaneId) {
|
|
2295
|
+
try {
|
|
2296
|
+
execTmuxFileSync(["display-message", "-p", "-t", activePaneId, "#S"], {
|
|
2297
|
+
encoding: "utf-8",
|
|
2298
|
+
});
|
|
2299
|
+
}
|
|
2300
|
+
catch { }
|
|
2301
|
+
}
|
|
2302
|
+
try {
|
|
2303
|
+
withTmuxExtendedKeys(cwd, () => {
|
|
2304
|
+
runCodexBlocking(cwd, launchArgs, codexEnvWithNotify);
|
|
2305
|
+
});
|
|
2306
|
+
}
|
|
2307
|
+
finally {
|
|
2308
|
+
const cleanupPaneIds = buildHudPaneCleanupTargets(listHudWatchPaneIdsInCurrentWindow(currentPaneId), hudPaneId, currentPaneId);
|
|
2309
|
+
for (const paneId of cleanupPaneIds) {
|
|
2310
|
+
killTmuxPane(paneId);
|
|
2311
|
+
}
|
|
2312
|
+
}
|
|
2313
|
+
return { postLaunchHandledExternally: false };
|
|
2314
|
+
}
|
|
2315
|
+
else if (launchPolicy === "direct") {
|
|
2316
|
+
// Detached HUD sessions require tmux. Skip the bootstrap entirely when the
|
|
2317
|
+
// binary is unavailable so direct launches do not emit noisy ENOENT logs.
|
|
2318
|
+
runCodexBlocking(cwd, launchArgs, codexEnvWithNotify);
|
|
2319
|
+
return { postLaunchHandledExternally: false };
|
|
2320
|
+
}
|
|
2321
|
+
else {
|
|
2322
|
+
// Not in tmux: create a new tmux session with codex + HUD pane
|
|
2323
|
+
const codexCmd = buildTmuxPaneCommand("codex", launchArgs);
|
|
2324
|
+
const detachedWindowsCodexCmd = nativeWindows
|
|
2325
|
+
? buildWindowsPromptCommand("codex", launchArgs)
|
|
2326
|
+
: null;
|
|
2327
|
+
const sessionName = buildDetachedTmuxSessionName(cwd, sessionId);
|
|
2328
|
+
void writeSessionStart(cwd, sessionId, { tmuxSessionName: sessionName }).catch((err) => {
|
|
2329
|
+
logCliOperationFailure(err);
|
|
2330
|
+
// Non-fatal: managed tmux recovery can still use compatibility fallback.
|
|
2331
|
+
});
|
|
2332
|
+
let createdDetachedSession = false;
|
|
2333
|
+
let registeredHookTarget = null;
|
|
2334
|
+
let registeredHookName = null;
|
|
2335
|
+
let registeredClientAttachedHookName = null;
|
|
2336
|
+
try {
|
|
2337
|
+
const bootstrapSteps = buildDetachedSessionBootstrapSteps(sessionName, cwd, codexCmd, hudCmd, workerLaunchArgs, codexHomeOverride, notifyTempContractRaw, nativeWindows, sessionId, projectLocalCodexHomeForCleanup, runtimeCodexHomeForCleanup);
|
|
2338
|
+
for (const step of bootstrapSteps) {
|
|
2339
|
+
const output = execTmuxFileSync(step.args, {
|
|
2340
|
+
stdio: "pipe",
|
|
2341
|
+
encoding: "utf-8",
|
|
2342
|
+
});
|
|
2343
|
+
if (step.name === "new-session") {
|
|
2344
|
+
createdDetachedSession = true;
|
|
2345
|
+
parsePaneIdFromTmuxOutput(output || "");
|
|
2346
|
+
}
|
|
2347
|
+
if (step.name === "split-and-capture-hud-pane") {
|
|
2348
|
+
const hudPaneId = parsePaneIdFromTmuxOutput(output || "");
|
|
2349
|
+
const hookWindowIndex = hudPaneId
|
|
2350
|
+
? detectDetachedSessionWindowIndex(sessionName)
|
|
2351
|
+
: null;
|
|
2352
|
+
const hookTarget = hudPaneId && hookWindowIndex
|
|
2353
|
+
? buildResizeHookTarget(sessionName, hookWindowIndex)
|
|
2354
|
+
: null;
|
|
2355
|
+
const hookName = hudPaneId && hookWindowIndex
|
|
2356
|
+
? buildResizeHookName("launch", sessionName, hookWindowIndex, hudPaneId)
|
|
2357
|
+
: null;
|
|
2358
|
+
const clientAttachedHookName = hudPaneId && hookWindowIndex
|
|
2359
|
+
? buildClientAttachedReconcileHookName("launch", sessionName, hookWindowIndex, hudPaneId)
|
|
2360
|
+
: null;
|
|
2361
|
+
const finalizeSteps = buildDetachedSessionFinalizeSteps(sessionName, hudPaneId, hookWindowIndex, process.env.RCS_MOUSE !== "0", nativeWindows);
|
|
2362
|
+
if (nativeWindows && detachedWindowsCodexCmd) {
|
|
2363
|
+
scheduleDetachedWindowsCodexLaunch(sessionName, detachedWindowsCodexCmd);
|
|
2364
|
+
}
|
|
2365
|
+
for (const finalizeStep of finalizeSteps) {
|
|
2366
|
+
if (finalizeStep.name === "sanitize-copy-mode-style") {
|
|
2367
|
+
try {
|
|
2368
|
+
mitigateCopyModeUnderlineArtifacts(sessionName);
|
|
2369
|
+
}
|
|
2370
|
+
catch (err) {
|
|
2371
|
+
logCliOperationFailure(err);
|
|
2372
|
+
}
|
|
2373
|
+
continue;
|
|
2374
|
+
}
|
|
2375
|
+
const stdio = finalizeStep.name === "attach-session" ? "inherit" : "ignore";
|
|
2376
|
+
try {
|
|
2377
|
+
execTmuxFileSync(finalizeStep.args, { stdio });
|
|
2378
|
+
}
|
|
2379
|
+
catch (err) {
|
|
2380
|
+
logCliOperationFailure(err);
|
|
2381
|
+
if (finalizeStep.name === "attach-session")
|
|
2382
|
+
throw new Error("failed to attach detached tmux session");
|
|
2383
|
+
continue;
|
|
2384
|
+
}
|
|
2385
|
+
if (finalizeStep.name === "register-resize-hook" &&
|
|
2386
|
+
hookTarget &&
|
|
2387
|
+
hookName) {
|
|
2388
|
+
registeredHookTarget = hookTarget;
|
|
2389
|
+
registeredHookName = hookName;
|
|
2390
|
+
}
|
|
2391
|
+
if (finalizeStep.name === "register-client-attached-reconcile" &&
|
|
2392
|
+
clientAttachedHookName) {
|
|
2393
|
+
registeredClientAttachedHookName = clientAttachedHookName;
|
|
2394
|
+
}
|
|
2395
|
+
}
|
|
2396
|
+
}
|
|
2397
|
+
}
|
|
2398
|
+
return { postLaunchHandledExternally: !nativeWindows };
|
|
2399
|
+
}
|
|
2400
|
+
catch (err) {
|
|
2401
|
+
logCliOperationFailure(err);
|
|
2402
|
+
if (createdDetachedSession) {
|
|
2403
|
+
const rollbackSteps = buildDetachedSessionRollbackSteps(sessionName, registeredHookTarget, registeredHookName, registeredClientAttachedHookName);
|
|
2404
|
+
for (const rollbackStep of rollbackSteps) {
|
|
2405
|
+
try {
|
|
2406
|
+
execTmuxFileSync(rollbackStep.args, { stdio: "ignore" });
|
|
2407
|
+
}
|
|
2408
|
+
catch (err) {
|
|
2409
|
+
logCliOperationFailure(err);
|
|
2410
|
+
// best-effort rollback only
|
|
2411
|
+
}
|
|
2412
|
+
}
|
|
2413
|
+
}
|
|
2414
|
+
// tmux not available or failed, just run codex directly
|
|
2415
|
+
runCodexBlocking(cwd, launchArgs, codexEnvWithNotify);
|
|
2416
|
+
return { postLaunchHandledExternally: false };
|
|
2417
|
+
}
|
|
2418
|
+
}
|
|
2419
|
+
}
|
|
2420
|
+
function listHudWatchPaneIdsInCurrentWindow(currentPaneId) {
|
|
2421
|
+
try {
|
|
2422
|
+
return listCurrentWindowHudPaneIds(currentPaneId);
|
|
2423
|
+
}
|
|
2424
|
+
catch (err) {
|
|
2425
|
+
logCliOperationFailure(err);
|
|
2426
|
+
return [];
|
|
2427
|
+
}
|
|
2428
|
+
}
|
|
2429
|
+
function createHudWatchPane(cwd, hudCmd) {
|
|
2430
|
+
return createSharedHudWatchPane(cwd, hudCmd, { heightLines: HUD_TMUX_HEIGHT_LINES });
|
|
2431
|
+
}
|
|
2432
|
+
function killTmuxPane(paneId) {
|
|
2433
|
+
if (!paneId.startsWith("%"))
|
|
2434
|
+
return;
|
|
2435
|
+
try {
|
|
2436
|
+
killSharedTmuxPane(paneId);
|
|
2437
|
+
}
|
|
2438
|
+
catch (err) {
|
|
2439
|
+
logCliOperationFailure(err);
|
|
2440
|
+
// Pane may already be gone; ignore.
|
|
2441
|
+
}
|
|
2442
|
+
}
|
|
2443
|
+
export function buildTmuxShellCommand(command, args) {
|
|
2444
|
+
return [quoteShellArg(command), ...args.map(quoteShellArg)].join(" ");
|
|
2445
|
+
}
|
|
2446
|
+
function encodePowerShellCommand(commandText) {
|
|
2447
|
+
return Buffer.from(commandText, "utf16le").toString("base64");
|
|
2448
|
+
}
|
|
2449
|
+
function isCodexVersionRequest(args) {
|
|
2450
|
+
return args.some((arg) => CODEX_VERSION_FLAGS.has(arg));
|
|
2451
|
+
}
|
|
2452
|
+
export function buildWindowsPromptCommand(command, args) {
|
|
2453
|
+
const invocation = [
|
|
2454
|
+
"&",
|
|
2455
|
+
quotePowerShellArg(command),
|
|
2456
|
+
...args.map(quotePowerShellArg),
|
|
2457
|
+
].join(" ");
|
|
2458
|
+
const wrappedCommand = [
|
|
2459
|
+
"$ErrorActionPreference = 'Stop'",
|
|
2460
|
+
`& { ${invocation} }`,
|
|
2461
|
+
].join("; ");
|
|
2462
|
+
return `powershell.exe -NoLogo -NoExit -EncodedCommand ${encodePowerShellCommand(wrappedCommand)}`;
|
|
2463
|
+
}
|
|
2464
|
+
/**
|
|
2465
|
+
* Wrap a command for tmux pane execution while preserving the tmux pane cwd.
|
|
2466
|
+
* tmux already starts the pane at `-c <cwd>`; using a login shell here can
|
|
2467
|
+
* reset that cwd back to the shell's startup directory on some setups.
|
|
2468
|
+
* Source zsh/bash rc files explicitly when needed, then exec the target.
|
|
2469
|
+
*/
|
|
2470
|
+
export function buildTmuxPaneCommand(command, args, shellPath = process.env.SHELL) {
|
|
2471
|
+
const bareCmd = buildTmuxShellCommand(command, args);
|
|
2472
|
+
let rcSource = "";
|
|
2473
|
+
if (shellPath && /\/zsh$/i.test(shellPath)) {
|
|
2474
|
+
rcSource = "if [ -f ~/.zshrc ]; then source ~/.zshrc; fi; ";
|
|
2475
|
+
}
|
|
2476
|
+
else if (shellPath && /\/bash$/i.test(shellPath)) {
|
|
2477
|
+
rcSource = "if [ -f ~/.bashrc ]; then source ~/.bashrc; fi; ";
|
|
2478
|
+
}
|
|
2479
|
+
const rawShell = shellPath && shellPath.trim() !== "" ? shellPath.trim() : "/bin/sh";
|
|
2480
|
+
const shellBin = ALLOWED_SHELLS.has(rawShell) ? rawShell : "/bin/sh";
|
|
2481
|
+
const inner = `${rcSource}exec ${bareCmd}`;
|
|
2482
|
+
return `${quoteShellArg(shellBin)} -c ${quoteShellArg(inner)}`;
|
|
2483
|
+
}
|
|
2484
|
+
function quoteShellArg(value) {
|
|
2485
|
+
return `'${value.replace(/'/g, `'\"'\"'`)}'`;
|
|
2486
|
+
}
|
|
2487
|
+
function quotePowerShellArg(value) {
|
|
2488
|
+
return `'${value.replace(/'/g, "''")}'`;
|
|
2489
|
+
}
|
|
2490
|
+
export function buildDetachedWindowsBootstrapScript(sessionName, commandText, delayMs = WINDOWS_DETACHED_BOOTSTRAP_DELAY_MS, tmuxCommand = resolveTmuxExecutableForLaunch()) {
|
|
2491
|
+
const delay = Number.isFinite(delayMs) && delayMs > 0
|
|
2492
|
+
? Math.floor(delayMs)
|
|
2493
|
+
: WINDOWS_DETACHED_BOOTSTRAP_DELAY_MS;
|
|
2494
|
+
const targetLiteral = JSON.stringify(`${sessionName}:0.0`);
|
|
2495
|
+
const commandLiteral = JSON.stringify(commandText);
|
|
2496
|
+
const tmuxCommandLiteral = JSON.stringify(tmuxCommand);
|
|
2497
|
+
return [
|
|
2498
|
+
"const { execFileSync } = require('child_process');",
|
|
2499
|
+
`const tmuxCommand = ${tmuxCommandLiteral};`,
|
|
2500
|
+
`setTimeout(() => {`,
|
|
2501
|
+
`try { execFileSync(tmuxCommand, ['send-keys', '-t', ${targetLiteral}, '-l', '--', ${commandLiteral}], { stdio: 'ignore' }); } catch {}`,
|
|
2502
|
+
`try { execFileSync(tmuxCommand, ['send-keys', '-t', ${targetLiteral}, 'C-m'], { stdio: 'ignore' }); } catch {}`,
|
|
2503
|
+
`}, ${delay});`,
|
|
2504
|
+
].join("");
|
|
2505
|
+
}
|
|
2506
|
+
function scheduleDetachedWindowsCodexLaunch(sessionName, commandText) {
|
|
2507
|
+
const child = spawn(process.execPath, ["-e", buildDetachedWindowsBootstrapScript(sessionName, commandText)], {
|
|
2508
|
+
detached: true,
|
|
2509
|
+
stdio: "ignore",
|
|
2510
|
+
windowsHide: true,
|
|
2511
|
+
});
|
|
2512
|
+
child.unref();
|
|
2513
|
+
}
|
|
2514
|
+
/**
|
|
2515
|
+
* postLaunch: Clean up after Codex exits.
|
|
2516
|
+
* Each step is independently fault-tolerant (try/catch per step).
|
|
2517
|
+
*/
|
|
2518
|
+
async function postLaunch(cwd, sessionId, codexHomeOverride, enableNotifyFallbackAuthority = false, projectLocalCodexHomeForCleanup) {
|
|
2519
|
+
// Capture session start time before cleanup (writeSessionEnd deletes session.json)
|
|
2520
|
+
let sessionStartedAt;
|
|
2521
|
+
try {
|
|
2522
|
+
const sessionState = await readSessionState(cwd);
|
|
2523
|
+
sessionStartedAt = sessionState?.started_at;
|
|
2524
|
+
}
|
|
2525
|
+
catch (err) {
|
|
2526
|
+
logCliOperationFailure(err);
|
|
2527
|
+
// Non-fatal
|
|
2528
|
+
}
|
|
2529
|
+
// 0. Reap MCP orphans left behind by the session that just exited.
|
|
2530
|
+
await reapPostLaunchOrphanedMcpProcesses();
|
|
2531
|
+
// 0. Flush fallback watcher once to reduce race with fast codex exit.
|
|
2532
|
+
try {
|
|
2533
|
+
await flushNotifyFallbackOnce(cwd, { codexHomeOverride, enableAuthority: enableNotifyFallbackAuthority, sessionId });
|
|
2534
|
+
}
|
|
2535
|
+
catch (err) {
|
|
2536
|
+
logCliOperationFailure(err);
|
|
2537
|
+
// Non-fatal
|
|
2538
|
+
}
|
|
2539
|
+
// 0. Stop notify fallback watcher first.
|
|
2540
|
+
try {
|
|
2541
|
+
await stopNotifyFallbackWatcher(cwd);
|
|
2542
|
+
}
|
|
2543
|
+
catch (err) {
|
|
2544
|
+
logCliOperationFailure(err);
|
|
2545
|
+
// Non-fatal
|
|
2546
|
+
}
|
|
2547
|
+
// 0. Flush derived watcher once on shutdown (opt-in, best effort).
|
|
2548
|
+
try {
|
|
2549
|
+
await flushHookDerivedWatcherOnce(cwd);
|
|
2550
|
+
}
|
|
2551
|
+
catch (err) {
|
|
2552
|
+
logCliOperationFailure(err);
|
|
2553
|
+
// Non-fatal
|
|
2554
|
+
}
|
|
2555
|
+
// 0.1 Stop derived watcher first (opt-in, best effort).
|
|
2556
|
+
try {
|
|
2557
|
+
await stopHookDerivedWatcher(cwd);
|
|
2558
|
+
}
|
|
2559
|
+
catch (err) {
|
|
2560
|
+
logCliOperationFailure(err);
|
|
2561
|
+
// Non-fatal
|
|
2562
|
+
}
|
|
2563
|
+
// 0.5. Remove Codex transient TUI NUX counters from project-local config only.
|
|
2564
|
+
try {
|
|
2565
|
+
if (projectLocalCodexHomeForCleanup) {
|
|
2566
|
+
await cleanCodexModelAvailabilityNuxIfNeeded(join(projectLocalCodexHomeForCleanup, "config.toml"));
|
|
2567
|
+
}
|
|
2568
|
+
}
|
|
2569
|
+
catch (err) {
|
|
2570
|
+
console.error(`[rcs] postLaunch: project config transient NUX cleanup failed: ${err instanceof Error ? err.message : err}`);
|
|
2571
|
+
}
|
|
2572
|
+
// 1. Remove session-scoped model instructions file
|
|
2573
|
+
try {
|
|
2574
|
+
await removeSessionModelInstructionsFile(cwd, sessionId);
|
|
2575
|
+
}
|
|
2576
|
+
catch (err) {
|
|
2577
|
+
console.error(`[rcs] postLaunch: model instructions cleanup failed: ${err instanceof Error ? err.message : err}`);
|
|
2578
|
+
}
|
|
2579
|
+
// 2. Archive session (write history, delete session.json)
|
|
2580
|
+
try {
|
|
2581
|
+
await writeSessionEnd(cwd, sessionId);
|
|
2582
|
+
}
|
|
2583
|
+
catch (err) {
|
|
2584
|
+
console.error(`[rcs] postLaunch: session archive failed: ${err instanceof Error ? err.message : err}`);
|
|
2585
|
+
}
|
|
2586
|
+
// 2.5. Best-effort wiki session capture
|
|
2587
|
+
try {
|
|
2588
|
+
const { onSessionEnd } = await import("../wiki/lifecycle.js");
|
|
2589
|
+
onSessionEnd({ cwd, session_id: sessionId });
|
|
2590
|
+
}
|
|
2591
|
+
catch (err) {
|
|
2592
|
+
logCliOperationFailure(err);
|
|
2593
|
+
// Non-fatal: wiki capture must never block session cleanup
|
|
2594
|
+
}
|
|
2595
|
+
// 3. Cancel any still-active modes
|
|
2596
|
+
try {
|
|
2597
|
+
await cleanupPostLaunchModeStateFiles(cwd, sessionId);
|
|
2598
|
+
}
|
|
2599
|
+
catch (err) {
|
|
2600
|
+
console.error(`[rcs] postLaunch: mode cleanup failed: ${err instanceof Error ? err.message : err}`);
|
|
2601
|
+
}
|
|
2602
|
+
// 4. Send session-end lifecycle notification (best effort)
|
|
2603
|
+
try {
|
|
2604
|
+
const { notifyLifecycle } = await import("../notifications/index.js");
|
|
2605
|
+
const durationMs = sessionStartedAt
|
|
2606
|
+
? Date.now() - new Date(sessionStartedAt).getTime()
|
|
2607
|
+
: undefined;
|
|
2608
|
+
await notifyLifecycle("session-end", {
|
|
2609
|
+
sessionId,
|
|
2610
|
+
projectPath: cwd,
|
|
2611
|
+
projectName: basename(cwd),
|
|
2612
|
+
durationMs,
|
|
2613
|
+
reason: "session_exit",
|
|
2614
|
+
});
|
|
2615
|
+
}
|
|
2616
|
+
catch (err) {
|
|
2617
|
+
logCliOperationFailure(err);
|
|
2618
|
+
// Non-fatal: notification failures must never block session cleanup
|
|
2619
|
+
}
|
|
2620
|
+
// 4.5. Persist team leader attention when an active leader session exits.
|
|
2621
|
+
try {
|
|
2622
|
+
const { markOwnedTeamsLeaderSessionStopped } = await import("../team/state.js");
|
|
2623
|
+
await markOwnedTeamsLeaderSessionStopped(cwd, sessionId);
|
|
2624
|
+
}
|
|
2625
|
+
catch (err) {
|
|
2626
|
+
logCliOperationFailure(err);
|
|
2627
|
+
// Non-fatal
|
|
2628
|
+
}
|
|
2629
|
+
// 5. Dispatch native hook event (best effort)
|
|
2630
|
+
try {
|
|
2631
|
+
const durationMs = sessionStartedAt
|
|
2632
|
+
? Date.now() - new Date(sessionStartedAt).getTime()
|
|
2633
|
+
: undefined;
|
|
2634
|
+
const normalizedEvent = process.exitCode && process.exitCode !== 0 ? "failed" : "finished";
|
|
2635
|
+
const errorSummary = normalizedEvent === "failed"
|
|
2636
|
+
? `codex exited with code ${process.exitCode}`
|
|
2637
|
+
: undefined;
|
|
2638
|
+
await emitNativeHookEvent(cwd, "session-end", {
|
|
2639
|
+
session_id: sessionId,
|
|
2640
|
+
context: buildNativeHookBaseContext(cwd, sessionId, normalizedEvent, {
|
|
2641
|
+
project_path: cwd,
|
|
2642
|
+
project_name: basename(cwd),
|
|
2643
|
+
duration_ms: durationMs,
|
|
2644
|
+
reason: "session_exit",
|
|
2645
|
+
status: normalizedEvent === "failed" ? "failed" : "finished",
|
|
2646
|
+
...(process.exitCode !== undefined
|
|
2647
|
+
? { exit_code: process.exitCode }
|
|
2648
|
+
: {}),
|
|
2649
|
+
...(errorSummary ? { error_summary: errorSummary } : {}),
|
|
2650
|
+
}),
|
|
2651
|
+
});
|
|
2652
|
+
}
|
|
2653
|
+
catch (err) {
|
|
2654
|
+
logCliOperationFailure(err);
|
|
2655
|
+
// Non-fatal
|
|
2656
|
+
}
|
|
2657
|
+
}
|
|
2658
|
+
export async function runDetachedSessionPostLaunch(cwd, sessionId, codexHomeOverride, projectLocalCodexHomeForCleanup, runtimeCodexHomeForCleanup) {
|
|
2659
|
+
await postLaunch(cwd, sessionId, codexHomeOverride, false, projectLocalCodexHomeForCleanup);
|
|
2660
|
+
await cleanupRuntimeCodexHome(runtimeCodexHomeForCleanup).catch(logCliOperationFailure);
|
|
2661
|
+
}
|
|
2662
|
+
async function emitNativeHookEvent(cwd, event, opts = {}) {
|
|
2663
|
+
const payload = buildHookEvent(event, {
|
|
2664
|
+
source: "native",
|
|
2665
|
+
context: opts.context || {},
|
|
2666
|
+
session_id: opts.session_id,
|
|
2667
|
+
thread_id: opts.thread_id,
|
|
2668
|
+
turn_id: opts.turn_id,
|
|
2669
|
+
mode: opts.mode,
|
|
2670
|
+
});
|
|
2671
|
+
await dispatchHookEvent(payload, {
|
|
2672
|
+
cwd,
|
|
2673
|
+
enabled: true,
|
|
2674
|
+
});
|
|
2675
|
+
}
|
|
2676
|
+
function notifyFallbackPidPath(cwd) {
|
|
2677
|
+
return join(cwd, ".rcs", "state", "notify-fallback.pid");
|
|
2678
|
+
}
|
|
2679
|
+
function hookDerivedWatcherPidPath(cwd) {
|
|
2680
|
+
return join(cwd, ".rcs", "state", "hook-derived-watcher.pid");
|
|
2681
|
+
}
|
|
2682
|
+
export function shouldDetachBackgroundHelper(env = process.env, platform = process.platform) {
|
|
2683
|
+
// The long-running watcher/helper itself must stay detached so it can
|
|
2684
|
+
// survive parent loss. Windows Git Bash/MSYS uses a short hidden bootstrap
|
|
2685
|
+
// process so the detached helper is created without stealing focus.
|
|
2686
|
+
void env;
|
|
2687
|
+
void platform;
|
|
2688
|
+
return true;
|
|
2689
|
+
}
|
|
2690
|
+
export function resolveBackgroundHelperLaunchMode(env = process.env, platform = process.platform) {
|
|
2691
|
+
return platform === "win32" && isMsysOrGitBash(env, platform)
|
|
2692
|
+
? "windows-msys-bootstrap"
|
|
2693
|
+
: "direct-detached";
|
|
2694
|
+
}
|
|
2695
|
+
export function buildWindowsMsysBackgroundHelperBootstrapScript(helperArgs, cwd) {
|
|
2696
|
+
const helperArgsLiteral = JSON.stringify(helperArgs);
|
|
2697
|
+
const cwdLiteral = JSON.stringify(cwd);
|
|
2698
|
+
return [
|
|
2699
|
+
"const fs = require('fs');",
|
|
2700
|
+
"const { spawn } = require('child_process');",
|
|
2701
|
+
`const child = spawn(process.execPath, ${helperArgsLiteral}, { cwd: ${cwdLiteral}, detached: true, stdio: 'ignore', windowsHide: true, env: process.env });`,
|
|
2702
|
+
"if (!child.pid) process.exit(1);",
|
|
2703
|
+
"child.unref();",
|
|
2704
|
+
"fs.writeSync(1, String(child.pid));",
|
|
2705
|
+
"process.exit(0);",
|
|
2706
|
+
].join("");
|
|
2707
|
+
}
|
|
2708
|
+
async function launchBackgroundHelper(helperArgs, options) {
|
|
2709
|
+
const launchMode = resolveBackgroundHelperLaunchMode(options.env, process.platform);
|
|
2710
|
+
if (launchMode === "windows-msys-bootstrap") {
|
|
2711
|
+
const { spawnSync } = await import("child_process");
|
|
2712
|
+
const bootstrap = spawnSync(process.execPath, [
|
|
2713
|
+
"-e",
|
|
2714
|
+
buildWindowsMsysBackgroundHelperBootstrapScript(helperArgs, options.cwd),
|
|
2715
|
+
], {
|
|
2716
|
+
cwd: options.cwd,
|
|
2717
|
+
encoding: "utf-8",
|
|
2718
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
2719
|
+
windowsHide: true,
|
|
2720
|
+
env: options.env,
|
|
2721
|
+
});
|
|
2722
|
+
if (bootstrap.error && (bootstrap.status ?? 1) !== 0) {
|
|
2723
|
+
throw bootstrap.error;
|
|
2724
|
+
}
|
|
2725
|
+
if (bootstrap.status !== 0) {
|
|
2726
|
+
const detail = (bootstrap.stderr || bootstrap.stdout || "").trim();
|
|
2727
|
+
throw new Error(detail || `background helper bootstrap exited ${bootstrap.status}`);
|
|
2728
|
+
}
|
|
2729
|
+
const helperPid = Number.parseInt((bootstrap.stdout || "").trim(), 10);
|
|
2730
|
+
return Number.isFinite(helperPid) && helperPid > 0
|
|
2731
|
+
? helperPid
|
|
2732
|
+
: undefined;
|
|
2733
|
+
}
|
|
2734
|
+
const child = spawn(process.execPath, helperArgs, {
|
|
2735
|
+
cwd: options.cwd,
|
|
2736
|
+
detached: shouldDetachBackgroundHelper(options.env, process.platform),
|
|
2737
|
+
stdio: "ignore",
|
|
2738
|
+
windowsHide: true,
|
|
2739
|
+
env: options.env,
|
|
2740
|
+
});
|
|
2741
|
+
child.unref();
|
|
2742
|
+
return child.pid;
|
|
2743
|
+
}
|
|
2744
|
+
function parseWatcherPidFile(content) {
|
|
2745
|
+
const trimmed = content.trim();
|
|
2746
|
+
if (!trimmed)
|
|
2747
|
+
return null;
|
|
2748
|
+
try {
|
|
2749
|
+
const parsed = JSON.parse(trimmed);
|
|
2750
|
+
if (typeof parsed === "number") {
|
|
2751
|
+
return Number.isFinite(parsed) && parsed > 0 ? parsed : null;
|
|
2752
|
+
}
|
|
2753
|
+
const pid = typeof parsed === "object" && parsed !== null
|
|
2754
|
+
? parsed.pid
|
|
2755
|
+
: undefined;
|
|
2756
|
+
return typeof pid === "number" && Number.isFinite(pid) && pid > 0 ? pid : null;
|
|
2757
|
+
}
|
|
2758
|
+
catch {
|
|
2759
|
+
const pid = Number.parseInt(trimmed, 10);
|
|
2760
|
+
return Number.isFinite(pid) && pid > 0 ? pid : null;
|
|
2761
|
+
}
|
|
2762
|
+
}
|
|
2763
|
+
function parseWatcherPidRecord(content) {
|
|
2764
|
+
const trimmed = content.trim();
|
|
2765
|
+
if (!trimmed)
|
|
2766
|
+
return null;
|
|
2767
|
+
try {
|
|
2768
|
+
const parsed = JSON.parse(trimmed);
|
|
2769
|
+
if (typeof parsed === "object" && parsed !== null) {
|
|
2770
|
+
const { pid, started_at: startedAtRaw } = parsed;
|
|
2771
|
+
if (typeof pid === "number" && Number.isFinite(pid) && pid > 0) {
|
|
2772
|
+
return {
|
|
2773
|
+
pid,
|
|
2774
|
+
startedAt: typeof startedAtRaw === "string" ? startedAtRaw : null,
|
|
2775
|
+
};
|
|
2776
|
+
}
|
|
2777
|
+
}
|
|
2778
|
+
}
|
|
2779
|
+
catch {
|
|
2780
|
+
}
|
|
2781
|
+
const pid = parseWatcherPidFile(trimmed);
|
|
2782
|
+
return pid ? { pid, startedAt: null } : null;
|
|
2783
|
+
}
|
|
2784
|
+
function isLikelyRcsWatcherProcess(pid, execFileSyncFn = execFileSync, platform = process.platform) {
|
|
2785
|
+
if (platform === "win32") {
|
|
2786
|
+
// ps is unavailable on native Windows; fall back to unconditional reap
|
|
2787
|
+
// to preserve the pre-identity-check behavior on opted-in Windows hosts.
|
|
2788
|
+
return true;
|
|
2789
|
+
}
|
|
2790
|
+
try {
|
|
2791
|
+
const cmd = execFileSyncFn("ps", ["-p", String(pid), "-o", "command="], {
|
|
2792
|
+
encoding: "utf-8",
|
|
2793
|
+
timeout: 2000,
|
|
2794
|
+
windowsHide: true,
|
|
2795
|
+
});
|
|
2796
|
+
return cmd.includes("notify-fallback-watcher") || cmd.includes("hook-derived-watcher");
|
|
2797
|
+
}
|
|
2798
|
+
catch {
|
|
2799
|
+
return false;
|
|
2800
|
+
}
|
|
2801
|
+
}
|
|
2802
|
+
export async function reapStaleNotifyFallbackWatcher(pidPath, deps = {}) {
|
|
2803
|
+
const exists = deps.exists ?? existsSync;
|
|
2804
|
+
if (!exists(pidPath))
|
|
2805
|
+
return;
|
|
2806
|
+
const { readFile } = await import("fs/promises");
|
|
2807
|
+
const readFileImpl = deps.readFile ?? readFile;
|
|
2808
|
+
const tryKillPidImpl = deps.tryKillPid ?? tryKillPid;
|
|
2809
|
+
const hasErrnoCodeImpl = deps.hasErrnoCode ?? hasErrnoCode;
|
|
2810
|
+
const warn = deps.warn ?? console.warn;
|
|
2811
|
+
const isWatcherProcessImpl = deps.isWatcherProcess ?? isLikelyRcsWatcherProcess;
|
|
2812
|
+
try {
|
|
2813
|
+
const record = parseWatcherPidRecord(await readFileImpl(pidPath, "utf-8"));
|
|
2814
|
+
if (record && isWatcherProcessImpl(record.pid)) {
|
|
2815
|
+
tryKillPidImpl(record.pid, "SIGTERM");
|
|
2816
|
+
}
|
|
2817
|
+
}
|
|
2818
|
+
catch (error) {
|
|
2819
|
+
if (!hasErrnoCodeImpl(error, "ESRCH")) {
|
|
2820
|
+
warn("[rcs] warning: failed to stop stale notify fallback watcher", {
|
|
2821
|
+
path: pidPath,
|
|
2822
|
+
error: error instanceof Error ? error.message : String(error),
|
|
2823
|
+
});
|
|
2824
|
+
}
|
|
2825
|
+
}
|
|
2826
|
+
}
|
|
2827
|
+
function tryKillPid(pid, signal = "SIGTERM") {
|
|
2828
|
+
try {
|
|
2829
|
+
process.kill(pid, signal);
|
|
2830
|
+
return true;
|
|
2831
|
+
}
|
|
2832
|
+
catch (error) {
|
|
2833
|
+
const code = error.code;
|
|
2834
|
+
if (code === "ESRCH")
|
|
2835
|
+
return false;
|
|
2836
|
+
throw error;
|
|
2837
|
+
}
|
|
2838
|
+
}
|
|
2839
|
+
async function startNotifyFallbackWatcher(cwd, options = {}) {
|
|
2840
|
+
const { mkdir, writeFile } = await import("fs/promises");
|
|
2841
|
+
const pidPath = notifyFallbackPidPath(cwd);
|
|
2842
|
+
await reapStaleNotifyFallbackWatcher(pidPath);
|
|
2843
|
+
if (!shouldEnableNotifyFallbackWatcher(process.env, process.platform))
|
|
2844
|
+
return;
|
|
2845
|
+
const pkgRoot = getPackageRoot();
|
|
2846
|
+
const watcherScript = resolveNotifyFallbackWatcherScript(pkgRoot);
|
|
2847
|
+
const notifyScript = resolveNotifyHookScript(pkgRoot);
|
|
2848
|
+
if (!existsSync(watcherScript) || !existsSync(notifyScript))
|
|
2849
|
+
return;
|
|
2850
|
+
await mkdir(join(cwd, ".rcs", "state"), { recursive: true }).catch((error) => {
|
|
2851
|
+
console.warn("[rcs] warning: failed to create notify fallback watcher state directory", {
|
|
2852
|
+
cwd,
|
|
2853
|
+
error: error instanceof Error ? error.message : String(error),
|
|
2854
|
+
});
|
|
2855
|
+
});
|
|
2856
|
+
const watcherEnv = buildNotifyFallbackWatcherEnv(process.env, {
|
|
2857
|
+
codexHomeOverride: options.codexHomeOverride,
|
|
2858
|
+
enableAuthority: options.enableAuthority === true,
|
|
2859
|
+
sessionId: options.sessionId,
|
|
2860
|
+
});
|
|
2861
|
+
let watcherPid;
|
|
2862
|
+
try {
|
|
2863
|
+
watcherPid = await launchBackgroundHelper([
|
|
2864
|
+
watcherScript,
|
|
2865
|
+
"--cwd",
|
|
2866
|
+
cwd,
|
|
2867
|
+
"--notify-script",
|
|
2868
|
+
notifyScript,
|
|
2869
|
+
"--pid-file",
|
|
2870
|
+
pidPath,
|
|
2871
|
+
"--parent-pid",
|
|
2872
|
+
String(process.pid),
|
|
2873
|
+
...(process.env.RCS_NOTIFY_FALLBACK_MAX_LIFETIME_MS
|
|
2874
|
+
? [
|
|
2875
|
+
"--max-lifetime-ms",
|
|
2876
|
+
process.env.RCS_NOTIFY_FALLBACK_MAX_LIFETIME_MS,
|
|
2877
|
+
]
|
|
2878
|
+
: []),
|
|
2879
|
+
], {
|
|
2880
|
+
cwd,
|
|
2881
|
+
env: watcherEnv,
|
|
2882
|
+
});
|
|
2883
|
+
}
|
|
2884
|
+
catch (error) {
|
|
2885
|
+
console.warn("[rcs] warning: failed to launch notify fallback watcher", {
|
|
2886
|
+
cwd,
|
|
2887
|
+
error: error instanceof Error ? error.message : String(error),
|
|
2888
|
+
});
|
|
2889
|
+
return;
|
|
2890
|
+
}
|
|
2891
|
+
if (!watcherPid)
|
|
2892
|
+
return;
|
|
2893
|
+
await writeFile(pidPath, JSON.stringify({ pid: watcherPid, started_at: new Date().toISOString() }, null, 2)).catch((error) => {
|
|
2894
|
+
console.warn("[rcs] warning: failed to write notify fallback watcher pid file", {
|
|
2895
|
+
path: pidPath,
|
|
2896
|
+
error: error instanceof Error ? error.message : String(error),
|
|
2897
|
+
});
|
|
2898
|
+
});
|
|
2899
|
+
}
|
|
2900
|
+
async function startHookDerivedWatcher(cwd) {
|
|
2901
|
+
if (process.env.RCS_HOOK_DERIVED_SIGNALS !== "1")
|
|
2902
|
+
return;
|
|
2903
|
+
const { mkdir, writeFile, readFile } = await import("fs/promises");
|
|
2904
|
+
const pidPath = hookDerivedWatcherPidPath(cwd);
|
|
2905
|
+
const pkgRoot = getPackageRoot();
|
|
2906
|
+
const watcherScript = resolveHookDerivedWatcherScript(pkgRoot);
|
|
2907
|
+
if (!existsSync(watcherScript))
|
|
2908
|
+
return;
|
|
2909
|
+
if (existsSync(pidPath)) {
|
|
2910
|
+
try {
|
|
2911
|
+
const prev = JSON.parse(await readFile(pidPath, "utf-8"));
|
|
2912
|
+
if (prev && typeof prev.pid === "number") {
|
|
2913
|
+
process.kill(prev.pid, "SIGTERM");
|
|
2914
|
+
}
|
|
2915
|
+
}
|
|
2916
|
+
catch (error) {
|
|
2917
|
+
console.warn("[rcs] warning: failed to stop stale hook-derived watcher", {
|
|
2918
|
+
path: pidPath,
|
|
2919
|
+
error: error instanceof Error ? error.message : String(error),
|
|
2920
|
+
});
|
|
2921
|
+
}
|
|
2922
|
+
}
|
|
2923
|
+
await mkdir(join(cwd, ".rcs", "state"), { recursive: true }).catch((error) => {
|
|
2924
|
+
console.warn("[rcs] warning: failed to create hook-derived watcher state directory", {
|
|
2925
|
+
cwd,
|
|
2926
|
+
error: error instanceof Error ? error.message : String(error),
|
|
2927
|
+
});
|
|
2928
|
+
});
|
|
2929
|
+
let watcherPid;
|
|
2930
|
+
try {
|
|
2931
|
+
watcherPid = await launchBackgroundHelper([watcherScript, "--cwd", cwd], {
|
|
2932
|
+
cwd,
|
|
2933
|
+
env: process.env,
|
|
2934
|
+
});
|
|
2935
|
+
}
|
|
2936
|
+
catch (error) {
|
|
2937
|
+
console.warn("[rcs] warning: failed to launch hook-derived watcher", {
|
|
2938
|
+
cwd,
|
|
2939
|
+
error: error instanceof Error ? error.message : String(error),
|
|
2940
|
+
});
|
|
2941
|
+
return;
|
|
2942
|
+
}
|
|
2943
|
+
if (!watcherPid)
|
|
2944
|
+
return;
|
|
2945
|
+
await writeFile(pidPath, JSON.stringify({ pid: watcherPid, started_at: new Date().toISOString() }, null, 2)).catch((error) => {
|
|
2946
|
+
console.warn("[rcs] warning: failed to write hook-derived watcher pid file", {
|
|
2947
|
+
path: pidPath,
|
|
2948
|
+
error: error instanceof Error ? error.message : String(error),
|
|
2949
|
+
});
|
|
2950
|
+
});
|
|
2951
|
+
}
|
|
2952
|
+
async function stopNotifyFallbackWatcher(cwd) {
|
|
2953
|
+
const { readFile, unlink } = await import("fs/promises");
|
|
2954
|
+
const pidPath = notifyFallbackPidPath(cwd);
|
|
2955
|
+
if (!existsSync(pidPath))
|
|
2956
|
+
return;
|
|
2957
|
+
try {
|
|
2958
|
+
const pid = parseWatcherPidFile(await readFile(pidPath, "utf-8"));
|
|
2959
|
+
if (pid) {
|
|
2960
|
+
tryKillPid(pid, "SIGTERM");
|
|
2961
|
+
}
|
|
2962
|
+
}
|
|
2963
|
+
catch (error) {
|
|
2964
|
+
if (!hasErrnoCode(error, "ESRCH")) {
|
|
2965
|
+
console.warn("[rcs] warning: failed to stop notify fallback watcher process", {
|
|
2966
|
+
path: pidPath,
|
|
2967
|
+
error: error instanceof Error ? error.message : String(error),
|
|
2968
|
+
});
|
|
2969
|
+
}
|
|
2970
|
+
}
|
|
2971
|
+
await unlink(pidPath).catch((error) => {
|
|
2972
|
+
console.warn("[rcs] warning: failed to remove notify fallback watcher pid file", {
|
|
2973
|
+
path: pidPath,
|
|
2974
|
+
error: error instanceof Error ? error.message : String(error),
|
|
2975
|
+
});
|
|
2976
|
+
});
|
|
2977
|
+
}
|
|
2978
|
+
async function stopHookDerivedWatcher(cwd) {
|
|
2979
|
+
const { readFile, unlink } = await import("fs/promises");
|
|
2980
|
+
const pidPath = hookDerivedWatcherPidPath(cwd);
|
|
2981
|
+
if (!existsSync(pidPath))
|
|
2982
|
+
return;
|
|
2983
|
+
try {
|
|
2984
|
+
const parsed = JSON.parse(await readFile(pidPath, "utf-8"));
|
|
2985
|
+
if (parsed && typeof parsed.pid === "number") {
|
|
2986
|
+
process.kill(parsed.pid, "SIGTERM");
|
|
2987
|
+
}
|
|
2988
|
+
}
|
|
2989
|
+
catch (error) {
|
|
2990
|
+
console.warn("[rcs] warning: failed to stop hook-derived watcher process", {
|
|
2991
|
+
path: pidPath,
|
|
2992
|
+
error: error instanceof Error ? error.message : String(error),
|
|
2993
|
+
});
|
|
2994
|
+
}
|
|
2995
|
+
await unlink(pidPath).catch((error) => {
|
|
2996
|
+
console.warn("[rcs] warning: failed to remove hook-derived watcher pid file", {
|
|
2997
|
+
path: pidPath,
|
|
2998
|
+
error: error instanceof Error ? error.message : String(error),
|
|
2999
|
+
});
|
|
3000
|
+
});
|
|
3001
|
+
}
|
|
3002
|
+
async function flushNotifyFallbackOnce(cwd, options = {}) {
|
|
3003
|
+
if (!shouldEnableNotifyFallbackWatcher(process.env, process.platform))
|
|
3004
|
+
return;
|
|
3005
|
+
const { spawnSync } = await import("child_process");
|
|
3006
|
+
const pkgRoot = getPackageRoot();
|
|
3007
|
+
const watcherScript = resolveNotifyFallbackWatcherScript(pkgRoot);
|
|
3008
|
+
const notifyScript = resolveNotifyHookScript(pkgRoot);
|
|
3009
|
+
if (!existsSync(watcherScript) || !existsSync(notifyScript))
|
|
3010
|
+
return;
|
|
3011
|
+
spawnSync(process.execPath, [watcherScript, "--once", "--cwd", cwd, "--notify-script", notifyScript], {
|
|
3012
|
+
cwd,
|
|
3013
|
+
stdio: "ignore",
|
|
3014
|
+
timeout: 3000,
|
|
3015
|
+
windowsHide: true,
|
|
3016
|
+
env: buildNotifyFallbackWatcherEnv(process.env, {
|
|
3017
|
+
codexHomeOverride: options.codexHomeOverride,
|
|
3018
|
+
enableAuthority: options.enableAuthority === true,
|
|
3019
|
+
sessionId: options.sessionId,
|
|
3020
|
+
}),
|
|
3021
|
+
});
|
|
3022
|
+
}
|
|
3023
|
+
async function flushHookDerivedWatcherOnce(cwd) {
|
|
3024
|
+
if (process.env.RCS_HOOK_DERIVED_SIGNALS !== "1")
|
|
3025
|
+
return;
|
|
3026
|
+
const { spawnSync } = await import("child_process");
|
|
3027
|
+
const pkgRoot = getPackageRoot();
|
|
3028
|
+
const watcherScript = resolveHookDerivedWatcherScript(pkgRoot);
|
|
3029
|
+
if (!existsSync(watcherScript))
|
|
3030
|
+
return;
|
|
3031
|
+
spawnSync(process.execPath, [watcherScript, "--once", "--cwd", cwd], {
|
|
3032
|
+
cwd,
|
|
3033
|
+
stdio: "ignore",
|
|
3034
|
+
timeout: 3000,
|
|
3035
|
+
windowsHide: true,
|
|
3036
|
+
env: {
|
|
3037
|
+
...process.env,
|
|
3038
|
+
RCS_HOOK_DERIVED_SIGNALS: "1",
|
|
3039
|
+
},
|
|
3040
|
+
});
|
|
3041
|
+
}
|
|
3042
|
+
async function cancelModes() {
|
|
3043
|
+
const { writeFile, readFile } = await import("fs/promises");
|
|
3044
|
+
const cwd = process.cwd();
|
|
3045
|
+
const nowIso = new Date().toISOString();
|
|
3046
|
+
try {
|
|
3047
|
+
const refs = await listModeStateFilesWithScopePreference(cwd);
|
|
3048
|
+
const states = new Map();
|
|
3049
|
+
for (const ref of refs) {
|
|
3050
|
+
const content = await readFile(ref.path, "utf-8");
|
|
3051
|
+
let parsedState;
|
|
3052
|
+
try {
|
|
3053
|
+
parsedState = JSON.parse(content);
|
|
3054
|
+
}
|
|
3055
|
+
catch (err) {
|
|
3056
|
+
logCliOperationFailure(err);
|
|
3057
|
+
continue;
|
|
3058
|
+
}
|
|
3059
|
+
states.set(ref.mode, {
|
|
3060
|
+
path: ref.path,
|
|
3061
|
+
scope: ref.scope,
|
|
3062
|
+
state: parsedState,
|
|
3063
|
+
});
|
|
3064
|
+
}
|
|
3065
|
+
const changed = new Set();
|
|
3066
|
+
const reported = new Set();
|
|
3067
|
+
const cancelMode = (mode, phase = "cancelled", reportIfWasActive = true) => {
|
|
3068
|
+
const entry = states.get(mode);
|
|
3069
|
+
if (!entry)
|
|
3070
|
+
return;
|
|
3071
|
+
const wasActive = entry.state.active === true;
|
|
3072
|
+
const needsChange = entry.state.active !== false ||
|
|
3073
|
+
entry.state.current_phase !== phase ||
|
|
3074
|
+
typeof entry.state.completed_at !== "string" ||
|
|
3075
|
+
String(entry.state.completed_at).trim() === "";
|
|
3076
|
+
if (!needsChange)
|
|
3077
|
+
return;
|
|
3078
|
+
entry.state.active = false;
|
|
3079
|
+
entry.state.current_phase = phase;
|
|
3080
|
+
entry.state.completed_at = nowIso;
|
|
3081
|
+
entry.state.last_turn_at = nowIso;
|
|
3082
|
+
changed.add(mode);
|
|
3083
|
+
if (reportIfWasActive && wasActive)
|
|
3084
|
+
reported.add(mode);
|
|
3085
|
+
};
|
|
3086
|
+
const ralphLinksUltrawork = (state) => state.linked_ultrawork === true || state.linked_mode === "ultrawork";
|
|
3087
|
+
const ralph = states.get("ralph");
|
|
3088
|
+
const hadActiveRalph = !!(ralph && ralph.state.active === true);
|
|
3089
|
+
if (ralph && ralph.state.active === true) {
|
|
3090
|
+
cancelMode("ralph", "cancelled", true);
|
|
3091
|
+
if (ralphLinksUltrawork(ralph.state))
|
|
3092
|
+
cancelMode("ultrawork", "cancelled", true);
|
|
3093
|
+
}
|
|
3094
|
+
if (!hadActiveRalph) {
|
|
3095
|
+
for (const [mode, entry] of states.entries()) {
|
|
3096
|
+
if (entry.state.active === true)
|
|
3097
|
+
cancelMode(mode, "cancelled", true);
|
|
3098
|
+
}
|
|
3099
|
+
}
|
|
3100
|
+
for (const [mode, entry] of states.entries()) {
|
|
3101
|
+
if (!changed.has(mode))
|
|
3102
|
+
continue;
|
|
3103
|
+
await writeFile(entry.path, JSON.stringify(entry.state, null, 2));
|
|
3104
|
+
}
|
|
3105
|
+
for (const mode of reported) {
|
|
3106
|
+
writeStdoutLine(`Cancelled: ${mode}`);
|
|
3107
|
+
}
|
|
3108
|
+
if (reported.size === 0) {
|
|
3109
|
+
writeStdoutLine("No active modes to cancel.");
|
|
3110
|
+
}
|
|
3111
|
+
}
|
|
3112
|
+
catch (err) {
|
|
3113
|
+
logCliOperationFailure(err);
|
|
3114
|
+
writeStdoutLine("No active modes to cancel.");
|
|
3115
|
+
}
|
|
3116
|
+
}
|
|
3117
|
+
//# sourceMappingURL=index.js.map
|