illuma-agents 1.0.10 → 1.0.12

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 (117) hide show
  1. package/LICENSE +1 -1
  2. package/dist/cjs/agents/AgentContext.cjs +236 -27
  3. package/dist/cjs/agents/AgentContext.cjs.map +1 -1
  4. package/dist/cjs/common/enum.cjs +2 -0
  5. package/dist/cjs/common/enum.cjs.map +1 -1
  6. package/dist/cjs/events.cjs +3 -11
  7. package/dist/cjs/events.cjs.map +1 -1
  8. package/dist/cjs/graphs/Graph.cjs +44 -18
  9. package/dist/cjs/graphs/Graph.cjs.map +1 -1
  10. package/dist/cjs/instrumentation.cjs +1 -3
  11. package/dist/cjs/instrumentation.cjs.map +1 -1
  12. package/dist/cjs/llm/bedrock/index.cjs +121 -6
  13. package/dist/cjs/llm/bedrock/index.cjs.map +1 -1
  14. package/dist/cjs/main.cjs +18 -0
  15. package/dist/cjs/main.cjs.map +1 -1
  16. package/dist/cjs/messages/cache.cjs +149 -54
  17. package/dist/cjs/messages/cache.cjs.map +1 -1
  18. package/dist/cjs/messages/tools.cjs +85 -0
  19. package/dist/cjs/messages/tools.cjs.map +1 -0
  20. package/dist/cjs/run.cjs +0 -8
  21. package/dist/cjs/run.cjs.map +1 -1
  22. package/dist/cjs/tools/CodeExecutor.cjs +4 -0
  23. package/dist/cjs/tools/CodeExecutor.cjs.map +1 -1
  24. package/dist/cjs/tools/ProgrammaticToolCalling.cjs +438 -0
  25. package/dist/cjs/tools/ProgrammaticToolCalling.cjs.map +1 -0
  26. package/dist/cjs/tools/ToolNode.cjs +53 -15
  27. package/dist/cjs/tools/ToolNode.cjs.map +1 -1
  28. package/dist/cjs/tools/ToolSearchRegex.cjs +455 -0
  29. package/dist/cjs/tools/ToolSearchRegex.cjs.map +1 -0
  30. package/dist/cjs/tools/search/schema.cjs +7 -9
  31. package/dist/cjs/tools/search/schema.cjs.map +1 -1
  32. package/dist/cjs/utils/run.cjs +5 -1
  33. package/dist/cjs/utils/run.cjs.map +1 -1
  34. package/dist/esm/agents/AgentContext.mjs +236 -27
  35. package/dist/esm/agents/AgentContext.mjs.map +1 -1
  36. package/dist/esm/common/enum.mjs +2 -0
  37. package/dist/esm/common/enum.mjs.map +1 -1
  38. package/dist/esm/events.mjs +4 -12
  39. package/dist/esm/events.mjs.map +1 -1
  40. package/dist/esm/graphs/Graph.mjs +45 -19
  41. package/dist/esm/graphs/Graph.mjs.map +1 -1
  42. package/dist/esm/instrumentation.mjs +1 -3
  43. package/dist/esm/instrumentation.mjs.map +1 -1
  44. package/dist/esm/llm/bedrock/index.mjs +121 -6
  45. package/dist/esm/llm/bedrock/index.mjs.map +1 -1
  46. package/dist/esm/main.mjs +3 -0
  47. package/dist/esm/main.mjs.map +1 -1
  48. package/dist/esm/messages/cache.mjs +149 -54
  49. package/dist/esm/messages/cache.mjs.map +1 -1
  50. package/dist/esm/messages/tools.mjs +82 -0
  51. package/dist/esm/messages/tools.mjs.map +1 -0
  52. package/dist/esm/run.mjs +0 -8
  53. package/dist/esm/run.mjs.map +1 -1
  54. package/dist/esm/tools/CodeExecutor.mjs +4 -0
  55. package/dist/esm/tools/CodeExecutor.mjs.map +1 -1
  56. package/dist/esm/tools/ProgrammaticToolCalling.mjs +430 -0
  57. package/dist/esm/tools/ProgrammaticToolCalling.mjs.map +1 -0
  58. package/dist/esm/tools/ToolNode.mjs +53 -15
  59. package/dist/esm/tools/ToolNode.mjs.map +1 -1
  60. package/dist/esm/tools/ToolSearchRegex.mjs +448 -0
  61. package/dist/esm/tools/ToolSearchRegex.mjs.map +1 -0
  62. package/dist/esm/tools/search/schema.mjs +7 -9
  63. package/dist/esm/tools/search/schema.mjs.map +1 -1
  64. package/dist/esm/utils/run.mjs +5 -1
  65. package/dist/esm/utils/run.mjs.map +1 -1
  66. package/dist/types/agents/AgentContext.d.ts +72 -5
  67. package/dist/types/common/enum.d.ts +2 -0
  68. package/dist/types/graphs/Graph.d.ts +3 -2
  69. package/dist/types/index.d.ts +2 -0
  70. package/dist/types/llm/bedrock/index.d.ts +31 -4
  71. package/dist/types/messages/cache.d.ts +23 -8
  72. package/dist/types/messages/index.d.ts +1 -0
  73. package/dist/types/messages/tools.d.ts +17 -0
  74. package/dist/types/test/mockTools.d.ts +28 -0
  75. package/dist/types/tools/ProgrammaticToolCalling.d.ts +91 -0
  76. package/dist/types/tools/ToolNode.d.ts +10 -2
  77. package/dist/types/tools/ToolSearchRegex.d.ts +80 -0
  78. package/dist/types/types/graph.d.ts +14 -1
  79. package/dist/types/types/tools.d.ts +138 -0
  80. package/package.json +7 -8
  81. package/src/agents/AgentContext.ts +278 -27
  82. package/src/agents/__tests__/AgentContext.test.ts +805 -0
  83. package/src/common/enum.ts +2 -0
  84. package/src/events.ts +5 -12
  85. package/src/graphs/Graph.ts +57 -19
  86. package/src/index.ts +2 -0
  87. package/src/instrumentation.ts +1 -4
  88. package/src/llm/bedrock/__tests__/bedrock-caching.test.ts +473 -0
  89. package/src/llm/bedrock/index.ts +149 -12
  90. package/src/messages/__tests__/tools.test.ts +473 -0
  91. package/src/messages/cache.ts +163 -61
  92. package/src/messages/index.ts +1 -0
  93. package/src/messages/tools.ts +99 -0
  94. package/src/run.ts +0 -9
  95. package/src/scripts/code_exec_ptc.ts +334 -0
  96. package/src/scripts/image.ts +178 -0
  97. package/src/scripts/programmatic_exec.ts +396 -0
  98. package/src/scripts/programmatic_exec_agent.ts +231 -0
  99. package/src/scripts/test-tools-before-handoff.ts +5 -1
  100. package/src/scripts/tool_search_regex.ts +162 -0
  101. package/src/scripts/tools.ts +4 -1
  102. package/src/specs/thinking-prune.test.ts +52 -118
  103. package/src/test/mockTools.ts +366 -0
  104. package/src/tools/CodeExecutor.ts +4 -0
  105. package/src/tools/ProgrammaticToolCalling.ts +558 -0
  106. package/src/tools/ToolNode.ts +59 -18
  107. package/src/tools/ToolSearchRegex.ts +535 -0
  108. package/src/tools/__tests__/ProgrammaticToolCalling.integration.test.ts +318 -0
  109. package/src/tools/__tests__/ProgrammaticToolCalling.test.ts +853 -0
  110. package/src/tools/__tests__/ToolSearchRegex.integration.test.ts +161 -0
  111. package/src/tools/__tests__/ToolSearchRegex.test.ts +232 -0
  112. package/src/tools/search/jina-reranker.test.ts +16 -16
  113. package/src/tools/search/schema.ts +7 -9
  114. package/src/types/graph.ts +14 -1
  115. package/src/types/tools.ts +166 -0
  116. package/src/utils/run.ts +5 -1
  117. package/src/tools/search/direct-url.test.ts +0 -530
@@ -7,6 +7,18 @@ type MessageWithContent = {
7
7
  content?: string | MessageContentComplex[];
8
8
  };
9
9
 
10
+ /** Always-on logger for cache operations */
11
+ const logCache = (message: string) => {
12
+ console.log(`[Cache] ${message}`);
13
+ };
14
+
15
+ /** Debug logger for cache operations - set ILLUMA_DEBUG_CACHE=true to enable */
16
+ const debugCache = (message: string, data?: unknown) => {
17
+ if (process.env.ILLUMA_DEBUG_CACHE === 'true') {
18
+ console.log(`[Cache] ${message}`, data !== undefined ? JSON.stringify(data, null, 2) : '');
19
+ }
20
+ };
21
+
10
22
  /**
11
23
  * Anthropic API: Adds cache control to the appropriate user messages in the payload.
12
24
  * Strips ALL existing cache control (both Anthropic and Bedrock formats) from all messages,
@@ -139,39 +151,54 @@ export function stripBedrockCacheControl<T extends MessageWithContent>(
139
151
  }
140
152
 
141
153
  /**
142
- * Adds Bedrock Converse API cache points to the last two messages.
143
- * Inserts `{ cachePoint: { type: 'default' } }` as a separate content block
144
- * immediately after the last text block in each targeted message.
145
- * Strips ALL existing cache control (both Bedrock and Anthropic formats) from all messages,
146
- * then adds fresh cache points to the last 2 messages in a single backward pass.
147
- * This ensures we don't accumulate stale cache points across multiple turns.
148
- * @param messages - The array of message objects.
149
- * @returns - The updated array of message objects with cache points added.
154
+ * Adds Bedrock Converse API cache points using "Stable Prefix Caching" strategy.
155
+ *
156
+ * STRATEGY: Place cache point after the LAST ASSISTANT message only.
157
+ * This ensures the prefix (everything before the cache point) remains STABLE
158
+ * as the conversation grows, maximizing cache hits.
159
+ *
160
+ * Why this works:
161
+ * - System message has its own cachePoint (added in AgentContext)
162
+ * - Tools have their own cachePoint (added in CustomChatBedrockConverse)
163
+ * - Conversation history grows, but the PREFIX stays the same
164
+ * - Only the NEW user message is uncached (it's always different)
165
+ *
166
+ * Example conversation flow:
167
+ * Request 1: [System+cachePoint][Tools+cachePoint][User1] → No conversation cache yet
168
+ * Request 2: [System][Tools][User1][Assistant1+cachePoint][User2] → Cache User1+Assistant1
169
+ * Request 3: [System][Tools][User1][Assistant1][User2][Assistant2+cachePoint][User3]
170
+ * → Cache reads User1+A1+User2+A2, cache writes new portion
171
+ *
172
+ * Claude's "Simplified Cache Management" automatically looks back up to 20 content
173
+ * blocks from the cache checkpoint to find the longest matching prefix.
174
+ *
175
+ * @param messages - The array of message objects (excluding system message).
176
+ * @returns - The updated array with a single cache point after the last assistant message.
150
177
  */
151
178
  export function addBedrockCacheControl<
152
179
  T extends Partial<BaseMessage> & MessageWithContent,
153
180
  >(messages: T[]): T[] {
154
- if (!Array.isArray(messages) || messages.length < 2) {
181
+ if (!Array.isArray(messages) || messages.length < 1) {
182
+ debugCache('addBedrockCacheControl: Skipping - no messages', { count: messages?.length });
155
183
  return messages;
156
184
  }
157
185
 
186
+ debugCache('addBedrockCacheControl: Processing messages with stable prefix strategy', {
187
+ count: messages.length
188
+ });
189
+
158
190
  const updatedMessages: T[] = messages.slice();
159
- let messagesModified = 0;
160
-
161
- for (let i = updatedMessages.length - 1; i >= 0; i--) {
162
- const message = updatedMessages[i];
163
- const isToolMessage =
164
- 'getType' in message &&
165
- typeof message.getType === 'function' &&
166
- message.getType() === 'tool';
167
-
191
+
192
+ // First pass: Remove ALL existing cache points to ensure clean state
193
+ // This prevents accumulation of stale cache points
194
+ for (const message of updatedMessages) {
168
195
  const content = message.content;
169
-
170
196
  if (Array.isArray(content)) {
171
197
  message.content = content.filter(
172
198
  (block) => !isCachePoint(block)
173
199
  ) as typeof content;
174
200
 
201
+ // Also remove Anthropic-style cache_control
175
202
  for (let j = 0; j < message.content.length; j++) {
176
203
  const block = message.content[j] as Record<string, unknown>;
177
204
  if ('cache_control' in block) {
@@ -179,63 +206,138 @@ export function addBedrockCacheControl<
179
206
  }
180
207
  }
181
208
  }
209
+ }
182
210
 
183
- if (messagesModified >= 2 || isToolMessage) {
184
- continue;
211
+ // Helper function to check if a message contains reasoning/thinking blocks
212
+ const hasReasoningBlock = (message: T): boolean => {
213
+ const content = message.content;
214
+ if (!Array.isArray(content)) {
215
+ return false;
185
216
  }
186
-
187
- if (typeof content === 'string' && content === '') {
188
- continue;
217
+ for (const block of content) {
218
+ const type = (block as { type?: string }).type;
219
+ // Check for all reasoning/thinking block types:
220
+ // - reasoning_content: Bedrock Anthropic extended thinking
221
+ // - reasoning: Generic reasoning format
222
+ // - thinking: Anthropic direct API thinking
223
+ // - redacted_thinking: Anthropic redacted thinking blocks
224
+ if (
225
+ type === 'reasoning_content' ||
226
+ type === 'reasoning' ||
227
+ type === 'thinking' ||
228
+ type === 'redacted_thinking'
229
+ ) {
230
+ return true;
231
+ }
189
232
  }
190
-
191
- if (typeof content === 'string') {
192
- message.content = [
193
- { type: ContentTypes.TEXT, text: content },
194
- { cachePoint: { type: 'default' } },
195
- ] as MessageContentComplex[];
196
- messagesModified++;
197
- continue;
233
+ return false;
234
+ };
235
+
236
+ // Second pass: Find the LAST assistant message WITHOUT reasoning blocks and add a cache point there
237
+ // Messages with reasoning/thinking blocks cannot have cache points after them (Bedrock limitation)
238
+ let lastAssistantIndex = -1;
239
+ let skippedWithReasoning = 0;
240
+
241
+ // Count message types for logging
242
+ const messageTypes: Record<string, number> = {};
243
+ for (const message of updatedMessages) {
244
+ const msgType = 'getType' in message && typeof message.getType === 'function'
245
+ ? message.getType()
246
+ : 'unknown';
247
+ messageTypes[msgType] = (messageTypes[msgType] || 0) + 1;
248
+ }
249
+
250
+ for (let i = updatedMessages.length - 1; i >= 0; i--) {
251
+ const message = updatedMessages[i];
252
+ const messageType = 'getType' in message && typeof message.getType === 'function'
253
+ ? message.getType()
254
+ : 'unknown';
255
+
256
+ if (messageType === 'ai') {
257
+ // Skip assistant messages with reasoning blocks - cache points not allowed after them
258
+ if (hasReasoningBlock(message)) {
259
+ skippedWithReasoning++;
260
+ debugCache('addBedrockCacheControl: Skipping assistant message with reasoning block', { index: i });
261
+ continue;
262
+ }
263
+ lastAssistantIndex = i;
264
+ break;
198
265
  }
266
+ }
199
267
 
200
- if (Array.isArray(message.content)) {
201
- let hasCacheableContent = false;
202
- for (const block of message.content) {
203
- if (block.type === ContentTypes.TEXT) {
204
- if (typeof block.text === 'string' && block.text !== '') {
205
- hasCacheableContent = true;
206
- break;
207
- }
208
- }
209
- }
268
+ // Log message summary
269
+ logCache(`📨 Messages | total=${updatedMessages.length} | ${Object.entries(messageTypes).map(([k,v]) => `${k}:${v}`).join(' ')} | skippedReasoning=${skippedWithReasoning}`);
210
270
 
211
- if (!hasCacheableContent) {
212
- continue;
213
- }
271
+ // If no suitable assistant message found, skip conversation caching
272
+ // (System and Tools caching are still handled separately)
273
+ if (lastAssistantIndex === -1) {
274
+ logCache('📨 Messages | No suitable assistant message for cachePoint (first turn or all have reasoning)');
275
+ return updatedMessages;
276
+ }
214
277
 
215
- let inserted = false;
216
- for (let j = message.content.length - 1; j >= 0; j--) {
217
- const block = message.content[j] as MessageContentComplex;
218
- const type = (block as { type?: string }).type;
219
- if (type === ContentTypes.TEXT || type === 'text') {
220
- const text = (block as { text?: string }).text;
221
- if (text === '' || text === undefined) {
222
- continue;
223
- }
224
- message.content.splice(j + 1, 0, {
278
+ // Add cache point to the last assistant message (without reasoning blocks)
279
+ const assistantMessage = updatedMessages[lastAssistantIndex];
280
+ const content = assistantMessage.content;
281
+
282
+ if (typeof content === 'string' && content !== '') {
283
+ assistantMessage.content = [
284
+ { type: ContentTypes.TEXT, text: content },
285
+ { cachePoint: { type: 'default' } },
286
+ ] as MessageContentComplex[];
287
+ logCache(`📍 Message cachePoint at index ${lastAssistantIndex} (string, ${content.length} chars)`);
288
+ debugCache('addBedrockCacheControl: Added cachePoint to assistant message (string content)', {
289
+ index: lastAssistantIndex,
290
+ contentLength: content.length,
291
+ });
292
+ } else if (Array.isArray(assistantMessage.content) && assistantMessage.content.length > 0) {
293
+ // Double-check: If this message has reasoning blocks, skip adding cache point entirely
294
+ // This handles edge cases where the initial skip check might have missed it
295
+ if (hasReasoningBlock(assistantMessage)) {
296
+ logCache(`⚠️ Message cachePoint SKIPPED at index ${lastAssistantIndex} (has reasoning blocks)`);
297
+ debugCache('addBedrockCacheControl: Skipping - assistant message has reasoning blocks (safety check)', {
298
+ index: lastAssistantIndex,
299
+ });
300
+ return updatedMessages;
301
+ }
302
+
303
+ // Find the last text block and insert cache point after it
304
+ let inserted = false;
305
+ for (let j = assistantMessage.content.length - 1; j >= 0; j--) {
306
+ const block = assistantMessage.content[j] as MessageContentComplex;
307
+ const type = (block as { type?: string }).type;
308
+ if (type === ContentTypes.TEXT || type === 'text') {
309
+ const text = (block as { text?: string }).text;
310
+ if (text && text !== '') {
311
+ assistantMessage.content.splice(j + 1, 0, {
225
312
  cachePoint: { type: 'default' },
226
313
  } as MessageContentComplex);
227
314
  inserted = true;
315
+ logCache(`📍 Message cachePoint at index ${lastAssistantIndex} (array, block ${j}, ${text.length} chars)`);
316
+ debugCache('addBedrockCacheControl: Added cachePoint after text block in assistant message', {
317
+ index: lastAssistantIndex,
318
+ textBlockIndex: j,
319
+ contentLength: text.length,
320
+ });
228
321
  break;
229
322
  }
230
323
  }
231
- if (!inserted) {
232
- message.content.push({
233
- cachePoint: { type: 'default' },
234
- } as MessageContentComplex);
235
- }
236
- messagesModified++;
324
+ }
325
+
326
+ // If no text block found, don't append cache point as the message structure is unexpected
327
+ if (!inserted) {
328
+ const contentTypes = assistantMessage.content.map((b) => (b as { type?: string }).type);
329
+ logCache(`⚠️ Message cachePoint SKIPPED at index ${lastAssistantIndex} (no text block, types: ${contentTypes.join(',')})`);
330
+ debugCache('addBedrockCacheControl: No suitable text block found, skipping cache point', {
331
+ index: lastAssistantIndex,
332
+ contentTypes,
333
+ });
237
334
  }
238
335
  }
239
336
 
337
+ debugCache('addBedrockCacheControl: Complete - stable prefix caching applied', {
338
+ lastAssistantIndex,
339
+ totalMessages: updatedMessages.length,
340
+ });
341
+
240
342
  return updatedMessages;
241
343
  }
@@ -4,3 +4,4 @@ export * from './prune';
4
4
  export * from './format';
5
5
  export * from './cache';
6
6
  export * from './content';
7
+ export * from './tools';
@@ -0,0 +1,99 @@
1
+ // src/messages/toolDiscovery.ts
2
+ import { AIMessageChunk, ToolMessage } from '@langchain/core/messages';
3
+ import type { BaseMessage } from '@langchain/core/messages';
4
+ import { Constants } from '@/common';
5
+ import { findLastIndex } from './core';
6
+
7
+ type ToolSearchArtifact = {
8
+ tool_references?: Array<{ tool_name: string }>;
9
+ };
10
+
11
+ /**
12
+ * Extracts discovered tool names from tool search results in the current turn.
13
+ * Only processes tool search messages after the latest AI message with tool calls.
14
+ *
15
+ * Similar pattern to formatArtifactPayload - finds relevant messages efficiently
16
+ * by identifying the latest AI parent and only processing subsequent tool messages.
17
+ *
18
+ * @param messages - All messages in the conversation
19
+ * @returns Array of discovered tool names (empty if no new discoveries)
20
+ */
21
+ export function extractToolDiscoveries(messages: BaseMessage[]): string[] {
22
+ const lastMessage = messages[messages.length - 1];
23
+ if (!(lastMessage instanceof ToolMessage)) return [];
24
+
25
+ // Find the latest AIMessage with tool_calls that this tool message belongs to
26
+ const latestAIParentIndex = findLastIndex(
27
+ messages,
28
+ (msg) =>
29
+ (msg instanceof AIMessageChunk &&
30
+ (msg.tool_calls?.length ?? 0) > 0 &&
31
+ msg.tool_calls?.some((tc) => tc.id === lastMessage.tool_call_id)) ??
32
+ false
33
+ );
34
+
35
+ if (latestAIParentIndex === -1) return [];
36
+
37
+ // Collect tool_call_ids from the AI message
38
+ const aiMessage = messages[latestAIParentIndex] as AIMessageChunk;
39
+ const toolCallIds = new Set(aiMessage.tool_calls?.map((tc) => tc.id) ?? []);
40
+
41
+ // Only process tool search results after the AI message that belong to this turn
42
+ const discoveredNames: string[] = [];
43
+ for (let i = latestAIParentIndex + 1; i < messages.length; i++) {
44
+ const msg = messages[i];
45
+ if (!(msg instanceof ToolMessage)) continue;
46
+ if (msg.name !== Constants.TOOL_SEARCH_REGEX) continue;
47
+ if (!toolCallIds.has(msg.tool_call_id)) continue;
48
+
49
+ // This is a tool search result from the current turn
50
+ if (typeof msg.artifact === 'object' && msg.artifact != null) {
51
+ const artifact = msg.artifact as ToolSearchArtifact;
52
+ if (artifact.tool_references && artifact.tool_references.length > 0) {
53
+ for (const ref of artifact.tool_references) {
54
+ discoveredNames.push(ref.tool_name);
55
+ }
56
+ }
57
+ }
58
+ }
59
+
60
+ return discoveredNames;
61
+ }
62
+
63
+ /**
64
+ * Checks if the current turn has any tool search results.
65
+ * Quick check to avoid full extraction when not needed.
66
+ */
67
+ export function hasToolSearchInCurrentTurn(messages: BaseMessage[]): boolean {
68
+ const lastMessage = messages[messages.length - 1];
69
+ if (!(lastMessage instanceof ToolMessage)) return false;
70
+
71
+ // Find the latest AIMessage with tool_calls
72
+ const latestAIParentIndex = findLastIndex(
73
+ messages,
74
+ (msg) =>
75
+ (msg instanceof AIMessageChunk &&
76
+ (msg.tool_calls?.length ?? 0) > 0 &&
77
+ msg.tool_calls?.some((tc) => tc.id === lastMessage.tool_call_id)) ??
78
+ false
79
+ );
80
+
81
+ if (latestAIParentIndex === -1) return false;
82
+
83
+ const aiMessage = messages[latestAIParentIndex] as AIMessageChunk;
84
+ const toolCallIds = new Set(aiMessage.tool_calls?.map((tc) => tc.id) ?? []);
85
+
86
+ // Check if any tool search results exist after the AI message
87
+ for (let i = latestAIParentIndex + 1; i < messages.length; i++) {
88
+ const msg = messages[i];
89
+ if (
90
+ msg instanceof ToolMessage &&
91
+ msg.name === Constants.TOOL_SEARCH_REGEX &&
92
+ toolCallIds.has(msg.tool_call_id)
93
+ ) {
94
+ return true;
95
+ }
96
+ }
97
+
98
+ return false;
99
+ }
package/src/run.ts CHANGED
@@ -292,15 +292,6 @@ export class Run<_T extends t.BaseGraphState> {
292
292
 
293
293
  const eventName: t.EventName = info.event;
294
294
 
295
- // Debug: log tool-related events
296
- if (eventName.includes('tool')) {
297
- console.log('[AgentRun] Tool event received:', eventName, {
298
- hasData: !!data,
299
- dataKeys: data ? Object.keys(data) : [],
300
- outputType: data?.output ? typeof data.output : 'none',
301
- });
302
- }
303
-
304
295
  /** Skip custom events as they're handled by our callback */
305
296
  if (eventName === GraphEvents.ON_CUSTOM_EVENT) {
306
297
  continue;