@inkeep/agents-run-api 0.39.5 → 0.41.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 (180) hide show
  1. package/dist/_virtual/_raw_/home/runner/work/agents/agents/agents-run-api/templates/v1/phase1/system-prompt.js +5 -0
  2. package/dist/_virtual/_raw_/home/runner/work/agents/agents/agents-run-api/templates/v1/phase1/thinking-preparation.js +5 -0
  3. package/dist/_virtual/_raw_/home/runner/work/agents/agents/agents-run-api/templates/v1/phase1/tool.js +5 -0
  4. package/dist/_virtual/_raw_/home/runner/work/agents/agents/agents-run-api/templates/v1/phase2/data-component.js +5 -0
  5. package/dist/_virtual/_raw_/home/runner/work/agents/agents/agents-run-api/templates/v1/phase2/data-components.js +5 -0
  6. package/dist/_virtual/_raw_/home/runner/work/agents/agents/agents-run-api/templates/v1/phase2/system-prompt.js +5 -0
  7. package/dist/_virtual/_raw_/home/runner/work/agents/agents/agents-run-api/templates/v1/shared/artifact-retrieval-guidance.js +5 -0
  8. package/dist/_virtual/_raw_/home/runner/work/agents/agents/agents-run-api/templates/v1/shared/artifact.js +5 -0
  9. package/dist/a2a/client.d.ts +184 -0
  10. package/dist/a2a/client.js +510 -0
  11. package/dist/a2a/handlers.d.ts +7 -0
  12. package/dist/a2a/handlers.js +576 -0
  13. package/dist/a2a/transfer.d.ts +22 -0
  14. package/dist/a2a/transfer.js +46 -0
  15. package/dist/a2a/types.d.ts +79 -0
  16. package/dist/a2a/types.js +22 -0
  17. package/dist/agents/Agent.d.ts +268 -0
  18. package/dist/agents/Agent.js +1932 -0
  19. package/dist/agents/ModelFactory.d.ts +63 -0
  20. package/dist/agents/ModelFactory.js +194 -0
  21. package/dist/agents/SystemPromptBuilder.d.ts +21 -0
  22. package/dist/agents/SystemPromptBuilder.js +48 -0
  23. package/dist/agents/ToolSessionManager.d.ts +63 -0
  24. package/dist/agents/ToolSessionManager.js +146 -0
  25. package/dist/agents/generateTaskHandler.d.ts +49 -0
  26. package/dist/agents/generateTaskHandler.js +523 -0
  27. package/dist/agents/relationTools.d.ts +57 -0
  28. package/dist/agents/relationTools.js +262 -0
  29. package/dist/agents/types.d.ts +28 -0
  30. package/dist/agents/types.js +1 -0
  31. package/dist/agents/versions/v1/Phase1Config.d.ts +27 -0
  32. package/dist/agents/versions/v1/Phase1Config.js +424 -0
  33. package/dist/agents/versions/v1/Phase2Config.d.ts +31 -0
  34. package/dist/agents/versions/v1/Phase2Config.js +330 -0
  35. package/dist/constants/execution-limits/defaults.d.ts +51 -0
  36. package/dist/constants/execution-limits/defaults.js +52 -0
  37. package/dist/constants/execution-limits/index.d.ts +6 -0
  38. package/dist/constants/execution-limits/index.js +21 -0
  39. package/dist/create-app.d.ts +9 -0
  40. package/dist/create-app.js +195 -0
  41. package/dist/data/agent.d.ts +7 -0
  42. package/dist/data/agent.js +72 -0
  43. package/dist/data/agents.d.ts +34 -0
  44. package/dist/data/agents.js +139 -0
  45. package/dist/data/conversations.d.ts +128 -0
  46. package/dist/data/conversations.js +522 -0
  47. package/dist/data/db/dbClient.d.ts +6 -0
  48. package/dist/data/db/dbClient.js +17 -0
  49. package/dist/env.d.ts +57 -0
  50. package/dist/env.js +1 -2
  51. package/dist/handlers/executionHandler.d.ts +41 -0
  52. package/dist/handlers/executionHandler.js +457 -0
  53. package/dist/index.d.ts +8 -29
  54. package/dist/index.js +5 -11386
  55. package/dist/instrumentation.d.ts +1 -2
  56. package/dist/instrumentation.js +66 -3
  57. package/dist/{logger2.js → logger.d.ts} +1 -2
  58. package/dist/logger.js +1 -1
  59. package/dist/middleware/api-key-auth.d.ts +26 -0
  60. package/dist/middleware/api-key-auth.js +240 -0
  61. package/dist/middleware/index.d.ts +2 -0
  62. package/dist/middleware/index.js +3 -0
  63. package/dist/openapi.d.ts +4 -0
  64. package/dist/openapi.js +54 -0
  65. package/dist/routes/agents.d.ts +12 -0
  66. package/dist/routes/agents.js +147 -0
  67. package/dist/routes/chat.d.ts +13 -0
  68. package/dist/routes/chat.js +305 -0
  69. package/dist/routes/chatDataStream.d.ts +13 -0
  70. package/dist/routes/chatDataStream.js +365 -0
  71. package/dist/routes/mcp.d.ts +13 -0
  72. package/dist/routes/mcp.js +495 -0
  73. package/dist/services/AgentSession.d.ts +356 -0
  74. package/dist/services/AgentSession.js +1208 -0
  75. package/dist/services/ArtifactParser.d.ts +105 -0
  76. package/dist/services/ArtifactParser.js +338 -0
  77. package/dist/services/ArtifactService.d.ts +123 -0
  78. package/dist/services/ArtifactService.js +612 -0
  79. package/dist/services/BaseCompressor.d.ts +183 -0
  80. package/dist/services/BaseCompressor.js +500 -0
  81. package/dist/services/ConversationCompressor.d.ts +32 -0
  82. package/dist/services/ConversationCompressor.js +91 -0
  83. package/dist/services/IncrementalStreamParser.d.ts +98 -0
  84. package/dist/services/IncrementalStreamParser.js +327 -0
  85. package/dist/services/MidGenerationCompressor.d.ts +63 -0
  86. package/dist/services/MidGenerationCompressor.js +104 -0
  87. package/dist/services/PendingToolApprovalManager.d.ts +62 -0
  88. package/dist/services/PendingToolApprovalManager.js +133 -0
  89. package/dist/services/ResponseFormatter.d.ts +39 -0
  90. package/dist/services/ResponseFormatter.js +152 -0
  91. package/dist/tools/NativeSandboxExecutor.d.ts +38 -0
  92. package/dist/tools/NativeSandboxExecutor.js +432 -0
  93. package/dist/tools/SandboxExecutorFactory.d.ts +36 -0
  94. package/dist/tools/SandboxExecutorFactory.js +80 -0
  95. package/dist/tools/VercelSandboxExecutor.d.ts +71 -0
  96. package/dist/tools/VercelSandboxExecutor.js +340 -0
  97. package/dist/tools/distill-conversation-history-tool.d.ts +62 -0
  98. package/dist/tools/distill-conversation-history-tool.js +206 -0
  99. package/dist/tools/distill-conversation-tool.d.ts +41 -0
  100. package/dist/tools/distill-conversation-tool.js +141 -0
  101. package/dist/tools/sandbox-utils.d.ts +18 -0
  102. package/dist/tools/sandbox-utils.js +53 -0
  103. package/dist/types/chat.d.ts +27 -0
  104. package/dist/types/chat.js +1 -0
  105. package/dist/types/execution-context.d.ts +46 -0
  106. package/dist/types/execution-context.js +27 -0
  107. package/dist/types/xml.d.ts +5 -0
  108. package/dist/utils/SchemaProcessor.d.ts +52 -0
  109. package/dist/utils/SchemaProcessor.js +182 -0
  110. package/dist/utils/agent-operations.d.ts +62 -0
  111. package/dist/utils/agent-operations.js +53 -0
  112. package/dist/utils/artifact-component-schema.d.ts +42 -0
  113. package/dist/utils/artifact-component-schema.js +186 -0
  114. package/dist/utils/cleanup.d.ts +21 -0
  115. package/dist/utils/cleanup.js +59 -0
  116. package/dist/utils/data-component-schema.d.ts +2 -0
  117. package/dist/utils/data-component-schema.js +3 -0
  118. package/dist/utils/default-status-schemas.d.ts +20 -0
  119. package/dist/utils/default-status-schemas.js +24 -0
  120. package/dist/utils/json-postprocessor.d.ts +13 -0
  121. package/dist/{json-postprocessor.cjs → utils/json-postprocessor.js} +2 -3
  122. package/dist/utils/model-context-utils.d.ts +39 -0
  123. package/dist/utils/model-context-utils.js +181 -0
  124. package/dist/utils/model-resolver.d.ts +6 -0
  125. package/dist/utils/model-resolver.js +34 -0
  126. package/dist/utils/schema-validation.d.ts +44 -0
  127. package/dist/utils/schema-validation.js +97 -0
  128. package/dist/utils/stream-helpers.d.ts +197 -0
  129. package/dist/utils/stream-helpers.js +518 -0
  130. package/dist/utils/stream-registry.d.ts +22 -0
  131. package/dist/utils/stream-registry.js +34 -0
  132. package/dist/utils/token-estimator.d.ts +69 -0
  133. package/dist/utils/token-estimator.js +53 -0
  134. package/dist/utils/tracer.d.ts +7 -0
  135. package/dist/utils/tracer.js +7 -0
  136. package/package.json +10 -26
  137. package/dist/SandboxExecutorFactory.cjs +0 -895
  138. package/dist/SandboxExecutorFactory.js +0 -893
  139. package/dist/SandboxExecutorFactory.js.map +0 -1
  140. package/dist/chunk-VBDAOXYI.cjs +0 -927
  141. package/dist/chunk-VBDAOXYI.js +0 -832
  142. package/dist/chunk-VBDAOXYI.js.map +0 -1
  143. package/dist/chunk.cjs +0 -34
  144. package/dist/conversations.cjs +0 -7
  145. package/dist/conversations.js +0 -7
  146. package/dist/conversations2.cjs +0 -209
  147. package/dist/conversations2.js +0 -180
  148. package/dist/conversations2.js.map +0 -1
  149. package/dist/dbClient.cjs +0 -9676
  150. package/dist/dbClient.js +0 -9670
  151. package/dist/dbClient.js.map +0 -1
  152. package/dist/dbClient2.cjs +0 -5
  153. package/dist/dbClient2.js +0 -5
  154. package/dist/env.cjs +0 -59
  155. package/dist/env.js.map +0 -1
  156. package/dist/execution-limits.cjs +0 -260
  157. package/dist/execution-limits.js +0 -63
  158. package/dist/execution-limits.js.map +0 -1
  159. package/dist/index.cjs +0 -11411
  160. package/dist/index.d.cts +0 -36
  161. package/dist/index.d.cts.map +0 -1
  162. package/dist/index.d.ts.map +0 -1
  163. package/dist/index.js.map +0 -1
  164. package/dist/instrumentation.cjs +0 -12
  165. package/dist/instrumentation.d.cts +0 -18
  166. package/dist/instrumentation.d.cts.map +0 -1
  167. package/dist/instrumentation.d.ts.map +0 -1
  168. package/dist/instrumentation2.cjs +0 -116
  169. package/dist/instrumentation2.js +0 -69
  170. package/dist/instrumentation2.js.map +0 -1
  171. package/dist/json-postprocessor.js +0 -20
  172. package/dist/json-postprocessor.js.map +0 -1
  173. package/dist/logger.cjs +0 -5
  174. package/dist/logger2.cjs +0 -1
  175. package/dist/nodefs.cjs +0 -29
  176. package/dist/nodefs.js +0 -27
  177. package/dist/nodefs.js.map +0 -1
  178. package/dist/opfs-ahp.cjs +0 -367
  179. package/dist/opfs-ahp.js +0 -368
  180. package/dist/opfs-ahp.js.map +0 -1
@@ -0,0 +1,79 @@
1
+ import { AgentCard, Artifact, Message, Task, TaskState } from "@inkeep/agents-core";
2
+
3
+ //#region src/a2a/types.d.ts
4
+ interface RegisteredAgent {
5
+ subAgentId: string;
6
+ tenantId: string;
7
+ projectId: string;
8
+ agentId: string;
9
+ agentCard: AgentCard;
10
+ taskHandler: (task: A2ATask) => Promise<A2ATaskResult>;
11
+ }
12
+ interface A2ATask {
13
+ id: string;
14
+ input: {
15
+ parts: Array<{
16
+ kind: string;
17
+ text?: string;
18
+ data?: any;
19
+ }>;
20
+ };
21
+ context?: {
22
+ conversationId?: string;
23
+ userId?: string;
24
+ metadata?: Record<string, any>;
25
+ };
26
+ }
27
+ type A2ATaskErrorType = 'connection_refused' | 'unknown';
28
+ interface A2ATaskResult {
29
+ status: {
30
+ state: TaskState;
31
+ message?: string;
32
+ type?: A2ATaskErrorType;
33
+ };
34
+ artifacts?: Artifact[];
35
+ }
36
+ /**
37
+ * Transfer data structure - what the transfer tool returns
38
+ * This gets wrapped into a DataPart by the AI SDK
39
+ */
40
+ interface TransferData {
41
+ type: 'transfer';
42
+ targetSubAgentId: string;
43
+ fromSubAgentId?: string;
44
+ }
45
+ /**
46
+ * Full transfer response following A2A protocol
47
+ * The TransferData is wrapped in artifacts[0].parts[0].data
48
+ */
49
+ interface TransferTask extends Task {
50
+ artifacts: Artifact[];
51
+ }
52
+ /**
53
+ * Type guard to check if a Task contains transfer data
54
+ */
55
+ declare function isTransferTask(result: Task | Message): result is TransferTask;
56
+ /**
57
+ * Helper to safely extract transfer data from a TransferTask
58
+ * Returns null if no transfer data found
59
+ */
60
+ declare function extractTransferData(task: TransferTask): TransferData | null;
61
+ interface JsonRpcRequest {
62
+ jsonrpc: '2.0';
63
+ method: string;
64
+ params?: any;
65
+ id?: string | number | null;
66
+ }
67
+ interface JsonRpcResponse {
68
+ jsonrpc: '2.0';
69
+ result?: any;
70
+ error?: {
71
+ code: number;
72
+ message: string;
73
+ data?: any;
74
+ };
75
+ id?: string | number | null;
76
+ }
77
+ type A2AMethod = 'agent.invoke' | 'agent.getCapabilities' | 'agent.getStatus';
78
+ //#endregion
79
+ export { A2AMethod, A2ATask, A2ATaskErrorType, A2ATaskResult, type AgentCard, JsonRpcRequest, JsonRpcResponse, RegisteredAgent, TransferData, TransferTask, extractTransferData, isTransferTask };
@@ -0,0 +1,22 @@
1
+ //#region src/a2a/types.ts
2
+ /**
3
+ * Type guard to check if a Task contains transfer data
4
+ */
5
+ function isTransferTask(result) {
6
+ if (!("artifacts" in result) || !result.artifacts) return false;
7
+ return result.artifacts.some((artifact) => artifact.parts.some((part) => {
8
+ if (part.kind !== "data" || !part.data) return false;
9
+ return typeof part.data === "object" && "type" in part.data && part.data.type === "transfer";
10
+ }));
11
+ }
12
+ /**
13
+ * Helper to safely extract transfer data from a TransferTask
14
+ * Returns null if no transfer data found
15
+ */
16
+ function extractTransferData(task) {
17
+ for (const artifact of task.artifacts) for (const part of artifact.parts) if (part.kind === "data" && part.data?.type === "transfer") return part.data;
18
+ return null;
19
+ }
20
+
21
+ //#endregion
22
+ export { extractTransferData, isTransferTask };
@@ -0,0 +1,268 @@
1
+ import { SandboxConfig } from "../types/execution-context.js";
2
+ import { StreamHelper } from "../utils/stream-helpers.js";
3
+ import { AgentConversationHistoryConfig, Artifact, ArtifactComponentApiInsert, CredentialStoreRegistry, DataComponentApiInsert, McpTool, Models, SubAgentStopWhen } from "@inkeep/agents-core";
4
+ import { ToolSet } from "ai";
5
+
6
+ //#region src/agents/Agent.d.ts
7
+
8
+ /**
9
+ * Creates a stopWhen condition that stops when any tool call name starts with the given prefix
10
+ * @param prefix - The prefix to check for in tool call names
11
+ * @returns A function that can be used as a stopWhen condition
12
+ */
13
+ declare function hasToolCallWithPrefix(prefix: string): ({
14
+ steps
15
+ }: {
16
+ steps: Array<any>;
17
+ }) => any;
18
+ type AgentConfig = {
19
+ id: string;
20
+ tenantId: string;
21
+ projectId: string;
22
+ agentId: string;
23
+ relationId?: string;
24
+ baseUrl: string;
25
+ apiKey?: string;
26
+ apiKeyId?: string;
27
+ name: string;
28
+ description?: string;
29
+ prompt?: string;
30
+ subAgentRelations: AgentConfig[];
31
+ transferRelations: AgentConfig[];
32
+ delegateRelations: DelegateRelation[];
33
+ tools?: McpTool[];
34
+ artifacts?: Record<string, Artifact>;
35
+ functionTools?: Array<{
36
+ name: string;
37
+ description: string;
38
+ execute: (params: any) => Promise<any>;
39
+ parameters?: Record<string, any>;
40
+ schema?: any;
41
+ }>;
42
+ contextConfigId?: string;
43
+ dataComponents?: DataComponentApiInsert[];
44
+ artifactComponents?: ArtifactComponentApiInsert[];
45
+ conversationHistoryConfig?: AgentConversationHistoryConfig;
46
+ models?: Models;
47
+ stopWhen?: SubAgentStopWhen;
48
+ sandboxConfig?: SandboxConfig;
49
+ /** User ID for user-scoped credential lookup (from temp JWT) */
50
+ userId?: string;
51
+ /** Headers to forward to MCP servers (e.g., x-forwarded-cookie for user session auth) */
52
+ forwardedHeaders?: Record<string, string>;
53
+ };
54
+ type ExternalAgentRelationConfig = {
55
+ relationId: string;
56
+ id: string;
57
+ name: string;
58
+ description: string;
59
+ baseUrl: string;
60
+ credentialReferenceId?: string | null;
61
+ headers?: Record<string, string> | null;
62
+ relationType: string;
63
+ };
64
+ type TeamAgentRelationConfig = {
65
+ relationId: string;
66
+ id: string;
67
+ name: string;
68
+ description: string;
69
+ baseUrl: string;
70
+ headers?: Record<string, string> | null;
71
+ };
72
+ type DelegateRelation = {
73
+ type: 'internal';
74
+ config: AgentConfig;
75
+ } | {
76
+ type: 'external';
77
+ config: ExternalAgentRelationConfig;
78
+ } | {
79
+ type: 'team';
80
+ config: TeamAgentRelationConfig;
81
+ };
82
+ type ToolType = 'transfer' | 'delegation' | 'mcp' | 'tool';
83
+ declare class Agent {
84
+ #private;
85
+ private config;
86
+ private systemPromptBuilder;
87
+ private credentialStuffer?;
88
+ private streamHelper?;
89
+ private streamRequestId?;
90
+ private conversationId?;
91
+ private delegationId?;
92
+ private artifactComponents;
93
+ private isDelegatedAgent;
94
+ private contextResolver?;
95
+ private credentialStoreRegistry?;
96
+ private mcpClientCache;
97
+ private mcpConnectionLocks;
98
+ private currentCompressor;
99
+ constructor(config: AgentConfig, credentialStoreRegistry?: CredentialStoreRegistry);
100
+ /**
101
+ * Get the maximum number of generation steps for this agent
102
+ * Uses agent's stopWhen.stepCountIs config or defaults to AGENT_EXECUTION_MAX_GENERATION_STEPS
103
+ */
104
+ private getMaxGenerationSteps;
105
+ /**
106
+ * Sanitizes tool names at runtime for AI SDK compatibility.
107
+ * The AI SDK requires tool names to match pattern ^[a-zA-Z0-9_-]{1,128}$
108
+ */
109
+ private sanitizeToolsForAISDK;
110
+ /**
111
+ * Get the primary model settings for text generation and thinking
112
+ * Requires model to be configured at project level
113
+ */
114
+ private getPrimaryModel;
115
+ /**
116
+ * Get the model settings for structured output generation
117
+ * Falls back to base model if structured output not configured
118
+ */
119
+ private getStructuredOutputModel;
120
+ /**
121
+ * Get the model settings for summarization/distillation
122
+ * Falls back to base model if summarizer not configured
123
+ */
124
+ private getSummarizerModel;
125
+ setConversationId(conversationId: string): void;
126
+ /**
127
+ * Simple compression fallback: drop oldest messages to fit under token limit
128
+ */
129
+ /**
130
+ * Set delegation status for this agent instance
131
+ */
132
+ setDelegationStatus(isDelegated: boolean): void;
133
+ /**
134
+ * Set delegation ID for this agent instance
135
+ */
136
+ setDelegationId(delegationId: string | undefined): void;
137
+ /**
138
+ * Get streaming helper if this agent should stream to user
139
+ * Returns undefined for delegated agents to prevent streaming data operations to user
140
+ */
141
+ getStreamingHelper(): StreamHelper | undefined;
142
+ /**
143
+ * Wraps a tool with streaming lifecycle tracking (start, complete, error) and AgentSession recording
144
+ */
145
+ private wrapToolWithStreaming;
146
+ getRelationTools(runtimeContext?: {
147
+ contextId: string;
148
+ metadata: {
149
+ conversationId: string;
150
+ threadId: string;
151
+ streamRequestId?: string;
152
+ streamBaseUrl?: string;
153
+ apiKey?: string;
154
+ baseUrl?: string;
155
+ };
156
+ }, sessionId?: string): any;
157
+ getMcpTools(sessionId?: string, streamRequestId?: string): Promise<ToolSet>;
158
+ /**
159
+ * Convert database McpTool to builder MCPToolConfig format
160
+ */
161
+ private convertToMCPToolConfig;
162
+ getMcpTool(tool: McpTool): Promise<{
163
+ tools: Record<string, any>;
164
+ toolPolicies: Record<string, {
165
+ needsApproval?: boolean;
166
+ }>;
167
+ mcpServerId: string;
168
+ mcpServerName: string;
169
+ }>;
170
+ private createMcpConnection;
171
+ getFunctionTools(sessionId?: string, streamRequestId?: string): Promise<ToolSet>;
172
+ /**
173
+ * Get resolved context using ContextResolver - will return cached data or fetch fresh data as needed
174
+ */
175
+ getResolvedContext(conversationId: string, headers?: Record<string, unknown>): Promise<Record<string, unknown> | null>;
176
+ /**
177
+ * Get the agent prompt for this agent's agent
178
+ */
179
+ private getPrompt;
180
+ /**
181
+ * Check if any agent in the agent has artifact components configured
182
+ */
183
+ private hasAgentArtifactComponents;
184
+ /**
185
+ * Build adaptive system prompt for Phase 2 structured output generation
186
+ * based on configured data components and artifact components across the agent
187
+ */
188
+ private buildPhase2SystemPrompt;
189
+ private buildSystemPrompt;
190
+ private getArtifactTools;
191
+ private createThinkingCompleteTool;
192
+ private getDefaultTools;
193
+ private getStreamRequestId;
194
+ /**
195
+ * Format tool result for storage in conversation history
196
+ */
197
+ private formatToolResult;
198
+ /**
199
+ * Get the conversation ID for storing tool results
200
+ * Always uses the real conversation ID - delegation filtering happens at query time
201
+ */
202
+ private getToolResultConversationId;
203
+ /**
204
+ * Analyze tool result structure and add helpful path hints for artifact creation
205
+ * Only adds hints when artifact components are available
206
+ */
207
+ private enhanceToolResultWithStructureHints;
208
+ private agentHasArtifactComponents;
209
+ generate(userMessage: string, runtimeContext?: {
210
+ contextId: string;
211
+ metadata: {
212
+ conversationId: string;
213
+ threadId: string;
214
+ taskId: string;
215
+ streamRequestId: string;
216
+ apiKey?: string;
217
+ };
218
+ }): Promise<any>;
219
+ /**
220
+ * Setup generation context and initialize streaming helper
221
+ */
222
+ private setupGenerationContext;
223
+ /**
224
+ * Load all tools and system prompts in parallel, then combine and sanitize them
225
+ */
226
+ private loadToolsAndPrompts;
227
+ /**
228
+ * Build conversation history based on configuration mode and filters
229
+ */
230
+ private buildConversationHistory;
231
+ /**
232
+ * Configure model settings, timeouts, and streaming behavior
233
+ */
234
+ private configureModelSettings;
235
+ /**
236
+ * Build initial messages array with system prompt and user content
237
+ */
238
+ private buildInitialMessages;
239
+ /**
240
+ * Setup compression for the current generation
241
+ */
242
+ private setupCompression;
243
+ /**
244
+ * Prepare step function for streaming with compression logic
245
+ */
246
+ private handlePrepareStepCompression;
247
+ private handleStopWhenConditions;
248
+ private setupStreamParser;
249
+ private buildTelemetryConfig;
250
+ private buildBaseGenerationConfig;
251
+ private buildReasoningFlow;
252
+ private buildDataComponentsSchema;
253
+ private calculatePhase2Timeout;
254
+ private buildPhase2Messages;
255
+ private executeStreamingPhase2;
256
+ private executeNonStreamingPhase2;
257
+ private formatFinalResponse;
258
+ private handleGenerationError;
259
+ /**
260
+ * Public cleanup method for external lifecycle management (e.g., session cleanup)
261
+ * Performs full cleanup of compression state when agent/session is ending
262
+ */
263
+ cleanupCompression(): void;
264
+ private processStreamEvents;
265
+ private formatStreamingResponse;
266
+ }
267
+ //#endregion
268
+ export { Agent, AgentConfig, DelegateRelation, ExternalAgentRelationConfig, TeamAgentRelationConfig, ToolType, hasToolCallWithPrefix };