@inkeep/agents-run-api 0.14.1 → 0.14.2

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.
@@ -10,7 +10,9 @@ import { ATTR_SERVICE_NAME } from '@opentelemetry/semantic-conventions';
10
10
 
11
11
  // src/instrumentation.ts
12
12
  var otlpExporter = new OTLPTraceExporter();
13
- var defaultBatchProcessor = new BatchSpanProcessor(otlpExporter);
13
+ var defaultBatchProcessor = new BatchSpanProcessor(otlpExporter, {
14
+ scheduledDelayMillis: 1e3
15
+ });
14
16
  var defaultResource = resourceFromAttributes({
15
17
  [ATTR_SERVICE_NAME]: "inkeep-agents-run-api"
16
18
  });
package/dist/index.cjs CHANGED
@@ -396,7 +396,9 @@ var init_json_postprocessor = __esm({
396
396
  // src/index.ts
397
397
  init_env();
398
398
  var otlpExporter = new exporterTraceOtlpHttp.OTLPTraceExporter();
399
- var defaultBatchProcessor = new sdkTraceBase.BatchSpanProcessor(otlpExporter);
399
+ var defaultBatchProcessor = new sdkTraceBase.BatchSpanProcessor(otlpExporter, {
400
+ scheduledDelayMillis: 1e3
401
+ });
400
402
  var defaultResource = resources.resourceFromAttributes({
401
403
  [semanticConventions.ATTR_SERVICE_NAME]: "inkeep-agents-run-api"
402
404
  });
@@ -3161,6 +3163,7 @@ ${this.statusUpdateState?.config.prompt?.trim() || ""}`;
3161
3163
  return { summaries: [] };
3162
3164
  } finally {
3163
3165
  span.end();
3166
+ await defaultBatchProcessor.forceFlush();
3164
3167
  }
3165
3168
  }
3166
3169
  );
@@ -3579,6 +3582,7 @@ Make it specific and relevant.`;
3579
3582
  );
3580
3583
  } finally {
3581
3584
  span.end();
3585
+ await defaultBatchProcessor.forceFlush();
3582
3586
  }
3583
3587
  }
3584
3588
  );
@@ -4136,6 +4140,7 @@ var ResponseFormatter = class {
4136
4140
  };
4137
4141
  } finally {
4138
4142
  span.end();
4143
+ await defaultBatchProcessor.forceFlush();
4139
4144
  }
4140
4145
  });
4141
4146
  }
@@ -4186,6 +4191,7 @@ var ResponseFormatter = class {
4186
4191
  return { text: responseText };
4187
4192
  } finally {
4188
4193
  span.end();
4194
+ await defaultBatchProcessor.forceFlush();
4189
4195
  }
4190
4196
  });
4191
4197
  }
@@ -7072,6 +7078,7 @@ var Agent = class {
7072
7078
  requestContext: requestContext || {},
7073
7079
  tenantId: this.config.tenantId
7074
7080
  });
7081
+ await defaultBatchProcessor.forceFlush();
7075
7082
  const contextWithBuiltins = {
7076
7083
  ...result.resolvedContext,
7077
7084
  $now: (/* @__PURE__ */ new Date()).toISOString(),
@@ -7610,6 +7617,7 @@ var Agent = class {
7610
7617
  throw err;
7611
7618
  } finally {
7612
7619
  childSpan.end();
7620
+ await defaultBatchProcessor.forceFlush();
7613
7621
  }
7614
7622
  }
7615
7623
  );
@@ -8040,6 +8048,7 @@ ${output}${structureHintsFormatted}`;
8040
8048
  }
8041
8049
  span.setStatus({ code: api.SpanStatusCode.OK });
8042
8050
  span.end();
8051
+ await defaultBatchProcessor.forceFlush();
8043
8052
  let formattedContent = response.formattedContent || null;
8044
8053
  if (!formattedContent) {
8045
8054
  const session = toolSessionManager.getSession(sessionId);
@@ -9605,6 +9614,7 @@ var ExecutionHandler = class {
9605
9614
  throw error;
9606
9615
  } finally {
9607
9616
  span.end();
9617
+ await defaultBatchProcessor.forceFlush();
9608
9618
  }
9609
9619
  });
9610
9620
  }
@@ -10131,6 +10141,7 @@ app3.openapi(chatDataStreamRoute, async (c) => {
10131
10141
  dbClient: dbClient_default,
10132
10142
  credentialStores
10133
10143
  });
10144
+ await defaultBatchProcessor.forceFlush();
10134
10145
  const lastUserMessage = body.messages.filter((m) => m.role === "user").slice(-1)[0];
10135
10146
  const userText = typeof lastUserMessage?.content === "string" ? lastUserMessage.content : lastUserMessage?.parts?.map((p) => p.text).join("") || "";
10136
10147
  logger22.info({ userText, lastUserMessage }, "userText");
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { defaultBatchProcessor } from './chunk-5RGAMXUL.js';
1
+ import { defaultBatchProcessor } from './chunk-Z76LOSTO.js';
2
2
  import { getLogger } from './chunk-A2S7GSHL.js';
3
3
  import { getFormattedConversationHistory, createDefaultConversationHistoryConfig, saveA2AMessageResponse } from './chunk-F46V23RK.js';
4
4
  import { dbClient_default, env } from './chunk-TWVQBIUL.js';
@@ -2709,6 +2709,7 @@ ${this.statusUpdateState?.config.prompt?.trim() || ""}`;
2709
2709
  return { summaries: [] };
2710
2710
  } finally {
2711
2711
  span.end();
2712
+ await defaultBatchProcessor.forceFlush();
2712
2713
  }
2713
2714
  }
2714
2715
  );
@@ -3127,6 +3128,7 @@ Make it specific and relevant.`;
3127
3128
  );
3128
3129
  } finally {
3129
3130
  span.end();
3131
+ await defaultBatchProcessor.forceFlush();
3130
3132
  }
3131
3133
  }
3132
3134
  );
@@ -3682,6 +3684,7 @@ var ResponseFormatter = class {
3682
3684
  };
3683
3685
  } finally {
3684
3686
  span.end();
3687
+ await defaultBatchProcessor.forceFlush();
3685
3688
  }
3686
3689
  });
3687
3690
  }
@@ -3732,6 +3735,7 @@ var ResponseFormatter = class {
3732
3735
  return { text: responseText };
3733
3736
  } finally {
3734
3737
  span.end();
3738
+ await defaultBatchProcessor.forceFlush();
3735
3739
  }
3736
3740
  });
3737
3741
  }
@@ -6603,6 +6607,7 @@ var Agent = class {
6603
6607
  requestContext: requestContext || {},
6604
6608
  tenantId: this.config.tenantId
6605
6609
  });
6610
+ await defaultBatchProcessor.forceFlush();
6606
6611
  const contextWithBuiltins = {
6607
6612
  ...result.resolvedContext,
6608
6613
  $now: (/* @__PURE__ */ new Date()).toISOString(),
@@ -7141,6 +7146,7 @@ var Agent = class {
7141
7146
  throw err;
7142
7147
  } finally {
7143
7148
  childSpan.end();
7149
+ await defaultBatchProcessor.forceFlush();
7144
7150
  }
7145
7151
  }
7146
7152
  );
@@ -7571,6 +7577,7 @@ ${output}${structureHintsFormatted}`;
7571
7577
  }
7572
7578
  span.setStatus({ code: SpanStatusCode.OK });
7573
7579
  span.end();
7580
+ await defaultBatchProcessor.forceFlush();
7574
7581
  let formattedContent = response.formattedContent || null;
7575
7582
  if (!formattedContent) {
7576
7583
  const session = toolSessionManager.getSession(sessionId);
@@ -9122,6 +9129,7 @@ var ExecutionHandler = class {
9122
9129
  throw error;
9123
9130
  } finally {
9124
9131
  span.end();
9132
+ await defaultBatchProcessor.forceFlush();
9125
9133
  }
9126
9134
  });
9127
9135
  }
@@ -9643,6 +9651,7 @@ app3.openapi(chatDataStreamRoute, async (c) => {
9643
9651
  dbClient: dbClient_default,
9644
9652
  credentialStores
9645
9653
  });
9654
+ await defaultBatchProcessor.forceFlush();
9646
9655
  const lastUserMessage = body.messages.filter((m) => m.role === "user").slice(-1)[0];
9647
9656
  const userText = typeof lastUserMessage?.content === "string" ? lastUserMessage.content : lastUserMessage?.parts?.map((p) => p.text).join("") || "";
9648
9657
  logger22.info({ userText, lastUserMessage }, "userText");
@@ -12,7 +12,9 @@ var semanticConventions = require('@opentelemetry/semantic-conventions');
12
12
 
13
13
  // src/instrumentation.ts
14
14
  var otlpExporter = new exporterTraceOtlpHttp.OTLPTraceExporter();
15
- var defaultBatchProcessor = new sdkTraceBase.BatchSpanProcessor(otlpExporter);
15
+ var defaultBatchProcessor = new sdkTraceBase.BatchSpanProcessor(otlpExporter, {
16
+ scheduledDelayMillis: 1e3
17
+ });
16
18
  var defaultResource = resources.resourceFromAttributes({
17
19
  [semanticConventions.ATTR_SERVICE_NAME]: "inkeep-agents-run-api"
18
20
  });
@@ -1 +1 @@
1
- export { defaultBatchProcessor, defaultContextManager, defaultInstrumentations, defaultResource, defaultSDK, defaultSpanProcessors, defaultTextMapPropagator } from './chunk-5RGAMXUL.js';
1
+ export { defaultBatchProcessor, defaultContextManager, defaultInstrumentations, defaultResource, defaultSDK, defaultSpanProcessors, defaultTextMapPropagator } from './chunk-Z76LOSTO.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-run-api",
3
- "version": "0.14.1",
3
+ "version": "0.14.2",
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.14.1"
54
+ "@inkeep/agents-core": "^0.14.2"
55
55
  },
56
56
  "optionalDependencies": {
57
57
  "keytar": "^7.9.0"