@inkeep/agents-run-api 0.0.0-dev-20250924214135 → 0.0.0-dev-20250925023031

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.
@@ -0,0 +1,55 @@
1
+ import { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentations-node';
2
+ import { BaggageSpanProcessor, ALLOW_ALL_BAGGAGE_KEYS } from '@opentelemetry/baggage-span-processor';
3
+ import { AsyncLocalStorageContextManager } from '@opentelemetry/context-async-hooks';
4
+ import { CompositePropagator, W3CTraceContextPropagator, W3CBaggagePropagator } from '@opentelemetry/core';
5
+ import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';
6
+ import { resourceFromAttributes } from '@opentelemetry/resources';
7
+ import { NodeSDK } from '@opentelemetry/sdk-node';
8
+ import { BatchSpanProcessor } from '@opentelemetry/sdk-trace-base';
9
+ import { ATTR_SERVICE_NAME } from '@opentelemetry/semantic-conventions';
10
+
11
+ // src/instrumentation.ts
12
+ var otlpExporter = new OTLPTraceExporter();
13
+ var defaultBatchProcessor = new BatchSpanProcessor(otlpExporter);
14
+ var defaultResource = resourceFromAttributes({
15
+ [ATTR_SERVICE_NAME]: "inkeep-agents-run-api"
16
+ });
17
+ var defaultInstrumentations = [
18
+ getNodeAutoInstrumentations({
19
+ "@opentelemetry/instrumentation-http": {
20
+ enabled: true,
21
+ requestHook: (span, request) => {
22
+ const url = request?.url ?? request?.path;
23
+ if (!url) return;
24
+ const u = new URL(url, "http://localhost");
25
+ span.updateName(`${request?.method || "UNKNOWN"} ${u.pathname}`);
26
+ }
27
+ },
28
+ "@opentelemetry/instrumentation-undici": {
29
+ requestHook: (span) => {
30
+ const method = span.attributes?.["http.request.method"];
31
+ const host = span.attributes?.["server.address"];
32
+ const path = span.attributes?.["url.path"];
33
+ if (method && path)
34
+ span.updateName(host ? `${method} ${host}${path}` : `${method} ${path}`);
35
+ }
36
+ }
37
+ })
38
+ ];
39
+ var defaultSpanProcessors = [
40
+ new BaggageSpanProcessor(ALLOW_ALL_BAGGAGE_KEYS),
41
+ defaultBatchProcessor
42
+ ];
43
+ var defaultContextManager = new AsyncLocalStorageContextManager();
44
+ var defaultTextMapPropagator = new CompositePropagator({
45
+ propagators: [new W3CTraceContextPropagator(), new W3CBaggagePropagator()]
46
+ });
47
+ var defaultSDK = new NodeSDK({
48
+ resource: defaultResource,
49
+ contextManager: defaultContextManager,
50
+ textMapPropagator: defaultTextMapPropagator,
51
+ spanProcessors: defaultSpanProcessors,
52
+ instrumentations: defaultInstrumentations
53
+ });
54
+
55
+ export { defaultBatchProcessor, defaultContextManager, defaultInstrumentations, defaultResource, defaultSDK, defaultSpanProcessors, defaultTextMapPropagator };
@@ -2,9 +2,7 @@ import { loadEnvironmentFiles, createDatabaseClient, createMessage, getConversat
2
2
  import { nanoid } from 'nanoid';
3
3
  import { z } from 'zod';
4
4
 
5
- var __defProp = Object.defineProperty;
6
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
+ // src/data/conversations.ts
8
6
  loadEnvironmentFiles();
9
7
  var envSchema = z.object({
10
8
  NODE_ENV: z.enum(["development", "production", "test"]).optional(),
@@ -210,4 +208,4 @@ ${formattedHistory}
210
208
  `;
211
209
  }
212
210
 
213
- export { __publicField, createDefaultConversationHistoryConfig, dbClient_default, env, getFormattedConversationHistory, getFullConversationContext, getScopedHistory, getUserFacingHistory, saveA2AMessageResponse };
211
+ export { createDefaultConversationHistoryConfig, dbClient_default, env, getFormattedConversationHistory, getFullConversationContext, getScopedHistory, getUserFacingHistory, saveA2AMessageResponse };
@@ -0,0 +1,5 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
+
5
+ export { __publicField };
@@ -1 +1 @@
1
- export { createDefaultConversationHistoryConfig, getFormattedConversationHistory, getFullConversationContext, getScopedHistory, getUserFacingHistory, saveA2AMessageResponse } from './chunk-AFP4EIVB.js';
1
+ export { createDefaultConversationHistoryConfig, getFormattedConversationHistory, getFullConversationContext, getScopedHistory, getUserFacingHistory, saveA2AMessageResponse } from './chunk-HIGMADTA.js';
package/dist/index.cjs CHANGED
@@ -27,7 +27,6 @@ var streaming = require('hono/streaming');
27
27
  var destr = require('destr');
28
28
  var traverse = require('traverse');
29
29
  var ai = require('ai');
30
- var agentsSdk = require('@inkeep/agents-sdk');
31
30
  var anthropic = require('@ai-sdk/anthropic');
32
31
  var gateway = require('@ai-sdk/gateway');
33
32
  var google = require('@ai-sdk/google');
@@ -1400,6 +1399,17 @@ __publicField(_ArtifactReferenceSchema, "ARTIFACT_PROPS_SCHEMA", {
1400
1399
  required: ["artifact_id", "task_id"]
1401
1400
  });
1402
1401
  var ArtifactReferenceSchema = _ArtifactReferenceSchema;
1402
+
1403
+ // src/utils/default-status-schemas.ts
1404
+ var retrieveStatusSchema = {
1405
+ type: "retrieve",
1406
+ description: 'Use this when the system found or retrieved specific information from searches, queries, or lookups. ONLY report ACTUAL findings that appear explicitly in the tool results - never make up data, names, numbers, or details. The label must state the SPECIFIC discovery (e.g., "Found 3 authentication methods", "Database contains 500 records", "API supports JSON format") not the act of searching. Every detail must be traceable to actual tool output. NEVER invent placeholder names, fictional data, or information not present in the activities.'
1407
+ };
1408
+ var actionStatusSchema = {
1409
+ type: "action",
1410
+ description: 'Use this when the system executed a tool or performed an operation that modified state or had side effects. ONLY report ACTUAL tool executions and their results as they appear in the tool outputs - never make up tool names, parameters, or outcomes. The label must describe what specific action was performed and its concrete result based on actual tool execution data. DO NOT make up examples like "Ran test suite with X passes" unless a test suite was ACTUALLY run and reported X passes. DO NOT say "Executed database query" unless a database query was ACTUALLY executed. Only report what literally happened. NEVER invent tool names, execution results, or details not explicitly present in the tool execution activities. If a tool failed, report the actual failure, not imagined success.'
1411
+ };
1412
+ var defaultStatusSchemas = [retrieveStatusSchema, actionStatusSchema];
1403
1413
  var logger5 = agentsCore.getLogger("ModelFactory");
1404
1414
  var _ModelFactory = class _ModelFactory {
1405
1415
  /**
@@ -1929,7 +1939,7 @@ var GraphSession = class {
1929
1939
  }
1930
1940
  const now = Date.now();
1931
1941
  const elapsedTime = now - statusUpdateState.startTime;
1932
- const statusComponents = statusUpdateState.config.statusComponents && statusUpdateState.config.statusComponents.length > 0 ? statusUpdateState.config.statusComponents : agentsSdk.defaultStatusSchemas;
1942
+ const statusComponents = statusUpdateState.config.statusComponents && statusUpdateState.config.statusComponents.length > 0 ? statusUpdateState.config.statusComponents : defaultStatusSchemas;
1933
1943
  const result = await this.generateStructuredStatusUpdate(
1934
1944
  this.events.slice(statusUpdateState.lastEventCount),
1935
1945
  elapsedTime,
package/dist/index.js CHANGED
@@ -1,4 +1,6 @@
1
- import { __publicField, dbClient_default, getFormattedConversationHistory, env, createDefaultConversationHistoryConfig, saveA2AMessageResponse } from './chunk-AFP4EIVB.js';
1
+ import { defaultBatchProcessor } from './chunk-5RGAMXUL.js';
2
+ import { dbClient_default, getFormattedConversationHistory, env, createDefaultConversationHistoryConfig, saveA2AMessageResponse } from './chunk-HIGMADTA.js';
3
+ import { __publicField } from './chunk-PKBMQBKP.js';
2
4
  import { getLogger, getTracer, HeadersScopeSchema, getRequestExecutionContext, createApiError, getAgentGraphWithDefaultAgent, contextValidationMiddleware, getFullGraph, createOrGetConversation, getActiveAgentForConversation, setActiveAgentForConversation, getAgentById, handleContextResolution, createMessage, commonGetErrorResponses, loggerFactory, createDefaultCredentialStores, CredentialStoreRegistry, listTaskIdsByContextId, getTask, getLedgerArtifacts, getAgentGraphById, createTask, updateTask, setSpanWithError, updateConversation, handleApiError, TaskState, setActiveAgentForThread, getConversation, getRelatedAgentsForGraph, getToolsForAgent, getDataComponentsForAgent, getArtifactComponentsForAgent, validateAndGetApiKey, getProject, ContextResolver, CredentialStuffer, MCPServerType, getCredentialReference, McpClient, getContextConfigById, getFullGraphDefinition, TemplateEngine, graphHasArtifactComponents, MCPTransportType, getExternalAgent } from '@inkeep/agents-core';
3
5
  import { otel } from '@hono/otel';
4
6
  import { OpenAPIHono, createRoute, z as z$1 } from '@hono/zod-openapi';
@@ -7,15 +9,6 @@ import { Hono } from 'hono';
7
9
  import { cors } from 'hono/cors';
8
10
  import { HTTPException } from 'hono/http-exception';
9
11
  import { requestId } from 'hono/request-id';
10
- import { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentations-node';
11
- import { BaggageSpanProcessor, ALLOW_ALL_BAGGAGE_KEYS } from '@opentelemetry/baggage-span-processor';
12
- import { AsyncLocalStorageContextManager } from '@opentelemetry/context-async-hooks';
13
- import { CompositePropagator, W3CTraceContextPropagator, W3CBaggagePropagator } from '@opentelemetry/core';
14
- import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';
15
- import { resourceFromAttributes } from '@opentelemetry/resources';
16
- import { NodeSDK } from '@opentelemetry/sdk-node';
17
- import { BatchSpanProcessor } from '@opentelemetry/sdk-trace-base';
18
- import { ATTR_SERVICE_NAME } from '@opentelemetry/semantic-conventions';
19
12
  import { createMiddleware } from 'hono/factory';
20
13
  import { swaggerUI } from '@hono/swagger-ui';
21
14
  import z4, { z } from 'zod';
@@ -24,7 +17,6 @@ import { nanoid } from 'nanoid';
24
17
  import destr from 'destr';
25
18
  import traverse from 'traverse';
26
19
  import { createUIMessageStream, JsonToSseTransformStream, parsePartialJson, generateObject, tool, streamText, generateText, streamObject } from 'ai';
27
- import { defaultStatusSchemas } from '@inkeep/agents-sdk';
28
20
  import { createAnthropic, anthropic } from '@ai-sdk/anthropic';
29
21
  import { createGateway, gateway } from '@ai-sdk/gateway';
30
22
  import { createGoogleGenerativeAI, google } from '@ai-sdk/google';
@@ -36,49 +28,6 @@ import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/
36
28
  import { z as z$2 } from 'zod/v3';
37
29
  import { toReqRes, toFetchResponse } from 'fetch-to-node';
38
30
 
39
- var otlpExporter = new OTLPTraceExporter();
40
- var defaultBatchProcessor = new BatchSpanProcessor(otlpExporter);
41
- var defaultResource = resourceFromAttributes({
42
- [ATTR_SERVICE_NAME]: "inkeep-agents-run-api"
43
- });
44
- var defaultInstrumentations = [
45
- getNodeAutoInstrumentations({
46
- "@opentelemetry/instrumentation-http": {
47
- enabled: true,
48
- requestHook: (span, request) => {
49
- const url = request?.url ?? request?.path;
50
- if (!url) return;
51
- const u = new URL(url, "http://localhost");
52
- span.updateName(`${request?.method || "UNKNOWN"} ${u.pathname}`);
53
- }
54
- },
55
- "@opentelemetry/instrumentation-undici": {
56
- requestHook: (span) => {
57
- const method = span.attributes?.["http.request.method"];
58
- const host = span.attributes?.["server.address"];
59
- const path = span.attributes?.["url.path"];
60
- if (method && path)
61
- span.updateName(host ? `${method} ${host}${path}` : `${method} ${path}`);
62
- }
63
- }
64
- })
65
- ];
66
- var defaultSpanProcessors = [
67
- new BaggageSpanProcessor(ALLOW_ALL_BAGGAGE_KEYS),
68
- defaultBatchProcessor
69
- ];
70
- var defaultContextManager = new AsyncLocalStorageContextManager();
71
- var defaultTextMapPropagator = new CompositePropagator({
72
- propagators: [new W3CTraceContextPropagator(), new W3CBaggagePropagator()]
73
- });
74
- new NodeSDK({
75
- resource: defaultResource,
76
- contextManager: defaultContextManager,
77
- textMapPropagator: defaultTextMapPropagator,
78
- spanProcessors: defaultSpanProcessors,
79
- instrumentations: defaultInstrumentations
80
- });
81
-
82
31
  // src/types/execution-context.ts
83
32
  function createExecutionContext(params) {
84
33
  return {
@@ -1133,6 +1082,17 @@ __publicField(_ArtifactReferenceSchema, "ARTIFACT_PROPS_SCHEMA", {
1133
1082
  required: ["artifact_id", "task_id"]
1134
1083
  });
1135
1084
  var ArtifactReferenceSchema = _ArtifactReferenceSchema;
1085
+
1086
+ // src/utils/default-status-schemas.ts
1087
+ var retrieveStatusSchema = {
1088
+ type: "retrieve",
1089
+ description: 'Use this when the system found or retrieved specific information from searches, queries, or lookups. ONLY report ACTUAL findings that appear explicitly in the tool results - never make up data, names, numbers, or details. The label must state the SPECIFIC discovery (e.g., "Found 3 authentication methods", "Database contains 500 records", "API supports JSON format") not the act of searching. Every detail must be traceable to actual tool output. NEVER invent placeholder names, fictional data, or information not present in the activities.'
1090
+ };
1091
+ var actionStatusSchema = {
1092
+ type: "action",
1093
+ description: 'Use this when the system executed a tool or performed an operation that modified state or had side effects. ONLY report ACTUAL tool executions and their results as they appear in the tool outputs - never make up tool names, parameters, or outcomes. The label must describe what specific action was performed and its concrete result based on actual tool execution data. DO NOT make up examples like "Ran test suite with X passes" unless a test suite was ACTUALLY run and reported X passes. DO NOT say "Executed database query" unless a database query was ACTUALLY executed. Only report what literally happened. NEVER invent tool names, execution results, or details not explicitly present in the tool execution activities. If a tool failed, report the actual failure, not imagined success.'
1094
+ };
1095
+ var defaultStatusSchemas = [retrieveStatusSchema, actionStatusSchema];
1136
1096
  var logger5 = getLogger("ModelFactory");
1137
1097
  var _ModelFactory = class _ModelFactory {
1138
1098
  /**
@@ -2126,7 +2086,7 @@ ${this.statusUpdateState?.config.prompt?.trim() || ""}`;
2126
2086
  );
2127
2087
  }
2128
2088
  span.setAttributes({ "validation.passed": true });
2129
- const { getFormattedConversationHistory: getFormattedConversationHistory2 } = await import('./conversations-LKYN44FI.js');
2089
+ const { getFormattedConversationHistory: getFormattedConversationHistory2 } = await import('./conversations-OVETKXSP.js');
2130
2090
  const conversationHistory = await getFormattedConversationHistory2({
2131
2091
  tenantId: artifactData.tenantId,
2132
2092
  projectId: artifactData.projectId,
@@ -0,0 +1,63 @@
1
+ 'use strict';
2
+
3
+ var autoInstrumentationsNode = require('@opentelemetry/auto-instrumentations-node');
4
+ var baggageSpanProcessor = require('@opentelemetry/baggage-span-processor');
5
+ var contextAsyncHooks = require('@opentelemetry/context-async-hooks');
6
+ var core = require('@opentelemetry/core');
7
+ var exporterTraceOtlpHttp = require('@opentelemetry/exporter-trace-otlp-http');
8
+ var resources = require('@opentelemetry/resources');
9
+ var sdkNode = require('@opentelemetry/sdk-node');
10
+ var sdkTraceBase = require('@opentelemetry/sdk-trace-base');
11
+ var semanticConventions = require('@opentelemetry/semantic-conventions');
12
+
13
+ // src/instrumentation.ts
14
+ var otlpExporter = new exporterTraceOtlpHttp.OTLPTraceExporter();
15
+ var defaultBatchProcessor = new sdkTraceBase.BatchSpanProcessor(otlpExporter);
16
+ var defaultResource = resources.resourceFromAttributes({
17
+ [semanticConventions.ATTR_SERVICE_NAME]: "inkeep-agents-run-api"
18
+ });
19
+ var defaultInstrumentations = [
20
+ autoInstrumentationsNode.getNodeAutoInstrumentations({
21
+ "@opentelemetry/instrumentation-http": {
22
+ enabled: true,
23
+ requestHook: (span, request) => {
24
+ const url = request?.url ?? request?.path;
25
+ if (!url) return;
26
+ const u = new URL(url, "http://localhost");
27
+ span.updateName(`${request?.method || "UNKNOWN"} ${u.pathname}`);
28
+ }
29
+ },
30
+ "@opentelemetry/instrumentation-undici": {
31
+ requestHook: (span) => {
32
+ const method = span.attributes?.["http.request.method"];
33
+ const host = span.attributes?.["server.address"];
34
+ const path = span.attributes?.["url.path"];
35
+ if (method && path)
36
+ span.updateName(host ? `${method} ${host}${path}` : `${method} ${path}`);
37
+ }
38
+ }
39
+ })
40
+ ];
41
+ var defaultSpanProcessors = [
42
+ new baggageSpanProcessor.BaggageSpanProcessor(baggageSpanProcessor.ALLOW_ALL_BAGGAGE_KEYS),
43
+ defaultBatchProcessor
44
+ ];
45
+ var defaultContextManager = new contextAsyncHooks.AsyncLocalStorageContextManager();
46
+ var defaultTextMapPropagator = new core.CompositePropagator({
47
+ propagators: [new core.W3CTraceContextPropagator(), new core.W3CBaggagePropagator()]
48
+ });
49
+ var defaultSDK = new sdkNode.NodeSDK({
50
+ resource: defaultResource,
51
+ contextManager: defaultContextManager,
52
+ textMapPropagator: defaultTextMapPropagator,
53
+ spanProcessors: defaultSpanProcessors,
54
+ instrumentations: defaultInstrumentations
55
+ });
56
+
57
+ exports.defaultBatchProcessor = defaultBatchProcessor;
58
+ exports.defaultContextManager = defaultContextManager;
59
+ exports.defaultInstrumentations = defaultInstrumentations;
60
+ exports.defaultResource = defaultResource;
61
+ exports.defaultSDK = defaultSDK;
62
+ exports.defaultSpanProcessors = defaultSpanProcessors;
63
+ exports.defaultTextMapPropagator = defaultTextMapPropagator;
@@ -0,0 +1,15 @@
1
+ import * as _opentelemetry_resources from '@opentelemetry/resources';
2
+ import { AsyncLocalStorageContextManager } from '@opentelemetry/context-async-hooks';
3
+ import { CompositePropagator } from '@opentelemetry/core';
4
+ import { NodeSDKConfiguration, NodeSDK } from '@opentelemetry/sdk-node';
5
+ import { BatchSpanProcessor, SpanProcessor } from '@opentelemetry/sdk-trace-base';
6
+
7
+ declare const defaultBatchProcessor: BatchSpanProcessor;
8
+ declare const defaultResource: _opentelemetry_resources.Resource;
9
+ declare const defaultInstrumentations: NonNullable<NodeSDKConfiguration['instrumentations']>;
10
+ declare const defaultSpanProcessors: SpanProcessor[];
11
+ declare const defaultContextManager: AsyncLocalStorageContextManager;
12
+ declare const defaultTextMapPropagator: CompositePropagator;
13
+ declare const defaultSDK: NodeSDK;
14
+
15
+ export { defaultBatchProcessor, defaultContextManager, defaultInstrumentations, defaultResource, defaultSDK, defaultSpanProcessors, defaultTextMapPropagator };
@@ -0,0 +1,15 @@
1
+ import * as _opentelemetry_resources from '@opentelemetry/resources';
2
+ import { AsyncLocalStorageContextManager } from '@opentelemetry/context-async-hooks';
3
+ import { CompositePropagator } from '@opentelemetry/core';
4
+ import { NodeSDKConfiguration, NodeSDK } from '@opentelemetry/sdk-node';
5
+ import { BatchSpanProcessor, SpanProcessor } from '@opentelemetry/sdk-trace-base';
6
+
7
+ declare const defaultBatchProcessor: BatchSpanProcessor;
8
+ declare const defaultResource: _opentelemetry_resources.Resource;
9
+ declare const defaultInstrumentations: NonNullable<NodeSDKConfiguration['instrumentations']>;
10
+ declare const defaultSpanProcessors: SpanProcessor[];
11
+ declare const defaultContextManager: AsyncLocalStorageContextManager;
12
+ declare const defaultTextMapPropagator: CompositePropagator;
13
+ declare const defaultSDK: NodeSDK;
14
+
15
+ export { defaultBatchProcessor, defaultContextManager, defaultInstrumentations, defaultResource, defaultSDK, defaultSpanProcessors, defaultTextMapPropagator };
@@ -0,0 +1 @@
1
+ export { defaultBatchProcessor, defaultContextManager, defaultInstrumentations, defaultResource, defaultSDK, defaultSpanProcessors, defaultTextMapPropagator } from './chunk-5RGAMXUL.js';
package/package.json CHANGED
@@ -1,11 +1,15 @@
1
1
  {
2
2
  "name": "@inkeep/agents-run-api",
3
- "version": "0.0.0-dev-20250924214135",
3
+ "version": "0.0.0-dev-20250925023031",
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",
7
7
  "exports": {
8
- ".": "./dist/index.js"
8
+ ".": "./dist/index.js",
9
+ "./instrumentation": {
10
+ "import": "./dist/instrumentation.js",
11
+ "types": "./dist/instrumentation.d.ts"
12
+ }
9
13
  },
10
14
  "type": "module",
11
15
  "license": "SEE LICENSE IN LICENSE.md",
@@ -48,8 +52,7 @@
48
52
  "traverse": "^0.6.11",
49
53
  "ts-pattern": "^5.7.1",
50
54
  "zod": "^4.1.5",
51
- "@inkeep/agents-sdk": "^0.0.0-dev-20250924214135",
52
- "@inkeep/agents-core": "^0.0.0-dev-20250924214135"
55
+ "@inkeep/agents-core": "^0.0.0-dev-20250925023031"
53
56
  },
54
57
  "devDependencies": {
55
58
  "@hono/vite-dev-server": "^0.20.1",