@inkeep/agents-run-api 0.0.0-dev-20250912230612 → 0.0.0-dev-20250913000214
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/index.cjs +23 -10
- package/dist/index.js +23 -10
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -327,17 +327,15 @@ var init_conversations = __esm({
|
|
|
327
327
|
init_env();
|
|
328
328
|
var maxExportBatchSize = env.OTEL_MAX_EXPORT_BATCH_SIZE ?? (env.ENVIRONMENT === "development" ? 1 : 512);
|
|
329
329
|
var otlpExporter = new exporterTraceOtlpHttp.OTLPTraceExporter();
|
|
330
|
+
var batchProcessor = new sdkTraceBase.BatchSpanProcessor(otlpExporter, {
|
|
331
|
+
maxExportBatchSize
|
|
332
|
+
});
|
|
330
333
|
var resource = resources.resourceFromAttributes({
|
|
331
334
|
[semanticConventions.ATTR_SERVICE_NAME]: "inkeep-agents-run-api"
|
|
332
335
|
});
|
|
333
336
|
var sdk = new sdkNode.NodeSDK({
|
|
334
337
|
resource,
|
|
335
|
-
spanProcessors: [
|
|
336
|
-
new baggageSpanProcessor.BaggageSpanProcessor(baggageSpanProcessor.ALLOW_ALL_BAGGAGE_KEYS),
|
|
337
|
-
new sdkTraceBase.BatchSpanProcessor(otlpExporter, {
|
|
338
|
-
maxExportBatchSize
|
|
339
|
-
})
|
|
340
|
-
],
|
|
338
|
+
spanProcessors: [new baggageSpanProcessor.BaggageSpanProcessor(baggageSpanProcessor.ALLOW_ALL_BAGGAGE_KEYS), batchProcessor],
|
|
341
339
|
instrumentations: [
|
|
342
340
|
autoInstrumentationsNode.getNodeAutoInstrumentations({
|
|
343
341
|
"@opentelemetry/instrumentation-http": {
|
|
@@ -8869,6 +8867,7 @@ app4.delete("/", async (c) => {
|
|
|
8869
8867
|
var mcp_default = app4;
|
|
8870
8868
|
|
|
8871
8869
|
// src/app.ts
|
|
8870
|
+
var logger23 = getLogger("agents-run-api");
|
|
8872
8871
|
function createExecutionHono(serverConfig, credentialStores) {
|
|
8873
8872
|
const app6 = new zodOpenapi.OpenAPIHono();
|
|
8874
8873
|
app6.use("*", requestId.requestId());
|
|
@@ -8892,7 +8891,7 @@ function createExecutionHono(serverConfig, credentialStores) {
|
|
|
8892
8891
|
});
|
|
8893
8892
|
app6.use(
|
|
8894
8893
|
honoPino.pinoLogger({
|
|
8895
|
-
pino:
|
|
8894
|
+
pino: logger23 || pino.pino({ level: "debug" }),
|
|
8896
8895
|
http: {
|
|
8897
8896
|
onResLevel(c) {
|
|
8898
8897
|
if (c.res.status >= 500) {
|
|
@@ -8936,7 +8935,6 @@ function createExecutionHono(serverConfig, credentialStores) {
|
|
|
8936
8935
|
if (!isExpectedError) {
|
|
8937
8936
|
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
8938
8937
|
const errorStack = err instanceof Error ? err.stack : void 0;
|
|
8939
|
-
const logger23 = getLogger();
|
|
8940
8938
|
if (logger23) {
|
|
8941
8939
|
logger23.error(
|
|
8942
8940
|
{
|
|
@@ -8950,7 +8948,6 @@ function createExecutionHono(serverConfig, credentialStores) {
|
|
|
8950
8948
|
);
|
|
8951
8949
|
}
|
|
8952
8950
|
} else {
|
|
8953
|
-
const logger23 = getLogger();
|
|
8954
8951
|
if (logger23) {
|
|
8955
8952
|
logger23.error(
|
|
8956
8953
|
{
|
|
@@ -8969,7 +8966,6 @@ function createExecutionHono(serverConfig, credentialStores) {
|
|
|
8969
8966
|
const response = err.getResponse();
|
|
8970
8967
|
return response;
|
|
8971
8968
|
} catch (responseError) {
|
|
8972
|
-
const logger23 = getLogger();
|
|
8973
8969
|
if (logger23) {
|
|
8974
8970
|
logger23.error({ error: responseError }, "Error while handling HTTPException response");
|
|
8975
8971
|
}
|
|
@@ -9014,6 +9010,7 @@ function createExecutionHono(serverConfig, credentialStores) {
|
|
|
9014
9010
|
const body = await c.req.json();
|
|
9015
9011
|
conversationId = body?.conversationId;
|
|
9016
9012
|
} catch (_) {
|
|
9013
|
+
logger23.debug("Conversation ID not found in JSON body");
|
|
9017
9014
|
}
|
|
9018
9015
|
}
|
|
9019
9016
|
const entries = Object.fromEntries(
|
|
@@ -9059,6 +9056,22 @@ function createExecutionHono(serverConfig, credentialStores) {
|
|
|
9059
9056
|
app6.route("/v1/mcp", mcp_default);
|
|
9060
9057
|
app6.route("/agents", agents_default);
|
|
9061
9058
|
setupOpenAPIRoutes(app6);
|
|
9059
|
+
app6.use("/tenants/*", async (c, next) => {
|
|
9060
|
+
await next();
|
|
9061
|
+
await batchProcessor.forceFlush();
|
|
9062
|
+
});
|
|
9063
|
+
app6.use("/agents/*", async (c, next) => {
|
|
9064
|
+
await next();
|
|
9065
|
+
await batchProcessor.forceFlush();
|
|
9066
|
+
});
|
|
9067
|
+
app6.use("/v1/*", async (c, next) => {
|
|
9068
|
+
await next();
|
|
9069
|
+
await batchProcessor.forceFlush();
|
|
9070
|
+
});
|
|
9071
|
+
app6.use("/api/*", async (c, next) => {
|
|
9072
|
+
await next();
|
|
9073
|
+
await batchProcessor.forceFlush();
|
|
9074
|
+
});
|
|
9062
9075
|
const baseApp = new hono.Hono();
|
|
9063
9076
|
baseApp.route("/", app6);
|
|
9064
9077
|
return baseApp;
|
package/dist/index.js
CHANGED
|
@@ -34,17 +34,15 @@ import { toReqRes, toFetchResponse } from 'fetch-to-node';
|
|
|
34
34
|
|
|
35
35
|
var maxExportBatchSize = env.OTEL_MAX_EXPORT_BATCH_SIZE ?? (env.ENVIRONMENT === "development" ? 1 : 512);
|
|
36
36
|
var otlpExporter = new OTLPTraceExporter();
|
|
37
|
+
var batchProcessor = new BatchSpanProcessor(otlpExporter, {
|
|
38
|
+
maxExportBatchSize
|
|
39
|
+
});
|
|
37
40
|
var resource = resourceFromAttributes({
|
|
38
41
|
[ATTR_SERVICE_NAME]: "inkeep-agents-run-api"
|
|
39
42
|
});
|
|
40
43
|
var sdk = new NodeSDK({
|
|
41
44
|
resource,
|
|
42
|
-
spanProcessors: [
|
|
43
|
-
new BaggageSpanProcessor(ALLOW_ALL_BAGGAGE_KEYS),
|
|
44
|
-
new BatchSpanProcessor(otlpExporter, {
|
|
45
|
-
maxExportBatchSize
|
|
46
|
-
})
|
|
47
|
-
],
|
|
45
|
+
spanProcessors: [new BaggageSpanProcessor(ALLOW_ALL_BAGGAGE_KEYS), batchProcessor],
|
|
48
46
|
instrumentations: [
|
|
49
47
|
getNodeAutoInstrumentations({
|
|
50
48
|
"@opentelemetry/instrumentation-http": {
|
|
@@ -8526,6 +8524,7 @@ app4.delete("/", async (c) => {
|
|
|
8526
8524
|
var mcp_default = app4;
|
|
8527
8525
|
|
|
8528
8526
|
// src/app.ts
|
|
8527
|
+
var logger23 = getLogger("agents-run-api");
|
|
8529
8528
|
function createExecutionHono(serverConfig, credentialStores) {
|
|
8530
8529
|
const app6 = new OpenAPIHono();
|
|
8531
8530
|
app6.use("*", requestId());
|
|
@@ -8549,7 +8548,7 @@ function createExecutionHono(serverConfig, credentialStores) {
|
|
|
8549
8548
|
});
|
|
8550
8549
|
app6.use(
|
|
8551
8550
|
pinoLogger({
|
|
8552
|
-
pino:
|
|
8551
|
+
pino: logger23 || pino({ level: "debug" }),
|
|
8553
8552
|
http: {
|
|
8554
8553
|
onResLevel(c) {
|
|
8555
8554
|
if (c.res.status >= 500) {
|
|
@@ -8593,7 +8592,6 @@ function createExecutionHono(serverConfig, credentialStores) {
|
|
|
8593
8592
|
if (!isExpectedError) {
|
|
8594
8593
|
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
8595
8594
|
const errorStack = err instanceof Error ? err.stack : void 0;
|
|
8596
|
-
const logger23 = getLogger();
|
|
8597
8595
|
if (logger23) {
|
|
8598
8596
|
logger23.error(
|
|
8599
8597
|
{
|
|
@@ -8607,7 +8605,6 @@ function createExecutionHono(serverConfig, credentialStores) {
|
|
|
8607
8605
|
);
|
|
8608
8606
|
}
|
|
8609
8607
|
} else {
|
|
8610
|
-
const logger23 = getLogger();
|
|
8611
8608
|
if (logger23) {
|
|
8612
8609
|
logger23.error(
|
|
8613
8610
|
{
|
|
@@ -8626,7 +8623,6 @@ function createExecutionHono(serverConfig, credentialStores) {
|
|
|
8626
8623
|
const response = err.getResponse();
|
|
8627
8624
|
return response;
|
|
8628
8625
|
} catch (responseError) {
|
|
8629
|
-
const logger23 = getLogger();
|
|
8630
8626
|
if (logger23) {
|
|
8631
8627
|
logger23.error({ error: responseError }, "Error while handling HTTPException response");
|
|
8632
8628
|
}
|
|
@@ -8671,6 +8667,7 @@ function createExecutionHono(serverConfig, credentialStores) {
|
|
|
8671
8667
|
const body = await c.req.json();
|
|
8672
8668
|
conversationId = body?.conversationId;
|
|
8673
8669
|
} catch (_) {
|
|
8670
|
+
logger23.debug("Conversation ID not found in JSON body");
|
|
8674
8671
|
}
|
|
8675
8672
|
}
|
|
8676
8673
|
const entries = Object.fromEntries(
|
|
@@ -8716,6 +8713,22 @@ function createExecutionHono(serverConfig, credentialStores) {
|
|
|
8716
8713
|
app6.route("/v1/mcp", mcp_default);
|
|
8717
8714
|
app6.route("/agents", agents_default);
|
|
8718
8715
|
setupOpenAPIRoutes(app6);
|
|
8716
|
+
app6.use("/tenants/*", async (c, next) => {
|
|
8717
|
+
await next();
|
|
8718
|
+
await batchProcessor.forceFlush();
|
|
8719
|
+
});
|
|
8720
|
+
app6.use("/agents/*", async (c, next) => {
|
|
8721
|
+
await next();
|
|
8722
|
+
await batchProcessor.forceFlush();
|
|
8723
|
+
});
|
|
8724
|
+
app6.use("/v1/*", async (c, next) => {
|
|
8725
|
+
await next();
|
|
8726
|
+
await batchProcessor.forceFlush();
|
|
8727
|
+
});
|
|
8728
|
+
app6.use("/api/*", async (c, next) => {
|
|
8729
|
+
await next();
|
|
8730
|
+
await batchProcessor.forceFlush();
|
|
8731
|
+
});
|
|
8719
8732
|
const baseApp = new Hono();
|
|
8720
8733
|
baseApp.route("/", app6);
|
|
8721
8734
|
return baseApp;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/agents-run-api",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20250913000214",
|
|
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",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"traverse": "^0.6.11",
|
|
44
44
|
"ts-pattern": "^5.7.1",
|
|
45
45
|
"zod": "^4.1.5",
|
|
46
|
-
"@inkeep/agents-core": "^0.0.0-dev-
|
|
46
|
+
"@inkeep/agents-core": "^0.0.0-dev-20250913000214"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@hono/vite-dev-server": "^0.20.1",
|