@sema-agent/core 7.54.1 → 7.56.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +950 -0
- package/dist/agents/agent-transcript-tool.js +2 -1
- package/dist/agents/builtin-agents.d.ts +12 -14
- package/dist/agents/cascade.js +1 -1
- package/dist/agents/cc-peer-directory.d.ts +36 -0
- package/dist/agents/cc-peer-directory.js +139 -0
- package/dist/agents/cc-peer-wire.d.ts +105 -0
- package/dist/agents/cc-peer-wire.js +98 -0
- package/dist/agents/cc-uds-peer-channel.d.ts +40 -0
- package/dist/agents/cc-uds-peer-channel.js +457 -0
- package/dist/agents/child-model-seat.d.ts +0 -11
- package/dist/agents/child-model-seat.js +0 -3
- package/dist/agents/cross-session-envelope.d.ts +4 -1
- package/dist/agents/cross-session-envelope.js +8 -1
- package/dist/agents/cross-session-judge.d.ts +2 -2
- package/dist/agents/list-agents-tool.d.ts +3 -1
- package/dist/agents/list-agents-tool.js +9 -8
- package/dist/agents/observer.d.ts +4 -5
- package/dist/agents/observer.js +2 -1
- package/dist/agents/peer-admission.d.ts +6 -0
- package/dist/agents/peer-admission.js +4 -1
- package/dist/agents/peer-directory.d.ts +65 -13
- package/dist/agents/peer-directory.js +90 -25
- package/dist/agents/peer-notices.d.ts +1 -1
- package/dist/agents/peer-session-drain.d.ts +3 -1
- package/dist/agents/peer-session-drain.js +3 -2
- package/dist/agents/read-inbox-tool.js +2 -1
- package/dist/agents/repair-loop.js +2 -2
- package/dist/agents/retain-ledger.d.ts +1 -1
- package/dist/agents/roster-store.d.ts +1 -1
- package/dist/agents/send-message-tool.d.ts +10 -0
- package/dist/agents/send-message-tool.js +37 -8
- package/dist/agents/subagent.d.ts +39 -82
- package/dist/agents/subagent.js +109 -106
- package/dist/agents/tool-filter.d.ts +31 -46
- package/dist/agents/tool-filter.js +13 -33
- package/dist/agents/verify.d.ts +6 -5
- package/dist/agents/verify.js +3 -3
- package/dist/brain/anthropic.js +43 -81
- package/dist/brain/errors.d.ts +15 -0
- package/dist/brain/errors.js +10 -0
- package/dist/brain/media-degrade.d.ts +18 -7
- package/dist/brain/media-degrade.js +13 -2
- package/dist/brain/model-capability.d.ts +37 -0
- package/dist/brain/model-capability.js +34 -0
- package/dist/brain/model-presets.d.ts +6 -12
- package/dist/brain/model-presets.js +1 -6
- package/dist/brain/open-responses.js +27 -35
- package/dist/brain/openai.js +30 -98
- package/dist/brain/provider-dialect.d.ts +39 -3
- package/dist/brain/provider-dialect.js +28 -0
- package/dist/brain/reasoning-request.d.ts +96 -0
- package/dist/brain/reasoning-request.js +174 -0
- package/dist/brain/reasoning.d.ts +12 -12
- package/dist/brain/reasoning.js +4 -3
- package/dist/brain/request-params.d.ts +62 -9
- package/dist/brain/request-params.js +42 -7
- package/dist/brain/retry.d.ts +1 -1
- package/dist/brain/route-adjudicator.d.ts +15 -0
- package/dist/brain/route-adjudicator.js +15 -0
- package/dist/brain/status-sink.d.ts +20 -0
- package/dist/brain/status-sink.js +7 -0
- package/dist/brain/stream-engine.js +6 -5
- package/dist/brain/stream-shared.d.ts +1 -1
- package/dist/core/a2a.d.ts +2 -1
- package/dist/core/a2a.js +19 -13
- package/dist/core/advisor-verdict.d.ts +120 -0
- package/dist/core/advisor-verdict.js +92 -0
- package/dist/core/agent-definition.d.ts +17 -8
- package/dist/core/allow-entry.d.ts +69 -36
- package/dist/core/allow-entry.js +81 -52
- package/dist/core/allow-rule-shadow.d.ts +10 -3
- package/dist/core/approval-object.d.ts +2 -1
- package/dist/core/approval-object.js +6 -6
- package/dist/core/ask-origin.d.ts +127 -29
- package/dist/core/ask-origin.js +87 -25
- package/dist/core/ask-question.d.ts +51 -8
- package/dist/core/ask-question.js +12 -7
- package/dist/core/ask-unresolvable-notice.d.ts +8 -3
- package/dist/core/ask-unresolvable-notice.js +16 -2
- package/dist/core/auto-compaction.d.ts +11 -8
- package/dist/core/auto-compaction.js +4 -2
- package/dist/core/auto-mode-arming.d.ts +2 -2
- package/dist/core/auto-mode-defaults.d.ts +8 -8
- package/dist/core/auto-mode-prompt-assets.d.ts +3 -3
- package/dist/core/auto-mode-prompt.d.ts +1 -1
- package/dist/core/auto-mode.d.ts +17 -9
- package/dist/core/auto-mode.js +9 -6
- package/dist/core/background-agent-store.d.ts +3 -3
- package/dist/core/canonical-json.d.ts +1 -1
- package/dist/core/canonical-json.js +2 -2
- package/dist/core/checkpoint-generation.d.ts +53 -0
- package/dist/core/checkpoint-generation.js +35 -0
- package/dist/core/checkpoint-queries.d.ts +180 -0
- package/dist/core/checkpoint-queries.js +272 -0
- package/dist/core/checkpoint-requirements.d.ts +19 -4
- package/dist/core/checkpoint-requirements.js +8 -14
- package/dist/core/checkpoint-store.d.ts +165 -72
- package/dist/core/checkpoint-store.js +79 -82
- package/dist/core/child-clamp-seats.d.ts +6 -0
- package/dist/core/child-clamp-seats.js +3 -16
- package/dist/core/compliance.d.ts +2 -2
- package/dist/core/context-edit.d.ts +6 -7
- package/dist/core/cross-boundary-taint.d.ts +11 -4
- package/dist/core/cross-boundary-taint.js +3 -3
- package/dist/core/decision-receipt.d.ts +37 -3
- package/dist/core/decision-receipt.js +19 -19
- package/dist/core/delegation-not-started.d.ts +6 -0
- package/dist/core/delegation-not-started.js +17 -0
- package/dist/core/effective-path-target.d.ts +1 -1
- package/dist/core/engine-attestation.d.ts +93 -0
- package/dist/core/engine-attestation.js +70 -0
- package/dist/core/engine-capabilities.d.ts +4 -1
- package/dist/core/engine-capabilities.js +1 -1
- package/dist/core/engine-notice.d.ts +45 -12
- package/dist/core/exec-output-tail.d.ts +1 -1
- package/dist/core/file-history-retention.d.ts +1 -1
- package/dist/core/file-history-store.d.ts +147 -21
- package/dist/core/file-history-store.js +58 -32
- package/dist/core/gate-fold.d.ts +1 -1
- package/dist/core/gate-fold.js +24 -11
- package/dist/core/gate-lanes.js +81 -68
- package/dist/core/gate-outcome.d.ts +40 -6
- package/dist/core/gate-outcome.js +56 -0
- package/dist/core/governance-codes.d.ts +17 -3
- package/dist/core/governance-codes.js +16 -0
- package/dist/core/hands-band.d.ts +1 -1
- package/dist/core/hooks.d.ts +21 -20
- package/dist/core/hooks.js +3 -1
- package/dist/core/host-floor.d.ts +128 -0
- package/dist/core/host-floor.js +206 -0
- package/dist/core/host-target.d.ts +84 -0
- package/dist/core/host-target.js +92 -0
- package/dist/core/image-downsample.d.ts +1 -1
- package/dist/core/lsp-diagnostics.d.ts +4 -4
- package/dist/core/lsp.d.ts +3 -3
- package/dist/core/mailbox-store.d.ts +4 -0
- package/dist/core/mcp-connection-pool.d.ts +18 -2
- package/dist/core/mcp-connection-pool.js +53 -6
- package/dist/core/mcp-failure.d.ts +23 -4
- package/dist/core/mcp-failure.js +26 -11
- package/dist/core/mcp-listing-drift.d.ts +10 -0
- package/dist/core/mcp-listing-drift.js +6 -0
- package/dist/core/mcp-server-link.d.ts +173 -0
- package/dist/core/mcp-server-link.js +127 -0
- package/dist/core/mcp-server-spec.d.ts +4 -2
- package/dist/core/mcp-session-end.d.ts +26 -0
- package/dist/core/mcp-session-end.js +29 -0
- package/dist/core/mcp-startup-request.d.ts +17 -0
- package/dist/core/mcp-startup-request.js +17 -0
- package/dist/core/mcp.d.ts +17 -13
- package/dist/core/mcp.js +240 -189
- package/dist/core/media-byte-cap.d.ts +1 -1
- package/dist/core/memory-engine/delegation-settlement.js +15 -24
- package/dist/core/memory-engine/engine.d.ts +9 -9
- package/dist/core/memory-engine/engine.js +4 -4
- package/dist/core/memory-engine/layout.d.ts +60 -8
- package/dist/core/memory-engine/layout.js +65 -6
- package/dist/core/memory-engine/provenance-wording.d.ts +1 -1
- package/dist/core/memory-engine/tools.js +4 -1
- package/dist/core/mode-policy.d.ts +1 -1
- package/dist/core/model-seat.d.ts +10 -3
- package/dist/core/mods/classic-events.d.ts +67 -0
- package/dist/core/mods/classic-events.js +1 -0
- package/dist/core/mods/dollar.d.ts +13 -0
- package/dist/core/mods/extension-call.d.ts +31 -0
- package/dist/core/mods/extension-call.js +43 -0
- package/dist/core/mods/kernel/dispatch.d.ts +20 -3
- package/dist/core/mods/kernel/dispatch.js +140 -69
- package/dist/core/mods/kernel/events.d.ts +47 -11
- package/dist/core/mods/kernel/events.js +66 -42
- package/dist/core/mods/kernel/index.d.ts +4 -4
- package/dist/core/mods/kernel/index.js +2 -2
- package/dist/core/mods/kernel/receive.d.ts +39 -5
- package/dist/core/mods/kernel/receive.js +290 -17
- package/dist/core/mods/kernel/registration.d.ts +33 -2
- package/dist/core/mods/kernel/registration.js +6 -7
- package/dist/core/mods/kernel/site-rules.d.ts +44 -16
- package/dist/core/mods/kernel/site-rules.js +24 -42
- package/dist/core/mods/spec-seats.d.ts +69 -0
- package/dist/core/mods/spec-seats.js +114 -0
- package/dist/core/mods/stations.d.ts +28 -8
- package/dist/core/mods/stations.js +29 -13
- package/dist/core/mods/tool-call.d.ts +79 -0
- package/dist/core/mods/tool-call.js +152 -0
- package/dist/core/namespaced-rule-name.d.ts +44 -24
- package/dist/core/namespaced-rule-name.js +50 -43
- package/dist/core/output-style.d.ts +1 -1
- package/dist/core/param-rule-reach.d.ts +15 -0
- package/dist/core/param-rule-reach.js +30 -0
- package/dist/core/parent-spec-seat.d.ts +13 -1
- package/dist/core/parent-spec-seat.js +6 -0
- package/dist/core/park-selfcheck.js +1 -0
- package/dist/core/pause-registry.d.ts +16 -5
- package/dist/core/pause-registry.js +6 -2
- package/dist/core/peer-channel.d.ts +70 -0
- package/dist/core/peer-channel.js +1 -0
- package/dist/core/permission-rule-consent.d.ts +30 -5
- package/dist/core/permission-rule-consent.js +147 -50
- package/dist/core/permission-rule-model.d.ts +245 -65
- package/dist/core/permission-rule-model.js +421 -107
- package/dist/core/permission-rule-org.d.ts +6 -2
- package/dist/core/permission-rule-org.js +7 -3
- package/dist/core/permission-rule-provider.d.ts +6 -2
- package/dist/core/permission-rule-provider.js +41 -11
- package/dist/core/permission-rule-store.d.ts +22 -26
- package/dist/core/permission-rule-store.js +12 -6
- package/dist/core/permission-rule-sync.d.ts +11 -2
- package/dist/core/permission-rule-sync.js +11 -3
- package/dist/core/permission-rule-syntax.d.ts +5 -4
- package/dist/core/permission-rule-syntax.js +2 -2
- package/dist/core/permission-rules.d.ts +53 -15
- package/dist/core/permission-rules.js +125 -100
- package/dist/core/persisted-rule-arms.d.ts +6 -4
- package/dist/core/persisted-rule-arms.js +10 -12
- package/dist/core/present-plan-tool.js +3 -1
- package/dist/core/principal-name.d.ts +20 -0
- package/dist/core/principal-name.js +22 -0
- package/dist/core/prompt-section-seat.js +4 -6
- package/dist/core/protocol-http-auth.d.ts +26 -5
- package/dist/core/protocol-http-auth.js +137 -4
- package/dist/core/protocol-naming.d.ts +2 -2
- package/dist/core/read-only-shell-table.d.ts +1 -1
- package/dist/core/read-only-shell.d.ts +1 -1
- package/dist/core/retired-keys.d.ts +16 -0
- package/dist/core/retired-keys.js +16 -4
- package/dist/core/rewrite-rejudge.d.ts +60 -0
- package/dist/core/rewrite-rejudge.js +36 -0
- package/dist/core/roles.d.ts +34 -3
- package/dist/core/roles.js +66 -53
- package/dist/core/rule-lane-reads.d.ts +20 -15
- package/dist/core/rule-lane-reads.js +45 -17
- package/dist/core/rule-offer-read.d.ts +53 -0
- package/dist/core/rule-offer-read.js +146 -0
- package/dist/core/rule-owner.d.ts +46 -0
- package/dist/core/rule-owner.js +29 -0
- package/dist/core/runner/advisor-instructions.d.ts +70 -0
- package/dist/core/runner/advisor-instructions.js +61 -0
- package/dist/core/runner/advisor-tool.d.ts +33 -0
- package/dist/core/runner/advisor-tool.js +112 -0
- package/dist/core/runner/announce-once-ledger.d.ts +18 -26
- package/dist/core/runner/announce-once-ledger.js +19 -46
- package/dist/core/runner/approval-feedback.js +6 -3
- package/dist/core/runner/assemble-result.d.ts +2 -1
- package/dist/core/runner/assemble-result.js +1 -1
- package/dist/core/runner/call-hook-stations.d.ts +3 -2
- package/dist/core/runner/caller-roster.d.ts +21 -2
- package/dist/core/runner/caller-roster.js +38 -0
- package/dist/core/runner/capability-withheld-seat.d.ts +5 -0
- package/dist/core/runner/capability-withheld-seat.js +24 -0
- package/dist/core/runner/classifier-ladder.d.ts +33 -13
- package/dist/core/runner/classifier-ladder.js +15 -14
- package/dist/core/runner/compaction-restate.d.ts +10 -6
- package/dist/core/runner/compaction-restate.js +9 -3
- package/dist/core/runner/construction-doors.js +3 -0
- package/dist/core/runner/contracts.d.ts +40 -33
- package/dist/core/runner/conversation-segment.d.ts +28 -0
- package/dist/core/runner/conversation-segment.js +42 -0
- package/dist/core/runner/cross-boundary-lane.d.ts +21 -16
- package/dist/core/runner/cross-boundary-lane.js +58 -34
- package/dist/core/runner/decide-continuation.d.ts +7 -4
- package/dist/core/runner/decide-continuation.js +2 -2
- package/dist/core/runner/denial-limit-arms.d.ts +4 -4
- package/dist/core/runner/denial-limit-arms.js +1 -1
- package/dist/core/runner/derived-route-fallback.d.ts +24 -24
- package/dist/core/runner/derived-route-fallback.js +9 -7
- package/dist/core/runner/file-history-request.d.ts +18 -0
- package/dist/core/runner/file-history-request.js +21 -13
- package/dist/core/runner/file-history-restore.d.ts +45 -0
- package/dist/core/runner/file-history-restore.js +46 -0
- package/dist/core/runner/gate-exit.d.ts +9 -3
- package/dist/core/runner/gate-exit.js +11 -5
- package/dist/core/runner/image.d.ts +7 -17
- package/dist/core/runner/image.js +9 -60
- package/dist/core/runner/initial-run-state.js +1 -1
- package/dist/core/runner/permission-rule-lanes.d.ts +6 -6
- package/dist/core/runner/permission-rule-lanes.js +38 -15
- package/dist/core/runner/person-path-rows.d.ts +12 -9
- package/dist/core/runner/person-path-rows.js +19 -8
- package/dist/core/runner/prepare-advisor.d.ts +63 -0
- package/dist/core/runner/prepare-advisor.js +77 -0
- package/dist/core/runner/prepare-ask-lane.d.ts +2 -2
- package/dist/core/runner/prepare-ask-lane.js +5 -2
- package/dist/core/runner/prepare-caps-and-workflow.d.ts +4 -6
- package/dist/core/runner/prepare-caps-and-workflow.js +5 -4
- package/dist/core/runner/prepare-config-doors.d.ts +31 -38
- package/dist/core/runner/prepare-config-doors.js +57 -34
- package/dist/core/runner/prepare-defer-classify.d.ts +4 -3
- package/dist/core/runner/prepare-defer-classify.js +7 -8
- package/dist/core/runner/prepare-delegation-surface.d.ts +2 -2
- package/dist/core/runner/prepare-delegation-surface.js +1 -1
- package/dist/core/runner/prepare-file-history.d.ts +48 -8
- package/dist/core/runner/prepare-file-history.js +41 -73
- package/dist/core/runner/prepare-gate-stations.d.ts +2 -5
- package/dist/core/runner/prepare-gate-stations.js +12 -8
- package/dist/core/runner/prepare-hands-readface.d.ts +2 -8
- package/dist/core/runner/prepare-hands-readface.js +15 -14
- package/dist/core/runner/prepare-inherited-gate.d.ts +11 -7
- package/dist/core/runner/prepare-inherited-gate.js +8 -6
- package/dist/core/runner/prepare-memory-engine-session.js +1 -1
- package/dist/core/runner/prepare-park-ask.js +12 -12
- package/dist/core/runner/prepare-policy-chain.d.ts +7 -4
- package/dist/core/runner/prepare-policy-chain.js +68 -81
- package/dist/core/runner/prepare-project-context.d.ts +5 -2
- package/dist/core/runner/prepare-project-context.js +6 -3
- package/dist/core/runner/prepare-prompt-assembly.d.ts +5 -7
- package/dist/core/runner/prepare-prompt-assembly.js +10 -8
- package/dist/core/runner/prepare-prompt-inputs.d.ts +11 -9
- package/dist/core/runner/prepare-prompt-inputs.js +4 -6
- package/dist/core/runner/prepare-protocol-tools.d.ts +4 -2
- package/dist/core/runner/prepare-protocol-tools.js +5 -4
- package/dist/core/runner/prepare-safety-scan.d.ts +9 -12
- package/dist/core/runner/prepare-safety-scan.js +8 -23
- package/dist/core/runner/prepare-suspend-saga.d.ts +2 -0
- package/dist/core/runner/prepare-suspend-saga.js +5 -6
- package/dist/core/runner/prepare-task.d.ts +1 -1
- package/dist/core/runner/prepare-task.js +41 -35
- package/dist/core/runner/prepare-tool-disclosure-mount.d.ts +7 -4
- package/dist/core/runner/prepare-tool-disclosure-mount.js +24 -18
- package/dist/core/runner/prepare-turn-wiring.d.ts +0 -4
- package/dist/core/runner/prepare-turn-wiring.js +2 -7
- package/dist/core/runner/prepare-wiring-manifest.d.ts +11 -4
- package/dist/core/runner/prepare-wiring-manifest.js +3 -3
- package/dist/core/runner/resume-admission.js +1 -1
- package/dist/core/runner/resume-apply.js +11 -12
- package/dist/core/runner/resume-checkpoint-screen.js +3 -0
- package/dist/core/runner/resume-claim.d.ts +4 -2
- package/dist/core/runner/resume-claim.js +15 -8
- package/dist/core/runner/resume-policy-outcome.js +1 -1
- package/dist/core/runner/retired-runner-deps.js +2 -1
- package/dist/core/runner/rewind-files.d.ts +15 -0
- package/dist/core/runner/rewind-files.js +132 -0
- package/dist/core/runner/run-attachment-seats.js +2 -2
- package/dist/core/runner/run-brain-sinks.d.ts +4 -1
- package/dist/core/runner/run-brain-sinks.js +4 -2
- package/dist/core/runner/run-compaction-machinery.d.ts +1 -1
- package/dist/core/runner/run-compaction-machinery.js +2 -12
- package/dist/core/runner/run-git-lane.d.ts +1 -0
- package/dist/core/runner/run-harness-handlers.js +14 -7
- package/dist/core/runner/run-leg.d.ts +1 -1
- package/dist/core/runner/run-leg.js +43 -18
- package/dist/core/runner/run-settle-and-teardown.js +3 -2
- package/dist/core/runner/run-telemetry-and-budget-seats.js +1 -1
- package/dist/core/runner/run-turn-boundary.d.ts +1 -0
- package/dist/core/runner/run-turn-boundary.js +15 -22
- package/dist/core/runner/runtask.d.ts +3 -0
- package/dist/core/runner/runtask.js +8 -9
- package/dist/core/runner/session-read-file-states.d.ts +15 -0
- package/dist/core/runner/session-read-file-states.js +28 -0
- package/dist/core/runner/session-rule-policy.d.ts +22 -21
- package/dist/core/runner/session-rule-policy.js +17 -31
- package/dist/core/runner/shell-env-withheld.d.ts +33 -0
- package/dist/core/runner/shell-env-withheld.js +51 -0
- package/dist/core/runner/side-call-account.d.ts +32 -8
- package/dist/core/runner/side-call-account.js +23 -1
- package/dist/core/runner/skills-seat.js +6 -2
- package/dist/core/runner/stream-settle-backstop.js +1 -1
- package/dist/core/runner/strict-output-schema.d.ts +1 -1
- package/dist/core/runner/sub-agent-deny-lists.js +4 -6
- package/dist/core/runner/synthetic-tools.d.ts +16 -13
- package/dist/core/runner/synthetic-tools.js +8 -3
- package/dist/core/runner/tool-disclosure.d.ts +10 -12
- package/dist/core/runner/tool-disclosure.js +3 -4
- package/dist/core/runner/tool-end-body.d.ts +1 -1
- package/dist/core/runner/tool-end-body.js +10 -9
- package/dist/core/runner/tool-face-overlay.d.ts +2 -1
- package/dist/core/runner/tool-face-overlay.js +17 -1
- package/dist/core/runner/tool-not-executed.d.ts +5 -0
- package/dist/core/runner/tool-not-executed.js +11 -0
- package/dist/core/runner/tool-occurrence.d.ts +8 -0
- package/dist/core/runner/tool-occurrence.js +7 -0
- package/dist/core/runner/tool-progress-lane.d.ts +2 -2
- package/dist/core/runner/tool-turn-repair-seat.d.ts +3 -2
- package/dist/core/runner/turn-attachments.d.ts +91 -80
- package/dist/core/runner/turn-attachments.js +62 -37
- package/dist/core/runner-deps.d.ts +42 -42
- package/dist/core/runtime-caps.d.ts +4 -4
- package/dist/core/safety-axis-vocab.d.ts +6 -4
- package/dist/core/safety-axis-vocab.js +6 -5
- package/dist/core/safety-merge-corpus.js +26 -2
- package/dist/core/same-plain-value.d.ts +40 -0
- package/dist/core/same-plain-value.js +49 -0
- package/dist/core/scheduler.d.ts +1 -1
- package/dist/core/secret-env.d.ts +26 -3
- package/dist/core/secret-env.js +44 -8
- package/dist/core/select-model.js +3 -3
- package/dist/core/sensitive-path-policy.d.ts +1 -1
- package/dist/core/sensitive-path-policy.js +1 -1
- package/dist/core/session-policy-store.d.ts +102 -35
- package/dist/core/session-policy-store.js +210 -48
- package/dist/core/session-reconcile.d.ts +2 -2
- package/dist/core/session-store.d.ts +106 -37
- package/dist/core/session-store.js +165 -91
- package/dist/core/session.d.ts +101 -57
- package/dist/core/session.js +53 -0
- package/dist/core/shared-memory/tools.js +3 -1
- package/dist/core/shared-memory/types.d.ts +1 -1
- package/dist/core/shell-read-silence.d.ts +11 -12
- package/dist/core/shell-read-silence.js +9 -5
- package/dist/core/shell-run-candidates.js +3 -1
- package/dist/core/shell-wrapper-projection.js +1 -1
- package/dist/core/shell-wrapper-table.d.ts +14 -7
- package/dist/core/shell-wrapper-table.js +5 -4
- package/dist/core/side-query.d.ts +10 -0
- package/dist/core/side-query.js +15 -1
- package/dist/core/skill-grant.d.ts +7 -2
- package/dist/core/skill-grant.js +5 -0
- package/dist/core/skills-directory.js +6 -2
- package/dist/core/store-contracts/checkpoint-store-contract.d.ts +11 -1
- package/dist/core/store-contracts/checkpoint-store-contract.js +168 -3
- package/dist/core/store-contracts/file-history-store-contract.js +74 -4
- package/dist/core/store-contracts/peer-directory-contract.d.ts +7 -2
- package/dist/core/store-contracts/peer-directory-contract.js +14 -2
- package/dist/core/store-contracts/session-policy-store-contract.d.ts +7 -0
- package/dist/core/store-contracts/session-policy-store-contract.js +130 -0
- package/dist/core/store-contracts/session-repo-contract.js +176 -0
- package/dist/core/store-contracts/session-store-contract.d.ts +6 -8
- package/dist/core/store-contracts/session-store-contract.js +361 -51
- package/dist/core/store-contracts/workflow-journal-store-contract.js +26 -1
- package/dist/core/stub-env.d.ts +2 -0
- package/dist/core/stub-env.js +1 -0
- package/dist/core/surrogate-safe-slice.d.ts +3 -3
- package/dist/core/synthetic-read-verdict.js +3 -3
- package/dist/core/task-event.d.ts +42 -8
- package/dist/core/task-notification.d.ts +19 -15
- package/dist/core/task-registry-agent.d.ts +4 -4
- package/dist/core/task-registry-shared.d.ts +4 -4
- package/dist/core/task-registry-shared.js +1 -0
- package/dist/core/task-registry.d.ts +13 -4
- package/dist/core/task-registry.js +14 -2
- package/dist/core/task-result.d.ts +21 -3
- package/dist/core/task-spec.d.ts +69 -64
- package/dist/core/task-stream.d.ts +6 -6
- package/dist/core/task-tool-shape.d.ts +4 -4
- package/dist/core/tighten-task-spec.d.ts +1 -1
- package/dist/core/tighten-task-spec.js +2 -1
- package/dist/core/tool-catalog-entries.d.ts +36 -2
- package/dist/core/tool-catalog-entries.js +69 -43
- package/dist/core/tool-check-reading.d.ts +11 -0
- package/dist/core/tool-check-reading.js +11 -6
- package/dist/core/tool-conformance.js +1 -0
- package/dist/core/tool-errors.d.ts +2 -2
- package/dist/core/tool-face-reader.js +5 -3
- package/dist/core/tool-face.d.ts +21 -2
- package/dist/core/tool-face.js +1 -1
- package/dist/core/tool-model-gate.d.ts +5 -5
- package/dist/core/tool-name-aliases.d.ts +29 -8
- package/dist/core/tool-name-aliases.js +22 -4
- package/dist/core/tool-name-readings.d.ts +10 -43
- package/dist/core/tool-name-readings.js +2 -11
- package/dist/core/tool-policy.d.ts +85 -196
- package/dist/core/tool-policy.js +150 -175
- package/dist/core/tool-registry.d.ts +14 -7
- package/dist/core/tool-registry.js +17 -7
- package/dist/core/tool-result-store.js +5 -1
- package/dist/core/tool-roster.d.ts +57 -33
- package/dist/core/tool-roster.js +56 -68
- package/dist/core/tool-spec-members.js +8 -3
- package/dist/core/tool-spec.d.ts +53 -31
- package/dist/core/tools.js +51 -10
- package/dist/core/trace.d.ts +6 -2
- package/dist/core/types.d.ts +1 -1
- package/dist/core/untrusted-egress.d.ts +1 -1
- package/dist/core/untrusted-text.d.ts +1 -1
- package/dist/core/user-attachment.d.ts +8 -1
- package/dist/core/user-attachment.js +64 -4
- package/dist/core/warm-resume.d.ts +1 -1
- package/dist/core/wiring-manifest.d.ts +58 -0
- package/dist/core/wiring-manifest.js +14 -5
- package/dist/core/workflow-journal-store.d.ts +62 -0
- package/dist/core/workflow-journal-store.js +78 -2
- package/dist/core/workflow-run-store.d.ts +6 -0
- package/dist/core/workflow-run-store.js +2 -0
- package/dist/engine/compaction/compaction.d.ts +9 -9
- package/dist/engine/compaction/compaction.js +3 -2
- package/dist/engine/execution-env/node-execution-env.d.ts +26 -8
- package/dist/engine/execution-env/node-execution-env.js +54 -24
- package/dist/engine/harness/agent-harness.d.ts +39 -9
- package/dist/engine/harness/agent-harness.js +87 -33
- package/dist/engine/harness/types.d.ts +58 -9
- package/dist/engine/harness/types.js +12 -1
- package/dist/engine/llm/types.d.ts +36 -19
- package/dist/engine/llm/validation.d.ts +4 -1
- package/dist/engine/llm/validation.js +13 -1
- package/dist/engine/loop/agent-loop.d.ts +23 -1
- package/dist/engine/loop/agent-loop.js +26 -34
- package/dist/engine/loop/types.d.ts +31 -19
- package/dist/engine/lsp/node-lsp-manager.d.ts +2 -2
- package/dist/engine/session/memory-repo.d.ts +18 -12
- package/dist/engine/session/memory-repo.js +24 -9
- package/dist/engine/session/parent-chain-guard.d.ts +3 -2
- package/dist/engine/session/parent-chain-guard.js +1 -1
- package/dist/engine/session/repo-utils.d.ts +32 -3
- package/dist/engine/session/repo-utils.js +50 -5
- package/dist/index.d.ts +47 -23
- package/dist/index.js +35 -17
- package/dist/internal/harness-types.d.ts +1 -1
- package/dist/internal/harness.d.ts +3 -3
- package/dist/internal/harness.js +2 -2
- package/dist/internal/llm.d.ts +2 -2
- package/dist/internal/llm.js +1 -1
- package/dist/orchestration/goal.js +2 -2
- package/dist/orchestration/run-workflow-tool.d.ts +8 -6
- package/dist/orchestration/run-workflow-tool.js +10 -6
- package/dist/orchestration/workflow-size-guideline.d.ts +4 -4
- package/dist/orchestration/workflow-types.d.ts +18 -0
- package/dist/orchestration/workflow-types.js +6 -0
- package/dist/orchestration/workflow.d.ts +5 -13
- package/dist/orchestration/workflow.js +57 -49
- package/dist/prompt-assembly/artifact.d.ts +2 -2
- package/dist/prompt-assembly/artifact.js +5 -3
- package/dist/prompt-assembly/assemble.d.ts +3 -2
- package/dist/prompt-assembly/assemble.js +1 -1
- package/dist/prompt-assembly/catalog/schema.d.ts +43 -12
- package/dist/prompt-assembly/catalog/schema.js +34 -2
- package/dist/prompt-assembly/catalog/sections.js +0 -1
- package/dist/prompt-assembly/composer.d.ts +3 -1
- package/dist/prompt-assembly/composer.js +1 -1
- package/dist/prompt-assembly/event-registry.js +2 -0
- package/dist/prompt-assembly/overlay.js +3 -3
- package/dist/prompt-assembly/renderers.d.ts +1 -1
- package/dist/prompt-assembly/renderers.js +0 -3
- package/dist/prompt-assembly/role-base.d.ts +15 -0
- package/dist/prompt-assembly/role-base.js +9 -0
- package/dist/prompt-assembly/select.d.ts +39 -14
- package/dist/prompt-assembly/select.js +47 -16
- package/dist/prompt-assembly/sugar.d.ts +17 -11
- package/dist/prompt-assembly/sugar.js +8 -3
- package/dist/prompt-assembly/tool-catalog.d.ts +39 -2
- package/dist/prompt-assembly/tool-catalog.js +117 -4
- package/dist/prompt-assembly/turn-snapshot.d.ts +4 -10
- package/dist/prompt-assembly/turn-snapshot.js +0 -3
- package/dist/prompt-assembly/types.d.ts +0 -7
- package/dist/prompts/default.d.ts +14 -14
- package/dist/scenarios/full-body.d.ts +15 -15
- package/dist/scenarios/full-body.js +4 -3
- package/dist/shell/lex.js +10 -1
- package/dist/stores/file/adoption/adopt.d.ts +4 -3
- package/dist/stores/file/adoption/adopt.js +27 -33
- package/dist/stores/file/adoption/marker.d.ts +6 -13
- package/dist/stores/file/adoption/marker.js +9 -17
- package/dist/stores/file/checkpoint-store.d.ts +24 -0
- package/dist/stores/file/checkpoint-store.js +45 -7
- package/dist/stores/file/file-history-store.d.ts +20 -19
- package/dist/stores/file/file-history-store.js +157 -141
- package/dist/stores/file/fs-atomic.d.ts +15 -0
- package/dist/stores/file/fs-atomic.js +89 -14
- package/dist/stores/file/index.d.ts +1 -1
- package/dist/stores/file/index.js +2 -1
- package/dist/stores/file/mailbox-store.d.ts +3 -0
- package/dist/stores/file/mailbox-store.js +3 -1
- package/dist/stores/file/permission-rule-adopt.d.ts +1 -1
- package/dist/stores/file/permission-rule-adopt.js +18 -18
- package/dist/stores/file/permission-rule-store.d.ts +18 -2
- package/dist/stores/file/permission-rule-store.js +31 -18
- package/dist/stores/file/session-policy-store.d.ts +3 -3
- package/dist/stores/file/session-store.d.ts +54 -16
- package/dist/stores/file/session-store.js +114 -85
- package/dist/stores/file/workflow-journal-store.d.ts +10 -4
- package/dist/stores/file/workflow-journal-store.js +28 -13
- package/dist/tools/artifact/artifact-text.d.ts +1 -1
- package/dist/tools/artifact/artifact-tool.js +5 -3
- package/dist/tools/fs/bash-program-position.d.ts +19 -2
- package/dist/tools/fs/bash-program-position.js +56 -9
- package/dist/tools/fs/bash-readonly-classifier.d.ts +3 -3
- package/dist/tools/fs/fs-bash.d.ts +2 -2
- package/dist/tools/fs/fs-bash.js +8 -6
- package/dist/tools/fs/fs-glob.d.ts +86 -0
- package/dist/tools/fs/fs-glob.js +226 -0
- package/dist/tools/fs/fs-read.js +14 -14
- package/dist/tools/fs/fs-search-tools.js +7 -7
- package/dist/tools/fs/fs-shared.d.ts +8 -8
- package/dist/tools/fs/gh-rate-limit.d.ts +1 -1
- package/dist/tools/fs/notebook.d.ts +2 -2
- package/dist/tools/fs/pattern-kill-guard.d.ts +22 -0
- package/dist/tools/fs/pattern-kill-guard.js +397 -0
- package/dist/tools/fs/pdf.d.ts +9 -6
- package/dist/tools/fs/pdf.js +3 -3
- package/dist/tools/fs/program-read-model.d.ts +57 -7
- package/dist/tools/fs/program-read-model.js +11 -1
- package/dist/tools/fs/program-read-model.rows.js +78 -21
- package/dist/tools/fs/read-deny-home.js +3 -2
- package/dist/tools/fs/read-deny.d.ts +29 -7
- package/dist/tools/fs/read-deny.js +63 -22
- package/dist/tools/fs/removal-targets.d.ts +18 -8
- package/dist/tools/fs/removal-targets.js +47 -20
- package/dist/tools/fs/safety.d.ts +9 -9
- package/dist/tools/fs/search.d.ts +16 -6
- package/dist/tools/fs/search.js +20 -26
- package/dist/tools/fs/shell-read-argv.js +89 -12
- package/dist/tools/fs/shell-read-bindings.d.ts +31 -0
- package/dist/tools/fs/shell-read-bindings.js +41 -0
- package/dist/tools/fs/shell-read-check.js +12 -20
- package/dist/tools/fs/shell-read-environment.d.ts +5 -1
- package/dist/tools/fs/shell-read-environment.js +3 -2
- package/dist/tools/fs/shell-read-establish.d.ts +15 -0
- package/dist/tools/fs/shell-read-establish.js +19 -20
- package/dist/tools/fs/shell-read-judge.d.ts +4 -0
- package/dist/tools/fs/shell-read-judge.js +5 -2
- package/dist/tools/fs/shell-read-plan.js +24 -16
- package/dist/tools/fs/shell-read-start.d.ts +6 -1
- package/dist/tools/fs/shell-read-write-targets.d.ts +5 -1
- package/dist/tools/fs/shell-read-write-targets.js +2 -3
- package/dist/tools/fs/shell-reentry-text.d.ts +9 -0
- package/dist/tools/fs/shell-reentry-text.js +40 -2
- package/dist/tools/loop-tick.d.ts +2 -2
- package/dist/tools/scheduler-tools.js +5 -1
- package/dist/tools/task-list.d.ts +7 -7
- package/dist/tools/task-list.js +5 -1
- package/dist/tools/todo.js +65 -64
- package/dist/tools/web.d.ts +20 -15
- package/dist/tools/web.js +55 -69
- package/dist/tools/worktree.d.ts +3 -3
- package/dist/tools/worktree.js +3 -1
- package/package.json +1 -1
- package/test/export-surface.snapshot.json +5894 -5638
- package/wire-changes/core@7.55.0.json +3318 -0
- package/wire-changes/core@7.56.0.json +3891 -0
- package/wire-changes/mods-kernel@7.56.0.json +303 -0
- package/dist/core/store-contracts/session-store-incarnation-contract.d.ts +0 -39
- package/dist/core/store-contracts/session-store-incarnation-contract.js +0 -95
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { TOOL_SPEC_MEMBERS, frozenExtra, frozenMember, newCopyState } from "../tool-spec-members.js";
|
|
2
|
+
import { RETIRED_TOOL_SPEC_KEYS, retiredKeyOf, retiredKeyRefusal } from "../retired-keys.js";
|
|
2
3
|
import { isDefineToolProduct, rebindDefineToolCtx } from "../tools.js";
|
|
4
|
+
import { isCatalogContract } from "../tool-catalog-entries.js";
|
|
5
|
+
import { attachedContractOf, computeShapeDigest, contractOriginOf, isEngineDescriptor } from "../../prompt-assembly/tool-catalog.js";
|
|
3
6
|
function specArmCanConstruct(t) {
|
|
4
7
|
if (typeof t !== "object" || t === null)
|
|
5
8
|
return false;
|
|
@@ -17,6 +20,8 @@ function faceKeys(t) {
|
|
|
17
20
|
const keys = new Set(Reflect.ownKeys(t).filter((k) => Object.getOwnPropertyDescriptor(t, k)?.enumerable === true));
|
|
18
21
|
for (const name of TOOL_SPEC_MEMBERS)
|
|
19
22
|
keys.add(name);
|
|
23
|
+
for (const name of Object.keys(RETIRED_TOOL_SPEC_KEYS))
|
|
24
|
+
keys.delete(name);
|
|
20
25
|
return [...keys];
|
|
21
26
|
}
|
|
22
27
|
const BUILDABLE = new WeakSet();
|
|
@@ -43,9 +48,42 @@ function refuseUnreadableEntry(index, entry, cause) {
|
|
|
43
48
|
e.code = "config.tool_mount_denied";
|
|
44
49
|
throw e;
|
|
45
50
|
}
|
|
51
|
+
function unmintedEngineClaim(face) {
|
|
52
|
+
const declared = face.contract?.contractId;
|
|
53
|
+
if (typeof declared === "string" && contractOriginOf(declared) === "core" && !isCatalogContract(face.contract))
|
|
54
|
+
return declared;
|
|
55
|
+
const carried = attachedContractOf(face);
|
|
56
|
+
if (carried === undefined || carried === null || typeof carried !== "object")
|
|
57
|
+
return undefined;
|
|
58
|
+
const id = carried.contractId;
|
|
59
|
+
if (carried.origin !== "core" && !(typeof id === "string" && contractOriginOf(id) === "core"))
|
|
60
|
+
return undefined;
|
|
61
|
+
const describesFace = isEngineDescriptor(carried) && carried.wireName === face.name && carried.shapeDigest === computeShapeDigest(face.parameters);
|
|
62
|
+
return describesFace ? undefined : String(id);
|
|
63
|
+
}
|
|
64
|
+
export function callerEngineContractProblem(face) {
|
|
65
|
+
const id = unmintedEngineClaim(face);
|
|
66
|
+
if (id === undefined)
|
|
67
|
+
return undefined;
|
|
68
|
+
return { code: "config.tool_face_invalid", message: `tool ${JSON.stringify(String(face.name).slice(0, 40))} declares the engine contract ${JSON.stringify(id.slice(0, 64))}, which no engine definition minted for it — a contract id under \`core.\` belongs to the engine's own definitions; declare an id of your own, or none` };
|
|
69
|
+
}
|
|
70
|
+
export function refuseRetiredMember(entry, index) {
|
|
71
|
+
if ((typeof entry !== "object" && typeof entry !== "function") || entry === null)
|
|
72
|
+
return;
|
|
73
|
+
let hit;
|
|
74
|
+
try {
|
|
75
|
+
hit = retiredKeyOf(entry, RETIRED_TOOL_SPEC_KEYS);
|
|
76
|
+
}
|
|
77
|
+
catch (cause) {
|
|
78
|
+
return refuseEntry(index, entry, cause);
|
|
79
|
+
}
|
|
80
|
+
if (hit !== undefined)
|
|
81
|
+
throw retiredKeyRefusal(hit, "ToolSpec");
|
|
82
|
+
}
|
|
46
83
|
export function rosterFaceOf(t, index) {
|
|
47
84
|
if ((typeof t !== "object" && typeof t !== "function") || t === null)
|
|
48
85
|
return t;
|
|
86
|
+
refuseRetiredMember(t, index);
|
|
49
87
|
try {
|
|
50
88
|
const product = isDefineToolProduct(t) ? t : undefined;
|
|
51
89
|
const buildable = product === undefined && specArmCanConstruct(t);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Prepared } from "./contracts.js";
|
|
2
|
+
import type { NoticeSeatInput } from "./notice-seat-input.js";
|
|
3
|
+
/** The session's announced record and the leg's receipt ledger (the parked write). */
|
|
4
|
+
export type CapabilityWithheldRecord = Pick<Prepared, "announcedListingsRef" | "frameReceipts">;
|
|
5
|
+
export declare function createCapabilityWithheldScope(ids: NoticeSeatInput, announced: CapabilityWithheldRecord): <T>(fn: () => Promise<T>) => Promise<T>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { runWithCapabilityWithheld } from "../../brain/status-sink.js";
|
|
2
|
+
import { deliverEngineNotice } from "../engine-notice.js";
|
|
3
|
+
import { announceDigest, withAnnounceDigests } from "./announce-once-ledger.js";
|
|
4
|
+
const CAPABILITY_DOWNGRADED = "model.capability_downgraded";
|
|
5
|
+
export function createCapabilityWithheldScope(ids, announced) {
|
|
6
|
+
const announce = (report) => {
|
|
7
|
+
const digest = announceDigest(CAPABILITY_DOWNGRADED, `${report.modelId}\n${report.capability}`);
|
|
8
|
+
const record = announced.announcedListingsRef;
|
|
9
|
+
if (record.advisories?.includes(digest) === true)
|
|
10
|
+
return;
|
|
11
|
+
const why = report.cause === "declared_off"
|
|
12
|
+
? `its catalog entry declares no image input (Model.input has no "image")`
|
|
13
|
+
: `its catalog entry does not declare image input, and images are not sent to an entry that does not`;
|
|
14
|
+
deliverEngineNotice(ids.onNotice, {
|
|
15
|
+
code: CAPABILITY_DOWNGRADED,
|
|
16
|
+
message: `Images in this conversation are not being sent to model "${report.modelId}": ${why}, so each image reaches the model as a one-line placeholder. ` +
|
|
17
|
+
`If the model reads images, declare it (input: ["text","image"]); otherwise switch to a model that reads images. Said once per conversation for this model.`,
|
|
18
|
+
detail: { model: report.modelId, capability: report.capability, status: report.cause, sessionId: ids.sessionId, runId: ids.runId },
|
|
19
|
+
});
|
|
20
|
+
record.advisories = withAnnounceDigests(record.advisories, [digest]);
|
|
21
|
+
announced.frameReceipts.listingSnapshotOwed = true;
|
|
22
|
+
};
|
|
23
|
+
return (fn) => runWithCapabilityWithheld(announce, fn);
|
|
24
|
+
}
|
|
@@ -99,6 +99,28 @@ export declare function classifierSeatModel(args: {
|
|
|
99
99
|
deps: Pick<RunnerDeps, "models" | "roles" | "tiers">;
|
|
100
100
|
main: Model;
|
|
101
101
|
}): ClassifierSeat;
|
|
102
|
+
/**
|
|
103
|
+
* The catalog the seat is read off. The Runner expands tier bindings into the catalog at construction and
|
|
104
|
+
* keeps that expansion PRIVATE, so the engine reaches this seat with tier words already catalog keys — a host
|
|
105
|
+
* holding its own deps does not, and the tier-relative leg (which addresses the catalog BY tier word) would
|
|
106
|
+
* find nothing and answer `main_only`. Expanding here is idempotent: an existing catalog key SHADOWS the tier
|
|
107
|
+
* binding, so a second expansion over an expanded catalog changes no key.
|
|
108
|
+
*
|
|
109
|
+
* A binding naming a model the catalog no longer carries throws in the expansion — that is the BOOT error a
|
|
110
|
+
* deployment gets from the Runner's constructor, and a seat READ must not re-raise it: this function's whole
|
|
111
|
+
* posture is that a stale reference never fails the caller ({@link classifierSeatModel}'s two `catch` arms). Such a deployment
|
|
112
|
+
* cannot construct a Runner at all, so there is no engine answer to disagree with; the raw catalog is handed
|
|
113
|
+
* on and the ordinary fallbacks name the seat.
|
|
114
|
+
*/
|
|
115
|
+
export declare function normalizeSeatDeps<T extends Pick<RunnerDeps, "models" | "tiers">>(deps: T): T;
|
|
116
|
+
/**
|
|
117
|
+
* The tier a model SITS on, as an index into `DEFAULT_TIER_ORDER` (0 = strongest): the LOWEST known tier whose
|
|
118
|
+
* expanded catalog key resolves to the same route as `model`. Read off a catalog {@link normalizeSeatDeps} expanded.
|
|
119
|
+
* The lowest, because a key synthesised for an unbound tier falls DOWN to the next bound one, so a model's lowest
|
|
120
|
+
* tier is the tier it was bound to. `undefined` when the deployment declares no tiers, or the model is on none.
|
|
121
|
+
* The one tier reading: the classifier seat and the advisor pairing both read it.
|
|
122
|
+
*/
|
|
123
|
+
export declare function tierIndexOf(deps: Pick<RunnerDeps, "models" | "tiers">, model: Model): number | undefined;
|
|
102
124
|
/**
|
|
103
125
|
* The `classifier.role_defaulted` line — minted ONCE per run by the arming, AFTER the route pre-flight, so it
|
|
104
126
|
* names the seat actually asked (a pre-flight swap to the main model is its own line,
|
|
@@ -157,14 +179,11 @@ export interface ClassifierUnavailableStation {
|
|
|
157
179
|
budgetMs?: number;
|
|
158
180
|
}
|
|
159
181
|
/**
|
|
160
|
-
* The classifier's REASONING
|
|
161
|
-
*
|
|
162
|
-
* for the answer alone)
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
* seat too: its wire carries nothing either way, so the request is the gateway's default, and a default-on
|
|
166
|
-
* gateway thinks — the arm that used to read it as "never thinks" is the one the field report was about.
|
|
167
|
-
* PER RUNG, not once per arming: the second rung is a different model with its own wire.
|
|
182
|
+
* The classifier's REASONING SEATS, read off the model a classification is actually asked on. The tier is the shared
|
|
183
|
+
* verdict ({@link lowestReasoningSeat}); the cap is the classifier's own: `off` carries the verdict-sized cap (the
|
|
184
|
+
* request pays for the answer alone), `low` carries the verdict cap plus the low allowance (spell off, or leave
|
|
185
|
+
* thinking to the provider and pay 2048). PER RUNG, not once per arming: the second rung is a different model with
|
|
186
|
+
* its own wire.
|
|
168
187
|
*
|
|
169
188
|
* The THINK seat is the RE-ASK seat ({@link classifierReplyAsksAgain}): a first attempt that produced no
|
|
170
189
|
* verdict is asked once more with thinking allowed the room of CC's stage-2 classifier (8192) — an unknown
|
|
@@ -190,13 +209,14 @@ export type ClassifierSeatRequest = typeof CLASSIFIER_OFF_SEAT | typeof CLASSIFI
|
|
|
190
209
|
* bound the engine can vouch for: a gateway may exclude reasoning tokens from `max_tokens` (a vLLM-fronted
|
|
191
210
|
* Qwen gateway answered a cap of 128 with 938 output tokens and `stop`), so an over-long think is cut by the
|
|
192
211
|
* round-trip timeout (`unavailable` / `timeout`), not by the cap (`parse_error` on an empty reply), and the
|
|
193
|
-
* two are attested as the two different facts they are.
|
|
212
|
+
* two are attested as the two different facts they are. The seat's tier is not the classifier's to decide: it reads
|
|
213
|
+
* {@link lowestReasoningSeat}, and only the cap is its own.
|
|
194
214
|
*/
|
|
195
215
|
export declare function classifierRungSeat(model: Model): typeof CLASSIFIER_OFF_SEAT | typeof CLASSIFIER_LOW_SEAT;
|
|
196
216
|
/**
|
|
197
|
-
* The user-message TAIL of each attempt —
|
|
217
|
+
* The user-message TAIL of each attempt — the reference's classifier suffixes: the FIRST attempt
|
|
198
218
|
* carries the fast-mode suffix (`$ns`: the answer must begin with `<block>`, no preamble), the RE-ASK carries
|
|
199
|
-
* the thinking-stage suffix (`Uns`: think in `<thinking>` first, then answer). The base prompt
|
|
219
|
+
* the thinking-stage suffix (`Uns`: think in `<thinking>` first, then answer). The base prompt
|
|
200
220
|
* already says "no preamble" once; upstream repeats it at the END of the user message, and it is the repeat
|
|
201
221
|
* that lands — live 2026-09-15, a Qwen 3.8 with thinking off went from 70% tagged replies (1.2–3.9k chars of
|
|
202
222
|
* "Looking at this action…" prose) to 90% at 8 output tokens with the first suffix, and the re-ask suffix
|
|
@@ -209,7 +229,7 @@ export declare const CLASSIFIER_ATTEMPT_SUFFIX: {
|
|
|
209
229
|
/** The classifier reply's answer text — every text block joined; thinking blocks are not the verdict. */
|
|
210
230
|
export declare function classifierReplyText(reply: AssistantMessage): string;
|
|
211
231
|
/**
|
|
212
|
-
*
|
|
232
|
+
* An EMPTY reply that stopped at the output cap is "unparseable" — a reply to ask for again,
|
|
213
233
|
* not a refusal and not a verdict. The engine's brains report that cut two ways: `stopReason:"length"` (an
|
|
214
234
|
* engine-shrunk cap) or `stopReason:"error"` with `errorKind:"length_empty"` (a static cap — the classifier's
|
|
215
235
|
* own). An empty reply with any OTHER stop is CC's `policy_refusal` arm: not re-asked.
|
|
@@ -243,7 +263,7 @@ export declare function classifierReplyVerdictText(reply: AssistantMessage): str
|
|
|
243
263
|
* ({@link classifierReplyTagOnly}), or text in which the reader finds no answer at all (`parse_error` of form
|
|
244
264
|
* `missing`: prose, a thinking-only reply). Not a CONFLICT (two `<block>` answers — it carries a `yes`, and a second attempt that answered `no`
|
|
245
265
|
* would erase it: the fail-closed `parse_error` it is stands) and not an empty reply with a non-cap stop
|
|
246
|
-
* (CC's refusal arm).
|
|
266
|
+
* (CC's refusal arm). The reference re-asks an unparseable reply up to `maxRetries` times; sema re-asks
|
|
247
267
|
* ONCE, on the stage-2 room, so a rung costs at most two calls. A failed reply ({@link classifierReplyFailure})
|
|
248
268
|
* is judged before this and never reaches it.
|
|
249
269
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { sameRouteIdentity } from "../../brain/route-adjudicator.js";
|
|
2
|
-
import {
|
|
2
|
+
import { lowestReasoningSeat } from "../../brain/reasoning-request.js";
|
|
3
3
|
import { AUTO_MODE_CLASSIFIER_CONTRACT_BROKEN_AFTER, AUTO_MODE_CLASSIFIER_LOW_REASONING_BUDGET_TOKENS, AUTO_MODE_CLASSIFIER_MAX_TOKENS, AUTO_MODE_CLASSIFIER_THINK_BUDGET_TOKENS } from "../auto-mode-defaults.js";
|
|
4
4
|
import { autoModeClassifierFallbackOf, parseAutoModeResponse } from "../auto-mode.js";
|
|
5
5
|
import { classifierUnavailableDispositionOf } from "../classifier-unavailable-arm.js";
|
|
@@ -44,7 +44,7 @@ export function classifierSeatModel(args) {
|
|
|
44
44
|
return { model: main, defaulted: "main_only" };
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
function normalizeSeatDeps(deps) {
|
|
47
|
+
export function normalizeSeatDeps(deps) {
|
|
48
48
|
if (deps.tiers === undefined)
|
|
49
49
|
return deps;
|
|
50
50
|
try {
|
|
@@ -54,20 +54,21 @@ function normalizeSeatDeps(deps) {
|
|
|
54
54
|
return deps;
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
export function tierIndexOf(deps, model) {
|
|
58
58
|
if (deps.tiers === undefined || Object.keys(deps.tiers).length === 0 || deps.models === undefined)
|
|
59
59
|
return undefined;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (m !== undefined && sameRouteQuietly(m, main)) {
|
|
65
|
-
mainTier = i;
|
|
66
|
-
break;
|
|
67
|
-
}
|
|
60
|
+
for (let i = DEFAULT_TIER_ORDER.length - 1; i >= 0; i--) {
|
|
61
|
+
const m = deps.models[DEFAULT_TIER_ORDER[i]];
|
|
62
|
+
if (m !== undefined && sameRouteQuietly(m, model))
|
|
63
|
+
return i;
|
|
68
64
|
}
|
|
69
|
-
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
67
|
+
function tierBelowMain(deps, main) {
|
|
68
|
+
const mainTier = tierIndexOf(deps, main);
|
|
69
|
+
if (mainTier === undefined)
|
|
70
70
|
return undefined;
|
|
71
|
+
const bound = DEFAULT_TIER_ORDER.map((tier) => deps.models?.[tier]);
|
|
71
72
|
for (let i = mainTier + 1; i < bound.length; i++) {
|
|
72
73
|
const m = bound[i];
|
|
73
74
|
if (m !== undefined && !sameRouteQuietly(m, main))
|
|
@@ -79,7 +80,7 @@ export function announceClassifierRoleDefaulted(args) {
|
|
|
79
80
|
const { seat } = args;
|
|
80
81
|
if (seat.defaulted === undefined)
|
|
81
82
|
return;
|
|
82
|
-
const spelled =
|
|
83
|
+
const spelled = lowestReasoningSeat(seat.model) === "off";
|
|
83
84
|
deliverEngineNotice(args.onNotice, {
|
|
84
85
|
code: "classifier.role_defaulted",
|
|
85
86
|
message: `no classifier role names a model — "${seat.model.id}" classifies this run (${seat.defaulted}); ` +
|
|
@@ -194,7 +195,7 @@ export const CLASSIFIER_OFF_SEAT = { reasoning: "off", maxTokens: AUTO_MODE_CLAS
|
|
|
194
195
|
export const CLASSIFIER_LOW_SEAT = { reasoning: "low", maxTokens: AUTO_MODE_CLASSIFIER_MAX_TOKENS + AUTO_MODE_CLASSIFIER_LOW_REASONING_BUDGET_TOKENS };
|
|
195
196
|
export const CLASSIFIER_THINK_SEAT = { reasoning: "low", maxTokens: AUTO_MODE_CLASSIFIER_MAX_TOKENS + AUTO_MODE_CLASSIFIER_THINK_BUDGET_TOKENS };
|
|
196
197
|
export function classifierRungSeat(model) {
|
|
197
|
-
return
|
|
198
|
+
return lowestReasoningSeat(model) === "off" ? CLASSIFIER_OFF_SEAT : CLASSIFIER_LOW_SEAT;
|
|
198
199
|
}
|
|
199
200
|
export const CLASSIFIER_ATTEMPT_SUFFIX = {
|
|
200
201
|
first: '\nErr on the side of blocking. Your ENTIRE response MUST begin with <block>. Do NOT output any analysis, reasoning, or commentary before <block>. No "Looking at..." or similar preamble.',
|
|
@@ -35,16 +35,20 @@ export declare function postureRestateOption(prepared: Prepared): Pick<MaybeComp
|
|
|
35
35
|
* of every engine frame written at a boundary, the git frame's re-assert and the compaction itself: the run continues
|
|
36
36
|
* and the failure is reported, `onError` phase `degraded`). Never throws.
|
|
37
37
|
*/
|
|
38
|
-
export declare function appendOwedPosture(prepared: Pick<Prepared, "approvalPosture" | "toolRoster" | "hookIdentity" | "session" | "reminderMark" | "postureFrameRef" | "batchHaltRef">, ask: "always" | "on_change"): Promise<void>;
|
|
38
|
+
export declare function appendOwedPosture(prepared: Pick<Prepared, "approvalPosture" | "toolRoster" | "hookIdentity" | "session" | "reminderMark" | "postureFrameRef" | "batchHaltRef" | "frameReceipts">, ask: "always" | "on_change"): Promise<void>;
|
|
39
39
|
/** The declared output style's frame as one engine-marked reminder — the one spelling every site that states it directly
|
|
40
40
|
* (a resumed leg's continuation, a boundary a queued input continues) mints. */
|
|
41
41
|
export declare function mintOutputStyleReminder(prepared: Pick<Prepared, "outputStyleFrame" | "reminderMark">): string | undefined;
|
|
42
|
+
/** Is a frame of this source already on its way to the next request (a pending receipt)? The one reading, for every
|
|
43
|
+
* collector that could state it again: the boundary bundle, the direct-write style lane and the posture writer. */
|
|
44
|
+
export declare function frameCarried(ledger: Prepared["frameReceipts"], source: Prepared["frameReceipts"]["pending"][number]["source"]): boolean;
|
|
42
45
|
/**
|
|
43
46
|
* The turn boundary's direct writes, for a boundary a request can follow: the owed posture, and the output style when
|
|
44
|
-
* the turn
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
+
* the turn's tool results do not go back as the next request (`turnOwesRequest` false) and queued input already
|
|
48
|
+
* guarantees the next one (`pendingInjectionCount`, both lanes: what can continue a run), unless that request already
|
|
49
|
+
* carries it ({@link frameCarried}). Both frames keep the posture's halt rule. The guarantee is read synchronously, at
|
|
50
|
+
* the call, before any await — a boundary with nothing queued returns the posture's own promise.
|
|
47
51
|
*/
|
|
48
|
-
export declare function appendBoundaryFrames(prepared: Pick<Prepared, "approvalPosture" | "toolRoster" | "hookIdentity" | "session" | "reminderMark" | "postureFrameRef" | "batchHaltRef" | "outputStyleFrame" | "harness">,
|
|
52
|
+
export declare function appendBoundaryFrames(prepared: Pick<Prepared, "approvalPosture" | "toolRoster" | "hookIdentity" | "session" | "reminderMark" | "postureFrameRef" | "batchHaltRef" | "outputStyleFrame" | "harness" | "frameReceipts">, turnOwesRequest: boolean): Promise<void>;
|
|
49
53
|
/** Every post-compaction restatement the turn boundary registers, at one spread site. */
|
|
50
|
-
export declare function compactionRestateOptions(prepared: Prepared): Pick<MaybeCompactOptions, "gitRestate" | "postureRestate">;
|
|
54
|
+
export declare function compactionRestateOptions(prepared: Prepared): Pick<MaybeCompactOptions, "gitRestate" | "postureRestate" | "advisorRestate">;
|
|
@@ -4,6 +4,7 @@ import { mintSystemReminder } from "../reminder-mint.js";
|
|
|
4
4
|
import { thrownText } from "../thrown-value.js";
|
|
5
5
|
import { rosterEntryNamed } from "../tool-roster.js";
|
|
6
6
|
import { sanitizeUntrustedText } from "../untrusted-text.js";
|
|
7
|
+
import { appendAdvisorRestate } from "./advisor-instructions.js";
|
|
7
8
|
import { gitRestateOption } from "./git-leg-delivery.js";
|
|
8
9
|
import { attachmentEnvelopeTags } from "./turn-attachments.js";
|
|
9
10
|
export function postureFactsOf(prepared) {
|
|
@@ -44,6 +45,8 @@ export function postureRestateOption(prepared) {
|
|
|
44
45
|
};
|
|
45
46
|
}
|
|
46
47
|
export async function appendOwedPosture(prepared, ask) {
|
|
48
|
+
if (frameCarried(prepared.frameReceipts, "posture"))
|
|
49
|
+
return;
|
|
47
50
|
const ref = prepared.postureFrameRef;
|
|
48
51
|
const text = await owedPostureText(prepared, ask);
|
|
49
52
|
if (text === undefined) {
|
|
@@ -88,11 +91,14 @@ async function appendOutputStyleRestate(prepared) {
|
|
|
88
91
|
}
|
|
89
92
|
}
|
|
90
93
|
}
|
|
91
|
-
export function
|
|
92
|
-
|
|
94
|
+
export function frameCarried(ledger, source) {
|
|
95
|
+
return ledger.pending.some((r) => r.source === source);
|
|
96
|
+
}
|
|
97
|
+
export function appendBoundaryFrames(prepared, turnOwesRequest) {
|
|
98
|
+
const styleOwed = prepared.outputStyleFrame !== undefined && !turnOwesRequest && prepared.batchHaltRef.current === undefined && !frameCarried(prepared.frameReceipts, "output_style") && prepared.harness.pendingInjectionCount() > 0;
|
|
93
99
|
const posture = appendOwedPosture(prepared, "on_change");
|
|
94
100
|
return styleOwed ? posture.then(() => appendOutputStyleRestate(prepared)) : posture;
|
|
95
101
|
}
|
|
96
102
|
export function compactionRestateOptions(prepared) {
|
|
97
|
-
return { ...gitRestateOption(prepared), ...postureRestateOption(prepared) };
|
|
103
|
+
return { ...gitRestateOption(prepared), ...postureRestateOption(prepared), ...(prepared.advisorInstruction?.mounted === true ? { advisorRestate: () => appendAdvisorRestate(prepared) } : {}) };
|
|
98
104
|
}
|
|
@@ -3,6 +3,7 @@ import { checkedMediaByteCap } from "../media-byte-cap.js";
|
|
|
3
3
|
import { receiptRefusal, receiveOwnProperties, refuseProxy } from "../own-property-receipt.js";
|
|
4
4
|
import { assertNoRetiredRunnerDeps } from "./retired-runner-deps.js";
|
|
5
5
|
import { copyReadDenySeat, READ_DENY_DEPLOYMENT_SEATS } from "../read-face-seats.js";
|
|
6
|
+
import { receiveHostFloor } from "../host-floor.js";
|
|
6
7
|
import { holdOwnCredentialValues } from "../secret-env.js";
|
|
7
8
|
export function retainRunnerDeps(deps) {
|
|
8
9
|
const words = { subject: "RunnerDeps", unit: "seat", moment: "at new Runner" };
|
|
@@ -15,6 +16,8 @@ export function retainRunnerDeps(deps) {
|
|
|
15
16
|
if (Object.hasOwn(retained, seat))
|
|
16
17
|
Object.defineProperty(retained, seat, { value: copyReadDenySeat(Reflect.get(retained, seat)), enumerable: true, writable: true, configurable: true });
|
|
17
18
|
}
|
|
19
|
+
if (Object.hasOwn(retained, "hostFloor"))
|
|
20
|
+
Object.defineProperty(retained, "hostFloor", { value: receiveHostFloor(Reflect.get(retained, "hostFloor")), enumerable: true, writable: true, configurable: true });
|
|
18
21
|
let consolidationKey;
|
|
19
22
|
try {
|
|
20
23
|
const chat = retained.memoryConsolidationDriver?.chat;
|
|
@@ -17,7 +17,7 @@ import type { HumanReviewGateRow } from "../task-result.js";
|
|
|
17
17
|
import type { RepairBundle } from "../../agents/repair-loop.js";
|
|
18
18
|
import type { SubagentRetainLedger } from "../../agents/retain-ledger.js";
|
|
19
19
|
import type { BrainCallGuardrailRef } from "../../brain/timeout.js";
|
|
20
|
-
import type { ActiveWorktreeSession, AgentHarness, AgentMessage, AgentTool, AnnouncedListingSnapshotInput, ExecutionEnv, ThinkingLevel } from "../../internal/harness.js";
|
|
20
|
+
import type { ActiveWorktreeSession, AgentHarness, AgentMessage, AgentTool, AnnouncedListingSnapshotInput, AnnouncedMcpFailure, ExecutionEnv, ThinkingLevel } from "../../internal/harness.js";
|
|
21
21
|
import type { Model } from "../../internal/llm.js";
|
|
22
22
|
import type { WorkflowSizeGuideline } from "../../orchestration/workflow-size-guideline.js";
|
|
23
23
|
import type { ToolManifestRow } from "../../prompt-assembly/tool-catalog.js";
|
|
@@ -232,9 +232,9 @@ export interface DateAnchorRead {
|
|
|
232
232
|
export interface FrameReceipt {
|
|
233
233
|
/** The carrying message's exact text (its first text block) — the receipt's match key. */
|
|
234
234
|
text: string;
|
|
235
|
-
/** Which frame this receipt settles.
|
|
236
|
-
*
|
|
237
|
-
source: "git_status" | "agent_listing" | "skills_listing" | "date_change" | "output_style" | "approval_feedback";
|
|
235
|
+
/** Which frame this receipt settles. No collector renders a frame whose receipt is still pending (the frame is on
|
|
236
|
+
* its way, not yet in the transcript) — the one reading is `frameCarried` (compaction-restate.ts). */
|
|
237
|
+
source: "git_status" | "agent_listing" | "skills_listing" | "date_change" | "output_style" | "mcp_unavailable" | "posture" | "approval_feedback" | "advisor_tool";
|
|
238
238
|
/** Runs inside the `message_end` walk (synchronous, never awaited): advances the run-local record
|
|
239
239
|
* and parks any session write for the next serialization point. */
|
|
240
240
|
commit: (entryId: string) => void;
|
|
@@ -291,6 +291,8 @@ export interface Prepared {
|
|
|
291
291
|
* prepare emits run-scoped disclosures of its own and each must have a terminal that names it.
|
|
292
292
|
*/
|
|
293
293
|
runId: string;
|
|
294
|
+
/** The deployment's host floor as the config doors compiled it (absent ⇒ none declared) — the task images' guard reads it. */
|
|
295
|
+
hostFloor?: import("../host-floor.js").HostFloor;
|
|
294
296
|
/** The (owner, scope) key this run's registry-facing tools register rows under — (host task id, mount domain), minted once at prepare; the teardown sweeps read it and never re-derive it. */
|
|
295
297
|
registryAccess: {
|
|
296
298
|
readonly owner: string;
|
|
@@ -472,13 +474,15 @@ export interface Prepared {
|
|
|
472
474
|
readonly args: unknown;
|
|
473
475
|
readonly admit: () => void;
|
|
474
476
|
}>;
|
|
477
|
+
/** The leg's `tool.call` station (`mods/tool-call.ts`) — every execution of a call passes it; absent when no handler hangs on the event. */
|
|
478
|
+
toolCallStation?: import("../mods/tool-call.js").ToolCallStation;
|
|
475
479
|
/** The leg's shell READ STATION, re-run on a durable RESUME before an approved shell call executes: the parked leg's
|
|
476
480
|
* admission died with that leg, so the resumed bytes are judged (and admitted for their pre-spawn re-establishment)
|
|
477
481
|
* on THIS leg — a deny row found now vetoes, an operator's edit is judged on the `rejudge` seat. */
|
|
478
482
|
shellReadCheck?: import("../../tools/fs/shell-read-check.js").ShellReadCheck;
|
|
479
483
|
crossBoundary?: {
|
|
480
484
|
readonly check: import("../cross-boundary-taint.js").CrossBoundaryCheck | undefined;
|
|
481
|
-
settle(): Promise<void>;
|
|
485
|
+
settle(owed: import("../cross-boundary-taint.js").OwedDeliveries): Promise<void>;
|
|
482
486
|
storeWaits(): number;
|
|
483
487
|
};
|
|
484
488
|
/** The ORG adjudication face, re-resolved on a durable RESUME before an approved
|
|
@@ -1007,6 +1011,11 @@ export interface Prepared {
|
|
|
1007
1011
|
* calls themselves never pass through the recorded seam (they ride the separate compaction-brain
|
|
1008
1012
|
* wrapper), so the snapshot is never polluted by a summary request. */
|
|
1009
1013
|
lastBrainContext: () => CompactionForkContext | undefined;
|
|
1014
|
+
/** The same recorded request, unconditionally — the one write {@link lastBrainContext} also reads, minus its lossy-projection
|
|
1015
|
+
* exclusion: what the main lane last actually sent (the advisor's projection reads it). `undefined` until the first call. */
|
|
1016
|
+
lastSentRequest: () => CompactionForkContext | undefined;
|
|
1017
|
+
/** The leg's advisor-instructions seat (advisor-instructions.ts); absent when the leg neither mounts the advisor nor has told the model of it. */
|
|
1018
|
+
advisorInstruction?: import("./advisor-instructions.js").AdvisorInstructionSeat;
|
|
1010
1019
|
/** The post-compaction restore (`MaybeCompactOptions.workingFileAttachments.restore`): re-reads the candidates through
|
|
1011
1020
|
* the leg's one file reader under the run's synthetic-Read judge — the user attachment's own path read — deduplicated
|
|
1012
1021
|
* against the read state the summary leaves, and mints their attachment frames (`readCompactionRestore`); a file it
|
|
@@ -1030,7 +1039,7 @@ export interface Prepared {
|
|
|
1030
1039
|
* result from a stub hit whose original full transmission may already be summarized away. Present
|
|
1031
1040
|
* only with hands. */
|
|
1032
1041
|
isDedupStubResult?: (resultText: string) => boolean;
|
|
1033
|
-
/** Wired to `MaybeCompactOptions.onApplied` by every compaction lane (
|
|
1042
|
+
/** Wired to `MaybeCompactOptions.onApplied` by every compaction lane (the reference clears readFileState at its
|
|
1034
1043
|
* compaction landing site, @388663). Drops every read-state entry the summary took out of view
|
|
1035
1044
|
* (`readFileStateAfterSummary`); the restored files then re-register through their frames' own commits. Present
|
|
1036
1045
|
* only with hands. `preserveReadState` carries the files the context the summary leaves still shows — their
|
|
@@ -1135,31 +1144,29 @@ export interface Prepared {
|
|
|
1135
1144
|
* turn boundary. Appended by the rematerialize diff (newly-activated names only — the announced set
|
|
1136
1145
|
* is seeded with prepare-time actives INCLUDING resume-reseeded ones, so a resume never replays);
|
|
1137
1146
|
* DRAINED by the run loop only when the `tools_delta` attachment actually survived the byte cap.
|
|
1138
|
-
* Present when the task has deferred tools at all
|
|
1139
|
-
* to connect, so the failure is announceable even on a task whose every MCP tool went missing with it.
|
|
1147
|
+
* Present when the task has deferred tools at all.
|
|
1140
1148
|
*
|
|
1141
|
-
* The same frame's MCP arms, filled by the SAME rematerialize seam
|
|
1142
|
-
* projection and drained by the same intact-survival predicate:
|
|
1149
|
+
* The same frame's MCP arms, filled by the SAME rematerialize seam and drained by the same intact-survival predicate:
|
|
1143
1150
|
* - `pendingRemoved`: previously-ANNOUNCED tool names that left the live roster (a RefreshMcpTools
|
|
1144
1151
|
* re-splice whose server withdrew them). CC `removedNames`.
|
|
1145
1152
|
* - `pendingReadded`: names in `pendingRemoved`'s history that came back on a later refresh. CC
|
|
1146
|
-
* `readdedNames`.
|
|
1147
|
-
* - `pendingFailed`: declared servers whose connect failed at materialize (`statuses`), name/error
|
|
1148
|
-
* neutralized + bounded at intake, MINUS the pairs this session's record already announced (CC
|
|
1149
|
-
* `failedMcpServers` compared against the previous attachment — a serving layer runs prepare once
|
|
1150
|
-
* per user message, so the per-run set alone re-announced every message). */
|
|
1153
|
+
* `readdedNames`. */
|
|
1151
1154
|
toolsDeltaRef?: {
|
|
1152
1155
|
pending: string[];
|
|
1153
1156
|
pendingRemoved: string[];
|
|
1154
1157
|
pendingReadded: string[];
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1158
|
+
};
|
|
1159
|
+
/** The `mcp_unavailable` frame's pending servers: declared servers whose dial failed at materialize (`statuses`), name/error
|
|
1160
|
+
* neutralized + bounded at intake, MINUS the pairs this session's record already announced (a serving layer runs prepare once
|
|
1161
|
+
* per user message, so the per-run set alone would re-announce every message). Present when at least one is pending — a
|
|
1162
|
+
* task whose every MCP tool went missing with its server is exactly the one that must say so. Carried by the leg's first
|
|
1163
|
+
* request (a fresh leg's first message, a resumed leg's continuation) and drained by that message's receipt (`settleMcpUnavailable`). */
|
|
1164
|
+
mcpUnavailable?: {
|
|
1165
|
+
pending: AnnouncedMcpFailure[];
|
|
1159
1166
|
};
|
|
1160
1167
|
/** G1 通告层续批 (CC `agent_listing_delta` parity) — the mounted delegation tool's agent-type roster
|
|
1161
1168
|
* (read off `ToolSpec.agentListing`, filled by createSubagentTool), plus the tool's mounted name for
|
|
1162
|
-
* the
|
|
1169
|
+
* the roster headers. [c209-C]: this seam is now the roster's ONLY model-facing carrier —
|
|
1163
1170
|
* the run loop delivers the initial full frame ON THE FIRST USER TURN (prompt-adjacent) and
|
|
1164
1171
|
* boundary drift deltas after. `models` (Q4, read off `ToolSpec.agentModels`) rides the initial
|
|
1165
1172
|
* frame's tail line. `seedAnnounced` = a durable-resume leg: the run loop seeds the producer's
|
|
@@ -1195,7 +1202,7 @@ export interface Prepared {
|
|
|
1195
1202
|
* catalog change across a suspend is re-announced as a "Models available…" drift line.
|
|
1196
1203
|
* `mcpFailed` / `advisories` are the once-per-SESSION arms of the same snapshot (see
|
|
1197
1204
|
* announce-once-ledger.ts): seeded at prepare from the branch's record, advanced by the run loop
|
|
1198
|
-
* on
|
|
1205
|
+
* on delivery of the mcp_unavailable frame / intact delivery of the mcp_dropped_tools frame. */
|
|
1199
1206
|
announcedListingsRef: AnnouncedListingSnapshotInput;
|
|
1200
1207
|
/** The frame-receipt ledger — the ONE commit point of every engine frame that rides a user message
|
|
1201
1208
|
* (the git-status frame, the agent and skills listing frames). Always present; per leg. */
|
|
@@ -1208,10 +1215,11 @@ export interface Prepared {
|
|
|
1208
1215
|
gitStatusRef: GitStatusLaneRef;
|
|
1209
1216
|
/** The posture composition's run-local half (the newest carrier's protection slot; the row last composed for). */
|
|
1210
1217
|
postureFrameRef: import("../auto-mode-directive.js").PostureFrameRef;
|
|
1211
|
-
/** G1 通告层 — narrow
|
|
1212
|
-
* pending/running
|
|
1213
|
-
* use), as a
|
|
1214
|
-
*
|
|
1218
|
+
/** G1 通告层 — narrow getter over the process task registry: THIS run's visible live background tasks
|
|
1219
|
+
* (pending / running / parked under the same owner/scope/session identity the TaskOutput/TaskStop tools
|
|
1220
|
+
* use), EVERY one (`TaskRegistry.liveTasks`), as a projection (id/description/status — never
|
|
1221
|
+
* handles/env/abort). Read by the post-compact listing (which caps what it renders), the resume's orphan
|
|
1222
|
+
* diff and the stop hook's `backgroundTasks` view. */
|
|
1215
1223
|
listBackgroundTasks: () => Array<{
|
|
1216
1224
|
id: string;
|
|
1217
1225
|
description?: string;
|
|
@@ -1581,8 +1589,6 @@ export interface PromptFeatureFlags {
|
|
|
1581
1589
|
writeFaceOpen: boolean;
|
|
1582
1590
|
orchestrationEnabled: boolean;
|
|
1583
1591
|
orchestrationDeferred: boolean;
|
|
1584
|
-
promptProfile: "simple" | "classic";
|
|
1585
|
-
fableMitigations: boolean;
|
|
1586
1592
|
goalEnabled: boolean;
|
|
1587
1593
|
awarenessEnabled: boolean;
|
|
1588
1594
|
worktreeIsolated: boolean;
|
|
@@ -1790,6 +1796,10 @@ export interface RunInternals {
|
|
|
1790
1796
|
outcome?: ResumeOutcome;
|
|
1791
1797
|
inheritedGate?: InheritedGate;
|
|
1792
1798
|
}>;
|
|
1799
|
+
/** The deployment's credential for the claim this run acts under (an opaque grant id; a TRUSTED channel like the decisions above).
|
|
1800
|
+
* A resume handed one carries it into its CAS as `expect.holder` (the store judges it; a superseded grant is
|
|
1801
|
+
* `resume.holder_superseded`, nothing applied), and so does every Workflow drive this run makes. Never inherited by children. */
|
|
1802
|
+
holder?: string;
|
|
1793
1803
|
/**
|
|
1794
1804
|
* Set ONLY by the Agent tool's fork route (`Agent(subagent_type:"fork")`, a core caller) on the
|
|
1795
1805
|
* child it spawns: this run IS a forked child. `prepareTask` threads it to tool ctx as `insideFork` so the
|
|
@@ -1839,8 +1849,8 @@ export interface RunInternals {
|
|
|
1839
1849
|
* `spec.systemPrompt ?? resolvedRole.systemPrompt ?? internals.defaultSystemPrompt` — so a deployment's
|
|
1840
1850
|
* `roles.subagent.systemPrompt` / `roles.default.systemPrompt` preset still wins (pre-G1 semantics: an
|
|
1841
1851
|
* unset child systemPrompt let the role preset apply; G1's first cut put SUBAGENT_PROMPT at spec level
|
|
1842
|
-
* and silently shadowed the preset). Only when NO preset resolves does the lean SUBAGENT_PROMPT (
|
|
1843
|
-
*
|
|
1852
|
+
* and silently shadowed the preset). Only when NO preset resolves does the lean SUBAGENT_PROMPT (general-purpose
|
|
1853
|
+
* persona) replace the full DEFAULT_SYSTEM_PROMPT constitution base.
|
|
1844
1854
|
* TRUSTED run-scoped channel (NOT a {@link TaskSpec} field), mirroring `insideFork`.
|
|
1845
1855
|
*/
|
|
1846
1856
|
defaultSystemPrompt?: string;
|
|
@@ -2044,8 +2054,6 @@ export interface RunInternals {
|
|
|
2044
2054
|
parentCenterArtifactDigest?: string;
|
|
2045
2055
|
/** Publish provenance companion of {@link parentCenterArtifactDigest} (audit only). */
|
|
2046
2056
|
parentCenterSourceRevision?: string;
|
|
2047
|
-
/** R2 双形轴 — parent's resolved prompt profile, inherited unless the child spec overrides. */
|
|
2048
|
-
promptProfile?: "simple" | "classic";
|
|
2049
2057
|
/**
|
|
2050
2058
|
* An OPT-IN, DISPLAY-ONLY event sink a deployment sets on the TOP run to
|
|
2051
2059
|
* receive a subagent's live `task_progress` ticks (which otherwise stay in the child's ISOLATED stream). Threaded
|
|
@@ -2149,7 +2157,7 @@ export interface RunInternals {
|
|
|
2149
2157
|
* Hands THIS run's notification injector back to the SPAWNER once the lane is
|
|
2150
2158
|
* live (runtask calls it with its wrapped `injectTaskNotification`). The spawner stores it on the
|
|
2151
2159
|
* child's registry handle so a parent/sibling SendMessage can deliver TO the RUNNING child at its
|
|
2152
|
-
* next turn boundary (
|
|
2160
|
+
* next turn boundary (the in-memory `pendingMessages` pedestal,
|
|
2153
2161
|
* messaging-runtime.md §2.5). The injector outlives its run safely: once this lane is over the frame
|
|
2154
2162
|
* is routed to whatever run the SESSION has live, and only a session with no live run parks it
|
|
2155
2163
|
* (PendingSessionNotifications) — exactly CC's durable-mailbox posture for an idle teammate (§2.4).
|
|
@@ -2529,7 +2537,6 @@ export interface RunState {
|
|
|
2529
2537
|
* requested id — surfaced on `turn_end.responseModel`, reset with the rest of the per-turn
|
|
2530
2538
|
* bookkeeping. Same shape as `turnStopReason`: last-message-wins, absent by default. */
|
|
2531
2539
|
turnResponseModel: string | undefined;
|
|
2532
|
-
lastTurnHadToolCalls: boolean;
|
|
2533
2540
|
/** B15 三期使能:postToolBatch 的本回合聚集批(每回合边界消费并重置 — 回合语义,故归 turn)。 */
|
|
2534
2541
|
toolBatch: PostToolBatchCall[];
|
|
2535
2542
|
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { SessionTreeEntry } from "../../internal/harness-types.js";
|
|
2
|
+
import type { DateAnchorRead } from "./contracts.js";
|
|
3
|
+
/** The id of the active branch's latest compaction entry — the segment a fact is recorded for — or `null` before any. */
|
|
4
|
+
export declare function conversationSegmentOf(branch: ReadonlyArray<SessionTreeEntry>): string | null;
|
|
5
|
+
/** The custom-entry kind that carries the session's date anchor (engine-owned; never model-visible). */
|
|
6
|
+
export declare const DATE_ANCHOR_CUSTOM_TYPE = "engine:date-anchor";
|
|
7
|
+
/**
|
|
8
|
+
* Read the session's date anchor off the active branch: the nearest anchor entry NEWER than the nearest
|
|
9
|
+
* compaction, honored only when it was written for that same segment. An anchor written by a leg whose
|
|
10
|
+
* prefix predates a compaction that landed in between therefore reads as absent — the one rule that makes a
|
|
11
|
+
* compaction re-anchor the date. An unreadable branch returns undefined (the leg renders today, writes nothing).
|
|
12
|
+
*/
|
|
13
|
+
export declare function readDateAnchor(session: {
|
|
14
|
+
getBranch(): Promise<ReadonlyArray<SessionTreeEntry>>;
|
|
15
|
+
}): Promise<DateAnchorRead | undefined>;
|
|
16
|
+
/**
|
|
17
|
+
* The anchor write a leg owes when it settles, or undefined: owed when prepare found no anchor for the segment
|
|
18
|
+
* (the leg rendered today) or the model has since been told a newer date; never after an unreadable branch.
|
|
19
|
+
* Best-effort — a lost write costs one re-rendered prefix or one repeated reminder next leg, never a wrong date.
|
|
20
|
+
*/
|
|
21
|
+
export declare function owedDateAnchor(session: {
|
|
22
|
+
appendCustomEntry(customType: string, data?: unknown): Promise<string>;
|
|
23
|
+
}, seat: {
|
|
24
|
+
legDate: string;
|
|
25
|
+
anchor: DateAnchorRead | undefined;
|
|
26
|
+
} | undefined, state: {
|
|
27
|
+
announcedDate: string;
|
|
28
|
+
} | undefined): (() => Promise<void>) | undefined;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export function conversationSegmentOf(branch) {
|
|
2
|
+
for (let i = branch.length - 1; i >= 0; i--)
|
|
3
|
+
if (branch[i].type === "compaction")
|
|
4
|
+
return branch[i].id;
|
|
5
|
+
return null;
|
|
6
|
+
}
|
|
7
|
+
export const DATE_ANCHOR_CUSTOM_TYPE = "engine:date-anchor";
|
|
8
|
+
const ISO_DATE = /^\d{4}-\d{2}-\d{2}$/;
|
|
9
|
+
function normalizeDateAnchor(v) {
|
|
10
|
+
if (typeof v !== "object" || v === null)
|
|
11
|
+
return undefined;
|
|
12
|
+
const { prefixDate, announcedDate, segment } = v;
|
|
13
|
+
if (typeof prefixDate !== "string" || !ISO_DATE.test(prefixDate) || typeof announcedDate !== "string" || !ISO_DATE.test(announcedDate))
|
|
14
|
+
return undefined;
|
|
15
|
+
if (segment !== null && (typeof segment !== "string" || segment.length > 200))
|
|
16
|
+
return undefined;
|
|
17
|
+
return { prefixDate, announcedDate, segment };
|
|
18
|
+
}
|
|
19
|
+
export async function readDateAnchor(session) {
|
|
20
|
+
let branch;
|
|
21
|
+
try {
|
|
22
|
+
branch = await session.getBranch();
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
let found;
|
|
28
|
+
for (let i = branch.length - 1; i >= 0 && branch[i].type !== "compaction"; i--) {
|
|
29
|
+
const e = branch[i];
|
|
30
|
+
if (found === undefined && e.type === "custom" && e.customType === DATE_ANCHOR_CUSTOM_TYPE)
|
|
31
|
+
found = normalizeDateAnchor(e.data);
|
|
32
|
+
}
|
|
33
|
+
const segment = conversationSegmentOf(branch);
|
|
34
|
+
return { current: found !== undefined && found.segment === segment ? { prefixDate: found.prefixDate, announcedDate: found.announcedDate } : undefined, segment };
|
|
35
|
+
}
|
|
36
|
+
export function owedDateAnchor(session, seat, state) {
|
|
37
|
+
const read = seat?.anchor;
|
|
38
|
+
if (read === undefined || state === undefined || read.current?.announcedDate === state.announcedDate)
|
|
39
|
+
return undefined;
|
|
40
|
+
const data = { prefixDate: seat.legDate, announcedDate: state.announcedDate, segment: read.segment };
|
|
41
|
+
return () => session.appendCustomEntry(DATE_ANCHOR_CUSTOM_TYPE, data).then(() => undefined, () => undefined);
|
|
42
|
+
}
|