@strands-agents/sdk 1.13.0 → 1.15.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/dist/src/agent/agent-as-tool.d.ts.map +1 -1
- package/dist/src/agent/agent-as-tool.js +8 -2
- package/dist/src/agent/agent-as-tool.js.map +1 -1
- package/dist/src/agent/agent-delegation.d.ts +9 -30
- package/dist/src/agent/agent-delegation.d.ts.map +1 -1
- package/dist/src/agent/agent-delegation.js +26 -98
- package/dist/src/agent/agent-delegation.js.map +1 -1
- package/dist/src/agent/agent.d.ts +49 -15
- package/dist/src/agent/agent.d.ts.map +1 -1
- package/dist/src/agent/agent.js +193 -60
- package/dist/src/agent/agent.js.map +1 -1
- package/dist/src/agent/continuation.d.ts +77 -0
- package/dist/src/agent/continuation.d.ts.map +1 -0
- package/dist/src/agent/continuation.js +167 -0
- package/dist/src/agent/continuation.js.map +1 -0
- package/dist/src/agent/tool-caller.d.ts.map +1 -1
- package/dist/src/agent/tool-caller.js +1 -0
- package/dist/src/agent/tool-caller.js.map +1 -1
- package/dist/src/background-tasks/errors.d.ts +8 -0
- package/dist/src/background-tasks/errors.d.ts.map +1 -0
- package/dist/src/background-tasks/errors.js +11 -0
- package/dist/src/background-tasks/errors.js.map +1 -0
- package/dist/src/background-tasks/in-process/engine.d.ts +96 -0
- package/dist/src/background-tasks/in-process/engine.d.ts.map +1 -0
- package/dist/src/background-tasks/in-process/engine.js +322 -0
- package/dist/src/background-tasks/in-process/engine.js.map +1 -0
- package/dist/src/background-tasks/in-process/types.d.ts +76 -0
- package/dist/src/background-tasks/in-process/types.d.ts.map +1 -0
- package/dist/src/background-tasks/in-process/types.js +2 -0
- package/dist/src/background-tasks/in-process/types.js.map +1 -0
- package/dist/src/context-manager/context-manager.d.ts +30 -0
- package/dist/src/context-manager/context-manager.d.ts.map +1 -0
- package/dist/src/context-manager/context-manager.js +89 -0
- package/dist/src/context-manager/context-manager.js.map +1 -0
- package/dist/src/context-manager/methods/summarize.d.ts +41 -0
- package/dist/src/context-manager/methods/summarize.d.ts.map +1 -0
- package/dist/src/context-manager/methods/summarize.js +108 -0
- package/dist/src/context-manager/methods/summarize.js.map +1 -0
- package/dist/src/context-manager/methods/truncate.d.ts +36 -0
- package/dist/src/context-manager/methods/truncate.d.ts.map +1 -0
- package/dist/src/context-manager/methods/truncate.js +86 -0
- package/dist/src/context-manager/methods/truncate.js.map +1 -0
- package/dist/src/context-manager/modes/agentic/agentic-context.d.ts +1 -2
- package/dist/src/context-manager/modes/agentic/agentic-context.d.ts.map +1 -1
- package/dist/src/context-manager/modes/agentic/agentic-context.js +6 -3
- package/dist/src/context-manager/modes/agentic/agentic-context.js.map +1 -1
- package/dist/src/context-manager/strategies/offload/base.d.ts +140 -0
- package/dist/src/context-manager/strategies/offload/base.d.ts.map +1 -0
- package/dist/src/context-manager/strategies/offload/base.js +376 -0
- package/dist/src/context-manager/strategies/offload/base.js.map +1 -0
- package/dist/src/context-manager/strategies/offload/drop.d.ts +19 -0
- package/dist/src/context-manager/strategies/offload/drop.d.ts.map +1 -0
- package/dist/src/context-manager/strategies/offload/drop.js +31 -0
- package/dist/src/context-manager/strategies/offload/drop.js.map +1 -0
- package/dist/src/context-manager/strategies/offload/index.d.ts +43 -0
- package/dist/src/context-manager/strategies/offload/index.d.ts.map +1 -0
- package/dist/src/context-manager/strategies/offload/index.js +37 -0
- package/dist/src/context-manager/strategies/offload/index.js.map +1 -0
- package/dist/src/context-manager/strategies/offload/summarize.d.ts +22 -0
- package/dist/src/context-manager/strategies/offload/summarize.d.ts.map +1 -0
- package/dist/src/context-manager/strategies/offload/summarize.js +104 -0
- package/dist/src/context-manager/strategies/offload/summarize.js.map +1 -0
- package/dist/src/context-manager/strategies/offload/truncate.d.ts +21 -0
- package/dist/src/context-manager/strategies/offload/truncate.d.ts.map +1 -0
- package/dist/src/context-manager/strategies/offload/truncate.js +66 -0
- package/dist/src/context-manager/strategies/offload/truncate.js.map +1 -0
- package/dist/src/context-manager/types.d.ts +50 -0
- package/dist/src/context-manager/types.d.ts.map +1 -0
- package/dist/src/context-manager/types.js +5 -0
- package/dist/src/context-manager/types.js.map +1 -0
- package/dist/src/hooks/events.d.ts +6 -5
- package/dist/src/hooks/events.d.ts.map +1 -1
- package/dist/src/hooks/events.js +5 -4
- package/dist/src/hooks/events.js.map +1 -1
- package/dist/src/hooks/types.d.ts +1 -0
- package/dist/src/hooks/types.d.ts.map +1 -1
- package/dist/src/hooks/types.js +1 -0
- package/dist/src/hooks/types.js.map +1 -1
- package/dist/src/index.d.ts +4 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +3 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/injection/message-injection.d.ts +12 -9
- package/dist/src/injection/message-injection.d.ts.map +1 -1
- package/dist/src/injection/message-injection.js +17 -16
- package/dist/src/injection/message-injection.js.map +1 -1
- package/dist/src/mcp/client.d.ts.map +1 -1
- package/dist/src/mcp/client.js +9 -0
- package/dist/src/mcp/client.js.map +1 -1
- package/dist/src/middleware/stages.d.ts +15 -2
- package/dist/src/middleware/stages.d.ts.map +1 -1
- package/dist/src/middleware/stages.js.map +1 -1
- package/dist/src/mime.d.ts +1 -0
- package/dist/src/mime.d.ts.map +1 -1
- package/dist/src/mime.js.map +1 -1
- package/dist/src/models/anthropic.d.ts +26 -1
- package/dist/src/models/anthropic.d.ts.map +1 -1
- package/dist/src/models/anthropic.js +178 -54
- package/dist/src/models/anthropic.js.map +1 -1
- package/dist/src/models/bedrock.d.ts +36 -17
- package/dist/src/models/bedrock.d.ts.map +1 -1
- package/dist/src/models/bedrock.js +166 -34
- package/dist/src/models/bedrock.js.map +1 -1
- package/dist/src/models/google/adapters.d.ts.map +1 -1
- package/dist/src/models/google/adapters.js +18 -4
- package/dist/src/models/google/adapters.js.map +1 -1
- package/dist/src/models/google/model.d.ts.map +1 -1
- package/dist/src/models/google/model.js +9 -7
- package/dist/src/models/google/model.js.map +1 -1
- package/dist/src/models/google/types.d.ts +2 -0
- package/dist/src/models/google/types.d.ts.map +1 -1
- package/dist/src/models/model.d.ts +72 -5
- package/dist/src/models/model.d.ts.map +1 -1
- package/dist/src/models/model.js +15 -0
- package/dist/src/models/model.js.map +1 -1
- package/dist/src/models/openai/cache.d.ts +31 -0
- package/dist/src/models/openai/cache.d.ts.map +1 -0
- package/dist/src/models/openai/cache.js +56 -0
- package/dist/src/models/openai/cache.js.map +1 -0
- package/dist/src/models/openai/chat-adapter.d.ts.map +1 -1
- package/dist/src/models/openai/chat-adapter.js +2 -0
- package/dist/src/models/openai/chat-adapter.js.map +1 -1
- package/dist/src/models/openai/model.d.ts.map +1 -1
- package/dist/src/models/openai/model.js +14 -3
- package/dist/src/models/openai/model.js.map +1 -1
- package/dist/src/models/openai/responses-adapter.d.ts.map +1 -1
- package/dist/src/models/openai/responses-adapter.js +3 -1
- package/dist/src/models/openai/responses-adapter.js.map +1 -1
- package/dist/src/models/openai/types.d.ts +5 -1
- package/dist/src/models/openai/types.d.ts.map +1 -1
- package/dist/src/models/routing/fallback-strategy.d.ts +13 -0
- package/dist/src/models/routing/fallback-strategy.d.ts.map +1 -0
- package/dist/src/models/routing/fallback-strategy.js +33 -0
- package/dist/src/models/routing/fallback-strategy.js.map +1 -0
- package/dist/src/models/routing/index.d.ts +11 -0
- package/dist/src/models/routing/index.d.ts.map +1 -0
- package/dist/src/models/routing/index.js +9 -0
- package/dist/src/models/routing/index.js.map +1 -0
- package/dist/src/models/routing/router.d.ts +161 -0
- package/dist/src/models/routing/router.d.ts.map +1 -0
- package/dist/src/models/routing/router.js +474 -0
- package/dist/src/models/routing/router.js.map +1 -0
- package/dist/src/models/routing/strategy.d.ts +53 -0
- package/dist/src/models/routing/strategy.d.ts.map +1 -0
- package/dist/src/models/routing/strategy.js +2 -0
- package/dist/src/models/routing/strategy.js.map +1 -0
- package/dist/src/models/streaming.d.ts +12 -0
- package/dist/src/models/streaming.d.ts.map +1 -1
- package/dist/src/models/streaming.js +17 -0
- package/dist/src/models/streaming.js.map +1 -1
- package/dist/src/multiagent/plugins.d.ts +3 -1
- package/dist/src/multiagent/plugins.d.ts.map +1 -1
- package/dist/src/multiagent/plugins.js +6 -1
- package/dist/src/multiagent/plugins.js.map +1 -1
- package/dist/src/plugins/registry.d.ts +3 -1
- package/dist/src/plugins/registry.d.ts.map +1 -1
- package/dist/src/plugins/registry.js +6 -1
- package/dist/src/plugins/registry.js.map +1 -1
- package/dist/src/retry/default-model-retry-strategy.d.ts +3 -8
- package/dist/src/retry/default-model-retry-strategy.d.ts.map +1 -1
- package/dist/src/retry/default-model-retry-strategy.js +3 -8
- package/dist/src/retry/default-model-retry-strategy.js.map +1 -1
- package/dist/src/retry/model-retry-strategy.d.ts +6 -9
- package/dist/src/retry/model-retry-strategy.d.ts.map +1 -1
- package/dist/src/retry/model-retry-strategy.js +8 -12
- package/dist/src/retry/model-retry-strategy.js.map +1 -1
- package/dist/src/session/session-manager.d.ts +4 -0
- package/dist/src/session/session-manager.d.ts.map +1 -1
- package/dist/src/session/session-manager.js +6 -0
- package/dist/src/session/session-manager.js.map +1 -1
- package/dist/src/storage/in-memory-storage.d.ts +8 -1
- package/dist/src/storage/in-memory-storage.d.ts.map +1 -1
- package/dist/src/storage/in-memory-storage.js +10 -0
- package/dist/src/storage/in-memory-storage.js.map +1 -1
- package/dist/src/storage/local-file-storage.d.ts +8 -1
- package/dist/src/storage/local-file-storage.d.ts.map +1 -1
- package/dist/src/storage/local-file-storage.js +10 -0
- package/dist/src/storage/local-file-storage.js.map +1 -1
- package/dist/src/storage/s3-storage.d.ts +8 -1
- package/dist/src/storage/s3-storage.d.ts.map +1 -1
- package/dist/src/storage/s3-storage.js +10 -0
- package/dist/src/storage/s3-storage.js.map +1 -1
- package/dist/src/storage/search/index.d.ts +13 -0
- package/dist/src/storage/search/index.d.ts.map +1 -0
- package/dist/src/storage/search/index.js +11 -0
- package/dist/src/storage/search/index.js.map +1 -0
- package/dist/src/storage/search/keyword.d.ts +23 -0
- package/dist/src/storage/search/keyword.d.ts.map +1 -0
- package/dist/src/storage/search/keyword.js +53 -0
- package/dist/src/storage/search/keyword.js.map +1 -0
- package/dist/src/storage/search/types.d.ts +24 -0
- package/dist/src/storage/search/types.d.ts.map +1 -0
- package/dist/src/storage/search/types.js +2 -0
- package/dist/src/storage/search/types.js.map +1 -0
- package/dist/src/storage/storage.d.ts +46 -1
- package/dist/src/storage/storage.d.ts.map +1 -1
- package/dist/src/storage/storage.js +22 -0
- package/dist/src/storage/storage.js.map +1 -1
- package/dist/src/telemetry/meter.d.ts +8 -6
- package/dist/src/telemetry/meter.d.ts.map +1 -1
- package/dist/src/telemetry/meter.js +8 -7
- package/dist/src/telemetry/meter.js.map +1 -1
- package/dist/src/telemetry/tracer.d.ts.map +1 -1
- package/dist/src/telemetry/tracer.js +9 -2
- package/dist/src/telemetry/tracer.js.map +1 -1
- package/dist/src/tools/executors/executor.d.ts +2 -0
- package/dist/src/tools/executors/executor.d.ts.map +1 -1
- package/dist/src/tools/executors/executor.js +6 -4
- package/dist/src/tools/executors/executor.js.map +1 -1
- package/dist/src/tools/executors/sequential.d.ts +1 -1
- package/dist/src/tools/executors/sequential.js +2 -2
- package/dist/src/tools/executors/sequential.js.map +1 -1
- package/dist/src/tools/mcp-tool.d.ts +2 -1
- package/dist/src/tools/mcp-tool.d.ts.map +1 -1
- package/dist/src/tools/mcp-tool.js +2 -1
- package/dist/src/tools/mcp-tool.js.map +1 -1
- package/dist/src/tools/tool.d.ts +2 -0
- package/dist/src/tools/tool.d.ts.map +1 -1
- package/dist/src/tools/tool.js.map +1 -1
- package/dist/src/tools/types.d.ts +8 -0
- package/dist/src/tools/types.d.ts.map +1 -1
- package/dist/src/tsconfig.tsbuildinfo +1 -1
- package/dist/src/types/agent.d.ts +14 -4
- package/dist/src/types/agent.d.ts.map +1 -1
- package/dist/src/types/agent.js +3 -2
- package/dist/src/types/agent.js.map +1 -1
- package/dist/src/types/media.d.ts +65 -3
- package/dist/src/types/media.d.ts.map +1 -1
- package/dist/src/types/media.js +68 -1
- package/dist/src/types/media.js.map +1 -1
- package/dist/src/types/messages.d.ts +6 -4
- package/dist/src/types/messages.d.ts.map +1 -1
- package/dist/src/types/messages.js +4 -1
- package/dist/src/types/messages.js.map +1 -1
- package/dist/src/vended-memory-stores/bedrock-knowledge-base/store.d.ts +11 -0
- package/dist/src/vended-memory-stores/bedrock-knowledge-base/store.d.ts.map +1 -1
- package/dist/src/vended-memory-stores/bedrock-knowledge-base/store.js +53 -3
- package/dist/src/vended-memory-stores/bedrock-knowledge-base/store.js.map +1 -1
- package/dist/src/vended-memory-stores/file-memory-store/index.d.ts +3 -0
- package/dist/src/vended-memory-stores/file-memory-store/index.d.ts.map +1 -0
- package/dist/src/vended-memory-stores/file-memory-store/index.js +2 -0
- package/dist/src/vended-memory-stores/file-memory-store/index.js.map +1 -0
- package/dist/src/vended-memory-stores/file-memory-store/store.d.ts +104 -0
- package/dist/src/vended-memory-stores/file-memory-store/store.d.ts.map +1 -0
- package/dist/src/vended-memory-stores/file-memory-store/store.js +237 -0
- package/dist/src/vended-memory-stores/file-memory-store/store.js.map +1 -0
- package/dist/src/vended-memory-stores/test-memory-store/store.d.ts.map +1 -1
- package/dist/src/vended-memory-stores/test-memory-store/store.js +2 -25
- package/dist/src/vended-memory-stores/test-memory-store/store.js.map +1 -1
- package/dist/src/vended-plugins/context-offloader/plugin.d.ts.map +1 -1
- package/dist/src/vended-plugins/context-offloader/plugin.js +2 -8
- package/dist/src/vended-plugins/context-offloader/plugin.js.map +1 -1
- package/dist/src/vended-tools/http-request/http-request.d.ts +1 -1
- package/dist/src/vended-tools/http-request/http-request.js +2 -2
- package/dist/src/vended-tools/http-request/http-request.js.map +1 -1
- package/dist/src/vended-tools/sleep/make-sleep.d.ts +4 -6
- package/dist/src/vended-tools/sleep/make-sleep.d.ts.map +1 -1
- package/dist/src/vended-tools/sleep/make-sleep.js +5 -7
- package/dist/src/vended-tools/sleep/make-sleep.js.map +1 -1
- package/package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IAC1C,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAsB;IACvD,OAAO,CAAC,KAAK,CAAQ;gBAET,MAAM,EAAE,eAAe;IA6CnC;;OAEG;IACH,IAAI,KAAK,IAAI,KAAK,CAEjB;IAEM,MAAM,CAAC,WAAW,EAAE,WAAW,GAAG,mBAAmB;CA8D7D"}
|
|
@@ -98,7 +98,7 @@ export class AgentAsTool extends Tool {
|
|
|
98
98
|
return this._agent;
|
|
99
99
|
}
|
|
100
100
|
async *stream(toolContext) {
|
|
101
|
-
const { toolUse } = toolContext;
|
|
101
|
+
const { toolUse, invocationState, cancelSignal } = toolContext;
|
|
102
102
|
const toolUseId = toolUse.toolUseId;
|
|
103
103
|
// Concurrency guard: loadSnapshot + agent.stream() must not overlap.
|
|
104
104
|
if (this._busy) {
|
|
@@ -114,7 +114,10 @@ export class AgentAsTool extends Tool {
|
|
|
114
114
|
// Stream the sub-agent, forwarding the outer invocation's state so
|
|
115
115
|
// mutations in the inner agent's hooks/tools are visible to the outer
|
|
116
116
|
// agent's downstream callbacks and final AgentResult.
|
|
117
|
-
const gen = this._agent.stream(input, {
|
|
117
|
+
const gen = this._agent.stream(input, {
|
|
118
|
+
invocationState,
|
|
119
|
+
cancelSignal,
|
|
120
|
+
});
|
|
118
121
|
let next = await gen.next();
|
|
119
122
|
while (!next.done) {
|
|
120
123
|
const event = next.value;
|
|
@@ -127,6 +130,9 @@ export class AgentAsTool extends Tool {
|
|
|
127
130
|
next = await gen.next();
|
|
128
131
|
}
|
|
129
132
|
const result = next.value;
|
|
133
|
+
if (result.stopReason === 'cancelled') {
|
|
134
|
+
return createErrorResult(`Agent '${this.name}' cancelled`, toolUseId);
|
|
135
|
+
}
|
|
130
136
|
// Build the tool result
|
|
131
137
|
if (result.structuredOutput !== undefined) {
|
|
132
138
|
return new ToolResultBlock({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-as-tool.js","sourceRoot":"","sources":["../../../src/agent/agent-as-tool.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,IAAI,eAAe,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;gBACjD,CAAC;gBAED,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAA;YACzB,CAAC;YACD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;YAEzB,IAAI,MAAM,CAAC,UAAU,KAAK,WAAW,EAAE,CAAC;gBACtC,OAAO,iBAAiB,CAAC,UAAU,IAAI,CAAC,IAAI,aAAa,EAAE,SAAS,CAAC,CAAA;YACvE,CAAC;YAED,wBAAwB;YACxB,IAAI,MAAM,CAAC,gBAAgB,KAAK,SAAS,EAAE,CAAC;gBAC1C,OAAO,IAAI,eAAe,CAAC;oBACzB,SAAS;oBACT,MAAM,EAAE,SAAS;oBACjB,OAAO,EAAE,CAAC,IAAI,SAAS,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,gBAA6B,EAAE,CAAC,CAAC;iBACzE,CAAC,CAAA;YACJ,CAAC;YAED,OAAO,IAAI,eAAe,CAAC;gBACzB,SAAS;gBACT,MAAM,EAAE,SAAS;gBACjB,OAAO,EAAE,CAAC,IAAI,SAAS,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,kCAAkC;aAChF,CAAC,CAAA;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,iBAAiB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAA;QAC5C,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QACpB,CAAC;IACH,CAAC;CACF"}
|
|
@@ -4,14 +4,8 @@
|
|
|
4
4
|
* When a tool is configured with `delegate: true`, this plugin ensures:
|
|
5
5
|
* 1. The delegation tool is the only tool called in the turn (single-call constraint)
|
|
6
6
|
* 2. The agent loop exits immediately after a successful delegation (via endTurn)
|
|
7
|
-
* 3. The
|
|
7
|
+
* 3. The delegation tool's content blocks become the final assistant message
|
|
8
8
|
* 4. Streaming events from the delegate agent are surfaced natively in the parent stream
|
|
9
|
-
*
|
|
10
|
-
* The final delegation message is produced in middleware after the core loop exits.
|
|
11
|
-
* It is written to `agent.messages` and yielded to stream consumers, but does not
|
|
12
|
-
* fire `MessageAddedEvent` hooks via `invokeCallbacks`. `SessionManager` with
|
|
13
|
-
* `saveLatestOn: 'invocation'` (default) is unaffected; `saveLatestOn: 'message'`
|
|
14
|
-
* may persist the endTurn placeholder instead of the delegation content.
|
|
15
9
|
*/
|
|
16
10
|
import type { Plugin } from '../plugins/plugin.js';
|
|
17
11
|
import type { LocalAgent } from '../types/agent.js';
|
|
@@ -34,7 +28,7 @@ import type { LocalAgent } from '../types/agent.js';
|
|
|
34
28
|
*/
|
|
35
29
|
export declare class AgentDelegation implements Plugin {
|
|
36
30
|
readonly name = "strands:agent-delegation";
|
|
37
|
-
/** Per-agent delegation state, created in _onBeforeTools and consumed in
|
|
31
|
+
/** Per-agent delegation state, created in _onBeforeTools and consumed in _onAfterTools. */
|
|
38
32
|
private readonly _state;
|
|
39
33
|
initAgent(agent: LocalAgent): void;
|
|
40
34
|
/**
|
|
@@ -47,15 +41,14 @@ export declare class AgentDelegation implements Plugin {
|
|
|
47
41
|
*/
|
|
48
42
|
private _onAfterToolCall;
|
|
49
43
|
/**
|
|
50
|
-
* AfterToolsEvent hook:
|
|
51
|
-
* delegation succeeded.
|
|
44
|
+
* AfterToolsEvent hook: sets endTurn to delegation content blocks when
|
|
45
|
+
* delegation succeeded with meaningful content.
|
|
52
46
|
*
|
|
53
|
-
* This hook runs at `HookOrder.SDK_LAST` (100)
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* is not a documented or supported pattern.
|
|
47
|
+
* This hook runs at `HookOrder.SDK_LAST` (100), after every SDK and vended-plugin
|
|
48
|
+
* hook. A hook registered above that order still runs afterwards and could flip
|
|
49
|
+
* a `ToolResultBlock` to error, but `endTurn` is already committed and the loop
|
|
50
|
+
* will exit anyway — mutating a committed `ToolResultBlock`'s status is not a
|
|
51
|
+
* supported pattern.
|
|
59
52
|
*/
|
|
60
53
|
private _onAfterTools;
|
|
61
54
|
/**
|
|
@@ -65,21 +58,7 @@ export declare class AgentDelegation implements Plugin {
|
|
|
65
58
|
* For delegation tools in a multi-tool batch, returns an error result without
|
|
66
59
|
* executing the tool. For valid single-tool delegation, unwraps inner agent
|
|
67
60
|
* streaming events so they appear as native events in the parent stream.
|
|
68
|
-
*
|
|
69
|
-
* A post-init middleware registered inside this one can still bypass the check
|
|
70
|
-
* by spreading a modified context with a different `tool` to `next()`. This is a
|
|
71
|
-
* framework-level trust boundary, not addressable at the plugin level.
|
|
72
|
-
* The sanctioned path for tool replacement is `BeforeToolCallEvent.selectedTool`.
|
|
73
61
|
*/
|
|
74
62
|
private _handleToolExecution;
|
|
75
|
-
/**
|
|
76
|
-
* AgentStreamStage middleware: transforms the AgentResult on delegation.
|
|
77
|
-
*
|
|
78
|
-
* When the main loop exits via endTurn triggered by delegation (identified by
|
|
79
|
-
* the `endTurnViaDelegation` flag on DelegationState), this middleware replaces
|
|
80
|
-
* the default endTurn result with the proper delegation result: the sub-agent's
|
|
81
|
-
* content from the tool-result message.
|
|
82
|
-
*/
|
|
83
|
-
private _handleStream;
|
|
84
63
|
}
|
|
85
64
|
//# sourceMappingURL=agent-delegation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-delegation.d.ts","sourceRoot":"","sources":["../../../src/agent/agent-delegation.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"agent-delegation.d.ts","sourceRoot":"","sources":["../../../src/agent/agent-delegation.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAoB,MAAM,mBAAmB,CAAA;AAiDrE;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,eAAgB,YAAW,MAAM;IAC5C,QAAQ,CAAC,IAAI,8BAA6B;IAE1C,2FAA2F;IAC3F,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA6C;IAEpE,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IA2ClC;;;OAGG;IACH,OAAO,CAAC,cAAc;IAkBtB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAuBxB;;;;;;;;;OASG;IACH,OAAO,CAAC,aAAa;IA+BrB;;;;;;;OAOG;YACY,oBAAoB;CAmDpC"}
|
|
@@ -4,21 +4,16 @@
|
|
|
4
4
|
* When a tool is configured with `delegate: true`, this plugin ensures:
|
|
5
5
|
* 1. The delegation tool is the only tool called in the turn (single-call constraint)
|
|
6
6
|
* 2. The agent loop exits immediately after a successful delegation (via endTurn)
|
|
7
|
-
* 3. The
|
|
7
|
+
* 3. The delegation tool's content blocks become the final assistant message
|
|
8
8
|
* 4. Streaming events from the delegate agent are surfaced natively in the parent stream
|
|
9
|
-
*
|
|
10
|
-
* The final delegation message is produced in middleware after the core loop exits.
|
|
11
|
-
* It is written to `agent.messages` and yielded to stream consumers, but does not
|
|
12
|
-
* fire `MessageAddedEvent` hooks via `invokeCallbacks`. `SessionManager` with
|
|
13
|
-
* `saveLatestOn: 'invocation'` (default) is unaffected; `saveLatestOn: 'message'`
|
|
14
|
-
* may persist the endTurn placeholder instead of the delegation content.
|
|
15
9
|
*/
|
|
16
|
-
import {
|
|
17
|
-
import { AfterToolCallEvent, AfterToolsEvent, BeforeModelCallEvent, BeforeToolsEvent, MessageAddedEvent, StreamEvent, ToolStreamUpdateEvent, } from '../hooks/events.js';
|
|
10
|
+
import { AfterToolCallEvent, AfterToolsEvent, BeforeModelCallEvent, BeforeToolsEvent, StreamEvent, ToolStreamUpdateEvent, } from '../hooks/events.js';
|
|
18
11
|
import { HookOrder } from '../hooks/types.js';
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
12
|
+
import { ExecuteToolStage } from '../middleware/index.js';
|
|
13
|
+
import { TextBlock, ToolResultBlock, ToolUseBlock } from '../types/messages.js';
|
|
21
14
|
import { AgentAsTool } from './agent-as-tool.js';
|
|
15
|
+
import { STRUCTURED_OUTPUT_TOOL_NAME } from '../tools/structured-output-tool.js';
|
|
16
|
+
import { logger } from '../logging/logger.js';
|
|
22
17
|
/**
|
|
23
18
|
* Checks whether a tool registered on the agent is a delegation AgentAsTool.
|
|
24
19
|
*/
|
|
@@ -59,7 +54,7 @@ function toContentBlocks(block) {
|
|
|
59
54
|
*/
|
|
60
55
|
export class AgentDelegation {
|
|
61
56
|
name = 'strands:agent-delegation';
|
|
62
|
-
/** Per-agent delegation state, created in _onBeforeTools and consumed in
|
|
57
|
+
/** Per-agent delegation state, created in _onBeforeTools and consumed in _onAfterTools. */
|
|
63
58
|
_state = new WeakMap();
|
|
64
59
|
initAgent(agent) {
|
|
65
60
|
// Fail fast: delegation is incompatible with stateful models.
|
|
@@ -85,9 +80,6 @@ export class AgentDelegation {
|
|
|
85
80
|
// async function* doesn't bind lexical `this`; capture for the terminal callback.
|
|
86
81
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
87
82
|
const self = this;
|
|
88
|
-
agent.addMiddleware(AgentStreamStage, async function* (context, next) {
|
|
89
|
-
return yield* self._handleStream(context, next);
|
|
90
|
-
});
|
|
91
83
|
// ExecuteToolStage middleware: unwraps inner agent streaming events for delegation tools
|
|
92
84
|
// so they appear as native events in the parent agent's stream.
|
|
93
85
|
agent.addMiddleware(ExecuteToolStage, async function* (context, next) {
|
|
@@ -137,15 +129,14 @@ export class AgentDelegation {
|
|
|
137
129
|
state.toolUseId = event.toolUse.toolUseId;
|
|
138
130
|
}
|
|
139
131
|
/**
|
|
140
|
-
* AfterToolsEvent hook:
|
|
141
|
-
* delegation succeeded.
|
|
132
|
+
* AfterToolsEvent hook: sets endTurn to delegation content blocks when
|
|
133
|
+
* delegation succeeded with meaningful content.
|
|
142
134
|
*
|
|
143
|
-
* This hook runs at `HookOrder.SDK_LAST` (100)
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
* is not a documented or supported pattern.
|
|
135
|
+
* This hook runs at `HookOrder.SDK_LAST` (100), after every SDK and vended-plugin
|
|
136
|
+
* hook. A hook registered above that order still runs afterwards and could flip
|
|
137
|
+
* a `ToolResultBlock` to error, but `endTurn` is already committed and the loop
|
|
138
|
+
* will exit anyway — mutating a committed `ToolResultBlock`'s status is not a
|
|
139
|
+
* supported pattern.
|
|
149
140
|
*/
|
|
150
141
|
_onAfterTools(event) {
|
|
151
142
|
if (event.agent.model.stateful)
|
|
@@ -159,8 +150,18 @@ export class AgentDelegation {
|
|
|
159
150
|
delete state.toolUseId;
|
|
160
151
|
return;
|
|
161
152
|
}
|
|
162
|
-
|
|
163
|
-
|
|
153
|
+
// Skip delegation when the parent expects structured output.
|
|
154
|
+
if (event.agent.toolRegistry.get(STRUCTURED_OUTPUT_TOOL_NAME)) {
|
|
155
|
+
logger.debug(`tool_use_id=<${state.toolUseId}> | parent requires structured output, skipping delegation`);
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
// Skip delegation when the tool result has no meaningful content.
|
|
159
|
+
const endTurnContent = toContentBlocks(resultBlock);
|
|
160
|
+
if (endTurnContent.length === 0 || endTurnContent.every((block) => 'text' in block && block.text === '')) {
|
|
161
|
+
logger.debug(`tool_use_id=<${state.toolUseId}> | delegation produced blank content, skipping delegation`);
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
event.endTurn = endTurnContent;
|
|
164
165
|
}
|
|
165
166
|
/**
|
|
166
167
|
* ExecuteToolStage middleware: enforces single-call constraint and surfaces
|
|
@@ -169,11 +170,6 @@ export class AgentDelegation {
|
|
|
169
170
|
* For delegation tools in a multi-tool batch, returns an error result without
|
|
170
171
|
* executing the tool. For valid single-tool delegation, unwraps inner agent
|
|
171
172
|
* streaming events so they appear as native events in the parent stream.
|
|
172
|
-
*
|
|
173
|
-
* A post-init middleware registered inside this one can still bypass the check
|
|
174
|
-
* by spreading a modified context with a different `tool` to `next()`. This is a
|
|
175
|
-
* framework-level trust boundary, not addressable at the plugin level.
|
|
176
|
-
* The sanctioned path for tool replacement is `BeforeToolCallEvent.selectedTool`.
|
|
177
173
|
*/
|
|
178
174
|
async *_handleToolExecution(context, next, agent) {
|
|
179
175
|
// Non-delegation tools or stateful models pass through unchanged.
|
|
@@ -218,73 +214,5 @@ export class AgentDelegation {
|
|
|
218
214
|
}
|
|
219
215
|
return result.value;
|
|
220
216
|
}
|
|
221
|
-
/**
|
|
222
|
-
* AgentStreamStage middleware: transforms the AgentResult on delegation.
|
|
223
|
-
*
|
|
224
|
-
* When the main loop exits via endTurn triggered by delegation (identified by
|
|
225
|
-
* the `endTurnViaDelegation` flag on DelegationState), this middleware replaces
|
|
226
|
-
* the default endTurn result with the proper delegation result: the sub-agent's
|
|
227
|
-
* content from the tool-result message.
|
|
228
|
-
*/
|
|
229
|
-
async *_handleStream(context, next) {
|
|
230
|
-
// Clear any stale state from a prior failed invocation.
|
|
231
|
-
this._state.delete(context.agent);
|
|
232
|
-
let streamResult;
|
|
233
|
-
try {
|
|
234
|
-
streamResult = yield* next(context);
|
|
235
|
-
}
|
|
236
|
-
catch (error) {
|
|
237
|
-
this._state.delete(context.agent);
|
|
238
|
-
throw error;
|
|
239
|
-
}
|
|
240
|
-
const state = this._state.get(context.agent);
|
|
241
|
-
this._state.delete(context.agent);
|
|
242
|
-
if (!state?.toolUseId || !state.endTurnViaDelegation)
|
|
243
|
-
return streamResult;
|
|
244
|
-
// Only transform if the result stopped via endTurn.
|
|
245
|
-
// Other stop reasons pass through unchanged.
|
|
246
|
-
if (streamResult.result.stopReason !== 'endTurn')
|
|
247
|
-
return streamResult;
|
|
248
|
-
// Find the delegation tool's result in agent.messages. The tool-result
|
|
249
|
-
// message is the last user message before the endTurn assistant message.
|
|
250
|
-
const messages = context.agent.messages;
|
|
251
|
-
let resultBlock;
|
|
252
|
-
for (let i = messages.length - 1; i >= 0; i--) {
|
|
253
|
-
const msg = messages[i];
|
|
254
|
-
if (msg && msg.role === 'user') {
|
|
255
|
-
resultBlock = msg.content.find((block) => block instanceof ToolResultBlock && block.toolUseId === state.toolUseId);
|
|
256
|
-
break;
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
if (!resultBlock || resultBlock.status === 'error')
|
|
260
|
-
return streamResult;
|
|
261
|
-
const delegationMessage = new Message({
|
|
262
|
-
role: 'assistant',
|
|
263
|
-
content: toContentBlocks(resultBlock),
|
|
264
|
-
});
|
|
265
|
-
// Replace the endTurn message the main loop appended with the delegation content.
|
|
266
|
-
const lastMessage = messages[messages.length - 1];
|
|
267
|
-
if (lastMessage?.role === 'assistant') {
|
|
268
|
-
messages[messages.length - 1] = delegationMessage;
|
|
269
|
-
}
|
|
270
|
-
else {
|
|
271
|
-
messages.push(delegationMessage);
|
|
272
|
-
}
|
|
273
|
-
yield new MessageAddedEvent({
|
|
274
|
-
agent: context.agent,
|
|
275
|
-
message: delegationMessage,
|
|
276
|
-
invocationState: streamResult.result.invocationState,
|
|
277
|
-
});
|
|
278
|
-
// Replace AgentResult with the delegation tool's content
|
|
279
|
-
return {
|
|
280
|
-
result: new AgentResult({
|
|
281
|
-
stopReason: 'endTurn',
|
|
282
|
-
lastMessage: delegationMessage,
|
|
283
|
-
invocationState: streamResult.result.invocationState,
|
|
284
|
-
...(streamResult.result.metrics !== undefined && { metrics: streamResult.result.metrics }),
|
|
285
|
-
...(streamResult.result.traces !== undefined && { traces: streamResult.result.traces }),
|
|
286
|
-
}),
|
|
287
|
-
};
|
|
288
|
-
}
|
|
289
217
|
}
|
|
290
218
|
//# sourceMappingURL=agent-delegation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-delegation.js","sourceRoot":"","sources":["../../../src/agent/agent-delegation.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"agent-delegation.js","sourceRoot":"","sources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AI,EAAE,CAAA;QAC7B,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YACpB,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAA;YAE1B,wFAAwF;YACxF,kFAAkF;YAClF,IAAI,KAAK,CAAC,IAAI,KAAK,uBAAuB,EAAE,CAAC;gBAC3C,MAAM,SAAS,GAAI,KAA+B,CAAC,KAAK,CAAC,IAAI,CAAA;gBAC7D,IAAI,SAAS,YAAY,WAAW,EAAE,CAAC;oBACrC,MAAM,SAA6B,CAAA;gBACrC,CAAC;qBAAM,CAAC;oBACN,mFAAmF;oBACnF,MAAM,KAAK,CAAA;gBACb,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,MAAM,KAAK,CAAA;YACb,CAAC;YAED,MAAM,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAA;QAC3B,CAAC;QACD,OAAO,MAAM,CAAC,KAAK,CAAA;IACrB,CAAC;CACF"}
|
|
@@ -4,6 +4,7 @@ import type { JSONValue } from '../types/json.js';
|
|
|
4
4
|
import { McpClient } from '../mcp/index.js';
|
|
5
5
|
import { type Tool } from '../tools/tool.js';
|
|
6
6
|
import { Model } from '../models/model.js';
|
|
7
|
+
import { ModelRouter } from '../models/routing/router.js';
|
|
7
8
|
import type { BaseModelConfig } from '../models/model.js';
|
|
8
9
|
import { ToolRegistry } from '../registry/tool-registry.js';
|
|
9
10
|
import { StateStore } from '../state-store.js';
|
|
@@ -29,6 +30,7 @@ import { InterruptState } from '../interrupt.js';
|
|
|
29
30
|
import type { TakeSnapshotOptions } from './snapshot.js';
|
|
30
31
|
import type { Snapshot } from '../types/snapshot.js';
|
|
31
32
|
import type { Sandbox } from '../sandbox/base.js';
|
|
33
|
+
import { ContextManager } from '../context-manager/context-manager.js';
|
|
32
34
|
/**
|
|
33
35
|
* Recursive type definition for nested tool arrays.
|
|
34
36
|
* Allows tools to be organized in nested arrays of any depth.
|
|
@@ -47,24 +49,33 @@ export type ToolList = (Tool | McpClient | Agent | ToolList)[];
|
|
|
47
49
|
* - `'sequential'` — runs tool calls one at a time
|
|
48
50
|
*
|
|
49
51
|
* Cancellation works identically in both modes: {@link Agent.cancel} flips
|
|
50
|
-
* {@link Agent.cancelSignal}
|
|
52
|
+
* {@link Agent.cancelSignal}, which SDK-managed tool contexts expose as `context.cancelSignal`.
|
|
51
53
|
* In concurrent mode, prompt batch-wide cancellation requires every in-flight tool
|
|
52
54
|
* to honor the signal.
|
|
53
55
|
*/
|
|
54
56
|
export type ToolExecutorStrategy = 'sequential' | 'concurrent';
|
|
55
57
|
/**
|
|
56
|
-
* Supported
|
|
58
|
+
* Supported string presets for the `contextManager` parameter.
|
|
57
59
|
*/
|
|
58
60
|
export declare const CONTEXT_MANAGER_STRATEGIES: readonly ["auto", "agentic"];
|
|
59
|
-
|
|
61
|
+
type ContextManagerPreset = (typeof CONTEXT_MANAGER_STRATEGIES)[number];
|
|
62
|
+
/**
|
|
63
|
+
* Supported values for the `contextManager` parameter.
|
|
64
|
+
*
|
|
65
|
+
* - `"auto"`: Managed context with proactive compression + offloading.
|
|
66
|
+
* - `"agentic"`: Model-driven context management via injected tools.
|
|
67
|
+
* - `ContextManager` instance: Full control over strategy-driven offloading.
|
|
68
|
+
* - `false`: Explicitly disable all context management (no compression, no offloading).
|
|
69
|
+
*/
|
|
70
|
+
export type ContextManagerStrategy = ContextManagerPreset | ContextManager | false;
|
|
60
71
|
/**
|
|
61
72
|
* Configuration object for creating a new Agent.
|
|
62
73
|
*/
|
|
63
74
|
export type AgentConfig = {
|
|
64
75
|
/**
|
|
65
|
-
* The model instance that the agent will use to make decisions.
|
|
66
|
-
* Accepts
|
|
67
|
-
* When a
|
|
76
|
+
* The model instance or router that the agent will use to make decisions.
|
|
77
|
+
* Accepts a Model, ModelRouter, or a string representing a Bedrock model ID.
|
|
78
|
+
* When a router is provided, `agent.model` remains its default concrete model.
|
|
68
79
|
*
|
|
69
80
|
* @example
|
|
70
81
|
* ```typescript
|
|
@@ -83,7 +94,7 @@ export type AgentConfig = {
|
|
|
83
94
|
* })
|
|
84
95
|
* ```
|
|
85
96
|
*/
|
|
86
|
-
model?: Model<BaseModelConfig> | string;
|
|
97
|
+
model?: Model<BaseModelConfig> | ModelRouter | string;
|
|
87
98
|
/** An initial set of messages to seed the agent's conversation history. */
|
|
88
99
|
messages?: Message[] | MessageData[];
|
|
89
100
|
/**
|
|
@@ -115,13 +126,15 @@ export type AgentConfig = {
|
|
|
115
126
|
*/
|
|
116
127
|
conversationManager?: ConversationManager;
|
|
117
128
|
/**
|
|
118
|
-
* Context management strategy.
|
|
129
|
+
* Context management strategy that controls how messages are compressed and offloaded.
|
|
119
130
|
*
|
|
120
131
|
* - `"auto"`: SummarizingConversationManager with proactive compression + ContextOffloader.
|
|
121
132
|
* - `"agentic"`: (Experimental) Lets the model drive context management via injected tools.
|
|
122
133
|
* This mode may change in future versions.
|
|
134
|
+
* - `ContextManager` instance: Strategy-driven offloading with overflow recovery.
|
|
135
|
+
* - `false`: Explicitly disable context management (no compression, no offloading).
|
|
123
136
|
*
|
|
124
|
-
*
|
|
137
|
+
* When a `ContextManager` instance is provided, any co-provided `conversationManager` is ignored.
|
|
125
138
|
* Defaults to undefined (SlidingWindowConversationManager, no offloader).
|
|
126
139
|
*
|
|
127
140
|
* @remarks The offloader uses in-memory storage by default. When an agent-level
|
|
@@ -254,6 +267,7 @@ export declare class Agent implements LocalAgent, InvokableAgent {
|
|
|
254
267
|
* The model provider used by the agent for inference.
|
|
255
268
|
*/
|
|
256
269
|
model: Model;
|
|
270
|
+
private readonly _modelRouter?;
|
|
257
271
|
/**
|
|
258
272
|
* The system prompt to pass to the model provider.
|
|
259
273
|
*/
|
|
@@ -270,10 +284,15 @@ export declare class Agent implements LocalAgent, InvokableAgent {
|
|
|
270
284
|
* Optional description of what the agent does.
|
|
271
285
|
*/
|
|
272
286
|
readonly description?: string;
|
|
287
|
+
/**
|
|
288
|
+
* The context manager for strategy-driven offloading, if configured.
|
|
289
|
+
*/
|
|
290
|
+
readonly contextManager?: ContextManager | undefined;
|
|
273
291
|
/**
|
|
274
292
|
* The session manager for saving and restoring agent sessions, if configured.
|
|
275
293
|
*/
|
|
276
294
|
readonly sessionManager?: SessionManager | undefined;
|
|
295
|
+
private _sessionId?;
|
|
277
296
|
/**
|
|
278
297
|
* The memory manager for cross-session memory retrieval and storage, if configured.
|
|
279
298
|
*/
|
|
@@ -290,6 +309,13 @@ export declare class Agent implements LocalAgent, InvokableAgent {
|
|
|
290
309
|
* environment (e.g. browsers, where no host default is registered).
|
|
291
310
|
*/
|
|
292
311
|
get sandbox(): Sandbox;
|
|
312
|
+
/**
|
|
313
|
+
* A stable, unique identifier for the current conversation session.
|
|
314
|
+
*
|
|
315
|
+
* If a SessionManager is attached, delegates to its sessionId.
|
|
316
|
+
* Otherwise, lazily generates and caches a random 8-character hex string.
|
|
317
|
+
*/
|
|
318
|
+
get sessionId(): string;
|
|
293
319
|
private readonly _hooksRegistry;
|
|
294
320
|
private readonly _middlewareRegistry;
|
|
295
321
|
private readonly _pluginRegistry;
|
|
@@ -480,7 +506,7 @@ export declare class Agent implements LocalAgent, InvokableAgent {
|
|
|
480
506
|
/**
|
|
481
507
|
* The cancellation signal for the current invocation.
|
|
482
508
|
*
|
|
483
|
-
*
|
|
509
|
+
* SDK-managed tool contexts receive this as `context.cancelSignal` for cancellable operations.
|
|
484
510
|
* Hooks can check `event.agent.cancelSignal.aborted` to detect cancellation.
|
|
485
511
|
*/
|
|
486
512
|
get cancelSignal(): AbortSignal;
|
|
@@ -494,7 +520,7 @@ export declare class Agent implements LocalAgent, InvokableAgent {
|
|
|
494
520
|
* - At the top of each agent loop cycle
|
|
495
521
|
*
|
|
496
522
|
* If a tool is already executing, it will run to completion unless
|
|
497
|
-
* the tool checks
|
|
523
|
+
* the tool checks `context.cancelSignal` internally.
|
|
498
524
|
*
|
|
499
525
|
* Hook callbacks can check `event.agent.cancelSignal.aborted` to detect
|
|
500
526
|
* cancellation and adjust their behavior accordingly.
|
|
@@ -725,6 +751,8 @@ export declare class Agent implements LocalAgent, InvokableAgent {
|
|
|
725
751
|
* @returns Object containing the assistant message, stop reason, and optional redaction message
|
|
726
752
|
*/
|
|
727
753
|
private _invokeModel;
|
|
754
|
+
private _modelForAttempt;
|
|
755
|
+
private _nextAttemptCount;
|
|
728
756
|
/**
|
|
729
757
|
* Invokes the model through the InvokeModelStage middleware chain.
|
|
730
758
|
* Builds an InvokeModelContext from current agent state and composes the
|
|
@@ -732,6 +760,8 @@ export declare class Agent implements LocalAgent, InvokableAgent {
|
|
|
732
760
|
* using context fields directly (not re-derived from the agent).
|
|
733
761
|
*
|
|
734
762
|
* @param invocationState - Per-invocation state shared across hooks and tools
|
|
763
|
+
* @param selectedModel - Model the chain starts with; middleware may replace it
|
|
764
|
+
* @param invokedModelRef - Slot filled with the model the terminal actually invoked
|
|
735
765
|
* @param toolChoice - Optional tool choice to force specific tool usage
|
|
736
766
|
* @returns StreamAggregatedResult from the model (or middleware short-circuit)
|
|
737
767
|
*/
|
|
@@ -748,6 +778,7 @@ export declare class Agent implements LocalAgent, InvokableAgent {
|
|
|
748
778
|
* These are separate event classes because they represent different granularities
|
|
749
779
|
* (partial deltas vs finished blocks). Both are yielded in the stream and hookable.
|
|
750
780
|
*
|
|
781
|
+
* @param model - Model selected for this call
|
|
751
782
|
* @param messages - Messages to send to the model
|
|
752
783
|
* @param streamOptions - Options for streaming
|
|
753
784
|
* @returns StreamAggregatedResult containing message, stop reason, and optional redaction message
|
|
@@ -784,10 +815,10 @@ export declare class Agent implements LocalAgent, InvokableAgent {
|
|
|
784
815
|
/**
|
|
785
816
|
* Estimate the input token count for the next model call.
|
|
786
817
|
*
|
|
787
|
-
* Uses the token counting strategy: reads
|
|
788
|
-
* from the last assistant message's metadata as a known baseline, then
|
|
789
|
-
* only new messages added after it. Falls back to full estimation when no metadata
|
|
790
|
-
*
|
|
818
|
+
* Uses the token counting strategy: reads the total prompt the model processed (including cached
|
|
819
|
+
* tokens) plus outputTokens from the last assistant message's metadata as a known baseline, then
|
|
820
|
+
* estimates only new messages added after it. Falls back to full estimation when no metadata is
|
|
821
|
+
* available (cold start or first call).
|
|
791
822
|
*
|
|
792
823
|
* @param streamOptions - The stream options containing system prompt and tool specs
|
|
793
824
|
* @returns Estimated input token count
|
|
@@ -808,5 +839,8 @@ export declare class Agent implements LocalAgent, InvokableAgent {
|
|
|
808
839
|
* @returns MessageAddedEvent to be yielded
|
|
809
840
|
*/
|
|
810
841
|
private _appendMessage;
|
|
842
|
+
private _appendContinuationMessages;
|
|
843
|
+
private _hasOpenUserTurn;
|
|
811
844
|
}
|
|
845
|
+
export {};
|
|
812
846
|
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/agent/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,KAAK,gBAAgB,EAErB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACtB,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EAIL,OAAO,EACP,KAAK,WAAW,EAEhB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EAItB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAmB,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAI7D,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAyC,MAAM,oBAAoB,CAAA;AAGhG,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAG9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,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