@sema-agent/core 7.70.0 → 7.71.1
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 +740 -0
- package/dist/agents/agent-transcript-tool.js +43 -19
- package/dist/agents/inherited-tool-pool.d.ts +5 -1
- package/dist/agents/inherited-tool-pool.js +6 -0
- package/dist/agents/retain-ledger.js +2 -0
- package/dist/agents/send-message-tool.d.ts +12 -1
- package/dist/agents/send-message-tool.js +47 -9
- package/dist/agents/subagent.js +31 -10
- package/dist/agents/tool-filter.js +1 -2
- package/dist/agents/verify.js +13 -2
- package/dist/agents/yield-adoption.js +11 -1
- package/dist/brain/claude-model-id.d.ts +11 -0
- package/dist/brain/claude-model-id.js +3 -1
- package/dist/config/catalog.js +10 -1
- package/dist/config/defaults.d.ts +3 -0
- package/dist/config/defaults.js +1 -0
- package/dist/core/allow-entry.js +1 -2
- package/dist/core/ask-origin.d.ts +55 -21
- package/dist/core/ask-origin.js +19 -11
- package/dist/core/ask-question.d.ts +4 -7
- package/dist/core/ask-question.js +2 -4
- package/dist/core/ask-unresolvable-notice.d.ts +17 -3
- package/dist/core/ask-unresolvable-notice.js +18 -4
- package/dist/core/attachment-source.d.ts +1 -1
- package/dist/core/attachment-source.js +2 -0
- package/dist/core/auto-compaction.d.ts +14 -4
- package/dist/core/auto-compaction.js +3 -2
- package/dist/core/auto-strip.js +2 -0
- package/dist/core/caller-text.d.ts +2 -33
- package/dist/core/caller-text.js +2 -23
- package/dist/core/caller-tool-name.js +1 -2
- package/dist/core/canonical-json.d.ts +9 -0
- package/dist/core/canonical-json.js +6 -0
- package/dist/core/checkpoint-features.d.ts +43 -80
- package/dist/core/checkpoint-features.js +10 -20
- package/dist/core/checkpoint-generation.d.ts +89 -19
- package/dist/core/checkpoint-generation.js +89 -14
- package/dist/core/checkpoint-queries.d.ts +95 -15
- package/dist/core/checkpoint-queries.js +108 -7
- package/dist/core/checkpoint-rekey.d.ts +2 -1
- package/dist/core/checkpoint-rekey.js +2 -2
- package/dist/core/checkpoint-requirements.d.ts +21 -7
- package/dist/core/checkpoint-requirements.js +2 -5
- package/dist/core/checkpoint-row-verdict.d.ts +3 -4
- package/dist/core/checkpoint-row-verdict.js +20 -41
- package/dist/core/checkpoint-store.d.ts +69 -41
- package/dist/core/checkpoint-store.js +28 -14
- package/dist/core/command-sandbox.d.ts +5 -3
- package/dist/core/command-sandbox.js +17 -9
- package/dist/core/config-refusal-codes.d.ts +1 -1
- package/dist/core/config-refusal-codes.js +1 -0
- package/dist/core/declaration-words.d.ts +2 -1
- package/dist/core/declaration-words.js +13 -2
- package/dist/core/effective-path-target.d.ts +23 -0
- package/dist/core/effective-path-target.js +15 -1
- package/dist/core/engine-attestation.d.ts +5 -1
- package/dist/core/engine-attestation.js +1 -0
- package/dist/core/engine-capabilities.d.ts +14 -9
- package/dist/core/engine-capabilities.js +1 -1
- package/dist/core/engine-notice.d.ts +62 -32
- package/dist/core/engine-version.js +1 -1
- package/dist/core/entries-not-applied.d.ts +1 -1
- package/dist/core/entries-not-applied.js +1 -0
- package/dist/core/file-history-store.d.ts +95 -11
- package/dist/core/file-history-store.js +117 -19
- package/dist/core/gate-fold.js +13 -7
- package/dist/core/gate-lanes.js +9 -9
- package/dist/core/governance-codes.d.ts +56 -7
- package/dist/core/governance-codes.js +105 -7
- package/dist/core/grant-holder.d.ts +53 -0
- package/dist/core/grant-holder.js +80 -0
- package/dist/core/hooks.d.ts +7 -3
- package/dist/core/hooks.js +2 -2
- package/dist/core/locked-config.d.ts +7 -1
- package/dist/core/locked-config.js +9 -2
- package/dist/core/mcp-call-meta.d.ts +52 -7
- package/dist/core/mcp-call-meta.js +21 -2
- package/dist/core/mcp-host-read.d.ts +1 -1
- package/dist/core/mcp-server-spec.d.ts +18 -0
- package/dist/core/mcp-server-spec.js +1 -0
- package/dist/core/mcp.js +2 -2
- package/dist/core/member-outcome.d.ts +22 -1
- package/dist/core/member-outcome.js +18 -6
- package/dist/core/memory-engine/delegation-settlement.js +5 -5
- package/dist/core/memory-engine/engine.js +19 -19
- package/dist/core/memory-engine/file-backend.d.ts +7 -2
- package/dist/core/memory-engine/file-backend.js +14 -12
- package/dist/core/memory-engine/frontmatter.js +1 -1
- package/dist/core/memory-engine/index.d.ts +1 -0
- package/dist/core/memory-engine/index.js +1 -0
- package/dist/core/memory-engine/layout.d.ts +34 -9
- package/dist/core/memory-engine/layout.js +36 -19
- package/dist/core/memory-engine/memory-deployment.js +8 -8
- package/dist/core/memory-engine/mount-failed-notice.d.ts +8 -5
- package/dist/core/memory-engine/mount-failed-notice.js +5 -2
- package/dist/core/mode-policy.d.ts +5 -0
- package/dist/core/mode-policy.js +6 -0
- package/dist/core/mods/host.d.ts +2 -1
- package/dist/core/mods/host.js +7 -6
- package/dist/core/mods/kernel/index.d.ts +1 -1
- package/dist/core/mods/kernel/index.js +1 -1
- package/dist/core/mods/kernel/registration.d.ts +5 -2
- package/dist/core/mods/kernel/registration.js +19 -3
- package/dist/core/mods/package.d.ts +12 -1
- package/dist/core/mods/package.js +36 -9
- package/dist/core/mods/stations.d.ts +7 -1
- package/dist/core/mods/stations.js +17 -3
- package/dist/core/mods/teammate-stations.d.ts +4 -1
- package/dist/core/mods/teammate-stations.js +1 -1
- package/dist/core/native-signal.d.ts +13 -0
- package/dist/core/native-signal.js +18 -0
- package/dist/core/park-resumability.d.ts +16 -14
- package/dist/core/park-resumability.js +9 -4
- package/dist/core/path-rule-binding.js +1 -1
- package/dist/core/permission-rule-model.d.ts +11 -5
- package/dist/core/permission-rule-model.js +5 -3
- package/dist/core/permission-rule-org.js +1 -1
- package/dist/core/permission-rule-provider.d.ts +5 -1
- package/dist/core/permission-rule-provider.js +6 -1
- package/dist/core/permission-rule-session.d.ts +35 -5
- package/dist/core/permission-rule-session.js +32 -1
- package/dist/core/permission-rule-store.d.ts +5 -1
- package/dist/core/permission-rule-store.js +28 -5
- package/dist/core/permission-rules.d.ts +2 -2
- package/dist/core/permission-rules.js +2 -3
- package/dist/core/principal-name.d.ts +12 -0
- package/dist/core/principal-name.js +6 -2
- package/dist/core/read-root-grant-screen.d.ts +7 -6
- package/dist/core/read-root-grant-screen.js +7 -8
- package/dist/core/remote-env.d.ts +42 -8
- package/dist/core/resume-config-judge.js +1 -1
- package/dist/core/resume-startup-cause.d.ts +19 -4
- package/dist/core/resume-startup-cause.js +25 -6
- package/dist/core/rewind-conversation.d.ts +4 -0
- package/dist/core/rewrite-rejudge.d.ts +9 -1
- package/dist/core/rewrite-rejudge.js +11 -1
- package/dist/core/rule-offer-read.js +3 -2
- package/dist/core/runner/assemble-result.d.ts +21 -11
- package/dist/core/runner/assemble-result.js +24 -4
- package/dist/core/runner/boundary-reminders.d.ts +104 -0
- package/dist/core/runner/boundary-reminders.js +108 -0
- package/dist/core/runner/branch-writeback.d.ts +21 -7
- package/dist/core/runner/branch-writeback.js +44 -6
- package/dist/core/runner/command-sandbox-frame.js +2 -1
- package/dist/core/runner/compact-session.js +11 -4
- package/dist/core/runner/constraint-layers.d.ts +24 -5
- package/dist/core/runner/constraint-layers.js +21 -2
- package/dist/core/runner/continuation-gate.js +3 -1
- package/dist/core/runner/contracts.d.ts +83 -13
- package/dist/core/runner/cross-boundary-lane.js +2 -1
- package/dist/core/runner/delegation-owner.d.ts +246 -45
- package/dist/core/runner/delegation-owner.js +237 -63
- package/dist/core/runner/expire-settle.d.ts +17 -0
- package/dist/core/runner/expire-settle.js +8 -2
- package/dist/core/runner/file-history-request.d.ts +4 -3
- package/dist/core/runner/file-history-request.js +4 -1
- package/dist/core/runner/file-history-restore.d.ts +11 -3
- package/dist/core/runner/file-history-restore.js +11 -3
- package/dist/core/runner/gate-exit.d.ts +22 -1
- package/dist/core/runner/gate-exit.js +12 -14
- package/dist/core/runner/nested-memory-content.js +1 -1
- package/dist/core/runner/nested-memory-lane.d.ts +10 -2
- package/dist/core/runner/nested-memory-lane.js +29 -8
- package/dist/core/runner/own-model-money-door.d.ts +13 -0
- package/dist/core/runner/own-model-money-door.js +17 -0
- package/dist/core/runner/park-commit.d.ts +4 -2
- package/dist/core/runner/park-commit.js +2 -1
- package/dist/core/runner/permission-rule-lanes.d.ts +4 -0
- package/dist/core/runner/permission-rule-lanes.js +7 -0
- package/dist/core/runner/person-path-rows.js +1 -1
- package/dist/core/runner/placement-fence.d.ts +8 -2
- package/dist/core/runner/placement-fence.js +8 -3
- package/dist/core/runner/policy-throw.d.ts +3 -2
- package/dist/core/runner/policy-throw.js +2 -2
- package/dist/core/runner/prepare-acquire-reconcile.d.ts +23 -14
- package/dist/core/runner/prepare-acquire-reconcile.js +33 -15
- package/dist/core/runner/prepare-artifact.d.ts +14 -1
- package/dist/core/runner/prepare-artifact.js +7 -2
- package/dist/core/runner/prepare-ask-lane.d.ts +8 -0
- package/dist/core/runner/prepare-ask-lane.js +14 -5
- package/dist/core/runner/prepare-boundary-parks.js +5 -4
- package/dist/core/runner/prepare-config-doors.d.ts +9 -4
- package/dist/core/runner/prepare-config-doors.js +25 -8
- package/dist/core/runner/prepare-defer-classify.d.ts +8 -4
- package/dist/core/runner/prepare-defer-classify.js +6 -6
- package/dist/core/runner/prepare-execution-env.d.ts +4 -1
- package/dist/core/runner/prepare-execution-env.js +8 -3
- package/dist/core/runner/prepare-file-history.d.ts +26 -0
- package/dist/core/runner/prepare-file-history.js +15 -1
- package/dist/core/runner/prepare-inherited-gate.d.ts +8 -3
- package/dist/core/runner/prepare-inherited-gate.js +9 -2
- package/dist/core/runner/prepare-leg-adoption.d.ts +2 -2
- package/dist/core/runner/prepare-park-ask.js +8 -5
- package/dist/core/runner/prepare-policy-chain.d.ts +5 -0
- package/dist/core/runner/prepare-policy-chain.js +18 -7
- package/dist/core/runner/prepare-prompt-assembly.d.ts +3 -0
- package/dist/core/runner/prepare-prompt-assembly.js +4 -3
- package/dist/core/runner/prepare-suspend-saga.d.ts +4 -1
- package/dist/core/runner/prepare-suspend-saga.js +19 -5
- package/dist/core/runner/prepare-task.d.ts +2 -5
- package/dist/core/runner/prepare-task.js +71 -26
- package/dist/core/runner/prepare-turn-wiring.js +7 -5
- package/dist/core/runner/prepare-workspace-restore.js +59 -28
- package/dist/core/runner/read-root-grant.d.ts +1 -0
- package/dist/core/runner/read-root-grant.js +1 -2
- package/dist/core/runner/resume-admission.d.ts +3 -0
- package/dist/core/runner/resume-admission.js +6 -4
- package/dist/core/runner/resume-apply.js +7 -5
- package/dist/core/runner/resume-claim.d.ts +2 -2
- package/dist/core/runner/resume-claim.js +4 -4
- package/dist/core/runner/resume-policy-outcome.d.ts +1 -1
- package/dist/core/runner/resume-policy-outcome.js +6 -4
- package/dist/core/runner/resume-preflight.d.ts +3 -0
- package/dist/core/runner/resume-preflight.js +10 -3
- package/dist/core/runner/rewind-conversation.js +11 -4
- package/dist/core/runner/rewind-files.js +29 -14
- package/dist/core/runner/rewind-outcome.d.ts +27 -0
- package/dist/core/runner/rewind-outcome.js +14 -0
- package/dist/core/runner/run-attachment-seats.js +2 -1
- package/dist/core/runner/run-clock-and-content.js +2 -0
- package/dist/core/runner/run-identity-wiring.js +2 -0
- package/dist/core/runner/run-leg.js +11 -1
- package/dist/core/runner/run-notification-lane.d.ts +3 -0
- package/dist/core/runner/run-notification-lane.js +2 -2
- package/dist/core/runner/run-settle-and-teardown.d.ts +4 -2
- package/dist/core/runner/run-settle-and-teardown.js +52 -40
- package/dist/core/runner/run-stop-and-final-verify.d.ts +4 -0
- package/dist/core/runner/run-stop-and-final-verify.js +5 -4
- package/dist/core/runner/run-terminal-adoption.d.ts +1 -1
- package/dist/core/runner/run-terminal-adoption.js +3 -3
- package/dist/core/runner/run-turn-boundary.js +7 -0
- package/dist/core/runner/runtask.d.ts +7 -4
- package/dist/core/runner/runtask.js +18 -9
- package/dist/core/runner/session-call-grant-station.d.ts +64 -0
- package/dist/core/runner/session-call-grant-station.js +119 -0
- package/dist/core/runner/session-file-state-replay.js +2 -2
- package/dist/core/runner/session-prompt-seats.d.ts +95 -0
- package/dist/core/runner/session-prompt-seats.js +62 -0
- package/dist/core/runner/session-rule-policy.js +1 -1
- package/dist/core/runner/session-write-ledger.d.ts +8 -0
- package/dist/core/runner/session-write-ledger.js +16 -0
- package/dist/core/runner/side-call-account.js +5 -1
- package/dist/core/runner/stop-tail-notice.d.ts +7 -0
- package/dist/core/runner/stop-tail-notice.js +23 -8
- package/dist/core/runner/stream-reap.js +4 -2
- package/dist/core/runner/stream-settle-backstop.d.ts +1 -1
- package/dist/core/runner/stream-settle-backstop.js +17 -18
- package/dist/core/runner/terminal-account.js +17 -8
- package/dist/core/runner/terminal-projection.d.ts +3 -2
- package/dist/core/runner/terminal-projection.js +1 -1
- package/dist/core/runner/tool-turn-repair-seat.d.ts +2 -2
- package/dist/core/runner/tool-turn-repair-seat.js +12 -7
- package/dist/core/runner/turn-attachments.d.ts +22 -1
- package/dist/core/runner/turn-attachments.js +20 -3
- package/dist/core/runner-deps.d.ts +6 -2
- package/dist/core/secret-env.d.ts +26 -6
- package/dist/core/secret-env.js +6 -6
- package/dist/core/session-call-grant-screen.d.ts +58 -0
- package/dist/core/session-call-grant-screen.js +18 -0
- package/dist/core/session-call-grant.d.ts +93 -0
- package/dist/core/session-call-grant.js +524 -0
- package/dist/core/session-checkout.d.ts +3 -0
- package/dist/core/session-checkout.js +8 -3
- package/dist/core/session-policy-store.d.ts +14 -0
- package/dist/core/session-policy-store.js +16 -2
- package/dist/core/session-store.d.ts +18 -1
- package/dist/core/session-store.js +20 -4
- package/dist/core/session.d.ts +36 -4
- package/dist/core/shared-artifact-reads.d.ts +93 -0
- package/dist/core/shared-artifact-reads.js +94 -0
- package/dist/core/skill-grant.js +1 -1
- package/dist/core/skills-directory.d.ts +9 -45
- package/dist/core/skills-directory.js +9 -722
- package/dist/core/spend-account.js +3 -0
- package/dist/core/store-contracts/checkpoint-store-contract.d.ts +22 -4
- package/dist/core/store-contracts/checkpoint-store-contract.js +363 -29
- package/dist/core/store-contracts/file-history-store-contract.d.ts +11 -3
- package/dist/core/store-contracts/file-history-store-contract.js +62 -2
- package/dist/core/store-contracts/grant-fixture.d.ts +52 -0
- package/dist/core/store-contracts/grant-fixture.js +84 -0
- package/dist/core/store-contracts/session-repo-contract.js +18 -0
- package/dist/core/store-contracts/session-store-contract.d.ts +15 -1
- package/dist/core/store-contracts/session-store-contract.js +211 -2
- package/dist/core/store-contracts/workflow-journal-store-contract.js +47 -8
- package/dist/core/suspend-lane-reasons.d.ts +13 -0
- package/dist/core/suspend-lane-reasons.js +5 -0
- package/dist/core/synthetic-read-verdict.d.ts +5 -3
- package/dist/core/synthetic-read-verdict.js +1 -1
- package/dist/core/task-limits.d.ts +15 -0
- package/dist/core/task-notification.d.ts +33 -7
- package/dist/core/task-notification.js +34 -9
- package/dist/core/task-registry-agent.d.ts +1 -1
- package/dist/core/task-registry-agent.js +18 -7
- package/dist/core/task-registry-shared.d.ts +29 -4
- package/dist/core/task-registry-shared.js +7 -0
- package/dist/core/task-registry.d.ts +21 -1
- package/dist/core/task-registry.js +36 -9
- package/dist/core/task-result.d.ts +55 -1
- package/dist/core/task-spec.d.ts +17 -3
- package/dist/core/terminal-cause.d.ts +68 -5
- package/dist/core/tool-catalog-entries.js +1 -1
- package/dist/core/tool-check-reading.js +2 -1
- package/dist/core/tool-errors.js +1 -0
- package/dist/core/tool-list-grammar.d.ts +0 -47
- package/dist/core/tool-list-grammar.js +1 -75
- package/dist/core/tool-model-gate.d.ts +7 -11
- package/dist/core/tool-model-gate.js +5 -8
- package/dist/core/tool-name-aliases.js +2 -3
- package/dist/core/tool-name-readings.d.ts +4 -0
- package/dist/core/tool-name-readings.js +1 -0
- package/dist/core/tool-policy.d.ts +46 -4
- package/dist/core/tool-policy.js +47 -18
- package/dist/core/tool-result-store.d.ts +0 -24
- package/dist/core/tool-result-store.js +1 -36
- package/dist/core/tool-spec.d.ts +8 -4
- package/dist/core/untrusted-egress.js +2 -2
- package/dist/core/untrusted-text.d.ts +8 -0
- package/dist/core/untrusted-text.js +14 -0
- package/dist/core/user-attachment.d.ts +16 -1
- package/dist/core/user-attachment.js +42 -18
- package/dist/core/wiring-manifest.d.ts +4 -9
- package/dist/core/wiring-manifest.js +1 -1
- package/dist/core/workflow-journal-store.d.ts +55 -8
- package/dist/core/workflow-journal-store.js +34 -10
- package/dist/core/workflow-run-store-contract.js +56 -1
- package/dist/core/workflow-run-store.d.ts +43 -19
- package/dist/core/workflow-run-store.js +17 -2
- package/dist/engine/execution-env/node-execution-env.d.ts +3 -0
- package/dist/engine/execution-env/node-execution-env.js +4 -0
- package/dist/engine/harness/agent-harness.d.ts +10 -5
- package/dist/engine/harness/agent-harness.js +12 -4
- package/dist/engine/harness/types.d.ts +18 -0
- package/dist/engine/llm/tool-turns.d.ts +1 -1
- package/dist/engine/llm/types.d.ts +5 -4
- package/dist/engine/session/memory-repo.d.ts +15 -3
- package/dist/engine/session/memory-repo.js +21 -3
- package/dist/engine/session/memory-storage.d.ts +5 -0
- package/dist/engine/session/memory-storage.js +8 -3
- package/dist/engine/session/repo-utils.d.ts +9 -0
- package/dist/engine/session/repo-utils.js +14 -0
- package/dist/engine/session/storage-base.d.ts +20 -7
- package/dist/engine/session/storage-base.js +13 -1
- package/dist/index.d.ts +39 -21
- package/dist/index.js +32 -17
- package/dist/internal/harness.d.ts +1 -1
- package/dist/internal/harness.js +1 -1
- package/dist/orchestration/run-workflow-tool.d.ts +13 -1
- package/dist/orchestration/run-workflow-tool.js +101 -32
- package/dist/orchestration/workflow-park-adoption.d.ts +309 -92
- package/dist/orchestration/workflow-park-adoption.js +588 -323
- package/dist/orchestration/workflow-tree-id.d.ts +66 -0
- package/dist/orchestration/workflow-tree-id.js +66 -0
- package/dist/orchestration/workflow-types.d.ts +90 -11
- package/dist/orchestration/workflow-types.js +10 -1
- package/dist/orchestration/workflow.d.ts +30 -4
- package/dist/orchestration/workflow.js +424 -114
- package/dist/prompt-assembly/catalog/constitution.js +5 -1
- package/dist/prompt-assembly/catalog/core-behavior.d.ts +3 -4
- package/dist/prompt-assembly/catalog/core-behavior.js +61 -22
- package/dist/prompt-assembly/catalog/environment.js +2 -2
- package/dist/prompt-assembly/catalog/events.d.ts +16 -0
- package/dist/prompt-assembly/catalog/events.js +2 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/core-behavior.js +72 -44
- package/dist/prompt-assembly/catalog/locales/zh-Hans/environment.js +2 -2
- package/dist/prompt-assembly/catalog/locales/zh-Hans/events.js +2 -0
- package/dist/prompt-assembly/catalog/schema.d.ts +5 -1
- package/dist/prompt-assembly/catalog/schema.js +2 -0
- package/dist/prompt-assembly/catalog/sections.js +3 -14
- package/dist/prompt-assembly/event-registry.js +2 -0
- package/dist/prompt-assembly/select.js +1 -0
- package/dist/prompt-assembly/tool-catalog.d.ts +10 -7
- package/dist/prompt-assembly/tool-catalog.js +21 -7
- package/dist/prompt-assembly/types.d.ts +3 -0
- package/dist/prompts/default.d.ts +4 -1
- package/dist/prompts/default.js +6 -0
- package/dist/stores/file/checkpoint-store.d.ts +11 -10
- package/dist/stores/file/checkpoint-store.js +36 -10
- package/dist/stores/file/file-history-store.d.ts +6 -0
- package/dist/stores/file/file-history-store.js +21 -4
- package/dist/stores/file/fs-atomic.d.ts +1 -1
- package/dist/stores/file/index.d.ts +14 -4
- package/dist/stores/file/index.js +21 -5
- package/dist/stores/file/process-anchor.d.ts +9 -1
- package/dist/stores/file/session-policy-store.js +2 -17
- package/dist/stores/file/session-store.d.ts +27 -0
- package/dist/stores/file/session-store.js +81 -9
- package/dist/stores/file/workflow-journal-store.d.ts +14 -4
- package/dist/stores/file/workflow-journal-store.js +32 -24
- package/dist/stores/file/workflow-run-store.d.ts +15 -4
- package/dist/stores/file/workflow-run-store.js +76 -0
- package/dist/tools/artifact/artifact-tool.d.ts +10 -3
- package/dist/tools/artifact/artifact-tool.js +16 -1
- package/dist/tools/fs/bash-program-position.d.ts +10 -4
- package/dist/tools/fs/bash-program-position.js +11 -8
- package/dist/tools/fs/bash-readonly-classifier.d.ts +3 -1
- package/dist/tools/fs/bash-readonly-classifier.js +9 -2
- package/dist/tools/fs/find-actions.d.ts +30 -16
- package/dist/tools/fs/find-actions.js +272 -19
- package/dist/tools/fs/fs-bash.js +8 -5
- package/dist/tools/fs/fs-shared.d.ts +0 -29
- package/dist/tools/fs/fs-shared.js +0 -5
- package/dist/tools/fs/fs-write.js +2 -1
- package/dist/tools/fs/read-deny.d.ts +6 -1
- package/dist/tools/fs/read-deny.js +6 -1
- package/dist/tools/fs/read-floor.d.ts +6 -0
- package/dist/tools/fs/read-floor.js +5 -1
- package/dist/tools/fs/removal-actions.d.ts +43 -0
- package/dist/tools/fs/removal-actions.js +25 -0
- package/dist/tools/fs/removal-targets.d.ts +2 -21
- package/dist/tools/fs/removal-targets.js +2 -3
- package/dist/tools/fs/safety.d.ts +37 -1
- package/dist/tools/fs/safety.js +52 -0
- package/dist/tools/fs/shell-climb.d.ts +46 -0
- package/dist/tools/fs/shell-climb.js +79 -0
- package/dist/tools/fs/shell-read-check.js +47 -19
- package/dist/tools/fs/shell-read-establish.js +36 -22
- package/dist/tools/fs/shell-read-judge.d.ts +10 -2
- package/dist/tools/fs/shell-read-judge.js +4 -4
- package/dist/tools/fs/shell-read-plan.d.ts +3 -0
- package/dist/tools/fs/shell-read-plan.js +1 -1
- package/dist/tools/fs/shell-read-workdir.js +3 -2
- package/dist/tools/fs/shell-read-write-targets.d.ts +4 -3
- package/dist/tools/fs/shell-read-write-targets.js +3 -0
- package/package.json +2 -2
- package/test/export-surface.snapshot.json +173 -15
- package/wire-changes/core-stores-sql@7.71.0.json +40 -0
- package/wire-changes/core-stores-sql@7.71.1.json +40 -0
- package/wire-changes/core@7.71.0.json +5827 -0
- package/wire-changes/core@7.71.1.json +118 -0
- package/wire-changes/mods-kernel@7.71.0.json +52 -0
- package/wire-changes/mods-kernel@7.71.1.json +40 -0
- package/wire-changes/primitives@7.71.0.json +473 -0
- package/wire-changes/primitives@7.71.1.json +40 -0
- package/wire-changes/wiki-gate@7.71.0.json +40 -0
- package/wire-changes/wiki-gate@7.71.1.json +40 -0
- package/dist/core/frontmatter-fence.d.ts +0 -10
- package/dist/core/frontmatter-fence.js +0 -6
- package/dist/core/permission-rule-syntax.d.ts +0 -46
- package/dist/core/permission-rule-syntax.js +0 -52
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { canonicalRootsOnce, isAbsence, observeEnvironment } from "./shell-read-environment.js";
|
|
2
2
|
import { anchorSpelling, belowOwnProcessLink, isAbsoluteForFamily, normalizeAbsPathLexically, ownProcessSpelling, pathFamilyOf, withinAnyRoot } from "./safety.js";
|
|
3
|
+
import { landingsOf, noteClimb, readingsAt, withClimbedPatterns, withClimbedViews, withFloorClimbs } from "./shell-climb.js";
|
|
3
4
|
import { boundaryIsTheSandbox } from "../../core/remote-env.js";
|
|
4
5
|
import { resolveOperandSpellings, tildeNamesAnAccount } from "./bash-readonly-classifier.js";
|
|
5
6
|
import { judgedCandidatesOf, sedBackupNames } from "./shell-read-write-targets.js";
|
|
@@ -111,8 +112,8 @@ function placeOperand(base, spelled, homeDir, walks = false) {
|
|
|
111
112
|
}
|
|
112
113
|
function placedSpellings(spelled, bases, homeDir) {
|
|
113
114
|
const out = [];
|
|
114
|
-
for (const base of bases) {
|
|
115
|
-
const at = placeOperand(base,
|
|
115
|
+
for (const [base, word] of bases.flatMap((b) => readingsAt(b, spelled))) {
|
|
116
|
+
const at = placeOperand(base, word, homeDir);
|
|
116
117
|
if (at === undefined || "unplaced" in at)
|
|
117
118
|
continue;
|
|
118
119
|
out.push(at.word.folded);
|
|
@@ -136,8 +137,8 @@ function lexicalReadsOf(candidate, boundary, placed) {
|
|
|
136
137
|
const accountHome = candidate.face !== "write" && tildeNamesAnAccount(candidate.spelled) ? { unresolved: true } : {};
|
|
137
138
|
const out = [];
|
|
138
139
|
const seen = new Set();
|
|
139
|
-
for (const base of bases) {
|
|
140
|
-
const at = placeOperand(base,
|
|
140
|
+
for (const [base, word] of bases.flatMap((b) => readingsAt(b, candidate.spelled))) {
|
|
141
|
+
const at = placeOperand(base, word, boundary.homeDir, candidate.provenance === "traversal_root");
|
|
141
142
|
const why = at !== undefined && "unplaced" in at ? at : undefined;
|
|
142
143
|
const placed = at !== undefined && !("unplaced" in at) ? at : undefined;
|
|
143
144
|
if (placed === undefined || placed.word.standIn === true) {
|
|
@@ -277,7 +278,7 @@ function establishLegOver(seen, readRoots) {
|
|
|
277
278
|
}
|
|
278
279
|
return [...out];
|
|
279
280
|
};
|
|
280
|
-
const resolveWithoutParentSteps = async (p, signal, writeTarget = false, linkHops = WRITE_LINK_HOPS) => {
|
|
281
|
+
const resolveWithoutParentSteps = async (p, signal, writeTarget = false, linkHops = WRITE_LINK_HOPS, climbs) => {
|
|
281
282
|
const parts = p.split(SEP);
|
|
282
283
|
const root = rootPartsOf(parts);
|
|
283
284
|
if (root === undefined)
|
|
@@ -292,7 +293,7 @@ function establishLegOver(seen, readRoots) {
|
|
|
292
293
|
const link = entry.ok && entry.value.kind === "symlink" ? (linkHops > 0 ? await env.readLink?.(at, signal) : void bounded(`"${at}" is a link chain of more than ${WRITE_LINK_HOPS} links, too many to follow to verify where it lands`)) : undefined;
|
|
293
294
|
if (link?.ok === true) {
|
|
294
295
|
const landing = anchorSpelling(family, placeOfParts(parts, parts.length - 1, root), link.value);
|
|
295
|
-
return await resolve([landing, ...[...tail].reverse()].join("/"), signal, true, linkHops - 1);
|
|
296
|
+
return await resolve([landing, ...[...tail].reverse()].join("/"), signal, true, linkHops - 1, climbs);
|
|
296
297
|
}
|
|
297
298
|
if (entry.ok || entry.error.code !== "not_found")
|
|
298
299
|
allAbsent = false;
|
|
@@ -309,44 +310,49 @@ function establishLegOver(seen, readRoots) {
|
|
|
309
310
|
return undefined;
|
|
310
311
|
};
|
|
311
312
|
const parentOf = (canonical) => normalizeAbsPathLexically(`${canonical}/..`);
|
|
312
|
-
const resolve = async (p, signal, writeTarget = false, linkHops = WRITE_LINK_HOPS) => {
|
|
313
|
+
const resolve = async (p, signal, writeTarget = false, linkHops = WRITE_LINK_HOPS, climbs) => {
|
|
313
314
|
if (ownProcessSpelling(p)?.startsWith(".") === true || belowOwnProcessLink(p))
|
|
314
315
|
return { value: p, exact: false };
|
|
315
316
|
const parts = p.split(SEP);
|
|
316
317
|
const first = parts.findIndex((seg) => seg === "..");
|
|
317
318
|
if (first < 0)
|
|
318
|
-
return await resolveWithoutParentSteps(p, signal, writeTarget, linkHops);
|
|
319
|
+
return await resolveWithoutParentSteps(p, signal, writeTarget, linkHops, climbs);
|
|
319
320
|
const headEnd = parts.slice(0, first).reduce((n, seg) => n + seg.length + 1, 0);
|
|
320
|
-
let head = await resolveWithoutParentSteps(p.slice(0, headEnd) || "/", signal, writeTarget, linkHops);
|
|
321
|
+
let head = await resolveWithoutParentSteps(p.slice(0, headEnd) || "/", signal, writeTarget, linkHops, climbs);
|
|
321
322
|
if (head === undefined)
|
|
322
323
|
return undefined;
|
|
323
324
|
let pending = [];
|
|
324
325
|
const flush = async () => {
|
|
325
326
|
if (pending.length === 0)
|
|
326
327
|
return true;
|
|
327
|
-
const next = await resolveWithoutParentSteps([head.value.replace(TRAILING_SEP, ""), ...pending].join("/"), signal, writeTarget, linkHops);
|
|
328
|
+
const next = await resolveWithoutParentSteps([head.value.replace(TRAILING_SEP, ""), ...pending].join("/"), signal, writeTarget, linkHops, climbs);
|
|
328
329
|
pending = [];
|
|
329
330
|
if (next === undefined)
|
|
330
331
|
return false;
|
|
331
332
|
head = next;
|
|
332
333
|
return true;
|
|
333
334
|
};
|
|
335
|
+
let climbing = false;
|
|
334
336
|
for (let i = first; i < parts.length; i++) {
|
|
335
337
|
const seg = parts[i];
|
|
336
338
|
if (seg === "" || seg === ".")
|
|
337
339
|
continue;
|
|
338
340
|
if (seg !== "..") {
|
|
339
341
|
pending.push(seg);
|
|
342
|
+
climbing = false;
|
|
340
343
|
continue;
|
|
341
344
|
}
|
|
342
345
|
if (!(await flush()))
|
|
343
346
|
return undefined;
|
|
344
347
|
if (!head.exact)
|
|
345
348
|
return head;
|
|
349
|
+
if (climbs !== undefined && !climbing)
|
|
350
|
+
climbing = noteClimb(family, head.value, parts.slice(i + 1), climbs);
|
|
346
351
|
head = { value: parentOf(head.value), exact: true };
|
|
347
352
|
}
|
|
348
353
|
return (await flush()) ? head : undefined;
|
|
349
354
|
};
|
|
355
|
+
const climbWalk = (signal) => (p, climbs) => resolve(p, signal, false, WRITE_LINK_HOPS, climbs);
|
|
350
356
|
const literalRootHead = (p, roots) => {
|
|
351
357
|
let best;
|
|
352
358
|
for (const r of [...readRoots, ...roots]) {
|
|
@@ -430,19 +436,23 @@ function establishLegOver(seen, readRoots) {
|
|
|
430
436
|
return undefined;
|
|
431
437
|
return info.value.kind === "directory" ? "directory" : info.value.kind === "file" ? "file" : undefined;
|
|
432
438
|
};
|
|
433
|
-
const entryOf = async (spelling, signal) => {
|
|
439
|
+
const entryOf = async (spelling, signal, climbs) => {
|
|
434
440
|
const parts = spelling.split(SEP);
|
|
435
441
|
const root = rootPartsOf(parts);
|
|
436
442
|
const leaf = parts.pop() ?? "";
|
|
437
443
|
if (leaf === "" || leaf === "." || leaf === ".." || root === undefined || parts.length < root)
|
|
438
|
-
return await resolve(spelling, signal, true);
|
|
439
|
-
const
|
|
444
|
+
return await resolve(spelling, signal, true, WRITE_LINK_HOPS, climbs);
|
|
445
|
+
const up = climbs === undefined ? undefined : [];
|
|
446
|
+
const parent = await resolve(placeOfParts(parts, parts.length, root), signal, true, WRITE_LINK_HOPS, up);
|
|
447
|
+
for (const landing of up ?? [])
|
|
448
|
+
if (!climbs.includes(joinUnder(landing, leaf)))
|
|
449
|
+
climbs.push(joinUnder(landing, leaf));
|
|
440
450
|
if (parent === undefined)
|
|
441
451
|
return undefined;
|
|
442
452
|
return { value: joinUnder(parent.value, leaf), exact: parent.exact, ...(parent.missing !== undefined ? { missing: parent.missing } : {}) };
|
|
443
453
|
};
|
|
444
|
-
const canonicalReadOf = async (candidate, spelling, spellings, established, origin, canonicalKnown, signal, seat = "landing") => {
|
|
445
|
-
const real = canonicalKnown !== undefined ? { value: canonicalKnown, exact: true } : candidate.provenance === "traversal_root" && belowOwnProcessLink(spelling, true) ? { value: spelling, exact: false } : seat === "entry" ? await entryOf(spelling, signal) : await resolve(spelling, signal, candidate.face === "write");
|
|
454
|
+
const canonicalReadOf = async (candidate, spelling, spellings, established, origin, canonicalKnown, signal, seat = "landing", climbs) => {
|
|
455
|
+
const real = canonicalKnown !== undefined ? { value: canonicalKnown, exact: true } : candidate.provenance === "traversal_root" && belowOwnProcessLink(spelling, true) ? { value: spelling, exact: false } : seat === "entry" ? await entryOf(spelling, signal, climbs) : await resolve(spelling, signal, candidate.face === "write", WRITE_LINK_HOPS, climbs);
|
|
446
456
|
if (real === undefined) {
|
|
447
457
|
if (resolverIsAuthoritative)
|
|
448
458
|
return { candidate, established: "unestablishable", spellings, ...(origin !== undefined ? { origin } : {}), cause: `"${spelling}" cannot be resolved to verify where it reads`, unresolved: true };
|
|
@@ -592,13 +602,17 @@ function establishLegOver(seen, readRoots) {
|
|
|
592
602
|
const writtenSeats = { ...judged, written: judged.written === undefined ? seats : landsToo(judged.written) };
|
|
593
603
|
const atSeats = async (spelling, spellings, established, origin, canonicalKnown) => {
|
|
594
604
|
const reads = [];
|
|
595
|
-
|
|
596
|
-
const read = writtenAt(await canonicalReadOf(candidate, spelling, spellings, established, origin, canonicalKnown, signal, seat), writtenSeats, seat);
|
|
605
|
+
const keep = (read, climbed = false) => {
|
|
597
606
|
const same = reads.findIndex((r) => r.established === read.established && r.target === read.target);
|
|
598
607
|
if (same < 0)
|
|
599
|
-
reads.push(read);
|
|
600
|
-
|
|
601
|
-
|
|
608
|
+
return void reads.push(read);
|
|
609
|
+
const [kept, other] = reads[same].written === undefined && read.written !== undefined ? [read, reads[same]] : [reads[same], read];
|
|
610
|
+
reads[same] = climbed ? withClimbedViews(kept, other) : kept;
|
|
611
|
+
};
|
|
612
|
+
for (const seat of seats) {
|
|
613
|
+
const climbs = [];
|
|
614
|
+
keep(writtenAt(await canonicalReadOf(candidate, spelling, spellings, established, origin, canonicalKnown, signal, seat, climbs), writtenSeats, seat));
|
|
615
|
+
await landingsOf(climbs, async (landing) => keep(writtenAt(await canonicalReadOf(candidate, landing, [landing, ...spellings], established, origin, undefined, signal, seat, climbs), writtenSeats, seat), true), bounded);
|
|
602
616
|
}
|
|
603
617
|
return reads;
|
|
604
618
|
};
|
|
@@ -613,7 +627,7 @@ function establishLegOver(seen, readRoots) {
|
|
|
613
627
|
const placed = candidate.repositoryTop === "discovered" && candidate.bases !== "unmodelled" && candidate.bases.length > 0 ? await atRepositoryTops(candidate.bases, signal) : undefined;
|
|
614
628
|
for (const [i, lexical] of lexicalReadsOf(candidate, boundary, placed).entries()) {
|
|
615
629
|
if (lexical.established !== "lexical" || passesUnasked(candidate)) {
|
|
616
|
-
out.push(writtenAt(lexical, writtenSeats, writtenSeats.written.includes("landing") ? "landing" : "entry"));
|
|
630
|
+
out.push(writtenAt(await withFloorClimbs(family, lexical, climbWalk(signal), bounded, signal), writtenSeats, writtenSeats.written.includes("landing") ? "landing" : "entry"));
|
|
617
631
|
continue;
|
|
618
632
|
}
|
|
619
633
|
try {
|
|
@@ -623,7 +637,7 @@ function establishLegOver(seen, readRoots) {
|
|
|
623
637
|
const viewed = (r) => (lexical.ancestorViews === undefined ? r : { ...r, ancestorViews: lexical.ancestorViews });
|
|
624
638
|
if (candidate.expands === "glob") {
|
|
625
639
|
let matched = false;
|
|
626
|
-
for (const p of candidate.pattern === undefined ? spellings : lexicalReadsOf({ ...candidate, spelled: candidate.pattern }, boundary, placed)[i]?.spellings ?? spellings) {
|
|
640
|
+
for (const p of await withClimbedPatterns(family, candidate.pattern === undefined ? spellings : lexicalReadsOf({ ...candidate, spelled: candidate.pattern }, boundary, placed)[i]?.spellings ?? spellings, climbWalk(signal), bounded, signal)) {
|
|
627
641
|
const expanded = await expandGlobCandidate(p, roots, signal);
|
|
628
642
|
if (expanded !== undefined && "unverifiable" in expanded) {
|
|
629
643
|
out.push(viewed({ candidate, established: "unestablishable", spellings, origin: folded, cause: expanded.unverifiable, ...(expanded.unresolved === true ? { unresolved: true } : {}) }));
|
|
@@ -346,18 +346,25 @@ export interface EstablishedRead {
|
|
|
346
346
|
export interface ReadFinding {
|
|
347
347
|
readonly read: EstablishedRead;
|
|
348
348
|
readonly kind: Extract<ShellReadFinding, "deny_hit" | "outside_roots" | "unestablishable" | "unanswered" | "none">;
|
|
349
|
-
/** The deny row that matched, the view it matched on, and — for a write target — the face (`write`) that refused.
|
|
349
|
+
/** The deny row that matched, the view it matched on, and — for a write target — the face (`write`) that refused. `under`: the
|
|
350
|
+
* view is a recursive read's root and the row lies BELOW it (the root holds the row's location; the root itself matches no
|
|
351
|
+
* row) — judged on locations, so nothing says a file is there. */
|
|
350
352
|
readonly deny?: {
|
|
351
353
|
readonly pattern: string;
|
|
352
354
|
readonly matchedView: string;
|
|
353
355
|
readonly face?: "write";
|
|
354
356
|
readonly readRow?: true;
|
|
357
|
+
readonly under?: true;
|
|
355
358
|
};
|
|
356
359
|
/** A `deny_hit` on no row: the read's target is a process-private /proc file (`isProcSensitiveFile`, safety.ts — the set the
|
|
357
360
|
* file read tools refuse), or a tree walk's root holds such files (`holdsProcSensitiveFile`); the view it was matched on. */
|
|
358
361
|
readonly processPrivate?: {
|
|
359
362
|
readonly matchedView: string;
|
|
360
363
|
};
|
|
364
|
+
/** An `unanswered` finding whose reason is that a deny row could not be asked about the read (a recursive read's root may hold a
|
|
365
|
+
* home row no home places; a spelling passes the floor's bound, so it may name a value no row was asked about) — what the
|
|
366
|
+
* station could not check is the deny list, not where the read lands. The account's closing clause reads it. */
|
|
367
|
+
readonly denyRowUnasked?: true;
|
|
361
368
|
readonly containment: "inside" | "outside" | "open" | "unknown";
|
|
362
369
|
/** The ask row this READ meets ({@link ShellReadBoundary.readRuleRows}): the rule's text, and `policy` when the row is the
|
|
363
370
|
* task's permission policy's. Beside any kind but a deny hit — the command's verdict carries it as a fact, and the gate
|
|
@@ -495,7 +502,8 @@ export interface ShellReadFold {
|
|
|
495
502
|
* only RAISE that: the nested text's deny-relation answers count — a deny hit (a refusal is a refusal whatever
|
|
496
503
|
* runs it) and a root that may hold a row no home places — its containment and its other silence do not (an inner
|
|
497
504
|
* `cat inside.txt` vouches nothing about the outer text). A substitution body (`$(…)`, a backtick, `<(…)`) is nested
|
|
498
|
-
* WITHOUT re-entry and folds in full
|
|
505
|
+
* WITHOUT re-entry and folds in full, as does a command line a program hands on ({@link ShellReadPlan.handed}: `find …
|
|
506
|
+
* -exec rm -rf {} +` writes where `rm -rf <start>/*` does) — beside its segment's own `unestablishable`. What a literal printer says the shell is fed ({@link JudgedSegment.printed}) is a
|
|
499
507
|
* text that may not run at all: its deny HITS count, and nothing else it finds or fails to find does.
|
|
500
508
|
*/
|
|
501
509
|
export declare function foldShellReadFindings(judged: JudgedPlan): ShellReadFold;
|
|
@@ -70,19 +70,19 @@ export function judgeRead(read, boundary) {
|
|
|
70
70
|
const folded = normalizeAbsPathLexically(view);
|
|
71
71
|
const under = boundary.denyUnder(folded);
|
|
72
72
|
if (typeof under === "string")
|
|
73
|
-
return { read, kind: "deny_hit", deny: { pattern: under, matchedView: folded }, containment: containmentOf(read, boundary) };
|
|
73
|
+
return { read, kind: "deny_hit", deny: { pattern: under, matchedView: folded, under: true }, containment: containmentOf(read, boundary) };
|
|
74
74
|
if (under !== null && typeof under === "object")
|
|
75
75
|
unplaced ??= under.unplaced;
|
|
76
76
|
}
|
|
77
77
|
if (unplaced !== undefined) {
|
|
78
78
|
const cause = `the home-anchored deny row "${unplaced}" cannot be placed (no home directory is known for this environment), so "${read.target ?? read.candidate.spelled}" may hold it`;
|
|
79
|
-
return { read: { ...read, cause }, kind: "unanswered", containment: containmentOf(read, boundary) };
|
|
79
|
+
return { read: { ...read, cause }, kind: "unanswered", denyRowUnasked: true, containment: containmentOf(read, boundary) };
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
if (read.candidate.floorPastBound === true && deny !== undefined) {
|
|
84
84
|
const cause = `the spellings "${read.candidate.raw}" may take pass the bound the station reads, so it may name a value no deny row was asked about`;
|
|
85
|
-
return { read: { ...read, cause }, kind: "unanswered", containment: writeTarget ? writeContainmentOf(read, boundary) : containmentOf(read, boundary) };
|
|
85
|
+
return { read: { ...read, cause }, kind: "unanswered", denyRowUnasked: true, containment: writeTarget ? writeContainmentOf(read, boundary) : containmentOf(read, boundary) };
|
|
86
86
|
}
|
|
87
87
|
if (writeTarget)
|
|
88
88
|
return judgeWrite(read, boundary);
|
|
@@ -227,7 +227,7 @@ export function foldShellReadFindings(judged) {
|
|
|
227
227
|
raise({ finding: "unestablishable", declined: s.segment });
|
|
228
228
|
}
|
|
229
229
|
for (const n of s.nested)
|
|
230
|
-
walk(n, reading === "full" && s.segment.reentry !== "shell" ? "full" : reading === "deny-hit" ? "deny-hit" : "deny-relation");
|
|
230
|
+
walk(n, reading === "full" && (s.segment.reentry !== "shell" || n.plan.handed === true) ? "full" : reading === "deny-hit" ? "deny-hit" : "deny-relation");
|
|
231
231
|
for (const n of s.printed)
|
|
232
232
|
walk(n, "deny-hit");
|
|
233
233
|
}
|
|
@@ -189,6 +189,9 @@ export interface ShellReadPlan {
|
|
|
189
189
|
readonly backgrounded: boolean;
|
|
190
190
|
readonly strayRedirection: boolean;
|
|
191
191
|
};
|
|
192
|
+
/** A command line a program HANDS ON, read off the program's own words (`find`'s `-exec` family, `find-actions.ts`): no shell
|
|
193
|
+
* parses it, so it is judged as the command line it is, though its segment re-enters ({@link ShellReadSegment.reentry}). */
|
|
194
|
+
readonly handed?: true;
|
|
192
195
|
}
|
|
193
196
|
/** Plan every read candidate of one command (the contract is this module's header). */
|
|
194
197
|
export declare function planShellReads(command: string, decl: ShellReadDeclarations, depth?: number, start?: PlanStart): ShellReadPlan;
|
|
@@ -852,7 +852,7 @@ function segmentFactsRead(segment, p, decl, table, nestedPlan, fed, toks, inheri
|
|
|
852
852
|
reentry = "shell";
|
|
853
853
|
if (row?.key === "find")
|
|
854
854
|
for (const line of findHandedLines(row, argReads.map((r) => findWordOf(r.word))))
|
|
855
|
-
nested.push(nestedPlan(line, "substitution"));
|
|
855
|
+
nested.push({ ...nestedPlan(line, "substitution"), handed: true });
|
|
856
856
|
let unreadProgramText;
|
|
857
857
|
const slot = row === undefined ? undefined : programTextSlotFiles(row, args);
|
|
858
858
|
if (slot !== undefined) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { argvOf, descriptorNameWords, expansionsInHeredocBody, lexShell } from "../../shell/lex.js";
|
|
2
2
|
import { shellWordsOf } from "../../shell/shell-words.js";
|
|
3
|
-
import {
|
|
3
|
+
import { resolveOperandSpellings } from "./bash-readonly-classifier.js";
|
|
4
4
|
import { readProgramPosition } from "./bash-program-position.js";
|
|
5
5
|
import { arithmeticSubstitutions, exportedFunctionNames, isArithmeticCommand, substitutionBodies } from "./shell-read-bindings.js";
|
|
6
6
|
import { twinFloor, twinsAfter } from "./shell-read-lost-walk.js";
|
|
@@ -8,6 +8,7 @@ import { programRow, readArgRoles } from "./program-read-model.js";
|
|
|
8
8
|
import { evalDefinedFunctions, functionCallOf } from "./shell-read-functions.js";
|
|
9
9
|
import { codeBodies, literalEvalText, reentersShell, reentryText, stdinTextsOf } from "./shell-reentry-text.js";
|
|
10
10
|
import { isAbsoluteForFamily } from "./safety.js";
|
|
11
|
+
import { movedTo } from "./shell-climb.js";
|
|
11
12
|
import { walkFromStart } from "./shell-read-start.js";
|
|
12
13
|
const TEXT_RUNNING_PROGRAMS = new Set(["eval", "source", "."]);
|
|
13
14
|
const BASE_CANDIDATE_MAX = 256;
|
|
@@ -211,7 +212,7 @@ export class WorkdirThread {
|
|
|
211
212
|
for (const t of targets) {
|
|
212
213
|
if ((s.physical || this.physical || c.pwd === undefined) && t.split("/").includes(".."))
|
|
213
214
|
return "lost";
|
|
214
|
-
const moved =
|
|
215
|
+
const moved = movedTo(c.base, t, ctx.homeDir, typeof s.target !== "string" && t !== c.base && t !== c.pwd && t !== c.old);
|
|
215
216
|
if (moved === undefined)
|
|
216
217
|
return "lost";
|
|
217
218
|
out.push(land(moved, s.physical, stack));
|
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
* segment's program writes by the program read model's ROLES (`writeReadings`: an operand or option value whose role
|
|
5
5
|
* writes, the operands an option made edited in place, a copy's destination and its children, an in-place edit's
|
|
6
6
|
* backups), at the seats the role and the selected options name ({@link WriteSeat}: the directory entry, or where the
|
|
7
|
-
* path lands)
|
|
8
|
-
*
|
|
9
|
-
* program writes is
|
|
7
|
+
* path lands) — and a removal walk's starting points, by the removal guard's own table (`removal-actions.ts`). The
|
|
8
|
+
* establisher (`shell-read-establish.ts`) places what this module names; the judge reads the result on the write face
|
|
9
|
+
* (the write deny rows, then the write roots). No table of programs or options lives here: what a program writes is
|
|
10
|
+
* its row's.
|
|
10
11
|
*/
|
|
11
12
|
import type { ReadCandidate, ShellReadSegment } from "./shell-read-plan.js";
|
|
12
13
|
import { type LineDescriptors } from "./shell-read-device.js";
|
|
@@ -4,6 +4,7 @@ import { renamed } from "./shell-read-word.js";
|
|
|
4
4
|
import { isWinFormPath, pathFamilyOf } from "./safety.js";
|
|
5
5
|
import { byteBoundIsSmall, implementationsOf, programRow, readArgRoles, selectedOptions, subcommandOf, writeReadings } from "./program-read-model.js";
|
|
6
6
|
import { programBasename, readProgramPosition } from "./bash-program-position.js";
|
|
7
|
+
import { walkRemovalTargetsOf } from "./removal-actions.js";
|
|
7
8
|
export function programArgs(segment) {
|
|
8
9
|
const at = segment.verb === undefined ? undefined : readProgramPosition(segment.argv).program?.index;
|
|
9
10
|
return (at === undefined ? [] : segment.argv.slice(at + 1)).map((w) => ({ raw: w.raw, spelled: w.folded, ...(w.expansions.length > 0 || w.unresolved !== undefined ? { rewritten: true } : {}), ...(w.pieces.length > 0 && w.pieces.every((p) => p.expansion?.yields === "many") ? { vanishes: true } : {}) }));
|
|
@@ -110,6 +111,8 @@ function writeTargetsOf(segment) {
|
|
|
110
111
|
write(c, ["landing", "entry"], undefined, true);
|
|
111
112
|
out.push(...backupTargetsOf(edited.get(o) ?? [], o.readings, o.override));
|
|
112
113
|
}
|
|
114
|
+
for (const c of walkRemovalTargetsOf(segment))
|
|
115
|
+
write(c, ["landing", "entry"]);
|
|
113
116
|
const readWords = new Set();
|
|
114
117
|
for (const o of owners) {
|
|
115
118
|
if (!o.program)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/core",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.71.1",
|
|
4
4
|
"description": "Stateless, task-oriented AI agent core",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "BUSL-1.1",
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
"dependencies": {
|
|
142
142
|
"@modelcontextprotocol/client": "2.4.0",
|
|
143
143
|
"@modelcontextprotocol/core": "2.4.0",
|
|
144
|
-
"@sema-agent/primitives": "7.
|
|
144
|
+
"@sema-agent/primitives": "7.71.1",
|
|
145
145
|
"typebox": "1.1.39",
|
|
146
146
|
"undici": "7.30.2"
|
|
147
147
|
},
|