@mastra/ai-sdk 1.12.0-alpha.0 → 1.12.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.
@@ -1,6 +1,6 @@
1
- import type { UIMessageStreamOptions as UIMessageStreamOptionsV5 } from './_types/@internal_ai-sdk-v5@0.0.95/dist/index.js';
2
- import type { UIMessageStreamOptions as UIMessageStreamOptionsV6 } from './_types/@internal_ai-v6@0.0.95/dist/index.js';
3
- import type { UIMessageStreamOptions as UIMessageStreamOptionsV7 } from './_types/@internal_ai-v7@0.0.95/dist/index.js';
1
+ import type { UIMessageStreamOptions as UIMessageStreamOptionsV5 } from './_types/@internal_ai-sdk-v5@0.0.96/dist/index.js';
2
+ import type { UIMessageStreamOptions as UIMessageStreamOptionsV6 } from './_types/@internal_ai-v6@0.0.96/dist/index.js';
3
+ import type { UIMessageStreamOptions as UIMessageStreamOptionsV7 } from './_types/@internal_ai-v7@0.0.96/dist/index.js';
4
4
  import type { AgentExecutionOptions } from '@mastra/core/agent';
5
5
  import type { Mastra } from '@mastra/core/mastra';
6
6
  import { registerApiRoute } from '@mastra/core/server';
@@ -1,6 +1,6 @@
1
- import type { InferUIMessageChunk as InferUIMessageChunkV5, UIMessage as UIMessageV5, UIMessageStreamOptions as UIMessageStreamOptionsV5 } from './_types/@internal_ai-sdk-v5@0.0.95/dist/index.js';
2
- import type { UIMessage as UIMessageV6, UIMessageStreamOptions as UIMessageStreamOptionsV6 } from './_types/@internal_ai-v6@0.0.95/dist/index.js';
3
- import type { UIMessage as UIMessageV7, UIMessageStreamOptions as UIMessageStreamOptionsV7 } from './_types/@internal_ai-v7@0.0.95/dist/index.js';
1
+ import type { InferUIMessageChunk as InferUIMessageChunkV5, UIMessage as UIMessageV5, UIMessageStreamOptions as UIMessageStreamOptionsV5 } from './_types/@internal_ai-sdk-v5@0.0.96/dist/index.js';
2
+ import type { UIMessage as UIMessageV6, UIMessageStreamOptions as UIMessageStreamOptionsV6 } from './_types/@internal_ai-v6@0.0.96/dist/index.js';
3
+ import type { UIMessage as UIMessageV7, UIMessageStreamOptions as UIMessageStreamOptionsV7 } from './_types/@internal_ai-v7@0.0.96/dist/index.js';
4
4
  import type { MastraModelOutput, MastraAgentNetworkStream, WorkflowRunOutput } from '@mastra/core/stream';
5
5
  import type { MastraWorkflowStream, Step, WorkflowResult } from '@mastra/core/workflows';
6
6
  import type { ZodObject, ZodType } from 'zod/v4';
@@ -3,7 +3,7 @@ name: mastra-ai-sdk
3
3
  description: Documentation for @mastra/ai-sdk. Use when working with @mastra/ai-sdk APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/ai-sdk"
6
- version: "1.12.0-alpha.0"
6
+ version: "1.12.0"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,36 +1,36 @@
1
1
  {
2
- "version": "1.12.0-alpha.0",
2
+ "version": "1.12.0",
3
3
  "package": "@mastra/ai-sdk",
4
4
  "exports": {
5
5
  "assertValidHeartbeatMs": {
6
6
  "types": "dist/sse-heartbeat.d.ts",
7
7
  "implementation": "dist/index.js",
8
- "line": 11761
8
+ "line": 11768
9
9
  },
10
10
  "chatRoute": {
11
11
  "types": "dist/chat-route.d.ts",
12
12
  "implementation": "dist/index.js",
13
- "line": 12169
13
+ "line": 12176
14
14
  },
15
15
  "handleChatStream": {
16
16
  "types": "dist/chat-route.d.ts",
17
17
  "implementation": "dist/index.js",
18
- "line": 12090
18
+ "line": 12097
19
19
  },
20
20
  "handleNetworkStream": {
21
21
  "types": "dist/network-route.d.ts",
22
22
  "implementation": "dist/index.js",
23
- "line": 12564
23
+ "line": 12571
24
24
  },
25
25
  "handleWorkflowStream": {
26
26
  "types": "dist/workflow-route.d.ts",
27
27
  "implementation": "dist/index.js",
28
- "line": 12412
28
+ "line": 12419
29
29
  },
30
30
  "networkRoute": {
31
31
  "types": "dist/network-route.d.ts",
32
32
  "implementation": "dist/index.js",
33
- "line": 12635
33
+ "line": 12642
34
34
  },
35
35
  "smoothStream": {
36
36
  "types": "dist/smooth-stream.d.ts",
@@ -40,37 +40,37 @@
40
40
  "toAISdkFormat": {
41
41
  "types": "dist/to-ai-sdk-format.d.ts",
42
42
  "implementation": "dist/index.js",
43
- "line": 13489
43
+ "line": 13496
44
44
  },
45
45
  "toAISdkStream": {
46
46
  "types": "dist/convert-streams.d.ts",
47
47
  "implementation": "dist/index.js",
48
- "line": 11708
48
+ "line": 11715
49
49
  },
50
50
  "toAISdkV5Stream": {
51
51
  "types": "dist/convert-streams.d.ts",
52
52
  "implementation": "dist/index.js",
53
- "line": 11682
53
+ "line": 11689
54
54
  },
55
55
  "withMastra": {
56
56
  "types": "dist/middleware.d.ts",
57
57
  "implementation": "dist/index.js",
58
- "line": 12832
58
+ "line": 12839
59
59
  },
60
60
  "withSseHeartbeat": {
61
61
  "types": "dist/sse-heartbeat.d.ts",
62
62
  "implementation": "dist/index.js",
63
- "line": 11774
63
+ "line": 11781
64
64
  },
65
65
  "workflowRoute": {
66
66
  "types": "dist/workflow-route.d.ts",
67
67
  "implementation": "dist/index.js",
68
- "line": 12482
68
+ "line": 12489
69
69
  },
70
70
  "workflowSnapshotToStream": {
71
71
  "types": "dist/convert-snapshot.d.ts",
72
72
  "implementation": "dist/index.js",
73
- "line": 12777
73
+ "line": 12784
74
74
  }
75
75
  },
76
76
  "modules": {}
@@ -172,7 +172,7 @@ const stream = await agent.stream('message for agent')
172
172
 
173
173
  **options.clientTools** (`ToolsInput`): Tools that are executed on the 'client' side of the request. These tools do not have execute functions in the definition.
174
174
 
175
- **options.hooks** (`ToolHooks`): Per-execution hooks that run before and after tool calls. Overrides matching agent-level hooks for this execution. beforeToolCall can return { proceed: false, output } to skip the tool call.
175
+ **options.hooks** (`ToolHooks`): Per-execution hooks that run before and after tool calls, for example to log or save audit records. afterToolCall: (context) => void | Promise\<void> receives toolName, input, and output or error. beforeToolCall can return { proceed: false, output } to skip the tool call. Overrides matching agent-level hooks for this execution. See Run logic around tool calls.
176
176
 
177
177
  **options.savePerStep** (`boolean`): Save messages incrementally after each stream step completes (default: false).
178
178
 
package/dist/helpers.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { InferUIMessageChunk, ObjectStreamPart, TextStreamPart, ToolSet, UIMessage, FinishReason } from './_types/@internal_ai-sdk-v5@0.0.95/dist/index.js';
2
- import type { FinishReason as FinishReasonV6, InferUIMessageChunk as InferUIMessageChunkV6, ToolApprovalRequest, UIMessage as UIMessageV6 } from './_types/@internal_ai-v6@0.0.95/dist/index.js';
1
+ import type { InferUIMessageChunk, ObjectStreamPart, TextStreamPart, ToolSet, UIMessage, FinishReason } from './_types/@internal_ai-sdk-v5@0.0.96/dist/index.js';
2
+ import type { FinishReason as FinishReasonV6, InferUIMessageChunk as InferUIMessageChunkV6, ToolApprovalRequest, UIMessage as UIMessageV6 } from './_types/@internal_ai-v6@0.0.96/dist/index.js';
3
3
  import type { DataChunkType, ChunkType, MastraFinishReason } from '@mastra/core/stream';
4
4
  /**
5
5
  * Separator used to encode both runId and toolCallId into a single approvalId string.
@@ -50,8 +50,9 @@ type ConvertMastraChunkToAISDKOptions<OUTPUT> = {
50
50
  normalizeUsage: (usage: any) => any;
51
51
  normalizeFinishReason: (reason: MastraFinishReason) => string;
52
52
  includeRawFinishReason?: boolean;
53
+ includeToolTitle?: boolean;
53
54
  };
54
- export declare function convertMastraChunkToAISDKBase<OUTPUT = undefined>({ chunk, mode, normalizeWarnings, normalizeUsage, normalizeFinishReason, includeRawFinishReason, }: ConvertMastraChunkToAISDKOptions<OUTPUT>): OutputChunkType<OUTPUT>;
55
+ export declare function convertMastraChunkToAISDKBase<OUTPUT = undefined>({ chunk, mode, normalizeWarnings, normalizeUsage, normalizeFinishReason, includeRawFinishReason, includeToolTitle, }: ConvertMastraChunkToAISDKOptions<OUTPUT>): OutputChunkType<OUTPUT>;
55
56
  export declare function convertMastraChunkToAISDKv5<OUTPUT = undefined>({ chunk, mode, }: {
56
57
  chunk: ChunkType<OUTPUT>;
57
58
  mode?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GAChB,EAAE;IACD,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACzB,IAAI,CAAC,EAAE,UAAU,GAAG,QAAQ,CAAC;CAC9B,GAAG,eAAe,CAAC,MAAM,CAAC,GAAG,qBAAqB,GAAG,eAAe,CAAC,MAAM,CAAC,EAAE,CA6C9E;AAED,KAAK,mBAAmB,GAAG;IACzB,IAAI,EAAE,aAAa,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,GAAG,CAAC;CACb,CAAC;AAuDF,wBAAgB,uCAAuC,CAAC,UAAU,SAAS,SAAS,EAAE,EACpF,IAAI,EACJ,oBAAoB,EACpB,aAAa,EACb,WAAW,EACX,OAAO,EACP,SAAS,EACT,UAAU,EACV,iBAAiB,GAClB,EAAE;IAED,IAAI,EAAE,cAAc,CAAC,OAAO,CAAC,GAAG,qBAAqB,GAAG,aAAa,GAAG,mBAAmB,GAAG,mBAAmB,CAAC;IAClH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,MAAM,CAAC;IACpC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,GACG,mBAAmB,CAAC,UAAU,CAAC,GAC/B,qBAAqB,CAAC,WAAW,CAAC,GAClC,kBAAkB,GAClB,qBAAqB,GACrB,oBAAoB,GACpB,SAAS,CAgTZ"}
package/dist/index.cjs CHANGED
@@ -32,7 +32,7 @@ let stream_web = require("stream/web");
32
32
  let _mastra_core_agent = require("@mastra/core/agent");
33
33
  let _mastra_core_di = require("@mastra/core/di");
34
34
  let _mastra_core_processors = require("@mastra/core/processors");
35
- // ../../packages/_vendored/ai_v5/dist/dist-BYnbJEqC.js
35
+ // ../../packages/_vendored/ai_v5/dist/dist-BESblyT5.js
36
36
  var marker$1$4 = "vercel.ai.error";
37
37
  var symbol$1$4 = Symbol.for(marker$1$4);
38
38
  var _a$1$4;
@@ -3281,7 +3281,7 @@ function createUIMessageStream$2({ execute, onError = () => "An error occurred."
3281
3281
  getOutcome: () => outcome
3282
3282
  });
3283
3283
  }
3284
- // ../../packages/_vendored/ai_v6/dist/dist-DwNW4Hp7.js
3284
+ // ../../packages/_vendored/ai_v6/dist/dist-DRzIKDJV.js
3285
3285
  var marker$1$2 = "vercel.ai.error";
3286
3286
  var symbol$1$2 = Symbol.for(marker$1$2);
3287
3287
  var _a$1;
@@ -6972,7 +6972,7 @@ var doWrap = ({ model, middleware: { transformParams, wrapGenerate, wrapStream,
6972
6972
  }
6973
6973
  };
6974
6974
  };
6975
- // ../../packages/_vendored/ai_v7/dist/dist-CwN1TMYk.js
6975
+ // ../../packages/_vendored/ai_v7/dist/dist-MpcKalG3.js
6976
6976
  /**
6977
6977
  * Symbol used for identifying AI SDK Error instances.
6978
6978
  * Enables checking if an error is an instance of AISDKError across package versions.
@@ -10061,7 +10061,7 @@ function convertBackgroundTaskChunkToDataChunk(chunk) {
10061
10061
  }
10062
10062
  };
10063
10063
  }
10064
- function convertMastraChunkToAISDKBase({ chunk, mode = "stream", normalizeWarnings, normalizeUsage, normalizeFinishReason, includeRawFinishReason = false }) {
10064
+ function convertMastraChunkToAISDKBase({ chunk, mode = "stream", normalizeWarnings, normalizeUsage, normalizeFinishReason, includeRawFinishReason = false, includeToolTitle = false }) {
10065
10065
  const displayInputTransform = getTransformedToolPayload(chunk.metadata, "display", "input-available");
10066
10066
  const displayInputDeltaTransform = getTransformedToolPayload(chunk.metadata, "display", "input-delta");
10067
10067
  const displayOutputTransform = getTransformedToolPayload(chunk.metadata, "display", "output-available");
@@ -10148,6 +10148,7 @@ function convertMastraChunkToAISDKBase({ chunk, mode = "stream", normalizeWarnin
10148
10148
  providerMetadata: chunk.payload.providerMetadata,
10149
10149
  providerExecuted: chunk.payload.providerExecuted,
10150
10150
  toolName: chunk.payload.toolName,
10151
+ ...includeToolTitle && chunk.payload.title != null ? { title: chunk.payload.title } : {},
10151
10152
  input: hasTransformedToolPayload(displayInputTransform) ? displayInputTransform.transformed : chunk.payload.args,
10152
10153
  ...chunk.payload.observability ? { observability: chunk.payload.observability } : {},
10153
10154
  ...chunk.payload.toolMetadata ? { toolMetadata: chunk.payload.toolMetadata } : {}
@@ -10215,6 +10216,7 @@ function convertMastraChunkToAISDKBase({ chunk, mode = "stream", normalizeWarnin
10215
10216
  type: "tool-input-start",
10216
10217
  id: chunk.payload.toolCallId,
10217
10218
  toolName: chunk.payload.toolName,
10219
+ ...includeToolTitle && chunk.payload.title != null ? { title: chunk.payload.title } : {},
10218
10220
  dynamic: !!chunk.payload.dynamic,
10219
10221
  providerMetadata: chunk.payload.providerMetadata,
10220
10222
  providerExecuted: chunk.payload.providerExecuted,
@@ -10407,7 +10409,8 @@ function convertMastraChunkToAISDKv6({ chunk, mode = "stream" }) {
10407
10409
  normalizeWarnings: normalizeV6Warnings,
10408
10410
  normalizeUsage: normalizeV6Usage,
10409
10411
  normalizeFinishReason: toAISDKFinishReasonV6,
10410
- includeRawFinishReason: true
10412
+ includeRawFinishReason: true,
10413
+ includeToolTitle: true
10411
10414
  });
10412
10415
  }
10413
10416
  function createToolOutputAncestryEntry(toolCallId, toolName) {
@@ -10518,10 +10521,12 @@ function convertFullStreamChunkToUIMessageStream({ part, messageMetadataValue, s
10518
10521
  return;
10519
10522
  case "tool-input-start": {
10520
10523
  const toolMetadata = part.toolMetadata;
10524
+ const title = part.title;
10521
10525
  return {
10522
10526
  type: "tool-input-start",
10523
10527
  toolCallId: part.id,
10524
10528
  toolName: part.toolName,
10529
+ ...title != null ? { title } : {},
10525
10530
  ...part.providerExecuted != null ? { providerExecuted: part.providerExecuted } : {},
10526
10531
  ...part.dynamic != null ? { dynamic: part.dynamic } : {},
10527
10532
  ...toolMetadata != null ? { toolMetadata } : {}
@@ -10535,10 +10540,12 @@ function convertFullStreamChunkToUIMessageStream({ part, messageMetadataValue, s
10535
10540
  case "tool-call": {
10536
10541
  const observability = part.observability;
10537
10542
  const toolMetadata = part.toolMetadata;
10543
+ const title = part.title;
10538
10544
  return {
10539
10545
  type: "tool-input-available",
10540
10546
  toolCallId: part.toolCallId,
10541
10547
  toolName: part.toolName,
10548
+ ...title != null ? { title } : {},
10542
10549
  input: part.input,
10543
10550
  ...part.providerExecuted != null ? { providerExecuted: part.providerExecuted } : {},
10544
10551
  ...part.providerMetadata != null ? { providerMetadata: part.providerMetadata } : {},