@sema-agent/core 7.67.3 → 7.68.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 +1516 -0
- package/README.md +18 -9
- package/README.zh-CN.md +16 -8
- package/dist/agents/agent-definition.d.ts +1 -1
- package/dist/agents/agent-definition.js +4 -1
- package/dist/agents/cascade.d.ts +2 -2
- package/dist/agents/cascade.js +3 -1
- package/dist/agents/cumulative-stats.d.ts +2 -1
- package/dist/agents/cumulative-stats.js +4 -1
- package/dist/agents/list-agents-tool.d.ts +30 -0
- package/dist/agents/list-agents-tool.js +45 -3
- package/dist/agents/peer-admission.d.ts +2 -2
- package/dist/agents/peer-session-drain.d.ts +2 -0
- package/dist/agents/peer-session-drain.js +1 -0
- package/dist/agents/repair-loop.js +3 -1
- package/dist/agents/retain-ledger.d.ts +61 -8
- package/dist/agents/retain-ledger.js +25 -3
- package/dist/agents/roster-store.d.ts +4 -2
- package/dist/agents/send-message-tool.d.ts +1 -1
- package/dist/agents/send-message-tool.js +20 -15
- package/dist/agents/subagent-steps.js +2 -10
- package/dist/agents/subagent.d.ts +3 -0
- package/dist/agents/subagent.js +106 -76
- package/dist/agents/tool-filter.d.ts +20 -11
- package/dist/agents/tool-filter.js +8 -4
- package/dist/agents/verify.d.ts +3 -1
- package/dist/agents/verify.js +2 -0
- package/dist/brain/anthropic.js +4 -4
- package/dist/brain/open-responses.js +3 -1
- package/dist/brain/openai.js +3 -1
- package/dist/brain/reasoning-request.d.ts +73 -19
- package/dist/brain/reasoning-request.js +164 -72
- package/dist/brain/reasoning-stamp.d.ts +26 -0
- package/dist/brain/reasoning-stamp.js +10 -0
- package/dist/brain/reasoning.d.ts +95 -162
- package/dist/brain/reasoning.js +31 -86
- package/dist/brain/route-adjudicator.d.ts +9 -7
- package/dist/brain/route-adjudicator.js +12 -10
- package/dist/brain/status-sink.d.ts +19 -64
- package/dist/brain/status-sink.js +5 -21
- package/dist/brain/stream-engine.d.ts +11 -2
- package/dist/brain/stream-engine.js +10 -0
- package/dist/core/a2a.d.ts +17 -5
- package/dist/core/a2a.js +11 -3
- package/dist/core/allow-entry.d.ts +35 -15
- package/dist/core/allow-entry.js +47 -60
- package/dist/core/ask-headline.d.ts +68 -0
- package/dist/core/ask-headline.js +23 -0
- package/dist/core/ask-origin.d.ts +36 -8
- package/dist/core/ask-origin.js +17 -10
- package/dist/core/ask-question.d.ts +34 -7
- package/dist/core/ask-question.js +10 -1
- package/dist/core/ask-unresolvable-notice.d.ts +7 -0
- package/dist/core/ask-unresolvable-notice.js +9 -3
- package/dist/core/auto-strip.d.ts +53 -0
- package/dist/core/auto-strip.js +76 -0
- package/dist/core/background-agent-store.d.ts +45 -5
- package/dist/core/background-agent-store.js +69 -15
- package/dist/core/background-shell.d.ts +2 -2
- package/dist/core/caller-text.js +2 -2
- package/dist/core/canonical-json.d.ts +13 -0
- package/dist/core/canonical-json.js +7 -0
- package/dist/core/checkpoint-features.d.ts +66 -20
- package/dist/core/checkpoint-features.js +12 -1
- package/dist/core/checkpoint-generation.d.ts +1 -1
- package/dist/core/checkpoint-queries.d.ts +1 -1
- package/dist/core/checkpoint-queries.js +4 -1
- package/dist/core/checkpoint-requirements.d.ts +25 -1
- package/dist/core/checkpoint-requirements.js +5 -1
- package/dist/core/checkpoint-row-verdict.d.ts +1 -0
- package/dist/core/checkpoint-row-verdict.js +4 -0
- package/dist/core/checkpoint-store.d.ts +66 -38
- package/dist/core/checkpoint-store.js +15 -6
- package/dist/core/child-clamp-seats.d.ts +6 -0
- package/dist/core/child-clamp-seats.js +1 -0
- package/dist/core/config-refusal-codes.d.ts +1 -1
- package/dist/core/config-refusal-codes.js +1 -0
- package/dist/core/delegation-frames.d.ts +9 -12
- package/dist/core/delegation-frames.js +9 -8
- package/dist/core/engine-capabilities.d.ts +21 -8
- package/dist/core/engine-capabilities.js +1 -1
- package/dist/core/engine-notice.d.ts +147 -34
- package/dist/core/engine-notice.js +27 -16
- package/dist/core/engine-storage-backend.d.ts +2 -1
- package/dist/core/env-budget.js +3 -3
- package/dist/core/env-knob-announce.d.ts +10 -10
- package/dist/core/env-knob-announce.js +3 -6
- package/dist/core/file-history-store.d.ts +29 -4
- package/dist/core/file-history-store.js +13 -0
- package/dist/core/frame-settlement.d.ts +2 -1
- package/dist/core/gate-fold.js +1 -1
- package/dist/core/gate-lanes.js +56 -49
- package/dist/core/governance-codes.d.ts +39 -3
- package/dist/core/governance-codes.js +61 -3
- package/dist/core/hooks.d.ts +29 -11
- package/dist/core/hooks.js +5 -2
- package/dist/core/human-input-projection.js +3 -3
- package/dist/core/input-author.d.ts +17 -3
- package/dist/core/input-author.js +15 -3
- package/dist/core/leg-identity.d.ts +10 -28
- package/dist/core/leg-identity.js +1 -21
- package/dist/core/lsp.d.ts +18 -13
- package/dist/core/lsp.js +30 -22
- package/dist/core/mailbox-store.d.ts +1 -1
- package/dist/core/mailbox-store.js +4 -4
- package/dist/core/mcp-connection-pool.d.ts +93 -4
- package/dist/core/mcp-connection-pool.js +104 -1
- package/dist/core/mcp-failure.d.ts +38 -12
- package/dist/core/mcp-failure.js +9 -13
- package/dist/core/mcp-probe.d.ts +4 -3
- package/dist/core/mcp-server-link.d.ts +4 -2
- package/dist/core/mcp-server-link.js +4 -5
- package/dist/core/mcp-server-spec.d.ts +3 -3
- package/dist/core/mcp-server-unavailable-notice.d.ts +22 -8
- package/dist/core/mcp-server-unavailable-notice.js +18 -4
- package/dist/core/mcp.d.ts +40 -6
- package/dist/core/mcp.js +39 -13
- package/dist/core/memory-engine/content-origin.js +2 -2
- package/dist/core/memory-engine/control-objects.d.ts +2 -4
- package/dist/core/memory-engine/control-objects.js +2 -10
- package/dist/core/memory-engine/delegation-settlement.js +6 -1
- package/dist/core/memory-engine/dual-root.js +3 -0
- package/dist/core/memory-engine/engine.d.ts +6 -4
- package/dist/core/memory-engine/engine.js +32 -29
- package/dist/core/memory-engine/file-backend.d.ts +20 -5
- package/dist/core/memory-engine/file-backend.js +21 -31
- package/dist/core/memory-engine/frontmatter.d.ts +2 -0
- package/dist/core/memory-engine/frontmatter.js +4 -0
- package/dist/core/memory-engine/layout.d.ts +114 -20
- package/dist/core/memory-engine/layout.js +340 -22
- package/dist/core/memory-engine/memory-deployment.d.ts +7 -5
- package/dist/core/memory-engine/mount-failed-notice.d.ts +19 -7
- package/dist/core/memory-engine/mount-failed-notice.js +43 -10
- package/dist/core/memory-engine/sync-client.js +4 -5
- package/dist/core/model-fallbacks.d.ts +5 -1
- package/dist/core/model-fallbacks.js +3 -3
- package/dist/core/model-receipt.d.ts +2 -1
- package/dist/core/model-receipt.js +12 -1
- package/dist/core/mods/kernel/dispatch.d.ts +2 -2
- package/dist/core/mods/kernel/dispatch.js +14 -6
- package/dist/core/mods/kernel/events.d.ts +8 -5
- package/dist/core/mods/kernel/events.js +2 -2
- package/dist/core/mods/kernel/index.d.ts +1 -1
- package/dist/core/mods/kernel/registration.d.ts +9 -0
- package/dist/core/mods/package.js +1 -1
- package/dist/core/mods/session-append.d.ts +4 -2
- package/dist/core/mods/session-append.js +3 -0
- package/dist/core/mods/stations.d.ts +7 -11
- package/dist/core/mods/stations.js +4 -7
- package/dist/core/mods/tool-call.d.ts +10 -8
- package/dist/core/mods/tool-call.js +15 -18
- package/dist/core/mounted-mcp.d.ts +0 -4
- package/dist/core/mounted-mcp.js +1 -1
- package/dist/core/park-noun.d.ts +24 -0
- package/dist/core/park-noun.js +21 -0
- package/dist/core/park-resumability.d.ts +60 -0
- package/dist/core/park-resumability.js +30 -0
- package/dist/core/permission-rule-provider.d.ts +24 -2
- package/dist/core/permission-rule-provider.js +11 -8
- package/dist/core/permission-rule-store.d.ts +8 -1
- package/dist/core/permission-rule-store.js +2 -3
- package/dist/core/permission-rules.d.ts +2 -1
- package/dist/core/permission-rules.js +8 -4
- package/dist/core/persisted-rule-arms.d.ts +3 -0
- package/dist/core/persisted-rule-arms.js +2 -1
- package/dist/core/present-plan-tool.d.ts +47 -3
- package/dist/core/present-plan-tool.js +62 -4
- package/dist/core/principal-name.d.ts +1 -1
- package/dist/core/principal-name.js +5 -5
- package/dist/core/process-identity.js +10 -5
- package/dist/core/protocol-http-auth.d.ts +20 -14
- package/dist/core/protocol-http-auth.js +70 -50
- package/dist/core/read-only-shell.js +9 -5
- package/dist/core/redaction-marks.d.ts +4 -26
- package/dist/core/redaction-marks.js +9 -21
- package/dist/core/remote-env.d.ts +43 -16
- package/dist/core/remote-env.js +1 -1
- package/dist/core/request-copy-projection.d.ts +1 -1
- package/dist/core/request-copy-projection.js +40 -50
- package/dist/core/resume-config-judge.js +1 -1
- package/dist/core/resume-startup-cause.d.ts +35 -18
- package/dist/core/resume-startup-cause.js +13 -10
- package/dist/core/retention.d.ts +167 -25
- package/dist/core/retention.js +100 -20
- package/dist/core/roles.d.ts +6 -0
- package/dist/core/roles.js +11 -5
- package/dist/core/rule-lane-reads.d.ts +3 -0
- package/dist/core/rule-lane-reads.js +5 -1
- package/dist/core/rule-store-fault.d.ts +70 -0
- package/dist/core/rule-store-fault.js +102 -0
- package/dist/core/runner/advertised-writable-dirs.js +16 -31
- package/dist/core/runner/announce-once-ledger.d.ts +19 -2
- package/dist/core/runner/announce-once-ledger.js +24 -2
- package/dist/core/runner/assemble-result.d.ts +6 -0
- package/dist/core/runner/assemble-result.js +1 -1
- package/dist/core/runner/auto-strip-notice.d.ts +36 -0
- package/dist/core/runner/auto-strip-notice.js +59 -0
- package/dist/core/runner/branch-window.d.ts +3 -0
- package/dist/core/runner/branch-window.js +37 -0
- package/dist/core/runner/caller-roster.d.ts +8 -3
- package/dist/core/runner/capability-withheld-seat.js +3 -9
- package/dist/core/runner/clock-and-limits.d.ts +22 -1
- package/dist/core/runner/clock-and-limits.js +30 -0
- package/dist/core/runner/contracts.d.ts +58 -35
- package/dist/core/runner/credential-refusal-seat.d.ts +2 -0
- package/dist/core/runner/credential-refusal-seat.js +47 -0
- package/dist/core/runner/cross-boundary-lane.js +6 -4
- package/dist/core/runner/decide-continuation.js +1 -1
- package/dist/core/runner/file-history-restore.d.ts +53 -2
- package/dist/core/runner/file-history-restore.js +29 -10
- package/dist/core/runner/forward-sink.d.ts +14 -1
- package/dist/core/runner/forward-sink.js +14 -12
- package/dist/core/runner/gate-exit.d.ts +8 -7
- package/dist/core/runner/gate-exit.js +13 -13
- package/dist/core/runner/git-status-frame.js +2 -4
- package/dist/core/runner/initial-run-state.js +1 -1
- package/dist/core/runner/main-call-account.d.ts +3 -1
- package/dist/core/runner/main-call-account.js +5 -3
- package/dist/core/runner/mcp-redial.d.ts +2 -5
- package/dist/core/runner/mcp-redial.js +2 -2
- package/dist/core/runner/nested-memory-content.d.ts +7 -1
- package/dist/core/runner/nested-memory-content.js +73 -13
- package/dist/core/runner/nested-memory-lane.d.ts +44 -19
- package/dist/core/runner/nested-memory-lane.js +152 -76
- package/dist/core/runner/park-commit.js +3 -1
- package/dist/core/runner/permission-rule-lanes.d.ts +8 -2
- package/dist/core/runner/permission-rule-lanes.js +29 -3
- package/dist/core/runner/person-path-rows.d.ts +3 -11
- package/dist/core/runner/person-path-rows.js +21 -24
- package/dist/core/runner/prepare-acquire-reconcile.js +3 -1
- package/dist/core/runner/prepare-artifact.d.ts +1 -1
- package/dist/core/runner/prepare-artifact.js +20 -14
- package/dist/core/runner/prepare-ask-lane.d.ts +9 -6
- package/dist/core/runner/prepare-ask-lane.js +6 -5
- package/dist/core/runner/prepare-boundary-parks.d.ts +7 -1
- package/dist/core/runner/prepare-boundary-parks.js +27 -24
- package/dist/core/runner/prepare-caps-and-workflow.d.ts +5 -2
- package/dist/core/runner/prepare-caps-and-workflow.js +4 -3
- package/dist/core/runner/prepare-config-doors.d.ts +9 -24
- package/dist/core/runner/prepare-config-doors.js +58 -41
- package/dist/core/runner/prepare-context-lane.d.ts +2 -2
- package/dist/core/runner/prepare-context-lane.js +3 -5
- package/dist/core/runner/prepare-defer-classify.d.ts +1 -1
- package/dist/core/runner/prepare-defer-classify.js +1 -1
- package/dist/core/runner/prepare-delegation-surface.d.ts +2 -2
- package/dist/core/runner/prepare-delegation-surface.js +3 -2
- package/dist/core/runner/prepare-file-history.d.ts +62 -26
- package/dist/core/runner/prepare-file-history.js +117 -46
- package/dist/core/runner/prepare-gate-stations.d.ts +4 -0
- package/dist/core/runner/prepare-gate-stations.js +6 -5
- package/dist/core/runner/prepare-hands-readface.d.ts +9 -4
- package/dist/core/runner/prepare-hands-readface.js +8 -4
- package/dist/core/runner/prepare-inherited-gate.d.ts +11 -4
- package/dist/core/runner/prepare-inherited-gate.js +6 -6
- package/dist/core/runner/prepare-listings.d.ts +1 -1
- package/dist/core/runner/prepare-listings.js +1 -1
- package/dist/core/runner/prepare-memory.js +2 -2
- package/dist/core/runner/prepare-offload-wrappers.d.ts +1 -1
- package/dist/core/runner/prepare-offload-wrappers.js +1 -1
- package/dist/core/runner/prepare-park-ask.d.ts +10 -3
- package/dist/core/runner/prepare-park-ask.js +7 -9
- package/dist/core/runner/prepare-policy-chain.d.ts +18 -9
- package/dist/core/runner/prepare-policy-chain.js +18 -13
- package/dist/core/runner/prepare-project-context.d.ts +1 -1
- package/dist/core/runner/prepare-project-context.js +5 -3
- package/dist/core/runner/prepare-prompt-assembly.js +2 -1
- package/dist/core/runner/prepare-prompt-inputs.d.ts +2 -2
- package/dist/core/runner/prepare-prompt-inputs.js +1 -1
- package/dist/core/runner/prepare-protocol-tools.d.ts +4 -5
- package/dist/core/runner/prepare-protocol-tools.js +7 -7
- package/dist/core/runner/prepare-question-face.d.ts +4 -2
- package/dist/core/runner/prepare-run-refs.d.ts +7 -2
- package/dist/core/runner/prepare-run-refs.js +8 -7
- package/dist/core/runner/prepare-safety-scan.d.ts +4 -3
- package/dist/core/runner/prepare-suspend-saga.d.ts +3 -7
- package/dist/core/runner/prepare-suspend-saga.js +4 -3
- package/dist/core/runner/prepare-task.js +66 -53
- package/dist/core/runner/prepare-tool-disclosure-mount.d.ts +3 -2
- package/dist/core/runner/prepare-tool-disclosure-mount.js +2 -1
- package/dist/core/runner/prepare-turn-wiring.d.ts +3 -1
- package/dist/core/runner/prepare-turn-wiring.js +1 -1
- package/dist/core/runner/prepare-wiring-manifest.d.ts +9 -4
- package/dist/core/runner/prepare-wiring-manifest.js +14 -6
- package/dist/core/runner/prepare-workspace-restore.d.ts +4 -4
- package/dist/core/runner/prepare-workspace-restore.js +15 -6
- package/dist/core/runner/remote-env-retry.d.ts +3 -3
- package/dist/core/runner/restore-seat.d.ts +41 -0
- package/dist/core/runner/restore-seat.js +38 -0
- package/dist/core/runner/resume-admission.js +1 -1
- package/dist/core/runner/resume-apply.js +4 -3
- package/dist/core/runner/resume-checkpoint-screen.js +2 -1
- package/dist/core/runner/resume-internals-and-config.js +2 -1
- package/dist/core/runner/resume-preflight.js +2 -1
- package/dist/core/runner/rewind-files.js +22 -6
- package/dist/core/runner/rule-store-unreadable-notice.d.ts +8 -0
- package/dist/core/runner/rule-store-unreadable-notice.js +11 -0
- package/dist/core/runner/run-brain-sinks.d.ts +3 -6
- package/dist/core/runner/run-brain-sinks.js +6 -6
- package/dist/core/runner/run-compaction-machinery.d.ts +2 -2
- package/dist/core/runner/run-git-lane.d.ts +2 -0
- package/dist/core/runner/run-git-lane.js +2 -1
- package/dist/core/runner/run-harness-handlers.js +5 -4
- package/dist/core/runner/run-identity-wiring.js +20 -12
- package/dist/core/runner/run-leg.js +31 -72
- package/dist/core/runner/run-notification-lane.d.ts +3 -0
- package/dist/core/runner/run-notification-lane.js +2 -4
- package/dist/core/runner/run-reasoning-seat.d.ts +5 -6
- package/dist/core/runner/run-reasoning-seat.js +13 -18
- package/dist/core/runner/run-settle-and-teardown.js +13 -9
- package/dist/core/runner/run-terminal-adoption.js +4 -8
- package/dist/core/runner/run-turn-boundary.js +6 -3
- package/dist/core/runner/runtask.d.ts +9 -4
- package/dist/core/runner/runtask.js +29 -22
- package/dist/core/runner/session-rule-policy.d.ts +11 -1
- package/dist/core/runner/shell-env-withheld.js +2 -7
- package/dist/core/runner/side-call-account.d.ts +5 -6
- package/dist/core/runner/side-call-account.js +2 -2
- package/dist/core/runner/stream-lifecycle-verbs.d.ts +3 -0
- package/dist/core/runner/stream-lifecycle-verbs.js +5 -3
- package/dist/core/runner/stream-settle-backstop.js +4 -6
- package/dist/core/runner/stream-steer-verb.d.ts +1 -1
- package/dist/core/runner/stream-steer-verb.js +4 -4
- package/dist/core/runner/sub-agent-deny-lists.d.ts +8 -3
- package/dist/core/runner/sub-agent-deny-lists.js +7 -4
- package/dist/core/runner/teardown-bounded.d.ts +7 -0
- package/dist/core/runner/teardown-bounded.js +7 -0
- package/dist/core/runner/terminal-account.js +41 -13
- package/dist/core/runner/terminal-projection.d.ts +1 -5
- package/dist/core/runner/tool-end-body.d.ts +9 -3
- package/dist/core/runner/tool-end-body.js +6 -3
- package/dist/core/runner/tool-output-projection.d.ts +13 -4
- package/dist/core/runner/tool-output-projection.js +10 -14
- package/dist/core/runner/turn-attachments.d.ts +3 -2
- package/dist/core/runner/turn-attachments.js +12 -5
- package/dist/core/runner-deps.d.ts +6 -6
- package/dist/core/runtime-caps.d.ts +2 -1
- package/dist/core/secret-env.d.ts +20 -3
- package/dist/core/secret-env.js +13 -15
- package/dist/core/session-checkout.d.ts +115 -15
- package/dist/core/session-checkout.js +435 -136
- package/dist/core/session-policy-store.js +21 -3
- package/dist/core/session-reconcile.js +1 -0
- package/dist/core/session-store.js +2 -0
- package/dist/core/session.d.ts +11 -1
- package/dist/core/shell-run-candidates.d.ts +1 -0
- package/dist/core/shell-run-candidates.js +1 -1
- package/dist/core/shutdown-debug.d.ts +6 -5
- package/dist/core/shutdown-debug.js +5 -1
- package/dist/core/skill-grant.js +4 -1
- package/dist/core/skills-directory.js +5 -3
- package/dist/core/spec-contract.d.ts +1 -1
- package/dist/core/store-contracts/checkpoint-store-contract.js +2 -7
- package/dist/core/store-contracts/file-history-store-contract.js +26 -2
- package/dist/core/store-contracts/session-deletion-cascade-contract.js +130 -14
- package/dist/core/store-contracts/task-list-store-contract.d.ts +2 -1
- package/dist/core/store-contracts/task-list-store-contract.js +28 -1
- package/dist/core/task-event.d.ts +48 -27
- package/dist/core/task-notification.d.ts +15 -9
- package/dist/core/task-notification.js +12 -0
- package/dist/core/task-registry-agent.d.ts +24 -22
- package/dist/core/task-registry-agent.js +65 -46
- package/dist/core/task-registry-shared.d.ts +17 -5
- package/dist/core/task-registry.d.ts +17 -6
- package/dist/core/task-registry.js +6 -1
- package/dist/core/task-result.d.ts +71 -25
- package/dist/core/task-spec-members.d.ts +0 -1
- package/dist/core/task-spec-members.js +1 -1
- package/dist/core/task-spec.d.ts +60 -52
- package/dist/core/task-stream.d.ts +45 -12
- package/dist/core/terminal-cause.d.ts +45 -8
- package/dist/core/terminal-cause.js +5 -0
- package/dist/core/tool-card-bound.d.ts +32 -0
- package/dist/core/tool-card-bound.js +33 -0
- package/dist/core/tool-catalog-entries.d.ts +9 -0
- package/dist/core/tool-catalog-entries.js +48 -0
- package/dist/core/tool-errors.d.ts +4 -3
- package/dist/core/tool-face.d.ts +3 -3
- package/dist/core/tool-mount-facts.d.ts +3 -2
- package/dist/core/tool-mount-facts.js +1 -1
- package/dist/core/tool-mount-static.js +7 -5
- package/dist/core/tool-policy.d.ts +21 -19
- package/dist/core/tool-policy.js +5 -6
- package/dist/core/tool-registry.d.ts +3 -1
- package/dist/core/tool-registry.js +15 -1
- package/dist/core/tool-result-store.d.ts +9 -3
- package/dist/core/tool-result-store.js +14 -1
- package/dist/core/tool-roster.d.ts +6 -0
- package/dist/core/tool-roster.js +18 -0
- package/dist/core/tool-spec.d.ts +17 -8
- package/dist/core/trace.d.ts +35 -31
- package/dist/core/types.d.ts +2 -2
- package/dist/core/untrusted-egress.d.ts +10 -9
- package/dist/core/untrusted-egress.js +9 -9
- package/dist/core/untrusted-text.d.ts +0 -18
- package/dist/core/untrusted-text.js +7 -3
- package/dist/core/user-attachment.d.ts +9 -6
- package/dist/core/user-attachment.js +12 -10
- package/dist/core/user-row-origin.d.ts +44 -25
- package/dist/core/user-row-origin.js +30 -20
- package/dist/core/wiring-manifest.d.ts +26 -7
- package/dist/core/wiring-manifest.js +14 -11
- package/dist/core/workspace-snapshot.d.ts +3 -1
- package/dist/core/workspace-snapshot.js +1 -0
- package/dist/engine/execution-env/node-execution-env.d.ts +23 -16
- package/dist/engine/execution-env/node-execution-env.js +127 -67
- package/dist/engine/harness/agent-harness.d.ts +4 -5
- package/dist/engine/harness/agent-harness.js +2 -7
- package/dist/engine/harness/types.d.ts +51 -19
- package/dist/engine/harness/types.js +28 -1
- package/dist/engine/llm/types.d.ts +26 -14
- package/dist/engine/llm/types.js +2 -2
- package/dist/engine/loop/agent-loop.d.ts +2 -2
- package/dist/engine/loop/agent-loop.js +51 -275
- package/dist/engine/loop/types.d.ts +0 -18
- package/dist/engine/session/import-validate.d.ts +3 -0
- package/dist/engine/session/import-validate.js +34 -2
- package/dist/engine/session/repo-utils.d.ts +42 -4
- package/dist/engine/session/repo-utils.js +33 -5
- package/dist/engine/session/session.d.ts +41 -14
- package/dist/engine/session/session.js +96 -25
- package/dist/index.d.ts +21 -16
- package/dist/index.js +16 -10
- package/dist/orchestration/run-spec.d.ts +1 -1
- package/dist/orchestration/run-workflow-tool.d.ts +12 -9
- package/dist/orchestration/run-workflow-tool.js +15 -19
- package/dist/orchestration/workflow-governance.js +13 -21
- package/dist/orchestration/workflow-observe.d.ts +4 -3
- package/dist/orchestration/workflow-primitives.d.ts +1 -1
- package/dist/orchestration/workflow-record-artifact.d.ts +14 -0
- package/dist/orchestration/workflow-record-artifact.js +32 -0
- package/dist/orchestration/workflow-script-store.d.ts +9 -0
- package/dist/orchestration/workflow-script-store.js +20 -1
- package/dist/orchestration/workflow-types.d.ts +33 -3
- package/dist/orchestration/workflow.d.ts +24 -14
- package/dist/orchestration/workflow.js +52 -23
- package/dist/prompt-assembly/artifact.js +4 -8
- package/dist/prompt-assembly/catalog/engine.d.ts +263 -0
- package/dist/prompt-assembly/catalog/engine.js +30 -0
- package/dist/prompt-assembly/catalog/index.d.ts +1 -1
- package/dist/prompt-assembly/catalog/index.js +2 -2
- package/dist/prompt-assembly/catalog/locales/zh-Hans/engine.d.ts +1 -1
- package/dist/prompt-assembly/catalog/locales/zh-Hans/engine.js +29 -0
- package/dist/prompt-assembly/epoch.js +6 -8
- package/dist/prompt-assembly/turn-snapshot.js +8 -9
- package/dist/stores/file/background-agent-store.js +5 -6
- package/dist/stores/file/checkpoint-store.d.ts +0 -4
- package/dist/stores/file/checkpoint-store.js +7 -3
- package/dist/stores/file/file-history-store.d.ts +8 -0
- package/dist/stores/file/file-history-store.js +72 -0
- package/dist/stores/file/fs-atomic.js +17 -12
- package/dist/stores/file/index.js +11 -5
- package/dist/stores/file/mailbox-store.js +13 -4
- package/dist/stores/file/permission-rule-store.js +14 -13
- package/dist/stores/file/shared-ledger.d.ts +4 -0
- package/dist/stores/file/shared-ledger.js +4 -0
- package/dist/stores/file/task-list-store.js +12 -3
- package/dist/stores/file/workflow-run-store.js +1 -0
- package/dist/tools/fs/bash-program-position.d.ts +4 -2
- package/dist/tools/fs/bash-program-position.js +1 -1
- package/dist/tools/fs/bash-readonly-classifier.js +1 -1
- package/dist/tools/fs/bound-open.d.ts +97 -0
- package/dist/tools/fs/bound-open.js +103 -0
- package/dist/tools/fs/containment-face.d.ts +2 -2
- package/dist/tools/fs/fs-pdf.d.ts +7 -1
- package/dist/tools/fs/fs-pdf.js +31 -23
- package/dist/tools/fs/fs-read.d.ts +24 -17
- package/dist/tools/fs/fs-read.js +84 -53
- package/dist/tools/fs/fs-shared.d.ts +14 -12
- package/dist/tools/fs/fs-shared.js +5 -4
- package/dist/tools/fs/fs-write.d.ts +2 -2
- package/dist/tools/fs/fs-write.js +20 -12
- package/dist/tools/fs/index.d.ts +4 -4
- package/dist/tools/fs/index.js +2 -2
- package/dist/tools/fs/notebook.d.ts +1 -1
- package/dist/tools/fs/pdf.d.ts +12 -3
- package/dist/tools/fs/pdf.js +22 -9
- package/dist/tools/fs/read-deny-home.d.ts +3 -2
- package/dist/tools/fs/read-deny-home.js +8 -11
- package/dist/tools/fs/safety.d.ts +3 -2
- package/dist/tools/fs/shell-read-check.js +10 -9
- package/dist/tools/monitor.d.ts +6 -5
- package/dist/tools/task-list.d.ts +16 -6
- package/dist/tools/task-list.js +4 -0
- package/dist/tools/web.d.ts +9 -1
- package/dist/tools/web.js +8 -3
- package/dist/tools/worktree.d.ts +7 -5
- package/dist/tools/worktree.js +4 -3
- package/package.json +4 -3
- package/test/export-surface.snapshot.json +93 -7
- package/wire-changes/core-stores-sql@7.68.0.json +39 -0
- package/wire-changes/core@7.68.0.json +4257 -0
- package/wire-changes/mods-kernel@7.68.0.json +129 -0
- package/wire-changes/primitives@7.68.0.json +253 -0
- package/wire-changes/wiki-gate@7.68.0.json +39 -0
- package/dist/core/runner/credential-origin-seat.d.ts +0 -2
- package/dist/core/runner/credential-origin-seat.js +0 -20
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { userAttachmentOf } from "../../internal/llm.js";
|
|
2
2
|
import { normalizeFileText } from "../../tools/fs/encoding.js";
|
|
3
|
-
import { countLines } from "../../tools/fs/fs-shared.js";
|
|
3
|
+
import { countLines, witnessesAfterDelivery } from "../../tools/fs/fs-shared.js";
|
|
4
4
|
import { pathFamilyOf, sha256, startsWithDriveLetter } from "../../tools/fs/safety.js";
|
|
5
5
|
import { relativeUnderRoot } from "../sensitive-path-policy.js";
|
|
6
6
|
import { ORG_ADJUDICATION_TIMEOUT_MS } from "../permission-rule-org.js";
|
|
@@ -23,6 +23,16 @@ export const NESTED_MEMORY_STAT_BATCH = 8;
|
|
|
23
23
|
export const NESTED_MEMORY_PROBE_FACE = "nested-memory";
|
|
24
24
|
export const INSTRUCTIONS_WITHHELD = "instructions.withheld";
|
|
25
25
|
export const INSTRUCTIONS_WITHHELD_REASONS = Object.freeze(["rule_denied", "outside_roots", "approval_required", "admission_unknown", "target_moved"]);
|
|
26
|
+
export const INSTRUCTIONS_FAMILY_UNDECLARED = "instructions.family_undeclared";
|
|
27
|
+
export function instructionsFamilyUndeclaredNotice(sessionId) {
|
|
28
|
+
return {
|
|
29
|
+
code: INSTRUCTIONS_FAMILY_UNDECLARED,
|
|
30
|
+
message: "No instruction family is declared for this deployment's runs (`TaskSpec.instructionFamily` is absent), so no run reads any instruction file (CLAUDE.md or another) into the model's context. " +
|
|
31
|
+
"To have them read, declare the family on the task spec: `instructionFamily: { files: [...] }` names the files each directory is read for (`rulesDir`, `alternate`, `includes` and `hostRules` are its other members). " +
|
|
32
|
+
"Said once to each notice receiver (once per process with none wired); `projectMemory: \"disabled\"` on a request is the off switch that says it on purpose.",
|
|
33
|
+
detail: { sessionId },
|
|
34
|
+
};
|
|
35
|
+
}
|
|
26
36
|
const FIELD = "TaskSpec.instructionFamily";
|
|
27
37
|
export const NESTED_MEMORY_LANE = Object.freeze({
|
|
28
38
|
declaration: FIELD,
|
|
@@ -85,7 +95,13 @@ export function screenNestedMemory(spec, projectMemory) {
|
|
|
85
95
|
return undefined;
|
|
86
96
|
if (!isPlain(v))
|
|
87
97
|
throw refuse(FIELD, `must be an object (got ${describeRejectedValue(v)}).`);
|
|
88
|
-
onlyKeys(v, ["files", "rulesDir", "alternate", "includes", "hostRules"], FIELD);
|
|
98
|
+
onlyKeys(v, ["files", "rulesDir", "alternate", "includes", "additionalDirectories", "hostRules"], FIELD);
|
|
99
|
+
const flag = (key) => {
|
|
100
|
+
const f = v[key];
|
|
101
|
+
if (f !== undefined && typeof f !== "boolean")
|
|
102
|
+
throw refuse(`${FIELD}.${key}`, `must be a boolean (got ${describeRejectedValue(f)}).`);
|
|
103
|
+
return f === true;
|
|
104
|
+
};
|
|
89
105
|
const seen = new Map();
|
|
90
106
|
const files = v["files"] === undefined ? [] : screenNames(v["files"], `${FIELD}.files`, seen);
|
|
91
107
|
const rulesDir = v["rulesDir"] === undefined ? undefined : screenName(v["rulesDir"], `${FIELD}.rulesDir`);
|
|
@@ -103,15 +119,14 @@ export function screenNestedMemory(spec, projectMemory) {
|
|
|
103
119
|
const altRules = a["rulesDir"] === undefined ? undefined : screenName(a["rulesDir"], `${at}.rulesDir`);
|
|
104
120
|
alternate = Object.freeze({ files: Object.freeze(altFiles), ...(altRules !== undefined ? { rulesDir: altRules } : {}), when });
|
|
105
121
|
}
|
|
106
|
-
const includes =
|
|
107
|
-
|
|
108
|
-
throw refuse(`${FIELD}.includes`, `must be a boolean (got ${describeRejectedValue(includes)}).`);
|
|
122
|
+
const includes = flag("includes");
|
|
123
|
+
const additionalDirectories = flag("additionalDirectories");
|
|
109
124
|
const hostRules = v["hostRules"] === undefined ? [] : screenHostRules(v["hostRules"]);
|
|
110
125
|
if (files.length === 0 && rulesDir === undefined && alternate === undefined && hostRules.length === 0)
|
|
111
126
|
throw refuse(FIELD, "names nothing to load (no files, rulesDir, alternate or hostRules) — omit it instead.");
|
|
112
127
|
if (projectMemory === "disabled")
|
|
113
128
|
return undefined;
|
|
114
|
-
return Object.freeze({ files: Object.freeze(files), ...(rulesDir !== undefined ? { rulesDir } : {}), ...(alternate !== undefined ? { alternate } : {}), includes
|
|
129
|
+
return Object.freeze({ files: Object.freeze(files), ...(rulesDir !== undefined ? { rulesDir } : {}), ...(alternate !== undefined ? { alternate } : {}), includes, additionalDirectories, hostRules: Object.freeze(hostRules) });
|
|
115
130
|
}
|
|
116
131
|
function screenHostRules(v) {
|
|
117
132
|
const at = `${FIELD}.hostRules`;
|
|
@@ -184,18 +199,40 @@ export function createNestedMemoryLane(seat) {
|
|
|
184
199
|
const decl = seat.declaration;
|
|
185
200
|
const win = pathFamilyOf({ root: seat.root }) === "win";
|
|
186
201
|
const sep = win ? "\\" : "/";
|
|
187
|
-
const
|
|
188
|
-
const
|
|
189
|
-
const
|
|
190
|
-
const
|
|
191
|
-
|
|
202
|
+
const baseOf = (dir) => (dir.endsWith(sep) ? dir.slice(0, -1) : dir);
|
|
203
|
+
const roots = [{ base: baseOf(seat.root) }];
|
|
204
|
+
for (const r of decl.additionalDirectories ? (seat.additionalRoots ?? []) : []) {
|
|
205
|
+
const base = baseOf(r.canonical);
|
|
206
|
+
if (!roots.some((x) => x.base === base))
|
|
207
|
+
roots.push({ base, directory: r.directory });
|
|
208
|
+
}
|
|
209
|
+
const absIn = (r, rel) => (rel === "" ? roots[r].base : `${roots[r].base}${sep}${win ? rel.replaceAll("/", "\\") : rel}`);
|
|
210
|
+
const relIn = (r, key) => {
|
|
211
|
+
const base = roots[r].base;
|
|
212
|
+
const x = base === "" ? (key.startsWith(sep) ? key.slice(sep.length) : null) : relativeUnderRoot(key, base);
|
|
213
|
+
return x === null ? undefined : win ? x.replaceAll("\\", "/") : x;
|
|
192
214
|
};
|
|
215
|
+
const abs = (rel) => absIn(0, rel);
|
|
216
|
+
const relOf = (key) => relIn(0, key);
|
|
193
217
|
const levelsOf = (rel) => {
|
|
194
218
|
const segs = rel.split("/");
|
|
195
219
|
return segs.slice(0, -1).map((_, i) => segs.slice(0, i + 1).join("/"));
|
|
196
220
|
};
|
|
197
221
|
const queue = [];
|
|
198
|
-
const queued = new
|
|
222
|
+
const queued = new Map();
|
|
223
|
+
const rankOf = (i) => (i.level === "" ? i.root : roots.length);
|
|
224
|
+
const claim = (i) => {
|
|
225
|
+
const id = itemId(i);
|
|
226
|
+
const held = queued.get(id);
|
|
227
|
+
if (held !== undefined) {
|
|
228
|
+
const at = queue.indexOf(held);
|
|
229
|
+
if (rankOf(held) <= rankOf(i) || at < 0)
|
|
230
|
+
return false;
|
|
231
|
+
queue.splice(at, 1);
|
|
232
|
+
}
|
|
233
|
+
queued.set(id, i);
|
|
234
|
+
return true;
|
|
235
|
+
};
|
|
199
236
|
const inFlight = new Set();
|
|
200
237
|
const includesBy = new Map();
|
|
201
238
|
let hostRetry = false;
|
|
@@ -208,8 +245,27 @@ export function createNestedMemoryLane(seat) {
|
|
|
208
245
|
return e !== undefined && isInstructionLaneEntry(e) ? e : undefined;
|
|
209
246
|
};
|
|
210
247
|
const withdrawing = new Set();
|
|
211
|
-
const
|
|
212
|
-
const
|
|
248
|
+
const asked = new Set();
|
|
249
|
+
const asksAgain = (i) => asked.has(i.path) && (i.kind === "listing" || i.rule === "any");
|
|
250
|
+
const queueAgain = (items) => {
|
|
251
|
+
for (const i of items) {
|
|
252
|
+
let at = queue.length - 1;
|
|
253
|
+
while (at >= 0 && (queue[at].root !== i.root || queue[at].level !== i.level))
|
|
254
|
+
at--;
|
|
255
|
+
queue.splice(at + 1, 0, i);
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
const queueOwed = (items, front) => {
|
|
259
|
+
const first = items.filter((i) => !asksAgain(i));
|
|
260
|
+
if (front)
|
|
261
|
+
queue.unshift(...first);
|
|
262
|
+
else
|
|
263
|
+
queue.push(...first);
|
|
264
|
+
queueAgain(items.filter(asksAgain));
|
|
265
|
+
};
|
|
266
|
+
const second = (r) => r === 0 && alternateOn === true;
|
|
267
|
+
const activeNames = (r) => [...decl.files, ...(second(r) ? decl.alternate.files : [])];
|
|
268
|
+
const activeRules = (r) => [decl.rulesDir, second(r) ? decl.alternate?.rulesDir : undefined].filter((d) => d !== undefined);
|
|
213
269
|
const memberAt = (rel, level, names, rules) => {
|
|
214
270
|
const local = level === "" ? rel : rel.startsWith(`${level}/`) ? rel.slice(level.length + 1) : undefined;
|
|
215
271
|
if (local === undefined)
|
|
@@ -218,40 +274,42 @@ export function createNestedMemoryLane(seat) {
|
|
|
218
274
|
return "name";
|
|
219
275
|
return rules.some((d) => local.startsWith(`${d}/`) && local.endsWith(".md")) ? "rule" : undefined;
|
|
220
276
|
};
|
|
221
|
-
const
|
|
222
|
-
|
|
277
|
+
const declaredOf = roots.map((_, r) => ({
|
|
278
|
+
names: [...decl.files, ...(r === 0 ? (decl.alternate?.files ?? []) : [])],
|
|
279
|
+
rules: [decl.rulesDir, r === 0 ? decl.alternate?.rulesDir : undefined].filter((d) => d !== undefined),
|
|
280
|
+
}));
|
|
281
|
+
const declaredNamesOf = (r) => declaredOf[r].names;
|
|
282
|
+
const declaredRulesOf = (r) => declaredOf[r].rules;
|
|
283
|
+
const rootLevelOf = (key) => roots.findIndex((_, r) => {
|
|
284
|
+
const rel = relIn(r, key);
|
|
285
|
+
return rel !== undefined && rel !== "" && memberAt(rel, "", declaredNamesOf(r), declaredRulesOf(r)) !== undefined;
|
|
286
|
+
});
|
|
223
287
|
const isMember = (key, at) => {
|
|
288
|
+
if (rootLevelOf(key) >= 0)
|
|
289
|
+
return true;
|
|
224
290
|
const rel = relOf(key);
|
|
225
|
-
|
|
226
|
-
return false;
|
|
227
|
-
return (at === "root" ? [""] : ["", ...levelsOf(rel)]).some((level) => memberAt(rel, level, declaredNames, declaredRules) !== undefined);
|
|
291
|
+
return at === "any" && rel !== undefined && rel !== "" && levelsOf(rel).some((level) => memberAt(rel, level, declaredNamesOf(0), declaredRulesOf(0)) !== undefined);
|
|
228
292
|
};
|
|
229
|
-
const
|
|
293
|
+
const levelItems = (r, level) => {
|
|
230
294
|
const items = [];
|
|
231
295
|
const add = (i) => {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
return;
|
|
235
|
-
queued.add(id);
|
|
236
|
-
items.push(i);
|
|
296
|
+
if (claim(i))
|
|
297
|
+
items.push(i);
|
|
237
298
|
};
|
|
238
|
-
const join = (name) =>
|
|
239
|
-
const names = activeNames();
|
|
240
|
-
const rules = activeRules();
|
|
299
|
+
const join = (name) => absIn(r, level === "" ? name : `${level}/${name}`);
|
|
300
|
+
const names = activeNames(r);
|
|
301
|
+
const rules = activeRules(r);
|
|
241
302
|
for (const name of names)
|
|
242
|
-
add({ kind: "file", level, path: join(name), rule: "none", depth: 0 });
|
|
303
|
+
add({ kind: "file", root: r, level, path: join(name), rule: "none", depth: 0 });
|
|
243
304
|
for (const dir of rules)
|
|
244
|
-
add({ kind: "listing", level, path: join(dir) });
|
|
305
|
+
add({ kind: "listing", root: r, level, path: join(dir) });
|
|
245
306
|
for (const [key, e] of seat.state) {
|
|
246
|
-
const rel =
|
|
307
|
+
const rel = relIn(r, key);
|
|
247
308
|
const member = rel === undefined || rel === "" || !isInstructionLaneEntry(e) ? undefined : memberAt(rel, level, names, rules);
|
|
248
309
|
if (member !== undefined)
|
|
249
|
-
add({ kind: "file", level, path: key, rule: member === "name" ? "none" : "any", depth: 0 });
|
|
310
|
+
add({ kind: "file", root: r, level, path: key, rule: member === "name" ? "none" : "any", depth: 0 });
|
|
250
311
|
}
|
|
251
|
-
|
|
252
|
-
queue.unshift(...items);
|
|
253
|
-
else
|
|
254
|
-
queue.push(...items);
|
|
312
|
+
return items;
|
|
255
313
|
};
|
|
256
314
|
const handBack = (rs) => {
|
|
257
315
|
for (const r of rs) {
|
|
@@ -260,9 +318,7 @@ export function createNestedMemoryLane(seat) {
|
|
|
260
318
|
}
|
|
261
319
|
if (rs.some((r) => r.key.startsWith(HOST_RULE_KEY)))
|
|
262
320
|
hostRetry = true;
|
|
263
|
-
const back = rs.filter((r) => !r.key.startsWith(HOST_RULE_KEY)).map((r) => r.item).filter(
|
|
264
|
-
for (const i of back)
|
|
265
|
-
queued.add(itemId(i));
|
|
321
|
+
const back = rs.filter((r) => !r.key.startsWith(HOST_RULE_KEY)).map((r) => r.item).filter(claim);
|
|
266
322
|
queue.unshift(...back);
|
|
267
323
|
};
|
|
268
324
|
let primed;
|
|
@@ -313,9 +369,12 @@ export function createNestedMemoryLane(seat) {
|
|
|
313
369
|
const atRoot = await Promise.all(decl.files.map((name) => seat.env.fileInfo(abs(name), seat.signal).catch(() => undefined)));
|
|
314
370
|
alternateOn = !atRoot.some((info) => info?.ok === true && info.value.kind !== "directory");
|
|
315
371
|
}
|
|
372
|
+
queueOwed(roots.flatMap((_, r) => levelItems(r, "")), true);
|
|
316
373
|
for (const level of [...dirty].sort((a, b) => a.split("/").length - b.split("/").length || (a < b ? -1 : a > b ? 1 : 0)))
|
|
317
|
-
if (level
|
|
318
|
-
|
|
374
|
+
if (level !== "" && [...accesses].some((r) => r.startsWith(`${level}/`)))
|
|
375
|
+
queueOwed(levelItems(0, level), false);
|
|
376
|
+
queue.sort((a, b) => rankOf(a) - rankOf(b));
|
|
377
|
+
const probes = NESTED_MEMORY_PROBES_PER_LOAD * roots.length;
|
|
319
378
|
const model = leg.harness.getModel();
|
|
320
379
|
const cpt = model.charsPerToken ?? 4;
|
|
321
380
|
const cap = instructionFileCap(model.contextWindow, cpt);
|
|
@@ -333,16 +392,20 @@ export function createNestedMemoryLane(seat) {
|
|
|
333
392
|
const withheld = (path, reason) => once(INSTRUCTIONS_WITHHELD, path, reason, () => {
|
|
334
393
|
if (delegated)
|
|
335
394
|
return;
|
|
336
|
-
const
|
|
395
|
+
const r = rootLevelOf(path);
|
|
396
|
+
const where = r === 0 ? "the task root" : r > 0 ? "an additional working directory" : "a directory the model accessed";
|
|
337
397
|
deliverEngineNotice(seat.deps.onNotice, { code: INSTRUCTIONS_WITHHELD, message: `An instruction file of ${where} was not loaded: ${path} (${WITHHELD_TEXT[reason]}).`, detail: { path, reason, sessionId: leg.sessionId, runId: leg.runId } });
|
|
338
398
|
});
|
|
339
|
-
const
|
|
399
|
+
const tellOperator = (lane, path, why, sentence) => once(lane, path, why, () => {
|
|
340
400
|
try {
|
|
341
|
-
seat.deps.onError?.(new Error(
|
|
401
|
+
seat.deps.onError?.(new Error(sentence), { phase: "degraded", sessionId: leg.sessionId, classification: "attachment-read" });
|
|
342
402
|
}
|
|
343
403
|
catch {
|
|
344
404
|
}
|
|
345
405
|
});
|
|
406
|
+
const unread = (path, why) => tellOperator("nested_memory_unread", path, why, `instruction file ${path} was not loaded: ${why}`);
|
|
407
|
+
const unlimited = (path) => tellOperator("nested_memory_rule_paths", path, "no_limit", `instruction rule ${path} names \`paths:\` but it reads as no limit (nothing listed, only \`**\`, or a form the engine does not recognise), so the rule applies to every file; to limit it, list the globs (\`paths:\` then \`- src/**\` lines, or \`paths: [src/**, lib/**]\`); if every file is meant, remove the key`);
|
|
408
|
+
const spansLines = (path) => tellOperator("nested_memory_rule_paths", path, "spans_lines", `instruction rule ${path} gives \`paths:\` as one text over several lines, which reads as a single glob that matches no file, so the rule is never loaded; for several globs list them (\`paths:\` then \`- src/**\` lines) or write them on one line separated by commas (\`paths: src/**, lib/**\`)`);
|
|
346
409
|
const reads = [];
|
|
347
410
|
const withdraw = (key, item) => {
|
|
348
411
|
if (inFlight.has(key))
|
|
@@ -373,18 +436,22 @@ export function createNestedMemoryLane(seat) {
|
|
|
373
436
|
};
|
|
374
437
|
const visited = new Set();
|
|
375
438
|
const deadlineAt = Date.now() + ORG_ADJUDICATION_TIMEOUT_MS;
|
|
376
|
-
const ruleApplies = (globs, level) => [...accesses].some((
|
|
439
|
+
const ruleApplies = (globs, r, level) => [...accesses].some((a) => {
|
|
440
|
+
const rel = relIn(r, abs(a));
|
|
441
|
+
return rel !== undefined && rel !== "" && (level === "" || rel.startsWith(`${level}/`)) && ruleGlobsMatch(globs, level === "" ? rel : rel.slice(level.length + 1));
|
|
442
|
+
});
|
|
377
443
|
const stats = new Map();
|
|
378
444
|
const statsAhead = (first) => {
|
|
379
445
|
if (first.kind !== "file" || stats.has(first.path))
|
|
380
446
|
return;
|
|
381
|
-
const room = Math.max(1, Math.min(NESTED_MEMORY_STAT_BATCH,
|
|
447
|
+
const room = Math.max(1, Math.min(NESTED_MEMORY_STAT_BATCH, probes - p.count));
|
|
382
448
|
const batch = [first, ...queue.filter((i) => i.kind === "file" && !stats.has(i.path))].slice(0, room);
|
|
383
449
|
p.count += batch.length;
|
|
384
450
|
for (const i of batch)
|
|
385
451
|
stats.set(i.path, seat.env.fileInfo(i.path, seat.signal).catch((err) => ({ ok: false, error: { code: "io", message: thrownText(err) } })));
|
|
386
452
|
};
|
|
387
453
|
const probeFile = async (item) => {
|
|
454
|
+
asked.add(item.path);
|
|
388
455
|
const info = await stats.get(item.path);
|
|
389
456
|
if (!info.ok) {
|
|
390
457
|
if (info.error.code === "not_found" && deliveredEntry(item.path) !== undefined)
|
|
@@ -422,7 +489,7 @@ export function createNestedMemoryLane(seat) {
|
|
|
422
489
|
return [];
|
|
423
490
|
}
|
|
424
491
|
p.count++;
|
|
425
|
-
const held = await seat.reader.openBound(key, seat.signal)
|
|
492
|
+
const held = await seat.reader.openBound(key, seat.signal);
|
|
426
493
|
try {
|
|
427
494
|
const verdict = await seat.judge({ file_path: item.path, face }, NESTED_MEMORY_PROBE_FACE, { deadlineAt });
|
|
428
495
|
if (verdict.verdict !== "no_objection") {
|
|
@@ -434,12 +501,12 @@ export function createNestedMemoryLane(seat) {
|
|
|
434
501
|
return [];
|
|
435
502
|
}
|
|
436
503
|
visited.add(key);
|
|
437
|
-
const t = await seat.reader.readText(key, { signal: seat.signal }, { judgedKey: key, capBytes: INSTRUCTION_FILE_MAX_BYTES,
|
|
504
|
+
const t = await seat.reader.readText(key, { signal: seat.signal }, { judgedKey: key, capBytes: INSTRUCTION_FILE_MAX_BYTES, opened: { key, opening: held } });
|
|
438
505
|
return admit(t, item, key, mtime, entry);
|
|
439
506
|
}
|
|
440
507
|
finally {
|
|
441
|
-
if (held
|
|
442
|
-
await held.
|
|
508
|
+
if (held.kind === "bound")
|
|
509
|
+
await held.object.close().catch(() => undefined);
|
|
443
510
|
}
|
|
444
511
|
};
|
|
445
512
|
const admit = (t, item, key, mtime, entry) => {
|
|
@@ -455,9 +522,13 @@ export function createNestedMemoryLane(seat) {
|
|
|
455
522
|
const text = normalizeFileText(t.text);
|
|
456
523
|
const hash = sha256(text);
|
|
457
524
|
const shown = processInstructionText(text, decl.includes);
|
|
458
|
-
if (item.rule !== "none" && shown.
|
|
525
|
+
if (item.rule !== "none" && shown.noLimit === true)
|
|
526
|
+
unlimited(item.path);
|
|
527
|
+
if (item.rule !== "none" && shown.spansLines === true)
|
|
528
|
+
spansLines(item.path);
|
|
529
|
+
if (item.rule !== "none" && shown.globs !== undefined && !ruleApplies(shown.globs, item.root, item.level))
|
|
459
530
|
return [];
|
|
460
|
-
const targets = includeTargetsOf(shown.includes, key);
|
|
531
|
+
const targets = includeTargetsOf(shown.includes, key, item.root);
|
|
461
532
|
includesBy.set(key, targets);
|
|
462
533
|
const more = includesAt(targets, item);
|
|
463
534
|
if (pending.has(key))
|
|
@@ -484,7 +555,7 @@ export function createNestedMemoryLane(seat) {
|
|
|
484
555
|
...(cut.note !== undefined ? { cut: cut.note } : {}),
|
|
485
556
|
observation: { key, entry: recorded, stampedAt: mtime },
|
|
486
557
|
record: (transmission) => {
|
|
487
|
-
const landed = { ...recorded, lastReadAt: mtime, witnesses:
|
|
558
|
+
const landed = { ...recorded, lastReadAt: mtime, witnesses: witnessesAfterDelivery(seat.state.get(key), recorded, transmission) };
|
|
488
559
|
seat.state.set(key, landed);
|
|
489
560
|
seen?.set(key, entryId(landed));
|
|
490
561
|
inFlight.delete(key);
|
|
@@ -494,20 +565,21 @@ export function createNestedMemoryLane(seat) {
|
|
|
494
565
|
reads.push({ read, item, key });
|
|
495
566
|
return more;
|
|
496
567
|
};
|
|
497
|
-
const includeTargetsOf = (paths, from) => {
|
|
498
|
-
const fromRel =
|
|
568
|
+
const includeTargetsOf = (paths, from, r) => {
|
|
569
|
+
const fromRel = relIn(r, from);
|
|
499
570
|
if (fromRel === undefined)
|
|
500
571
|
return [];
|
|
501
572
|
const base = fromRel.split("/").slice(0, -1);
|
|
502
573
|
return paths.flatMap((raw) => {
|
|
503
574
|
if (raw.startsWith("~/"))
|
|
504
575
|
return [];
|
|
505
|
-
const rel = raw.startsWith("/") ?
|
|
506
|
-
return rel === undefined || rel === "" || !isTextIncludeTarget(rel) ? [] : [
|
|
576
|
+
const rel = raw.startsWith("/") ? relIn(r, raw) : resolveRel(base, raw);
|
|
577
|
+
return rel === undefined || rel === "" || !isTextIncludeTarget(rel) ? [] : [absIn(r, rel)];
|
|
507
578
|
});
|
|
508
579
|
};
|
|
509
|
-
const includesAt = (targets, item) => item.depth + 1 < INSTRUCTION_INCLUDE_MAX_DEPTH ? targets.map((path) => ({ kind: "file", level: item.level, path, rule: "none", depth: item.depth + 1 })) : [];
|
|
580
|
+
const includesAt = (targets, item) => item.depth + 1 < INSTRUCTION_INCLUDE_MAX_DEPTH ? targets.map((path) => ({ kind: "file", root: item.root, level: item.level, path, rule: "none", depth: item.depth + 1 })) : [];
|
|
510
581
|
const probeListing = async (item) => {
|
|
582
|
+
asked.add(item.path);
|
|
511
583
|
p.count++;
|
|
512
584
|
const listed = await seat.env.listDir(item.path, seat.signal).catch((err) => ({ ok: false, error: { code: "io", message: thrownText(err) } }));
|
|
513
585
|
if (!listed.ok) {
|
|
@@ -517,13 +589,13 @@ export function createNestedMemoryLane(seat) {
|
|
|
517
589
|
}
|
|
518
590
|
const entries = [...listed.value].sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));
|
|
519
591
|
return [
|
|
520
|
-
...entries.filter((e) => e.kind !== "directory" && e.name.endsWith(".md")).map((e) => ({ kind: "file", level: item.level, path: e.path, rule: "any", depth: 0 })),
|
|
521
|
-
...entries.filter((e) => e.kind === "directory").map((e) => ({ kind: "listing", level: item.level, path: e.path })),
|
|
592
|
+
...entries.filter((e) => e.kind !== "directory" && e.name.endsWith(".md")).map((e) => ({ kind: "file", root: item.root, level: item.level, path: e.path, rule: "any", depth: 0 })),
|
|
593
|
+
...entries.filter((e) => e.kind === "directory").map((e) => ({ kind: "listing", root: item.root, level: item.level, path: e.path })),
|
|
522
594
|
];
|
|
523
595
|
};
|
|
524
596
|
const budget = NESTED_MEMORY_FRAME_BUDGET_FILES * cap;
|
|
525
597
|
let chars = 0;
|
|
526
|
-
while (queue.length > 0 && p.count <
|
|
598
|
+
while (queue.length > 0 && p.count < probes && !seat.signal.aborted && chars <= budget) {
|
|
527
599
|
const item = queue.shift();
|
|
528
600
|
queued.delete(itemId(item));
|
|
529
601
|
statsAhead(item);
|
|
@@ -538,10 +610,7 @@ export function createNestedMemoryLane(seat) {
|
|
|
538
610
|
}
|
|
539
611
|
for (const r of reads.slice(before))
|
|
540
612
|
chars += r.read.text.length;
|
|
541
|
-
|
|
542
|
-
for (const i of added)
|
|
543
|
-
queued.add(itemId(i));
|
|
544
|
-
queue.unshift(...added);
|
|
613
|
+
queueOwed(more.filter(claim), true);
|
|
545
614
|
}
|
|
546
615
|
if (decl.hostRules.length > 0 && (dirty.size > 0 || hostRetry)) {
|
|
547
616
|
hostRetry = false;
|
|
@@ -553,7 +622,7 @@ export function createNestedMemoryLane(seat) {
|
|
|
553
622
|
continue;
|
|
554
623
|
const key = `${HOST_RULE_KEY}${r.name}`;
|
|
555
624
|
inFlight.add(key);
|
|
556
|
-
reads.push({ key, item: { kind: "file", level: "", path: key, rule: "none", depth: 0 }, read: { supply: "content_text", owner: r.level === "project" ? "repository" : "deployment", layer: "nested", label: r.name, text: cut.text, ...(cut.note !== undefined ? { cut: cut.note } : {}), record: () => (inFlight.delete(key), echo.fn?.(r.name, "nested", false)) } });
|
|
625
|
+
reads.push({ key, item: { kind: "file", root: 0, level: "", path: key, rule: "none", depth: 0 }, read: { supply: "content_text", owner: r.level === "project" ? "repository" : "deployment", layer: "nested", label: r.name, text: cut.text, ...(cut.note !== undefined ? { cut: cut.note } : {}), record: () => (inFlight.delete(key), echo.fn?.(r.name, "nested", false)) } });
|
|
557
626
|
}
|
|
558
627
|
}
|
|
559
628
|
if (fresh.length > 0) {
|
|
@@ -614,16 +683,23 @@ export function createNestedMemoryLane(seat) {
|
|
|
614
683
|
}
|
|
615
684
|
return mint(reads);
|
|
616
685
|
},
|
|
617
|
-
|
|
618
|
-
const keys = new Set();
|
|
619
|
-
for (const key of [...seat.state.keys(), ...inFlight])
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
686
|
+
selected() {
|
|
687
|
+
const keys = roots.map(() => new Set());
|
|
688
|
+
for (const key of [...seat.state.keys(), ...inFlight]) {
|
|
689
|
+
const r = withdrawing.has(key) ? -1 : rootLevelOf(key);
|
|
690
|
+
if (r >= 0)
|
|
691
|
+
keys[r].add(key);
|
|
692
|
+
}
|
|
693
|
+
const of = (r) => {
|
|
694
|
+
const names = declaredNamesOf(r);
|
|
695
|
+
const rank = (rel) => {
|
|
696
|
+
const i = names.indexOf(rel);
|
|
697
|
+
return i < 0 ? names.length : i;
|
|
698
|
+
};
|
|
699
|
+
return Object.freeze([...keys[r]].map((k) => relIn(r, k)).sort((a, b) => rank(a) - rank(b) || (a < b ? -1 : a > b ? 1 : 0)));
|
|
625
700
|
};
|
|
626
|
-
|
|
701
|
+
const additional = roots.slice(1).map((x, i) => Object.freeze({ directory: x.directory, selected: of(i + 1) }));
|
|
702
|
+
return Object.freeze({ selected: of(0), ...(decl.additionalDirectories ? { additionalDirectories: Object.freeze(additional) } : {}) });
|
|
627
703
|
},
|
|
628
704
|
isMember,
|
|
629
705
|
};
|
|
@@ -635,7 +711,7 @@ export async function primeInstructionLane(lane, manifest, report) {
|
|
|
635
711
|
catch (err) {
|
|
636
712
|
report(asThrownError(err));
|
|
637
713
|
}
|
|
638
|
-
manifest.instructions =
|
|
714
|
+
manifest.instructions = lane.selected();
|
|
639
715
|
}
|
|
640
716
|
function resolveRel(base, raw) {
|
|
641
717
|
const out = [...base];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { planReviewRequesterOf } from "../checkpoint-store.js";
|
|
1
|
+
import { planReviewContentHashOf, planReviewRequesterOf } from "../checkpoint-store.js";
|
|
2
2
|
export const DEFAULT_RESOURCE_TTL_MS = 30 * 24 * 60 * 60 * 1000;
|
|
3
3
|
export const USAGE_WINDOW_REAP_MARGIN_MS = 60 * 60 * 1000;
|
|
4
4
|
export const DEFAULT_UNATTENDED_APPROVAL_TTL_MS = 30 * 24 * 60 * 60 * 1000;
|
|
@@ -21,6 +21,7 @@ export function parkContaminationMarker(refs) {
|
|
|
21
21
|
}
|
|
22
22
|
export function publishCommittedSuspend(refs, token, gate, scope, remoteHandle, checkpointId, pendingAction) {
|
|
23
23
|
const requestedByCallId = pendingAction !== undefined ? planReviewRequesterOf(pendingAction) : undefined;
|
|
24
|
+
const planContentHash = pendingAction !== undefined ? planReviewContentHashOf(pendingAction) : undefined;
|
|
24
25
|
const pause = {
|
|
25
26
|
cause: {
|
|
26
27
|
kind: "paused",
|
|
@@ -28,6 +29,7 @@ export function publishCommittedSuspend(refs, token, gate, scope, remoteHandle,
|
|
|
28
29
|
token,
|
|
29
30
|
...(checkpointId !== undefined ? { checkpointId } : {}),
|
|
30
31
|
...(requestedByCallId !== undefined ? { requestedByCallId } : {}),
|
|
32
|
+
...(planContentHash !== undefined ? { planContentHash } : {}),
|
|
31
33
|
...(remoteHandle !== undefined ? { restoreMode: remoteHandle.restoreMode === "park_only" ? "park_only" : "snapshot" } : {}),
|
|
32
34
|
},
|
|
33
35
|
scope,
|
|
@@ -31,6 +31,7 @@ import { type PathRuleBases } from "../permission-rule-model.js";
|
|
|
31
31
|
import { type HeadLeads } from "../path-rule-binding.js";
|
|
32
32
|
import { type OrgRuleResolution } from "../permission-rule-org.js";
|
|
33
33
|
import { type EffectivePermissionRules, type PermissionRuleStoreProvider, type PersonRowsRead } from "../permission-rule-provider.js";
|
|
34
|
+
import { type AutoStripReason } from "../auto-strip.js";
|
|
34
35
|
/**
|
|
35
36
|
* The evidence an INHERITED-lane ask carries.
|
|
36
37
|
*
|
|
@@ -184,8 +185,13 @@ export declare function createPermissionRuleLanes(cfg: {
|
|
|
184
185
|
pin(toolCallId: string, judged?: unknown): Promise<PersonRowsRead>;
|
|
185
186
|
forRequest(): Promise<PersonRowsRead>;
|
|
186
187
|
};
|
|
187
|
-
/** The allow layer's auto strip over a stored ALLOW row (
|
|
188
|
-
stripsAllow?: (rule: PersistedRule, req: ToolCallRequest) =>
|
|
188
|
+
/** The allow layer's auto strip over a stored ALLOW row (a reason ⇒ out of this call's table BEFORE the coverage is chosen). */
|
|
189
|
+
stripsAllow?: (rule: PersistedRule, req: ToolCallRequest) => AutoStripReason | undefined;
|
|
190
|
+
/** Hears each stored allow row the strip took from a call this lane judged — one the call's allow judgment would have read
|
|
191
|
+
* (its tool among the call's granting names, a whole-tool row reaching it, a path row on a judged path face), that applies here
|
|
192
|
+
* (its scope covers this leg) and whose text reads as an allow rule (one that does not grants nothing in any mode). Absent ⇒
|
|
193
|
+
* nobody is told (a judgment that is not the gate's: the consolidation judge, a synthetic read, a resumed call's belt). */
|
|
194
|
+
onAutoStripped?: (rule: PersistedRule, reason: AutoStripReason, req: ToolCallRequest) => void;
|
|
189
195
|
}): PermissionRuleLanes;
|
|
190
196
|
/** The surviving-ask facts the rule-offer factory reads (see {@link createRuleOffersOf}): the
|
|
191
197
|
* synchronous mint sites spread the surviving decision, which carries them; the park leg threads
|
|
@@ -10,6 +10,7 @@ import { describeUnreadableOrgRows, readOrgRules, settleOrgVerdictWithin } from
|
|
|
10
10
|
import { ASK_USER_QUESTION_TOOL_NAME } from "../ask-question.js";
|
|
11
11
|
import { routesContent } from "../tool-catalog-entries.js";
|
|
12
12
|
import { ownerStoreOf } from "../permission-rule-provider.js";
|
|
13
|
+
import { storedAllowRowRead } from "../auto-strip.js";
|
|
13
14
|
import { readPrincipal } from "../principal-name.js";
|
|
14
15
|
import { thrownText } from "../thrown-value.js";
|
|
15
16
|
import { strongestAnswer } from "../persisted-rule-arms.js";
|
|
@@ -131,11 +132,18 @@ export function createPermissionRuleLanes(cfg) {
|
|
|
131
132
|
if (!judged.some(([, g, grants]) => g === "path" && grants) && faceRowsSpeakFor(callPathFaceOf(req)))
|
|
132
133
|
judged.push([req.toolName, "path", true]);
|
|
133
134
|
const view = await reader.pin(req.toolCallId, req.args);
|
|
135
|
+
const storeUnreadable = () => ({ unreadable: true, ...(view.unreadableFaults !== undefined ? { faults: view.unreadableFaults } : {}) });
|
|
134
136
|
const ownRow = (r) => judged.some(([n]) => n === r.tool) || wholeToolRuleReaches(r.tool, req, r.behavior);
|
|
135
137
|
if (judged.length === 0 && !view.rules.some(ownRow))
|
|
136
|
-
return view.unreadable !== undefined ?
|
|
138
|
+
return view.unreadable !== undefined ? storeUnreadable() : undefined;
|
|
137
139
|
try {
|
|
138
|
-
const
|
|
140
|
+
const strips = new Map();
|
|
141
|
+
for (const r of view.rules) {
|
|
142
|
+
const reason = r.behavior === "allow" ? cfg.stripsAllow?.(r, req) : undefined;
|
|
143
|
+
if (reason !== undefined)
|
|
144
|
+
strips.set(r, reason);
|
|
145
|
+
}
|
|
146
|
+
const stripped = view.rules.filter((r) => !strips.has(r));
|
|
139
147
|
const judgesPath = judged.some(([, g]) => g === "path");
|
|
140
148
|
const noRule = [];
|
|
141
149
|
const table = stripped.filter((r) => {
|
|
@@ -150,8 +158,10 @@ export function createPermissionRuleLanes(cfg) {
|
|
|
150
158
|
const judgedAnswer = strongestAnswer([...judged.map(([n, grammar, grants]) => judgeAgainst(grants ? table : table.filter((r) => r.behavior !== "allow"), { ...req, toolName: n }, grammar, leads, scopeIdentity)), wholeTool]);
|
|
151
159
|
const unjudged = noRule.find(({ row }) => (row.behavior === "deny" || row.behavior === "ask") && eligiblePersisted(row, { tool: row.tool, cwd: cfg.root, sessionId: cfg.sessionId, ...(scopeIdentity !== undefined ? { scopeIdentity } : {}) }, row.behavior));
|
|
152
160
|
const answer = unjudged !== undefined && !(judgedAnswer !== undefined && "behavior" in judgedAnswer && judgedAnswer.behavior === "deny") ? unjudgedRowAnswer(unjudged.row, unjudged.why, req.toolName) : judgedAnswer;
|
|
161
|
+
if (cfg.onAutoStripped !== undefined && strips.size > 0)
|
|
162
|
+
await tellStrips(strips, req, judged, cfg.onAutoStripped);
|
|
153
163
|
const stands = answer !== undefined && (("behavior" in answer && answer.behavior === "deny") || "unreadable" in answer);
|
|
154
|
-
return view.unreadable !== undefined && !stands ?
|
|
164
|
+
return view.unreadable !== undefined && !stands ? storeUnreadable() : answer;
|
|
155
165
|
}
|
|
156
166
|
catch (err) {
|
|
157
167
|
const why = `judging this call against the rows threw: ${thrownText(err)}`;
|
|
@@ -165,6 +175,22 @@ export function createPermissionRuleLanes(cfg) {
|
|
|
165
175
|
return { unreadable: true, reason: why };
|
|
166
176
|
};
|
|
167
177
|
const anchorsOf = (rule) => persistedRowAnchors(rule.scope, cfg.chainTop);
|
|
178
|
+
const tellStrips = async (strips, req, judged, told) => {
|
|
179
|
+
try {
|
|
180
|
+
const grantNames = judged.flatMap(([n, , grants]) => (grants ? [n] : []));
|
|
181
|
+
const grantsPath = judged.some(([, g, grants]) => g === "path" && grants);
|
|
182
|
+
const read = [...strips].filter(([r]) => (grantNames.includes(r.tool) || (r.match === "tool" && wholeToolRuleReaches(r.tool, req, "allow")) || (grantsPath && (r.match === "path" || r.match === "subpath"))) && storedAllowRowRead(r) !== undefined);
|
|
183
|
+
if (read.length === 0)
|
|
184
|
+
return;
|
|
185
|
+
const scopeIdentity = await projectScopeIdentity(read.map(([r]) => r), cfg.rootCanonical, cfg.leads);
|
|
186
|
+
for (const [r, reason] of read)
|
|
187
|
+
if (eligiblePersisted(r, { tool: r.tool, cwd: cfg.root, sessionId: cfg.sessionId, ...(scopeIdentity !== undefined ? { scopeIdentity } : {}) }, "allow"))
|
|
188
|
+
told(r, reason, req);
|
|
189
|
+
}
|
|
190
|
+
catch (err) {
|
|
191
|
+
cfg.onDisclosure(`the account of the stored allow rows auto mode set aside for a ${req.toolName} call could not be given: ${thrownText(err)}`);
|
|
192
|
+
}
|
|
193
|
+
};
|
|
168
194
|
const judgeAgainst = (table, req, grammar, leads, scopeIdentity) => {
|
|
169
195
|
const liveCwd = cfg.liveCwd();
|
|
170
196
|
const scope = scopeIdentity !== undefined ? { scopeIdentity } : {};
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
import type { EffectivePermissionRules, PermissionRuleStoreProvider, PersonRowsRead } from "../permission-rule-provider.js";
|
|
50
50
|
import { type PathRuleBases } from "../permission-rule-model.js";
|
|
51
51
|
import { type BoundPathRule, type HeadLeads } from "../path-rule-binding.js";
|
|
52
|
+
import { type RuleStoreFault } from "../rule-store-fault.js";
|
|
52
53
|
import type { RunnerDeps } from "../runner-deps.js";
|
|
53
54
|
import { type PathRuleDenyRow, type ReadDenyBuiltinConfig, type ReadDenyEntry, type ReadDenySeat, type WriteDenyMatcher } from "../../tools/fs/read-deny.js";
|
|
54
55
|
import { type HomeViewSource, type PlacedReadDenyMatcher } from "../../tools/fs/read-deny-home.js";
|
|
@@ -167,8 +168,8 @@ export interface PersonPathRowsConfig {
|
|
|
167
168
|
/** The operator's line for each read the store could not answer, each disclosure line a read carries, each row a table
|
|
168
169
|
* could not anchor. */
|
|
169
170
|
onDisclosure: (message: string) => void;
|
|
170
|
-
/** The
|
|
171
|
-
onUnread: (at: "prepare" | "call",
|
|
171
|
+
/** The notice for a store that could not be read (`ruleStoreUnreadableNotice`, rule-store-unreadable-notice.ts), with why: told once per session per fault set. */
|
|
172
|
+
onUnread: (at: "prepare" | "call", faults: readonly RuleStoreFault[]) => void;
|
|
172
173
|
/** The run's one notice for rows left out ({@link ruleRowsDroppedNotice}). */
|
|
173
174
|
onRowsDropped: (rows: EffectivePermissionRules["droppedRows"]) => void;
|
|
174
175
|
/** The run's cut: a read it interrupts is abandoned quietly — a cancelled wait is no fact about the store — and every wait
|
|
@@ -247,15 +248,6 @@ export declare function personPathRowsOfTask(t: {
|
|
|
247
248
|
};
|
|
248
249
|
readonly signals: readonly AbortSignal[];
|
|
249
250
|
}): PersonPathRows;
|
|
250
|
-
/**
|
|
251
|
-
* The run's ONE `permission.rule_store_unavailable` notice (audience user): the person's rules — the whole store, or the
|
|
252
|
-
* sources of it whose partition could not be read — could not be read; minted by whichever read found it first (the
|
|
253
|
-
* prepare read, or a call's), once per run however many reads fail after it. The trace keeps every read's line.
|
|
254
|
-
*/
|
|
255
|
-
export declare function ruleStoreUnreadableNotice(onNotice: RunnerDeps["onNotice"], ids: {
|
|
256
|
-
readonly sessionId: string;
|
|
257
|
-
readonly runId: string;
|
|
258
|
-
}): (at: "prepare" | "call", sources?: EffectivePermissionRules["unreadableSources"]) => void;
|
|
259
251
|
/**
|
|
260
252
|
* The run's ONE `permission.rule_row_dropped` notice (audience user): the person's store served project-scoped rows whose
|
|
261
253
|
* scope root is not a complete absolute path, left out of the checks; minted by whichever read met them first, once per
|