oh-my-codex 0.11.13 → 0.12.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/Cargo.lock +5 -5
- package/Cargo.toml +1 -1
- package/README.md +27 -17
- package/crates/omx-runtime/src/main.rs +6 -2
- package/dist/agents/native-config.js +1 -1
- package/dist/agents/native-config.js.map +1 -1
- package/dist/cli/__tests__/autoresearch-guided.test.js +74 -2
- package/dist/cli/__tests__/autoresearch-guided.test.js.map +1 -1
- package/dist/cli/__tests__/cleanup.test.js +22 -30
- package/dist/cli/__tests__/cleanup.test.js.map +1 -1
- package/dist/cli/__tests__/error-handling-warnings.test.js +3 -1
- package/dist/cli/__tests__/error-handling-warnings.test.js.map +1 -1
- package/dist/cli/__tests__/index.test.js +217 -4
- package/dist/cli/__tests__/index.test.js.map +1 -1
- package/dist/cli/__tests__/setup-refresh.test.js +49 -9
- package/dist/cli/__tests__/setup-refresh.test.js.map +1 -1
- package/dist/cli/__tests__/setup-scope.test.js +9 -0
- package/dist/cli/__tests__/setup-scope.test.js.map +1 -1
- package/dist/cli/__tests__/team.test.js +136 -11
- package/dist/cli/__tests__/team.test.js.map +1 -1
- package/dist/cli/__tests__/uninstall.test.js +10 -0
- package/dist/cli/__tests__/uninstall.test.js.map +1 -1
- package/dist/cli/__tests__/windows-popup-loop-contract.test.js +1 -0
- package/dist/cli/__tests__/windows-popup-loop-contract.test.js.map +1 -1
- package/dist/cli/autoresearch-guided.d.ts.map +1 -1
- package/dist/cli/autoresearch-guided.js +2 -1
- package/dist/cli/autoresearch-guided.js.map +1 -1
- package/dist/cli/autoresearch.d.ts.map +1 -1
- package/dist/cli/autoresearch.js +2 -1
- package/dist/cli/autoresearch.js.map +1 -1
- package/dist/cli/cleanup.d.ts.map +1 -1
- package/dist/cli/cleanup.js +4 -2
- package/dist/cli/cleanup.js.map +1 -1
- package/dist/cli/index.d.ts +12 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +238 -30
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/omx.js +2 -0
- package/dist/cli/omx.js.map +1 -1
- package/dist/cli/setup.d.ts +1 -0
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +41 -7
- package/dist/cli/setup.js.map +1 -1
- package/dist/cli/team.d.ts.map +1 -1
- package/dist/cli/team.js +16 -557
- package/dist/cli/team.js.map +1 -1
- package/dist/cli/uninstall.d.ts.map +1 -1
- package/dist/cli/uninstall.js +34 -9
- package/dist/cli/uninstall.js.map +1 -1
- package/dist/config/__tests__/generator-idempotent.test.js +79 -2
- package/dist/config/__tests__/generator-idempotent.test.js.map +1 -1
- package/dist/config/__tests__/generator-notify.test.js +2 -0
- package/dist/config/__tests__/generator-notify.test.js.map +1 -1
- package/dist/config/codex-hooks.d.ts +11 -0
- package/dist/config/codex-hooks.d.ts.map +1 -0
- package/dist/config/codex-hooks.js +50 -0
- package/dist/config/codex-hooks.js.map +1 -0
- package/dist/config/generator.d.ts +5 -3
- package/dist/config/generator.d.ts.map +1 -1
- package/dist/config/generator.js +24 -14
- package/dist/config/generator.js.map +1 -1
- 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__/notify-fallback-watcher.test.js +236 -2
- package/dist/hooks/__tests__/notify-fallback-watcher.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js +86 -0
- package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js +40 -0
- package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js.map +1 -1
- 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 +54 -0
- package/dist/hooks/__tests__/notify-hook-managed-tmux.test.js.map +1 -0
- package/dist/hooks/__tests__/notify-hook-modules.test.js +31 -0
- package/dist/hooks/__tests__/notify-hook-modules.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-ralph-resume.test.js +51 -0
- package/dist/hooks/__tests__/notify-hook-ralph-resume.test.js.map +1 -1
- 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 +136 -0
- package/dist/hooks/__tests__/notify-hook-session-idle-dedupe.test.js.map +1 -0
- package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js +120 -0
- package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js +145 -20
- package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js +116 -0
- package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-worker-idle.test.js +86 -0
- package/dist/hooks/__tests__/notify-hook-worker-idle.test.js.map +1 -1
- package/dist/hooks/__tests__/pre-context-gate-skills.test.js +1 -0
- package/dist/hooks/__tests__/pre-context-gate-skills.test.js.map +1 -1
- package/dist/hooks/extensibility/__tests__/runtime.test.js +49 -0
- package/dist/hooks/extensibility/__tests__/runtime.test.js.map +1 -1
- package/dist/hooks/extensibility/runtime.d.ts.map +1 -1
- package/dist/hooks/extensibility/runtime.js +10 -0
- package/dist/hooks/extensibility/runtime.js.map +1 -1
- package/dist/hooks/extensibility/types.d.ts +1 -1
- package/dist/hooks/extensibility/types.d.ts.map +1 -1
- package/dist/hooks/prompt-guidance-contract.d.ts.map +1 -1
- package/dist/hooks/prompt-guidance-contract.js +12 -8
- package/dist/hooks/prompt-guidance-contract.js.map +1 -1
- package/dist/hooks/session.d.ts +5 -1
- package/dist/hooks/session.d.ts.map +1 -1
- package/dist/hooks/session.js +10 -6
- package/dist/hooks/session.js.map +1 -1
- package/dist/hud/index.d.ts.map +1 -1
- package/dist/hud/index.js +6 -1
- package/dist/hud/index.js.map +1 -1
- package/dist/mcp/__tests__/bootstrap.test.js +0 -3
- package/dist/mcp/__tests__/bootstrap.test.js.map +1 -1
- package/dist/mcp/__tests__/code-intel-server.test.js +27 -1
- package/dist/mcp/__tests__/code-intel-server.test.js.map +1 -1
- package/dist/mcp/__tests__/server-lifecycle.test.js +0 -5
- package/dist/mcp/__tests__/server-lifecycle.test.js.map +1 -1
- package/dist/mcp/bootstrap.d.ts +1 -1
- package/dist/mcp/bootstrap.d.ts.map +1 -1
- package/dist/mcp/bootstrap.js +0 -1
- package/dist/mcp/bootstrap.js.map +1 -1
- package/dist/mcp/code-intel-server.d.ts +20 -0
- package/dist/mcp/code-intel-server.d.ts.map +1 -1
- package/dist/mcp/code-intel-server.js +6 -5
- package/dist/mcp/code-intel-server.js.map +1 -1
- package/dist/notifications/__tests__/idle-cooldown.test.js +24 -1
- package/dist/notifications/__tests__/idle-cooldown.test.js.map +1 -1
- package/dist/notifications/__tests__/reply-listener.test.js +20 -1
- package/dist/notifications/__tests__/reply-listener.test.js.map +1 -1
- package/dist/notifications/__tests__/tmux.test.js +41 -0
- package/dist/notifications/__tests__/tmux.test.js.map +1 -1
- package/dist/notifications/idle-cooldown.d.ts +13 -0
- package/dist/notifications/idle-cooldown.d.ts.map +1 -1
- package/dist/notifications/idle-cooldown.js +50 -16
- package/dist/notifications/idle-cooldown.js.map +1 -1
- package/dist/notifications/reply-listener.d.ts.map +1 -1
- package/dist/notifications/reply-listener.js +2 -0
- package/dist/notifications/reply-listener.js.map +1 -1
- package/dist/notifications/tmux.d.ts.map +1 -1
- package/dist/notifications/tmux.js +4 -0
- package/dist/notifications/tmux.js.map +1 -1
- 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 +720 -0
- package/dist/scripts/__tests__/codex-native-hook.test.js.map +1 -0
- package/dist/scripts/codex-native-hook.d.ts +22 -0
- package/dist/scripts/codex-native-hook.d.ts.map +1 -0
- package/dist/scripts/codex-native-hook.js +594 -0
- package/dist/scripts/codex-native-hook.js.map +1 -0
- package/dist/scripts/codex-native-pre-post.d.ts +26 -0
- package/dist/scripts/codex-native-pre-post.d.ts.map +1 -0
- package/dist/scripts/codex-native-pre-post.js +118 -0
- package/dist/scripts/codex-native-pre-post.js.map +1 -0
- package/dist/scripts/notify-fallback-watcher.js +262 -18
- package/dist/scripts/notify-fallback-watcher.js.map +1 -1
- package/dist/scripts/notify-hook/auto-nudge.d.ts.map +1 -1
- package/dist/scripts/notify-hook/auto-nudge.js +5 -6
- package/dist/scripts/notify-hook/auto-nudge.js.map +1 -1
- package/dist/scripts/notify-hook/log.d.ts +2 -2
- package/dist/scripts/notify-hook/log.d.ts.map +1 -1
- package/dist/scripts/notify-hook/log.js +10 -2
- package/dist/scripts/notify-hook/log.js.map +1 -1
- package/dist/scripts/notify-hook/managed-tmux.d.ts.map +1 -1
- package/dist/scripts/notify-hook/managed-tmux.js +2 -0
- package/dist/scripts/notify-hook/managed-tmux.js.map +1 -1
- 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/process-runner.js.map +1 -1
- package/dist/scripts/notify-hook/ralph-session-resume.d.ts.map +1 -1
- package/dist/scripts/notify-hook/ralph-session-resume.js +7 -0
- package/dist/scripts/notify-hook/ralph-session-resume.js.map +1 -1
- package/dist/scripts/notify-hook/team-dispatch.d.ts +15 -6
- package/dist/scripts/notify-hook/team-dispatch.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-dispatch.js +125 -6
- package/dist/scripts/notify-hook/team-dispatch.js.map +1 -1
- package/dist/scripts/notify-hook/team-leader-nudge.d.ts +3 -2
- package/dist/scripts/notify-hook/team-leader-nudge.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-leader-nudge.js +165 -37
- package/dist/scripts/notify-hook/team-leader-nudge.js.map +1 -1
- package/dist/scripts/notify-hook/team-tmux-guard.d.ts +4 -1
- package/dist/scripts/notify-hook/team-tmux-guard.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-tmux-guard.js +33 -44
- package/dist/scripts/notify-hook/team-tmux-guard.js.map +1 -1
- package/dist/scripts/notify-hook/team-worker.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-worker.js +68 -5
- package/dist/scripts/notify-hook/team-worker.js.map +1 -1
- package/dist/scripts/notify-hook/utils.d.ts +1 -1
- package/dist/scripts/notify-hook/utils.d.ts.map +1 -1
- package/dist/scripts/notify-hook/utils.js.map +1 -1
- package/dist/scripts/notify-hook.js +55 -32
- package/dist/scripts/notify-hook.js.map +1 -1
- package/dist/team/__tests__/api-interop.test.js +344 -18
- package/dist/team/__tests__/api-interop.test.js.map +1 -1
- 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 +671 -0
- package/dist/team/__tests__/delivery-e2e-smoke.test.js.map +1 -0
- package/dist/team/__tests__/mcp-comm.test.js +5 -0
- package/dist/team/__tests__/mcp-comm.test.js.map +1 -1
- package/dist/team/__tests__/runtime.test.js +422 -12
- package/dist/team/__tests__/runtime.test.js.map +1 -1
- package/dist/team/__tests__/state.test.js +126 -8
- package/dist/team/__tests__/state.test.js.map +1 -1
- package/dist/team/__tests__/team-ops-contract.test.js +4 -0
- package/dist/team/__tests__/team-ops-contract.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.test.js +160 -0
- package/dist/team/__tests__/tmux-session.test.js.map +1 -1
- package/dist/team/__tests__/worker-bootstrap.test.js +19 -1
- package/dist/team/__tests__/worker-bootstrap.test.js.map +1 -1
- package/dist/team/api-interop.d.ts.map +1 -1
- package/dist/team/api-interop.js +95 -23
- package/dist/team/api-interop.js.map +1 -1
- package/dist/team/contracts.d.ts +11 -1
- package/dist/team/contracts.d.ts.map +1 -1
- package/dist/team/contracts.js +29 -0
- package/dist/team/contracts.js.map +1 -1
- 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/idle-nudge.d.ts +2 -2
- package/dist/team/idle-nudge.js +2 -2
- package/dist/team/mcp-comm.d.ts +4 -0
- package/dist/team/mcp-comm.d.ts.map +1 -1
- package/dist/team/mcp-comm.js +84 -1
- package/dist/team/mcp-comm.js.map +1 -1
- 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/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/runtime-cli.d.ts +1 -1
- package/dist/team/runtime-cli.js +2 -2
- package/dist/team/runtime-cli.js.map +1 -1
- package/dist/team/runtime.d.ts +2 -1
- package/dist/team/runtime.d.ts.map +1 -1
- package/dist/team/runtime.js +407 -190
- package/dist/team/runtime.js.map +1 -1
- package/dist/team/scaling.d.ts.map +1 -1
- package/dist/team/scaling.js +6 -5
- package/dist/team/scaling.js.map +1 -1
- package/dist/team/state/dispatch.d.ts +4 -1
- package/dist/team/state/dispatch.d.ts.map +1 -1
- package/dist/team/state/dispatch.js +59 -18
- package/dist/team/state/dispatch.js.map +1 -1
- package/dist/team/state/mailbox.d.ts.map +1 -1
- package/dist/team/state/mailbox.js +39 -2
- package/dist/team/state/mailbox.js.map +1 -1
- package/dist/team/state/monitor.d.ts +2 -1
- package/dist/team/state/monitor.d.ts.map +1 -1
- package/dist/team/state/monitor.js +30 -1
- package/dist/team/state/monitor.js.map +1 -1
- package/dist/team/state/types.d.ts +5 -2
- package/dist/team/state/types.d.ts.map +1 -1
- package/dist/team/state/types.js.map +1 -1
- package/dist/team/state.d.ts +30 -3
- package/dist/team/state.d.ts.map +1 -1
- package/dist/team/state.js +170 -2
- package/dist/team/state.js.map +1 -1
- package/dist/team/team-ops.d.ts +5 -1
- package/dist/team/team-ops.d.ts.map +1 -1
- package/dist/team/team-ops.js +4 -0
- package/dist/team/team-ops.js.map +1 -1
- package/dist/team/tmux-session.d.ts +2 -0
- package/dist/team/tmux-session.d.ts.map +1 -1
- package/dist/team/tmux-session.js +19 -3
- package/dist/team/tmux-session.js.map +1 -1
- package/dist/team/worker-bootstrap.d.ts +4 -0
- package/dist/team/worker-bootstrap.d.ts.map +1 -1
- package/dist/team/worker-bootstrap.js +33 -6
- package/dist/team/worker-bootstrap.js.map +1 -1
- package/dist/utils/__tests__/paths.test.js +63 -1
- package/dist/utils/__tests__/paths.test.js.map +1 -1
- package/dist/utils/__tests__/platform-command.test.js +50 -4
- package/dist/utils/__tests__/platform-command.test.js.map +1 -1
- package/dist/utils/paths.d.ts +12 -0
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +44 -2
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/platform-command.d.ts.map +1 -1
- package/dist/utils/platform-command.js +13 -5
- package/dist/utils/platform-command.js.map +1 -1
- package/dist/utils/sleep.d.ts.map +1 -1
- package/dist/utils/sleep.js +10 -1
- package/dist/utils/sleep.js.map +1 -1
- package/package.json +1 -1
- package/prompts/analyst.md +2 -2
- package/prompts/api-reviewer.md +2 -2
- package/prompts/architect.md +2 -2
- package/prompts/build-fixer.md +2 -2
- package/prompts/code-reviewer.md +2 -2
- package/prompts/code-simplifier.md +1 -1
- package/prompts/critic.md +2 -2
- package/prompts/debugger.md +3 -2
- package/prompts/dependency-expert.md +2 -2
- package/prompts/designer.md +2 -2
- package/prompts/executor.md +3 -2
- package/prompts/explore.md +2 -2
- package/prompts/git-master.md +2 -2
- package/prompts/information-architect.md +2 -2
- package/prompts/performance-reviewer.md +2 -2
- package/prompts/planner.md +3 -2
- package/prompts/product-analyst.md +2 -2
- package/prompts/product-manager.md +2 -2
- package/prompts/qa-tester.md +2 -2
- package/prompts/quality-reviewer.md +2 -2
- package/prompts/quality-strategist.md +2 -2
- package/prompts/researcher.md +2 -2
- package/prompts/security-reviewer.md +2 -2
- package/prompts/sisyphus-lite.md +2 -2
- package/prompts/style-reviewer.md +2 -2
- package/prompts/team-executor.md +2 -2
- package/prompts/test-engineer.md +2 -2
- package/prompts/ux-researcher.md +2 -2
- package/prompts/verifier.md +3 -2
- package/prompts/vision.md +2 -2
- package/prompts/writer.md +2 -2
- package/skills/team/SKILL.md +18 -33
- package/src/scripts/__tests__/codex-native-hook.test.ts +931 -0
- package/src/scripts/codex-native-hook.ts +721 -0
- package/src/scripts/codex-native-pre-post.ts +161 -0
- package/src/scripts/notify-fallback-watcher.ts +318 -26
- package/src/scripts/notify-hook/auto-nudge.ts +5 -10
- package/src/scripts/notify-hook/log.ts +18 -4
- package/src/scripts/notify-hook/managed-tmux.ts +1 -0
- package/src/scripts/notify-hook/orchestration-intent.ts +82 -0
- package/src/scripts/notify-hook/process-runner.ts +4 -4
- package/src/scripts/notify-hook/ralph-session-resume.ts +9 -0
- package/src/scripts/notify-hook/team-dispatch.ts +134 -6
- package/src/scripts/notify-hook/team-leader-nudge.ts +183 -37
- package/src/scripts/notify-hook/team-tmux-guard.ts +35 -43
- package/src/scripts/notify-hook/team-worker.ts +73 -4
- package/src/scripts/notify-hook/utils.ts +1 -1
- package/src/scripts/notify-hook.ts +64 -32
- package/templates/AGENTS.md +21 -11
- package/README.de.md +0 -263
- package/README.el.md +0 -223
- package/README.es.md +0 -263
- package/README.fr.md +0 -263
- package/README.it.md +0 -263
- package/README.ja.md +0 -264
- package/README.ko.md +0 -264
- package/README.pl.md +0 -216
- package/README.pt.md +0 -263
- package/README.ru.md +0 -263
- package/README.tr.md +0 -263
- package/README.vi.md +0 -223
- package/README.zh-TW.md +0 -293
- package/README.zh.md +0 -264
- package/dist/mcp/__tests__/team-server-cleanup.test.d.ts +0 -2
- package/dist/mcp/__tests__/team-server-cleanup.test.d.ts.map +0 -1
- package/dist/mcp/__tests__/team-server-cleanup.test.js +0 -219
- package/dist/mcp/__tests__/team-server-cleanup.test.js.map +0 -1
- package/dist/mcp/__tests__/team-server-runtime-deps.test.d.ts +0 -2
- package/dist/mcp/__tests__/team-server-runtime-deps.test.d.ts.map +0 -1
- package/dist/mcp/__tests__/team-server-runtime-deps.test.js +0 -13
- package/dist/mcp/__tests__/team-server-runtime-deps.test.js.map +0 -1
- package/dist/mcp/__tests__/team-server-wait.test.d.ts +0 -2
- package/dist/mcp/__tests__/team-server-wait.test.d.ts.map +0 -1
- package/dist/mcp/__tests__/team-server-wait.test.js +0 -155
- package/dist/mcp/__tests__/team-server-wait.test.js.map +0 -1
- package/dist/mcp/team-server.d.ts +0 -24
- package/dist/mcp/team-server.d.ts.map +0 -1
- package/dist/mcp/team-server.js +0 -482
- package/dist/mcp/team-server.js.map +0 -1
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
|
|
3
|
+
import { safeString } from './utils.js';
|
|
4
|
+
|
|
5
|
+
export const TEAM_ORCHESTRATION_INTENTS = [
|
|
6
|
+
'followup-reuse',
|
|
7
|
+
'followup-relaunch',
|
|
8
|
+
'stalled-unblock',
|
|
9
|
+
'done-review-or-shutdown',
|
|
10
|
+
'pending-mailbox-review',
|
|
11
|
+
] as const;
|
|
12
|
+
|
|
13
|
+
export const ORCHESTRATION_INTENT_TAG_PREFIX = '[OMX_INTENT:';
|
|
14
|
+
|
|
15
|
+
const ORCHESTRATION_INTENT_TAG_RE = /\s*\[OMX_INTENT:[a-z0-9-]+\]/gi;
|
|
16
|
+
|
|
17
|
+
export function buildOrchestrationIntentTag(intent) {
|
|
18
|
+
const normalizedIntent = safeString(intent).trim();
|
|
19
|
+
return normalizedIntent ? `${ORCHESTRATION_INTENT_TAG_PREFIX}${normalizedIntent}]` : '';
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function appendOrchestrationIntentTag(text, intent) {
|
|
23
|
+
const normalizedText = safeString(text).trim();
|
|
24
|
+
const tag = buildOrchestrationIntentTag(intent);
|
|
25
|
+
if (!tag) return normalizedText;
|
|
26
|
+
return normalizedText ? `${normalizedText} ${tag}` : tag;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function stripOrchestrationIntentTags(text) {
|
|
30
|
+
return safeString(text).replace(ORCHESTRATION_INTENT_TAG_RE, '');
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function classifyLeaderActionState({
|
|
34
|
+
allWorkersIdle = false,
|
|
35
|
+
workerPanesAlive = false,
|
|
36
|
+
taskCounts = {},
|
|
37
|
+
teamProgressStalled = false,
|
|
38
|
+
} = {}) {
|
|
39
|
+
const pending = Number.isFinite(taskCounts.pending) ? taskCounts.pending : 0;
|
|
40
|
+
const blocked = Number.isFinite(taskCounts.blocked) ? taskCounts.blocked : 0;
|
|
41
|
+
const inProgress = Number.isFinite(taskCounts.in_progress) ? taskCounts.in_progress : 0;
|
|
42
|
+
const tasksComplete = pending === 0 && blocked === 0 && inProgress === 0;
|
|
43
|
+
const pendingFollowUpTasks = allWorkersIdle && pending > 0 && blocked === 0 && inProgress === 0;
|
|
44
|
+
const blockedWaitingOnLeader = allWorkersIdle && blocked > 0 && pending === 0 && inProgress === 0;
|
|
45
|
+
const terminalWaitingOnLeader = allWorkersIdle && tasksComplete && workerPanesAlive;
|
|
46
|
+
const stalledWaitingOnLeader = blockedWaitingOnLeader || teamProgressStalled;
|
|
47
|
+
|
|
48
|
+
if (terminalWaitingOnLeader) return 'done_waiting_on_leader';
|
|
49
|
+
if (stalledWaitingOnLeader) return 'stuck_waiting_on_leader';
|
|
50
|
+
if (pendingFollowUpTasks) return 'still_actionable';
|
|
51
|
+
return 'still_actionable';
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function resolveAllWorkersIdleIntent(leaderActionState = 'still_actionable') {
|
|
55
|
+
if (leaderActionState === 'done_waiting_on_leader') return 'done-review-or-shutdown';
|
|
56
|
+
if (leaderActionState === 'stuck_waiting_on_leader') return 'stalled-unblock';
|
|
57
|
+
return 'followup-reuse';
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function resolveLeaderNudgeIntent({ nudgeReason = '', leaderActionState = 'still_actionable' } = {}) {
|
|
61
|
+
switch (safeString(nudgeReason).trim()) {
|
|
62
|
+
case 'new_mailbox_message':
|
|
63
|
+
case 'stale_leader_with_messages':
|
|
64
|
+
return 'pending-mailbox-review';
|
|
65
|
+
case 'ack_without_start_evidence':
|
|
66
|
+
return 'followup-relaunch';
|
|
67
|
+
case 'stuck_waiting_on_leader':
|
|
68
|
+
case 'stale_leader_panes_alive':
|
|
69
|
+
return 'stalled-unblock';
|
|
70
|
+
case 'done_waiting_on_leader':
|
|
71
|
+
return 'done-review-or-shutdown';
|
|
72
|
+
case 'all_workers_idle':
|
|
73
|
+
default:
|
|
74
|
+
return resolveAllWorkersIdleIntent(leaderActionState);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function resolveWorkerIdleIntent(currentState = 'idle') {
|
|
79
|
+
return safeString(currentState).trim() === 'done'
|
|
80
|
+
? 'done-review-or-shutdown'
|
|
81
|
+
: 'followup-reuse';
|
|
82
|
+
}
|
|
@@ -18,19 +18,19 @@ export function runProcess(command: string, args: string[], timeoutMs = 3000): P
|
|
|
18
18
|
reject(new Error(`timeout after ${timeoutMs}ms`));
|
|
19
19
|
}, timeoutMs);
|
|
20
20
|
|
|
21
|
-
child.stdout.on('data', (chunk:
|
|
21
|
+
child.stdout.on('data', (chunk: Buffer) => {
|
|
22
22
|
stdout += chunk.toString();
|
|
23
23
|
});
|
|
24
|
-
child.stderr.on('data', (chunk:
|
|
24
|
+
child.stderr.on('data', (chunk: Buffer) => {
|
|
25
25
|
stderr += chunk.toString();
|
|
26
26
|
});
|
|
27
|
-
child.on('error', (err:
|
|
27
|
+
child.on('error', (err: Error) => {
|
|
28
28
|
if (finished) return;
|
|
29
29
|
finished = true;
|
|
30
30
|
clearTimeout(timer);
|
|
31
31
|
reject(err);
|
|
32
32
|
});
|
|
33
|
-
child.on('close', (code:
|
|
33
|
+
child.on('close', (code: number | null) => {
|
|
34
34
|
if (finished) return;
|
|
35
35
|
finished = true;
|
|
36
36
|
clearTimeout(timer);
|
|
@@ -214,6 +214,7 @@ export async function reconcileRalphSessionResume({
|
|
|
214
214
|
if (currentRalphState && currentRalphState.active === true) {
|
|
215
215
|
let changed = false;
|
|
216
216
|
const updated: Record<string, unknown> = { ...currentRalphState };
|
|
217
|
+
const normalizedPayloadThreadId = safeString(payloadThreadId).trim();
|
|
217
218
|
if (safeString(updated.owner_omx_session_id).trim() !== currentOmxSessionId) {
|
|
218
219
|
updated.owner_omx_session_id = currentOmxSessionId;
|
|
219
220
|
changed = true;
|
|
@@ -222,6 +223,14 @@ export async function reconcileRalphSessionResume({
|
|
|
222
223
|
updated.owner_codex_session_id = payloadSessionId;
|
|
223
224
|
changed = true;
|
|
224
225
|
}
|
|
226
|
+
if (
|
|
227
|
+
!safeString(updated.owner_codex_session_id).trim()
|
|
228
|
+
&& normalizedPayloadThreadId
|
|
229
|
+
&& safeString(updated.owner_codex_thread_id).trim() !== normalizedPayloadThreadId
|
|
230
|
+
) {
|
|
231
|
+
updated.owner_codex_thread_id = normalizedPayloadThreadId;
|
|
232
|
+
changed = true;
|
|
233
|
+
}
|
|
225
234
|
if (
|
|
226
235
|
typeof updated.owner_codex_thread_id === 'string'
|
|
227
236
|
&& safeString(updated.owner_codex_session_id).trim()
|
|
@@ -6,6 +6,7 @@ import { dirname, join, resolve } from 'path';
|
|
|
6
6
|
import { fileURLToPath } from 'node:url';
|
|
7
7
|
import { safeString } from './utils.js';
|
|
8
8
|
import { resolveBridgeStateDir, resolveRuntimeBinaryPath } from '../../runtime/bridge.js';
|
|
9
|
+
import { appendTeamDeliveryLog } from '../../team/delivery-log.js';
|
|
9
10
|
|
|
10
11
|
const __filename = fileURLToPath(import.meta.url);
|
|
11
12
|
const __dirname = dirname(__filename);
|
|
@@ -372,6 +373,7 @@ async function injectDispatchRequest(request, config, cwd, stateDir) {
|
|
|
372
373
|
if (!target) {
|
|
373
374
|
return { ok: false, reason: 'missing_tmux_target' };
|
|
374
375
|
}
|
|
376
|
+
const leaderTargeted = request.to_worker === 'leader-fixed';
|
|
375
377
|
let resolution;
|
|
376
378
|
if (target.type === 'session') {
|
|
377
379
|
const paneId = await resolveSessionToPane(target.value).catch(() => null);
|
|
@@ -384,14 +386,24 @@ async function injectDispatchRequest(request, config, cwd, stateDir) {
|
|
|
384
386
|
if (!resolution.paneTarget) {
|
|
385
387
|
return { ok: false, reason: `target_resolution_failed:${resolution.reason}` };
|
|
386
388
|
}
|
|
389
|
+
const isLeaderMailboxDispatch = request.to_worker === 'leader-fixed';
|
|
387
390
|
const paneGuard = await evaluatePaneInjectionReadiness(resolution.paneTarget, {
|
|
388
391
|
skipIfScrolling: true,
|
|
389
|
-
requireRunningAgent:
|
|
392
|
+
requireRunningAgent: leaderTargeted,
|
|
390
393
|
requireReady: false,
|
|
391
394
|
requireIdle: false,
|
|
395
|
+
requireObservableState: leaderTargeted,
|
|
392
396
|
});
|
|
393
397
|
if (!paneGuard.ok) {
|
|
394
|
-
return {
|
|
398
|
+
return {
|
|
399
|
+
ok: false,
|
|
400
|
+
reason: paneGuard.reason,
|
|
401
|
+
pane: resolution.paneTarget,
|
|
402
|
+
pane_source: resolution.source || null,
|
|
403
|
+
readiness_evidence: paneGuard.readinessEvidence || null,
|
|
404
|
+
pane_current_command: paneGuard.paneCurrentCommand || null,
|
|
405
|
+
tmux_injection_attempted: false,
|
|
406
|
+
};
|
|
395
407
|
}
|
|
396
408
|
|
|
397
409
|
const attemptCountAtStart = Number.isFinite(request.attempt_count)
|
|
@@ -427,7 +439,15 @@ async function injectDispatchRequest(request, config, cwd, stateDir) {
|
|
|
427
439
|
typePrompt: shouldTypePrompt,
|
|
428
440
|
});
|
|
429
441
|
if (!sendResult.ok) {
|
|
430
|
-
return {
|
|
442
|
+
return {
|
|
443
|
+
ok: false,
|
|
444
|
+
reason: sendResult.error || sendResult.reason,
|
|
445
|
+
pane: resolution.paneTarget,
|
|
446
|
+
pane_source: resolution.source || null,
|
|
447
|
+
readiness_evidence: paneGuard.readinessEvidence || null,
|
|
448
|
+
pane_current_command: paneGuard.paneCurrentCommand || null,
|
|
449
|
+
tmux_injection_attempted: true,
|
|
450
|
+
};
|
|
431
451
|
}
|
|
432
452
|
|
|
433
453
|
// Post-injection verification: confirm the trigger text was consumed.
|
|
@@ -448,7 +468,15 @@ async function injectDispatchRequest(request, config, cwd, stateDir) {
|
|
|
448
468
|
// Worker is actively processing (mirrors sync path tmux-session.ts:1292-1294)
|
|
449
469
|
if (paneHasActiveTask(wideCap.stdout)) {
|
|
450
470
|
runtimeExec({ command: 'MarkDelivered', request_id: request.request_id }, stateDir);
|
|
451
|
-
return {
|
|
471
|
+
return {
|
|
472
|
+
ok: true,
|
|
473
|
+
reason: 'tmux_send_keys_confirmed_active_task',
|
|
474
|
+
pane: resolution.paneTarget,
|
|
475
|
+
pane_source: resolution.source || null,
|
|
476
|
+
readiness_evidence: paneGuard.readinessEvidence || null,
|
|
477
|
+
pane_current_command: paneGuard.paneCurrentCommand || null,
|
|
478
|
+
tmux_injection_attempted: true,
|
|
479
|
+
};
|
|
452
480
|
}
|
|
453
481
|
// Do not declare success while a *worker* pane is still bootstrapping / not
|
|
454
482
|
// input-ready. Otherwise a pre-ready send can be marked "confirmed" and later
|
|
@@ -461,7 +489,15 @@ async function injectDispatchRequest(request, config, cwd, stateDir) {
|
|
|
461
489
|
const triggerNearTail = capturedPaneContainsTriggerNearTail(wideCap.stdout, request.trigger_message);
|
|
462
490
|
if (!triggerInNarrow && !triggerNearTail) {
|
|
463
491
|
runtimeExec({ command: 'MarkDelivered', request_id: request.request_id }, stateDir);
|
|
464
|
-
return {
|
|
492
|
+
return {
|
|
493
|
+
ok: true,
|
|
494
|
+
reason: 'tmux_send_keys_confirmed',
|
|
495
|
+
pane: resolution.paneTarget,
|
|
496
|
+
pane_source: resolution.source || null,
|
|
497
|
+
readiness_evidence: paneGuard.readinessEvidence || null,
|
|
498
|
+
pane_current_command: paneGuard.paneCurrentCommand || null,
|
|
499
|
+
tmux_injection_attempted: true,
|
|
500
|
+
};
|
|
465
501
|
}
|
|
466
502
|
} catch {
|
|
467
503
|
// capture failed; fall through to retry C-m
|
|
@@ -476,7 +512,15 @@ async function injectDispatchRequest(request, config, cwd, stateDir) {
|
|
|
476
512
|
}
|
|
477
513
|
|
|
478
514
|
// Trigger text is still visible after all retry rounds.
|
|
479
|
-
return {
|
|
515
|
+
return {
|
|
516
|
+
ok: true,
|
|
517
|
+
reason: 'tmux_send_keys_unconfirmed',
|
|
518
|
+
pane: resolution.paneTarget,
|
|
519
|
+
pane_source: resolution.source || null,
|
|
520
|
+
readiness_evidence: paneGuard.readinessEvidence || null,
|
|
521
|
+
pane_current_command: paneGuard.paneCurrentCommand || null,
|
|
522
|
+
tmux_injection_attempted: true,
|
|
523
|
+
};
|
|
480
524
|
}
|
|
481
525
|
|
|
482
526
|
function shouldSkipRequest(request) {
|
|
@@ -505,12 +549,38 @@ async function appendDispatchLog(logsDir, event) {
|
|
|
505
549
|
await appendFile(path, `${JSON.stringify({ timestamp: new Date().toISOString(), ...event })}\n`).catch(() => {});
|
|
506
550
|
}
|
|
507
551
|
|
|
552
|
+
async function appendDeliveryTelemetry(logsDir, event) {
|
|
553
|
+
await appendTeamDeliveryLog(logsDir, {
|
|
554
|
+
source: 'notify-hook.team-dispatch',
|
|
555
|
+
...event,
|
|
556
|
+
}).catch(() => {});
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
function buildDispatchAttemptEvidence(result, fallback = {}) {
|
|
560
|
+
return {
|
|
561
|
+
pane_target: safeString(result?.pane || fallback.pane || '').trim() || null,
|
|
562
|
+
pane_source: safeString(result?.pane_source || fallback.pane_source || '').trim() || null,
|
|
563
|
+
readiness_evidence: safeString(result?.readiness_evidence || fallback.readiness_evidence || '').trim() || null,
|
|
564
|
+
pane_current_command: safeString(result?.pane_current_command || fallback.pane_current_command || '').trim() || null,
|
|
565
|
+
tmux_injection_attempted:
|
|
566
|
+
typeof result?.tmux_injection_attempted === 'boolean'
|
|
567
|
+
? result.tmux_injection_attempted
|
|
568
|
+
: (typeof fallback.tmux_injection_attempted === 'boolean' ? fallback.tmux_injection_attempted : null),
|
|
569
|
+
};
|
|
570
|
+
}
|
|
571
|
+
|
|
508
572
|
export async function drainPendingTeamDispatch({
|
|
509
573
|
cwd,
|
|
510
574
|
stateDir = resolveBridgeStateDir(cwd),
|
|
511
575
|
logsDir = join(cwd, '.omx', 'logs'),
|
|
512
576
|
maxPerTick = 5,
|
|
513
577
|
injector = injectDispatchRequest,
|
|
578
|
+
}: {
|
|
579
|
+
cwd?: string;
|
|
580
|
+
stateDir?: string;
|
|
581
|
+
logsDir?: string;
|
|
582
|
+
maxPerTick?: number;
|
|
583
|
+
injector?: typeof injectDispatchRequest;
|
|
514
584
|
} = {}) {
|
|
515
585
|
if (safeString(process.env.OMX_TEAM_WORKER)) {
|
|
516
586
|
return { processed: 0, skipped: 0, failed: 0, reason: 'worker_context' };
|
|
@@ -575,6 +645,20 @@ export async function drainPendingTeamDispatch({
|
|
|
575
645
|
tmux_session: safeString(config?.tmux_session).trim() || null,
|
|
576
646
|
leader_pane_id: safeString(config?.leader_pane_id).trim() || null,
|
|
577
647
|
tmux_injection_attempted: false,
|
|
648
|
+
pane_target: null,
|
|
649
|
+
pane_source: null,
|
|
650
|
+
readiness_evidence: null,
|
|
651
|
+
pane_current_command: null,
|
|
652
|
+
});
|
|
653
|
+
await appendDeliveryTelemetry(logsDir, {
|
|
654
|
+
event: 'dispatch_result',
|
|
655
|
+
team: teamName,
|
|
656
|
+
request_id: request.request_id,
|
|
657
|
+
message_id: request.message_id || null,
|
|
658
|
+
to_worker: request.to_worker,
|
|
659
|
+
transport: 'send-keys',
|
|
660
|
+
result: 'deferred',
|
|
661
|
+
reason: LEADER_PANE_MISSING_DEFERRED_REASON,
|
|
578
662
|
});
|
|
579
663
|
// On the legacy fallback lane, requests.json still carries the queue
|
|
580
664
|
// state for this deferred request; this event stays a progress
|
|
@@ -645,6 +729,17 @@ export async function drainPendingTeamDispatch({
|
|
|
645
729
|
worker: request.to_worker,
|
|
646
730
|
attempt: request.attempt_count,
|
|
647
731
|
reason: result.reason,
|
|
732
|
+
...buildDispatchAttemptEvidence(result),
|
|
733
|
+
});
|
|
734
|
+
await appendDeliveryTelemetry(logsDir, {
|
|
735
|
+
event: 'dispatch_result',
|
|
736
|
+
team: teamName,
|
|
737
|
+
request_id: request.request_id,
|
|
738
|
+
message_id: request.message_id || null,
|
|
739
|
+
to_worker: request.to_worker,
|
|
740
|
+
transport: 'send-keys',
|
|
741
|
+
result: 'retry',
|
|
742
|
+
reason: result.reason,
|
|
648
743
|
});
|
|
649
744
|
await emitOperationalHookEvent(cwd, 'retry-needed', {
|
|
650
745
|
team: teamName,
|
|
@@ -672,6 +767,17 @@ export async function drainPendingTeamDispatch({
|
|
|
672
767
|
worker: request.to_worker,
|
|
673
768
|
message_id: request.message_id || null,
|
|
674
769
|
reason: request.last_reason,
|
|
770
|
+
...buildDispatchAttemptEvidence(result),
|
|
771
|
+
});
|
|
772
|
+
await appendDeliveryTelemetry(logsDir, {
|
|
773
|
+
event: 'dispatch_result',
|
|
774
|
+
team: teamName,
|
|
775
|
+
request_id: request.request_id,
|
|
776
|
+
message_id: request.message_id || null,
|
|
777
|
+
to_worker: request.to_worker,
|
|
778
|
+
transport: 'send-keys',
|
|
779
|
+
result: 'failed',
|
|
780
|
+
reason: request.last_reason,
|
|
675
781
|
});
|
|
676
782
|
await emitOperationalHookEvent(cwd, 'failed', {
|
|
677
783
|
team: teamName,
|
|
@@ -704,6 +810,17 @@ export async function drainPendingTeamDispatch({
|
|
|
704
810
|
worker: request.to_worker,
|
|
705
811
|
message_id: request.message_id || null,
|
|
706
812
|
reason: result.reason,
|
|
813
|
+
...buildDispatchAttemptEvidence(result),
|
|
814
|
+
});
|
|
815
|
+
await appendDeliveryTelemetry(logsDir, {
|
|
816
|
+
event: 'dispatch_result',
|
|
817
|
+
team: teamName,
|
|
818
|
+
request_id: request.request_id,
|
|
819
|
+
message_id: request.message_id || null,
|
|
820
|
+
to_worker: request.to_worker,
|
|
821
|
+
transport: 'send-keys',
|
|
822
|
+
result: 'notified',
|
|
823
|
+
reason: result.reason,
|
|
707
824
|
});
|
|
708
825
|
} else {
|
|
709
826
|
request.status = 'failed';
|
|
@@ -720,6 +837,17 @@ export async function drainPendingTeamDispatch({
|
|
|
720
837
|
worker: request.to_worker,
|
|
721
838
|
message_id: request.message_id || null,
|
|
722
839
|
reason: result.reason,
|
|
840
|
+
...buildDispatchAttemptEvidence(result),
|
|
841
|
+
});
|
|
842
|
+
await appendDeliveryTelemetry(logsDir, {
|
|
843
|
+
event: 'dispatch_result',
|
|
844
|
+
team: teamName,
|
|
845
|
+
request_id: request.request_id,
|
|
846
|
+
message_id: request.message_id || null,
|
|
847
|
+
to_worker: request.to_worker,
|
|
848
|
+
transport: 'send-keys',
|
|
849
|
+
result: 'failed',
|
|
850
|
+
reason: result.reason,
|
|
723
851
|
});
|
|
724
852
|
await emitOperationalHookEvent(cwd, result.reason === LEADER_PANE_MISSING_DEFERRED_REASON ? 'handoff-needed' : 'failed', {
|
|
725
853
|
team: teamName,
|