@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,2531 @@
|
|
|
1
|
+
import { execFileSync } from "child_process";
|
|
2
|
+
import { closeSync, existsSync, openSync, readFileSync, readSync } from "fs";
|
|
3
|
+
import { mkdir, readFile, readdir, writeFile } from "fs/promises";
|
|
4
|
+
import { join, relative, resolve } from "path";
|
|
5
|
+
import { pathToFileURL } from "url";
|
|
6
|
+
import { readModeState, readModeStateForSession, updateModeState } from "../modes/base.js";
|
|
7
|
+
import {
|
|
8
|
+
listActiveSkills,
|
|
9
|
+
readVisibleSkillActiveState,
|
|
10
|
+
} from "../state/skill-active.js";
|
|
11
|
+
import {
|
|
12
|
+
readSubagentSessionSummary,
|
|
13
|
+
recordSubagentTurnForSession,
|
|
14
|
+
} from "../subagents/tracker.js";
|
|
15
|
+
import { resolveCanonicalTeamStateRoot, resolveWorkerNotifyTeamStateRootPath } from "../team/state-root.js";
|
|
16
|
+
import {
|
|
17
|
+
appendToLog,
|
|
18
|
+
isSessionStateUsable,
|
|
19
|
+
readSessionState,
|
|
20
|
+
readUsableSessionState,
|
|
21
|
+
reconcileNativeSessionStart,
|
|
22
|
+
type SessionState,
|
|
23
|
+
} from "../hooks/session.js";
|
|
24
|
+
import {
|
|
25
|
+
appendTeamEvent,
|
|
26
|
+
readTeamLeaderAttention,
|
|
27
|
+
readTeamManifestV2,
|
|
28
|
+
readTeamPhase,
|
|
29
|
+
writeTeamLeaderAttention,
|
|
30
|
+
writeTeamPhase,
|
|
31
|
+
} from "../team/state.js";
|
|
32
|
+
import { rcsNotepadPath, rcsProjectMemoryPath } from "../utils/paths.js";
|
|
33
|
+
import { findGitLayout } from "../utils/git-layout.js";
|
|
34
|
+
import { getStateFilePath, getStatePath } from "../mcp/state-paths.js";
|
|
35
|
+
import {
|
|
36
|
+
detectKeywords,
|
|
37
|
+
detectPrimaryKeyword,
|
|
38
|
+
recordSkillActivation,
|
|
39
|
+
type SkillActiveState,
|
|
40
|
+
} from "../hooks/keyword-detector.js";
|
|
41
|
+
import {
|
|
42
|
+
detectNativeStopStallPattern,
|
|
43
|
+
loadAutoNudgeConfig,
|
|
44
|
+
normalizeAutoNudgeSignatureText,
|
|
45
|
+
resolveEffectiveAutoNudgeResponse,
|
|
46
|
+
} from "./notify-hook/auto-nudge.js";
|
|
47
|
+
import {
|
|
48
|
+
buildNativePostToolUseOutput,
|
|
49
|
+
buildNativePreToolUseOutput,
|
|
50
|
+
detectMcpTransportFailure,
|
|
51
|
+
} from "./codex-native-pre-post.js";
|
|
52
|
+
import { handleTeamWorkerPostToolUseSuccess } from "./notify-hook/team-worker-posttooluse.js";
|
|
53
|
+
import {
|
|
54
|
+
resolveCodexExecutionSurface,
|
|
55
|
+
type CodexLauncherKind,
|
|
56
|
+
type CodexTransportKind,
|
|
57
|
+
} from "./codex-execution-surface.js";
|
|
58
|
+
import {
|
|
59
|
+
buildNativeHookEvent,
|
|
60
|
+
} from "../hooks/extensibility/events.js";
|
|
61
|
+
import type { HookEventEnvelope } from "../hooks/extensibility/types.js";
|
|
62
|
+
import { dispatchHookEvent } from "../hooks/extensibility/dispatcher.js";
|
|
63
|
+
import { reconcileHudForPromptSubmit } from "../hud/reconcile.js";
|
|
64
|
+
import { onSessionStart as buildWikiSessionStartContext } from "../wiki/lifecycle.js";
|
|
65
|
+
import { readAutoresearchCompletionStatus, readAutoresearchModeState } from "../autoresearch/skill-validation.js";
|
|
66
|
+
import { readRunState } from "../runtime/run-state.js";
|
|
67
|
+
import { getRunContinuationSnapshot, shouldContinueRun } from "../runtime/run-loop.js";
|
|
68
|
+
import { triagePrompt } from "../hooks/triage-heuristic.js";
|
|
69
|
+
import { readTriageConfig } from "../hooks/triage-config.js";
|
|
70
|
+
import {
|
|
71
|
+
readTriageState,
|
|
72
|
+
writeTriageState,
|
|
73
|
+
shouldSuppressFollowup,
|
|
74
|
+
promptSignature,
|
|
75
|
+
type TriageStateFile,
|
|
76
|
+
} from "../hooks/triage-state.js";
|
|
77
|
+
import {
|
|
78
|
+
isPendingDeepInterviewQuestionEnforcement,
|
|
79
|
+
reconcileDeepInterviewQuestionEnforcementFromAnsweredRecords,
|
|
80
|
+
} from "../question/deep-interview.js";
|
|
81
|
+
import {
|
|
82
|
+
buildDocumentRefreshAdvisoryOutput,
|
|
83
|
+
evaluateFinalHandoffDocumentRefresh,
|
|
84
|
+
isFinalHandoffDocumentRefreshCandidate,
|
|
85
|
+
} from "../document-refresh/enforcer.js";
|
|
86
|
+
import { buildExecFollowupStopOutput } from "../exec/followup.js";
|
|
87
|
+
|
|
88
|
+
type CodexHookEventName =
|
|
89
|
+
| "SessionStart"
|
|
90
|
+
| "PreToolUse"
|
|
91
|
+
| "PostToolUse"
|
|
92
|
+
| "UserPromptSubmit"
|
|
93
|
+
| "Stop";
|
|
94
|
+
|
|
95
|
+
type CodexHookPayload = Record<string, unknown>;
|
|
96
|
+
|
|
97
|
+
interface NativeHookDispatchOptions {
|
|
98
|
+
cwd?: string;
|
|
99
|
+
sessionOwnerPid?: number;
|
|
100
|
+
reconcileHudForPromptSubmitFn?: typeof reconcileHudForPromptSubmit;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface NativeHookDispatchResult {
|
|
104
|
+
hookEventName: CodexHookEventName | null;
|
|
105
|
+
rcsEventName: string | null;
|
|
106
|
+
skillState: SkillActiveState | null;
|
|
107
|
+
outputJson: Record<string, unknown> | null;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const TERMINAL_MODE_PHASES = new Set(["complete", "completed", "failed", "cancelled"]);
|
|
111
|
+
const SKILL_STOP_BLOCKERS = new Set(["ralplan"]);
|
|
112
|
+
const TEAM_TERMINAL_TASK_STATUSES = new Set(["completed", "failed"]);
|
|
113
|
+
const TEAM_WORKER_STOP_ACTIVE_STATES = new Set(["working", "blocked"]);
|
|
114
|
+
const NATIVE_STOP_STATE_FILE = "native-stop-state.json";
|
|
115
|
+
const STABLE_FINAL_RECOMMENDATION_PATTERNS = [
|
|
116
|
+
/^\s*(?:launch|release|ship)-?ready\s*:\s*(?:yes|no)\b[^\n\r]*/im,
|
|
117
|
+
/^\s*ready to release\s*:\s*(?:yes|no)\b[^\n\r]*/im,
|
|
118
|
+
/^\s*(?:final\s+)?recommendation\s*:\s*(?:yes|no|ship|hold|release|do not release|proceed|do not proceed)\b[^\n\r]*/im,
|
|
119
|
+
/^\s*decision\s*:\s*(?:yes|no|ship|hold|release|do not release|proceed|do not proceed)\b[^\n\r]*/im,
|
|
120
|
+
] as const;
|
|
121
|
+
const RELEASE_READINESS_FINALIZE_SYSTEM_MESSAGE =
|
|
122
|
+
"RCS release-readiness detected a stable final recommendation with no active worker tasks; emit one concise final decision summary and finalize.";
|
|
123
|
+
const EXECUTION_HANDOFF_PATTERNS = [
|
|
124
|
+
/^(?:好|好的|行|可以|那就|那现在)?[,,\s]*(?:开始|继续|直接)\s*(?:执行|优化|实现|修改|修复)(?=$|\s|[,,。.!!??])/u,
|
|
125
|
+
/(?:按照|按|基于)(?:这个|上述|当前)?\s*(?:plan|计划|方案).{0,16}(?:开始|继续|直接)?\s*(?:执行|优化|实现|修改|修复)/u,
|
|
126
|
+
/(?:不用|别|不要).{0,6}讨论/u,
|
|
127
|
+
/\b(?:start|begin|go ahead(?: and)?|proceed(?: now)?)\s+(?:to\s+)?(?:implement|execute|apply|fix)\b/i,
|
|
128
|
+
/\b(?:according to|based on)\s+(?:the|this|that)\s+plan\b.{0,20}\b(?:start|begin|proceed(?: now)?|go ahead(?: and)?)\b/i,
|
|
129
|
+
] as const;
|
|
130
|
+
const SHORT_FOLLOWUP_PRIORITY_PATTERNS = [
|
|
131
|
+
/^(?:继续|接着|然后|那就|那现在|还有(?:一个)?问题|这些优化都做了么|这些都做了么|现在呢|本轮|当前轮|这一轮)/u,
|
|
132
|
+
/(?:按照|按|基于)(?:这个|上述|当前)?(?:plan|计划|方案)/u,
|
|
133
|
+
/\b(?:follow up|latest request|this turn|current turn|newest request)\b/i,
|
|
134
|
+
] as const;
|
|
135
|
+
const MAX_SESSION_META_LINE_BYTES = 256 * 1024;
|
|
136
|
+
|
|
137
|
+
function safeString(value: unknown): string {
|
|
138
|
+
return typeof value === "string" ? value : "";
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function safeObject(value: unknown): Record<string, unknown> {
|
|
142
|
+
return value && typeof value === "object" ? value as Record<string, unknown> : {};
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
interface NativeSubagentSessionStartMetadata {
|
|
146
|
+
parentThreadId: string;
|
|
147
|
+
agentNickname?: string;
|
|
148
|
+
agentRole?: string;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function readBoundedFirstLineSync(path: string): string {
|
|
152
|
+
const fd = openSync(path, "r");
|
|
153
|
+
try {
|
|
154
|
+
const chunks: Buffer[] = [];
|
|
155
|
+
const buffer = Buffer.alloc(Math.min(8192, MAX_SESSION_META_LINE_BYTES));
|
|
156
|
+
let totalBytesRead = 0;
|
|
157
|
+
|
|
158
|
+
while (totalBytesRead < MAX_SESSION_META_LINE_BYTES) {
|
|
159
|
+
const bytesToRead = Math.min(buffer.length, MAX_SESSION_META_LINE_BYTES - totalBytesRead);
|
|
160
|
+
const bytesRead = readSync(fd, buffer, 0, bytesToRead, totalBytesRead);
|
|
161
|
+
if (bytesRead <= 0) break;
|
|
162
|
+
|
|
163
|
+
totalBytesRead += bytesRead;
|
|
164
|
+
const chunk = buffer.subarray(0, bytesRead);
|
|
165
|
+
const newlineOffset = chunk.indexOf(0x0a);
|
|
166
|
+
if (newlineOffset >= 0) {
|
|
167
|
+
chunks.push(Buffer.from(chunk.subarray(0, newlineOffset)));
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
chunks.push(Buffer.from(chunk));
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return Buffer.concat(chunks).toString("utf-8").replace(/\r$/, "");
|
|
174
|
+
} finally {
|
|
175
|
+
closeSync(fd);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function readNativeSubagentSessionStartMetadata(transcriptPath: string): NativeSubagentSessionStartMetadata | null {
|
|
180
|
+
const normalizedPath = transcriptPath.trim();
|
|
181
|
+
if (!normalizedPath) return null;
|
|
182
|
+
|
|
183
|
+
try {
|
|
184
|
+
const firstLine = readBoundedFirstLineSync(normalizedPath).trim();
|
|
185
|
+
if (!firstLine) return null;
|
|
186
|
+
const firstRecord = safeObject(JSON.parse(firstLine));
|
|
187
|
+
if (safeString(firstRecord.type) !== "session_meta") return null;
|
|
188
|
+
|
|
189
|
+
const payload = safeObject(firstRecord.payload);
|
|
190
|
+
const source = safeObject(payload.source);
|
|
191
|
+
const subagent = safeObject(source.subagent);
|
|
192
|
+
const threadSpawn = safeObject(subagent.thread_spawn);
|
|
193
|
+
const parentThreadId = safeString(threadSpawn.parent_thread_id).trim();
|
|
194
|
+
if (!parentThreadId) return null;
|
|
195
|
+
|
|
196
|
+
const agentNickname = safeString(threadSpawn.agent_nickname ?? payload.agent_nickname).trim();
|
|
197
|
+
const agentRole = safeString(threadSpawn.agent_role ?? payload.agent_role).trim();
|
|
198
|
+
return {
|
|
199
|
+
parentThreadId,
|
|
200
|
+
...(agentNickname ? { agentNickname } : {}),
|
|
201
|
+
...(agentRole ? { agentRole } : {}),
|
|
202
|
+
};
|
|
203
|
+
} catch {
|
|
204
|
+
return null;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
async function recordNativeSubagentSessionStart(
|
|
209
|
+
cwd: string,
|
|
210
|
+
canonicalSessionId: string,
|
|
211
|
+
childSessionId: string,
|
|
212
|
+
metadata: NativeSubagentSessionStartMetadata,
|
|
213
|
+
transcriptPath: string,
|
|
214
|
+
): Promise<void> {
|
|
215
|
+
const trackingSessionIds = [...new Set([
|
|
216
|
+
canonicalSessionId.trim(),
|
|
217
|
+
metadata.parentThreadId.trim(),
|
|
218
|
+
].filter(Boolean))];
|
|
219
|
+
for (const sessionId of trackingSessionIds) {
|
|
220
|
+
await recordSubagentTurnForSession(cwd, {
|
|
221
|
+
sessionId,
|
|
222
|
+
threadId: metadata.parentThreadId,
|
|
223
|
+
}).catch(() => {});
|
|
224
|
+
await recordSubagentTurnForSession(cwd, {
|
|
225
|
+
sessionId,
|
|
226
|
+
threadId: childSessionId,
|
|
227
|
+
mode: metadata.agentRole,
|
|
228
|
+
}).catch(() => {});
|
|
229
|
+
}
|
|
230
|
+
await appendToLog(cwd, {
|
|
231
|
+
event: "subagent_session_start",
|
|
232
|
+
session_id: canonicalSessionId,
|
|
233
|
+
native_owner_session_id: metadata.parentThreadId,
|
|
234
|
+
native_session_id: childSessionId,
|
|
235
|
+
parent_thread_id: metadata.parentThreadId,
|
|
236
|
+
...(metadata.agentNickname ? { agent_nickname: metadata.agentNickname } : {}),
|
|
237
|
+
...(metadata.agentRole ? { agent_role: metadata.agentRole } : {}),
|
|
238
|
+
...(transcriptPath ? { transcript_path: transcriptPath } : {}),
|
|
239
|
+
timestamp: new Date().toISOString(),
|
|
240
|
+
}).catch(() => {});
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
async function nativeSubagentSessionStartBelongsToCanonicalSession(
|
|
244
|
+
cwd: string,
|
|
245
|
+
canonicalSessionId: string,
|
|
246
|
+
currentSessionState: SessionState | null,
|
|
247
|
+
metadata: NativeSubagentSessionStartMetadata,
|
|
248
|
+
): Promise<boolean> {
|
|
249
|
+
const parentThreadId = metadata.parentThreadId.trim();
|
|
250
|
+
if (!parentThreadId) return false;
|
|
251
|
+
|
|
252
|
+
const currentNativeSessionId = safeString(currentSessionState?.native_session_id).trim();
|
|
253
|
+
if (currentNativeSessionId && currentNativeSessionId === parentThreadId) {
|
|
254
|
+
return true;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
const summary = await readSubagentSessionSummary(cwd, canonicalSessionId).catch(() => null);
|
|
258
|
+
if (!summary) return false;
|
|
259
|
+
if (summary.leaderThreadId === parentThreadId) return true;
|
|
260
|
+
return summary.allThreadIds.includes(parentThreadId);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
async function recordIgnoredNativeSubagentSessionStart(
|
|
264
|
+
cwd: string,
|
|
265
|
+
canonicalSessionId: string,
|
|
266
|
+
childSessionId: string,
|
|
267
|
+
metadata: NativeSubagentSessionStartMetadata,
|
|
268
|
+
transcriptPath: string,
|
|
269
|
+
): Promise<void> {
|
|
270
|
+
await appendToLog(cwd, {
|
|
271
|
+
event: "subagent_session_start_ignored",
|
|
272
|
+
reason: "parent_not_in_canonical_session",
|
|
273
|
+
session_id: canonicalSessionId,
|
|
274
|
+
native_session_id: childSessionId,
|
|
275
|
+
parent_thread_id: metadata.parentThreadId,
|
|
276
|
+
...(metadata.agentNickname ? { agent_nickname: metadata.agentNickname } : {}),
|
|
277
|
+
...(metadata.agentRole ? { agent_role: metadata.agentRole } : {}),
|
|
278
|
+
...(transcriptPath ? { transcript_path: transcriptPath } : {}),
|
|
279
|
+
timestamp: new Date().toISOString(),
|
|
280
|
+
}).catch(() => {});
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
function safePositiveInteger(value: unknown): number | null {
|
|
284
|
+
if (typeof value === "number" && Number.isInteger(value) && value > 0) return value;
|
|
285
|
+
if (typeof value === "string" && value.trim() !== "") {
|
|
286
|
+
const parsed = Number.parseInt(value.trim(), 10);
|
|
287
|
+
if (Number.isInteger(parsed) && parsed > 0) return parsed;
|
|
288
|
+
}
|
|
289
|
+
return null;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
function normalizePromptSignalText(text: string): string {
|
|
293
|
+
return text.trim().replace(/\s+/g, " ");
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
function looksLikeExecutionHandoffPrompt(prompt: string): boolean {
|
|
297
|
+
const normalized = normalizePromptSignalText(prompt);
|
|
298
|
+
if (!normalized) return false;
|
|
299
|
+
return EXECUTION_HANDOFF_PATTERNS.some((pattern) => pattern.test(normalized));
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
function looksLikeShortFollowupPrompt(prompt: string): boolean {
|
|
303
|
+
const normalized = normalizePromptSignalText(prompt);
|
|
304
|
+
if (!normalized) return false;
|
|
305
|
+
if (looksLikeExecutionHandoffPrompt(normalized)) return true;
|
|
306
|
+
if (normalized.length > 240) return false;
|
|
307
|
+
return SHORT_FOLLOWUP_PRIORITY_PATTERNS.some((pattern) => pattern.test(normalized));
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
function buildPromptPriorityMessage(prompt: string): string | null {
|
|
311
|
+
if (looksLikeExecutionHandoffPrompt(prompt)) {
|
|
312
|
+
return "Newest user input is an execution handoff for the current task. Treat it as authorization to act now against the latest approved plan/request. Do not restate the prior plan unless the user explicitly asks for a recap or status update.";
|
|
313
|
+
}
|
|
314
|
+
if (looksLikeShortFollowupPrompt(prompt)) {
|
|
315
|
+
return "Newest user input is a same-thread follow-up. Answer that latest follow-up directly and prefer it over older unresolved prompts when choosing what to do next.";
|
|
316
|
+
}
|
|
317
|
+
return null;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
function readHookEventName(payload: CodexHookPayload): CodexHookEventName | null {
|
|
321
|
+
const raw = safeString(
|
|
322
|
+
payload.hook_event_name
|
|
323
|
+
?? payload.hookEventName
|
|
324
|
+
?? payload.event
|
|
325
|
+
?? payload.name,
|
|
326
|
+
).trim();
|
|
327
|
+
if (
|
|
328
|
+
raw === "SessionStart"
|
|
329
|
+
|| raw === "PreToolUse"
|
|
330
|
+
|| raw === "PostToolUse"
|
|
331
|
+
|| raw === "UserPromptSubmit"
|
|
332
|
+
|| raw === "Stop"
|
|
333
|
+
) {
|
|
334
|
+
return raw;
|
|
335
|
+
}
|
|
336
|
+
return null;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
export function mapCodexHookEventToRcsEvent(
|
|
340
|
+
hookEventName: CodexHookEventName | null,
|
|
341
|
+
): string | null {
|
|
342
|
+
switch (hookEventName) {
|
|
343
|
+
case "SessionStart":
|
|
344
|
+
return "session-start";
|
|
345
|
+
case "PreToolUse":
|
|
346
|
+
return "pre-tool-use";
|
|
347
|
+
case "PostToolUse":
|
|
348
|
+
return "post-tool-use";
|
|
349
|
+
case "UserPromptSubmit":
|
|
350
|
+
return "keyword-detector";
|
|
351
|
+
case "Stop":
|
|
352
|
+
return "stop";
|
|
353
|
+
default:
|
|
354
|
+
return null;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
function readPromptText(payload: CodexHookPayload): string {
|
|
359
|
+
const candidates = [
|
|
360
|
+
payload.prompt,
|
|
361
|
+
payload.user_prompt,
|
|
362
|
+
payload.userPrompt,
|
|
363
|
+
];
|
|
364
|
+
for (const candidate of candidates) {
|
|
365
|
+
const value = safeString(candidate).trim();
|
|
366
|
+
if (value) return value;
|
|
367
|
+
}
|
|
368
|
+
return "";
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
function sanitizePayloadForHookContext(
|
|
372
|
+
payload: CodexHookPayload,
|
|
373
|
+
hookEventName: CodexHookEventName,
|
|
374
|
+
canonicalSessionId = "",
|
|
375
|
+
): CodexHookPayload {
|
|
376
|
+
const sanitized = { ...payload };
|
|
377
|
+
|
|
378
|
+
if (hookEventName === "UserPromptSubmit") {
|
|
379
|
+
delete sanitized.prompt;
|
|
380
|
+
delete sanitized.input;
|
|
381
|
+
delete sanitized.user_prompt;
|
|
382
|
+
delete sanitized.userPrompt;
|
|
383
|
+
delete sanitized.text;
|
|
384
|
+
return sanitized;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
if (hookEventName === "Stop") {
|
|
388
|
+
delete sanitized.stop_hook_active;
|
|
389
|
+
delete sanitized.stopHookActive;
|
|
390
|
+
delete sanitized.sessionId;
|
|
391
|
+
sanitized.session_id = canonicalSessionId.trim() || safeString(payload.session_id ?? payload.sessionId).trim();
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
return sanitized;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
function buildBaseContext(
|
|
398
|
+
cwd: string,
|
|
399
|
+
payload: CodexHookPayload,
|
|
400
|
+
hookEventName: CodexHookEventName,
|
|
401
|
+
canonicalSessionId = "",
|
|
402
|
+
): Record<string, unknown> {
|
|
403
|
+
return {
|
|
404
|
+
cwd,
|
|
405
|
+
project_path: cwd,
|
|
406
|
+
transcript_path: safeString(payload.transcript_path ?? payload.transcriptPath) || null,
|
|
407
|
+
source: safeString(payload.source),
|
|
408
|
+
payload: sanitizePayloadForHookContext(payload, hookEventName, canonicalSessionId),
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
async function readJsonIfExists(path: string): Promise<Record<string, unknown> | null> {
|
|
413
|
+
if (!existsSync(path)) return null;
|
|
414
|
+
try {
|
|
415
|
+
return JSON.parse(await readFile(path, "utf-8")) as Record<string, unknown>;
|
|
416
|
+
} catch {
|
|
417
|
+
return null;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
function isNonTerminalPhase(value: unknown): boolean {
|
|
422
|
+
const phase = safeString(value).trim().toLowerCase();
|
|
423
|
+
return phase !== "" && !TERMINAL_MODE_PHASES.has(phase);
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
function formatPhase(value: unknown, fallback = "active"): string {
|
|
427
|
+
const phase = safeString(value).trim();
|
|
428
|
+
return phase || fallback;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
async function readActiveAutoresearchState(
|
|
432
|
+
cwd: string,
|
|
433
|
+
sessionId?: string,
|
|
434
|
+
): Promise<Record<string, unknown> | null> {
|
|
435
|
+
const normalizedSessionId = sessionId?.trim() || undefined;
|
|
436
|
+
if (!normalizedSessionId) return null;
|
|
437
|
+
const state = await readAutoresearchModeState(cwd, normalizedSessionId);
|
|
438
|
+
if (state?.active !== true) return null;
|
|
439
|
+
if (!isNonTerminalPhase(state.current_phase ?? state.currentPhase ?? 'executing')) return null;
|
|
440
|
+
return state;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
interface ActiveRalphStopState {
|
|
444
|
+
state: Record<string, unknown>;
|
|
445
|
+
path: string;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
interface RalphStopOwnershipContext {
|
|
449
|
+
sessionId: string;
|
|
450
|
+
payloadSessionId: string;
|
|
451
|
+
threadId: string;
|
|
452
|
+
currentNativeSessionId: string;
|
|
453
|
+
tmuxPaneId: string;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
function isRalphStartingPhase(state: Record<string, unknown>): boolean {
|
|
457
|
+
return safeString(state.current_phase ?? state.currentPhase).trim().toLowerCase() === "starting";
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
function hasValue(values: string[], value: string): boolean {
|
|
461
|
+
return value !== "" && values.some((candidate) => candidate === value);
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
function activeRalphStateMatchesStopOwner(
|
|
465
|
+
state: Record<string, unknown>,
|
|
466
|
+
context: RalphStopOwnershipContext,
|
|
467
|
+
): boolean {
|
|
468
|
+
const ownerRcsSessionId = safeString(state.owner_rcs_session_id).trim();
|
|
469
|
+
if (ownerRcsSessionId && ownerRcsSessionId !== context.sessionId) {
|
|
470
|
+
return false;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
const stateSessionId = safeString(state.session_id).trim();
|
|
474
|
+
if (!ownerRcsSessionId && stateSessionId && stateSessionId !== context.sessionId) {
|
|
475
|
+
return false;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
const codexOwnerSessionId = safeString(state.owner_codex_session_id).trim();
|
|
479
|
+
if (codexOwnerSessionId) {
|
|
480
|
+
const stopCodexSessionIds = [
|
|
481
|
+
context.payloadSessionId,
|
|
482
|
+
context.currentNativeSessionId,
|
|
483
|
+
context.sessionId,
|
|
484
|
+
].filter(Boolean);
|
|
485
|
+
if (!hasValue(stopCodexSessionIds, codexOwnerSessionId)) return false;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
const stateThreadId = safeString(state.owner_codex_thread_id ?? state.thread_id).trim();
|
|
489
|
+
if (stateThreadId && context.threadId && stateThreadId !== context.threadId) {
|
|
490
|
+
return false;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
const statePaneId = safeString(state.tmux_pane_id).trim();
|
|
494
|
+
if (statePaneId && context.tmuxPaneId && statePaneId !== context.tmuxPaneId) {
|
|
495
|
+
return false;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
return true;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
function shouldHonorCanonicalTerminalRunState(
|
|
502
|
+
runState: Record<string, unknown> | null,
|
|
503
|
+
mode: string,
|
|
504
|
+
): boolean {
|
|
505
|
+
if (!runState) return false;
|
|
506
|
+
const runMode = safeString(runState.mode).trim();
|
|
507
|
+
if (runMode && runMode !== mode) return false;
|
|
508
|
+
return getRunContinuationSnapshot(runState)?.terminal === true;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
async function readCanonicalTerminalRunStateForStop(
|
|
512
|
+
cwd: string,
|
|
513
|
+
sessionId: string | undefined,
|
|
514
|
+
mode: string,
|
|
515
|
+
): Promise<Record<string, unknown> | null> {
|
|
516
|
+
if (!safeString(sessionId).trim()) return null;
|
|
517
|
+
const runState = await readRunState(cwd, sessionId).catch(() => null);
|
|
518
|
+
const runRecord = runState as unknown as Record<string, unknown> | null;
|
|
519
|
+
return shouldHonorCanonicalTerminalRunState(runRecord, mode) ? runRecord : null;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
async function isVisibleRalphActiveForSession(cwd: string, sessionId: string): Promise<boolean> {
|
|
523
|
+
const canonicalState = await readVisibleSkillActiveState(cwd, sessionId);
|
|
524
|
+
if (!canonicalState) return false;
|
|
525
|
+
return listActiveSkills(canonicalState).some((entry) => (
|
|
526
|
+
entry.skill === "ralph"
|
|
527
|
+
&& matchesSkillStopContext(entry, canonicalState, sessionId, "")
|
|
528
|
+
));
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
async function readActiveRalphState(
|
|
532
|
+
stateDir: string,
|
|
533
|
+
preferredSessionId?: string,
|
|
534
|
+
ownerContext?: {
|
|
535
|
+
payloadSessionId?: string;
|
|
536
|
+
threadId?: string;
|
|
537
|
+
tmuxPaneId?: string;
|
|
538
|
+
},
|
|
539
|
+
): Promise<ActiveRalphStopState | null> {
|
|
540
|
+
const cwd = resolve(stateDir, "..", "..");
|
|
541
|
+
const [rawSessionInfo, usableSessionInfo] = await Promise.all([
|
|
542
|
+
readSessionState(cwd),
|
|
543
|
+
readUsableSessionState(cwd),
|
|
544
|
+
]);
|
|
545
|
+
const currentRcsSessionId = safeString(usableSessionInfo?.session_id).trim();
|
|
546
|
+
const currentNativeSessionId = safeString(usableSessionInfo?.native_session_id).trim();
|
|
547
|
+
const staleCurrentSessionId = rawSessionInfo && !isSessionStateUsable(rawSessionInfo, cwd)
|
|
548
|
+
? safeString(rawSessionInfo.session_id).trim()
|
|
549
|
+
: "";
|
|
550
|
+
const sessionCandidates = [...new Set([
|
|
551
|
+
safeString(preferredSessionId).trim(),
|
|
552
|
+
currentRcsSessionId,
|
|
553
|
+
].filter(Boolean))];
|
|
554
|
+
|
|
555
|
+
// Ralph Stop stays authoritative-scope-only once the Stop payload is session-bound.
|
|
556
|
+
// That is intentionally stricter than generic state MCP reads: do not scan sibling
|
|
557
|
+
// session scopes or fall back to root when a current/explicit session is in play.
|
|
558
|
+
for (const sessionId of sessionCandidates) {
|
|
559
|
+
if (staleCurrentSessionId && sessionId === staleCurrentSessionId) {
|
|
560
|
+
continue;
|
|
561
|
+
}
|
|
562
|
+
if (await readCanonicalTerminalRunStateForStop(cwd, sessionId, "ralph")) {
|
|
563
|
+
continue;
|
|
564
|
+
}
|
|
565
|
+
const sessionScopedPath = getStateFilePath("ralph-state.json", cwd, sessionId);
|
|
566
|
+
const sessionScoped = await readJsonIfExists(sessionScopedPath);
|
|
567
|
+
if (
|
|
568
|
+
sessionScoped?.active === true
|
|
569
|
+
&& isRalphStartingPhase(sessionScoped)
|
|
570
|
+
&& !(await isVisibleRalphActiveForSession(cwd, sessionId))
|
|
571
|
+
) {
|
|
572
|
+
continue;
|
|
573
|
+
}
|
|
574
|
+
if (
|
|
575
|
+
sessionScoped?.active === true
|
|
576
|
+
&& shouldContinueRun(sessionScoped)
|
|
577
|
+
&& activeRalphStateMatchesStopOwner(sessionScoped, {
|
|
578
|
+
sessionId,
|
|
579
|
+
payloadSessionId: safeString(ownerContext?.payloadSessionId).trim(),
|
|
580
|
+
threadId: safeString(ownerContext?.threadId).trim(),
|
|
581
|
+
currentNativeSessionId,
|
|
582
|
+
tmuxPaneId: safeString(ownerContext?.tmuxPaneId).trim(),
|
|
583
|
+
})
|
|
584
|
+
) {
|
|
585
|
+
return { state: sessionScoped, path: sessionScopedPath };
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
if (sessionCandidates.length > 0) return null;
|
|
590
|
+
|
|
591
|
+
const directPath = join(stateDir, "ralph-state.json");
|
|
592
|
+
const direct = await readJsonIfExists(directPath);
|
|
593
|
+
if (direct?.active === true && shouldContinueRun(direct)) {
|
|
594
|
+
return { state: direct, path: directPath };
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
return null;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
function readParentPid(pid: number): number | null {
|
|
601
|
+
try {
|
|
602
|
+
if (process.platform === "linux") {
|
|
603
|
+
const stat = readFileSync(`/proc/${pid}/stat`, "utf-8");
|
|
604
|
+
const commandEnd = stat.lastIndexOf(")");
|
|
605
|
+
if (commandEnd === -1) return null;
|
|
606
|
+
const remainder = stat.slice(commandEnd + 1).trim();
|
|
607
|
+
const fields = remainder.split(/\s+/);
|
|
608
|
+
const ppid = Number(fields[1]);
|
|
609
|
+
return Number.isFinite(ppid) && ppid > 0 ? ppid : null;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
const raw = execFileSync("ps", ["-o", "ppid=", "-p", String(pid)], {
|
|
613
|
+
encoding: "utf-8",
|
|
614
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
615
|
+
}).trim();
|
|
616
|
+
const ppid = Number.parseInt(raw, 10);
|
|
617
|
+
return Number.isFinite(ppid) && ppid > 0 ? ppid : null;
|
|
618
|
+
} catch {
|
|
619
|
+
return null;
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
function readProcessCommand(pid: number): string {
|
|
624
|
+
try {
|
|
625
|
+
if (process.platform === "linux") {
|
|
626
|
+
return readFileSync(`/proc/${pid}/cmdline`, "utf-8")
|
|
627
|
+
.replace(/\u0000+/g, " ")
|
|
628
|
+
.trim();
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
return execFileSync("ps", ["-o", "command=", "-p", String(pid)], {
|
|
632
|
+
encoding: "utf-8",
|
|
633
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
634
|
+
}).trim();
|
|
635
|
+
} catch {
|
|
636
|
+
return "";
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
function looksLikeShellCommand(command: string): boolean {
|
|
641
|
+
return /(^|[\/\s])(bash|zsh|sh|dash|fish|ksh)(\s|$)/i.test(command);
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
function looksLikeCodexCommand(command: string): boolean {
|
|
645
|
+
if (/codex-native-hook(?:\.js)?/i.test(command)) return false;
|
|
646
|
+
return /\bcodex(?:\.js)?\b/i.test(command);
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
export function resolveSessionOwnerPidFromAncestry(
|
|
650
|
+
startPid: number,
|
|
651
|
+
options: {
|
|
652
|
+
readParentPid?: (pid: number) => number | null;
|
|
653
|
+
readProcessCommand?: (pid: number) => string;
|
|
654
|
+
} = {},
|
|
655
|
+
): number | null {
|
|
656
|
+
const readParent = options.readParentPid ?? readParentPid;
|
|
657
|
+
const readCommand = options.readProcessCommand ?? readProcessCommand;
|
|
658
|
+
const lineage: Array<{ pid: number; command: string }> = [];
|
|
659
|
+
let currentPid = startPid;
|
|
660
|
+
|
|
661
|
+
for (let i = 0; i < 6 && Number.isInteger(currentPid) && currentPid > 1; i += 1) {
|
|
662
|
+
const command = readCommand(currentPid);
|
|
663
|
+
lineage.push({ pid: currentPid, command });
|
|
664
|
+
const nextPid = readParent(currentPid);
|
|
665
|
+
if (!nextPid || nextPid === currentPid) break;
|
|
666
|
+
currentPid = nextPid;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
const codexAncestor = lineage.find((entry) => looksLikeCodexCommand(entry.command));
|
|
670
|
+
if (codexAncestor) return codexAncestor.pid;
|
|
671
|
+
|
|
672
|
+
if (lineage.length >= 2 && looksLikeShellCommand(lineage[0]?.command || "")) {
|
|
673
|
+
return lineage[1].pid;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
if (lineage.length >= 1) return lineage[0].pid;
|
|
677
|
+
return null;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
function resolveSessionOwnerPid(payload: CodexHookPayload): number {
|
|
681
|
+
const explicitPid = [
|
|
682
|
+
payload.session_pid,
|
|
683
|
+
payload.sessionPid,
|
|
684
|
+
payload.codex_pid,
|
|
685
|
+
payload.codexPid,
|
|
686
|
+
payload.parent_pid,
|
|
687
|
+
payload.parentPid,
|
|
688
|
+
]
|
|
689
|
+
.map(safePositiveInteger)
|
|
690
|
+
.find((value): value is number => value !== null);
|
|
691
|
+
if (explicitPid) return explicitPid;
|
|
692
|
+
|
|
693
|
+
const resolved = resolveSessionOwnerPidFromAncestry(process.ppid);
|
|
694
|
+
if (resolved) return resolved;
|
|
695
|
+
return process.pid;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
function tryReadGitValue(cwd: string, args: string[]): string | null {
|
|
699
|
+
try {
|
|
700
|
+
const value = execFileSync("git", args, {
|
|
701
|
+
cwd,
|
|
702
|
+
encoding: "utf-8",
|
|
703
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
704
|
+
windowsHide: true,
|
|
705
|
+
}).trim();
|
|
706
|
+
return value || null;
|
|
707
|
+
} catch {
|
|
708
|
+
return null;
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
|
|
713
|
+
function localExcludeAlreadyIgnoresRcsPath(cwd: string): boolean {
|
|
714
|
+
const layout = findGitLayout(cwd);
|
|
715
|
+
if (!layout) return false;
|
|
716
|
+
const excludePath = join(layout.gitDir, "info", "exclude");
|
|
717
|
+
try {
|
|
718
|
+
const lines = readFileSync(excludePath, "utf-8")
|
|
719
|
+
.split(/\r?\n/)
|
|
720
|
+
.map((line) => line.trim())
|
|
721
|
+
.filter((line) => line && !line.startsWith("#"));
|
|
722
|
+
return lines.includes(".rcs/") || lines.includes(".rcs");
|
|
723
|
+
} catch {
|
|
724
|
+
return false;
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
function isPathIgnoredByGit(cwd: string, path: string): boolean {
|
|
729
|
+
try {
|
|
730
|
+
execFileSync("git", ["check-ignore", "-q", path], {
|
|
731
|
+
cwd,
|
|
732
|
+
stdio: ["ignore", "ignore", "ignore"],
|
|
733
|
+
windowsHide: true,
|
|
734
|
+
});
|
|
735
|
+
return true;
|
|
736
|
+
} catch {
|
|
737
|
+
return false;
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
async function ensureRcsLocalIgnoreEntry(cwd: string): Promise<{ changed: boolean; excludePath?: string }> {
|
|
742
|
+
const repoRoot = tryReadGitValue(cwd, ["rev-parse", "--show-toplevel"]);
|
|
743
|
+
if (!repoRoot) return { changed: false };
|
|
744
|
+
if (localExcludeAlreadyIgnoresRcsPath(repoRoot) || isPathIgnoredByGit(repoRoot, ".rcs/")) {
|
|
745
|
+
return { changed: false };
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
const excludePathValue = tryReadGitValue(repoRoot, ["rev-parse", "--git-path", "info/exclude"]);
|
|
749
|
+
if (!excludePathValue) return { changed: false };
|
|
750
|
+
const excludePath = resolve(repoRoot, excludePathValue);
|
|
751
|
+
|
|
752
|
+
const existing = existsSync(excludePath)
|
|
753
|
+
? await readFile(excludePath, "utf-8")
|
|
754
|
+
: "";
|
|
755
|
+
const lines = existing.split(/\r?\n/).map((line) => line.trim());
|
|
756
|
+
if (lines.includes(".rcs/")) {
|
|
757
|
+
return { changed: false, excludePath };
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
const next = `${existing}${existing.endsWith("\n") || existing.length === 0 ? "" : "\n"}.rcs/\n`;
|
|
761
|
+
await writeFile(excludePath, next);
|
|
762
|
+
return { changed: true, excludePath };
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
async function buildSessionStartContext(
|
|
766
|
+
cwd: string,
|
|
767
|
+
sessionId: string,
|
|
768
|
+
options: {
|
|
769
|
+
hookEventName?: CodexHookEventName | null;
|
|
770
|
+
payload?: CodexHookPayload;
|
|
771
|
+
canonicalSessionId?: string;
|
|
772
|
+
nativeSessionId?: string;
|
|
773
|
+
} = {},
|
|
774
|
+
): Promise<string | null> {
|
|
775
|
+
const sections: string[] = [];
|
|
776
|
+
|
|
777
|
+
sections.push(buildExecutionEnvironmentSection(cwd, {
|
|
778
|
+
hookEventName: options.hookEventName,
|
|
779
|
+
payload: options.payload,
|
|
780
|
+
canonicalSessionId: options.canonicalSessionId,
|
|
781
|
+
nativeSessionId: options.nativeSessionId,
|
|
782
|
+
}));
|
|
783
|
+
|
|
784
|
+
const localIgnoreResult = await ensureRcsLocalIgnoreEntry(cwd);
|
|
785
|
+
if (localIgnoreResult.changed) {
|
|
786
|
+
sections.push(`Added .rcs/ to ${localIgnoreResult.excludePath} to keep local RCS state out of source control without mutating tracked repo ignores.`);
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
const modeSummaries: string[] = [];
|
|
790
|
+
for (const mode of ["ralph", "autopilot", "ultrawork", "ultraqa", "ralplan", "deep-interview", "team"] as const) {
|
|
791
|
+
const state = await readJsonIfExists(getStatePath(mode, cwd, sessionId));
|
|
792
|
+
if (state?.active !== true || !isNonTerminalPhase(state.current_phase)) continue;
|
|
793
|
+
if (mode === "team") {
|
|
794
|
+
const teamName = safeString(state.team_name).trim();
|
|
795
|
+
if (teamName) {
|
|
796
|
+
const phase = await readTeamPhase(teamName, cwd);
|
|
797
|
+
const canonicalPhase = phase?.current_phase ?? state.current_phase;
|
|
798
|
+
if (isNonTerminalPhase(canonicalPhase)) {
|
|
799
|
+
modeSummaries.push(`- team (${teamName}) phase: ${formatPhase(canonicalPhase)}`);
|
|
800
|
+
}
|
|
801
|
+
continue;
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
modeSummaries.push(`- ${mode} phase: ${formatPhase(state.current_phase)}`);
|
|
805
|
+
}
|
|
806
|
+
if (modeSummaries.length > 0) {
|
|
807
|
+
sections.push(["[Active RCS modes]", ...modeSummaries].join("\n"));
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
const projectMemory = await readJsonIfExists(rcsProjectMemoryPath(cwd));
|
|
811
|
+
if (projectMemory) {
|
|
812
|
+
const directives = Array.isArray(projectMemory.directives) ? projectMemory.directives : [];
|
|
813
|
+
const notes = Array.isArray(projectMemory.notes) ? projectMemory.notes : [];
|
|
814
|
+
const techStack = safeString(projectMemory.techStack).trim();
|
|
815
|
+
const conventions = safeString(projectMemory.conventions).trim();
|
|
816
|
+
const build = safeString(projectMemory.build).trim();
|
|
817
|
+
const summary: string[] = [];
|
|
818
|
+
if (techStack) summary.push(`- stack: ${techStack}`);
|
|
819
|
+
if (conventions) summary.push(`- conventions: ${conventions}`);
|
|
820
|
+
if (build) summary.push(`- build: ${build}`);
|
|
821
|
+
if (directives.length > 0) {
|
|
822
|
+
const firstDirective = directives[0] as Record<string, unknown>;
|
|
823
|
+
const directive = safeString(firstDirective.directive).trim();
|
|
824
|
+
if (directive) summary.push(`- directive: ${directive}`);
|
|
825
|
+
}
|
|
826
|
+
if (notes.length > 0) {
|
|
827
|
+
const firstNote = notes[0] as Record<string, unknown>;
|
|
828
|
+
const note = safeString(firstNote.content).trim();
|
|
829
|
+
if (note) summary.push(`- note: ${note}`);
|
|
830
|
+
}
|
|
831
|
+
if (summary.length > 0) {
|
|
832
|
+
sections.push(["[Project memory]", ...summary].join("\n"));
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
if (existsSync(rcsNotepadPath(cwd))) {
|
|
837
|
+
try {
|
|
838
|
+
const notepad = await readFile(rcsNotepadPath(cwd), "utf-8");
|
|
839
|
+
const header = "## PRIORITY";
|
|
840
|
+
const idx = notepad.indexOf(header);
|
|
841
|
+
if (idx >= 0) {
|
|
842
|
+
const nextHeader = notepad.indexOf("\n## ", idx + header.length);
|
|
843
|
+
const section = (
|
|
844
|
+
nextHeader < 0
|
|
845
|
+
? notepad.slice(idx + header.length)
|
|
846
|
+
: notepad.slice(idx + header.length, nextHeader)
|
|
847
|
+
)
|
|
848
|
+
.split(/\r?\n/)
|
|
849
|
+
.map((line) => line.trim())
|
|
850
|
+
.filter(Boolean)
|
|
851
|
+
.join(" ");
|
|
852
|
+
if (section) {
|
|
853
|
+
sections.push(`[Priority notes]\n- ${section.slice(0, 220)}`);
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
} catch {
|
|
857
|
+
// best effort only
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
const wikiContext = buildWikiSessionStartContext({ cwd });
|
|
862
|
+
if (wikiContext.additionalContext) {
|
|
863
|
+
sections.push(wikiContext.additionalContext);
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
const subagentSummary = await readSubagentSessionSummary(cwd, sessionId).catch(() => null);
|
|
867
|
+
if (subagentSummary && subagentSummary.activeSubagentThreadIds.length > 0) {
|
|
868
|
+
sections.push(`[Subagents]\n- active subagent threads: ${subagentSummary.activeSubagentThreadIds.length}`);
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
return sections.length > 0 ? sections.join("\n\n") : null;
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
type ExecutionEnvironmentKind =
|
|
875
|
+
| "attached-tmux-runtime"
|
|
876
|
+
| "outside-tmux-with-bridge"
|
|
877
|
+
| "native-outside-tmux"
|
|
878
|
+
| "direct-cli-outside-tmux";
|
|
879
|
+
|
|
880
|
+
interface ExecutionEnvironmentInfo {
|
|
881
|
+
kind: ExecutionEnvironmentKind;
|
|
882
|
+
launcher: CodexLauncherKind;
|
|
883
|
+
transport: CodexTransportKind;
|
|
884
|
+
surface: string;
|
|
885
|
+
tmuxWorkflowGuidance: string;
|
|
886
|
+
questionGuidance: string;
|
|
887
|
+
teamRuntimeInstruction: string;
|
|
888
|
+
teamHelpInstruction: string;
|
|
889
|
+
deepInterviewInstruction: string;
|
|
890
|
+
leaderPaneHint: string;
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
function resolveExecutionEnvironment(
|
|
894
|
+
cwd: string,
|
|
895
|
+
options: {
|
|
896
|
+
hookEventName?: CodexHookEventName | null;
|
|
897
|
+
payload?: CodexHookPayload;
|
|
898
|
+
canonicalSessionId?: string;
|
|
899
|
+
nativeSessionId?: string;
|
|
900
|
+
} = {},
|
|
901
|
+
): ExecutionEnvironmentInfo {
|
|
902
|
+
const executionSurface = resolveCodexExecutionSurface(cwd, options);
|
|
903
|
+
const leaderPaneHint = resolveQuestionLeaderPaneHint(cwd, options.payload);
|
|
904
|
+
const questionBridgeHint = leaderPaneHint
|
|
905
|
+
? `tmux return bridge recorded at ${leaderPaneHint}, but this process is not attached to tmux; prefer native/user-input fallback unless running from an attached tmux pane`
|
|
906
|
+
: "not available from this outside-tmux surface; use native structured input when available or ask one concise plain-text question";
|
|
907
|
+
|
|
908
|
+
if (executionSurface.transport === "attached-tmux") {
|
|
909
|
+
return {
|
|
910
|
+
kind: "attached-tmux-runtime",
|
|
911
|
+
launcher: executionSurface.launcher,
|
|
912
|
+
transport: executionSurface.transport,
|
|
913
|
+
surface: "attached tmux runtime - tmux",
|
|
914
|
+
tmuxWorkflowGuidance: "rcs team, rcs hud, and rcs question are directly usable in this session",
|
|
915
|
+
questionGuidance: "visible temporary renderer available from the current pane; primary success JSON is answers[]",
|
|
916
|
+
teamRuntimeInstruction: "Use the durable RCS team runtime via `rcs team ...` for coordinated execution; do not replace it with in-process fanout.",
|
|
917
|
+
teamHelpInstruction: "If you need runtime syntax, run `rcs team --help` yourself.",
|
|
918
|
+
deepInterviewInstruction: "Deep-interview must ask each interview round via `rcs question`; do not fall back to `request_user_input` or plain-text questioning. This session is already attached to tmux, so `rcs question` can open its temporary renderer directly over the leader pane. After starting `rcs question` in a background terminal, wait for that terminal to finish and read the JSON answer before continuing the interview. Prefer `answers[0].answer` / `answers[]`; use legacy `answer` only as fallback. Deep-interview remains one question per round, so do not batch multiple interview rounds into one `questions[]` form. Stop remains blocked while a deep-interview question obligation is pending.",
|
|
919
|
+
leaderPaneHint,
|
|
920
|
+
};
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
if (leaderPaneHint) {
|
|
924
|
+
const isNativeOutsideTmux = executionSurface.launcher === "native";
|
|
925
|
+
return {
|
|
926
|
+
kind: "outside-tmux-with-bridge",
|
|
927
|
+
launcher: executionSurface.launcher,
|
|
928
|
+
transport: executionSurface.transport,
|
|
929
|
+
surface: isNativeOutsideTmux
|
|
930
|
+
? "native-hook / Codex App outside tmux with tmux return bridge"
|
|
931
|
+
: "direct CLI outside tmux with tmux return bridge",
|
|
932
|
+
tmuxWorkflowGuidance: "rcs team and rcs hud need an attached tmux RCS CLI shell from this surface; rcs question can use the detected bridge",
|
|
933
|
+
questionGuidance: questionBridgeHint,
|
|
934
|
+
teamRuntimeInstruction: isNativeOutsideTmux
|
|
935
|
+
? "This session is native-hook / Codex App outside tmux; `rcs team` is a CLI/tmux runtime surface, not directly available here. Launch RCS CLI from an attached tmux shell first; do not replace it with in-process fanout."
|
|
936
|
+
: "This session is direct CLI outside tmux with a tmux return bridge for `rcs question`; prompt-side `$team` does not auto-start the durable tmux team runtime here. If you intentionally want the runtime, run `rcs team ...` yourself from shell instead of replacing it with in-process fanout.",
|
|
937
|
+
teamHelpInstruction: isNativeOutsideTmux
|
|
938
|
+
? "If you need runtime syntax, run `rcs team --help` from an attached tmux RCS CLI shell."
|
|
939
|
+
: "If you need runtime syntax, run `rcs team --help` yourself from shell.",
|
|
940
|
+
deepInterviewInstruction: `Deep-interview is active, but this session is not attached to tmux. Do not invoke \`rcs question\`, \`rcs hud\`, or \`rcs team\` from this surface. Ask each interview round through the native structured question tool when available; otherwise ask exactly one concise plain-text question and wait for the answer. A tmux return bridge (${leaderPaneHint}) is recorded for explicit attached-tmux recovery only, not for default Codex App/native fallback.`,
|
|
941
|
+
leaderPaneHint,
|
|
942
|
+
};
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
const isNativeOutsideTmux = executionSurface.launcher === "native" && executionSurface.transport === "outside-tmux";
|
|
946
|
+
const surface = isNativeOutsideTmux
|
|
947
|
+
? "native-hook / Codex App outside tmux"
|
|
948
|
+
: "direct CLI outside tmux";
|
|
949
|
+
const teamRuntimeInstruction = isNativeOutsideTmux
|
|
950
|
+
? "This session is native-hook / Codex App outside tmux; `rcs team` is a CLI/tmux runtime surface, not directly available here. Launch RCS CLI from an attached tmux shell first; do not replace it with in-process fanout."
|
|
951
|
+
: "This session is direct CLI outside tmux; prompt-side `$team` does not auto-start the durable tmux team runtime here. If you intentionally want the runtime, run `rcs team ...` yourself from shell instead of replacing it with in-process fanout.";
|
|
952
|
+
const teamHelpInstruction = isNativeOutsideTmux
|
|
953
|
+
? "If you need runtime syntax, run `rcs team --help` from an attached tmux RCS CLI shell rather than from Codex App/native outside-tmux context."
|
|
954
|
+
: "If you need runtime syntax, run `rcs team --help` yourself from shell.";
|
|
955
|
+
return {
|
|
956
|
+
kind: isNativeOutsideTmux ? "native-outside-tmux" : "direct-cli-outside-tmux",
|
|
957
|
+
launcher: executionSurface.launcher,
|
|
958
|
+
transport: executionSurface.transport,
|
|
959
|
+
surface,
|
|
960
|
+
tmuxWorkflowGuidance: "rcs team, rcs hud, and rcs question need an attached tmux RCS CLI shell or preserved question bridge from this surface",
|
|
961
|
+
questionGuidance: questionBridgeHint,
|
|
962
|
+
teamRuntimeInstruction,
|
|
963
|
+
teamHelpInstruction,
|
|
964
|
+
deepInterviewInstruction: "Deep-interview is active, but this session is not attached to tmux. Do not invoke `rcs question`, `rcs hud`, or `rcs team` from this surface. Ask each interview round through the native structured question tool when available; otherwise ask exactly one concise plain-text question and wait for the answer. Stop gating still applies to the interview, but no tmux question obligation should be created outside tmux.",
|
|
965
|
+
leaderPaneHint: "",
|
|
966
|
+
};
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
function buildExecutionEnvironmentSection(
|
|
970
|
+
cwd: string,
|
|
971
|
+
options: {
|
|
972
|
+
hookEventName?: CodexHookEventName | null;
|
|
973
|
+
payload?: CodexHookPayload;
|
|
974
|
+
canonicalSessionId?: string;
|
|
975
|
+
nativeSessionId?: string;
|
|
976
|
+
} = {},
|
|
977
|
+
): string {
|
|
978
|
+
const environment = resolveExecutionEnvironment(cwd, options);
|
|
979
|
+
return [
|
|
980
|
+
"[Execution environment]",
|
|
981
|
+
`- surface: ${environment.surface}`,
|
|
982
|
+
`- rcs runtime surfaces: ${environment.tmuxWorkflowGuidance}`,
|
|
983
|
+
`- rcs question: ${environment.questionGuidance}`,
|
|
984
|
+
].join("\n");
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
function resolveQuestionLeaderPaneHint(cwd: string, payload?: CodexHookPayload): string {
|
|
988
|
+
const payloadSessionId = safeString(payload?.session_id).trim();
|
|
989
|
+
const envSessionId = safeString(process.env.RCS_SESSION_ID || process.env.CODEX_SESSION_ID || process.env.SESSION_ID).trim();
|
|
990
|
+
const sessionId = payloadSessionId || envSessionId;
|
|
991
|
+
const candidatePaths = [
|
|
992
|
+
...(sessionId ? [getStatePath('deep-interview', cwd, sessionId), getStatePath('ralplan', cwd, sessionId), getStatePath('ralph', cwd, sessionId)] : []),
|
|
993
|
+
getStatePath('deep-interview', cwd),
|
|
994
|
+
getStatePath('ralplan', cwd),
|
|
995
|
+
getStatePath('ralph', cwd),
|
|
996
|
+
];
|
|
997
|
+
|
|
998
|
+
for (const path of candidatePaths) {
|
|
999
|
+
try {
|
|
1000
|
+
if (!existsSync(path)) continue;
|
|
1001
|
+
const parsed = JSON.parse(readFileSync(path, 'utf-8')) as Record<string, unknown>;
|
|
1002
|
+
const pane = safeString(parsed?.tmux_pane_id).trim();
|
|
1003
|
+
if (/^%\d+$/.test(pane)) return pane;
|
|
1004
|
+
} catch {
|
|
1005
|
+
// best effort only
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
const envPane = safeString(process.env.TMUX_PANE).trim();
|
|
1010
|
+
return /^%\d+$/.test(envPane) ? envPane : '';
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
function buildDeepInterviewQuestionBridgeInstruction(cwd: string, payload?: CodexHookPayload): string {
|
|
1014
|
+
return resolveExecutionEnvironment(cwd, {
|
|
1015
|
+
hookEventName: "UserPromptSubmit",
|
|
1016
|
+
payload,
|
|
1017
|
+
nativeSessionId: safeString(payload?.session_id ?? payload?.sessionId).trim(),
|
|
1018
|
+
}).deepInterviewInstruction;
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
function buildTeamRuntimeInstruction(cwd: string, payload?: CodexHookPayload): string {
|
|
1022
|
+
return resolveExecutionEnvironment(cwd, {
|
|
1023
|
+
hookEventName: "UserPromptSubmit",
|
|
1024
|
+
payload,
|
|
1025
|
+
nativeSessionId: safeString(payload?.session_id ?? payload?.sessionId).trim(),
|
|
1026
|
+
}).teamRuntimeInstruction;
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
function buildTeamHelpInstruction(cwd: string, payload?: CodexHookPayload): string {
|
|
1030
|
+
return resolveExecutionEnvironment(cwd, {
|
|
1031
|
+
hookEventName: "UserPromptSubmit",
|
|
1032
|
+
payload,
|
|
1033
|
+
nativeSessionId: safeString(payload?.session_id ?? payload?.sessionId).trim(),
|
|
1034
|
+
}).teamHelpInstruction;
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
function buildNativeOutsideTmuxTeamPromptBlockState(
|
|
1038
|
+
prompt: string,
|
|
1039
|
+
cwd: string,
|
|
1040
|
+
payload: CodexHookPayload,
|
|
1041
|
+
sessionId?: string,
|
|
1042
|
+
threadId?: string,
|
|
1043
|
+
turnId?: string,
|
|
1044
|
+
): SkillActiveState | null {
|
|
1045
|
+
const match = detectPrimaryKeyword(prompt);
|
|
1046
|
+
if (match?.skill !== "team") return null;
|
|
1047
|
+
|
|
1048
|
+
const environment = resolveExecutionEnvironment(cwd, {
|
|
1049
|
+
hookEventName: "UserPromptSubmit",
|
|
1050
|
+
payload,
|
|
1051
|
+
canonicalSessionId: sessionId ?? "",
|
|
1052
|
+
nativeSessionId: safeString(payload.session_id ?? payload.sessionId).trim(),
|
|
1053
|
+
});
|
|
1054
|
+
if (!(environment.launcher === "native" && environment.transport === "outside-tmux")) return null;
|
|
1055
|
+
|
|
1056
|
+
const nowIso = new Date().toISOString();
|
|
1057
|
+
return {
|
|
1058
|
+
version: 1,
|
|
1059
|
+
active: false,
|
|
1060
|
+
skill: "team",
|
|
1061
|
+
keyword: match.keyword,
|
|
1062
|
+
phase: "planning",
|
|
1063
|
+
activated_at: nowIso,
|
|
1064
|
+
updated_at: nowIso,
|
|
1065
|
+
source: "keyword-detector",
|
|
1066
|
+
session_id: sessionId,
|
|
1067
|
+
thread_id: threadId,
|
|
1068
|
+
turn_id: turnId,
|
|
1069
|
+
active_skills: [],
|
|
1070
|
+
transition_error: "Codex App/native outside-tmux sessions cannot activate the tmux-only `team` workflow directly. Launch RCS CLI from an attached tmux shell first, then run `rcs team ...` there.",
|
|
1071
|
+
};
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
function buildAdditionalContextMessage(
|
|
1075
|
+
prompt: string,
|
|
1076
|
+
skillState?: SkillActiveState | null,
|
|
1077
|
+
cwd: string = process.cwd(),
|
|
1078
|
+
payload?: CodexHookPayload,
|
|
1079
|
+
): string | null {
|
|
1080
|
+
if (!prompt) return null;
|
|
1081
|
+
const promptPriorityMessage = buildPromptPriorityMessage(prompt);
|
|
1082
|
+
const matches = detectKeywords(prompt);
|
|
1083
|
+
const match = detectPrimaryKeyword(prompt);
|
|
1084
|
+
if (!match) return promptPriorityMessage;
|
|
1085
|
+
const detectedKeywordMessage = matches.length > 1
|
|
1086
|
+
? `RCS native UserPromptSubmit detected workflow keywords ${matches.map((entry) => `"${entry.keyword}" -> ${entry.skill}`).join(", ")}.`
|
|
1087
|
+
: `RCS native UserPromptSubmit detected workflow keyword "${match.keyword}" -> ${match.skill}.`;
|
|
1088
|
+
const activeSkills = Array.isArray(skillState?.active_skills)
|
|
1089
|
+
? skillState.active_skills.map((entry) => entry.skill)
|
|
1090
|
+
: [];
|
|
1091
|
+
const deferredSkills = Array.isArray(skillState?.deferred_skills)
|
|
1092
|
+
? skillState.deferred_skills
|
|
1093
|
+
: [];
|
|
1094
|
+
const teamDetected = activeSkills.includes("team");
|
|
1095
|
+
const ralphPromptActivationNote = skillState?.initialized_mode === "ralph"
|
|
1096
|
+
? "Prompt-side `$ralph` activation seeds Ralph workflow state only; it does not invoke `rcs ralph`. Use `rcs ralph --prd ...` only when you explicitly want the PRD-gated CLI startup path."
|
|
1097
|
+
: null;
|
|
1098
|
+
const deepInterviewPromptActivationNote = skillState?.initialized_mode === "deep-interview"
|
|
1099
|
+
? buildDeepInterviewQuestionBridgeInstruction(cwd, payload)
|
|
1100
|
+
: null;
|
|
1101
|
+
const ultraworkPromptActivationNote = skillState?.initialized_mode === "ultrawork"
|
|
1102
|
+
? "Ultrawork protocol: ground the task before editing, define pass/fail acceptance criteria, keep shared-file work local, and use direct-tool plus background evidence lanes only for truly independent work. Direct ultrawork provides lightweight verification only; Ralph owns persistence and the full verified-completion promise."
|
|
1103
|
+
: null;
|
|
1104
|
+
const combinedTransitionMessage = (() => {
|
|
1105
|
+
if (!skillState?.transition_message) return null;
|
|
1106
|
+
if (matches.length <= 1 || activeSkills.length <= 1) return skillState.transition_message;
|
|
1107
|
+
const source = skillState.transition_message.match(/^mode transiting: (.+?) -> /)?.[1];
|
|
1108
|
+
if (!source) return skillState.transition_message;
|
|
1109
|
+
return `mode transiting: ${source} -> ${activeSkills.join(" + ")}`;
|
|
1110
|
+
})();
|
|
1111
|
+
|
|
1112
|
+
if (skillState?.transition_error) {
|
|
1113
|
+
return [
|
|
1114
|
+
`RCS native UserPromptSubmit denied workflow keyword "${match.keyword}" -> ${match.skill}.`,
|
|
1115
|
+
skillState.transition_error,
|
|
1116
|
+
promptPriorityMessage,
|
|
1117
|
+
'Follow AGENTS.md routing and preserve workflow transition and planning-safety rules.',
|
|
1118
|
+
].join(' ');
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
if (skillState?.transition_message) {
|
|
1122
|
+
return [
|
|
1123
|
+
detectedKeywordMessage,
|
|
1124
|
+
combinedTransitionMessage,
|
|
1125
|
+
activeSkills.length > 1 ? `active skills: ${activeSkills.join(", ")}.` : null,
|
|
1126
|
+
deferredSkills.length > 0
|
|
1127
|
+
? `planning preserved over simultaneous execution follow-up; deferred skills: ${deferredSkills.join(", ")}.`
|
|
1128
|
+
: null,
|
|
1129
|
+
promptPriorityMessage,
|
|
1130
|
+
skillState.initialized_mode && skillState.initialized_state_path
|
|
1131
|
+
? `skill: ${skillState.initialized_mode} activated and initial state initialized at ${skillState.initialized_state_path}; write subsequent updates via rcs_state MCP.`
|
|
1132
|
+
: null,
|
|
1133
|
+
teamDetected
|
|
1134
|
+
? buildTeamRuntimeInstruction(cwd, payload)
|
|
1135
|
+
: null,
|
|
1136
|
+
teamDetected ? buildTeamHelpInstruction(cwd, payload) : null,
|
|
1137
|
+
'Follow AGENTS.md routing and preserve workflow transition and planning-safety rules.',
|
|
1138
|
+
].filter(Boolean).join(' ');
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
if (teamDetected) {
|
|
1142
|
+
const initializedStateMessage = skillState?.initialized_mode && skillState.initialized_state_path
|
|
1143
|
+
? `skill: ${skillState.initialized_mode} activated and initial state initialized at ${skillState.initialized_state_path}; write subsequent updates via rcs_state MCP.`
|
|
1144
|
+
: null;
|
|
1145
|
+
return [
|
|
1146
|
+
detectedKeywordMessage,
|
|
1147
|
+
activeSkills.length > 1 ? `active skills: ${activeSkills.join(", ")}.` : null,
|
|
1148
|
+
deferredSkills.length > 0
|
|
1149
|
+
? `planning preserved over simultaneous execution follow-up; deferred skills: ${deferredSkills.join(", ")}.`
|
|
1150
|
+
: null,
|
|
1151
|
+
promptPriorityMessage,
|
|
1152
|
+
initializedStateMessage,
|
|
1153
|
+
deepInterviewPromptActivationNote,
|
|
1154
|
+
ultraworkPromptActivationNote,
|
|
1155
|
+
buildTeamRuntimeInstruction(cwd, payload),
|
|
1156
|
+
buildTeamHelpInstruction(cwd, payload),
|
|
1157
|
+
"Follow AGENTS.md routing and preserve workflow transition and planning-safety rules.",
|
|
1158
|
+
].filter(Boolean).join(" ");
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
if (skillState?.initialized_mode && skillState.initialized_state_path) {
|
|
1162
|
+
return [
|
|
1163
|
+
detectedKeywordMessage,
|
|
1164
|
+
activeSkills.length > 1 ? `active skills: ${activeSkills.join(", ")}.` : null,
|
|
1165
|
+
deferredSkills.length > 0
|
|
1166
|
+
? `planning preserved over simultaneous execution follow-up; deferred skills: ${deferredSkills.join(", ")}.`
|
|
1167
|
+
: null,
|
|
1168
|
+
promptPriorityMessage,
|
|
1169
|
+
`skill: ${skillState.initialized_mode} activated and initial state initialized at ${skillState.initialized_state_path}; write subsequent updates via rcs_state MCP.`,
|
|
1170
|
+
deepInterviewPromptActivationNote,
|
|
1171
|
+
ultraworkPromptActivationNote,
|
|
1172
|
+
ralphPromptActivationNote,
|
|
1173
|
+
"Follow AGENTS.md routing and preserve workflow transition and planning-safety rules.",
|
|
1174
|
+
].join(" ");
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
return [detectedKeywordMessage, promptPriorityMessage, "Follow AGENTS.md routing and preserve workflow transition and planning-safety rules."].filter(Boolean).join(" ");
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
function parseTeamWorkerEnv(rawValue: string): { teamName: string; workerName: string } | null {
|
|
1181
|
+
const match = /^([a-z0-9][a-z0-9-]{0,29})\/(worker-\d+)$/.exec(rawValue.trim());
|
|
1182
|
+
if (!match) return null;
|
|
1183
|
+
return {
|
|
1184
|
+
teamName: match[1] || "",
|
|
1185
|
+
workerName: match[2] || "",
|
|
1186
|
+
};
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
async function resolveTeamStateDirForWorkerContext(
|
|
1190
|
+
cwd: string,
|
|
1191
|
+
workerContext: { teamName: string; workerName: string },
|
|
1192
|
+
): Promise<string | null> {
|
|
1193
|
+
return resolveWorkerNotifyTeamStateRootPath(cwd, workerContext, process.env);
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
|
|
1197
|
+
async function buildTeamWorkerStopOutput(
|
|
1198
|
+
cwd: string,
|
|
1199
|
+
): Promise<Record<string, unknown> | null> {
|
|
1200
|
+
const workerContext = parseTeamWorkerEnv(safeString(process.env.RCS_TEAM_INTERNAL_WORKER || process.env.RCS_TEAM_WORKER));
|
|
1201
|
+
if (!workerContext) return null;
|
|
1202
|
+
|
|
1203
|
+
const stateDir = await resolveTeamStateDirForWorkerContext(cwd, workerContext);
|
|
1204
|
+
if (!stateDir) return null;
|
|
1205
|
+
const workerRoot = join(stateDir, "team", workerContext.teamName, "workers", workerContext.workerName);
|
|
1206
|
+
const [identity, status] = await Promise.all([
|
|
1207
|
+
readJsonIfExists(join(workerRoot, "identity.json")),
|
|
1208
|
+
readJsonIfExists(join(workerRoot, "status.json")),
|
|
1209
|
+
]);
|
|
1210
|
+
|
|
1211
|
+
const workerState = safeString(status?.state).trim().toLowerCase();
|
|
1212
|
+
if (!TEAM_WORKER_STOP_ACTIVE_STATES.has(workerState)) return null;
|
|
1213
|
+
|
|
1214
|
+
const candidateTaskIds = new Set<string>();
|
|
1215
|
+
const currentTaskId = safeString(status?.current_task_id).trim();
|
|
1216
|
+
if (currentTaskId) candidateTaskIds.add(currentTaskId);
|
|
1217
|
+
const assignedTasks = Array.isArray(identity?.assigned_tasks) ? identity?.assigned_tasks : [];
|
|
1218
|
+
for (const taskId of assignedTasks) {
|
|
1219
|
+
const normalized = safeString(taskId).trim();
|
|
1220
|
+
if (normalized) candidateTaskIds.add(normalized);
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
for (const taskId of candidateTaskIds) {
|
|
1224
|
+
const task = await readJsonIfExists(
|
|
1225
|
+
join(stateDir, "team", workerContext.teamName, "tasks", `task-${taskId}.json`),
|
|
1226
|
+
);
|
|
1227
|
+
const statusValue = safeString(task?.status).trim().toLowerCase();
|
|
1228
|
+
if (!statusValue || TEAM_TERMINAL_TASK_STATUSES.has(statusValue)) continue;
|
|
1229
|
+
return {
|
|
1230
|
+
decision: "block",
|
|
1231
|
+
reason:
|
|
1232
|
+
`RCS team worker ${workerContext.workerName} is still assigned non-terminal task ${taskId} (${statusValue}); continue the current assigned task or report a concrete blocker before stopping.`,
|
|
1233
|
+
stopReason: `team_worker_${workerContext.workerName}_${taskId}_${statusValue}`,
|
|
1234
|
+
systemMessage:
|
|
1235
|
+
`RCS team worker ${workerContext.workerName} is still assigned task ${taskId} (${statusValue}).`,
|
|
1236
|
+
};
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
return null;
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
function hasTeamWorkerContext(): boolean {
|
|
1243
|
+
return parseTeamWorkerEnv(safeString(process.env.RCS_TEAM_INTERNAL_WORKER || process.env.RCS_TEAM_WORKER)) !== null;
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
function isStopExempt(payload: CodexHookPayload): boolean {
|
|
1247
|
+
const candidates = [
|
|
1248
|
+
payload.stop_reason,
|
|
1249
|
+
payload.stopReason,
|
|
1250
|
+
payload.reason,
|
|
1251
|
+
payload.exit_reason,
|
|
1252
|
+
payload.exitReason,
|
|
1253
|
+
]
|
|
1254
|
+
.map((value) => safeString(value).toLowerCase())
|
|
1255
|
+
.filter(Boolean);
|
|
1256
|
+
return candidates.some((value) =>
|
|
1257
|
+
value.includes("cancel")
|
|
1258
|
+
|| value.includes("abort")
|
|
1259
|
+
|| value.includes("context")
|
|
1260
|
+
|| value.includes("compact")
|
|
1261
|
+
|| value.includes("limit"),
|
|
1262
|
+
);
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
async function buildModeBasedStopOutput(
|
|
1266
|
+
mode: "autopilot" | "ultrawork" | "ultraqa",
|
|
1267
|
+
cwd: string,
|
|
1268
|
+
sessionId?: string,
|
|
1269
|
+
): Promise<Record<string, unknown> | null> {
|
|
1270
|
+
const state = sessionId
|
|
1271
|
+
? await readModeStateForSession(mode, sessionId, cwd)
|
|
1272
|
+
: await readModeState(mode, cwd);
|
|
1273
|
+
if (!state || !shouldContinueRun(state)) return null;
|
|
1274
|
+
const phase = formatPhase(state.current_phase);
|
|
1275
|
+
return {
|
|
1276
|
+
decision: "block",
|
|
1277
|
+
reason: `RCS ${mode} is still active (phase: ${phase}); continue the task and gather fresh verification evidence before stopping.`,
|
|
1278
|
+
stopReason: `${mode}_${phase}`,
|
|
1279
|
+
systemMessage: `RCS ${mode} is still active (phase: ${phase}).`,
|
|
1280
|
+
};
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
async function readTeamModeStateForStop(
|
|
1284
|
+
cwd: string,
|
|
1285
|
+
sessionId?: string,
|
|
1286
|
+
): Promise<Record<string, unknown> | null> {
|
|
1287
|
+
const normalizedSessionId = safeString(sessionId).trim();
|
|
1288
|
+
if (!normalizedSessionId) {
|
|
1289
|
+
return await readModeState("team", cwd);
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
const scopedState = await readStopSessionPinnedState("team-state.json", cwd, normalizedSessionId);
|
|
1293
|
+
if (scopedState) return scopedState;
|
|
1294
|
+
|
|
1295
|
+
const rootState = await readJsonIfExists(join(cwd, ".rcs", "state", "team-state.json"));
|
|
1296
|
+
if (rootState?.active !== true) return null;
|
|
1297
|
+
|
|
1298
|
+
const ownerSessionId = safeString(rootState.session_id).trim();
|
|
1299
|
+
if (ownerSessionId && ownerSessionId !== normalizedSessionId) {
|
|
1300
|
+
return null;
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
return rootState;
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
async function buildTeamStopOutput(cwd: string, sessionId?: string): Promise<Record<string, unknown> | null> {
|
|
1307
|
+
if (await readCanonicalTerminalRunStateForStop(cwd, sessionId, "team")) {
|
|
1308
|
+
return null;
|
|
1309
|
+
}
|
|
1310
|
+
const teamState = await readTeamModeStateForStop(cwd, sessionId);
|
|
1311
|
+
if (teamState?.active !== true) return null;
|
|
1312
|
+
const teamName = safeString(teamState.team_name).trim();
|
|
1313
|
+
if (teamName) {
|
|
1314
|
+
const canonicalTeamDir = join(resolveCanonicalTeamStateRoot(cwd), "team", teamName);
|
|
1315
|
+
if (!existsSync(canonicalTeamDir)) {
|
|
1316
|
+
return null;
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1319
|
+
const coarsePhase = teamState.current_phase;
|
|
1320
|
+
const canonicalPhase = teamName ? (await readTeamPhase(teamName, cwd))?.current_phase ?? coarsePhase : coarsePhase;
|
|
1321
|
+
if (!isNonTerminalPhase(canonicalPhase)) return null;
|
|
1322
|
+
return buildTeamStopOutputForPhase(teamName, formatPhase(canonicalPhase));
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
function buildTeamStopReason(teamName: string, phase: string): string {
|
|
1326
|
+
const teamContext = teamName ? ` (${teamName})` : "";
|
|
1327
|
+
return `RCS team pipeline is still active${teamContext} at phase ${phase}; continue coordinating until the team reaches a terminal phase. If system-generated worker auto-checkpoint commits exist, rewrite them into Lore-format final commits before merge/finalization.`;
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
function buildTeamStopOutputForPhase(teamName: string, phase: string): Record<string, unknown> {
|
|
1331
|
+
return {
|
|
1332
|
+
decision: "block",
|
|
1333
|
+
reason: buildTeamStopReason(teamName, phase),
|
|
1334
|
+
stopReason: `team_${phase}`,
|
|
1335
|
+
systemMessage: `RCS team pipeline is still active at phase ${phase}.`,
|
|
1336
|
+
};
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1339
|
+
function extractStableFinalRecommendationSummary(message: string): string {
|
|
1340
|
+
for (const pattern of STABLE_FINAL_RECOMMENDATION_PATTERNS) {
|
|
1341
|
+
const match = pattern.exec(message);
|
|
1342
|
+
if (!match) continue;
|
|
1343
|
+
const summary = match[0]?.trim().replace(/\s+/g, " ");
|
|
1344
|
+
if (!summary) continue;
|
|
1345
|
+
return /[.!?]$/.test(summary) ? summary : `${summary}.`;
|
|
1346
|
+
}
|
|
1347
|
+
return "";
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
function buildStableFinalRecommendationStopSignature(
|
|
1351
|
+
payload: CodexHookPayload,
|
|
1352
|
+
teamName: string,
|
|
1353
|
+
summary: string,
|
|
1354
|
+
): string {
|
|
1355
|
+
const sessionId = readPayloadSessionId(payload) || "no-session";
|
|
1356
|
+
const threadId = readPayloadThreadId(payload) || "no-thread";
|
|
1357
|
+
const normalizedSummary = normalizeAutoNudgeSignatureText(summary) || summary.toLowerCase();
|
|
1358
|
+
return ["release-readiness-finalize", sessionId, threadId, teamName, normalizedSummary].join("|");
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
function hasReleaseReadinessMode(payload: CodexHookPayload): boolean {
|
|
1362
|
+
const mode = safeString(payload.mode).trim().toLowerCase();
|
|
1363
|
+
return mode === "release-readiness";
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
async function hasReleaseReadinessStopMarker(
|
|
1367
|
+
cwd: string,
|
|
1368
|
+
sessionId: string,
|
|
1369
|
+
teamName: string,
|
|
1370
|
+
): Promise<boolean> {
|
|
1371
|
+
if (!sessionId) return false;
|
|
1372
|
+
|
|
1373
|
+
const markerState = await readStopSessionPinnedState("release-readiness-state.json", cwd, sessionId);
|
|
1374
|
+
if (markerState?.active !== true || markerState.stable_final_recommendation_emitted !== true) {
|
|
1375
|
+
return false;
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1378
|
+
const markerTeamName = safeString(markerState.team_name).trim();
|
|
1379
|
+
if (markerTeamName && markerTeamName !== teamName) return false;
|
|
1380
|
+
|
|
1381
|
+
const markerSessionId = safeString(markerState.session_id).trim();
|
|
1382
|
+
if (markerSessionId && markerSessionId !== sessionId) return false;
|
|
1383
|
+
|
|
1384
|
+
return true;
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
function readPayloadSessionId(payload: CodexHookPayload): string {
|
|
1388
|
+
return safeString(payload.session_id ?? payload.sessionId).trim();
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
function readPayloadThreadId(payload: CodexHookPayload): string {
|
|
1392
|
+
return safeString(payload.thread_id ?? payload.threadId).trim();
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
function readPayloadTurnId(payload: CodexHookPayload): string {
|
|
1396
|
+
return safeString(payload.turn_id ?? payload.turnId).trim();
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1399
|
+
async function resolveInternalSessionIdForPayload(
|
|
1400
|
+
cwd: string,
|
|
1401
|
+
payloadSessionId: string,
|
|
1402
|
+
): Promise<string> {
|
|
1403
|
+
const currentSession = await readUsableSessionState(cwd);
|
|
1404
|
+
const canonicalSessionId = safeString(currentSession?.session_id).trim();
|
|
1405
|
+
if (!canonicalSessionId) return payloadSessionId;
|
|
1406
|
+
|
|
1407
|
+
const nativeSessionId = safeString(currentSession?.native_session_id).trim();
|
|
1408
|
+
if (!payloadSessionId) return canonicalSessionId;
|
|
1409
|
+
if (payloadSessionId === canonicalSessionId) return canonicalSessionId;
|
|
1410
|
+
if (nativeSessionId && payloadSessionId === nativeSessionId) return canonicalSessionId;
|
|
1411
|
+
return payloadSessionId;
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
async function readStopSessionPinnedState(
|
|
1415
|
+
fileName: string,
|
|
1416
|
+
cwd: string,
|
|
1417
|
+
sessionId: string,
|
|
1418
|
+
): Promise<Record<string, unknown> | null> {
|
|
1419
|
+
const statePath = getStateFilePath(fileName, cwd, sessionId || undefined);
|
|
1420
|
+
return readJsonIfExists(statePath);
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
function matchesSkillStopContext(
|
|
1424
|
+
entry: { session_id?: string; thread_id?: string },
|
|
1425
|
+
state: { session_id?: string; thread_id?: string },
|
|
1426
|
+
sessionId: string,
|
|
1427
|
+
threadId: string,
|
|
1428
|
+
): boolean {
|
|
1429
|
+
const entrySessionId = safeString(entry.session_id ?? state.session_id).trim();
|
|
1430
|
+
const entryThreadId = safeString(entry.thread_id ?? state.thread_id).trim();
|
|
1431
|
+
if (sessionId && entrySessionId && entrySessionId !== sessionId) return false;
|
|
1432
|
+
if (sessionId && !entrySessionId && threadId && entryThreadId && entryThreadId !== threadId) {
|
|
1433
|
+
return false;
|
|
1434
|
+
}
|
|
1435
|
+
return true;
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
function modeStateMatchesSkillStopContext(
|
|
1439
|
+
state: Record<string, unknown>,
|
|
1440
|
+
cwd: string,
|
|
1441
|
+
sessionId: string,
|
|
1442
|
+
): boolean {
|
|
1443
|
+
const stateSessionId = safeString(
|
|
1444
|
+
state.owner_rcs_session_id
|
|
1445
|
+
?? state.session_id
|
|
1446
|
+
?? state.codex_session_id
|
|
1447
|
+
?? state.owner_codex_session_id,
|
|
1448
|
+
).trim();
|
|
1449
|
+
if (sessionId && stateSessionId && stateSessionId !== sessionId) return false;
|
|
1450
|
+
|
|
1451
|
+
const stateCwd = safeString(
|
|
1452
|
+
state.cwd
|
|
1453
|
+
?? state.workingDirectory
|
|
1454
|
+
?? state.working_directory
|
|
1455
|
+
?? state.project_path,
|
|
1456
|
+
).trim();
|
|
1457
|
+
if (stateCwd) {
|
|
1458
|
+
try {
|
|
1459
|
+
if (resolve(stateCwd) !== resolve(cwd)) return false;
|
|
1460
|
+
} catch {
|
|
1461
|
+
return false;
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
return true;
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
async function readBlockingSkillForStop(
|
|
1469
|
+
cwd: string,
|
|
1470
|
+
sessionId: string,
|
|
1471
|
+
threadId: string,
|
|
1472
|
+
requiredSkill?: string,
|
|
1473
|
+
): Promise<{ skill: string; phase: string } | null> {
|
|
1474
|
+
const canonicalState = await readVisibleSkillActiveState(cwd, sessionId);
|
|
1475
|
+
const visibleEntries = canonicalState ? listActiveSkills(canonicalState) : [];
|
|
1476
|
+
const candidateSkills = requiredSkill
|
|
1477
|
+
? [requiredSkill]
|
|
1478
|
+
: [...SKILL_STOP_BLOCKERS];
|
|
1479
|
+
|
|
1480
|
+
for (const skill of candidateSkills) {
|
|
1481
|
+
const terminalRunState = await readCanonicalTerminalRunStateForStop(cwd, sessionId, skill);
|
|
1482
|
+
if (terminalRunState) continue;
|
|
1483
|
+
|
|
1484
|
+
const modeState = await readStopSessionPinnedState(`${skill}-state.json`, cwd, sessionId);
|
|
1485
|
+
if (!modeState || modeState.active !== true) continue;
|
|
1486
|
+
if (!modeStateMatchesSkillStopContext(modeState, cwd, sessionId)) continue;
|
|
1487
|
+
|
|
1488
|
+
const modeSnapshot = getRunContinuationSnapshot(modeState);
|
|
1489
|
+
if (modeSnapshot?.terminal === true) continue;
|
|
1490
|
+
|
|
1491
|
+
const phase = formatPhase(
|
|
1492
|
+
modeState.current_phase,
|
|
1493
|
+
formatPhase(
|
|
1494
|
+
visibleEntries.find((entry) => entry.skill === skill)?.phase,
|
|
1495
|
+
"planning",
|
|
1496
|
+
),
|
|
1497
|
+
);
|
|
1498
|
+
if (TERMINAL_MODE_PHASES.has(phase.toLowerCase()) || phase === "completing") {
|
|
1499
|
+
continue;
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
if (!canonicalState) {
|
|
1503
|
+
return { skill, phase };
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
const blocker = visibleEntries.find((entry) => (
|
|
1507
|
+
entry.skill === skill
|
|
1508
|
+
&& matchesSkillStopContext(entry, canonicalState, sessionId, threadId)
|
|
1509
|
+
));
|
|
1510
|
+
if (!blocker) continue;
|
|
1511
|
+
|
|
1512
|
+
return {
|
|
1513
|
+
skill,
|
|
1514
|
+
phase: formatPhase(modeState.current_phase ?? blocker.phase ?? canonicalState.phase, "planning"),
|
|
1515
|
+
};
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
return null;
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
async function readStopAutoNudgePhase(
|
|
1522
|
+
cwd: string,
|
|
1523
|
+
sessionId: string,
|
|
1524
|
+
threadId: string,
|
|
1525
|
+
): Promise<string> {
|
|
1526
|
+
const normalizedSessionId = sessionId.trim();
|
|
1527
|
+
if (normalizedSessionId) {
|
|
1528
|
+
const scopedModeState = await readStopSessionPinnedState("deep-interview-state.json", cwd, normalizedSessionId);
|
|
1529
|
+
if (
|
|
1530
|
+
scopedModeState?.active === true
|
|
1531
|
+
&& safeString(scopedModeState.current_phase).trim().toLowerCase() === "intent-first"
|
|
1532
|
+
) {
|
|
1533
|
+
return "planning";
|
|
1534
|
+
}
|
|
1535
|
+
} else {
|
|
1536
|
+
const rootModeState = await readJsonIfExists(join(cwd, ".rcs", "state", "deep-interview-state.json"));
|
|
1537
|
+
if (
|
|
1538
|
+
rootModeState?.active === true
|
|
1539
|
+
&& safeString(rootModeState.current_phase).trim().toLowerCase() === "intent-first"
|
|
1540
|
+
) {
|
|
1541
|
+
return "planning";
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1545
|
+
if (!normalizedSessionId) return "";
|
|
1546
|
+
|
|
1547
|
+
const canonicalState = await readVisibleSkillActiveState(cwd, normalizedSessionId);
|
|
1548
|
+
const visibleEntries = canonicalState ? listActiveSkills(canonicalState) : [];
|
|
1549
|
+
const deepInterview = visibleEntries.find((entry) => (
|
|
1550
|
+
entry.skill === "deep-interview"
|
|
1551
|
+
&& matchesSkillStopContext(entry, canonicalState ?? {}, normalizedSessionId, threadId)
|
|
1552
|
+
));
|
|
1553
|
+
if (!deepInterview) return "";
|
|
1554
|
+
|
|
1555
|
+
const modeState = await readStopSessionPinnedState("deep-interview-state.json", cwd, normalizedSessionId);
|
|
1556
|
+
if (!modeState || modeState.active !== true) return "";
|
|
1557
|
+
|
|
1558
|
+
const modePhase = safeString(modeState.current_phase).trim().toLowerCase();
|
|
1559
|
+
return modePhase === "intent-first" ? "planning" : "";
|
|
1560
|
+
}
|
|
1561
|
+
|
|
1562
|
+
async function buildDeepInterviewQuestionStopOutput(
|
|
1563
|
+
cwd: string,
|
|
1564
|
+
sessionId: string,
|
|
1565
|
+
threadId: string,
|
|
1566
|
+
): Promise<{ output: Record<string, unknown>; obligationId: string } | null> {
|
|
1567
|
+
await reconcileDeepInterviewQuestionEnforcementFromAnsweredRecords(cwd, sessionId);
|
|
1568
|
+
const modeState = await readStopSessionPinnedState("deep-interview-state.json", cwd, sessionId);
|
|
1569
|
+
if (!modeState) return null;
|
|
1570
|
+
|
|
1571
|
+
const questionEnforcement = safeObject(modeState.question_enforcement);
|
|
1572
|
+
const hasPendingQuestionObligation = isPendingDeepInterviewQuestionEnforcement(questionEnforcement);
|
|
1573
|
+
if (modeState.active !== true && !hasPendingQuestionObligation) return null;
|
|
1574
|
+
|
|
1575
|
+
const phase = formatPhase(modeState.current_phase, "planning");
|
|
1576
|
+
if (TERMINAL_MODE_PHASES.has(phase.toLowerCase()) || phase === "completing") {
|
|
1577
|
+
return null;
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
const canonicalState = await readVisibleSkillActiveState(cwd, sessionId);
|
|
1581
|
+
if (canonicalState) {
|
|
1582
|
+
const blocker = listActiveSkills(canonicalState).find((entry) => (
|
|
1583
|
+
entry.skill === "deep-interview"
|
|
1584
|
+
&& matchesSkillStopContext(entry, canonicalState, sessionId, threadId)
|
|
1585
|
+
));
|
|
1586
|
+
if (!blocker) return null;
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1589
|
+
if (!hasPendingQuestionObligation) {
|
|
1590
|
+
return null;
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
const obligationId = safeString(questionEnforcement.obligation_id).trim();
|
|
1594
|
+
if (!obligationId) return null;
|
|
1595
|
+
|
|
1596
|
+
const systemMessage =
|
|
1597
|
+
`RCS deep-interview is still active (phase: ${phase}) and requires a structured question via rcs question before stopping; read the returned answers[] JSON before continuing.`;
|
|
1598
|
+
|
|
1599
|
+
return {
|
|
1600
|
+
obligationId,
|
|
1601
|
+
output: {
|
|
1602
|
+
decision: "block",
|
|
1603
|
+
reason:
|
|
1604
|
+
`Deep interview is still active (phase: ${phase}) and has a pending structured question obligation; use \`rcs question\` before stopping.`,
|
|
1605
|
+
stopReason: "deep_interview_question_required",
|
|
1606
|
+
systemMessage,
|
|
1607
|
+
},
|
|
1608
|
+
};
|
|
1609
|
+
}
|
|
1610
|
+
|
|
1611
|
+
function resolveRepeatableStopSessionId(
|
|
1612
|
+
payload: CodexHookPayload,
|
|
1613
|
+
canonicalSessionId?: string,
|
|
1614
|
+
): string {
|
|
1615
|
+
return canonicalSessionId?.trim() || readPayloadSessionId(payload) || "";
|
|
1616
|
+
}
|
|
1617
|
+
|
|
1618
|
+
function buildRepeatableStopSignature(
|
|
1619
|
+
payload: CodexHookPayload,
|
|
1620
|
+
kind: string,
|
|
1621
|
+
detail = "",
|
|
1622
|
+
canonicalSessionId?: string,
|
|
1623
|
+
): string {
|
|
1624
|
+
const sessionId = resolveRepeatableStopSessionId(payload, canonicalSessionId) || "no-session";
|
|
1625
|
+
const threadId = readPayloadThreadId(payload) || "no-thread";
|
|
1626
|
+
const turnId = readPayloadTurnId(payload);
|
|
1627
|
+
const normalizedDetail = normalizeAutoNudgeSignatureText(detail) || safeString(detail).trim().toLowerCase();
|
|
1628
|
+
const transcriptPath = safeString(payload.transcript_path ?? payload.transcriptPath).trim() || "no-transcript";
|
|
1629
|
+
const lastAssistantMessage = normalizeAutoNudgeSignatureText(
|
|
1630
|
+
payload.last_assistant_message ?? payload.lastAssistantMessage,
|
|
1631
|
+
) || "no-message";
|
|
1632
|
+
if (turnId) {
|
|
1633
|
+
return [
|
|
1634
|
+
kind,
|
|
1635
|
+
sessionId,
|
|
1636
|
+
threadId,
|
|
1637
|
+
turnId,
|
|
1638
|
+
transcriptPath,
|
|
1639
|
+
lastAssistantMessage,
|
|
1640
|
+
normalizedDetail || "no-detail",
|
|
1641
|
+
].join("|");
|
|
1642
|
+
}
|
|
1643
|
+
return [
|
|
1644
|
+
kind,
|
|
1645
|
+
sessionId,
|
|
1646
|
+
threadId,
|
|
1647
|
+
transcriptPath,
|
|
1648
|
+
lastAssistantMessage,
|
|
1649
|
+
normalizedDetail || "no-detail",
|
|
1650
|
+
].join("|");
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1653
|
+
function formatStopStatePath(cwd: string, statePath: string): string {
|
|
1654
|
+
const relativePath = relative(cwd, statePath);
|
|
1655
|
+
if (!relativePath || relativePath.startsWith("..")) return statePath;
|
|
1656
|
+
return relativePath.replace(/\\/g, "/");
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1659
|
+
function readNativeStopSessionKey(
|
|
1660
|
+
payload: CodexHookPayload,
|
|
1661
|
+
canonicalSessionId?: string,
|
|
1662
|
+
): string {
|
|
1663
|
+
return resolveRepeatableStopSessionId(payload, canonicalSessionId) || readPayloadThreadId(payload) || "global";
|
|
1664
|
+
}
|
|
1665
|
+
|
|
1666
|
+
function readPreviousNativeStopSignature(
|
|
1667
|
+
state: Record<string, unknown>,
|
|
1668
|
+
sessionKey: string,
|
|
1669
|
+
): string {
|
|
1670
|
+
const sessions = safeObject(state.sessions);
|
|
1671
|
+
const sessionState = safeObject(sessions[sessionKey]);
|
|
1672
|
+
return safeString(sessionState.last_signature).trim();
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
async function persistNativeStopSignature(
|
|
1676
|
+
stateDir: string,
|
|
1677
|
+
payload: CodexHookPayload,
|
|
1678
|
+
signature: string,
|
|
1679
|
+
canonicalSessionId?: string,
|
|
1680
|
+
): Promise<void> {
|
|
1681
|
+
if (!signature) return;
|
|
1682
|
+
const statePath = join(stateDir, NATIVE_STOP_STATE_FILE);
|
|
1683
|
+
const state = await readJsonIfExists(statePath) ?? {};
|
|
1684
|
+
const sessions = safeObject(state.sessions);
|
|
1685
|
+
const sessionKey = readNativeStopSessionKey(payload, canonicalSessionId);
|
|
1686
|
+
sessions[sessionKey] = {
|
|
1687
|
+
...safeObject(sessions[sessionKey]),
|
|
1688
|
+
last_signature: signature,
|
|
1689
|
+
updated_at: new Date().toISOString(),
|
|
1690
|
+
};
|
|
1691
|
+
await mkdir(stateDir, { recursive: true });
|
|
1692
|
+
await writeFile(statePath, JSON.stringify({
|
|
1693
|
+
...state,
|
|
1694
|
+
sessions,
|
|
1695
|
+
}, null, 2));
|
|
1696
|
+
}
|
|
1697
|
+
|
|
1698
|
+
async function maybeReturnRepeatableStopOutput(
|
|
1699
|
+
payload: CodexHookPayload,
|
|
1700
|
+
stateDir: string,
|
|
1701
|
+
signature: string,
|
|
1702
|
+
output: Record<string, unknown> | null,
|
|
1703
|
+
canonicalSessionId?: string,
|
|
1704
|
+
options: { allowRepeatDuringStopHook?: boolean } = {},
|
|
1705
|
+
): Promise<Record<string, unknown> | null> {
|
|
1706
|
+
if (!output) return null;
|
|
1707
|
+
const stopHookActive = payload.stop_hook_active === true || payload.stopHookActive === true;
|
|
1708
|
+
if (stopHookActive && options.allowRepeatDuringStopHook !== true) {
|
|
1709
|
+
const state = await readJsonIfExists(join(stateDir, NATIVE_STOP_STATE_FILE)) ?? {};
|
|
1710
|
+
const previousSignature = readPreviousNativeStopSignature(
|
|
1711
|
+
state,
|
|
1712
|
+
readNativeStopSessionKey(payload, canonicalSessionId),
|
|
1713
|
+
);
|
|
1714
|
+
if (!signature || previousSignature === signature) {
|
|
1715
|
+
return null;
|
|
1716
|
+
}
|
|
1717
|
+
}
|
|
1718
|
+
await persistNativeStopSignature(stateDir, payload, signature, canonicalSessionId);
|
|
1719
|
+
return output;
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
async function returnPersistentStopBlock(
|
|
1723
|
+
payload: CodexHookPayload,
|
|
1724
|
+
stateDir: string,
|
|
1725
|
+
signatureKind: string,
|
|
1726
|
+
signatureValue: string,
|
|
1727
|
+
output: Record<string, unknown> | null,
|
|
1728
|
+
canonicalSessionId?: string,
|
|
1729
|
+
options: { allowRepeatDuringStopHook?: boolean } = { allowRepeatDuringStopHook: true },
|
|
1730
|
+
): Promise<Record<string, unknown> | null> {
|
|
1731
|
+
return await maybeReturnRepeatableStopOutput(
|
|
1732
|
+
payload,
|
|
1733
|
+
stateDir,
|
|
1734
|
+
buildRepeatableStopSignature(payload, signatureKind, signatureValue, canonicalSessionId),
|
|
1735
|
+
output,
|
|
1736
|
+
canonicalSessionId,
|
|
1737
|
+
options,
|
|
1738
|
+
);
|
|
1739
|
+
}
|
|
1740
|
+
|
|
1741
|
+
async function findCanonicalActiveTeamForSession(
|
|
1742
|
+
cwd: string,
|
|
1743
|
+
sessionId: string,
|
|
1744
|
+
): Promise<{ teamName: string; phase: string } | null> {
|
|
1745
|
+
if (!sessionId.trim()) return null;
|
|
1746
|
+
const teamsRoot = join(resolveCanonicalTeamStateRoot(cwd), "team");
|
|
1747
|
+
if (!existsSync(teamsRoot)) return null;
|
|
1748
|
+
|
|
1749
|
+
const entries = await readdir(teamsRoot, { withFileTypes: true }).catch(() => []);
|
|
1750
|
+
for (const entry of entries) {
|
|
1751
|
+
if (!entry.isDirectory()) continue;
|
|
1752
|
+
const teamName = entry.name.trim();
|
|
1753
|
+
if (!teamName) continue;
|
|
1754
|
+
|
|
1755
|
+
const [manifest, phaseState] = await Promise.all([
|
|
1756
|
+
readTeamManifestV2(teamName, cwd),
|
|
1757
|
+
readTeamPhase(teamName, cwd),
|
|
1758
|
+
]);
|
|
1759
|
+
if (!manifest || !phaseState) continue;
|
|
1760
|
+
const ownerSessionId = (manifest.leader?.session_id ?? "").trim();
|
|
1761
|
+
if (ownerSessionId && ownerSessionId !== sessionId.trim()) continue;
|
|
1762
|
+
if (!isNonTerminalPhase(phaseState.current_phase)) continue;
|
|
1763
|
+
|
|
1764
|
+
return {
|
|
1765
|
+
teamName,
|
|
1766
|
+
phase: formatPhase(phaseState.current_phase),
|
|
1767
|
+
};
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
return null;
|
|
1771
|
+
}
|
|
1772
|
+
|
|
1773
|
+
async function resolveActiveTeamNameForStop(
|
|
1774
|
+
cwd: string,
|
|
1775
|
+
sessionId: string,
|
|
1776
|
+
): Promise<string> {
|
|
1777
|
+
const directState = await readTeamModeStateForStop(cwd, sessionId);
|
|
1778
|
+
const directTeamName = safeString(directState?.team_name).trim();
|
|
1779
|
+
if (directState?.active === true && directTeamName) return directTeamName;
|
|
1780
|
+
|
|
1781
|
+
const canonicalTeam = await findCanonicalActiveTeamForSession(cwd, sessionId);
|
|
1782
|
+
return canonicalTeam?.teamName ?? "";
|
|
1783
|
+
}
|
|
1784
|
+
|
|
1785
|
+
async function maybeBuildReleaseReadinessFinalizeStopOutput(
|
|
1786
|
+
payload: CodexHookPayload,
|
|
1787
|
+
cwd: string,
|
|
1788
|
+
stateDir: string,
|
|
1789
|
+
sessionId: string,
|
|
1790
|
+
): Promise<{ matched: boolean; output: Record<string, unknown> | null }> {
|
|
1791
|
+
if (!sessionId) return { matched: false, output: null };
|
|
1792
|
+
|
|
1793
|
+
const teamName = await resolveActiveTeamNameForStop(cwd, sessionId);
|
|
1794
|
+
if (!teamName) return { matched: false, output: null };
|
|
1795
|
+
|
|
1796
|
+
const explicitReleaseReadinessContext =
|
|
1797
|
+
hasReleaseReadinessMode(payload)
|
|
1798
|
+
|| await hasReleaseReadinessStopMarker(cwd, sessionId, teamName);
|
|
1799
|
+
if (!explicitReleaseReadinessContext) {
|
|
1800
|
+
return { matched: false, output: null };
|
|
1801
|
+
}
|
|
1802
|
+
|
|
1803
|
+
const summary = extractStableFinalRecommendationSummary(
|
|
1804
|
+
safeString(payload.last_assistant_message ?? payload.lastAssistantMessage),
|
|
1805
|
+
);
|
|
1806
|
+
if (!summary) return { matched: false, output: null };
|
|
1807
|
+
|
|
1808
|
+
const leaderAttention = await readTeamLeaderAttention(teamName, cwd);
|
|
1809
|
+
if (
|
|
1810
|
+
!leaderAttention
|
|
1811
|
+
|| leaderAttention.leader_decision_state !== "done_waiting_on_leader"
|
|
1812
|
+
|| leaderAttention.work_remaining !== false
|
|
1813
|
+
) {
|
|
1814
|
+
return { matched: false, output: null };
|
|
1815
|
+
}
|
|
1816
|
+
|
|
1817
|
+
const signature = buildStableFinalRecommendationStopSignature(payload, teamName, summary);
|
|
1818
|
+
const output = await maybeReturnRepeatableStopOutput(
|
|
1819
|
+
payload,
|
|
1820
|
+
stateDir,
|
|
1821
|
+
signature,
|
|
1822
|
+
{
|
|
1823
|
+
decision: "block",
|
|
1824
|
+
reason:
|
|
1825
|
+
`Stable final recommendation already reached with no active worker tasks. Emit exactly one concise final decision summary aligned to "${summary}" with no filler or residual acknowledgements (for example "yes"), then stop.`,
|
|
1826
|
+
stopReason: "release_readiness_auto_finalize",
|
|
1827
|
+
systemMessage: RELEASE_READINESS_FINALIZE_SYSTEM_MESSAGE,
|
|
1828
|
+
},
|
|
1829
|
+
sessionId,
|
|
1830
|
+
);
|
|
1831
|
+
return { matched: true, output };
|
|
1832
|
+
}
|
|
1833
|
+
|
|
1834
|
+
async function buildSkillStopOutput(
|
|
1835
|
+
cwd: string,
|
|
1836
|
+
sessionId: string,
|
|
1837
|
+
threadId: string,
|
|
1838
|
+
): Promise<Record<string, unknown> | null> {
|
|
1839
|
+
const blocker = await readBlockingSkillForStop(cwd, sessionId, threadId);
|
|
1840
|
+
if (!blocker) return null;
|
|
1841
|
+
|
|
1842
|
+
const subagentSummary = await readSubagentSessionSummary(cwd, sessionId).catch(() => null);
|
|
1843
|
+
if (subagentSummary && subagentSummary.activeSubagentThreadIds.length > 0) {
|
|
1844
|
+
return null;
|
|
1845
|
+
}
|
|
1846
|
+
|
|
1847
|
+
return {
|
|
1848
|
+
decision: "block",
|
|
1849
|
+
reason: `RCS skill ${blocker.skill} is still active (phase: ${blocker.phase}); continue until the current ${blocker.skill} workflow reaches a terminal state.`,
|
|
1850
|
+
stopReason: `skill_${blocker.skill}_${blocker.phase}`,
|
|
1851
|
+
systemMessage: `RCS skill ${blocker.skill} is still active (phase: ${blocker.phase}).`,
|
|
1852
|
+
};
|
|
1853
|
+
}
|
|
1854
|
+
|
|
1855
|
+
async function findActiveTeamForTransportFailure(
|
|
1856
|
+
cwd: string,
|
|
1857
|
+
sessionId: string,
|
|
1858
|
+
): Promise<{ teamName: string; phase: string } | null> {
|
|
1859
|
+
const teamState = await readModeStateForSession("team", sessionId, cwd);
|
|
1860
|
+
if (teamState?.active === true) {
|
|
1861
|
+
const teamName = safeString(teamState.team_name).trim();
|
|
1862
|
+
const coarsePhase = formatPhase(teamState.current_phase);
|
|
1863
|
+
if (teamName) {
|
|
1864
|
+
const canonicalPhase = (await readTeamPhase(teamName, cwd))?.current_phase ?? coarsePhase;
|
|
1865
|
+
if (isNonTerminalPhase(canonicalPhase)) {
|
|
1866
|
+
return { teamName, phase: formatPhase(canonicalPhase) };
|
|
1867
|
+
}
|
|
1868
|
+
}
|
|
1869
|
+
}
|
|
1870
|
+
|
|
1871
|
+
return await findCanonicalActiveTeamForSession(cwd, sessionId);
|
|
1872
|
+
}
|
|
1873
|
+
|
|
1874
|
+
async function markTeamTransportFailure(
|
|
1875
|
+
cwd: string,
|
|
1876
|
+
payload: CodexHookPayload,
|
|
1877
|
+
): Promise<void> {
|
|
1878
|
+
const canonicalSessionId = await resolveInternalSessionIdForPayload(cwd, readPayloadSessionId(payload));
|
|
1879
|
+
const activeTeam = await findActiveTeamForTransportFailure(cwd, canonicalSessionId);
|
|
1880
|
+
if (!activeTeam) return;
|
|
1881
|
+
|
|
1882
|
+
const nowIso = new Date().toISOString();
|
|
1883
|
+
const existingPhase = await readTeamPhase(activeTeam.teamName, cwd);
|
|
1884
|
+
const currentPhase = existingPhase?.current_phase ?? activeTeam.phase;
|
|
1885
|
+
if (!isNonTerminalPhase(currentPhase)) return;
|
|
1886
|
+
|
|
1887
|
+
await writeTeamPhase(
|
|
1888
|
+
activeTeam.teamName,
|
|
1889
|
+
{
|
|
1890
|
+
current_phase: "failed",
|
|
1891
|
+
max_fix_attempts: existingPhase?.max_fix_attempts ?? 3,
|
|
1892
|
+
current_fix_attempt: existingPhase?.current_fix_attempt ?? 0,
|
|
1893
|
+
transitions: [
|
|
1894
|
+
...(existingPhase?.transitions ?? []),
|
|
1895
|
+
{
|
|
1896
|
+
from: formatPhase(currentPhase),
|
|
1897
|
+
to: "failed",
|
|
1898
|
+
at: nowIso,
|
|
1899
|
+
reason: "mcp_transport_dead",
|
|
1900
|
+
},
|
|
1901
|
+
],
|
|
1902
|
+
updated_at: nowIso,
|
|
1903
|
+
},
|
|
1904
|
+
cwd,
|
|
1905
|
+
);
|
|
1906
|
+
|
|
1907
|
+
const existingAttention = await readTeamLeaderAttention(activeTeam.teamName, cwd);
|
|
1908
|
+
await writeTeamLeaderAttention(
|
|
1909
|
+
activeTeam.teamName,
|
|
1910
|
+
{
|
|
1911
|
+
team_name: activeTeam.teamName,
|
|
1912
|
+
updated_at: nowIso,
|
|
1913
|
+
source: "notify_hook",
|
|
1914
|
+
leader_decision_state: existingAttention?.leader_decision_state ?? "still_actionable",
|
|
1915
|
+
leader_attention_pending: true,
|
|
1916
|
+
leader_attention_reason: "mcp_transport_dead",
|
|
1917
|
+
attention_reasons: [
|
|
1918
|
+
...new Set([...(existingAttention?.attention_reasons ?? []), "mcp_transport_dead"]),
|
|
1919
|
+
],
|
|
1920
|
+
leader_stale: existingAttention?.leader_stale ?? false,
|
|
1921
|
+
leader_session_active: existingAttention?.leader_session_active ?? true,
|
|
1922
|
+
leader_session_id: existingAttention?.leader_session_id ?? (canonicalSessionId || null),
|
|
1923
|
+
leader_session_stopped_at: existingAttention?.leader_session_stopped_at ?? null,
|
|
1924
|
+
unread_leader_message_count: existingAttention?.unread_leader_message_count ?? 0,
|
|
1925
|
+
work_remaining: existingAttention?.work_remaining ?? true,
|
|
1926
|
+
stalled_for_ms: existingAttention?.stalled_for_ms ?? null,
|
|
1927
|
+
},
|
|
1928
|
+
cwd,
|
|
1929
|
+
);
|
|
1930
|
+
|
|
1931
|
+
await appendTeamEvent(
|
|
1932
|
+
activeTeam.teamName,
|
|
1933
|
+
{
|
|
1934
|
+
type: "leader_attention",
|
|
1935
|
+
worker: "leader-fixed",
|
|
1936
|
+
reason: "mcp_transport_dead",
|
|
1937
|
+
metadata: {
|
|
1938
|
+
phase_before: formatPhase(currentPhase),
|
|
1939
|
+
},
|
|
1940
|
+
},
|
|
1941
|
+
cwd,
|
|
1942
|
+
).catch(() => {});
|
|
1943
|
+
|
|
1944
|
+
try {
|
|
1945
|
+
await updateModeState(
|
|
1946
|
+
"team",
|
|
1947
|
+
{
|
|
1948
|
+
current_phase: "failed",
|
|
1949
|
+
error: "mcp_transport_dead",
|
|
1950
|
+
last_turn_at: nowIso,
|
|
1951
|
+
},
|
|
1952
|
+
cwd,
|
|
1953
|
+
canonicalSessionId || undefined,
|
|
1954
|
+
);
|
|
1955
|
+
} catch {
|
|
1956
|
+
// Canonical team state already carries the preserved failure for coarse-state-missing sessions.
|
|
1957
|
+
}
|
|
1958
|
+
}
|
|
1959
|
+
|
|
1960
|
+
async function buildStopHookOutput(
|
|
1961
|
+
payload: CodexHookPayload,
|
|
1962
|
+
cwd: string,
|
|
1963
|
+
stateDir: string,
|
|
1964
|
+
): Promise<Record<string, unknown> | null> {
|
|
1965
|
+
if (isStopExempt(payload)) {
|
|
1966
|
+
return null;
|
|
1967
|
+
}
|
|
1968
|
+
|
|
1969
|
+
const sessionId = readPayloadSessionId(payload);
|
|
1970
|
+
const canonicalSessionId = await resolveInternalSessionIdForPayload(cwd, sessionId);
|
|
1971
|
+
const threadId = readPayloadThreadId(payload);
|
|
1972
|
+
const execFollowupOutput = await buildExecFollowupStopOutput(cwd, canonicalSessionId);
|
|
1973
|
+
if (execFollowupOutput) return execFollowupOutput;
|
|
1974
|
+
const ralphState = await readActiveRalphState(stateDir, canonicalSessionId, {
|
|
1975
|
+
payloadSessionId: sessionId,
|
|
1976
|
+
threadId,
|
|
1977
|
+
tmuxPaneId: safeString(process.env.TMUX_PANE).trim(),
|
|
1978
|
+
});
|
|
1979
|
+
if (!ralphState) {
|
|
1980
|
+
const autoresearchState = await readActiveAutoresearchState(cwd, canonicalSessionId);
|
|
1981
|
+
if (autoresearchState) {
|
|
1982
|
+
const completion = await readAutoresearchCompletionStatus(cwd, canonicalSessionId!.trim());
|
|
1983
|
+
if (!completion.complete) {
|
|
1984
|
+
const currentPhase = safeString(autoresearchState.current_phase ?? autoresearchState.currentPhase).trim() || 'executing';
|
|
1985
|
+
const systemMessage = `RCS autoresearch is still active (phase: ${currentPhase}); continue until validator evidence is complete before stopping.`;
|
|
1986
|
+
return await maybeReturnRepeatableStopOutput(
|
|
1987
|
+
payload,
|
|
1988
|
+
stateDir,
|
|
1989
|
+
buildRepeatableStopSignature(payload, 'autoresearch-stop', `${currentPhase}|${completion.reason}`, canonicalSessionId),
|
|
1990
|
+
{
|
|
1991
|
+
decision: 'block',
|
|
1992
|
+
reason: systemMessage,
|
|
1993
|
+
stopReason: `autoresearch_${currentPhase}`,
|
|
1994
|
+
systemMessage,
|
|
1995
|
+
},
|
|
1996
|
+
canonicalSessionId,
|
|
1997
|
+
{ allowRepeatDuringStopHook: true },
|
|
1998
|
+
);
|
|
1999
|
+
}
|
|
2000
|
+
}
|
|
2001
|
+
|
|
2002
|
+
const teamWorkerOutput = await buildTeamWorkerStopOutput(cwd);
|
|
2003
|
+
if (hasTeamWorkerContext() && teamWorkerOutput) {
|
|
2004
|
+
return await returnPersistentStopBlock(
|
|
2005
|
+
payload,
|
|
2006
|
+
stateDir,
|
|
2007
|
+
"team-worker-stop",
|
|
2008
|
+
safeString(teamWorkerOutput.stopReason),
|
|
2009
|
+
teamWorkerOutput,
|
|
2010
|
+
canonicalSessionId,
|
|
2011
|
+
{ allowRepeatDuringStopHook: false },
|
|
2012
|
+
);
|
|
2013
|
+
}
|
|
2014
|
+
|
|
2015
|
+
const autopilotOutput = await buildModeBasedStopOutput("autopilot", cwd, canonicalSessionId);
|
|
2016
|
+
if (autopilotOutput) {
|
|
2017
|
+
return await returnPersistentStopBlock(
|
|
2018
|
+
payload,
|
|
2019
|
+
stateDir,
|
|
2020
|
+
"autopilot-stop",
|
|
2021
|
+
safeString(autopilotOutput.stopReason),
|
|
2022
|
+
autopilotOutput,
|
|
2023
|
+
canonicalSessionId,
|
|
2024
|
+
{ allowRepeatDuringStopHook: false },
|
|
2025
|
+
);
|
|
2026
|
+
}
|
|
2027
|
+
|
|
2028
|
+
const ultraworkOutput = await buildModeBasedStopOutput("ultrawork", cwd, canonicalSessionId);
|
|
2029
|
+
if (ultraworkOutput) {
|
|
2030
|
+
return await returnPersistentStopBlock(
|
|
2031
|
+
payload,
|
|
2032
|
+
stateDir,
|
|
2033
|
+
"ultrawork-stop",
|
|
2034
|
+
safeString(ultraworkOutput.stopReason),
|
|
2035
|
+
ultraworkOutput,
|
|
2036
|
+
canonicalSessionId,
|
|
2037
|
+
{ allowRepeatDuringStopHook: false },
|
|
2038
|
+
);
|
|
2039
|
+
}
|
|
2040
|
+
|
|
2041
|
+
const ultraqaOutput = await buildModeBasedStopOutput("ultraqa", cwd, canonicalSessionId);
|
|
2042
|
+
if (ultraqaOutput) {
|
|
2043
|
+
return await returnPersistentStopBlock(
|
|
2044
|
+
payload,
|
|
2045
|
+
stateDir,
|
|
2046
|
+
"ultraqa-stop",
|
|
2047
|
+
safeString(ultraqaOutput.stopReason),
|
|
2048
|
+
ultraqaOutput,
|
|
2049
|
+
canonicalSessionId,
|
|
2050
|
+
);
|
|
2051
|
+
}
|
|
2052
|
+
|
|
2053
|
+
const releaseReadinessFinalizeResult = await maybeBuildReleaseReadinessFinalizeStopOutput(
|
|
2054
|
+
payload,
|
|
2055
|
+
cwd,
|
|
2056
|
+
stateDir,
|
|
2057
|
+
canonicalSessionId,
|
|
2058
|
+
);
|
|
2059
|
+
if (releaseReadinessFinalizeResult.matched) return releaseReadinessFinalizeResult.output;
|
|
2060
|
+
|
|
2061
|
+
const teamOutput = await buildTeamStopOutput(cwd, canonicalSessionId);
|
|
2062
|
+
if (teamOutput) {
|
|
2063
|
+
return await returnPersistentStopBlock(
|
|
2064
|
+
payload,
|
|
2065
|
+
stateDir,
|
|
2066
|
+
"team-stop",
|
|
2067
|
+
safeString(teamOutput.stopReason),
|
|
2068
|
+
teamOutput,
|
|
2069
|
+
canonicalSessionId,
|
|
2070
|
+
);
|
|
2071
|
+
}
|
|
2072
|
+
|
|
2073
|
+
if (canonicalSessionId) {
|
|
2074
|
+
const deepInterviewQuestionOutput = await buildDeepInterviewQuestionStopOutput(
|
|
2075
|
+
cwd,
|
|
2076
|
+
canonicalSessionId,
|
|
2077
|
+
threadId,
|
|
2078
|
+
);
|
|
2079
|
+
if (deepInterviewQuestionOutput) {
|
|
2080
|
+
return await returnPersistentStopBlock(
|
|
2081
|
+
payload,
|
|
2082
|
+
stateDir,
|
|
2083
|
+
"deep-interview-question-stop",
|
|
2084
|
+
deepInterviewQuestionOutput.obligationId,
|
|
2085
|
+
deepInterviewQuestionOutput.output,
|
|
2086
|
+
canonicalSessionId,
|
|
2087
|
+
);
|
|
2088
|
+
}
|
|
2089
|
+
|
|
2090
|
+
const canonicalTeam = await readCanonicalTerminalRunStateForStop(cwd, canonicalSessionId, "team")
|
|
2091
|
+
? null
|
|
2092
|
+
: await findCanonicalActiveTeamForSession(cwd, canonicalSessionId);
|
|
2093
|
+
if (canonicalTeam) {
|
|
2094
|
+
const canonicalTeamOutput = buildTeamStopOutputForPhase(
|
|
2095
|
+
canonicalTeam.teamName,
|
|
2096
|
+
canonicalTeam.phase,
|
|
2097
|
+
);
|
|
2098
|
+
const repeatedCanonicalTeamOutput = await returnPersistentStopBlock(
|
|
2099
|
+
payload,
|
|
2100
|
+
stateDir,
|
|
2101
|
+
"team-stop",
|
|
2102
|
+
`${canonicalTeam.teamName}|${canonicalTeam.phase}`,
|
|
2103
|
+
canonicalTeamOutput,
|
|
2104
|
+
canonicalSessionId,
|
|
2105
|
+
);
|
|
2106
|
+
if (repeatedCanonicalTeamOutput) return repeatedCanonicalTeamOutput;
|
|
2107
|
+
}
|
|
2108
|
+
|
|
2109
|
+
const skillOutput = await buildSkillStopOutput(cwd, canonicalSessionId, threadId);
|
|
2110
|
+
if (skillOutput) {
|
|
2111
|
+
return await returnPersistentStopBlock(
|
|
2112
|
+
payload,
|
|
2113
|
+
stateDir,
|
|
2114
|
+
"skill-stop",
|
|
2115
|
+
safeString(skillOutput.stopReason),
|
|
2116
|
+
skillOutput,
|
|
2117
|
+
canonicalSessionId,
|
|
2118
|
+
);
|
|
2119
|
+
}
|
|
2120
|
+
}
|
|
2121
|
+
|
|
2122
|
+
|
|
2123
|
+
const lastAssistantMessage = safeString(
|
|
2124
|
+
payload.last_assistant_message ?? payload.lastAssistantMessage,
|
|
2125
|
+
);
|
|
2126
|
+
const autoNudgeConfig = await loadAutoNudgeConfig();
|
|
2127
|
+
const autoNudgePhase = await readStopAutoNudgePhase(cwd, canonicalSessionId, threadId);
|
|
2128
|
+
|
|
2129
|
+
if (
|
|
2130
|
+
autoNudgeConfig.enabled
|
|
2131
|
+
&& detectNativeStopStallPattern(lastAssistantMessage, autoNudgeConfig.patterns, autoNudgePhase)
|
|
2132
|
+
) {
|
|
2133
|
+
const effectiveResponse = resolveEffectiveAutoNudgeResponse(autoNudgeConfig.response);
|
|
2134
|
+
return await returnPersistentStopBlock(
|
|
2135
|
+
payload,
|
|
2136
|
+
stateDir,
|
|
2137
|
+
"auto-nudge",
|
|
2138
|
+
lastAssistantMessage,
|
|
2139
|
+
{
|
|
2140
|
+
decision: "block",
|
|
2141
|
+
reason: effectiveResponse,
|
|
2142
|
+
stopReason: "auto_nudge",
|
|
2143
|
+
systemMessage:
|
|
2144
|
+
"RCS native Stop detected a stall/permission-style handoff and continued the turn automatically.",
|
|
2145
|
+
},
|
|
2146
|
+
canonicalSessionId,
|
|
2147
|
+
);
|
|
2148
|
+
}
|
|
2149
|
+
|
|
2150
|
+
if (isFinalHandoffDocumentRefreshCandidate(lastAssistantMessage)) {
|
|
2151
|
+
const documentRefreshWarning = evaluateFinalHandoffDocumentRefresh(cwd, lastAssistantMessage);
|
|
2152
|
+
if (documentRefreshWarning) {
|
|
2153
|
+
return await maybeReturnRepeatableStopOutput(
|
|
2154
|
+
payload,
|
|
2155
|
+
stateDir,
|
|
2156
|
+
buildRepeatableStopSignature(
|
|
2157
|
+
payload,
|
|
2158
|
+
"document-refresh-stop",
|
|
2159
|
+
documentRefreshWarning.triggeringPaths.join("|"),
|
|
2160
|
+
canonicalSessionId,
|
|
2161
|
+
),
|
|
2162
|
+
buildDocumentRefreshAdvisoryOutput(documentRefreshWarning, "Stop"),
|
|
2163
|
+
canonicalSessionId,
|
|
2164
|
+
{ allowRepeatDuringStopHook: false },
|
|
2165
|
+
);
|
|
2166
|
+
}
|
|
2167
|
+
}
|
|
2168
|
+
|
|
2169
|
+
return null;
|
|
2170
|
+
}
|
|
2171
|
+
|
|
2172
|
+
const currentPhase = safeString(ralphState.state.current_phase).trim() || "executing";
|
|
2173
|
+
const blockingPath = formatStopStatePath(cwd, ralphState.path);
|
|
2174
|
+
const stopReason = `ralph_${currentPhase}`;
|
|
2175
|
+
const systemMessage =
|
|
2176
|
+
`RCS Ralph is still active (phase: ${currentPhase}; state: ${blockingPath}); continue the task and gather fresh verification evidence before stopping.`;
|
|
2177
|
+
|
|
2178
|
+
return await returnPersistentStopBlock(
|
|
2179
|
+
payload,
|
|
2180
|
+
stateDir,
|
|
2181
|
+
"ralph-stop",
|
|
2182
|
+
currentPhase,
|
|
2183
|
+
{
|
|
2184
|
+
decision: "block",
|
|
2185
|
+
reason: systemMessage,
|
|
2186
|
+
stopReason,
|
|
2187
|
+
systemMessage,
|
|
2188
|
+
},
|
|
2189
|
+
canonicalSessionId,
|
|
2190
|
+
);
|
|
2191
|
+
}
|
|
2192
|
+
|
|
2193
|
+
export async function dispatchCodexNativeHook(
|
|
2194
|
+
payload: CodexHookPayload,
|
|
2195
|
+
options: NativeHookDispatchOptions = {},
|
|
2196
|
+
): Promise<NativeHookDispatchResult> {
|
|
2197
|
+
const hookEventName = readHookEventName(payload);
|
|
2198
|
+
const cwd = options.cwd ?? (safeString(payload.cwd).trim() || process.cwd());
|
|
2199
|
+
const stateDir = join(cwd, ".rcs", "state");
|
|
2200
|
+
await mkdir(stateDir, { recursive: true });
|
|
2201
|
+
|
|
2202
|
+
const rcsEventName = mapCodexHookEventToRcsEvent(hookEventName);
|
|
2203
|
+
let skillState: SkillActiveState | null = null;
|
|
2204
|
+
let triageAdditionalContext: string | null = null;
|
|
2205
|
+
|
|
2206
|
+
const nativeSessionId = safeString(payload.session_id ?? payload.sessionId).trim();
|
|
2207
|
+
const threadId = safeString(payload.thread_id ?? payload.threadId).trim();
|
|
2208
|
+
const turnId = safeString(payload.turn_id ?? payload.turnId).trim();
|
|
2209
|
+
const currentSessionState = await readUsableSessionState(cwd);
|
|
2210
|
+
let canonicalSessionId = safeString(currentSessionState?.session_id).trim();
|
|
2211
|
+
let resolvedNativeSessionId = nativeSessionId;
|
|
2212
|
+
let skipCanonicalSessionStartContext = false;
|
|
2213
|
+
|
|
2214
|
+
if (hookEventName === "SessionStart" && nativeSessionId) {
|
|
2215
|
+
const transcriptPath = safeString(payload.transcript_path ?? payload.transcriptPath).trim();
|
|
2216
|
+
const subagentSessionStart = readNativeSubagentSessionStartMetadata(transcriptPath);
|
|
2217
|
+
if (subagentSessionStart && canonicalSessionId) {
|
|
2218
|
+
const belongsToCanonicalSession = await nativeSubagentSessionStartBelongsToCanonicalSession(
|
|
2219
|
+
cwd,
|
|
2220
|
+
canonicalSessionId,
|
|
2221
|
+
currentSessionState,
|
|
2222
|
+
subagentSessionStart,
|
|
2223
|
+
);
|
|
2224
|
+
if (belongsToCanonicalSession) {
|
|
2225
|
+
resolvedNativeSessionId = nativeSessionId;
|
|
2226
|
+
await recordNativeSubagentSessionStart(
|
|
2227
|
+
cwd,
|
|
2228
|
+
canonicalSessionId,
|
|
2229
|
+
nativeSessionId,
|
|
2230
|
+
subagentSessionStart,
|
|
2231
|
+
transcriptPath,
|
|
2232
|
+
);
|
|
2233
|
+
} else {
|
|
2234
|
+
skipCanonicalSessionStartContext = true;
|
|
2235
|
+
resolvedNativeSessionId =
|
|
2236
|
+
safeString(currentSessionState?.native_session_id).trim() || nativeSessionId;
|
|
2237
|
+
await recordIgnoredNativeSubagentSessionStart(
|
|
2238
|
+
cwd,
|
|
2239
|
+
canonicalSessionId,
|
|
2240
|
+
nativeSessionId,
|
|
2241
|
+
subagentSessionStart,
|
|
2242
|
+
transcriptPath,
|
|
2243
|
+
);
|
|
2244
|
+
}
|
|
2245
|
+
} else {
|
|
2246
|
+
const sessionState = await reconcileNativeSessionStart(cwd, nativeSessionId, {
|
|
2247
|
+
pid: options.sessionOwnerPid ?? resolveSessionOwnerPid(payload),
|
|
2248
|
+
});
|
|
2249
|
+
canonicalSessionId = safeString(sessionState.session_id).trim();
|
|
2250
|
+
resolvedNativeSessionId = safeString(sessionState.native_session_id).trim() || nativeSessionId;
|
|
2251
|
+
}
|
|
2252
|
+
} else if (!canonicalSessionId) {
|
|
2253
|
+
canonicalSessionId = safeString(currentSessionState?.session_id).trim();
|
|
2254
|
+
}
|
|
2255
|
+
|
|
2256
|
+
if (hookEventName === "Stop") {
|
|
2257
|
+
const stopCanonicalSessionId = await resolveInternalSessionIdForPayload(
|
|
2258
|
+
cwd,
|
|
2259
|
+
readPayloadSessionId(payload),
|
|
2260
|
+
);
|
|
2261
|
+
if (stopCanonicalSessionId) {
|
|
2262
|
+
canonicalSessionId = stopCanonicalSessionId;
|
|
2263
|
+
}
|
|
2264
|
+
if (canonicalSessionId && safeString(currentSessionState?.session_id).trim() === canonicalSessionId) {
|
|
2265
|
+
resolvedNativeSessionId =
|
|
2266
|
+
safeString(currentSessionState?.native_session_id).trim() || resolvedNativeSessionId;
|
|
2267
|
+
}
|
|
2268
|
+
}
|
|
2269
|
+
|
|
2270
|
+
const eventSessionId = canonicalSessionId || nativeSessionId || undefined;
|
|
2271
|
+
const sessionIdForState = canonicalSessionId || nativeSessionId;
|
|
2272
|
+
let outputJson: Record<string, unknown> | null = null;
|
|
2273
|
+
|
|
2274
|
+
if (hookEventName === "UserPromptSubmit") {
|
|
2275
|
+
const prompt = readPromptText(payload);
|
|
2276
|
+
if (prompt) {
|
|
2277
|
+
skillState = buildNativeOutsideTmuxTeamPromptBlockState(
|
|
2278
|
+
prompt,
|
|
2279
|
+
cwd,
|
|
2280
|
+
payload,
|
|
2281
|
+
sessionIdForState,
|
|
2282
|
+
threadId || undefined,
|
|
2283
|
+
turnId || undefined,
|
|
2284
|
+
) ?? await recordSkillActivation({
|
|
2285
|
+
stateDir,
|
|
2286
|
+
text: prompt,
|
|
2287
|
+
sessionId: sessionIdForState,
|
|
2288
|
+
threadId,
|
|
2289
|
+
turnId,
|
|
2290
|
+
});
|
|
2291
|
+
}
|
|
2292
|
+
// --- Triage classifier (advisory-only, non-keyword prompts) ---
|
|
2293
|
+
if (prompt && skillState === null) {
|
|
2294
|
+
try {
|
|
2295
|
+
if (readTriageConfig().enabled) {
|
|
2296
|
+
const normalized = prompt.trim().toLowerCase();
|
|
2297
|
+
const previous = readTriageState({ cwd, sessionId: sessionIdForState || null });
|
|
2298
|
+
const suppress = shouldSuppressFollowup({
|
|
2299
|
+
previous,
|
|
2300
|
+
currentPrompt: normalized,
|
|
2301
|
+
currentHasKeyword: false,
|
|
2302
|
+
});
|
|
2303
|
+
if (!suppress) {
|
|
2304
|
+
const decision = triagePrompt(prompt);
|
|
2305
|
+
const nowIso = new Date().toISOString();
|
|
2306
|
+
const effectiveTurnId = turnId || nowIso;
|
|
2307
|
+
if (decision.lane === "HEAVY") {
|
|
2308
|
+
triageAdditionalContext =
|
|
2309
|
+
"RCS native UserPromptSubmit triage detected a multi-step goal with no workflow keyword. This is advisory prompt-routing context only; it did not activate autopilot or initialize workflow state. Prefer the existing autopilot-style workflow if AGENTS.md/runtime conditions allow it, unless newer user context narrows or opts out.";
|
|
2310
|
+
const newState: TriageStateFile = {
|
|
2311
|
+
version: 1,
|
|
2312
|
+
last_triage: {
|
|
2313
|
+
lane: "HEAVY",
|
|
2314
|
+
destination: "autopilot",
|
|
2315
|
+
reason: decision.reason,
|
|
2316
|
+
prompt_signature: promptSignature(normalized),
|
|
2317
|
+
turn_id: effectiveTurnId,
|
|
2318
|
+
created_at: nowIso,
|
|
2319
|
+
},
|
|
2320
|
+
suppress_followup: true,
|
|
2321
|
+
};
|
|
2322
|
+
writeTriageState({ cwd, sessionId: sessionIdForState || null, state: newState });
|
|
2323
|
+
} else if (decision.lane === "LIGHT") {
|
|
2324
|
+
if (decision.destination === "explore") {
|
|
2325
|
+
triageAdditionalContext =
|
|
2326
|
+
"RCS native UserPromptSubmit triage detected a read-only/question-shaped request with no workflow keyword. This is advisory prompt-routing context only. Prefer the explore role surface rather than escalating to autopilot.";
|
|
2327
|
+
} else if (decision.destination === "executor") {
|
|
2328
|
+
triageAdditionalContext =
|
|
2329
|
+
"RCS native UserPromptSubmit triage detected a narrow edit-shaped request with no workflow keyword. This is advisory prompt-routing context only. Prefer the executor role surface rather than autopilot.";
|
|
2330
|
+
} else if (decision.destination === "designer") {
|
|
2331
|
+
triageAdditionalContext =
|
|
2332
|
+
"RCS native UserPromptSubmit triage detected a visual/style request with no workflow keyword. This is advisory prompt-routing context only. Prefer the designer role surface.";
|
|
2333
|
+
} else if (decision.destination === "researcher") {
|
|
2334
|
+
triageAdditionalContext =
|
|
2335
|
+
"RCS native UserPromptSubmit triage detected an external documentation/reference research request with no workflow keyword. This is advisory prompt-routing context only. Prefer the researcher role surface rather than repo-local explore or autopilot.";
|
|
2336
|
+
}
|
|
2337
|
+
if (triageAdditionalContext !== null) {
|
|
2338
|
+
const dest = decision.destination as "explore" | "executor" | "designer" | "researcher";
|
|
2339
|
+
const newState: TriageStateFile = {
|
|
2340
|
+
version: 1,
|
|
2341
|
+
last_triage: {
|
|
2342
|
+
lane: "LIGHT",
|
|
2343
|
+
destination: dest,
|
|
2344
|
+
reason: decision.reason,
|
|
2345
|
+
prompt_signature: promptSignature(normalized),
|
|
2346
|
+
turn_id: effectiveTurnId,
|
|
2347
|
+
created_at: nowIso,
|
|
2348
|
+
},
|
|
2349
|
+
suppress_followup: true,
|
|
2350
|
+
};
|
|
2351
|
+
writeTriageState({ cwd, sessionId: sessionIdForState || null, state: newState });
|
|
2352
|
+
}
|
|
2353
|
+
}
|
|
2354
|
+
// lane === "PASS": no context, no state write
|
|
2355
|
+
}
|
|
2356
|
+
}
|
|
2357
|
+
} catch {
|
|
2358
|
+
// Swallow all triage errors; never break the hook
|
|
2359
|
+
triageAdditionalContext = null;
|
|
2360
|
+
}
|
|
2361
|
+
}
|
|
2362
|
+
const reconcileHudForPromptSubmitFn = options.reconcileHudForPromptSubmitFn ?? reconcileHudForPromptSubmit;
|
|
2363
|
+
await reconcileHudForPromptSubmitFn(cwd, { sessionId: canonicalSessionId || sessionIdForState || undefined }).catch(() => {});
|
|
2364
|
+
}
|
|
2365
|
+
|
|
2366
|
+
if (rcsEventName && !skipCanonicalSessionStartContext) {
|
|
2367
|
+
const baseContext = buildBaseContext(cwd, payload, hookEventName!, canonicalSessionId);
|
|
2368
|
+
if (resolvedNativeSessionId) {
|
|
2369
|
+
baseContext.native_session_id = resolvedNativeSessionId;
|
|
2370
|
+
baseContext.codex_session_id = resolvedNativeSessionId;
|
|
2371
|
+
}
|
|
2372
|
+
if (canonicalSessionId) {
|
|
2373
|
+
baseContext.rcs_session_id = canonicalSessionId;
|
|
2374
|
+
}
|
|
2375
|
+
const event: HookEventEnvelope = buildNativeHookEvent(
|
|
2376
|
+
rcsEventName,
|
|
2377
|
+
baseContext,
|
|
2378
|
+
{
|
|
2379
|
+
session_id: eventSessionId,
|
|
2380
|
+
thread_id: threadId || undefined,
|
|
2381
|
+
turn_id: turnId || undefined,
|
|
2382
|
+
mode: safeString(payload.mode).trim() || undefined,
|
|
2383
|
+
},
|
|
2384
|
+
);
|
|
2385
|
+
await dispatchHookEvent(event, { cwd });
|
|
2386
|
+
}
|
|
2387
|
+
|
|
2388
|
+
if ((hookEventName === "SessionStart" && !skipCanonicalSessionStartContext) || hookEventName === "UserPromptSubmit") {
|
|
2389
|
+
const additionalContext = hookEventName === "SessionStart"
|
|
2390
|
+
? await buildSessionStartContext(cwd, canonicalSessionId || nativeSessionId, {
|
|
2391
|
+
hookEventName,
|
|
2392
|
+
payload,
|
|
2393
|
+
canonicalSessionId,
|
|
2394
|
+
nativeSessionId: resolvedNativeSessionId || nativeSessionId,
|
|
2395
|
+
})
|
|
2396
|
+
: (buildAdditionalContextMessage(readPromptText(payload), skillState, cwd, payload) ?? triageAdditionalContext);
|
|
2397
|
+
if (additionalContext) {
|
|
2398
|
+
outputJson = {
|
|
2399
|
+
hookSpecificOutput: {
|
|
2400
|
+
hookEventName,
|
|
2401
|
+
additionalContext,
|
|
2402
|
+
},
|
|
2403
|
+
};
|
|
2404
|
+
}
|
|
2405
|
+
} else if (hookEventName === "PreToolUse") {
|
|
2406
|
+
outputJson = buildNativePreToolUseOutput(payload);
|
|
2407
|
+
} else if (hookEventName === "PostToolUse") {
|
|
2408
|
+
if (detectMcpTransportFailure(payload)) {
|
|
2409
|
+
await markTeamTransportFailure(cwd, payload);
|
|
2410
|
+
}
|
|
2411
|
+
outputJson = buildNativePostToolUseOutput(payload);
|
|
2412
|
+
await handleTeamWorkerPostToolUseSuccess(payload, cwd);
|
|
2413
|
+
} else if (hookEventName === "Stop") {
|
|
2414
|
+
outputJson = await buildStopHookOutput(payload, cwd, stateDir);
|
|
2415
|
+
}
|
|
2416
|
+
|
|
2417
|
+
return {
|
|
2418
|
+
hookEventName,
|
|
2419
|
+
rcsEventName,
|
|
2420
|
+
skillState,
|
|
2421
|
+
outputJson,
|
|
2422
|
+
};
|
|
2423
|
+
}
|
|
2424
|
+
|
|
2425
|
+
interface NativeHookCliReadResult {
|
|
2426
|
+
payload: CodexHookPayload;
|
|
2427
|
+
parseError: Error | null;
|
|
2428
|
+
}
|
|
2429
|
+
|
|
2430
|
+
export function isCodexNativeHookMainModule(
|
|
2431
|
+
moduleUrl: string,
|
|
2432
|
+
argv1: string | undefined,
|
|
2433
|
+
): boolean {
|
|
2434
|
+
if (!argv1) return false;
|
|
2435
|
+
return moduleUrl === pathToFileURL(argv1).href;
|
|
2436
|
+
}
|
|
2437
|
+
|
|
2438
|
+
async function readStdinJson(): Promise<NativeHookCliReadResult> {
|
|
2439
|
+
const chunks: Buffer[] = [];
|
|
2440
|
+
for await (const chunk of process.stdin) {
|
|
2441
|
+
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(String(chunk)));
|
|
2442
|
+
}
|
|
2443
|
+
const raw = Buffer.concat(chunks).toString("utf-8").trim();
|
|
2444
|
+
if (!raw) {
|
|
2445
|
+
return { payload: {}, parseError: null };
|
|
2446
|
+
}
|
|
2447
|
+
|
|
2448
|
+
try {
|
|
2449
|
+
return {
|
|
2450
|
+
payload: safeObject(JSON.parse(raw)),
|
|
2451
|
+
parseError: null,
|
|
2452
|
+
};
|
|
2453
|
+
} catch (error) {
|
|
2454
|
+
return {
|
|
2455
|
+
payload: {},
|
|
2456
|
+
parseError: error instanceof Error ? error : new Error(String(error)),
|
|
2457
|
+
};
|
|
2458
|
+
}
|
|
2459
|
+
}
|
|
2460
|
+
|
|
2461
|
+
function writeNativeHookJsonStdout(output: Record<string, unknown>): void {
|
|
2462
|
+
process.stdout.write(`${JSON.stringify(output)}\n`);
|
|
2463
|
+
}
|
|
2464
|
+
|
|
2465
|
+
function isStopDispatchFailureTestTrigger(payload: CodexHookPayload): boolean {
|
|
2466
|
+
return process.env.NODE_ENV === "test"
|
|
2467
|
+
&& process.env.RCS_NATIVE_HOOK_TEST_THROW_STOP_DISPATCH === "1"
|
|
2468
|
+
&& readHookEventName(payload) === "Stop";
|
|
2469
|
+
}
|
|
2470
|
+
|
|
2471
|
+
function buildStopDispatchFailureOutput(error: unknown): Record<string, unknown> {
|
|
2472
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
2473
|
+
const reason =
|
|
2474
|
+
"RCS native Stop hook failed before normal continuation handling. Continue once more, preserve runtime state, inspect the hook logs, and retry with a valid Stop JSON response.";
|
|
2475
|
+
return {
|
|
2476
|
+
decision: "block",
|
|
2477
|
+
reason,
|
|
2478
|
+
stopReason: "native_stop_dispatch_failure",
|
|
2479
|
+
systemMessage: `${reason} Failure: ${detail}`,
|
|
2480
|
+
};
|
|
2481
|
+
}
|
|
2482
|
+
|
|
2483
|
+
export async function runCodexNativeHookCli(): Promise<void> {
|
|
2484
|
+
const { payload, parseError } = await readStdinJson();
|
|
2485
|
+
if (parseError) {
|
|
2486
|
+
writeNativeHookJsonStdout({
|
|
2487
|
+
decision: "block",
|
|
2488
|
+
reason: "RCS native hook received malformed JSON input. Preserve runtime state, inspect the emitting hook payload yourself, and retry with valid JSON.",
|
|
2489
|
+
hookSpecificOutput: {
|
|
2490
|
+
hookEventName: "Unknown",
|
|
2491
|
+
additionalContext:
|
|
2492
|
+
`stdin JSON parsing failed inside codex-native-hook: ${parseError.message}. Emit valid JSON from the native hook caller before retrying.`,
|
|
2493
|
+
},
|
|
2494
|
+
});
|
|
2495
|
+
return;
|
|
2496
|
+
}
|
|
2497
|
+
|
|
2498
|
+
try {
|
|
2499
|
+
if (isStopDispatchFailureTestTrigger(payload)) {
|
|
2500
|
+
throw new Error("test-induced Stop dispatch failure");
|
|
2501
|
+
}
|
|
2502
|
+
|
|
2503
|
+
const result = await dispatchCodexNativeHook(payload);
|
|
2504
|
+
if (result.outputJson) {
|
|
2505
|
+
writeNativeHookJsonStdout(result.outputJson);
|
|
2506
|
+
} else if (result.hookEventName === "Stop") {
|
|
2507
|
+
writeNativeHookJsonStdout({});
|
|
2508
|
+
}
|
|
2509
|
+
} catch (error) {
|
|
2510
|
+
if (readHookEventName(payload) !== "Stop") {
|
|
2511
|
+
throw error;
|
|
2512
|
+
}
|
|
2513
|
+
process.stderr.write(
|
|
2514
|
+
`[rcs] codex-native Stop hook dispatch failed: ${
|
|
2515
|
+
error instanceof Error ? error.message : String(error)
|
|
2516
|
+
}\n`,
|
|
2517
|
+
);
|
|
2518
|
+
writeNativeHookJsonStdout(buildStopDispatchFailureOutput(error));
|
|
2519
|
+
}
|
|
2520
|
+
}
|
|
2521
|
+
|
|
2522
|
+
if (isCodexNativeHookMainModule(import.meta.url, process.argv[1])) {
|
|
2523
|
+
runCodexNativeHookCli().catch((error) => {
|
|
2524
|
+
process.stderr.write(
|
|
2525
|
+
`[rcs] codex-native-hook failed: ${
|
|
2526
|
+
error instanceof Error ? error.message : String(error)
|
|
2527
|
+
}\n`,
|
|
2528
|
+
);
|
|
2529
|
+
process.exitCode = 1;
|
|
2530
|
+
});
|
|
2531
|
+
}
|