@openrouter/agent 0.8.0 → 0.10.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/README.md +732 -7
- package/THIRD_PARTY_NOTICES.md +25 -0
- package/esm/index.d.ts +20 -5
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +10 -3
- package/esm/index.js.map +1 -1
- package/esm/inner-loop/call-model.d.ts.map +1 -1
- package/esm/inner-loop/call-model.js +63 -46
- package/esm/inner-loop/call-model.js.map +1 -1
- package/esm/inner-loop/resume-tool-results.d.ts +128 -0
- package/esm/inner-loop/resume-tool-results.d.ts.map +1 -0
- package/esm/inner-loop/resume-tool-results.js +244 -0
- package/esm/inner-loop/resume-tool-results.js.map +1 -0
- package/esm/lib/agent-tool.d.ts +92 -0
- package/esm/lib/agent-tool.d.ts.map +1 -0
- package/esm/lib/agent-tool.js +211 -0
- package/esm/lib/agent-tool.js.map +1 -0
- package/esm/lib/async-params.d.ts +96 -0
- package/esm/lib/async-params.d.ts.map +1 -1
- package/esm/lib/async-params.js +30 -1
- package/esm/lib/async-params.js.map +1 -1
- package/esm/lib/async-tool-registry.d.ts +134 -0
- package/esm/lib/async-tool-registry.d.ts.map +1 -0
- package/esm/lib/async-tool-registry.js +352 -0
- package/esm/lib/async-tool-registry.js.map +1 -0
- package/esm/lib/async-tools.d.ts +23 -0
- package/esm/lib/async-tools.d.ts.map +1 -0
- package/esm/lib/async-tools.js +19 -0
- package/esm/lib/async-tools.js.map +1 -0
- package/esm/lib/conversation-state.d.ts +1 -0
- package/esm/lib/conversation-state.d.ts.map +1 -1
- package/esm/lib/conversation-state.js +8 -0
- package/esm/lib/conversation-state.js.map +1 -1
- package/esm/lib/doom-loop.d.ts +533 -0
- package/esm/lib/doom-loop.d.ts.map +1 -0
- package/esm/lib/doom-loop.js +1221 -0
- package/esm/lib/doom-loop.js.map +1 -0
- package/esm/lib/hooks-schemas.d.ts +33 -0
- package/esm/lib/hooks-schemas.d.ts.map +1 -1
- package/esm/lib/hooks-schemas.js +54 -0
- package/esm/lib/hooks-schemas.js.map +1 -1
- package/esm/lib/hooks-types.d.ts +6 -2
- package/esm/lib/hooks-types.d.ts.map +1 -1
- package/esm/lib/hooks-types.js.map +1 -1
- package/esm/lib/model-result.d.ts +648 -12
- package/esm/lib/model-result.d.ts.map +1 -1
- package/esm/lib/model-result.js +2784 -164
- package/esm/lib/model-result.js.map +1 -1
- package/esm/lib/next-turn-params.d.ts.map +1 -1
- package/esm/lib/next-turn-params.js +3 -1
- package/esm/lib/next-turn-params.js.map +1 -1
- package/esm/lib/next-turn-params.test.js +72 -0
- package/esm/lib/next-turn-params.test.js.map +1 -1
- package/esm/lib/reusable-stream.d.ts +9 -0
- package/esm/lib/reusable-stream.d.ts.map +1 -1
- package/esm/lib/reusable-stream.js +17 -0
- package/esm/lib/reusable-stream.js.map +1 -1
- package/esm/lib/stream-transformers.d.ts +21 -1
- package/esm/lib/stream-transformers.d.ts.map +1 -1
- package/esm/lib/stream-transformers.js +45 -0
- package/esm/lib/stream-transformers.js.map +1 -1
- package/esm/lib/tool-check.d.ts +76 -0
- package/esm/lib/tool-check.d.ts.map +1 -0
- package/esm/lib/tool-check.js +241 -0
- package/esm/lib/tool-check.js.map +1 -0
- package/esm/lib/tool-concurrency.d.ts +42 -0
- package/esm/lib/tool-concurrency.d.ts.map +1 -0
- package/esm/lib/tool-concurrency.js +80 -0
- package/esm/lib/tool-concurrency.js.map +1 -0
- package/esm/lib/tool-context.d.ts +45 -1
- package/esm/lib/tool-context.d.ts.map +1 -1
- package/esm/lib/tool-context.js +60 -1
- package/esm/lib/tool-context.js.map +1 -1
- package/esm/lib/tool-executor.d.ts +52 -9
- package/esm/lib/tool-executor.d.ts.map +1 -1
- package/esm/lib/tool-executor.js +253 -21
- package/esm/lib/tool-executor.js.map +1 -1
- package/esm/lib/tool-orchestrator.d.ts.map +1 -1
- package/esm/lib/tool-orchestrator.js +87 -50
- package/esm/lib/tool-orchestrator.js.map +1 -1
- package/esm/lib/tool-set-types.d.ts +298 -0
- package/esm/lib/tool-set-types.d.ts.map +1 -0
- package/esm/lib/tool-set-types.js +2 -0
- package/esm/lib/tool-set-types.js.map +1 -0
- package/esm/lib/tool-set.d.ts +157 -0
- package/esm/lib/tool-set.d.ts.map +1 -0
- package/esm/lib/tool-set.js +473 -0
- package/esm/lib/tool-set.js.map +1 -0
- package/esm/lib/tool-task.d.ts +157 -0
- package/esm/lib/tool-task.d.ts.map +1 -0
- package/esm/lib/tool-task.js +206 -0
- package/esm/lib/tool-task.js.map +1 -0
- package/esm/lib/tool-types.d.ts +667 -38
- package/esm/lib/tool-types.d.ts.map +1 -1
- package/esm/lib/tool-types.js +59 -10
- package/esm/lib/tool-types.js.map +1 -1
- package/esm/lib/tool.d.ts +227 -19
- package/esm/lib/tool.d.ts.map +1 -1
- package/esm/lib/tool.js +206 -6
- package/esm/lib/tool.js.map +1 -1
- package/esm/mcp/auth/auth-resolver.d.ts +14 -0
- package/esm/mcp/auth/auth-resolver.d.ts.map +1 -0
- package/esm/mcp/auth/auth-resolver.js +27 -0
- package/esm/mcp/auth/auth-resolver.js.map +1 -0
- package/esm/mcp/auth/auth-types.d.ts +33 -0
- package/esm/mcp/auth/auth-types.d.ts.map +1 -0
- package/esm/mcp/auth/auth-types.js +4 -0
- package/esm/mcp/auth/auth-types.js.map +1 -0
- package/esm/mcp/build-tools.d.ts +29 -0
- package/esm/mcp/build-tools.d.ts.map +1 -0
- package/esm/mcp/build-tools.js +80 -0
- package/esm/mcp/build-tools.js.map +1 -0
- package/esm/mcp/cache/cache-store.d.ts +24 -0
- package/esm/mcp/cache/cache-store.d.ts.map +1 -0
- package/esm/mcp/cache/cache-store.js +20 -0
- package/esm/mcp/cache/cache-store.js.map +1 -0
- package/esm/mcp/cache/cache-types.d.ts +71 -0
- package/esm/mcp/cache/cache-types.d.ts.map +1 -0
- package/esm/mcp/cache/cache-types.js +49 -0
- package/esm/mcp/cache/cache-types.js.map +1 -0
- package/esm/mcp/cache/serialize.d.ts +25 -0
- package/esm/mcp/cache/serialize.d.ts.map +1 -0
- package/esm/mcp/cache/serialize.js +96 -0
- package/esm/mcp/cache/serialize.js.map +1 -0
- package/esm/mcp/close-quietly.d.ts +24 -0
- package/esm/mcp/close-quietly.d.ts.map +1 -0
- package/esm/mcp/close-quietly.js +30 -0
- package/esm/mcp/close-quietly.js.map +1 -0
- package/esm/mcp/create-mcp-tools.d.ts +13 -0
- package/esm/mcp/create-mcp-tools.d.ts.map +1 -0
- package/esm/mcp/create-mcp-tools.js +87 -0
- package/esm/mcp/create-mcp-tools.js.map +1 -0
- package/esm/mcp/elicitation.d.ts +11 -0
- package/esm/mcp/elicitation.d.ts.map +1 -0
- package/esm/mcp/elicitation.js +51 -0
- package/esm/mcp/elicitation.js.map +1 -0
- package/esm/mcp/errors.d.ts +91 -0
- package/esm/mcp/errors.d.ts.map +1 -0
- package/esm/mcp/errors.js +91 -0
- package/esm/mcp/errors.js.map +1 -0
- package/esm/mcp/handle.d.ts +66 -0
- package/esm/mcp/handle.d.ts.map +1 -0
- package/esm/mcp/handle.js +323 -0
- package/esm/mcp/handle.js.map +1 -0
- package/esm/mcp/index.d.ts +13 -0
- package/esm/mcp/index.d.ts.map +1 -0
- package/esm/mcp/index.js +11 -0
- package/esm/mcp/index.js.map +1 -0
- package/esm/mcp/mcp-connection.d.ts +150 -0
- package/esm/mcp/mcp-connection.d.ts.map +1 -0
- package/esm/mcp/mcp-connection.js +478 -0
- package/esm/mcp/mcp-connection.js.map +1 -0
- package/esm/mcp/mcp-sdk.d.ts +10 -0
- package/esm/mcp/mcp-sdk.d.ts.map +1 -0
- package/esm/mcp/mcp-sdk.js +37 -0
- package/esm/mcp/mcp-sdk.js.map +1 -0
- package/esm/mcp/rehydrate.d.ts +76 -0
- package/esm/mcp/rehydrate.d.ts.map +1 -0
- package/esm/mcp/rehydrate.js +505 -0
- package/esm/mcp/rehydrate.js.map +1 -0
- package/esm/mcp/resource-tools.d.ts +17 -0
- package/esm/mcp/resource-tools.d.ts.map +1 -0
- package/esm/mcp/resource-tools.js +155 -0
- package/esm/mcp/resource-tools.js.map +1 -0
- package/esm/mcp/result-mapper.d.ts +19 -0
- package/esm/mcp/result-mapper.d.ts.map +1 -0
- package/esm/mcp/result-mapper.js +40 -0
- package/esm/mcp/result-mapper.js.map +1 -0
- package/esm/mcp/schema/json-schema-guards.d.ts +14 -0
- package/esm/mcp/schema/json-schema-guards.d.ts.map +1 -0
- package/esm/mcp/schema/json-schema-guards.js +19 -0
- package/esm/mcp/schema/json-schema-guards.js.map +1 -0
- package/esm/mcp/schema/json-schema-to-zod.d.ts +20 -0
- package/esm/mcp/schema/json-schema-to-zod.d.ts.map +1 -0
- package/esm/mcp/schema/json-schema-to-zod.js +72 -0
- package/esm/mcp/schema/json-schema-to-zod.js.map +1 -0
- package/esm/mcp/tool-wrapper.d.ts +41 -0
- package/esm/mcp/tool-wrapper.d.ts.map +1 -0
- package/esm/mcp/tool-wrapper.js +131 -0
- package/esm/mcp/tool-wrapper.js.map +1 -0
- package/esm/mcp/transport-types.d.ts +45 -0
- package/esm/mcp/transport-types.d.ts.map +1 -0
- package/esm/mcp/transport-types.js +2 -0
- package/esm/mcp/transport-types.js.map +1 -0
- package/esm/mcp/types.d.ts +119 -0
- package/esm/mcp/types.d.ts.map +1 -0
- package/esm/mcp/types.js +2 -0
- package/esm/mcp/types.js.map +1 -0
- package/esm/mcp/version.d.ts +3 -0
- package/esm/mcp/version.d.ts.map +1 -0
- package/esm/mcp/version.js +5 -0
- package/esm/mcp/version.js.map +1 -0
- package/package.json +70 -5
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { applyNextTurnParamsToRequest, executeNextTurnParamsFunctions, } from './next-turn-params.js';
|
|
2
2
|
import { extractToolCallsFromResponse, responseHasToolCalls } from './stream-transformers.js';
|
|
3
3
|
import { isFunctionCallItem } from './stream-type-guards.js';
|
|
4
|
-
import { executeTool, findToolByName } from './tool-executor.js';
|
|
5
|
-
import { isAutoResolvableTool, isMcpTool } from './tool-types.js';
|
|
4
|
+
import { executeTool, findToolByName, isAsyncToolInvocation } from './tool-executor.js';
|
|
5
|
+
import { isAutoResolvableTool, isMcpTool, isUnifiedTool } from './tool-types.js';
|
|
6
6
|
import { buildTurnContext } from './turn-context.js';
|
|
7
7
|
/**
|
|
8
8
|
* Execute tool calls and manage multi-turn conversations
|
|
@@ -48,45 +48,13 @@ export async function executeToolLoop(sendRequest, initialInput, initialRequest,
|
|
|
48
48
|
break;
|
|
49
49
|
}
|
|
50
50
|
// Execute all tool calls in parallel (parallel tool calling)
|
|
51
|
-
const toolCallPromises = toolCalls.map(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
source: 'client',
|
|
59
|
-
result: null,
|
|
60
|
-
error: new Error(`Tool "${toolCall.name}" not found in tool definitions`),
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
if (!isAutoResolvableTool(tool)) {
|
|
64
|
-
// Tool has no execute/onToolCalled - return null to filter out
|
|
65
|
-
return null;
|
|
66
|
-
}
|
|
67
|
-
// Find the raw tool call from the response output
|
|
68
|
-
const rawToolCall = currentResponse.output.find((item) => isFunctionCallItem(item) && item.callId === toolCall.id);
|
|
69
|
-
if (!rawToolCall) {
|
|
70
|
-
throw new Error(`Could not find raw tool call for ${toolCall.id}`);
|
|
71
|
-
}
|
|
72
|
-
// Convert to FunctionCallItem format
|
|
73
|
-
const openResponsesToolCall = {
|
|
74
|
-
type: 'function_call',
|
|
75
|
-
callId: rawToolCall.callId,
|
|
76
|
-
name: rawToolCall.name,
|
|
77
|
-
arguments: rawToolCall.arguments,
|
|
78
|
-
id: rawToolCall.callId,
|
|
79
|
-
status: rawToolCall.status,
|
|
80
|
-
};
|
|
81
|
-
// Build turn context with full information
|
|
82
|
-
const turnContext = buildTurnContext({
|
|
83
|
-
numberOfTurns: currentRound,
|
|
84
|
-
toolCall: openResponsesToolCall,
|
|
85
|
-
turnRequest: currentRequest,
|
|
86
|
-
});
|
|
87
|
-
// Execute the tool
|
|
88
|
-
return executeTool(tool, toolCall, turnContext, onPreliminaryResult);
|
|
89
|
-
});
|
|
51
|
+
const toolCallPromises = toolCalls.map((toolCall) => executeOrchestratedCall(toolCall, {
|
|
52
|
+
tools,
|
|
53
|
+
response: currentResponse,
|
|
54
|
+
request: currentRequest,
|
|
55
|
+
round: currentRound,
|
|
56
|
+
onPreliminaryResult,
|
|
57
|
+
}));
|
|
90
58
|
// Wait for all tool executions to complete in parallel
|
|
91
59
|
const settledResults = await Promise.allSettled(toolCallPromises);
|
|
92
60
|
// Process settled results, handling both fulfilled and rejected promises
|
|
@@ -96,21 +64,32 @@ export async function executeToolLoop(sendRequest, initialInput, initialRequest,
|
|
|
96
64
|
if (!toolCall) {
|
|
97
65
|
return;
|
|
98
66
|
}
|
|
67
|
+
const errorResult = (error) => {
|
|
68
|
+
const failedTool = findToolByName(tools, toolCall.name);
|
|
69
|
+
return {
|
|
70
|
+
toolCallId: toolCall.id,
|
|
71
|
+
toolName: toolCall.name,
|
|
72
|
+
source: failedTool !== undefined && isMcpTool(failedTool) ? 'mcp' : 'client',
|
|
73
|
+
result: null,
|
|
74
|
+
error,
|
|
75
|
+
};
|
|
76
|
+
};
|
|
99
77
|
if (settled.status === 'fulfilled') {
|
|
100
|
-
|
|
78
|
+
// This legacy loop predates async tools and only understands
|
|
79
|
+
// synchronous execution results (background/deferred invocations
|
|
80
|
+
// are handled by ModelResult's live loop). Surface an explicit
|
|
81
|
+
// error rather than silently dropping the call — an unpaired
|
|
82
|
+
// function_call would poison any history built from these results.
|
|
83
|
+
if (settled.value !== null && isAsyncToolInvocation(settled.value)) {
|
|
84
|
+
roundResults.push(errorResult(new Error(`Tool "${toolCall.name}" uses an async lifecycle (background/deferred), which executeToolLoop does not support — run it through callModel instead.`)));
|
|
85
|
+
}
|
|
86
|
+
else if (settled.value !== null) {
|
|
101
87
|
roundResults.push(settled.value);
|
|
102
88
|
}
|
|
103
89
|
}
|
|
104
90
|
else {
|
|
105
91
|
// Promise rejected - create error result
|
|
106
|
-
|
|
107
|
-
roundResults.push({
|
|
108
|
-
toolCallId: toolCall.id,
|
|
109
|
-
toolName: toolCall.name,
|
|
110
|
-
source: rejectedTool !== undefined && isMcpTool(rejectedTool) ? 'mcp' : 'client',
|
|
111
|
-
result: null,
|
|
112
|
-
error: settled.reason instanceof Error ? settled.reason : new Error(String(settled.reason)),
|
|
113
|
-
});
|
|
92
|
+
roundResults.push(errorResult(settled.reason instanceof Error ? settled.reason : new Error(String(settled.reason))));
|
|
114
93
|
}
|
|
115
94
|
});
|
|
116
95
|
toolExecutionResults.push(...roundResults);
|
|
@@ -182,4 +161,62 @@ export function getToolExecutionErrors(results) {
|
|
|
182
161
|
.filter((result) => result.error !== undefined)
|
|
183
162
|
.map((result) => result.error);
|
|
184
163
|
}
|
|
164
|
+
/**
|
|
165
|
+
* Execute one orchestrated tool call: resolve the tool, rebuild the raw
|
|
166
|
+
* `function_call` item, build the turn context, and run the tool. Returns
|
|
167
|
+
* `null` for calls with nothing to execute (manual tools), an error-shaped
|
|
168
|
+
* result for unknown tools.
|
|
169
|
+
*/
|
|
170
|
+
async function executeOrchestratedCall(toolCall, round) {
|
|
171
|
+
const tool = findToolByName(round.tools, toolCall.name);
|
|
172
|
+
if (!tool) {
|
|
173
|
+
// Tool not found in definitions
|
|
174
|
+
return {
|
|
175
|
+
toolCallId: toolCall.id,
|
|
176
|
+
toolName: toolCall.name,
|
|
177
|
+
source: 'client',
|
|
178
|
+
result: null,
|
|
179
|
+
error: new Error(`Tool "${toolCall.name}" not found in tool definitions`),
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
if (!isAutoResolvableTool(tool)) {
|
|
183
|
+
// Tool has no execute/onToolCalled - return null to filter out
|
|
184
|
+
return null;
|
|
185
|
+
}
|
|
186
|
+
// Async lifecycles are unsupported here — short-circuit BEFORE running
|
|
187
|
+
// the body. This matters for deferred tools especially: their run()
|
|
188
|
+
// executes in-round and would open an external ticket that this loop can
|
|
189
|
+
// never resolve (an orphan external task).
|
|
190
|
+
if (isUnifiedTool(tool) && tool.function.lifecycle && tool.function.lifecycle !== 'sync') {
|
|
191
|
+
return {
|
|
192
|
+
toolCallId: toolCall.id,
|
|
193
|
+
toolName: toolCall.name,
|
|
194
|
+
source: isMcpTool(tool) ? 'mcp' : 'client',
|
|
195
|
+
result: null,
|
|
196
|
+
error: new Error(`Tool "${toolCall.name}" uses an async lifecycle ('${tool.function.lifecycle}'), which executeToolLoop does not support — run it through callModel instead.`),
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
// Find the raw tool call from the response output
|
|
200
|
+
const rawToolCall = round.response.output.find((item) => isFunctionCallItem(item) && item.callId === toolCall.id);
|
|
201
|
+
if (!rawToolCall) {
|
|
202
|
+
throw new Error(`Could not find raw tool call for ${toolCall.id}`);
|
|
203
|
+
}
|
|
204
|
+
// Convert to FunctionCallItem format
|
|
205
|
+
const openResponsesToolCall = {
|
|
206
|
+
type: 'function_call',
|
|
207
|
+
callId: rawToolCall.callId,
|
|
208
|
+
name: rawToolCall.name,
|
|
209
|
+
arguments: rawToolCall.arguments,
|
|
210
|
+
id: rawToolCall.callId,
|
|
211
|
+
status: rawToolCall.status,
|
|
212
|
+
};
|
|
213
|
+
// Build turn context with full information
|
|
214
|
+
const turnContext = buildTurnContext({
|
|
215
|
+
numberOfTurns: round.round,
|
|
216
|
+
toolCall: openResponsesToolCall,
|
|
217
|
+
turnRequest: round.request,
|
|
218
|
+
});
|
|
219
|
+
// Execute the tool
|
|
220
|
+
return executeTool(tool, toolCall, turnContext, round.onPreliminaryResult);
|
|
221
|
+
}
|
|
185
222
|
//# sourceMappingURL=tool-orchestrator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-orchestrator.js","sourceRoot":"","sources":["../../src/lib/tool-orchestrator.ts"],"names":[],"mappings":"AACA,OAAO,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AW,CAAC,MAAM;QACtB,MAAM,EAAE,WAAW,CAAC,MAAM;KAC3B,CAAC;IAEF,2CAA2C;IAC3C,MAAM,WAAW,GAAG,gBAAgB,CAAC;QACnC,aAAa,EAAE,KAAK,CAAC,KAAK;QAC1B,QAAQ,EAAE,qBAAqB;QAC/B,WAAW,EAAE,KAAK,CAAC,OAAO;KAC3B,CAAC,CAAC;IAEH,mBAAmB;IACnB,OAAO,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC;AAC7E,CAAC"}
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import { TOOL_SET_SNAPSHOT } from './async-params.js';
|
|
2
|
+
import type { ClientTool, ConversationState, CorrelatedToolEventUnion, ServerToolBase, Tool } from './tool-types.js';
|
|
3
|
+
/** Client tool: `function.name` literal. */
|
|
4
|
+
export type ClientToolName<T> = T extends {
|
|
5
|
+
function: {
|
|
6
|
+
name: infer N extends string;
|
|
7
|
+
};
|
|
8
|
+
} ? N : never;
|
|
9
|
+
/**
|
|
10
|
+
* Server-tool stable ID.
|
|
11
|
+
* Prefixed so it can never collide with a client function name.
|
|
12
|
+
* Prefers an explicit `id` on the tool; falls back to `server:${config.type}`.
|
|
13
|
+
*
|
|
14
|
+
* When `T`'s `id` has been widened to plain `string` (e.g. a custom-ID
|
|
15
|
+
* `ServerTool<T, TId>` value erased to the exported `ServerToolBase`
|
|
16
|
+
* interface), the concrete literal is no longer visible at the type level.
|
|
17
|
+
* Synthesizing `` `server:${config.type}` `` in that case would be unsound:
|
|
18
|
+
* the runtime `id` could be anything, and the synthesized literal would
|
|
19
|
+
* both reject the real id and falsely claim a default that may not hold.
|
|
20
|
+
* Widening to `string` here is the sound choice — it accepts any runtime id.
|
|
21
|
+
* Only tools with no structural `id` at all fall back to the synthesized
|
|
22
|
+
* default, and concrete `ServerTool<T, TId>` values keep their literal `TId`.
|
|
23
|
+
*/
|
|
24
|
+
export type ServerToolIdOf<T> = 'id' extends keyof T ? T extends {
|
|
25
|
+
readonly id?: infer Id;
|
|
26
|
+
} ? Extract<Id, string> extends infer StringId extends string ? string extends StringId ? string : StringId : never : never : T extends {
|
|
27
|
+
readonly config: {
|
|
28
|
+
type: infer K extends string;
|
|
29
|
+
};
|
|
30
|
+
} ? `server:${K}` : never;
|
|
31
|
+
/** Union of every addressable id for one tool. */
|
|
32
|
+
export type ToolIdOf<T extends Tool> = T extends ServerToolBase ? ServerToolIdOf<T> : ClientToolName<T>;
|
|
33
|
+
export type ToolIdsOfTuple<T extends readonly Tool[]> = ToolIdOf<T[number]>;
|
|
34
|
+
export type ClientToolNamesOfTuple<T extends readonly Tool[]> = ClientToolName<Extract<T[number], ClientTool>>;
|
|
35
|
+
export type ServerToolIdsOfTuple<T extends readonly Tool[]> = ServerToolIdOf<Extract<T[number], ServerToolBase>>;
|
|
36
|
+
/** Lookup tool by id inside a tuple (preserves concrete member type). */
|
|
37
|
+
export type ToolById<T extends readonly Tool[], Id extends string> = Extract<{
|
|
38
|
+
[I in keyof T]: T[I] extends Tool ? (ToolIdOf<T[I]> extends Id ? T[I] : never) : never;
|
|
39
|
+
}[number], Tool>;
|
|
40
|
+
/**
|
|
41
|
+
* Distributive per-element filter used for the wide (non-tuple) case below.
|
|
42
|
+
* A "naked" type parameter (`El`) is required for the conditional to
|
|
43
|
+
* distribute over the `T[number]` union; wrapping it in an indexed access
|
|
44
|
+
* (e.g. checking `T[number]` directly inside the conditional) would collapse
|
|
45
|
+
* to a single non-distributive check instead.
|
|
46
|
+
*/
|
|
47
|
+
type KeepIfActive<El, Active extends string> = El extends Tool ? string extends ToolIdOf<El> ? El : ToolIdOf<El> extends Active ? El : never : never;
|
|
48
|
+
/**
|
|
49
|
+
* Keep tuple order; drop members whose id is not in Active.
|
|
50
|
+
*
|
|
51
|
+
* A genuine fixed-length tuple (`T['length']` is a literal number) is
|
|
52
|
+
* filtered by exact head/tail recursion, preserving order and concrete
|
|
53
|
+
* per-element types. A dynamic `readonly Tool[]` (e.g. an `@openrouter/agent/mcp`
|
|
54
|
+
* tool array not typed as a literal tuple) has `number extends T['length']`,
|
|
55
|
+
* so it falls back to a distributive per-element filter instead of
|
|
56
|
+
* recursing — the tuple pattern never matches a general array, and without
|
|
57
|
+
* this branch the recursion always bottoms out at `readonly []`.
|
|
58
|
+
*/
|
|
59
|
+
export type FilterToolsByIds<T extends readonly Tool[], Active extends string> = number extends T['length'] ? readonly KeepIfActive<T[number], Active>[] : T extends readonly [
|
|
60
|
+
infer H extends Tool,
|
|
61
|
+
...infer R extends readonly Tool[]
|
|
62
|
+
] ? ToolIdOf<H> extends Active ? readonly [
|
|
63
|
+
H,
|
|
64
|
+
...FilterToolsByIds<R, Active>
|
|
65
|
+
] : FilterToolsByIds<R, Active> : readonly [];
|
|
66
|
+
/** IDs that are statically enabled or selected from the conditional partition. */
|
|
67
|
+
type ResolvedActiveIds<P extends Partition, TActive extends string> = P['enabled'] | Extract<TActive, P['conditional']>;
|
|
68
|
+
/**
|
|
69
|
+
* Exact tuple for static partitions; possible active members for partitions
|
|
70
|
+
* whose runtime predicates can change tuple membership.
|
|
71
|
+
*/
|
|
72
|
+
export type ResolvedTools<TTools extends readonly Tool[], P extends Partition, TActive extends P['conditional'] = P['conditional']> = [
|
|
73
|
+
P['conditional']
|
|
74
|
+
] extends [
|
|
75
|
+
never
|
|
76
|
+
] ? FilterToolsByIds<TTools, P['enabled'] & ToolIdsOfTuple<TTools>> : readonly FilterToolsByIds<TTools, ResolvedActiveIds<P, TActive> & ToolIdsOfTuple<TTools>>[number][];
|
|
77
|
+
/**
|
|
78
|
+
* Enabled = statically on (default, or .activate / situation.enabled)
|
|
79
|
+
* Disabled = statically off (.deactivate / situation.disabled)
|
|
80
|
+
* Conditional = runtime predicate (.activateWhen / .deactivateWhen / situation rules)
|
|
81
|
+
*
|
|
82
|
+
* Invariants (enforced by mutators via Exclude):
|
|
83
|
+
* Enabled ∩ Disabled = ∅
|
|
84
|
+
* Enabled ∩ Conditional = ∅
|
|
85
|
+
* Disabled ∩ Conditional = ∅
|
|
86
|
+
* Enabled ∪ Disabled ∪ Conditional = all known IDs
|
|
87
|
+
*/
|
|
88
|
+
export type Partition = {
|
|
89
|
+
enabled: string;
|
|
90
|
+
disabled: string;
|
|
91
|
+
conditional: string;
|
|
92
|
+
};
|
|
93
|
+
export type EmptyPartition = {
|
|
94
|
+
enabled: never;
|
|
95
|
+
disabled: never;
|
|
96
|
+
conditional: never;
|
|
97
|
+
};
|
|
98
|
+
/** Default construction: every tool ID enabled. */
|
|
99
|
+
export type InitialPartition<T extends readonly Tool[]> = {
|
|
100
|
+
enabled: ToolIdsOfTuple<T>;
|
|
101
|
+
disabled: never;
|
|
102
|
+
conditional: never;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Deliberately imprecise partition for mutable `ToolSet` instances.
|
|
106
|
+
*
|
|
107
|
+
* A mutable `ToolSet` mutates one shared runtime object in place, and any
|
|
108
|
+
* number of aliases can reference that same object. If mutators refined the
|
|
109
|
+
* partition type the way the immutable path does, two aliases of the same
|
|
110
|
+
* live object could statically claim different, contradictory exact
|
|
111
|
+
* partitions the instant one of them mutated — an unsound state (e.g. one
|
|
112
|
+
* alias's type promising `disabled: never` while the object it points to
|
|
113
|
+
* has, in fact, just been deactivated through another alias).
|
|
114
|
+
*
|
|
115
|
+
* Mutable instances therefore use this single widened partition,
|
|
116
|
+
* unconditionally and unchanging, for their entire lifetime: nothing is
|
|
117
|
+
* ever statically guaranteed enabled or disabled, and every id is treated
|
|
118
|
+
* as `conditional` (only knowable by calling `resolve()`). Every alias of a
|
|
119
|
+
* mutable instance carries the exact same (already maximally conservative)
|
|
120
|
+
* type, so no alias can ever make a compile-time claim the runtime object
|
|
121
|
+
* could contradict.
|
|
122
|
+
*/
|
|
123
|
+
export type WidenedPartition<T extends readonly Tool[]> = {
|
|
124
|
+
enabled: never;
|
|
125
|
+
disabled: never;
|
|
126
|
+
conditional: ToolIdsOfTuple<T>;
|
|
127
|
+
};
|
|
128
|
+
export type ActivatePartition<P extends Partition, Name extends string> = {
|
|
129
|
+
enabled: P['enabled'] | Name;
|
|
130
|
+
disabled: Exclude<P['disabled'], Name>;
|
|
131
|
+
conditional: Exclude<P['conditional'], Name>;
|
|
132
|
+
};
|
|
133
|
+
export type DeactivatePartition<P extends Partition, Name extends string> = {
|
|
134
|
+
enabled: Exclude<P['enabled'], Name>;
|
|
135
|
+
disabled: P['disabled'] | Name;
|
|
136
|
+
conditional: Exclude<P['conditional'], Name>;
|
|
137
|
+
};
|
|
138
|
+
export type ConditionalPartition<P extends Partition, Name extends string> = {
|
|
139
|
+
enabled: Exclude<P['enabled'], Name>;
|
|
140
|
+
disabled: Exclude<P['disabled'], Name>;
|
|
141
|
+
conditional: P['conditional'] | Name;
|
|
142
|
+
};
|
|
143
|
+
export type ActivationInput<TShared extends Record<string, unknown> = Record<string, unknown>> = {
|
|
144
|
+
state?: ConversationState;
|
|
145
|
+
context?: TShared;
|
|
146
|
+
};
|
|
147
|
+
export type ActivationPredicate<TShared extends Record<string, unknown> = Record<string, unknown>> = (input: ActivationInput<TShared>) => boolean;
|
|
148
|
+
export type SituationConditionalRule<TShared extends Record<string, unknown> = Record<string, unknown>> = ActivationPredicate<TShared> | {
|
|
149
|
+
mode?: 'activateWhen' | 'deactivateWhen';
|
|
150
|
+
predicate: ActivationPredicate<TShared>;
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* Declarative fixed partition overlay for one named situation.
|
|
154
|
+
* Keys not listed keep the base ToolSet partition after the overlay.
|
|
155
|
+
*/
|
|
156
|
+
export type SituationConfig<TIds extends string = string, TShared extends Record<string, unknown> = Record<string, unknown>> = {
|
|
157
|
+
/** Statically on in this situation. */
|
|
158
|
+
enabled?: readonly TIds[];
|
|
159
|
+
/** Statically off in this situation. */
|
|
160
|
+
disabled?: readonly TIds[];
|
|
161
|
+
/**
|
|
162
|
+
* Conditional tools for this situation.
|
|
163
|
+
* Default mode is activateWhen (inactive until predicate is true).
|
|
164
|
+
* Use `{ mode: 'deactivateWhen', predicate }` for the reverse default.
|
|
165
|
+
*/
|
|
166
|
+
conditional?: {
|
|
167
|
+
readonly [K in TIds]?: SituationConditionalRule<TShared>;
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
/** Situations registry accumulated on the ToolSet type. */
|
|
171
|
+
export type SituationMap = Record<string, {
|
|
172
|
+
enabled: string;
|
|
173
|
+
disabled: string;
|
|
174
|
+
conditional: string;
|
|
175
|
+
}>;
|
|
176
|
+
export type EmptySituations = Record<never, never>;
|
|
177
|
+
/**
|
|
178
|
+
* Deliberately imprecise situation registry for mutable `ToolSet` instances.
|
|
179
|
+
*
|
|
180
|
+
* Mirrors {@link WidenedPartition}: since `defineSituations` on a mutable
|
|
181
|
+
* instance mutates the shared runtime situation registry in place, its type
|
|
182
|
+
* cannot statically promise a specific set of situation names without
|
|
183
|
+
* risking the same cross-alias contradiction. `string` keeps every
|
|
184
|
+
* situation name assignable while still requiring a real string key.
|
|
185
|
+
*/
|
|
186
|
+
export type WidenedSituationMap = Record<string, Partition>;
|
|
187
|
+
export type SituationNames<S extends SituationMap> = keyof S & string;
|
|
188
|
+
/**
|
|
189
|
+
* Infer the static partition contribution of a situation config object.
|
|
190
|
+
* Missing fields contribute `never`.
|
|
191
|
+
*/
|
|
192
|
+
export type InferSituationEntry<C> = {
|
|
193
|
+
enabled: C extends {
|
|
194
|
+
enabled: readonly (infer E extends string)[];
|
|
195
|
+
} ? E : never;
|
|
196
|
+
disabled: C extends {
|
|
197
|
+
disabled: readonly (infer D extends string)[];
|
|
198
|
+
} ? D : never;
|
|
199
|
+
conditional: C extends {
|
|
200
|
+
conditional: infer Cond;
|
|
201
|
+
} ? keyof Cond & string : never;
|
|
202
|
+
};
|
|
203
|
+
export type InferSituationMap<M> = {
|
|
204
|
+
[K in keyof M]: InferSituationEntry<M[K]>;
|
|
205
|
+
};
|
|
206
|
+
/**
|
|
207
|
+
* Apply a situation overlay onto a base partition.
|
|
208
|
+
* Situation wins for every id it mentions; others stay from base.
|
|
209
|
+
*/
|
|
210
|
+
export type ApplySituationPartition<Base extends Partition, Sit extends {
|
|
211
|
+
enabled: string;
|
|
212
|
+
disabled: string;
|
|
213
|
+
conditional: string;
|
|
214
|
+
}> = {
|
|
215
|
+
enabled: Exclude<Base['enabled'], Sit['enabled'] | Sit['disabled'] | Sit['conditional']> | Sit['enabled'];
|
|
216
|
+
disabled: Exclude<Base['disabled'], Sit['enabled'] | Sit['disabled'] | Sit['conditional']> | Sit['disabled'];
|
|
217
|
+
conditional: Exclude<Base['conditional'], Sit['enabled'] | Sit['disabled'] | Sit['conditional']> | Sit['conditional'];
|
|
218
|
+
};
|
|
219
|
+
export type StatusReason = 'default' | 'activate' | 'deactivate' | 'activateWhen' | 'deactivateWhen' | 'situation';
|
|
220
|
+
export type ToolStatusEntry = {
|
|
221
|
+
readonly enabled: boolean;
|
|
222
|
+
readonly reason: StatusReason;
|
|
223
|
+
/**
|
|
224
|
+
* The last applicable directive for this tool before predicates ran, if any.
|
|
225
|
+
* Absent when the tool is still at its construction default.
|
|
226
|
+
*/
|
|
227
|
+
readonly directive?: 'activate' | 'deactivate' | 'activateWhen' | 'deactivateWhen';
|
|
228
|
+
/** True when the final state depended on evaluating a runtime predicate. */
|
|
229
|
+
readonly predicate?: boolean;
|
|
230
|
+
};
|
|
231
|
+
export type StatusByToolMap<TIds extends string> = {
|
|
232
|
+
readonly [K in TIds]: ToolStatusEntry;
|
|
233
|
+
};
|
|
234
|
+
/**
|
|
235
|
+
* What resolve() / resolveSituation() returns.
|
|
236
|
+
*
|
|
237
|
+
* For static-only partitions (`conditional = never`), the snapshot is fully
|
|
238
|
+
* known at compile time. When conditional ≠ never, TActive selects possible
|
|
239
|
+
* members from `P['conditional']`; `P['enabled']` is always included. Tools
|
|
240
|
+
* become a readonly array of that possible member union because predicates
|
|
241
|
+
* can change length and positions at runtime. Runtime arrays/status are exact.
|
|
242
|
+
*
|
|
243
|
+
* `disabled` is declared as the complement of the *definitely-enabled* set
|
|
244
|
+
* (`P['enabled']`), not of `TActive`. A conditional id's predicate can
|
|
245
|
+
* resolve to either outcome at runtime — `#resolveWithActivation` pushes it
|
|
246
|
+
* into `disabled` whenever the predicate says off — so conditional ids must
|
|
247
|
+
* remain in both the `enabled` and `disabled` upper bounds for the declared
|
|
248
|
+
* types to stay sound. (Subtracting `TActive`, which already includes
|
|
249
|
+
* `P['conditional']`, would wrongly exclude conditional ids from `disabled`.)
|
|
250
|
+
*/
|
|
251
|
+
export type ResolvedToolSnapshot<TTools extends readonly Tool[], P extends Partition, TActive extends P['conditional'] = P['conditional']> = {
|
|
252
|
+
/** Active tools only, construction order preserved, concrete member types kept. */
|
|
253
|
+
readonly tools: ResolvedTools<TTools, P, TActive>;
|
|
254
|
+
/** Active client names only (`callModel.activeTools` wire format). Server ids omitted. */
|
|
255
|
+
readonly activeTools: readonly Extract<ResolvedActiveIds<P, TActive>, ClientToolNamesOfTuple<TTools>>[];
|
|
256
|
+
/** Spread-safe input for `callModel`; snapshot metadata is intentionally excluded. */
|
|
257
|
+
readonly callModel: {
|
|
258
|
+
readonly tools: ResolvedTools<TTools, P, TActive>;
|
|
259
|
+
readonly activeTools: readonly Extract<ResolvedActiveIds<P, TActive>, ClientToolNamesOfTuple<TTools>>[];
|
|
260
|
+
};
|
|
261
|
+
/** IDs that resolved active (client + server). */
|
|
262
|
+
readonly enabled: readonly (ResolvedActiveIds<P, TActive> & ToolIdsOfTuple<TTools>)[];
|
|
263
|
+
/**
|
|
264
|
+
* IDs that resolved inactive (client + server). Sound upper bound: the
|
|
265
|
+
* complement of the definitely-enabled set, so conditional ids whose
|
|
266
|
+
* predicate resolves `false` are included here too.
|
|
267
|
+
*/
|
|
268
|
+
readonly disabled: readonly Exclude<ToolIdsOfTuple<TTools>, P['enabled']>[];
|
|
269
|
+
/** Exhaustive id → status entry. Every ToolIdsOfTuple key present. */
|
|
270
|
+
readonly statusByTool: StatusByToolMap<ToolIdsOfTuple<TTools>>;
|
|
271
|
+
/** Internal marker allowing `callModel` to recognize a snapshot spread. */
|
|
272
|
+
readonly [TOOL_SET_SNAPSHOT]: true;
|
|
273
|
+
};
|
|
274
|
+
/**
|
|
275
|
+
* Structural shape for extracting partition/situation generics from either
|
|
276
|
+
* mutable or immutable `ToolSet` instances.
|
|
277
|
+
*/
|
|
278
|
+
export type ToolSetLike<TTools extends readonly Tool[] = readonly Tool[], TShared extends Record<string, unknown> = Record<string, unknown>, P extends Partition = Partition, Sit extends SituationMap = SituationMap> = {
|
|
279
|
+
readonly tools: TTools;
|
|
280
|
+
readonly _partition?: P;
|
|
281
|
+
readonly _situations?: Sit;
|
|
282
|
+
readonly _shared?: TShared;
|
|
283
|
+
};
|
|
284
|
+
/** Every known tool-set ID. */
|
|
285
|
+
export type InferAllIds<TS> = TS extends ToolSetLike<infer T, any, any, any> ? ToolIdsOfTuple<T> : never;
|
|
286
|
+
/** Definitely-enabled IDs (static). */
|
|
287
|
+
export type InferEnabledIds<TS> = TS extends ToolSetLike<any, any, infer P, any> ? P['enabled'] : never;
|
|
288
|
+
/** Definitely-disabled IDs (static). */
|
|
289
|
+
export type InferDisabledIds<TS> = TS extends ToolSetLike<any, any, infer P, any> ? P['disabled'] : never;
|
|
290
|
+
/** Conditionally-activated IDs (runtime predicate). */
|
|
291
|
+
export type InferConditionalIds<TS> = TS extends ToolSetLike<any, any, infer P, any> ? P['conditional'] : never;
|
|
292
|
+
/**
|
|
293
|
+
* Name-correlated streaming events for a tools tuple.
|
|
294
|
+
* Delegates to the agent's core {@link CorrelatedToolEventUnion}.
|
|
295
|
+
*/
|
|
296
|
+
export type InferToolSet<T extends readonly Tool[]> = CorrelatedToolEventUnion<T>;
|
|
297
|
+
export {};
|
|
298
|
+
//# sourceMappingURL=tool-set-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-set-types.d.ts","sourceRoot":"","sources":["../../src/lib/tool-set-types.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