@lannguyensi/harness 0.64.0 → 1.0.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/CHANGELOG.md +64 -0
- package/README.md +46 -42
- package/dist/cli/add/index.js +17 -21
- package/dist/cli/add/index.js.map +1 -1
- package/dist/cli/adopt/derive.d.ts +2 -2
- package/dist/cli/adopt/derive.js +2 -19
- package/dist/cli/adopt/derive.js.map +1 -1
- package/dist/cli/adopt/index.d.ts +1 -1
- package/dist/cli/adopt/index.js +1 -12
- package/dist/cli/adopt/index.js.map +1 -1
- package/dist/cli/apply/apply.d.ts +20 -35
- package/dist/cli/apply/apply.js +61 -136
- package/dist/cli/apply/apply.js.map +1 -1
- package/dist/cli/apply/generate-codex-config.js +10 -58
- package/dist/cli/apply/generate-codex-config.js.map +1 -1
- package/dist/cli/apply/generate-memory-index.js +1 -2
- package/dist/cli/apply/generate-memory-index.js.map +1 -1
- package/dist/cli/apply/generate-opencode-config.d.ts +2 -10
- package/dist/cli/apply/generate-opencode-config.js +74 -113
- package/dist/cli/apply/generate-opencode-config.js.map +1 -1
- package/dist/cli/apply/generate-settings.d.ts +11 -64
- package/dist/cli/apply/generate-settings.js +27 -132
- package/dist/cli/apply/generate-settings.js.map +1 -1
- package/dist/cli/apply/index.d.ts +1 -1
- package/dist/cli/apply/index.js +1 -1
- package/dist/cli/apply/index.js.map +1 -1
- package/dist/cli/apply/install-codex-config.d.ts +153 -1
- package/dist/cli/apply/install-codex-config.js +445 -70
- package/dist/cli/apply/install-codex-config.js.map +1 -1
- package/dist/cli/apply/next-steps.d.ts +7 -0
- package/dist/cli/apply/next-steps.js +13 -1
- package/dist/cli/apply/next-steps.js.map +1 -1
- package/dist/cli/bounded-stdin.d.ts +0 -23
- package/dist/cli/bounded-stdin.js +2 -49
- package/dist/cli/bounded-stdin.js.map +1 -1
- package/dist/cli/describe.d.ts +1 -1
- package/dist/cli/describe.js +0 -3
- package/dist/cli/describe.js.map +1 -1
- package/dist/cli/diff/engine.d.ts +0 -11
- package/dist/cli/diff/engine.js +1 -17
- package/dist/cli/diff/engine.js.map +1 -1
- package/dist/cli/diff/index.js +14 -25
- package/dist/cli/diff/index.js.map +1 -1
- package/dist/cli/doctor/claude-mcp.d.ts +4 -19
- package/dist/cli/doctor/claude-mcp.js +11 -22
- package/dist/cli/doctor/claude-mcp.js.map +1 -1
- package/dist/cli/doctor/codex.d.ts +12 -14
- package/dist/cli/doctor/codex.js +31 -144
- package/dist/cli/doctor/codex.js.map +1 -1
- package/dist/cli/doctor/format.js +23 -345
- package/dist/cli/doctor/format.js.map +1 -1
- package/dist/cli/doctor/hook-liveness.d.ts +56 -0
- package/dist/cli/doctor/hook-liveness.js +455 -0
- package/dist/cli/doctor/hook-liveness.js.map +1 -0
- package/dist/cli/doctor/index.d.ts +13 -87
- package/dist/cli/doctor/index.js +57 -713
- package/dist/cli/doctor/index.js.map +1 -1
- package/dist/cli/doctor/opencode.d.ts +2 -1
- package/dist/cli/doctor/opencode.js.map +1 -1
- package/dist/cli/doctor/types.d.ts +21 -387
- package/dist/cli/doctor/types.js.map +1 -1
- package/dist/cli/drain-stdio.d.ts +31 -0
- package/dist/cli/drain-stdio.js +76 -0
- package/dist/cli/drain-stdio.js.map +1 -0
- package/dist/cli/export.d.ts +3 -1
- package/dist/cli/export.js +7 -16
- package/dist/cli/export.js.map +1 -1
- package/dist/cli/gate/codex-disable.d.ts +29 -0
- package/dist/cli/gate/codex-disable.js +195 -0
- package/dist/cli/gate/codex-disable.js.map +1 -0
- package/dist/cli/gate/codex-enable.d.ts +41 -0
- package/dist/cli/gate/codex-enable.js +127 -0
- package/dist/cli/gate/codex-enable.js.map +1 -0
- package/dist/cli/gate/codex-snapshot.d.ts +208 -0
- package/dist/cli/gate/codex-snapshot.js +402 -0
- package/dist/cli/gate/codex-snapshot.js.map +1 -0
- package/dist/cli/gate/disable.d.ts +9 -0
- package/dist/cli/gate/disable.js +263 -28
- package/dist/cli/gate/disable.js.map +1 -1
- package/dist/cli/gate/enable.d.ts +26 -6
- package/dist/cli/gate/enable.js +152 -80
- package/dist/cli/gate/enable.js.map +1 -1
- package/dist/cli/gate/link-chain.d.ts +53 -0
- package/dist/cli/gate/link-chain.js +122 -0
- package/dist/cli/gate/link-chain.js.map +1 -0
- package/dist/cli/gate/snapshot.d.ts +289 -12
- package/dist/cli/gate/snapshot.js +481 -22
- package/dist/cli/gate/snapshot.js.map +1 -1
- package/dist/cli/index.d.ts +0 -9
- package/dist/cli/index.js +9 -2131
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init/composer.d.ts +3 -6
- package/dist/cli/init/composer.js +6 -370
- package/dist/cli/init/composer.js.map +1 -1
- package/dist/cli/init/dependencies.d.ts +1 -2
- package/dist/cli/init/dependencies.js +4 -80
- package/dist/cli/init/dependencies.js.map +1 -1
- package/dist/cli/init/detect.js +5 -4
- package/dist/cli/init/detect.js.map +1 -1
- package/dist/cli/init/interactive.d.ts +1 -23
- package/dist/cli/init/interactive.js +33 -247
- package/dist/cli/init/interactive.js.map +1 -1
- package/dist/cli/init/profiles.d.ts +2 -2
- package/dist/cli/init/profiles.js +51 -245
- package/dist/cli/init/profiles.js.map +1 -1
- package/dist/cli/init/templates.d.ts +2 -37
- package/dist/cli/init/templates.js +25 -1237
- package/dist/cli/init/templates.js.map +1 -1
- package/dist/cli/list.d.ts +1 -1
- package/dist/cli/list.js +1 -38
- package/dist/cli/list.js.map +1 -1
- package/dist/cli/loader.d.ts +15 -1
- package/dist/cli/loader.js +56 -39
- package/dist/cli/loader.js.map +1 -1
- package/dist/cli/main.js +7 -2
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/migrate-home/index.js +2 -2
- package/dist/cli/migrate-home/index.js.map +1 -1
- package/dist/cli/pack/add.js +1 -1
- package/dist/cli/pack/add.js.map +1 -1
- package/dist/cli/pack/hook-bootstrap.d.ts +5 -164
- package/dist/cli/pack/hook-bootstrap.js +15 -291
- package/dist/cli/pack/hook-bootstrap.js.map +1 -1
- package/dist/cli/pack/hook-branch-protection.d.ts +28 -21
- package/dist/cli/pack/hook-branch-protection.js +365 -340
- package/dist/cli/pack/hook-branch-protection.js.map +1 -1
- package/dist/cli/pack/index.d.ts +0 -1
- package/dist/cli/pack/index.js +0 -1
- package/dist/cli/pack/index.js.map +1 -1
- package/dist/cli/pack/list.js +1 -6
- package/dist/cli/pack/list.js.map +1 -1
- package/dist/cli/pack/mutate.d.ts +7 -9
- package/dist/cli/pack/mutate.js +6 -9
- package/dist/cli/pack/mutate.js.map +1 -1
- package/dist/cli/pack/reseed.d.ts +2 -2
- package/dist/cli/pack/reseed.js +16 -22
- package/dist/cli/pack/reseed.js.map +1 -1
- package/dist/cli/{delegate/register.d.ts → register-gate-group.d.ts} +1 -1
- package/dist/cli/register-gate-group.js +348 -0
- package/dist/cli/register-gate-group.js.map +1 -0
- package/dist/cli/register-inspect-group.d.ts +6 -0
- package/dist/cli/register-inspect-group.js +189 -0
- package/dist/cli/register-inspect-group.js.map +1 -0
- package/dist/cli/register-operator-lifecycle.d.ts +1 -1
- package/dist/cli/register-operator-lifecycle.js +3 -100
- package/dist/cli/register-operator-lifecycle.js.map +1 -1
- package/dist/cli/register-pack-group.d.ts +5 -0
- package/dist/cli/register-pack-group.js +134 -0
- package/dist/cli/register-pack-group.js.map +1 -0
- package/dist/cli/{register-audit-group.d.ts → register-setup-group.d.ts} +1 -1
- package/dist/cli/register-setup-group.js +495 -0
- package/dist/cli/register-setup-group.js.map +1 -0
- package/dist/cli/remove/index.d.ts +0 -14
- package/dist/cli/remove/index.js +2 -115
- package/dist/cli/remove/index.js.map +1 -1
- package/dist/cli/remove/mutate.d.ts +0 -2
- package/dist/cli/remove/mutate.js +1 -19
- package/dist/cli/remove/mutate.js.map +1 -1
- package/dist/cli/remove/register.js +2 -19
- package/dist/cli/remove/register.js.map +1 -1
- package/dist/cli/shell-quote.d.ts +7 -0
- package/dist/cli/shell-quote.js +17 -0
- package/dist/cli/shell-quote.js.map +1 -0
- package/dist/cli/uninstall/index.d.ts +4 -2
- package/dist/cli/uninstall/index.js +15 -7
- package/dist/cli/uninstall/index.js.map +1 -1
- package/dist/cli/uninstall/register.js +6 -4
- package/dist/cli/uninstall/register.js.map +1 -1
- package/dist/cli/uninstall/snapshot.d.ts +15 -0
- package/dist/cli/uninstall/snapshot.js +38 -0
- package/dist/cli/uninstall/snapshot.js.map +1 -1
- package/dist/cli/validate/checks.d.ts +0 -77
- package/dist/cli/validate/checks.js +3 -1049
- package/dist/cli/validate/checks.js.map +1 -1
- package/dist/cli/validate/index.js +19 -15
- package/dist/cli/validate/index.js.map +1 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -3
- package/dist/index.js.map +1 -1
- package/dist/io/claude-mcp.d.ts +1 -1
- package/dist/io/claude-mcp.js +27 -14
- package/dist/io/claude-mcp.js.map +1 -1
- package/dist/io/harness-lock.js +2 -2
- package/dist/io/harness-lock.js.map +1 -1
- package/dist/io/lock.d.ts +0 -26
- package/dist/io/lock.js +10 -27
- package/dist/io/lock.js.map +1 -1
- package/dist/io/merge-settings.js +6 -4
- package/dist/io/merge-settings.js.map +1 -1
- package/dist/io/project-name.d.ts +22 -39
- package/dist/io/project-name.js +25 -42
- package/dist/io/project-name.js.map +1 -1
- package/dist/io/read-regular-file.d.ts +103 -40
- package/dist/io/read-regular-file.js +196 -35
- package/dist/io/read-regular-file.js.map +1 -1
- package/dist/io/restart-hints.js +3 -6
- package/dist/io/restart-hints.js.map +1 -1
- package/dist/io/version-compare.d.ts +1 -3
- package/dist/io/version-compare.js +1 -3
- package/dist/io/version-compare.js.map +1 -1
- package/dist/io/write-regular-file.d.ts +30 -0
- package/dist/io/write-regular-file.js +85 -0
- package/dist/io/write-regular-file.js.map +1 -0
- package/dist/overrides/index.d.ts +1 -0
- package/dist/overrides/index.js +1 -0
- package/dist/overrides/index.js.map +1 -1
- package/dist/overrides/merge-layers.d.ts +43 -0
- package/dist/overrides/merge-layers.js +76 -0
- package/dist/overrides/merge-layers.js.map +1 -0
- package/dist/overrides/merge.d.ts +16 -0
- package/dist/overrides/merge.js +21 -8
- package/dist/overrides/merge.js.map +1 -1
- package/dist/policy-packs/builtin/branch-protection-runtime.d.ts +4 -69
- package/dist/policy-packs/builtin/branch-protection-runtime.js +12 -84
- package/dist/policy-packs/builtin/branch-protection-runtime.js.map +1 -1
- package/dist/policy-packs/builtin/branch-protection.d.ts +7 -30
- package/dist/policy-packs/builtin/branch-protection.js +56 -89
- package/dist/policy-packs/builtin/branch-protection.js.map +1 -1
- package/dist/policy-packs/config-check.d.ts +7 -5
- package/dist/policy-packs/config-check.js +2 -2
- package/dist/policy-packs/config-check.js.map +1 -1
- package/dist/policy-packs/expand.d.ts +1 -3
- package/dist/policy-packs/expand.js +5 -42
- package/dist/policy-packs/expand.js.map +1 -1
- package/dist/policy-packs/index.d.ts +3 -3
- package/dist/policy-packs/index.js +2 -2
- package/dist/policy-packs/index.js.map +1 -1
- package/dist/policy-packs/registry.d.ts +9 -38
- package/dist/policy-packs/registry.js +5 -65
- package/dist/policy-packs/registry.js.map +1 -1
- package/dist/policy-packs/runtime.d.ts +0 -4
- package/dist/policy-packs/runtime.js +9 -22
- package/dist/policy-packs/runtime.js.map +1 -1
- package/dist/policy-packs/types.d.ts +0 -19
- package/dist/policy-packs/ux-compare.d.ts +1 -11
- package/dist/policy-packs/ux-compare.js +6 -42
- package/dist/policy-packs/ux-compare.js.map +1 -1
- package/dist/policy-packs/ux-drift-check.d.ts +5 -5
- package/dist/policy-packs/ux-drift-check.js +17 -22
- package/dist/policy-packs/ux-drift-check.js.map +1 -1
- package/dist/policy-packs/version-check.d.ts +5 -26
- package/dist/policy-packs/version-check.js +19 -74
- package/dist/policy-packs/version-check.js.map +1 -1
- package/dist/probes/memory.d.ts +1 -1
- package/dist/probes/memory.js +1 -1
- package/dist/probes/memory.js.map +1 -1
- package/dist/runtime/agent-facing.d.ts +9 -0
- package/dist/runtime/agent-facing.js +28 -14
- package/dist/runtime/agent-facing.js.map +1 -1
- package/dist/runtime/bounded-text.d.ts +15 -0
- package/dist/runtime/bounded-text.js +27 -0
- package/dist/runtime/bounded-text.js.map +1 -0
- package/dist/runtime/git-branch.d.ts +125 -0
- package/dist/runtime/git-branch.js +381 -0
- package/dist/runtime/git-branch.js.map +1 -0
- package/dist/runtime/hermetic-spawn-guard.d.ts +2 -2
- package/dist/runtime/hermetic-spawn-guard.js +24 -34
- package/dist/runtime/hermetic-spawn-guard.js.map +1 -1
- package/dist/runtime/home-dir.js +3 -2
- package/dist/runtime/home-dir.js.map +1 -1
- package/dist/runtime/tool-name-aliases.d.ts +0 -6
- package/dist/runtime/tool-name-aliases.js +5 -18
- package/dist/runtime/tool-name-aliases.js.map +1 -1
- package/dist/schema/grounding.d.ts +7 -54
- package/dist/schema/grounding.js +10 -12
- package/dist/schema/grounding.js.map +1 -1
- package/dist/schema/hooks.d.ts +39 -136
- package/dist/schema/hooks.js +3 -6
- package/dist/schema/hooks.js.map +1 -1
- package/dist/schema/index.d.ts +114 -3828
- package/dist/schema/index.js +41 -80
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/memory.d.ts +54 -131
- package/dist/schema/memory.js +2 -2
- package/dist/schema/memory.js.map +1 -1
- package/dist/schema/policy-packs.d.ts +3 -45
- package/dist/schema/policy-packs.js +7 -13
- package/dist/schema/policy-packs.js.map +1 -1
- package/dist/schema/policy-ux.d.ts +7 -0
- package/dist/schema/policy-ux.js +18 -0
- package/dist/schema/policy-ux.js.map +1 -0
- package/dist/schema/removed-keys.d.ts +185 -0
- package/dist/schema/removed-keys.js +531 -0
- package/dist/schema/removed-keys.js.map +1 -0
- package/dist/schema/tools.d.ts +30 -268
- package/dist/schema/tools.js +4 -4
- package/dist/schema/tools.js.map +1 -1
- package/package.json +5 -16
- package/dist/cli/approve/branch-protection.d.ts +0 -69
- package/dist/cli/approve/branch-protection.js +0 -144
- package/dist/cli/approve/branch-protection.js.map +0 -1
- package/dist/cli/approve/risk.d.ts +0 -112
- package/dist/cli/approve/risk.js +0 -197
- package/dist/cli/approve/risk.js.map +0 -1
- package/dist/cli/approve/stdin-report.d.ts +0 -57
- package/dist/cli/approve/stdin-report.js +0 -145
- package/dist/cli/approve/stdin-report.js.map +0 -1
- package/dist/cli/approve/understanding.d.ts +0 -410
- package/dist/cli/approve/understanding.js +0 -996
- package/dist/cli/approve/understanding.js.map +0 -1
- package/dist/cli/audit.d.ts +0 -80
- package/dist/cli/audit.js +0 -252
- package/dist/cli/audit.js.map +0 -1
- package/dist/cli/delegate/index.d.ts +0 -76
- package/dist/cli/delegate/index.js +0 -444
- package/dist/cli/delegate/index.js.map +0 -1
- package/dist/cli/delegate/register.js +0 -90
- package/dist/cli/delegate/register.js.map +0 -1
- package/dist/cli/doctor/auto-approve-mode.d.ts +0 -37
- package/dist/cli/doctor/auto-approve-mode.js +0 -80
- package/dist/cli/doctor/auto-approve-mode.js.map +0 -1
- package/dist/cli/doctor/bypass-without-auto-approve.d.ts +0 -38
- package/dist/cli/doctor/bypass-without-auto-approve.js +0 -95
- package/dist/cli/doctor/bypass-without-auto-approve.js.map +0 -1
- package/dist/cli/doctor/codex-config-drift.d.ts +0 -28
- package/dist/cli/doctor/codex-config-drift.js +0 -240
- package/dist/cli/doctor/codex-config-drift.js.map +0 -1
- package/dist/cli/doctor/expire-on-tool-match.d.ts +0 -15
- package/dist/cli/doctor/expire-on-tool-match.js +0 -58
- package/dist/cli/doctor/expire-on-tool-match.js.map +0 -1
- package/dist/cli/doctor/rogue-ledger.d.ts +0 -53
- package/dist/cli/doctor/rogue-ledger.js +0 -153
- package/dist/cli/doctor/rogue-ledger.js.map +0 -1
- package/dist/cli/doctor/session-start-preflight-setup-version.d.ts +0 -83
- package/dist/cli/doctor/session-start-preflight-setup-version.js +0 -114
- package/dist/cli/doctor/session-start-preflight-setup-version.js.map +0 -1
- package/dist/cli/doctor/settings-drift.d.ts +0 -25
- package/dist/cli/doctor/settings-drift.js +0 -213
- package/dist/cli/doctor/settings-drift.js.map +0 -1
- package/dist/cli/doctor/toolchain-parity.d.ts +0 -63
- package/dist/cli/doctor/toolchain-parity.js +0 -154
- package/dist/cli/doctor/toolchain-parity.js.map +0 -1
- package/dist/cli/doctor/ug-auto-approvals.d.ts +0 -40
- package/dist/cli/doctor/ug-auto-approvals.js +0 -91
- package/dist/cli/doctor/ug-auto-approvals.js.map +0 -1
- package/dist/cli/doctor/ug-delegations.d.ts +0 -26
- package/dist/cli/doctor/ug-delegations.js +0 -121
- package/dist/cli/doctor/ug-delegations.js.map +0 -1
- package/dist/cli/doctor/ug-inflight.d.ts +0 -35
- package/dist/cli/doctor/ug-inflight.js +0 -57
- package/dist/cli/doctor/ug-inflight.js.map +0 -1
- package/dist/cli/doctor/understanding-mode-env.d.ts +0 -51
- package/dist/cli/doctor/understanding-mode-env.js +0 -98
- package/dist/cli/doctor/understanding-mode-env.js.map +0 -1
- package/dist/cli/dry-run.d.ts +0 -58
- package/dist/cli/dry-run.js +0 -283
- package/dist/cli/dry-run.js.map +0 -1
- package/dist/cli/enriched-event.d.ts +0 -35
- package/dist/cli/enriched-event.js +0 -60
- package/dist/cli/enriched-event.js.map +0 -1
- package/dist/cli/event-input.d.ts +0 -28
- package/dist/cli/event-input.js +0 -73
- package/dist/cli/event-input.js.map +0 -1
- package/dist/cli/explain-action.d.ts +0 -25
- package/dist/cli/explain-action.js +0 -57
- package/dist/cli/explain-action.js.map +0 -1
- package/dist/cli/explain-policy.d.ts +0 -147
- package/dist/cli/explain-policy.js +0 -248
- package/dist/cli/explain-policy.js.map +0 -1
- package/dist/cli/explain.d.ts +0 -31
- package/dist/cli/explain.js +0 -159
- package/dist/cli/explain.js.map +0 -1
- package/dist/cli/gc/index.d.ts +0 -63
- package/dist/cli/gc/index.js +0 -566
- package/dist/cli/gc/index.js.map +0 -1
- package/dist/cli/pack/approve-escape.d.ts +0 -19
- package/dist/cli/pack/approve-escape.js +0 -190
- package/dist/cli/pack/approve-escape.js.map +0 -1
- package/dist/cli/pack/auto-approve-path.d.ts +0 -146
- package/dist/cli/pack/auto-approve-path.js +0 -462
- package/dist/cli/pack/auto-approve-path.js.map +0 -1
- package/dist/cli/pack/hook-codex-post-tool-use.d.ts +0 -25
- package/dist/cli/pack/hook-codex-post-tool-use.js +0 -160
- package/dist/cli/pack/hook-codex-post-tool-use.js.map +0 -1
- package/dist/cli/pack/hook-codex-pre-tool-use.d.ts +0 -48
- package/dist/cli/pack/hook-codex-pre-tool-use.js +0 -474
- package/dist/cli/pack/hook-codex-pre-tool-use.js.map +0 -1
- package/dist/cli/pack/hook-codex-stop.d.ts +0 -35
- package/dist/cli/pack/hook-codex-stop.js +0 -329
- package/dist/cli/pack/hook-codex-stop.js.map +0 -1
- package/dist/cli/pack/hook-codex-user-prompt-submit.d.ts +0 -24
- package/dist/cli/pack/hook-codex-user-prompt-submit.js +0 -93
- package/dist/cli/pack/hook-codex-user-prompt-submit.js.map +0 -1
- package/dist/cli/pack/hook-post-merge-gate-record.d.ts +0 -37
- package/dist/cli/pack/hook-post-merge-gate-record.js +0 -190
- package/dist/cli/pack/hook-post-merge-gate-record.js.map +0 -1
- package/dist/cli/pack/hook-post-merge-gate.d.ts +0 -34
- package/dist/cli/pack/hook-post-merge-gate.js +0 -277
- package/dist/cli/pack/hook-post-merge-gate.js.map +0 -1
- package/dist/cli/pack/hook-post-tool-use.d.ts +0 -45
- package/dist/cli/pack/hook-post-tool-use.js +0 -137
- package/dist/cli/pack/hook-post-tool-use.js.map +0 -1
- package/dist/cli/pack/hook-pre-tool-use.d.ts +0 -92
- package/dist/cli/pack/hook-pre-tool-use.js +0 -1328
- package/dist/cli/pack/hook-pre-tool-use.js.map +0 -1
- package/dist/cli/pack/hook-runtime-reality.d.ts +0 -63
- package/dist/cli/pack/hook-runtime-reality.js +0 -210
- package/dist/cli/pack/hook-runtime-reality.js.map +0 -1
- package/dist/cli/pack/hook-solution-acceptance-writeguard.d.ts +0 -32
- package/dist/cli/pack/hook-solution-acceptance-writeguard.js +0 -438
- package/dist/cli/pack/hook-solution-acceptance-writeguard.js.map +0 -1
- package/dist/cli/pack/hook-solution-acceptance.d.ts +0 -157
- package/dist/cli/pack/hook-solution-acceptance.js +0 -530
- package/dist/cli/pack/hook-solution-acceptance.js.map +0 -1
- package/dist/cli/pack/hook-stay-in-scope.d.ts +0 -37
- package/dist/cli/pack/hook-stay-in-scope.js +0 -128
- package/dist/cli/pack/hook-stay-in-scope.js.map +0 -1
- package/dist/cli/pack/hook-subagent-start.d.ts +0 -23
- package/dist/cli/pack/hook-subagent-start.js +0 -88
- package/dist/cli/pack/hook-subagent-start.js.map +0 -1
- package/dist/cli/pack/hook-subagent-stop.d.ts +0 -19
- package/dist/cli/pack/hook-subagent-stop.js +0 -41
- package/dist/cli/pack/hook-subagent-stop.js.map +0 -1
- package/dist/cli/pack/hook-track-active-claim.d.ts +0 -27
- package/dist/cli/pack/hook-track-active-claim.js +0 -275
- package/dist/cli/pack/hook-track-active-claim.js.map +0 -1
- package/dist/cli/pack/transcript-report-scan.d.ts +0 -71
- package/dist/cli/pack/transcript-report-scan.js +0 -359
- package/dist/cli/pack/transcript-report-scan.js.map +0 -1
- package/dist/cli/pack/understanding-report-schema-hint.d.ts +0 -26
- package/dist/cli/pack/understanding-report-schema-hint.js +0 -120
- package/dist/cli/pack/understanding-report-schema-hint.js.map +0 -1
- package/dist/cli/pack/upgrade.d.ts +0 -32
- package/dist/cli/pack/upgrade.js +0 -273
- package/dist/cli/pack/upgrade.js.map +0 -1
- package/dist/cli/pause/index.d.ts +0 -113
- package/dist/cli/pause/index.js +0 -251
- package/dist/cli/pause/index.js.map +0 -1
- package/dist/cli/pause-check.d.ts +0 -22
- package/dist/cli/pause-check.js +0 -54
- package/dist/cli/pause-check.js.map +0 -1
- package/dist/cli/policy/intercept.d.ts +0 -233
- package/dist/cli/policy/intercept.js +0 -1022
- package/dist/cli/policy/intercept.js.map +0 -1
- package/dist/cli/policy/risk-envelope-enrichment.d.ts +0 -40
- package/dist/cli/policy/risk-envelope-enrichment.js +0 -110
- package/dist/cli/policy/risk-envelope-enrichment.js.map +0 -1
- package/dist/cli/record/index.d.ts +0 -81
- package/dist/cli/record/index.js +0 -348
- package/dist/cli/record/index.js.map +0 -1
- package/dist/cli/register-audit-group.js +0 -91
- package/dist/cli/register-audit-group.js.map +0 -1
- package/dist/cli/resolve-env.d.ts +0 -32
- package/dist/cli/resolve-env.js +0 -46
- package/dist/cli/resolve-env.js.map +0 -1
- package/dist/cli/session-export/index.d.ts +0 -46
- package/dist/cli/session-export/index.js +0 -169
- package/dist/cli/session-export/index.js.map +0 -1
- package/dist/cli/session-export/redact.d.ts +0 -22
- package/dist/cli/session-export/redact.js +0 -47
- package/dist/cli/session-export/redact.js.map +0 -1
- package/dist/cli/session-export/transcript.d.ts +0 -24
- package/dist/cli/session-export/transcript.js +0 -164
- package/dist/cli/session-export/transcript.js.map +0 -1
- package/dist/cli/session-start/branch-check.d.ts +0 -18
- package/dist/cli/session-start/branch-check.js +0 -140
- package/dist/cli/session-start/branch-check.js.map +0 -1
- package/dist/cli/session-start/index.d.ts +0 -121
- package/dist/cli/session-start/index.js +0 -591
- package/dist/cli/session-start/index.js.map +0 -1
- package/dist/cli/session-start/shared-options.d.ts +0 -103
- package/dist/cli/session-start/shared-options.js +0 -107
- package/dist/cli/session-start/shared-options.js.map +0 -1
- package/dist/cli/session-start/stale-base-check.d.ts +0 -46
- package/dist/cli/session-start/stale-base-check.js +0 -352
- package/dist/cli/session-start/stale-base-check.js.map +0 -1
- package/dist/cli/session-start/toolchain-parity.d.ts +0 -267
- package/dist/cli/session-start/toolchain-parity.js +0 -797
- package/dist/cli/session-start/toolchain-parity.js.map +0 -1
- package/dist/cli/smoke/assertions.d.ts +0 -46
- package/dist/cli/smoke/assertions.js +0 -170
- package/dist/cli/smoke/assertions.js.map +0 -1
- package/dist/cli/smoke/index.d.ts +0 -76
- package/dist/cli/smoke/index.js +0 -245
- package/dist/cli/smoke/index.js.map +0 -1
- package/dist/cli/smoke/runner.d.ts +0 -55
- package/dist/cli/smoke/runner.js +0 -134
- package/dist/cli/smoke/runner.js.map +0 -1
- package/dist/cli/smoke/stream-parser.d.ts +0 -65
- package/dist/cli/smoke/stream-parser.js +0 -115
- package/dist/cli/smoke/stream-parser.js.map +0 -1
- package/dist/cli/test-risk.d.ts +0 -27
- package/dist/cli/test-risk.js +0 -38
- package/dist/cli/test-risk.js.map +0 -1
- package/dist/io/display-path.d.ts +0 -11
- package/dist/io/display-path.js +0 -29
- package/dist/io/display-path.js.map +0 -1
- package/dist/io/duration.d.ts +0 -5
- package/dist/io/duration.js +0 -50
- package/dist/io/duration.js.map +0 -1
- package/dist/io/extract.d.ts +0 -79
- package/dist/io/extract.js +0 -226
- package/dist/io/extract.js.map +0 -1
- package/dist/io/ledger-record.d.ts +0 -83
- package/dist/io/ledger-record.js +0 -301
- package/dist/io/ledger-record.js.map +0 -1
- package/dist/io/read-json-dir-entries.d.ts +0 -36
- package/dist/io/read-json-dir-entries.js +0 -48
- package/dist/io/read-json-dir-entries.js.map +0 -1
- package/dist/io/safe-json-parse.d.ts +0 -5
- package/dist/io/safe-json-parse.js +0 -21
- package/dist/io/safe-json-parse.js.map +0 -1
- package/dist/policies/index.d.ts +0 -5
- package/dist/policies/index.js +0 -6
- package/dist/policies/index.js.map +0 -1
- package/dist/policies/ledger-client.d.ts +0 -113
- package/dist/policies/ledger-client.js +0 -500
- package/dist/policies/ledger-client.js.map +0 -1
- package/dist/policies/producers.d.ts +0 -12
- package/dist/policies/producers.js +0 -61
- package/dist/policies/producers.js.map +0 -1
- package/dist/policies/requires.d.ts +0 -75
- package/dist/policies/requires.js +0 -240
- package/dist/policies/requires.js.map +0 -1
- package/dist/policies/timestamp.d.ts +0 -14
- package/dist/policies/timestamp.js +0 -36
- package/dist/policies/timestamp.js.map +0 -1
- package/dist/policy-packs/builtin/permission-profiles.d.ts +0 -11
- package/dist/policy-packs/builtin/permission-profiles.js +0 -74
- package/dist/policy-packs/builtin/permission-profiles.js.map +0 -1
- package/dist/policy-packs/builtin/post-merge-gate-runtime.d.ts +0 -286
- package/dist/policy-packs/builtin/post-merge-gate-runtime.js +0 -397
- package/dist/policy-packs/builtin/post-merge-gate-runtime.js.map +0 -1
- package/dist/policy-packs/builtin/post-merge-gate.d.ts +0 -56
- package/dist/policy-packs/builtin/post-merge-gate.js +0 -347
- package/dist/policy-packs/builtin/post-merge-gate.js.map +0 -1
- package/dist/policy-packs/builtin/solution-acceptance-reconnect.d.ts +0 -50
- package/dist/policy-packs/builtin/solution-acceptance-reconnect.js +0 -151
- package/dist/policy-packs/builtin/solution-acceptance-reconnect.js.map +0 -1
- package/dist/policy-packs/builtin/solution-acceptance-runtime.d.ts +0 -323
- package/dist/policy-packs/builtin/solution-acceptance-runtime.js +0 -672
- package/dist/policy-packs/builtin/solution-acceptance-runtime.js.map +0 -1
- package/dist/policy-packs/builtin/solution-acceptance.d.ts +0 -45
- package/dist/policy-packs/builtin/solution-acceptance.js +0 -226
- package/dist/policy-packs/builtin/solution-acceptance.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution/active-claim.d.ts +0 -25
- package/dist/policy-packs/builtin/understanding-before-execution/active-claim.js +0 -94
- package/dist/policy-packs/builtin/understanding-before-execution/active-claim.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution/auto-approve-default.d.ts +0 -35
- package/dist/policy-packs/builtin/understanding-before-execution/auto-approve-default.js +0 -86
- package/dist/policy-packs/builtin/understanding-before-execution/auto-approve-default.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution/auto-approve.d.ts +0 -210
- package/dist/policy-packs/builtin/understanding-before-execution/auto-approve.js +0 -361
- package/dist/policy-packs/builtin/understanding-before-execution/auto-approve.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution/delegation-markers.d.ts +0 -304
- package/dist/policy-packs/builtin/understanding-before-execution/delegation-markers.js +0 -734
- package/dist/policy-packs/builtin/understanding-before-execution/delegation-markers.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution/expiry-reason.d.ts +0 -36
- package/dist/policy-packs/builtin/understanding-before-execution/expiry-reason.js +0 -73
- package/dist/policy-packs/builtin/understanding-before-execution/expiry-reason.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution/index.d.ts +0 -19
- package/dist/policy-packs/builtin/understanding-before-execution/index.js +0 -83
- package/dist/policy-packs/builtin/understanding-before-execution/index.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution/inflight-records.d.ts +0 -135
- package/dist/policy-packs/builtin/understanding-before-execution/inflight-records.js +0 -643
- package/dist/policy-packs/builtin/understanding-before-execution/inflight-records.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution/ledger.d.ts +0 -25
- package/dist/policy-packs/builtin/understanding-before-execution/ledger.js +0 -56
- package/dist/policy-packs/builtin/understanding-before-execution/ledger.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution/lifecycle.d.ts +0 -20
- package/dist/policy-packs/builtin/understanding-before-execution/lifecycle.js +0 -106
- package/dist/policy-packs/builtin/understanding-before-execution/lifecycle.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution/markers.d.ts +0 -126
- package/dist/policy-packs/builtin/understanding-before-execution/markers.js +0 -245
- package/dist/policy-packs/builtin/understanding-before-execution/markers.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution/measured-permission-modes.d.ts +0 -29
- package/dist/policy-packs/builtin/understanding-before-execution/measured-permission-modes.js +0 -82
- package/dist/policy-packs/builtin/understanding-before-execution/measured-permission-modes.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution/permission-mode-observations.d.ts +0 -71
- package/dist/policy-packs/builtin/understanding-before-execution/permission-mode-observations.js +0 -175
- package/dist/policy-packs/builtin/understanding-before-execution/permission-mode-observations.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution/persisted-reports.d.ts +0 -625
- package/dist/policy-packs/builtin/understanding-before-execution/persisted-reports.js +0 -1076
- package/dist/policy-packs/builtin/understanding-before-execution/persisted-reports.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution/post-tool-use-boundary.d.ts +0 -128
- package/dist/policy-packs/builtin/understanding-before-execution/post-tool-use-boundary.js +0 -213
- package/dist/policy-packs/builtin/understanding-before-execution/post-tool-use-boundary.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution/stay-in-scope-config.d.ts +0 -129
- package/dist/policy-packs/builtin/understanding-before-execution/stay-in-scope-config.js +0 -166
- package/dist/policy-packs/builtin/understanding-before-execution/stay-in-scope-config.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution/task-markers.d.ts +0 -164
- package/dist/policy-packs/builtin/understanding-before-execution/task-markers.js +0 -275
- package/dist/policy-packs/builtin/understanding-before-execution/task-markers.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution-runtime.d.ts +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution-runtime.js +0 -10
- package/dist/policy-packs/builtin/understanding-before-execution-runtime.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution.d.ts +0 -526
- package/dist/policy-packs/builtin/understanding-before-execution.js +0 -1078
- package/dist/policy-packs/builtin/understanding-before-execution.js.map +0 -1
- package/dist/policy-packs/permission-translator.d.ts +0 -9
- package/dist/policy-packs/permission-translator.js +0 -76
- package/dist/policy-packs/permission-translator.js.map +0 -1
- package/dist/runtime/action-envelope.d.ts +0 -64
- package/dist/runtime/action-envelope.js +0 -46
- package/dist/runtime/action-envelope.js.map +0 -1
- package/dist/runtime/approval-signing.d.ts +0 -111
- package/dist/runtime/approval-signing.js +0 -384
- package/dist/runtime/approval-signing.js.map +0 -1
- package/dist/runtime/bash-match-facts.d.ts +0 -60
- package/dist/runtime/bash-match-facts.js +0 -196
- package/dist/runtime/bash-match-facts.js.map +0 -1
- package/dist/runtime/bash-match-registry.d.ts +0 -112
- package/dist/runtime/bash-match-registry.js +0 -406
- package/dist/runtime/bash-match-registry.js.map +0 -1
- package/dist/runtime/bash-prefix-parse.d.ts +0 -31
- package/dist/runtime/bash-prefix-parse.js +0 -576
- package/dist/runtime/bash-prefix-parse.js.map +0 -1
- package/dist/runtime/command-normalize.d.ts +0 -658
- package/dist/runtime/command-normalize.js +0 -2410
- package/dist/runtime/command-normalize.js.map +0 -1
- package/dist/runtime/deletion-target-resolve.d.ts +0 -28
- package/dist/runtime/deletion-target-resolve.js +0 -1078
- package/dist/runtime/deletion-target-resolve.js.map +0 -1
- package/dist/runtime/destructive-shell-floor.d.ts +0 -19
- package/dist/runtime/destructive-shell-floor.js +0 -611
- package/dist/runtime/destructive-shell-floor.js.map +0 -1
- package/dist/runtime/environment-resolver.d.ts +0 -36
- package/dist/runtime/environment-resolver.js +0 -138
- package/dist/runtime/environment-resolver.js.map +0 -1
- package/dist/runtime/git-context.d.ts +0 -201
- package/dist/runtime/git-context.js +0 -422
- package/dist/runtime/git-context.js.map +0 -1
- package/dist/runtime/index.d.ts +0 -12
- package/dist/runtime/index.js +0 -13
- package/dist/runtime/index.js.map +0 -1
- package/dist/runtime/intercept.d.ts +0 -623
- package/dist/runtime/intercept.js +0 -1384
- package/dist/runtime/intercept.js.map +0 -1
- package/dist/runtime/kube-context.d.ts +0 -16
- package/dist/runtime/kube-context.js +0 -63
- package/dist/runtime/kube-context.js.map +0 -1
- package/dist/runtime/kubectl-target-parse.d.ts +0 -31
- package/dist/runtime/kubectl-target-parse.js +0 -249
- package/dist/runtime/kubectl-target-parse.js.map +0 -1
- package/dist/runtime/ledger-add.d.ts +0 -16
- package/dist/runtime/ledger-add.js +0 -150
- package/dist/runtime/ledger-add.js.map +0 -1
- package/dist/runtime/ledger-writer.d.ts +0 -27
- package/dist/runtime/ledger-writer.js +0 -46
- package/dist/runtime/ledger-writer.js.map +0 -1
- package/dist/runtime/pause-sentinel.d.ts +0 -60
- package/dist/runtime/pause-sentinel.js +0 -156
- package/dist/runtime/pause-sentinel.js.map +0 -1
- package/dist/runtime/pending-approval.d.ts +0 -23
- package/dist/runtime/pending-approval.js +0 -67
- package/dist/runtime/pending-approval.js.map +0 -1
- package/dist/runtime/read-only-bash.d.ts +0 -141
- package/dist/runtime/read-only-bash.js +0 -2204
- package/dist/runtime/read-only-bash.js.map +0 -1
- package/dist/runtime/recovery-git-commit.d.ts +0 -22
- package/dist/runtime/recovery-git-commit.js +0 -284
- package/dist/runtime/recovery-git-commit.js.map +0 -1
- package/dist/runtime/reject-malformed-session-id.d.ts +0 -8
- package/dist/runtime/reject-malformed-session-id.js +0 -16
- package/dist/runtime/reject-malformed-session-id.js.map +0 -1
- package/dist/runtime/risk-classifier.d.ts +0 -38
- package/dist/runtime/risk-classifier.js +0 -311
- package/dist/runtime/risk-classifier.js.map +0 -1
- package/dist/runtime/session-id.d.ts +0 -113
- package/dist/runtime/session-id.js +0 -193
- package/dist/runtime/session-id.js.map +0 -1
- package/dist/runtime/shell-word.d.ts +0 -62
- package/dist/runtime/shell-word.js +0 -410
- package/dist/runtime/shell-word.js.map +0 -1
- package/dist/runtime/task-providers/agent-tasks.d.ts +0 -105
- package/dist/runtime/task-providers/agent-tasks.js +0 -247
- package/dist/runtime/task-providers/agent-tasks.js.map +0 -1
- package/dist/runtime/when-eval.d.ts +0 -62
- package/dist/runtime/when-eval.js +0 -212
- package/dist/runtime/when-eval.js.map +0 -1
- package/dist/runtime/workflow-policies.d.ts +0 -207
- package/dist/runtime/workflow-policies.js +0 -596
- package/dist/runtime/workflow-policies.js.map +0 -1
- package/dist/schema/audit.d.ts +0 -71
- package/dist/schema/audit.js +0 -32
- package/dist/schema/audit.js.map +0 -1
- package/dist/schema/doctor.d.ts +0 -25
- package/dist/schema/doctor.js +0 -23
- package/dist/schema/doctor.js.map +0 -1
- package/dist/schema/environments.d.ts +0 -215
- package/dist/schema/environments.js +0 -101
- package/dist/schema/environments.js.map +0 -1
- package/dist/schema/extract.d.ts +0 -9
- package/dist/schema/extract.js +0 -86
- package/dist/schema/extract.js.map +0 -1
- package/dist/schema/permission-profiles.d.ts +0 -2292
- package/dist/schema/permission-profiles.js +0 -60
- package/dist/schema/permission-profiles.js.map +0 -1
- package/dist/schema/policies.d.ts +0 -974
- package/dist/schema/policies.js +0 -298
- package/dist/schema/policies.js.map +0 -1
- package/dist/schema/requires.d.ts +0 -131
- package/dist/schema/requires.js +0 -88
- package/dist/schema/requires.js.map +0 -1
- package/dist/schema/risk.d.ts +0 -144
- package/dist/schema/risk.js +0 -194
- package/dist/schema/risk.js.map +0 -1
- package/dist/schema/session-start-preflight.d.ts +0 -10
- package/dist/schema/session-start-preflight.js +0 -106
- package/dist/schema/session-start-preflight.js.map +0 -1
- package/dist/schema/stale-base-check.d.ts +0 -18
- package/dist/schema/stale-base-check.js +0 -37
- package/dist/schema/stale-base-check.js.map +0 -1
- package/dist/schema/toolchain-parity.d.ts +0 -21
- package/dist/schema/toolchain-parity.js +0 -48
- package/dist/schema/toolchain-parity.js.map +0 -1
- package/dist/schema/workflows.d.ts +0 -519
- package/dist/schema/workflows.js +0 -81
- package/dist/schema/workflows.js.map +0 -1
- package/scripts/runtime-reality-docker-probe.mjs +0 -71
|
@@ -46,15 +46,14 @@ const HEADER = [
|
|
|
46
46
|
"# Operator-owned settings (model, auth, sandbox profile, MCP servers)",
|
|
47
47
|
"# stay in your own config; harness owns hook wiring only.",
|
|
48
48
|
"#",
|
|
49
|
-
"# Wire format the tool-event
|
|
50
|
-
|
|
51
|
-
'# Codex"):',
|
|
49
|
+
"# Wire format a hook command reads on stdin: the tool-event JSON Codex sends,",
|
|
50
|
+
"# for example:",
|
|
52
51
|
"#",
|
|
53
|
-
"# {
|
|
52
|
+
"# { hook_event_name?: string, session_id?: string, tool_name?: string,",
|
|
53
|
+
"# tool_input?: any, cwd?: string }",
|
|
54
54
|
"#",
|
|
55
55
|
"# PreToolUse blocker exit-code contract: 0 = allow, 2 = block (with reason",
|
|
56
|
-
"# on stderr).
|
|
57
|
-
"# whenever Codex invokes that event; it does not inspect stdin to suppress turns.",
|
|
56
|
+
"# on stderr).",
|
|
58
57
|
"",
|
|
59
58
|
].join("\n");
|
|
60
59
|
// Control-character regex covering U+0000..U+001F + U+007F. Constructed
|
|
@@ -91,48 +90,13 @@ function escapeTomlString(s) {
|
|
|
91
90
|
function tomlString(s) {
|
|
92
91
|
return `"${escapeTomlString(s)}"`;
|
|
93
92
|
}
|
|
94
|
-
function eventKey(event) {
|
|
95
|
-
// Codex 0.131.0's TOML schema uses protocol event names as table
|
|
96
|
-
// keys (for example [[hooks.PreToolUse]]), not the legacy lower-snake
|
|
97
|
-
// names harness emitted in the first Codex adapter. Unknown events
|
|
98
|
-
// pass through unchanged so future schema additions are not dropped.
|
|
99
|
-
switch (event) {
|
|
100
|
-
case "UserPromptSubmit":
|
|
101
|
-
return "UserPromptSubmit";
|
|
102
|
-
case "PreToolUse":
|
|
103
|
-
return "PreToolUse";
|
|
104
|
-
case "Stop":
|
|
105
|
-
return "Stop";
|
|
106
|
-
case "PostToolUse":
|
|
107
|
-
return "PostToolUse";
|
|
108
|
-
case "SessionStart":
|
|
109
|
-
return "SessionStart";
|
|
110
|
-
default:
|
|
111
|
-
return event;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
// Hook names safe to splice into the emitted command literal as
|
|
115
|
-
// `--hook <name>`. Restricted to a quote/space/metachar-free charset so
|
|
116
|
-
// the projection never produces a shell-broken command, even though the
|
|
117
|
-
// underlying `Hook.name` schema (z.string().min(1)) accepts anything.
|
|
118
|
-
// All policy-pack hook names ship within this charset; an exotic name
|
|
119
|
-
// silently skips the flag and falls back to the un-tagged emission, with
|
|
120
|
-
// the preceding `# harness hook: <name>` TOML comment still naming it.
|
|
121
|
-
const SAFE_HOOK_NAME_RE = /^[A-Za-z0-9._:-]+$/;
|
|
122
|
-
function commandWithHookTag(h) {
|
|
123
|
-
if (h.command.trim() !== "harness policy intercept")
|
|
124
|
-
return h.command;
|
|
125
|
-
if (!SAFE_HOOK_NAME_RE.test(h.name))
|
|
126
|
-
return h.command;
|
|
127
|
-
return `${h.command} --hook ${h.name}`;
|
|
128
|
-
}
|
|
129
93
|
function emitCommandHook(h) {
|
|
130
94
|
const fields = [
|
|
131
95
|
`type = "command"`,
|
|
132
|
-
`command = ${tomlString(
|
|
96
|
+
`command = ${tomlString(h.command)}`,
|
|
133
97
|
// Shared with generate-settings.ts's Claude Code projection
|
|
134
98
|
// (`hookTimeoutSeconds`) so the two runtime projections cannot diverge
|
|
135
|
-
// on the ms->seconds conversion
|
|
99
|
+
// on the ms->seconds conversion again.
|
|
136
100
|
`timeout = ${hookTimeoutSeconds(h)}`,
|
|
137
101
|
];
|
|
138
102
|
return `{ ${fields.join(", ")} }`;
|
|
@@ -143,7 +107,9 @@ function tomlCommentText(s) {
|
|
|
143
107
|
function emitHook(h) {
|
|
144
108
|
const lines = [];
|
|
145
109
|
lines.push(`# harness hook: ${tomlCommentText(h.name)} (budget_ms=${h.budget_ms})`);
|
|
146
|
-
|
|
110
|
+
// Codex 0.131.0's TOML schema uses the protocol event names as table
|
|
111
|
+
// keys (e.g. [[hooks.PreToolUse]]), so the manifest event is emitted as is.
|
|
112
|
+
lines.push(`[[hooks.${h.event}]]`);
|
|
147
113
|
if (h.match !== undefined) {
|
|
148
114
|
lines.push(`matcher = ${tomlString(expandCodexHookMatchPattern(h.match))}`);
|
|
149
115
|
}
|
|
@@ -164,20 +130,6 @@ export function generateCodexConfig(manifest) {
|
|
|
164
130
|
return a.event < b.event ? -1 : 1;
|
|
165
131
|
return a.command < b.command ? -1 : a.command > b.command ? 1 : 0;
|
|
166
132
|
});
|
|
167
|
-
// Surface a warning for hook entries that carry path_match / bash_match
|
|
168
|
-
// filters; we do not project those into the emitted TOML (the harness
|
|
169
|
-
// schema treats them as documentation that the underlying script
|
|
170
|
-
// enforces internally, identical to the Claude Code projection in
|
|
171
|
-
// generate-settings.ts). The warning makes the silent-drop visible
|
|
172
|
-
// to operators who might expect TOML-level filtering.
|
|
173
|
-
for (const h of hooks) {
|
|
174
|
-
if (h.path_match !== undefined) {
|
|
175
|
-
warnings.push(`hook ${JSON.stringify(h.name)}: path_match is not projected into Codex config (script-side filter only)`);
|
|
176
|
-
}
|
|
177
|
-
if (h.bash_match !== undefined) {
|
|
178
|
-
warnings.push(`hook ${JSON.stringify(h.name)}: bash_match is not projected into Codex config (script-side filter only)`);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
133
|
if (hooks.length === 0) {
|
|
182
134
|
warnings.push("manifest contributes no hooks; the emitted Codex config has no [[hooks.*]] entries");
|
|
183
135
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-codex-config.js","sourceRoot":"","sources":["../../../src/cli/apply/generate-codex-config.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,EAAE;AACF,oEAAoE;AACpE,+DAA+D;AAC/D,yEAAyE;AACzE,sCAAsC;AACtC,mEAAmE;AACnE,qEAAqE;AACrE,uEAAuE;AACvE,EAAE;AACF,gDAAgD;AAChD,sEAAsE;AACtE,6DAA6D;AAC7D,EAAE;AACF,wEAAwE;AACxE,kBAAkB;AAClB,oDAAoD;AACpD,4DAA4D;AAC5D,EAAE;AACF,kCAAkC;AAClC,uEAAuE;AACvE,wEAAwE;AACxE,wEAAwE;AACxE,oEAAoE;AACpE,uDAAuD;AACvD,qEAAqE;AACrE,qEAAqE;AACrE,2CAA2C;AAG3C,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAOnF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,2BAA2B,GACtC,+CAA+C,CAAC;AAElD,MAAM,MAAM,GAAG;IACb,2BAA2B;IAC3B,sEAAsE;IACtE,GAAG;IACH,2CAA2C;IAC3C,6CAA6C;IAC7C,GAAG;IACH,sEAAsE;IACtE,uEAAuE;IACvE,2DAA2D;IAC3D,GAAG;IACH
|
|
1
|
+
{"version":3,"file":"generate-codex-config.js","sourceRoot":"","sources":["../../../src/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C,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;IACH,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,QAAQ,CAAC,IAAI,CACX,oFAAoF,CACrF,CAAC;IACJ,CAAC;IACD,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC9C,MAAM,OAAO,GAAG,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IACjE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;AAC/B,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Generate `harness.generated/MEMORY.md`: the index that lists every memory
|
|
2
2
|
// file the router would surface, derived from `memory.directories[]`. Memory
|
|
3
|
-
// markdown files themselves stay user-owned
|
|
4
|
-
// the index is generated.
|
|
3
|
+
// markdown files themselves stay user-owned; only the index is generated.
|
|
5
4
|
//
|
|
6
5
|
// Output format mirrors the canonical hand-curated MEMORY.md convention:
|
|
7
6
|
//
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-memory-index.js","sourceRoot":"","sources":["../../../src/cli/apply/generate-memory-index.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,6EAA6E;AAC7E,0EAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"generate-memory-index.js","sourceRoot":"","sources":["../../../src/cli/apply/generate-memory-index.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,6EAA6E;AAC7E,0EAA0E;AAC1E,EAAE;AACF,yEAAyE;AACzE,EAAE;AACF,wCAAwC;AACxC,EAAE;AACF,wEAAwE;AACx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QACxB,IAAI,CAAC,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC7B,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,QAAQ,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;QAChE,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC;IACD,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IAEhE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;AACxC,CAAC"}
|
|
@@ -8,8 +8,8 @@ export interface OpencodeLocalMcpServer {
|
|
|
8
8
|
/**
|
|
9
9
|
* LOW-F4 (batch18 fix-round, task f34eb233 review): the marker projected
|
|
10
10
|
* for a manifest `tools.mcp[]` entry declared `enabled: false`. See this
|
|
11
|
-
* module's "enabled:false" header note for why
|
|
12
|
-
* `type`/`command`
|
|
11
|
+
* module's "enabled:false" header note for why the key is not omitted
|
|
12
|
+
* and why a bare object (no `type`/`command`) is accepted.
|
|
13
13
|
*/
|
|
14
14
|
export interface OpencodeDisabledMcpServer {
|
|
15
15
|
enabled: false;
|
|
@@ -46,13 +46,5 @@ export interface GenerateOpencodeConfigExtras {
|
|
|
46
46
|
* convention as `GenerateSettingsExtras.homeDir` in generate-settings.ts.
|
|
47
47
|
*/
|
|
48
48
|
homeDir?: string;
|
|
49
|
-
/**
|
|
50
|
-
* Absolute `harness.generated/` directory for the manifest in use (task
|
|
51
|
-
* 03a917fd/H1b), threaded through to `projectSigningKeyEnv` exactly like
|
|
52
|
-
* `GenerateSettingsExtras.generatedDir` in generate-settings.ts. Same
|
|
53
|
-
* no-safe-default rule: omitting this yields NO
|
|
54
|
-
* `SOLUTION_VERDICT_SIGNING_KEY` projection rather than a guessed path.
|
|
55
|
-
*/
|
|
56
|
-
generatedDir?: string;
|
|
57
49
|
}
|
|
58
50
|
export declare function generateOpencodeConfig(manifest: Manifest, extras?: GenerateOpencodeConfigExtras): OpencodeConfigResult;
|
|
@@ -1,111 +1,70 @@
|
|
|
1
|
-
//
|
|
1
|
+
// Opencode runtime adapter config generator: `harness apply --runtime
|
|
2
|
+
// opencode` (adapter shipped in task f34eb233). Writes
|
|
3
|
+
// `harness.generated/opencode/opencode.json` instead of settings.json.
|
|
4
|
+
// opencode MERGES multiple config sources by precedence (global
|
|
5
|
+
// `~/.config/opencode/opencode.json`, `$OPENCODE_CONFIG`, a project
|
|
6
|
+
// `opencode.json`, ...), and every one of those slots is operator-owned
|
|
7
|
+
// or environment-selected, so this generator deliberately writes no
|
|
8
|
+
// operator config: wiring the artefact in is an operator action (point
|
|
9
|
+
// `$OPENCODE_CONFIG` at the generated file, or copy its `mcp` block
|
|
10
|
+
// out). Those merge semantics drive the projection rules below.
|
|
2
11
|
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
12
|
+
// Projected: `$schema` (the published opencode config schema URL) and
|
|
13
|
+
// `mcp`, built from `manifest.tools.mcp[]` via generate-settings.ts's
|
|
14
|
+
// `buildDesiredMcpServers` (the single choke point the Claude Code and
|
|
15
|
+
// Codex projections share, covering the grounding-mcp env projection
|
|
16
|
+
// and the literal-tilde warning) and reshaped into opencode's native
|
|
17
|
+
// `{type: "local", command, environment}` entries.
|
|
9
18
|
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
// 6. inline config: `$OPENCODE_CONFIG_CONTENT`
|
|
18
|
-
// 7. OS-managed config (macOS `/Library/Application Support/opencode/`,
|
|
19
|
-
// Linux `/etc/opencode/`, Windows `%ProgramData%\opencode`)
|
|
20
|
-
// Every one of those slots is either operator-owned or environment/OS
|
|
21
|
-
// selected; opencode does not auto-discover an extra "drop a file here"
|
|
22
|
-
// directory the way a plugin/pack system might. That is exactly why this
|
|
23
|
-
// generator does not attempt to install itself into any of them -- see
|
|
24
|
-
// "What we deliberately do NOT do" below.
|
|
19
|
+
// enabled:false -> a `tools.mcp[]` entry declared `enabled: false` is
|
|
20
|
+
// emitted as a bare `{"enabled": false}` marker, NOT omitted: because
|
|
21
|
+
// opencode merges config sources, an omitted key would not override an
|
|
22
|
+
// active declaration for the same server name in another merged source
|
|
23
|
+
// (e.g. the operator's own `~/.config/opencode/opencode.json`), while
|
|
24
|
+
// the explicit marker makes the disablement actually win once merged.
|
|
25
|
+
// opencode accepts the bare marker without `type` or `command`.
|
|
25
26
|
//
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
//
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
//
|
|
33
|
-
//
|
|
34
|
-
//
|
|
35
|
-
//
|
|
36
|
-
//
|
|
37
|
-
//
|
|
38
|
-
//
|
|
39
|
-
//
|
|
40
|
-
//
|
|
41
|
-
//
|
|
42
|
-
//
|
|
43
|
-
//
|
|
44
|
-
//
|
|
45
|
-
// for opencode: per the "Config location" list above, opencode MERGES
|
|
46
|
-
// multiple config sources, so a server name this generator's output
|
|
47
|
-
// simply omits does NOT override an `enabled: true` (or default-
|
|
48
|
-
// enabled) declaration for the SAME name in another merged source
|
|
49
|
-
// (e.g. the operator's own ~/.config/opencode/opencode.json) -- the
|
|
50
|
-
// operator's intent to disable that server would silently not take
|
|
51
|
-
// effect. Emitting the explicit marker instead makes the disablement
|
|
52
|
-
// actually win once merged.
|
|
53
|
-
//
|
|
54
|
-
// hooks -> NOT PROJECTED (documented no-op, not a bug). opencode.json's
|
|
55
|
-
// schema has NO declarative hook/event field of any kind (confirmed:
|
|
56
|
-
// absent from https://opencode.ai/config.json). opencode's only
|
|
57
|
-
// extensibility surface for tool-call interception is the JS/TS
|
|
58
|
-
// `plugin` array (`@opencode-ai/plugin`; its event set includes
|
|
59
|
-
// `tool.execute.before` / `tool.execute.after`, `session.*`,
|
|
60
|
-
// `permission.asked`, ...) -- a code-authoring surface, not a
|
|
61
|
-
// config-declared shell-command list like Claude Code's settings.json
|
|
62
|
-
// `hooks` or Codex's `[[hooks.*]]` TOML. Building a harness -> opencode
|
|
63
|
-
// plugin bridge that would let manifest hooks actually intercept tool
|
|
64
|
-
// calls is explicitly out of this task's scope (opencode policy
|
|
65
|
-
// enforcement / hook interception). So `manifest.hooks[]` and the
|
|
66
|
-
// `memory.router` UserPromptSubmit-equivalent projection
|
|
67
|
-
// (`generate-settings.ts#buildMemoryRouterHook`) are both left
|
|
68
|
-
// unprojected here; a warning says so instead of silently dropping them.
|
|
69
|
-
//
|
|
70
|
-
// permission -> NOT PROJECTED (v1; documented follow-up). opencode does
|
|
71
|
-
// have a native `permission` block (per-tool `ask`/`allow`/`deny`, with
|
|
72
|
-
// a pattern-keyed object as an escape hatch) that is a genuine
|
|
73
|
-
// PreToolUse-blocking equivalent -- but its shape (tool key -> pattern
|
|
74
|
-
// -> action) is structurally inverted from the
|
|
75
|
-
// `permissions.{allow,ask,deny}: string[]` pattern-DSL that
|
|
76
|
-
// `policy_packs`' `packPermissions` already produce for Claude Code, and
|
|
77
|
-
// mapping one into the other is real, untested-by-this-task translation
|
|
78
|
-
// work. `generate-codex-config.ts`'s header deferred the analogous
|
|
79
|
-
// Codex sandbox-profile mapping for the same "keep v1 small" reason;
|
|
80
|
-
// this adapter follows that precedent instead of inventing a rushed
|
|
81
|
-
// pattern translator. `apply.ts` surfaces a warning (mirroring the
|
|
82
|
-
// Codex branch) when a manifest actually contributes permissions here,
|
|
83
|
-
// so the gap stays visible instead of silent.
|
|
27
|
+
// NOT projected (hooks print a warning when present; `memory.router` is
|
|
28
|
+
// projected nowhere and prints no warning; permission has no manifest
|
|
29
|
+
// source, so nothing is warned or dropped):
|
|
30
|
+
// - hooks: `manifest.hooks[]` and the `memory.router`
|
|
31
|
+
// UserPromptSubmit-equivalent projection
|
|
32
|
+
// (`generate-settings.ts#buildMemoryRouterHook`). opencode.json has
|
|
33
|
+
// no declarative hook/event field; its only tool-call interception
|
|
34
|
+
// surface is the JS/TS `plugin` array (a code-authoring surface),
|
|
35
|
+
// and a harness -> opencode plugin bridge is out of scope.
|
|
36
|
+
// - permission: opencode's native `permission` block (per-tool
|
|
37
|
+
// `ask`/`allow`/`deny`) is a genuine PreToolUse-blocking
|
|
38
|
+
// equivalent, but its tool -> pattern -> action shape is
|
|
39
|
+
// structurally inverted from the `permissions.{allow,ask,deny}`
|
|
40
|
+
// pattern DSL of Claude Code's settings.json, and mapping one into
|
|
41
|
+
// the other is real, untested work. `generate-codex-config.ts`'s
|
|
42
|
+
// header deferred the analogous Codex sandbox-profile mapping for
|
|
43
|
+
// the same "keep v1 small" reason; this adapter follows that
|
|
44
|
+
// precedent. No builtin pack contributes permissions, so nothing is
|
|
45
|
+
// dropped silently.
|
|
84
46
|
//
|
|
85
47
|
// Stable-output rules (load-bearing for byte-equivalent regeneration on
|
|
86
|
-
// a no-op apply):
|
|
87
|
-
//
|
|
88
|
-
// guarantees: ascending lexical by name.
|
|
89
|
-
// - No timestamps, hostnames, or other run-specific data.
|
|
48
|
+
// a no-op apply): `mcp` server keys are ascending lexical by name, and
|
|
49
|
+
// no timestamps, hostnames, or other run-specific data are emitted.
|
|
90
50
|
//
|
|
91
|
-
// What
|
|
92
|
-
//
|
|
93
|
-
//
|
|
94
|
-
//
|
|
95
|
-
//
|
|
96
|
-
//
|
|
97
|
-
//
|
|
98
|
-
//
|
|
99
|
-
//
|
|
100
|
-
//
|
|
101
|
-
//
|
|
102
|
-
//
|
|
103
|
-
// `mcp` block into an existing config. harness never touches
|
|
104
|
-
// `~/.config/opencode/` or a project `opencode.json` itself.
|
|
105
|
-
// - Map policy-pack hook commands into opencode plugin code (see
|
|
106
|
-
// "hooks" above) or opencode's `permission` block (see "permission"
|
|
107
|
-
// above).
|
|
51
|
+
// What this generator deliberately does NOT do: merge into, or
|
|
52
|
+
// otherwise write, any operator-owned opencode config (harness never
|
|
53
|
+
// touches `~/.config/opencode/` or a project `opencode.json`; opencode
|
|
54
|
+
// reads JSONC, which is why the emitted `//` banner is valid config),
|
|
55
|
+
// and map hook commands into plugin code or
|
|
56
|
+
// `permission` entries (see "NOT projected" above).
|
|
57
|
+
//
|
|
58
|
+
// Header contract: the generated file's first line is
|
|
59
|
+
// `OPENCODE_GENERATED_HEADER_LINE`, the banner `harness doctor --target
|
|
60
|
+
// opencode` recognises a harness-generated artefact by. The emitted
|
|
61
|
+
// `HEADER` block and that constant are pinned bytes: change them only
|
|
62
|
+
// together with doctor's banner check and the tests that pin them.
|
|
108
63
|
import { buildDesiredMcpServers, } from "./generate-settings.js";
|
|
64
|
+
/** Hooks named in the not-projected warning before it collapses to a count. */
|
|
65
|
+
const MAX_NAMED_HOOKS = 3;
|
|
66
|
+
/** Hook the branch-protection policy pack contributes. */
|
|
67
|
+
const BRANCH_PROTECTION_HOOK_NAME = "policy-pack:branch-protection:pre-tool-use";
|
|
109
68
|
/**
|
|
110
69
|
* First line of the generated opencode config. Exported so callers that
|
|
111
70
|
* need to detect a harness-generated artefact (doctor's banner check)
|
|
@@ -125,7 +84,7 @@ const HEADER = [
|
|
|
125
84
|
"// opencode.jsonc (opencode merges config sources by precedence;",
|
|
126
85
|
"// see https://opencode.ai/docs/config/).",
|
|
127
86
|
"//",
|
|
128
|
-
"// Adapter mapping (
|
|
87
|
+
"// Adapter mapping (rationale in this generator's module header,",
|
|
129
88
|
"// src/cli/apply/generate-opencode-config.ts):",
|
|
130
89
|
"// mcp -> projected below (opencode's native `mcp` block).",
|
|
131
90
|
"// A manifest entry with `enabled: false` is emitted",
|
|
@@ -150,11 +109,10 @@ function toOpencodeMcpServer(server) {
|
|
|
150
109
|
}
|
|
151
110
|
export function generateOpencodeConfig(manifest, extras = {}) {
|
|
152
111
|
// Claude Code's {command, args, env} shape already carries the
|
|
153
|
-
// grounding-mcp EVIDENCE_LEDGER_DB
|
|
154
|
-
//
|
|
155
|
-
//
|
|
156
|
-
//
|
|
157
|
-
// buildMcpServers/projectGroundingEnv/projectSigningKeyEnv sequence).
|
|
112
|
+
// grounding-mcp EVIDENCE_LEDGER_DB projection plus the literal-tilde
|
|
113
|
+
// warning, via `buildDesiredMcpServers` (the single choke point every
|
|
114
|
+
// producer of this shape shares, instead of hand-rolling a third copy of
|
|
115
|
+
// the buildMcpServers/projectGroundingEnv sequence).
|
|
158
116
|
// `buildMcpServers` (inside the helper) returns keys pre-sorted ascending
|
|
159
117
|
// by name (see its own header) AND drops `enabled: false` entries
|
|
160
118
|
// entirely. That drop is correct for the Claude-Code-shaped intermediate
|
|
@@ -164,7 +122,6 @@ export function generateOpencodeConfig(manifest, extras = {}) {
|
|
|
164
122
|
// review — see this module's "enabled:false" header note for why).
|
|
165
123
|
const { mcp: claudeShapeMcp, warnings } = buildDesiredMcpServers(manifest, {
|
|
166
124
|
homeDir: extras.homeDir,
|
|
167
|
-
generatedDir: extras.generatedDir,
|
|
168
125
|
});
|
|
169
126
|
// Built by iterating manifest.tools.mcp SORTED ascending by name (not
|
|
170
127
|
// by re-using claudeShapeMcp's own key order, which only covers the
|
|
@@ -192,11 +149,15 @@ export function generateOpencodeConfig(manifest, extras = {}) {
|
|
|
192
149
|
warnings.push("tools.mcp[] has entries but none produced a projectable opencode `mcp` entry (see the per-entry warnings above)");
|
|
193
150
|
}
|
|
194
151
|
if (manifest.hooks.length > 0) {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
152
|
+
const names = manifest.hooks.map((h) => h.name);
|
|
153
|
+
const shown = names.slice(0, MAX_NAMED_HOOKS).join(", ");
|
|
154
|
+
const more = names.length > MAX_NAMED_HOOKS
|
|
155
|
+
? ` and ${names.length - MAX_NAMED_HOOKS} more`
|
|
156
|
+
: "";
|
|
157
|
+
const protectedBranchNote = names.includes(BRANCH_PROTECTION_HOOK_NAME)
|
|
158
|
+
? "; edits on protected branches are NOT blocked under opencode"
|
|
159
|
+
: "";
|
|
160
|
+
warnings.push(`${names.length} hook(s) not projected (${shown}${more}): opencode has no declarative hook wiring, so they do not run under opencode${protectedBranchNote}`);
|
|
200
161
|
}
|
|
201
162
|
const config = {
|
|
202
163
|
"$schema": "https://opencode.ai/config.json",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-opencode-config.js","sourceRoot":"","sources":["../../../src/cli/apply/generate-opencode-config.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"generate-opencode-config.js","sourceRoot":"","sources":["../../../src/cli/apply/generate-opencode-config.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,uDAAuD;AACvD,uEAAuE;AACvE,gEAAgE;AAChE,oEAAoE;AACpE,wEAAwE;AACxE,oEAAoE;AACpE,uEAAuE;AACvE,oEAAoE;AACpE,gEAAgE;AAChE,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,uEAAuE;AACvE,qEAAqE;AACrE,qEAAqE;AACrE,mDAAmD;AACnD,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,uEAAuE;AACvE,uEAAuE;AACvE,sEAAsE;AACtE,sEAAsE;AACtE,gEAAgE;AAChE,EAAE;AACF,wEAAwE;AACxE,sEAAsE;AACtE,4CAA4C;AAC5C,wDAAwD;AACxD,6CAA6C;AAC7C,wEAAwE;AACxE,uEAAuE;AACvE,sEAAsE;AACtE,+DAA+D;AAC/D,iEAAiE;AACjE,6DAA6D;AAC7D,6DAA6D;AAC7D,oEAAoE;AACpE,uEAAuE;AACvE,qEAAqE;AACrE,sEAAsE;AACtE,iEAAiE;AACjE,wEAAwE;AACxE,wBAAwB;AACxB,EAAE;AACF,wEAAwE;AACxE,uEA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IAErD,MAAM,IAAI,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC;IACpD,MAAM,OAAO,GAAG,GAAG,MAAM,GAAG,IAAI,EAAE,CAAC;IACnC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC;AACpC,CAAC"}
|
|
@@ -4,8 +4,6 @@ export declare const DEFAULT_BUDGET_MS = 30000;
|
|
|
4
4
|
export declare const GROUNDING_MCP_SERVER_NAME = "grounding-mcp";
|
|
5
5
|
/** The env var grounding-mcp's ledger-bridge reads for the evidence-ledger DB path. */
|
|
6
6
|
export declare const EVIDENCE_LEDGER_DB_ENV = "EVIDENCE_LEDGER_DB";
|
|
7
|
-
/** The env var grounding-mcp (>= 0.8.0) reads for the harness's own approval-marker signing-key path. */
|
|
8
|
-
export declare const SOLUTION_VERDICT_SIGNING_KEY_ENV = "SOLUTION_VERDICT_SIGNING_KEY";
|
|
9
7
|
export interface SettingsHookCommand {
|
|
10
8
|
type: "command";
|
|
11
9
|
command: string;
|
|
@@ -20,14 +18,8 @@ export interface SettingsMcpServer {
|
|
|
20
18
|
args?: string[];
|
|
21
19
|
env?: Record<string, string>;
|
|
22
20
|
}
|
|
23
|
-
export interface SettingsPermissions {
|
|
24
|
-
allow?: string[];
|
|
25
|
-
ask?: string[];
|
|
26
|
-
deny?: string[];
|
|
27
|
-
}
|
|
28
21
|
export interface SettingsRoot {
|
|
29
22
|
hooks: Record<string, SettingsHookGroup[]>;
|
|
30
|
-
permissions?: SettingsPermissions;
|
|
31
23
|
}
|
|
32
24
|
export interface GenerateSettingsResult {
|
|
33
25
|
root: SettingsRoot;
|
|
@@ -35,9 +27,8 @@ export interface GenerateSettingsResult {
|
|
|
35
27
|
/**
|
|
36
28
|
* The manifest's `tools.mcp[]` entries translated into Claude Code's
|
|
37
29
|
* server-spec shape (command/args/env) via `buildDesiredMcpServers` —
|
|
38
|
-
* INCLUDING
|
|
39
|
-
* (`projectGroundingEnv`)
|
|
40
|
-
* (`projectSigningKeyEnv`) projections. Deliberately NOT part of `root`
|
|
30
|
+
* INCLUDING the grounding-mcp `EVIDENCE_LEDGER_DB`
|
|
31
|
+
* (`projectGroundingEnv`) projection. Deliberately NOT part of `root`
|
|
41
32
|
* and never serialized into settings.json (task
|
|
42
33
|
* init-mcp-wiring-claude-code/T-002): Claude Code does not read the
|
|
43
34
|
* settings.json `mcpServers` block at runtime — see
|
|
@@ -54,31 +45,12 @@ export interface GenerateSettingsResult {
|
|
|
54
45
|
mcpServers: Record<string, SettingsMcpServer>;
|
|
55
46
|
}
|
|
56
47
|
export interface GenerateSettingsExtras {
|
|
57
|
-
/**
|
|
58
|
-
* Phase 6 #5 — pack-contributed permissions emitted into the
|
|
59
|
-
* settings.json `permissions` block. Empty buckets are dropped from
|
|
60
|
-
* the output so a no-op contribution doesn't pollute the JSON.
|
|
61
|
-
*/
|
|
62
|
-
packPermissions?: SettingsPermissions;
|
|
63
48
|
/**
|
|
64
49
|
* Home directory used to expand `~/` in projected values (the
|
|
65
50
|
* grounding evidence-ledger path). Defaults to `os.homedir()`;
|
|
66
51
|
* injected by tests for determinism.
|
|
67
52
|
*/
|
|
68
53
|
homeDir?: string;
|
|
69
|
-
/**
|
|
70
|
-
* The `harness.generated/` directory for the manifest in use (task
|
|
71
|
-
* 03a917fd/H1). Used only to project `SOLUTION_VERDICT_SIGNING_KEY` (see
|
|
72
|
-
* `projectSigningKeyEnv`) onto the grounding-mcp entry — the path to the
|
|
73
|
-
* harness's own `.approval-signing.key` (`signingKeyPathFor`). Unlike
|
|
74
|
-
* `homeDir` above there is no safe universal default: the generated dir
|
|
75
|
-
* depends on manifest-path resolution (a `--config` override changes
|
|
76
|
-
* it), so a caller that omits this gets NO projection rather than a
|
|
77
|
-
* guessed-wrong path. A relative value, or one carrying a literal `~`,
|
|
78
|
-
* is normalized to an absolute path at the projection boundary (review
|
|
79
|
-
* round H1, Finding 1) rather than rejected — see `projectSigningKeyEnv`.
|
|
80
|
-
*/
|
|
81
|
-
generatedDir?: string;
|
|
82
54
|
}
|
|
83
55
|
export declare function generateSettings(manifest: Manifest): SettingsRoot;
|
|
84
56
|
export declare function generateSettingsWithWarnings(manifest: Manifest, extras?: GenerateSettingsExtras): GenerateSettingsResult;
|
|
@@ -90,21 +62,9 @@ export declare function buildMcpServers(entries: McpServer[], warnings: string[]
|
|
|
90
62
|
* round-trip stays drift-free by construction.
|
|
91
63
|
*/
|
|
92
64
|
export declare function groundingLedgerEnvValue(manifest: Manifest, homeDir?: string): string;
|
|
93
|
-
/**
|
|
94
|
-
* The single source of the projected `SOLUTION_VERDICT_SIGNING_KEY` VALUE
|
|
95
|
-
* (mirrors how `EVIDENCE_LEDGER_DB` shares its value): `expandHome` +
|
|
96
|
-
* `path.resolve` on `generatedDir`, then `signingKeyPathFor`. Both the
|
|
97
|
-
* apply-side projection above and the adopt-side mirror
|
|
98
|
-
* (adopt/derive.ts) MUST call this, never `signingKeyPathFor` on a raw
|
|
99
|
-
* `generatedDir` — otherwise apply and adopt disagree for relative or
|
|
100
|
-
* literal-tilde `generatedDir` values and adopt reports phantom drift.
|
|
101
|
-
*/
|
|
102
|
-
export declare function signingKeyEnvValue(generatedDir: string, homeDir?: string): string;
|
|
103
65
|
export interface BuildDesiredMcpServersOptions {
|
|
104
|
-
/** Threaded to `projectGroundingEnv`
|
|
66
|
+
/** Threaded to `projectGroundingEnv`'s tilde-expansion; defaults to `os.homedir()` (see `expandHome`). */
|
|
105
67
|
homeDir?: string;
|
|
106
|
-
/** Threaded to `projectSigningKeyEnv`; no safe default (see that function's doc). */
|
|
107
|
-
generatedDir?: string;
|
|
108
68
|
}
|
|
109
69
|
export interface DesiredMcpServersResult {
|
|
110
70
|
mcp: Record<string, SettingsMcpServer>;
|
|
@@ -114,22 +74,13 @@ export interface DesiredMcpServersResult {
|
|
|
114
74
|
* Single choke point for the manifest -> Claude-Code-shaped MCP
|
|
115
75
|
* server-spec projection (review round H1, Finding 2 — STRUCTURAL fix).
|
|
116
76
|
* Encapsulates the fixed sequence `buildMcpServers` -> `projectGroundingEnv`
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
* Before this helper existed, that sequence had to be wired into each
|
|
125
|
-
* call site by hand: three of the four remembered to call
|
|
126
|
-
* `projectSigningKeyEnv` when it was added (task 03a917fd/H1b), and
|
|
127
|
-
* doctor's registration check did not, so its "not registered, run this
|
|
128
|
-
* `claude mcp add-json ...`" hint silently omitted
|
|
129
|
-
* `SOLUTION_VERDICT_SIGNING_KEY` (review round H1, Finding 2). Routing
|
|
130
|
-
* every producer through this function means the NEXT projected env only
|
|
131
|
-
* needs to be added here once, and cannot again reach only some of the
|
|
132
|
-
* call sites.
|
|
77
|
+
* so every producer of this shape, `harness apply`'s settings.json
|
|
78
|
+
* generation (this module), the init wizard's `claude mcp` CLI wiring
|
|
79
|
+
* (`src/cli/init/interactive.ts`), the doctor registration-health check
|
|
80
|
+
* (`src/cli/doctor/claude-mcp.ts`), and the opencode config generator
|
|
81
|
+
* (`generate-opencode-config.ts`), calls this ONE function instead of
|
|
82
|
+
* hand-rolling the same sequence. A NEW projected env only needs to be
|
|
83
|
+
* added here once, and cannot reach only some of the call sites.
|
|
133
84
|
*/
|
|
134
85
|
export declare function buildDesiredMcpServers(manifest: Manifest, opts?: BuildDesiredMcpServersOptions): DesiredMcpServersResult;
|
|
135
86
|
export declare function buildMemoryRouterHook(manifest: Manifest): Hook | null;
|
|
@@ -154,10 +105,6 @@ export declare function computeHookFingerprint(command: string, timeout: Setting
|
|
|
154
105
|
* helper is the single source of truth both projections now share so they
|
|
155
106
|
* cannot diverge again.
|
|
156
107
|
*
|
|
157
|
-
* `Math.ceil` never rounds a budget down to 0s
|
|
158
|
-
* policy intercept`, 1s otherwise) matches Codex's existing floor rationale
|
|
159
|
-
* (generate-codex-config.ts): the policy-intercept engine's own ledger
|
|
160
|
-
* round-trip regularly needs slightly longer than a bare 1s floor would
|
|
161
|
-
* allow.
|
|
108
|
+
* `Math.ceil` never rounds a budget down to 0s: every hook gets a 1s floor.
|
|
162
109
|
*/
|
|
163
110
|
export declare function hookTimeoutSeconds(h: Hook): number;
|