@sema-agent/core 7.54.1 → 7.56.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 +950 -0
- package/dist/agents/agent-transcript-tool.js +2 -1
- package/dist/agents/builtin-agents.d.ts +12 -14
- package/dist/agents/cascade.js +1 -1
- package/dist/agents/cc-peer-directory.d.ts +36 -0
- package/dist/agents/cc-peer-directory.js +139 -0
- package/dist/agents/cc-peer-wire.d.ts +105 -0
- package/dist/agents/cc-peer-wire.js +98 -0
- package/dist/agents/cc-uds-peer-channel.d.ts +40 -0
- package/dist/agents/cc-uds-peer-channel.js +457 -0
- package/dist/agents/child-model-seat.d.ts +0 -11
- package/dist/agents/child-model-seat.js +0 -3
- package/dist/agents/cross-session-envelope.d.ts +4 -1
- package/dist/agents/cross-session-envelope.js +8 -1
- package/dist/agents/cross-session-judge.d.ts +2 -2
- package/dist/agents/list-agents-tool.d.ts +3 -1
- package/dist/agents/list-agents-tool.js +9 -8
- package/dist/agents/observer.d.ts +4 -5
- package/dist/agents/observer.js +2 -1
- package/dist/agents/peer-admission.d.ts +6 -0
- package/dist/agents/peer-admission.js +4 -1
- package/dist/agents/peer-directory.d.ts +65 -13
- package/dist/agents/peer-directory.js +90 -25
- package/dist/agents/peer-notices.d.ts +1 -1
- package/dist/agents/peer-session-drain.d.ts +3 -1
- package/dist/agents/peer-session-drain.js +3 -2
- package/dist/agents/read-inbox-tool.js +2 -1
- package/dist/agents/repair-loop.js +2 -2
- package/dist/agents/retain-ledger.d.ts +1 -1
- package/dist/agents/roster-store.d.ts +1 -1
- package/dist/agents/send-message-tool.d.ts +10 -0
- package/dist/agents/send-message-tool.js +37 -8
- package/dist/agents/subagent.d.ts +39 -82
- package/dist/agents/subagent.js +109 -106
- package/dist/agents/tool-filter.d.ts +31 -46
- package/dist/agents/tool-filter.js +13 -33
- package/dist/agents/verify.d.ts +6 -5
- package/dist/agents/verify.js +3 -3
- package/dist/brain/anthropic.js +43 -81
- package/dist/brain/errors.d.ts +15 -0
- package/dist/brain/errors.js +10 -0
- package/dist/brain/media-degrade.d.ts +18 -7
- package/dist/brain/media-degrade.js +13 -2
- package/dist/brain/model-capability.d.ts +37 -0
- package/dist/brain/model-capability.js +34 -0
- package/dist/brain/model-presets.d.ts +6 -12
- package/dist/brain/model-presets.js +1 -6
- package/dist/brain/open-responses.js +27 -35
- package/dist/brain/openai.js +30 -98
- package/dist/brain/provider-dialect.d.ts +39 -3
- package/dist/brain/provider-dialect.js +28 -0
- package/dist/brain/reasoning-request.d.ts +96 -0
- package/dist/brain/reasoning-request.js +174 -0
- package/dist/brain/reasoning.d.ts +12 -12
- package/dist/brain/reasoning.js +4 -3
- package/dist/brain/request-params.d.ts +62 -9
- package/dist/brain/request-params.js +42 -7
- package/dist/brain/retry.d.ts +1 -1
- package/dist/brain/route-adjudicator.d.ts +15 -0
- package/dist/brain/route-adjudicator.js +15 -0
- package/dist/brain/status-sink.d.ts +20 -0
- package/dist/brain/status-sink.js +7 -0
- package/dist/brain/stream-engine.js +6 -5
- package/dist/brain/stream-shared.d.ts +1 -1
- package/dist/core/a2a.d.ts +2 -1
- package/dist/core/a2a.js +19 -13
- package/dist/core/advisor-verdict.d.ts +120 -0
- package/dist/core/advisor-verdict.js +92 -0
- package/dist/core/agent-definition.d.ts +17 -8
- package/dist/core/allow-entry.d.ts +69 -36
- package/dist/core/allow-entry.js +81 -52
- package/dist/core/allow-rule-shadow.d.ts +10 -3
- package/dist/core/approval-object.d.ts +2 -1
- package/dist/core/approval-object.js +6 -6
- package/dist/core/ask-origin.d.ts +127 -29
- package/dist/core/ask-origin.js +87 -25
- package/dist/core/ask-question.d.ts +51 -8
- package/dist/core/ask-question.js +12 -7
- package/dist/core/ask-unresolvable-notice.d.ts +8 -3
- package/dist/core/ask-unresolvable-notice.js +16 -2
- package/dist/core/auto-compaction.d.ts +11 -8
- package/dist/core/auto-compaction.js +4 -2
- package/dist/core/auto-mode-arming.d.ts +2 -2
- package/dist/core/auto-mode-defaults.d.ts +8 -8
- package/dist/core/auto-mode-prompt-assets.d.ts +3 -3
- package/dist/core/auto-mode-prompt.d.ts +1 -1
- package/dist/core/auto-mode.d.ts +17 -9
- package/dist/core/auto-mode.js +9 -6
- package/dist/core/background-agent-store.d.ts +3 -3
- package/dist/core/canonical-json.d.ts +1 -1
- package/dist/core/canonical-json.js +2 -2
- package/dist/core/checkpoint-generation.d.ts +53 -0
- package/dist/core/checkpoint-generation.js +35 -0
- package/dist/core/checkpoint-queries.d.ts +180 -0
- package/dist/core/checkpoint-queries.js +272 -0
- package/dist/core/checkpoint-requirements.d.ts +19 -4
- package/dist/core/checkpoint-requirements.js +8 -14
- package/dist/core/checkpoint-store.d.ts +165 -72
- package/dist/core/checkpoint-store.js +79 -82
- package/dist/core/child-clamp-seats.d.ts +6 -0
- package/dist/core/child-clamp-seats.js +3 -16
- package/dist/core/compliance.d.ts +2 -2
- package/dist/core/context-edit.d.ts +6 -7
- package/dist/core/cross-boundary-taint.d.ts +11 -4
- package/dist/core/cross-boundary-taint.js +3 -3
- package/dist/core/decision-receipt.d.ts +37 -3
- package/dist/core/decision-receipt.js +19 -19
- package/dist/core/delegation-not-started.d.ts +6 -0
- package/dist/core/delegation-not-started.js +17 -0
- package/dist/core/effective-path-target.d.ts +1 -1
- package/dist/core/engine-attestation.d.ts +93 -0
- package/dist/core/engine-attestation.js +70 -0
- package/dist/core/engine-capabilities.d.ts +4 -1
- package/dist/core/engine-capabilities.js +1 -1
- package/dist/core/engine-notice.d.ts +45 -12
- package/dist/core/exec-output-tail.d.ts +1 -1
- package/dist/core/file-history-retention.d.ts +1 -1
- package/dist/core/file-history-store.d.ts +147 -21
- package/dist/core/file-history-store.js +58 -32
- package/dist/core/gate-fold.d.ts +1 -1
- package/dist/core/gate-fold.js +24 -11
- package/dist/core/gate-lanes.js +81 -68
- package/dist/core/gate-outcome.d.ts +40 -6
- package/dist/core/gate-outcome.js +56 -0
- package/dist/core/governance-codes.d.ts +17 -3
- package/dist/core/governance-codes.js +16 -0
- package/dist/core/hands-band.d.ts +1 -1
- package/dist/core/hooks.d.ts +21 -20
- package/dist/core/hooks.js +3 -1
- package/dist/core/host-floor.d.ts +128 -0
- package/dist/core/host-floor.js +206 -0
- package/dist/core/host-target.d.ts +84 -0
- package/dist/core/host-target.js +92 -0
- package/dist/core/image-downsample.d.ts +1 -1
- package/dist/core/lsp-diagnostics.d.ts +4 -4
- package/dist/core/lsp.d.ts +3 -3
- package/dist/core/mailbox-store.d.ts +4 -0
- package/dist/core/mcp-connection-pool.d.ts +18 -2
- package/dist/core/mcp-connection-pool.js +53 -6
- package/dist/core/mcp-failure.d.ts +23 -4
- package/dist/core/mcp-failure.js +26 -11
- package/dist/core/mcp-listing-drift.d.ts +10 -0
- package/dist/core/mcp-listing-drift.js +6 -0
- package/dist/core/mcp-server-link.d.ts +173 -0
- package/dist/core/mcp-server-link.js +127 -0
- package/dist/core/mcp-server-spec.d.ts +4 -2
- package/dist/core/mcp-session-end.d.ts +26 -0
- package/dist/core/mcp-session-end.js +29 -0
- package/dist/core/mcp-startup-request.d.ts +17 -0
- package/dist/core/mcp-startup-request.js +17 -0
- package/dist/core/mcp.d.ts +17 -13
- package/dist/core/mcp.js +240 -189
- package/dist/core/media-byte-cap.d.ts +1 -1
- package/dist/core/memory-engine/delegation-settlement.js +15 -24
- package/dist/core/memory-engine/engine.d.ts +9 -9
- package/dist/core/memory-engine/engine.js +4 -4
- package/dist/core/memory-engine/layout.d.ts +60 -8
- package/dist/core/memory-engine/layout.js +65 -6
- package/dist/core/memory-engine/provenance-wording.d.ts +1 -1
- package/dist/core/memory-engine/tools.js +4 -1
- package/dist/core/mode-policy.d.ts +1 -1
- package/dist/core/model-seat.d.ts +10 -3
- package/dist/core/mods/classic-events.d.ts +67 -0
- package/dist/core/mods/classic-events.js +1 -0
- package/dist/core/mods/dollar.d.ts +13 -0
- package/dist/core/mods/extension-call.d.ts +31 -0
- package/dist/core/mods/extension-call.js +43 -0
- package/dist/core/mods/kernel/dispatch.d.ts +20 -3
- package/dist/core/mods/kernel/dispatch.js +140 -69
- package/dist/core/mods/kernel/events.d.ts +47 -11
- package/dist/core/mods/kernel/events.js +66 -42
- package/dist/core/mods/kernel/index.d.ts +4 -4
- package/dist/core/mods/kernel/index.js +2 -2
- package/dist/core/mods/kernel/receive.d.ts +39 -5
- package/dist/core/mods/kernel/receive.js +290 -17
- package/dist/core/mods/kernel/registration.d.ts +33 -2
- package/dist/core/mods/kernel/registration.js +6 -7
- package/dist/core/mods/kernel/site-rules.d.ts +44 -16
- package/dist/core/mods/kernel/site-rules.js +24 -42
- package/dist/core/mods/spec-seats.d.ts +69 -0
- package/dist/core/mods/spec-seats.js +114 -0
- package/dist/core/mods/stations.d.ts +28 -8
- package/dist/core/mods/stations.js +29 -13
- package/dist/core/mods/tool-call.d.ts +79 -0
- package/dist/core/mods/tool-call.js +152 -0
- package/dist/core/namespaced-rule-name.d.ts +44 -24
- package/dist/core/namespaced-rule-name.js +50 -43
- package/dist/core/output-style.d.ts +1 -1
- package/dist/core/param-rule-reach.d.ts +15 -0
- package/dist/core/param-rule-reach.js +30 -0
- package/dist/core/parent-spec-seat.d.ts +13 -1
- package/dist/core/parent-spec-seat.js +6 -0
- package/dist/core/park-selfcheck.js +1 -0
- package/dist/core/pause-registry.d.ts +16 -5
- package/dist/core/pause-registry.js +6 -2
- package/dist/core/peer-channel.d.ts +70 -0
- package/dist/core/peer-channel.js +1 -0
- package/dist/core/permission-rule-consent.d.ts +30 -5
- package/dist/core/permission-rule-consent.js +147 -50
- package/dist/core/permission-rule-model.d.ts +245 -65
- package/dist/core/permission-rule-model.js +421 -107
- package/dist/core/permission-rule-org.d.ts +6 -2
- package/dist/core/permission-rule-org.js +7 -3
- package/dist/core/permission-rule-provider.d.ts +6 -2
- package/dist/core/permission-rule-provider.js +41 -11
- package/dist/core/permission-rule-store.d.ts +22 -26
- package/dist/core/permission-rule-store.js +12 -6
- package/dist/core/permission-rule-sync.d.ts +11 -2
- package/dist/core/permission-rule-sync.js +11 -3
- package/dist/core/permission-rule-syntax.d.ts +5 -4
- package/dist/core/permission-rule-syntax.js +2 -2
- package/dist/core/permission-rules.d.ts +53 -15
- package/dist/core/permission-rules.js +125 -100
- package/dist/core/persisted-rule-arms.d.ts +6 -4
- package/dist/core/persisted-rule-arms.js +10 -12
- package/dist/core/present-plan-tool.js +3 -1
- package/dist/core/principal-name.d.ts +20 -0
- package/dist/core/principal-name.js +22 -0
- package/dist/core/prompt-section-seat.js +4 -6
- package/dist/core/protocol-http-auth.d.ts +26 -5
- package/dist/core/protocol-http-auth.js +137 -4
- package/dist/core/protocol-naming.d.ts +2 -2
- package/dist/core/read-only-shell-table.d.ts +1 -1
- package/dist/core/read-only-shell.d.ts +1 -1
- package/dist/core/retired-keys.d.ts +16 -0
- package/dist/core/retired-keys.js +16 -4
- package/dist/core/rewrite-rejudge.d.ts +60 -0
- package/dist/core/rewrite-rejudge.js +36 -0
- package/dist/core/roles.d.ts +34 -3
- package/dist/core/roles.js +66 -53
- package/dist/core/rule-lane-reads.d.ts +20 -15
- package/dist/core/rule-lane-reads.js +45 -17
- package/dist/core/rule-offer-read.d.ts +53 -0
- package/dist/core/rule-offer-read.js +146 -0
- package/dist/core/rule-owner.d.ts +46 -0
- package/dist/core/rule-owner.js +29 -0
- package/dist/core/runner/advisor-instructions.d.ts +70 -0
- package/dist/core/runner/advisor-instructions.js +61 -0
- package/dist/core/runner/advisor-tool.d.ts +33 -0
- package/dist/core/runner/advisor-tool.js +112 -0
- package/dist/core/runner/announce-once-ledger.d.ts +18 -26
- package/dist/core/runner/announce-once-ledger.js +19 -46
- package/dist/core/runner/approval-feedback.js +6 -3
- package/dist/core/runner/assemble-result.d.ts +2 -1
- package/dist/core/runner/assemble-result.js +1 -1
- package/dist/core/runner/call-hook-stations.d.ts +3 -2
- package/dist/core/runner/caller-roster.d.ts +21 -2
- package/dist/core/runner/caller-roster.js +38 -0
- package/dist/core/runner/capability-withheld-seat.d.ts +5 -0
- package/dist/core/runner/capability-withheld-seat.js +24 -0
- package/dist/core/runner/classifier-ladder.d.ts +33 -13
- package/dist/core/runner/classifier-ladder.js +15 -14
- package/dist/core/runner/compaction-restate.d.ts +10 -6
- package/dist/core/runner/compaction-restate.js +9 -3
- package/dist/core/runner/construction-doors.js +3 -0
- package/dist/core/runner/contracts.d.ts +40 -33
- package/dist/core/runner/conversation-segment.d.ts +28 -0
- package/dist/core/runner/conversation-segment.js +42 -0
- package/dist/core/runner/cross-boundary-lane.d.ts +21 -16
- package/dist/core/runner/cross-boundary-lane.js +58 -34
- package/dist/core/runner/decide-continuation.d.ts +7 -4
- package/dist/core/runner/decide-continuation.js +2 -2
- package/dist/core/runner/denial-limit-arms.d.ts +4 -4
- package/dist/core/runner/denial-limit-arms.js +1 -1
- package/dist/core/runner/derived-route-fallback.d.ts +24 -24
- package/dist/core/runner/derived-route-fallback.js +9 -7
- package/dist/core/runner/file-history-request.d.ts +18 -0
- package/dist/core/runner/file-history-request.js +21 -13
- package/dist/core/runner/file-history-restore.d.ts +45 -0
- package/dist/core/runner/file-history-restore.js +46 -0
- package/dist/core/runner/gate-exit.d.ts +9 -3
- package/dist/core/runner/gate-exit.js +11 -5
- package/dist/core/runner/image.d.ts +7 -17
- package/dist/core/runner/image.js +9 -60
- package/dist/core/runner/initial-run-state.js +1 -1
- package/dist/core/runner/permission-rule-lanes.d.ts +6 -6
- package/dist/core/runner/permission-rule-lanes.js +38 -15
- package/dist/core/runner/person-path-rows.d.ts +12 -9
- package/dist/core/runner/person-path-rows.js +19 -8
- package/dist/core/runner/prepare-advisor.d.ts +63 -0
- package/dist/core/runner/prepare-advisor.js +77 -0
- package/dist/core/runner/prepare-ask-lane.d.ts +2 -2
- package/dist/core/runner/prepare-ask-lane.js +5 -2
- package/dist/core/runner/prepare-caps-and-workflow.d.ts +4 -6
- package/dist/core/runner/prepare-caps-and-workflow.js +5 -4
- package/dist/core/runner/prepare-config-doors.d.ts +31 -38
- package/dist/core/runner/prepare-config-doors.js +57 -34
- package/dist/core/runner/prepare-defer-classify.d.ts +4 -3
- package/dist/core/runner/prepare-defer-classify.js +7 -8
- package/dist/core/runner/prepare-delegation-surface.d.ts +2 -2
- package/dist/core/runner/prepare-delegation-surface.js +1 -1
- package/dist/core/runner/prepare-file-history.d.ts +48 -8
- package/dist/core/runner/prepare-file-history.js +41 -73
- package/dist/core/runner/prepare-gate-stations.d.ts +2 -5
- package/dist/core/runner/prepare-gate-stations.js +12 -8
- package/dist/core/runner/prepare-hands-readface.d.ts +2 -8
- package/dist/core/runner/prepare-hands-readface.js +15 -14
- package/dist/core/runner/prepare-inherited-gate.d.ts +11 -7
- package/dist/core/runner/prepare-inherited-gate.js +8 -6
- package/dist/core/runner/prepare-memory-engine-session.js +1 -1
- package/dist/core/runner/prepare-park-ask.js +12 -12
- package/dist/core/runner/prepare-policy-chain.d.ts +7 -4
- package/dist/core/runner/prepare-policy-chain.js +68 -81
- package/dist/core/runner/prepare-project-context.d.ts +5 -2
- package/dist/core/runner/prepare-project-context.js +6 -3
- package/dist/core/runner/prepare-prompt-assembly.d.ts +5 -7
- package/dist/core/runner/prepare-prompt-assembly.js +10 -8
- package/dist/core/runner/prepare-prompt-inputs.d.ts +11 -9
- package/dist/core/runner/prepare-prompt-inputs.js +4 -6
- package/dist/core/runner/prepare-protocol-tools.d.ts +4 -2
- package/dist/core/runner/prepare-protocol-tools.js +5 -4
- package/dist/core/runner/prepare-safety-scan.d.ts +9 -12
- package/dist/core/runner/prepare-safety-scan.js +8 -23
- package/dist/core/runner/prepare-suspend-saga.d.ts +2 -0
- package/dist/core/runner/prepare-suspend-saga.js +5 -6
- package/dist/core/runner/prepare-task.d.ts +1 -1
- package/dist/core/runner/prepare-task.js +41 -35
- package/dist/core/runner/prepare-tool-disclosure-mount.d.ts +7 -4
- package/dist/core/runner/prepare-tool-disclosure-mount.js +24 -18
- package/dist/core/runner/prepare-turn-wiring.d.ts +0 -4
- package/dist/core/runner/prepare-turn-wiring.js +2 -7
- package/dist/core/runner/prepare-wiring-manifest.d.ts +11 -4
- package/dist/core/runner/prepare-wiring-manifest.js +3 -3
- package/dist/core/runner/resume-admission.js +1 -1
- package/dist/core/runner/resume-apply.js +11 -12
- package/dist/core/runner/resume-checkpoint-screen.js +3 -0
- package/dist/core/runner/resume-claim.d.ts +4 -2
- package/dist/core/runner/resume-claim.js +15 -8
- package/dist/core/runner/resume-policy-outcome.js +1 -1
- package/dist/core/runner/retired-runner-deps.js +2 -1
- package/dist/core/runner/rewind-files.d.ts +15 -0
- package/dist/core/runner/rewind-files.js +132 -0
- package/dist/core/runner/run-attachment-seats.js +2 -2
- package/dist/core/runner/run-brain-sinks.d.ts +4 -1
- package/dist/core/runner/run-brain-sinks.js +4 -2
- package/dist/core/runner/run-compaction-machinery.d.ts +1 -1
- package/dist/core/runner/run-compaction-machinery.js +2 -12
- package/dist/core/runner/run-git-lane.d.ts +1 -0
- package/dist/core/runner/run-harness-handlers.js +14 -7
- package/dist/core/runner/run-leg.d.ts +1 -1
- package/dist/core/runner/run-leg.js +43 -18
- package/dist/core/runner/run-settle-and-teardown.js +3 -2
- package/dist/core/runner/run-telemetry-and-budget-seats.js +1 -1
- package/dist/core/runner/run-turn-boundary.d.ts +1 -0
- package/dist/core/runner/run-turn-boundary.js +15 -22
- package/dist/core/runner/runtask.d.ts +3 -0
- package/dist/core/runner/runtask.js +8 -9
- package/dist/core/runner/session-read-file-states.d.ts +15 -0
- package/dist/core/runner/session-read-file-states.js +28 -0
- package/dist/core/runner/session-rule-policy.d.ts +22 -21
- package/dist/core/runner/session-rule-policy.js +17 -31
- package/dist/core/runner/shell-env-withheld.d.ts +33 -0
- package/dist/core/runner/shell-env-withheld.js +51 -0
- package/dist/core/runner/side-call-account.d.ts +32 -8
- package/dist/core/runner/side-call-account.js +23 -1
- package/dist/core/runner/skills-seat.js +6 -2
- package/dist/core/runner/stream-settle-backstop.js +1 -1
- package/dist/core/runner/strict-output-schema.d.ts +1 -1
- package/dist/core/runner/sub-agent-deny-lists.js +4 -6
- package/dist/core/runner/synthetic-tools.d.ts +16 -13
- package/dist/core/runner/synthetic-tools.js +8 -3
- package/dist/core/runner/tool-disclosure.d.ts +10 -12
- package/dist/core/runner/tool-disclosure.js +3 -4
- package/dist/core/runner/tool-end-body.d.ts +1 -1
- package/dist/core/runner/tool-end-body.js +10 -9
- package/dist/core/runner/tool-face-overlay.d.ts +2 -1
- package/dist/core/runner/tool-face-overlay.js +17 -1
- package/dist/core/runner/tool-not-executed.d.ts +5 -0
- package/dist/core/runner/tool-not-executed.js +11 -0
- package/dist/core/runner/tool-occurrence.d.ts +8 -0
- package/dist/core/runner/tool-occurrence.js +7 -0
- package/dist/core/runner/tool-progress-lane.d.ts +2 -2
- package/dist/core/runner/tool-turn-repair-seat.d.ts +3 -2
- package/dist/core/runner/turn-attachments.d.ts +91 -80
- package/dist/core/runner/turn-attachments.js +62 -37
- package/dist/core/runner-deps.d.ts +42 -42
- package/dist/core/runtime-caps.d.ts +4 -4
- package/dist/core/safety-axis-vocab.d.ts +6 -4
- package/dist/core/safety-axis-vocab.js +6 -5
- package/dist/core/safety-merge-corpus.js +26 -2
- package/dist/core/same-plain-value.d.ts +40 -0
- package/dist/core/same-plain-value.js +49 -0
- package/dist/core/scheduler.d.ts +1 -1
- package/dist/core/secret-env.d.ts +26 -3
- package/dist/core/secret-env.js +44 -8
- package/dist/core/select-model.js +3 -3
- package/dist/core/sensitive-path-policy.d.ts +1 -1
- package/dist/core/sensitive-path-policy.js +1 -1
- package/dist/core/session-policy-store.d.ts +102 -35
- package/dist/core/session-policy-store.js +210 -48
- package/dist/core/session-reconcile.d.ts +2 -2
- package/dist/core/session-store.d.ts +106 -37
- package/dist/core/session-store.js +165 -91
- package/dist/core/session.d.ts +101 -57
- package/dist/core/session.js +53 -0
- package/dist/core/shared-memory/tools.js +3 -1
- package/dist/core/shared-memory/types.d.ts +1 -1
- package/dist/core/shell-read-silence.d.ts +11 -12
- package/dist/core/shell-read-silence.js +9 -5
- package/dist/core/shell-run-candidates.js +3 -1
- package/dist/core/shell-wrapper-projection.js +1 -1
- package/dist/core/shell-wrapper-table.d.ts +14 -7
- package/dist/core/shell-wrapper-table.js +5 -4
- package/dist/core/side-query.d.ts +10 -0
- package/dist/core/side-query.js +15 -1
- package/dist/core/skill-grant.d.ts +7 -2
- package/dist/core/skill-grant.js +5 -0
- package/dist/core/skills-directory.js +6 -2
- package/dist/core/store-contracts/checkpoint-store-contract.d.ts +11 -1
- package/dist/core/store-contracts/checkpoint-store-contract.js +168 -3
- package/dist/core/store-contracts/file-history-store-contract.js +74 -4
- package/dist/core/store-contracts/peer-directory-contract.d.ts +7 -2
- package/dist/core/store-contracts/peer-directory-contract.js +14 -2
- package/dist/core/store-contracts/session-policy-store-contract.d.ts +7 -0
- package/dist/core/store-contracts/session-policy-store-contract.js +130 -0
- package/dist/core/store-contracts/session-repo-contract.js +176 -0
- package/dist/core/store-contracts/session-store-contract.d.ts +6 -8
- package/dist/core/store-contracts/session-store-contract.js +361 -51
- package/dist/core/store-contracts/workflow-journal-store-contract.js +26 -1
- package/dist/core/stub-env.d.ts +2 -0
- package/dist/core/stub-env.js +1 -0
- package/dist/core/surrogate-safe-slice.d.ts +3 -3
- package/dist/core/synthetic-read-verdict.js +3 -3
- package/dist/core/task-event.d.ts +42 -8
- package/dist/core/task-notification.d.ts +19 -15
- package/dist/core/task-registry-agent.d.ts +4 -4
- package/dist/core/task-registry-shared.d.ts +4 -4
- package/dist/core/task-registry-shared.js +1 -0
- package/dist/core/task-registry.d.ts +13 -4
- package/dist/core/task-registry.js +14 -2
- package/dist/core/task-result.d.ts +21 -3
- package/dist/core/task-spec.d.ts +69 -64
- package/dist/core/task-stream.d.ts +6 -6
- package/dist/core/task-tool-shape.d.ts +4 -4
- package/dist/core/tighten-task-spec.d.ts +1 -1
- package/dist/core/tighten-task-spec.js +2 -1
- package/dist/core/tool-catalog-entries.d.ts +36 -2
- package/dist/core/tool-catalog-entries.js +69 -43
- package/dist/core/tool-check-reading.d.ts +11 -0
- package/dist/core/tool-check-reading.js +11 -6
- package/dist/core/tool-conformance.js +1 -0
- package/dist/core/tool-errors.d.ts +2 -2
- package/dist/core/tool-face-reader.js +5 -3
- package/dist/core/tool-face.d.ts +21 -2
- package/dist/core/tool-face.js +1 -1
- package/dist/core/tool-model-gate.d.ts +5 -5
- package/dist/core/tool-name-aliases.d.ts +29 -8
- package/dist/core/tool-name-aliases.js +22 -4
- package/dist/core/tool-name-readings.d.ts +10 -43
- package/dist/core/tool-name-readings.js +2 -11
- package/dist/core/tool-policy.d.ts +85 -196
- package/dist/core/tool-policy.js +150 -175
- package/dist/core/tool-registry.d.ts +14 -7
- package/dist/core/tool-registry.js +17 -7
- package/dist/core/tool-result-store.js +5 -1
- package/dist/core/tool-roster.d.ts +57 -33
- package/dist/core/tool-roster.js +56 -68
- package/dist/core/tool-spec-members.js +8 -3
- package/dist/core/tool-spec.d.ts +53 -31
- package/dist/core/tools.js +51 -10
- package/dist/core/trace.d.ts +6 -2
- package/dist/core/types.d.ts +1 -1
- package/dist/core/untrusted-egress.d.ts +1 -1
- package/dist/core/untrusted-text.d.ts +1 -1
- package/dist/core/user-attachment.d.ts +8 -1
- package/dist/core/user-attachment.js +64 -4
- package/dist/core/warm-resume.d.ts +1 -1
- package/dist/core/wiring-manifest.d.ts +58 -0
- package/dist/core/wiring-manifest.js +14 -5
- package/dist/core/workflow-journal-store.d.ts +62 -0
- package/dist/core/workflow-journal-store.js +78 -2
- package/dist/core/workflow-run-store.d.ts +6 -0
- package/dist/core/workflow-run-store.js +2 -0
- package/dist/engine/compaction/compaction.d.ts +9 -9
- package/dist/engine/compaction/compaction.js +3 -2
- package/dist/engine/execution-env/node-execution-env.d.ts +26 -8
- package/dist/engine/execution-env/node-execution-env.js +54 -24
- package/dist/engine/harness/agent-harness.d.ts +39 -9
- package/dist/engine/harness/agent-harness.js +87 -33
- package/dist/engine/harness/types.d.ts +58 -9
- package/dist/engine/harness/types.js +12 -1
- package/dist/engine/llm/types.d.ts +36 -19
- package/dist/engine/llm/validation.d.ts +4 -1
- package/dist/engine/llm/validation.js +13 -1
- package/dist/engine/loop/agent-loop.d.ts +23 -1
- package/dist/engine/loop/agent-loop.js +26 -34
- package/dist/engine/loop/types.d.ts +31 -19
- package/dist/engine/lsp/node-lsp-manager.d.ts +2 -2
- package/dist/engine/session/memory-repo.d.ts +18 -12
- package/dist/engine/session/memory-repo.js +24 -9
- package/dist/engine/session/parent-chain-guard.d.ts +3 -2
- package/dist/engine/session/parent-chain-guard.js +1 -1
- package/dist/engine/session/repo-utils.d.ts +32 -3
- package/dist/engine/session/repo-utils.js +50 -5
- package/dist/index.d.ts +47 -23
- package/dist/index.js +35 -17
- package/dist/internal/harness-types.d.ts +1 -1
- package/dist/internal/harness.d.ts +3 -3
- package/dist/internal/harness.js +2 -2
- package/dist/internal/llm.d.ts +2 -2
- package/dist/internal/llm.js +1 -1
- package/dist/orchestration/goal.js +2 -2
- package/dist/orchestration/run-workflow-tool.d.ts +8 -6
- package/dist/orchestration/run-workflow-tool.js +10 -6
- package/dist/orchestration/workflow-size-guideline.d.ts +4 -4
- package/dist/orchestration/workflow-types.d.ts +18 -0
- package/dist/orchestration/workflow-types.js +6 -0
- package/dist/orchestration/workflow.d.ts +5 -13
- package/dist/orchestration/workflow.js +57 -49
- package/dist/prompt-assembly/artifact.d.ts +2 -2
- package/dist/prompt-assembly/artifact.js +5 -3
- package/dist/prompt-assembly/assemble.d.ts +3 -2
- package/dist/prompt-assembly/assemble.js +1 -1
- package/dist/prompt-assembly/catalog/schema.d.ts +43 -12
- package/dist/prompt-assembly/catalog/schema.js +34 -2
- package/dist/prompt-assembly/catalog/sections.js +0 -1
- package/dist/prompt-assembly/composer.d.ts +3 -1
- package/dist/prompt-assembly/composer.js +1 -1
- package/dist/prompt-assembly/event-registry.js +2 -0
- package/dist/prompt-assembly/overlay.js +3 -3
- package/dist/prompt-assembly/renderers.d.ts +1 -1
- package/dist/prompt-assembly/renderers.js +0 -3
- package/dist/prompt-assembly/role-base.d.ts +15 -0
- package/dist/prompt-assembly/role-base.js +9 -0
- package/dist/prompt-assembly/select.d.ts +39 -14
- package/dist/prompt-assembly/select.js +47 -16
- package/dist/prompt-assembly/sugar.d.ts +17 -11
- package/dist/prompt-assembly/sugar.js +8 -3
- package/dist/prompt-assembly/tool-catalog.d.ts +39 -2
- package/dist/prompt-assembly/tool-catalog.js +117 -4
- package/dist/prompt-assembly/turn-snapshot.d.ts +4 -10
- package/dist/prompt-assembly/turn-snapshot.js +0 -3
- package/dist/prompt-assembly/types.d.ts +0 -7
- package/dist/prompts/default.d.ts +14 -14
- package/dist/scenarios/full-body.d.ts +15 -15
- package/dist/scenarios/full-body.js +4 -3
- package/dist/shell/lex.js +10 -1
- package/dist/stores/file/adoption/adopt.d.ts +4 -3
- package/dist/stores/file/adoption/adopt.js +27 -33
- package/dist/stores/file/adoption/marker.d.ts +6 -13
- package/dist/stores/file/adoption/marker.js +9 -17
- package/dist/stores/file/checkpoint-store.d.ts +24 -0
- package/dist/stores/file/checkpoint-store.js +45 -7
- package/dist/stores/file/file-history-store.d.ts +20 -19
- package/dist/stores/file/file-history-store.js +157 -141
- package/dist/stores/file/fs-atomic.d.ts +15 -0
- package/dist/stores/file/fs-atomic.js +89 -14
- package/dist/stores/file/index.d.ts +1 -1
- package/dist/stores/file/index.js +2 -1
- package/dist/stores/file/mailbox-store.d.ts +3 -0
- package/dist/stores/file/mailbox-store.js +3 -1
- package/dist/stores/file/permission-rule-adopt.d.ts +1 -1
- package/dist/stores/file/permission-rule-adopt.js +18 -18
- package/dist/stores/file/permission-rule-store.d.ts +18 -2
- package/dist/stores/file/permission-rule-store.js +31 -18
- package/dist/stores/file/session-policy-store.d.ts +3 -3
- package/dist/stores/file/session-store.d.ts +54 -16
- package/dist/stores/file/session-store.js +114 -85
- package/dist/stores/file/workflow-journal-store.d.ts +10 -4
- package/dist/stores/file/workflow-journal-store.js +28 -13
- package/dist/tools/artifact/artifact-text.d.ts +1 -1
- package/dist/tools/artifact/artifact-tool.js +5 -3
- package/dist/tools/fs/bash-program-position.d.ts +19 -2
- package/dist/tools/fs/bash-program-position.js +56 -9
- package/dist/tools/fs/bash-readonly-classifier.d.ts +3 -3
- package/dist/tools/fs/fs-bash.d.ts +2 -2
- package/dist/tools/fs/fs-bash.js +8 -6
- package/dist/tools/fs/fs-glob.d.ts +86 -0
- package/dist/tools/fs/fs-glob.js +226 -0
- package/dist/tools/fs/fs-read.js +14 -14
- package/dist/tools/fs/fs-search-tools.js +7 -7
- package/dist/tools/fs/fs-shared.d.ts +8 -8
- package/dist/tools/fs/gh-rate-limit.d.ts +1 -1
- package/dist/tools/fs/notebook.d.ts +2 -2
- package/dist/tools/fs/pattern-kill-guard.d.ts +22 -0
- package/dist/tools/fs/pattern-kill-guard.js +397 -0
- package/dist/tools/fs/pdf.d.ts +9 -6
- package/dist/tools/fs/pdf.js +3 -3
- package/dist/tools/fs/program-read-model.d.ts +57 -7
- package/dist/tools/fs/program-read-model.js +11 -1
- package/dist/tools/fs/program-read-model.rows.js +78 -21
- package/dist/tools/fs/read-deny-home.js +3 -2
- package/dist/tools/fs/read-deny.d.ts +29 -7
- package/dist/tools/fs/read-deny.js +63 -22
- package/dist/tools/fs/removal-targets.d.ts +18 -8
- package/dist/tools/fs/removal-targets.js +47 -20
- package/dist/tools/fs/safety.d.ts +9 -9
- package/dist/tools/fs/search.d.ts +16 -6
- package/dist/tools/fs/search.js +20 -26
- package/dist/tools/fs/shell-read-argv.js +89 -12
- package/dist/tools/fs/shell-read-bindings.d.ts +31 -0
- package/dist/tools/fs/shell-read-bindings.js +41 -0
- package/dist/tools/fs/shell-read-check.js +12 -20
- package/dist/tools/fs/shell-read-environment.d.ts +5 -1
- package/dist/tools/fs/shell-read-environment.js +3 -2
- package/dist/tools/fs/shell-read-establish.d.ts +15 -0
- package/dist/tools/fs/shell-read-establish.js +19 -20
- package/dist/tools/fs/shell-read-judge.d.ts +4 -0
- package/dist/tools/fs/shell-read-judge.js +5 -2
- package/dist/tools/fs/shell-read-plan.js +24 -16
- package/dist/tools/fs/shell-read-start.d.ts +6 -1
- package/dist/tools/fs/shell-read-write-targets.d.ts +5 -1
- package/dist/tools/fs/shell-read-write-targets.js +2 -3
- package/dist/tools/fs/shell-reentry-text.d.ts +9 -0
- package/dist/tools/fs/shell-reentry-text.js +40 -2
- package/dist/tools/loop-tick.d.ts +2 -2
- package/dist/tools/scheduler-tools.js +5 -1
- package/dist/tools/task-list.d.ts +7 -7
- package/dist/tools/task-list.js +5 -1
- package/dist/tools/todo.js +65 -64
- package/dist/tools/web.d.ts +20 -15
- package/dist/tools/web.js +55 -69
- package/dist/tools/worktree.d.ts +3 -3
- package/dist/tools/worktree.js +3 -1
- package/package.json +1 -1
- package/test/export-surface.snapshot.json +5894 -5638
- package/wire-changes/core@7.55.0.json +3318 -0
- package/wire-changes/core@7.56.0.json +3891 -0
- package/wire-changes/mods-kernel@7.56.0.json +303 -0
- package/dist/core/store-contracts/session-store-incarnation-contract.d.ts +0 -39
- package/dist/core/store-contracts/session-store-incarnation-contract.js +0 -95
|
@@ -59,6 +59,9 @@ export type ArgRole =
|
|
|
59
59
|
/** The program expands `{a,b}` sets and `[a-z]` / `[1-9]` ranges in the value itself before it opens anything
|
|
60
60
|
* (curl's URL glob), unless the invocation carries an option marked {@link OptionSpec.literalValues}. */
|
|
61
61
|
readonly programGlob?: true;
|
|
62
|
+
/** The program substitutes its own environment into the value (valgrind's `%q{NAME}`): a value carrying such a substitution
|
|
63
|
+
* names a place the text does not settle. */
|
|
64
|
+
readonly programEnv?: true;
|
|
62
65
|
/** A writing effect: the seats the program writes the path at (absent: where it lands). */
|
|
63
66
|
readonly seats?: readonly WriteSeat[];
|
|
64
67
|
/** A writing effect the program does NOT itself perform at every seat: the seats it does write (`[]`: none — a
|
|
@@ -177,13 +180,27 @@ export interface OptionSpec {
|
|
|
177
180
|
* reads the station cannot establish ({@link deliversOperands}); the list file itself is a read like any other and meets the deny
|
|
178
181
|
* rows as itself. */
|
|
179
182
|
readonly delivers?: "operands";
|
|
180
|
-
/** The option's value is a PLACE the program's walk works in or compares (`
|
|
183
|
+
/** The option's value is a PLACE the program's walk works in or compares (`diff --from-file=DIR`): a root of a
|
|
181
184
|
* recursive form, whichever way the value is spelled. Absent: a path value is a file the program READS (a config, ignore or
|
|
182
185
|
* exclusion file, an archive, a pattern file) or an entry it examines — judged as itself, never a root, so it does not count
|
|
183
186
|
* as the root the walk was given (`rg --ignore-file ig pat` walks `.`). A list the operands come from ({@link delivers}) is a
|
|
184
187
|
* root of a recursive form too, in either spelling: the program works on what the list names, not on the working directory
|
|
185
188
|
* (and, the names not being in the text, the segment is not vouched: {@link deliversOperands}). */
|
|
186
189
|
readonly walks?: true;
|
|
190
|
+
/** The option's value is the directory the program changes into before it opens the OPERANDS written after it (`tar -C DIR`,
|
|
191
|
+
* both GNU tar and bsdtar): an ordered base — each relative operand after it resolves against it, a second one resolves
|
|
192
|
+
* against the first, the operands before it and every option value (the archive, a list, an exclusion file) against the
|
|
193
|
+
* working directory. The value itself is a place the program names, no root of the walk. */
|
|
194
|
+
readonly rebases?: true;
|
|
195
|
+
/** The option's value is a `KEY=VALUE` setting the program keeps, and the value of a key this table names is a command line the
|
|
196
|
+
* program hands to a shell LATER (`git -c core.pager=…`, `git -c 'alias.x=!…'`): a code body of the program ({@link CodeBody}
|
|
197
|
+
* `option-values`). `valueFrom: "environment"`: the setting's VALUE is the content of the environment variable the word names
|
|
198
|
+
* (`git --config-env=core.pager=VAR`) — text the command does not spell. The table is read off the program's own
|
|
199
|
+
* documentation, never off the command. */
|
|
200
|
+
readonly runsLater?: {
|
|
201
|
+
readonly keys: readonly LaterRunKey[];
|
|
202
|
+
readonly valueFrom?: "environment";
|
|
203
|
+
};
|
|
187
204
|
/** The option's value bounds the program's output, in bytes or in lines (`head -c` / `head -n`). */
|
|
188
205
|
readonly bounds?: "bytes" | "lines";
|
|
189
206
|
/** The option's value is what the row's LAST operand would otherwise be (`cp -t <dir>`), so every operand is an
|
|
@@ -192,6 +209,10 @@ export interface OptionSpec {
|
|
|
192
209
|
/** An enum option: selecting the value (case-folded, any unambiguous prefix of it) makes the operands roots of a
|
|
193
210
|
* tree walk (`grep -d recurse`). */
|
|
194
211
|
readonly selectsWhenValue?: string;
|
|
212
|
+
/** Given exactly this value, the option RUNS what the program holds at once, whatever else is selected — as an
|
|
213
|
+
* `effect: "executes"` option does (`fc -e -`: no editor, the stored line runs even beside `-l`); any other value is
|
|
214
|
+
* read by the option's role alone (`fc -e vi -l` only lists). */
|
|
215
|
+
readonly executesWhenValue?: string;
|
|
195
216
|
/** This option delivers what the row's first positional would otherwise be (grep's `-e`, sed's `-f`, an
|
|
196
217
|
* interpreter's `-c`), so the first operand is an ordinary operand after it. */
|
|
197
218
|
readonly fillsSlot?: true;
|
|
@@ -217,6 +238,18 @@ export interface OptionSpec {
|
|
|
217
238
|
* the names, `declare -p`; names functions, `-f`; or a bash it runs on refuses the switch, bash 3.2's `declare -g`). */
|
|
218
239
|
readonly assigns?: DeclaredAttribute;
|
|
219
240
|
}
|
|
241
|
+
/** One key of {@link OptionSpec.runsLater}: `key` the setting's name, case-folded, `*` standing for any run of characters (a
|
|
242
|
+
* subsection, a variable name); `bang` — only a value led by `!` is a command line (the text after the `!`), any other value
|
|
243
|
+
* names something the program resolves itself; `prefixed` — a value led by `!` is a shell snippet (the text after it), one led
|
|
244
|
+
* by `/` the command as written, any other value is run with this text in front of it (git's credential helpers: `git
|
|
245
|
+
* credential-<value>`); `orBoolean` — a boolean value (`true` / `false` / `yes` / `no` / `on` / `off` / `1` / `0`, or empty)
|
|
246
|
+
* switches a behaviour and is no command line. */
|
|
247
|
+
export interface LaterRunKey {
|
|
248
|
+
readonly key: string;
|
|
249
|
+
readonly bang?: true;
|
|
250
|
+
readonly prefixed?: string;
|
|
251
|
+
readonly orBoolean?: true;
|
|
252
|
+
}
|
|
220
253
|
/** What a declaration builtin does to the names it binds ({@link OptionSpec.assigns}). */
|
|
221
254
|
export type DeclaredAttribute = "integer" | "reference" | "transformed" | "frozen" | "unsettled";
|
|
222
255
|
/** One implementation's option grammar. `any` = every implementation the row was measured on reads it this way. */
|
|
@@ -338,11 +371,13 @@ export interface DeliverySpec {
|
|
|
338
371
|
readonly stdinWhenUnnamed: boolean;
|
|
339
372
|
}
|
|
340
373
|
/** The shell text a re-entry program runs: `-c`'s value, its words joined (`eval`), its non-option words (`parallel`),
|
|
341
|
-
*
|
|
342
|
-
*
|
|
374
|
+
* none (`source FILE` reads a file operand), or a line of the shell's own HISTORY list (`fc -s`, `fc -e -`, bare `fc`: no word
|
|
375
|
+
* of the command spells it, so it is a text built when the command runs — unless an option the row marks `banner` makes it
|
|
376
|
+
* print instead, `fc -l`). `stdin: "script"`: where its argv names no text and no script file, it runs its STANDARD INPUT
|
|
377
|
+
* (`bash <<EOF`, `… | sh`, `parallel < commands`). */
|
|
343
378
|
export type ShellReentry = {
|
|
344
379
|
readonly kind: "shell";
|
|
345
|
-
readonly text: "c-option" | "words" | "non-option-words" | "file-operand";
|
|
380
|
+
readonly text: "c-option" | "words" | "non-option-words" | "file-operand" | "history";
|
|
346
381
|
readonly stdin?: "script";
|
|
347
382
|
}
|
|
348
383
|
/** Its operands arrive on a stream and it execs `defaultProgram` when the chain names none (`xargs`). */
|
|
@@ -350,8 +385,9 @@ export type ShellReentry = {
|
|
|
350
385
|
readonly kind: "argv";
|
|
351
386
|
readonly defaultProgram: string;
|
|
352
387
|
};
|
|
353
|
-
/** Where a
|
|
354
|
-
* `NAME=VALUE` operands (`alias`), or the values of its shell-text options (`mapfile -C`)
|
|
388
|
+
/** Where a program keeps shell text it runs later: its first operand after the options (`trap`), the values of its
|
|
389
|
+
* `NAME=VALUE` operands (`alias`), or the values of its shell-text options (`mapfile -C`) — and of a setting option whose key
|
|
390
|
+
* names a command line ({@link OptionSpec.runsLater}: `git -c core.pager=…`). */
|
|
355
391
|
export type CodeBody = "first-operand" | "assignment-values" | "option-values";
|
|
356
392
|
/** How a row is checked against the program: the gate runs the binary, or the row says why it cannot. */
|
|
357
393
|
export type Witness = "binary" | {
|
|
@@ -392,6 +428,10 @@ export interface ProgramRow {
|
|
|
392
428
|
/** Modules the interpreter runs by name (`python -m <module>`) whose own argv tail is not argv: the role of every word
|
|
393
429
|
* after the module name (`timeit` compiles and runs it as program text). */
|
|
394
430
|
readonly modules?: Readonly<Record<string, ArgRole>>;
|
|
431
|
+
/** Each grammar declares EVERY option its implementation takes (measured): a spelling one does not declare is an option
|
|
432
|
+
* that implementation refuses — getopt reports it and the program runs nothing ({@link rowRefusesArgv}). Absent, an
|
|
433
|
+
* undeclared spelling may be one the row does not model, and no reader concludes anything from it. */
|
|
434
|
+
readonly optionsComplete?: true;
|
|
395
435
|
readonly witness: Witness;
|
|
396
436
|
}
|
|
397
437
|
/** The row bash runs for this basename: the exact key, or — for a row that declares versioned spellings — the name
|
|
@@ -518,7 +558,8 @@ export declare function programGlobExpansions(value: string): readonly string[]
|
|
|
518
558
|
* the no. A plain path offers itself; an `indirect` one itself and what it names past an `@`; a `header` only a
|
|
519
559
|
* whole-word `@<file>`; a `form` field spec the files after its `@` / `<`; a `url` the local path of a `file:` URL. A
|
|
520
560
|
* `programGlob` value offers what each of its expansions offers (`globs: "literal"` = the invocation turned the glob
|
|
521
|
-
* off); `undefined` = it expands past {@link PROGRAM_GLOB_MAX}
|
|
561
|
+
* off); `undefined` = it expands past {@link PROGRAM_GLOB_MAX}, or it carries a substitution of the program's own environment
|
|
562
|
+
* (`programEnv`): it names files the reader does not list.
|
|
522
563
|
*/
|
|
523
564
|
export declare function slotValueCandidates(value: string, role: ArgRole, globs?: "expanded" | "literal"): string[] | undefined;
|
|
524
565
|
/** The paths an object name `<rev>:<path>` ({@link ArgRole} `object-path`) may spell: the text after each `:` (a stage
|
|
@@ -677,6 +718,10 @@ interface OptionScan {
|
|
|
677
718
|
readonly name: string;
|
|
678
719
|
}[];
|
|
679
720
|
readonly operands: readonly number[];
|
|
721
|
+
/** ONE implementation's reading met an option word naming a spelling its grammar does not declare, where that
|
|
722
|
+
* implementation certainly reads the word as an option: before the first operand, or anywhere in a grammar that
|
|
723
|
+
* permutes (`afterFirstOperand: "options"`). Past `--` nothing is an option. */
|
|
724
|
+
readonly undeclared: boolean;
|
|
680
725
|
}
|
|
681
726
|
/**
|
|
682
727
|
* Every option spec an argv selects. A short cluster is read as getopt reads it, scanning left to right: a declared
|
|
@@ -698,6 +743,11 @@ export declare function selectedSpellings(row: ProgramRow, args: readonly string
|
|
|
698
743
|
* declares (another implementation's) that this one does not? getopt calls it an invalid option: the program runs
|
|
699
744
|
* nothing. */
|
|
700
745
|
export declare function implementationRejects(row: ProgramRow, view: ProgramRow, words: readonly string[]): boolean;
|
|
746
|
+
/** Does EVERY implementation of a row whose grammars declare all its options ({@link ProgramRow.optionsComplete}) refuse
|
|
747
|
+
* this argv — an option word it certainly reads as an option names a spelling it does not declare
|
|
748
|
+
* ({@link OptionScan.undeclared})? getopt reports the invalid option and the program runs nothing (`rm -m pytest .`,
|
|
749
|
+
* `rm -rfE .`). One implementation that takes the argv is enough for it to run; a row that is not complete refuses nothing. */
|
|
750
|
+
export declare function rowRefusesArgv(row: ProgramRow, args: readonly string[]): boolean;
|
|
701
751
|
/** A path role whose effect writes. */
|
|
702
752
|
export type WritingRole = Extract<ArgRole, {
|
|
703
753
|
kind: "path";
|
|
@@ -404,6 +404,8 @@ export function slotValueCandidates(value, role, globs = "expanded") {
|
|
|
404
404
|
return [value];
|
|
405
405
|
if (role.kind !== "path")
|
|
406
406
|
return [];
|
|
407
|
+
if (role.programEnv === true && value.includes("%q{"))
|
|
408
|
+
return undefined;
|
|
407
409
|
if (role.kind === "path" && role.programGlob === true && globs === "expanded") {
|
|
408
410
|
const values = programGlobExpansions(value);
|
|
409
411
|
if (values === undefined)
|
|
@@ -782,13 +784,16 @@ function scanOptions(row, args, one) {
|
|
|
782
784
|
const values = [];
|
|
783
785
|
const operands = [];
|
|
784
786
|
const select = (spec, name) => { specs.push(spec); names.push(name); };
|
|
787
|
+
const permutes = row.grammars[0]?.afterFirstOperand === "options";
|
|
785
788
|
let endOfOptions = false;
|
|
789
|
+
let undeclared = false;
|
|
786
790
|
for (let k = 0; k < args.length; k++) {
|
|
787
791
|
const t = args[k];
|
|
788
792
|
if (endOfOptions) {
|
|
789
793
|
operands.push(k);
|
|
790
794
|
continue;
|
|
791
795
|
}
|
|
796
|
+
const certain = one && (operands.length === 0 || permutes);
|
|
792
797
|
const traditional = k === 0 || !one ? obsolete.filter((o) => o.signs.includes(t[0] ?? "") && /^.\d+[A-Za-z]*$/.test(t)) : [];
|
|
793
798
|
if (traditional.length > 0) {
|
|
794
799
|
for (const o of traditional)
|
|
@@ -827,6 +832,7 @@ function scanOptions(row, args, one) {
|
|
|
827
832
|
const eq = t.indexOf("=");
|
|
828
833
|
const exact = longs.get(name);
|
|
829
834
|
const hits = exact !== undefined ? [[name, exact]] : [...longs].filter(([full, m]) => isLongOptionSpellingOf(name, full, m.abbreviable));
|
|
835
|
+
undeclared ||= certain && hits.length === 0;
|
|
830
836
|
for (const [full, m] of hits)
|
|
831
837
|
select(m.spec, `--${full}`);
|
|
832
838
|
const [full, only] = hits[0] ?? [];
|
|
@@ -849,6 +855,7 @@ function scanOptions(row, args, one) {
|
|
|
849
855
|
for (let i = 1; i < t.length; i++) {
|
|
850
856
|
const m = shorts.get(t[i]);
|
|
851
857
|
if (m === undefined) {
|
|
858
|
+
undeclared ||= certain;
|
|
852
859
|
if (/[A-Za-z0-9]/.test(t[i]))
|
|
853
860
|
continue;
|
|
854
861
|
break;
|
|
@@ -864,7 +871,10 @@ function scanOptions(row, args, one) {
|
|
|
864
871
|
break;
|
|
865
872
|
}
|
|
866
873
|
}
|
|
867
|
-
return { specs, names, values, operands };
|
|
874
|
+
return { specs, names, values, operands, undeclared };
|
|
875
|
+
}
|
|
876
|
+
export function rowRefusesArgv(row, args) {
|
|
877
|
+
return row.optionsComplete === true && implementationsOf(row).every((view) => scanOptions(view, args, true).undeclared);
|
|
868
878
|
}
|
|
869
879
|
export function writesPath(role) {
|
|
870
880
|
return role?.kind === "path" && WRITING_EFFECTS.has(role.effect);
|
|
@@ -33,6 +33,7 @@ const OBJECT_PATH = { kind: "object-path" };
|
|
|
33
33
|
const text = (language) => ({ kind: "program-text", language });
|
|
34
34
|
const file = (language) => ({ kind: "program-file", language });
|
|
35
35
|
const WALKS = { walks: true };
|
|
36
|
+
const REBASES = { rebases: true };
|
|
36
37
|
const SWITCH = { arity: 0 };
|
|
37
38
|
const QUERY = { arity: 0, mode: "queries" };
|
|
38
39
|
const val = (value, extra = {}) => ({ arity: 1, ...(value !== undefined ? { value } : {}), ...extra });
|
|
@@ -164,8 +165,8 @@ const date = {
|
|
|
164
165
|
};
|
|
165
166
|
const tar = {
|
|
166
167
|
key: "tar",
|
|
167
|
-
grammars: [grammar({ b: val(COUNT), C: val(NAMES,
|
|
168
|
-
"blocking-factor": val(COUNT), directory: val(NAMES,
|
|
168
|
+
grammars: [grammar({ b: val(COUNT), C: val(NAMES, REBASES), f: val(READ), T: val(READ, { delivers: "operands" }), X: val(READ), g: val(), ...switches("adhjJkmOpPStvwWxzZ"), ...switches("cru", { selects: "traversal" }) }, {
|
|
169
|
+
"blocking-factor": val(COUNT), directory: val(NAMES, REBASES), exclude: val(NAME_PATTERN), "exclude-from": val(READ), file: val(READ), "files-from": val(READ, { delivers: "operands" }), "strip-components": val(COUNT),
|
|
169
170
|
...longSwitches(["absolute-names", "dereference", "extract", "get", "interactive", "keep-old-files", "list", "preserve-permissions", "sparse", "to-stdout", "touch", "verbose", "verify"]), ...BANNERS,
|
|
170
171
|
...longSwitches(["append", "create", "update"], { selects: "traversal" }),
|
|
171
172
|
})],
|
|
@@ -176,6 +177,7 @@ const find = {
|
|
|
176
177
|
key: "find",
|
|
177
178
|
grammars: implementations(grammar({ D: val(LABEL), O: val(COUNT), f: val(NAMES), ...switches("HLPdsx") }, BANNERS, {
|
|
178
179
|
afterFirstOperand: "options",
|
|
180
|
+
acceptsAbbreviations: false,
|
|
179
181
|
dashWords: {
|
|
180
182
|
amin: val(COUNT), anewer: val(NAMES), atime: val(COUNT), cmin: val(COUNT), cnewer: val(NAMES), context: val(LABEL),
|
|
181
183
|
ctime: val(COUNT), fstype: val(LABEL), gid: val(COUNT), group: val(LABEL), ilname: val(NAMES), iname: val(NAME_PATTERN),
|
|
@@ -306,7 +308,7 @@ function interpreterGrammar(language, g) {
|
|
|
306
308
|
put(s, val(file(language), { fillsSlot: true, ...(g.fileEndsOptions === true ? { endsOptions: true } : {}) }));
|
|
307
309
|
for (const s of g.longText ?? [])
|
|
308
310
|
put(s, val(text(language), { fillsSlot: true }));
|
|
309
|
-
return { dialect: "any", short, long, dashWords, afterFirstOperand: "either" };
|
|
311
|
+
return { dialect: "any", short, long, dashWords, afterFirstOperand: "either", ...(g.exactLongNames === true ? { acceptsAbbreviations: false } : {}) };
|
|
310
312
|
}
|
|
311
313
|
const interpreter = (key, language, g, program, stdinWhenUnnamed, extra = {}, departures) => ({
|
|
312
314
|
key,
|
|
@@ -317,9 +319,9 @@ const interpreter = (key, language, g, program, stdinWhenUnnamed, extra = {}, de
|
|
|
317
319
|
witness: BINARY,
|
|
318
320
|
...extra,
|
|
319
321
|
});
|
|
320
|
-
const PERL = { text: "eEmM", separated: "I", attached: "iCFxDV", plain: "nplawcsStTUWX", banner: "vVh" };
|
|
321
|
-
const RUBY = { text: "e", separated: "IrECKT", attached: "F", plain: "nplawcsSU", banner: "vh" };
|
|
322
|
-
const PYTHON = { text: "c", module: "m", separated: "WXQ", plain: "uBEIsSqbdvxOtR", banner: "Vh?", interactive: "i", fileEndsOptions: true };
|
|
322
|
+
const PERL = { text: "eEmM", separated: "I", attached: "iCFxDV", plain: "nplawcsStTUWX", banner: "vVh", exactLongNames: true };
|
|
323
|
+
const RUBY = { text: "e", separated: "IrECKT", attached: "F", plain: "nplawcsSU", banner: "vh", exactLongNames: true };
|
|
324
|
+
const PYTHON = { text: "c", module: "m", separated: "WXQ", plain: "uBEIsSqbdvxOtR", banner: "Vh?", interactive: "i", fileEndsOptions: true, exactLongNames: true };
|
|
323
325
|
const NODE = {
|
|
324
326
|
longText: ["--eval", "--print"], text: "ep",
|
|
325
327
|
longModules: ["--import", "--loader", "--experimental-loader", "--require"],
|
|
@@ -327,25 +329,25 @@ const NODE = {
|
|
|
327
329
|
longAttached: ["--max-old-space-size"],
|
|
328
330
|
longNamesProgram: ["--test"],
|
|
329
331
|
longPlain: ["--inspect", "--inspect-brk", "--no-warnings", "--trace-warnings", "--watch", "--enable-source-maps", "--experimental-modules", "--no-deprecation", "--check"],
|
|
330
|
-
modules: "r", plain: "c", banner: "vh", interactive: "i",
|
|
332
|
+
modules: "r", plain: "c", banner: "vh", interactive: "i", exactLongNames: true,
|
|
331
333
|
};
|
|
332
|
-
const PHP = { longText: ["--run", "--process-begin", "--process-code", "--process-end"], text: "rRBE", file: "fF", separated: "dcz", plain: "nqswl", banner: "vhi", interactive: "a" };
|
|
334
|
+
const PHP = { longText: ["--run", "--process-begin", "--process-code", "--process-end"], text: "rRBE", file: "fF", separated: "dcz", plain: "nqswl", banner: "vhi", interactive: "a", exactLongNames: true };
|
|
333
335
|
const LUA = { text: "e", separated: "l", banner: "vh", interactive: "i" };
|
|
334
336
|
const EXPECT = { text: "c", separated: "Db", plain: "dN", banner: "vh", interactive: "i" };
|
|
335
337
|
const AWK = { longText: ["--source"], text: "e", longFile: ["--file", "--exec"], file: "fE", separated: "F", assignment: "v", banner: "V" };
|
|
336
338
|
const POSIX_AWK = { file: "f", separated: "F", assignment: "v" };
|
|
337
339
|
const AWK_IMPLEMENTATIONS = { gnu: {}, bsd: { lacks: ["-E", "--file", "--exec", "--source"] } };
|
|
338
|
-
const JQ = { longFile: ["--from-file"], file: "f", separated: "L", plain: "nrjcsSaCMRe", banner: "h" };
|
|
340
|
+
const JQ = { longFile: ["--from-file"], file: "f", separated: "L", plain: "nrjcsSaCMRe", banner: "h", exactLongNames: true };
|
|
339
341
|
const BC = { longText: ["--expression"], text: "e", plain: "lqsw", banner: "vh", interactive: "i" };
|
|
340
342
|
const DC = { longText: ["--expression"], text: "e", longFile: ["--file"], file: "f", banner: "hV" };
|
|
341
|
-
const SQLITE = { longText: ["-cmd"], longSupplemental: ["-init"] };
|
|
343
|
+
const SQLITE = { longText: ["-cmd"], longSupplemental: ["-init"], exactLongNames: true };
|
|
342
344
|
const PSQL = { longText: ["--command"], text: "c", longFile: ["--file"], file: "f", separated: "hpUdoF", plain: "aeEqtxXwW", banner: "lV?" };
|
|
343
345
|
const OSASCRIPT = { text: "e", separated: "ls", plain: "i", banner: "h" };
|
|
344
346
|
const RSCRIPT = { text: "e", banner: "h" };
|
|
345
347
|
const JULIA = { longText: ["--eval", "--print"], text: "eE", separated: "JLp", plain: "q", banner: "vh", interactive: "i" };
|
|
346
348
|
const GHCI = { text: "e", separated: "io" };
|
|
347
349
|
const GROOVY = { text: "e", separated: "Dcl", plain: "n", banner: "vh", interactive: "i" };
|
|
348
|
-
const BUN = { longText: ["--eval", "--print"], text: "ep", modules: "r", banner: "vh" };
|
|
350
|
+
const BUN = { longText: ["--eval", "--print"], text: "ep", modules: "r", banner: "vh", exactLongNames: true };
|
|
349
351
|
const launcher = (key, spec = {}, g, extra = {}) => ({
|
|
350
352
|
key,
|
|
351
353
|
grammars: g === undefined ? [] : [g],
|
|
@@ -396,6 +398,47 @@ const SU_OPTIONS = {
|
|
|
396
398
|
programs: ["-m", "-p", "--preserve-environment"],
|
|
397
399
|
};
|
|
398
400
|
const SU = launcherGrammar(SU_OPTIONS, { stepsDashDash: true });
|
|
401
|
+
const VALGRIND_FLAGS = [
|
|
402
|
+
"trace-children", "trace-children-skip", "trace-children-skip-by-arg", "child-silent-after-fork", "vgdb", "vgdb-stop-at", "track-fds", "time-stamp",
|
|
403
|
+
"xml", "xml-user-comment", "demangle", "error-limit", "exit-on-first-error", "error-markers", "show-error-list", "keep-debuginfo", "show-below-main",
|
|
404
|
+
"default-suppressions", "gen-suppressions", "dsymutil", "xtree-memory", "fullpath-after", "allow-mismatched-debuginfo", "smc-check", "read-inline-info",
|
|
405
|
+
"read-var-info", "run-libc-freeres", "run-cxx-freeres", "fair-sched", "sigill-diagnostics", "show-emwarns", "vgdb-shadow-registers", "sim-hints",
|
|
406
|
+
"kernel-variant", "soname-synonyms", "resync-filter", "tool",
|
|
407
|
+
"leak-check", "leak-resolution", "show-leak-kinds", "errors-for-leak-kinds", "leak-check-heuristics", "show-reachable", "show-possibly-lost", "xtree-leak",
|
|
408
|
+
"undef-value-errors", "track-origins", "partial-loads-ok", "expensive-definedness-checks", "workaround-gcc296-bugs", "ignore-ranges", "ignore-range-below-sp",
|
|
409
|
+
"malloc-fill", "free-fill", "keep-stacktraces", "show-mismatched-frees",
|
|
410
|
+
];
|
|
411
|
+
const VALGRIND_COUNTS = [
|
|
412
|
+
"vgdb-error", "log-fd", "xml-fd", "num-callers", "error-exitcode", "input-fd", "max-stackframe", "main-stacksize", "alignment", "redzone-size",
|
|
413
|
+
"max-threads", "merge-recursive-frames", "num-transtab-sectors", "avg-transtab-entry-size", "valgrind-stacksize", "vgdb-poll",
|
|
414
|
+
"unw-stack-scan-thresh", "unw-stack-scan-frames", "freelist-vol", "freelist-big-blocks",
|
|
415
|
+
];
|
|
416
|
+
const VALGRIND_OUTPUT_FILES = ["log-file", "xml-file", "xtree-memory-file", "xtree-leak-file", "callgrind-out-file", "cachegrind-out-file", "massif-out-file", "dhat-out-file"];
|
|
417
|
+
const VALGRIND_WRITE = { kind: "path", effect: "write", programEnv: true };
|
|
418
|
+
const VALGRIND_READ = { kind: "path", effect: "read", programEnv: true };
|
|
419
|
+
const VALGRIND = launcherGrammar({
|
|
420
|
+
switches: ["-q", "-v", "-s", "--quiet", "--verbose", "-h", "--help", "--help-debug", "--help-dyn-options", "--version"],
|
|
421
|
+
banners: ["-h", "--help", "--help-debug", "--help-dyn-options", "--version"],
|
|
422
|
+
optional: {
|
|
423
|
+
...Object.fromEntries(VALGRIND_FLAGS.map((n) => [`--${n}`, LABEL])),
|
|
424
|
+
...Object.fromEntries(VALGRIND_COUNTS.map((n) => [`--${n}`, COUNT])),
|
|
425
|
+
...Object.fromEntries(VALGRIND_OUTPUT_FILES.map((n) => [`--${n}`, VALGRIND_WRITE])),
|
|
426
|
+
"--suppressions": VALGRIND_READ,
|
|
427
|
+
},
|
|
428
|
+
}, { acceptsAbbreviations: false, stepsDashDash: true });
|
|
429
|
+
const SETPRIV = launcherGrammar({
|
|
430
|
+
switches: ["--nnp", "--no-new-privs", "--clear-groups", "--keep-groups", "--init-groups", "--reset-env", "-d", "--dump", "-h", "--help", "-V", "--version"],
|
|
431
|
+
banners: ["-d", "--dump", "-h", "--help", "-V", "--version"],
|
|
432
|
+
values: Object.fromEntries(["ambient-caps", "inh-caps", "bounding-set", "ruid", "euid", "rgid", "egid", "reuid", "regid", "groups", "securebits", "pdeathsig", "selinux-label", "apparmor-profile"].map((n) => [`--${n}`, LABEL])),
|
|
433
|
+
}, { stepsDashDash: true });
|
|
434
|
+
const CHROOT_GRAMMARS = implementations(launcherGrammar({ switches: ["--skip-chdir", "--help", "--version"], values: { "--userspec": LABEL, "--groups": LABEL, "-u": LABEL, "-g": LABEL, "-G": LABEL } }, { stepsDashDash: true }), { lacks: ["-u", "-g", "-G"] }, { lacks: ["--skip-chdir", "--help", "--version", "--userspec", "--groups"] });
|
|
435
|
+
const PRLIMIT_RESOURCES = { c: "core", d: "data", e: "nice", f: "fsize", i: "sigpending", l: "memlock", m: "rss", n: "nofile", q: "msgqueue", r: "rtprio", s: "stack", t: "cpu", u: "nproc", v: "as", x: "locks", y: "rttime" };
|
|
436
|
+
const PRLIMIT = launcherGrammar({
|
|
437
|
+
switches: ["--noheadings", "--raw", "--verbose", "-h", "--help", "-V", "--version"],
|
|
438
|
+
banners: ["-h", "--help", "-V", "--version"],
|
|
439
|
+
values: { "-p": COUNT, "--pid": COUNT, "-o": LABEL, "--output": LABEL },
|
|
440
|
+
optional: Object.fromEntries(Object.entries(PRLIMIT_RESOURCES).flatMap(([letter, name]) => [[`-${letter}`, LABEL], [`--${name}`, LABEL]])),
|
|
441
|
+
}, { stepsDashDash: true });
|
|
399
442
|
const SU_LINUX_ONLY = [...SU_OPTIONS.switches, ...Object.keys(SU_OPTIONS.values), ...SU_OPTIONS.shellText, ...SU_OPTIONS.programs].filter((s) => !["-f", "-l", "-m"].includes(s));
|
|
400
443
|
const launchers = [
|
|
401
444
|
{ key: "env", grammars: implementations(launcherGrammar({
|
|
@@ -427,8 +470,8 @@ const launchers = [
|
|
|
427
470
|
launcher("pkexec", { whenNoProgram: "shell" }, launcherGrammar({ switches: ["--disable-internal-agent", "--keep-cwd", "--version", "--help"], values: { "--user": LABEL } }), { witness: PRIVILEGED }),
|
|
428
471
|
{ key: "su", grammars: implementations(SU, { afterFirstOperand: "options" }, { lacks: SU_LINUX_ONLY, afterFirstOperand: "operands" }), launcher: { shellText: "user", asUser: { home: "target", loginWith: ["-l", "--login"] } }, witness: PRIVILEGED },
|
|
429
472
|
{ key: "runuser", grammars: [launcherGrammar({ ...SU_OPTIONS, values: { ...SU_OPTIONS.values, "-u": LABEL, "--user": LABEL } }, { afterFirstOperand: "options", stepsDashDash: true })], launcher: { shellText: "user", programWith: ["-u", "--user"], asUser: { home: "target", loginWith: ["-l", "--login"] } }, witness: PRIVILEGED },
|
|
430
|
-
|
|
431
|
-
launcher("setpriv", {},
|
|
473
|
+
{ key: "chroot", grammars: CHROOT_GRAMMARS, launcher: { requiredOperands: 1, whenNoProgram: "shell" }, witness: PRIVILEGED },
|
|
474
|
+
launcher("setpriv", {}, SETPRIV, { witness: PRIVILEGED }),
|
|
432
475
|
launcher("nohup", {}, grammar({}, BANNERS, { stepsDashDash: true })),
|
|
433
476
|
{ key: "nice", grammars: implementations(grammar({ n: val(COUNT) }, { adjustment: val(COUNT), ...BANNERS }, { stepsDashDash: true }), {}, { lacks: ["--adjustment", "--help", "--version"] }), launcher: { negativeIntegerIsOwnArgument: true }, witness: BINARY },
|
|
434
477
|
launcher("ionice", {}, launcherGrammar({
|
|
@@ -470,7 +513,7 @@ const launchers = [
|
|
|
470
513
|
}), { witness: LINUX_NAMESPACE }),
|
|
471
514
|
launcher("script", { shellText: "joined" }, launcherGrammar({ shellText: ["-c", "--command"] }), { witness: SHELL_TEXT_LAUNCHER }),
|
|
472
515
|
launcher("numactl", {}, undefined, { witness: LINUX_NAMESPACE }),
|
|
473
|
-
launcher("prlimit", {},
|
|
516
|
+
launcher("prlimit", {}, PRLIMIT, { witness: LINUX_NAMESPACE }),
|
|
474
517
|
launcher("systemd-run", {}, undefined, { witness: { declared: "hands the program to a service manager" } }),
|
|
475
518
|
launcher("strace", {}, launcherGrammar({
|
|
476
519
|
switches: ["-f", "-c", "-C", "-d", "-D", "-h", "-i", "-k", "-q", "-r", "-t", "-T", "-v", "-V", "-w", "-x", "-y", "-z", "-Z", "-F", "--follow-forks", "--summary-only", "--summary", "--debug", "--help", "--version"],
|
|
@@ -486,7 +529,7 @@ const launchers = [
|
|
|
486
529
|
banners: ["-V"],
|
|
487
530
|
values: { "-a": COUNT, "-A": COUNT, "-e": LABEL, "-l": NAMES, "-n": COUNT, "-o": WRITE, "-p": COUNT, "-s": COUNT, "-u": LABEL, "-x": LABEL, "-D": LABEL, "-F": READ, "-w": COUNT, "--align": COUNT, "--config": READ, "--debug": LABEL, "--indent": COUNT, "--library": NAMES, "--output": WRITE, "--string-max": COUNT, "--where": COUNT },
|
|
488
531
|
}), { witness: LINUX_NAMESPACE }),
|
|
489
|
-
launcher("valgrind"),
|
|
532
|
+
launcher("valgrind", {}, VALGRIND),
|
|
490
533
|
launcher("firejail", { whenNoProgram: "shell" }, undefined, { witness: LINUX_NAMESPACE }),
|
|
491
534
|
launcher("bwrap", {}, undefined, { witness: LINUX_NAMESPACE }),
|
|
492
535
|
];
|
|
@@ -507,12 +550,25 @@ const GIT_GREP = {
|
|
|
507
550
|
traversal: { discloses: "contents", always: true },
|
|
508
551
|
};
|
|
509
552
|
const gitObjectSubcommand = (short = {}, long = {}) => ({ grammar: grammar(short, long), operands: { rest: OBJECT_PATH } });
|
|
553
|
+
const GIT_RUNS_LATER = [
|
|
554
|
+
...["core.pager", "core.editor", "sequence.editor", "core.sshcommand", "core.gitproxy", "core.askpass", "core.alternaterefscommand",
|
|
555
|
+
"diff.external", "diff.*.command", "diff.*.textconv", "merge.*.driver", "filter.*.clean", "filter.*.smudge", "filter.*.process",
|
|
556
|
+
"difftool.*.cmd", "difftool.*.path", "mergetool.*.cmd", "mergetool.*.path", "interactive.difffilter",
|
|
557
|
+
"gpg.program", "gpg.*.program", "gpg.ssh.defaultkeycommand", "browser.*.cmd", "browser.*.path", "man.*.cmd", "man.*.path",
|
|
558
|
+
"guitool.*.cmd", "instaweb.httpd", "trailer.*.cmd", "trailer.*.command", "uploadpack.packobjectshook", "gc.recentobjectshook",
|
|
559
|
+
"remote.*.receivepack", "remote.*.uploadpack",
|
|
560
|
+
"sendemail.*tocmd", "sendemail.*cccmd", "sendemail.*headercmd", "sendemail.*sendmailcmd", "sendemail.*smtpserver"].map((key) => ({ key })),
|
|
561
|
+
{ key: "pager.*", orBoolean: true }, { key: "core.fsmonitor", orBoolean: true },
|
|
562
|
+
{ key: "alias.*", bang: true }, { key: "credential.helper", prefixed: "git credential-" }, { key: "credential.*.helper", prefixed: "git credential-" },
|
|
563
|
+
];
|
|
510
564
|
const git = {
|
|
511
565
|
key: "git",
|
|
512
|
-
grammars: [grammar({ p: SWITCH, P: SWITCH, C: val(WORKDIR), c: val() }, {
|
|
566
|
+
grammars: [grammar({ p: SWITCH, P: SWITCH, C: val(WORKDIR), c: val(undefined, { runsLater: { keys: GIT_RUNS_LATER } }) }, {
|
|
513
567
|
...longSwitches(["paginate", "no-pager", "bare", "no-replace-objects", "literal-pathspecs", "glob-pathspecs", "noglob-pathspecs", "icase-pathspecs", "no-optional-locks"]),
|
|
514
|
-
"git-dir": val(WORKDIR), "work-tree": val(WORKDIR), namespace: val(), "config-env": val(), "super-prefix": val(),
|
|
515
|
-
|
|
568
|
+
"git-dir": val(WORKDIR), "work-tree": val(WORKDIR), namespace: val(), "config-env": val(undefined, { runsLater: { keys: GIT_RUNS_LATER, valueFrom: "environment" } }), "super-prefix": val(),
|
|
569
|
+
version: { arity: 0, mode: "banner" },
|
|
570
|
+
}, { acceptsAbbreviations: false })],
|
|
571
|
+
body: "option-values",
|
|
516
572
|
subcommands: {
|
|
517
573
|
commit: gitSubcommand("apsnvqeioz", "Su", "mFCct", ["message", "file", "template", "pathspec-from-file", "author", "date", "cleanup", "fixup", "squash", "trailer", "reuse-message", "reedit-message"]),
|
|
518
574
|
tag: gitSubcommand("asfdvle", "n", "mFu", ["message", "file", "local-user", "cleanup", "trailer", "sort", "format", "contains", "no-contains", "points-at", "merged", "no-merged"]),
|
|
@@ -562,7 +618,7 @@ const CONTAINER_RUN = {
|
|
|
562
618
|
};
|
|
563
619
|
const containerRuntime = (key) => ({
|
|
564
620
|
key,
|
|
565
|
-
grammars: [grammar({ H: val(LABEL), c: val(LABEL), l: val(LABEL), D: SWITCH }, { host: val(LABEL), context: val(LABEL), "log-level": val(LABEL), config: val(READ), tlscacert: val(READ), tlscert: val(READ), tlskey: val(READ), ...longSwitches(["debug", "tls", "tlsverify"]) })],
|
|
621
|
+
grammars: [grammar({ H: val(LABEL), c: val(LABEL), l: val(LABEL), D: SWITCH }, { host: val(LABEL), context: val(LABEL), "log-level": val(LABEL), config: val(READ), tlscacert: val(READ), tlscert: val(READ), tlskey: val(READ), ...longSwitches(["debug", "tls", "tlsverify"]) }, { acceptsAbbreviations: false })],
|
|
566
622
|
operands: { assignmentArguments: "not-paths" },
|
|
567
623
|
subcommands: { run: CONTAINER_RUN, create: CONTAINER_RUN },
|
|
568
624
|
witness: { declared: "a build tool / container client: what a NAME=value argument means is the build's or the container's" },
|
|
@@ -595,8 +651,8 @@ const copyGrammars = (bsdSuffixSwitch, destination) => implementations(grammar({
|
|
|
595
651
|
const writerRows = [
|
|
596
652
|
{ key: "mkdir", grammars: [], operands: { rest: CREATED, dash: "file" }, witness: BINARY },
|
|
597
653
|
{ key: "touch", grammars: implementations(grammar({ h: { arity: 0, writesAt: ["landing", "entry"] } }, { "no-dereference": { arity: 0, writesAt: ["landing", "entry"] } }), {}, { lacks: ["--no-dereference"] }), operands: { rest: TOUCHED, dash: "file" }, witness: BINARY },
|
|
598
|
-
{ key: "rm", grammars: implementations(grammar({ ...switches("rR", { selects: "traversal" }), f: { arity: 0, mode: "forced" } }, { ...longSwitches(["recursive"], { selects: "traversal" }), force: { arity: 0, mode: "forced" } }), {}, { lacks: ["--recursive", "--force"] }), operands: { rest: REMOVED, dash: "file" }, witness: BINARY },
|
|
599
|
-
{ key: "rmdir", grammars: implementations(grammar({ p: { arity: 0, effect: "writes" } }, { parents: { arity: 0, effect: "writes" } }), {}, { lacks: ["--parents"] }), operands: { rest: REMOVED, dash: "file" }, witness: BINARY },
|
|
654
|
+
{ key: "rm", grammars: implementations(grammar({ ...switches("rR", { selects: "traversal" }), f: { arity: 0, mode: "forced" }, ...switches("diIvPWx", { effect: "none" }) }, { ...longSwitches(["recursive"], { selects: "traversal" }), force: { arity: 0, mode: "forced" }, ...longSwitches(["dir", "verbose", "one-file-system", "no-preserve-root", "-presume-input-tty"], { effect: "none" }), interactive: { arity: "attached", value: LABEL, effect: "none" }, "preserve-root": { arity: "attached", value: LABEL, effect: "none" }, ...BANNERS }), { lacks: ["-P", "-W", "-x"] }, { lacks: ["--recursive", "--force", "--dir", "--verbose", "--one-file-system", "--no-preserve-root", "---presume-input-tty", "--interactive", "--preserve-root", "--help", "--version"] }), operands: { rest: REMOVED, dash: "file" }, optionsComplete: true, witness: BINARY },
|
|
655
|
+
{ key: "rmdir", grammars: implementations(grammar({ p: { arity: 0, effect: "writes" }, v: { arity: 0, effect: "none" } }, { parents: { arity: 0, effect: "writes" }, ...longSwitches(["verbose", "ignore-fail-on-non-empty"], { effect: "none" }), ...BANNERS }), {}, { lacks: ["--parents", "--verbose", "--ignore-fail-on-non-empty", "--help", "--version"] }), operands: { rest: REMOVED, dash: "file" }, optionsComplete: true, witness: BINARY },
|
|
600
656
|
{ key: "tee", grammars: [], operands: { rest: WRITE_THROUGH, dash: "file" }, witness: BINARY },
|
|
601
657
|
{ key: "cp", grammars: copyGrammars(true, COPY_DESTINATION), operands: { rest: COPY_SOURCE, last: COPY_DESTINATION, dash: "file" }, witness: BINARY },
|
|
602
658
|
{ key: "mv", grammars: copyGrammars(false, MOVE_DESTINATION), operands: { rest: MOVE_SOURCE, last: MOVE_DESTINATION, dash: "file" }, witness: BINARY },
|
|
@@ -651,6 +707,7 @@ export const PROGRAM_ROWS = [
|
|
|
651
707
|
...[...shellWordsOf("stack_mover")].map((key) => ({ key, grammars: [], movesBase: "stack", witness: BUILTIN_ONLY })),
|
|
652
708
|
...SHELLS.map((s) => shellRow(s, "c-option", BINARY, [SHELL_GRAMMARS[s]], "script")),
|
|
653
709
|
shellRow("eval", "words", BUILTIN_ONLY), shellRow("source", "file-operand", BUILTIN_ONLY), shellRow(".", "file-operand", BUILTIN_ONLY), shellRow("parallel", "non-option-words", BINARY, [], "script"),
|
|
710
|
+
shellRow("fc", "history", BUILTIN_ONLY, [grammar({ ...switches("nr"), s: { arity: 0, effect: "executes" }, ...switches("l", { mode: "banner" }), e: val(COMMAND, { executesWhenValue: "-" }) }, {}, { afterFirstOperand: "operands" })]),
|
|
654
711
|
...codeBodyRows,
|
|
655
712
|
...[...shellWordsOf("block")].map((k) => block(k, BLOCK_GRAMMARS[k])),
|
|
656
713
|
];
|
|
@@ -5,6 +5,7 @@ import { thrownText } from "../../core/thrown-value.js";
|
|
|
5
5
|
import { agentConfigDirTail } from "../../core/agent-config-dir.js";
|
|
6
6
|
import { validatePath } from "../../core/effective-path-target.js";
|
|
7
7
|
import { readDenyPatternRun, readDenyRowAnchor, readDenyRunHead } from "./read-deny.js";
|
|
8
|
+
import { isAbsence } from "./shell-read-environment.js";
|
|
8
9
|
export const AUXILIARY_HOME_PROBE_MS = 2_000;
|
|
9
10
|
const said = new Set();
|
|
10
11
|
function sayOnce(kind, line) {
|
|
@@ -75,7 +76,7 @@ async function homeSpellingsOf(env, home, signal) {
|
|
|
75
76
|
const canonical = await env.canonicalPath(home, signal);
|
|
76
77
|
if (canonical.ok)
|
|
77
78
|
return { spellings: canonical.value !== home ? [home, canonical.value] : [home], canonical: canonical.value, answered: true };
|
|
78
|
-
return { spellings: [home], answered: canonical.error.code
|
|
79
|
+
return { spellings: [home], answered: isAbsence(canonical.error.code) };
|
|
79
80
|
}
|
|
80
81
|
catch {
|
|
81
82
|
return { spellings: [home], answered: false };
|
|
@@ -202,7 +203,7 @@ export async function whereItsAnsweredPrefixLeads(env, at, family = pathFamilyOf
|
|
|
202
203
|
}
|
|
203
204
|
const NO_CHAIN = { ancestors: [], whole: false, unread: [] };
|
|
204
205
|
const unreadChain = (at) => ({ ancestors: [], whole: false, unread: [at] });
|
|
205
|
-
const identityUnread = (id) => id === undefined || (!id.ok && id.error.code
|
|
206
|
+
const identityUnread = (id) => id === undefined || (!id.ok && !isAbsence(id.error.code) && id.error.code !== "not_supported");
|
|
206
207
|
async function chainAbove(env, identity, canonical, signal, deadline) {
|
|
207
208
|
let own;
|
|
208
209
|
const ancestors = [];
|
|
@@ -115,7 +115,7 @@ export declare function ruleHeadParts(rows: readonly Pick<PathRuleDenyRow, "head
|
|
|
115
115
|
* below that part. Every part, not the head alone: a link inside the rule's literal prefix that is re-pointed after the
|
|
116
116
|
* rows were placed still meets the row through the parts above it. One rule for every row form and every judge (the
|
|
117
117
|
* gate's lanes and the deny tables): the reference compiles the same "physical twin" of every deny / ask rule's literal
|
|
118
|
-
* prefix
|
|
118
|
+
* prefix. `leads` is the leg's resolution of each part (absent or
|
|
119
119
|
* `undefined` = no twin there); a part that only extends its parent's resolution adds no row. A twin is the row's own
|
|
120
120
|
* kind (it keeps every member but the head), so a judgment reports the rule the twin stands for.
|
|
121
121
|
*/
|
|
@@ -416,12 +416,32 @@ export declare function activeReadDenyBuiltinTiers(config?: ReadDenyBuiltinConfi
|
|
|
416
416
|
* renders "what COULD be switched on".
|
|
417
417
|
*/
|
|
418
418
|
export declare const READ_FACE_DEFAULT_DENY_ENTRIES: readonly ReadDenyEntry[];
|
|
419
|
+
/**
|
|
420
|
+
* The fold the "unicode" mode applies — the one a RegExp `i` flag without `u` applies, one UTF-16 code unit at a time: the
|
|
421
|
+
* upper-case mapping when it is a single unit and does not step from a non-ASCII unit down into ASCII (`ı` and `ſ` stay
|
|
422
|
+
* themselves, `ß` stays `ß`). Both sides of a comparison go through it.
|
|
423
|
+
*/
|
|
424
|
+
export declare function ignoreCaseFold(s: string): string;
|
|
425
|
+
/** How a compiled pattern compares: `none` byte for byte; `ascii` and `unicode` through the fold of that name, both sides —
|
|
426
|
+
* the pattern's side at compile, the segments' side by whoever tests (once per path: {@link segmentReadingsOf}). */
|
|
427
|
+
export type SegmentFold = "none" | "ascii" | "unicode";
|
|
428
|
+
/** The function that folds a string as each fold folds — the one place that says which function that is (the pattern at compile,
|
|
429
|
+
* a path's segments in the readings, an anchor's segments all read it, at the time they fold). */
|
|
430
|
+
export declare const SEGMENT_FOLDS: Record<SegmentFold, (s: string) => string>;
|
|
431
|
+
/** One compiled segment of a pattern: `*` stands for any run of characters but a separator, every other character for itself. */
|
|
432
|
+
export interface SegmentMatcher {
|
|
433
|
+
/** Does the whole of `segment` match? The segment is folded as the pattern's fold folds ({@link CompiledSegmentPattern.fold}) —
|
|
434
|
+
* by the caller; a segment that holds a separator never matches. */
|
|
435
|
+
test(segment: string): boolean;
|
|
436
|
+
/** The pattern is stars only: it matches every one segment. */
|
|
437
|
+
readonly anything: boolean;
|
|
438
|
+
}
|
|
419
439
|
/** A compiled segment-run pattern (shared engine — the write guard delegates here too). */
|
|
420
440
|
export interface CompiledSegmentPattern {
|
|
421
441
|
raw: string;
|
|
422
|
-
segments:
|
|
423
|
-
/** Fold BOTH sides
|
|
424
|
-
|
|
442
|
+
segments: SegmentMatcher[];
|
|
443
|
+
/** Fold BOTH sides before testing: compile folded the pattern side; the segments tested are folded the same way. */
|
|
444
|
+
fold: SegmentFold;
|
|
425
445
|
/** The segment lists of the directories the run is ANCHORED at (folded as the pattern folds): the run must start
|
|
426
446
|
* right after one of them. Absent = the run matches anywhere. */
|
|
427
447
|
anchors?: readonly (readonly string[])[];
|
|
@@ -437,12 +457,14 @@ export interface CompiledSegmentPattern {
|
|
|
437
457
|
* Compile one segment-glob pattern (shared engine). `fold`:
|
|
438
458
|
* · "none" — byte-exact segments;
|
|
439
459
|
* · "ascii" — ASCII-case-insensitive (deny-set contract);
|
|
440
|
-
* · "unicode" — RegExp `i` flag (the write guard's historical host-keyed
|
|
441
|
-
*
|
|
460
|
+
* · "unicode" — the fold a RegExp `i` flag applies, {@link ignoreCaseFold} (the write guard's historical host-keyed
|
|
461
|
+
* behavior — kept for it answer for answer; NOT used by the deny set).
|
|
462
|
+
* The pattern is folded here, once; the segments a row is tested on are folded by whoever tests, once per path
|
|
463
|
+
* ({@link segmentReadingsOf}) — never once per row per test.
|
|
442
464
|
* Returns null when the pattern reduces to zero segments — the CALLER owns its loud path (the two
|
|
443
465
|
* consumers refuse with their own surface-specific texts).
|
|
444
466
|
*/
|
|
445
|
-
export declare function compileSegmentPattern(raw: string, fold:
|
|
467
|
+
export declare function compileSegmentPattern(raw: string, fold: SegmentFold): CompiledSegmentPattern | null;
|
|
446
468
|
/**
|
|
447
469
|
* Does the path contain a compiled pattern as a CONTIGUOUS run of full path segments? (Shared engine:
|
|
448
470
|
* `.git/hooks` matches `/repo/.git/hooks/pre-commit`; `.ssh` matches any `.ssh` segment.) An ANCHORED pattern
|