@dexto/core 1.12.1 → 1.13.0
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/agent/DextoAgent.d.ts +2 -5
- package/dist/agent/DextoAgent.d.ts.map +1 -1
- package/dist/approval/index.cjs +4 -2
- package/dist/approval/index.d.ts +1 -1
- package/dist/approval/index.d.ts.map +1 -1
- package/dist/approval/index.js +3 -2
- package/dist/approval/manager.cjs +23 -4
- package/dist/approval/manager.d.ts +3 -2
- package/dist/approval/manager.d.ts.map +1 -1
- package/dist/approval/manager.js +21 -3
- package/dist/approval/schemas.cjs +5 -0
- package/dist/approval/schemas.d.ts +8 -0
- package/dist/approval/schemas.d.ts.map +1 -1
- package/dist/approval/schemas.js +5 -0
- package/dist/approval/types.d.ts +2 -2
- package/dist/approval/types.d.ts.map +1 -1
- package/dist/events/index.d.ts +2 -0
- package/dist/events/index.d.ts.map +1 -1
- package/dist/llm/executor/turn-executor.cjs +13 -20
- package/dist/llm/executor/turn-executor.d.ts +0 -1
- package/dist/llm/executor/turn-executor.d.ts.map +1 -1
- package/dist/llm/executor/turn-executor.js +13 -20
- package/dist/mcp/errors.cjs +9 -0
- package/dist/mcp/errors.d.ts +4 -0
- package/dist/mcp/errors.d.ts.map +1 -1
- package/dist/mcp/errors.js +9 -0
- package/dist/mcp/manager.cjs +79 -3
- package/dist/mcp/manager.d.ts +14 -7
- package/dist/mcp/manager.d.ts.map +1 -1
- package/dist/mcp/manager.js +79 -3
- package/dist/mcp/mcp-client.cjs +52 -62
- package/dist/mcp/mcp-client.d.ts.map +1 -1
- package/dist/mcp/mcp-client.js +54 -63
- package/dist/storage/tool-executions/types.cjs +12 -8
- package/dist/storage/tool-executions/types.d.ts +9 -0
- package/dist/storage/tool-executions/types.d.ts.map +1 -1
- package/dist/storage/tool-executions/types.js +12 -8
- package/dist/telemetry/decorators.cjs +47 -23
- package/dist/telemetry/decorators.d.ts +6 -0
- package/dist/telemetry/decorators.d.ts.map +1 -1
- package/dist/telemetry/decorators.js +47 -23
- package/dist/telemetry/operation-span.cjs +5 -2
- package/dist/telemetry/operation-span.d.ts +3 -0
- package/dist/telemetry/operation-span.d.ts.map +1 -1
- package/dist/telemetry/operation-span.js +5 -2
- package/dist/tools/approval/tool-approval-policy.cjs +11 -1
- package/dist/tools/approval/tool-approval-policy.d.ts +2 -2
- package/dist/tools/approval/tool-approval-policy.d.ts.map +1 -1
- package/dist/tools/approval/tool-approval-policy.js +11 -1
- package/dist/tools/identity.cjs +36 -0
- package/dist/tools/identity.d.ts +6 -0
- package/dist/tools/identity.d.ts.map +1 -0
- package/dist/tools/identity.js +13 -0
- package/dist/tools/index.cjs +2 -0
- package/dist/tools/index.d.ts +2 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +4 -1
- package/dist/tools/presentation/tool-presentation.d.ts +5 -0
- package/dist/tools/presentation/tool-presentation.d.ts.map +1 -1
- package/dist/tools/schema-fingerprint.cjs +48 -0
- package/dist/tools/schema-fingerprint.d.ts +4 -0
- package/dist/tools/schema-fingerprint.d.ts.map +1 -0
- package/dist/tools/schema-fingerprint.js +25 -0
- package/dist/tools/schemas.cjs +3 -0
- package/dist/tools/schemas.d.ts +1 -0
- package/dist/tools/schemas.d.ts.map +1 -1
- package/dist/tools/schemas.js +2 -0
- package/dist/tools/tool-manager.cjs +160 -43
- package/dist/tools/tool-manager.d.ts +20 -11
- package/dist/tools/tool-manager.d.ts.map +1 -1
- package/dist/tools/tool-manager.js +160 -43
- package/dist/tools/types.d.ts +48 -0
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/utils/schema.cjs +2 -2
- package/dist/utils/schema.d.ts +1 -1
- package/dist/utils/schema.d.ts.map +1 -1
- package/dist/utils/schema.js +2 -2
- package/dist/utils/stable-fingerprint.cjs +32 -0
- package/dist/utils/stable-fingerprint.d.ts +3 -0
- package/dist/utils/stable-fingerprint.d.ts.map +1 -0
- package/dist/utils/stable-fingerprint.js +9 -0
- package/package.json +9 -2
package/dist/mcp/mcp-client.cjs
CHANGED
|
@@ -34,8 +34,7 @@ var import_types2 = require("../approval/types.js");
|
|
|
34
34
|
var import_errors = require("./errors.js");
|
|
35
35
|
var import_types3 = require("@modelcontextprotocol/sdk/types.js");
|
|
36
36
|
var import_api = require("@opentelemetry/api");
|
|
37
|
-
var
|
|
38
|
-
var import_safe_stringify = require("../utils/safe-stringify.js");
|
|
37
|
+
var import_operation_span = require("../telemetry/operation-span.js");
|
|
39
38
|
const UI_EXTENSION_NAME = "io.modelcontextprotocol/ui";
|
|
40
39
|
const UI_EXTENSION_MIME_TYPE = "text/html;profile=mcp-app";
|
|
41
40
|
function buildClientCapabilities() {
|
|
@@ -49,6 +48,19 @@ function buildClientCapabilities() {
|
|
|
49
48
|
}
|
|
50
49
|
};
|
|
51
50
|
}
|
|
51
|
+
function mcpToolFailureMessage(name, result) {
|
|
52
|
+
const parsed = import_types3.CallToolResultSchema.safeParse(result);
|
|
53
|
+
if (!parsed.success) {
|
|
54
|
+
return `MCP tool '${name}' failed.`;
|
|
55
|
+
}
|
|
56
|
+
const messages = [];
|
|
57
|
+
for (const content of parsed.data.content) {
|
|
58
|
+
if (content.type === "text") {
|
|
59
|
+
messages.push(content.text);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return messages.join("\n") || `MCP tool '${name}' failed.`;
|
|
63
|
+
}
|
|
52
64
|
class DextoMcpClient extends import_events.EventEmitter {
|
|
53
65
|
toolInvocationContext = new import_async_hooks.AsyncLocalStorage();
|
|
54
66
|
client = null;
|
|
@@ -327,70 +339,46 @@ class DextoMcpClient extends import_events.EventEmitter {
|
|
|
327
339
|
async callTool(name, args, invocation) {
|
|
328
340
|
this.ensureConnected();
|
|
329
341
|
return await this.toolInvocationContext.run(invocation, async () => {
|
|
330
|
-
const shouldTrace = (0, import_utils.hasActiveTelemetry)();
|
|
331
|
-
const tracer = shouldTrace ? import_api.trace.getTracer("dexto") : null;
|
|
332
|
-
const span = tracer?.startSpan(`mcp.tool.${name}`, {
|
|
333
|
-
kind: import_api.SpanKind.CLIENT
|
|
334
|
-
});
|
|
335
342
|
try {
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
toolArgs =
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
if (key === "data" && typeof value === "string" && value.length > 100) {
|
|
367
|
-
return `[Base64 data: ${value.length} chars]`;
|
|
343
|
+
return await (0, import_operation_span.recordOperationSpan)(
|
|
344
|
+
{
|
|
345
|
+
attributes: {
|
|
346
|
+
"tool.name": name,
|
|
347
|
+
"tool.server": this.serverAlias || "unknown",
|
|
348
|
+
"tool.timeout": this.timeout
|
|
349
|
+
},
|
|
350
|
+
captureErrors: false,
|
|
351
|
+
componentName: "DextoMcpClient",
|
|
352
|
+
name: `mcp.tool.${name}`,
|
|
353
|
+
spanKind: import_api.SpanKind.CLIENT
|
|
354
|
+
},
|
|
355
|
+
async () => {
|
|
356
|
+
this.logger.debug(`Calling tool '${name}'`);
|
|
357
|
+
let toolArgs = args;
|
|
358
|
+
if (typeof args === "string") {
|
|
359
|
+
try {
|
|
360
|
+
toolArgs = JSON.parse(args);
|
|
361
|
+
} catch {
|
|
362
|
+
toolArgs = { input: args };
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
this.logger.debug(`Using timeout: ${this.timeout}`);
|
|
366
|
+
const result = await this.client.callTool(
|
|
367
|
+
{ name, arguments: toolArgs },
|
|
368
|
+
void 0,
|
|
369
|
+
{ timeout: this.timeout }
|
|
370
|
+
);
|
|
371
|
+
if (result.isError === true) {
|
|
372
|
+
throw new Error(mcpToolFailureMessage(name, result));
|
|
368
373
|
}
|
|
369
|
-
|
|
374
|
+
this.logger.debug(`Tool '${name}' completed`);
|
|
375
|
+
return result ?? "Tool executed successfully with no result data.";
|
|
370
376
|
},
|
|
371
|
-
|
|
377
|
+
this.logger
|
|
372
378
|
);
|
|
373
|
-
this.logger.debug(`Tool '${name}' result: ${logResult}`);
|
|
374
|
-
if (span) {
|
|
375
|
-
span.setAttribute("tool.result", (0, import_safe_stringify.safeStringify)(result, 4096));
|
|
376
|
-
span.setStatus({ code: import_api.SpanStatusCode.OK });
|
|
377
|
-
}
|
|
378
|
-
if (result === null || result === void 0) {
|
|
379
|
-
return "Tool executed successfully with no result data.";
|
|
380
|
-
}
|
|
381
|
-
return result;
|
|
382
379
|
} catch (error) {
|
|
383
|
-
this.logger.error(`Tool call '${name}' failed
|
|
384
|
-
|
|
385
|
-
span.recordException(error);
|
|
386
|
-
span.setStatus({
|
|
387
|
-
code: import_api.SpanStatusCode.ERROR,
|
|
388
|
-
message: error instanceof Error ? error.message : String(error)
|
|
389
|
-
});
|
|
390
|
-
}
|
|
391
|
-
return `Error executing tool '${name}': ${error instanceof Error ? error.message : String(error)}`;
|
|
392
|
-
} finally {
|
|
393
|
-
span?.end();
|
|
380
|
+
this.logger.error(`Tool call '${name}' failed`);
|
|
381
|
+
throw error;
|
|
394
382
|
}
|
|
395
383
|
});
|
|
396
384
|
}
|
|
@@ -415,7 +403,9 @@ class DextoMcpClient extends import_events.EventEmitter {
|
|
|
415
403
|
tools[tool.name] = {
|
|
416
404
|
description: tool.description ?? "",
|
|
417
405
|
parameters: tool.inputSchema,
|
|
418
|
-
|
|
406
|
+
...tool.outputSchema !== void 0 ? { outputSchema: tool.outputSchema } : {},
|
|
407
|
+
...tool.annotations !== void 0 ? { annotations: tool.annotations } : {},
|
|
408
|
+
...tool._meta !== void 0 ? { _meta: tool._meta } : {}
|
|
419
409
|
};
|
|
420
410
|
});
|
|
421
411
|
} else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-client.d.ts","sourceRoot":"","sources":["../../src/mcp/mcp-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAMnE,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAGtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,KAAK,EACR,wBAAwB,EAI3B,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,wBAAwB,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAExF,OAAO,KAAK,EACR,eAAe,EACf,kBAAkB,EAGlB,MAAM,EACT,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"mcp-client.d.ts","sourceRoot":"","sources":["../../src/mcp/mcp-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAMnE,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAGtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,KAAK,EACR,wBAAwB,EAI3B,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,wBAAwB,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAExF,OAAO,KAAK,EACR,eAAe,EACf,kBAAkB,EAGlB,MAAM,EAC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qBAAqB;IAK7B;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAKhC;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAK9B;;OAEG;IACH,kBAAkB,CAAC,eAAe,EAAE,eAAe,GAAG,IAAI;IAQ1D;;OAEG;IACH,OAAO,CAAC,uBAAuB;CA2GlC"}
|
package/dist/mcp/mcp-client.js
CHANGED
|
@@ -11,13 +11,13 @@ import { DextoLogComponent } from "../logger/v2/types.js";
|
|
|
11
11
|
import { ApprovalStatus } from "../approval/types.js";
|
|
12
12
|
import { MCPError } from "./errors.js";
|
|
13
13
|
import {
|
|
14
|
+
CallToolResultSchema,
|
|
14
15
|
ResourceUpdatedNotificationSchema,
|
|
15
16
|
PromptListChangedNotificationSchema,
|
|
16
17
|
ToolListChangedNotificationSchema
|
|
17
18
|
} from "@modelcontextprotocol/sdk/types.js";
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import { safeStringify } from "../utils/safe-stringify.js";
|
|
19
|
+
import { SpanKind } from "@opentelemetry/api";
|
|
20
|
+
import { recordOperationSpan } from "../telemetry/operation-span.js";
|
|
21
21
|
const UI_EXTENSION_NAME = "io.modelcontextprotocol/ui";
|
|
22
22
|
const UI_EXTENSION_MIME_TYPE = "text/html;profile=mcp-app";
|
|
23
23
|
function buildClientCapabilities() {
|
|
@@ -31,6 +31,19 @@ function buildClientCapabilities() {
|
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
+
function mcpToolFailureMessage(name, result) {
|
|
35
|
+
const parsed = CallToolResultSchema.safeParse(result);
|
|
36
|
+
if (!parsed.success) {
|
|
37
|
+
return `MCP tool '${name}' failed.`;
|
|
38
|
+
}
|
|
39
|
+
const messages = [];
|
|
40
|
+
for (const content of parsed.data.content) {
|
|
41
|
+
if (content.type === "text") {
|
|
42
|
+
messages.push(content.text);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return messages.join("\n") || `MCP tool '${name}' failed.`;
|
|
46
|
+
}
|
|
34
47
|
class DextoMcpClient extends EventEmitter {
|
|
35
48
|
toolInvocationContext = new AsyncLocalStorage();
|
|
36
49
|
client = null;
|
|
@@ -309,70 +322,46 @@ class DextoMcpClient extends EventEmitter {
|
|
|
309
322
|
async callTool(name, args, invocation) {
|
|
310
323
|
this.ensureConnected();
|
|
311
324
|
return await this.toolInvocationContext.run(invocation, async () => {
|
|
312
|
-
const shouldTrace = hasActiveTelemetry();
|
|
313
|
-
const tracer = shouldTrace ? trace.getTracer("dexto") : null;
|
|
314
|
-
const span = tracer?.startSpan(`mcp.tool.${name}`, {
|
|
315
|
-
kind: SpanKind.CLIENT
|
|
316
|
-
});
|
|
317
325
|
try {
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
toolArgs =
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
if (key === "data" && typeof value === "string" && value.length > 100) {
|
|
349
|
-
return `[Base64 data: ${value.length} chars]`;
|
|
326
|
+
return await recordOperationSpan(
|
|
327
|
+
{
|
|
328
|
+
attributes: {
|
|
329
|
+
"tool.name": name,
|
|
330
|
+
"tool.server": this.serverAlias || "unknown",
|
|
331
|
+
"tool.timeout": this.timeout
|
|
332
|
+
},
|
|
333
|
+
captureErrors: false,
|
|
334
|
+
componentName: "DextoMcpClient",
|
|
335
|
+
name: `mcp.tool.${name}`,
|
|
336
|
+
spanKind: SpanKind.CLIENT
|
|
337
|
+
},
|
|
338
|
+
async () => {
|
|
339
|
+
this.logger.debug(`Calling tool '${name}'`);
|
|
340
|
+
let toolArgs = args;
|
|
341
|
+
if (typeof args === "string") {
|
|
342
|
+
try {
|
|
343
|
+
toolArgs = JSON.parse(args);
|
|
344
|
+
} catch {
|
|
345
|
+
toolArgs = { input: args };
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
this.logger.debug(`Using timeout: ${this.timeout}`);
|
|
349
|
+
const result = await this.client.callTool(
|
|
350
|
+
{ name, arguments: toolArgs },
|
|
351
|
+
void 0,
|
|
352
|
+
{ timeout: this.timeout }
|
|
353
|
+
);
|
|
354
|
+
if (result.isError === true) {
|
|
355
|
+
throw new Error(mcpToolFailureMessage(name, result));
|
|
350
356
|
}
|
|
351
|
-
|
|
357
|
+
this.logger.debug(`Tool '${name}' completed`);
|
|
358
|
+
return result ?? "Tool executed successfully with no result data.";
|
|
352
359
|
},
|
|
353
|
-
|
|
360
|
+
this.logger
|
|
354
361
|
);
|
|
355
|
-
this.logger.debug(`Tool '${name}' result: ${logResult}`);
|
|
356
|
-
if (span) {
|
|
357
|
-
span.setAttribute("tool.result", safeStringify(result, 4096));
|
|
358
|
-
span.setStatus({ code: SpanStatusCode.OK });
|
|
359
|
-
}
|
|
360
|
-
if (result === null || result === void 0) {
|
|
361
|
-
return "Tool executed successfully with no result data.";
|
|
362
|
-
}
|
|
363
|
-
return result;
|
|
364
362
|
} catch (error) {
|
|
365
|
-
this.logger.error(`Tool call '${name}' failed
|
|
366
|
-
|
|
367
|
-
span.recordException(error);
|
|
368
|
-
span.setStatus({
|
|
369
|
-
code: SpanStatusCode.ERROR,
|
|
370
|
-
message: error instanceof Error ? error.message : String(error)
|
|
371
|
-
});
|
|
372
|
-
}
|
|
373
|
-
return `Error executing tool '${name}': ${error instanceof Error ? error.message : String(error)}`;
|
|
374
|
-
} finally {
|
|
375
|
-
span?.end();
|
|
363
|
+
this.logger.error(`Tool call '${name}' failed`);
|
|
364
|
+
throw error;
|
|
376
365
|
}
|
|
377
366
|
});
|
|
378
367
|
}
|
|
@@ -397,7 +386,9 @@ class DextoMcpClient extends EventEmitter {
|
|
|
397
386
|
tools[tool.name] = {
|
|
398
387
|
description: tool.description ?? "",
|
|
399
388
|
parameters: tool.inputSchema,
|
|
400
|
-
|
|
389
|
+
...tool.outputSchema !== void 0 ? { outputSchema: tool.outputSchema } : {},
|
|
390
|
+
...tool.annotations !== void 0 ? { annotations: tool.annotations } : {},
|
|
391
|
+
...tool._meta !== void 0 ? { _meta: tool._meta } : {}
|
|
401
392
|
};
|
|
402
393
|
});
|
|
403
394
|
} else {
|
|
@@ -29,14 +29,15 @@ __export(types_exports, {
|
|
|
29
29
|
splitToolExecutionResult: () => splitToolExecutionResult
|
|
30
30
|
});
|
|
31
31
|
module.exports = __toCommonJS(types_exports);
|
|
32
|
-
var import_crypto = require("crypto");
|
|
33
32
|
var import_zod = require("zod");
|
|
34
33
|
var import_display_types = require("../../tools/display-types.js");
|
|
35
34
|
var import_presentation_schema = require("../../tools/presentation-schema.js");
|
|
35
|
+
var import_stable_fingerprint = require("../../utils/stable-fingerprint.js");
|
|
36
36
|
const ToolExecutionIdentitySchema = import_zod.z.object({
|
|
37
37
|
runId: import_zod.z.string().min(1),
|
|
38
38
|
turnId: import_zod.z.string().min(1),
|
|
39
39
|
modelStepId: import_zod.z.string().min(1),
|
|
40
|
+
parentToolCallId: import_zod.z.string().min(1).optional(),
|
|
40
41
|
toolCallId: import_zod.z.string().min(1)
|
|
41
42
|
}).strict();
|
|
42
43
|
const ToolExecutionResultMetadataSchema = import_zod.z.object({
|
|
@@ -86,13 +87,16 @@ const ToolExecutionRecordSchema = import_zod.z.discriminatedUnion("status", [
|
|
|
86
87
|
ToolExecutionCancelledRecordSchema
|
|
87
88
|
]);
|
|
88
89
|
function createToolExecutionId(identity) {
|
|
89
|
-
const key = JSON.stringify(
|
|
90
|
-
identity.runId,
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
90
|
+
const key = JSON.stringify(
|
|
91
|
+
identity.parentToolCallId === void 0 ? [identity.runId, identity.turnId, identity.modelStepId, identity.toolCallId] : [
|
|
92
|
+
identity.runId,
|
|
93
|
+
identity.turnId,
|
|
94
|
+
identity.modelStepId,
|
|
95
|
+
identity.parentToolCallId,
|
|
96
|
+
identity.toolCallId
|
|
97
|
+
]
|
|
98
|
+
);
|
|
99
|
+
return `tool-exec-${(0, import_stable_fingerprint.stableFingerprint)(key)}`;
|
|
96
100
|
}
|
|
97
101
|
function splitToolExecutionResult(result) {
|
|
98
102
|
const resultMetadata = {};
|
|
@@ -6,6 +6,7 @@ export declare const ToolExecutionIdentitySchema: z.ZodObject<{
|
|
|
6
6
|
runId: z.ZodString;
|
|
7
7
|
turnId: z.ZodString;
|
|
8
8
|
modelStepId: z.ZodString;
|
|
9
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
9
10
|
toolCallId: z.ZodString;
|
|
10
11
|
}, z.core.$strict>;
|
|
11
12
|
export declare const ToolExecutionRunningRecordSchema: z.ZodObject<{
|
|
@@ -14,6 +15,7 @@ export declare const ToolExecutionRunningRecordSchema: z.ZodObject<{
|
|
|
14
15
|
runId: z.ZodString;
|
|
15
16
|
turnId: z.ZodString;
|
|
16
17
|
modelStepId: z.ZodString;
|
|
18
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
17
19
|
toolCallId: z.ZodString;
|
|
18
20
|
}, z.core.$strict>;
|
|
19
21
|
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
@@ -28,6 +30,7 @@ export declare const ToolExecutionCompletedRecordSchema: z.ZodObject<{
|
|
|
28
30
|
runId: z.ZodString;
|
|
29
31
|
turnId: z.ZodString;
|
|
30
32
|
modelStepId: z.ZodString;
|
|
33
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
31
34
|
toolCallId: z.ZodString;
|
|
32
35
|
}, z.core.$strict>;
|
|
33
36
|
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
@@ -186,6 +189,7 @@ export declare const ToolExecutionFailedRecordSchema: z.ZodObject<{
|
|
|
186
189
|
runId: z.ZodString;
|
|
187
190
|
turnId: z.ZodString;
|
|
188
191
|
modelStepId: z.ZodString;
|
|
192
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
189
193
|
toolCallId: z.ZodString;
|
|
190
194
|
}, z.core.$strict>;
|
|
191
195
|
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
@@ -202,6 +206,7 @@ export declare const ToolExecutionCancelledRecordSchema: z.ZodObject<{
|
|
|
202
206
|
runId: z.ZodString;
|
|
203
207
|
turnId: z.ZodString;
|
|
204
208
|
modelStepId: z.ZodString;
|
|
209
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
205
210
|
toolCallId: z.ZodString;
|
|
206
211
|
}, z.core.$strict>;
|
|
207
212
|
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
@@ -218,6 +223,7 @@ export declare const ToolExecutionRecordSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
218
223
|
runId: z.ZodString;
|
|
219
224
|
turnId: z.ZodString;
|
|
220
225
|
modelStepId: z.ZodString;
|
|
226
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
221
227
|
toolCallId: z.ZodString;
|
|
222
228
|
}, z.core.$strict>;
|
|
223
229
|
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
@@ -231,6 +237,7 @@ export declare const ToolExecutionRecordSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
231
237
|
runId: z.ZodString;
|
|
232
238
|
turnId: z.ZodString;
|
|
233
239
|
modelStepId: z.ZodString;
|
|
240
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
234
241
|
toolCallId: z.ZodString;
|
|
235
242
|
}, z.core.$strict>;
|
|
236
243
|
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
@@ -388,6 +395,7 @@ export declare const ToolExecutionRecordSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
388
395
|
runId: z.ZodString;
|
|
389
396
|
turnId: z.ZodString;
|
|
390
397
|
modelStepId: z.ZodString;
|
|
398
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
391
399
|
toolCallId: z.ZodString;
|
|
392
400
|
}, z.core.$strict>;
|
|
393
401
|
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
@@ -403,6 +411,7 @@ export declare const ToolExecutionRecordSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
403
411
|
runId: z.ZodString;
|
|
404
412
|
turnId: z.ZodString;
|
|
405
413
|
modelStepId: z.ZodString;
|
|
414
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
406
415
|
toolCallId: z.ZodString;
|
|
407
416
|
}, z.core.$strict>;
|
|
408
417
|
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/storage/tool-executions/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/storage/tool-executions/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,mBAAmB,EAA8B,MAAM,sBAAsB,CAAC;AAC5F,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAExF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAG1E,eAAO,MAAM,2BAA2B;;;;;;kBAQ3B,CAAC;AA+Bd,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;kBAElC,CAAC;AAEZ,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAA;CAAE,CAAC;AAE1D,MAAM,WAAW,kBAAkB;IAC/B,GAAG,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC,CAAC;IAC9E,KAAK,CAAC,KAAK,EAAE;QAAE,MAAM,EAAE,0BAA0B,CAAA;KAAE,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;IACxF,QAAQ,CAAC,KAAK,EAAE;QACZ,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,IAAI,CAAC;QAClB,MAAM,EAAE,mBAAmB,CAAC;KAC/B,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;IAC1C,IAAI,CAAC,KAAK,EAAE;QACR,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,IAAI,CAAC;QAClB,KAAK,EAAE,MAAM,CAAC;KACjB,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;IACvC,MAAM,CAAC,KAAK,EAAE;QACV,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,IAAI,CAAC;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;CAC7C;AAED,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,qBAAqB,GAAG,MAAM,CAc7E;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,mBAAmB,GAAG;IACnE,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,CAAC,EAAE,2BAA2B,CAAC;CAChD,CAyBA;AAED,wBAAgB,8BAA8B,CAC1C,MAAM,EAAE,4BAA4B,GACrC,mBAAmB,CAoBrB"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import "../../chunk-C6A6W6XS.js";
|
|
2
|
-
import { createHash } from "crypto";
|
|
3
2
|
import { z } from "zod";
|
|
4
3
|
import { isValidDisplayData } from "../../tools/display-types.js";
|
|
5
4
|
import { ToolPresentationSnapshotV1Schema } from "../../tools/presentation-schema.js";
|
|
5
|
+
import { stableFingerprint } from "../../utils/stable-fingerprint.js";
|
|
6
6
|
const ToolExecutionIdentitySchema = z.object({
|
|
7
7
|
runId: z.string().min(1),
|
|
8
8
|
turnId: z.string().min(1),
|
|
9
9
|
modelStepId: z.string().min(1),
|
|
10
|
+
parentToolCallId: z.string().min(1).optional(),
|
|
10
11
|
toolCallId: z.string().min(1)
|
|
11
12
|
}).strict();
|
|
12
13
|
const ToolExecutionResultMetadataSchema = z.object({
|
|
@@ -56,13 +57,16 @@ const ToolExecutionRecordSchema = z.discriminatedUnion("status", [
|
|
|
56
57
|
ToolExecutionCancelledRecordSchema
|
|
57
58
|
]);
|
|
58
59
|
function createToolExecutionId(identity) {
|
|
59
|
-
const key = JSON.stringify(
|
|
60
|
-
identity.runId,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
const key = JSON.stringify(
|
|
61
|
+
identity.parentToolCallId === void 0 ? [identity.runId, identity.turnId, identity.modelStepId, identity.toolCallId] : [
|
|
62
|
+
identity.runId,
|
|
63
|
+
identity.turnId,
|
|
64
|
+
identity.modelStepId,
|
|
65
|
+
identity.parentToolCallId,
|
|
66
|
+
identity.toolCallId
|
|
67
|
+
]
|
|
68
|
+
);
|
|
69
|
+
return `tool-exec-${stableFingerprint(key)}`;
|
|
66
70
|
}
|
|
67
71
|
function splitToolExecutionResult(result) {
|
|
68
72
|
const resultMetadata = {};
|
|
@@ -27,6 +27,9 @@ var import_utils = require("./utils.js");
|
|
|
27
27
|
var import_safe_stringify = require("../utils/safe-stringify.js");
|
|
28
28
|
var import_runtime = require("../runtime/index.js");
|
|
29
29
|
function withSpan(options) {
|
|
30
|
+
const captureArguments = options.captureArguments ?? true;
|
|
31
|
+
const captureErrors = options.captureErrors ?? true;
|
|
32
|
+
const captureResult = options.captureResult ?? true;
|
|
30
33
|
return function(_target, propertyKey, descriptor) {
|
|
31
34
|
if (!descriptor || typeof descriptor === "number") return;
|
|
32
35
|
const originalMethod = descriptor.value;
|
|
@@ -63,9 +66,14 @@ function withSpan(options) {
|
|
|
63
66
|
const effectiveHostRuntime = hostRuntime;
|
|
64
67
|
const effectiveRunId = effectiveHostRuntime?.ids?.runId ?? runId;
|
|
65
68
|
const applySpanAttributes = (span) => {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
+
if (captureArguments) {
|
|
70
|
+
args.forEach((arg, index) => {
|
|
71
|
+
span.setAttribute(
|
|
72
|
+
`${spanName}.argument.${index}`,
|
|
73
|
+
(0, import_safe_stringify.safeStringify)(arg, 8192)
|
|
74
|
+
);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
69
77
|
if (sessionId) {
|
|
70
78
|
span.setAttribute("sessionId", sessionId);
|
|
71
79
|
span.setAttribute("baggage.sessionId", sessionId);
|
|
@@ -159,36 +167,49 @@ function withSpan(options) {
|
|
|
159
167
|
result = originalMethod.apply(this, args);
|
|
160
168
|
if (result instanceof Promise) {
|
|
161
169
|
return result.then((resolvedValue) => {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
170
|
+
if (captureResult) {
|
|
171
|
+
span.setAttribute(
|
|
172
|
+
`${spanName}.result`,
|
|
173
|
+
(0, import_safe_stringify.safeStringify)(resolvedValue, 8192)
|
|
174
|
+
);
|
|
175
|
+
}
|
|
166
176
|
return resolvedValue;
|
|
167
177
|
}).catch((error) => {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
178
|
+
if (captureErrors) {
|
|
179
|
+
span.recordException(error);
|
|
180
|
+
span.setStatus({
|
|
181
|
+
code: import_api.SpanStatusCode.ERROR,
|
|
182
|
+
message: error?.toString()
|
|
183
|
+
});
|
|
184
|
+
} else {
|
|
185
|
+
span.setStatus({ code: import_api.SpanStatusCode.ERROR });
|
|
186
|
+
}
|
|
173
187
|
throw error;
|
|
174
188
|
}).finally(() => {
|
|
175
189
|
span.end();
|
|
176
190
|
});
|
|
177
191
|
}
|
|
178
|
-
|
|
192
|
+
if (captureResult) {
|
|
193
|
+
span.setAttribute(`${spanName}.result`, (0, import_safe_stringify.safeStringify)(result, 8192));
|
|
194
|
+
}
|
|
179
195
|
return result;
|
|
180
196
|
} catch (error) {
|
|
181
197
|
const logger2 = this?.logger;
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
198
|
+
if (captureErrors) {
|
|
199
|
+
logger2?.error(
|
|
200
|
+
`withSpan: Error in method '${methodName}': ${error instanceof Error ? error.message : String(error)}`,
|
|
201
|
+
{ error }
|
|
202
|
+
);
|
|
203
|
+
span.setStatus({
|
|
204
|
+
code: import_api.SpanStatusCode.ERROR,
|
|
205
|
+
message: error instanceof Error ? error.message : "Unknown error"
|
|
206
|
+
});
|
|
207
|
+
if (error instanceof Error) {
|
|
208
|
+
span.recordException(error);
|
|
209
|
+
}
|
|
210
|
+
} else {
|
|
211
|
+
logger2?.error(`withSpan: Error in method '${methodName}'`);
|
|
212
|
+
span.setStatus({ code: import_api.SpanStatusCode.ERROR });
|
|
192
213
|
}
|
|
193
214
|
throw error;
|
|
194
215
|
} finally {
|
|
@@ -215,6 +236,9 @@ function InstrumentClass(options) {
|
|
|
215
236
|
target.prototype,
|
|
216
237
|
method,
|
|
217
238
|
withSpan({
|
|
239
|
+
captureArguments: options?.captureArguments ?? true,
|
|
240
|
+
captureErrors: options?.captureErrors ?? true,
|
|
241
|
+
captureResult: options?.captureResult ?? true,
|
|
218
242
|
spanName: options?.prefix ? `${options.prefix}.${method}` : method,
|
|
219
243
|
skipIfNoTelemetry: true,
|
|
220
244
|
spanKind: options?.spanKind || import_api.SpanKind.INTERNAL,
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { SpanKind } from '@opentelemetry/api';
|
|
2
2
|
export declare function withSpan(options: {
|
|
3
|
+
captureArguments?: boolean;
|
|
4
|
+
captureErrors?: boolean;
|
|
5
|
+
captureResult?: boolean;
|
|
3
6
|
spanName?: string;
|
|
4
7
|
componentName?: string;
|
|
5
8
|
skipIfNoTelemetry?: boolean;
|
|
@@ -7,6 +10,9 @@ export declare function withSpan(options: {
|
|
|
7
10
|
tracerName?: string;
|
|
8
11
|
}): any;
|
|
9
12
|
export declare function InstrumentClass(options?: {
|
|
13
|
+
captureArguments?: boolean;
|
|
14
|
+
captureErrors?: boolean;
|
|
15
|
+
captureResult?: boolean;
|
|
10
16
|
prefix?: string;
|
|
11
17
|
componentName?: string;
|
|
12
18
|
spanKind?: SpanKind;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../src/telemetry/decorators.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,QAAQ,EAKX,MAAM,oBAAoB,CAAC;AAO5B,wBAAgB,QAAQ,CAAC,OAAO,EAAE;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,GAAG,
|
|
1
|
+
{"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../src/telemetry/decorators.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,QAAQ,EAKX,MAAM,oBAAoB,CAAC;AAO5B,wBAAgB,QAAQ,CAAC,OAAO,EAAE;IAC9B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,C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