oh-my-codex 0.21.0 → 0.21.2
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.toml +1 -1
- package/README.md +4 -2
- package/dist/cli/__tests__/detached-launch-diagnostics-3578.test.d.ts +2 -0
- package/dist/cli/__tests__/detached-launch-diagnostics-3578.test.d.ts.map +1 -0
- package/dist/cli/__tests__/detached-launch-diagnostics-3578.test.js +592 -0
- package/dist/cli/__tests__/detached-launch-diagnostics-3578.test.js.map +1 -0
- package/dist/cli/__tests__/detached-leader-teardown.test.js +270 -33
- package/dist/cli/__tests__/detached-leader-teardown.test.js.map +1 -1
- package/dist/cli/__tests__/doctor-warning-copy.test.js +133 -5
- package/dist/cli/__tests__/doctor-warning-copy.test.js.map +1 -1
- package/dist/cli/__tests__/index.test.js +543 -2
- package/dist/cli/__tests__/index.test.js.map +1 -1
- package/dist/cli/__tests__/issue-windows-cancel-identity.test.d.ts +2 -0
- package/dist/cli/__tests__/issue-windows-cancel-identity.test.d.ts.map +1 -0
- package/dist/cli/__tests__/issue-windows-cancel-identity.test.js +17 -0
- package/dist/cli/__tests__/issue-windows-cancel-identity.test.js.map +1 -0
- package/dist/cli/__tests__/launch-fallback.test.js +15 -3
- package/dist/cli/__tests__/launch-fallback.test.js.map +1 -1
- package/dist/cli/__tests__/package-bin-contract.test.js +20 -0
- package/dist/cli/__tests__/package-bin-contract.test.js.map +1 -1
- package/dist/cli/__tests__/plugin-cache-stale-lock.test.d.ts +2 -0
- package/dist/cli/__tests__/plugin-cache-stale-lock.test.d.ts.map +1 -0
- package/dist/cli/__tests__/plugin-cache-stale-lock.test.js +76 -0
- package/dist/cli/__tests__/plugin-cache-stale-lock.test.js.map +1 -0
- package/dist/cli/__tests__/plugin-cache-symlink-provenance-3552.test.d.ts +2 -0
- package/dist/cli/__tests__/plugin-cache-symlink-provenance-3552.test.d.ts.map +1 -0
- package/dist/cli/__tests__/plugin-cache-symlink-provenance-3552.test.js +1662 -0
- package/dist/cli/__tests__/plugin-cache-symlink-provenance-3552.test.js.map +1 -0
- package/dist/cli/__tests__/plugin-launcher-provenance-3558.test.d.ts +2 -0
- package/dist/cli/__tests__/plugin-launcher-provenance-3558.test.d.ts.map +1 -0
- package/dist/cli/__tests__/plugin-launcher-provenance-3558.test.js +522 -0
- package/dist/cli/__tests__/plugin-launcher-provenance-3558.test.js.map +1 -0
- package/dist/cli/__tests__/ralplan-advisory.test.d.ts +2 -0
- package/dist/cli/__tests__/ralplan-advisory.test.d.ts.map +1 -0
- package/dist/cli/__tests__/ralplan-advisory.test.js +301 -0
- package/dist/cli/__tests__/ralplan-advisory.test.js.map +1 -0
- package/dist/cli/__tests__/ralplan.test.js +39 -0
- package/dist/cli/__tests__/ralplan.test.js.map +1 -1
- package/dist/cli/__tests__/resume.test.js +81 -6
- package/dist/cli/__tests__/resume.test.js.map +1 -1
- package/dist/cli/__tests__/session-scoped-runtime.test.js +423 -4
- package/dist/cli/__tests__/session-scoped-runtime.test.js.map +1 -1
- package/dist/cli/__tests__/setup-install-mode.test.js +60 -3
- package/dist/cli/__tests__/setup-install-mode.test.js.map +1 -1
- package/dist/cli/__tests__/setup-refresh.test.js +9 -0
- package/dist/cli/__tests__/setup-refresh.test.js.map +1 -1
- package/dist/cli/__tests__/sparkshell-cli.test.js +4 -0
- package/dist/cli/__tests__/sparkshell-cli.test.js.map +1 -1
- package/dist/cli/__tests__/ultragoal.test.js +71 -0
- package/dist/cli/__tests__/ultragoal.test.js.map +1 -1
- package/dist/cli/__tests__/windows-popup-loop-contract.test.js +30 -4
- package/dist/cli/__tests__/windows-popup-loop-contract.test.js.map +1 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +57 -8
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/index.d.ts +113 -7
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +1850 -185
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/native-assets.d.ts +2 -1
- package/dist/cli/native-assets.d.ts.map +1 -1
- package/dist/cli/native-assets.js +7 -7
- package/dist/cli/native-assets.js.map +1 -1
- package/dist/cli/plugin-marketplace.d.ts +89 -4
- package/dist/cli/plugin-marketplace.d.ts.map +1 -1
- package/dist/cli/plugin-marketplace.js +2135 -118
- package/dist/cli/plugin-marketplace.js.map +1 -1
- package/dist/cli/ralplan.d.ts +2 -1
- package/dist/cli/ralplan.d.ts.map +1 -1
- package/dist/cli/ralplan.js +149 -9
- package/dist/cli/ralplan.js.map +1 -1
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +7 -1
- package/dist/cli/setup.js.map +1 -1
- package/dist/cli/sparkshell.d.ts.map +1 -1
- package/dist/cli/sparkshell.js +9 -10
- package/dist/cli/sparkshell.js.map +1 -1
- package/dist/cli/update-worker.js +9 -0
- package/dist/cli/update-worker.js.map +1 -1
- package/dist/cli/update.d.ts +1 -0
- package/dist/cli/update.d.ts.map +1 -1
- package/dist/cli/update.js +9 -0
- package/dist/cli/update.js.map +1 -1
- package/dist/config/__tests__/generator-idempotent.test.js +118 -0
- package/dist/config/__tests__/generator-idempotent.test.js.map +1 -1
- package/dist/config/generator.d.ts.map +1 -1
- package/dist/config/generator.js +74 -4
- package/dist/config/generator.js.map +1 -1
- package/dist/hooks/__tests__/keyword-detector.test.js +74 -0
- package/dist/hooks/__tests__/keyword-detector.test.js.map +1 -1
- package/dist/hooks/__tests__/ralplan-advisory-keyword.test.d.ts +2 -0
- package/dist/hooks/__tests__/ralplan-advisory-keyword.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/ralplan-advisory-keyword.test.js +250 -0
- package/dist/hooks/__tests__/ralplan-advisory-keyword.test.js.map +1 -0
- package/dist/hooks/__tests__/session.test.js +10 -1
- package/dist/hooks/__tests__/session.test.js.map +1 -1
- package/dist/hooks/keyword-detector.d.ts +8 -1
- package/dist/hooks/keyword-detector.d.ts.map +1 -1
- package/dist/hooks/keyword-detector.js +130 -9
- package/dist/hooks/keyword-detector.js.map +1 -1
- package/dist/hooks/session.d.ts +5 -0
- package/dist/hooks/session.d.ts.map +1 -1
- package/dist/hooks/session.js +17 -3
- package/dist/hooks/session.js.map +1 -1
- package/dist/hud/__tests__/index.test.js +16 -1
- package/dist/hud/__tests__/index.test.js.map +1 -1
- package/dist/hud/__tests__/reconcile.test.js +134 -7
- package/dist/hud/__tests__/reconcile.test.js.map +1 -1
- package/dist/hud/__tests__/render.test.js +57 -0
- package/dist/hud/__tests__/render.test.js.map +1 -1
- package/dist/hud/__tests__/session-attached.test.d.ts +2 -0
- package/dist/hud/__tests__/session-attached.test.d.ts.map +1 -0
- package/dist/hud/__tests__/session-attached.test.js +82 -0
- package/dist/hud/__tests__/session-attached.test.js.map +1 -0
- package/dist/hud/__tests__/state.test.js +94 -2
- package/dist/hud/__tests__/state.test.js.map +1 -1
- package/dist/hud/__tests__/tmux-split-realtmux.test.js +169 -2
- package/dist/hud/__tests__/tmux-split-realtmux.test.js.map +1 -1
- package/dist/hud/__tests__/tmux.test.js +104 -22
- package/dist/hud/__tests__/tmux.test.js.map +1 -1
- package/dist/hud/__tests__/types.test.js +9 -0
- package/dist/hud/__tests__/types.test.js.map +1 -1
- package/dist/hud/__tests__/watch-detached.test.d.ts +2 -0
- package/dist/hud/__tests__/watch-detached.test.d.ts.map +1 -0
- package/dist/hud/__tests__/watch-detached.test.js +383 -0
- package/dist/hud/__tests__/watch-detached.test.js.map +1 -0
- package/dist/hud/__tests__/watch-realtmux.test.d.ts +2 -0
- package/dist/hud/__tests__/watch-realtmux.test.d.ts.map +1 -0
- package/dist/hud/__tests__/watch-realtmux.test.js +322 -0
- package/dist/hud/__tests__/watch-realtmux.test.js.map +1 -0
- package/dist/hud/index.d.ts +3 -0
- package/dist/hud/index.d.ts.map +1 -1
- package/dist/hud/index.js +98 -20
- package/dist/hud/index.js.map +1 -1
- package/dist/hud/reconcile.d.ts.map +1 -1
- package/dist/hud/reconcile.js +68 -24
- package/dist/hud/reconcile.js.map +1 -1
- package/dist/hud/render.d.ts.map +1 -1
- package/dist/hud/render.js +20 -0
- package/dist/hud/render.js.map +1 -1
- package/dist/hud/session-attached.d.ts +15 -0
- package/dist/hud/session-attached.d.ts.map +1 -0
- package/dist/hud/session-attached.js +47 -0
- package/dist/hud/session-attached.js.map +1 -0
- package/dist/hud/state.d.ts +9 -1
- package/dist/hud/state.d.ts.map +1 -1
- package/dist/hud/state.js +140 -3
- package/dist/hud/state.js.map +1 -1
- package/dist/hud/tmux.d.ts +4 -0
- package/dist/hud/tmux.d.ts.map +1 -1
- package/dist/hud/tmux.js +86 -23
- package/dist/hud/tmux.js.map +1 -1
- package/dist/hud/types.d.ts +20 -0
- package/dist/hud/types.d.ts.map +1 -1
- package/dist/hud/types.js +3 -0
- package/dist/hud/types.js.map +1 -1
- package/dist/modes/base.d.ts +15 -2
- package/dist/modes/base.d.ts.map +1 -1
- package/dist/modes/base.js +105 -16
- package/dist/modes/base.js.map +1 -1
- package/dist/question/autopilot-wait.js +2 -2
- package/dist/question/autopilot-wait.js.map +1 -1
- package/dist/question/deep-interview.js +2 -2
- package/dist/question/deep-interview.js.map +1 -1
- package/dist/ralplan/__tests__/advisory-activation.test.d.ts +2 -0
- package/dist/ralplan/__tests__/advisory-activation.test.d.ts.map +1 -0
- package/dist/ralplan/__tests__/advisory-activation.test.js +700 -0
- package/dist/ralplan/__tests__/advisory-activation.test.js.map +1 -0
- package/dist/ralplan/__tests__/advisory-detached-transition.test.d.ts +2 -0
- package/dist/ralplan/__tests__/advisory-detached-transition.test.d.ts.map +1 -0
- package/dist/ralplan/__tests__/advisory-detached-transition.test.js +88 -0
- package/dist/ralplan/__tests__/advisory-detached-transition.test.js.map +1 -0
- package/dist/ralplan/__tests__/advisory.test.d.ts +2 -0
- package/dist/ralplan/__tests__/advisory.test.d.ts.map +1 -0
- package/dist/ralplan/__tests__/advisory.test.js +1087 -0
- package/dist/ralplan/__tests__/advisory.test.js.map +1 -0
- package/dist/ralplan/__tests__/runtime.test.js +416 -7
- package/dist/ralplan/__tests__/runtime.test.js.map +1 -1
- package/dist/ralplan/advisory-activation-verifier.d.ts +19 -0
- package/dist/ralplan/advisory-activation-verifier.d.ts.map +1 -0
- package/dist/ralplan/advisory-activation-verifier.js +77 -0
- package/dist/ralplan/advisory-activation-verifier.js.map +1 -0
- package/dist/ralplan/advisory-activation.d.ts +34 -0
- package/dist/ralplan/advisory-activation.d.ts.map +1 -0
- package/dist/ralplan/advisory-activation.js +205 -0
- package/dist/ralplan/advisory-activation.js.map +1 -0
- package/dist/ralplan/advisory-contract.d.ts +103 -0
- package/dist/ralplan/advisory-contract.d.ts.map +1 -0
- package/dist/ralplan/advisory-contract.js +83 -0
- package/dist/ralplan/advisory-contract.js.map +1 -0
- package/dist/ralplan/advisory-detached-transition.d.ts +11 -0
- package/dist/ralplan/advisory-detached-transition.d.ts.map +1 -0
- package/dist/ralplan/advisory-detached-transition.js +21 -0
- package/dist/ralplan/advisory-detached-transition.js.map +1 -0
- package/dist/ralplan/advisory-evidence.d.ts +91 -0
- package/dist/ralplan/advisory-evidence.d.ts.map +1 -0
- package/dist/ralplan/advisory-evidence.js +393 -0
- package/dist/ralplan/advisory-evidence.js.map +1 -0
- package/dist/ralplan/advisory-lifecycle-validation.d.ts +11 -0
- package/dist/ralplan/advisory-lifecycle-validation.d.ts.map +1 -0
- package/dist/ralplan/advisory-lifecycle-validation.js +72 -0
- package/dist/ralplan/advisory-lifecycle-validation.js.map +1 -0
- package/dist/ralplan/advisory-postconditions.d.ts +3 -0
- package/dist/ralplan/advisory-postconditions.d.ts.map +1 -0
- package/dist/ralplan/advisory-postconditions.js +33 -0
- package/dist/ralplan/advisory-postconditions.js.map +1 -0
- package/dist/ralplan/advisory-recovery-journal.d.ts +56 -0
- package/dist/ralplan/advisory-recovery-journal.d.ts.map +1 -0
- package/dist/ralplan/advisory-recovery-journal.js +136 -0
- package/dist/ralplan/advisory-recovery-journal.js.map +1 -0
- package/dist/ralplan/advisory-storage.d.ts +24 -0
- package/dist/ralplan/advisory-storage.d.ts.map +1 -0
- package/dist/ralplan/advisory-storage.js +106 -0
- package/dist/ralplan/advisory-storage.js.map +1 -0
- package/dist/ralplan/advisory.d.ts +99 -0
- package/dist/ralplan/advisory.d.ts.map +1 -0
- package/dist/ralplan/advisory.js +914 -0
- package/dist/ralplan/advisory.js.map +1 -0
- package/dist/ralplan/documented-leader-preflight.d.ts +8 -0
- package/dist/ralplan/documented-leader-preflight.d.ts.map +1 -1
- package/dist/ralplan/documented-leader-preflight.js +60 -2
- package/dist/ralplan/documented-leader-preflight.js.map +1 -1
- package/dist/ralplan/runtime-advisory-lifecycle.d.ts +74 -0
- package/dist/ralplan/runtime-advisory-lifecycle.d.ts.map +1 -0
- package/dist/ralplan/runtime-advisory-lifecycle.js +352 -0
- package/dist/ralplan/runtime-advisory-lifecycle.js.map +1 -0
- package/dist/ralplan/runtime-contract.d.ts +126 -0
- package/dist/ralplan/runtime-contract.d.ts.map +1 -0
- package/dist/ralplan/runtime-contract.js +2 -0
- package/dist/ralplan/runtime-contract.js.map +1 -0
- package/dist/ralplan/runtime.d.ts +6 -109
- package/dist/ralplan/runtime.d.ts.map +1 -1
- package/dist/ralplan/runtime.js +174 -56
- package/dist/ralplan/runtime.js.map +1 -1
- package/dist/scripts/__tests__/postinstall.test.js +26 -0
- package/dist/scripts/__tests__/postinstall.test.js.map +1 -1
- package/dist/scripts/__tests__/ralplan-advisory-hook.test.d.ts +2 -0
- package/dist/scripts/__tests__/ralplan-advisory-hook.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/ralplan-advisory-hook.test.js +299 -0
- package/dist/scripts/__tests__/ralplan-advisory-hook.test.js.map +1 -0
- package/dist/scripts/__tests__/smoke-packed-install.test.js +102 -8
- package/dist/scripts/__tests__/smoke-packed-install.test.js.map +1 -1
- package/dist/scripts/codex-native-hook.d.ts +20 -0
- package/dist/scripts/codex-native-hook.d.ts.map +1 -1
- package/dist/scripts/codex-native-hook.js +226 -15
- package/dist/scripts/codex-native-hook.js.map +1 -1
- package/dist/scripts/postinstall.d.ts +7 -0
- package/dist/scripts/postinstall.d.ts.map +1 -1
- package/dist/scripts/postinstall.js +40 -0
- package/dist/scripts/postinstall.js.map +1 -1
- package/dist/scripts/smoke-packed-install.d.ts +21 -5
- package/dist/scripts/smoke-packed-install.d.ts.map +1 -1
- package/dist/scripts/smoke-packed-install.js +157 -57
- package/dist/scripts/smoke-packed-install.js.map +1 -1
- package/dist/state/__tests__/mode-binding-lease.test.d.ts +2 -0
- package/dist/state/__tests__/mode-binding-lease.test.d.ts.map +1 -0
- package/dist/state/__tests__/mode-binding-lease.test.js +498 -0
- package/dist/state/__tests__/mode-binding-lease.test.js.map +1 -0
- package/dist/state/__tests__/operations.test.js +1 -0
- package/dist/state/__tests__/operations.test.js.map +1 -1
- package/dist/state/__tests__/pinned-atomic-file.test.d.ts +2 -0
- package/dist/state/__tests__/pinned-atomic-file.test.d.ts.map +1 -0
- package/dist/state/__tests__/pinned-atomic-file.test.js +438 -0
- package/dist/state/__tests__/pinned-atomic-file.test.js.map +1 -0
- package/dist/state/__tests__/skill-active-exact-session-transaction.test.d.ts +2 -0
- package/dist/state/__tests__/skill-active-exact-session-transaction.test.d.ts.map +1 -0
- package/dist/state/__tests__/skill-active-exact-session-transaction.test.js +179 -0
- package/dist/state/__tests__/skill-active-exact-session-transaction.test.js.map +1 -0
- package/dist/state/__tests__/skill-active.test.js +29 -1
- package/dist/state/__tests__/skill-active.test.js.map +1 -1
- package/dist/state/mode-binding-lease-helper.d.ts +2 -0
- package/dist/state/mode-binding-lease-helper.d.ts.map +1 -0
- package/dist/state/mode-binding-lease-helper.js +623 -0
- package/dist/state/mode-binding-lease-helper.js.map +1 -0
- package/dist/state/mode-binding-lease.d.ts +25 -0
- package/dist/state/mode-binding-lease.d.ts.map +1 -0
- package/dist/state/mode-binding-lease.js +380 -0
- package/dist/state/mode-binding-lease.js.map +1 -0
- package/dist/state/operations.d.ts +29 -1
- package/dist/state/operations.d.ts.map +1 -1
- package/dist/state/operations.js +203 -122
- package/dist/state/operations.js.map +1 -1
- package/dist/state/pinned-atomic-file-darwin-client.d.ts +34 -0
- package/dist/state/pinned-atomic-file-darwin-client.d.ts.map +1 -0
- package/dist/state/pinned-atomic-file-darwin-client.js +174 -0
- package/dist/state/pinned-atomic-file-darwin-client.js.map +1 -0
- package/dist/state/pinned-atomic-file-darwin-helper.d.ts +2 -0
- package/dist/state/pinned-atomic-file-darwin-helper.d.ts.map +1 -0
- package/dist/state/pinned-atomic-file-darwin-helper.js +275 -0
- package/dist/state/pinned-atomic-file-darwin-helper.js.map +1 -0
- package/dist/state/pinned-atomic-file-darwin-janitor.d.ts +2 -0
- package/dist/state/pinned-atomic-file-darwin-janitor.d.ts.map +1 -0
- package/dist/state/pinned-atomic-file-darwin-janitor.js +272 -0
- package/dist/state/pinned-atomic-file-darwin-janitor.js.map +1 -0
- package/dist/state/pinned-atomic-file.d.ts +29 -0
- package/dist/state/pinned-atomic-file.d.ts.map +1 -0
- package/dist/state/pinned-atomic-file.js +536 -0
- package/dist/state/pinned-atomic-file.js.map +1 -0
- package/dist/state/process-identity.d.ts +30 -0
- package/dist/state/process-identity.d.ts.map +1 -0
- package/dist/state/process-identity.js +99 -0
- package/dist/state/process-identity.js.map +1 -0
- package/dist/state/skill-active.d.ts +18 -1
- package/dist/state/skill-active.d.ts.map +1 -1
- package/dist/state/skill-active.js +82 -5
- package/dist/state/skill-active.js.map +1 -1
- package/dist/state/workflow-transition-reconcile.js +1 -1
- package/dist/state/workflow-transition-reconcile.js.map +1 -1
- package/dist/team/__tests__/tmux-session.test.js +109 -0
- package/dist/team/__tests__/tmux-session.test.js.map +1 -1
- package/dist/team/tmux-session.d.ts.map +1 -1
- package/dist/team/tmux-session.js +10 -1
- package/dist/team/tmux-session.js.map +1 -1
- package/dist/utils/__tests__/file-durability.test.js +20 -0
- package/dist/utils/__tests__/file-durability.test.js.map +1 -1
- package/dist/utils/file-durability.d.ts +1 -1
- package/dist/utils/file-durability.d.ts.map +1 -1
- package/dist/utils/file-durability.js.map +1 -1
- package/dist/verification/__tests__/ci-rust-gates.test.js +12 -4
- package/dist/verification/__tests__/ci-rust-gates.test.js.map +1 -1
- package/dist/verification/__tests__/ci-trusted-publish.test.d.ts +2 -0
- package/dist/verification/__tests__/ci-trusted-publish.test.d.ts.map +1 -0
- package/dist/verification/__tests__/ci-trusted-publish.test.js +205 -0
- package/dist/verification/__tests__/ci-trusted-publish.test.js.map +1 -0
- package/dist/verification/__tests__/explore-harness-release-workflow.test.js +10 -5
- package/dist/verification/__tests__/explore-harness-release-workflow.test.js.map +1 -1
- package/dist/verification/__tests__/publish-npm-manual-retired.test.d.ts +2 -0
- package/dist/verification/__tests__/publish-npm-manual-retired.test.d.ts.map +1 -0
- package/dist/verification/__tests__/publish-npm-manual-retired.test.js +22 -0
- package/dist/verification/__tests__/publish-npm-manual-retired.test.js.map +1 -0
- package/package.json +1 -1
- package/plugins/oh-my-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/oh-my-codex/skills/doctor/SKILL.md +1 -1
- package/plugins/oh-my-codex/skills/omx-setup/SKILL.md +1 -1
- package/plugins/oh-my-codex/skills/ralplan/SKILL.md +10 -1
- package/plugins/oh-my-codex/skills/team/SKILL.md +2 -0
- package/skills/doctor/SKILL.md +1 -1
- package/skills/omx-setup/SKILL.md +1 -1
- package/skills/ralplan/SKILL.md +10 -1
- package/skills/team/SKILL.md +2 -0
- package/src/scripts/__tests__/postinstall.test.ts +28 -0
- package/src/scripts/__tests__/ralplan-advisory-hook.test.ts +320 -0
- package/src/scripts/__tests__/smoke-packed-install.test.ts +120 -7
- package/src/scripts/codex-native-hook.ts +220 -10
- package/src/scripts/postinstall.ts +46 -0
- package/src/scripts/smoke-packed-install.ts +175 -70
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { execFileSync } from "child_process";
|
|
2
2
|
import { accessSync, closeSync, constants as fsConstants, existsSync, lstatSync, openSync, readFileSync, readSync, readdirSync, realpathSync, statSync } from "fs";
|
|
3
|
-
import { appendFile, lstat, mkdir, open, readFile, readdir, stat, unlink, writeFile } from "fs/promises";
|
|
3
|
+
import { appendFile, lstat, mkdir, open, readFile, readdir, realpath, stat, unlink, writeFile } from "fs/promises";
|
|
4
4
|
import { basename, delimiter, dirname, extname, isAbsolute, join, relative, resolve } from "path";
|
|
5
5
|
import { createHash } from "crypto";
|
|
6
6
|
import { fileURLToPath, pathToFileURL } from "url";
|
|
@@ -9,11 +9,13 @@ import { redactAuthSecrets } from "../auth/redact.js";
|
|
|
9
9
|
import { SKILL_ACTIVE_STATE_FILE, extractSessionIdFromInitializedStatePath, getSkillActiveStatePathsForStateDir, listActiveSkills, readSkillActiveState, readVisibleSkillActiveStateForStateDir, } from "../state/skill-active.js";
|
|
10
10
|
import { fenceNativeSubagentAuthorities, forceGlobalAuthorityDenial, consumeDirectChildReopenContext, isTrustedSubagentThread, readSubagentSessionSummary, readSubagentTrackingState, recordNativeSubagentAuthorityObservation, repairPersistedRootIdentity, quarantinePersistedRootAuthority, revokeNativeSubagentAuthorities, resolveInstalledRoleName, } from "../subagents/tracker.js";
|
|
11
11
|
import { readRoleRoutingMarker, writeRoleRoutingMarker } from "../subagents/role-routing-marker.js";
|
|
12
|
+
import { reconcileRalplanAdvisory, observeRalplanAdvisoryPrompt, } from "../ralplan/advisory.js";
|
|
13
|
+
import { activateOrResumeRalplanAdvisory } from "../ralplan/advisory-activation.js";
|
|
12
14
|
import { resolveCanonicalTeamStateRoot, resolveWorkerTeamStateRootPath, } from "../team/state-root.js";
|
|
13
15
|
import { readCanonicalInternalTeamWorkerEnvironment, readTeamWorkerEnvironment, resolveAuthoritativeTeamWorkerContext, resolveConductorPolicyRoot, } from "../team/worker-provenance.js";
|
|
14
16
|
import { inferTerminalLifecycleOutcome } from "../runtime/run-outcome.js";
|
|
15
17
|
import { syncRegularFile } from "../utils/file-durability.js";
|
|
16
|
-
import { appendPromptSessionProvenanceRejection, appendToLog, isSessionPointerLaunchAbort, isSessionStateUsable, isSessionStateAuthoritativeForCwd, normalizeSessionId, readNativeSessionOwner, readSessionPointer, readSessionState, readUsableSessionState, reconcileNativeSessionStart, resolveSessionPointerContext, writeNativeSessionOwner } from "../hooks/session.js";
|
|
18
|
+
import { appendPromptSessionProvenanceRejection, appendToLog, isSessionPointerLaunchAbort, isSessionStateUsable, isSessionStateAuthoritativeForCwd, normalizeSessionId, readNativeSessionOwner, readSessionPointer, readSessionState, readUsableSessionState, reconcileNativeSessionStart, resolveSessionPointerContext, sessionOwnerFileIdentityMatches, writeNativeSessionOwner } from "../hooks/session.js";
|
|
17
19
|
import { evaluateResolvedPromptTurn, extractSelectedTargetOwnerEvidence, preflightSelectedTargetOwner, } from "../hooks/prompt-session-provenance.js";
|
|
18
20
|
import { appendTeamEvent, readTeamLeaderAttention, readTeamManifestV2, readTeamPhase, writeTeamLeaderAttention, writeTeamPhase, } from "../team/state.js";
|
|
19
21
|
import { parseTeamNoticeLedgerPrompt, reconcileTeamNoticeLedger } from "../team/notice-ledger.js";
|
|
@@ -3036,7 +3038,11 @@ function hookCancelIdentity(stats) {
|
|
|
3036
3038
|
return { dev: stats.dev, ino: stats.ino, mode: stats.mode, uid: stats.uid, size: stats.size, mtimeMs: stats.mtimeMs };
|
|
3037
3039
|
}
|
|
3038
3040
|
function hookCancelIdentityMatches(left, right) {
|
|
3039
|
-
return left
|
|
3041
|
+
return sessionOwnerFileIdentityMatches(left, right, hookCancelPlatform())
|
|
3042
|
+
&& left.mode === right.mode
|
|
3043
|
+
&& left.uid === right.uid
|
|
3044
|
+
&& left.size === right.size
|
|
3045
|
+
&& left.mtimeMs === right.mtimeMs;
|
|
3040
3046
|
}
|
|
3041
3047
|
function hookCancelTargetMatches(left, right) {
|
|
3042
3048
|
return left.dev === right.dev && left.ino === right.ino && left.mode === right.mode && left.uid === right.uid;
|
|
@@ -4939,6 +4945,7 @@ const NATIVE_CODEX_GOAL_READ_TOOL_NAMES = new Set([
|
|
|
4939
4945
|
"get_goal",
|
|
4940
4946
|
"functions.get_goal",
|
|
4941
4947
|
"functionsget_goal",
|
|
4948
|
+
"mcp__omx_goal__get_goal",
|
|
4942
4949
|
]);
|
|
4943
4950
|
const NATIVE_CODEX_GOAL_LIFECYCLE_TOOL_NAMES = new Set([
|
|
4944
4951
|
"create_goal",
|
|
@@ -4947,6 +4954,8 @@ const NATIVE_CODEX_GOAL_LIFECYCLE_TOOL_NAMES = new Set([
|
|
|
4947
4954
|
"functions.update_goal",
|
|
4948
4955
|
"functionscreate_goal",
|
|
4949
4956
|
"functionsupdate_goal",
|
|
4957
|
+
"mcp__omx_goal__create_goal",
|
|
4958
|
+
"mcp__omx_goal__update_goal",
|
|
4950
4959
|
]);
|
|
4951
4960
|
function canonicalizeNativeCodexGoalToolName(name) {
|
|
4952
4961
|
switch (name) {
|
|
@@ -9600,6 +9609,116 @@ function isAllowedDeepInterviewCommandSpecificBash(payload, command, cwd) {
|
|
|
9600
9609
|
function directOmxCancelCommandHasTrustedExecutionContext(command, cwd) {
|
|
9601
9610
|
return omxOrGjcExecutionContextIsTrusted(command, cwd, ["omx"]);
|
|
9602
9611
|
}
|
|
9612
|
+
async function sessionHasAdvisoryBinding(cwd, sessionId) {
|
|
9613
|
+
const path = join(getBaseStateDir(cwd), "sessions", sessionId, "ralplan-state.json");
|
|
9614
|
+
let handle;
|
|
9615
|
+
try {
|
|
9616
|
+
handle = await open(path, fsConstants.O_RDONLY | fsConstants.O_NOFOLLOW);
|
|
9617
|
+
}
|
|
9618
|
+
catch (error) {
|
|
9619
|
+
if (error.code === "ENOENT")
|
|
9620
|
+
return false;
|
|
9621
|
+
throw error;
|
|
9622
|
+
}
|
|
9623
|
+
try {
|
|
9624
|
+
const info = await handle.stat();
|
|
9625
|
+
if (!info.isFile() || info.nlink !== 1 || info.size > 1024 * 1024)
|
|
9626
|
+
throw new Error("ralplan_advisory_binding_file_invalid");
|
|
9627
|
+
const value = JSON.parse((await handle.readFile()).toString("utf8"));
|
|
9628
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
9629
|
+
throw new Error("ralplan_advisory_binding_json_invalid");
|
|
9630
|
+
return value.workflow_variant === "advisory";
|
|
9631
|
+
}
|
|
9632
|
+
finally {
|
|
9633
|
+
await handle.close();
|
|
9634
|
+
}
|
|
9635
|
+
}
|
|
9636
|
+
export async function detectRalplanAdvisoryState(cwd, sessionId) {
|
|
9637
|
+
let canonicalCwd;
|
|
9638
|
+
try {
|
|
9639
|
+
canonicalCwd = await realpath(cwd);
|
|
9640
|
+
}
|
|
9641
|
+
catch (error) {
|
|
9642
|
+
const root = join(getBaseStateDir(cwd), "sessions", sessionId, "ralplan-advisory");
|
|
9643
|
+
return { status: "unreadable", root, reason: `cwd_realpath_${error.code ?? "failed"}` };
|
|
9644
|
+
}
|
|
9645
|
+
const root = join(getBaseStateDir(canonicalCwd), "sessions", sessionId, "ralplan-advisory");
|
|
9646
|
+
if (!/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/.test(sessionId)) {
|
|
9647
|
+
return { status: "unreadable", root, reason: "session_id_invalid" };
|
|
9648
|
+
}
|
|
9649
|
+
try {
|
|
9650
|
+
const info = await lstat(root);
|
|
9651
|
+
let canonical;
|
|
9652
|
+
try {
|
|
9653
|
+
canonical = await realpath(root);
|
|
9654
|
+
}
|
|
9655
|
+
catch (error) {
|
|
9656
|
+
return { status: "unreadable", root, reason: `state_root_realpath_${error.code ?? "failed"}` };
|
|
9657
|
+
}
|
|
9658
|
+
if (!info.isDirectory())
|
|
9659
|
+
return { status: "unreadable", root, reason: "state_root_not_canonical_directory" };
|
|
9660
|
+
if (canonical !== root)
|
|
9661
|
+
return { status: "unreadable", root, reason: "state_root_not_canonical" };
|
|
9662
|
+
return { status: "normal", root };
|
|
9663
|
+
}
|
|
9664
|
+
catch (error) {
|
|
9665
|
+
if (error.code !== "ENOENT") {
|
|
9666
|
+
return { status: "unreadable", root, reason: `state_root_lstat_${error.code ?? "failed"}` };
|
|
9667
|
+
}
|
|
9668
|
+
}
|
|
9669
|
+
try {
|
|
9670
|
+
return await sessionHasAdvisoryBinding(canonicalCwd, sessionId)
|
|
9671
|
+
? { status: "missing", root, reason: "advisory_binding_without_state_root" }
|
|
9672
|
+
: { status: "none", root };
|
|
9673
|
+
}
|
|
9674
|
+
catch (error) {
|
|
9675
|
+
return { status: "unreadable", root, reason: `binding_${error.code ?? "invalid"}` };
|
|
9676
|
+
}
|
|
9677
|
+
}
|
|
9678
|
+
export function buildRalplanAdvisoryRoutingObservation(intent, projection, binding) {
|
|
9679
|
+
if (intent !== "execute" || !projection)
|
|
9680
|
+
return null;
|
|
9681
|
+
if (projection.corruption) {
|
|
9682
|
+
return `Ralplan Advisory evidence is not a valid lifecycle projection (${projection.corruption}); this non-authoritative diagnostic does not grant or deny host tool permission.`;
|
|
9683
|
+
}
|
|
9684
|
+
const fence = projection.fence;
|
|
9685
|
+
if (!fence)
|
|
9686
|
+
return "Ralplan Advisory planning has not reached a terminal lifecycle state; no automatic execution handoff was created.";
|
|
9687
|
+
const matchingAdvisoryBinding = binding?.workflow_variant === "advisory"
|
|
9688
|
+
&& binding.advisory_generation_id === projection.activation.generation_id;
|
|
9689
|
+
const conflictingWorkflow = binding?.active === true && !matchingAdvisoryBinding;
|
|
9690
|
+
if (conflictingWorkflow)
|
|
9691
|
+
return null;
|
|
9692
|
+
if (fence.state === "pending_closeout") {
|
|
9693
|
+
return "Ralplan Advisory closeout is still pending; no automatic execution handoff was created.";
|
|
9694
|
+
}
|
|
9695
|
+
if (fence.state === "recovery_required") {
|
|
9696
|
+
return "Ralplan Advisory evidence requires lifecycle recovery; no automatic execution handoff was created.";
|
|
9697
|
+
}
|
|
9698
|
+
if (fence.state === "abandoned") {
|
|
9699
|
+
return `Ralplan Advisory ended as ${fence.outcome ?? "abandoned"}, not as an approved planning result; later instructions follow normal host rules.`;
|
|
9700
|
+
}
|
|
9701
|
+
const lifecycle = projection.journal?.terminal_mode_updates?.ralplan_review_lifecycle;
|
|
9702
|
+
const lifecycleRecord = lifecycle && typeof lifecycle === "object" && !Array.isArray(lifecycle)
|
|
9703
|
+
? lifecycle
|
|
9704
|
+
: null;
|
|
9705
|
+
const complete = fence.state === "closed" && fence.outcome === "approved" && fence.integrity_status === "proven"
|
|
9706
|
+
&& projection.journal?.phase === "committed" && projection.journal.outcome === "approved"
|
|
9707
|
+
&& lifecycleRecord?.complete === true
|
|
9708
|
+
&& lifecycleRecord.sequence_valid === true
|
|
9709
|
+
&& lifecycleRecord.iteration === fence.iteration
|
|
9710
|
+
&& lifecycleRecord.iteration_id === fence.iteration_id
|
|
9711
|
+
&& lifecycleRecord.plan_manifest_sha256 === fence.plan_manifest_sha256
|
|
9712
|
+
&& lifecycleRecord.architect_review_sha256 === fence.architect_review_sha256
|
|
9713
|
+
&& lifecycleRecord.critic_review_sha256 === fence.critic_review_sha256
|
|
9714
|
+
&& lifecycleRecord.evidence_bundle_sha256 === fence.evidence_bundle_sha256
|
|
9715
|
+
&& lifecycleRecord.evidence_scope === "local_runtime"
|
|
9716
|
+
&& lifecycleRecord.host_observable === false
|
|
9717
|
+
&& lifecycleRecord.host_verified === false;
|
|
9718
|
+
return complete
|
|
9719
|
+
? "Ralplan Advisory planning is complete and its byte-bound evidence remains auditable. This execution request is a non-authoritative routing observation only; no local Advisory file or classifier grants tool permission or an automatic execution handoff."
|
|
9720
|
+
: "Ralplan Advisory does not contain a complete approved and proven planning lifecycle; no automatic execution handoff was created.";
|
|
9721
|
+
}
|
|
9603
9722
|
function isCommandResolutionSensitiveEnvironmentName(name) {
|
|
9604
9723
|
// Variables that redirect where the shell resolves the executable itself.
|
|
9605
9724
|
// A leading PATH/PATHEXT override can point a bare `omx`/`rtk` at an
|
|
@@ -20883,6 +21002,7 @@ async function preflightNativePromptTarget(stateDir, context) {
|
|
|
20883
21002
|
export async function dispatchCodexNativeHook(payload, options = {}) {
|
|
20884
21003
|
const hookEventName = readHookEventName(payload);
|
|
20885
21004
|
const cwd = options.cwd ?? (safeString(payload.cwd).trim() || process.cwd());
|
|
21005
|
+
const reconcileAdvisory = options.reconcileRalplanAdvisoryFn ?? reconcileRalplanAdvisory;
|
|
20886
21006
|
const omxEventName = mapCodexHookEventToOmxEvent(hookEventName);
|
|
20887
21007
|
// #3497 / C1 boundary: documented-leader PreToolUse hard gate removed.
|
|
20888
21008
|
if (hookEventName === "PreToolUse" && safeString(payload.tool_name).trim() === "Bash") {
|
|
@@ -20932,6 +21052,7 @@ export async function dispatchCodexNativeHook(payload, options = {}) {
|
|
|
20932
21052
|
let goalWorkflowAdditionalContext = null;
|
|
20933
21053
|
let ultragoalSteeringAdditionalContext = null;
|
|
20934
21054
|
let teamNoticeAdditionalContext = null;
|
|
21055
|
+
let advisoryAdditionalContext = null;
|
|
20935
21056
|
let teamNoticeTargetKey = null;
|
|
20936
21057
|
let promptClassification = null;
|
|
20937
21058
|
const candidateWorkerPayloadSessionId = declaredTeamWorker
|
|
@@ -21248,13 +21369,88 @@ export async function dispatchCodexNativeHook(payload, options = {}) {
|
|
|
21248
21369
|
}
|
|
21249
21370
|
const suppressNoisySubagentLifecycleDispatch = (isSubagentSessionStart || isSubagentStop)
|
|
21250
21371
|
&& shouldSuppressSubagentLifecycleHookDispatch();
|
|
21372
|
+
const advisoryStateDetection = canonicalSessionId
|
|
21373
|
+
&& (hookEventName === "SessionStart" || hookEventName === "Stop" || hookEventName === "UserPromptSubmit")
|
|
21374
|
+
? await detectRalplanAdvisoryState(policyCwd, canonicalSessionId)
|
|
21375
|
+
: null;
|
|
21376
|
+
if ((hookEventName === "SessionStart" || hookEventName === "Stop") && canonicalSessionId
|
|
21377
|
+
&& advisoryStateDetection?.status === "normal") {
|
|
21378
|
+
try {
|
|
21379
|
+
const reconciledAdvisory = await reconcileAdvisory(policyCwd, canonicalSessionId);
|
|
21380
|
+
if (reconciledAdvisory?.corruption === "live_session_binding_conflict"
|
|
21381
|
+
|| reconciledAdvisory?.corruption === "live_session_binding_unreadable") {
|
|
21382
|
+
throw new Error(reconciledAdvisory.corruption);
|
|
21383
|
+
}
|
|
21384
|
+
}
|
|
21385
|
+
catch (error) {
|
|
21386
|
+
const diagnostic = `Ralplan Advisory lifecycle reconciliation reported a non-authoritative diagnostic: ${error instanceof Error ? error.message : String(error)}. It does not grant or deny host tool permission.`;
|
|
21387
|
+
if (hookEventName === "SessionStart") {
|
|
21388
|
+
advisoryAdditionalContext = diagnostic;
|
|
21389
|
+
}
|
|
21390
|
+
else {
|
|
21391
|
+
await appendToLog(cwd, {
|
|
21392
|
+
event: "ralplan_advisory_reconciliation_diagnostic",
|
|
21393
|
+
hook_event_name: "Stop",
|
|
21394
|
+
session_id: canonicalSessionId,
|
|
21395
|
+
reason: error instanceof Error ? error.message : String(error),
|
|
21396
|
+
non_authoritative: true,
|
|
21397
|
+
timestamp: new Date().toISOString(),
|
|
21398
|
+
}).catch(() => { });
|
|
21399
|
+
}
|
|
21400
|
+
}
|
|
21401
|
+
}
|
|
21251
21402
|
if (hookEventName === "UserPromptSubmit") {
|
|
21252
21403
|
const prompt = readPromptText(payload);
|
|
21253
|
-
|
|
21254
|
-
|
|
21404
|
+
const advisoryThreadKind = promptTurnContext?.status === "authorized"
|
|
21405
|
+
&& promptTurnContext.authorization.targetRelation !== "explicit-independent"
|
|
21406
|
+
&& promptTurnContext.authorization.thread.kind === "root-or-drift"
|
|
21407
|
+
? "root-or-drift" : "unknown";
|
|
21408
|
+
if (!isSubagentPromptSubmit)
|
|
21409
|
+
promptClassification = classifyKeywordInput(prompt);
|
|
21410
|
+
if (canonicalSessionId && !isSubagentPromptSubmit && advisoryStateDetection?.status === "normal") {
|
|
21411
|
+
try {
|
|
21412
|
+
await activateOrResumeRalplanAdvisory({
|
|
21413
|
+
cwd: policyCwd, sessionId: canonicalSessionId, rootThreadId: threadId,
|
|
21414
|
+
activationTurnId: turnId, prompt, resumeOnly: true, producer: "native", threadKind: advisoryThreadKind,
|
|
21415
|
+
});
|
|
21416
|
+
const advisory = await observeRalplanAdvisoryPrompt({
|
|
21417
|
+
cwd: policyCwd,
|
|
21418
|
+
sessionId: canonicalSessionId,
|
|
21419
|
+
turnId,
|
|
21420
|
+
threadId,
|
|
21421
|
+
prompt,
|
|
21422
|
+
producer: "native",
|
|
21423
|
+
threadKind: promptTurnContext?.status === "authorized"
|
|
21424
|
+
&& promptTurnContext.authorization.targetRelation !== "explicit-independent"
|
|
21425
|
+
? "root-or-drift" : "unknown",
|
|
21426
|
+
isSubagentPromptSubmit,
|
|
21427
|
+
markedContinuation: payload.continuation === true
|
|
21428
|
+
|| payload.is_continuation === true
|
|
21429
|
+
|| safeString(payload.source).toLowerCase().includes("continuation"),
|
|
21430
|
+
synthetic: payload.synthetic === true
|
|
21431
|
+
|| payload.auto_nudge === true
|
|
21432
|
+
|| safeString(payload.source).toLowerCase().includes("nudge"),
|
|
21433
|
+
reservedInput: promptClassification?.reservedInput ?? null,
|
|
21434
|
+
});
|
|
21435
|
+
if ((advisory.intent === "replan" || advisory.intent === "new_advisory")
|
|
21436
|
+
&& advisory.projection?.activation) {
|
|
21437
|
+
const activated = await activateOrResumeRalplanAdvisory({
|
|
21438
|
+
cwd: policyCwd, sessionId: canonicalSessionId, rootThreadId: threadId,
|
|
21439
|
+
activationTurnId: turnId, prompt, producer: "native", threadKind: advisoryThreadKind,
|
|
21440
|
+
predecessorGenerationId: advisory.projection.activation.generation_id,
|
|
21441
|
+
});
|
|
21442
|
+
if (activated)
|
|
21443
|
+
advisory.projection = activated.projection;
|
|
21444
|
+
}
|
|
21445
|
+
const advisoryBinding = await readModeStateForSession("ralplan", canonicalSessionId, policyCwd);
|
|
21446
|
+
advisoryAdditionalContext = buildRalplanAdvisoryRoutingObservation(advisory.intent, advisory.projection, advisoryBinding);
|
|
21447
|
+
}
|
|
21448
|
+
catch (error) {
|
|
21449
|
+
advisoryAdditionalContext = `Ralplan Advisory lifecycle reconciliation reported a non-authoritative diagnostic: ${error instanceof Error ? error.message : String(error)}. It does not grant or deny host tool permission.`;
|
|
21450
|
+
}
|
|
21255
21451
|
}
|
|
21256
21452
|
if (!isSubagentPromptSubmit) {
|
|
21257
|
-
|
|
21453
|
+
teamNoticeTargetKey = parseTeamNoticeLedgerPrompt(prompt);
|
|
21258
21454
|
}
|
|
21259
21455
|
goalWorkflowAdditionalContext = allowGlobalSideEffects
|
|
21260
21456
|
? await buildCompletedGoalCleanupPromptWarning(cwd, prompt).catch(() => null)
|
|
@@ -21263,14 +21459,27 @@ export async function dispatchCodexNativeHook(payload, options = {}) {
|
|
|
21263
21459
|
ultragoalSteeringAdditionalContext = prompt && !isSubagentPromptSubmit && allowImplicitSessionSideEffects && allowGlobalSideEffects
|
|
21264
21460
|
? await applyUserPromptUltragoalSteering(cwd, prompt).catch((error) => `OMX native UserPromptSubmit rejected bounded .omx/ultragoal steering for G002-cli-and-prompt-submit-bridge: ${error instanceof Error ? error.message : String(error)}`)
|
|
21265
21461
|
: null;
|
|
21266
|
-
|
|
21462
|
+
// An explicit independent payload session is safe to seed in its own
|
|
21463
|
+
// session-scoped state even when global side effects (HUD/root mirrors) are
|
|
21464
|
+
// suppressed because a stale selected pointer exists.
|
|
21465
|
+
let suppressActivationSeeding = !allowImplicitSessionSideEffects
|
|
21466
|
+
|| (!allowGlobalSideEffects
|
|
21467
|
+
&& promptTurnContext?.status !== "authorized");
|
|
21267
21468
|
if (promptTurnContext?.status === "authorized") {
|
|
21268
21469
|
sessionIdForState = promptTurnContext.authorization.targetSessionId;
|
|
21269
21470
|
}
|
|
21270
21471
|
else if (prompt && !isSubagentPromptSubmit && allowImplicitSessionSideEffects) {
|
|
21271
21472
|
const rawHookSessionId = canonicalSessionId || nativeSessionId;
|
|
21272
21473
|
const normalizedHookSessionId = normalizeSessionId(rawHookSessionId);
|
|
21273
|
-
|
|
21474
|
+
// An explicit payload session must win over a stale selected pointer.
|
|
21475
|
+
// Preserve the pointer only for its authenticated session/native alias;
|
|
21476
|
+
// otherwise seed state in the payload's session rather than silently
|
|
21477
|
+
// mutating the selected session.
|
|
21478
|
+
const explicitHookSessionId = currentSessionState
|
|
21479
|
+
&& normalizedHookSessionId
|
|
21480
|
+
&& payloadMatchesSessionPointer(normalizedHookSessionId, currentSessionState)
|
|
21481
|
+
? undefined
|
|
21482
|
+
: normalizedHookSessionId;
|
|
21274
21483
|
if (rawHookSessionId && !normalizedHookSessionId) {
|
|
21275
21484
|
suppressActivationSeeding = true;
|
|
21276
21485
|
}
|
|
@@ -21421,7 +21630,8 @@ export async function dispatchCodexNativeHook(payload, options = {}) {
|
|
|
21421
21630
|
allowTeamWorkerSideEffects: false,
|
|
21422
21631
|
});
|
|
21423
21632
|
}
|
|
21424
|
-
if (hookEventName === "UserPromptSubmit" && !isSubagentPromptSubmit && teamNoticeTargetKey
|
|
21633
|
+
if (hookEventName === "UserPromptSubmit" && !isSubagentPromptSubmit && teamNoticeTargetKey
|
|
21634
|
+
&& allowGlobalSideEffects) {
|
|
21425
21635
|
const reconciled = await reconcileTeamNoticeLedger({ stateRoot: stateDir, targetKey: teamNoticeTargetKey }).catch(() => null);
|
|
21426
21636
|
if (!reconciled || reconciled.context.length === 0) {
|
|
21427
21637
|
teamNoticeAdditionalContext = "OMX invalidated this queued Team wake immediately before model input because no active source-proven Team notices remain. Do not infer or reference a removed Team from the generic wake.";
|
|
@@ -21453,16 +21663,17 @@ export async function dispatchCodexNativeHook(payload, options = {}) {
|
|
|
21453
21663
|
}
|
|
21454
21664
|
else if ((hookEventName === "SessionStart" && !skipCanonicalSessionStartContext) || hookEventName === "UserPromptSubmit") {
|
|
21455
21665
|
const additionalContext = hookEventName === "SessionStart"
|
|
21456
|
-
? await buildSessionStartContext(cwd, canonicalSessionId || nativeSessionId, {
|
|
21457
|
-
|
|
21458
|
-
|
|
21459
|
-
|
|
21460
|
-
|
|
21461
|
-
|
|
21666
|
+
? [await buildSessionStartContext(cwd, canonicalSessionId || nativeSessionId, {
|
|
21667
|
+
hookEventName,
|
|
21668
|
+
payload,
|
|
21669
|
+
canonicalSessionId,
|
|
21670
|
+
nativeSessionId: resolvedNativeSessionId || nativeSessionId,
|
|
21671
|
+
}), advisoryAdditionalContext].filter((entry) => Boolean(entry)).join("\n\n") || null
|
|
21462
21672
|
: isSubagentPromptSubmit
|
|
21463
21673
|
? null
|
|
21464
21674
|
: [
|
|
21465
21675
|
teamNoticeAdditionalContext,
|
|
21676
|
+
advisoryAdditionalContext,
|
|
21466
21677
|
promptClassification ? buildAdditionalContextMessage(promptClassification, skillState, cwd, payload) : null,
|
|
21467
21678
|
ultragoalSteeringAdditionalContext,
|
|
21468
21679
|
goalWorkflowAdditionalContext,
|