@sema-agent/core 7.70.0 → 7.71.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 +728 -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 +7 -6
- 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 +65 -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 +37 -19
- package/dist/index.js +30 -15
- 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 +169 -15
- package/wire-changes/core-stores-sql@7.71.0.json +40 -0
- package/wire-changes/core@7.71.0.json +5827 -0
- package/wire-changes/mods-kernel@7.71.0.json +52 -0
- package/wire-changes/primitives@7.71.0.json +473 -0
- package/wire-changes/wiki-gate@7.71.0.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,4 +1,4 @@
|
|
|
1
|
-
import type { SessionPlacement, SessionStore } from "../session.js";
|
|
1
|
+
import type { SessionHead, SessionPlacement, SessionStore } from "../session.js";
|
|
2
2
|
import type { RunnerDeps } from "../types.js";
|
|
3
3
|
import type { RunInternals } from "./contracts.js";
|
|
4
4
|
/**
|
|
@@ -10,6 +10,13 @@ import type { RunInternals } from "./contracts.js";
|
|
|
10
10
|
export type DelegationOwnerReading = {
|
|
11
11
|
readonly bound: true;
|
|
12
12
|
readonly owner: string | null;
|
|
13
|
+
/** The tree's root anchor as this reading saw it — the root session's id and the occupant its row held — the one source of the anchor
|
|
14
|
+
* a durable record of the tree writes (a revival is judged in the tree that root anchors). The engine's seats carry it; a seat a host
|
|
15
|
+
* builds ({@link delegationOwnerSeat}) anchors no root. */
|
|
16
|
+
readonly root?: {
|
|
17
|
+
readonly sessionId: string;
|
|
18
|
+
readonly incarnation: string | undefined;
|
|
19
|
+
};
|
|
13
20
|
} | {
|
|
14
21
|
readonly bound: false;
|
|
15
22
|
readonly reason: string;
|
|
@@ -17,20 +24,35 @@ export type DelegationOwnerReading = {
|
|
|
17
24
|
};
|
|
18
25
|
/**
|
|
19
26
|
* The delegation tree's owner: the owner cell of the tree root's row, as the root run read it — once. A run spawned by another run
|
|
20
|
-
* holds its spawner's seat (by reference, so the whole tree shares one reading), and so does a revived child (its reviver's
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* call; a read fault rejects and
|
|
27
|
+
* holds its spawner's seat (by reference, so the whole tree shares one reading), and so does a revived child (its reviver's; a revival no
|
|
28
|
+
* the tree it was BORN in — its record's root anchor ({@link revivalTreeSeat}), never the reviving caller's seat nor one read off the row
|
|
29
|
+
* it re-opens); a run nobody spawned (a top-level run, a parked child resumed on its own) holds a seat over the row it acquired itself
|
|
30
|
+
* ({@link ownRowDelegationOwner}). The first answer that binds or refuses is the answer for every later call; a read fault rejects and
|
|
31
|
+
* binds nothing.
|
|
24
32
|
*/
|
|
25
33
|
export interface DelegationOwnerSeat {
|
|
26
34
|
read(): Promise<DelegationOwnerReading>;
|
|
27
35
|
}
|
|
36
|
+
/** A seat a host builds for a leg it starts itself (a composed leg, a direct workflow): the tree's owner it states — a principal name, or
|
|
37
|
+
* `null` for an anonymous tree — bound as given. Its reading anchors no root: a record the leg's background children write carries no
|
|
38
|
+
* root occupant (what a revival of such a record runs as: {@link revivalTreeSeat}). A value that is neither a name nor `null` is refused. */
|
|
39
|
+
export declare function delegationOwnerSeat(owner: string | null): DelegationOwnerSeat;
|
|
40
|
+
/** A seat a host hands the engine for a run (`RunInternals.delegationOwner`, a workflow's `delegationOwner`), taken at the door so it
|
|
41
|
+
* answers once ({@link onceSeat}): a host's own seat that answered alice and would answer bob next answers alice to the leg and
|
|
42
|
+
* to every row its tree creates. A seat that already answers once is handed back as it is (one tree, one object). */
|
|
43
|
+
export declare function answeringOnce(seat: DelegationOwnerSeat): DelegationOwnerSeat;
|
|
28
44
|
/**
|
|
29
45
|
* The seat of a run nobody spawned: the owner of the row it acquired, read by id through its own store's {@link SessionStore.headOf}
|
|
30
46
|
* and taken only while the row's occupant is the one acquired ({@link sameOccupant} of the head's `incarnation` and the acquired
|
|
31
|
-
* session's metadata's). A store without a by-id read has no owner to read: the reading is `null
|
|
47
|
+
* session's metadata's). A store without a by-id read has no owner to read: the reading is `null`, anchoring no root. The reading's
|
|
48
|
+
* root anchor ({@link DelegationOwnerReading}) is the run's declared tree root when it has one (`declaredRoot`: the root session a host
|
|
49
|
+
* handed the run, with that row's occupant as handed — a revival checks it against the root row, never takes it on trust), else the row
|
|
50
|
+
* itself with the occupant this read compared.
|
|
32
51
|
*/
|
|
33
|
-
export declare function ownRowDelegationOwner(sessions: Pick<SessionStore, "headOf">, sessionId: string, acquiredIncarnation: () => Promise<string | undefined
|
|
52
|
+
export declare function ownRowDelegationOwner(sessions: Pick<SessionStore, "headOf">, sessionId: string, acquiredIncarnation: () => Promise<string | undefined>, declaredRoot?: {
|
|
53
|
+
readonly sessionId: string;
|
|
54
|
+
readonly incarnation: string | undefined;
|
|
55
|
+
}): DelegationOwnerSeat;
|
|
34
56
|
/** The refusal of a delegation whose tree owner does not bind ({@link DelegationOwnerReading}): the child is not started and no row is
|
|
35
57
|
* created for it. */
|
|
36
58
|
export declare const DELEGATION_OWNER_UNBOUND = "delegation.owner_unbound";
|
|
@@ -41,15 +63,16 @@ export declare function delegationOwnerUnbound(reason: string): Error & {
|
|
|
41
63
|
* run on the row, and nothing is deleted. */
|
|
42
64
|
export declare const DELEGATION_OWNER_MISMATCH = "delegation.owner_mismatch";
|
|
43
65
|
/**
|
|
44
|
-
* The owner a delegated leg's
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* ends the leg as the stopped run it is ({@link ownerReadEnd}).
|
|
66
|
+
* The tree owner a delegated leg's row is judged under: its spawner's seat as it binds — a name, or `null` for an anonymous tree. Read
|
|
67
|
+
* BEFORE the acquire (a create-capable acquire names the name, and a row it creates records it; an anonymous tree's names none), so a seat
|
|
68
|
+
* that does not bind refuses the leg (`delegation.owner_unbound`, what the read threw as the cause) with no row created for it. Read by
|
|
69
|
+
* every leg that holds a spawner's seat, whatever its acquire's form ({@link judgedOwnerSeat}); a run nobody spawned reads none (its own row
|
|
70
|
+
* is the tree's). The read is bounded ({@link boundedOwnerRead}): one that does not answer in time binds nothing and refuses the leg the same
|
|
71
|
+
* way; one still pending when the leg's run is stopped (`signal`) ends the leg as the stopped run it is ({@link ownerReadEnd}).
|
|
51
72
|
*/
|
|
52
|
-
export declare function
|
|
73
|
+
export declare function delegatedTreeOwner(seat: DelegationOwnerSeat, signal?: AbortSignal): Promise<{
|
|
74
|
+
readonly owner: string | null;
|
|
75
|
+
}>;
|
|
53
76
|
/** The one answer to "is there an owner to judge" for a leg: the name its tree's reading binds, or `undefined` — an anonymous tree
|
|
54
77
|
* (`owner: null`) judges nothing, as a leg with no seat does. Prepare reads a leg's row back only against it ({@link delegatedRowOwner});
|
|
55
78
|
* a spawning lane says "verified" at a leg's birth exactly when it is `undefined` — of the seat reading it already took (the background
|
|
@@ -62,12 +85,10 @@ export declare function ownerToJudge(tree: {
|
|
|
62
85
|
* find it. The seat's reading is the one prepare reads (a seat answers once). A reading that does not answer — a fault, a tree that
|
|
63
86
|
* does not bind, the call's stop — says nothing: the leg waits for prepare's word ({@link RunInternals.onSessionVerified}). */
|
|
64
87
|
export declare function verifiedAtBirth(seat: DelegationOwnerSeat | undefined, signal?: AbortSignal): Promise<boolean>;
|
|
65
|
-
/** The seat a leg's row is judged under: its spawner's tree-owner seat
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
export declare function judgedOwnerSeat(
|
|
69
|
-
readonly requireExistingSession?: boolean;
|
|
70
|
-
}, internals: {
|
|
88
|
+
/** The seat a leg's row is judged under: its spawner's tree-owner seat — every leg that holds one is judged ({@link judgeRowForTree}),
|
|
89
|
+
* whatever its acquire's form (a re-open of a row it did not create included). The run's carrier is born "unverified" off it and prepare
|
|
90
|
+
* reads the seat off it; an anonymous tree's leg on a row the engine minted for it is told "verified" with no read ({@link ownerToJudge}). */
|
|
91
|
+
export declare function judgedOwnerSeat(internals: {
|
|
71
92
|
readonly delegationOwner?: DelegationOwnerSeat;
|
|
72
93
|
} | undefined): DelegationOwnerSeat | undefined;
|
|
73
94
|
/** The create-capable acquire's options of a leg: the placement and the owner it names, each only when there is one — a leg with neither
|
|
@@ -79,41 +100,220 @@ export declare function createForm(input: {
|
|
|
79
100
|
placement?: SessionPlacement;
|
|
80
101
|
owner?: string;
|
|
81
102
|
} | undefined;
|
|
103
|
+
/** What the one row judge ({@link judgeRowForTree}) answers: the row may be opened (`claimed`: this judgement recorded the tree's owner on
|
|
104
|
+
* it; `head`: the head it judged — `null` for a row it read as not there, absent when it read none — which an entry that opens the row
|
|
105
|
+
* only after judging it holds its read to, {@link readJudgedRow}), or it may not, with the engine's sentence (`why`) and one of two
|
|
106
|
+
* kinds:
|
|
107
|
+
* · `not_ours` — the row is not this tree's to open: it records another owner, another tree claimed it first, it holds another occupant
|
|
108
|
+
* than the one acquired (or, for a caller holding a handle of it, it is not there). Each entry answers these as it answers "the record
|
|
109
|
+
* does not name this row" (the model `not_retained` / `not_found`, a leg `delegation.owner_mismatch`): never an owner, never which;
|
|
110
|
+
* · `store` — the deployment's session store could not judge it: it has no by-id read or no conditional owner write
|
|
111
|
+
* (`config.invalid_session_store`, the sentence naming the member), a read or the claim faulted or did not answer in time (`storage`,
|
|
112
|
+
* what it threw in `fault`), or the tree's own owner does not bind (`delegation.owner_unbound`). The deployment's to fix: never
|
|
113
|
+
* answered as "not retained". */
|
|
114
|
+
export type RowAdmission = {
|
|
115
|
+
readonly open: true;
|
|
116
|
+
readonly claimed: boolean;
|
|
117
|
+
readonly head?: SessionHead | null;
|
|
118
|
+
} | {
|
|
119
|
+
readonly open: false;
|
|
120
|
+
readonly kind: "not_ours";
|
|
121
|
+
readonly why: string;
|
|
122
|
+
} | {
|
|
123
|
+
readonly open: false;
|
|
124
|
+
readonly kind: "store";
|
|
125
|
+
readonly code: RowStoreFaultCode;
|
|
126
|
+
readonly why: string;
|
|
127
|
+
readonly fault?: unknown;
|
|
128
|
+
};
|
|
129
|
+
/** The codes a {@link RowAdmission} of kind `store` carries. */
|
|
130
|
+
export type RowStoreFaultCode = "config.invalid_session_store" | "storage" | "delegation.owner_unbound";
|
|
131
|
+
/** The row a judgement is of: its id, the occupant of the handle the caller holds and will use (`occupant`; absent = the caller holds no
|
|
132
|
+
* handle, and the occupant the head names is the one judged), whether the engine minted the id for this call and the call's create-capable
|
|
133
|
+
* acquire laid the row down (`minted`), and whether the caller is the leg that will run on it (`runsOn`: the one judgement that claims). */
|
|
134
|
+
export interface JudgedRow {
|
|
135
|
+
readonly sessionId: string;
|
|
136
|
+
readonly occupant?: () => Promise<string | undefined>;
|
|
137
|
+
readonly minted?: boolean;
|
|
138
|
+
readonly runsOn?: true;
|
|
139
|
+
}
|
|
140
|
+
/** The one refusal of a claim on a store that has no conditional owner write ({@link SessionStore.recordOwner}) — the whole of what a tree
|
|
141
|
+
* with an owner meets on a row that records none there; one sentence, one place. */
|
|
142
|
+
export declare function claimUnavailable(): RowAdmission;
|
|
143
|
+
/** The error an entry that throws a refusal of kind `store` throws: coded, the cause what faulted. */
|
|
144
|
+
export declare function rowStoreFaultError(sessionId: string, verdict: Extract<RowAdmission, {
|
|
145
|
+
kind: "store";
|
|
146
|
+
}>): Error & {
|
|
147
|
+
code: RowStoreFaultCode;
|
|
148
|
+
};
|
|
82
149
|
/**
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
150
|
+
* THE judge of a session row an entry is about to run on or read, for a tree (`tree`, its seat's reading) — one rule at every entry that
|
|
151
|
+
* opens a row's content (prepare's acquire of every leg that holds a seat, SendMessage before it touches the record, AgentTranscript's two
|
|
152
|
+
* lanes, an extension's read of a subagent's transcript). Read by id through the store's {@link SessionStore.headOf}, within the bound and
|
|
153
|
+
* ended by the caller's stop (`signal`; the one throw is the run's cancellation):
|
|
154
|
+
* · a tree that does not bind opens nothing;
|
|
155
|
+
* · an anonymous tree opens, unread, a row the engine minted for this call (`row.minted`); on a store with no by-id read it opens any row
|
|
156
|
+
* (no row there records an owner the engine wrote); otherwise it opens only a row that records no owner, and claims nothing;
|
|
157
|
+
* · a tree with an owner opens a row that records exactly that owner. A row that records none an entry that only opens or reads it opens
|
|
158
|
+
* as it is (unclaimed: its content is every tree's to read); the leg that will RUN on it (`row.runsOn`, prepare's acquire —
|
|
159
|
+
* {@link judgeLegRow}, the one claimant) claims it first — the store's conditional owner write ({@link SessionStore.recordOwner}) naming
|
|
160
|
+
* the occupant this judgement read, answered within the bound — and opens it only when the head that write answers records this owner on
|
|
161
|
+
* that occupant;
|
|
162
|
+
* · a row that is not there is not judged for a caller that holds no handle of it (`row.occupant` absent: it is answered by the
|
|
163
|
+
* caller's own path for a gone row); a caller that holds a handle — it opened the row, the leg that would run on it included — is
|
|
164
|
+
* refused (its handle no longer names the row);
|
|
165
|
+
* · every other answer opens nothing: another owner (or a cell that names nobody), a claim another tree won first, a head whose
|
|
166
|
+
* occupant is not the one the caller holds (`row.occupant`), a store with no by-id read, or none to claim with ({@link claimUnavailable}),
|
|
167
|
+
* a read or a claim that faulted or did not answer in time (a late claim still records this tree's owner — the claim is monotonic — but
|
|
168
|
+
* this leg has refused).
|
|
169
|
+
* A claim records the owner for every later entry; what a run that opened the row while it recorded none already holds is not taken back.
|
|
86
170
|
*/
|
|
87
|
-
export declare function
|
|
171
|
+
export declare function judgeRowForTree(sessions: Pick<SessionStore, "headOf" | "recordOwner">, row: JudgedRow, tree: DelegationOwnerReading, signal?: AbortSignal): Promise<RowAdmission>;
|
|
172
|
+
/**
|
|
173
|
+
* THE read of a row a reading entry judged ({@link judgeRowForSeat}, no handle held — nothing of a row it may be refused is opened, a File
|
|
174
|
+
* log's tail repair included): judge → open → read → judge the head again. The row is opened (`acquire`, the existing row only) and read
|
|
175
|
+
* (`read`); then its head is read again by id, and the read stands only when that head is the one judged — the same owner and the same
|
|
176
|
+
* occupant. A row whose owner or occupant moved between the judgement and the end of the read (claimed by another tree, deleted, laid
|
|
177
|
+
* down again) voids the read, and so does a row judged not there that opens anyway (a head judged absent is the head of no row): it is
|
|
178
|
+
* answered as not this tree's and its view is dropped. A head read that faults or does not answer voids it too, as the store's fault. A verdict that read no head
|
|
179
|
+
* (a store with no by-id read, a row the engine minted) has nothing to hold the read to: it stands. What the open or the read throw is
|
|
180
|
+
* the caller's (its own answers for a row that is gone or unreadable); the one other throw is the run's stop.
|
|
181
|
+
*/
|
|
182
|
+
export declare function readJudgedRow<T>(sessions: Pick<SessionStore, "headOf" | "acquire" | "forget">, sessionId: string, verdict: Extract<RowAdmission, {
|
|
183
|
+
open: true;
|
|
184
|
+
}>, read: (held: Awaited<ReturnType<SessionStore["acquire"]>>) => Promise<T>, signal?: AbortSignal): Promise<{
|
|
185
|
+
readonly read: T;
|
|
186
|
+
} | {
|
|
187
|
+
readonly refused: Exclude<RowAdmission, {
|
|
188
|
+
open: true;
|
|
189
|
+
}>;
|
|
190
|
+
}>;
|
|
191
|
+
/** {@link judgeRowForTree} for an entry that reads its CALLER's seat off the tool call (SendMessage, AgentTranscript, an extension's
|
|
192
|
+
* transcript read): the seat's reading, bounded and ended by the call's stop. A caller that holds no seat — a tool driven with no run around
|
|
193
|
+
* it, an operator's continuation — is an anonymous tree's ({@link delegationOwnerOf}): it opens only rows that record no owner. What a
|
|
194
|
+
* revival then runs as is not this caller's tree but the one it was born in ({@link revivalTreeSeat}). It opens or refuses; it never claims. */
|
|
195
|
+
export declare function judgeRowForSeat(sessions: Pick<SessionStore, "headOf">, row: Omit<JudgedRow, "runsOn">, seat: DelegationOwnerSeat | undefined, signal?: AbortSignal): Promise<RowAdmission>;
|
|
196
|
+
/**
|
|
197
|
+
* The tree a revival cycle runs in — the one the record was BORN in — read ONCE per cycle, off the record as the store holds it: its root
|
|
198
|
+
* anchor (`rootSessionId` + `rootSessionIncarnation`, written from the spawning tree's seat) names the root row, whose owner is read by id
|
|
199
|
+
* while it still holds that occupant. ONE rule for a tree that is not there to read: a record that anchors no root occupant (written before
|
|
200
|
+
* 7.65.0, or spawned by a call with no seat or under a seat that anchors no root or another root), a root row that is gone, and a root row
|
|
201
|
+
* laid down again for another occupant name no tree — the cycle is an anonymous tree's: it opens only a row that records no owner and
|
|
202
|
+
* claims nothing. A read that faults or does not answer is refused (`fault`), and so is a root cell that names nobody and a record whose
|
|
203
|
+
* root is its own session (the child would read its own row's owner). Answers the seat of the reading taken (it answers that reading,
|
|
204
|
+
* always — what the cycle carries to its revive arm), or the refusal's sentence.
|
|
205
|
+
*/
|
|
206
|
+
export declare function birthTree(sessions: Pick<SessionStore, "headOf">, record: RevivalRecord, signal?: AbortSignal): Promise<{
|
|
207
|
+
readonly seat: DelegationOwnerSeat;
|
|
208
|
+
readonly reading: Extract<DelegationOwnerReading, {
|
|
209
|
+
bound: true;
|
|
210
|
+
}>;
|
|
211
|
+
} | {
|
|
212
|
+
readonly refused: string;
|
|
213
|
+
readonly fault?: unknown;
|
|
214
|
+
}>;
|
|
215
|
+
/** Puts the tree a message entry admitted its caller on onto the claim object it hands its spawner ({@link revivalTreeSeat} takes it). */
|
|
216
|
+
export declare function holdCycleTree(claim: object, seat: DelegationOwnerSeat): void;
|
|
217
|
+
/** The tree a message entry put on this claim object: `undefined` for an object no entry handed out (a copy of one included). */
|
|
218
|
+
export declare function heldCycleTree(claim: object): DelegationOwnerSeat | undefined;
|
|
219
|
+
/**
|
|
220
|
+
* The tree a revival's leg runs in, at the revive arm: the claim (`claim.row` as the claimant read it, `claim.rev`) must be the record the
|
|
221
|
+
* store holds — the same rev and the same identity cells (session, root anchor, owner, scope); a claim whose copy differs is refused,
|
|
222
|
+
* nothing re-opened. Then the cycle's tree, by ONE rule on whether a message entry stands behind the claim: a parked drive's claim
|
|
223
|
+
* (`parked`: a person deciding a parked agent through its host — no message entry) reads the birth tree here, once ({@link birthTree});
|
|
224
|
+
* every other claim runs in the tree its message entry admitted the caller on and put on this very claim object ({@link holdCycleTree};
|
|
225
|
+
* never read again), and one that carries none — a copy of the entry's object, a claim a host made by hand — is refused, no row read.
|
|
226
|
+
* Answers the seat, or the refusal's sentence.
|
|
227
|
+
*/
|
|
228
|
+
export declare function revivalTreeSeat(sessions: Pick<SessionStore, "headOf">, records: {
|
|
229
|
+
get(handle: string, scope: string): Promise<RevivalRecord | null>;
|
|
230
|
+
}, claim: {
|
|
231
|
+
readonly row: RevivalRecord;
|
|
232
|
+
readonly rev: number;
|
|
233
|
+
readonly parked: boolean;
|
|
234
|
+
}, signal?: AbortSignal): Promise<{
|
|
235
|
+
readonly seat: DelegationOwnerSeat;
|
|
236
|
+
} | {
|
|
237
|
+
readonly refused: string;
|
|
238
|
+
readonly identity?: true;
|
|
239
|
+
readonly fault?: unknown;
|
|
240
|
+
}>;
|
|
241
|
+
/** THE rule of who may reach an agent from outside its run — continue it, or message it while it runs or is retained: its tree (`tree`,
|
|
242
|
+
* the one it was born in) records no owner, or records the owner the caller's tree binds. A reading that does not bind reaches nothing. */
|
|
243
|
+
export declare function treeReaches(tree: DelegationOwnerReading, caller: DelegationOwnerReading): boolean;
|
|
244
|
+
/**
|
|
245
|
+
* Whether a caller's tree may continue a record (SendMessage's revival and its backlog drain): the cycle runs in the tree the record was
|
|
246
|
+
* born in, read here ONCE ({@link birthTree}) and carried to the revive arm as the seat this answer admits on (`tree`), so a caller may
|
|
247
|
+
* start it only FROM that tree, and the row the record names is judged for THAT tree — the one that will run on it. A caller whose tree
|
|
248
|
+
* does not bind starts nothing (`delegation.owner_unbound`). Then the birth tree admits a caller when it records no owner (the anonymous
|
|
249
|
+
* cycle, {@link birthTree}) or records the owner the caller's tree binds (`caller`: the caller's reading, taken once for the call); another
|
|
250
|
+
* principal's tree, and an anonymous caller, are refused as "not this tree's" (nothing is claimed, written or lent); a birth tree that
|
|
251
|
+
* cannot be read is the store fault it is (`storage` where a read faulted, `delegation.owner_unbound` otherwise) — never let through. Last,
|
|
252
|
+
* the row (`row`, no handle held) is judged for the cycle's tree ({@link judgeRowForTree}): an anonymous cycle opens only a row that
|
|
253
|
+
* records no owner. Answers the cycle's seat and the row's verdict, or the refusal.
|
|
254
|
+
*/
|
|
255
|
+
export declare function birthTreeAdmission(sessions: Pick<SessionStore, "headOf">, record: RevivalRecord, row: Omit<JudgedRow, "runsOn" | "occupant">, caller: DelegationOwnerReading, signal?: AbortSignal): Promise<{
|
|
256
|
+
readonly open: true;
|
|
257
|
+
readonly tree: DelegationOwnerSeat;
|
|
258
|
+
readonly row: Extract<RowAdmission, {
|
|
259
|
+
open: true;
|
|
260
|
+
}>;
|
|
261
|
+
} | Exclude<RowAdmission, {
|
|
262
|
+
open: true;
|
|
263
|
+
}>>;
|
|
264
|
+
/** The root anchor a fresh background agent's durable record carries — the one source its revival's tree is read from
|
|
265
|
+
* ({@link revivalTreeSeat}): the call's root linkage (`rootSessionId ?? sessionId`), and beside it the root occupant only as the spawning
|
|
266
|
+
* tree's reading saw it (`tree.root`, the reading that bound the tree's owner), and only when that anchor is the linkage's root. A call's
|
|
267
|
+
* own root fields never put an occupant there: a call with no seat, or one whose seat anchors no root or another root, records the
|
|
268
|
+
* linkage alone. */
|
|
269
|
+
export declare function recordedRootAnchor(ctx: {
|
|
270
|
+
readonly rootSessionId?: string;
|
|
271
|
+
readonly sessionId?: string;
|
|
272
|
+
}, tree: DelegationOwnerReading | undefined): {
|
|
273
|
+
rootSessionId?: string;
|
|
274
|
+
rootSessionIncarnation?: string;
|
|
275
|
+
};
|
|
276
|
+
/** The cells of a durable agent record a revival's tree is read from ({@link revivalTreeSeat}). */
|
|
277
|
+
export interface RevivalRecord {
|
|
278
|
+
readonly handle: string;
|
|
279
|
+
readonly scope: string;
|
|
280
|
+
readonly owner: string;
|
|
281
|
+
readonly rev: number;
|
|
282
|
+
readonly sessionId?: string;
|
|
283
|
+
readonly rootSessionId?: string;
|
|
284
|
+
readonly rootSessionIncarnation?: string;
|
|
285
|
+
}
|
|
286
|
+
/** A delegated leg's row as prepare's acquire resolved it, judged before anything is written to it ({@link judgeRowForTree}, on the occupant
|
|
287
|
+
* the acquired session carries): one that may not be opened is never run on — its cached view is dropped (`forget`, history-safe; a fault
|
|
288
|
+
* of the drop goes to `report`) and the leg refused: `delegation.owner_mismatch` for a row that is not the tree's (the row named, no
|
|
289
|
+
* owner), the store fault's own code ({@link RowStoreFaultCode}) for a store that could not judge it; nothing is deleted. */
|
|
290
|
+
export declare function judgeLegRow(sessions: Pick<SessionStore, "headOf" | "recordOwner" | "forget">, held: {
|
|
88
291
|
readonly sessionId: string;
|
|
89
292
|
readonly session: {
|
|
90
293
|
getMetadata(): Promise<{
|
|
91
294
|
readonly incarnation?: string;
|
|
92
295
|
}>;
|
|
93
296
|
};
|
|
94
|
-
},
|
|
95
|
-
/** What a delegated leg's
|
|
96
|
-
*
|
|
97
|
-
* and the leg's own stop (`signal`, its spec's). */
|
|
98
|
-
export interface
|
|
99
|
-
readonly
|
|
100
|
-
readonly
|
|
297
|
+
}, leg: JudgedLeg, report?: (err: Error, sessionId: string) => void): Promise<void>;
|
|
298
|
+
/** What a delegated leg's row is judged by in prepare: the tree owner its seat bound (`owner`; `null` = anonymous), whether the engine
|
|
299
|
+
* minted the id for this leg's create-capable acquire (`minted` — no author named it: the store's mint, or the spawning lane's,
|
|
300
|
+
* `RunInternals.sessionIdMintedBySpawner`), and the leg's own stop (`signal`, its spec's). */
|
|
301
|
+
export interface JudgedLeg {
|
|
302
|
+
readonly owner: string | null;
|
|
303
|
+
readonly minted: boolean;
|
|
101
304
|
readonly signal?: AbortSignal;
|
|
102
305
|
}
|
|
103
|
-
/** How a row's owner cell stands to a tree's owner — the one comparison the create form's read-back ({@link readBackDelegatedRow}) and
|
|
104
|
-
* the revival entry ({@link revivalRowJudged}) share: `tree` (it records exactly that owner), `ownerless` (`null`: none recorded),
|
|
105
|
-
* `other` (another name, or a cell that names nobody). What each does with `ownerless` is its own rule; the standing is one. */
|
|
106
|
-
export type RowOwnerStanding = "tree" | "ownerless" | "other";
|
|
107
|
-
export declare function rowOwnerStanding(rowOwner: unknown, treeOwner: string): RowOwnerStanding;
|
|
108
306
|
/**
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
* that faulted or did not answer, or a tree owner that does not bind shows nothing, and the row is not re-opened.
|
|
307
|
+
* A fork lane's judgement of the row a store's fork answered, before the child runs on it or a cleanup releases it: the row must be a copy
|
|
308
|
+
* of the session this run holds — its lineage cells name the source id and the occupant this run acquired — or it is not this tree's to run
|
|
309
|
+
* on or to release (a store that answered a row that stands under another id's history, or a source the id no longer holds). Answers the
|
|
310
|
+
* sentence of a row that is not, `undefined` for one that is. A source occupant of `null` is one the caller does not hold (a delegation tool
|
|
311
|
+
* driven outside a run): only the lineage id is judged.
|
|
115
312
|
*/
|
|
116
|
-
export declare function
|
|
313
|
+
export declare function forkedRowNotOurs(sessions: Pick<SessionStore, "acquire" | "forget">, forkedId: string, source: {
|
|
314
|
+
readonly sessionId: string;
|
|
315
|
+
readonly occupant: string | undefined | null;
|
|
316
|
+
}): Promise<string | undefined>;
|
|
117
317
|
/**
|
|
118
318
|
* Whether a leg's result names the session it ran on. A result names only a session whose row's owner was verified (or a leg with no
|
|
119
319
|
* owner to judge): a leg refused over its row, or one that ended — stopped, timed out — before the row was read, names none (`""`).
|
|
@@ -136,7 +336,8 @@ export declare function namesVerifiedSession(result: {
|
|
|
136
336
|
* anything else names no occupant — the member is dropped from the copy handed back, so the root reads as an unknown occupant
|
|
137
337
|
* everywhere — and `onError` is told once (`phase: "config"`, `config.invalid_argument`) with the value's shape, never the value.
|
|
138
338
|
* Absent, `undefined` and `null` are an unknown occupant already, said nothing. The root's box scope (`rootSessionScope`) is read the
|
|
139
|
-
* same way: a non-empty string is the scope; anything else is no recorded scope, dropped and told once.
|
|
339
|
+
* same way: a non-empty string is the scope; anything else is no recorded scope, dropped and told once. The tree's owner seat
|
|
340
|
+
* (`delegationOwner`) is taken at this door as well: it answers once ({@link answeringOnce}). Every member is read once
|
|
140
341
|
* into the copy, so a getter cannot answer one value here and another to the spread that follows; the caller's own bag is never written.
|
|
141
342
|
*/
|
|
142
343
|
export declare function readRootOccupant(internals: RunInternals | undefined, onError: RunnerDeps["onError"], sessionId: string | undefined): RunInternals | undefined;
|