@inkeep/agents-run-api 0.21.0 → 1.0.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.
|
@@ -77,9 +77,6 @@ var _LocalSandboxExecutor = class _LocalSandboxExecutor {
|
|
|
77
77
|
}
|
|
78
78
|
return _LocalSandboxExecutor.instance;
|
|
79
79
|
}
|
|
80
|
-
/**
|
|
81
|
-
* Get or create a semaphore for the specified vCPU limit
|
|
82
|
-
*/
|
|
83
80
|
getSemaphore(vcpus) {
|
|
84
81
|
const effectiveVcpus = Math.max(1, vcpus || 1);
|
|
85
82
|
if (!this.executionSemaphores.has(effectiveVcpus)) {
|
|
@@ -92,9 +89,6 @@ var _LocalSandboxExecutor = class _LocalSandboxExecutor {
|
|
|
92
89
|
}
|
|
93
90
|
return semaphore;
|
|
94
91
|
}
|
|
95
|
-
/**
|
|
96
|
-
* Get execution statistics for monitoring and debugging
|
|
97
|
-
*/
|
|
98
92
|
getExecutionStats() {
|
|
99
93
|
const stats = {};
|
|
100
94
|
for (const [vcpus, semaphore] of this.executionSemaphores.entries()) {
|
|
@@ -305,17 +299,11 @@ var _LocalSandboxExecutor = class _LocalSandboxExecutor {
|
|
|
305
299
|
return new Promise((resolve, reject) => {
|
|
306
300
|
const npmEnv = {
|
|
307
301
|
...process.env,
|
|
308
|
-
// Set npm cache directory to sandbox to avoid /home/user issues
|
|
309
302
|
npm_config_cache: join(sandboxDir, ".npm-cache"),
|
|
310
|
-
// Set npm logs directory to sandbox
|
|
311
303
|
npm_config_logs_dir: join(sandboxDir, ".npm-logs"),
|
|
312
|
-
// Set npm temp directory to sandbox
|
|
313
304
|
npm_config_tmp: join(sandboxDir, ".npm-tmp"),
|
|
314
|
-
// Override HOME directory as fallback for npm
|
|
315
305
|
HOME: sandboxDir,
|
|
316
|
-
// Disable npm update notifier to avoid permission issues
|
|
317
306
|
npm_config_update_notifier: "false",
|
|
318
|
-
// Use non-interactive mode
|
|
319
307
|
npm_config_progress: "false",
|
|
320
308
|
npm_config_loglevel: "error"
|
|
321
309
|
};
|
|
@@ -351,7 +339,6 @@ var _LocalSandboxExecutor = class _LocalSandboxExecutor {
|
|
|
351
339
|
const spawnOptions = {
|
|
352
340
|
cwd: sandboxDir,
|
|
353
341
|
stdio: "pipe",
|
|
354
|
-
// Security: drop privileges and limit resources
|
|
355
342
|
uid: process.getuid ? process.getuid() : void 0,
|
|
356
343
|
gid: process.getgid ? process.getgid() : void 0
|
|
357
344
|
};
|
|
@@ -427,7 +414,7 @@ const args = ${JSON.stringify(args)};
|
|
|
427
414
|
|
|
428
415
|
try {
|
|
429
416
|
const result = execute(args);
|
|
430
|
-
|
|
417
|
+
|
|
431
418
|
// Handle both sync and async functions
|
|
432
419
|
if (result && typeof result.then === 'function') {
|
|
433
420
|
// Async function - result is a Promise
|
package/dist/index.cjs
CHANGED
|
@@ -465,9 +465,6 @@ var init_LocalSandboxExecutor = __esm({
|
|
|
465
465
|
}
|
|
466
466
|
return _LocalSandboxExecutor.instance;
|
|
467
467
|
}
|
|
468
|
-
/**
|
|
469
|
-
* Get or create a semaphore for the specified vCPU limit
|
|
470
|
-
*/
|
|
471
468
|
getSemaphore(vcpus) {
|
|
472
469
|
const effectiveVcpus = Math.max(1, vcpus || 1);
|
|
473
470
|
if (!this.executionSemaphores.has(effectiveVcpus)) {
|
|
@@ -480,9 +477,6 @@ var init_LocalSandboxExecutor = __esm({
|
|
|
480
477
|
}
|
|
481
478
|
return semaphore;
|
|
482
479
|
}
|
|
483
|
-
/**
|
|
484
|
-
* Get execution statistics for monitoring and debugging
|
|
485
|
-
*/
|
|
486
480
|
getExecutionStats() {
|
|
487
481
|
const stats = {};
|
|
488
482
|
for (const [vcpus, semaphore] of this.executionSemaphores.entries()) {
|
|
@@ -693,17 +687,11 @@ var init_LocalSandboxExecutor = __esm({
|
|
|
693
687
|
return new Promise((resolve, reject) => {
|
|
694
688
|
const npmEnv = {
|
|
695
689
|
...process.env,
|
|
696
|
-
// Set npm cache directory to sandbox to avoid /home/user issues
|
|
697
690
|
npm_config_cache: path.join(sandboxDir, ".npm-cache"),
|
|
698
|
-
// Set npm logs directory to sandbox
|
|
699
691
|
npm_config_logs_dir: path.join(sandboxDir, ".npm-logs"),
|
|
700
|
-
// Set npm temp directory to sandbox
|
|
701
692
|
npm_config_tmp: path.join(sandboxDir, ".npm-tmp"),
|
|
702
|
-
// Override HOME directory as fallback for npm
|
|
703
693
|
HOME: sandboxDir,
|
|
704
|
-
// Disable npm update notifier to avoid permission issues
|
|
705
694
|
npm_config_update_notifier: "false",
|
|
706
|
-
// Use non-interactive mode
|
|
707
695
|
npm_config_progress: "false",
|
|
708
696
|
npm_config_loglevel: "error"
|
|
709
697
|
};
|
|
@@ -739,7 +727,6 @@ var init_LocalSandboxExecutor = __esm({
|
|
|
739
727
|
const spawnOptions = {
|
|
740
728
|
cwd: sandboxDir,
|
|
741
729
|
stdio: "pipe",
|
|
742
|
-
// Security: drop privileges and limit resources
|
|
743
730
|
uid: process.getuid ? process.getuid() : void 0,
|
|
744
731
|
gid: process.getgid ? process.getgid() : void 0
|
|
745
732
|
};
|
|
@@ -815,7 +802,7 @@ const args = ${JSON.stringify(args)};
|
|
|
815
802
|
|
|
816
803
|
try {
|
|
817
804
|
const result = execute(args);
|
|
818
|
-
|
|
805
|
+
|
|
819
806
|
// Handle both sync and async functions
|
|
820
807
|
if (result && typeof result.then === 'function') {
|
|
821
808
|
// Async function - result is a Promise
|
|
@@ -1146,7 +1133,6 @@ async function a2aHandler(c, agent) {
|
|
|
1146
1133
|
});
|
|
1147
1134
|
}
|
|
1148
1135
|
switch (rpcRequest.method) {
|
|
1149
|
-
// Google A2A Protocol Methods
|
|
1150
1136
|
case "message/send":
|
|
1151
1137
|
return await handleMessageSend(c, agent, rpcRequest);
|
|
1152
1138
|
case "message/stream":
|
|
@@ -1157,7 +1143,6 @@ async function a2aHandler(c, agent) {
|
|
|
1157
1143
|
return await handleTasksCancel(c, agent, rpcRequest);
|
|
1158
1144
|
case "tasks/resubscribe":
|
|
1159
1145
|
return await handleTasksResubscribe(c, agent, rpcRequest);
|
|
1160
|
-
// Legacy/simplified methods
|
|
1161
1146
|
case "agent.invoke":
|
|
1162
1147
|
return await handleAgentInvoke(c, agent, rpcRequest);
|
|
1163
1148
|
case "agent.getCapabilities":
|
|
@@ -1205,7 +1190,6 @@ async function handleMessageSend(c, agent, request) {
|
|
|
1205
1190
|
metadata: {
|
|
1206
1191
|
blocking: params.configuration?.blocking ?? false,
|
|
1207
1192
|
custom: { agent_id: agentId || "" },
|
|
1208
|
-
// Pass through streaming metadata from the original message
|
|
1209
1193
|
...params.message.metadata
|
|
1210
1194
|
}
|
|
1211
1195
|
}
|
|
@@ -1393,7 +1377,6 @@ async function handleMessageSend(c, agent, request) {
|
|
|
1393
1377
|
const taskStatus = {
|
|
1394
1378
|
state: result.status.state,
|
|
1395
1379
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1396
|
-
// Don't include message field since it expects Message object, not string
|
|
1397
1380
|
};
|
|
1398
1381
|
if (params.configuration?.blocking === false) {
|
|
1399
1382
|
const taskResponse = {
|
|
@@ -3042,13 +3025,10 @@ var _ArtifactParser = class _ArtifactParser {
|
|
|
3042
3025
|
return await this.artifactService.getArtifactSummary(artifactId, toolCallId, artifactMap);
|
|
3043
3026
|
}
|
|
3044
3027
|
};
|
|
3045
|
-
// Shared regex patterns - support both single and double quotes
|
|
3046
3028
|
__publicField(_ArtifactParser, "ARTIFACT_REGEX", /<artifact:ref\s+id=(['"])([^'"]*?)\1\s+tool=(['"])([^'"]*?)\3\s*\/>/gs);
|
|
3047
3029
|
__publicField(_ArtifactParser, "ARTIFACT_CHECK_REGEX", /<artifact:ref\s+(?=.*id=['"][^'"]+['"])(?=.*tool=['"][^'"]+['"])[^>]*\/>/);
|
|
3048
|
-
// Artifact creation patterns
|
|
3049
3030
|
__publicField(_ArtifactParser, "ARTIFACT_CREATE_REGEX", /<artifact:create\s+([^>]+?)(?:\s*\/)?>(?:(.*?)<\/artifact:create>)?/gs);
|
|
3050
3031
|
__publicField(_ArtifactParser, "ATTR_REGEX", /(\w+)="([^"]*)"|(\w+)='([^']*)'|(\w+)=({[^}]+})/g);
|
|
3051
|
-
// Simple patterns for detecting incomplete artifacts at end of text
|
|
3052
3032
|
__publicField(_ArtifactParser, "ARTIFACT_PATTERNS", [
|
|
3053
3033
|
"<a",
|
|
3054
3034
|
"<ar",
|
|
@@ -3695,7 +3675,6 @@ ${previousSummaries.map((s, i) => `${i + 1}. ${s}`).join("\n")}
|
|
|
3695
3675
|
` : "";
|
|
3696
3676
|
const selectionSchema = z6.z.object(
|
|
3697
3677
|
Object.fromEntries([
|
|
3698
|
-
// Add no_relevant_updates schema
|
|
3699
3678
|
[
|
|
3700
3679
|
"no_relevant_updates",
|
|
3701
3680
|
z6.z.object({
|
|
@@ -3704,7 +3683,6 @@ ${previousSummaries.map((s, i) => `${i + 1}. ${s}`).join("\n")}
|
|
|
3704
3683
|
"Use when nothing substantially new to report. Should only use on its own."
|
|
3705
3684
|
)
|
|
3706
3685
|
],
|
|
3707
|
-
// Add all other component schemas
|
|
3708
3686
|
...statusComponents.map((component) => [
|
|
3709
3687
|
component.type,
|
|
3710
3688
|
this.getComponentSchema(component).optional().describe(component.description || component.type)
|
|
@@ -3934,7 +3912,6 @@ ${this.statusUpdateState?.config.prompt?.trim() || ""}`;
|
|
|
3934
3912
|
);
|
|
3935
3913
|
break;
|
|
3936
3914
|
}
|
|
3937
|
-
// INTERNAL OPERATIONS - DO NOT EXPOSE TO STATUS UPDATES
|
|
3938
3915
|
case "transfer":
|
|
3939
3916
|
case "delegation_sent":
|
|
3940
3917
|
case "delegation_returned":
|
|
@@ -4885,7 +4862,6 @@ var _IncrementalStreamParser = class _IncrementalStreamParser {
|
|
|
4885
4862
|
}
|
|
4886
4863
|
}
|
|
4887
4864
|
};
|
|
4888
|
-
// Memory management constants
|
|
4889
4865
|
__publicField(_IncrementalStreamParser, "MAX_SNAPSHOT_SIZE", 100);
|
|
4890
4866
|
// Max number of snapshots to keep
|
|
4891
4867
|
__publicField(_IncrementalStreamParser, "MAX_STREAMED_SIZE", 1e3);
|
|
@@ -5851,7 +5827,6 @@ var A2AClient = class {
|
|
|
5851
5827
|
const endpoint = await this._getServiceEndpoint();
|
|
5852
5828
|
const clientRequestId = this.requestIdCounter++;
|
|
5853
5829
|
const rpcRequest = {
|
|
5854
|
-
// This is the initial JSON-RPC request to establish the stream
|
|
5855
5830
|
jsonrpc: "2.0",
|
|
5856
5831
|
method: "message/stream",
|
|
5857
5832
|
params,
|
|
@@ -5954,7 +5929,6 @@ var A2AClient = class {
|
|
|
5954
5929
|
const endpoint = await this._getServiceEndpoint();
|
|
5955
5930
|
const clientRequestId = this.requestIdCounter++;
|
|
5956
5931
|
const rpcRequest = {
|
|
5957
|
-
// Initial JSON-RPC request to establish the stream
|
|
5958
5932
|
jsonrpc: "2.0",
|
|
5959
5933
|
method: "tasks/resubscribe",
|
|
5960
5934
|
params,
|
|
@@ -6994,7 +6968,6 @@ ${creationInstructions}
|
|
|
6994
6968
|
toolXml = toolXml.replace("{{TOOL_PARAMETERS_SCHEMA}}", parametersXml);
|
|
6995
6969
|
return toolXml;
|
|
6996
6970
|
}
|
|
6997
|
-
// Data component methods removed - handled by Phase2Config
|
|
6998
6971
|
generateParametersXml(inputSchema) {
|
|
6999
6972
|
if (!inputSchema) {
|
|
7000
6973
|
return "<type>object</type>\n <properties>\n </properties>\n <required>[]</required>";
|
|
@@ -7450,11 +7423,8 @@ var logger18 = agentsCore.getLogger("Agent");
|
|
|
7450
7423
|
var CONSTANTS = {
|
|
7451
7424
|
MAX_GENERATION_STEPS: 12,
|
|
7452
7425
|
PHASE_1_TIMEOUT_MS: 27e4,
|
|
7453
|
-
// 4.5 minutes for streaming phase 1
|
|
7454
7426
|
NON_STREAMING_PHASE_1_TIMEOUT_MS: 9e4,
|
|
7455
|
-
// 1.5 minutes for non-streaming phase 1
|
|
7456
7427
|
PHASE_2_TIMEOUT_MS: 9e4
|
|
7457
|
-
// 1.5 minutes for phase 2 structured output
|
|
7458
7428
|
};
|
|
7459
7429
|
function validateModel(modelString, modelType) {
|
|
7460
7430
|
if (!modelString?.trim()) {
|
|
@@ -7509,7 +7479,6 @@ var Agent = class {
|
|
|
7509
7479
|
this.config = {
|
|
7510
7480
|
...config,
|
|
7511
7481
|
dataComponents: processedDataComponents,
|
|
7512
|
-
// Set default conversation history if not provided
|
|
7513
7482
|
conversationHistoryConfig: config.conversationHistoryConfig || createDefaultConversationHistoryConfig()
|
|
7514
7483
|
};
|
|
7515
7484
|
this.credentialStoreRegistry = credentialStoreRegistry;
|
|
@@ -9324,7 +9293,6 @@ var createTaskHandler = (config, credentialStoreRegistry) => {
|
|
|
9324
9293
|
transferRelations: []
|
|
9325
9294
|
})),
|
|
9326
9295
|
delegateRelations: [
|
|
9327
|
-
// Internal delegate relations
|
|
9328
9296
|
...enhancedInternalRelations.filter((relation) => relation.relationType === "delegate").map((relation) => ({
|
|
9329
9297
|
type: "internal",
|
|
9330
9298
|
config: {
|
|
@@ -9342,7 +9310,6 @@ var createTaskHandler = (config, credentialStoreRegistry) => {
|
|
|
9342
9310
|
transferRelations: []
|
|
9343
9311
|
}
|
|
9344
9312
|
})),
|
|
9345
|
-
// External delegate relations
|
|
9346
9313
|
...externalRelations.map((relation) => ({
|
|
9347
9314
|
type: "external",
|
|
9348
9315
|
config: {
|
|
@@ -9969,7 +9936,6 @@ var SSEStreamHelper = class {
|
|
|
9969
9936
|
this.stream = stream2;
|
|
9970
9937
|
this.requestId = requestId2;
|
|
9971
9938
|
this.timestamp = timestamp;
|
|
9972
|
-
// Stream queuing for proper event ordering
|
|
9973
9939
|
__publicField(this, "isTextStreaming", false);
|
|
9974
9940
|
__publicField(this, "queuedEvents", []);
|
|
9975
9941
|
}
|
|
@@ -10149,14 +10115,11 @@ var _VercelDataStreamHelper = class _VercelDataStreamHelper {
|
|
|
10149
10115
|
__publicField(this, "sessionId");
|
|
10150
10116
|
// 5MB limit (more generous during request)
|
|
10151
10117
|
__publicField(this, "isCompleted", false);
|
|
10152
|
-
// Stream queuing for proper event ordering
|
|
10153
10118
|
__publicField(this, "isTextStreaming", false);
|
|
10154
10119
|
__publicField(this, "queuedEvents", []);
|
|
10155
|
-
// Timing tracking for text sequences (text-end to text-start gap)
|
|
10156
10120
|
__publicField(this, "lastTextEndTimestamp", 0);
|
|
10157
10121
|
__publicField(this, "TEXT_GAP_THRESHOLD", 2e3);
|
|
10158
10122
|
// milliseconds - if gap between text sequences is less than this, queue operations
|
|
10159
|
-
// Connection management and forced cleanup
|
|
10160
10123
|
__publicField(this, "connectionDropTimer");
|
|
10161
10124
|
__publicField(this, "MAX_LIFETIME_MS", 6e5);
|
|
10162
10125
|
this.connectionDropTimer = setTimeout(() => {
|
|
@@ -10166,7 +10129,6 @@ var _VercelDataStreamHelper = class _VercelDataStreamHelper {
|
|
|
10166
10129
|
setSessionId(sessionId) {
|
|
10167
10130
|
this.sessionId = sessionId;
|
|
10168
10131
|
}
|
|
10169
|
-
// This mirrors SSEStreamHelper API but outputs using Vercel AI SDK writer
|
|
10170
10132
|
async writeRole(_ = "assistant") {
|
|
10171
10133
|
}
|
|
10172
10134
|
async writeContent(content) {
|
|
@@ -10464,7 +10426,6 @@ var _VercelDataStreamHelper = class _VercelDataStreamHelper {
|
|
|
10464
10426
|
this.cleanup();
|
|
10465
10427
|
}
|
|
10466
10428
|
};
|
|
10467
|
-
// Memory management - focused on connection completion cleanup
|
|
10468
10429
|
__publicField(_VercelDataStreamHelper, "MAX_BUFFER_SIZE", 5 * 1024 * 1024);
|
|
10469
10430
|
var VercelDataStreamHelper = _VercelDataStreamHelper;
|
|
10470
10431
|
function createVercelStreamHelper(writer) {
|
|
@@ -10536,7 +10497,6 @@ function createMCPStreamHelper() {
|
|
|
10536
10497
|
var logger22 = agentsCore.getLogger("ExecutionHandler");
|
|
10537
10498
|
var ExecutionHandler = class {
|
|
10538
10499
|
constructor() {
|
|
10539
|
-
// Hardcoded error limit - separate from configurable stopWhen
|
|
10540
10500
|
__publicField(this, "MAX_ERRORS", 3);
|
|
10541
10501
|
}
|
|
10542
10502
|
/**
|
|
@@ -11925,9 +11885,7 @@ var handleExistingSessionRequest = async (body, executionContext, validatedConte
|
|
|
11925
11885
|
await agentsCore.updateConversation(dbClient_default)({
|
|
11926
11886
|
scopes: { tenantId, projectId },
|
|
11927
11887
|
conversationId: sessionId,
|
|
11928
|
-
data: {
|
|
11929
|
-
// Just updating the timestamp by calling update
|
|
11930
|
-
}
|
|
11888
|
+
data: {}
|
|
11931
11889
|
});
|
|
11932
11890
|
const transport = new streamableHttp_js.StreamableHTTPServerTransport({
|
|
11933
11891
|
sessionIdGenerator: () => sessionId
|
package/dist/index.js
CHANGED
|
@@ -234,7 +234,6 @@ async function a2aHandler(c, agent) {
|
|
|
234
234
|
});
|
|
235
235
|
}
|
|
236
236
|
switch (rpcRequest.method) {
|
|
237
|
-
// Google A2A Protocol Methods
|
|
238
237
|
case "message/send":
|
|
239
238
|
return await handleMessageSend(c, agent, rpcRequest);
|
|
240
239
|
case "message/stream":
|
|
@@ -245,7 +244,6 @@ async function a2aHandler(c, agent) {
|
|
|
245
244
|
return await handleTasksCancel(c, agent, rpcRequest);
|
|
246
245
|
case "tasks/resubscribe":
|
|
247
246
|
return await handleTasksResubscribe(c, agent, rpcRequest);
|
|
248
|
-
// Legacy/simplified methods
|
|
249
247
|
case "agent.invoke":
|
|
250
248
|
return await handleAgentInvoke(c, agent, rpcRequest);
|
|
251
249
|
case "agent.getCapabilities":
|
|
@@ -293,7 +291,6 @@ async function handleMessageSend(c, agent, request) {
|
|
|
293
291
|
metadata: {
|
|
294
292
|
blocking: params.configuration?.blocking ?? false,
|
|
295
293
|
custom: { agent_id: agentId || "" },
|
|
296
|
-
// Pass through streaming metadata from the original message
|
|
297
294
|
...params.message.metadata
|
|
298
295
|
}
|
|
299
296
|
}
|
|
@@ -481,7 +478,6 @@ async function handleMessageSend(c, agent, request) {
|
|
|
481
478
|
const taskStatus = {
|
|
482
479
|
state: result.status.state,
|
|
483
480
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
484
|
-
// Don't include message field since it expects Message object, not string
|
|
485
481
|
};
|
|
486
482
|
if (params.configuration?.blocking === false) {
|
|
487
483
|
const taskResponse = {
|
|
@@ -2109,13 +2105,10 @@ var _ArtifactParser = class _ArtifactParser {
|
|
|
2109
2105
|
return await this.artifactService.getArtifactSummary(artifactId, toolCallId, artifactMap);
|
|
2110
2106
|
}
|
|
2111
2107
|
};
|
|
2112
|
-
// Shared regex patterns - support both single and double quotes
|
|
2113
2108
|
__publicField(_ArtifactParser, "ARTIFACT_REGEX", /<artifact:ref\s+id=(['"])([^'"]*?)\1\s+tool=(['"])([^'"]*?)\3\s*\/>/gs);
|
|
2114
2109
|
__publicField(_ArtifactParser, "ARTIFACT_CHECK_REGEX", /<artifact:ref\s+(?=.*id=['"][^'"]+['"])(?=.*tool=['"][^'"]+['"])[^>]*\/>/);
|
|
2115
|
-
// Artifact creation patterns
|
|
2116
2110
|
__publicField(_ArtifactParser, "ARTIFACT_CREATE_REGEX", /<artifact:create\s+([^>]+?)(?:\s*\/)?>(?:(.*?)<\/artifact:create>)?/gs);
|
|
2117
2111
|
__publicField(_ArtifactParser, "ATTR_REGEX", /(\w+)="([^"]*)"|(\w+)='([^']*)'|(\w+)=({[^}]+})/g);
|
|
2118
|
-
// Simple patterns for detecting incomplete artifacts at end of text
|
|
2119
2112
|
__publicField(_ArtifactParser, "ARTIFACT_PATTERNS", [
|
|
2120
2113
|
"<a",
|
|
2121
2114
|
"<ar",
|
|
@@ -2762,7 +2755,6 @@ ${previousSummaries.map((s, i) => `${i + 1}. ${s}`).join("\n")}
|
|
|
2762
2755
|
` : "";
|
|
2763
2756
|
const selectionSchema = z.object(
|
|
2764
2757
|
Object.fromEntries([
|
|
2765
|
-
// Add no_relevant_updates schema
|
|
2766
2758
|
[
|
|
2767
2759
|
"no_relevant_updates",
|
|
2768
2760
|
z.object({
|
|
@@ -2771,7 +2763,6 @@ ${previousSummaries.map((s, i) => `${i + 1}. ${s}`).join("\n")}
|
|
|
2771
2763
|
"Use when nothing substantially new to report. Should only use on its own."
|
|
2772
2764
|
)
|
|
2773
2765
|
],
|
|
2774
|
-
// Add all other component schemas
|
|
2775
2766
|
...statusComponents.map((component) => [
|
|
2776
2767
|
component.type,
|
|
2777
2768
|
this.getComponentSchema(component).optional().describe(component.description || component.type)
|
|
@@ -3001,7 +2992,6 @@ ${this.statusUpdateState?.config.prompt?.trim() || ""}`;
|
|
|
3001
2992
|
);
|
|
3002
2993
|
break;
|
|
3003
2994
|
}
|
|
3004
|
-
// INTERNAL OPERATIONS - DO NOT EXPOSE TO STATUS UPDATES
|
|
3005
2995
|
case "transfer":
|
|
3006
2996
|
case "delegation_sent":
|
|
3007
2997
|
case "delegation_returned":
|
|
@@ -3943,7 +3933,6 @@ var _IncrementalStreamParser = class _IncrementalStreamParser {
|
|
|
3943
3933
|
}
|
|
3944
3934
|
}
|
|
3945
3935
|
};
|
|
3946
|
-
// Memory management constants
|
|
3947
3936
|
__publicField(_IncrementalStreamParser, "MAX_SNAPSHOT_SIZE", 100);
|
|
3948
3937
|
// Max number of snapshots to keep
|
|
3949
3938
|
__publicField(_IncrementalStreamParser, "MAX_STREAMED_SIZE", 1e3);
|
|
@@ -4898,7 +4887,6 @@ var A2AClient = class {
|
|
|
4898
4887
|
const endpoint = await this._getServiceEndpoint();
|
|
4899
4888
|
const clientRequestId = this.requestIdCounter++;
|
|
4900
4889
|
const rpcRequest = {
|
|
4901
|
-
// This is the initial JSON-RPC request to establish the stream
|
|
4902
4890
|
jsonrpc: "2.0",
|
|
4903
4891
|
method: "message/stream",
|
|
4904
4892
|
params,
|
|
@@ -5001,7 +4989,6 @@ var A2AClient = class {
|
|
|
5001
4989
|
const endpoint = await this._getServiceEndpoint();
|
|
5002
4990
|
const clientRequestId = this.requestIdCounter++;
|
|
5003
4991
|
const rpcRequest = {
|
|
5004
|
-
// Initial JSON-RPC request to establish the stream
|
|
5005
4992
|
jsonrpc: "2.0",
|
|
5006
4993
|
method: "tasks/resubscribe",
|
|
5007
4994
|
params,
|
|
@@ -6036,7 +6023,6 @@ ${creationInstructions}
|
|
|
6036
6023
|
toolXml = toolXml.replace("{{TOOL_PARAMETERS_SCHEMA}}", parametersXml);
|
|
6037
6024
|
return toolXml;
|
|
6038
6025
|
}
|
|
6039
|
-
// Data component methods removed - handled by Phase2Config
|
|
6040
6026
|
generateParametersXml(inputSchema) {
|
|
6041
6027
|
if (!inputSchema) {
|
|
6042
6028
|
return "<type>object</type>\n <properties>\n </properties>\n <required>[]</required>";
|
|
@@ -6492,11 +6478,8 @@ var logger16 = getLogger("Agent");
|
|
|
6492
6478
|
var CONSTANTS = {
|
|
6493
6479
|
MAX_GENERATION_STEPS: 12,
|
|
6494
6480
|
PHASE_1_TIMEOUT_MS: 27e4,
|
|
6495
|
-
// 4.5 minutes for streaming phase 1
|
|
6496
6481
|
NON_STREAMING_PHASE_1_TIMEOUT_MS: 9e4,
|
|
6497
|
-
// 1.5 minutes for non-streaming phase 1
|
|
6498
6482
|
PHASE_2_TIMEOUT_MS: 9e4
|
|
6499
|
-
// 1.5 minutes for phase 2 structured output
|
|
6500
6483
|
};
|
|
6501
6484
|
function validateModel(modelString, modelType) {
|
|
6502
6485
|
if (!modelString?.trim()) {
|
|
@@ -6551,7 +6534,6 @@ var Agent = class {
|
|
|
6551
6534
|
this.config = {
|
|
6552
6535
|
...config,
|
|
6553
6536
|
dataComponents: processedDataComponents,
|
|
6554
|
-
// Set default conversation history if not provided
|
|
6555
6537
|
conversationHistoryConfig: config.conversationHistoryConfig || createDefaultConversationHistoryConfig()
|
|
6556
6538
|
};
|
|
6557
6539
|
this.credentialStoreRegistry = credentialStoreRegistry;
|
|
@@ -7046,7 +7028,7 @@ var Agent = class {
|
|
|
7046
7028
|
if (functionToolsData.length === 0) {
|
|
7047
7029
|
return functionTools;
|
|
7048
7030
|
}
|
|
7049
|
-
const { LocalSandboxExecutor } = await import('./LocalSandboxExecutor-
|
|
7031
|
+
const { LocalSandboxExecutor } = await import('./LocalSandboxExecutor-TSOIXW7O.js');
|
|
7050
7032
|
const sandboxExecutor = LocalSandboxExecutor.getInstance();
|
|
7051
7033
|
for (const functionToolDef of functionToolsData) {
|
|
7052
7034
|
const functionId = functionToolDef.functionId;
|
|
@@ -8366,7 +8348,6 @@ var createTaskHandler = (config, credentialStoreRegistry) => {
|
|
|
8366
8348
|
transferRelations: []
|
|
8367
8349
|
})),
|
|
8368
8350
|
delegateRelations: [
|
|
8369
|
-
// Internal delegate relations
|
|
8370
8351
|
...enhancedInternalRelations.filter((relation) => relation.relationType === "delegate").map((relation) => ({
|
|
8371
8352
|
type: "internal",
|
|
8372
8353
|
config: {
|
|
@@ -8384,7 +8365,6 @@ var createTaskHandler = (config, credentialStoreRegistry) => {
|
|
|
8384
8365
|
transferRelations: []
|
|
8385
8366
|
}
|
|
8386
8367
|
})),
|
|
8387
|
-
// External delegate relations
|
|
8388
8368
|
...externalRelations.map((relation) => ({
|
|
8389
8369
|
type: "external",
|
|
8390
8370
|
config: {
|
|
@@ -8997,7 +8977,6 @@ var SSEStreamHelper = class {
|
|
|
8997
8977
|
this.stream = stream2;
|
|
8998
8978
|
this.requestId = requestId2;
|
|
8999
8979
|
this.timestamp = timestamp;
|
|
9000
|
-
// Stream queuing for proper event ordering
|
|
9001
8980
|
__publicField(this, "isTextStreaming", false);
|
|
9002
8981
|
__publicField(this, "queuedEvents", []);
|
|
9003
8982
|
}
|
|
@@ -9177,14 +9156,11 @@ var _VercelDataStreamHelper = class _VercelDataStreamHelper {
|
|
|
9177
9156
|
__publicField(this, "sessionId");
|
|
9178
9157
|
// 5MB limit (more generous during request)
|
|
9179
9158
|
__publicField(this, "isCompleted", false);
|
|
9180
|
-
// Stream queuing for proper event ordering
|
|
9181
9159
|
__publicField(this, "isTextStreaming", false);
|
|
9182
9160
|
__publicField(this, "queuedEvents", []);
|
|
9183
|
-
// Timing tracking for text sequences (text-end to text-start gap)
|
|
9184
9161
|
__publicField(this, "lastTextEndTimestamp", 0);
|
|
9185
9162
|
__publicField(this, "TEXT_GAP_THRESHOLD", 2e3);
|
|
9186
9163
|
// milliseconds - if gap between text sequences is less than this, queue operations
|
|
9187
|
-
// Connection management and forced cleanup
|
|
9188
9164
|
__publicField(this, "connectionDropTimer");
|
|
9189
9165
|
__publicField(this, "MAX_LIFETIME_MS", 6e5);
|
|
9190
9166
|
this.connectionDropTimer = setTimeout(() => {
|
|
@@ -9194,7 +9170,6 @@ var _VercelDataStreamHelper = class _VercelDataStreamHelper {
|
|
|
9194
9170
|
setSessionId(sessionId) {
|
|
9195
9171
|
this.sessionId = sessionId;
|
|
9196
9172
|
}
|
|
9197
|
-
// This mirrors SSEStreamHelper API but outputs using Vercel AI SDK writer
|
|
9198
9173
|
async writeRole(_ = "assistant") {
|
|
9199
9174
|
}
|
|
9200
9175
|
async writeContent(content) {
|
|
@@ -9492,7 +9467,6 @@ var _VercelDataStreamHelper = class _VercelDataStreamHelper {
|
|
|
9492
9467
|
this.cleanup();
|
|
9493
9468
|
}
|
|
9494
9469
|
};
|
|
9495
|
-
// Memory management - focused on connection completion cleanup
|
|
9496
9470
|
__publicField(_VercelDataStreamHelper, "MAX_BUFFER_SIZE", 5 * 1024 * 1024);
|
|
9497
9471
|
var VercelDataStreamHelper = _VercelDataStreamHelper;
|
|
9498
9472
|
function createVercelStreamHelper(writer) {
|
|
@@ -9564,7 +9538,6 @@ function createMCPStreamHelper() {
|
|
|
9564
9538
|
var logger20 = getLogger("ExecutionHandler");
|
|
9565
9539
|
var ExecutionHandler = class {
|
|
9566
9540
|
constructor() {
|
|
9567
|
-
// Hardcoded error limit - separate from configurable stopWhen
|
|
9568
9541
|
__publicField(this, "MAX_ERRORS", 3);
|
|
9569
9542
|
}
|
|
9570
9543
|
/**
|
|
@@ -10944,9 +10917,7 @@ var handleExistingSessionRequest = async (body, executionContext, validatedConte
|
|
|
10944
10917
|
await updateConversation(dbClient_default)({
|
|
10945
10918
|
scopes: { tenantId, projectId },
|
|
10946
10919
|
conversationId: sessionId,
|
|
10947
|
-
data: {
|
|
10948
|
-
// Just updating the timestamp by calling update
|
|
10949
|
-
}
|
|
10920
|
+
data: {}
|
|
10950
10921
|
});
|
|
10951
10922
|
const transport = new StreamableHTTPServerTransport({
|
|
10952
10923
|
sessionIdGenerator: () => sessionId
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/agents-run-api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Agents Run API for Inkeep Agent Framework - handles chat, agent execution, and streaming",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"traverse": "^0.6.11",
|
|
52
52
|
"ts-pattern": "^5.7.1",
|
|
53
53
|
"zod": "^4.1.11",
|
|
54
|
-
"@inkeep/agents-core": "^0.
|
|
54
|
+
"@inkeep/agents-core": "^1.0.0"
|
|
55
55
|
},
|
|
56
56
|
"optionalDependencies": {
|
|
57
57
|
"keytar": "^7.9.0"
|