@inkeep/agents-run-api 0.14.1 → 0.14.3
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 → chunk-USFUAR3Y.js} +14 -3
- package/dist/index.cjs +244 -221
- package/dist/index.js +10 -1
- package/dist/instrumentation.cjs +15 -1
- package/dist/instrumentation.d.cts +2 -2
- package/dist/instrumentation.d.ts +2 -2
- package/dist/instrumentation.js +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defaultBatchProcessor } from './chunk-
|
|
1
|
+
import { defaultBatchProcessor } from './chunk-USFUAR3Y.js';
|
|
2
2
|
import { getLogger } from './chunk-A2S7GSHL.js';
|
|
3
3
|
import { getFormattedConversationHistory, createDefaultConversationHistoryConfig, saveA2AMessageResponse } from './chunk-F46V23RK.js';
|
|
4
4
|
import { dbClient_default, env } from './chunk-TWVQBIUL.js';
|
|
@@ -2709,6 +2709,7 @@ ${this.statusUpdateState?.config.prompt?.trim() || ""}`;
|
|
|
2709
2709
|
return { summaries: [] };
|
|
2710
2710
|
} finally {
|
|
2711
2711
|
span.end();
|
|
2712
|
+
await defaultBatchProcessor.forceFlush();
|
|
2712
2713
|
}
|
|
2713
2714
|
}
|
|
2714
2715
|
);
|
|
@@ -3127,6 +3128,7 @@ Make it specific and relevant.`;
|
|
|
3127
3128
|
);
|
|
3128
3129
|
} finally {
|
|
3129
3130
|
span.end();
|
|
3131
|
+
await defaultBatchProcessor.forceFlush();
|
|
3130
3132
|
}
|
|
3131
3133
|
}
|
|
3132
3134
|
);
|
|
@@ -3682,6 +3684,7 @@ var ResponseFormatter = class {
|
|
|
3682
3684
|
};
|
|
3683
3685
|
} finally {
|
|
3684
3686
|
span.end();
|
|
3687
|
+
await defaultBatchProcessor.forceFlush();
|
|
3685
3688
|
}
|
|
3686
3689
|
});
|
|
3687
3690
|
}
|
|
@@ -3732,6 +3735,7 @@ var ResponseFormatter = class {
|
|
|
3732
3735
|
return { text: responseText };
|
|
3733
3736
|
} finally {
|
|
3734
3737
|
span.end();
|
|
3738
|
+
await defaultBatchProcessor.forceFlush();
|
|
3735
3739
|
}
|
|
3736
3740
|
});
|
|
3737
3741
|
}
|
|
@@ -6603,6 +6607,7 @@ var Agent = class {
|
|
|
6603
6607
|
requestContext: requestContext || {},
|
|
6604
6608
|
tenantId: this.config.tenantId
|
|
6605
6609
|
});
|
|
6610
|
+
await defaultBatchProcessor.forceFlush();
|
|
6606
6611
|
const contextWithBuiltins = {
|
|
6607
6612
|
...result.resolvedContext,
|
|
6608
6613
|
$now: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -7141,6 +7146,7 @@ var Agent = class {
|
|
|
7141
7146
|
throw err;
|
|
7142
7147
|
} finally {
|
|
7143
7148
|
childSpan.end();
|
|
7149
|
+
await defaultBatchProcessor.forceFlush();
|
|
7144
7150
|
}
|
|
7145
7151
|
}
|
|
7146
7152
|
);
|
|
@@ -7571,6 +7577,7 @@ ${output}${structureHintsFormatted}`;
|
|
|
7571
7577
|
}
|
|
7572
7578
|
span.setStatus({ code: SpanStatusCode.OK });
|
|
7573
7579
|
span.end();
|
|
7580
|
+
await defaultBatchProcessor.forceFlush();
|
|
7574
7581
|
let formattedContent = response.formattedContent || null;
|
|
7575
7582
|
if (!formattedContent) {
|
|
7576
7583
|
const session = toolSessionManager.getSession(sessionId);
|
|
@@ -9122,6 +9129,7 @@ var ExecutionHandler = class {
|
|
|
9122
9129
|
throw error;
|
|
9123
9130
|
} finally {
|
|
9124
9131
|
span.end();
|
|
9132
|
+
await defaultBatchProcessor.forceFlush();
|
|
9125
9133
|
}
|
|
9126
9134
|
});
|
|
9127
9135
|
}
|
|
@@ -9643,6 +9651,7 @@ app3.openapi(chatDataStreamRoute, async (c) => {
|
|
|
9643
9651
|
dbClient: dbClient_default,
|
|
9644
9652
|
credentialStores
|
|
9645
9653
|
});
|
|
9654
|
+
await defaultBatchProcessor.forceFlush();
|
|
9646
9655
|
const lastUserMessage = body.messages.filter((m) => m.role === "user").slice(-1)[0];
|
|
9647
9656
|
const userText = typeof lastUserMessage?.content === "string" ? lastUserMessage.content : lastUserMessage?.parts?.map((p) => p.text).join("") || "";
|
|
9648
9657
|
logger22.info({ userText, lastUserMessage }, "userText");
|
package/dist/instrumentation.cjs
CHANGED
|
@@ -9,10 +9,24 @@ var resources = require('@opentelemetry/resources');
|
|
|
9
9
|
var sdkNode = require('@opentelemetry/sdk-node');
|
|
10
10
|
var sdkTraceBase = require('@opentelemetry/sdk-trace-base');
|
|
11
11
|
var semanticConventions = require('@opentelemetry/semantic-conventions');
|
|
12
|
+
var agentsCore = require('@inkeep/agents-core');
|
|
13
|
+
|
|
14
|
+
// src/instrumentation.ts
|
|
12
15
|
|
|
13
16
|
// src/instrumentation.ts
|
|
14
17
|
var otlpExporter = new exporterTraceOtlpHttp.OTLPTraceExporter();
|
|
15
|
-
var
|
|
18
|
+
var logger = agentsCore.getLogger("instrumentation");
|
|
19
|
+
function createSafeBatchProcessor() {
|
|
20
|
+
try {
|
|
21
|
+
return new sdkTraceBase.BatchSpanProcessor(otlpExporter, {
|
|
22
|
+
scheduledDelayMillis: 1e3
|
|
23
|
+
});
|
|
24
|
+
} catch (error) {
|
|
25
|
+
logger.warn({ error }, "Failed to create batch processor");
|
|
26
|
+
return new sdkTraceBase.NoopSpanProcessor();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
var defaultBatchProcessor = createSafeBatchProcessor();
|
|
16
30
|
var defaultResource = resources.resourceFromAttributes({
|
|
17
31
|
[semanticConventions.ATTR_SERVICE_NAME]: "inkeep-agents-run-api"
|
|
18
32
|
});
|
|
@@ -2,9 +2,9 @@ import * as _opentelemetry_resources from '@opentelemetry/resources';
|
|
|
2
2
|
import { AsyncLocalStorageContextManager } from '@opentelemetry/context-async-hooks';
|
|
3
3
|
import { CompositePropagator } from '@opentelemetry/core';
|
|
4
4
|
import { NodeSDKConfiguration, NodeSDK } from '@opentelemetry/sdk-node';
|
|
5
|
-
import {
|
|
5
|
+
import { SpanProcessor } from '@opentelemetry/sdk-trace-base';
|
|
6
6
|
|
|
7
|
-
declare const defaultBatchProcessor:
|
|
7
|
+
declare const defaultBatchProcessor: SpanProcessor;
|
|
8
8
|
declare const defaultResource: _opentelemetry_resources.Resource;
|
|
9
9
|
declare const defaultInstrumentations: NonNullable<NodeSDKConfiguration['instrumentations']>;
|
|
10
10
|
declare const defaultSpanProcessors: SpanProcessor[];
|
|
@@ -2,9 +2,9 @@ import * as _opentelemetry_resources from '@opentelemetry/resources';
|
|
|
2
2
|
import { AsyncLocalStorageContextManager } from '@opentelemetry/context-async-hooks';
|
|
3
3
|
import { CompositePropagator } from '@opentelemetry/core';
|
|
4
4
|
import { NodeSDKConfiguration, NodeSDK } from '@opentelemetry/sdk-node';
|
|
5
|
-
import {
|
|
5
|
+
import { SpanProcessor } from '@opentelemetry/sdk-trace-base';
|
|
6
6
|
|
|
7
|
-
declare const defaultBatchProcessor:
|
|
7
|
+
declare const defaultBatchProcessor: SpanProcessor;
|
|
8
8
|
declare const defaultResource: _opentelemetry_resources.Resource;
|
|
9
9
|
declare const defaultInstrumentations: NonNullable<NodeSDKConfiguration['instrumentations']>;
|
|
10
10
|
declare const defaultSpanProcessors: SpanProcessor[];
|
package/dist/instrumentation.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { defaultBatchProcessor, defaultContextManager, defaultInstrumentations, defaultResource, defaultSDK, defaultSpanProcessors, defaultTextMapPropagator } from './chunk-
|
|
1
|
+
export { defaultBatchProcessor, defaultContextManager, defaultInstrumentations, defaultResource, defaultSDK, defaultSpanProcessors, defaultTextMapPropagator } from './chunk-USFUAR3Y.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/agents-run-api",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.3",
|
|
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",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"traverse": "^0.6.11",
|
|
52
52
|
"ts-pattern": "^5.7.1",
|
|
53
53
|
"zod": "^4.1.11",
|
|
54
|
-
"@inkeep/agents-core": "^0.14.
|
|
54
|
+
"@inkeep/agents-core": "^0.14.3"
|
|
55
55
|
},
|
|
56
56
|
"optionalDependencies": {
|
|
57
57
|
"keytar": "^7.9.0"
|