@ai-sdk/devtools 1.0.0-canary.24 → 1.0.0-canary.27
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/client/assets/{index-DGv_Z9xV.css → index-BVPj3Knk.css} +1 -1
- package/dist/client/assets/index-DKzNaLaQ.js +190 -0
- package/dist/client/index.html +2 -2
- package/dist/index.js +3 -3
- package/package.json +21 -21
- package/src/integration.ts +3 -3
- package/src/viewer/client/utils.ts +34 -31
- package/dist/client/assets/index-DJUnsFup.js +0 -181
package/dist/client/index.html
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
href="https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500;600;700&display=swap"
|
|
11
11
|
rel="stylesheet"
|
|
12
12
|
/>
|
|
13
|
-
<script type="module" crossorigin src="/assets/index-
|
|
14
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
13
|
+
<script type="module" crossorigin src="/assets/index-DKzNaLaQ.js"></script>
|
|
14
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BVPj3Knk.css">
|
|
15
15
|
</head>
|
|
16
16
|
<body>
|
|
17
17
|
<div id="root"></div>
|
package/dist/index.js
CHANGED
|
@@ -442,9 +442,9 @@ function DevToolsTelemetry() {
|
|
|
442
442
|
let currentToolCallId = null;
|
|
443
443
|
function resolveParentInfo() {
|
|
444
444
|
if (!currentToolCallId) return void 0;
|
|
445
|
-
const
|
|
446
|
-
if (!
|
|
447
|
-
const parentState = callStates.get(
|
|
445
|
+
const toolCallContext = toolContextMap.get(currentToolCallId);
|
|
446
|
+
if (!toolCallContext) return void 0;
|
|
447
|
+
const parentState = callStates.get(toolCallContext.parentCallId);
|
|
448
448
|
if (!parentState) return void 0;
|
|
449
449
|
let latestStepId;
|
|
450
450
|
let latestStepNumber = -1;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/devtools",
|
|
3
|
-
"version": "1.0.0-canary.
|
|
3
|
+
"version": "1.0.0-canary.27",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -25,38 +25,38 @@
|
|
|
25
25
|
"bin"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@hono/node-server": "^1.
|
|
29
|
-
"hono": "^4.
|
|
30
|
-
"@ai-sdk/provider": "4.0.0-canary.
|
|
28
|
+
"@hono/node-server": "^1.19.14",
|
|
29
|
+
"hono": "^4.12.18",
|
|
30
|
+
"@ai-sdk/provider": "4.0.0-canary.18"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@radix-ui/react-collapsible": "^1.1.12",
|
|
34
34
|
"@radix-ui/react-scroll-area": "^1.2.10",
|
|
35
35
|
"@radix-ui/react-slot": "^1.2.4",
|
|
36
36
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
37
|
-
"@tailwindcss/vite": "^4.
|
|
38
|
-
"@types/node": "
|
|
39
|
-
"@types/react": "^18",
|
|
40
|
-
"@types/react-dom": "^18",
|
|
41
|
-
"@vitejs/plugin-react": "^4.
|
|
37
|
+
"@tailwindcss/vite": "^4.3.0",
|
|
38
|
+
"@types/node": "22.19.19",
|
|
39
|
+
"@types/react": "^18.3.28",
|
|
40
|
+
"@types/react-dom": "^18.3.7",
|
|
41
|
+
"@vitejs/plugin-react": "^4.7.0",
|
|
42
42
|
"class-variance-authority": "^0.7.1",
|
|
43
43
|
"clsx": "^2.1.1",
|
|
44
|
-
"concurrently": "^9.1
|
|
45
|
-
"dotenv": "^17.2
|
|
44
|
+
"concurrently": "^9.2.1",
|
|
45
|
+
"dotenv": "^17.4.2",
|
|
46
46
|
"lucide-react": "^0.556.0",
|
|
47
|
-
"react": "^
|
|
48
|
-
"react-dom": "^
|
|
49
|
-
"tailwind-merge": "^3.
|
|
50
|
-
"tailwindcss": "^4.
|
|
51
|
-
"tsup": "^8",
|
|
52
|
-
"
|
|
53
|
-
"tsx": "^4.19.2",
|
|
47
|
+
"react": "^19.2.6",
|
|
48
|
+
"react-dom": "^19.2.6",
|
|
49
|
+
"tailwind-merge": "^3.6.0",
|
|
50
|
+
"tailwindcss": "^4.3.0",
|
|
51
|
+
"tsup": "^8.5.1",
|
|
52
|
+
"tsx": "^4.22.0",
|
|
54
53
|
"tw-animate-css": "^1.4.0",
|
|
55
54
|
"typescript": "5.8.3",
|
|
56
55
|
"vaul": "^1.1.2",
|
|
57
|
-
"vite": "^6.
|
|
56
|
+
"vite": "^6.4.2",
|
|
57
|
+
"vitest": "^4.1.6",
|
|
58
58
|
"zod": "3.25.76",
|
|
59
|
-
"ai": "7.0.0-canary.
|
|
59
|
+
"ai": "7.0.0-canary.165"
|
|
60
60
|
},
|
|
61
61
|
"publishConfig": {
|
|
62
62
|
"access": "public",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"license": "Apache-2.0",
|
|
75
75
|
"sideEffects": false,
|
|
76
76
|
"engines": {
|
|
77
|
-
"node": ">=
|
|
77
|
+
"node": ">=22"
|
|
78
78
|
},
|
|
79
79
|
"keywords": [
|
|
80
80
|
"ai"
|
package/src/integration.ts
CHANGED
|
@@ -126,10 +126,10 @@ export function DevToolsTelemetry(): Telemetry {
|
|
|
126
126
|
function resolveParentInfo(): { runId: string; stepId: string } | undefined {
|
|
127
127
|
if (!currentToolCallId) return undefined;
|
|
128
128
|
|
|
129
|
-
const
|
|
130
|
-
if (!
|
|
129
|
+
const toolCallContext = toolContextMap.get(currentToolCallId);
|
|
130
|
+
if (!toolCallContext) return undefined;
|
|
131
131
|
|
|
132
|
-
const parentState = callStates.get(
|
|
132
|
+
const parentState = callStates.get(toolCallContext.parentCallId);
|
|
133
133
|
if (!parentState) return undefined;
|
|
134
134
|
|
|
135
135
|
// Find the step that is currently executing the tool call.
|
|
@@ -469,21 +469,21 @@ export function buildTraceSpans(
|
|
|
469
469
|
|
|
470
470
|
if (!hasSubParts) {
|
|
471
471
|
const stepChildRuns = childRuns.filter(
|
|
472
|
-
|
|
472
|
+
childRun => childRun.run.parent_step_id === step.id,
|
|
473
473
|
);
|
|
474
|
-
for (const
|
|
474
|
+
for (const childRun of stepChildRuns) {
|
|
475
475
|
addStepSpans(
|
|
476
|
-
|
|
476
|
+
childRun.steps,
|
|
477
477
|
depth + 1,
|
|
478
|
-
|
|
479
|
-
|
|
478
|
+
childRun.childRuns ?? [],
|
|
479
|
+
childRun.run.function_id,
|
|
480
480
|
);
|
|
481
481
|
}
|
|
482
482
|
continue;
|
|
483
483
|
}
|
|
484
484
|
|
|
485
485
|
const stepChildRuns = childRuns.filter(
|
|
486
|
-
|
|
486
|
+
childRun => childRun.run.parent_step_id === step.id,
|
|
487
487
|
);
|
|
488
488
|
const sortedChildRuns = [...stepChildRuns].sort(
|
|
489
489
|
(a, b) =>
|
|
@@ -499,7 +499,7 @@ export function buildTraceSpans(
|
|
|
499
499
|
const unmatchedChildRuns: ChildRun[] = [];
|
|
500
500
|
|
|
501
501
|
if (toolCallParts.length > 0 && sortedChildRuns.length > 0) {
|
|
502
|
-
let
|
|
502
|
+
let childRunIndex = 0;
|
|
503
503
|
for (const tc of toolCallParts) {
|
|
504
504
|
const tcId = tc.toolCallId;
|
|
505
505
|
if (!tcId) continue;
|
|
@@ -511,19 +511,19 @@ export function buildTraceSpans(
|
|
|
511
511
|
p.toolCallId === tcId,
|
|
512
512
|
);
|
|
513
513
|
|
|
514
|
-
if (tcResult &&
|
|
515
|
-
const
|
|
516
|
-
if (
|
|
514
|
+
if (tcResult && childRunIndex < sortedChildRuns.length) {
|
|
515
|
+
const childRun = sortedChildRuns[childRunIndex];
|
|
516
|
+
if (childRun) {
|
|
517
517
|
const existing = toolCallToChildRuns.get(tcId) ?? [];
|
|
518
|
-
existing.push(
|
|
518
|
+
existing.push(childRun);
|
|
519
519
|
toolCallToChildRuns.set(tcId, existing);
|
|
520
|
-
|
|
520
|
+
childRunIndex++;
|
|
521
521
|
}
|
|
522
522
|
}
|
|
523
523
|
}
|
|
524
|
-
for (let i =
|
|
525
|
-
const
|
|
526
|
-
if (
|
|
524
|
+
for (let i = childRunIndex; i < sortedChildRuns.length; i++) {
|
|
525
|
+
const childRun = sortedChildRuns[i];
|
|
526
|
+
if (childRun) unmatchedChildRuns.push(childRun);
|
|
527
527
|
}
|
|
528
528
|
} else {
|
|
529
529
|
unmatchedChildRuns.push(...sortedChildRuns);
|
|
@@ -541,18 +541,19 @@ export function buildTraceSpans(
|
|
|
541
541
|
if (tcChildRuns.length > 0) {
|
|
542
542
|
const earliest = Math.min(
|
|
543
543
|
...tcChildRuns.map(
|
|
544
|
-
|
|
544
|
+
childRun =>
|
|
545
|
+
new Date(childRun.run.started_at).getTime() - traceStart,
|
|
545
546
|
),
|
|
546
547
|
);
|
|
547
548
|
const latest = Math.max(
|
|
548
|
-
...tcChildRuns.map(
|
|
549
|
-
const
|
|
550
|
-
new Date(
|
|
551
|
-
const
|
|
549
|
+
...tcChildRuns.map(childRun => {
|
|
550
|
+
const childRunStart =
|
|
551
|
+
new Date(childRun.run.started_at).getTime() - traceStart;
|
|
552
|
+
const childRunDuration = childRun.steps.reduce(
|
|
552
553
|
(a, s) => a + (s.duration_ms || 0),
|
|
553
554
|
0,
|
|
554
555
|
);
|
|
555
|
-
return
|
|
556
|
+
return childRunStart + childRunDuration;
|
|
556
557
|
}),
|
|
557
558
|
);
|
|
558
559
|
toolTimeRanges.push({
|
|
@@ -600,11 +601,13 @@ export function buildTraceSpans(
|
|
|
600
601
|
? Object.entries(args as Record<string, unknown>)
|
|
601
602
|
.slice(0, 3)
|
|
602
603
|
.map(([, v]) => {
|
|
603
|
-
const
|
|
604
|
+
const previewText =
|
|
604
605
|
typeof v === 'string'
|
|
605
606
|
? v
|
|
606
607
|
: (JSON.stringify(v) ?? String(v));
|
|
607
|
-
return
|
|
608
|
+
return previewText.length > 30
|
|
609
|
+
? previewText.slice(0, 30) + '…'
|
|
610
|
+
: previewText;
|
|
608
611
|
})
|
|
609
612
|
.join(', ')
|
|
610
613
|
: typeof args === 'string'
|
|
@@ -640,12 +643,12 @@ export function buildTraceSpans(
|
|
|
640
643
|
toolCallId: part.toolCallId,
|
|
641
644
|
});
|
|
642
645
|
|
|
643
|
-
for (const
|
|
646
|
+
for (const childRun of tcChildRuns) {
|
|
644
647
|
addStepSpans(
|
|
645
|
-
|
|
648
|
+
childRun.steps,
|
|
646
649
|
depth + 2,
|
|
647
|
-
|
|
648
|
-
|
|
650
|
+
childRun.childRuns ?? [],
|
|
651
|
+
childRun.run.function_id,
|
|
649
652
|
);
|
|
650
653
|
}
|
|
651
654
|
|
|
@@ -687,12 +690,12 @@ export function buildTraceSpans(
|
|
|
687
690
|
});
|
|
688
691
|
}
|
|
689
692
|
|
|
690
|
-
for (const
|
|
693
|
+
for (const childRun of unmatchedChildRuns) {
|
|
691
694
|
addStepSpans(
|
|
692
|
-
|
|
695
|
+
childRun.steps,
|
|
693
696
|
depth + 1,
|
|
694
|
-
|
|
695
|
-
|
|
697
|
+
childRun.childRuns ?? [],
|
|
698
|
+
childRun.run.function_id,
|
|
696
699
|
);
|
|
697
700
|
}
|
|
698
701
|
}
|