@inkeep/agents-run-api 0.0.0-dev-20260106120605 → 0.0.0-dev-20260106154123

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,9 +1,9 @@
1
1
  import { SandboxConfig } from "./types/execution-context.js";
2
2
  import { CredentialStoreRegistry, ServerConfig } from "@inkeep/agents-core";
3
3
  import { Hono } from "hono";
4
- import * as hono_types0 from "hono/types";
4
+ import * as hono_types3 from "hono/types";
5
5
 
6
6
  //#region src/create-app.d.ts
7
- declare function createExecutionHono(serverConfig: ServerConfig, credentialStores: CredentialStoreRegistry, sandboxConfig?: SandboxConfig): Hono<hono_types0.BlankEnv, hono_types0.BlankSchema, "/">;
7
+ declare function createExecutionHono(serverConfig: ServerConfig, credentialStores: CredentialStoreRegistry, sandboxConfig?: SandboxConfig): Hono<hono_types3.BlankEnv, hono_types3.BlankSchema, "/">;
8
8
  //#endregion
9
9
  export { createExecutionHono };
package/dist/env.d.ts CHANGED
@@ -17,11 +17,11 @@ declare const envSchema: z.ZodObject<{
17
17
  INKEEP_AGENTS_RUN_API_URL: z.ZodDefault<z.ZodOptional<z.ZodString>>;
18
18
  AGENTS_MANAGE_UI_URL: z.ZodDefault<z.ZodOptional<z.ZodString>>;
19
19
  LOG_LEVEL: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
20
- error: "error";
21
20
  trace: "trace";
22
21
  debug: "debug";
23
22
  info: "info";
24
23
  warn: "warn";
24
+ error: "error";
25
25
  }>>>;
26
26
  NANGO_SERVER_URL: z.ZodDefault<z.ZodOptional<z.ZodString>>;
27
27
  NANGO_SECRET_KEY: z.ZodOptional<z.ZodString>;
@@ -38,7 +38,7 @@ declare const env: {
38
38
  ENVIRONMENT: "development" | "production" | "test" | "pentest";
39
39
  INKEEP_AGENTS_RUN_API_URL: string;
40
40
  AGENTS_MANAGE_UI_URL: string;
41
- LOG_LEVEL: "error" | "trace" | "debug" | "info" | "warn";
41
+ LOG_LEVEL: "trace" | "debug" | "info" | "warn" | "error";
42
42
  NANGO_SERVER_URL: string;
43
43
  ANTHROPIC_API_KEY: string;
44
44
  OTEL_BSP_SCHEDULE_DELAY: number;
package/dist/index.d.ts CHANGED
@@ -3,14 +3,14 @@ import { createExecutionHono } from "./create-app.js";
3
3
  import "./env.js";
4
4
  import { CredentialStore, ServerConfig } from "@inkeep/agents-core";
5
5
  import { Hono } from "hono";
6
- import * as hono_types1 from "hono/types";
6
+ import * as hono_types0 from "hono/types";
7
7
 
8
8
  //#region src/index.d.ts
9
- declare const app: Hono<hono_types1.BlankEnv, hono_types1.BlankSchema, "/">;
9
+ declare const app: Hono<hono_types0.BlankEnv, hono_types0.BlankSchema, "/">;
10
10
  declare function createExecutionApp(config?: {
11
11
  serverConfig?: ServerConfig;
12
12
  credentialStores?: CredentialStore[];
13
13
  sandboxConfig?: SandboxConfig;
14
- }): Hono<hono_types1.BlankEnv, hono_types1.BlankSchema, "/">;
14
+ }): Hono<hono_types0.BlankEnv, hono_types0.BlankSchema, "/">;
15
15
  //#endregion
16
16
  export { Hono, type NativeSandboxConfig, type SandboxConfig, type VercelSandboxConfig, createExecutionApp, createExecutionHono, app as default };
@@ -108,12 +108,18 @@ app.openapi(chatCompletionsRoute, async (c) => {
108
108
  }, "Extracted chat parameters from API key context");
109
109
  const body = c.get("requestBody") || {};
110
110
  const conversationId = body.conversationId || getConversationId();
111
+ const targetTenantId = c.req.header("x-target-tenant-id");
112
+ const targetProjectId = c.req.header("x-target-project-id");
113
+ const targetAgentId = c.req.header("x-target-agent-id");
111
114
  const activeSpan = trace.getActiveSpan();
112
115
  if (activeSpan) activeSpan.setAttributes({
113
116
  "conversation.id": conversationId,
114
117
  "tenant.id": tenantId,
115
118
  "agent.id": agentId,
116
- "project.id": projectId
119
+ "project.id": projectId,
120
+ ...targetTenantId && { "target.tenant.id": targetTenantId },
121
+ ...targetProjectId && { "target.project.id": targetProjectId },
122
+ ...targetAgentId && { "target.agent.id": targetAgentId }
117
123
  });
118
124
  let currentBag = propagation.getBaggage(context.active());
119
125
  if (!currentBag) currentBag = propagation.createBaggage();
@@ -72,12 +72,18 @@ app.openapi(chatDataStreamRoute, async (c) => {
72
72
  }, "Extracted chatDataStream parameters");
73
73
  const body = c.get("requestBody") || {};
74
74
  const conversationId = body.conversationId || getConversationId();
75
+ const targetTenantId = c.req.header("x-target-tenant-id");
76
+ const targetProjectId = c.req.header("x-target-project-id");
77
+ const targetAgentId = c.req.header("x-target-agent-id");
75
78
  const activeSpan = trace.getActiveSpan();
76
79
  if (activeSpan) activeSpan.setAttributes({
77
80
  "conversation.id": conversationId,
78
81
  "tenant.id": tenantId,
79
82
  "agent.id": agentId,
80
- "project.id": projectId
83
+ "project.id": projectId,
84
+ ...targetTenantId && { "target.tenant.id": targetTenantId },
85
+ ...targetProjectId && { "target.project.id": targetProjectId },
86
+ ...targetAgentId && { "target.agent.id": targetAgentId }
81
87
  });
82
88
  let currentBag = propagation.getBaggage(context.active());
83
89
  if (!currentBag) currentBag = propagation.createBaggage();
@@ -409,7 +409,6 @@ var BaseCompressor = class {
409
409
  return await tracer.startActiveSpan("compressor.safe_compress", { attributes: {
410
410
  "compression.type": this.getCompressionType(),
411
411
  "compression.session_id": this.sessionId,
412
- "compression.conversation_id": this.conversationId,
413
412
  "compression.message_count": messages.length,
414
413
  "compression.input_tokens": fullContextSize ?? this.calculateContextSize(messages),
415
414
  "compression.hard_limit": this.getHardLimit(),
@@ -423,7 +422,7 @@ var BaseCompressor = class {
423
422
  "compression.result.output_tokens": resultTokens,
424
423
  "compression.result.compression_ratio": (fullContextSize ?? this.calculateContextSize(messages)) > 0 ? ((fullContextSize ?? this.calculateContextSize(messages)) - resultTokens) / (fullContextSize ?? this.calculateContextSize(messages)) : 0,
425
424
  "compression.success": true,
426
- "compression.fallback_used": false
425
+ "compression.result.summary": result.summary?.high_level || ""
427
426
  });
428
427
  compressionSpan.setStatus({ code: SpanStatusCode.OK });
429
428
  return result;
@@ -434,10 +433,7 @@ var BaseCompressor = class {
434
433
  error: error instanceof Error ? error.message : String(error),
435
434
  stack: error instanceof Error ? error.stack : void 0
436
435
  }, "Compression failed, using simple fallback");
437
- compressionSpan.setAttributes({
438
- "compression.error": error instanceof Error ? error.message : String(error),
439
- "compression.fallback_used": true
440
- });
436
+ compressionSpan.setAttributes({ "compression.error": error instanceof Error ? error.message : String(error) });
441
437
  const fallbackResult = await this.simpleCompressionFallback(messages);
442
438
  const fallbackTokens = Array.isArray(fallbackResult.summary) ? this.calculateContextSize(fallbackResult.summary) : this.estimateTokens(fallbackResult.summary);
443
439
  compressionSpan.setAttributes({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-run-api",
3
- "version": "0.0.0-dev-20260106120605",
3
+ "version": "0.0.0-dev-20260106154123",
4
4
  "description": "Agents Run API for Inkeep Agent Framework - handles chat, agent execution, and streaming",
5
5
  "types": "dist/index.d.ts",
6
6
  "exports": {
@@ -41,7 +41,7 @@
41
41
  "hono": "^4.10.4",
42
42
  "jmespath": "^0.16.0",
43
43
  "llm-info": "^1.0.69",
44
- "@inkeep/agents-core": "^0.0.0-dev-20260106120605"
44
+ "@inkeep/agents-core": "^0.0.0-dev-20260106154123"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@hono/zod-openapi": "^1.1.5",