agentfootprint 18.2.0 → 19.0.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/CAPABILITIES.md +3 -0
- package/dist/adapters/llm/AnthropicProvider.js +4 -0
- package/dist/adapters/llm/AnthropicProvider.js.map +1 -1
- package/dist/adapters/llm/BrowserAnthropicProvider.js +4 -0
- package/dist/adapters/llm/BrowserAnthropicProvider.js.map +1 -1
- package/dist/adapters/llm/InvokeModelGatewayProvider.js +18 -21
- package/dist/adapters/llm/InvokeModelGatewayProvider.js.map +1 -1
- package/dist/adapters/llm/anthropicModels.js +72 -4
- package/dist/adapters/llm/anthropicModels.js.map +1 -1
- package/dist/adapters/observability/auditShapes/events/decisions.js +19 -0
- package/dist/adapters/observability/auditShapes/events/decisions.js.map +1 -1
- package/dist/core/agent/contextBinding/check.js +141 -0
- package/dist/core/agent/contextBinding/check.js.map +1 -0
- package/dist/core/agent/contextBinding/compare.js +84 -0
- package/dist/core/agent/contextBinding/compare.js.map +1 -0
- package/dist/core/agent/contextBinding/composition.js +87 -0
- package/dist/core/agent/contextBinding/composition.js.map +1 -0
- package/dist/core/agent/contextBinding/forCall.js +41 -0
- package/dist/core/agent/contextBinding/forCall.js.map +1 -0
- package/dist/core/agent/runValues.js +1 -0
- package/dist/core/agent/runValues.js.map +1 -1
- package/dist/core/agent/runtime/configuration/configure.js +6 -0
- package/dist/core/agent/runtime/configuration/configure.js.map +1 -1
- package/dist/core/agent/runtime/configuration/values.js.map +1 -1
- package/dist/core/agent/runtime/native/initialize.js +1 -0
- package/dist/core/agent/runtime/native/initialize.js.map +1 -1
- package/dist/core/agent/runtime/request/factory.js +1 -0
- package/dist/core/agent/runtime/request/factory.js.map +1 -1
- package/dist/core/agent/stages/callLLM/prepareCall.js +13 -0
- package/dist/core/agent/stages/callLLM/prepareCall.js.map +1 -1
- package/dist/core/agent/stages/callLLM.js +2 -0
- package/dist/core/agent/stages/callLLM.js.map +1 -1
- package/dist/esm/adapters/llm/AnthropicProvider.d.ts +16 -0
- package/dist/esm/adapters/llm/AnthropicProvider.js +5 -1
- package/dist/esm/adapters/llm/AnthropicProvider.js.map +1 -1
- package/dist/esm/adapters/llm/BrowserAnthropicProvider.d.ts +9 -0
- package/dist/esm/adapters/llm/BrowserAnthropicProvider.js +5 -1
- package/dist/esm/adapters/llm/BrowserAnthropicProvider.js.map +1 -1
- package/dist/esm/adapters/llm/InvokeModelGatewayProvider.d.ts +10 -8
- package/dist/esm/adapters/llm/InvokeModelGatewayProvider.js +19 -22
- package/dist/esm/adapters/llm/InvokeModelGatewayProvider.js.map +1 -1
- package/dist/esm/adapters/llm/anthropicModels.d.ts +37 -0
- package/dist/esm/adapters/llm/anthropicModels.js +70 -3
- package/dist/esm/adapters/llm/anthropicModels.js.map +1 -1
- package/dist/esm/adapters/observability/auditShapes/events/decisions.js +19 -0
- package/dist/esm/adapters/observability/auditShapes/events/decisions.js.map +1 -1
- package/dist/esm/core/agent/contextBinding/check.d.ts +68 -0
- package/dist/esm/core/agent/contextBinding/check.js +135 -0
- package/dist/esm/core/agent/contextBinding/check.js.map +1 -0
- package/dist/esm/core/agent/contextBinding/compare.d.ts +13 -0
- package/dist/esm/core/agent/contextBinding/compare.js +80 -0
- package/dist/esm/core/agent/contextBinding/compare.js.map +1 -0
- package/dist/esm/core/agent/contextBinding/composition.d.ts +54 -0
- package/dist/esm/core/agent/contextBinding/composition.js +79 -0
- package/dist/esm/core/agent/contextBinding/composition.js.map +1 -0
- package/dist/esm/core/agent/contextBinding/forCall.d.ts +23 -0
- package/dist/esm/core/agent/contextBinding/forCall.js +36 -0
- package/dist/esm/core/agent/contextBinding/forCall.js.map +1 -0
- package/dist/esm/core/agent/runValues.d.ts +3 -0
- package/dist/esm/core/agent/runValues.js +1 -0
- package/dist/esm/core/agent/runValues.js.map +1 -1
- package/dist/esm/core/agent/runtime/configuration/configure.js +6 -0
- package/dist/esm/core/agent/runtime/configuration/configure.js.map +1 -1
- package/dist/esm/core/agent/runtime/configuration/types.d.ts +5 -1
- package/dist/esm/core/agent/runtime/configuration/values.d.ts +1 -0
- package/dist/esm/core/agent/runtime/configuration/values.js.map +1 -1
- package/dist/esm/core/agent/runtime/native/initialize.js +1 -0
- package/dist/esm/core/agent/runtime/native/initialize.js.map +1 -1
- package/dist/esm/core/agent/runtime/request/factory.js +1 -0
- package/dist/esm/core/agent/runtime/request/factory.js.map +1 -1
- package/dist/esm/core/agent/stages/callLLM/prepareCall.d.ts +1 -0
- package/dist/esm/core/agent/stages/callLLM/prepareCall.js +13 -0
- package/dist/esm/core/agent/stages/callLLM/prepareCall.js.map +1 -1
- package/dist/esm/core/agent/stages/callLLM/types.d.ts +6 -0
- package/dist/esm/core/agent/stages/callLLM.js +2 -0
- package/dist/esm/core/agent/stages/callLLM.js.map +1 -1
- package/dist/esm/core/agent/types/observation.d.ts +34 -1
- package/dist/esm/events/payloads/contextChange.d.ts +68 -0
- package/dist/esm/events/payloads/contextChange.js +2 -0
- package/dist/esm/events/payloads/contextChange.js.map +1 -0
- package/dist/esm/events/payloads/stream.d.ts +13 -0
- package/dist/esm/events/payloads.d.ts +1 -0
- package/dist/esm/hosting/durability.d.ts +10 -0
- package/dist/esm/hosting/durability.js +54 -30
- package/dist/esm/hosting/durability.js.map +1 -1
- package/dist/esm/hosting/standingAgent/artifacts/accountParts.d.ts +3 -2
- package/dist/esm/hosting/standingAgent/artifacts/accountParts.js +9 -4
- package/dist/esm/hosting/standingAgent/artifacts/accountParts.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/observe.d.ts +1 -1
- package/dist/esm/observe.js.map +1 -1
- package/dist/esm/provider-contract/requestRefusal.js +3 -1
- package/dist/esm/provider-contract/requestRefusal.js.map +1 -1
- package/dist/esm/provider-contract/thinkingBinding.d.ts +20 -0
- package/dist/esm/provider-contract/thinkingBinding.js +27 -0
- package/dist/esm/provider-contract/thinkingBinding.js.map +1 -0
- package/dist/esm/provider-contract/types/provider.d.ts +43 -0
- package/dist/esm/provider-contract/types.d.ts +1 -1
- package/dist/esm/provider-contract/types.js.map +1 -1
- package/dist/esm/providers.d.ts +2 -0
- package/dist/esm/providers.js +2 -0
- package/dist/esm/providers.js.map +1 -1
- package/dist/esm/recorders/observability/FlowchartRecorder.d.ts +8 -120
- package/dist/esm/recorders/observability/FlowchartRecorder.js +16 -0
- package/dist/esm/recorders/observability/FlowchartRecorder.js.map +1 -1
- package/dist/esm/recorders/observability/boundaryRecorder/domainEvents.d.ts +9 -0
- package/dist/esm/recorders/observability/recordingParts/format.d.ts +87 -12
- package/dist/esm/recorders/observability/recordingParts/format.js +136 -17
- package/dist/esm/recorders/observability/recordingParts/format.js.map +1 -1
- package/dist/esm/recorders/observability/recordingParts/open.d.ts +41 -7
- package/dist/esm/recorders/observability/recordingParts/open.js +32 -6
- package/dist/esm/recorders/observability/recordingParts/open.js.map +1 -1
- package/dist/esm/recorders/observability/recordingParts/partReader.d.ts +25 -2
- package/dist/esm/recorders/observability/recordingParts/partReader.js +183 -15
- package/dist/esm/recorders/observability/recordingParts/partReader.js.map +1 -1
- package/dist/esm/recorders/observability/recordingParts/split.d.ts +13 -0
- package/dist/esm/recorders/observability/recordingParts/split.js +135 -26
- package/dist/esm/recorders/observability/recordingParts/split.js.map +1 -1
- package/dist/esm/recorders/observability/recordingParts/subflowPayloads.d.ts +124 -0
- package/dist/esm/recorders/observability/recordingParts/subflowPayloads.js +389 -0
- package/dist/esm/recorders/observability/recordingParts/subflowPayloads.js.map +1 -0
- package/dist/esm/recorders/observability/stepGraphTypes.d.ts +139 -0
- package/dist/esm/recorders/observability/stepGraphTypes.js +10 -0
- package/dist/esm/recorders/observability/stepGraphTypes.js.map +1 -0
- package/dist/esm/redaction/knownStrings/fields-0.d.ts +5 -5
- package/dist/esm/redaction/knownStrings/fields-0.js +5 -5
- package/dist/esm/redaction/knownStrings/fields-0.js.map +1 -1
- package/dist/esm/redaction/knownStrings/fields-1.d.ts +7 -7
- package/dist/esm/redaction/knownStrings/fields-1.js +7 -7
- package/dist/esm/redaction/knownStrings/fields-1.js.map +1 -1
- package/dist/esm/redaction/knownStrings/fields-2.d.ts +7 -0
- package/dist/esm/redaction/knownStrings/fields-2.js +7 -0
- package/dist/esm/redaction/knownStrings/fields-2.js.map +1 -1
- package/dist/esm/redaction/knownStrings/words-0.d.ts +4 -4
- package/dist/esm/redaction/knownStrings/words-0.js +4 -4
- package/dist/esm/redaction/knownStrings/words-0.js.map +1 -1
- package/dist/esm/redaction/knownStrings/words-1.d.ts +5 -5
- package/dist/esm/redaction/knownStrings/words-1.js +5 -5
- package/dist/esm/redaction/knownStrings/words-1.js.map +1 -1
- package/dist/esm/redaction/knownStrings/words-2.d.ts +6 -0
- package/dist/esm/redaction/knownStrings/words-2.js +6 -0
- package/dist/esm/redaction/knownStrings/words-2.js.map +1 -1
- package/dist/esm/resilience/withCircuitBreaker.js +1 -0
- package/dist/esm/resilience/withCircuitBreaker.js.map +1 -1
- package/dist/esm/resilience/withFallback.js +4 -0
- package/dist/esm/resilience/withFallback.js.map +1 -1
- package/dist/esm/resilience/withRetry.js +1 -0
- package/dist/esm/resilience/withRetry.js.map +1 -1
- package/dist/esm/thinking/contextChange.d.ts +53 -0
- package/dist/esm/thinking/contextChange.js +101 -0
- package/dist/esm/thinking/contextChange.js.map +1 -0
- package/dist/esm/time-travel/servedView/recordReads.js +12 -0
- package/dist/esm/time-travel/servedView/recordReads.js.map +1 -1
- package/dist/esm/time-travel/servedView.d.ts +4 -1
- package/dist/esm/time-travel/servedView.js.map +1 -1
- package/dist/events/payloads/contextChange.js +3 -0
- package/dist/events/payloads/contextChange.js.map +1 -0
- package/dist/hosting/durability.js +54 -30
- package/dist/hosting/durability.js.map +1 -1
- package/dist/hosting/standingAgent/artifacts/accountParts.js +9 -4
- package/dist/hosting/standingAgent/artifacts/accountParts.js.map +1 -1
- package/dist/observe.js.map +1 -1
- package/dist/provider-contract/requestRefusal.js +3 -1
- package/dist/provider-contract/requestRefusal.js.map +1 -1
- package/dist/provider-contract/thinkingBinding.js +31 -0
- package/dist/provider-contract/thinkingBinding.js.map +1 -0
- package/dist/provider-contract/types.js.map +1 -1
- package/dist/providers.js +5 -1
- package/dist/providers.js.map +1 -1
- package/dist/recorders/observability/FlowchartRecorder.js +16 -0
- package/dist/recorders/observability/FlowchartRecorder.js.map +1 -1
- package/dist/recorders/observability/recordingParts/format.js +139 -18
- package/dist/recorders/observability/recordingParts/format.js.map +1 -1
- package/dist/recorders/observability/recordingParts/open.js +30 -4
- package/dist/recorders/observability/recordingParts/open.js.map +1 -1
- package/dist/recorders/observability/recordingParts/partReader.js +182 -14
- package/dist/recorders/observability/recordingParts/partReader.js.map +1 -1
- package/dist/recorders/observability/recordingParts/split.js +134 -25
- package/dist/recorders/observability/recordingParts/split.js.map +1 -1
- package/dist/recorders/observability/recordingParts/subflowPayloads.js +396 -0
- package/dist/recorders/observability/recordingParts/subflowPayloads.js.map +1 -0
- package/dist/recorders/observability/stepGraphTypes.js +11 -0
- package/dist/recorders/observability/stepGraphTypes.js.map +1 -0
- package/dist/redaction/knownStrings/fields-0.js +5 -5
- package/dist/redaction/knownStrings/fields-0.js.map +1 -1
- package/dist/redaction/knownStrings/fields-1.js +7 -7
- package/dist/redaction/knownStrings/fields-1.js.map +1 -1
- package/dist/redaction/knownStrings/fields-2.js +7 -0
- package/dist/redaction/knownStrings/fields-2.js.map +1 -1
- package/dist/redaction/knownStrings/words-0.js +4 -4
- package/dist/redaction/knownStrings/words-0.js.map +1 -1
- package/dist/redaction/knownStrings/words-1.js +5 -5
- package/dist/redaction/knownStrings/words-1.js.map +1 -1
- package/dist/redaction/knownStrings/words-2.js +6 -0
- package/dist/redaction/knownStrings/words-2.js.map +1 -1
- package/dist/resilience/withCircuitBreaker.js +1 -0
- package/dist/resilience/withCircuitBreaker.js.map +1 -1
- package/dist/resilience/withFallback.js +4 -0
- package/dist/resilience/withFallback.js.map +1 -1
- package/dist/resilience/withRetry.js +1 -0
- package/dist/resilience/withRetry.js.map +1 -1
- package/dist/thinking/contextChange.js +107 -0
- package/dist/thinking/contextChange.js.map +1 -0
- package/dist/time-travel/servedView/recordReads.js +12 -0
- package/dist/time-travel/servedView/recordReads.js.map +1 -1
- package/dist/time-travel/servedView.js.map +1 -1
- package/dist/types/adapters/llm/AnthropicProvider.d.ts +16 -0
- package/dist/types/adapters/llm/AnthropicProvider.d.ts.map +1 -1
- package/dist/types/adapters/llm/BrowserAnthropicProvider.d.ts +9 -0
- package/dist/types/adapters/llm/BrowserAnthropicProvider.d.ts.map +1 -1
- package/dist/types/adapters/llm/InvokeModelGatewayProvider.d.ts +10 -8
- package/dist/types/adapters/llm/InvokeModelGatewayProvider.d.ts.map +1 -1
- package/dist/types/adapters/llm/anthropicModels.d.ts +37 -0
- package/dist/types/adapters/llm/anthropicModels.d.ts.map +1 -1
- package/dist/types/adapters/observability/auditShapes/events/decisions.d.ts.map +1 -1
- package/dist/types/core/agent/contextBinding/check.d.ts +69 -0
- package/dist/types/core/agent/contextBinding/check.d.ts.map +1 -0
- package/dist/types/core/agent/contextBinding/compare.d.ts +14 -0
- package/dist/types/core/agent/contextBinding/compare.d.ts.map +1 -0
- package/dist/types/core/agent/contextBinding/composition.d.ts +55 -0
- package/dist/types/core/agent/contextBinding/composition.d.ts.map +1 -0
- package/dist/types/core/agent/contextBinding/forCall.d.ts +24 -0
- package/dist/types/core/agent/contextBinding/forCall.d.ts.map +1 -0
- package/dist/types/core/agent/runValues.d.ts +3 -0
- package/dist/types/core/agent/runValues.d.ts.map +1 -1
- package/dist/types/core/agent/runtime/configuration/configure.d.ts.map +1 -1
- package/dist/types/core/agent/runtime/configuration/types.d.ts +5 -1
- package/dist/types/core/agent/runtime/configuration/types.d.ts.map +1 -1
- package/dist/types/core/agent/runtime/configuration/values.d.ts +1 -0
- package/dist/types/core/agent/runtime/configuration/values.d.ts.map +1 -1
- package/dist/types/core/agent/runtime/native/initialize.d.ts.map +1 -1
- package/dist/types/core/agent/runtime/request/factory.d.ts.map +1 -1
- package/dist/types/core/agent/stages/callLLM/prepareCall.d.ts +1 -0
- package/dist/types/core/agent/stages/callLLM/prepareCall.d.ts.map +1 -1
- package/dist/types/core/agent/stages/callLLM/types.d.ts +6 -0
- package/dist/types/core/agent/stages/callLLM/types.d.ts.map +1 -1
- package/dist/types/core/agent/stages/callLLM.d.ts.map +1 -1
- package/dist/types/core/agent/types/observation.d.ts +34 -1
- package/dist/types/core/agent/types/observation.d.ts.map +1 -1
- package/dist/types/events/payloads/contextChange.d.ts +69 -0
- package/dist/types/events/payloads/contextChange.d.ts.map +1 -0
- package/dist/types/events/payloads/stream.d.ts +13 -0
- package/dist/types/events/payloads/stream.d.ts.map +1 -1
- package/dist/types/events/payloads.d.ts +1 -0
- package/dist/types/events/payloads.d.ts.map +1 -1
- package/dist/types/hosting/durability.d.ts +10 -0
- package/dist/types/hosting/durability.d.ts.map +1 -1
- package/dist/types/hosting/standingAgent/artifacts/accountParts.d.ts +3 -2
- package/dist/types/hosting/standingAgent/artifacts/accountParts.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/observe.d.ts +1 -1
- package/dist/types/observe.d.ts.map +1 -1
- package/dist/types/provider-contract/requestRefusal.d.ts.map +1 -1
- package/dist/types/provider-contract/thinkingBinding.d.ts +21 -0
- package/dist/types/provider-contract/thinkingBinding.d.ts.map +1 -0
- package/dist/types/provider-contract/types/provider.d.ts +43 -0
- package/dist/types/provider-contract/types/provider.d.ts.map +1 -1
- package/dist/types/provider-contract/types.d.ts +1 -1
- package/dist/types/provider-contract/types.d.ts.map +1 -1
- package/dist/types/providers.d.ts +2 -0
- package/dist/types/providers.d.ts.map +1 -1
- package/dist/types/recorders/observability/FlowchartRecorder.d.ts +8 -120
- package/dist/types/recorders/observability/FlowchartRecorder.d.ts.map +1 -1
- package/dist/types/recorders/observability/boundaryRecorder/domainEvents.d.ts +9 -0
- package/dist/types/recorders/observability/boundaryRecorder/domainEvents.d.ts.map +1 -1
- package/dist/types/recorders/observability/recordingParts/format.d.ts +87 -12
- package/dist/types/recorders/observability/recordingParts/format.d.ts.map +1 -1
- package/dist/types/recorders/observability/recordingParts/open.d.ts +41 -7
- package/dist/types/recorders/observability/recordingParts/open.d.ts.map +1 -1
- package/dist/types/recorders/observability/recordingParts/partReader.d.ts +25 -2
- package/dist/types/recorders/observability/recordingParts/partReader.d.ts.map +1 -1
- package/dist/types/recorders/observability/recordingParts/split.d.ts +13 -0
- package/dist/types/recorders/observability/recordingParts/split.d.ts.map +1 -1
- package/dist/types/recorders/observability/recordingParts/subflowPayloads.d.ts +125 -0
- package/dist/types/recorders/observability/recordingParts/subflowPayloads.d.ts.map +1 -0
- package/dist/types/recorders/observability/stepGraphTypes.d.ts +140 -0
- package/dist/types/recorders/observability/stepGraphTypes.d.ts.map +1 -0
- package/dist/types/redaction/knownStrings/fields-0.d.ts +5 -5
- package/dist/types/redaction/knownStrings/fields-1.d.ts +7 -7
- package/dist/types/redaction/knownStrings/fields-2.d.ts +7 -0
- package/dist/types/redaction/knownStrings/fields-2.d.ts.map +1 -1
- package/dist/types/redaction/knownStrings/words-0.d.ts +4 -4
- package/dist/types/redaction/knownStrings/words-1.d.ts +5 -5
- package/dist/types/redaction/knownStrings/words-2.d.ts +6 -0
- package/dist/types/redaction/knownStrings/words-2.d.ts.map +1 -1
- package/dist/types/resilience/withCircuitBreaker.d.ts.map +1 -1
- package/dist/types/resilience/withFallback.d.ts.map +1 -1
- package/dist/types/resilience/withRetry.d.ts.map +1 -1
- package/dist/types/thinking/contextChange.d.ts +54 -0
- package/dist/types/thinking/contextChange.d.ts.map +1 -0
- package/dist/types/time-travel/servedView/recordReads.d.ts.map +1 -1
- package/dist/types/time-travel/servedView.d.ts +4 -1
- package/dist/types/time-travel/servedView.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What differs between a model request and the request the newest signed
|
|
3
|
+
* reasoning in its history was written under — by NAME, never by value.
|
|
4
|
+
*
|
|
5
|
+
* Carried on `agentfootprint.stream.llm_start` (`contextChange`) and on
|
|
6
|
+
* `ContextChangedError`. Present only on a model whose provider answers
|
|
7
|
+
* `thinkingBinding` with `bound` or `unknown`, and only when signed reasoning
|
|
8
|
+
* is in the history.
|
|
9
|
+
*/
|
|
10
|
+
import type { ContextSource } from '../types.js';
|
|
11
|
+
import type { ToolNameChannel } from './toolCatalog.js';
|
|
12
|
+
/** One named difference. Which fields are set depends on `slot`. */
|
|
13
|
+
export interface ContextChange {
|
|
14
|
+
/** The part of the request that differs. */
|
|
15
|
+
readonly slot: 'system-prompt' | 'tools' | 'messages';
|
|
16
|
+
/**
|
|
17
|
+
* `added` / `removed` / `changed`. For `messages`, `removed` means a message
|
|
18
|
+
* the reasoning was written after is no longer in the request, and `changed`
|
|
19
|
+
* that it differs.
|
|
20
|
+
*/
|
|
21
|
+
readonly change: 'added' | 'removed' | 'changed';
|
|
22
|
+
/** `system-prompt`: the piece's source (`skill`, `instructions`, …). */
|
|
23
|
+
readonly source?: ContextSource;
|
|
24
|
+
/** `system-prompt`: the piece's own id (a skill id, an injection id), when it has one. */
|
|
25
|
+
readonly id?: string;
|
|
26
|
+
/** `tools`: the tool's name. */
|
|
27
|
+
readonly tool?: string;
|
|
28
|
+
/** `tools`: who put the tool forward, when the run recorded it. */
|
|
29
|
+
readonly party?: {
|
|
30
|
+
readonly channel: ToolNameChannel;
|
|
31
|
+
readonly id?: string;
|
|
32
|
+
};
|
|
33
|
+
/** `messages`: the message's position in the conversation. */
|
|
34
|
+
readonly position?: number;
|
|
35
|
+
/** `messages`: the message's role. */
|
|
36
|
+
readonly role?: string;
|
|
37
|
+
}
|
|
38
|
+
/** The comparison one request received. */
|
|
39
|
+
export interface ContextChangeCheck {
|
|
40
|
+
/**
|
|
41
|
+
* `compared`: this request was compared with the request the newest signed
|
|
42
|
+
* reasoning on its wire was written under. `unchecked`: that reasoning came
|
|
43
|
+
* from a response this run did not record (a conversation continued or
|
|
44
|
+
* restored from storage), so nothing could be compared; said once per such
|
|
45
|
+
* response, on the first request that carries it.
|
|
46
|
+
*/
|
|
47
|
+
readonly check: 'compared' | 'unchecked';
|
|
48
|
+
/**
|
|
49
|
+
* True when the reasoning belongs to an unfinished tool turn on a `bound`
|
|
50
|
+
* model: the request is not sent. Never true on an `unknown` one.
|
|
51
|
+
*/
|
|
52
|
+
readonly refused: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* The model's binding as the provider (or the app, through the adapter's
|
|
55
|
+
* `thinkingBinding` option) answered it. `unknown`: an id the adapter cannot
|
|
56
|
+
* place — the change is recorded and the request is sent; the provider
|
|
57
|
+
* decides.
|
|
58
|
+
*/
|
|
59
|
+
readonly binding: 'bound' | 'unknown';
|
|
60
|
+
/** Who stated the binding: the provider's own knowledge, or the app. */
|
|
61
|
+
readonly by: 'provider' | 'app';
|
|
62
|
+
/** The app's `thinkingBinding` statement for this id threw or answered something unusable, so it was not used. */
|
|
63
|
+
readonly appStatement?: 'failed';
|
|
64
|
+
/** The named differences, at most 16. Empty when unchecked. */
|
|
65
|
+
readonly changes: readonly ContextChange[];
|
|
66
|
+
/** Differences beyond the cap, counted. Absent when none were left out. */
|
|
67
|
+
readonly omittedChanges?: number;
|
|
68
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contextChange.js","sourceRoot":"","sources":["../../../../src/events/payloads/contextChange.ts"],"names":[],"mappings":""}
|
|
@@ -50,6 +50,19 @@ export interface LLMStartPayload {
|
|
|
50
50
|
readonly via: 'skill' | 'escalation';
|
|
51
51
|
readonly skillId?: string;
|
|
52
52
|
};
|
|
53
|
+
/**
|
|
54
|
+
* On a model whose thinking is bound to its context, or whose binding the
|
|
55
|
+
* provider cannot tell (`thinkingBinding` answers `bound` or `unknown`): what
|
|
56
|
+
* this request changes under the newest signed reasoning on its wire, by
|
|
57
|
+
* name, when that reasoning was written by a model of the same family.
|
|
58
|
+
* `refused: true` means the call stops here with `ContextChangedError`
|
|
59
|
+
* (bound models only). A row with `check: 'unchecked'` appears ONCE per
|
|
60
|
+
* signed response this run did not record (a continued or restored
|
|
61
|
+
* conversation): nothing could be compared for it.
|
|
62
|
+
* ABSENT otherwise: when nothing changed, when no such reasoning is on the
|
|
63
|
+
* wire, and on every unbound model — those runs keep their exact prior bytes.
|
|
64
|
+
*/
|
|
65
|
+
readonly contextChange?: import('./contextChange.js').ContextChangeCheck;
|
|
53
66
|
}
|
|
54
67
|
export interface LLMEndPayload {
|
|
55
68
|
readonly iteration: number;
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
export type { CompositionEnterPayload, CompositionExitPayload, ParallelForkStartPayload, ParallelBranchCompletePayload, ParallelMergeEndPayload, ConditionalRouteDecidedPayload, LoopIterationStartPayload, LoopIterationExitPayload, } from './payloads/flow.js';
|
|
11
11
|
export type { AgentTurnStartPayload, AgentTurnEndPayload, AgentBudgetExhaustedPayload, AgentIterationStartPayload, AgentIterationEndPayload, FixedRouteRationale, FixedPauseReason, AgentRouteDecidedPayload, AgentHandoffPayload, AgentAroundTurnFailedPayload, } from './payloads/agent.js';
|
|
12
12
|
export type { LLMStartPayload, LLMEndPayload, LLMTokenPayload, ToolStartPayload, ToolProgressPayload, ToolEndPayload, } from './payloads/stream.js';
|
|
13
|
+
export type { ContextChange, ContextChangeCheck } from './payloads/contextChange.js';
|
|
13
14
|
export type { ContextInjectedPayload, ContextEvictedPayload, ContextSlotComposedPayload, ContextBudgetPressurePayload, SkillGuardValueRecord, SkillGuardEvaluationRecord, ContextEvaluatedPayload, } from './payloads/context.js';
|
|
14
15
|
export type { ContextRecordedPayload, ContextRecordedPiece } from './payloads/contextRecorded.js';
|
|
15
16
|
export type { ErrorFatalPayload, PauseRequestPayload, PauseResumePayload, CheckInRequestPayload, CheckInDecisionPayload, MiddlewareDecisionPayload, } from './payloads/consent.js';
|
|
@@ -28,6 +28,16 @@
|
|
|
28
28
|
* "this commit wrote `history`", which is not an optimisation but the honest
|
|
29
29
|
* reading of the question: the conversation moved iff `history` moved.
|
|
30
30
|
*
|
|
31
|
+
* "This commit wrote `history`" is learned from the WRITES, not from the commit
|
|
32
|
+
* event's `mutations`: every `onWrite` of `history` marks its stage (by
|
|
33
|
+
* `runtimeStageId`), and that stage's `onCommit` acts on the mark. `mutations`
|
|
34
|
+
* is the snapshot's write view, which the run's `writeTracking` dial governs:
|
|
35
|
+
* under `'off'` it is empty, and a durability promise must not depend on an
|
|
36
|
+
* observability dial. `onWrite` fires for every write in every mode. A
|
|
37
|
+
* retried stage's discarded attempt drops its mark (`onStageRetry`), as the
|
|
38
|
+
* engine drops its staged writes, so the commits that trigger are exactly the
|
|
39
|
+
* ones whose write view holds `history` under `'full'` or `'summary'`.
|
|
40
|
+
*
|
|
31
41
|
* ── What a commit boundary actually guarantees, and what it does not ─────────
|
|
32
42
|
* It guarantees the whole stage. The agent dispatches ALL of one iteration's
|
|
33
43
|
* tool calls inside one stage body, so a crash part-way through that body stores
|
|
@@ -28,6 +28,16 @@
|
|
|
28
28
|
* "this commit wrote `history`", which is not an optimisation but the honest
|
|
29
29
|
* reading of the question: the conversation moved iff `history` moved.
|
|
30
30
|
*
|
|
31
|
+
* "This commit wrote `history`" is learned from the WRITES, not from the commit
|
|
32
|
+
* event's `mutations`: every `onWrite` of `history` marks its stage (by
|
|
33
|
+
* `runtimeStageId`), and that stage's `onCommit` acts on the mark. `mutations`
|
|
34
|
+
* is the snapshot's write view, which the run's `writeTracking` dial governs:
|
|
35
|
+
* under `'off'` it is empty, and a durability promise must not depend on an
|
|
36
|
+
* observability dial. `onWrite` fires for every write in every mode. A
|
|
37
|
+
* retried stage's discarded attempt drops its mark (`onStageRetry`), as the
|
|
38
|
+
* engine drops its staged writes, so the commits that trigger are exactly the
|
|
39
|
+
* ones whose write view holds `history` under `'full'` or `'summary'`.
|
|
40
|
+
*
|
|
31
41
|
* ── What a commit boundary actually guarantees, and what it does not ─────────
|
|
32
42
|
* It guarantees the whole stage. The agent dispatches ALL of one iteration's
|
|
33
43
|
* tool calls inside one stage body, so a crash part-way through that body stores
|
|
@@ -112,36 +122,50 @@ export function durableWriter(options) {
|
|
|
112
122
|
};
|
|
113
123
|
pump();
|
|
114
124
|
}
|
|
115
|
-
const capture = ({ sessionId, runId, identity, state }) =>
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
125
|
+
const capture = ({ sessionId, runId, identity, state }) => {
|
|
126
|
+
/** The stages (by `runtimeStageId`) that wrote `history` and have not committed yet. */
|
|
127
|
+
const wroteHistory = new Set();
|
|
128
|
+
return {
|
|
129
|
+
id: 'af-hosting-durability',
|
|
130
|
+
// INLINE, always. A write delivered one beat behind is a write that can be
|
|
131
|
+
// lost by the very crash it exists to survive — and under `'sync'` the
|
|
132
|
+
// barrier would be waiting on a snapshot the queue had not handed over yet.
|
|
133
|
+
// The causal-evidence bridge and the compaction meter are inline for the
|
|
134
|
+
// same class of reason.
|
|
135
|
+
delivery: 'inline',
|
|
136
|
+
// The conversation moved iff this stage wrote `history`. The write says
|
|
137
|
+
// WHICH key moved — a key's NAME is never redacted — and the run's live
|
|
138
|
+
// state, read at the commit, says what it now holds: real values, the
|
|
139
|
+
// conversation the next turn resumes from. A write's own value is the
|
|
140
|
+
// record's form, which an agent's `redact` may have turned into a placeholder.
|
|
141
|
+
onWrite(event) {
|
|
142
|
+
if (event.key === 'history')
|
|
143
|
+
wroteHistory.add(event.runtimeStageId);
|
|
144
|
+
},
|
|
145
|
+
// A failed attempt's writes are discarded before the next one runs.
|
|
146
|
+
onStageRetry(event) {
|
|
147
|
+
const stage = event.traversalContext?.runtimeStageId;
|
|
148
|
+
if (stage !== undefined)
|
|
149
|
+
wroteHistory.delete(stage);
|
|
150
|
+
},
|
|
151
|
+
onCommit(event) {
|
|
152
|
+
if (!wroteHistory.delete(event.runtimeStageId))
|
|
153
|
+
return;
|
|
154
|
+
if (sessionId === undefined)
|
|
155
|
+
return;
|
|
156
|
+
const origin = runId();
|
|
157
|
+
if (origin === undefined)
|
|
158
|
+
return;
|
|
159
|
+
const live = state();
|
|
160
|
+
const history = live?.['history'];
|
|
161
|
+
if (!Array.isArray(history))
|
|
162
|
+
return;
|
|
163
|
+
const userMessage = live?.['userMessage'];
|
|
164
|
+
const iteration = live?.['iteration'];
|
|
165
|
+
enqueue(sessionId, origin, history, typeof userMessage === 'string' ? userMessage : '', typeof iteration === 'number' ? iteration : 0, identity());
|
|
166
|
+
},
|
|
167
|
+
};
|
|
168
|
+
};
|
|
145
169
|
const settle = async () => {
|
|
146
170
|
// Loop rather than await once: a write that completes may release a queued
|
|
147
171
|
// successor, and "settled" has to mean nothing is left.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"durability.js","sourceRoot":"","sources":["../../../src/hosting/durability.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"durability.js","sourceRoot":"","sources":["../../../src/hosting/durability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAIH,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAC;AAmElF;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,OAA6B;IACzD,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;IAEhC,u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gBACnB,OAAO,MAAM,EAAE,CAAC;YAClB,CAAC,CAAC,CAAC;QACL,CAAC;QACD,MAAM;KACP,CAAC;AACJ,CAAC"}
|
|
@@ -23,8 +23,9 @@
|
|
|
23
23
|
* (base included), and no other `get`.
|
|
24
24
|
* 3. **The ceiling on the whole** — `maxRecordingBytes` bounds the STORED part
|
|
25
25
|
* bytes (base and invocation parts, each with its small part wrapper;
|
|
26
|
-
* proven alias copies are restored by reference and not counted)
|
|
27
|
-
*
|
|
26
|
+
* proven alias copies are restored by reference and not counted) PLUS the
|
|
27
|
+
* sub-flow payloads a whole read restores from results (index format 2,
|
|
28
|
+
* `sizes.restoredBytes`), and a packed part by what it expands to. So within a narrow band a parts
|
|
28
29
|
* recording is explained where the same run filed whole is over the
|
|
29
30
|
* ceiling. When the index's stored totals already pass it, the named 413
|
|
30
31
|
* comes before any part is read; a packed part that would expand past
|
|
@@ -23,8 +23,9 @@
|
|
|
23
23
|
* (base included), and no other `get`.
|
|
24
24
|
* 3. **The ceiling on the whole** — `maxRecordingBytes` bounds the STORED part
|
|
25
25
|
* bytes (base and invocation parts, each with its small part wrapper;
|
|
26
|
-
* proven alias copies are restored by reference and not counted)
|
|
27
|
-
*
|
|
26
|
+
* proven alias copies are restored by reference and not counted) PLUS the
|
|
27
|
+
* sub-flow payloads a whole read restores from results (index format 2,
|
|
28
|
+
* `sizes.restoredBytes`), and a packed part by what it expands to. So within a narrow band a parts
|
|
28
29
|
* recording is explained where the same run filed whole is over the
|
|
29
30
|
* ceiling. When the index's stored totals already pass it, the named 413
|
|
30
31
|
* comes before any part is read; a packed part that would expand past
|
|
@@ -64,8 +65,12 @@ export async function explainPartsRecording(service, store, scope, ref, bound) {
|
|
|
64
65
|
service.drop(key);
|
|
65
66
|
return { status: 'not-found' };
|
|
66
67
|
}
|
|
67
|
-
//
|
|
68
|
-
|
|
68
|
+
// Decided from the index alone: the stored parts, with the payloads a whole
|
|
69
|
+
// read restores from results, already pass the ceiling. The restored share is
|
|
70
|
+
// the index's claim, so this only refuses early: a pass is provisional, and
|
|
71
|
+
// `readWhole` measures what it restores against the same ceiling (a figure
|
|
72
|
+
// that does not match is `part-changed`, the op's one not-found).
|
|
73
|
+
if (opened.sizes.restoredBytes - (opened.sizes.index ?? 0) > ceiling)
|
|
69
74
|
return { status: 'too-large' };
|
|
70
75
|
const answer = service.cached(key) ??
|
|
71
76
|
(await service.compute(key, async () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accountParts.js","sourceRoot":"","sources":["../../../../../src/hosting/standingAgent/artifacts/accountParts.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"accountParts.js","sourceRoot":"","sources":["../../../../../src/hosting/standingAgent/artifacts/accountParts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yDAAyD,CAAC;AAG7F,OAAO,EAAE,gCAAgC,EAAE,MAAM,iBAAiB,CAAC;AAQnE;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,OAAuB,EACvB,KAAoB,EACpB,KAAoB,EACpB,GAAW,EACX,KAAuC;IAEvC,MAAM,MAAM,GAAG,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC3C,IAAI,OAAO,GAAkD,MAAM,CAAC;IACpE,MAAM,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAC1C,MAAM,MAAM,GAAG,MAAM,kBAAkB,CACrC,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,EAC3E,GAAG,EACH,EAAE,YAAY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YACxE,uDAAuD;YACvD,IAAI,KAAK,CAAC,MAAM,KAAK,WAAW;gBAAE,MAAM,IAAI,gCAAgC,CAAC,OAAO,CAAC,CAAC;YACtF,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC,CAAC;IACN,OAAO,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;AACpF,CAAC"}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ export type { ObserverDrainResult, ObserverStats } from 'footprintjs';
|
|
|
38
38
|
export type { ToolArgValidationMode } from './tools/toolArgsValidation.js';
|
|
39
39
|
export { isTruncatedToolResult, type TruncatedToolResult } from './core/agent/toolResultCap.js';
|
|
40
40
|
export type { ReadSummaryMarker, ReadTrackingMode } from 'footprintjs';
|
|
41
|
+
export type { WriteSummaryMarker, WriteTrackingMode } from 'footprintjs';
|
|
41
42
|
export type { WriteProvenanceMode } from './core/agent/types.js';
|
|
42
43
|
export type { ExternalGroundsProvider } from './core/agent/types.js';
|
|
43
44
|
export type { ExternalGround, ExternalGrounding } from './integrity/unsupported-argument/check.js';
|
package/dist/esm/observe.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ export { RunStepRecorder, runStepRecorder, type RunStep, type RunStepKind, type
|
|
|
40
40
|
export { attachFlowchart, buildStepGraph, buildStepGraphFromEvents, type StepGraph, type StepNode, type StepEdge, type SlotBoundary, type ContextInjection, type FlowchartOptions, type FlowchartHandle, } from './recorders/observability/FlowchartRecorder.js';
|
|
41
41
|
export { recordRun, type Recording, type RecordRunOptions, type RunRecorder, } from './recorders/observability/recordRun.js';
|
|
42
42
|
export { recordingSizeReport, type RecordingSizeFields, type RecordingSizeMount, type RecordingSizeReport, type RecordingSizeRow, } from './recorders/observability/recordingSizeReport.js';
|
|
43
|
-
export { openSavedRecording, type OpenSavedRecordingOptions, type SavedInvocation, type SavedRecording, type SavedRecordingArtifacts, type SavedRecordingPartUnavailable, type SavedRecordingReadOptions, type SavedRecordingSizes, type SavedRecordingUnavailable, type SavedRecordingWholeOptions, } from './recorders/observability/recordingParts/open.js';
|
|
43
|
+
export { openSavedRecording, type OpenSavedRecordingOptions, type SavedInvocation, type SavedInvocationPayloads, type SavedPayloadSlot, type SavedRecording, type SavedRecordingArtifacts, type SavedRecordingPartUnavailable, type SavedRecordingReadOptions, type SavedRecordingSizes, type SavedRecordingUnavailable, type SavedRecordingWholeOptions, } from './recorders/observability/recordingParts/open.js';
|
|
44
44
|
export { contextShapeAt, type RecordedContextShape, } from './recorders/observability/contextShapes/read.js';
|
|
45
45
|
export type { ContextShapeIndex, ContextShapeOptions, ShapeEntry, } from './recorders/observability/contextShapes.js';
|
|
46
46
|
export { recordContextRun, readContextRecording, applyContextChange, contextCallCommentary, ContextRecordingError, type ContextRunRecorder, type RecordContextRunOptions, type ContextCallChange, type ContextValueWriter, type ContextValueReader, type ContextValueRecording, type OpenContextValues, type ReadContextRecording, } from './recorders/observability/contextRecording.js';
|
package/dist/esm/observe.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observe.js","sourceRoot":"","sources":["../../src/observe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,4BAA4B;AAC5B,OAAO,EAAE,eAAe,EAA+B,MAAM,qCAAqC,CAAC;AACnG,OAAO,EAAE,cAAc,EAA8B,MAAM,oCAAoC,CAAC;AAEhG,+BAA+B;AAC/B,OAAO,EACL,mBAAmB,GAEpB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,aAAa,EAA6B,MAAM,mCAAmC,CAAC;AAC7F,OAAO,EACL,gBAAgB,EAChB,gBAAgB,GAkBjB,MAAM,+CAA+C,CAAC;AACvD,OAAO,EACL,eAAe,EACf,eAAe,GAMhB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAC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gF;AAChF,OAAO,EACL,mBAAmB,GAMpB,MAAM,kDAAkD,CAAC;AAC1D,gFAAgF;AAChF,gFAAgF;AAChF,OAAO,EACL,kBAAkB,GAQnB,MAAM,yDAAyD,CAAC;AAEjE,uDAAuD;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE1D,kEAAkE;AAClE,uEAAuE;AACvE,0EAA0E;AAC1E,4EAA4E;AAC5E,6EAA6E;AAC7E,yDAAyD;AACzD,cAAc,YAAY,CAAC;AAC3B,sEAAsE;AACtE,uEAAuE;AACvE,qEAAqE;AACrE,oEAAoE;AACpE,OAAO,EACL,kBAAkB,EAClB,kBAAkB,GAOnB,MAAM,iDAAiD,CAAC;AAEzD,OAAO,EACL,aAAa,EACb,cAAc,GAOf,MAAM,4CAA4C,CAAC;AAEpD,sEAAsE;AACtE,4EAA4E;AAC5E,2CAA2C;AAC3C,OAAO,EACL,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,WAAW,GACZ,MAAM,2BAA2B,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { UnsupportedToolChoiceError } from './forcedToolChoice.js';
|
|
|
3
3
|
import { UnsupportedNativeOutputError } from './nativeOutputSchema.js';
|
|
4
4
|
import { UnsupportedThinkingError } from '../thinking/errors.js';
|
|
5
5
|
import { UnsafeThinkingReplayError } from '../thinking/replay.js';
|
|
6
|
+
import { ContextChangedError } from '../thinking/contextChange.js';
|
|
6
7
|
import { isProviderInterventionError } from './intervention.js';
|
|
7
8
|
/** Deliberately narrow: unrelated application errors keep their existing policy. */
|
|
8
9
|
export function isRequestRefusal(error) {
|
|
@@ -10,6 +11,7 @@ export function isRequestRefusal(error) {
|
|
|
10
11
|
error instanceof UnsupportedToolChoiceError ||
|
|
11
12
|
error instanceof UnsupportedNativeOutputError ||
|
|
12
13
|
error instanceof UnsupportedThinkingError ||
|
|
13
|
-
error instanceof UnsafeThinkingReplayError
|
|
14
|
+
error instanceof UnsafeThinkingReplayError ||
|
|
15
|
+
error instanceof ContextChangedError);
|
|
14
16
|
}
|
|
15
17
|
//# sourceMappingURL=requestRefusal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestRefusal.js","sourceRoot":"","sources":["../../../src/provider-contract/requestRefusal.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAEhE,oFAAoF;AACpF,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,OAAO,CACL,2BAA2B,CAAC,KAAK,CAAC;QAClC,KAAK,YAAY,0BAA0B;QAC3C,KAAK,YAAY,4BAA4B;QAC7C,KAAK,YAAY,wBAAwB;QACzC,KAAK,YAAY,yBAAyB,
|
|
1
|
+
{"version":3,"file":"requestRefusal.js","sourceRoot":"","sources":["../../../src/provider-contract/requestRefusal.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAEhE,oFAAoF;AACpF,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,OAAO,CACL,2BAA2B,CAAC,KAAK,CAAC;QAClC,KAAK,YAAY,0BAA0B;QAC3C,KAAK,YAAY,4BAA4B;QAC7C,KAAK,YAAY,wBAAwB;QACzC,KAAK,YAAY,yBAAyB;QAC1C,KAAK,YAAY,mBAAmB,CACrC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a model's thinking is bound to the context it was written under —
|
|
3
|
+
* `bound`, `unbound` or `unknown` — and who said so. The one reader of
|
|
4
|
+
* {@link LLMProvider.thinkingBinding}.
|
|
5
|
+
*
|
|
6
|
+
* Absence means unbound, so every provider that never heard of the capability
|
|
7
|
+
* (OpenAI-family, Gemini, Ollama, a hand-written mock) keeps its exact
|
|
8
|
+
* request path. The Anthropic-wire adapters answer per model from their table,
|
|
9
|
+
* `unknown` for an id the table cannot place, and take an app's statement for
|
|
10
|
+
* such an id through their `thinkingBinding` option (`by: 'app'`). A
|
|
11
|
+
* declaration that throws or answers something else reads as `unknown`.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* thinkingBindingOf(anthropic(), 'claude-haiku-5-5'); // { binding: 'bound', by: 'provider' }
|
|
15
|
+
* thinkingBindingOf(anthropic(), 'claude-opus-6'); // { binding: 'unknown', by: 'provider' }
|
|
16
|
+
* thinkingBindingOf(openai(), 'gpt-5'); // { binding: 'unbound', by: 'provider' }
|
|
17
|
+
*/
|
|
18
|
+
import type { LLMProvider, ThinkingBinding } from './types.js';
|
|
19
|
+
export type { ThinkingBinding } from './types.js';
|
|
20
|
+
export declare function thinkingBindingOf(provider: Pick<LLMProvider, 'thinkingBinding'>, model: string): ThinkingBinding;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const UNBOUND = Object.freeze({ binding: 'unbound', by: 'provider' });
|
|
2
|
+
const UNKNOWN = Object.freeze({ binding: 'unknown', by: 'provider' });
|
|
3
|
+
export function thinkingBindingOf(provider, model) {
|
|
4
|
+
if (provider.thinkingBinding === undefined)
|
|
5
|
+
return UNBOUND;
|
|
6
|
+
let answer;
|
|
7
|
+
try {
|
|
8
|
+
answer = provider.thinkingBinding(model);
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
// A declaration that throws is not evidence either way: unknown, which
|
|
12
|
+
// records and never refuses. The run itself is not failed by it.
|
|
13
|
+
return UNKNOWN;
|
|
14
|
+
}
|
|
15
|
+
const binding = answer?.binding;
|
|
16
|
+
// A malformed answer is not evidence either way: unknown.
|
|
17
|
+
if (binding !== 'bound' && binding !== 'unbound' && binding !== 'unknown')
|
|
18
|
+
return UNKNOWN;
|
|
19
|
+
return {
|
|
20
|
+
binding,
|
|
21
|
+
by: answer?.by === 'app' ? 'app' : 'provider',
|
|
22
|
+
...(typeof answer?.family === 'string' && { family: answer.family }),
|
|
23
|
+
...(typeof answer?.model === 'string' && { model: answer.model }),
|
|
24
|
+
...(answer?.appStatement === 'failed' && { appStatement: 'failed' }),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=thinkingBinding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thinkingBinding.js","sourceRoot":"","sources":["../../../src/provider-contract/thinkingBinding.ts"],"names":[],"mappings":"AAqBA,MAAM,OAAO,GAAoB,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;AACvF,MAAM,OAAO,GAAoB,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;AAEvF,MAAM,UAAU,iBAAiB,CAC/B,QAA8C,EAC9C,KAAa;IAEb,IAAI,QAAQ,CAAC,eAAe,KAAK,SAAS;QAAE,OAAO,OAAO,CAAC;IAC3D,IAAI,MAA4C,CAAC;IACjD,IAAI,CAAC;QACH,MAAM,GAAG,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAyC,CAAC;IACnF,CAAC;IAAC,MAAM,CAAC;QACP,uEAAuE;QACvE,iEAAiE;QACjE,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,MAAM,OAAO,GAAG,MAAM,EAAE,OAAO,CAAC;IAChC,0DAA0D;IAC1D,IAAI,OAAO,KAAK,OAAO,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,OAAO,CAAC;IAC1F,OAAO;QACL,OAAO;QACP,EAAE,EAAE,MAAM,EAAE,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU;QAC7C,GAAG,CAAC,OAAO,MAAM,EAAE,MAAM,KAAK,QAAQ,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;QACpE,GAAG,CAAC,OAAO,MAAM,EAAE,KAAK,KAAK,QAAQ,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC;QACjE,GAAG,CAAC,MAAM,EAAE,YAAY,KAAK,QAAQ,IAAI,EAAE,YAAY,EAAE,QAAiB,EAAE,CAAC;KAC9E,CAAC;AACJ,CAAC"}
|
|
@@ -165,6 +165,24 @@ export interface LLMProvider {
|
|
|
165
165
|
* `withFallback` answers for its pair.
|
|
166
166
|
*/
|
|
167
167
|
readonly thinkingMode?: (model: string) => import('../../thinking/types.js').ThinkingMode;
|
|
168
|
+
/**
|
|
169
|
+
* Whether a thinking block this model returns stays valid only under the
|
|
170
|
+
* system prompt, tool list and earlier messages it was written under
|
|
171
|
+
* (Anthropic's preserved thinking: the API refuses or drops a block replayed
|
|
172
|
+
* after any of them changed) — `bound`, `unbound` or `unknown`, and who said
|
|
173
|
+
* so. Read with `thinkingBindingOf(provider, model)`. On a `bound` model the
|
|
174
|
+
* agent refuses by name a tool turn whose context changed under its signed
|
|
175
|
+
* reasoning (`ContextChangedError`); on an `unknown` one it sends the request
|
|
176
|
+
* and records the change.
|
|
177
|
+
*
|
|
178
|
+
* A plain function of the model id (no `this`). **Absence means unbound.**
|
|
179
|
+
* The Anthropic-wire adapters answer from their model table, `unknown` for an
|
|
180
|
+
* id the table cannot place, and take the app's statement for such an id
|
|
181
|
+
* (`thinkingBinding` option, `by: 'app'`). A WRAPPER must forward it;
|
|
182
|
+
* `withFallback` forwards its primary's answer, the side every call goes to
|
|
183
|
+
* first (a fallback's own adapter checks the calls it serves).
|
|
184
|
+
*/
|
|
185
|
+
readonly thinkingBinding?: (model: string) => ThinkingBinding;
|
|
168
186
|
/**
|
|
169
187
|
* v7.21 — which roles this provider carries INSIDE the `messages` array.
|
|
170
188
|
*
|
|
@@ -259,3 +277,28 @@ export interface LLMProvider {
|
|
|
259
277
|
complete(req: LLMRequest, hooks?: LLMCallHooks): Promise<LLMResponse>;
|
|
260
278
|
stream?(req: LLMRequest, hooks?: LLMCallHooks): AsyncIterable<LLMChunk>;
|
|
261
279
|
}
|
|
280
|
+
/** A provider's answer to `thinkingBinding`: the fact, and who stated it. */
|
|
281
|
+
export interface ThinkingBinding {
|
|
282
|
+
/**
|
|
283
|
+
* `bound`: a thinking block is valid only under the system prompt, tool list
|
|
284
|
+
* and earlier messages it was written under. `unbound`: it is not. `unknown`:
|
|
285
|
+
* the provider cannot tell for this model id (an id its table cannot place).
|
|
286
|
+
*/
|
|
287
|
+
readonly binding: 'bound' | 'unbound' | 'unknown';
|
|
288
|
+
/** `provider`: the adapter's own knowledge. `app`: the application stated it. */
|
|
289
|
+
readonly by: 'provider' | 'app';
|
|
290
|
+
/**
|
|
291
|
+
* The model family the provider resolved the id to, when it knows it. Two
|
|
292
|
+
* ids of one family read each other's reasoning bindings (a dated id and its
|
|
293
|
+
* alias); a block written by another family is not checked against this one.
|
|
294
|
+
*/
|
|
295
|
+
readonly family?: string;
|
|
296
|
+
/**
|
|
297
|
+
* The model id the provider resolved the asked id to — an adapter's
|
|
298
|
+
* shorthand (`'anthropic'`) becomes the id it actually sends. Absent: the
|
|
299
|
+
* asked id is the one sent.
|
|
300
|
+
*/
|
|
301
|
+
readonly model?: string;
|
|
302
|
+
/** The app's statement for this id was asked and could not be used (it threw or answered something else). */
|
|
303
|
+
readonly appStatement?: 'failed';
|
|
304
|
+
}
|
|
@@ -17,7 +17,7 @@ export { DEFAULT_CARRIES_IN_MESSAGES, type WireRole } from './wireRole.js';
|
|
|
17
17
|
export type { LLMMessage } from './types/message.js';
|
|
18
18
|
export type { LLMRequest } from './types/request.js';
|
|
19
19
|
export type { LLMResponse, WireToolManifest, LLMChunk } from './types/response.js';
|
|
20
|
-
export type { ResilienceReport, LLMCallHooks, LLMProvider } from './types/provider.js';
|
|
20
|
+
export type { ResilienceReport, LLMCallHooks, LLMProvider, ThinkingBinding, } from './types/provider.js';
|
|
21
21
|
export { STAGED_INPUTS_ENV, canStageCodeInputs, canReadCodeFiles, canRunCodeCommands, type BrowserShot, type BrowserDriver, type BrowserRunner, type BrowserSession, type CodeRunner, type CodeInput, type StagedCodeInput, type CodeSession, type CodeReadOptions, type CodeFile, type CodeCommandOptions, type CodeCommandResult, type CodeTruncation, type CodeResult, } from './types/code.js';
|
|
22
22
|
export interface LLMToolSchema {
|
|
23
23
|
readonly name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/provider-contract/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAOH,OAAO,EAAE,2BAA2B,EAAiB,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/provider-contract/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAOH,OAAO,EAAE,2BAA2B,EAAiB,MAAM,eAAe,CAAC;AAW3E,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,GAenB,MAAM,iBAAiB,CAAC;AAiLzB;;GAEG;AACH,MAAM,UAAU,cAAc,CAC5B,OAAsC,EACtC,UAAgC;IAEhC,IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC;IAC3B,OAAO,UAAU,KAAK,WAAW,IAAI,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;AACtF,CAAC"}
|
package/dist/esm/providers.d.ts
CHANGED
|
@@ -36,6 +36,8 @@
|
|
|
36
36
|
export { forcedToolChoiceFor, UnsupportedToolChoiceError, } from './provider-contract/forcedToolChoice.js';
|
|
37
37
|
export { nativeOutputSchemaFor, UnsupportedNativeOutputError, } from './provider-contract/nativeOutputSchema.js';
|
|
38
38
|
export { UnsafeThinkingReplayError } from './thinking/replay.js';
|
|
39
|
+
export { ContextChangedError, type ContextChange } from './thinking/contextChange.js';
|
|
40
|
+
export { thinkingBindingOf, type ThinkingBinding } from './provider-contract/thinkingBinding.js';
|
|
39
41
|
export { ProviderBlockedError, ProviderInterventionUnknownError, ProviderGuardrailLimitError, type ProviderIntervention, } from './provider-contract/intervention.js';
|
|
40
42
|
export type { MessageReplay, ReplayPart, ReplayPreparation, ThinkingReplayOmission, ThinkingReplayReason, } from './thinking/replay.js';
|
|
41
43
|
export { MockProvider, mock, type MockProviderOptions, type MockReply, type LatencyMs, } from './adapters/llm/MockProvider.js';
|
package/dist/esm/providers.js
CHANGED
|
@@ -36,6 +36,8 @@
|
|
|
36
36
|
export { forcedToolChoiceFor, UnsupportedToolChoiceError, } from './provider-contract/forcedToolChoice.js';
|
|
37
37
|
export { nativeOutputSchemaFor, UnsupportedNativeOutputError, } from './provider-contract/nativeOutputSchema.js';
|
|
38
38
|
export { UnsafeThinkingReplayError } from './thinking/replay.js';
|
|
39
|
+
export { ContextChangedError } from './thinking/contextChange.js';
|
|
40
|
+
export { thinkingBindingOf } from './provider-contract/thinkingBinding.js';
|
|
39
41
|
export { ProviderBlockedError, ProviderInterventionUnknownError, ProviderGuardrailLimitError, } from './provider-contract/intervention.js';
|
|
40
42
|
export { MockProvider, mock, } from './adapters/llm/MockProvider.js';
|
|
41
43
|
export { anthropic, AnthropicProvider, } from './adapters/llm/AnthropicProvider.js';
|
|
@@ -1 +1 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