agents 0.17.3 → 0.18.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.
Files changed (47) hide show
  1. package/dist/{agent-tool-types-CNyE1iz_.d.ts → agent-tool-types-BNUGGBzQ.d.ts} +191 -61
  2. package/dist/agent-tool-types.d.ts +1 -1
  3. package/dist/{agent-tools-BeOheFBK.d.ts → agent-tools-BFbzVLFc.d.ts} +2 -2
  4. package/dist/agent-tools.d.ts +1 -1
  5. package/dist/chat/index.d.ts +29 -9
  6. package/dist/chat/index.js +31 -41
  7. package/dist/chat/index.js.map +1 -1
  8. package/dist/chat/react.d.ts +25 -1
  9. package/dist/chat/react.js +249 -93
  10. package/dist/chat/react.js.map +1 -1
  11. package/dist/chat-sdk/index.d.ts +1 -1
  12. package/dist/{client-BZ-B3NhC.js → client-CcjiFpTf.js} +352 -81
  13. package/dist/client-CcjiFpTf.js.map +1 -0
  14. package/dist/client.d.ts +1 -1
  15. package/dist/cloudflare-BldFV0Pa.js +117 -0
  16. package/dist/cloudflare-BldFV0Pa.js.map +1 -0
  17. package/dist/index.d.ts +13 -11
  18. package/dist/index.js +153 -48
  19. package/dist/index.js.map +1 -1
  20. package/dist/mcp/client.d.ts +18 -14
  21. package/dist/mcp/client.js +1 -1
  22. package/dist/mcp/index.d.ts +38 -30
  23. package/dist/mcp/index.js +1 -1
  24. package/dist/mcp/index.js.map +1 -1
  25. package/dist/observability/ai/index.d.ts +155 -0
  26. package/dist/observability/ai/index.js +1845 -0
  27. package/dist/observability/ai/index.js.map +1 -0
  28. package/dist/react.d.ts +1 -1
  29. package/dist/{retries-CvHJwSuh.d.ts → retries-CAvxtG9d.d.ts} +16 -7
  30. package/dist/retries.d.ts +8 -6
  31. package/dist/retries.js +20 -2
  32. package/dist/retries.js.map +1 -1
  33. package/dist/serializable.d.ts +1 -1
  34. package/dist/sub-routing.d.ts +6 -6
  35. package/dist/vite.d.ts +4 -4
  36. package/dist/vite.js +4 -2
  37. package/dist/vite.js.map +1 -1
  38. package/dist/{wire-types-nflOzNuU.js → wire-types-CU9rLoeS.js} +33 -2
  39. package/dist/wire-types-CU9rLoeS.js.map +1 -0
  40. package/dist/workflows.d.ts +1 -1
  41. package/docs/agent-class.md +9 -1
  42. package/docs/configuration.md +20 -0
  43. package/docs/mcp-client.md +52 -4
  44. package/docs/observability.md +282 -0
  45. package/package.json +7 -2
  46. package/dist/client-BZ-B3NhC.js.map +0 -1
  47. package/dist/wire-types-nflOzNuU.js.map +0 -1
@@ -0,0 +1,155 @@
1
+ //#region src/observability/ai/options.d.ts
2
+ /** Opt-in span payload storage. Both flags default to `false`. */
3
+ type AISDKStorageOptions = {
4
+ readonly storeMessages?: boolean;
5
+ readonly storeTools?: boolean;
6
+ };
7
+ /** Instrumentation options for the AI SDK v6 adapter. */
8
+ type AISDKInstrumentationOptions = AISDKStorageOptions & {
9
+ /** AI SDK v6 `experimental_context` keys to emit as scalar attributes. */ readonly includeRuntimeContext?: readonly string[];
10
+ };
11
+ //#endregion
12
+ //#region src/observability/ai/v7/types.d.ts
13
+ /** Common AI SDK v7 telemetry callback options this adapter reads. */
14
+ type AISDKV7TelemetryOptions = {
15
+ readonly functionId?: string | undefined;
16
+ };
17
+ /** AI SDK v7 operation lifecycle event shape consumed by this adapter. */
18
+ type AISDKV7OperationEvent = AISDKV7TelemetryOptions & {
19
+ readonly callId: string;
20
+ readonly finishReason?: unknown;
21
+ readonly frequencyPenalty?: unknown;
22
+ readonly maxOutputTokens?: unknown;
23
+ readonly maxTokens?: unknown;
24
+ readonly messages?: unknown;
25
+ readonly modelId?: string | undefined;
26
+ readonly object?: unknown;
27
+ readonly operationId?: string | undefined;
28
+ readonly presencePenalty?: unknown;
29
+ readonly prompt?: unknown;
30
+ readonly provider?: string | undefined;
31
+ readonly response?: unknown;
32
+ readonly responseId?: unknown;
33
+ readonly responseModel?: unknown;
34
+ readonly runtimeContext?: unknown;
35
+ readonly seed?: unknown;
36
+ readonly temperature?: unknown;
37
+ readonly text?: unknown;
38
+ readonly toolCalls?: unknown;
39
+ readonly toolsContext?: unknown;
40
+ readonly topK?: unknown;
41
+ readonly topP?: unknown;
42
+ readonly totalUsage?: unknown;
43
+ readonly usage?: unknown;
44
+ };
45
+ /** AI SDK v7 language-model lifecycle event shape consumed by this adapter. */
46
+ type AISDKV7LanguageModelCallEvent = AISDKV7TelemetryOptions & {
47
+ readonly callId: string;
48
+ readonly content?: unknown;
49
+ readonly finishReason?: unknown;
50
+ readonly frequencyPenalty?: unknown;
51
+ readonly headers?: unknown;
52
+ readonly maxOutputTokens?: unknown;
53
+ readonly maxTokens?: unknown;
54
+ readonly messages?: unknown;
55
+ readonly modelId?: string | undefined;
56
+ readonly performance?: unknown;
57
+ readonly presencePenalty?: unknown;
58
+ readonly prompt?: unknown;
59
+ readonly provider?: string | undefined;
60
+ readonly providerMetadata?: unknown;
61
+ readonly response?: unknown;
62
+ readonly responseHeaders?: unknown;
63
+ readonly responseId?: unknown;
64
+ readonly responseModel?: unknown;
65
+ readonly seed?: unknown;
66
+ readonly temperature?: unknown;
67
+ readonly topK?: unknown;
68
+ readonly topP?: unknown;
69
+ readonly totalUsage?: unknown;
70
+ readonly usage?: unknown;
71
+ };
72
+ /** AI SDK v7 tool-call identity shape consumed by this adapter. */
73
+ type AISDKV7ToolCall = {
74
+ readonly input?: unknown;
75
+ readonly toolCallId?: string | undefined;
76
+ readonly toolName?: string | undefined;
77
+ };
78
+ /** AI SDK v7 tool-output event shape consumed by this adapter. */
79
+ type AISDKV7ToolOutput = {
80
+ readonly error?: unknown;
81
+ readonly output?: unknown;
82
+ readonly type?: string | undefined;
83
+ };
84
+ /** AI SDK v7 tool lifecycle event shape consumed by this adapter. */
85
+ type AISDKV7ToolExecutionEvent = AISDKV7TelemetryOptions & {
86
+ readonly callId: string;
87
+ readonly toolCall: AISDKV7ToolCall;
88
+ readonly toolContext?: unknown;
89
+ readonly toolOutput?: AISDKV7ToolOutput | undefined;
90
+ };
91
+ /** AI SDK v7 abort event shape consumed by this adapter. */
92
+ type AISDKV7AbortEvent = {
93
+ readonly callId: string;
94
+ readonly reason?: unknown;
95
+ };
96
+ /** AI SDK v7 model-call execution hook shape consumed by this adapter. */
97
+ type AISDKV7ExecuteLanguageModelOptions<T> = {
98
+ readonly callId: string;
99
+ readonly execute: () => PromiseLike<T>;
100
+ };
101
+ /** AI SDK v7 tool execution hook shape consumed by this adapter. */
102
+ type AISDKV7ExecuteToolOptions<T> = {
103
+ readonly callId: string;
104
+ readonly execute: () => PromiseLike<T>;
105
+ readonly toolCallId: string;
106
+ };
107
+ /** Structural AI SDK v7 telemetry object returned by this package. */
108
+ type AISDKV7Telemetry = {
109
+ readonly executeLanguageModelCall?: <T>(
110
+ options: AISDKV7ExecuteLanguageModelOptions<T>
111
+ ) => PromiseLike<T>;
112
+ readonly executeTool?: <T>(
113
+ options: AISDKV7ExecuteToolOptions<T>
114
+ ) => PromiseLike<T>;
115
+ readonly onAbort?: (event: AISDKV7AbortEvent) => void | PromiseLike<void>;
116
+ readonly onEnd?: (event: AISDKV7OperationEvent) => void | PromiseLike<void>;
117
+ readonly onError?: (event: unknown) => void | PromiseLike<void>;
118
+ readonly onLanguageModelCallEnd?: (
119
+ event: AISDKV7LanguageModelCallEvent
120
+ ) => void | PromiseLike<void>;
121
+ readonly onLanguageModelCallStart?: (
122
+ event: AISDKV7LanguageModelCallEvent
123
+ ) => void | PromiseLike<void>;
124
+ readonly onStart?: (event: AISDKV7OperationEvent) => void | PromiseLike<void>;
125
+ readonly onToolExecutionEnd?: (
126
+ event: AISDKV7ToolExecutionEvent
127
+ ) => void | PromiseLike<void>;
128
+ readonly onToolExecutionStart?: (
129
+ event: AISDKV7ToolExecutionEvent
130
+ ) => void | PromiseLike<void>;
131
+ };
132
+ //#endregion
133
+ //#region src/observability/ai/index.d.ts
134
+ /**
135
+ * Wraps an AI SDK namespace with tracing.
136
+ */
137
+ declare function wrapAISDK<T extends Record<string, unknown>>(
138
+ ai: T,
139
+ options?: AISDKInstrumentationOptions
140
+ ): T;
141
+ /**
142
+ * Creates an AI SDK v7 telemetry adapter for use with `registerTelemetry` or
143
+ * per-call telemetry configuration.
144
+ */
145
+ declare function createAISDKTelemetry(
146
+ options?: AISDKStorageOptions
147
+ ): AISDKV7Telemetry;
148
+ //#endregion
149
+ export {
150
+ type AISDKInstrumentationOptions,
151
+ type AISDKStorageOptions,
152
+ createAISDKTelemetry,
153
+ wrapAISDK
154
+ };
155
+ //# sourceMappingURL=index.d.ts.map