@deftai/directive-runtime 0.129.4 → 0.129.6
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/Taskfile.yml +235 -0
- package/UPGRADING.md +1 -0
- package/contracts/design-critique.md +1 -1
- package/contracts/path-write-fence.md +6 -0
- package/dist/applying-host-release.d.ts +16 -0
- package/dist/applying-host-release.js +98 -0
- package/dist/authz.d.ts +1 -1
- package/dist/authz.js +1 -1
- package/dist/check.d.ts +1 -0
- package/dist/check.js +27 -4
- package/dist/design-critique-ensure-arc-dest.d.ts +16 -0
- package/dist/design-critique-ensure-arc-dest.js +168 -0
- package/dist/dispatch.d.ts +1 -1
- package/dist/dispatch.js +8 -0
- package/dist/hook-dispatch.js +11 -5
- package/dist/human-presence-mint.d.ts +6 -1
- package/dist/human-presence-mint.js +20 -6
- package/dist/pre-pr-run.d.ts +7 -1
- package/dist/pre-pr-run.js +25 -1
- package/dist/session-start.js +40 -6
- package/dist/setup-wiring.d.ts +36 -0
- package/dist/setup-wiring.js +169 -14
- package/dist/verify-ac.d.ts +7 -2
- package/dist/verify-ac.js +13 -5
- package/dist/verify-source-cli/verify-deposit-closure.js +5 -5
- package/dist/windows-bin-ps1.d.ts +2 -2
- package/dist/windows-bin-ps1.js +5 -11
- package/docs/deft-directive-disable.md +3 -3
- package/docs/scope-provenance.md +4 -0
- package/package.json +2 -3
- package/packs/lessons/lessons-pack-0.1.json +15 -0
- package/packs/skills/skills-pack-0.1.json +2 -2
- package/skills/deft-directive-design-critique/SKILL.md +1 -1
- package/skills/deft-directive-release/SKILL.md +54 -1
- package/tasks/materialize.cjs +106 -5
- package/tasks/materialize.test.cjs +108 -0
- package/tasks/materialize.yml +14 -2
- package/vendor/directive-content/Taskfile.yml +235 -0
- package/vendor/directive-content/UPGRADING.md +1 -0
- package/vendor/directive-content/contracts/design-critique.md +1 -1
- package/vendor/directive-content/contracts/path-write-fence.md +6 -0
- package/vendor/directive-content/docs/deft-directive-disable.md +3 -3
- package/vendor/directive-content/docs/scope-provenance.md +4 -0
- package/vendor/directive-content/packs/lessons/lessons-pack-0.1.json +15 -0
- package/vendor/directive-content/packs/skills/skills-pack-0.1.json +2 -2
- package/vendor/directive-content/skills/deft-directive-design-critique/SKILL.md +1 -1
- package/vendor/directive-content/skills/deft-directive-release/SKILL.md +54 -1
- package/vendor/directive-content/tasks/materialize.cjs +106 -5
- package/vendor/directive-content/tasks/materialize.test.cjs +108 -0
- package/vendor/directive-content/tasks/materialize.yml +14 -2
- package/vendor/directive-core/dist/.tsbuildinfo +1 -1
- package/vendor/directive-core/dist/authz/classify.d.ts +18 -0
- package/vendor/directive-core/dist/authz/classify.d.ts.map +1 -1
- package/vendor/directive-core/dist/authz/classify.js +196 -14
- package/vendor/directive-core/dist/authz/classify.js.map +1 -1
- package/vendor/directive-core/dist/authz/evaluate.d.ts +5 -0
- package/vendor/directive-core/dist/authz/evaluate.d.ts.map +1 -1
- package/vendor/directive-core/dist/authz/evaluate.js +15 -5
- package/vendor/directive-core/dist/authz/evaluate.js.map +1 -1
- package/vendor/directive-core/dist/authz/templates.d.ts +2 -2
- package/vendor/directive-core/dist/authz/templates.d.ts.map +1 -1
- package/vendor/directive-core/dist/authz/templates.js +1 -0
- package/vendor/directive-core/dist/authz/templates.js.map +1 -1
- package/vendor/directive-core/dist/authz/types.d.ts +1 -1
- package/vendor/directive-core/dist/authz/types.d.ts.map +1 -1
- package/vendor/directive-core/dist/authz/types.js +2 -0
- package/vendor/directive-core/dist/authz/types.js.map +1 -1
- package/vendor/directive-core/dist/authz/verb-classification.d.ts.map +1 -1
- package/vendor/directive-core/dist/authz/verb-classification.js +30 -3
- package/vendor/directive-core/dist/authz/verb-classification.js.map +1 -1
- package/vendor/directive-core/dist/cache/fetch.d.ts.map +1 -1
- package/vendor/directive-core/dist/cache/fetch.js +50 -4
- package/vendor/directive-core/dist/cache/fetch.js.map +1 -1
- package/vendor/directive-core/dist/check/cached-orchestrator.d.ts.map +1 -1
- package/vendor/directive-core/dist/check/cached-orchestrator.js +101 -2
- package/vendor/directive-core/dist/check/cached-orchestrator.js.map +1 -1
- package/vendor/directive-core/dist/check/context.d.ts +199 -0
- package/vendor/directive-core/dist/check/context.d.ts.map +1 -1
- package/vendor/directive-core/dist/check/context.js +417 -2
- package/vendor/directive-core/dist/check/context.js.map +1 -1
- package/vendor/directive-core/dist/check/gate-lists.d.ts +42 -0
- package/vendor/directive-core/dist/check/gate-lists.d.ts.map +1 -1
- package/vendor/directive-core/dist/check/gate-lists.js +226 -0
- package/vendor/directive-core/dist/check/gate-lists.js.map +1 -1
- package/vendor/directive-core/dist/check/index.d.ts +1 -0
- package/vendor/directive-core/dist/check/index.d.ts.map +1 -1
- package/vendor/directive-core/dist/check/index.js +1 -0
- package/vendor/directive-core/dist/check/index.js.map +1 -1
- package/vendor/directive-core/dist/check/named-cause.d.ts.map +1 -1
- package/vendor/directive-core/dist/check/named-cause.js +1 -0
- package/vendor/directive-core/dist/check/named-cause.js.map +1 -1
- package/vendor/directive-core/dist/check/orchestrator.d.ts +1 -0
- package/vendor/directive-core/dist/check/orchestrator.d.ts.map +1 -1
- package/vendor/directive-core/dist/check/orchestrator.js +69 -4
- package/vendor/directive-core/dist/check/orchestrator.js.map +1 -1
- package/vendor/directive-core/dist/design-critique/arc-dest.d.ts +22 -5
- package/vendor/directive-core/dist/design-critique/arc-dest.d.ts.map +1 -1
- package/vendor/directive-core/dist/design-critique/arc-dest.js +61 -0
- package/vendor/directive-core/dist/design-critique/arc-dest.js.map +1 -1
- package/vendor/directive-core/dist/design-critique/run-posture.d.ts +7 -2
- package/vendor/directive-core/dist/design-critique/run-posture.d.ts.map +1 -1
- package/vendor/directive-core/dist/design-critique/run-posture.js +6 -1
- package/vendor/directive-core/dist/design-critique/run-posture.js.map +1 -1
- package/vendor/directive-core/dist/finish-loop/pr-finish-loop.d.ts +7 -0
- package/vendor/directive-core/dist/finish-loop/pr-finish-loop.d.ts.map +1 -1
- package/vendor/directive-core/dist/finish-loop/pr-finish-loop.js +42 -0
- package/vendor/directive-core/dist/finish-loop/pr-finish-loop.js.map +1 -1
- package/vendor/directive-core/dist/hooks/classify/host-session-identity.d.ts +15 -2
- package/vendor/directive-core/dist/hooks/classify/host-session-identity.d.ts.map +1 -1
- package/vendor/directive-core/dist/hooks/classify/host-session-identity.js +46 -5
- package/vendor/directive-core/dist/hooks/classify/host-session-identity.js.map +1 -1
- package/vendor/directive-core/dist/hooks/dispatcher.d.ts.map +1 -1
- package/vendor/directive-core/dist/hooks/dispatcher.js +235 -22
- package/vendor/directive-core/dist/hooks/dispatcher.js.map +1 -1
- package/vendor/directive-core/dist/hooks/scope.d.ts +38 -9
- package/vendor/directive-core/dist/hooks/scope.d.ts.map +1 -1
- package/vendor/directive-core/dist/hooks/scope.js +102 -16
- package/vendor/directive-core/dist/hooks/scope.js.map +1 -1
- package/vendor/directive-core/dist/hooks/shell-write-targets.d.ts +5 -0
- package/vendor/directive-core/dist/hooks/shell-write-targets.d.ts.map +1 -1
- package/vendor/directive-core/dist/hooks/shell-write-targets.js +18 -1
- package/vendor/directive-core/dist/hooks/shell-write-targets.js.map +1 -1
- package/vendor/directive-core/dist/init-deposit/host-hook-outer.d.ts +5 -0
- package/vendor/directive-core/dist/init-deposit/host-hook-outer.d.ts.map +1 -1
- package/vendor/directive-core/dist/init-deposit/host-hook-outer.js +22 -9
- package/vendor/directive-core/dist/init-deposit/host-hook-outer.js.map +1 -1
- package/vendor/directive-core/dist/init-deposit/scaffold.d.ts +8 -1
- package/vendor/directive-core/dist/init-deposit/scaffold.d.ts.map +1 -1
- package/vendor/directive-core/dist/init-deposit/scaffold.js +38 -4
- package/vendor/directive-core/dist/init-deposit/scaffold.js.map +1 -1
- package/vendor/directive-core/dist/install-health/cheap.d.ts +13 -1
- package/vendor/directive-core/dist/install-health/cheap.d.ts.map +1 -1
- package/vendor/directive-core/dist/install-health/cheap.js +39 -4
- package/vendor/directive-core/dist/install-health/cheap.js.map +1 -1
- package/vendor/directive-core/dist/install-health/constants.d.ts +18 -2
- package/vendor/directive-core/dist/install-health/constants.d.ts.map +1 -1
- package/vendor/directive-core/dist/install-health/constants.js +18 -2
- package/vendor/directive-core/dist/install-health/constants.js.map +1 -1
- package/vendor/directive-core/dist/install-health/index.d.ts +1 -1
- package/vendor/directive-core/dist/install-health/index.d.ts.map +1 -1
- package/vendor/directive-core/dist/install-health/index.js +1 -1
- package/vendor/directive-core/dist/install-health/index.js.map +1 -1
- package/vendor/directive-core/dist/policy/deft-directive-disable.d.ts +42 -5
- package/vendor/directive-core/dist/policy/deft-directive-disable.d.ts.map +1 -1
- package/vendor/directive-core/dist/policy/deft-directive-disable.js +71 -41
- package/vendor/directive-core/dist/policy/deft-directive-disable.js.map +1 -1
- package/vendor/directive-core/dist/policy/write-fence.d.ts +7 -0
- package/vendor/directive-core/dist/policy/write-fence.d.ts.map +1 -1
- package/vendor/directive-core/dist/policy/write-fence.js +81 -14
- package/vendor/directive-core/dist/policy/write-fence.js.map +1 -1
- package/vendor/directive-core/dist/pr-closeout-attestable/evaluate.d.ts +6 -1
- package/vendor/directive-core/dist/pr-closeout-attestable/evaluate.d.ts.map +1 -1
- package/vendor/directive-core/dist/pr-closeout-attestable/evaluate.js +24 -12
- package/vendor/directive-core/dist/pr-closeout-attestable/evaluate.js.map +1 -1
- package/vendor/directive-core/dist/pr-closeout-attestable/pr-head-assert.d.ts +68 -14
- package/vendor/directive-core/dist/pr-closeout-attestable/pr-head-assert.d.ts.map +1 -1
- package/vendor/directive-core/dist/pr-closeout-attestable/pr-head-assert.js +278 -47
- package/vendor/directive-core/dist/pr-closeout-attestable/pr-head-assert.js.map +1 -1
- package/vendor/directive-core/dist/pr-closing-keywords/main.d.ts +19 -0
- package/vendor/directive-core/dist/pr-closing-keywords/main.d.ts.map +1 -1
- package/vendor/directive-core/dist/pr-closing-keywords/main.js +31 -16
- package/vendor/directive-core/dist/pr-closing-keywords/main.js.map +1 -1
- package/vendor/directive-core/dist/pr-merge-readiness/compute.d.ts +8 -0
- package/vendor/directive-core/dist/pr-merge-readiness/compute.d.ts.map +1 -1
- package/vendor/directive-core/dist/pr-merge-readiness/compute.js +54 -2
- package/vendor/directive-core/dist/pr-merge-readiness/compute.js.map +1 -1
- package/vendor/directive-core/dist/pr-merge-readiness/gh.d.ts +7 -0
- package/vendor/directive-core/dist/pr-merge-readiness/gh.d.ts.map +1 -1
- package/vendor/directive-core/dist/pr-merge-readiness/gh.js +180 -49
- package/vendor/directive-core/dist/pr-merge-readiness/gh.js.map +1 -1
- package/vendor/directive-core/dist/pr-merge-readiness/main.d.ts +2 -0
- package/vendor/directive-core/dist/pr-merge-readiness/main.d.ts.map +1 -1
- package/vendor/directive-core/dist/pr-merge-readiness/main.js +1 -0
- package/vendor/directive-core/dist/pr-merge-readiness/main.js.map +1 -1
- package/vendor/directive-core/dist/pr-monitor/monitor.d.ts.map +1 -1
- package/vendor/directive-core/dist/pr-monitor/monitor.js +1 -0
- package/vendor/directive-core/dist/pr-monitor/monitor.js.map +1 -1
- package/vendor/directive-core/dist/pr-monitor/readiness.d.ts.map +1 -1
- package/vendor/directive-core/dist/pr-monitor/readiness.js +1 -0
- package/vendor/directive-core/dist/pr-monitor/readiness.js.map +1 -1
- package/vendor/directive-core/dist/pr-monitor/types.d.ts +2 -0
- package/vendor/directive-core/dist/pr-monitor/types.d.ts.map +1 -1
- package/vendor/directive-core/dist/pr-wait-mergeable/cascade.d.ts +6 -0
- package/vendor/directive-core/dist/pr-wait-mergeable/cascade.d.ts.map +1 -1
- package/vendor/directive-core/dist/pr-wait-mergeable/cascade.js +27 -0
- package/vendor/directive-core/dist/pr-wait-mergeable/cascade.js.map +1 -1
- package/vendor/directive-core/dist/pr-wait-mergeable/constants.d.ts +15 -0
- package/vendor/directive-core/dist/pr-wait-mergeable/constants.d.ts.map +1 -1
- package/vendor/directive-core/dist/pr-wait-mergeable/constants.js +18 -0
- package/vendor/directive-core/dist/pr-wait-mergeable/constants.js.map +1 -1
- package/vendor/directive-core/dist/pr-wait-mergeable/index.d.ts +2 -1
- package/vendor/directive-core/dist/pr-wait-mergeable/index.d.ts.map +1 -1
- package/vendor/directive-core/dist/pr-wait-mergeable/index.js +2 -1
- package/vendor/directive-core/dist/pr-wait-mergeable/index.js.map +1 -1
- package/vendor/directive-core/dist/pr-wait-mergeable/semantic-green.d.ts +81 -0
- package/vendor/directive-core/dist/pr-wait-mergeable/semantic-green.d.ts.map +1 -1
- package/vendor/directive-core/dist/pr-wait-mergeable/semantic-green.js +687 -3
- package/vendor/directive-core/dist/pr-wait-mergeable/semantic-green.js.map +1 -1
- package/vendor/directive-core/dist/pre-pr-controller/controller.d.ts +59 -1
- package/vendor/directive-core/dist/pre-pr-controller/controller.d.ts.map +1 -1
- package/vendor/directive-core/dist/pre-pr-controller/controller.js +155 -2
- package/vendor/directive-core/dist/pre-pr-controller/controller.js.map +1 -1
- package/vendor/directive-core/dist/pre-pr-controller/index.d.ts +1 -1
- package/vendor/directive-core/dist/pre-pr-controller/index.d.ts.map +1 -1
- package/vendor/directive-core/dist/pre-pr-controller/index.js +1 -1
- package/vendor/directive-core/dist/pre-pr-controller/index.js.map +1 -1
- package/vendor/directive-core/dist/pre-pr-controller/phases.d.ts +7 -0
- package/vendor/directive-core/dist/pre-pr-controller/phases.d.ts.map +1 -1
- package/vendor/directive-core/dist/pre-pr-controller/phases.js +11 -0
- package/vendor/directive-core/dist/pre-pr-controller/phases.js.map +1 -1
- package/vendor/directive-core/dist/pre-pr-controller/types.d.ts +1 -1
- package/vendor/directive-core/dist/pre-pr-controller/types.d.ts.map +1 -1
- package/vendor/directive-core/dist/pre-pr-controller/types.js.map +1 -1
- package/vendor/directive-core/dist/preflight-gh/pre-push.d.ts.map +1 -1
- package/vendor/directive-core/dist/preflight-gh/pre-push.js +58 -2
- package/vendor/directive-core/dist/preflight-gh/pre-push.js.map +1 -1
- package/vendor/directive-core/dist/product-first-done-gate/acceptance-resolver.d.ts +1 -1
- package/vendor/directive-core/dist/product-first-done-gate/acceptance-resolver.d.ts.map +1 -1
- package/vendor/directive-core/dist/product-first-done-gate/acceptance-resolver.js +1 -1
- package/vendor/directive-core/dist/product-first-done-gate/acceptance-resolver.js.map +1 -1
- package/vendor/directive-core/dist/product-first-done-gate/index.d.ts +1 -1
- package/vendor/directive-core/dist/product-first-done-gate/index.d.ts.map +1 -1
- package/vendor/directive-core/dist/product-first-done-gate/index.js +1 -1
- package/vendor/directive-core/dist/product-first-done-gate/index.js.map +1 -1
- package/vendor/directive-core/dist/release/gh.d.ts.map +1 -1
- package/vendor/directive-core/dist/release/gh.js +2 -1
- package/vendor/directive-core/dist/release/gh.js.map +1 -1
- package/vendor/directive-core/dist/release/pipeline.d.ts.map +1 -1
- package/vendor/directive-core/dist/release/pipeline.js +13 -1
- package/vendor/directive-core/dist/release/pipeline.js.map +1 -1
- package/vendor/directive-core/dist/release/preflight.d.ts +11 -0
- package/vendor/directive-core/dist/release/preflight.d.ts.map +1 -1
- package/vendor/directive-core/dist/release/preflight.js +65 -0
- package/vendor/directive-core/dist/release/preflight.js.map +1 -1
- package/vendor/directive-core/dist/release/types.d.ts +4 -0
- package/vendor/directive-core/dist/release/types.d.ts.map +1 -1
- package/vendor/directive-core/dist/release/version.d.ts +4 -2
- package/vendor/directive-core/dist/release/version.d.ts.map +1 -1
- package/vendor/directive-core/dist/release/version.js +4 -2
- package/vendor/directive-core/dist/release/version.js.map +1 -1
- package/vendor/directive-core/dist/release-publish/gh-api.d.ts.map +1 -1
- package/vendor/directive-core/dist/release-publish/gh-api.js +4 -2
- package/vendor/directive-core/dist/release-publish/gh-api.js.map +1 -1
- package/vendor/directive-core/dist/release-publish/main.d.ts.map +1 -1
- package/vendor/directive-core/dist/release-publish/main.js +15 -4
- package/vendor/directive-core/dist/release-publish/main.js.map +1 -1
- package/vendor/directive-core/dist/release-publish/pipeline.d.ts +11 -0
- package/vendor/directive-core/dist/release-publish/pipeline.d.ts.map +1 -1
- package/vendor/directive-core/dist/release-publish/pipeline.js +143 -2
- package/vendor/directive-core/dist/release-publish/pipeline.js.map +1 -1
- package/vendor/directive-core/dist/release-rollback/gh.d.ts.map +1 -1
- package/vendor/directive-core/dist/release-rollback/gh.js +2 -1
- package/vendor/directive-core/dist/release-rollback/gh.js.map +1 -1
- package/vendor/directive-core/dist/scope/delivery-evidence.d.ts +37 -0
- package/vendor/directive-core/dist/scope/delivery-evidence.d.ts.map +1 -1
- package/vendor/directive-core/dist/scope/delivery-evidence.js +106 -6
- package/vendor/directive-core/dist/scope/delivery-evidence.js.map +1 -1
- package/vendor/directive-core/dist/scope/transition.d.ts +3 -1
- package/vendor/directive-core/dist/scope/transition.d.ts.map +1 -1
- package/vendor/directive-core/dist/scope/transition.js +4 -0
- package/vendor/directive-core/dist/scope/transition.js.map +1 -1
- package/vendor/directive-core/dist/session/git.d.ts +21 -2
- package/vendor/directive-core/dist/session/git.d.ts.map +1 -1
- package/vendor/directive-core/dist/session/git.js +21 -4
- package/vendor/directive-core/dist/session/git.js.map +1 -1
- package/vendor/directive-core/dist/session/occupancy.d.ts +93 -6
- package/vendor/directive-core/dist/session/occupancy.d.ts.map +1 -1
- package/vendor/directive-core/dist/session/occupancy.js +215 -52
- package/vendor/directive-core/dist/session/occupancy.js.map +1 -1
- package/vendor/directive-core/dist/session/session-start.d.ts.map +1 -1
- package/vendor/directive-core/dist/session/session-start.js +5 -2
- package/vendor/directive-core/dist/session/session-start.js.map +1 -1
- package/vendor/directive-core/dist/swarm/dest-place.d.ts +1 -1
- package/vendor/directive-core/dist/swarm/dest-place.d.ts.map +1 -1
- package/vendor/directive-core/dist/swarm/dest-place.js +36 -41
- package/vendor/directive-core/dist/swarm/dest-place.js.map +1 -1
- package/vendor/directive-core/dist/swarm/finalize-owed.d.ts +14 -0
- package/vendor/directive-core/dist/swarm/finalize-owed.d.ts.map +1 -1
- package/vendor/directive-core/dist/swarm/finalize-owed.js +214 -48
- package/vendor/directive-core/dist/swarm/finalize-owed.js.map +1 -1
- package/vendor/directive-core/dist/swarm/launch.d.ts.map +1 -1
- package/vendor/directive-core/dist/swarm/launch.js +15 -4
- package/vendor/directive-core/dist/swarm/launch.js.map +1 -1
- package/vendor/directive-core/dist/swarm/worktree-pm-install.d.ts +49 -2
- package/vendor/directive-core/dist/swarm/worktree-pm-install.d.ts.map +1 -1
- package/vendor/directive-core/dist/swarm/worktree-pm-install.js +207 -12
- package/vendor/directive-core/dist/swarm/worktree-pm-install.js.map +1 -1
- package/vendor/directive-core/dist/swarm/worktrees-cli.d.ts +6 -0
- package/vendor/directive-core/dist/swarm/worktrees-cli.d.ts.map +1 -1
- package/vendor/directive-core/dist/swarm/worktrees-cli.js +79 -2
- package/vendor/directive-core/dist/swarm/worktrees-cli.js.map +1 -1
- package/vendor/directive-core/dist/swarm/worktrees.d.ts +12 -1
- package/vendor/directive-core/dist/swarm/worktrees.d.ts.map +1 -1
- package/vendor/directive-core/dist/swarm/worktrees.js +34 -26
- package/vendor/directive-core/dist/swarm/worktrees.js.map +1 -1
- package/vendor/directive-core/dist/verify-ac/evaluate.d.ts +52 -0
- package/vendor/directive-core/dist/verify-ac/evaluate.d.ts.map +1 -1
- package/vendor/directive-core/dist/verify-ac/evaluate.js +361 -1
- package/vendor/directive-core/dist/verify-ac/evaluate.js.map +1 -1
- package/vendor/directive-core/dist/verify-ac/index.d.ts +1 -1
- package/vendor/directive-core/dist/verify-ac/index.d.ts.map +1 -1
- package/vendor/directive-core/dist/verify-ac/index.js +1 -1
- package/vendor/directive-core/dist/verify-ac/index.js.map +1 -1
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
import { classifyMcpTool, classifyShellCommand, listShellOps } from "../policy/runtime-authority.js";
|
|
15
15
|
import type { AuthzOperation } from "./types.js";
|
|
16
16
|
export type AuthzClassifiedOp = AuthzOperation | "test" | "evidence" | "unknown" | "protected_store";
|
|
17
|
+
/** Kill-switch / permanent opt-out basenames agents must not plant (#3186 / #3039 / #6136). */
|
|
18
|
+
export declare const KILL_SWITCH_BASENAMES: readonly [".deft-directive-disable", ".no-deft-directive"];
|
|
19
|
+
/** True when a path basename is a kill-switch / permanent opt-out plant target (#6136). */
|
|
20
|
+
export declare function isKillSwitchPlantPath(pathish: string): boolean;
|
|
17
21
|
/** True when a recovered dest literal is a payload-relative protected path. */
|
|
18
22
|
export declare function destLiteralIsRelativeProtected(dest: string): boolean;
|
|
19
23
|
/**
|
|
@@ -23,6 +27,12 @@ export declare function destLiteralIsRelativeProtected(dest: string): boolean;
|
|
|
23
27
|
* symlink dest can still be realpath-resolved.
|
|
24
28
|
*/
|
|
25
29
|
export declare function harvestDestsOfWriteForRealpath(command: string): string[];
|
|
30
|
+
/**
|
|
31
|
+
* Shell write targeting `.deft-directive-disable` / `.no-deft-directive` (#3186 / #3039 / #3213 / #6136).
|
|
32
|
+
* Always-on grant-gated plant deny (not UAT-only). Includes symlink plant bins
|
|
33
|
+
* (`ln`/`link`/`mklink`) and quote-split-resistant basename checks.
|
|
34
|
+
*/
|
|
35
|
+
export declare function hasKillSwitchShellWrite(command: string, tokens?: readonly string[]): boolean;
|
|
26
36
|
/** Best-effort shell classification for UAT-sensitive ops beyond push/merge. */
|
|
27
37
|
export declare function classifyShellAuthzOps(command: string): AuthzClassifiedOp[];
|
|
28
38
|
/** Map a PreToolUse tool name + optional shell command to authz ops. */
|
|
@@ -33,6 +43,8 @@ export declare function classifyHookAuthzOps(input: {
|
|
|
33
43
|
readonly mcpArgsText?: string | null;
|
|
34
44
|
/** Payload root for #4188 harvest realpath. Blank/omitted skips harvest. */
|
|
35
45
|
readonly projectRoot?: string | null;
|
|
46
|
+
/** Direct Write/Edit target path for always-on kill-switch plant classify (#6136). */
|
|
47
|
+
readonly writePath?: string | null;
|
|
36
48
|
}): AuthzClassifiedOp[];
|
|
37
49
|
/**
|
|
38
50
|
* Public pin for #4709: Shell write targeting `.deft/authz/` or `.deft/approved-scope/`.
|
|
@@ -50,6 +62,12 @@ export declare function hasProtectedDestOfWriteUnknown(command: string): boolean
|
|
|
50
62
|
* realpath against an explicit payload root closes non-lexical symlink aliases.
|
|
51
63
|
*/
|
|
52
64
|
export declare function inactiveShellTargetsProtectedStore(command: string): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* First matched protected dest/token from the same classify/harvest routes that
|
|
67
|
+
* set protected_store (#5970 P3). Lexical dest-of-write first; #4188 realpath
|
|
68
|
+
* harvest when projectRoot is provided. Proven readers yield null.
|
|
69
|
+
*/
|
|
70
|
+
export declare function matchProtectedStoreShellDest(command: string, projectRoot?: string | null): string | null;
|
|
53
71
|
/** Re-export #2711 classifiers for composition docs/tests. */
|
|
54
72
|
export { classifyMcpTool, classifyShellCommand, listShellOps };
|
|
55
73
|
//# sourceMappingURL=classify.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"classify.d.ts","sourceRoot":"","sources":["../../src/authz/classify.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,YAAY,EAEb,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"classify.d.ts","sourceRoot":"","sources":["../../src/authz/classify.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,YAAY,EAEb,MAAM,gCAAgC,CAAC;AAKxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,MAAM,iBAAiB,GACzB,cAAc,GACd,MAAM,GACN,UAAU,GACV,SAAS,GACT,iBAAiB,CAAC;AA6KtB,+FAA+F;AAC/F,eAAO,MAAM,qBAAqB,4DAA6D,CAAC;AAEhG,2FAA2F;AAC3F,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAQ9D;AA61FD,+EAA+E;AAC/E,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAIpE;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CA4BxE;AAuaD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAK5F;AAo/BD,gFAAgF;AAChF,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB,EAAE,CAiH1E;AA+OD,wEAAwE;AACxE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE;IAC1C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,4EAA4E;IAC5E,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,sFAAsF;IACtF,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC,GAAG,iBAAiB,EAAE,CA2DtB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAI9D;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAYvE;AAED;;;;GAIG;AACH,wBAAgB,kCAAkC,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE3E;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAC1B,MAAM,GAAG,IAAI,CAkEf;AAED,8DAA8D;AAC9D,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import { isShellTool } from "../hooks/tools.js";
|
|
15
15
|
import { classifyMcpTool, classifyShellCommand, listShellOps, } from "../policy/runtime-authority.js";
|
|
16
|
-
import { shellCommandHasPayloadRootProtectedDestAfterRealpath } from "./protected-dest-realpath.js";
|
|
16
|
+
import { resolvedDestIsPayloadRootProtected, shellCommandHasPayloadRootProtectedDestAfterRealpath, } from "./protected-dest-realpath.js";
|
|
17
17
|
/**
|
|
18
18
|
* Split on whitespace without nested quantifiers (O(n)).
|
|
19
19
|
* Newlines become `;` segment breaks so compound lists like
|
|
@@ -185,8 +185,20 @@ const POLICY_AUTHORITY_MUTATORS = new Set([
|
|
|
185
185
|
"disable-directive",
|
|
186
186
|
"enable-directive",
|
|
187
187
|
]);
|
|
188
|
-
/** Kill-switch / permanent opt-out basenames agents must not plant
|
|
189
|
-
const KILL_SWITCH_BASENAMES = [".deft-directive-disable", ".no-deft-directive"];
|
|
188
|
+
/** Kill-switch / permanent opt-out basenames agents must not plant (#3186 / #3039 / #6136). */
|
|
189
|
+
export const KILL_SWITCH_BASENAMES = [".deft-directive-disable", ".no-deft-directive"];
|
|
190
|
+
/** True when a path basename is a kill-switch / permanent opt-out plant target (#6136). */
|
|
191
|
+
export function isKillSwitchPlantPath(pathish) {
|
|
192
|
+
// Lowercase so Windows / case-insensitive plants (`.DEFT-DIRECTIVE-DISABLE`) match.
|
|
193
|
+
const p = canonicalizePathish(pathish).toLowerCase();
|
|
194
|
+
if (p.length === 0)
|
|
195
|
+
return false;
|
|
196
|
+
for (const name of KILL_SWITCH_BASENAMES) {
|
|
197
|
+
if (p === name || p.endsWith(`/${name}`))
|
|
198
|
+
return true;
|
|
199
|
+
}
|
|
200
|
+
return false;
|
|
201
|
+
}
|
|
190
202
|
/**
|
|
191
203
|
* Dest-form writers #3529 harvest missed (#3545). Shared across downloader,
|
|
192
204
|
* archive-alt, positional, and indirect-write membership so a named-peer
|
|
@@ -1488,6 +1500,49 @@ function zipShellWithoutLineContinuations(command) {
|
|
|
1488
1500
|
}
|
|
1489
1501
|
return result;
|
|
1490
1502
|
}
|
|
1503
|
+
/**
|
|
1504
|
+
* True for executable command substitution (`$(…)` / backticks) outside single
|
|
1505
|
+
* quotes. Arithmetic `$((…))` and plain `$VAR` / `${VAR}` do not qualify —
|
|
1506
|
+
* those cannot run a nested writer before the outer argv0 (#5970 P1).
|
|
1507
|
+
*/
|
|
1508
|
+
function zipShellWordHasCommandSubstitution(raw) {
|
|
1509
|
+
let quote = null;
|
|
1510
|
+
for (let i = 0; i < raw.length; i++) {
|
|
1511
|
+
const char = raw[i];
|
|
1512
|
+
if (char === "\\" && quote !== "'" && i + 1 < raw.length) {
|
|
1513
|
+
i++;
|
|
1514
|
+
continue;
|
|
1515
|
+
}
|
|
1516
|
+
if (quote === null && char === "$" && raw[i + 1] === "'") {
|
|
1517
|
+
quote = "$'";
|
|
1518
|
+
i++;
|
|
1519
|
+
continue;
|
|
1520
|
+
}
|
|
1521
|
+
if (char === "'" || char === '"') {
|
|
1522
|
+
if (quote === null)
|
|
1523
|
+
quote = char;
|
|
1524
|
+
else if (quote === "$'" && char === "'")
|
|
1525
|
+
quote = null;
|
|
1526
|
+
else if (quote === char)
|
|
1527
|
+
quote = null;
|
|
1528
|
+
continue;
|
|
1529
|
+
}
|
|
1530
|
+
if (quote === "'" || quote === "$'")
|
|
1531
|
+
continue;
|
|
1532
|
+
if (char === "`")
|
|
1533
|
+
return true;
|
|
1534
|
+
if (char === "$" && raw[i + 1] === "(" && raw[i + 2] !== "(")
|
|
1535
|
+
return true;
|
|
1536
|
+
}
|
|
1537
|
+
return false;
|
|
1538
|
+
}
|
|
1539
|
+
function argvHasCommandSubstitution(words, execIndex) {
|
|
1540
|
+
for (let i = execIndex + 1; i < words.length; i++) {
|
|
1541
|
+
if (zipShellWordHasCommandSubstitution(words[i]))
|
|
1542
|
+
return true;
|
|
1543
|
+
}
|
|
1544
|
+
return false;
|
|
1545
|
+
}
|
|
1491
1546
|
/** True for shell expansion syntax outside single quotes and not escaped. */
|
|
1492
1547
|
function zipShellWordHasExpansion(raw) {
|
|
1493
1548
|
let quote = null;
|
|
@@ -2194,6 +2249,22 @@ const READ_ONLY_PROOF_BINS = new Set([
|
|
|
2194
2249
|
"gawk",
|
|
2195
2250
|
"nawk",
|
|
2196
2251
|
]);
|
|
2252
|
+
/**
|
|
2253
|
+
* #5970 Approach1 existence probes. Sole classify carve for relative dest-of-write
|
|
2254
|
+
* and #4188 harvest (no second harvest-only skip list). test/[ ignore POSIX -o OR;
|
|
2255
|
+
* dir/Get-ChildItem still refuse sort/awk-style output-dest flags.
|
|
2256
|
+
*/
|
|
2257
|
+
const EXISTENCE_PROBE_READ_ONLY_BINS = new Set([
|
|
2258
|
+
"test-path",
|
|
2259
|
+
"test",
|
|
2260
|
+
"[",
|
|
2261
|
+
"get-item",
|
|
2262
|
+
"gi",
|
|
2263
|
+
"dir",
|
|
2264
|
+
"get-childitem",
|
|
2265
|
+
"gci",
|
|
2266
|
+
]);
|
|
2267
|
+
const EXISTENCE_PROBE_IGNORE_OUTPUT_DEST_FLAGS = new Set(["test", "["]);
|
|
2197
2268
|
const READ_ONLY_PROOF_OUTPUT_DEST_FLAGS = new Set(["-o", "--output", "--pretty-print"]);
|
|
2198
2269
|
function argvHasOutputDestFlag(words, execIndex) {
|
|
2199
2270
|
for (let i = execIndex + 1; i < words.length; i++) {
|
|
@@ -2281,6 +2352,9 @@ function isProvenReadOnlyArgv(words, execIndex) {
|
|
|
2281
2352
|
const literal = argv0Literal(words, execIndex);
|
|
2282
2353
|
if (literal === null || argv0IsPathQualified(literal))
|
|
2283
2354
|
return false;
|
|
2355
|
+
// Nested writers in argv (`$(mkfile …)` / backticks) void the reader proof (#5970 P1).
|
|
2356
|
+
if (argvHasCommandSubstitution(words, execIndex))
|
|
2357
|
+
return false;
|
|
2284
2358
|
const name = writeBinName(literal);
|
|
2285
2359
|
if (isArStyleArchiveBin(name)) {
|
|
2286
2360
|
const rawMode = words[execIndex + 1];
|
|
@@ -2290,6 +2364,14 @@ function isProvenReadOnlyArgv(words, execIndex) {
|
|
|
2290
2364
|
return (/^[abcdfilmnpqrstuvx]+$/.test(mode) &&
|
|
2291
2365
|
![...mode].some((letter) => ARCHIVE_WRITE_OPERATIONS.has(letter)));
|
|
2292
2366
|
}
|
|
2367
|
+
if (EXISTENCE_PROBE_READ_ONLY_BINS.has(name)) {
|
|
2368
|
+
// Visible refuse for nested writers (Greptile #5970 P1); also gated above.
|
|
2369
|
+
if (argvHasCommandSubstitution(words, execIndex))
|
|
2370
|
+
return false;
|
|
2371
|
+
if (EXISTENCE_PROBE_IGNORE_OUTPUT_DEST_FLAGS.has(name))
|
|
2372
|
+
return true;
|
|
2373
|
+
return !argvHasOutputDestFlag(words, execIndex);
|
|
2374
|
+
}
|
|
2293
2375
|
if (READ_ONLY_PROOF_BINS.has(name)) {
|
|
2294
2376
|
if (name === "sort" || name === "awk" || name === "gawk" || name === "nawk") {
|
|
2295
2377
|
return !argvHasOutputDestFlag(words, execIndex);
|
|
@@ -3452,7 +3534,7 @@ function sqlite3MetaDest(raw, next) {
|
|
|
3452
3534
|
return null;
|
|
3453
3535
|
}
|
|
3454
3536
|
function pathishMentionsKillSwitch(pathish) {
|
|
3455
|
-
const p = canonicalizePathish(pathish);
|
|
3537
|
+
const p = canonicalizePathish(pathish).toLowerCase();
|
|
3456
3538
|
for (const name of KILL_SWITCH_BASENAMES) {
|
|
3457
3539
|
if (p === name || p.endsWith(`/${name}`) || p.includes(name)) {
|
|
3458
3540
|
return true;
|
|
@@ -3461,11 +3543,18 @@ function pathishMentionsKillSwitch(pathish) {
|
|
|
3461
3543
|
return false;
|
|
3462
3544
|
}
|
|
3463
3545
|
/**
|
|
3464
|
-
* Shell write targeting `.deft-directive-disable` / `.no-deft-directive` (#3186 / #3039 / #3213).
|
|
3465
|
-
*
|
|
3466
|
-
*
|
|
3546
|
+
* Shell write targeting `.deft-directive-disable` / `.no-deft-directive` (#3186 / #3039 / #3213 / #6136).
|
|
3547
|
+
* Always-on grant-gated plant deny (not UAT-only). Includes symlink plant bins
|
|
3548
|
+
* (`ln`/`link`/`mklink`) and quote-split-resistant basename checks.
|
|
3467
3549
|
*/
|
|
3468
|
-
function hasKillSwitchShellWrite(command, tokens) {
|
|
3550
|
+
export function hasKillSwitchShellWrite(command, tokens) {
|
|
3551
|
+
const cmd = command.trim();
|
|
3552
|
+
if (cmd.length === 0)
|
|
3553
|
+
return false;
|
|
3554
|
+
const resolvedTokens = tokens ?? shellTokens(cmd);
|
|
3555
|
+
return hasKillSwitchShellWriteInner(cmd, resolvedTokens);
|
|
3556
|
+
}
|
|
3557
|
+
function hasKillSwitchShellWriteInner(command, tokens) {
|
|
3469
3558
|
const lower = command.toLowerCase().replace(/\\/g, "/");
|
|
3470
3559
|
// Quote-stripped form so `'.deft'-directive-disable`-class splits still match (#3213).
|
|
3471
3560
|
const stripped = lower.replace(/['"]/g, "");
|
|
@@ -3505,6 +3594,8 @@ function hasKillSwitchShellWrite(command, tokens) {
|
|
|
3505
3594
|
}
|
|
3506
3595
|
// Write/destructive + symlink plant + archive/alt-write bins with a kill-switch path
|
|
3507
3596
|
// argument (#3213 ln/link/mklink; #3245 tar/axel/rclone/socat residual).
|
|
3597
|
+
// echo/printf/type are stdout-only without a redirect; redirect dests are handled
|
|
3598
|
+
// above so bare `echo .deft-directive-disable` stays non-plant (#6136 Greptile P2).
|
|
3508
3599
|
const killWriteBins = new Set([
|
|
3509
3600
|
...INDIRECT_WRITE_BINS,
|
|
3510
3601
|
...SYMLINK_PLANT_BINS,
|
|
@@ -3512,9 +3603,6 @@ function hasKillSwitchShellWrite(command, tokens) {
|
|
|
3512
3603
|
"touch",
|
|
3513
3604
|
"new-item",
|
|
3514
3605
|
"ni",
|
|
3515
|
-
"echo",
|
|
3516
|
-
"printf",
|
|
3517
|
-
"type",
|
|
3518
3606
|
]);
|
|
3519
3607
|
for (let ti = 0; ti < tokens.length; ti++) {
|
|
3520
3608
|
const binTok = normalizeToken(tokens[ti]);
|
|
@@ -4512,7 +4600,8 @@ export function classifyShellAuthzOps(command) {
|
|
|
4512
4600
|
found.add("settings");
|
|
4513
4601
|
if (commandHasAuthzDirShellWrite(cmd, tokens))
|
|
4514
4602
|
found.add("settings");
|
|
4515
|
-
// #3186: kill-switch plant + policy authority mutators → settings
|
|
4603
|
+
// #3186 / #6136: kill-switch plant + policy authority mutators → settings
|
|
4604
|
+
// (always-on grant-gated via dispatcher; not UAT-only).
|
|
4516
4605
|
if (hasKillSwitchShellWrite(cmd, tokens))
|
|
4517
4606
|
found.add("settings");
|
|
4518
4607
|
if (hasPolicyAuthorityMutator(tokens))
|
|
@@ -4729,7 +4818,11 @@ function isCargoArgv0(name) {
|
|
|
4729
4818
|
const EMPTY_OPS_DEST_ASSIGNMENT_KEYS = new Set(["of"]);
|
|
4730
4819
|
function emptyOpsSegmentIsReadShaped(tokens, index) {
|
|
4731
4820
|
const first = firstCommandBin(segmentSliceAround(tokens, index));
|
|
4732
|
-
|
|
4821
|
+
// #5970: POSIX test/[ use -f/-o as predicates, not EMPTY_OPS_DEST_FLAGS writers.
|
|
4822
|
+
// dir/Get-ChildItem stay off this carve so -o/--output dest plants still deny.
|
|
4823
|
+
return (READ_SHAPED_FILE_FLAG_BINS.has(first) ||
|
|
4824
|
+
DEST_ASSIGNMENT_NON_WRITER_FIRST_BINS.has(first) ||
|
|
4825
|
+
EXISTENCE_PROBE_IGNORE_OUTPUT_DEST_FLAGS.has(first));
|
|
4733
4826
|
}
|
|
4734
4827
|
function destFlagOperandIsProtectedSettings(tokens) {
|
|
4735
4828
|
for (let i = 0; i < tokens.length; i++) {
|
|
@@ -4813,8 +4906,17 @@ function hasWriteShapedProtectedSettingsDest(command, tokens) {
|
|
|
4813
4906
|
/** Map a PreToolUse tool name + optional shell command to authz ops. */
|
|
4814
4907
|
export function classifyHookAuthzOps(input) {
|
|
4815
4908
|
const { toolName, shellCommand, isDirectWrite } = input;
|
|
4816
|
-
if (isDirectWrite)
|
|
4909
|
+
if (isDirectWrite) {
|
|
4910
|
+
// Prefer-A Bound #6136: kill-switch Write/Edit is `settings` (always-on grant
|
|
4911
|
+
// gate). Keep off bare `edit` — isProtectedStoreEditDest treats the flag
|
|
4912
|
+
// basenames themselves as protected and would deny before the grant check.
|
|
4913
|
+
// Symlink plants into `.deft/authz/` are denied in dispatcher via realpath
|
|
4914
|
+
// (not this op class alone).
|
|
4915
|
+
const writePath = (input.writePath ?? "").trim();
|
|
4916
|
+
if (writePath.length > 0 && isKillSwitchPlantPath(writePath))
|
|
4917
|
+
return ["settings"];
|
|
4817
4918
|
return ["edit"];
|
|
4919
|
+
}
|
|
4818
4920
|
const lower = toolName.toLowerCase();
|
|
4819
4921
|
// Shared catalog (#4041 / #3987). A second name list missed Grok monitor.
|
|
4820
4922
|
if (isShellTool(toolName)) {
|
|
@@ -4892,6 +4994,86 @@ export function hasProtectedDestOfWriteUnknown(command) {
|
|
|
4892
4994
|
export function inactiveShellTargetsProtectedStore(command) {
|
|
4893
4995
|
return hasAuthzDirShellWrite(command) || hasProtectedDestOfWriteUnknown(command);
|
|
4894
4996
|
}
|
|
4997
|
+
/**
|
|
4998
|
+
* First matched protected dest/token from the same classify/harvest routes that
|
|
4999
|
+
* set protected_store (#5970 P3). Lexical dest-of-write first; #4188 realpath
|
|
5000
|
+
* harvest when projectRoot is provided. Proven readers yield null.
|
|
5001
|
+
*/
|
|
5002
|
+
export function matchProtectedStoreShellDest(command, projectRoot) {
|
|
5003
|
+
const cmd = command.trim();
|
|
5004
|
+
if (cmd.length === 0)
|
|
5005
|
+
return null;
|
|
5006
|
+
for (const segment of zipStyleCommandSegments(cmd)) {
|
|
5007
|
+
if (isProvenReadOnlyArgv(segment.words, segment.execIndex))
|
|
5008
|
+
continue;
|
|
5009
|
+
const jarDest = jarCreateArchiveDest(segment.words, segment.execIndex);
|
|
5010
|
+
if (jarDest !== null && isRelativePayloadProtectedDest(jarDest))
|
|
5011
|
+
return jarDest;
|
|
5012
|
+
const archiveDest = firstArchiveOperandDest(segment.words, segment.execIndex);
|
|
5013
|
+
if (archiveDest !== null && isRelativePayloadProtectedDest(archiveDest))
|
|
5014
|
+
return archiveDest;
|
|
5015
|
+
for (const doubleColonDest of doubleColonCreateArchiveDests(segment.words, segment.execIndex)) {
|
|
5016
|
+
if (isRelativePayloadProtectedDest(doubleColonDest))
|
|
5017
|
+
return doubleColonDest;
|
|
5018
|
+
}
|
|
5019
|
+
for (const dest of harvestInterpreterPayloadDests(segment.words, segment.execIndex)) {
|
|
5020
|
+
if (isRelativePayloadProtectedDest(dest))
|
|
5021
|
+
return dest;
|
|
5022
|
+
}
|
|
5023
|
+
const name = argv0BareName(segment.words, segment.execIndex);
|
|
5024
|
+
if (name !== null) {
|
|
5025
|
+
for (const dest of harvestUnknownDestFlagValues(segment.words, segment.execIndex, name)) {
|
|
5026
|
+
if (isRelativePayloadProtectedDest(dest))
|
|
5027
|
+
return dest;
|
|
5028
|
+
}
|
|
5029
|
+
}
|
|
5030
|
+
const last = lastDestOfWritePositional(segment.words, segment.execIndex);
|
|
5031
|
+
if (last !== null && isRelativePayloadProtectedDest(last)) {
|
|
5032
|
+
const lit = zipShellWordLiteral(last);
|
|
5033
|
+
return lit ?? last;
|
|
5034
|
+
}
|
|
5035
|
+
}
|
|
5036
|
+
const tokens = shellTokens(cmd);
|
|
5037
|
+
if (hasWriteShapedProtectedSettingsDest(cmd, tokens)) {
|
|
5038
|
+
// Prefer redirect destinations over earlier read operands (#5970 P2).
|
|
5039
|
+
for (let i = 0; i < cmd.length; i++) {
|
|
5040
|
+
if (cmd[i] !== ">")
|
|
5041
|
+
continue;
|
|
5042
|
+
const dest = redirectDestSlice(cmd.toLowerCase().replace(/\\/g, "/"), i).trim();
|
|
5043
|
+
if (dest.length > 0 && pathishIsProtectedMutationDest(dest))
|
|
5044
|
+
return dest;
|
|
5045
|
+
}
|
|
5046
|
+
for (const raw of tokens) {
|
|
5047
|
+
const pathish = pathishToken(raw);
|
|
5048
|
+
if (pathishIsProtectedMutationDest(pathish))
|
|
5049
|
+
return pathish;
|
|
5050
|
+
}
|
|
5051
|
+
}
|
|
5052
|
+
if (commandHasAuthzDirShellWrite(cmd, tokens)) {
|
|
5053
|
+
for (const raw of tokens) {
|
|
5054
|
+
const pathish = pathishToken(raw);
|
|
5055
|
+
if (pathishIsAuthzDir(pathish) || pathishIsApprovedScopeDir(pathish))
|
|
5056
|
+
return pathish;
|
|
5057
|
+
}
|
|
5058
|
+
}
|
|
5059
|
+
if (hasKillSwitchShellWrite(cmd, tokens)) {
|
|
5060
|
+
for (const raw of tokens) {
|
|
5061
|
+
const pathish = pathishToken(raw);
|
|
5062
|
+
if (pathishMentionsKillSwitch(pathish))
|
|
5063
|
+
return pathish;
|
|
5064
|
+
}
|
|
5065
|
+
}
|
|
5066
|
+
const harvestRoot = (projectRoot ?? "").trim();
|
|
5067
|
+
if (harvestRoot.length > 0) {
|
|
5068
|
+
for (const dest of harvestDestsOfWriteForRealpath(cmd)) {
|
|
5069
|
+
if (destLiteralIsRelativeProtected(dest))
|
|
5070
|
+
continue;
|
|
5071
|
+
if (resolvedDestIsPayloadRootProtected(harvestRoot, dest))
|
|
5072
|
+
return dest;
|
|
5073
|
+
}
|
|
5074
|
+
}
|
|
5075
|
+
return null;
|
|
5076
|
+
}
|
|
4895
5077
|
/** Re-export #2711 classifiers for composition docs/tests. */
|
|
4896
5078
|
export { classifyMcpTool, classifyShellCommand, listShellOps };
|
|
4897
5079
|
//# sourceMappingURL=classify.js.map
|