@inkeep/agents-run-api 0.32.2 → 0.33.1

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.
@@ -1,4 +1,4 @@
1
- import { env } from './chunk-N2FZD53W.js';
1
+ import { env } from './chunk-UZXC6MEO.js';
2
2
  import { createDatabaseClient } from '@inkeep/agents-core';
3
3
 
4
4
  var getDbConfig = () => {
@@ -1,4 +1,4 @@
1
- import { dbClient_default } from './chunk-BYF2SHLS.js';
1
+ import { dbClient_default } from './chunk-4HDXSU6S.js';
2
2
  import { CONVERSATION_HISTORY_DEFAULT_LIMIT } from './chunk-IVALDC72.js';
3
3
  import { CONVERSATION_HISTORY_MAX_OUTPUT_TOKENS_DEFAULT, createMessage, generateId, getConversationHistory } from '@inkeep/agents-core';
4
4
 
@@ -191,7 +191,7 @@ async function getConversationScopedArtifacts(params) {
191
191
  return [];
192
192
  }
193
193
  const { getLedgerArtifacts } = await import('@inkeep/agents-core');
194
- const dbClient = (await import('./dbClient-XRZSZEYI.js')).default;
194
+ const dbClient = (await import('./dbClient-6HPZ2V7Y.js')).default;
195
195
  const visibleTaskIds = visibleMessages.map((msg) => msg.taskId).filter((taskId) => Boolean(taskId));
196
196
  const referenceArtifacts = [];
197
197
  for (const taskId of visibleTaskIds) {
@@ -1,4 +1,4 @@
1
- import { env } from './chunk-N2FZD53W.js';
1
+ import { env } from './chunk-UZXC6MEO.js';
2
2
  import { getLogger } from './chunk-A2S7GSHL.js';
3
3
  import { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentations-node';
4
4
  import { BaggageSpanProcessor, ALLOW_ALL_BAGGAGE_KEYS } from '@opentelemetry/baggage-span-processor';
@@ -7,7 +7,7 @@ var envSchema = z.object({
7
7
  NODE_ENV: z.enum(["development", "production", "test"]).optional(),
8
8
  ENVIRONMENT: z.enum(["development", "production", "pentest", "test"]).optional().default("development"),
9
9
  DATABASE_URL: z.string().optional(),
10
- AGENTS_RUN_API_URL: z.string().optional().default("http://localhost:3003"),
10
+ INKEEP_AGENTS_RUN_API_URL: z.string().optional().default("http://localhost:3003"),
11
11
  LOG_LEVEL: z.enum(["trace", "debug", "info", "warn", "error"]).optional().default("debug"),
12
12
  NANGO_SERVER_URL: z.string().optional().default("https://api.nango.dev"),
13
13
  NANGO_SECRET_KEY: z.string().optional(),
@@ -21,8 +21,7 @@ var envSchema = z.object({
21
21
  });
22
22
  var parseEnv = () => {
23
23
  try {
24
- const parsedEnv = envSchema.parse(process.env);
25
- return parsedEnv;
24
+ return envSchema.parse(process.env);
26
25
  } catch (error) {
27
26
  if (error instanceof z.ZodError) {
28
27
  const missingVars = error.issues.map((issue) => issue.path.join("."));
@@ -1 +1 @@
1
- export { createDefaultConversationHistoryConfig, getConversationScopedArtifacts, getFormattedConversationHistory, getFullConversationContext, getScopedHistory, getUserFacingHistory, saveA2AMessageResponse } from './chunk-54Z7AOV4.js';
1
+ export { createDefaultConversationHistoryConfig, getConversationScopedArtifacts, getFormattedConversationHistory, getFullConversationContext, getScopedHistory, getUserFacingHistory, saveA2AMessageResponse } from './chunk-BEMQODJT.js';
@@ -0,0 +1 @@
1
+ export { dbClient_default as default } from './chunk-4HDXSU6S.js';
package/dist/index.cjs CHANGED
@@ -71,7 +71,7 @@ var init_env = __esm({
71
71
  NODE_ENV: z7.z.enum(["development", "production", "test"]).optional(),
72
72
  ENVIRONMENT: z7.z.enum(["development", "production", "pentest", "test"]).optional().default("development"),
73
73
  DATABASE_URL: z7.z.string().optional(),
74
- AGENTS_RUN_API_URL: z7.z.string().optional().default("http://localhost:3003"),
74
+ INKEEP_AGENTS_RUN_API_URL: z7.z.string().optional().default("http://localhost:3003"),
75
75
  LOG_LEVEL: z7.z.enum(["trace", "debug", "info", "warn", "error"]).optional().default("debug"),
76
76
  NANGO_SERVER_URL: z7.z.string().optional().default("https://api.nango.dev"),
77
77
  NANGO_SECRET_KEY: z7.z.string().optional(),
@@ -85,8 +85,7 @@ var init_env = __esm({
85
85
  });
86
86
  parseEnv = () => {
87
87
  try {
88
- const parsedEnv = envSchema.parse(process.env);
89
- return parsedEnv;
88
+ return envSchema.parse(process.env);
90
89
  } catch (error) {
91
90
  if (error instanceof z7.z.ZodError) {
92
91
  const missingVars = error.issues.map((issue) => issue.path.join("."));
@@ -1913,6 +1912,7 @@ init_env();
1913
1912
  function setupOpenAPIRoutes(app6) {
1914
1913
  app6.get("/openapi.json", (c) => {
1915
1914
  try {
1915
+ const serverUrl = process.env.VERCEL_ENV === "production" && process.env.VERCEL_PROJECT_PRODUCTION_URL ? `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}` : process.env.VERCEL_ENV === "preview" && process.env.VERCEL_URL ? `https://${process.env.VERCEL_URL}` : env.INKEEP_AGENTS_RUN_API_URL;
1916
1916
  const document = app6.getOpenAPIDocument({
1917
1917
  openapi: "3.0.0",
1918
1918
  info: {
@@ -1922,7 +1922,7 @@ function setupOpenAPIRoutes(app6) {
1922
1922
  },
1923
1923
  servers: [
1924
1924
  {
1925
- url: env.AGENTS_RUN_API_URL,
1925
+ url: serverUrl,
1926
1926
  description: "API Server"
1927
1927
  }
1928
1928
  ]
@@ -9565,6 +9565,22 @@ var Agent = class {
9565
9565
  getStreamRequestId() {
9566
9566
  return this.streamRequestId || "";
9567
9567
  }
9568
+ /**
9569
+ * Format tool result for storage in conversation history
9570
+ */
9571
+ formatToolResult(toolName, args, result, toolCallId) {
9572
+ const input = args ? JSON.stringify(args, null, 2) : "No input";
9573
+ const output = typeof result === "string" ? result : JSON.stringify(result, null, 2);
9574
+ return `## Tool: ${toolName}
9575
+
9576
+ ### \u{1F527} TOOL_CALL_ID: ${toolCallId}
9577
+
9578
+ ### Input
9579
+ ${input}
9580
+
9581
+ ### Output
9582
+ ${output}`;
9583
+ }
9568
9584
  /**
9569
9585
  * Analyze tool result structure and add helpful path hints for artifact creation
9570
9586
  * Only adds hints when artifact components are available
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { flushBatchProcessor } from './chunk-YBBSNUL3.js';
2
- import { getFormattedConversationHistory, createDefaultConversationHistoryConfig, saveA2AMessageResponse } from './chunk-54Z7AOV4.js';
3
- import { dbClient_default } from './chunk-BYF2SHLS.js';
4
- import { env } from './chunk-N2FZD53W.js';
1
+ import { flushBatchProcessor } from './chunk-H2IQDFCM.js';
2
+ import { getFormattedConversationHistory, createDefaultConversationHistoryConfig, saveA2AMessageResponse } from './chunk-BEMQODJT.js';
3
+ import { dbClient_default } from './chunk-4HDXSU6S.js';
4
+ import { env } from './chunk-UZXC6MEO.js';
5
5
  import { getLogger } from './chunk-A2S7GSHL.js';
6
6
  import { STREAM_PARSER_MAX_SNAPSHOT_SIZE, STREAM_PARSER_MAX_STREAMED_SIZE, STREAM_PARSER_MAX_COLLECTED_PARTS, STREAM_BUFFER_MAX_SIZE_BYTES, SESSION_CLEANUP_INTERVAL_MS, STREAM_MAX_LIFETIME_MS, STREAM_TEXT_GAP_THRESHOLD_MS, AGENT_EXECUTION_MAX_CONSECUTIVE_ERRORS, SESSION_TOOL_RESULT_CACHE_TIMEOUT_MS, ARTIFACT_GENERATION_MAX_RETRIES, ARTIFACT_SESSION_MAX_PENDING, STATUS_UPDATE_DEFAULT_INTERVAL_SECONDS, STATUS_UPDATE_DEFAULT_NUM_EVENTS, ARTIFACT_SESSION_MAX_PREVIOUS_SUMMARIES, ARTIFACT_GENERATION_BACKOFF_INITIAL_MS, ARTIFACT_GENERATION_BACKOFF_MAX_MS, AGENT_EXECUTION_MAX_GENERATION_STEPS, FUNCTION_TOOL_SANDBOX_VCPUS_DEFAULT, FUNCTION_TOOL_EXECUTION_TIMEOUT_MS_DEFAULT, LLM_GENERATION_MAX_ALLOWED_TIMEOUT_MS, LLM_GENERATION_FIRST_CALL_TIMEOUT_MS_STREAMING, LLM_GENERATION_FIRST_CALL_TIMEOUT_MS_NON_STREAMING, LLM_GENERATION_SUBSEQUENT_CALL_TIMEOUT_MS, DELEGATION_TOOL_BACKOFF_MAX_ELAPSED_TIME_MS, DELEGATION_TOOL_BACKOFF_EXPONENT, DELEGATION_TOOL_BACKOFF_MAX_INTERVAL_MS, DELEGATION_TOOL_BACKOFF_INITIAL_INTERVAL_MS } from './chunk-IVALDC72.js';
7
7
  import { __publicField } from './chunk-PKBMQBKP.js';
@@ -292,6 +292,7 @@ var extractContextFromTeamAgentToken = async (token, baseUrl, expectedSubAgentId
292
292
  function setupOpenAPIRoutes(app6) {
293
293
  app6.get("/openapi.json", (c) => {
294
294
  try {
295
+ const serverUrl = process.env.VERCEL_ENV === "production" && process.env.VERCEL_PROJECT_PRODUCTION_URL ? `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}` : process.env.VERCEL_ENV === "preview" && process.env.VERCEL_URL ? `https://${process.env.VERCEL_URL}` : env.INKEEP_AGENTS_RUN_API_URL;
295
296
  const document = app6.getOpenAPIDocument({
296
297
  openapi: "3.0.0",
297
298
  info: {
@@ -301,7 +302,7 @@ function setupOpenAPIRoutes(app6) {
301
302
  },
302
303
  servers: [
303
304
  {
304
- url: env.AGENTS_RUN_API_URL,
305
+ url: serverUrl,
305
306
  description: "API Server"
306
307
  }
307
308
  ]
@@ -7782,7 +7783,7 @@ var Agent = class {
7782
7783
  inputSchema: tool3.inputSchema || tool3.parameters || {},
7783
7784
  usageGuidelines: name.startsWith("transfer_to_") || name.startsWith("delegate_to_") ? `Use this tool to ${name.startsWith("transfer_to_") ? "transfer" : "delegate"} to another agent when appropriate.` : "Use this tool when appropriate for the task at hand."
7784
7785
  }));
7785
- const { getConversationScopedArtifacts } = await import('./conversations-ZZI6XV2G.js');
7786
+ const { getConversationScopedArtifacts } = await import('./conversations-FGU5QUYM.js');
7786
7787
  const historyConfig = this.config.conversationHistoryConfig ?? createDefaultConversationHistoryConfig();
7787
7788
  const referenceArtifacts = await getConversationScopedArtifacts({
7788
7789
  tenantId: this.config.tenantId,
@@ -7889,6 +7890,22 @@ var Agent = class {
7889
7890
  getStreamRequestId() {
7890
7891
  return this.streamRequestId || "";
7891
7892
  }
7893
+ /**
7894
+ * Format tool result for storage in conversation history
7895
+ */
7896
+ formatToolResult(toolName, args, result, toolCallId) {
7897
+ const input = args ? JSON.stringify(args, null, 2) : "No input";
7898
+ const output = typeof result === "string" ? result : JSON.stringify(result, null, 2);
7899
+ return `## Tool: ${toolName}
7900
+
7901
+ ### \u{1F527} TOOL_CALL_ID: ${toolCallId}
7902
+
7903
+ ### Input
7904
+ ${input}
7905
+
7906
+ ### Output
7907
+ ${output}`;
7908
+ }
7892
7909
  /**
7893
7910
  * Analyze tool result structure and add helpful path hints for artifact creation
7894
7911
  * Only adds hints when artifact components are available
@@ -18,7 +18,7 @@ var envSchema = zod.z.object({
18
18
  NODE_ENV: zod.z.enum(["development", "production", "test"]).optional(),
19
19
  ENVIRONMENT: zod.z.enum(["development", "production", "pentest", "test"]).optional().default("development"),
20
20
  DATABASE_URL: zod.z.string().optional(),
21
- AGENTS_RUN_API_URL: zod.z.string().optional().default("http://localhost:3003"),
21
+ INKEEP_AGENTS_RUN_API_URL: zod.z.string().optional().default("http://localhost:3003"),
22
22
  LOG_LEVEL: zod.z.enum(["trace", "debug", "info", "warn", "error"]).optional().default("debug"),
23
23
  NANGO_SERVER_URL: zod.z.string().optional().default("https://api.nango.dev"),
24
24
  NANGO_SECRET_KEY: zod.z.string().optional(),
@@ -32,8 +32,7 @@ var envSchema = zod.z.object({
32
32
  });
33
33
  var parseEnv = () => {
34
34
  try {
35
- const parsedEnv = envSchema.parse(process.env);
36
- return parsedEnv;
35
+ return envSchema.parse(process.env);
37
36
  } catch (error) {
38
37
  if (error instanceof zod.z.ZodError) {
39
38
  const missingVars = error.issues.map((issue) => issue.path.join("."));
@@ -1 +1 @@
1
- export { defaultBatchProcessor, defaultContextManager, defaultInstrumentations, defaultResource, defaultSDK, defaultSpanProcessors, defaultTextMapPropagator, flushBatchProcessor } from './chunk-YBBSNUL3.js';
1
+ export { defaultBatchProcessor, defaultContextManager, defaultInstrumentations, defaultResource, defaultSDK, defaultSpanProcessors, defaultTextMapPropagator, flushBatchProcessor } from './chunk-H2IQDFCM.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-run-api",
3
- "version": "0.32.2",
3
+ "version": "0.33.1",
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",
@@ -53,7 +53,7 @@
53
53
  "traverse": "^0.6.11",
54
54
  "ts-pattern": "^5.7.1",
55
55
  "zod": "4.1.5",
56
- "@inkeep/agents-core": "^0.32.2"
56
+ "@inkeep/agents-core": "^0.33.1"
57
57
  },
58
58
  "optionalDependencies": {
59
59
  "keytar": "^7.9.0"
@@ -1 +0,0 @@
1
- export { dbClient_default as default } from './chunk-BYF2SHLS.js';