@inkeep/agents-run-api 0.0.0-dev-20251014185355 → 0.0.0-dev-20251014185934

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/index.cjs CHANGED
@@ -1133,7 +1133,6 @@ async function a2aHandler(c, agent) {
1133
1133
  });
1134
1134
  }
1135
1135
  switch (rpcRequest.method) {
1136
- // Google A2A Protocol Methods
1137
1136
  case "message/send":
1138
1137
  return await handleMessageSend(c, agent, rpcRequest);
1139
1138
  case "message/stream":
@@ -1144,7 +1143,6 @@ async function a2aHandler(c, agent) {
1144
1143
  return await handleTasksCancel(c, agent, rpcRequest);
1145
1144
  case "tasks/resubscribe":
1146
1145
  return await handleTasksResubscribe(c, agent, rpcRequest);
1147
- // Legacy/simplified methods
1148
1146
  case "agent.invoke":
1149
1147
  return await handleAgentInvoke(c, agent, rpcRequest);
1150
1148
  case "agent.getCapabilities":
@@ -1192,7 +1190,6 @@ async function handleMessageSend(c, agent, request) {
1192
1190
  metadata: {
1193
1191
  blocking: params.configuration?.blocking ?? false,
1194
1192
  custom: { agent_id: agentId || "" },
1195
- // Pass through streaming metadata from the original message
1196
1193
  ...params.message.metadata
1197
1194
  }
1198
1195
  }
@@ -1380,7 +1377,6 @@ async function handleMessageSend(c, agent, request) {
1380
1377
  const taskStatus = {
1381
1378
  state: result.status.state,
1382
1379
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
1383
- // Don't include message field since it expects Message object, not string
1384
1380
  };
1385
1381
  if (params.configuration?.blocking === false) {
1386
1382
  const taskResponse = {
@@ -3029,13 +3025,10 @@ var _ArtifactParser = class _ArtifactParser {
3029
3025
  return await this.artifactService.getArtifactSummary(artifactId, toolCallId, artifactMap);
3030
3026
  }
3031
3027
  };
3032
- // Shared regex patterns - support both single and double quotes
3033
3028
  __publicField(_ArtifactParser, "ARTIFACT_REGEX", /<artifact:ref\s+id=(['"])([^'"]*?)\1\s+tool=(['"])([^'"]*?)\3\s*\/>/gs);
3034
3029
  __publicField(_ArtifactParser, "ARTIFACT_CHECK_REGEX", /<artifact:ref\s+(?=.*id=['"][^'"]+['"])(?=.*tool=['"][^'"]+['"])[^>]*\/>/);
3035
- // Artifact creation patterns
3036
3030
  __publicField(_ArtifactParser, "ARTIFACT_CREATE_REGEX", /<artifact:create\s+([^>]+?)(?:\s*\/)?>(?:(.*?)<\/artifact:create>)?/gs);
3037
3031
  __publicField(_ArtifactParser, "ATTR_REGEX", /(\w+)="([^"]*)"|(\w+)='([^']*)'|(\w+)=({[^}]+})/g);
3038
- // Simple patterns for detecting incomplete artifacts at end of text
3039
3032
  __publicField(_ArtifactParser, "ARTIFACT_PATTERNS", [
3040
3033
  "<a",
3041
3034
  "<ar",
@@ -3682,7 +3675,6 @@ ${previousSummaries.map((s, i) => `${i + 1}. ${s}`).join("\n")}
3682
3675
  ` : "";
3683
3676
  const selectionSchema = z6.z.object(
3684
3677
  Object.fromEntries([
3685
- // Add no_relevant_updates schema
3686
3678
  [
3687
3679
  "no_relevant_updates",
3688
3680
  z6.z.object({
@@ -3691,7 +3683,6 @@ ${previousSummaries.map((s, i) => `${i + 1}. ${s}`).join("\n")}
3691
3683
  "Use when nothing substantially new to report. Should only use on its own."
3692
3684
  )
3693
3685
  ],
3694
- // Add all other component schemas
3695
3686
  ...statusComponents.map((component) => [
3696
3687
  component.type,
3697
3688
  this.getComponentSchema(component).optional().describe(component.description || component.type)
@@ -3921,7 +3912,6 @@ ${this.statusUpdateState?.config.prompt?.trim() || ""}`;
3921
3912
  );
3922
3913
  break;
3923
3914
  }
3924
- // INTERNAL OPERATIONS - DO NOT EXPOSE TO STATUS UPDATES
3925
3915
  case "transfer":
3926
3916
  case "delegation_sent":
3927
3917
  case "delegation_returned":
@@ -4872,7 +4862,6 @@ var _IncrementalStreamParser = class _IncrementalStreamParser {
4872
4862
  }
4873
4863
  }
4874
4864
  };
4875
- // Memory management constants
4876
4865
  __publicField(_IncrementalStreamParser, "MAX_SNAPSHOT_SIZE", 100);
4877
4866
  // Max number of snapshots to keep
4878
4867
  __publicField(_IncrementalStreamParser, "MAX_STREAMED_SIZE", 1e3);
@@ -5838,7 +5827,6 @@ var A2AClient = class {
5838
5827
  const endpoint = await this._getServiceEndpoint();
5839
5828
  const clientRequestId = this.requestIdCounter++;
5840
5829
  const rpcRequest = {
5841
- // This is the initial JSON-RPC request to establish the stream
5842
5830
  jsonrpc: "2.0",
5843
5831
  method: "message/stream",
5844
5832
  params,
@@ -5941,7 +5929,6 @@ var A2AClient = class {
5941
5929
  const endpoint = await this._getServiceEndpoint();
5942
5930
  const clientRequestId = this.requestIdCounter++;
5943
5931
  const rpcRequest = {
5944
- // Initial JSON-RPC request to establish the stream
5945
5932
  jsonrpc: "2.0",
5946
5933
  method: "tasks/resubscribe",
5947
5934
  params,
@@ -7437,11 +7424,8 @@ var logger18 = agentsCore.getLogger("Agent");
7437
7424
  var CONSTANTS = {
7438
7425
  MAX_GENERATION_STEPS: 12,
7439
7426
  PHASE_1_TIMEOUT_MS: 27e4,
7440
- // 4.5 minutes for streaming phase 1
7441
7427
  NON_STREAMING_PHASE_1_TIMEOUT_MS: 9e4,
7442
- // 1.5 minutes for non-streaming phase 1
7443
7428
  PHASE_2_TIMEOUT_MS: 9e4
7444
- // 1.5 minutes for phase 2 structured output
7445
7429
  };
7446
7430
  function validateModel(modelString, modelType) {
7447
7431
  if (!modelString?.trim()) {
@@ -7496,7 +7480,6 @@ var Agent = class {
7496
7480
  this.config = {
7497
7481
  ...config,
7498
7482
  dataComponents: processedDataComponents,
7499
- // Set default conversation history if not provided
7500
7483
  conversationHistoryConfig: config.conversationHistoryConfig || createDefaultConversationHistoryConfig()
7501
7484
  };
7502
7485
  this.credentialStoreRegistry = credentialStoreRegistry;
@@ -9956,7 +9939,6 @@ var SSEStreamHelper = class {
9956
9939
  this.stream = stream2;
9957
9940
  this.requestId = requestId2;
9958
9941
  this.timestamp = timestamp;
9959
- // Stream queuing for proper event ordering
9960
9942
  __publicField(this, "isTextStreaming", false);
9961
9943
  __publicField(this, "queuedEvents", []);
9962
9944
  }
@@ -10136,14 +10118,11 @@ var _VercelDataStreamHelper = class _VercelDataStreamHelper {
10136
10118
  __publicField(this, "sessionId");
10137
10119
  // 5MB limit (more generous during request)
10138
10120
  __publicField(this, "isCompleted", false);
10139
- // Stream queuing for proper event ordering
10140
10121
  __publicField(this, "isTextStreaming", false);
10141
10122
  __publicField(this, "queuedEvents", []);
10142
- // Timing tracking for text sequences (text-end to text-start gap)
10143
10123
  __publicField(this, "lastTextEndTimestamp", 0);
10144
10124
  __publicField(this, "TEXT_GAP_THRESHOLD", 2e3);
10145
10125
  // milliseconds - if gap between text sequences is less than this, queue operations
10146
- // Connection management and forced cleanup
10147
10126
  __publicField(this, "connectionDropTimer");
10148
10127
  __publicField(this, "MAX_LIFETIME_MS", 6e5);
10149
10128
  this.connectionDropTimer = setTimeout(() => {
@@ -10153,7 +10132,6 @@ var _VercelDataStreamHelper = class _VercelDataStreamHelper {
10153
10132
  setSessionId(sessionId) {
10154
10133
  this.sessionId = sessionId;
10155
10134
  }
10156
- // This mirrors SSEStreamHelper API but outputs using Vercel AI SDK writer
10157
10135
  async writeRole(_ = "assistant") {
10158
10136
  }
10159
10137
  async writeContent(content) {
@@ -10451,7 +10429,6 @@ var _VercelDataStreamHelper = class _VercelDataStreamHelper {
10451
10429
  this.cleanup();
10452
10430
  }
10453
10431
  };
10454
- // Memory management - focused on connection completion cleanup
10455
10432
  __publicField(_VercelDataStreamHelper, "MAX_BUFFER_SIZE", 5 * 1024 * 1024);
10456
10433
  var VercelDataStreamHelper = _VercelDataStreamHelper;
10457
10434
  function createVercelStreamHelper(writer) {
@@ -10523,7 +10500,6 @@ function createMCPStreamHelper() {
10523
10500
  var logger22 = agentsCore.getLogger("ExecutionHandler");
10524
10501
  var ExecutionHandler = class {
10525
10502
  constructor() {
10526
- // Hardcoded error limit - separate from configurable stopWhen
10527
10503
  __publicField(this, "MAX_ERRORS", 3);
10528
10504
  }
10529
10505
  /**
@@ -11912,9 +11888,7 @@ var handleExistingSessionRequest = async (body, executionContext, validatedConte
11912
11888
  await agentsCore.updateConversation(dbClient_default)({
11913
11889
  scopes: { tenantId, projectId },
11914
11890
  conversationId: sessionId,
11915
- data: {
11916
- // Just updating the timestamp by calling update
11917
- }
11891
+ data: {}
11918
11892
  });
11919
11893
  const transport = new streamableHttp_js.StreamableHTTPServerTransport({
11920
11894
  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,
@@ -6492,11 +6479,8 @@ var logger16 = getLogger("Agent");
6492
6479
  var CONSTANTS = {
6493
6480
  MAX_GENERATION_STEPS: 12,
6494
6481
  PHASE_1_TIMEOUT_MS: 27e4,
6495
- // 4.5 minutes for streaming phase 1
6496
6482
  NON_STREAMING_PHASE_1_TIMEOUT_MS: 9e4,
6497
- // 1.5 minutes for non-streaming phase 1
6498
6483
  PHASE_2_TIMEOUT_MS: 9e4
6499
- // 1.5 minutes for phase 2 structured output
6500
6484
  };
6501
6485
  function validateModel(modelString, modelType) {
6502
6486
  if (!modelString?.trim()) {
@@ -6551,7 +6535,6 @@ var Agent = class {
6551
6535
  this.config = {
6552
6536
  ...config,
6553
6537
  dataComponents: processedDataComponents,
6554
- // Set default conversation history if not provided
6555
6538
  conversationHistoryConfig: config.conversationHistoryConfig || createDefaultConversationHistoryConfig()
6556
6539
  };
6557
6540
  this.credentialStoreRegistry = credentialStoreRegistry;
@@ -8997,7 +8980,6 @@ var SSEStreamHelper = class {
8997
8980
  this.stream = stream2;
8998
8981
  this.requestId = requestId2;
8999
8982
  this.timestamp = timestamp;
9000
- // Stream queuing for proper event ordering
9001
8983
  __publicField(this, "isTextStreaming", false);
9002
8984
  __publicField(this, "queuedEvents", []);
9003
8985
  }
@@ -9177,14 +9159,11 @@ var _VercelDataStreamHelper = class _VercelDataStreamHelper {
9177
9159
  __publicField(this, "sessionId");
9178
9160
  // 5MB limit (more generous during request)
9179
9161
  __publicField(this, "isCompleted", false);
9180
- // Stream queuing for proper event ordering
9181
9162
  __publicField(this, "isTextStreaming", false);
9182
9163
  __publicField(this, "queuedEvents", []);
9183
- // Timing tracking for text sequences (text-end to text-start gap)
9184
9164
  __publicField(this, "lastTextEndTimestamp", 0);
9185
9165
  __publicField(this, "TEXT_GAP_THRESHOLD", 2e3);
9186
9166
  // milliseconds - if gap between text sequences is less than this, queue operations
9187
- // Connection management and forced cleanup
9188
9167
  __publicField(this, "connectionDropTimer");
9189
9168
  __publicField(this, "MAX_LIFETIME_MS", 6e5);
9190
9169
  this.connectionDropTimer = setTimeout(() => {
@@ -9194,7 +9173,6 @@ var _VercelDataStreamHelper = class _VercelDataStreamHelper {
9194
9173
  setSessionId(sessionId) {
9195
9174
  this.sessionId = sessionId;
9196
9175
  }
9197
- // This mirrors SSEStreamHelper API but outputs using Vercel AI SDK writer
9198
9176
  async writeRole(_ = "assistant") {
9199
9177
  }
9200
9178
  async writeContent(content) {
@@ -9492,7 +9470,6 @@ var _VercelDataStreamHelper = class _VercelDataStreamHelper {
9492
9470
  this.cleanup();
9493
9471
  }
9494
9472
  };
9495
- // Memory management - focused on connection completion cleanup
9496
9473
  __publicField(_VercelDataStreamHelper, "MAX_BUFFER_SIZE", 5 * 1024 * 1024);
9497
9474
  var VercelDataStreamHelper = _VercelDataStreamHelper;
9498
9475
  function createVercelStreamHelper(writer) {
@@ -9564,7 +9541,6 @@ function createMCPStreamHelper() {
9564
9541
  var logger20 = getLogger("ExecutionHandler");
9565
9542
  var ExecutionHandler = class {
9566
9543
  constructor() {
9567
- // Hardcoded error limit - separate from configurable stopWhen
9568
9544
  __publicField(this, "MAX_ERRORS", 3);
9569
9545
  }
9570
9546
  /**
@@ -10944,9 +10920,7 @@ var handleExistingSessionRequest = async (body, executionContext, validatedConte
10944
10920
  await updateConversation(dbClient_default)({
10945
10921
  scopes: { tenantId, projectId },
10946
10922
  conversationId: sessionId,
10947
- data: {
10948
- // Just updating the timestamp by calling update
10949
- }
10923
+ data: {}
10950
10924
  });
10951
10925
  const transport = new StreamableHTTPServerTransport({
10952
10926
  sessionIdGenerator: () => sessionId
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-run-api",
3
- "version": "0.0.0-dev-20251014185355",
3
+ "version": "0.0.0-dev-20251014185934",
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.0.0-dev-20251014185355"
54
+ "@inkeep/agents-core": "^0.0.0-dev-20251014185934"
55
55
  },
56
56
  "optionalDependencies": {
57
57
  "keytar": "^7.9.0"