@openrouter/agent 0.1.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.
Files changed (98) hide show
  1. package/README.md +367 -0
  2. package/esm/api-shape-helpers/claude-message.d.ts +218 -0
  3. package/esm/api-shape-helpers/claude-message.d.ts.map +1 -0
  4. package/esm/api-shape-helpers/claude-message.js +6 -0
  5. package/esm/api-shape-helpers/claude-message.js.map +1 -0
  6. package/esm/index.d.ts +22 -0
  7. package/esm/index.d.ts.map +1 -0
  8. package/esm/index.js +27 -0
  9. package/esm/index.js.map +1 -0
  10. package/esm/inner-loop/call-model.d.ts +67 -0
  11. package/esm/inner-loop/call-model.d.ts.map +1 -0
  12. package/esm/inner-loop/call-model.js +116 -0
  13. package/esm/inner-loop/call-model.js.map +1 -0
  14. package/esm/lib/anthropic-compat.d.ts +51 -0
  15. package/esm/lib/anthropic-compat.d.ts.map +1 -0
  16. package/esm/lib/anthropic-compat.js +216 -0
  17. package/esm/lib/anthropic-compat.js.map +1 -0
  18. package/esm/lib/anthropic-compat.test.d.ts +2 -0
  19. package/esm/lib/anthropic-compat.test.d.ts.map +1 -0
  20. package/esm/lib/anthropic-compat.test.js +668 -0
  21. package/esm/lib/anthropic-compat.test.js.map +1 -0
  22. package/esm/lib/async-params.d.ts +107 -0
  23. package/esm/lib/async-params.d.ts.map +1 -0
  24. package/esm/lib/async-params.js +94 -0
  25. package/esm/lib/async-params.js.map +1 -0
  26. package/esm/lib/chat-compat.d.ts +46 -0
  27. package/esm/lib/chat-compat.d.ts.map +1 -0
  28. package/esm/lib/chat-compat.js +111 -0
  29. package/esm/lib/chat-compat.js.map +1 -0
  30. package/esm/lib/chat-compat.test.d.ts +2 -0
  31. package/esm/lib/chat-compat.test.d.ts.map +1 -0
  32. package/esm/lib/chat-compat.test.js +405 -0
  33. package/esm/lib/chat-compat.test.js.map +1 -0
  34. package/esm/lib/claude-constants.d.ts +22 -0
  35. package/esm/lib/claude-constants.d.ts.map +1 -0
  36. package/esm/lib/claude-constants.js +20 -0
  37. package/esm/lib/claude-constants.js.map +1 -0
  38. package/esm/lib/claude-type-guards.d.ts +10 -0
  39. package/esm/lib/claude-type-guards.d.ts.map +1 -0
  40. package/esm/lib/claude-type-guards.js +68 -0
  41. package/esm/lib/claude-type-guards.js.map +1 -0
  42. package/esm/lib/conversation-state.d.ts +61 -0
  43. package/esm/lib/conversation-state.d.ts.map +1 -0
  44. package/esm/lib/conversation-state.js +230 -0
  45. package/esm/lib/conversation-state.js.map +1 -0
  46. package/esm/lib/model-result.d.ts +370 -0
  47. package/esm/lib/model-result.d.ts.map +1 -0
  48. package/esm/lib/model-result.js +1483 -0
  49. package/esm/lib/model-result.js.map +1 -0
  50. package/esm/lib/next-turn-params.d.ts +30 -0
  51. package/esm/lib/next-turn-params.d.ts.map +1 -0
  52. package/esm/lib/next-turn-params.js +129 -0
  53. package/esm/lib/next-turn-params.js.map +1 -0
  54. package/esm/lib/reusable-stream.d.ts +39 -0
  55. package/esm/lib/reusable-stream.d.ts.map +1 -0
  56. package/esm/lib/reusable-stream.js +192 -0
  57. package/esm/lib/reusable-stream.js.map +1 -0
  58. package/esm/lib/stop-conditions.d.ts +80 -0
  59. package/esm/lib/stop-conditions.d.ts.map +1 -0
  60. package/esm/lib/stop-conditions.js +104 -0
  61. package/esm/lib/stop-conditions.js.map +1 -0
  62. package/esm/lib/stream-transformers.d.ts +109 -0
  63. package/esm/lib/stream-transformers.d.ts.map +1 -0
  64. package/esm/lib/stream-transformers.js +856 -0
  65. package/esm/lib/stream-transformers.js.map +1 -0
  66. package/esm/lib/stream-type-guards.d.ts +29 -0
  67. package/esm/lib/stream-type-guards.d.ts.map +1 -0
  68. package/esm/lib/stream-type-guards.js +85 -0
  69. package/esm/lib/stream-type-guards.js.map +1 -0
  70. package/esm/lib/tool-context.d.ts +68 -0
  71. package/esm/lib/tool-context.d.ts.map +1 -0
  72. package/esm/lib/tool-context.js +188 -0
  73. package/esm/lib/tool-context.js.map +1 -0
  74. package/esm/lib/tool-event-broadcaster.d.ts +44 -0
  75. package/esm/lib/tool-event-broadcaster.d.ts.map +1 -0
  76. package/esm/lib/tool-event-broadcaster.js +162 -0
  77. package/esm/lib/tool-event-broadcaster.js.map +1 -0
  78. package/esm/lib/tool-executor.d.ts +73 -0
  79. package/esm/lib/tool-executor.d.ts.map +1 -0
  80. package/esm/lib/tool-executor.js +267 -0
  81. package/esm/lib/tool-executor.js.map +1 -0
  82. package/esm/lib/tool-orchestrator.d.ts +50 -0
  83. package/esm/lib/tool-orchestrator.d.ts.map +1 -0
  84. package/esm/lib/tool-orchestrator.js +180 -0
  85. package/esm/lib/tool-orchestrator.js.map +1 -0
  86. package/esm/lib/tool-types.d.ts +572 -0
  87. package/esm/lib/tool-types.d.ts.map +1 -0
  88. package/esm/lib/tool-types.js +80 -0
  89. package/esm/lib/tool-types.js.map +1 -0
  90. package/esm/lib/tool.d.ts +108 -0
  91. package/esm/lib/tool.d.ts.map +1 -0
  92. package/esm/lib/tool.js +84 -0
  93. package/esm/lib/tool.js.map +1 -0
  94. package/esm/lib/turn-context.d.ts +50 -0
  95. package/esm/lib/turn-context.d.ts.map +1 -0
  96. package/esm/lib/turn-context.js +61 -0
  97. package/esm/lib/turn-context.js.map +1 -0
  98. package/package.json +125 -0
@@ -0,0 +1,180 @@
1
+ import { applyNextTurnParamsToRequest, executeNextTurnParamsFunctions, } from './next-turn-params.js';
2
+ import { extractToolCallsFromResponse, responseHasToolCalls } from './stream-transformers.js';
3
+ import { isFunctionCallItem } from './stream-type-guards.js';
4
+ import { executeTool, findToolByName } from './tool-executor.js';
5
+ import { hasExecuteFunction } from './tool-types.js';
6
+ import { buildTurnContext } from './turn-context.js';
7
+ /**
8
+ * Execute tool calls and manage multi-turn conversations
9
+ * This orchestrates the loop of: request -> tool calls -> execute -> send results -> repeat
10
+ *
11
+ * @param sendRequest - Function to send a request and get a response
12
+ * @param initialInput - Starting input for the conversation
13
+ * @param initialRequest - Full initial request with all parameters
14
+ * @param tools - Enhanced tools with Zod schemas and execute functions
15
+ * @param apiTools - Converted tools in API format (JSON Schema)
16
+ * @param options - Execution options
17
+ * @returns Result containing final response and all execution data
18
+ */
19
+ export async function executeToolLoop(sendRequest, initialInput, initialRequest, tools, apiTools, options = {}) {
20
+ const onPreliminaryResult = options.onPreliminaryResult;
21
+ const allResponses = [];
22
+ const toolExecutionResults = [];
23
+ let conversationInput = initialInput;
24
+ let currentRequest = {
25
+ ...initialRequest,
26
+ };
27
+ let currentRound = 0;
28
+ let currentResponse;
29
+ // Initial request
30
+ currentResponse = await sendRequest(conversationInput, apiTools);
31
+ allResponses.push(currentResponse);
32
+ // Loop until no more tool calls (model decides when to stop)
33
+ while (responseHasToolCalls(currentResponse)) {
34
+ currentRound++;
35
+ // Extract tool calls from response
36
+ const toolCalls = extractToolCallsFromResponse(currentResponse);
37
+ if (toolCalls.length === 0) {
38
+ break;
39
+ }
40
+ // Check if any tools have execute functions
41
+ const hasExecutableTools = toolCalls.some((toolCall) => {
42
+ const tool = findToolByName(tools, toolCall.name);
43
+ return tool && hasExecuteFunction(tool);
44
+ });
45
+ // If no executable tools, return (manual execution mode)
46
+ if (!hasExecutableTools) {
47
+ break;
48
+ }
49
+ // Execute all tool calls in parallel (parallel tool calling)
50
+ const toolCallPromises = toolCalls.map(async (toolCall) => {
51
+ const tool = findToolByName(tools, toolCall.name);
52
+ if (!tool) {
53
+ // Tool not found in definitions
54
+ return {
55
+ toolCallId: toolCall.id,
56
+ toolName: toolCall.name,
57
+ result: null,
58
+ error: new Error(`Tool "${toolCall.name}" not found in tool definitions`),
59
+ };
60
+ }
61
+ if (!hasExecuteFunction(tool)) {
62
+ // Tool has no execute function - return null to filter out
63
+ return null;
64
+ }
65
+ // Find the raw tool call from the response output
66
+ const rawToolCall = currentResponse.output.find((item) => isFunctionCallItem(item) && item.callId === toolCall.id);
67
+ if (!rawToolCall) {
68
+ throw new Error(`Could not find raw tool call for ${toolCall.id}`);
69
+ }
70
+ // Convert to FunctionCallItem format
71
+ const openResponsesToolCall = {
72
+ type: 'function_call',
73
+ callId: rawToolCall.callId,
74
+ name: rawToolCall.name,
75
+ arguments: rawToolCall.arguments,
76
+ id: rawToolCall.callId,
77
+ status: rawToolCall.status,
78
+ };
79
+ // Build turn context with full information
80
+ const turnContext = buildTurnContext({
81
+ numberOfTurns: currentRound,
82
+ toolCall: openResponsesToolCall,
83
+ turnRequest: currentRequest,
84
+ });
85
+ // Execute the tool
86
+ return executeTool(tool, toolCall, turnContext, onPreliminaryResult);
87
+ });
88
+ // Wait for all tool executions to complete in parallel
89
+ const settledResults = await Promise.allSettled(toolCallPromises);
90
+ // Process settled results, handling both fulfilled and rejected promises
91
+ const roundResults = [];
92
+ settledResults.forEach((settled, i) => {
93
+ const toolCall = toolCalls[i];
94
+ if (!toolCall)
95
+ return;
96
+ if (settled.status === 'fulfilled') {
97
+ if (settled.value !== null) {
98
+ roundResults.push(settled.value);
99
+ }
100
+ }
101
+ else {
102
+ // Promise rejected - create error result
103
+ roundResults.push({
104
+ toolCallId: toolCall.id,
105
+ toolName: toolCall.name,
106
+ result: null,
107
+ error: settled.reason instanceof Error ? settled.reason : new Error(String(settled.reason)),
108
+ });
109
+ }
110
+ });
111
+ toolExecutionResults.push(...roundResults);
112
+ // Execute nextTurnParams functions for tools that were called
113
+ const computedParams = await executeNextTurnParamsFunctions(toolCalls, tools, currentRequest);
114
+ // Apply computed parameters to request
115
+ if (Object.keys(computedParams).length > 0) {
116
+ currentRequest = applyNextTurnParamsToRequest(currentRequest, computedParams);
117
+ conversationInput = currentRequest.input ?? conversationInput;
118
+ }
119
+ // Build array input with all output from previous response plus tool results
120
+ // The API expects continuation via previousResponseId, not by including outputs
121
+ // For now, we'll keep the conversation going via previousResponseId
122
+ // conversationInput is updated above if nextTurnParams modified it
123
+ // Note: The OpenRouter Responses API uses previousResponseId for continuation
124
+ // Tool results are automatically associated with the previous response's tool calls
125
+ // Send updated conversation to API - this should use previousResponseId
126
+ currentResponse = await sendRequest(conversationInput, apiTools);
127
+ allResponses.push(currentResponse);
128
+ }
129
+ return {
130
+ finalResponse: currentResponse,
131
+ allResponses,
132
+ toolExecutionResults,
133
+ conversationInput,
134
+ };
135
+ }
136
+ /**
137
+ * Convert tool execution results to a map for easy lookup
138
+ */
139
+ export function toolResultsToMap(results) {
140
+ const map = new Map();
141
+ for (const result of results) {
142
+ map.set(result.toolCallId, {
143
+ result: result.result,
144
+ preliminaryResults: result.preliminaryResults,
145
+ });
146
+ }
147
+ return map;
148
+ }
149
+ /**
150
+ * Build a summary of tool executions for debugging/logging
151
+ */
152
+ export function summarizeToolExecutions(results) {
153
+ const lines = [];
154
+ for (const result of results) {
155
+ if (result.error) {
156
+ lines.push(`❌ ${result.toolName} (${result.toolCallId}): ERROR - ${result.error.message}`);
157
+ }
158
+ else {
159
+ const prelimCount = result.preliminaryResults?.length ?? 0;
160
+ const prelimInfo = prelimCount > 0 ? ` (${prelimCount} preliminary results)` : '';
161
+ lines.push(`✅ ${result.toolName} (${result.toolCallId}): SUCCESS${prelimInfo}`);
162
+ }
163
+ }
164
+ return lines.join('\n');
165
+ }
166
+ /**
167
+ * Check if any tool executions had errors
168
+ */
169
+ export function hasToolExecutionErrors(results) {
170
+ return results.some((result) => result.error !== undefined);
171
+ }
172
+ /**
173
+ * Get all tool execution errors
174
+ */
175
+ export function getToolExecutionErrors(results) {
176
+ return results
177
+ .filter((result) => result.error !== undefined)
178
+ .map((result) => result.error);
179
+ }
180
+ //# sourceMappingURL=tool-orchestrator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-orchestrator.js","sourceRoot":"","sources":["../../src/lib/tool-orchestrator.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,4BAA4B,EAC5B,8BAA8B,GAC/B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,4BAA4B,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAC9F,OAAO,EAAE,kBAAkB,EAAE,MAAM,yB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