@inkeep/agents-run-api 0.0.0-dev-20250924224100 → 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.
- package/dist/chunk-5RGAMXUL.js +55 -0
- package/dist/{chunk-AFP4EIVB.js → chunk-HIGMADTA.js} +2 -4
- package/dist/chunk-PKBMQBKP.js +5 -0
- package/dist/{conversations-LKYN44FI.js → conversations-OVETKXSP.js} +1 -1
- package/dist/index.js +4 -54
- package/dist/instrumentation.cjs +63 -0
- package/dist/instrumentation.d.cts +15 -0
- package/dist/instrumentation.d.ts +15 -0
- package/dist/instrumentation.js +1 -0
- package/package.json +7 -3
|
@@ -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
|
-
|
|
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 {
|
|
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-
|
|
1
|
+
export { createDefaultConversationHistoryConfig, getFormattedConversationHistory, getFullConversationContext, getScopedHistory, getUserFacingHistory, saveA2AMessageResponse } from './chunk-HIGMADTA.js';
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
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';
|
|
@@ -35,49 +28,6 @@ import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/
|
|
|
35
28
|
import { z as z$2 } from 'zod/v3';
|
|
36
29
|
import { toReqRes, toFetchResponse } from 'fetch-to-node';
|
|
37
30
|
|
|
38
|
-
var otlpExporter = new OTLPTraceExporter();
|
|
39
|
-
var defaultBatchProcessor = new BatchSpanProcessor(otlpExporter);
|
|
40
|
-
var defaultResource = resourceFromAttributes({
|
|
41
|
-
[ATTR_SERVICE_NAME]: "inkeep-agents-run-api"
|
|
42
|
-
});
|
|
43
|
-
var defaultInstrumentations = [
|
|
44
|
-
getNodeAutoInstrumentations({
|
|
45
|
-
"@opentelemetry/instrumentation-http": {
|
|
46
|
-
enabled: true,
|
|
47
|
-
requestHook: (span, request) => {
|
|
48
|
-
const url = request?.url ?? request?.path;
|
|
49
|
-
if (!url) return;
|
|
50
|
-
const u = new URL(url, "http://localhost");
|
|
51
|
-
span.updateName(`${request?.method || "UNKNOWN"} ${u.pathname}`);
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
"@opentelemetry/instrumentation-undici": {
|
|
55
|
-
requestHook: (span) => {
|
|
56
|
-
const method = span.attributes?.["http.request.method"];
|
|
57
|
-
const host = span.attributes?.["server.address"];
|
|
58
|
-
const path = span.attributes?.["url.path"];
|
|
59
|
-
if (method && path)
|
|
60
|
-
span.updateName(host ? `${method} ${host}${path}` : `${method} ${path}`);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
})
|
|
64
|
-
];
|
|
65
|
-
var defaultSpanProcessors = [
|
|
66
|
-
new BaggageSpanProcessor(ALLOW_ALL_BAGGAGE_KEYS),
|
|
67
|
-
defaultBatchProcessor
|
|
68
|
-
];
|
|
69
|
-
var defaultContextManager = new AsyncLocalStorageContextManager();
|
|
70
|
-
var defaultTextMapPropagator = new CompositePropagator({
|
|
71
|
-
propagators: [new W3CTraceContextPropagator(), new W3CBaggagePropagator()]
|
|
72
|
-
});
|
|
73
|
-
new NodeSDK({
|
|
74
|
-
resource: defaultResource,
|
|
75
|
-
contextManager: defaultContextManager,
|
|
76
|
-
textMapPropagator: defaultTextMapPropagator,
|
|
77
|
-
spanProcessors: defaultSpanProcessors,
|
|
78
|
-
instrumentations: defaultInstrumentations
|
|
79
|
-
});
|
|
80
|
-
|
|
81
31
|
// src/types/execution-context.ts
|
|
82
32
|
function createExecutionContext(params) {
|
|
83
33
|
return {
|
|
@@ -2136,7 +2086,7 @@ ${this.statusUpdateState?.config.prompt?.trim() || ""}`;
|
|
|
2136
2086
|
);
|
|
2137
2087
|
}
|
|
2138
2088
|
span.setAttributes({ "validation.passed": true });
|
|
2139
|
-
const { getFormattedConversationHistory: getFormattedConversationHistory2 } = await import('./conversations-
|
|
2089
|
+
const { getFormattedConversationHistory: getFormattedConversationHistory2 } = await import('./conversations-OVETKXSP.js');
|
|
2140
2090
|
const conversationHistory = await getFormattedConversationHistory2({
|
|
2141
2091
|
tenantId: artifactData.tenantId,
|
|
2142
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-
|
|
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,7 +52,7 @@
|
|
|
48
52
|
"traverse": "^0.6.11",
|
|
49
53
|
"ts-pattern": "^5.7.1",
|
|
50
54
|
"zod": "^4.1.5",
|
|
51
|
-
"@inkeep/agents-core": "^0.0.0-dev-
|
|
55
|
+
"@inkeep/agents-core": "^0.0.0-dev-20250925023031"
|
|
52
56
|
},
|
|
53
57
|
"devDependencies": {
|
|
54
58
|
"@hono/vite-dev-server": "^0.20.1",
|