@inkeep/agents-run-api 0.39.5 → 0.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_raw_/home/runner/work/agents/agents/agents-run-api/templates/v1/phase1/system-prompt.js +5 -0
- package/dist/_virtual/_raw_/home/runner/work/agents/agents/agents-run-api/templates/v1/phase1/thinking-preparation.js +5 -0
- package/dist/_virtual/_raw_/home/runner/work/agents/agents/agents-run-api/templates/v1/phase1/tool.js +5 -0
- package/dist/_virtual/_raw_/home/runner/work/agents/agents/agents-run-api/templates/v1/phase2/data-component.js +5 -0
- package/dist/_virtual/_raw_/home/runner/work/agents/agents/agents-run-api/templates/v1/phase2/data-components.js +5 -0
- package/dist/_virtual/_raw_/home/runner/work/agents/agents/agents-run-api/templates/v1/phase2/system-prompt.js +5 -0
- package/dist/_virtual/_raw_/home/runner/work/agents/agents/agents-run-api/templates/v1/shared/artifact-retrieval-guidance.js +5 -0
- package/dist/_virtual/_raw_/home/runner/work/agents/agents/agents-run-api/templates/v1/shared/artifact.js +5 -0
- package/dist/a2a/client.d.ts +184 -0
- package/dist/a2a/client.js +510 -0
- package/dist/a2a/handlers.d.ts +7 -0
- package/dist/a2a/handlers.js +560 -0
- package/dist/a2a/transfer.d.ts +22 -0
- package/dist/a2a/transfer.js +46 -0
- package/dist/a2a/types.d.ts +79 -0
- package/dist/a2a/types.js +22 -0
- package/dist/agents/Agent.d.ts +266 -0
- package/dist/agents/Agent.js +1927 -0
- package/dist/agents/ModelFactory.d.ts +63 -0
- package/dist/agents/ModelFactory.js +194 -0
- package/dist/agents/SystemPromptBuilder.d.ts +21 -0
- package/dist/agents/SystemPromptBuilder.js +48 -0
- package/dist/agents/ToolSessionManager.d.ts +63 -0
- package/dist/agents/ToolSessionManager.js +146 -0
- package/dist/agents/generateTaskHandler.d.ts +49 -0
- package/dist/agents/generateTaskHandler.js +521 -0
- package/dist/agents/relationTools.d.ts +57 -0
- package/dist/agents/relationTools.js +262 -0
- package/dist/agents/types.d.ts +28 -0
- package/dist/agents/types.js +1 -0
- package/dist/agents/versions/v1/Phase1Config.d.ts +27 -0
- package/dist/agents/versions/v1/Phase1Config.js +424 -0
- package/dist/agents/versions/v1/Phase2Config.d.ts +31 -0
- package/dist/agents/versions/v1/Phase2Config.js +330 -0
- package/dist/constants/execution-limits/defaults.d.ts +51 -0
- package/dist/constants/execution-limits/defaults.js +52 -0
- package/dist/constants/execution-limits/index.d.ts +6 -0
- package/dist/constants/execution-limits/index.js +21 -0
- package/dist/create-app.d.ts +9 -0
- package/dist/create-app.js +195 -0
- package/dist/data/agent.d.ts +7 -0
- package/dist/data/agent.js +72 -0
- package/dist/data/agents.d.ts +34 -0
- package/dist/data/agents.js +139 -0
- package/dist/data/conversations.d.ts +128 -0
- package/dist/data/conversations.js +522 -0
- package/dist/data/db/dbClient.d.ts +6 -0
- package/dist/data/db/dbClient.js +17 -0
- package/dist/env.d.ts +57 -0
- package/dist/env.js +1 -2
- package/dist/handlers/executionHandler.d.ts +39 -0
- package/dist/handlers/executionHandler.js +456 -0
- package/dist/index.d.ts +8 -29
- package/dist/index.js +5 -11386
- package/dist/instrumentation.d.ts +1 -2
- package/dist/instrumentation.js +66 -3
- package/dist/{logger2.js → logger.d.ts} +1 -2
- package/dist/logger.js +1 -1
- package/dist/middleware/api-key-auth.d.ts +26 -0
- package/dist/middleware/api-key-auth.js +240 -0
- package/dist/middleware/index.d.ts +2 -0
- package/dist/middleware/index.js +3 -0
- package/dist/openapi.d.ts +4 -0
- package/dist/openapi.js +54 -0
- package/dist/routes/agents.d.ts +12 -0
- package/dist/routes/agents.js +147 -0
- package/dist/routes/chat.d.ts +13 -0
- package/dist/routes/chat.js +293 -0
- package/dist/routes/chatDataStream.d.ts +13 -0
- package/dist/routes/chatDataStream.js +352 -0
- package/dist/routes/mcp.d.ts +13 -0
- package/dist/routes/mcp.js +495 -0
- package/dist/services/AgentSession.d.ts +356 -0
- package/dist/services/AgentSession.js +1208 -0
- package/dist/services/ArtifactParser.d.ts +105 -0
- package/dist/services/ArtifactParser.js +338 -0
- package/dist/services/ArtifactService.d.ts +123 -0
- package/dist/services/ArtifactService.js +612 -0
- package/dist/services/BaseCompressor.d.ts +183 -0
- package/dist/services/BaseCompressor.js +504 -0
- package/dist/services/ConversationCompressor.d.ts +32 -0
- package/dist/services/ConversationCompressor.js +91 -0
- package/dist/services/IncrementalStreamParser.d.ts +98 -0
- package/dist/services/IncrementalStreamParser.js +327 -0
- package/dist/services/MidGenerationCompressor.d.ts +63 -0
- package/dist/services/MidGenerationCompressor.js +104 -0
- package/dist/services/PendingToolApprovalManager.d.ts +62 -0
- package/dist/services/PendingToolApprovalManager.js +133 -0
- package/dist/services/ResponseFormatter.d.ts +39 -0
- package/dist/services/ResponseFormatter.js +152 -0
- package/dist/tools/NativeSandboxExecutor.d.ts +38 -0
- package/dist/tools/NativeSandboxExecutor.js +432 -0
- package/dist/tools/SandboxExecutorFactory.d.ts +36 -0
- package/dist/tools/SandboxExecutorFactory.js +80 -0
- package/dist/tools/VercelSandboxExecutor.d.ts +71 -0
- package/dist/tools/VercelSandboxExecutor.js +340 -0
- package/dist/tools/distill-conversation-history-tool.d.ts +62 -0
- package/dist/tools/distill-conversation-history-tool.js +206 -0
- package/dist/tools/distill-conversation-tool.d.ts +41 -0
- package/dist/tools/distill-conversation-tool.js +141 -0
- package/dist/tools/sandbox-utils.d.ts +18 -0
- package/dist/tools/sandbox-utils.js +53 -0
- package/dist/types/chat.d.ts +27 -0
- package/dist/types/chat.js +1 -0
- package/dist/types/execution-context.d.ts +46 -0
- package/dist/types/execution-context.js +27 -0
- package/dist/types/xml.d.ts +5 -0
- package/dist/utils/SchemaProcessor.d.ts +52 -0
- package/dist/utils/SchemaProcessor.js +182 -0
- package/dist/utils/agent-operations.d.ts +62 -0
- package/dist/utils/agent-operations.js +53 -0
- package/dist/utils/artifact-component-schema.d.ts +42 -0
- package/dist/utils/artifact-component-schema.js +186 -0
- package/dist/utils/cleanup.d.ts +21 -0
- package/dist/utils/cleanup.js +59 -0
- package/dist/utils/data-component-schema.d.ts +2 -0
- package/dist/utils/data-component-schema.js +3 -0
- package/dist/utils/default-status-schemas.d.ts +20 -0
- package/dist/utils/default-status-schemas.js +24 -0
- package/dist/utils/json-postprocessor.d.ts +13 -0
- package/dist/{json-postprocessor.cjs → utils/json-postprocessor.js} +1 -2
- package/dist/utils/model-context-utils.d.ts +39 -0
- package/dist/utils/model-context-utils.js +181 -0
- package/dist/utils/model-resolver.d.ts +6 -0
- package/dist/utils/model-resolver.js +34 -0
- package/dist/utils/schema-validation.d.ts +44 -0
- package/dist/utils/schema-validation.js +97 -0
- package/dist/utils/stream-helpers.d.ts +197 -0
- package/dist/utils/stream-helpers.js +518 -0
- package/dist/utils/stream-registry.d.ts +22 -0
- package/dist/utils/stream-registry.js +34 -0
- package/dist/utils/token-estimator.d.ts +69 -0
- package/dist/utils/token-estimator.js +53 -0
- package/dist/utils/tracer.d.ts +7 -0
- package/dist/utils/tracer.js +7 -0
- package/package.json +4 -20
- package/dist/SandboxExecutorFactory.cjs +0 -895
- package/dist/SandboxExecutorFactory.js +0 -893
- package/dist/SandboxExecutorFactory.js.map +0 -1
- package/dist/chunk-VBDAOXYI.cjs +0 -927
- package/dist/chunk-VBDAOXYI.js +0 -832
- package/dist/chunk-VBDAOXYI.js.map +0 -1
- package/dist/chunk.cjs +0 -34
- package/dist/conversations.cjs +0 -7
- package/dist/conversations.js +0 -7
- package/dist/conversations2.cjs +0 -209
- package/dist/conversations2.js +0 -180
- package/dist/conversations2.js.map +0 -1
- package/dist/dbClient.cjs +0 -9676
- package/dist/dbClient.js +0 -9670
- package/dist/dbClient.js.map +0 -1
- package/dist/dbClient2.cjs +0 -5
- package/dist/dbClient2.js +0 -5
- package/dist/env.cjs +0 -59
- package/dist/env.js.map +0 -1
- package/dist/execution-limits.cjs +0 -260
- package/dist/execution-limits.js +0 -63
- package/dist/execution-limits.js.map +0 -1
- package/dist/index.cjs +0 -11411
- package/dist/index.d.cts +0 -36
- package/dist/index.d.cts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/instrumentation.cjs +0 -12
- package/dist/instrumentation.d.cts +0 -18
- package/dist/instrumentation.d.cts.map +0 -1
- package/dist/instrumentation.d.ts.map +0 -1
- package/dist/instrumentation2.cjs +0 -116
- package/dist/instrumentation2.js +0 -69
- package/dist/instrumentation2.js.map +0 -1
- package/dist/json-postprocessor.js +0 -20
- package/dist/json-postprocessor.js.map +0 -1
- package/dist/logger.cjs +0 -5
- package/dist/logger2.cjs +0 -1
- package/dist/nodefs.cjs +0 -29
- package/dist/nodefs.js +0 -27
- package/dist/nodefs.js.map +0 -1
- package/dist/opfs-ahp.cjs +0 -367
- package/dist/opfs-ahp.js +0 -368
- package/dist/opfs-ahp.js.map +0 -1
|
@@ -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,266 @@
|
|
|
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
|
+
};
|
|
52
|
+
type ExternalAgentRelationConfig = {
|
|
53
|
+
relationId: string;
|
|
54
|
+
id: string;
|
|
55
|
+
name: string;
|
|
56
|
+
description: string;
|
|
57
|
+
baseUrl: string;
|
|
58
|
+
credentialReferenceId?: string | null;
|
|
59
|
+
headers?: Record<string, string> | null;
|
|
60
|
+
relationType: string;
|
|
61
|
+
};
|
|
62
|
+
type TeamAgentRelationConfig = {
|
|
63
|
+
relationId: string;
|
|
64
|
+
id: string;
|
|
65
|
+
name: string;
|
|
66
|
+
description: string;
|
|
67
|
+
baseUrl: string;
|
|
68
|
+
headers?: Record<string, string> | null;
|
|
69
|
+
};
|
|
70
|
+
type DelegateRelation = {
|
|
71
|
+
type: 'internal';
|
|
72
|
+
config: AgentConfig;
|
|
73
|
+
} | {
|
|
74
|
+
type: 'external';
|
|
75
|
+
config: ExternalAgentRelationConfig;
|
|
76
|
+
} | {
|
|
77
|
+
type: 'team';
|
|
78
|
+
config: TeamAgentRelationConfig;
|
|
79
|
+
};
|
|
80
|
+
type ToolType = 'transfer' | 'delegation' | 'mcp' | 'tool';
|
|
81
|
+
declare class Agent {
|
|
82
|
+
#private;
|
|
83
|
+
private config;
|
|
84
|
+
private systemPromptBuilder;
|
|
85
|
+
private credentialStuffer?;
|
|
86
|
+
private streamHelper?;
|
|
87
|
+
private streamRequestId?;
|
|
88
|
+
private conversationId?;
|
|
89
|
+
private delegationId?;
|
|
90
|
+
private artifactComponents;
|
|
91
|
+
private isDelegatedAgent;
|
|
92
|
+
private contextResolver?;
|
|
93
|
+
private credentialStoreRegistry?;
|
|
94
|
+
private mcpClientCache;
|
|
95
|
+
private mcpConnectionLocks;
|
|
96
|
+
private currentCompressor;
|
|
97
|
+
constructor(config: AgentConfig, credentialStoreRegistry?: CredentialStoreRegistry);
|
|
98
|
+
/**
|
|
99
|
+
* Get the maximum number of generation steps for this agent
|
|
100
|
+
* Uses agent's stopWhen.stepCountIs config or defaults to AGENT_EXECUTION_MAX_GENERATION_STEPS
|
|
101
|
+
*/
|
|
102
|
+
private getMaxGenerationSteps;
|
|
103
|
+
/**
|
|
104
|
+
* Sanitizes tool names at runtime for AI SDK compatibility.
|
|
105
|
+
* The AI SDK requires tool names to match pattern ^[a-zA-Z0-9_-]{1,128}$
|
|
106
|
+
*/
|
|
107
|
+
private sanitizeToolsForAISDK;
|
|
108
|
+
/**
|
|
109
|
+
* Get the primary model settings for text generation and thinking
|
|
110
|
+
* Requires model to be configured at project level
|
|
111
|
+
*/
|
|
112
|
+
private getPrimaryModel;
|
|
113
|
+
/**
|
|
114
|
+
* Get the model settings for structured output generation
|
|
115
|
+
* Falls back to base model if structured output not configured
|
|
116
|
+
*/
|
|
117
|
+
private getStructuredOutputModel;
|
|
118
|
+
/**
|
|
119
|
+
* Get the model settings for summarization/distillation
|
|
120
|
+
* Falls back to base model if summarizer not configured
|
|
121
|
+
*/
|
|
122
|
+
private getSummarizerModel;
|
|
123
|
+
setConversationId(conversationId: string): void;
|
|
124
|
+
/**
|
|
125
|
+
* Simple compression fallback: drop oldest messages to fit under token limit
|
|
126
|
+
*/
|
|
127
|
+
/**
|
|
128
|
+
* Set delegation status for this agent instance
|
|
129
|
+
*/
|
|
130
|
+
setDelegationStatus(isDelegated: boolean): void;
|
|
131
|
+
/**
|
|
132
|
+
* Set delegation ID for this agent instance
|
|
133
|
+
*/
|
|
134
|
+
setDelegationId(delegationId: string | undefined): void;
|
|
135
|
+
/**
|
|
136
|
+
* Get streaming helper if this agent should stream to user
|
|
137
|
+
* Returns undefined for delegated agents to prevent streaming data operations to user
|
|
138
|
+
*/
|
|
139
|
+
getStreamingHelper(): StreamHelper | undefined;
|
|
140
|
+
/**
|
|
141
|
+
* Wraps a tool with streaming lifecycle tracking (start, complete, error) and AgentSession recording
|
|
142
|
+
*/
|
|
143
|
+
private wrapToolWithStreaming;
|
|
144
|
+
getRelationTools(runtimeContext?: {
|
|
145
|
+
contextId: string;
|
|
146
|
+
metadata: {
|
|
147
|
+
conversationId: string;
|
|
148
|
+
threadId: string;
|
|
149
|
+
streamRequestId?: string;
|
|
150
|
+
streamBaseUrl?: string;
|
|
151
|
+
apiKey?: string;
|
|
152
|
+
baseUrl?: string;
|
|
153
|
+
};
|
|
154
|
+
}, sessionId?: string): any;
|
|
155
|
+
getMcpTools(sessionId?: string, streamRequestId?: string): Promise<ToolSet>;
|
|
156
|
+
/**
|
|
157
|
+
* Convert database McpTool to builder MCPToolConfig format
|
|
158
|
+
*/
|
|
159
|
+
private convertToMCPToolConfig;
|
|
160
|
+
getMcpTool(tool: McpTool): Promise<{
|
|
161
|
+
tools: Record<string, any>;
|
|
162
|
+
toolPolicies: Record<string, {
|
|
163
|
+
needsApproval?: boolean;
|
|
164
|
+
}>;
|
|
165
|
+
mcpServerId: string;
|
|
166
|
+
mcpServerName: string;
|
|
167
|
+
}>;
|
|
168
|
+
private createMcpConnection;
|
|
169
|
+
getFunctionTools(sessionId?: string, streamRequestId?: string): Promise<ToolSet>;
|
|
170
|
+
/**
|
|
171
|
+
* Get resolved context using ContextResolver - will return cached data or fetch fresh data as needed
|
|
172
|
+
*/
|
|
173
|
+
getResolvedContext(conversationId: string, headers?: Record<string, unknown>): Promise<Record<string, unknown> | null>;
|
|
174
|
+
/**
|
|
175
|
+
* Get the agent prompt for this agent's agent
|
|
176
|
+
*/
|
|
177
|
+
private getPrompt;
|
|
178
|
+
/**
|
|
179
|
+
* Check if any agent in the agent has artifact components configured
|
|
180
|
+
*/
|
|
181
|
+
private hasAgentArtifactComponents;
|
|
182
|
+
/**
|
|
183
|
+
* Build adaptive system prompt for Phase 2 structured output generation
|
|
184
|
+
* based on configured data components and artifact components across the agent
|
|
185
|
+
*/
|
|
186
|
+
private buildPhase2SystemPrompt;
|
|
187
|
+
private buildSystemPrompt;
|
|
188
|
+
private getArtifactTools;
|
|
189
|
+
private createThinkingCompleteTool;
|
|
190
|
+
private getDefaultTools;
|
|
191
|
+
private getStreamRequestId;
|
|
192
|
+
/**
|
|
193
|
+
* Format tool result for storage in conversation history
|
|
194
|
+
*/
|
|
195
|
+
private formatToolResult;
|
|
196
|
+
/**
|
|
197
|
+
* Get the conversation ID for storing tool results
|
|
198
|
+
* Always uses the real conversation ID - delegation filtering happens at query time
|
|
199
|
+
*/
|
|
200
|
+
private getToolResultConversationId;
|
|
201
|
+
/**
|
|
202
|
+
* Analyze tool result structure and add helpful path hints for artifact creation
|
|
203
|
+
* Only adds hints when artifact components are available
|
|
204
|
+
*/
|
|
205
|
+
private enhanceToolResultWithStructureHints;
|
|
206
|
+
private agentHasArtifactComponents;
|
|
207
|
+
generate(userMessage: string, runtimeContext?: {
|
|
208
|
+
contextId: string;
|
|
209
|
+
metadata: {
|
|
210
|
+
conversationId: string;
|
|
211
|
+
threadId: string;
|
|
212
|
+
taskId: string;
|
|
213
|
+
streamRequestId: string;
|
|
214
|
+
apiKey?: string;
|
|
215
|
+
};
|
|
216
|
+
}): Promise<any>;
|
|
217
|
+
/**
|
|
218
|
+
* Setup generation context and initialize streaming helper
|
|
219
|
+
*/
|
|
220
|
+
private setupGenerationContext;
|
|
221
|
+
/**
|
|
222
|
+
* Load all tools and system prompts in parallel, then combine and sanitize them
|
|
223
|
+
*/
|
|
224
|
+
private loadToolsAndPrompts;
|
|
225
|
+
/**
|
|
226
|
+
* Build conversation history based on configuration mode and filters
|
|
227
|
+
*/
|
|
228
|
+
private buildConversationHistory;
|
|
229
|
+
/**
|
|
230
|
+
* Configure model settings, timeouts, and streaming behavior
|
|
231
|
+
*/
|
|
232
|
+
private configureModelSettings;
|
|
233
|
+
/**
|
|
234
|
+
* Build initial messages array with system prompt and user content
|
|
235
|
+
*/
|
|
236
|
+
private buildInitialMessages;
|
|
237
|
+
/**
|
|
238
|
+
* Setup compression for the current generation
|
|
239
|
+
*/
|
|
240
|
+
private setupCompression;
|
|
241
|
+
/**
|
|
242
|
+
* Prepare step function for streaming with compression logic
|
|
243
|
+
*/
|
|
244
|
+
private handlePrepareStepCompression;
|
|
245
|
+
private handleStopWhenConditions;
|
|
246
|
+
private setupStreamParser;
|
|
247
|
+
private buildTelemetryConfig;
|
|
248
|
+
private buildBaseGenerationConfig;
|
|
249
|
+
private buildReasoningFlow;
|
|
250
|
+
private buildDataComponentsSchema;
|
|
251
|
+
private calculatePhase2Timeout;
|
|
252
|
+
private buildPhase2Messages;
|
|
253
|
+
private executeStreamingPhase2;
|
|
254
|
+
private executeNonStreamingPhase2;
|
|
255
|
+
private formatFinalResponse;
|
|
256
|
+
private handleGenerationError;
|
|
257
|
+
/**
|
|
258
|
+
* Public cleanup method for external lifecycle management (e.g., session cleanup)
|
|
259
|
+
* Performs full cleanup of compression state when agent/session is ending
|
|
260
|
+
*/
|
|
261
|
+
cleanupCompression(): void;
|
|
262
|
+
private processStreamEvents;
|
|
263
|
+
private formatStreamingResponse;
|
|
264
|
+
}
|
|
265
|
+
//#endregion
|
|
266
|
+
export { Agent, AgentConfig, DelegateRelation, ExternalAgentRelationConfig, TeamAgentRelationConfig, ToolType, hasToolCallWithPrefix };
|