oh-my-codex 0.15.2 → 0.16.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 +10 -7
- package/Cargo.toml +1 -1
- package/README.md +3 -0
- package/crates/omx-explore/Cargo.toml +3 -0
- package/crates/omx-explore/src/main.rs +517 -16
- package/dist/agents/__tests__/native-config.test.js +33 -0
- package/dist/agents/__tests__/native-config.test.js.map +1 -1
- package/dist/autoresearch/goal.d.ts +90 -0
- package/dist/autoresearch/goal.d.ts.map +1 -0
- package/dist/autoresearch/goal.js +237 -0
- package/dist/autoresearch/goal.js.map +1 -0
- package/dist/autoresearch/skill-validation.d.ts +1 -0
- package/dist/autoresearch/skill-validation.d.ts.map +1 -1
- package/dist/autoresearch/skill-validation.js +10 -3
- package/dist/autoresearch/skill-validation.js.map +1 -1
- package/dist/catalog/__tests__/generator.test.js +9 -4
- package/dist/catalog/__tests__/generator.test.js.map +1 -1
- package/dist/catalog/__tests__/plugin-bundle-ssot.test.js +29 -2
- package/dist/catalog/__tests__/plugin-bundle-ssot.test.js.map +1 -1
- package/dist/catalog/__tests__/schema.test.js +14 -3
- package/dist/catalog/__tests__/schema.test.js.map +1 -1
- package/dist/catalog/schema.js +1 -1
- package/dist/catalog/schema.js.map +1 -1
- package/dist/cli/__tests__/autoresearch-goal.test.d.ts +2 -0
- package/dist/cli/__tests__/autoresearch-goal.test.d.ts.map +1 -0
- package/dist/cli/__tests__/autoresearch-goal.test.js +194 -0
- package/dist/cli/__tests__/autoresearch-goal.test.js.map +1 -0
- package/dist/cli/__tests__/cleanup.test.js +82 -1
- package/dist/cli/__tests__/cleanup.test.js.map +1 -1
- package/dist/cli/__tests__/codex-plugin-layout.test.js +7 -4
- package/dist/cli/__tests__/codex-plugin-layout.test.js.map +1 -1
- 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-warning-copy.test.js +25 -2
- package/dist/cli/__tests__/doctor-warning-copy.test.js.map +1 -1
- package/dist/cli/__tests__/exec.test.js +1 -0
- package/dist/cli/__tests__/exec.test.js.map +1 -1
- package/dist/cli/__tests__/explore.test.js +48 -18
- package/dist/cli/__tests__/explore.test.js.map +1 -1
- package/dist/cli/__tests__/index.test.js +222 -10
- package/dist/cli/__tests__/index.test.js.map +1 -1
- package/dist/cli/__tests__/launch-fallback.test.js +58 -0
- package/dist/cli/__tests__/launch-fallback.test.js.map +1 -1
- package/dist/cli/__tests__/mcp-serve.test.js +27 -1
- package/dist/cli/__tests__/mcp-serve.test.js.map +1 -1
- package/dist/cli/__tests__/native-assets.test.js +26 -1
- package/dist/cli/__tests__/native-assets.test.js.map +1 -1
- package/dist/cli/__tests__/package-bin-contract.test.js +2 -2
- package/dist/cli/__tests__/package-bin-contract.test.js.map +1 -1
- package/dist/cli/__tests__/performance-goal.test.d.ts +2 -0
- package/dist/cli/__tests__/performance-goal.test.d.ts.map +1 -0
- package/dist/cli/__tests__/performance-goal.test.js +144 -0
- package/dist/cli/__tests__/performance-goal.test.js.map +1 -0
- package/dist/cli/__tests__/question.test.js +8 -0
- package/dist/cli/__tests__/question.test.js.map +1 -1
- package/dist/cli/__tests__/ralph-goal-mode-contract.test.d.ts +2 -0
- package/dist/cli/__tests__/ralph-goal-mode-contract.test.d.ts.map +1 -0
- package/dist/cli/__tests__/ralph-goal-mode-contract.test.js +31 -0
- package/dist/cli/__tests__/ralph-goal-mode-contract.test.js.map +1 -0
- package/dist/cli/__tests__/ralph-prd-deep-interview.test.js +5 -4
- package/dist/cli/__tests__/ralph-prd-deep-interview.test.js.map +1 -1
- package/dist/cli/__tests__/ralph-prd-smoke.test.js +7 -0
- package/dist/cli/__tests__/ralph-prd-smoke.test.js.map +1 -1
- package/dist/cli/__tests__/ralph.test.js +59 -1
- package/dist/cli/__tests__/ralph.test.js.map +1 -1
- package/dist/cli/__tests__/setup-install-mode.test.js +57 -21
- package/dist/cli/__tests__/setup-install-mode.test.js.map +1 -1
- package/dist/cli/__tests__/setup-refresh.test.js +27 -8
- package/dist/cli/__tests__/setup-refresh.test.js.map +1 -1
- package/dist/cli/__tests__/setup-scope.test.js +20 -10
- package/dist/cli/__tests__/setup-scope.test.js.map +1 -1
- package/dist/cli/__tests__/setup-skill-validation.test.js +11 -11
- package/dist/cli/__tests__/setup-skill-validation.test.js.map +1 -1
- package/dist/cli/__tests__/setup-skills-overwrite.test.js +12 -12
- package/dist/cli/__tests__/setup-skills-overwrite.test.js.map +1 -1
- package/dist/cli/__tests__/team.test.js +242 -10
- package/dist/cli/__tests__/team.test.js.map +1 -1
- package/dist/cli/__tests__/ultragoal.test.d.ts +2 -0
- package/dist/cli/__tests__/ultragoal.test.d.ts.map +1 -0
- package/dist/cli/__tests__/ultragoal.test.js +106 -0
- package/dist/cli/__tests__/ultragoal.test.js.map +1 -0
- package/dist/cli/__tests__/uninstall.test.js +11 -0
- package/dist/cli/__tests__/uninstall.test.js.map +1 -1
- package/dist/cli/autoresearch-goal.d.ts +3 -0
- package/dist/cli/autoresearch-goal.d.ts.map +1 -0
- package/dist/cli/autoresearch-goal.js +175 -0
- package/dist/cli/autoresearch-goal.js.map +1 -0
- package/dist/cli/cleanup.d.ts +3 -1
- package/dist/cli/cleanup.d.ts.map +1 -1
- package/dist/cli/cleanup.js +42 -2
- package/dist/cli/cleanup.js.map +1 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +95 -3
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/explore.d.ts.map +1 -1
- package/dist/cli/explore.js +10 -2
- package/dist/cli/explore.js.map +1 -1
- package/dist/cli/index.d.ts +21 -2
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +268 -30
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/mcp-serve.d.ts +1 -0
- package/dist/cli/mcp-serve.d.ts.map +1 -1
- package/dist/cli/mcp-serve.js +8 -0
- package/dist/cli/mcp-serve.js.map +1 -1
- package/dist/cli/native-assets.js +1 -1
- package/dist/cli/native-assets.js.map +1 -1
- package/dist/cli/performance-goal.d.ts +3 -0
- package/dist/cli/performance-goal.d.ts.map +1 -0
- package/dist/cli/performance-goal.js +186 -0
- package/dist/cli/performance-goal.js.map +1 -0
- package/dist/cli/ralph.d.ts +2 -0
- package/dist/cli/ralph.d.ts.map +1 -1
- package/dist/cli/ralph.js +25 -1
- package/dist/cli/ralph.js.map +1 -1
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +13 -6
- package/dist/cli/setup.js.map +1 -1
- package/dist/cli/team.d.ts +6 -0
- package/dist/cli/team.d.ts.map +1 -1
- package/dist/cli/team.js +113 -33
- package/dist/cli/team.js.map +1 -1
- package/dist/cli/tmux-hook.d.ts.map +1 -1
- package/dist/cli/tmux-hook.js +2 -1
- package/dist/cli/tmux-hook.js.map +1 -1
- package/dist/cli/ultragoal.d.ts +3 -0
- package/dist/cli/ultragoal.d.ts.map +1 -0
- package/dist/cli/ultragoal.js +191 -0
- package/dist/cli/ultragoal.js.map +1 -0
- package/dist/cli/uninstall.d.ts.map +1 -1
- package/dist/cli/uninstall.js +4 -2
- package/dist/cli/uninstall.js.map +1 -1
- package/dist/config/__tests__/generator-idempotent.test.js +39 -6
- package/dist/config/__tests__/generator-idempotent.test.js.map +1 -1
- package/dist/config/__tests__/generator-notify.test.js +5 -0
- package/dist/config/__tests__/generator-notify.test.js.map +1 -1
- package/dist/config/commit-lore-guard.d.ts +3 -0
- package/dist/config/commit-lore-guard.d.ts.map +1 -0
- package/dist/config/commit-lore-guard.js +9 -0
- package/dist/config/commit-lore-guard.js.map +1 -0
- package/dist/config/generator.d.ts +14 -4
- package/dist/config/generator.d.ts.map +1 -1
- package/dist/config/generator.js +166 -66
- package/dist/config/generator.js.map +1 -1
- package/dist/config/omx-first-party-mcp.d.ts +1 -0
- package/dist/config/omx-first-party-mcp.d.ts.map +1 -1
- package/dist/config/omx-first-party-mcp.js +4 -1
- package/dist/config/omx-first-party-mcp.js.map +1 -1
- package/dist/goal-workflows/__tests__/artifacts.test.d.ts +2 -0
- package/dist/goal-workflows/__tests__/artifacts.test.d.ts.map +1 -0
- package/dist/goal-workflows/__tests__/artifacts.test.js +96 -0
- package/dist/goal-workflows/__tests__/artifacts.test.js.map +1 -0
- package/dist/goal-workflows/__tests__/codex-goal-snapshot.test.d.ts +2 -0
- package/dist/goal-workflows/__tests__/codex-goal-snapshot.test.d.ts.map +1 -0
- package/dist/goal-workflows/__tests__/codex-goal-snapshot.test.js +54 -0
- package/dist/goal-workflows/__tests__/codex-goal-snapshot.test.js.map +1 -0
- package/dist/goal-workflows/artifacts.d.ts +62 -0
- package/dist/goal-workflows/artifacts.d.ts.map +1 -0
- package/dist/goal-workflows/artifacts.js +132 -0
- package/dist/goal-workflows/artifacts.js.map +1 -0
- package/dist/goal-workflows/codex-goal-snapshot.d.ts +28 -0
- package/dist/goal-workflows/codex-goal-snapshot.d.ts.map +1 -0
- package/dist/goal-workflows/codex-goal-snapshot.js +110 -0
- package/dist/goal-workflows/codex-goal-snapshot.js.map +1 -0
- package/dist/goal-workflows/handoff.d.ts +10 -0
- package/dist/goal-workflows/handoff.d.ts.map +1 -0
- package/dist/goal-workflows/handoff.js +31 -0
- package/dist/goal-workflows/handoff.js.map +1 -0
- package/dist/goal-workflows/validation.d.ts +13 -0
- package/dist/goal-workflows/validation.d.ts.map +1 -0
- package/dist/goal-workflows/validation.js +36 -0
- package/dist/goal-workflows/validation.js.map +1 -0
- package/dist/hooks/__tests__/agents-overlay.test.js +59 -0
- package/dist/hooks/__tests__/agents-overlay.test.js.map +1 -1
- package/dist/hooks/__tests__/anti-slop-workflow.test.js +109 -18
- package/dist/hooks/__tests__/anti-slop-workflow.test.js.map +1 -1
- package/dist/hooks/__tests__/keyword-detector.test.js +45 -32
- package/dist/hooks/__tests__/keyword-detector.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-fallback-watcher.test.js +3 -3
- package/dist/hooks/__tests__/notify-fallback-watcher.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js +2 -1
- package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js +17 -24
- package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js.map +1 -1
- package/dist/hooks/__tests__/prompt-guidance-wave-two.test.js +3 -3
- package/dist/hooks/__tests__/prompt-guidance-wave-two.test.js.map +1 -1
- package/dist/hooks/__tests__/task-size-detector.test.js +1 -1
- package/dist/hooks/__tests__/task-size-detector.test.js.map +1 -1
- package/dist/hooks/__tests__/visual-ralph-skill.test.js +3 -3
- package/dist/hooks/__tests__/visual-ralph-skill.test.js.map +1 -1
- package/dist/hooks/__tests__/visual-verdict-loop.test.js +7 -11
- package/dist/hooks/__tests__/visual-verdict-loop.test.js.map +1 -1
- package/dist/hooks/agents-overlay.d.ts.map +1 -1
- package/dist/hooks/agents-overlay.js +23 -2
- package/dist/hooks/agents-overlay.js.map +1 -1
- package/dist/hooks/keyword-detector.d.ts.map +1 -1
- package/dist/hooks/keyword-detector.js +12 -13
- package/dist/hooks/keyword-detector.js.map +1 -1
- package/dist/hooks/keyword-registry.d.ts.map +1 -1
- package/dist/hooks/keyword-registry.js +2 -10
- package/dist/hooks/keyword-registry.js.map +1 -1
- package/dist/hooks/prompt-guidance-contract.d.ts.map +1 -1
- package/dist/hooks/prompt-guidance-contract.js +0 -4
- package/dist/hooks/prompt-guidance-contract.js.map +1 -1
- package/dist/hooks/session.js +2 -2
- package/dist/hooks/session.js.map +1 -1
- package/dist/hooks/task-size-detector.d.ts.map +1 -1
- package/dist/hooks/task-size-detector.js +1 -0
- package/dist/hooks/task-size-detector.js.map +1 -1
- package/dist/hud/__tests__/index.test.js +30 -14
- package/dist/hud/__tests__/index.test.js.map +1 -1
- package/dist/hud/__tests__/reconcile.test.js +29 -7
- package/dist/hud/__tests__/reconcile.test.js.map +1 -1
- package/dist/hud/reconcile.d.ts +2 -1
- package/dist/hud/reconcile.d.ts.map +1 -1
- package/dist/hud/reconcile.js +12 -0
- package/dist/hud/reconcile.js.map +1 -1
- package/dist/mcp/__tests__/bootstrap.test.js +15 -2
- package/dist/mcp/__tests__/bootstrap.test.js.map +1 -1
- package/dist/mcp/__tests__/state-paths.test.js +54 -0
- package/dist/mcp/__tests__/state-paths.test.js.map +1 -1
- package/dist/mcp/__tests__/state-server.test.js +36 -0
- package/dist/mcp/__tests__/state-server.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 +9 -7
- package/dist/mcp/bootstrap.js.map +1 -1
- package/dist/mcp/state-paths.d.ts +17 -0
- package/dist/mcp/state-paths.d.ts.map +1 -1
- package/dist/mcp/state-paths.js +36 -2
- package/dist/mcp/state-paths.js.map +1 -1
- package/dist/modes/__tests__/base-session-scope.test.js +26 -0
- package/dist/modes/__tests__/base-session-scope.test.js.map +1 -1
- package/dist/modes/base.d.ts +1 -0
- package/dist/modes/base.d.ts.map +1 -1
- package/dist/modes/base.js +35 -5
- package/dist/modes/base.js.map +1 -1
- package/dist/notifications/__tests__/http-client.test.d.ts +2 -0
- package/dist/notifications/__tests__/http-client.test.d.ts.map +1 -0
- package/dist/notifications/__tests__/http-client.test.js +90 -0
- package/dist/notifications/__tests__/http-client.test.js.map +1 -0
- package/dist/notifications/__tests__/notifier.test.js +22 -60
- package/dist/notifications/__tests__/notifier.test.js.map +1 -1
- package/dist/notifications/dispatcher.d.ts.map +1 -1
- package/dist/notifications/dispatcher.js +35 -60
- package/dist/notifications/dispatcher.js.map +1 -1
- package/dist/notifications/http-client.d.ts +22 -0
- package/dist/notifications/http-client.d.ts.map +1 -0
- package/dist/notifications/http-client.js +298 -0
- package/dist/notifications/http-client.js.map +1 -0
- package/dist/notifications/notifier.d.ts +3 -2
- package/dist/notifications/notifier.d.ts.map +1 -1
- package/dist/notifications/notifier.js +17 -22
- package/dist/notifications/notifier.js.map +1 -1
- package/dist/openclaw/__tests__/dispatcher.test.js +63 -2
- package/dist/openclaw/__tests__/dispatcher.test.js.map +1 -1
- package/dist/openclaw/dispatcher.d.ts.map +1 -1
- package/dist/openclaw/dispatcher.js +3 -2
- package/dist/openclaw/dispatcher.js.map +1 -1
- package/dist/performance-goal/artifacts.d.ts +76 -0
- package/dist/performance-goal/artifacts.d.ts.map +1 -0
- package/dist/performance-goal/artifacts.js +221 -0
- package/dist/performance-goal/artifacts.js.map +1 -0
- package/dist/pipeline/__tests__/stages.test.js +423 -14
- package/dist/pipeline/__tests__/stages.test.js.map +1 -1
- package/dist/pipeline/stages/team-exec.d.ts +8 -4
- package/dist/pipeline/stages/team-exec.d.ts.map +1 -1
- package/dist/pipeline/stages/team-exec.js +181 -13
- package/dist/pipeline/stages/team-exec.js.map +1 -1
- package/dist/planning/__tests__/artifacts.test.js +261 -1
- package/dist/planning/__tests__/artifacts.test.js.map +1 -1
- 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 +23 -1
- package/dist/planning/artifacts.d.ts.map +1 -1
- package/dist/planning/artifacts.js +171 -59
- package/dist/planning/artifacts.js.map +1 -1
- package/dist/ralph/__tests__/persistence.test.js +21 -1
- package/dist/ralph/__tests__/persistence.test.js.map +1 -1
- package/dist/ralph/persistence.d.ts.map +1 -1
- package/dist/ralph/persistence.js +6 -4
- package/dist/ralph/persistence.js.map +1 -1
- package/dist/ralplan/__tests__/runtime.test.js +2 -0
- package/dist/ralplan/__tests__/runtime.test.js.map +1 -1
- package/dist/ralplan/runtime.d.ts.map +1 -1
- package/dist/ralplan/runtime.js +6 -0
- package/dist/ralplan/runtime.js.map +1 -1
- package/dist/scripts/__tests__/codex-native-hook.test.js +1749 -88
- package/dist/scripts/__tests__/codex-native-hook.test.js.map +1 -1
- package/dist/scripts/__tests__/hook-derived-watcher.test.js +33 -1
- package/dist/scripts/__tests__/hook-derived-watcher.test.js.map +1 -1
- package/dist/scripts/__tests__/run-test-files.test.js +36 -0
- package/dist/scripts/__tests__/run-test-files.test.js.map +1 -1
- package/dist/scripts/codex-native-hook.d.ts.map +1 -1
- package/dist/scripts/codex-native-hook.js +570 -45
- package/dist/scripts/codex-native-hook.js.map +1 -1
- package/dist/scripts/codex-native-pre-post.d.ts +7 -0
- package/dist/scripts/codex-native-pre-post.d.ts.map +1 -1
- package/dist/scripts/codex-native-pre-post.js +341 -15
- package/dist/scripts/codex-native-pre-post.js.map +1 -1
- package/dist/scripts/hook-derived-watcher.js +2 -1
- package/dist/scripts/hook-derived-watcher.js.map +1 -1
- package/dist/scripts/notify-fallback-watcher.js +2 -1
- package/dist/scripts/notify-fallback-watcher.js.map +1 -1
- package/dist/scripts/notify-hook/orchestration-intent.d.ts +1 -2
- package/dist/scripts/notify-hook/orchestration-intent.d.ts.map +1 -1
- package/dist/scripts/notify-hook/orchestration-intent.js +2 -3
- package/dist/scripts/notify-hook/orchestration-intent.js.map +1 -1
- package/dist/scripts/notify-hook/team-leader-nudge.d.ts +0 -2
- package/dist/scripts/notify-hook/team-leader-nudge.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-leader-nudge.js +8 -60
- package/dist/scripts/notify-hook/team-leader-nudge.js.map +1 -1
- package/dist/scripts/notify-hook/team-worker-posttooluse.js +1 -1
- package/dist/scripts/notify-hook/team-worker-posttooluse.js.map +1 -1
- package/dist/scripts/notify-hook/team-worker-stop.d.ts +15 -0
- package/dist/scripts/notify-hook/team-worker-stop.d.ts.map +1 -0
- package/dist/scripts/notify-hook/team-worker-stop.js +224 -0
- package/dist/scripts/notify-hook/team-worker-stop.js.map +1 -0
- package/dist/scripts/notify-hook/team-worker.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-worker.js +26 -18
- package/dist/scripts/notify-hook/team-worker.js.map +1 -1
- package/dist/scripts/notify-hook.js +1 -1
- package/dist/scripts/notify-hook.js.map +1 -1
- package/dist/scripts/run-test-files.js +17 -1
- package/dist/scripts/run-test-files.js.map +1 -1
- package/dist/scripts/sync-plugin-mirror.d.ts +1 -0
- package/dist/scripts/sync-plugin-mirror.d.ts.map +1 -1
- package/dist/scripts/sync-plugin-mirror.js +10 -4
- package/dist/scripts/sync-plugin-mirror.js.map +1 -1
- package/dist/state/__tests__/operations.test.js +26 -0
- package/dist/state/__tests__/operations.test.js.map +1 -1
- package/dist/state/__tests__/skill-active.test.js +76 -0
- package/dist/state/__tests__/skill-active.test.js.map +1 -1
- package/dist/state/operations.d.ts +3 -1
- package/dist/state/operations.d.ts.map +1 -1
- package/dist/state/operations.js +8 -4
- package/dist/state/operations.js.map +1 -1
- package/dist/state/skill-active.d.ts +1 -0
- package/dist/state/skill-active.d.ts.map +1 -1
- package/dist/state/skill-active.js +54 -13
- package/dist/state/skill-active.js.map +1 -1
- package/dist/team/__tests__/api-interop.test.js +279 -0
- package/dist/team/__tests__/api-interop.test.js.map +1 -1
- package/dist/team/__tests__/approved-execution.test.d.ts +2 -0
- package/dist/team/__tests__/approved-execution.test.d.ts.map +1 -0
- package/dist/team/__tests__/approved-execution.test.js +124 -0
- package/dist/team/__tests__/approved-execution.test.js.map +1 -0
- package/dist/team/__tests__/delivery-e2e-smoke.test.js +2 -4
- package/dist/team/__tests__/delivery-e2e-smoke.test.js.map +1 -1
- package/dist/team/__tests__/delivery-log.test.d.ts +2 -0
- package/dist/team/__tests__/delivery-log.test.d.ts.map +1 -0
- package/dist/team/__tests__/delivery-log.test.js +44 -0
- package/dist/team/__tests__/delivery-log.test.js.map +1 -0
- package/dist/team/__tests__/model-contract.test.js +40 -9
- package/dist/team/__tests__/model-contract.test.js.map +1 -1
- package/dist/team/__tests__/repo-aware-decomposition.test.js +41 -0
- package/dist/team/__tests__/repo-aware-decomposition.test.js.map +1 -1
- package/dist/team/__tests__/role-router.test.js +4 -4
- package/dist/team/__tests__/role-router.test.js.map +1 -1
- package/dist/team/__tests__/runtime-boxed-state.test.d.ts +2 -0
- package/dist/team/__tests__/runtime-boxed-state.test.d.ts.map +1 -0
- package/dist/team/__tests__/runtime-boxed-state.test.js +39 -0
- package/dist/team/__tests__/runtime-boxed-state.test.js.map +1 -0
- package/dist/team/__tests__/runtime-cli.test.js +24 -0
- package/dist/team/__tests__/runtime-cli.test.js.map +1 -1
- package/dist/team/__tests__/runtime.test.js +563 -72
- package/dist/team/__tests__/runtime.test.js.map +1 -1
- package/dist/team/__tests__/state-root.test.js +13 -0
- package/dist/team/__tests__/state-root.test.js.map +1 -1
- package/dist/team/__tests__/state.test.js +13 -0
- package/dist/team/__tests__/state.test.js.map +1 -1
- 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__/tmux-session.test.js +58 -1
- package/dist/team/__tests__/tmux-session.test.js.map +1 -1
- package/dist/team/__tests__/worker-bootstrap.test.js +62 -0
- package/dist/team/__tests__/worker-bootstrap.test.js.map +1 -1
- package/dist/team/api-interop.d.ts +1 -0
- package/dist/team/api-interop.d.ts.map +1 -1
- package/dist/team/api-interop.js +163 -132
- package/dist/team/api-interop.js.map +1 -1
- package/dist/team/approved-execution.d.ts +37 -0
- package/dist/team/approved-execution.d.ts.map +1 -0
- package/dist/team/approved-execution.js +136 -0
- package/dist/team/approved-execution.js.map +1 -0
- package/dist/team/delivery-log.d.ts +1 -1
- package/dist/team/delivery-log.d.ts.map +1 -1
- package/dist/team/delivery-log.js +2 -1
- package/dist/team/delivery-log.js.map +1 -1
- package/dist/team/followup-planner.js +2 -2
- package/dist/team/followup-planner.js.map +1 -1
- package/dist/team/goal-workflow.d.ts +20 -0
- package/dist/team/goal-workflow.d.ts.map +1 -0
- package/dist/team/goal-workflow.js +57 -0
- package/dist/team/goal-workflow.js.map +1 -0
- package/dist/team/orchestrator.js +2 -2
- package/dist/team/orchestrator.js.map +1 -1
- package/dist/team/repo-aware-decomposition.d.ts +3 -0
- package/dist/team/repo-aware-decomposition.d.ts.map +1 -1
- package/dist/team/repo-aware-decomposition.js +2 -0
- package/dist/team/repo-aware-decomposition.js.map +1 -1
- package/dist/team/role-router.js +5 -5
- package/dist/team/role-router.js.map +1 -1
- package/dist/team/runtime-cli.d.ts +32 -2
- package/dist/team/runtime-cli.d.ts.map +1 -1
- package/dist/team/runtime-cli.js +78 -26
- package/dist/team/runtime-cli.js.map +1 -1
- package/dist/team/runtime.d.ts +7 -1
- package/dist/team/runtime.d.ts.map +1 -1
- package/dist/team/runtime.js +383 -40
- package/dist/team/runtime.js.map +1 -1
- package/dist/team/scaling.d.ts.map +1 -1
- package/dist/team/scaling.js +2 -0
- package/dist/team/scaling.js.map +1 -1
- package/dist/team/state.d.ts +9 -0
- package/dist/team/state.d.ts.map +1 -1
- package/dist/team/state.js +21 -0
- package/dist/team/state.js.map +1 -1
- 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/tmux-session.d.ts +18 -0
- package/dist/team/tmux-session.d.ts.map +1 -1
- package/dist/team/tmux-session.js +65 -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 +28 -2
- package/dist/team/worker-bootstrap.js.map +1 -1
- package/dist/ultragoal/__tests__/artifacts.test.d.ts +2 -0
- package/dist/ultragoal/__tests__/artifacts.test.d.ts.map +1 -0
- package/dist/ultragoal/__tests__/artifacts.test.js +93 -0
- package/dist/ultragoal/__tests__/artifacts.test.js.map +1 -0
- package/dist/ultragoal/artifacts.d.ts +89 -0
- package/dist/ultragoal/artifacts.d.ts.map +1 -0
- package/dist/ultragoal/artifacts.js +233 -0
- package/dist/ultragoal/artifacts.js.map +1 -0
- package/dist/utils/__tests__/agents-model-table.test.js +3 -1
- package/dist/utils/__tests__/agents-model-table.test.js.map +1 -1
- package/dist/utils/__tests__/paths.test.js +31 -1
- package/dist/utils/__tests__/paths.test.js.map +1 -1
- package/dist/utils/agents-model-table.d.ts.map +1 -1
- package/dist/utils/agents-model-table.js +12 -1
- package/dist/utils/agents-model-table.js.map +1 -1
- package/dist/utils/paths.d.ts +2 -0
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +23 -7
- package/dist/utils/paths.js.map +1 -1
- package/dist/verification/__tests__/ci-rust-gates.test.js +30 -19
- package/dist/verification/__tests__/ci-rust-gates.test.js.map +1 -1
- package/package.json +5 -5
- package/plugins/oh-my-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/oh-my-codex/skills/ai-slop-cleaner/SKILL.md +30 -5
- package/plugins/oh-my-codex/skills/ask/SKILL.md +58 -0
- package/plugins/oh-my-codex/skills/autoresearch-goal/SKILL.md +36 -0
- package/plugins/oh-my-codex/skills/omx-setup/SKILL.md +2 -2
- package/plugins/oh-my-codex/skills/performance-goal/SKILL.md +65 -0
- package/plugins/oh-my-codex/skills/plan/SKILL.md +1 -1
- package/plugins/oh-my-codex/skills/ralph/SKILL.md +22 -3
- package/plugins/oh-my-codex/skills/team/SKILL.md +6 -2
- package/plugins/oh-my-codex/skills/ultragoal/SKILL.md +49 -0
- package/plugins/oh-my-codex/skills/visual-ralph/SKILL.md +9 -9
- package/prompts/api-reviewer.md +1 -1
- package/prompts/code-reviewer.md +2 -0
- package/prompts/performance-reviewer.md +1 -1
- package/prompts/quality-reviewer.md +1 -1
- package/prompts/quality-strategist.md +2 -2
- package/prompts/style-reviewer.md +1 -1
- package/prompts/test-engineer.md +1 -1
- package/skills/ai-slop-cleaner/SKILL.md +30 -5
- package/skills/ask/SKILL.md +58 -0
- package/skills/ask-claude/SKILL.md +3 -54
- package/skills/ask-gemini/SKILL.md +3 -54
- package/skills/autoresearch-goal/SKILL.md +36 -0
- package/skills/build-fix/SKILL.md +4 -139
- package/skills/deepsearch/SKILL.md +4 -32
- package/skills/ecomode/SKILL.md +4 -108
- package/skills/help/SKILL.md +4 -196
- package/skills/note/SKILL.md +4 -56
- package/skills/omx-setup/SKILL.md +2 -2
- package/skills/performance-goal/SKILL.md +65 -0
- package/skills/plan/SKILL.md +1 -1
- package/skills/ralph/SKILL.md +22 -3
- package/skills/ralph-init/SKILL.md +4 -40
- package/skills/review/SKILL.md +4 -32
- package/skills/security-review/SKILL.md +4 -294
- package/skills/swarm/SKILL.md +4 -19
- package/skills/tdd/SKILL.md +4 -100
- package/skills/team/SKILL.md +6 -2
- package/skills/trace/SKILL.md +4 -27
- package/skills/ultragoal/SKILL.md +49 -0
- package/skills/visual-ralph/SKILL.md +9 -9
- package/skills/visual-verdict/SKILL.md +4 -70
- package/skills/web-clone/SKILL.md +4 -18
- package/src/scripts/__tests__/codex-native-hook.test.ts +2923 -1030
- package/src/scripts/__tests__/hook-derived-watcher.test.ts +45 -1
- package/src/scripts/__tests__/run-test-files.test.ts +46 -0
- package/src/scripts/codex-native-hook.ts +696 -46
- package/src/scripts/codex-native-pre-post.ts +369 -16
- package/src/scripts/hook-derived-watcher.ts +2 -1
- package/src/scripts/notify-fallback-watcher.ts +2 -1
- package/src/scripts/notify-hook/orchestration-intent.ts +1 -3
- package/src/scripts/notify-hook/team-leader-nudge.ts +7 -63
- package/src/scripts/notify-hook/team-worker-posttooluse.ts +1 -1
- package/src/scripts/notify-hook/team-worker-stop.ts +246 -0
- package/src/scripts/notify-hook/team-worker.ts +23 -14
- package/src/scripts/notify-hook.ts +1 -1
- package/src/scripts/run-test-files.ts +20 -1
- package/src/scripts/sync-plugin-mirror.ts +13 -4
- package/templates/catalog-manifest.json +45 -27
- package/plugins/oh-my-codex/skills/ask-claude/SKILL.md +0 -61
- package/plugins/oh-my-codex/skills/ask-gemini/SKILL.md +0 -61
- package/plugins/oh-my-codex/skills/help/SKILL.md +0 -202
- package/plugins/oh-my-codex/skills/note/SKILL.md +0 -62
- package/plugins/oh-my-codex/skills/security-review/SKILL.md +0 -300
- package/plugins/oh-my-codex/skills/trace/SKILL.md +0 -33
- package/plugins/oh-my-codex/skills/visual-verdict/SKILL.md +0 -76
package/dist/team/api-interop.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from 'node:fs';
|
|
2
2
|
import { dirname, join, resolve as resolvePath } from 'node:path';
|
|
3
|
+
import { omxStateDir } from '../utils/paths.js';
|
|
3
4
|
import { sendWorkerMessage, shutdownTeam } from './runtime.js';
|
|
4
5
|
import { TEAM_NAME_SAFE_PATTERN, WORKER_NAME_SAFE_PATTERN, TASK_ID_SAFE_PATTERN, TEAM_TASK_STATUSES, TEAM_EVENT_TYPES, TEAM_TASK_APPROVAL_STATUSES, } from './contracts.js';
|
|
5
6
|
import { readTeamEvents, waitForTeamEvent } from './state/events.js';
|
|
@@ -10,6 +11,7 @@ import { readLatestTeamProgressEvidenceMs } from './progress-evidence.js';
|
|
|
10
11
|
import { resolveCanonicalTeamStateRoot } from './state-root.js';
|
|
11
12
|
import { buildLeaderMailboxTriggerDirective, buildMailboxTriggerDirective } from './worker-bootstrap.js';
|
|
12
13
|
import { teamBroadcast as broadcastMessage, teamListMailbox as listMailboxMessages, teamMarkMessageDelivered as markMessageDelivered, teamMarkMessageNotified as markMessageNotified, teamListDispatchRequests, teamMarkDispatchRequestNotified, teamMarkDispatchRequestDelivered, teamCreateTask, teamReadTask, teamListTasks, teamUpdateTask, teamClaimTask, teamTransitionTaskStatus, teamReleaseTaskClaim, teamCleanup, teamReadConfig, teamReadManifest, teamReadWorkerStatus, teamReadWorkerHeartbeat, teamUpdateWorkerHeartbeat, teamWriteWorkerInbox, teamWriteWorkerIdentity, teamAppendEvent, teamGetSummary, teamWriteShutdownRequest, teamReadShutdownAck, teamReadMonitorSnapshot, teamReadPhase, teamReadLeaderAttention, teamWriteMonitorSnapshot, teamReadTaskApproval, teamWriteTaskApproval, } from './team-ops.js';
|
|
14
|
+
import { listTeamLookupCandidates, resolveTeamNameForCurrentContext, TeamLookupAmbiguityError } from './team-identity.js';
|
|
13
15
|
const TEAM_UPDATE_TASK_MUTABLE_FIELDS = new Set(['subject', 'description', 'blocked_by', 'requires_code_change']);
|
|
14
16
|
const TEAM_UPDATE_TASK_REQUEST_FIELDS = new Set(['team_name', 'task_id', 'workingDirectory', ...TEAM_UPDATE_TASK_MUTABLE_FIELDS]);
|
|
15
17
|
export const LEGACY_TEAM_MCP_TOOLS = [
|
|
@@ -217,7 +219,7 @@ function buildIdleState(teamName, summary, snapshot, recentEvents) {
|
|
|
217
219
|
};
|
|
218
220
|
}
|
|
219
221
|
function readLatestLeaderRuntimeActivityMs(cwd) {
|
|
220
|
-
const path = join(cwd, '
|
|
222
|
+
const path = join(omxStateDir(cwd), 'leader-runtime-activity.json');
|
|
221
223
|
if (!existsSync(path))
|
|
222
224
|
return Number.NaN;
|
|
223
225
|
try {
|
|
@@ -342,7 +344,7 @@ function parseValidatedTaskIdArray(value, fieldName) {
|
|
|
342
344
|
function teamStateExists(teamName, candidateCwd) {
|
|
343
345
|
if (!TEAM_NAME_SAFE_PATTERN.test(teamName))
|
|
344
346
|
return false;
|
|
345
|
-
const teamRoot = join(candidateCwd, '
|
|
347
|
+
const teamRoot = join(resolveCanonicalTeamStateRoot(candidateCwd), 'team', teamName);
|
|
346
348
|
return existsSync(join(teamRoot, 'config.json')) || existsSync(join(teamRoot, 'tasks')) || existsSync(teamRoot);
|
|
347
349
|
}
|
|
348
350
|
function readTeamStateRootFromManifest(path) {
|
|
@@ -363,7 +365,7 @@ function stateRootToWorkingDirectory(stateRoot) {
|
|
|
363
365
|
return dirname(dirname(absolute));
|
|
364
366
|
}
|
|
365
367
|
function resolveTeamWorkingDirectoryFromMetadata(teamName, candidateCwd) {
|
|
366
|
-
const teamRoot = join(candidateCwd, '
|
|
368
|
+
const teamRoot = join(resolveCanonicalTeamStateRoot(candidateCwd), 'team', teamName);
|
|
367
369
|
if (!existsSync(teamRoot))
|
|
368
370
|
return null;
|
|
369
371
|
const fromManifest = readTeamStateRootFromManifest(join(teamRoot, 'manifest.v2.json'));
|
|
@@ -433,9 +435,9 @@ export function buildLegacyTeamDeprecationHint(legacyName, originalArgs) {
|
|
|
433
435
|
}
|
|
434
436
|
return `Use CLI interop: omx team api ${operation} --input '${payload}' --json`;
|
|
435
437
|
}
|
|
436
|
-
function validateCommonFields(args) {
|
|
438
|
+
function validateCommonFields(args, options = {}) {
|
|
437
439
|
const teamName = String(args.team_name || '').trim();
|
|
438
|
-
if (teamName && !TEAM_NAME_SAFE_PATTERN.test(teamName)) {
|
|
440
|
+
if (!options.skipTeamName && teamName && !TEAM_NAME_SAFE_PATTERN.test(teamName)) {
|
|
439
441
|
throw new Error(`Invalid team_name: "${teamName}". Must match /^[a-z0-9][a-z0-9-]{0,29}$/ (lowercase alphanumeric + hyphens, max 30 chars).`);
|
|
440
442
|
}
|
|
441
443
|
for (const workerField of ['worker', 'from_worker', 'to_worker']) {
|
|
@@ -449,17 +451,43 @@ function validateCommonFields(args) {
|
|
|
449
451
|
throw new Error(`Invalid task_id: "${rawTaskId}". Must be a positive integer (digits only, max 20 digits).`);
|
|
450
452
|
}
|
|
451
453
|
}
|
|
454
|
+
function normalizeTeamDisplayLookupName(value) {
|
|
455
|
+
return value
|
|
456
|
+
.toLowerCase()
|
|
457
|
+
.replace(/[^a-z0-9]+/g, '-')
|
|
458
|
+
.replace(/-+/g, '-')
|
|
459
|
+
.replace(/^-|-$/g, '')
|
|
460
|
+
.slice(0, 30)
|
|
461
|
+
.replace(/-$/, '');
|
|
462
|
+
}
|
|
463
|
+
function assertUnsafeTeamNameMatchesKnownDisplay(rawTeamName, cwd) {
|
|
464
|
+
if (TEAM_NAME_SAFE_PATTERN.test(rawTeamName))
|
|
465
|
+
return;
|
|
466
|
+
const normalized = normalizeTeamDisplayLookupName(rawTeamName);
|
|
467
|
+
const matchesKnownDisplay = listTeamLookupCandidates(cwd).some((candidate) => {
|
|
468
|
+
return normalizeTeamDisplayLookupName(candidate.displayName) === normalized
|
|
469
|
+
|| normalizeTeamDisplayLookupName(candidate.requestedName) === normalized;
|
|
470
|
+
});
|
|
471
|
+
if (!matchesKnownDisplay) {
|
|
472
|
+
throw new Error(`Invalid team_name: "${rawTeamName}". Must match /^[a-z0-9][a-z0-9-]{0,29}$/ or resolve to an existing display name.`);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
452
475
|
export async function executeTeamApiOperation(operation, args, fallbackCwd) {
|
|
453
476
|
try {
|
|
454
|
-
validateCommonFields(args);
|
|
455
|
-
const
|
|
456
|
-
|
|
477
|
+
validateCommonFields(args, { skipTeamName: true });
|
|
478
|
+
const rawTeamNameForCwd = String(args.team_name || '').trim();
|
|
479
|
+
if (rawTeamNameForCwd)
|
|
480
|
+
assertUnsafeTeamNameMatchesKnownDisplay(rawTeamNameForCwd, fallbackCwd);
|
|
481
|
+
const resolvedTeamName = rawTeamNameForCwd ? resolveTeamNameForCurrentContext(rawTeamNameForCwd, fallbackCwd) : '';
|
|
482
|
+
const cwd = resolvedTeamName ? resolveTeamWorkingDirectory(resolvedTeamName, fallbackCwd) : fallbackCwd;
|
|
483
|
+
const opArgs = resolvedTeamName ? { ...args, team_name: resolvedTeamName } : args;
|
|
484
|
+
validateCommonFields(opArgs);
|
|
457
485
|
switch (operation) {
|
|
458
486
|
case 'send-message': {
|
|
459
|
-
const teamName = String(
|
|
460
|
-
const fromWorker = String(
|
|
461
|
-
const toWorker = String(
|
|
462
|
-
const body = String(
|
|
487
|
+
const teamName = String(opArgs.team_name || '').trim();
|
|
488
|
+
const fromWorker = String(opArgs.from_worker || '').trim();
|
|
489
|
+
const toWorker = String(opArgs.to_worker || '').trim();
|
|
490
|
+
const body = String(opArgs.body || '').trim();
|
|
463
491
|
if (!fromWorker) {
|
|
464
492
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'from_worker is required. You must identify yourself.' } };
|
|
465
493
|
}
|
|
@@ -525,9 +553,9 @@ export async function executeTeamApiOperation(operation, args, fallbackCwd) {
|
|
|
525
553
|
return { ok: true, operation, data: { message, dispatch: outcome } };
|
|
526
554
|
}
|
|
527
555
|
case 'broadcast': {
|
|
528
|
-
const teamName = String(
|
|
529
|
-
const fromWorker = String(
|
|
530
|
-
const body = String(
|
|
556
|
+
const teamName = String(opArgs.team_name || '').trim();
|
|
557
|
+
const fromWorker = String(opArgs.from_worker || '').trim();
|
|
558
|
+
const body = String(opArgs.body || '').trim();
|
|
531
559
|
if (!teamName || !fromWorker || !body) {
|
|
532
560
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'team_name, from_worker, body are required' } };
|
|
533
561
|
}
|
|
@@ -535,9 +563,9 @@ export async function executeTeamApiOperation(operation, args, fallbackCwd) {
|
|
|
535
563
|
return { ok: true, operation, data: { count: messages.length, messages } };
|
|
536
564
|
}
|
|
537
565
|
case 'mailbox-list': {
|
|
538
|
-
const teamName = String(
|
|
539
|
-
const worker = String(
|
|
540
|
-
const includeDelivered =
|
|
566
|
+
const teamName = String(opArgs.team_name || '').trim();
|
|
567
|
+
const worker = String(opArgs.worker || '').trim();
|
|
568
|
+
const includeDelivered = opArgs.include_delivered !== false;
|
|
541
569
|
if (!teamName || !worker) {
|
|
542
570
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'team_name and worker are required' } };
|
|
543
571
|
}
|
|
@@ -546,9 +574,9 @@ export async function executeTeamApiOperation(operation, args, fallbackCwd) {
|
|
|
546
574
|
return { ok: true, operation, data: { worker, count: messages.length, messages } };
|
|
547
575
|
}
|
|
548
576
|
case 'mailbox-mark-delivered': {
|
|
549
|
-
const teamName = String(
|
|
550
|
-
const worker = String(
|
|
551
|
-
const messageId = String(
|
|
577
|
+
const teamName = String(opArgs.team_name || '').trim();
|
|
578
|
+
const worker = String(opArgs.worker || '').trim();
|
|
579
|
+
const messageId = String(opArgs.message_id || '').trim();
|
|
552
580
|
if (!teamName || !worker || !messageId) {
|
|
553
581
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'team_name, worker, message_id are required' } };
|
|
554
582
|
}
|
|
@@ -577,9 +605,9 @@ export async function executeTeamApiOperation(operation, args, fallbackCwd) {
|
|
|
577
605
|
};
|
|
578
606
|
}
|
|
579
607
|
case 'mailbox-mark-notified': {
|
|
580
|
-
const teamName = String(
|
|
581
|
-
const worker = String(
|
|
582
|
-
const messageId = String(
|
|
608
|
+
const teamName = String(opArgs.team_name || '').trim();
|
|
609
|
+
const worker = String(opArgs.worker || '').trim();
|
|
610
|
+
const messageId = String(opArgs.message_id || '').trim();
|
|
583
611
|
if (!teamName || !worker || !messageId) {
|
|
584
612
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'team_name, worker, message_id are required' } };
|
|
585
613
|
}
|
|
@@ -587,23 +615,23 @@ export async function executeTeamApiOperation(operation, args, fallbackCwd) {
|
|
|
587
615
|
return { ok: true, operation, data: { worker, message_id: messageId, notified } };
|
|
588
616
|
}
|
|
589
617
|
case 'create-task': {
|
|
590
|
-
const teamName = String(
|
|
591
|
-
const subject = String(
|
|
592
|
-
const description = String(
|
|
618
|
+
const teamName = String(opArgs.team_name || '').trim();
|
|
619
|
+
const subject = String(opArgs.subject || '').trim();
|
|
620
|
+
const description = String(opArgs.description || '').trim();
|
|
593
621
|
if (!teamName || !subject || !description) {
|
|
594
622
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'team_name, subject, description are required' } };
|
|
595
623
|
}
|
|
596
|
-
const owner =
|
|
597
|
-
const blockedBy =
|
|
598
|
-
const requiresCodeChange =
|
|
624
|
+
const owner = opArgs.owner;
|
|
625
|
+
const blockedBy = opArgs.blocked_by;
|
|
626
|
+
const requiresCodeChange = opArgs.requires_code_change;
|
|
599
627
|
const task = await teamCreateTask(teamName, {
|
|
600
628
|
subject, description, status: 'pending', owner: owner || undefined, blocked_by: blockedBy, requires_code_change: requiresCodeChange,
|
|
601
629
|
}, cwd);
|
|
602
630
|
return { ok: true, operation, data: { task } };
|
|
603
631
|
}
|
|
604
632
|
case 'read-task': {
|
|
605
|
-
const teamName = String(
|
|
606
|
-
const taskId = String(
|
|
633
|
+
const teamName = String(opArgs.team_name || '').trim();
|
|
634
|
+
const taskId = String(opArgs.task_id || '').trim();
|
|
607
635
|
if (!teamName || !taskId) {
|
|
608
636
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'team_name and task_id are required' } };
|
|
609
637
|
}
|
|
@@ -613,7 +641,7 @@ export async function executeTeamApiOperation(operation, args, fallbackCwd) {
|
|
|
613
641
|
: { ok: false, operation, error: { code: 'task_not_found', message: 'task_not_found' } };
|
|
614
642
|
}
|
|
615
643
|
case 'list-tasks': {
|
|
616
|
-
const teamName = String(
|
|
644
|
+
const teamName = String(opArgs.team_name || '').trim();
|
|
617
645
|
if (!teamName) {
|
|
618
646
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'team_name is required' } };
|
|
619
647
|
}
|
|
@@ -621,8 +649,8 @@ export async function executeTeamApiOperation(operation, args, fallbackCwd) {
|
|
|
621
649
|
return { ok: true, operation, data: { count: tasks.length, tasks } };
|
|
622
650
|
}
|
|
623
651
|
case 'update-task': {
|
|
624
|
-
const teamName = String(
|
|
625
|
-
const taskId = String(
|
|
652
|
+
const teamName = String(opArgs.team_name || '').trim();
|
|
653
|
+
const taskId = String(opArgs.task_id || '').trim();
|
|
626
654
|
if (!teamName || !taskId) {
|
|
627
655
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'team_name and task_id are required' } };
|
|
628
656
|
}
|
|
@@ -637,26 +665,26 @@ export async function executeTeamApiOperation(operation, args, fallbackCwd) {
|
|
|
637
665
|
}
|
|
638
666
|
const updates = {};
|
|
639
667
|
if ('subject' in args) {
|
|
640
|
-
if (typeof
|
|
668
|
+
if (typeof opArgs.subject !== 'string') {
|
|
641
669
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'subject must be a string when provided' } };
|
|
642
670
|
}
|
|
643
|
-
updates.subject =
|
|
671
|
+
updates.subject = opArgs.subject.trim();
|
|
644
672
|
}
|
|
645
673
|
if ('description' in args) {
|
|
646
|
-
if (typeof
|
|
674
|
+
if (typeof opArgs.description !== 'string') {
|
|
647
675
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'description must be a string when provided' } };
|
|
648
676
|
}
|
|
649
|
-
updates.description =
|
|
677
|
+
updates.description = opArgs.description.trim();
|
|
650
678
|
}
|
|
651
679
|
if ('requires_code_change' in args) {
|
|
652
|
-
if (typeof
|
|
680
|
+
if (typeof opArgs.requires_code_change !== 'boolean') {
|
|
653
681
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'requires_code_change must be a boolean when provided' } };
|
|
654
682
|
}
|
|
655
|
-
updates.requires_code_change =
|
|
683
|
+
updates.requires_code_change = opArgs.requires_code_change;
|
|
656
684
|
}
|
|
657
685
|
if ('blocked_by' in args) {
|
|
658
686
|
try {
|
|
659
|
-
updates.blocked_by = parseValidatedTaskIdArray(
|
|
687
|
+
updates.blocked_by = parseValidatedTaskIdArray(opArgs.blocked_by, 'blocked_by');
|
|
660
688
|
}
|
|
661
689
|
catch (error) {
|
|
662
690
|
return { ok: false, operation, error: { code: 'invalid_input', message: error.message } };
|
|
@@ -668,13 +696,13 @@ export async function executeTeamApiOperation(operation, args, fallbackCwd) {
|
|
|
668
696
|
: { ok: false, operation, error: { code: 'task_not_found', message: 'task_not_found' } };
|
|
669
697
|
}
|
|
670
698
|
case 'claim-task': {
|
|
671
|
-
const teamName = String(
|
|
672
|
-
const taskId = String(
|
|
673
|
-
const worker = String(
|
|
699
|
+
const teamName = String(opArgs.team_name || '').trim();
|
|
700
|
+
const taskId = String(opArgs.task_id || '').trim();
|
|
701
|
+
const worker = String(opArgs.worker || '').trim();
|
|
674
702
|
if (!teamName || !taskId || !worker) {
|
|
675
703
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'team_name, task_id, worker are required' } };
|
|
676
704
|
}
|
|
677
|
-
const rawExpectedVersion =
|
|
705
|
+
const rawExpectedVersion = opArgs.expected_version;
|
|
678
706
|
if (rawExpectedVersion !== undefined && (!isFiniteInteger(rawExpectedVersion) || rawExpectedVersion < 1)) {
|
|
679
707
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'expected_version must be a positive integer when provided' } };
|
|
680
708
|
}
|
|
@@ -682,13 +710,13 @@ export async function executeTeamApiOperation(operation, args, fallbackCwd) {
|
|
|
682
710
|
return { ok: true, operation, data: result };
|
|
683
711
|
}
|
|
684
712
|
case 'transition-task-status': {
|
|
685
|
-
const teamName = String(
|
|
686
|
-
const taskId = String(
|
|
687
|
-
const from = String(
|
|
688
|
-
const to = String(
|
|
689
|
-
const claimToken = String(
|
|
690
|
-
const transitionResult =
|
|
691
|
-
const transitionError =
|
|
713
|
+
const teamName = String(opArgs.team_name || '').trim();
|
|
714
|
+
const taskId = String(opArgs.task_id || '').trim();
|
|
715
|
+
const from = String(opArgs.from || '').trim();
|
|
716
|
+
const to = String(opArgs.to || '').trim();
|
|
717
|
+
const claimToken = String(opArgs.claim_token || '').trim();
|
|
718
|
+
const transitionResult = opArgs.result;
|
|
719
|
+
const transitionError = opArgs.error;
|
|
692
720
|
if (!teamName || !taskId || !from || !to || !claimToken) {
|
|
693
721
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'team_name, task_id, from, to, claim_token are required' } };
|
|
694
722
|
}
|
|
@@ -709,10 +737,10 @@ export async function executeTeamApiOperation(operation, args, fallbackCwd) {
|
|
|
709
737
|
return { ok: true, operation, data: result };
|
|
710
738
|
}
|
|
711
739
|
case 'release-task-claim': {
|
|
712
|
-
const teamName = String(
|
|
713
|
-
const taskId = String(
|
|
714
|
-
const claimToken = String(
|
|
715
|
-
const worker = String(
|
|
740
|
+
const teamName = String(opArgs.team_name || '').trim();
|
|
741
|
+
const taskId = String(opArgs.task_id || '').trim();
|
|
742
|
+
const claimToken = String(opArgs.claim_token || '').trim();
|
|
743
|
+
const worker = String(opArgs.worker || '').trim();
|
|
716
744
|
if (!teamName || !taskId || !claimToken || !worker) {
|
|
717
745
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'team_name, task_id, claim_token, worker are required' } };
|
|
718
746
|
}
|
|
@@ -720,7 +748,7 @@ export async function executeTeamApiOperation(operation, args, fallbackCwd) {
|
|
|
720
748
|
return { ok: true, operation, data: result };
|
|
721
749
|
}
|
|
722
750
|
case 'read-config': {
|
|
723
|
-
const teamName = String(
|
|
751
|
+
const teamName = String(opArgs.team_name || '').trim();
|
|
724
752
|
if (!teamName)
|
|
725
753
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'team_name is required' } };
|
|
726
754
|
const config = await teamReadConfig(teamName, cwd);
|
|
@@ -729,7 +757,7 @@ export async function executeTeamApiOperation(operation, args, fallbackCwd) {
|
|
|
729
757
|
: { ok: false, operation, error: { code: 'team_not_found', message: 'team_not_found' } };
|
|
730
758
|
}
|
|
731
759
|
case 'read-manifest': {
|
|
732
|
-
const teamName = String(
|
|
760
|
+
const teamName = String(opArgs.team_name || '').trim();
|
|
733
761
|
if (!teamName)
|
|
734
762
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'team_name is required' } };
|
|
735
763
|
const manifest = await teamReadManifest(teamName, cwd);
|
|
@@ -738,27 +766,27 @@ export async function executeTeamApiOperation(operation, args, fallbackCwd) {
|
|
|
738
766
|
: { ok: false, operation, error: { code: 'manifest_not_found', message: 'manifest_not_found' } };
|
|
739
767
|
}
|
|
740
768
|
case 'read-worker-status': {
|
|
741
|
-
const teamName = String(
|
|
742
|
-
const worker = String(
|
|
769
|
+
const teamName = String(opArgs.team_name || '').trim();
|
|
770
|
+
const worker = String(opArgs.worker || '').trim();
|
|
743
771
|
if (!teamName || !worker)
|
|
744
772
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'team_name and worker are required' } };
|
|
745
773
|
const status = await teamReadWorkerStatus(teamName, worker, cwd);
|
|
746
774
|
return { ok: true, operation, data: { worker, status } };
|
|
747
775
|
}
|
|
748
776
|
case 'read-worker-heartbeat': {
|
|
749
|
-
const teamName = String(
|
|
750
|
-
const worker = String(
|
|
777
|
+
const teamName = String(opArgs.team_name || '').trim();
|
|
778
|
+
const worker = String(opArgs.worker || '').trim();
|
|
751
779
|
if (!teamName || !worker)
|
|
752
780
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'team_name and worker are required' } };
|
|
753
781
|
const heartbeat = await teamReadWorkerHeartbeat(teamName, worker, cwd);
|
|
754
782
|
return { ok: true, operation, data: { worker, heartbeat } };
|
|
755
783
|
}
|
|
756
784
|
case 'update-worker-heartbeat': {
|
|
757
|
-
const teamName = String(
|
|
758
|
-
const worker = String(
|
|
759
|
-
const pid =
|
|
760
|
-
const turnCount =
|
|
761
|
-
const alive =
|
|
785
|
+
const teamName = String(opArgs.team_name || '').trim();
|
|
786
|
+
const worker = String(opArgs.worker || '').trim();
|
|
787
|
+
const pid = opArgs.pid;
|
|
788
|
+
const turnCount = opArgs.turn_count;
|
|
789
|
+
const alive = opArgs.alive;
|
|
762
790
|
if (!teamName || !worker || typeof pid !== 'number' || typeof turnCount !== 'number' || typeof alive !== 'boolean') {
|
|
763
791
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'team_name, worker, pid, turn_count, alive are required' } };
|
|
764
792
|
}
|
|
@@ -766,9 +794,9 @@ export async function executeTeamApiOperation(operation, args, fallbackCwd) {
|
|
|
766
794
|
return { ok: true, operation, data: { worker } };
|
|
767
795
|
}
|
|
768
796
|
case 'write-worker-inbox': {
|
|
769
|
-
const teamName = String(
|
|
770
|
-
const worker = String(
|
|
771
|
-
const content = String(
|
|
797
|
+
const teamName = String(opArgs.team_name || '').trim();
|
|
798
|
+
const worker = String(opArgs.worker || '').trim();
|
|
799
|
+
const content = String(opArgs.content || '').trim();
|
|
772
800
|
if (!teamName || !worker || !content) {
|
|
773
801
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'team_name, worker, content are required' } };
|
|
774
802
|
}
|
|
@@ -776,10 +804,10 @@ export async function executeTeamApiOperation(operation, args, fallbackCwd) {
|
|
|
776
804
|
return { ok: true, operation, data: { worker } };
|
|
777
805
|
}
|
|
778
806
|
case 'write-worker-identity': {
|
|
779
|
-
const teamName = String(
|
|
780
|
-
const worker = String(
|
|
781
|
-
const index =
|
|
782
|
-
const role = String(
|
|
807
|
+
const teamName = String(opArgs.team_name || '').trim();
|
|
808
|
+
const worker = String(opArgs.worker || '').trim();
|
|
809
|
+
const index = opArgs.index;
|
|
810
|
+
const role = String(opArgs.role || '').trim();
|
|
783
811
|
if (!teamName || !worker || typeof index !== 'number' || !role) {
|
|
784
812
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'team_name, worker, index, role are required' } };
|
|
785
813
|
}
|
|
@@ -787,21 +815,21 @@ export async function executeTeamApiOperation(operation, args, fallbackCwd) {
|
|
|
787
815
|
name: worker,
|
|
788
816
|
index,
|
|
789
817
|
role,
|
|
790
|
-
assigned_tasks:
|
|
791
|
-
pid:
|
|
792
|
-
pane_id:
|
|
793
|
-
working_dir:
|
|
794
|
-
worktree_path:
|
|
795
|
-
worktree_branch:
|
|
796
|
-
worktree_detached:
|
|
797
|
-
team_state_root:
|
|
818
|
+
assigned_tasks: opArgs.assigned_tasks ?? [],
|
|
819
|
+
pid: opArgs.pid,
|
|
820
|
+
pane_id: opArgs.pane_id,
|
|
821
|
+
working_dir: opArgs.working_dir,
|
|
822
|
+
worktree_path: opArgs.worktree_path,
|
|
823
|
+
worktree_branch: opArgs.worktree_branch,
|
|
824
|
+
worktree_detached: opArgs.worktree_detached,
|
|
825
|
+
team_state_root: opArgs.team_state_root,
|
|
798
826
|
}, cwd);
|
|
799
827
|
return { ok: true, operation, data: { worker } };
|
|
800
828
|
}
|
|
801
829
|
case 'append-event': {
|
|
802
|
-
const teamName = String(
|
|
803
|
-
const eventType = String(
|
|
804
|
-
const worker = String(
|
|
830
|
+
const teamName = String(opArgs.team_name || '').trim();
|
|
831
|
+
const eventType = String(opArgs.type || '').trim();
|
|
832
|
+
const worker = String(opArgs.worker || '').trim();
|
|
805
833
|
if (!teamName || !eventType || !worker) {
|
|
806
834
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'team_name, type, worker are required' } };
|
|
807
835
|
}
|
|
@@ -811,29 +839,29 @@ export async function executeTeamApiOperation(operation, args, fallbackCwd) {
|
|
|
811
839
|
const event = await teamAppendEvent(teamName, {
|
|
812
840
|
type: eventType,
|
|
813
841
|
worker,
|
|
814
|
-
task_id:
|
|
815
|
-
message_id:
|
|
816
|
-
reason:
|
|
817
|
-
state:
|
|
818
|
-
prev_state:
|
|
819
|
-
to_worker:
|
|
820
|
-
worker_count: typeof
|
|
821
|
-
source_type:
|
|
822
|
-
metadata: parseOptionalMetadata(
|
|
842
|
+
task_id: opArgs.task_id,
|
|
843
|
+
message_id: opArgs.message_id ?? null,
|
|
844
|
+
reason: opArgs.reason,
|
|
845
|
+
state: opArgs.state,
|
|
846
|
+
prev_state: opArgs.prev_state,
|
|
847
|
+
to_worker: opArgs.to_worker,
|
|
848
|
+
worker_count: typeof opArgs.worker_count === 'number' ? opArgs.worker_count : undefined,
|
|
849
|
+
source_type: opArgs.source_type,
|
|
850
|
+
metadata: parseOptionalMetadata(opArgs.metadata),
|
|
823
851
|
}, cwd);
|
|
824
852
|
return { ok: true, operation, data: { event } };
|
|
825
853
|
}
|
|
826
854
|
case 'read-events': {
|
|
827
|
-
const teamName = String(
|
|
855
|
+
const teamName = String(opArgs.team_name || '').trim();
|
|
828
856
|
if (!teamName) {
|
|
829
857
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'team_name is required' } };
|
|
830
858
|
}
|
|
831
|
-
const wakeableOnly = parseOptionalBoolean(
|
|
832
|
-
const eventType = parseOptionalEventType(
|
|
833
|
-
const worker = typeof
|
|
834
|
-
const taskId = typeof
|
|
859
|
+
const wakeableOnly = parseOptionalBoolean(opArgs.wakeable_only, 'wakeable_only');
|
|
860
|
+
const eventType = parseOptionalEventType(opArgs.type);
|
|
861
|
+
const worker = typeof opArgs.worker === 'string' ? opArgs.worker.trim() : '';
|
|
862
|
+
const taskId = typeof opArgs.task_id === 'string' ? opArgs.task_id.trim() : '';
|
|
835
863
|
const events = await readTeamEvents(teamName, cwd, {
|
|
836
|
-
afterEventId: typeof
|
|
864
|
+
afterEventId: typeof opArgs.after_event_id === 'string' ? opArgs.after_event_id.trim() || undefined : undefined,
|
|
837
865
|
wakeableOnly: wakeableOnly ?? false,
|
|
838
866
|
type: eventType ?? undefined,
|
|
839
867
|
worker: worker || undefined,
|
|
@@ -844,24 +872,24 @@ export async function executeTeamApiOperation(operation, args, fallbackCwd) {
|
|
|
844
872
|
operation,
|
|
845
873
|
data: {
|
|
846
874
|
count: events.length,
|
|
847
|
-
cursor: events.at(-1)?.event_id ?? (typeof
|
|
875
|
+
cursor: events.at(-1)?.event_id ?? (typeof opArgs.after_event_id === 'string' ? opArgs.after_event_id.trim() : ''),
|
|
848
876
|
events,
|
|
849
877
|
},
|
|
850
878
|
};
|
|
851
879
|
}
|
|
852
880
|
case 'await-event': {
|
|
853
|
-
const teamName = String(
|
|
881
|
+
const teamName = String(opArgs.team_name || '').trim();
|
|
854
882
|
if (!teamName) {
|
|
855
883
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'team_name is required' } };
|
|
856
884
|
}
|
|
857
|
-
const timeoutMs = parseOptionalNonNegativeInteger(
|
|
858
|
-
const pollMs = parseOptionalNonNegativeInteger(
|
|
859
|
-
const wakeableOnly = parseOptionalBoolean(
|
|
860
|
-
const eventType = parseOptionalEventType(
|
|
861
|
-
const worker = typeof
|
|
862
|
-
const taskId = typeof
|
|
885
|
+
const timeoutMs = parseOptionalNonNegativeInteger(opArgs.timeout_ms, 'timeout_ms') ?? 30_000;
|
|
886
|
+
const pollMs = parseOptionalNonNegativeInteger(opArgs.poll_ms, 'poll_ms');
|
|
887
|
+
const wakeableOnly = parseOptionalBoolean(opArgs.wakeable_only, 'wakeable_only');
|
|
888
|
+
const eventType = parseOptionalEventType(opArgs.type);
|
|
889
|
+
const worker = typeof opArgs.worker === 'string' ? opArgs.worker.trim() : '';
|
|
890
|
+
const taskId = typeof opArgs.task_id === 'string' ? opArgs.task_id.trim() : '';
|
|
863
891
|
const result = await waitForTeamEvent(teamName, cwd, {
|
|
864
|
-
afterEventId: typeof
|
|
892
|
+
afterEventId: typeof opArgs.after_event_id === 'string' ? opArgs.after_event_id.trim() || undefined : undefined,
|
|
865
893
|
timeoutMs,
|
|
866
894
|
pollMs: pollMs ?? undefined,
|
|
867
895
|
wakeableOnly: wakeableOnly ?? false,
|
|
@@ -880,7 +908,7 @@ export async function executeTeamApiOperation(operation, args, fallbackCwd) {
|
|
|
880
908
|
};
|
|
881
909
|
}
|
|
882
910
|
case 'read-idle-state': {
|
|
883
|
-
const teamName = String(
|
|
911
|
+
const teamName = String(opArgs.team_name || '').trim();
|
|
884
912
|
if (!teamName) {
|
|
885
913
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'team_name is required' } };
|
|
886
914
|
}
|
|
@@ -900,7 +928,7 @@ export async function executeTeamApiOperation(operation, args, fallbackCwd) {
|
|
|
900
928
|
};
|
|
901
929
|
}
|
|
902
930
|
case 'read-stall-state': {
|
|
903
|
-
const teamName = String(
|
|
931
|
+
const teamName = String(opArgs.team_name || '').trim();
|
|
904
932
|
if (!teamName) {
|
|
905
933
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'team_name is required' } };
|
|
906
934
|
}
|
|
@@ -943,7 +971,7 @@ export async function executeTeamApiOperation(operation, args, fallbackCwd) {
|
|
|
943
971
|
};
|
|
944
972
|
}
|
|
945
973
|
case 'get-summary': {
|
|
946
|
-
const teamName = String(
|
|
974
|
+
const teamName = String(opArgs.team_name || '').trim();
|
|
947
975
|
if (!teamName)
|
|
948
976
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'team_name is required' } };
|
|
949
977
|
const summary = await teamGetSummary(teamName, cwd);
|
|
@@ -952,7 +980,7 @@ export async function executeTeamApiOperation(operation, args, fallbackCwd) {
|
|
|
952
980
|
: { ok: false, operation, error: { code: 'team_not_found', message: 'team_not_found' } };
|
|
953
981
|
}
|
|
954
982
|
case 'cleanup': {
|
|
955
|
-
const teamName = String(
|
|
983
|
+
const teamName = String(opArgs.team_name || '').trim();
|
|
956
984
|
if (!teamName)
|
|
957
985
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'team_name is required' } };
|
|
958
986
|
const force = args.force === true;
|
|
@@ -961,16 +989,16 @@ export async function executeTeamApiOperation(operation, args, fallbackCwd) {
|
|
|
961
989
|
return { ok: true, operation, data: { team_name: teamName, cleanup_mode: 'shutdown' } };
|
|
962
990
|
}
|
|
963
991
|
case 'orphan-cleanup': {
|
|
964
|
-
const teamName = String(
|
|
992
|
+
const teamName = String(opArgs.team_name || '').trim();
|
|
965
993
|
if (!teamName)
|
|
966
994
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'team_name is required' } };
|
|
967
995
|
await teamCleanup(teamName, cwd);
|
|
968
996
|
return { ok: true, operation, data: { team_name: teamName, cleanup_mode: 'orphan_cleanup' } };
|
|
969
997
|
}
|
|
970
998
|
case 'write-shutdown-request': {
|
|
971
|
-
const teamName = String(
|
|
972
|
-
const worker = String(
|
|
973
|
-
const requestedBy = String(
|
|
999
|
+
const teamName = String(opArgs.team_name || '').trim();
|
|
1000
|
+
const worker = String(opArgs.worker || '').trim();
|
|
1001
|
+
const requestedBy = String(opArgs.requested_by || '').trim();
|
|
974
1002
|
if (!teamName || !worker || !requestedBy) {
|
|
975
1003
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'team_name, worker, requested_by are required' } };
|
|
976
1004
|
}
|
|
@@ -978,24 +1006,24 @@ export async function executeTeamApiOperation(operation, args, fallbackCwd) {
|
|
|
978
1006
|
return { ok: true, operation, data: { worker } };
|
|
979
1007
|
}
|
|
980
1008
|
case 'read-shutdown-ack': {
|
|
981
|
-
const teamName = String(
|
|
982
|
-
const worker = String(
|
|
1009
|
+
const teamName = String(opArgs.team_name || '').trim();
|
|
1010
|
+
const worker = String(opArgs.worker || '').trim();
|
|
983
1011
|
if (!teamName || !worker) {
|
|
984
1012
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'team_name and worker are required' } };
|
|
985
1013
|
}
|
|
986
|
-
const ack = await teamReadShutdownAck(teamName, worker, cwd,
|
|
1014
|
+
const ack = await teamReadShutdownAck(teamName, worker, cwd, opArgs.min_updated_at);
|
|
987
1015
|
return { ok: true, operation, data: { worker, ack } };
|
|
988
1016
|
}
|
|
989
1017
|
case 'read-monitor-snapshot': {
|
|
990
|
-
const teamName = String(
|
|
1018
|
+
const teamName = String(opArgs.team_name || '').trim();
|
|
991
1019
|
if (!teamName)
|
|
992
1020
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'team_name is required' } };
|
|
993
1021
|
const snapshot = await teamReadMonitorSnapshot(teamName, cwd);
|
|
994
1022
|
return { ok: true, operation, data: { snapshot } };
|
|
995
1023
|
}
|
|
996
1024
|
case 'write-monitor-snapshot': {
|
|
997
|
-
const teamName = String(
|
|
998
|
-
const snapshot =
|
|
1025
|
+
const teamName = String(opArgs.team_name || '').trim();
|
|
1026
|
+
const snapshot = opArgs.snapshot;
|
|
999
1027
|
if (!teamName || !snapshot) {
|
|
1000
1028
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'team_name and snapshot are required' } };
|
|
1001
1029
|
}
|
|
@@ -1003,8 +1031,8 @@ export async function executeTeamApiOperation(operation, args, fallbackCwd) {
|
|
|
1003
1031
|
return { ok: true, operation, data: {} };
|
|
1004
1032
|
}
|
|
1005
1033
|
case 'read-task-approval': {
|
|
1006
|
-
const teamName = String(
|
|
1007
|
-
const taskId = String(
|
|
1034
|
+
const teamName = String(opArgs.team_name || '').trim();
|
|
1035
|
+
const taskId = String(opArgs.task_id || '').trim();
|
|
1008
1036
|
if (!teamName || !taskId) {
|
|
1009
1037
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'team_name and task_id are required' } };
|
|
1010
1038
|
}
|
|
@@ -1012,18 +1040,18 @@ export async function executeTeamApiOperation(operation, args, fallbackCwd) {
|
|
|
1012
1040
|
return { ok: true, operation, data: { approval } };
|
|
1013
1041
|
}
|
|
1014
1042
|
case 'write-task-approval': {
|
|
1015
|
-
const teamName = String(
|
|
1016
|
-
const taskId = String(
|
|
1017
|
-
const status = String(
|
|
1018
|
-
const reviewer = String(
|
|
1019
|
-
const decisionReason = String(
|
|
1043
|
+
const teamName = String(opArgs.team_name || '').trim();
|
|
1044
|
+
const taskId = String(opArgs.task_id || '').trim();
|
|
1045
|
+
const status = String(opArgs.status || '').trim();
|
|
1046
|
+
const reviewer = String(opArgs.reviewer || '').trim();
|
|
1047
|
+
const decisionReason = String(opArgs.decision_reason || '').trim();
|
|
1020
1048
|
if (!teamName || !taskId || !status || !reviewer || !decisionReason) {
|
|
1021
1049
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'team_name, task_id, status, reviewer, decision_reason are required' } };
|
|
1022
1050
|
}
|
|
1023
1051
|
if (!TEAM_TASK_APPROVAL_STATUSES.includes(status)) {
|
|
1024
1052
|
return { ok: false, operation, error: { code: 'invalid_input', message: `status must be one of: ${TEAM_TASK_APPROVAL_STATUSES.join(', ')}` } };
|
|
1025
1053
|
}
|
|
1026
|
-
const rawRequired =
|
|
1054
|
+
const rawRequired = opArgs.required;
|
|
1027
1055
|
if (rawRequired !== undefined && typeof rawRequired !== 'boolean') {
|
|
1028
1056
|
return { ok: false, operation, error: { code: 'invalid_input', message: 'required must be a boolean when provided' } };
|
|
1029
1057
|
}
|
|
@@ -1040,6 +1068,9 @@ export async function executeTeamApiOperation(operation, args, fallbackCwd) {
|
|
|
1040
1068
|
}
|
|
1041
1069
|
}
|
|
1042
1070
|
catch (error) {
|
|
1071
|
+
if (error instanceof TeamLookupAmbiguityError) {
|
|
1072
|
+
return { ok: false, operation, error: { code: 'ambiguous_team_name', message: error.message, details: { candidates: error.candidates } } };
|
|
1073
|
+
}
|
|
1043
1074
|
return {
|
|
1044
1075
|
ok: false,
|
|
1045
1076
|
operation,
|