@n8n/agents 0.17.2 → 0.19.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 (152) hide show
  1. package/dist/build.tsbuildinfo +1 -1
  2. package/dist/index.d.ts +10 -5
  3. package/dist/index.js +13 -8
  4. package/dist/index.js.map +1 -1
  5. package/dist/integrations/langsmith.js +1 -1
  6. package/dist/integrations/langsmith.js.map +1 -1
  7. package/dist/runtime/loop/agent-runtime.d.ts +7 -10
  8. package/dist/runtime/loop/agent-runtime.js +89 -45
  9. package/dist/runtime/loop/agent-runtime.js.map +1 -1
  10. package/dist/runtime/loop/execution-counter.d.ts +1 -0
  11. package/dist/runtime/loop/execution-counter.js +8 -0
  12. package/dist/runtime/loop/execution-counter.js.map +1 -1
  13. package/dist/runtime/loop/generate-sink.js +3 -1
  14. package/dist/runtime/loop/generate-sink.js.map +1 -1
  15. package/dist/runtime/loop/hydrate-file-parts.d.ts +7 -0
  16. package/dist/runtime/loop/hydrate-file-parts.js +42 -0
  17. package/dist/runtime/loop/hydrate-file-parts.js.map +1 -0
  18. package/dist/runtime/loop/run-output-sink.d.ts +4 -3
  19. package/dist/runtime/loop/runtime-context.d.ts +2 -1
  20. package/dist/runtime/loop/runtime-context.js +9 -4
  21. package/dist/runtime/loop/runtime-context.js.map +1 -1
  22. package/dist/runtime/loop/runtime-helpers.d.ts +2 -1
  23. package/dist/runtime/loop/runtime-helpers.js +11 -0
  24. package/dist/runtime/loop/runtime-helpers.js.map +1 -1
  25. package/dist/runtime/loop/stream-sink.js +5 -3
  26. package/dist/runtime/loop/stream-sink.js.map +1 -1
  27. package/dist/runtime/mcp/mcp-connection.js +2 -0
  28. package/dist/runtime/mcp/mcp-connection.js.map +1 -1
  29. package/dist/runtime/memory/episodic-memory-defaults.js +2 -2
  30. package/dist/runtime/memory/episodic-memory-defaults.js.map +1 -1
  31. package/dist/runtime/memory/episodic-memory.js +3 -2
  32. package/dist/runtime/memory/episodic-memory.js.map +1 -1
  33. package/dist/runtime/memory/observation-log-defaults.d.ts +2 -2
  34. package/dist/runtime/memory/observation-log-defaults.js +18 -5
  35. package/dist/runtime/memory/observation-log-defaults.js.map +1 -1
  36. package/dist/runtime/memory/observation-log-observer.js +8 -13
  37. package/dist/runtime/memory/observation-log-observer.js.map +1 -1
  38. package/dist/runtime/memory/observation-log-reflector.js +6 -1
  39. package/dist/runtime/memory/observation-log-reflector.js.map +1 -1
  40. package/dist/runtime/memory/title-generation.js +4 -18
  41. package/dist/runtime/memory/title-generation.js.map +1 -1
  42. package/dist/runtime/model/message-list.d.ts +3 -1
  43. package/dist/runtime/model/message-list.js +10 -3
  44. package/dist/runtime/model/message-list.js.map +1 -1
  45. package/dist/runtime/model/messages.d.ts +2 -1
  46. package/dist/runtime/model/messages.js +65 -5
  47. package/dist/runtime/model/messages.js.map +1 -1
  48. package/dist/runtime/model/model-factory.d.ts +1 -1
  49. package/dist/runtime/model/model-factory.js +8 -6
  50. package/dist/runtime/model/model-factory.js.map +1 -1
  51. package/dist/runtime/model/provider-credentials.d.ts +4 -0
  52. package/dist/runtime/model/provider-credentials.js +3 -1
  53. package/dist/runtime/model/provider-credentials.js.map +1 -1
  54. package/dist/runtime/model/provider-quirks.d.ts +3 -2
  55. package/dist/runtime/model/provider-quirks.js +29 -5
  56. package/dist/runtime/model/provider-quirks.js.map +1 -1
  57. package/dist/runtime/state/run-state.d.ts +5 -0
  58. package/dist/runtime/state/run-state.js +14 -3
  59. package/dist/runtime/state/run-state.js.map +1 -1
  60. package/dist/runtime/streaming/stream-session.js +8 -0
  61. package/dist/runtime/streaming/stream-session.js.map +1 -1
  62. package/dist/runtime/telemetry/runtime-telemetry.d.ts +4 -3
  63. package/dist/runtime/telemetry/runtime-telemetry.js +56 -21
  64. package/dist/runtime/telemetry/runtime-telemetry.js.map +1 -1
  65. package/dist/runtime/telemetry/sub-agent-telemetry.d.ts +2 -0
  66. package/dist/runtime/telemetry/sub-agent-telemetry.js +14 -0
  67. package/dist/runtime/telemetry/sub-agent-telemetry.js.map +1 -0
  68. package/dist/runtime/telemetry/telemetry-options.d.ts +3 -3
  69. package/dist/runtime/telemetry/telemetry-options.js +5 -6
  70. package/dist/runtime/telemetry/telemetry-options.js.map +1 -1
  71. package/dist/runtime/tools/delegate-sub-agent-tool.d.ts +59 -5
  72. package/dist/runtime/tools/delegate-sub-agent-tool.js +236 -45
  73. package/dist/runtime/tools/delegate-sub-agent-tool.js.map +1 -1
  74. package/dist/runtime/tools/planner-todos-tool.d.ts +6 -0
  75. package/dist/runtime/tools/planner-todos-tool.js +47 -0
  76. package/dist/runtime/tools/planner-todos-tool.js.map +1 -0
  77. package/dist/runtime/tools/todos-core.d.ts +35 -0
  78. package/dist/runtime/tools/todos-core.js +52 -0
  79. package/dist/runtime/tools/todos-core.js.map +1 -0
  80. package/dist/runtime/tools/tool-adapter.d.ts +4 -1
  81. package/dist/runtime/tools/tool-adapter.js +15 -2
  82. package/dist/runtime/tools/tool-adapter.js.map +1 -1
  83. package/dist/runtime/tools/tool-call-executor.d.ts +5 -0
  84. package/dist/runtime/tools/tool-call-executor.js +166 -45
  85. package/dist/runtime/tools/tool-call-executor.js.map +1 -1
  86. package/dist/runtime/tools/write-todos-tool.js +5 -40
  87. package/dist/runtime/tools/write-todos-tool.js.map +1 -1
  88. package/dist/sdk/agent.d.ts +9 -1
  89. package/dist/sdk/agent.js +154 -22
  90. package/dist/sdk/agent.js.map +1 -1
  91. package/dist/sdk/catalog.d.ts +1 -1
  92. package/dist/sdk/catalog.js +1 -1
  93. package/dist/sdk/catalog.js.map +1 -1
  94. package/dist/sdk/mcp-client.d.ts +4 -1
  95. package/dist/sdk/mcp-client.js +26 -13
  96. package/dist/sdk/mcp-client.js.map +1 -1
  97. package/dist/sdk/metadata-enriched-tracer.d.ts +3 -0
  98. package/dist/sdk/metadata-enriched-tracer.js +38 -0
  99. package/dist/sdk/metadata-enriched-tracer.js.map +1 -0
  100. package/dist/sdk/telemetry.d.ts +3 -3
  101. package/dist/sdk/telemetry.js +77 -29
  102. package/dist/sdk/telemetry.js.map +1 -1
  103. package/dist/sdk/tool.js +55 -3
  104. package/dist/sdk/tool.js.map +1 -1
  105. package/dist/skills/index.d.ts +2 -2
  106. package/dist/skills/index.js +1 -3
  107. package/dist/skills/index.js.map +1 -1
  108. package/dist/skills/prompt.d.ts +1 -1
  109. package/dist/skills/prompt.js +2 -3
  110. package/dist/skills/prompt.js.map +1 -1
  111. package/dist/skills/tools.d.ts +0 -1
  112. package/dist/skills/tools.js +4 -101
  113. package/dist/skills/tools.js.map +1 -1
  114. package/dist/skills/types.d.ts +0 -1
  115. package/dist/skills/types.js +1 -2
  116. package/dist/skills/types.js.map +1 -1
  117. package/dist/types/index.d.ts +7 -4
  118. package/dist/types/index.js +3 -1
  119. package/dist/types/index.js.map +1 -1
  120. package/dist/types/runtime/event.d.ts +38 -2
  121. package/dist/types/runtime/event.js +1 -0
  122. package/dist/types/runtime/event.js.map +1 -1
  123. package/dist/types/sdk/agent-builder.d.ts +3 -0
  124. package/dist/types/sdk/agent.d.ts +17 -5
  125. package/dist/types/sdk/file-store.d.ts +7 -0
  126. package/dist/types/sdk/file-store.js +3 -0
  127. package/dist/types/sdk/file-store.js.map +1 -0
  128. package/dist/types/sdk/mcp.d.ts +5 -0
  129. package/dist/types/sdk/message.d.ts +18 -2
  130. package/dist/types/sdk/message.js +15 -0
  131. package/dist/types/sdk/message.js.map +1 -1
  132. package/dist/types/sdk/provider.d.ts +1 -0
  133. package/dist/types/sdk/reasoning.d.ts +2 -0
  134. package/dist/types/sdk/reasoning.js +3 -0
  135. package/dist/types/sdk/reasoning.js.map +1 -0
  136. package/dist/types/sdk/tool.d.ts +20 -2
  137. package/dist/types/telemetry.d.ts +6 -2
  138. package/dist/utils/parse.js +26 -8
  139. package/dist/utils/parse.js.map +1 -1
  140. package/dist/workspace/sandbox/daytona-sandbox.d.ts +6 -2
  141. package/dist/workspace/sandbox/daytona-sandbox.js +121 -23
  142. package/dist/workspace/sandbox/daytona-sandbox.js.map +1 -1
  143. package/dist/workspace/sandbox/index.d.ts +1 -1
  144. package/dist/workspace/sandbox/index.js +1 -3
  145. package/dist/workspace/sandbox/index.js.map +1 -1
  146. package/dist/workspace/sandbox/workspace-root.d.ts +0 -2
  147. package/dist/workspace/sandbox/workspace-root.js +0 -11
  148. package/dist/workspace/sandbox/workspace-root.js.map +1 -1
  149. package/package.json +28 -22
  150. package/dist/runtime/json-value.d.ts +0 -2
  151. package/dist/runtime/json-value.js +0 -43
  152. package/dist/runtime/json-value.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export type { BuiltTool, BuiltProviderTool, BuiltAgent, BuiltMemory, BuiltEpisodicMemoryStore, BuiltGuardrail, PiiDetectionType, BuiltEval, RunOptions, AgentResult, GenerateResult, StreamResult, EvalInput, EvalScore, EvalRunResult, EvalResults, ToolContext, ToolExecutionContext, InterruptibleToolContext, CheckpointStore, StreamChunk, Provider, ThinkingConfig, ThinkingConfigFor, AnthropicThinkingConfig, OpenAIThinkingConfig, GoogleThinkingConfig, XaiThinkingConfig, SerializableAgentState, AgentRunState, MemoryConfig, ObservationLogMemoryConfig, MemoryDescriptor, ObservationCapableMemory, TitleGenerationConfig, Thread, EpisodicMemoryConfig, EpisodicMemoryCursor, EpisodicMemoryEmbeddingProviderOptions, EpisodicMemoryEntry, EpisodicMemoryEntrySource, EpisodicMemoryExtractFn, EpisodicMemoryExtraction, EpisodicMemoryExtractionCandidate, EpisodicMemoryExtractorInput, EpisodicMemoryMethods, EpisodicMemoryPrompts, EpisodicMemoryReflectFn, EpisodicMemoryReflection, EpisodicMemoryReflectionApply, EpisodicMemoryReflectionApplyMerge, EpisodicMemoryReflectionMerge, EpisodicMemoryReflectionResult, EpisodicMemoryReflectorInput, EpisodicMemoryScope, EpisodicMemorySearchOptions, EpisodicMemoryStatus, EpisodicMemoryTaskLockHandle, EpisodicMemoryTaskLockMethods, NewEpisodicMemoryCursor, NewEpisodicMemoryEntry, NewEpisodicMemoryEntrySource, NewEpisodicMemoryEntrySourceForEntry, RetrievedEpisodicMemoryEntry, ResumeOptions, McpServerConfig, McpToolCallSettledEvent, McpVerifyResult, ModelConfig, ExecutionOptions, SmoothStreamOptions, TokenUsage, AgentExecutionCounter, PersistedExecutionOptions, AnthropicPromptCachingConfig, OpenAIPromptCachingConfig, PromptCachingConfig, BuiltTelemetry, AttributeValue, ObservationCursor, ObservationalMemoryConfig, BuiltObservationLogStore, BuiltObservationLogTaskLockStore, MemoryTaskUsageReport, NewObservationLogEntry, ObservationLogEntry, ObservationLogMarker, ObservationLogMerge, ObservationLogReadOptions, ObservationLogReflection, ObservationLogReflectionResult, ObservationLogScope, ObservationLogStatus, ObservationLogTaskKind, ObservationLogTaskLockHandle, TokenCounter, } from './types';
1
+ export type { BuiltTool, BuiltProviderTool, BuiltAgent, BuiltMemory, BuiltEpisodicMemoryStore, BuiltGuardrail, PiiDetectionType, BuiltEval, RunOptions, AgentResult, GenerateResult, StreamResult, EvalInput, EvalScore, EvalRunResult, EvalResults, ToolContext, ToolCancellationContext, ToolExecutionContext, InterruptibleToolContext, ToolSuspendOptions, CheckpointStore, StreamChunk, Provider, ThinkingConfig, ThinkingConfigFor, AnthropicThinkingConfig, OpenAIThinkingConfig, GoogleThinkingConfig, XaiThinkingConfig, ReasoningLevel, SerializableAgentState, AgentRunState, MemoryConfig, ObservationLogMemoryConfig, MemoryDescriptor, ObservationCapableMemory, TitleGenerationConfig, Thread, EpisodicMemoryConfig, EpisodicMemoryCursor, EpisodicMemoryEmbeddingProviderOptions, EpisodicMemoryEntry, EpisodicMemoryEntrySource, EpisodicMemoryExtractFn, EpisodicMemoryExtraction, EpisodicMemoryExtractionCandidate, EpisodicMemoryExtractorInput, EpisodicMemoryMethods, EpisodicMemoryPrompts, EpisodicMemoryReflectFn, EpisodicMemoryReflection, EpisodicMemoryReflectionApply, EpisodicMemoryReflectionApplyMerge, EpisodicMemoryReflectionMerge, EpisodicMemoryReflectionResult, EpisodicMemoryReflectorInput, EpisodicMemoryScope, EpisodicMemorySearchOptions, EpisodicMemoryStatus, EpisodicMemoryTaskLockHandle, EpisodicMemoryTaskLockMethods, NewEpisodicMemoryCursor, NewEpisodicMemoryEntry, NewEpisodicMemoryEntrySource, NewEpisodicMemoryEntrySourceForEntry, RetrievedEpisodicMemoryEntry, ResumeOptions, McpServerConfig, McpToolCallSettledEvent, McpConnectionFailedEvent, McpVerifyResult, ModelConfig, ExecutionOptions, SmoothStreamOptions, TokenUsage, AgentExecutionCounter, PersistedExecutionOptions, AnthropicPromptCachingConfig, OpenAIPromptCachingConfig, PromptCachingConfig, BuiltTelemetry, AttributeValue, ObservationCursor, ObservationalMemoryConfig, BuiltObservationLogStore, BuiltObservationLogTaskLockStore, MemoryTaskUsageReport, NewObservationLogEntry, ObservationLogEntry, ObservationLogMarker, ObservationLogMerge, ObservationLogReadOptions, ObservationLogReflection, ObservationLogReflectionResult, ObservationLogScope, ObservationLogStatus, ObservationLogTaskKind, ObservationLogTaskLockHandle, TokenCounter, } from './types';
2
2
  export type { ProviderOptions } from '@ai-sdk/provider-utils';
3
3
  export { AgentEvent } from './types';
4
4
  export type { AgentEventData, AgentEventHandler } from './types';
@@ -19,18 +19,21 @@ export { evaluate } from './sdk/evaluate';
19
19
  export type { DatasetRow, EvaluateConfig } from './sdk/evaluate';
20
20
  export * as evals from './evals/index';
21
21
  export { Telemetry } from './sdk/telemetry';
22
+ export { deriveSubAgentTelemetry } from './runtime/telemetry/sub-agent-telemetry';
22
23
  export { LangSmithTelemetry } from './integrations/langsmith';
23
24
  export type { LangSmithTelemetryConfig } from './integrations/langsmith';
24
25
  export { Agent } from './sdk/agent';
25
26
  export type { AgentSnapshot } from './sdk/agent';
26
- export { appendSkillCatalogToInstructions, createListSkillsTool, createRuntimeSkillRegistry, createRuntimeSkillSource, createRuntimeSkillTools, createSkillLoadTool, filterRuntimeSkillSource, formatSkillValidationErrors, InvalidRuntimeSkillError, loadRuntimeSkillsFromDirectory, loadRuntimeSkillSourceFromDirectory, parseRuntimeSkillMarkdown, renderSkillCatalogPrompt, RUNTIME_SKILL_TOOL_NAMES, RUNTIME_SKILL_FILE_NAME, RUNTIME_SKILL_LINKED_FILE_GROUPS, RUNTIME_SKILL_NAME_PATTERN, RUNTIME_SKILL_REGISTRY_SCHEMA_VERSION, LIST_SKILLS_TOOL_NAME, SKILL_LOAD_TOOL_NAME, validateRuntimeSkill, } from './skills';
27
+ export { appendSkillCatalogToInstructions, createRuntimeSkillRegistry, createRuntimeSkillSource, createRuntimeSkillTools, createSkillLoadTool, filterRuntimeSkillSource, formatSkillValidationErrors, InvalidRuntimeSkillError, loadRuntimeSkillsFromDirectory, loadRuntimeSkillSourceFromDirectory, parseRuntimeSkillMarkdown, renderSkillCatalogPrompt, RUNTIME_SKILL_TOOL_NAMES, RUNTIME_SKILL_FILE_NAME, RUNTIME_SKILL_LINKED_FILE_GROUPS, RUNTIME_SKILL_NAME_PATTERN, RUNTIME_SKILL_REGISTRY_SCHEMA_VERSION, SKILL_LOAD_TOOL_NAME, validateRuntimeSkill, } from './skills';
27
28
  export type { LoadRuntimeSkillSourceFromDirectoryOptions, RenderSkillCatalogOptions, RuntimeSkill, RuntimeSkillContent, RuntimeSkillDependenciesContract, RuntimeSkillFileContent, RuntimeSkillFileLoader, RuntimeSkillIndexEntry, RuntimeSkillInterfaceContract, RuntimeSkillLinkedFile, RuntimeSkillLinkedFileGroup, RuntimeSkillLinkedFiles, RuntimeSkillLoader, RuntimeSkillMcpServerDependency, RuntimeSkillPolicyContract, RuntimeSkillRegistry, RuntimeSkillRegistryEntry, RuntimeSkillSource, RuntimeSkillValidationError, RuntimeSkillValidationResult, } from './skills';
28
29
  export type { AgentBuilder, CredentialProvider, ResolvedCredential, CredentialListItem, } from './types';
29
30
  export { McpClient } from './sdk/mcp-client';
30
31
  export { providerTools } from './sdk/provider-tools';
31
32
  export { verify } from './sdk/verify';
32
33
  export type { VerifyResult } from './sdk/verify';
33
- export type { ContentCitation, ContentFile, ContentMetadata, ContentReasoning, ContentText, ContentToolCall, Message, MessageContent, MessageRole, AgentMessage, CustomAgentMessages, AgentDbMessage, } from './types/sdk/message';
34
+ export type { ContentCitation, ContentCustom, ContentFile, ContentFileRef, ContentMetadata, ContentReasoning, ContentReasoningFile, ContentText, ContentToolCall, Message, MessageContent, MessageRole, AgentMessage, CustomAgentMessages, AgentDbMessage, } from './types/sdk/message';
35
+ export { stripHydratedFileData } from './types/sdk/message';
36
+ export type { BuiltFileStore } from './types/sdk/file-store';
34
37
  export type { HandlerExecutor } from './types/sdk/handler-executor';
35
38
  export { filterLlmMessages, isLlmMessage, } from './sdk/message';
36
39
  export { fetchProviderCatalog } from './sdk/catalog';
@@ -43,9 +46,11 @@ export { createModel } from './runtime/model/model-factory';
43
46
  export type { FetchFn, EmbeddingProviderOptions } from './runtime/model/model-factory';
44
47
  export { DEFAULT_SUB_AGENT_MAX_CHILDREN, ROOT_SUB_AGENT_TASK_PATH, assertSubAgentTaskPath, createChildSubAgentTaskPath, isSubAgentTaskPath, sanitizeSubAgentTaskName, } from './runtime/tools/sub-agent-task-path';
45
48
  export type { SubAgentTaskPath, SubAgentTaskPathPolicy } from './runtime/tools/sub-agent-task-path';
46
- export { DELEGATE_SUB_AGENT_TOOL_NAME, DELEGATED_CHILD_SUSPEND_UNSUPPORTED_MESSAGE, INLINE_SUB_AGENT_ID, SUB_AGENT_TASK_DIFFICULTIES, createDelegateSubAgentTool, failedDelegatedChildSuspendOutput, generateResultToDelegateSubAgentOutput, getInlineDelegateSubAgentToolOptions, isDelegateSubAgentTool, renderDelegateSubAgentPrompt, } from './runtime/tools/delegate-sub-agent-tool';
47
- export type { CreateDelegateSubAgentToolOptions, DelegateSubAgentInput, DelegateSubAgentPolicy, DelegateSubAgentRequest, DelegateSubAgentRunner, DelegateSubAgentRunnerHelpers, DelegateSubAgentToolOutput, InlineSubAgentProviderToolsResolver, SubAgentTaskDifficulty, } from './runtime/tools/delegate-sub-agent-tool';
49
+ export { DELEGATE_SUB_AGENT_TOOL_NAME, DELEGATED_CHILD_SUSPEND_UNSUPPORTED_MESSAGE, INLINE_SUB_AGENT_ID, SUB_AGENT_TASK_DIFFICULTIES, createDelegateSubAgentTool, failedDelegatedChildSuspendOutput, generateResultToDelegateSubAgentOutput, getInlineDelegateSubAgentToolOptions, isDelegateSubAgentTool, parseDelegateSubAgentContinuation, renderDelegateSubAgentPrompt, } from './runtime/tools/delegate-sub-agent-tool';
50
+ export type { CreateDelegateSubAgentToolOptions, DelegateSubAgentCancelRequest, DelegateSubAgentCancelRunner, DelegateSubAgentContinuation, DelegateSubAgentInput, DelegateSubAgentPolicy, DelegateSubAgentRequest, DelegateSubAgentResumeRequest, DelegateSubAgentResumeRunner, DelegateSubAgentRunner, DelegateSubAgentRunnerHelpers, DelegateSubAgentToolOutput, InlineSubAgentProviderToolsResolver, SubAgentTaskDifficulty, } from './runtime/tools/delegate-sub-agent-tool';
48
51
  export { WRITE_TODOS_TOOL_NAME, createWriteTodosTool } from './runtime/tools/write-todos-tool';
52
+ export { createPlannerTodosTool } from './runtime/tools/planner-todos-tool';
53
+ export type { CreatePlannerTodosToolOptions } from './runtime/tools/planner-todos-tool';
49
54
  export type { CreateWriteTodosToolOptions } from './runtime/tools/write-todos-tool';
50
55
  export { createEmbeddingModel } from './runtime/model/model-factory';
51
56
  export { generateTitleFromMessage } from './runtime/memory/title-generation';
package/dist/index.js CHANGED
@@ -33,9 +33,9 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.RUNTIME_SKILL_FILE_NAME = exports.RUNTIME_SKILL_TOOL_NAMES = exports.renderSkillCatalogPrompt = exports.parseRuntimeSkillMarkdown = exports.loadRuntimeSkillSourceFromDirectory = exports.loadRuntimeSkillsFromDirectory = exports.InvalidRuntimeSkillError = exports.formatSkillValidationErrors = exports.filterRuntimeSkillSource = exports.createSkillLoadTool = exports.createRuntimeSkillTools = exports.createRuntimeSkillSource = exports.createRuntimeSkillRegistry = exports.createListSkillsTool = exports.appendSkillCatalogToInstructions = exports.Agent = exports.LangSmithTelemetry = exports.Telemetry = exports.evals = exports.evaluate = exports.Eval = exports.SUPPORTED_PII_CATEGORIES = exports.passesLuhn = exports.resolvePatterns = exports.StreamingRedactor = exports.DEFAULT_PLACEHOLDER = exports.redactionOptionsFromGuardrail = exports.redactDeep = exports.redactText = exports.Guardrail = exports.buildFilterInputSchema = exports.assertValidFilter = exports.normalizeFilterInput = exports.FILTER_OPERATORS = exports.VectorStore = exports.Memory = exports.sanitizeToolName = exports.wrapToolForApproval = exports.Tool = exports.throwIfAborted = exports.raceWithAbort = exports.isAbortError = exports.createAbortError = exports.CANCELLATION_TYPE = exports.isCancellation = exports.createCancellation = exports.OBSERVATION_LOG_STATUSES = exports.OBSERVATION_LOG_MARKERS = exports.estimateObservationTokens = exports.AgentEvent = void 0;
37
- exports.isEpisodicMemoryEnabled = exports.hasEpisodicMemoryStore = exports.hashEpisodicMemoryEvidence = exports.hashEpisodicMemoryContent = exports.getEpisodicMemoryScope = exports.createRecallMemoryTool = exports.RECALL_MEMORY_TOOL_NAME = exports.uniqueStrings = exports.supersededLifecycleState = exports.normalizeFlatReflectionActions = exports.markLifecycleSuperseded = exports.markLifecycleDropped = exports.markLifecycleActive = exports.droppedLifecycleState = exports.activeLifecycleState = exports.generateTitleFromMessage = exports.createEmbeddingModel = exports.createWriteTodosTool = exports.WRITE_TODOS_TOOL_NAME = exports.renderDelegateSubAgentPrompt = exports.isDelegateSubAgentTool = exports.getInlineDelegateSubAgentToolOptions = exports.generateResultToDelegateSubAgentOutput = exports.failedDelegatedChildSuspendOutput = exports.createDelegateSubAgentTool = exports.SUB_AGENT_TASK_DIFFICULTIES = exports.INLINE_SUB_AGENT_ID = exports.DELEGATED_CHILD_SUSPEND_UNSUPPORTED_MESSAGE = exports.DELEGATE_SUB_AGENT_TOOL_NAME = exports.sanitizeSubAgentTaskName = exports.isSubAgentTaskPath = exports.createChildSubAgentTaskPath = exports.assertSubAgentTaskPath = exports.ROOT_SUB_AGENT_TASK_PATH = exports.DEFAULT_SUB_AGENT_MAX_CHILDREN = exports.createModel = exports.BaseVectorStore = exports.BaseMemory = exports.fetchProviderCatalog = exports.isLlmMessage = exports.filterLlmMessages = exports.verify = exports.providerTools = exports.McpClient = exports.validateRuntimeSkill = exports.SKILL_LOAD_TOOL_NAME = exports.LIST_SKILLS_TOOL_NAME = exports.RUNTIME_SKILL_REGISTRY_SCHEMA_VERSION = exports.RUNTIME_SKILL_NAME_PATTERN = exports.RUNTIME_SKILL_LINKED_FILE_GROUPS = void 0;
38
- exports.zodToJsonSchema = exports.isZodSchema = exports.ProcessHandle = exports.SandboxProcessManager = exports.createWorkspaceTools = exports.BaseSandbox = exports.BaseFilesystem = exports.Workspace = exports.DEFAULT_OBSERVATION_LOG_TAIL_LIMIT = exports.DEFAULT_OBSERVATION_LOG_RENDER_TOKEN_BUDGET = exports.DEFAULT_OBSERVATION_LOG_REFLECTOR_THRESHOLD_TOKENS = exports.DEFAULT_OBSERVATION_LOG_REFLECTOR_PROMPT = exports.DEFAULT_OBSERVATION_LOG_OBSERVER_THRESHOLD_TOKENS = exports.DEFAULT_OBSERVATION_LOG_OBSERVER_PROMPT = exports.DEFAULT_OBSERVATION_LOG_LOCK_TTL_MS = exports.createObservationLogObserveFn = exports.createObservationLogReflectFn = exports.buildObservationLogObserverPrompt = exports.buildObservationLogReflectorPrompt = exports.ScopedMemoryTaskRunner = exports.runObservationLogReflector = exports.renderObservationLogForReflection = exports.parseObservationLogReflectionJson = exports.normalizeObservationLogReflection = exports.runObservationLogObserver = exports.renderObserverTranscript = exports.parseObservationLogMarkdown = exports.createEpisodicMemoryReflectFn = exports.createEpisodicMemoryExtractFn = exports.buildEpisodicMemoryReflectorPrompt = exports.buildEpisodicMemoryExtractorPrompt = exports.DEFAULT_EPISODIC_MEMORY_TOP_K = exports.DEFAULT_EPISODIC_MEMORY_REFLECTION_PROMPT = exports.DEFAULT_EPISODIC_MEMORY_RECALL_TOOL_INSTRUCTION = exports.DEFAULT_EPISODIC_MEMORY_MAX_ENTRIES_PER_RUN = exports.DEFAULT_EPISODIC_MEMORY_EXTRACTION_PROMPT = exports.DEFAULT_EPISODIC_MEMORY_EMBEDDING_MODEL = exports.withEpisodicMemoryDefaults = exports.runEpisodicMemoryIndexer = exports.rankEpisodicMemoryEntries = void 0;
36
+ exports.RUNTIME_SKILL_FILE_NAME = exports.RUNTIME_SKILL_TOOL_NAMES = exports.renderSkillCatalogPrompt = exports.parseRuntimeSkillMarkdown = exports.loadRuntimeSkillSourceFromDirectory = exports.loadRuntimeSkillsFromDirectory = exports.InvalidRuntimeSkillError = exports.formatSkillValidationErrors = exports.filterRuntimeSkillSource = exports.createSkillLoadTool = exports.createRuntimeSkillTools = exports.createRuntimeSkillSource = exports.createRuntimeSkillRegistry = exports.appendSkillCatalogToInstructions = exports.Agent = exports.LangSmithTelemetry = exports.deriveSubAgentTelemetry = exports.Telemetry = exports.evals = exports.evaluate = exports.Eval = exports.SUPPORTED_PII_CATEGORIES = exports.passesLuhn = exports.resolvePatterns = exports.StreamingRedactor = exports.DEFAULT_PLACEHOLDER = exports.redactionOptionsFromGuardrail = exports.redactDeep = exports.redactText = exports.Guardrail = exports.buildFilterInputSchema = exports.assertValidFilter = exports.normalizeFilterInput = exports.FILTER_OPERATORS = exports.VectorStore = exports.Memory = exports.sanitizeToolName = exports.wrapToolForApproval = exports.Tool = exports.throwIfAborted = exports.raceWithAbort = exports.isAbortError = exports.createAbortError = exports.CANCELLATION_TYPE = exports.isCancellation = exports.createCancellation = exports.OBSERVATION_LOG_STATUSES = exports.OBSERVATION_LOG_MARKERS = exports.estimateObservationTokens = exports.AgentEvent = void 0;
37
+ exports.hashEpisodicMemoryEvidence = exports.hashEpisodicMemoryContent = exports.getEpisodicMemoryScope = exports.createRecallMemoryTool = exports.RECALL_MEMORY_TOOL_NAME = exports.uniqueStrings = exports.supersededLifecycleState = exports.normalizeFlatReflectionActions = exports.markLifecycleSuperseded = exports.markLifecycleDropped = exports.markLifecycleActive = exports.droppedLifecycleState = exports.activeLifecycleState = exports.generateTitleFromMessage = exports.createEmbeddingModel = exports.createPlannerTodosTool = exports.createWriteTodosTool = exports.WRITE_TODOS_TOOL_NAME = exports.renderDelegateSubAgentPrompt = exports.parseDelegateSubAgentContinuation = exports.isDelegateSubAgentTool = exports.getInlineDelegateSubAgentToolOptions = exports.generateResultToDelegateSubAgentOutput = exports.failedDelegatedChildSuspendOutput = exports.createDelegateSubAgentTool = exports.SUB_AGENT_TASK_DIFFICULTIES = exports.INLINE_SUB_AGENT_ID = exports.DELEGATED_CHILD_SUSPEND_UNSUPPORTED_MESSAGE = exports.DELEGATE_SUB_AGENT_TOOL_NAME = exports.sanitizeSubAgentTaskName = exports.isSubAgentTaskPath = exports.createChildSubAgentTaskPath = exports.assertSubAgentTaskPath = exports.ROOT_SUB_AGENT_TASK_PATH = exports.DEFAULT_SUB_AGENT_MAX_CHILDREN = exports.createModel = exports.BaseVectorStore = exports.BaseMemory = exports.fetchProviderCatalog = exports.isLlmMessage = exports.filterLlmMessages = exports.stripHydratedFileData = exports.verify = exports.providerTools = exports.McpClient = exports.validateRuntimeSkill = exports.SKILL_LOAD_TOOL_NAME = exports.RUNTIME_SKILL_REGISTRY_SCHEMA_VERSION = exports.RUNTIME_SKILL_NAME_PATTERN = exports.RUNTIME_SKILL_LINKED_FILE_GROUPS = void 0;
38
+ exports.zodToJsonSchema = exports.isZodSchema = exports.ProcessHandle = exports.SandboxProcessManager = exports.createWorkspaceTools = exports.BaseSandbox = exports.BaseFilesystem = exports.Workspace = exports.DEFAULT_OBSERVATION_LOG_TAIL_LIMIT = exports.DEFAULT_OBSERVATION_LOG_RENDER_TOKEN_BUDGET = exports.DEFAULT_OBSERVATION_LOG_REFLECTOR_THRESHOLD_TOKENS = exports.DEFAULT_OBSERVATION_LOG_REFLECTOR_PROMPT = exports.DEFAULT_OBSERVATION_LOG_OBSERVER_THRESHOLD_TOKENS = exports.DEFAULT_OBSERVATION_LOG_OBSERVER_PROMPT = exports.DEFAULT_OBSERVATION_LOG_LOCK_TTL_MS = exports.createObservationLogObserveFn = exports.createObservationLogReflectFn = exports.buildObservationLogObserverPrompt = exports.buildObservationLogReflectorPrompt = exports.ScopedMemoryTaskRunner = exports.runObservationLogReflector = exports.renderObservationLogForReflection = exports.parseObservationLogReflectionJson = exports.normalizeObservationLogReflection = exports.runObservationLogObserver = exports.renderObserverTranscript = exports.parseObservationLogMarkdown = exports.createEpisodicMemoryReflectFn = exports.createEpisodicMemoryExtractFn = exports.buildEpisodicMemoryReflectorPrompt = exports.buildEpisodicMemoryExtractorPrompt = exports.DEFAULT_EPISODIC_MEMORY_TOP_K = exports.DEFAULT_EPISODIC_MEMORY_REFLECTION_PROMPT = exports.DEFAULT_EPISODIC_MEMORY_RECALL_TOOL_INSTRUCTION = exports.DEFAULT_EPISODIC_MEMORY_MAX_ENTRIES_PER_RUN = exports.DEFAULT_EPISODIC_MEMORY_EXTRACTION_PROMPT = exports.DEFAULT_EPISODIC_MEMORY_EMBEDDING_MODEL = exports.withEpisodicMemoryDefaults = exports.runEpisodicMemoryIndexer = exports.rankEpisodicMemoryEntries = exports.isEpisodicMemoryEnabled = exports.hasEpisodicMemoryStore = void 0;
39
39
  var types_1 = require("./types");
40
40
  Object.defineProperty(exports, "AgentEvent", { enumerable: true, get: function () { return types_1.AgentEvent; } });
41
41
  var types_2 = require("./types");
@@ -82,13 +82,14 @@ Object.defineProperty(exports, "evaluate", { enumerable: true, get: function ()
82
82
  exports.evals = __importStar(require("./evals/index"));
83
83
  var telemetry_1 = require("./sdk/telemetry");
84
84
  Object.defineProperty(exports, "Telemetry", { enumerable: true, get: function () { return telemetry_1.Telemetry; } });
85
+ var sub_agent_telemetry_1 = require("./runtime/telemetry/sub-agent-telemetry");
86
+ Object.defineProperty(exports, "deriveSubAgentTelemetry", { enumerable: true, get: function () { return sub_agent_telemetry_1.deriveSubAgentTelemetry; } });
85
87
  var langsmith_1 = require("./integrations/langsmith");
86
88
  Object.defineProperty(exports, "LangSmithTelemetry", { enumerable: true, get: function () { return langsmith_1.LangSmithTelemetry; } });
87
89
  var agent_1 = require("./sdk/agent");
88
90
  Object.defineProperty(exports, "Agent", { enumerable: true, get: function () { return agent_1.Agent; } });
89
91
  var skills_1 = require("./skills");
90
92
  Object.defineProperty(exports, "appendSkillCatalogToInstructions", { enumerable: true, get: function () { return skills_1.appendSkillCatalogToInstructions; } });
91
- Object.defineProperty(exports, "createListSkillsTool", { enumerable: true, get: function () { return skills_1.createListSkillsTool; } });
92
93
  Object.defineProperty(exports, "createRuntimeSkillRegistry", { enumerable: true, get: function () { return skills_1.createRuntimeSkillRegistry; } });
93
94
  Object.defineProperty(exports, "createRuntimeSkillSource", { enumerable: true, get: function () { return skills_1.createRuntimeSkillSource; } });
94
95
  Object.defineProperty(exports, "createRuntimeSkillTools", { enumerable: true, get: function () { return skills_1.createRuntimeSkillTools; } });
@@ -105,7 +106,6 @@ Object.defineProperty(exports, "RUNTIME_SKILL_FILE_NAME", { enumerable: true, ge
105
106
  Object.defineProperty(exports, "RUNTIME_SKILL_LINKED_FILE_GROUPS", { enumerable: true, get: function () { return skills_1.RUNTIME_SKILL_LINKED_FILE_GROUPS; } });
106
107
  Object.defineProperty(exports, "RUNTIME_SKILL_NAME_PATTERN", { enumerable: true, get: function () { return skills_1.RUNTIME_SKILL_NAME_PATTERN; } });
107
108
  Object.defineProperty(exports, "RUNTIME_SKILL_REGISTRY_SCHEMA_VERSION", { enumerable: true, get: function () { return skills_1.RUNTIME_SKILL_REGISTRY_SCHEMA_VERSION; } });
108
- Object.defineProperty(exports, "LIST_SKILLS_TOOL_NAME", { enumerable: true, get: function () { return skills_1.LIST_SKILLS_TOOL_NAME; } });
109
109
  Object.defineProperty(exports, "SKILL_LOAD_TOOL_NAME", { enumerable: true, get: function () { return skills_1.SKILL_LOAD_TOOL_NAME; } });
110
110
  Object.defineProperty(exports, "validateRuntimeSkill", { enumerable: true, get: function () { return skills_1.validateRuntimeSkill; } });
111
111
  var mcp_client_1 = require("./sdk/mcp-client");
@@ -114,9 +114,11 @@ var provider_tools_1 = require("./sdk/provider-tools");
114
114
  Object.defineProperty(exports, "providerTools", { enumerable: true, get: function () { return provider_tools_1.providerTools; } });
115
115
  var verify_1 = require("./sdk/verify");
116
116
  Object.defineProperty(exports, "verify", { enumerable: true, get: function () { return verify_1.verify; } });
117
- var message_1 = require("./sdk/message");
118
- Object.defineProperty(exports, "filterLlmMessages", { enumerable: true, get: function () { return message_1.filterLlmMessages; } });
119
- Object.defineProperty(exports, "isLlmMessage", { enumerable: true, get: function () { return message_1.isLlmMessage; } });
117
+ var message_1 = require("./types/sdk/message");
118
+ Object.defineProperty(exports, "stripHydratedFileData", { enumerable: true, get: function () { return message_1.stripHydratedFileData; } });
119
+ var message_2 = require("./sdk/message");
120
+ Object.defineProperty(exports, "filterLlmMessages", { enumerable: true, get: function () { return message_2.filterLlmMessages; } });
121
+ Object.defineProperty(exports, "isLlmMessage", { enumerable: true, get: function () { return message_2.isLlmMessage; } });
120
122
  var catalog_1 = require("./sdk/catalog");
121
123
  Object.defineProperty(exports, "fetchProviderCatalog", { enumerable: true, get: function () { return catalog_1.fetchProviderCatalog; } });
122
124
  var base_memory_1 = require("./storage/base-memory");
@@ -142,10 +144,13 @@ Object.defineProperty(exports, "failedDelegatedChildSuspendOutput", { enumerable
142
144
  Object.defineProperty(exports, "generateResultToDelegateSubAgentOutput", { enumerable: true, get: function () { return delegate_sub_agent_tool_1.generateResultToDelegateSubAgentOutput; } });
143
145
  Object.defineProperty(exports, "getInlineDelegateSubAgentToolOptions", { enumerable: true, get: function () { return delegate_sub_agent_tool_1.getInlineDelegateSubAgentToolOptions; } });
144
146
  Object.defineProperty(exports, "isDelegateSubAgentTool", { enumerable: true, get: function () { return delegate_sub_agent_tool_1.isDelegateSubAgentTool; } });
147
+ Object.defineProperty(exports, "parseDelegateSubAgentContinuation", { enumerable: true, get: function () { return delegate_sub_agent_tool_1.parseDelegateSubAgentContinuation; } });
145
148
  Object.defineProperty(exports, "renderDelegateSubAgentPrompt", { enumerable: true, get: function () { return delegate_sub_agent_tool_1.renderDelegateSubAgentPrompt; } });
146
149
  var write_todos_tool_1 = require("./runtime/tools/write-todos-tool");
147
150
  Object.defineProperty(exports, "WRITE_TODOS_TOOL_NAME", { enumerable: true, get: function () { return write_todos_tool_1.WRITE_TODOS_TOOL_NAME; } });
148
151
  Object.defineProperty(exports, "createWriteTodosTool", { enumerable: true, get: function () { return write_todos_tool_1.createWriteTodosTool; } });
152
+ var planner_todos_tool_1 = require("./runtime/tools/planner-todos-tool");
153
+ Object.defineProperty(exports, "createPlannerTodosTool", { enumerable: true, get: function () { return planner_todos_tool_1.createPlannerTodosTool; } });
149
154
  var model_factory_2 = require("./runtime/model/model-factory");
150
155
  Object.defineProperty(exports, "createEmbeddingModel", { enumerable: true, get: function () { return model_factory_2.createEmbeddingModel; } });
151
156
  var title_generation_1 = require("./runtime/memory/title-generation");
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmGA,iCAAqC;AAA5B,mGAAA,UAAU,OAAA;AAEnB,iCAIiB;AAHhB,kHAAA,yBAAyB,OAAA;AACzB,gHAAA,uBAAuB,OAAA;AACvB,iHAAA,wBAAwB,OAAA;AAGzB,mDAA2F;AAAlF,kHAAA,kBAAkB,OAAA;AAAE,8GAAA,cAAc,OAAA;AAAE,iHAAA,iBAAiB,OAAA;AAE9D,qCAKqB;AAJpB,yGAAA,gBAAgB,OAAA;AAChB,qGAAA,YAAY,OAAA;AACZ,sGAAA,aAAa,OAAA;AACb,uGAAA,cAAc,OAAA;AAEf,mCAAyE;AAAhE,4FAAA,IAAI,OAAA;AAAE,2GAAA,mBAAmB,OAA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A1C,iHAAA,oBAAoB,OAAA;AAC7B,yCAAmE;AAA1D,kHAAA,qBAAqB,OAAA;AAAE,0GAAA,aAAa,OAAA;AAoC7C,mCAA2D;AAAlD,kGAAA,WAAW,OAAA;AAAE,sGAAA,eAAe,OAAA"}
@@ -189,7 +189,7 @@ class LangSmithTelemetry extends telemetry_1.Telemetry {
189
189
  const { tracer, provider } = await createLangSmithTracer(this.langsmithConfig, this.resolvedKey);
190
190
  this.tracerValue = tracer;
191
191
  const built = await super.build();
192
- return { ...built, provider };
192
+ return { ...built, provider, isLangSmith: true };
193
193
  }
194
194
  }
195
195
  exports.LangSmithTelemetry = LangSmithTelemetry;
@@ -1 +1 @@
1
- {"version":3,"file":"langsmith.js","sourceRoot":"","sources":["../../src/integrations/langsmith.ts"],"names":[],"mappings":";;;AAAA,gDAA6C;AAG7C,IAAI,qBAAqB,GAAG,KAAK,CAAC;AAElC,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AAClD,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AAC9C,MAAM,uBAAuB,GAAG,0BAA0B,CAAC;AAC3D,MAAM,uCAAuC,GAAG,yCAAyC,CAAC;AAC1F,MAAM,eAAe,GAAG,gBAAgB,CAAC;AACzC,MAAM,2BAA2B,GAAG,IAAI,GAAG,CAAC;IAC3C,4BAA4B;IAC5B,wBAAwB;IACxB,8BAA8B;IAC9B,0BAA0B;IAC1B,aAAa;CACb,CAAC,CAAC;AAuDH,MAAM,yBAAyB,GAAG,CAAC,CAAC;AAEpC,SAAS,aAAa,CAAC,KAAc;IACpC,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AAClE,CAAC;AAED,SAAS,uCAAuC,CAC/C,0BAAiE,EACjE,iBAAwF,EACxF,UAAiD;IAEjD,OAAO;QACN,MAAM,CAAC,KAAK,EAAE,cAAc;YAC3B,KAAK,CA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CAAC;IAGQ,KAAK,CAAC,KAAK;QACnB,IAAI,IAAI,CAAC,iBAAiB,KAAK,SAAS,EAAE,CAAC;YAC1C,MAAM,IAAI,KAAK,CAAC,yEAAyE,CAAC,CAAC;QAC5F,CAAC;QAID,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;QAI7B,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,MAAM,CAAC;QAE5C,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,qBAAqB,CACvD,IAAI,CAAC,eAAe,EACpB,IAAI,CAAC,WAAW,CAChB,CAAC;QACF,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC;QAG1B,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC;QAOlC,OAAO,EAAE,GAAG,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;IAClD,CAAC;CACD"}
@@ -2,8 +2,8 @@ import type { ProviderOptions } from '@ai-sdk/provider-utils';
2
2
  import type { JSONSchema7 } from 'json-schema';
3
3
  import type { z } from 'zod';
4
4
  import { type ModelCost } from '../../sdk/catalog';
5
- import type { BuiltMemory, BuiltProviderTool, BuiltTelemetry, BuiltTool, CheckpointStore, EpisodicMemoryConfig, GenerateResult, ObservationalMemoryConfig, ObservationLogMemoryConfig, RunOptions, SerializableAgentState, StreamResult, ThinkingConfig, TitleGenerationConfig } from '../../types';
6
- import type { ExecutionOptions, ModelConfig, PromptCachingConfig } from '../../types/sdk/agent';
5
+ import type { BuiltFileStore, BuiltMemory, BuiltProviderTool, BuiltTelemetry, BuiltTool, CheckpointStore, EpisodicMemoryConfig, GenerateResult, McpConnectionFailedEvent, ObservationalMemoryConfig, ObservationLogMemoryConfig, RunOptions, ReasoningLevel, SerializableAgentState, StreamResult, ThinkingConfig, TitleGenerationConfig } from '../../types';
6
+ import type { ExecutionOptions, ModelConfig, PromptCachingConfig, ResumeOptions } from '../../types/sdk/agent';
7
7
  import type { AgentMessage } from '../../types/sdk/message';
8
8
  import type { ScopedMemoryTaskEvent } from '../memory/scoped-memory-task-runner';
9
9
  import type { FetchFn } from '../model/model-factory';
@@ -22,12 +22,14 @@ export interface AgentRuntimeConfig {
22
22
  };
23
23
  providerTools?: BuiltProviderTool[];
24
24
  memory?: BuiltMemory;
25
+ fileStore?: BuiltFileStore;
25
26
  observationLog?: ObservationLogMemoryConfig;
26
27
  observationalMemory?: ObservationalMemoryConfig;
27
28
  episodicMemory?: EpisodicMemoryConfig;
28
29
  structuredOutput?: z.ZodType | JSONSchema7;
29
30
  checkpointStorage?: 'memory' | CheckpointStore;
30
31
  thinking?: ThinkingConfig;
32
+ reasoning?: ReasoningLevel;
31
33
  promptCaching?: PromptCachingConfig;
32
34
  eventBus?: AgentEventBus;
33
35
  toolCallConcurrency?: number;
@@ -37,6 +39,7 @@ export interface AgentRuntimeConfig {
37
39
  modelCost?: ModelCost;
38
40
  runState?: RunStateManager;
39
41
  onMemoryTaskEvent?: (event: ScopedMemoryTaskEvent) => void;
42
+ mcpConnectionFailures?: McpConnectionFailedEvent[];
40
43
  }
41
44
  export declare class AgentRuntime {
42
45
  private config;
@@ -58,14 +61,8 @@ export declare class AgentRuntime {
58
61
  abort(): void;
59
62
  generate(input: AgentMessage[] | string, options?: RunOptions & ExecutionOptions): Promise<GenerateResult>;
60
63
  stream(input: AgentMessage[] | string, options?: RunOptions & ExecutionOptions): Promise<StreamResult>;
61
- resume(method: 'generate', data: unknown, options: {
62
- runId: string;
63
- toolCallId: string;
64
- } & ExecutionOptions): Promise<GenerateResult>;
65
- resume(method: 'stream', data: unknown, options: {
66
- runId: string;
67
- toolCallId: string;
68
- } & ExecutionOptions): Promise<StreamResult>;
64
+ resume(method: 'generate', data: unknown, options: ResumeOptions & ExecutionOptions): Promise<GenerateResult>;
65
+ resume(method: 'stream', data: unknown, options: ResumeOptions & ExecutionOptions): Promise<StreamResult>;
69
66
  crashResume(options: {
70
67
  runId: string;
71
68
  contextNotes?: string[];
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AgentRuntime = void 0;
4
4
  const execution_counter_1 = require("./execution-counter");
5
5
  const generate_sink_1 = require("./generate-sink");
6
+ const hydrate_file_parts_1 = require("./hydrate-file-parts");
6
7
  const runtime_context_1 = require("./runtime-context");
7
8
  const runtime_helpers_1 = require("./runtime-helpers");
8
9
  const stream_sink_1 = require("./stream-sink");
@@ -125,29 +126,35 @@ class AgentRuntime {
125
126
  async resume(method, data, options) {
126
127
  this.runId = options.runId;
127
128
  const state = await this.runState.resume(this.runId);
128
- if (!state)
129
- throw new Error(`No suspended run found for runId: ${this.runId}`);
129
+ if (!state) {
130
+ throw new run_state_1.StaleResumeError(`No suspended run found for runId: ${this.runId}`);
131
+ }
130
132
  const toolCall = state.pendingToolCalls[options.toolCallId];
131
- if (!toolCall)
132
- throw new Error(`No tool call found for toolCallId: ${options.toolCallId}`);
133
+ if (!toolCall) {
134
+ throw new run_state_1.StaleResumeError(`No tool call found for toolCallId: ${options.toolCallId}`);
135
+ }
133
136
  const list = message_list_1.AgentMessageList.deserialize(state.messageList);
134
137
  this.context.hydrateDeferredToolsFromList(list);
135
- const toolForValidation = this.context
138
+ await (0, hydrate_file_parts_1.hydrateFileParts)(list.messages(), this.config.fileStore, {
139
+ threadId: state.persistence?.threadId,
140
+ });
141
+ const tool = this.context
136
142
  .getCurrentTools(state.persistence)
137
143
  .find((t) => t.name === toolCall.toolName);
138
- if (!toolForValidation)
144
+ if (!tool)
139
145
  throw new Error(`Tool ${toolCall.toolName} not found`);
140
146
  let resumeData = data;
141
147
  let abortScope;
142
- if (!(0, cancellation_1.isCancellation)(resumeData) && toolForValidation.resumeSchema) {
143
- const parseResult = await (0, parse_1.parseWithSchema)(toolForValidation.resumeSchema, data);
148
+ const resumeSchema = toolCall.suspended ? toolCall.resumeSchema : tool.resumeSchema;
149
+ if (!(0, cancellation_1.isCancellation)(resumeData) && resumeSchema) {
150
+ const parseResult = await (0, parse_1.parseWithSchema)(resumeSchema, data);
144
151
  if (!parseResult.success) {
145
152
  throw new Error(`Invalid resume payload: ${parseResult.error}`);
146
153
  }
147
154
  resumeData = parseResult.data;
148
155
  }
149
156
  try {
150
- const { runId: _rid, toolCallId: _tcid, ...callerExecOptions } = options;
157
+ const { runId: _rid, toolCallId: _tcid, onResumeClaimed: _onResumeClaimed, ...callerExecOptions } = options;
151
158
  const persisted = state.executionOptions ?? {};
152
159
  const persistedMaxIterations = persisted.maxIterations;
153
160
  const callerMaxIterations = callerExecOptions.maxIterations;
@@ -162,15 +169,15 @@ class AgentRuntime {
162
169
  ...(mergedMaxIterations !== undefined ? { maxIterations: mergedMaxIterations } : {}),
163
170
  ...(state.iterationCount !== undefined ? { iterationCount: state.iterationCount } : {}),
164
171
  };
165
- const tool = this.context
166
- .getCurrentTools(state.persistence, mergedExecOptions.executionCounter)
167
- .find((t) => t.name === toolCall.toolName);
168
- if (!tool)
169
- throw new Error(`Tool ${toolCall.toolName} not found`);
170
172
  const resumeOptions = {
171
173
  persistence: state.persistence,
172
174
  ...mergedExecOptions,
173
175
  };
176
+ const claimed = await this.runState.claimResume(this.runId, state);
177
+ if (!claimed) {
178
+ throw new run_state_1.StaleResumeError(`Run ${this.runId} is not suspended. Cannot resume.`);
179
+ }
180
+ await options.onResumeClaimed?.();
174
181
  abortScope = this.eventBus.createAbortScope(resumeOptions.abortSignal);
175
182
  const activeAbortScope = abortScope;
176
183
  const pendingResume = {
@@ -180,10 +187,6 @@ class AgentRuntime {
180
187
  };
181
188
  await this.ensureModelCost();
182
189
  await this.memory.setListObservationLogMemory(list, state.persistence);
183
- const claimed = await this.runState.claimResume(this.runId, state);
184
- if (!claimed) {
185
- throw new Error(`Run ${this.runId} is not suspended. Cannot resume.`);
186
- }
187
190
  if (method === 'generate') {
188
191
  const sink = new generate_sink_1.GenerateSink(this.createRunServices());
189
192
  const rawResult = await this.telemetry.withRootSpan('generate', resumeOptions, this.runId, async () => await this.runAgentLoop({
@@ -213,6 +216,8 @@ class AgentRuntime {
213
216
  catch (error) {
214
217
  const isAbort = abortScope?.isAborted ?? false;
215
218
  abortScope?.dispose();
219
+ if (error instanceof run_state_1.StaleResumeError)
220
+ throw error;
216
221
  this.updateState({ status: isAbort ? 'cancelled' : 'failed' });
217
222
  if (!isAbort) {
218
223
  this.eventBus.emit({ type: "error", message: String(error), error });
@@ -242,6 +247,9 @@ class AgentRuntime {
242
247
  }
243
248
  const list = message_list_1.AgentMessageList.deserialize(state.messageList);
244
249
  this.context.hydrateDeferredToolsFromList(list);
250
+ await (0, hydrate_file_parts_1.hydrateFileParts)(list.messages(), this.config.fileStore, {
251
+ threadId: state.persistence?.threadId,
252
+ });
245
253
  let abortScope;
246
254
  try {
247
255
  const { runId: _rid, contextNotes, ...callerExecOptions } = options;
@@ -292,6 +300,9 @@ class AgentRuntime {
292
300
  await this.memory.loadInto(list, options);
293
301
  list.addInput(input);
294
302
  await this.memory.persistInputMessages(list, options);
303
+ await (0, hydrate_file_parts_1.hydrateFileParts)(list.messages(), this.config.fileStore, {
304
+ threadId: options?.persistence?.threadId,
305
+ });
295
306
  return list;
296
307
  }
297
308
  async initRun(input, options) {
@@ -309,16 +320,20 @@ class AgentRuntime {
309
320
  result.runId = this.runId;
310
321
  result.usage = this.applyCost(result.usage);
311
322
  result.model = this.modelIdString;
312
- this.updateState({ status: 'success', messageList: list.serialize() });
313
- this.eventBus.emit({ type: "agent_end", messages: result.messages });
323
+ if (!result.pendingSuspend?.length) {
324
+ this.updateState({ status: 'success', messageList: list.serialize() });
325
+ this.eventBus.emit({ type: "agent_end", messages: result.messages });
326
+ }
314
327
  return { ...result, getState: () => this.getState() };
315
328
  }
316
329
  buildAiSdkOptions(toolMap, options) {
317
330
  return {
318
331
  ...this.telemetry.buildTelemetryOptions(options),
319
- ...(options?.onStepStart ? { experimental_onStepStart: options.onStepStart } : {}),
320
- ...(options?.onStepFinish ? { onStepFinish: options.onStepFinish } : {}),
321
- experimental_repairToolCall: async (options) => {
332
+ ...(options?.onStepStart ? { onStepStart: options.onStepStart } : {}),
333
+ ...(options?.onStepEnd || options?.onStepFinish
334
+ ? { onStepEnd: options.onStepEnd ?? options.onStepFinish }
335
+ : {}),
336
+ repairToolCall: async (options) => {
322
337
  return await (0, fix_tool_call_1.fixToolCall)({
323
338
  toolCall: options.toolCall,
324
339
  error: options.error,
@@ -368,6 +383,7 @@ class AgentRuntime {
368
383
  async runAgentLoop(ctx, sink) {
369
384
  const { list, options, abortScope, pendingResume } = ctx;
370
385
  this.context.hydrateDeferredToolsFromList(list);
386
+ list.mcpConnectionNote = (0, runtime_helpers_1.formatMcpConnectionNote)(this.config.mcpConnectionFailures ?? []);
371
387
  let totalUsage;
372
388
  let lastFinishReason = 'stop';
373
389
  let structuredOutput;
@@ -390,22 +406,49 @@ class AgentRuntime {
390
406
  abortSignal: abortScope.signal,
391
407
  isAborted: () => abortScope.isAborted,
392
408
  });
409
+ const finishToolBatch = async (batch, toolMap, nextIteration) => {
410
+ const hasPending = Object.keys(batch.pending).length > 0;
411
+ let completed = false;
412
+ try {
413
+ this.assertNotAborted(abortScope);
414
+ await sink.emitToolBatch(batch);
415
+ this.assertNotAborted(abortScope);
416
+ if (!hasPending) {
417
+ completed = true;
418
+ return { suspended: false };
419
+ }
420
+ await this.persistSuspension(batch.pending, options, list, totalUsage, maxIterations, nextIteration);
421
+ this.assertNotAborted(abortScope);
422
+ const result = await sink.finishSuspended({
423
+ suspendRunId: this.runId,
424
+ list,
425
+ usage: totalUsage,
426
+ suspensions: batch.suspensions,
427
+ });
428
+ this.assertNotAborted(abortScope);
429
+ completed = true;
430
+ return { suspended: true, result };
431
+ }
432
+ finally {
433
+ if (!completed && hasPending) {
434
+ await this.toolExecutor.cleanupPendingToolCalls(batch.pending, buildToolBatchContext(toolMap), abortScope.isAborted ? 'Run aborted' : 'Parent run failed before suspension');
435
+ try {
436
+ await this.runState.cancel(this.runId);
437
+ }
438
+ catch {
439
+ }
440
+ }
441
+ }
442
+ };
393
443
  if (pendingResume) {
394
444
  const pendingLoopContext = this.context.buildToolLoopContext(staticLoopContext.aiProviderTools, options?.persistence, options?.executionCounter);
395
445
  const batch = await this.toolExecutor.iteratePendingToolCallsConcurrent({
396
446
  ...buildToolBatchContext(pendingLoopContext.toolMap),
397
447
  pendingResume,
398
448
  });
399
- await sink.emitToolBatch(batch);
400
- if (Object.keys(batch.pending).length > 0) {
401
- const suspendRunId = await this.persistSuspension(batch.pending, options, list, totalUsage, maxIterations, iterationCount);
402
- return await sink.finishSuspended({
403
- suspendRunId,
404
- list,
405
- usage: totalUsage,
406
- suspensions: batch.suspensions,
407
- });
408
- }
449
+ const finalized = await finishToolBatch(batch, pendingLoopContext.toolMap, iterationCount);
450
+ if (finalized.suspended)
451
+ return finalized.result;
409
452
  }
410
453
  for (; iterationCount < maxIterations; iterationCount++) {
411
454
  this.assertNotAborted(abortScope);
@@ -427,6 +470,7 @@ class AgentRuntime {
427
470
  abortSignal: abortScope.signal,
428
471
  hasTools,
429
472
  aiTools: cached.aiTools,
473
+ reasoning: staticLoopContext.reasoning,
430
474
  providerOptions: staticLoopContext.providerOptions,
431
475
  outputSpec: staticLoopContext.outputSpec,
432
476
  aiSdkOptions: this.buildAiSdkOptions(toolMap, options),
@@ -450,17 +494,9 @@ class AgentRuntime {
450
494
  ...buildToolBatchContext(toolMap),
451
495
  toolCalls: turn.toolCalls,
452
496
  });
453
- this.assertNotAborted(abortScope);
454
- await sink.emitToolBatch(batch);
455
- if (Object.keys(batch.pending).length > 0) {
456
- const suspendRunId = await this.persistSuspension(batch.pending, options, list, totalUsage, maxIterations, iterationCount + 1);
457
- return await sink.finishSuspended({
458
- suspendRunId,
459
- list,
460
- usage: totalUsage,
461
- suspensions: batch.suspensions,
462
- });
463
- }
497
+ const finalized = await finishToolBatch(batch, toolMap, iterationCount + 1);
498
+ if (finalized.suspended)
499
+ return finalized.result;
464
500
  this.emitTurnEnd(turn.newMessages, (0, runtime_helpers_1.extractSettledToolCalls)(list.responseDelta()));
465
501
  if (options?.stepCheckpoints) {
466
502
  await this.persistStepCheckpoint(list, totalUsage, options, maxIterations, iterationCount + 1);
@@ -486,6 +522,15 @@ class AgentRuntime {
486
522
  options: ctx.options,
487
523
  withRootSpan: async (operation, options, runId, fn) => await this.telemetry.withRootSpan(operation, options, runId, fn),
488
524
  runLoop: async (guard) => {
525
+ for (const failure of this.config.mcpConnectionFailures ?? []) {
526
+ void guard.write({
527
+ type: 'warning',
528
+ message: failure.error,
529
+ code: 'mcp_connection_failed',
530
+ source: 'mcp',
531
+ server: failure.server,
532
+ });
533
+ }
489
534
  sink = new stream_sink_1.StreamSink(guard, this.createRunServices(), ctx.options);
490
535
  await this.runAgentLoop(ctx, sink);
491
536
  },
@@ -518,7 +563,6 @@ class AgentRuntime {
518
563
  await this.runState.suspend(this.runId, state);
519
564
  this.updateState({ status: 'suspended', pendingToolCalls, messageList: list.serialize() });
520
565
  await this.memory.persistTurnDelta(list, options);
521
- return this.runId;
522
566
  }
523
567
  async persistStepCheckpoint(list, totalUsage, options, maxIterations, iterationCount) {
524
568
  const resolvedMaxIterations = maxIterations ?? options?.maxIterations;