@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
package/dist/core/task-spec.d.ts
CHANGED
|
@@ -75,10 +75,11 @@ export type UserAttachment = {
|
|
|
75
75
|
* - `files` — the file names each level is read for, relative and `/`-separated (`CLAUDE.md`, `.claude/CLAUDE.md`, …).
|
|
76
76
|
* - `rulesDir` — a directory each level is listed under (recursively, `.md` files): a rule whose frontmatter names
|
|
77
77
|
* `paths:` is loaded when the accessed path matches one (relative to that level), a rule without is loaded with its
|
|
78
|
-
* level
|
|
78
|
+
* level, the task root's included.
|
|
79
79
|
* - `alternate` — a second family: `when: "absent"` reads it only where the task root holds no member of `files`
|
|
80
80
|
* (judged once per leg), `"also"` reads it beside `files`.
|
|
81
|
-
* - `includes` — follow a file's `@path` includes (within the
|
|
81
|
+
* - `includes` — follow a file's `@path` includes (within the root it is read under, to a depth of {@link NESTED_MEMORY_LANE}'s limit).
|
|
82
|
+
* - `additionalDirectories` — `true` also reads each {@link TaskSpec.additionalDirectories} entry as a further root: its own level on every leg as the task root's is (after it), for `files` and `rulesDir` — no level below it, no `alternate`, and a rule with `paths:` there only for an accessed path below the task root. Omitted / `false` ⇒ not read (the reference's default; its opt-in `CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD`).
|
|
82
83
|
* - `hostRules` — rule texts the deployment holds outside the workspace (a user's or an organization's rules, a rule of a
|
|
83
84
|
* directory above the task root): each is delivered when an accessed path, relative to the task root, matches one of
|
|
84
85
|
* its `paths`. `name` is the label the frame shows.
|
|
@@ -95,6 +96,7 @@ export interface InstructionFamilyDeclaration {
|
|
|
95
96
|
readonly when: "absent" | "also";
|
|
96
97
|
};
|
|
97
98
|
readonly includes?: boolean;
|
|
99
|
+
readonly additionalDirectories?: boolean;
|
|
98
100
|
readonly hostRules?: ReadonlyArray<{
|
|
99
101
|
readonly level: "user" | "managed" | "project";
|
|
100
102
|
readonly name: string;
|
|
@@ -113,6 +115,15 @@ export type ShellGateDoctrine = "always";
|
|
|
113
115
|
* parked for this session's occupant while it sat idle (the durable box's included). */
|
|
114
116
|
export declare const TASK_WAKE_SOURCES: readonly ["parked_notifications"];
|
|
115
117
|
export type TaskWakeSource = (typeof TASK_WAKE_SOURCES)[number];
|
|
118
|
+
/** A task's durable-park opt-in ({@link TaskSpec.durableApproval}'s object state). */
|
|
119
|
+
export interface DurableApprovalOptIn {
|
|
120
|
+
/** Multi-tenant isolation key, forced into the checkpoint + `resolve`/`reap` WHERE. Required. */
|
|
121
|
+
scope: string;
|
|
122
|
+
/** Optional awaiting-human TTL (ms). Past it a reaper CAS-expires the checkpoint (≈ deny). Absent, or a finite number >= 0 — any other
|
|
123
|
+
* value (NaN, Infinity, a negative, a string) is refused at the task door (`config.invalid_argument`, `detail.field` `durableApproval.ttlMs`),
|
|
124
|
+
* the judge `resourceSuspend`'s numbers are judged by. */
|
|
125
|
+
ttlMs?: number;
|
|
126
|
+
}
|
|
116
127
|
export interface TaskSpec {
|
|
117
128
|
taskId?: string;
|
|
118
129
|
/** The instruction / latest user message for this turn. */
|
|
@@ -288,20 +299,23 @@ export interface TaskSpec {
|
|
|
288
299
|
* leg runs in the session's tree as if it had sent it — or send the SAME declaration; `null` is a leg that wants NO tree (it
|
|
289
300
|
* runs at the task root the host gave it, reports no checkout, and leaves the record as it is). A declaration that differs is
|
|
290
301
|
* refused.
|
|
291
|
-
* - `isolation: "worktree"`: the session works in its OWN managed
|
|
292
|
-
*
|
|
293
|
-
* `baseRef`: `"fresh"` default, or `"head"`). Every
|
|
294
|
-
*
|
|
295
|
-
*
|
|
296
|
-
*
|
|
297
|
-
*
|
|
298
|
-
*
|
|
299
|
-
*
|
|
300
|
-
*
|
|
301
|
-
*
|
|
302
|
-
*
|
|
303
|
-
*
|
|
304
|
-
* `
|
|
302
|
+
* - `isolation: "worktree"`: the session works in its OWN managed trees, one per repository a listed root is in (`roots`,
|
|
303
|
+
* absent ⇒ the task root), minted together on the first leg — all or none — at `<repository root>/.sema/worktrees/<name>`
|
|
304
|
+
* on branch `sema/<name>` (`name` absent ⇒ derived from the session id; `baseRef`: `"fresh"` default, or `"head"`). Every
|
|
305
|
+
* declared root of an isolated repository (the task root, an `additionalDirectories` / `additionalReadDirectories` entry,
|
|
306
|
+
* listed or not) stands at its place in that tree on every leg, a delegated child's included; the base checkouts are
|
|
307
|
+
* outside the leg's write roots. The trees outlive every leg and env; `releaseSessionCheckout` removes them.
|
|
308
|
+
* - `sources`: the commit the session's code starts from, per repository (`{ root, remote, sha, ref? }`): checked on the
|
|
309
|
+
* first leg (the checkout at that root must be at `sha`; an isolated repository's tree is minted at it).
|
|
310
|
+
* Refusals, each before the leg starts: a malformed declaration ⇒ `config.session_workspace_invalid` (also: a writable root
|
|
311
|
+
* in no tree that holds an isolated base checkout, a listed directory that is no `additionalDirectories` entry, a `baseRef`
|
|
312
|
+
* that starts no tree, a remote carrying a credential); a declaration that differs from the first leg's, appears on a
|
|
313
|
+
* session that already began without one (its log holds a turn or a compaction), or a listed root no longer in an isolated repository ⇒
|
|
314
|
+
* `config.session_workspace_changed`; a tree cannot be made ⇒ `workspace.isolation_unavailable` (the root and the reason
|
|
315
|
+
* named, `probeWorktreeCapability` judges the same); a checkout not at the declared commit ⇒ `workspace.source_mismatch`; the
|
|
316
|
+
* record cannot be read ⇒ `workspace.checkout_unavailable`; a tree is gone ⇒ `workspace.checkout_missing` (never run in a
|
|
317
|
+
* base checkout instead). A fork does not inherit the checkout. Every leg's `workspace_changed` frame carries it
|
|
318
|
+
* (`session`), except a `null` leg's, and says where each additional root stands (`directories`).
|
|
305
319
|
*/
|
|
306
320
|
workspace?: WorkspaceDeclaration | null;
|
|
307
321
|
/**
|
|
@@ -359,6 +373,8 @@ export interface TaskSpec {
|
|
|
359
373
|
* message that ends mid-tool-call (a SETTLED turn boundary — else the replay would orphan-close a done call).
|
|
360
374
|
* Non-destructive: recorded as a branch `leaf` entry, so prior leaves stay in the tree (re-resume any time).
|
|
361
375
|
* Mutually exclusive with a durable `runner.resume(...)` (the Runner rejects both at once).
|
|
376
|
+
* On a store that loads only a bounded window of the log, it must hold the whole branch the new leaf continues (its path read reaches a root, or the latest
|
|
377
|
+
* compaction on it keeps from an entry on it), either {@link resumeAtMode}; else `resume_at.outside_window`, nothing written by the attempt that refuses (never a run from the window's floor on); `"at"` a user message keeps its attachment frames, found among the entries the handle loaded — one that does not hold the message refuses the same code (never a run without them).
|
|
362
378
|
*/
|
|
363
379
|
resumeAt?: string;
|
|
364
380
|
/**
|
|
@@ -541,7 +557,8 @@ export interface TaskSpec {
|
|
|
541
557
|
* through the hands, under the Read tool's own admission — the root's own level on every leg (the session's instructions,
|
|
542
558
|
* frames of origin `project_instructions`, the leg's first request first), and when the model reads or writes a file below the
|
|
543
559
|
* root, the family of each directory between the root and that file and the rules whose paths match it (frames of origin
|
|
544
|
-
* `nested_memory`, on the next request)
|
|
560
|
+
* `nested_memory`, on the next request); with its `additionalDirectories: true`, each additional working directory's own level as
|
|
561
|
+
* the root's is. A delivered file edited since is sent whole again; removed or emptied, it is withdrawn
|
|
545
562
|
* once. Absent, or under {@link projectMemory} `"disabled"` (screened, then silent) ⇒ nothing is stat'ed or read. Children inherit
|
|
546
563
|
* it (the parent spec seat): omitted ⇒ the parent's; `projectMemory: "disabled"` silences it; the child's own declaration stands.
|
|
547
564
|
*/
|
|
@@ -582,7 +599,7 @@ export interface TaskSpec {
|
|
|
582
599
|
* conversation" = {@link resumeAt} alone). Legal ONLY when {@link resumeAt} is ABSENT — handing
|
|
583
600
|
* BOTH anchors is refused loud (`rewind.conflicting_targets`): two file targets is a
|
|
584
601
|
* contradiction, and silently preferring one is the silent-swallow family this seam refuses; a
|
|
585
|
-
* target with no history boundary fails loud (`rewind_snapshot.unresolvable`). Requires
|
|
602
|
+
* target with no history boundary, or that is not an entry of this session's own log, fails loud (`rewind_snapshot.unresolvable`). Requires
|
|
586
603
|
* `RunnerDeps.fileHistoryStore`. The session leaf is untouched — the next turn continues the
|
|
587
604
|
* CURRENT conversation, only the files moved.
|
|
588
605
|
*
|
|
@@ -630,8 +647,8 @@ export interface TaskSpec {
|
|
|
630
647
|
* deferred-search lane). Deferral is reached through ToolSearch, so a list that leaves it out defers nothing.
|
|
631
648
|
*
|
|
632
649
|
* A tool a leg relies on (a delegated child's ReportBlocked, a teammate's SendMessage, a goal iteration's DeclareDone, an
|
|
633
|
-
* observer's report tool — the catalog's protocol column) is not an allowlist's to name
|
|
634
|
-
* leg is refused at prepare.
|
|
650
|
+
* observer's report tool, a run's structured-output tool — the catalog's protocol column) is not an allowlist's to name, nor
|
|
651
|
+
* {@link excludeAllTools}'s to take out; a denylist that reaches one on such a leg is refused at prepare.
|
|
635
652
|
*/
|
|
636
653
|
allowTools?: string[];
|
|
637
654
|
/**
|
|
@@ -647,11 +664,11 @@ export interface TaskSpec {
|
|
|
647
664
|
*/
|
|
648
665
|
excludeTools?: string[];
|
|
649
666
|
/**
|
|
650
|
-
* design/388 §2.2 ⑥ — unmount the WHOLE tool face: the leg
|
|
651
|
-
* scaffolds,
|
|
652
|
-
*
|
|
653
|
-
*
|
|
654
|
-
*
|
|
667
|
+
* design/388 §2.2 ⑥ — unmount the WHOLE tool face: the leg's own allowlist names nothing (whatever {@link allowTools} says), so
|
|
668
|
+
* it mounts no hands, scaffolds, caller, MCP, A2A or skill tool and keeps only the tools its kind relies on, as `allowTools: []`
|
|
669
|
+
* keeps them: a run with an {@link outputSchema} delivers `structuredOutput`, a goal iteration keeps DeclareDone, and a leg that
|
|
670
|
+
* relies on none reads `entries: []` and sends no tools; `runWithVerification`'s verifier carries it. Not `excludeTools: ["*"]`
|
|
671
|
+
* (a legal caller name). `excludeTools` beside it is redundant, not an error; one reaching a relied-on tool is refused as without it.
|
|
655
672
|
*/
|
|
656
673
|
excludeAllTools?: true;
|
|
657
674
|
/**
|
|
@@ -829,17 +846,21 @@ export interface TaskSpec {
|
|
|
829
846
|
* in-stream — same turn, no checkpoint, the gate recorded in `humanReview.gates` — and this option acts
|
|
830
847
|
* as the no-approver fallback. The durable park keeps priority only when: (a) there is no function seat
|
|
831
848
|
* (absent, or a blanket `"allow"`/`"deny"` string mode — a policy setting is not a reachable human);
|
|
832
|
-
* (b) a control-plane `forceDurableGate` entitlement is in force (on a delegated leg only where its
|
|
849
|
+
* (b) a control-plane `forceDurableGate` entitlement is in force (on a delegated leg only where its lane holds its parks — elsewhere the leg parks no ask and refuses every one, `config.durable_gate_unavailable`); (c) the live face already answered
|
|
833
850
|
* `"unavailable"` for this ask; or (d) the call is marked inherited-unavailable by an ancestor.
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
851
|
+
*
|
|
852
|
+
* **`false` — the host cannot resume this run's decision parks.** Three states, one question ("this leg's decision parks"): an
|
|
853
|
+
* object opts in, absence says nothing (a `forceDurableGate` entitlement may still synthesize an opt-in), and `false` declares that
|
|
854
|
+
* nobody can resume a parked approval of this run. Then no decision park is minted (a permission ask, a question, a plan review): a
|
|
855
|
+
* live approver answers in-stream, else the ask is refused with its way out — under a `forceDurableGate` entitlement it is refused
|
|
856
|
+
* `config.durable_gate_unavailable` / `leg_not_resumable`, never answered live; the plan-mode tool pair mounts only as on a store-less leg (ExitPlanMode only under `interactiveTools: true`); resource
|
|
857
|
+
* parks (budget / turns / a scheduler's yield / a usage window / an env lifetime) are untouched. It travels to every child the run
|
|
858
|
+
* spawns (a tighten-only seat), and a resource row the leg parks records it: a resume whose config states no `durableApproval`
|
|
859
|
+
* keeps it, and only a config that states an opt-in object lifts it. Declare it where no road leads back to a parked approval
|
|
860
|
+
* (a one-shot call with no approval channel; a lane whose resume runs elsewhere); a run with a live approver, or a background lane
|
|
861
|
+
* that can park, has no need of it (`INTEGRATION-CORE.md`, "Declaring durableApproval: false").
|
|
862
|
+
*/
|
|
863
|
+
durableApproval?: DurableApprovalOptIn | false;
|
|
843
864
|
/**
|
|
844
865
|
* design/74: opt into resource-slice suspend. When a resource limit (maxTurns / budget / walltime) is hit
|
|
845
866
|
* AND the task is eligible (a `checkpointStore` + a remote, suspendable `executionEnvFactory` env), suspend
|
|
@@ -990,6 +1011,7 @@ export interface TaskSpec {
|
|
|
990
1011
|
*
|
|
991
1012
|
* Delegated children inherit it: the sync / background / fork spawn lanes copy the `"disabled"` word
|
|
992
1013
|
* into every child spec (same discipline as `principal`), so a store-less run's whole tree stays store-less.
|
|
1014
|
+
* The engine is the word's second setter: every fork child runs with it whatever its parent resolved (nothing resumes a fork), and so does every leg the fork spawns.
|
|
993
1015
|
*
|
|
994
1016
|
* The off switch is the WORD `"disabled"`, never `null`: a string is not nullish, so the ordinary
|
|
995
1017
|
* `spec ?? deps` coalesce is the whole resolution rule and no reader has to remember a special
|
|
@@ -1437,21 +1459,6 @@ export interface TaskSpec {
|
|
|
1437
1459
|
* background processes.
|
|
1438
1460
|
*/
|
|
1439
1461
|
retainBackgroundProcesses?: boolean;
|
|
1440
|
-
/**
|
|
1441
|
-
* design/120 P2: opt in to in-stream tool execution — safe tool calls start while the model is
|
|
1442
|
-
* still streaming its response instead of waiting for the full reply. Default OFF. Forwarded to
|
|
1443
|
-
* the harness, which additionally withholds it whenever a `tool_call` gate handler is registered
|
|
1444
|
-
* (policy / approval / egress runs — a gate could durably suspend, which is impossible
|
|
1445
|
-
* mid-stream), so setting this on a gated task is safe and simply has no effect. A run whose only
|
|
1446
|
-
* gate concern is resource-suspend does NOT register that handler (it stops at clean turn
|
|
1447
|
-
* boundaries), so in-stream execution stays available there.
|
|
1448
|
-
*
|
|
1449
|
-
* Known limitation (documented): with this ON, a tool's side effect can complete BEFORE the
|
|
1450
|
-
* assistant message persists; a hard process crash in that window leaves no transcript trace of
|
|
1451
|
-
* the call (wake reconcile cannot see an orphan that was never written). Prefer OFF for
|
|
1452
|
-
* deployments where crash-exactly-once accounting of tool effects matters more than latency.
|
|
1453
|
-
*/
|
|
1454
|
-
streamingToolExecution?: boolean;
|
|
1455
1462
|
/**
|
|
1456
1463
|
* **Structured output** (1.41): constrain the task's FINAL result to this JSON schema (a typebox
|
|
1457
1464
|
* object schema). Injects a built-in `StructuredOutput` tool whose parameters ARE this schema; the model
|
|
@@ -1738,8 +1745,9 @@ export interface TaskSpec {
|
|
|
1738
1745
|
* the default was off — a probe pinning "no background_tasks frame without opt-in" reds. */
|
|
1739
1746
|
backgroundTasks?: boolean;
|
|
1740
1747
|
toolsDelta?: true;
|
|
1741
|
-
/** The notice that a declared MCP server did not connect
|
|
1742
|
-
*
|
|
1748
|
+
/** The notice that a declared MCP server did not connect: its tools are unavailable for this session when the session remembers
|
|
1749
|
+
* the failure (it waited out the startup bound; not dialed again unless its declaration changes or the host has it reconnected),
|
|
1750
|
+
* for now otherwise (the next message tries again). Rides the leg's first request (a fresh leg's first user message, a resumed leg's continuation),
|
|
1743
1751
|
* once per session per server and error. DEFAULT ON — boolean: `false` is the opt-out, a non-boolean is refused at the
|
|
1744
1752
|
* task's door (`config.invalid_argument`). BREAKING: the notice used to ride {@link toolsDelta}, and only a turn boundary. */
|
|
1745
1753
|
mcpUnavailable?: boolean;
|
|
@@ -198,19 +198,31 @@ export interface TaskStream extends AsyncIterable<TaskEvent> {
|
|
|
198
198
|
* Request a manual context **compaction** (design/99 MF-18 — the shell `/compact` button). Forces a
|
|
199
199
|
* compaction at the NEXT safe turn boundary regardless of the auto-threshold (the only safe point — never
|
|
200
200
|
* mid-turn, which would rewrite the session under an in-flight request); a `compacted` event with
|
|
201
|
-
* `trigger:"manual"` is emitted when it actually compacts.
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
201
|
+
* `trigger:"manual"` is emitted when it actually compacts.
|
|
202
|
+
*
|
|
203
|
+
* **Taken or refused** — read {@link inputWindow} (the same judge, with zero ticks; before or after the call):
|
|
204
|
+
* - `"over"` (no turn boundary of this run will come: the loop has ended, or the run has settled) — the request is
|
|
205
|
+
* **refused**: the promise is already rejected when `compact()` returns, `steering.not_running` ("the task has
|
|
206
|
+
* already finished"), and no `compaction_outcome` frame is emitted (a refused request has no outcome).
|
|
207
|
+
* - `"open"` / `"before"` — the request is **taken**; the promise is its outcome, settled by the boundary that
|
|
208
|
+
* serves it (one of the six {@link CompactOutcome} words) or `"mooted"` when the run ends before a boundary served
|
|
209
|
+
* it. Taken is the admission, not a promise of service: a run that ends before another boundary comes answers a taken
|
|
210
|
+
* request `"mooted"`. One more answer exists for a request taken before the run has published its handle: it is
|
|
211
|
+
* rejected `steering.not_running` ("the task is not running") when the run's preparation threw, and when the handle
|
|
212
|
+
* is still unpublished 30 s after the call (the readiness bound) — a preparation that is only slow, and goes on to
|
|
213
|
+
* start, is refused at the bound all the same (`steer()` meets the same bound, counted from when its own turn in
|
|
214
|
+
* the steer queue begins).
|
|
215
|
+
* Idempotent-ish: concurrent calls coalesce onto the next boundary (all waiters get the same outcome).
|
|
205
216
|
*
|
|
206
217
|
* ⚠️ BREAKING (MF-18: "processed" without "compacted"): resolves with a {@link CompactOutcome}
|
|
207
218
|
* instead of `void` — "processed" alone told a consumer nothing when the attempt failed or was mooted
|
|
208
219
|
* (the 202-then-silence fingerprint). Every outcome also has a stream/trace counterpart:
|
|
209
220
|
* `"compacted"` → the `compacted` event; `"failed"` → `compaction.failed` trace (+ `onError(phase:
|
|
210
221
|
* "compaction")` when an attempt was burned); `"blocked"` → `compaction.blocked` trace; `"noop"` →
|
|
211
|
-
* `compaction.noop` trace; `"disabled"` → `compaction.disabled` trace; `"mooted"` →
|
|
222
|
+
* `compaction.noop` trace; `"disabled"` → `compaction.disabled` trace; `"mooted"` (taken, never served) →
|
|
212
223
|
* `compaction.mooted` trace — or the task simply settled before any boundary processed the request
|
|
213
|
-
* (the
|
|
224
|
+
* (the `compaction_outcome{mooted}` frame while the stream can still carry it; past its close the
|
|
225
|
+
* run-end backstop resolves "mooted" without a frame and the task's terminal events are the signal).
|
|
214
226
|
*
|
|
215
227
|
* design/145 §4 (additive): `opts.instructions` — the CC `/compact <instructions>` parity face.
|
|
216
228
|
* Injected into the summarization prompt in the standard shape (`\n\nAdditional Instructions:`),
|
|
@@ -235,12 +247,30 @@ export interface TaskStream extends AsyncIterable<TaskEvent> {
|
|
|
235
247
|
* soft-deadline abort; the trace counterpart is `compaction.mooted` with `reason:"cancelled"`).
|
|
236
248
|
* Coalescing caveat: coalesced callers share ONE pass, so one caller's cancel aborts the shared
|
|
237
249
|
* pass — every waiter of that pass then resolves `"mooted"`.
|
|
238
|
-
* An already-aborted signal resolves `"mooted"` immediately without arming a request
|
|
250
|
+
* An already-aborted signal resolves `"mooted"` immediately without arming a request (on an `"over"` stream the
|
|
251
|
+
* refusal comes first).
|
|
239
252
|
*/
|
|
240
253
|
compact(opts?: {
|
|
241
254
|
instructions?: string;
|
|
242
255
|
signal?: AbortSignal;
|
|
243
256
|
}): Promise<CompactOutcome>;
|
|
257
|
+
/**
|
|
258
|
+
* Where this run's loop stands for an input, read now — the stream's one input judge, the reading {@link compact}
|
|
259
|
+
* takes or refuses a request by, and the facts {@link steer} waits on. Synchronous: a host answers a manual
|
|
260
|
+
* compaction request from it with zero ticks, before or after calling `compact()`.
|
|
261
|
+
* - `"before"` — the loop is not taking input but has not ended: the run is starting (a `compact()` is taken and
|
|
262
|
+
* waits for the run's first boundary; while the run has published no handle that wait is bounded — 30 s from the
|
|
263
|
+
* call — and a run whose handle is still unpublished then refuses it, whether or not it starts afterwards), or,
|
|
264
|
+
* for an instant, the loop's last prompt has settled and its end is not yet recorded (a `compact()` taken there
|
|
265
|
+
* finds no boundary and ends `"mooted"`).
|
|
266
|
+
* - `"open"` — the loop takes input: a `compact()` is taken.
|
|
267
|
+
* - `"over"` — the loop has ended or the run has settled: no turn boundary of this run will come; `compact()` and
|
|
268
|
+
* `steer()` refuse (`steering.not_running`). A manual compaction from here on is the idle session's
|
|
269
|
+
* (`Runner.compactSession`, once this stream has settled).
|
|
270
|
+
* Changes only forward (`before` → `open` → `over`, or `before` → `over`), except that `open` reads `before` again in
|
|
271
|
+
* the instant between the loop's last prompt settling and its end.
|
|
272
|
+
*/
|
|
273
|
+
inputWindow(): import("./input-author.js").InputWindow;
|
|
244
274
|
/**
|
|
245
275
|
* design/116 detach(CC mid-flight ctrl+b)— move a RUNNING tool call to the background.
|
|
246
276
|
* Today only a detach-capable Bash honors it (the env adopts the child as a background shell; the tool
|
|
@@ -312,8 +342,10 @@ export interface TaskStream extends AsyncIterable<TaskEvent> {
|
|
|
312
342
|
* **RE-DIAL one MCP server** on the running task, the action `RefreshMcpTools` deliberately
|
|
313
343
|
* is not (its contract is "never dials or re-dials"). Core holds no MCP connection across task
|
|
314
344
|
* legs, so once a server's transport closes this leg is stuck with it: every one of its tools fails
|
|
315
|
-
* fast and a refresh can only keep reporting `not_connected
|
|
316
|
-
*
|
|
345
|
+
* fast and a refresh can only keep reporting `not_connected`; and a server whose connection attempt
|
|
346
|
+
* failed is remembered by the session's pool, so the session's later legs do not dial it either.
|
|
347
|
+
* This is the verb a host hangs a "Reconnect" control on while a run is live (it drops that memory
|
|
348
|
+
* and dials now); between messages it is `Runner.forgetMcpFailure` (the next message dials). ONE NAMED SERVER, required — the reference's control-channel request carries
|
|
317
349
|
* a required `serverName` and has no all-servers form, and an all-servers form would CLOSE HEALTHY
|
|
318
350
|
* connections to re-dial them (the stdio server owning a device or a port — the case this verb
|
|
319
351
|
* exists for — is the one that cannot be re-dialed while its predecessor still holds the device).
|
|
@@ -321,8 +353,8 @@ export interface TaskStream extends AsyncIterable<TaskEvent> {
|
|
|
321
353
|
* ⚠️ **A FAILED RE-DIAL LEAVES THE SERVER DOWN.** The old connection is closed BEFORE the new one is
|
|
322
354
|
* dialed (no other order works for a device-owning server), so a dial that fails has spent a
|
|
323
355
|
* working connection: the server stays disconnected, with its tools WITHDRAWN from the roster,
|
|
324
|
-
* until another re-dial
|
|
325
|
-
* connection fail with it. Both are inherent to re-dialing; CC behaves the same way.
|
|
356
|
+
* until another re-dial — the failed attempt is the session's memory, so the next leg does not dial
|
|
357
|
+
* it either — and calls in flight on the replaced connection fail with it. Both are inherent to re-dialing; CC behaves the same way.
|
|
326
358
|
*
|
|
327
359
|
* Resolves {@link import("./mcp.js").McpReconnectResult} — `outcome` is one of three words, so a
|
|
328
360
|
* consumer mapping it onto a three-state control answer needs no table: `reconnected` (the only
|
|
@@ -331,7 +363,8 @@ export interface TaskStream extends AsyncIterable<TaskEvent> {
|
|
|
331
363
|
* Throws, never silently no-ops: `mcp.reconnect_unavailable` when this run declared NO MCP servers
|
|
332
364
|
* (a host maps that to "unsupported", not "refused"), `steering.invalid_content` on a missing or
|
|
333
365
|
* non-string name, and the steer-family `steering.not_running` once the task has finished.
|
|
334
|
-
*
|
|
366
|
+
* The result rides no checkpoint; what the session's pool remembers of the dial lives in this process only, so a durable resume in
|
|
367
|
+
* the same Runner reads that memory and one in another process takes a fresh first listing.
|
|
335
368
|
*/
|
|
336
369
|
reconnectMcpServer(server: string): Promise<import("./mcp.js").McpReconnectResult>;
|
|
337
370
|
/**
|
|
@@ -12,6 +12,17 @@ import type { AssertAllKeysHandled } from "./ask-origin.js";
|
|
|
12
12
|
import type { ProviderCondition, ProviderConditionSource } from "../brain/provider-dialect.js";
|
|
13
13
|
import type { RequestRoute } from "../brain/request-route.js";
|
|
14
14
|
import type { ModelOutputInvalidCause, OutputLimit } from "../internal/llm.js";
|
|
15
|
+
/**
|
|
16
|
+
* What became of the checkpoint row of a RESUMED leg that ended before its approved action started — the store's own outcome of
|
|
17
|
+
* the claim's reversal, stated by the exit that compensated it. A CLOSED SET with one home, registered in `docs/CLOSED-SETS.md`:
|
|
18
|
+
* · `"reopened"` — pending again: the same token resumes it (also when the reopen threw and the row read afterwards shows it landed);
|
|
19
|
+
* · `"declined"` — the store refused to reopen it (the row is no longer the resolved row the leg claimed): read the row;
|
|
20
|
+
* · `"unknown"` — the reopen threw and the row does not show it landed: its state is unprovable from here.
|
|
21
|
+
* Every carrier reads this one type: a failed result's `terminal.unstartedRow`, a resume's rejection before its leg started
|
|
22
|
+
* (`CheckpointError.detail.unstartedRow`), and the engine's own outcome record (`UnstartedRow`, whose sentence is derived from the word).
|
|
23
|
+
* A consumer holding a table over it is tsc-red on a new word until it places the word.
|
|
24
|
+
*/
|
|
25
|
+
export type UnstartedRowOutcome = "reopened" | "declined" | "unknown";
|
|
15
26
|
/**
|
|
16
27
|
* WHY a run ended — ONE tagged cause, and the ONLY terminal record a {@link TaskResult} carries. The run
|
|
17
28
|
* loop's terminal arbitration used to decide a `status` word plus seven optional plane fields one by one
|
|
@@ -62,7 +73,8 @@ export type TerminalCause = {
|
|
|
62
73
|
* Two codes name the EXTERNAL stop causes — neither is a `limits.` code, because neither is an
|
|
63
74
|
* allowance the task chose, and a caller that retries on `limits.*` should NOT treat these the same:
|
|
64
75
|
* - `"env.lifetime_expired"` — the execution environment's platform lifetime ran out and the run
|
|
65
|
-
* could not be suspended durably
|
|
76
|
+
* could not be suspended durably — or, answered by the environment when the leg established it, before
|
|
77
|
+
* the run started. Retrying needs a NEW environment, not a smaller budget.
|
|
66
78
|
* - `"usage.window_exhausted"` — a deployment usage-governance window is full (see
|
|
67
79
|
* `RunnerDeps.usageWindows`). Reported at task ENTRY (nothing ran) or after a suspend was
|
|
68
80
|
* impossible; the wait hint rides the thrown error's `retryAfterMs` (delivered through
|
|
@@ -107,14 +119,11 @@ export type TerminalCause = {
|
|
|
107
119
|
*/
|
|
108
120
|
nestedPause?: PausedCause;
|
|
109
121
|
/**
|
|
110
|
-
* What a RESUMED leg that ended before its approved action started did to its checkpoint row
|
|
111
|
-
* outcome, stated by the exit that compensated it: `reopened` (pending again: the same token resumes it — also when the
|
|
112
|
-
* reopen threw and the row read afterwards shows it landed), `declined` (the store refused to reopen it — read the row),
|
|
113
|
-
* `unknown` (the reopen threw and the row does not show it landed: its state is unprovable).
|
|
122
|
+
* What a RESUMED leg that ended before its approved action started did to its checkpoint row ({@link UnstartedRowOutcome}).
|
|
114
123
|
* Beside `code`, never folded into it: the code still names what ended the leg. PRESENCE: only on such a leg; a
|
|
115
124
|
* fresh run, a leg that started its approved action and a delivered negative decision carry none.
|
|
116
125
|
*/
|
|
117
|
-
unstartedRow?:
|
|
126
|
+
unstartedRow?: UnstartedRowOutcome;
|
|
118
127
|
} | {
|
|
119
128
|
kind: "blocked";
|
|
120
129
|
/**
|
|
@@ -143,6 +152,14 @@ export type TerminalCause = {
|
|
|
143
152
|
* gate). Its kind's {@link import("./pause-registry.js").PAUSE_REGISTRY} row is what
|
|
144
153
|
* {@link import("./runner/terminal-projection.js").terminalProjection} reads the status word from
|
|
145
154
|
* (`"suspended"` for an approval / a resource slice / a platform pause, `"needs_review"` for a review).
|
|
155
|
+
*
|
|
156
|
+
* An approval gate's `reason` is the engine's account of the pause kind, not the question put to a person. The card's
|
|
157
|
+
* question, its askers' own words, the origin word and the class pair are the row's `PendingAction.tool_approval` members
|
|
158
|
+
* (`cardMessage`, `askReasons`, `origin`, `askClass` / `classes` — the values the live card carried): a surface rendering
|
|
159
|
+
* the parked card reads that row by {@link token} (`CheckpointStore.get`), and the row's `checkpointId` is
|
|
160
|
+
* {@link checkpointId}. The gate carries none of those members; what it does carry about the ask is its triage
|
|
161
|
+
* descriptor (`riskDescriptor`: severity, axes, the action's summary, a probe's account when a probe tightened the call)
|
|
162
|
+
* and, on a real-approval ask, the bit the resume reads (`realApproval`, with the ask's origin word).
|
|
146
163
|
*/
|
|
147
164
|
gate: import("./checkpoint-store.js").CheckpointGate;
|
|
148
165
|
/**
|
|
@@ -166,6 +183,16 @@ export type TerminalCause = {
|
|
|
166
183
|
* `plan_review.requestedByCallId` — one write, at the park mint.
|
|
167
184
|
*/
|
|
168
185
|
requestedByCallId?: string;
|
|
186
|
+
/**
|
|
187
|
+
* The digest of the plan SHOWN to the person at this plan_review pause: `sha256:` + the lowercase hex SHA-256 of the
|
|
188
|
+
* UTF-8 bytes of the `plan` string on the `exit-plan-mode` card the requesting call's `tool_end` carried
|
|
189
|
+
* (`structured.plan`), unnormalized and untruncated — so a reader digests the plan string it holds, before any
|
|
190
|
+
* display normalization, and compares. It says what was shown, not who asked and not which gate. PRESENT only on a
|
|
191
|
+
* `plan_review` pause whose requesting call's frame carried a plan card; ABSENT otherwise (a card left off the frame
|
|
192
|
+
* for size included), which means "nothing to compare", never "an empty plan". Echo of the committed row's
|
|
193
|
+
* {@link import("./checkpoint-store.js").PendingAction} `plan_review.planContentHash` — one write, at the park mint.
|
|
194
|
+
*/
|
|
195
|
+
planContentHash?: string;
|
|
169
196
|
/**
|
|
170
197
|
* HOW the paused task's remote workspace will come back, present whenever the pause captured a
|
|
171
198
|
* remote workspace. The two modes bill and behave very differently:
|
|
@@ -253,8 +280,12 @@ export type TerminalFailureDetail = {
|
|
|
253
280
|
/**
|
|
254
281
|
* The thrown error's own `detail`, as its throw site stated it — a snapshot of its JSON-plain members (strings,
|
|
255
282
|
* finite numbers, booleans, null, and arrays / plain objects of those, bounded; a member of any other kind is left
|
|
256
|
-
* out; bytes — an `ArrayBuffer` view, an index-keyed object — are never a record).
|
|
257
|
-
*
|
|
283
|
+
* out; bytes — an `ArrayBuffer` view, an index-keyed object — are never a record). An ARRAY is one fact: when a bound
|
|
284
|
+
* (64 entries per container, 4096 characters per string, depth 4, 256 values and 16384 characters in all) leaves out any
|
|
285
|
+
* element of it, or a member of an element record, the array is absent whole — never a shorter list or a cut row — and
|
|
286
|
+
* what it had spent of the bounds goes back, so the members after it are judged as if it were not there (a record's
|
|
287
|
+
* own members that do not fit are left out one by one, as before). A member under a credential
|
|
288
|
+
* name (the env-credential judge's names: `password`, `apiKey`, `token` …) stands as the bare redaction mark (`REDACTION_MARKS.bare`), unread; every
|
|
258
289
|
* other string leaf passes the secret-tier redaction (credential shapes masked; a path is kept — it rides this
|
|
259
290
|
* structured seat, never `message`); a member whose key is not JSON-safe (visible ASCII 1–128, nothing the
|
|
260
291
|
* redaction would mask) is left out. Read off the same link of the error's `cause` chain whose `code` became
|
|
@@ -330,3 +361,9 @@ export declare function isTerminalCauseKind(kind: unknown): kind is TerminalCaus
|
|
|
330
361
|
export type PausedCause = Extract<TerminalCause, {
|
|
331
362
|
kind: "paused";
|
|
332
363
|
}>;
|
|
364
|
+
/**
|
|
365
|
+
* The run's own cancellation as a thrown value — its ONE mint (the leg's entry before the first turn, and the restore
|
|
366
|
+
* seat around its establishment call). It carries no `code` by design: a cancelled run's terminal is
|
|
367
|
+
* `{ kind: "failed", message: "run aborted" }`, whatever step it was cancelled at.
|
|
368
|
+
*/
|
|
369
|
+
export declare function runAbortedError(): Error;
|
|
@@ -14,3 +14,8 @@ Object.freeze(TERMINAL_CAUSE_IS_REPLAYABLE);
|
|
|
14
14
|
export function isTerminalCauseKind(kind) {
|
|
15
15
|
return typeof kind === "string" && Object.hasOwn(TERMINAL_CAUSE_IS_REPLAYABLE, kind);
|
|
16
16
|
}
|
|
17
|
+
export function runAbortedError() {
|
|
18
|
+
const e = new Error("run aborted");
|
|
19
|
+
e.name = "AbortError";
|
|
20
|
+
return e;
|
|
21
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bounds of what a `tool_end` frame carries. The end projection (`runner/tool-output-projection.ts`) reads them, and so
|
|
3
|
+
* does a tool that must know, before it asks a person to look at its card, whether that card reaches the person at all
|
|
4
|
+
* (the plan-exit tool: a plan its card cannot carry is refused before any approval is requested). One bound, one measure:
|
|
5
|
+
* nothing else spells either.
|
|
6
|
+
*/
|
|
7
|
+
/** Size cap (characters) for the TEXT of a `tool_end.output` body on the live event stream, so a GB-scale result can't
|
|
8
|
+
* bloat SSE/checkpoint replay. Media blocks are not measured against it. The full result still lives in context /
|
|
9
|
+
* `ToolResultStore`. */
|
|
10
|
+
export declare const MAX_TOOL_END_OUTPUT_CHARS = 16384;
|
|
11
|
+
/** A card rides `tool_end.structured` while its JSON is at most this many characters: 4x the text cap, because card facts
|
|
12
|
+
* legitimately carry `originalFile` (the diff base). A larger card is left off `structured` whole; its skeleton rides instead. */
|
|
13
|
+
export declare const MAX_TOOL_CARD_CHARS: number;
|
|
14
|
+
/** A card's size as the frame measures it: the length of its JSON. A card with no JSON (a cycle, a BigInt, a throwing
|
|
15
|
+
* getter) measures `Infinity` — it never rides. */
|
|
16
|
+
export declare function toolCardChars(details: object): number;
|
|
17
|
+
/** Where a card goes on its `tool_end`: whole on `structured`, or — over the bound — its skeleton on `structuredSkeleton`. */
|
|
18
|
+
export type CardOnFrame = {
|
|
19
|
+
structured: object;
|
|
20
|
+
} | {
|
|
21
|
+
structuredSkeleton: {
|
|
22
|
+
type: string;
|
|
23
|
+
} & Record<string, unknown>;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* The one rule for a card and the bound. A card the frame can carry rides whole. One it cannot rides as its SKELETON: `type`
|
|
27
|
+
* plus the `members` its kind names, copied as written (a dotted name reaches into a nested object; a member the card does
|
|
28
|
+
* not carry stays absent; nothing is computed). A skeleton the frame cannot carry either rides as nothing — never cut: a
|
|
29
|
+
* shortened path would name another file. The rule knows no kind; the caller hands in the kind's members. A card whose
|
|
30
|
+
* members cannot be read (a throwing getter) has no skeleton either.
|
|
31
|
+
*/
|
|
32
|
+
export declare function cardOnFrame(card: object, type: string, members: readonly string[]): CardOnFrame | undefined;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export const MAX_TOOL_END_OUTPUT_CHARS = 16384;
|
|
2
|
+
export const MAX_TOOL_CARD_CHARS = MAX_TOOL_END_OUTPUT_CHARS * 4;
|
|
3
|
+
export function toolCardChars(details) {
|
|
4
|
+
try {
|
|
5
|
+
return (JSON.stringify(details) ?? "").length;
|
|
6
|
+
}
|
|
7
|
+
catch {
|
|
8
|
+
return Number.POSITIVE_INFINITY;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export function cardOnFrame(card, type, members) {
|
|
12
|
+
if (toolCardChars(card) <= MAX_TOOL_CARD_CHARS)
|
|
13
|
+
return { structured: card };
|
|
14
|
+
const skeleton = { type };
|
|
15
|
+
try {
|
|
16
|
+
for (const name of members) {
|
|
17
|
+
const path = name.split(".");
|
|
18
|
+
let value = card;
|
|
19
|
+
for (const key of path)
|
|
20
|
+
value = value !== null && typeof value === "object" && Object.hasOwn(value, key) ? value[key] : undefined;
|
|
21
|
+
if (value === undefined)
|
|
22
|
+
continue;
|
|
23
|
+
let into = skeleton;
|
|
24
|
+
for (const key of path.slice(0, -1))
|
|
25
|
+
into = (into[key] ??= {});
|
|
26
|
+
into[path.at(-1)] = value;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
return toolCardChars(skeleton) <= MAX_TOOL_CARD_CHARS ? { structuredSkeleton: skeleton } : undefined;
|
|
33
|
+
}
|
|
@@ -49,6 +49,15 @@ export declare const TOOL_CATALOG_ENTRIES: readonly ToolCatalogEntry[];
|
|
|
49
49
|
* cards and the fs boundary refusals (minted by the shared safety module on behalf of every fs tool).
|
|
50
50
|
*/
|
|
51
51
|
export declare const ENGINE_CARDS: Readonly<Record<string, string>>;
|
|
52
|
+
/**
|
|
53
|
+
* Each engine card's SKELETON — what rides `tool_end.structuredSkeleton` when the card itself is over the frame's card
|
|
54
|
+
* bound: `type` plus the members named here, copied as the mint wrote them (a dotted name reaches into a nested object;
|
|
55
|
+
* a member the card does not carry is simply absent). Only members whose size does not grow with content are named —
|
|
56
|
+
* paths, ids, closed words, counts, digests — so a kind whose every other member is content has an empty row. One row per
|
|
57
|
+
* card the engine mints, no row without one: the catalog refuses itself below otherwise. A caller-declared card has no
|
|
58
|
+
* row; its skeleton is `{ type }`.
|
|
59
|
+
*/
|
|
60
|
+
export declare const CARD_SKELETONS: Readonly<Record<string, readonly string[]>>;
|
|
52
61
|
/** The declared face of one definition, by definition id — what a definition module spreads into its spec. */
|
|
53
62
|
export declare function toolFace(id: string): ToolFaceDeclaration;
|
|
54
63
|
/** Is `contract` a contract object the catalog minted for an engine definition ({@link toolFace}) — the one record of "the engine
|
|
@@ -184,6 +184,54 @@ export const ENGINE_CARDS = Object.freeze({
|
|
|
184
184
|
read_unestablished: "src/tools/fs/shell-read-check.ts",
|
|
185
185
|
bash_self_kill_refused: "src/tools/fs/pattern-kill-guard.ts",
|
|
186
186
|
});
|
|
187
|
+
export const CARD_SKELETONS = Object.freeze({
|
|
188
|
+
create: ["filePath", "contentSha256"],
|
|
189
|
+
update: ["filePath", "contentSha256"],
|
|
190
|
+
edit: ["filePath", "replaceAll", "contentSha256"],
|
|
191
|
+
"notebook-edit": ["notebookPath", "cellId", "editMode", "cellType", "newCellId", "contentSha256"],
|
|
192
|
+
text: ["file.filePath", "file.numLines", "file.startLine", "file.totalLines", "file.truncatedByTokenCap"],
|
|
193
|
+
notebook: ["file.filePath"],
|
|
194
|
+
image: ["file.type", "file.originalSize", "file.dimensions"],
|
|
195
|
+
document: ["file.type", "file.originalSize", "file.pageCount", "file.timedOut", "fallback.level"],
|
|
196
|
+
grep: ["mode", "numFiles", "totalFiles", "numMatches", "numLines", "totalLines", "appliedLimit", "appliedOffset", "partial", "fallback"],
|
|
197
|
+
glob: ["numFiles", "truncated", "durationMs", "totalMatches", "countIsComplete"],
|
|
198
|
+
"repo-map": ["sourceFiles", "renderedFiles", "nonSourceFiles", "truncated"],
|
|
199
|
+
bash: ["exitCode", "interrupted", "timedOut", "timeoutSec", "requestedTimeoutSec", "cappedToMaxTimeoutSec", "livenessNoOutput", "noOutputSec", "aborted", "isImage", "output_file", "detached", "task_id", "sandboxUnavailable", "refusedBy", "refused", "transportLost", "envSuspended", "authFailed", "targetUnavailable", "registerFailed", "killFailed"],
|
|
200
|
+
bash_invalid_timeout: ["code"],
|
|
201
|
+
bash_self_kill_refused: ["code", "finding", "pid", "relation"],
|
|
202
|
+
readonly_out_of_root: ["code"],
|
|
203
|
+
read_unestablished: ["code"],
|
|
204
|
+
path_not_in_root: ["code", "target"],
|
|
205
|
+
read_path_denied: ["code", "target", "pattern"],
|
|
206
|
+
artifact: ["action", "plane", "code", "invalidArguments", "url", "path", "bytes", "mediaType", "ref.url", "ref.slug", "ref.version"],
|
|
207
|
+
worktree: ["action", "worktreeDir", "base", "kept", "metadataPruned"],
|
|
208
|
+
"task-stop": ["task_type", "task_id", "status", "retrieval_status", "error", "code", "stoppedBy", "completionId"],
|
|
209
|
+
"monitor-start": ["taskId", "persistent", "envBudgetSec", "effectiveTimeoutMs", "timeoutIgnored", "sessionScoped", "timeoutMs", "requestedTimeoutMs", "wasClamped", "sandboxUnavailable", "refusedBy"],
|
|
210
|
+
"send-message": ["status", "to", "address", "seq", "task_id", "marker", "doorbell", "verdict", "subscription"],
|
|
211
|
+
"agent-transcript": ["id", "agentState"],
|
|
212
|
+
"list-agents": ["directoryFault"],
|
|
213
|
+
"read-inbox": ["error", "delivered", "pending", "urgent", "notTaken"],
|
|
214
|
+
"workflow-run": ["status", "workflowRunId", "task_id"],
|
|
215
|
+
"report-findings": ["count", "level"],
|
|
216
|
+
"tool-search": ["total_deferred_tools"],
|
|
217
|
+
advisor: ["outcome", "model", "servedModel", "stopReason", "code", "errorKind", "hold", "inputTooLongRuledOut", "usage"],
|
|
218
|
+
"ask-question": ["questionId", "continuationSource", "runContinues", "reason", "code"],
|
|
219
|
+
"exit-plan-mode": ["isAgent", "filePath"],
|
|
220
|
+
"enter-plan-mode": ["message"],
|
|
221
|
+
"cron-create": ["id", "recurring", "durable", "replaced", "nextFireAt"],
|
|
222
|
+
"cron-delete": ["id"],
|
|
223
|
+
"cron-list": [],
|
|
224
|
+
"schedule-wakeup": ["stopped", "scheduledFor", "clampedDelaySeconds", "wasClamped", "noop", "cancelledWakeups"],
|
|
225
|
+
"web-fetch": ["url", "code", "bytes", "durationMs", "truncated", "partial", "timedOut", "aborted"],
|
|
226
|
+
"web-search": ["durationSeconds", "searchCount", "retryable"],
|
|
227
|
+
todo: [],
|
|
228
|
+
task: ["task.id", "task.status", "task.owner", "deleted"],
|
|
229
|
+
"task-list": [],
|
|
230
|
+
agent: ["status", "isAsync", "task_id", "settle_id", "subagent_type", "taskId", "sessionId", "code", "retryAfterMs", "resolvedModel", "worktreePath"],
|
|
231
|
+
fork: [],
|
|
232
|
+
mcp: [],
|
|
233
|
+
a2a: ["state", "kind", "taskId", "contextId", "code", "delivered"],
|
|
234
|
+
});
|
|
187
235
|
const byId = new Map();
|
|
188
236
|
for (const e of TOOL_CATALOG_ENTRIES) {
|
|
189
237
|
if (byId.has(e.id))
|
|
@@ -93,9 +93,10 @@ export declare function formatToolError(error: unknown): string;
|
|
|
93
93
|
* terminal codes, not foreign ones); (c) pre-existing precedent (`config.compliance_required`,
|
|
94
94
|
* NOT part of this diff) already folds a transient/retryable governance code into `config`.
|
|
95
95
|
* The whole `env.` namespace is `config` BY PREFIX: a terminal code there is a refusal or a
|
|
96
|
-
* limit of the execution environment — `env.lifetime_expired`,
|
|
97
|
-
* `executionEnvFactory` throws when it refuses to mint
|
|
98
|
-
*
|
|
96
|
+
* limit of the execution environment — `env.lifetime_expired`, the code a deployment's
|
|
97
|
+
* `executionEnvFactory` throws when it refuses to mint, or the code an adapter answers at the
|
|
98
|
+
* leg's restore seat when it refuses to establish (the engine carries both to the terminal
|
|
99
|
+
* verbatim; the module registers none of them, so a code a later deployment
|
|
99
100
|
* mints still reads `config`) — and what a caller does about every one of them is the same:
|
|
100
101
|
* change the environment or the configuration, then retry. The other `env.`-spelled strings
|
|
101
102
|
* of the codebase (a prompt-assembly block id, mod-kernel event names) are never a terminal
|