@ai-sdk/devtools 1.0.0-beta.15 → 1.0.0-beta.16
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.d.ts +5 -5
- package/package.json +2 -2
- package/src/integration.ts +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LanguageModelV4Middleware } from '@ai-sdk/provider';
|
|
2
|
-
import {
|
|
2
|
+
import { Telemetry } from 'ai';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Factory function that creates a devtools middleware instance.
|
|
@@ -25,15 +25,15 @@ declare const devToolsMiddleware: () => LanguageModelV4Middleware;
|
|
|
25
25
|
*
|
|
26
26
|
* Usage:
|
|
27
27
|
* ```ts
|
|
28
|
-
* import {
|
|
28
|
+
* import { registerTelemetry } from 'ai';
|
|
29
29
|
* import { DevToolsTelemetry } from '@ai-sdk/devtools';
|
|
30
30
|
*
|
|
31
|
-
*
|
|
31
|
+
* registerTelemetry(DevToolsTelemetry());
|
|
32
32
|
* ```
|
|
33
33
|
*
|
|
34
|
-
* Telemetry is enabled by default — no need to set `
|
|
34
|
+
* Telemetry is enabled by default — no need to set `telemetry`
|
|
35
35
|
* unless you want to configure `functionId`, `recordInputs`, or `recordOutputs`.
|
|
36
36
|
*/
|
|
37
|
-
declare function DevToolsTelemetry():
|
|
37
|
+
declare function DevToolsTelemetry(): Telemetry;
|
|
38
38
|
|
|
39
39
|
export { DevToolsTelemetry, devToolsMiddleware };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/devtools",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.16",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"vaul": "^1.1.2",
|
|
57
57
|
"vite": "^6.0.3",
|
|
58
58
|
"zod": "3.25.76",
|
|
59
|
-
"ai": "7.0.0-beta.
|
|
59
|
+
"ai": "7.0.0-beta.111"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
62
|
"dev": "concurrently -k \"pnpm dev:api\" \"pnpm dev:client\"",
|
package/src/integration.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type {
|
|
|
6
6
|
ObjectOnStartEvent,
|
|
7
7
|
ObjectOnStepStartEvent,
|
|
8
8
|
ObjectOnStepFinishEvent,
|
|
9
|
-
|
|
9
|
+
Telemetry,
|
|
10
10
|
ToolSet,
|
|
11
11
|
} from 'ai';
|
|
12
12
|
import {
|
|
@@ -93,16 +93,16 @@ function getOperationType(operationId: string): OperationType {
|
|
|
93
93
|
*
|
|
94
94
|
* Usage:
|
|
95
95
|
* ```ts
|
|
96
|
-
* import {
|
|
96
|
+
* import { registerTelemetry } from 'ai';
|
|
97
97
|
* import { DevToolsTelemetry } from '@ai-sdk/devtools';
|
|
98
98
|
*
|
|
99
|
-
*
|
|
99
|
+
* registerTelemetry(DevToolsTelemetry());
|
|
100
100
|
* ```
|
|
101
101
|
*
|
|
102
|
-
* Telemetry is enabled by default — no need to set `
|
|
102
|
+
* Telemetry is enabled by default — no need to set `telemetry`
|
|
103
103
|
* unless you want to configure `functionId`, `recordInputs`, or `recordOutputs`.
|
|
104
104
|
*/
|
|
105
|
-
export function DevToolsTelemetry():
|
|
105
|
+
export function DevToolsTelemetry(): Telemetry {
|
|
106
106
|
if (process.env.NODE_ENV === 'production') {
|
|
107
107
|
throw new Error(
|
|
108
108
|
'@ai-sdk/devtools should not be used in production. ' +
|
|
@@ -187,7 +187,7 @@ export function DevToolsTelemetry(): TelemetryIntegration {
|
|
|
187
187
|
return state;
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
const integration:
|
|
190
|
+
const integration: Telemetry = {
|
|
191
191
|
onStart: async event => {
|
|
192
192
|
const operationId = (event as { operationId: string }).operationId;
|
|
193
193
|
|