@sema-agent/core 7.67.3 → 7.68.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1537 -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 +45 -2
- package/dist/core/checkpoint-requirements.js +16 -6
- 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 +18 -0
- package/dist/core/tool-roster.js +30 -1
- 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-stores-sql@7.68.1.json +39 -0
- package/wire-changes/core@7.68.0.json +4257 -0
- package/wire-changes/core@7.68.1.json +95 -0
- package/wire-changes/mods-kernel@7.68.0.json +129 -0
- package/wire-changes/mods-kernel@7.68.1.json +39 -0
- package/wire-changes/primitives@7.68.0.json +253 -0
- package/wire-changes/primitives@7.68.1.json +39 -0
- package/wire-changes/wiki-gate@7.68.0.json +39 -0
- package/wire-changes/wiki-gate@7.68.1.json +39 -0
- package/dist/core/runner/credential-origin-seat.d.ts +0 -2
- package/dist/core/runner/credential-origin-seat.js +0 -20
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
* truncation note is the one an entry cut at the per-entry cap carries on either lane.
|
|
8
8
|
* - The tool-miss result names the tool (a retired name adds what the retirement table says); the roster recovery
|
|
9
9
|
* lists a capped prefix of the mounted tools and points at the search tool when it is mounted.
|
|
10
|
+
* - An approval card's headline is a person's line, not the model's: one row per ask class, two remedy rows and the
|
|
11
|
+
* joiner, composed in one place (`core/ask-headline.ts`) in the run's locale.
|
|
10
12
|
*/
|
|
11
13
|
import type { Attribution } from "./schema.js";
|
|
12
14
|
export declare const ENGINE_MESSAGES: readonly [{
|
|
@@ -105,4 +107,265 @@ export declare const ENGINE_MESSAGES: readonly [{
|
|
|
105
107
|
readonly text: string;
|
|
106
108
|
}];
|
|
107
109
|
attribution: Attribution;
|
|
110
|
+
}, {
|
|
111
|
+
id: "core/engine.ask-headline.hook";
|
|
112
|
+
variants: readonly [{
|
|
113
|
+
readonly id: "default";
|
|
114
|
+
readonly when: {};
|
|
115
|
+
readonly text: string;
|
|
116
|
+
}];
|
|
117
|
+
attribution: Attribution;
|
|
118
|
+
securityBearing: true;
|
|
119
|
+
}, {
|
|
120
|
+
id: "core/engine.ask-headline.ancestor";
|
|
121
|
+
variants: readonly [{
|
|
122
|
+
readonly id: "default";
|
|
123
|
+
readonly when: {};
|
|
124
|
+
readonly text: string;
|
|
125
|
+
}];
|
|
126
|
+
attribution: Attribution;
|
|
127
|
+
securityBearing: true;
|
|
128
|
+
}, {
|
|
129
|
+
id: "core/engine.ask-headline.dangerous_delete";
|
|
130
|
+
variants: readonly [{
|
|
131
|
+
readonly id: "default";
|
|
132
|
+
readonly when: {};
|
|
133
|
+
readonly text: string;
|
|
134
|
+
}];
|
|
135
|
+
attribution: Attribution;
|
|
136
|
+
securityBearing: true;
|
|
137
|
+
}, {
|
|
138
|
+
id: "core/engine.ask-headline.unverifiable_delete";
|
|
139
|
+
variants: readonly [{
|
|
140
|
+
readonly id: "default";
|
|
141
|
+
readonly when: {};
|
|
142
|
+
readonly text: string;
|
|
143
|
+
}];
|
|
144
|
+
attribution: Attribution;
|
|
145
|
+
securityBearing: true;
|
|
146
|
+
}, {
|
|
147
|
+
id: "core/engine.ask-headline.unverifiable_shell_text";
|
|
148
|
+
variants: readonly [{
|
|
149
|
+
readonly id: "default";
|
|
150
|
+
readonly when: {};
|
|
151
|
+
readonly text: string;
|
|
152
|
+
}];
|
|
153
|
+
attribution: Attribution;
|
|
154
|
+
securityBearing: true;
|
|
155
|
+
}, {
|
|
156
|
+
id: "core/engine.ask-headline.transcript_write";
|
|
157
|
+
variants: readonly [{
|
|
158
|
+
readonly id: "default";
|
|
159
|
+
readonly when: {};
|
|
160
|
+
readonly text: string;
|
|
161
|
+
}];
|
|
162
|
+
attribution: Attribution;
|
|
163
|
+
securityBearing: true;
|
|
164
|
+
}, {
|
|
165
|
+
id: "core/engine.ask-headline.org_rule";
|
|
166
|
+
variants: readonly [{
|
|
167
|
+
readonly id: "default";
|
|
168
|
+
readonly when: {};
|
|
169
|
+
readonly text: string;
|
|
170
|
+
}];
|
|
171
|
+
attribution: Attribution;
|
|
172
|
+
securityBearing: true;
|
|
173
|
+
}, {
|
|
174
|
+
id: "core/engine.ask-headline.rule_unreadable";
|
|
175
|
+
variants: readonly [{
|
|
176
|
+
readonly id: "default";
|
|
177
|
+
readonly when: {};
|
|
178
|
+
readonly text: string;
|
|
179
|
+
}];
|
|
180
|
+
attribution: Attribution;
|
|
181
|
+
securityBearing: true;
|
|
182
|
+
}, {
|
|
183
|
+
id: "core/engine.ask-headline.ask_rule";
|
|
184
|
+
variants: readonly [{
|
|
185
|
+
readonly id: "default";
|
|
186
|
+
readonly when: {};
|
|
187
|
+
readonly text: string;
|
|
188
|
+
}];
|
|
189
|
+
attribution: Attribution;
|
|
190
|
+
securityBearing: true;
|
|
191
|
+
}, {
|
|
192
|
+
id: "core/engine.ask-headline.denial_limit_fallback";
|
|
193
|
+
variants: readonly [{
|
|
194
|
+
readonly id: "default";
|
|
195
|
+
readonly when: {};
|
|
196
|
+
readonly text: string;
|
|
197
|
+
}];
|
|
198
|
+
attribution: Attribution;
|
|
199
|
+
securityBearing: true;
|
|
200
|
+
}, {
|
|
201
|
+
id: "core/engine.ask-headline.classifier_no_ruling";
|
|
202
|
+
variants: readonly [{
|
|
203
|
+
readonly id: "default";
|
|
204
|
+
readonly when: {};
|
|
205
|
+
readonly text: string;
|
|
206
|
+
}];
|
|
207
|
+
attribution: Attribution;
|
|
208
|
+
securityBearing: true;
|
|
209
|
+
}, {
|
|
210
|
+
id: "core/engine.ask-headline.requires_user_interaction";
|
|
211
|
+
variants: readonly [{
|
|
212
|
+
readonly id: "default";
|
|
213
|
+
readonly when: {};
|
|
214
|
+
readonly text: string;
|
|
215
|
+
}];
|
|
216
|
+
attribution: Attribution;
|
|
217
|
+
securityBearing: true;
|
|
218
|
+
}, {
|
|
219
|
+
id: "core/engine.ask-headline.cross_boundary";
|
|
220
|
+
variants: readonly [{
|
|
221
|
+
readonly id: "default";
|
|
222
|
+
readonly when: {};
|
|
223
|
+
readonly text: string;
|
|
224
|
+
}];
|
|
225
|
+
attribution: Attribution;
|
|
226
|
+
securityBearing: true;
|
|
227
|
+
}, {
|
|
228
|
+
id: "core/engine.ask-headline.operator_forced";
|
|
229
|
+
variants: readonly [{
|
|
230
|
+
readonly id: "default";
|
|
231
|
+
readonly when: {};
|
|
232
|
+
readonly text: string;
|
|
233
|
+
}];
|
|
234
|
+
attribution: Attribution;
|
|
235
|
+
securityBearing: true;
|
|
236
|
+
}, {
|
|
237
|
+
id: "core/engine.ask-headline.shell_floor";
|
|
238
|
+
variants: readonly [{
|
|
239
|
+
readonly id: "default";
|
|
240
|
+
readonly when: {};
|
|
241
|
+
readonly text: string;
|
|
242
|
+
}];
|
|
243
|
+
attribution: Attribution;
|
|
244
|
+
securityBearing: true;
|
|
245
|
+
}, {
|
|
246
|
+
id: "core/engine.ask-headline.target_unresolved";
|
|
247
|
+
variants: readonly [{
|
|
248
|
+
readonly id: "default";
|
|
249
|
+
readonly when: {};
|
|
250
|
+
readonly text: string;
|
|
251
|
+
}];
|
|
252
|
+
attribution: Attribution;
|
|
253
|
+
securityBearing: true;
|
|
254
|
+
}, {
|
|
255
|
+
id: "core/engine.ask-headline.probe";
|
|
256
|
+
variants: readonly [{
|
|
257
|
+
readonly id: "default";
|
|
258
|
+
readonly when: {};
|
|
259
|
+
readonly text: string;
|
|
260
|
+
}];
|
|
261
|
+
attribution: Attribution;
|
|
262
|
+
securityBearing: true;
|
|
263
|
+
}, {
|
|
264
|
+
id: "core/engine.ask-headline.write_protection_on_disk";
|
|
265
|
+
variants: readonly [{
|
|
266
|
+
readonly id: "default";
|
|
267
|
+
readonly when: {};
|
|
268
|
+
readonly text: string;
|
|
269
|
+
}];
|
|
270
|
+
attribution: Attribution;
|
|
271
|
+
securityBearing: true;
|
|
272
|
+
}, {
|
|
273
|
+
id: "core/engine.ask-headline.write_protection";
|
|
274
|
+
variants: readonly [{
|
|
275
|
+
readonly id: "default";
|
|
276
|
+
readonly when: {};
|
|
277
|
+
readonly text: string;
|
|
278
|
+
}];
|
|
279
|
+
attribution: Attribution;
|
|
280
|
+
securityBearing: true;
|
|
281
|
+
}, {
|
|
282
|
+
id: "core/engine.ask-headline.tool_marks_mcp";
|
|
283
|
+
variants: readonly [{
|
|
284
|
+
readonly id: "default";
|
|
285
|
+
readonly when: {};
|
|
286
|
+
readonly text: string;
|
|
287
|
+
}];
|
|
288
|
+
attribution: Attribution;
|
|
289
|
+
securityBearing: true;
|
|
290
|
+
}, {
|
|
291
|
+
id: "core/engine.ask-headline.tool_marks_a2a";
|
|
292
|
+
variants: readonly [{
|
|
293
|
+
readonly id: "default";
|
|
294
|
+
readonly when: {};
|
|
295
|
+
readonly text: string;
|
|
296
|
+
}];
|
|
297
|
+
attribution: Attribution;
|
|
298
|
+
securityBearing: true;
|
|
299
|
+
}, {
|
|
300
|
+
id: "core/engine.ask-headline.policy_rra";
|
|
301
|
+
variants: readonly [{
|
|
302
|
+
readonly id: "default";
|
|
303
|
+
readonly when: {};
|
|
304
|
+
readonly text: string;
|
|
305
|
+
}];
|
|
306
|
+
attribution: Attribution;
|
|
307
|
+
securityBearing: true;
|
|
308
|
+
}, {
|
|
309
|
+
id: "core/engine.ask-headline.artifact_shared_read";
|
|
310
|
+
variants: readonly [{
|
|
311
|
+
readonly id: "default";
|
|
312
|
+
readonly when: {};
|
|
313
|
+
readonly text: string;
|
|
314
|
+
}];
|
|
315
|
+
attribution: Attribution;
|
|
316
|
+
securityBearing: true;
|
|
317
|
+
}, {
|
|
318
|
+
id: "core/engine.ask-headline.mode";
|
|
319
|
+
variants: readonly [{
|
|
320
|
+
readonly id: "default";
|
|
321
|
+
readonly when: {};
|
|
322
|
+
readonly text: string;
|
|
323
|
+
}];
|
|
324
|
+
attribution: Attribution;
|
|
325
|
+
securityBearing: true;
|
|
326
|
+
}, {
|
|
327
|
+
id: "core/engine.ask-headline.unstated";
|
|
328
|
+
variants: readonly [{
|
|
329
|
+
readonly id: "default";
|
|
330
|
+
readonly when: {};
|
|
331
|
+
readonly text: string;
|
|
332
|
+
}];
|
|
333
|
+
attribution: Attribution;
|
|
334
|
+
securityBearing: true;
|
|
335
|
+
}, {
|
|
336
|
+
id: "core/engine.ask-headline.ordinary";
|
|
337
|
+
variants: readonly [{
|
|
338
|
+
readonly id: "default";
|
|
339
|
+
readonly when: {};
|
|
340
|
+
readonly text: string;
|
|
341
|
+
}];
|
|
342
|
+
attribution: Attribution;
|
|
343
|
+
securityBearing: true;
|
|
344
|
+
}, {
|
|
345
|
+
id: "core/engine.ask-headline-remedy.rule-clears";
|
|
346
|
+
variants: readonly [{
|
|
347
|
+
readonly id: "default";
|
|
348
|
+
readonly when: {};
|
|
349
|
+
readonly text: string;
|
|
350
|
+
}];
|
|
351
|
+
attribution: Attribution;
|
|
352
|
+
securityBearing: true;
|
|
353
|
+
}, {
|
|
354
|
+
id: "core/engine.ask-headline-remedy.rule-cannot";
|
|
355
|
+
variants: readonly [{
|
|
356
|
+
readonly id: "default";
|
|
357
|
+
readonly when: {};
|
|
358
|
+
readonly text: string;
|
|
359
|
+
}];
|
|
360
|
+
attribution: Attribution;
|
|
361
|
+
securityBearing: true;
|
|
362
|
+
}, {
|
|
363
|
+
id: "core/engine.ask-headline-join";
|
|
364
|
+
variants: readonly [{
|
|
365
|
+
readonly id: "default";
|
|
366
|
+
readonly when: {};
|
|
367
|
+
readonly text: string;
|
|
368
|
+
}];
|
|
369
|
+
attribution: Attribution;
|
|
370
|
+
securityBearing: true;
|
|
108
371
|
}];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const engineMessage = (id, text, attribution) => ({ id, variants: [{ id: "default", when: {}, text }], attribution });
|
|
2
|
+
const headlineRow = (id, text) => ({ id, variants: [{ id: "default", when: {}, text }], attribution: SEMA, securityBearing: true });
|
|
2
3
|
const SEMA = { form: "sema-owned" };
|
|
3
4
|
const MCP_DELTA = { form: "verbatim", cc: ["cli316.js B[22433497,22433900) `mcp_instructions_delta`"] };
|
|
4
5
|
const TOOL_MISS = { form: "adapted", cc: ['cli316.js B[26552585,26552700) "No such tool available"'] };
|
|
@@ -16,4 +17,33 @@ export const ENGINE_MESSAGES = Object.freeze([
|
|
|
16
17
|
engineMessage("core/engine.roster-listing-withheld", "{{shown}} … and {{withheld}} more", SEMA),
|
|
17
18
|
engineMessage("core/engine.image-prefix-one", "[Image from tool result {{ids}}]", SEMA),
|
|
18
19
|
engineMessage("core/engine.image-prefix-many", "[Images from tool result {{ids}}]", SEMA),
|
|
20
|
+
headlineRow("core/engine.ask-headline.hook", "A check this deployment runs before tools wants you to decide this step."),
|
|
21
|
+
headlineRow("core/engine.ask-headline.ancestor", "The agent that started this one needs your approval for this step."),
|
|
22
|
+
headlineRow("core/engine.ask-headline.dangerous_delete", "This deletes a top-level, home or workspace folder, or a folder that holds one."),
|
|
23
|
+
headlineRow("core/engine.ask-headline.unverifiable_delete", "This deletes files, and the command does not say which ones."),
|
|
24
|
+
headlineRow("core/engine.ask-headline.unverifiable_shell_text", "The engine cannot read exactly what this command will run, so it cannot be checked first."),
|
|
25
|
+
headlineRow("core/engine.ask-headline.transcript_write", "This changes the record of this session's own conversation."),
|
|
26
|
+
headlineRow("core/engine.ask-headline.org_rule", "Your organization's policy asks for your approval here."),
|
|
27
|
+
headlineRow("core/engine.ask-headline.rule_unreadable", "A permission rule that may cover this could not be read, so you are asked instead."),
|
|
28
|
+
headlineRow("core/engine.ask-headline.ask_rule", "A rule in the settings asks before steps like this."),
|
|
29
|
+
headlineRow("core/engine.ask-headline.denial_limit_fallback", "Automatic approval has turned down as many steps as this session allows, so this one comes to you."),
|
|
30
|
+
headlineRow("core/engine.ask-headline.classifier_no_ruling", "Automatic approval could not decide on this step, so it comes to you."),
|
|
31
|
+
headlineRow("core/engine.ask-headline.requires_user_interaction", "This tool says you have to take part in this step."),
|
|
32
|
+
headlineRow("core/engine.ask-headline.cross_boundary", "This session may run on a device outside the deployment's trusted network, and this step may cross between the two."),
|
|
33
|
+
headlineRow("core/engine.ask-headline.operator_forced", "This deployment marks steps like this as needing your approval."),
|
|
34
|
+
headlineRow("core/engine.ask-headline.shell_floor", "This deployment asks you before every command."),
|
|
35
|
+
headlineRow("core/engine.ask-headline.target_unresolved", "Where this writes cannot be worked out before it runs."),
|
|
36
|
+
headlineRow("core/engine.ask-headline.probe", "This may reach outside this session's folders or be hard to undo, and a check could not rule that out."),
|
|
37
|
+
headlineRow("core/engine.ask-headline.write_protection_on_disk", "This writes to a protected file through a link or another spelling of its path."),
|
|
38
|
+
headlineRow("core/engine.ask-headline.write_protection", "This writes to a protected file, such as the agent's own settings."),
|
|
39
|
+
headlineRow("core/engine.ask-headline.tool_marks_mcp", "The tool's server marks this as sending data out or as not undoable."),
|
|
40
|
+
headlineRow("core/engine.ask-headline.tool_marks_a2a", "This sends a request to another agent service, which may act on it."),
|
|
41
|
+
headlineRow("core/engine.ask-headline.policy_rra", "This deployment's policy asks for your approval here."),
|
|
42
|
+
headlineRow("core/engine.ask-headline.artifact_shared_read", "This reads something another task shared."),
|
|
43
|
+
headlineRow("core/engine.ask-headline.mode", "Your current permission mode asks before this step."),
|
|
44
|
+
headlineRow("core/engine.ask-headline.unstated", "This tool does not say what it needs permission for, so you are asked."),
|
|
45
|
+
headlineRow("core/engine.ask-headline.ordinary", "No rule or check singled this step out — steps like it are just not allowed on their own yet."),
|
|
46
|
+
headlineRow("core/engine.ask-headline-remedy.rule-clears", "Saving an allow rule for it would stop it being asked again."),
|
|
47
|
+
headlineRow("core/engine.ask-headline-remedy.rule-cannot", "Saving an allow rule would not stop it being asked again."),
|
|
48
|
+
headlineRow("core/engine.ask-headline-join", "{{why}} {{remedy}}"),
|
|
19
49
|
]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type CatalogMessage, type PromptCatalog } from "./schema.js";
|
|
2
2
|
export declare const SEMA_DEFAULT_CATALOG: PromptCatalog;
|
|
3
|
-
/** The digest a locale row binds:
|
|
3
|
+
/** The digest a locale row binds: the variant text it was written from, in the package's one `sha256:` text form. */
|
|
4
4
|
export declare function sourceDigestOf(text: string): string;
|
|
5
5
|
/**
|
|
6
6
|
* Structural validation (fail loud, never a silent skip): unique message ids and variant ids, unique section ids and
|
|
@@ -8,7 +8,7 @@ import { ROLE_MESSAGES } from "./role.js";
|
|
|
8
8
|
import { SECTIONS } from "./sections.js";
|
|
9
9
|
import { TEAM_MESSAGES } from "./team.js";
|
|
10
10
|
import { BANDS } from "../bands.js";
|
|
11
|
-
import {
|
|
11
|
+
import { textContentHashOf } from "../../core/canonical-json.js";
|
|
12
12
|
import { slotNames } from "../slots.js";
|
|
13
13
|
import { LOCALE_PACKS } from "./locales/index.js";
|
|
14
14
|
import { PROMPT_LOCALES, RENDERER_IDS, isWordOf } from "./schema.js";
|
|
@@ -20,7 +20,7 @@ export const SEMA_DEFAULT_CATALOG = {
|
|
|
20
20
|
locales: LOCALE_PACKS,
|
|
21
21
|
};
|
|
22
22
|
export function sourceDigestOf(text) {
|
|
23
|
-
return
|
|
23
|
+
return textContentHashOf(text);
|
|
24
24
|
}
|
|
25
25
|
export function validateCatalog(catalog) {
|
|
26
26
|
const fail = (why) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* zh-Hans renderings of the engine messages (catalog/engine.ts): the MCP instructions frame, the recovery nudge, the
|
|
3
|
-
* tool-miss result
|
|
3
|
+
* tool-miss result, the image provenance line and the approval card's headline rows. Each row bound to its source text (see ./constitution.ts). Tool
|
|
4
4
|
* names, server names and the other slot values arrive as written.
|
|
5
5
|
*/
|
|
6
6
|
import type { LocalePack } from "../../schema.js";
|
|
@@ -12,4 +12,33 @@ export const ZH_HANS_ENGINE = {
|
|
|
12
12
|
"core/engine.roster-listing-withheld": row("sha256:6c9f2d06b0fdb4184dd12a48492f61a93b31b44c503b25a6acd0481271ca9fc1", "{{shown}} …另有 {{withheld}} 个"),
|
|
13
13
|
"core/engine.image-prefix-one": row("sha256:9b087eb94fb417111f8272560a076ee2d198dd0f242bc464aba2a77fe94e7b6a", "[来自工具结果 {{ids}} 的图片]"),
|
|
14
14
|
"core/engine.image-prefix-many": row("sha256:7cb0d8a734632cc2d6de9cf8dfdeac6a1a4c2aa4194754053a766809149366e6", "[来自工具结果 {{ids}} 的多张图片]"),
|
|
15
|
+
"core/engine.ask-headline.hook": row("sha256:6150ff79801ee4e0dd28a9cbc52d2adad37937c7a68ffd4f7393e36bf7a40256", "这个部署在工具运行前设的检查要你来决定这一步。"),
|
|
16
|
+
"core/engine.ask-headline.ancestor": row("sha256:3cbfd3062f5beb35b2ef654bc1cf9c8d9f08d1863c06d7af4889bada8701e510", "启动这个智能体的上一级智能体需要你批准这一步。"),
|
|
17
|
+
"core/engine.ask-headline.dangerous_delete": row("sha256:ca743a6e3ed4f8a7003d0e1e10731f94e959a3c3f2d189da63f860aa563e6c62", "这会删除顶层目录、主目录或工作区目录,或包含它们的目录。"),
|
|
18
|
+
"core/engine.ask-headline.unverifiable_delete": row("sha256:a9eabf2635ad76a3f1ee5eeb3db0093737d8db98508f749c91ae5f842d954364", "这会删除文件,但命令里没有写明删哪些。"),
|
|
19
|
+
"core/engine.ask-headline.unverifiable_shell_text": row("sha256:70549a30dd95456d2a25b254acd6f483457b7e42961496571a7b74ad158f7a41", "引擎读不出这条命令实际会运行什么,无法事先检查。"),
|
|
20
|
+
"core/engine.ask-headline.transcript_write": row("sha256:9eadd40a0899456df70a43214214193c1de6bfaa4772b77e2aadd57512582f72", "这会改动本会话自己的对话记录。"),
|
|
21
|
+
"core/engine.ask-headline.org_rule": row("sha256:a7df105a27516ad0b71510f9a00b328b48480454afdbbf10cb1338212ae9d244", "你所在组织的策略要求这里由你批准。"),
|
|
22
|
+
"core/engine.ask-headline.rule_unreadable": row("sha256:20dd3a79741e92136d3b237c2424659cd27ac740c9f4eb7462bfae9a1b620b33", "一条可能适用于这一步的权限规则读不出来,所以改为问你。"),
|
|
23
|
+
"core/engine.ask-headline.ask_rule": row("sha256:f299ac3946bb2732102bb727e4d8a300591e6aecbf1b34b08419cf52286ded95", "设置里有一条规则要求这类步骤先问。"),
|
|
24
|
+
"core/engine.ask-headline.denial_limit_fallback": row("sha256:cc8a397e42358f486f7465c6365066eb56f7e5a4b3c03fb83ad1a33a2bfdee9f", "自动审批拒绝的步骤已达本会话允许的上限,所以这一步交给你。"),
|
|
25
|
+
"core/engine.ask-headline.classifier_no_ruling": row("sha256:f8bbe425ed41f26a79a734b6899641496d9899e3366ae4e2916537676820e146", "自动审批没能对这一步作出判断,所以交给你。"),
|
|
26
|
+
"core/engine.ask-headline.requires_user_interaction": row("sha256:e888ad7e9d5b23d5394c4e055d5b6c70853f2200f7f4a85dcc78be3d6eadb62b", "这个工具声明这一步必须由你参与。"),
|
|
27
|
+
"core/engine.ask-headline.cross_boundary": row("sha256:f383d4a52d78a5c71195901d65f22ee10d83bd1bf7db9063dd829cbde50e81cb", "本会话可能运行在部署信任网络之外的设备上,而这一步可能要跨越两者之间。"),
|
|
28
|
+
"core/engine.ask-headline.operator_forced": row("sha256:1ed22ab63911f40e8df47044f9480fdd9263a01f94c61b10f5d5a7715148f9e9", "这个部署把这类步骤标为需要你批准。"),
|
|
29
|
+
"core/engine.ask-headline.shell_floor": row("sha256:6aa998b45db25c6c1412c47f3cac135f484f8777b78899be66e2a1bc681b9598", "这个部署要求每条命令都先问你。"),
|
|
30
|
+
"core/engine.ask-headline.target_unresolved": row("sha256:86a9ac81b6dc5c694f2666c52a94b55291c69fb14bdad6e23f01bc0b2a2241be", "这一步会写到哪里,运行前无法确定。"),
|
|
31
|
+
"core/engine.ask-headline.probe": row("sha256:256d102492a4c4abbc8672c7b437da4836e63613dfcadb9c509a823b9bc30214", "这一步可能超出本会话的目录或难以撤销,检查无法排除这一点。"),
|
|
32
|
+
"core/engine.ask-headline.write_protection_on_disk": row("sha256:8bd77b6d0b1663b05c0c17c68719958bd83ce1af5810f5fa471b91bf4a15c252", "这会经由链接或路径的另一种写法写入受保护的文件。"),
|
|
33
|
+
"core/engine.ask-headline.write_protection": row("sha256:af153a4458136d606eef0d65f5827740ae76da6e0a22f4d259995933eefbcbb5", "这会写入受保护的文件,比如智能体自己的设置。"),
|
|
34
|
+
"core/engine.ask-headline.tool_marks_mcp": row("sha256:12dd9667919efaf74d65c6290dcd64730dd2a0399e9f26bd80e9ee43dda6be4d", "这个工具的服务器把这一步标为会向外发送数据或无法撤销。"),
|
|
35
|
+
"core/engine.ask-headline.tool_marks_a2a": row("sha256:32f57ed76bd72ad1c931282228d1e7482933820a60a44103e26702956f2d45bf", "这会向另一个智能体服务发送请求,对方可能据此行动。"),
|
|
36
|
+
"core/engine.ask-headline.policy_rra": row("sha256:ed3298a686ca3c3e588045778e3e2306792b589ea912c8bb7500be8592abbdc4", "这个部署的策略要求这里由你批准。"),
|
|
37
|
+
"core/engine.ask-headline.artifact_shared_read": row("sha256:fda88833aa999720caba4a5f5d37859884c5db950e6be5e1149cf4e87820dd9a", "这会读取另一个任务共享出来的内容。"),
|
|
38
|
+
"core/engine.ask-headline.mode": row("sha256:1c50972cf2d8d80179fa04a62b1e93846019d4ee916c2188aefbfa0bf80a6c91", "你当前的权限模式要求这一步先问你。"),
|
|
39
|
+
"core/engine.ask-headline.unstated": row("sha256:b66ed0b8ce319472b855ec34d3fe335a9555f7f1dba970e77a2a9a031c1ff9ca", "这个工具没有说明它需要什么权限,所以要问你。"),
|
|
40
|
+
"core/engine.ask-headline.ordinary": row("sha256:ad2cdb3433514cd5c84bb682ed54544bed8769489835ed0776d0c71f174560aa", "没有哪条规则或检查专门针对这一步 —— 只是这类步骤还不能自动放行。"),
|
|
41
|
+
"core/engine.ask-headline-remedy.rule-clears": row("sha256:71eb1019bc443bd7c05a96a83ddf0c3fca30477b38d993c16cd2778420c82a8a", "为它保存一条允许规则,以后就不会再问。"),
|
|
42
|
+
"core/engine.ask-headline-remedy.rule-cannot": row("sha256:7db92986b13d150902f77421067b95668c45905a7cbc25ec17f218ada374dc61", "保存允许规则也不能让它以后不再问。"),
|
|
43
|
+
"core/engine.ask-headline-join": row("sha256:8638f5fc72966023c33bf31c38d8d95dc4a581ef3ba1952be1b17f8a6344ef99", "{{why}}{{remedy}}"),
|
|
15
44
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isTextContentHash, textContentHashOf } from "../core/canonical-json.js";
|
|
2
2
|
export function canonical(node) {
|
|
3
3
|
if (Array.isArray(node))
|
|
4
4
|
return `[${node.map(canonical).join(",")}]`;
|
|
@@ -8,7 +8,7 @@ export function canonical(node) {
|
|
|
8
8
|
return `{${keys.map((k) => `${JSON.stringify(k)}:${canonical(node[k])}`).join(",")}}`;
|
|
9
9
|
}
|
|
10
10
|
export function digestOf(node) {
|
|
11
|
-
return
|
|
11
|
+
return textContentHashOf(canonical(node));
|
|
12
12
|
}
|
|
13
13
|
export function catalogDigestOf(catalog) {
|
|
14
14
|
return digestOf({
|
|
@@ -28,8 +28,6 @@ export function promptIdentityOf(layers) {
|
|
|
28
28
|
}
|
|
29
29
|
export const PROMPT_EPOCH_ACTIVATIONS = Object.freeze(["session_start", "compaction", "code_change", "selection_change"]);
|
|
30
30
|
export const PROMPT_EPOCH_CHANGES = Object.freeze(["catalog", "renderers", "deploy", "task", "published_schema"]);
|
|
31
|
-
const DIGEST = /^sha256:[0-9a-f]{64}$/;
|
|
32
|
-
const isDigest = (v) => typeof v === "string" && DIGEST.test(v);
|
|
33
31
|
const RETIRED_DESCRIPTOR_FIELDS = Object.freeze(["artifactDigest", "packId", "assemblyApi", "centerArtifactDigest"]);
|
|
34
32
|
function normalizeLayers(raw) {
|
|
35
33
|
if (raw === null || typeof raw !== "object" || Array.isArray(raw))
|
|
@@ -38,10 +36,10 @@ function normalizeLayers(raw) {
|
|
|
38
36
|
for (const k of Object.keys(r))
|
|
39
37
|
if (!["catalog", "renderers", "center", "deploy", "task", "binding"].includes(k))
|
|
40
38
|
return undefined;
|
|
41
|
-
if (!
|
|
39
|
+
if (!isTextContentHash(r.catalog) || !isTextContentHash(r.binding))
|
|
42
40
|
return undefined;
|
|
43
41
|
for (const k of ["center", "deploy", "task"])
|
|
44
|
-
if (r[k] !== undefined && !
|
|
42
|
+
if (r[k] !== undefined && !isTextContentHash(r[k]))
|
|
45
43
|
return undefined;
|
|
46
44
|
const rv = r.renderers;
|
|
47
45
|
if (rv === null || typeof rv !== "object" || Array.isArray(rv))
|
|
@@ -64,7 +62,7 @@ export function normalizePromptEpoch(raw) {
|
|
|
64
62
|
const r = raw;
|
|
65
63
|
if (typeof r.epoch !== "number" || !Number.isInteger(r.epoch) || r.epoch < 1 || r.epoch > 1_000_000_000)
|
|
66
64
|
return undefined;
|
|
67
|
-
if (!
|
|
65
|
+
if (!isTextContentHash(r.identity))
|
|
68
66
|
return undefined;
|
|
69
67
|
const layers = normalizeLayers(r.layers);
|
|
70
68
|
if (layers === undefined || promptIdentityOf(layers) !== r.identity)
|
|
@@ -100,7 +98,7 @@ export function readStoredPromptEpoch(raw) {
|
|
|
100
98
|
const r = raw;
|
|
101
99
|
if (!RETIRED_DESCRIPTOR_FIELDS.some((f) => f in r))
|
|
102
100
|
return undefined;
|
|
103
|
-
return { kind: "legacy", centerPinned:
|
|
101
|
+
return { kind: "legacy", centerPinned: isTextContentHash(r.centerArtifactDigest) };
|
|
104
102
|
}
|
|
105
103
|
function changedLayers(a, b) {
|
|
106
104
|
const out = [];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { textContentHashOf } from "../core/canonical-json.js";
|
|
2
2
|
import { canonical } from "./epoch.js";
|
|
3
3
|
export const PREFIX_INPUT_CLASSIFICATION = {
|
|
4
4
|
provider: "cache-identity",
|
|
@@ -16,7 +16,6 @@ export const PREFIX_INPUT_CLASSIFICATION = {
|
|
|
16
16
|
turn: "volatile-no-reuse",
|
|
17
17
|
cacheRead: "volatile-no-reuse",
|
|
18
18
|
};
|
|
19
|
-
const sha = (text) => `sha256:${createHash("sha256").update(text, "utf8").digest("hex")}`;
|
|
20
19
|
export const LOWERING_VERSION = "sema-lowering@1";
|
|
21
20
|
export function loweringRecordFor(api) {
|
|
22
21
|
if (api.startsWith("anthropic")) {
|
|
@@ -42,10 +41,10 @@ export function loweringRecordFor(api) {
|
|
|
42
41
|
return { version: LOWERING_VERSION, form: "other", intentionalDivergences: ["unknown wire family — lowering fidelity unverified"] };
|
|
43
42
|
}
|
|
44
43
|
function identityOf(e) {
|
|
45
|
-
return
|
|
44
|
+
return textContentHashOf(canonical(e));
|
|
46
45
|
}
|
|
47
46
|
export function buildTurnPromptSnapshot(raw, api, promptHasher) {
|
|
48
|
-
const promptSha = promptHasher ??
|
|
47
|
+
const promptSha = promptHasher ?? textContentHashOf;
|
|
49
48
|
const lowering = loweringRecordFor(api);
|
|
50
49
|
let requestPolicy = {
|
|
51
50
|
thinkingLevel: raw.thinkingLevel,
|
|
@@ -59,10 +58,10 @@ export function buildTurnPromptSnapshot(raw, api, promptHasher) {
|
|
|
59
58
|
provider: raw.provider,
|
|
60
59
|
modelId: raw.modelId,
|
|
61
60
|
artifactDigest: raw.artifactDigest,
|
|
62
|
-
layoutDigest:
|
|
61
|
+
layoutDigest: textContentHashOf(canonical(raw.layoutGroups)),
|
|
63
62
|
stableSystemDigest: promptSha(raw.stableSystemText),
|
|
64
|
-
toolWireDigest:
|
|
65
|
-
requestPolicyDigest:
|
|
63
|
+
toolWireDigest: textContentHashOf(canonical(raw.toolWire.map(toolFace))),
|
|
64
|
+
requestPolicyDigest: textContentHashOf(canonical(requestPolicy)),
|
|
66
65
|
loweringVersion: `${lowering.version}/${lowering.form}/${api}`,
|
|
67
66
|
};
|
|
68
67
|
const bump = (change) => {
|
|
@@ -92,7 +91,7 @@ export function buildTurnPromptSnapshot(raw, api, promptHasher) {
|
|
|
92
91
|
}
|
|
93
92
|
}
|
|
94
93
|
toolFaces = faces;
|
|
95
|
-
elements.toolWireDigest =
|
|
94
|
+
elements.toolWireDigest = textContentHashOf(canonical(toolWire.map(toolFace)));
|
|
96
95
|
if (source !== "view")
|
|
97
96
|
mounted = elements.toolWireDigest;
|
|
98
97
|
bump({ cause: "tool_table", source, ...(first >= 0 ? { firstChangedIndex: first } : {}) });
|
|
@@ -111,7 +110,7 @@ export function buildTurnPromptSnapshot(raw, api, promptHasher) {
|
|
|
111
110
|
hasOutputSchema: requestPolicy.hasOutputSchema,
|
|
112
111
|
...(retention !== undefined ? { cacheRetention: retention } : {}),
|
|
113
112
|
};
|
|
114
|
-
elements.requestPolicyDigest =
|
|
113
|
+
elements.requestPolicyDigest = textContentHashOf(canonical(requestPolicy));
|
|
115
114
|
bump({ cause: "request_policy" });
|
|
116
115
|
},
|
|
117
116
|
refreshModel(m) {
|
|
@@ -107,12 +107,11 @@ export class FileBackgroundAgentStore {
|
|
|
107
107
|
const k = FileBackgroundAgentStore.key(handle, scope);
|
|
108
108
|
return this.withLock(k, () => {
|
|
109
109
|
const live = this.rows.get(k);
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
return true;
|
|
110
|
+
const gone = live !== undefined && (expect === undefined || live.rev === expect.rev);
|
|
111
|
+
if (gone)
|
|
112
|
+
this.commit({ t: "delete", k });
|
|
113
|
+
this.ledger.settleErasure();
|
|
114
|
+
return gone;
|
|
116
115
|
});
|
|
117
116
|
}
|
|
118
117
|
async reap(scope, now, opts) {
|
|
@@ -165,10 +165,6 @@ export declare class FileCheckpointStore implements CheckpointStore {
|
|
|
165
165
|
* same JSON reading as the ledger line); the declaration is what makes the loss visible to the mint BEFORE the
|
|
166
166
|
* row is filed. */
|
|
167
167
|
readonly fidelity: "json";
|
|
168
|
-
/** The execution-outcome record verb below is the contract's CAS (journaled), and `reopen` honours the record. */
|
|
169
|
-
readonly execution: {
|
|
170
|
-
readonly outcome: true;
|
|
171
|
-
};
|
|
172
168
|
/** Declared exactly when the store was built with a `holderIsCurrent` judge. */
|
|
173
169
|
readonly fence?: {
|
|
174
170
|
readonly holder: true;
|
|
@@ -92,7 +92,6 @@ export class FileCheckpointStore {
|
|
|
92
92
|
durability = "durable";
|
|
93
93
|
retention;
|
|
94
94
|
fidelity = "json";
|
|
95
|
-
execution = { outcome: true };
|
|
96
95
|
holderIsCurrent;
|
|
97
96
|
fsyncEnabled;
|
|
98
97
|
compactEvery;
|
|
@@ -133,8 +132,13 @@ export class FileCheckpointStore {
|
|
|
133
132
|
this.commit({ t: "delete", token }, true);
|
|
134
133
|
return true;
|
|
135
134
|
});
|
|
136
|
-
|
|
137
|
-
|
|
135
|
+
const erased = async (deleted) => {
|
|
136
|
+
const n = await deleted;
|
|
137
|
+
this.ledger.settleErasure();
|
|
138
|
+
return n;
|
|
139
|
+
};
|
|
140
|
+
this.deleteSessionCheckpoints = async (sessionId, guard) => erased(deleteSessionRowsAtStart(this.cps, ownerSessionRowsDelete(sessionId, guard, headOf), remove));
|
|
141
|
+
this.deleteUnreadableSessionCheckpoints = async (sessionId) => erased(deleteSessionRowsAtStart(this.cps, unreadableSessionRowsDelete(sessionId, headOf), remove));
|
|
138
142
|
}
|
|
139
143
|
}
|
|
140
144
|
withLock(token, fn) {
|
|
@@ -356,6 +356,14 @@ export declare class FileFileHistoryStore implements FileHistoryStore {
|
|
|
356
356
|
diffStats(scope: string, entryId: string, env: ExecutionEnv, root: string): Promise<FileHistoryDiffStats | null>;
|
|
357
357
|
reap(scope: string, keepEntryIds: string[]): Promise<number>;
|
|
358
358
|
deleteBySession(scope: string): Promise<number>;
|
|
359
|
+
deleteUnreadableSessionHistory(sessionId: string): Promise<number>;
|
|
360
|
+
/** Every scope this store holds history for, by the name its tracked set records (`TrackedFileJson.scope`; the directory name is a
|
|
361
|
+
* one-way hash of it). Not a scope: a consumed-id ledger (a file), an adoption's or an import's staging directory (its name carries a
|
|
362
|
+
* `.`, which a scope directory's never does), and a scope directory with neither a tracked set nor a boundary (an attempt's staging
|
|
363
|
+
* only — nothing is committed before the tracked set; the blob pass judges its journals). A tracked set that is missing beside a
|
|
364
|
+
* boundary, does not parse, names no scope, or names a scope whose directory is another cannot be judged, nor can a directory that
|
|
365
|
+
* cannot be read: the read throws naming it — a deletion that cannot tell whose history it is erases nothing. */
|
|
366
|
+
private scopeNamesOnDisk;
|
|
359
367
|
/**
|
|
360
368
|
* Blob GC across EVERY scope — FAIL-SAFE by construction: build the COMPLETE live set or keep
|
|
361
369
|
* every blob. An incomplete live set (a swallowed scan error) would delete still-live bytes, so
|