@mastra/react 0.1.0-beta.2 → 0.1.0-beta.21

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/CHANGELOG.md CHANGED
@@ -1,5 +1,303 @@
1
1
  # @mastra/react-hooks
2
2
 
3
+ ## 0.1.0-beta.21
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies:
8
+ - @mastra/client-js@1.0.0-beta.21
9
+
10
+ ## 0.1.0-beta.20
11
+
12
+ ### Patch Changes
13
+
14
+ - Fix TypeScript errors during build declaration generation ([#11682](https://github.com/mastra-ai/mastra/pull/11682))
15
+
16
+ Updated test file `toUIMessage.test.ts` to match current `@mastra/core` types:
17
+ - Changed `error` property from string to `Error` object (per `StepFailure` type)
18
+ - Added missing `resumeSchema` property to `tool-call-approval` payloads (per `ToolCallApprovalPayload` type)
19
+ - Added `zod` as peer/dev dependency for test type support
20
+
21
+ - Fixed agent network not returning text response when routing agent handles requests without delegation. ([#11497](https://github.com/mastra-ai/mastra/pull/11497))
22
+
23
+ **What changed:**
24
+ - Agent networks now correctly stream text responses when the routing agent decides to handle a request itself instead of delegating to sub-agents, workflows, or tools
25
+ - Added fallback in transformers to ensure text is always returned even if core events are missing
26
+
27
+ **Why this matters:**
28
+ Previously, when using `toAISdkV5Stream` or `networkRoute()` outside of the Mastra Studio UI, no text content was returned when the routing agent handled requests directly. This fix ensures consistent behavior across all API routes.
29
+
30
+ Fixes #11219
31
+
32
+ - Display network completion validation results and scorer feedback in the Playground when viewing agent network runs, letting users see pass/fail status and actionable feedback from completion scorers ([#11562](https://github.com/mastra-ai/mastra/pull/11562))
33
+
34
+ - Updated dependencies [[`bc72b52`](https://github.com/mastra-ai/mastra/commit/bc72b529ee4478fe89ecd85a8be47ce0127b82a0), [`c042bd0`](https://github.com/mastra-ai/mastra/commit/c042bd0b743e0e86199d0cb83344ca7690e34a9c), [`e4d366a`](https://github.com/mastra-ai/mastra/commit/e4d366aeb500371dd4210d6aa8361a4c21d87034), [`58e3931`](https://github.com/mastra-ai/mastra/commit/58e3931af9baa5921688566210f00fb0c10479fa), [`08bb631`](https://github.com/mastra-ai/mastra/commit/08bb631ae2b14684b2678e3549d0b399a6f0561e), [`106c960`](https://github.com/mastra-ai/mastra/commit/106c960df5d110ec15ac8f45de8858597fb90ad5)]:
35
+ - @mastra/client-js@1.0.0-beta.20
36
+
37
+ ## 0.1.0-beta.19
38
+
39
+ ### Patch Changes
40
+
41
+ - Updated dependencies:
42
+ - @mastra/client-js@1.0.0-beta.19
43
+
44
+ ## 0.1.0-beta.18
45
+
46
+ ### Patch Changes
47
+
48
+ - Updated dependencies:
49
+ - @mastra/client-js@1.0.0-beta.18
50
+
51
+ ## 0.1.0-beta.17
52
+
53
+ ### Patch Changes
54
+
55
+ - Updated dependencies:
56
+ - @mastra/client-js@1.0.0-beta.17
57
+
58
+ ## 0.1.0-beta.16
59
+
60
+ ### Patch Changes
61
+
62
+ - Updated dependencies [[`6cbb549`](https://github.com/mastra-ai/mastra/commit/6cbb549475201a2fbf158f0fd7323f6495f46d08)]:
63
+ - @mastra/client-js@1.0.0-beta.16
64
+
65
+ ## 0.1.0-beta.15
66
+
67
+ ### Minor Changes
68
+
69
+ - Unified observability schema with entity-based span identification ([#11132](https://github.com/mastra-ai/mastra/pull/11132))
70
+
71
+ ## What changed
72
+
73
+ Spans now use a unified identification model with `entityId`, `entityType`, and `entityName` instead of separate `agentId`, `toolId`, `workflowId` fields.
74
+
75
+ **Before:**
76
+
77
+ ```typescript
78
+ // Old span structure
79
+ span.agentId; // 'my-agent'
80
+ span.toolId; // undefined
81
+ span.workflowId; // undefined
82
+ ```
83
+
84
+ **After:**
85
+
86
+ ```typescript
87
+ // New span structure
88
+ span.entityType; // EntityType.AGENT
89
+ span.entityId; // 'my-agent'
90
+ span.entityName; // 'My Agent'
91
+ ```
92
+
93
+ ## New `listTraces()` API
94
+
95
+ Query traces with filtering, pagination, and sorting:
96
+
97
+ ```typescript
98
+ const { spans, pagination } = await storage.listTraces({
99
+ filters: {
100
+ entityType: EntityType.AGENT,
101
+ entityId: 'my-agent',
102
+ userId: 'user-123',
103
+ environment: 'production',
104
+ status: TraceStatus.SUCCESS,
105
+ startedAt: { start: new Date('2024-01-01'), end: new Date('2024-01-31') },
106
+ },
107
+ pagination: { page: 0, perPage: 50 },
108
+ orderBy: { field: 'startedAt', direction: 'DESC' },
109
+ });
110
+ ```
111
+
112
+ **Available filters:** date ranges (`startedAt`, `endedAt`), entity (`entityType`, `entityId`, `entityName`), identity (`userId`, `organizationId`), correlation IDs (`runId`, `sessionId`, `threadId`), deployment (`environment`, `source`, `serviceName`), `tags`, `metadata`, and `status`.
113
+
114
+ ## New retrieval methods
115
+ - `getSpan({ traceId, spanId })` - Get a single span
116
+ - `getRootSpan({ traceId })` - Get the root span of a trace
117
+ - `getTrace({ traceId })` - Get all spans for a trace
118
+
119
+ ## Backward compatibility
120
+
121
+ The legacy `getTraces()` method continues to work. When you pass `name: "agent run: my-agent"`, it automatically transforms to `entityId: "my-agent", entityType: AGENT`.
122
+
123
+ ## Migration
124
+
125
+ **Automatic:** SQL-based stores (PostgreSQL, LibSQL, MSSQL) automatically add new columns to existing `spans` tables on initialization. Existing data is preserved with new columns set to `NULL`.
126
+
127
+ **No action required:** Your existing code continues to work. Adopt the new fields and `listTraces()` API at your convenience.
128
+
129
+ ### Patch Changes
130
+
131
+ - Updated dependencies [[`d90ea65`](https://github.com/mastra-ai/mastra/commit/d90ea6536f7aa51c6545a4e9215b55858e98e16d), [`d171e55`](https://github.com/mastra-ai/mastra/commit/d171e559ead9f52ec728d424844c8f7b164c4510), [`632fdb8`](https://github.com/mastra-ai/mastra/commit/632fdb8b3cd9ff6f90399256d526db439fc1758b), [`184f01d`](https://github.com/mastra-ai/mastra/commit/184f01d1f534ec0be9703d3996f2e088b4a560eb)]:
132
+ - @mastra/client-js@1.0.0-beta.15
133
+
134
+ ## 0.1.0-beta.14
135
+
136
+ ### Patch Changes
137
+
138
+ - Updated dependencies [[`66741d1`](https://github.com/mastra-ai/mastra/commit/66741d1a99c4f42cf23a16109939e8348ac6852e), [`a7ce182`](https://github.com/mastra-ai/mastra/commit/a7ce1822a8785ce45d62dd5c911af465e144f7d7)]:
139
+ - @mastra/client-js@1.0.0-beta.14
140
+
141
+ ## 0.1.0-beta.13
142
+
143
+ ### Patch Changes
144
+
145
+ - Updated dependencies:
146
+ - @mastra/client-js@1.0.0-beta.13
147
+
148
+ ## 0.1.0-beta.12
149
+
150
+ ### Patch Changes
151
+
152
+ - Remove redundant toolCalls from network agent finalResult ([#11189](https://github.com/mastra-ai/mastra/pull/11189))
153
+
154
+ The network agent's `finalResult` was storing `toolCalls` separately even though all tool call information is already present in the `messages` array (as `tool-call` and `tool-result` type messages). This caused significant token waste since the routing agent reads this data from memory on every iteration.
155
+
156
+ **Before:** `finalResult: { text, toolCalls, messages }`
157
+ **After:** `finalResult: { text, messages }`
158
+
159
+ +**Migration:** If you were accessing `finalResult.toolCalls`, retrieve tool calls from `finalResult.messages` by filtering for messages with `type: 'tool-call'`.
160
+
161
+ Updated `@mastra/react` to extract tool calls directly from the `messages` array instead of the removed `toolCalls` field when resolving initial messages from memory.
162
+
163
+ Fixes #11059
164
+
165
+ - Auto resume suspended tools if `autoResumeSuspendedTools: true` ([#11157](https://github.com/mastra-ai/mastra/pull/11157))
166
+
167
+ The flag can be added to `defaultAgentOptions` when creating the agent or to options in `agent.stream` or `agent.generate`
168
+
169
+ ```typescript
170
+ const agent = new Agent({
171
+ //...agent information,
172
+ defaultAgentOptions: {
173
+ autoResumeSuspendedTools: true,
174
+ },
175
+ });
176
+ ```
177
+
178
+ - Updated dependencies [[`9650cce`](https://github.com/mastra-ai/mastra/commit/9650cce52a1d917ff9114653398e2a0f5c3ba808), [`695a621`](https://github.com/mastra-ai/mastra/commit/695a621528bdabeb87f83c2277cf2bb084c7f2b4), [`1b85674`](https://github.com/mastra-ai/mastra/commit/1b85674123708d9b85834dccc9eae601a9d0891c), [`486352b`](https://github.com/mastra-ai/mastra/commit/486352b66c746602b68a95839f830de14c7fb8c0), [`439eaf7`](https://github.com/mastra-ai/mastra/commit/439eaf75447809b05e326666675a4dcbf9c334ce)]:
179
+ - @mastra/client-js@1.0.0-beta.12
180
+
181
+ ## 0.1.0-beta.11
182
+
183
+ ### Patch Changes
184
+
185
+ - Support new Workflow tripwire run status. Tripwires that are thrown from within a workflow will now bubble up and return a graceful state with information about tripwires. ([#10947](https://github.com/mastra-ai/mastra/pull/10947))
186
+
187
+ When a workflow contains an agent step that triggers a tripwire, the workflow returns with `status: 'tripwire'` and includes tripwire details:
188
+
189
+ ```typescript showLineNumbers copy
190
+ const run = await workflow.createRun();
191
+ const result = await run.start({ inputData: { message: 'Hello' } });
192
+
193
+ if (result.status === 'tripwire') {
194
+ console.log('Workflow terminated by tripwire:', result.tripwire?.reason);
195
+ console.log('Processor ID:', result.tripwire?.processorId);
196
+ console.log('Retry requested:', result.tripwire?.retry);
197
+ }
198
+ ```
199
+
200
+ Adds new UI state for tripwire in agent chat and workflow UI.
201
+
202
+ This is distinct from `status: 'failed'` which indicates an unexpected error. A tripwire status means a processor intentionally stopped execution (e.g., for content moderation).
203
+
204
+ - Updated dependencies [[`3bf6c5f`](https://github.com/mastra-ai/mastra/commit/3bf6c5f104c25226cd84e0c77f9dec15f2cac2db)]:
205
+ - @mastra/client-js@1.0.0-beta.11
206
+
207
+ ## 0.1.0-beta.10
208
+
209
+ ### Minor Changes
210
+
211
+ - Fix "MessagePartRuntime is not available" error when chatting with agents in Studio playground by replacing deprecated `useMessagePart` hook with `useAssistantState` ([#11039](https://github.com/mastra-ai/mastra/pull/11039))
212
+
213
+ ### Patch Changes
214
+
215
+ - fix: persist data-\* chunks from writer.custom() to memory storage ([#10884](https://github.com/mastra-ai/mastra/pull/10884))
216
+ - Add persistence for custom data chunks (`data-*` parts) emitted via `writer.custom()` in tools
217
+ - Data chunks are now saved to message storage so they survive page refreshes
218
+ - Update `@assistant-ui/react` to v0.11.47 with native `DataMessagePart` support
219
+ - Convert `data-*` parts to `DataMessagePart` format (`{ type: 'data', name: string, data: T }`)
220
+ - Update related `@assistant-ui/*` packages for compatibility
221
+
222
+ - Updated dependencies [[`261473a`](https://github.com/mastra-ai/mastra/commit/261473ac637e633064a22076671e2e02b002214d)]:
223
+ - @mastra/client-js@1.0.0-beta.10
224
+
225
+ ## 0.1.0-beta.9
226
+
227
+ ### Patch Changes
228
+
229
+ - Updated dependencies [[`5a1ede1`](https://github.com/mastra-ai/mastra/commit/5a1ede1f7ab527b9ead11f7eee2f73e67aeca9e4)]:
230
+ - @mastra/client-js@1.0.0-beta.9
231
+
232
+ ## 0.1.0-beta.8
233
+
234
+ ### Patch Changes
235
+
236
+ - Updated dependencies:
237
+ - @mastra/client-js@1.0.0-beta.8
238
+
239
+ ## 0.1.0-beta.7
240
+
241
+ ### Patch Changes
242
+
243
+ - Updated dependencies [[`5fe71bc`](https://github.com/mastra-ai/mastra/commit/5fe71bc925dfce597df69c89241f33b378028c63), [`21735a7`](https://github.com/mastra-ai/mastra/commit/21735a7ef306963554a69a89b44f06c3bcd85141)]:
244
+ - @mastra/client-js@1.0.0-beta.7
245
+
246
+ ## 0.1.0-beta.6
247
+
248
+ ### Patch Changes
249
+
250
+ - Adjust the types to accept tracingOptions ([#10742](https://github.com/mastra-ai/mastra/pull/10742))
251
+
252
+ - Updated dependencies [[`6edf340`](https://github.com/mastra-ai/mastra/commit/6edf3402f6a46ee8def2f42a2287785251fbffd6), [`ad7e8f1`](https://github.com/mastra-ai/mastra/commit/ad7e8f16ac843cbd16687ad47b66ba96bcffe111), [`e1b7118`](https://github.com/mastra-ai/mastra/commit/e1b7118f42ca0a97247afc75e57dcd5fdf987752), [`441c7b6`](https://github.com/mastra-ai/mastra/commit/441c7b6665915cfa7fd625fded8c0f518530bf10), [`e849603`](https://github.com/mastra-ai/mastra/commit/e849603a596269069f58a438b98449ea2770493d)]:
253
+ - @mastra/client-js@1.0.0-beta.6
254
+
255
+ ## 0.1.0-beta.5
256
+
257
+ ### Patch Changes
258
+
259
+ - Configurable resourceId in react useChat ([#10461](https://github.com/mastra-ai/mastra/pull/10461))
260
+
261
+ - fix(agent): persist messages before tool suspension ([#10369](https://github.com/mastra-ai/mastra/pull/10369))
262
+
263
+ Fixes issues where thread and messages were not saved before suspension when tools require approval or call suspend() during execution. This caused conversation history to be lost if users refreshed during tool approval or suspension.
264
+
265
+ **Backend changes (@mastra/core):**
266
+ - Add assistant messages to messageList immediately after LLM execution
267
+ - Flush messages synchronously before suspension to persist state
268
+ - Create thread if it doesn't exist before flushing
269
+ - Add metadata helpers to persist and remove tool approval state
270
+ - Pass saveQueueManager and memory context through workflow for immediate persistence
271
+
272
+ **Frontend changes (@mastra/react):**
273
+ - Extract runId from pending approvals to enable resumption after refresh
274
+ - Convert `pendingToolApprovals` (DB format) to `requireApprovalMetadata` (runtime format)
275
+ - Handle both `dynamic-tool` and `tool-{NAME}` part types for approval state
276
+ - Change runId from hardcoded `agentId` to unique `uuid()`
277
+
278
+ **UI changes (@mastra/playground-ui):**
279
+ - Handle tool calls awaiting approval in message initialization
280
+ - Convert approval metadata format when loading initial messages
281
+
282
+ Fixes #9745, #9906
283
+
284
+ - Updated dependencies [[`898a972`](https://github.com/mastra-ai/mastra/commit/898a9727d286c2510d6b702dfd367e6aaf5c6b0f)]:
285
+ - @mastra/client-js@1.0.0-beta.5
286
+
287
+ ## 0.1.0-beta.4
288
+
289
+ ### Patch Changes
290
+
291
+ - Updated dependencies [[`6a86fe5`](https://github.com/mastra-ai/mastra/commit/6a86fe56b8ff53ca2eb3ed87ffc0748749ebadce), [`595a3b8`](https://github.com/mastra-ai/mastra/commit/595a3b8727c901f44e333909c09843c711224440)]:
292
+ - @mastra/client-js@1.0.0-beta.4
293
+
294
+ ## 0.1.0-beta.3
295
+
296
+ ### Patch Changes
297
+
298
+ - Updated dependencies [[`e1bb9c9`](https://github.com/mastra-ai/mastra/commit/e1bb9c94b4eb68b019ae275981be3feb769b5365)]:
299
+ - @mastra/client-js@1.0.0-beta.3
300
+
3
301
  ## 0.1.0-beta.2
4
302
 
5
303
  ### Patch Changes
@@ -0,0 +1,249 @@
1
+ import { _ as __commonJS, a as __require2, r as require_token_error } from './index-Bk0KrCu7.js';
2
+
3
+ // ../_vendored/ai_v5/dist/chunk-OL3SSKUZ.js
4
+ var require_token_io = __commonJS({
5
+ "../../../node_modules/.pnpm/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/token-io.js"(exports, module) {
6
+ var __create = Object.create;
7
+ var __defProp = Object.defineProperty;
8
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
9
+ var __getOwnPropNames = Object.getOwnPropertyNames;
10
+ var __getProtoOf = Object.getPrototypeOf;
11
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
12
+ var __export = (target, all) => {
13
+ for (var name in all)
14
+ __defProp(target, name, { get: all[name], enumerable: true });
15
+ };
16
+ var __copyProps = (to, from, except, desc) => {
17
+ if (from && typeof from === "object" || typeof from === "function") {
18
+ for (let key of __getOwnPropNames(from))
19
+ if (!__hasOwnProp.call(to, key) && key !== except)
20
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
21
+ }
22
+ return to;
23
+ };
24
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25
+ // If the importer is in node compatibility mode or this is not an ESM
26
+ // file that has been converted to a CommonJS file using a Babel-
27
+ // compatible transform (i.e. "__esModule" has not been set), then set
28
+ // "default" to the CommonJS "module.exports" for node compatibility.
29
+ !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
30
+ mod
31
+ ));
32
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
33
+ var token_io_exports = {};
34
+ __export(token_io_exports, {
35
+ findRootDir: () => findRootDir,
36
+ getUserDataDir: () => getUserDataDir
37
+ });
38
+ module.exports = __toCommonJS(token_io_exports);
39
+ var import_path = __toESM(__require2("path"));
40
+ var import_fs = __toESM(__require2("fs"));
41
+ var import_os = __toESM(__require2("os"));
42
+ var import_token_error = require_token_error();
43
+ function findRootDir() {
44
+ try {
45
+ let dir = process.cwd();
46
+ while (dir !== import_path.default.dirname(dir)) {
47
+ const pkgPath = import_path.default.join(dir, ".vercel");
48
+ if (import_fs.default.existsSync(pkgPath)) {
49
+ return dir;
50
+ }
51
+ dir = import_path.default.dirname(dir);
52
+ }
53
+ } catch (e) {
54
+ throw new import_token_error.VercelOidcTokenError(
55
+ "Token refresh only supported in node server environments"
56
+ );
57
+ }
58
+ throw new import_token_error.VercelOidcTokenError("Unable to find root directory");
59
+ }
60
+ function getUserDataDir() {
61
+ if (process.env.XDG_DATA_HOME) {
62
+ return process.env.XDG_DATA_HOME;
63
+ }
64
+ switch (import_os.default.platform()) {
65
+ case "darwin":
66
+ return import_path.default.join(import_os.default.homedir(), "Library/Application Support");
67
+ case "linux":
68
+ return import_path.default.join(import_os.default.homedir(), ".local/share");
69
+ case "win32":
70
+ if (process.env.LOCALAPPDATA) {
71
+ return process.env.LOCALAPPDATA;
72
+ }
73
+ return null;
74
+ default:
75
+ return null;
76
+ }
77
+ }
78
+ }
79
+ });
80
+ var require_token_util = __commonJS({
81
+ "../../../node_modules/.pnpm/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/token-util.js"(exports, module) {
82
+ var __create = Object.create;
83
+ var __defProp = Object.defineProperty;
84
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
85
+ var __getOwnPropNames = Object.getOwnPropertyNames;
86
+ var __getProtoOf = Object.getPrototypeOf;
87
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
88
+ var __export = (target, all) => {
89
+ for (var name in all)
90
+ __defProp(target, name, { get: all[name], enumerable: true });
91
+ };
92
+ var __copyProps = (to, from, except, desc) => {
93
+ if (from && typeof from === "object" || typeof from === "function") {
94
+ for (let key of __getOwnPropNames(from))
95
+ if (!__hasOwnProp.call(to, key) && key !== except)
96
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
97
+ }
98
+ return to;
99
+ };
100
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
101
+ // If the importer is in node compatibility mode or this is not an ESM
102
+ // file that has been converted to a CommonJS file using a Babel-
103
+ // compatible transform (i.e. "__esModule" has not been set), then set
104
+ // "default" to the CommonJS "module.exports" for node compatibility.
105
+ !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
106
+ mod
107
+ ));
108
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
109
+ var token_util_exports = {};
110
+ __export(token_util_exports, {
111
+ assertVercelOidcTokenResponse: () => assertVercelOidcTokenResponse,
112
+ findProjectInfo: () => findProjectInfo,
113
+ getTokenPayload: () => getTokenPayload,
114
+ getVercelCliToken: () => getVercelCliToken,
115
+ getVercelDataDir: () => getVercelDataDir,
116
+ getVercelOidcToken: () => getVercelOidcToken,
117
+ isExpired: () => isExpired,
118
+ loadToken: () => loadToken,
119
+ saveToken: () => saveToken
120
+ });
121
+ module.exports = __toCommonJS(token_util_exports);
122
+ var path = __toESM(__require2("path"));
123
+ var fs = __toESM(__require2("fs"));
124
+ var import_token_error = require_token_error();
125
+ var import_token_io = require_token_io();
126
+ function getVercelDataDir() {
127
+ const vercelFolder = "com.vercel.cli";
128
+ const dataDir = (0, import_token_io.getUserDataDir)();
129
+ if (!dataDir) {
130
+ return null;
131
+ }
132
+ return path.join(dataDir, vercelFolder);
133
+ }
134
+ function getVercelCliToken() {
135
+ const dataDir = getVercelDataDir();
136
+ if (!dataDir) {
137
+ return null;
138
+ }
139
+ const tokenPath = path.join(dataDir, "auth.json");
140
+ if (!fs.existsSync(tokenPath)) {
141
+ return null;
142
+ }
143
+ const token = fs.readFileSync(tokenPath, "utf8");
144
+ if (!token) {
145
+ return null;
146
+ }
147
+ return JSON.parse(token).token;
148
+ }
149
+ async function getVercelOidcToken(authToken, projectId, teamId) {
150
+ try {
151
+ const url = `https://api.vercel.com/v1/projects/${projectId}/token?source=vercel-oidc-refresh${teamId ? `&teamId=${teamId}` : ""}`;
152
+ const res = await fetch(url, {
153
+ method: "POST",
154
+ headers: {
155
+ Authorization: `Bearer ${authToken}`
156
+ }
157
+ });
158
+ if (!res.ok) {
159
+ throw new import_token_error.VercelOidcTokenError(
160
+ `Failed to refresh OIDC token: ${res.statusText}`
161
+ );
162
+ }
163
+ const tokenRes = await res.json();
164
+ assertVercelOidcTokenResponse(tokenRes);
165
+ return tokenRes;
166
+ } catch (e) {
167
+ throw new import_token_error.VercelOidcTokenError(`Failed to refresh OIDC token`, e);
168
+ }
169
+ }
170
+ function assertVercelOidcTokenResponse(res) {
171
+ if (!res || typeof res !== "object") {
172
+ throw new TypeError("Expected an object");
173
+ }
174
+ if (!("token" in res) || typeof res.token !== "string") {
175
+ throw new TypeError("Expected a string-valued token property");
176
+ }
177
+ }
178
+ function findProjectInfo() {
179
+ const dir = (0, import_token_io.findRootDir)();
180
+ if (!dir) {
181
+ throw new import_token_error.VercelOidcTokenError("Unable to find root directory");
182
+ }
183
+ try {
184
+ const prjPath = path.join(dir, ".vercel", "project.json");
185
+ if (!fs.existsSync(prjPath)) {
186
+ throw new import_token_error.VercelOidcTokenError("project.json not found");
187
+ }
188
+ const prj = JSON.parse(fs.readFileSync(prjPath, "utf8"));
189
+ if (typeof prj.projectId !== "string" && typeof prj.orgId !== "string") {
190
+ throw new TypeError("Expected a string-valued projectId property");
191
+ }
192
+ return { projectId: prj.projectId, teamId: prj.orgId };
193
+ } catch (e) {
194
+ throw new import_token_error.VercelOidcTokenError(`Unable to find project ID`, e);
195
+ }
196
+ }
197
+ function saveToken(token, projectId) {
198
+ try {
199
+ const dir = (0, import_token_io.getUserDataDir)();
200
+ if (!dir) {
201
+ throw new import_token_error.VercelOidcTokenError("Unable to find user data directory");
202
+ }
203
+ const tokenPath = path.join(dir, "com.vercel.token", `${projectId}.json`);
204
+ const tokenJson = JSON.stringify(token);
205
+ fs.mkdirSync(path.dirname(tokenPath), { mode: 504, recursive: true });
206
+ fs.writeFileSync(tokenPath, tokenJson);
207
+ fs.chmodSync(tokenPath, 432);
208
+ return;
209
+ } catch (e) {
210
+ throw new import_token_error.VercelOidcTokenError(`Failed to save token`, e);
211
+ }
212
+ }
213
+ function loadToken(projectId) {
214
+ try {
215
+ const dir = (0, import_token_io.getUserDataDir)();
216
+ if (!dir) {
217
+ return null;
218
+ }
219
+ const tokenPath = path.join(dir, "com.vercel.token", `${projectId}.json`);
220
+ if (!fs.existsSync(tokenPath)) {
221
+ return null;
222
+ }
223
+ const token = JSON.parse(fs.readFileSync(tokenPath, "utf8"));
224
+ assertVercelOidcTokenResponse(token);
225
+ return token;
226
+ } catch (e) {
227
+ throw new import_token_error.VercelOidcTokenError(`Failed to load token`, e);
228
+ }
229
+ }
230
+ function getTokenPayload(token) {
231
+ const tokenParts = token.split(".");
232
+ if (tokenParts.length !== 3) {
233
+ throw new import_token_error.VercelOidcTokenError("Invalid token");
234
+ }
235
+ const base64 = tokenParts[1].replace(/-/g, "+").replace(/_/g, "/");
236
+ const padded = base64.padEnd(
237
+ base64.length + (4 - base64.length % 4) % 4,
238
+ "="
239
+ );
240
+ return JSON.parse(Buffer.from(padded, "base64").toString("utf8"));
241
+ }
242
+ function isExpired(token) {
243
+ return token.exp * 1e3 < Date.now();
244
+ }
245
+ }
246
+ });
247
+
248
+ export { require_token_util as r };
249
+ //# sourceMappingURL=chunk-55VPMN3N-BuAJ8n05.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-55VPMN3N-BuAJ8n05.js","sources":["../../../packages/core/dist/chunk-55VPMN3N.js"],"sourcesContent":["import { __commonJS, __require, require_token_error } from './chunk-D22XABFZ.js';\n\n// ../_vendored/ai_v5/dist/chunk-OL3SSKUZ.js\nvar require_token_io = __commonJS({\n \"../../../node_modules/.pnpm/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/token-io.js\"(exports, module) {\n var __create = Object.create;\n var __defProp = Object.defineProperty;\n var __getOwnPropDesc = Object.getOwnPropertyDescriptor;\n var __getOwnPropNames = Object.getOwnPropertyNames;\n var __getProtoOf = Object.getPrototypeOf;\n var __hasOwnProp = Object.prototype.hasOwnProperty;\n var __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n };\n var __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n };\n var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n ));\n var __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n var token_io_exports = {};\n __export(token_io_exports, {\n findRootDir: () => findRootDir,\n getUserDataDir: () => getUserDataDir\n });\n module.exports = __toCommonJS(token_io_exports);\n var import_path = __toESM(__require(\"path\"));\n var import_fs = __toESM(__require(\"fs\"));\n var import_os = __toESM(__require(\"os\"));\n var import_token_error = require_token_error();\n function findRootDir() {\n try {\n let dir = process.cwd();\n while (dir !== import_path.default.dirname(dir)) {\n const pkgPath = import_path.default.join(dir, \".vercel\");\n if (import_fs.default.existsSync(pkgPath)) {\n return dir;\n }\n dir = import_path.default.dirname(dir);\n }\n } catch (e) {\n throw new import_token_error.VercelOidcTokenError(\n \"Token refresh only supported in node server environments\"\n );\n }\n throw new import_token_error.VercelOidcTokenError(\"Unable to find root directory\");\n }\n function getUserDataDir() {\n if (process.env.XDG_DATA_HOME) {\n return process.env.XDG_DATA_HOME;\n }\n switch (import_os.default.platform()) {\n case \"darwin\":\n return import_path.default.join(import_os.default.homedir(), \"Library/Application Support\");\n case \"linux\":\n return import_path.default.join(import_os.default.homedir(), \".local/share\");\n case \"win32\":\n if (process.env.LOCALAPPDATA) {\n return process.env.LOCALAPPDATA;\n }\n return null;\n default:\n return null;\n }\n }\n }\n});\nvar require_token_util = __commonJS({\n \"../../../node_modules/.pnpm/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/token-util.js\"(exports, module) {\n var __create = Object.create;\n var __defProp = Object.defineProperty;\n var __getOwnPropDesc = Object.getOwnPropertyDescriptor;\n var __getOwnPropNames = Object.getOwnPropertyNames;\n var __getProtoOf = Object.getPrototypeOf;\n var __hasOwnProp = Object.prototype.hasOwnProperty;\n var __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n };\n var __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n };\n var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n ));\n var __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n var token_util_exports = {};\n __export(token_util_exports, {\n assertVercelOidcTokenResponse: () => assertVercelOidcTokenResponse,\n findProjectInfo: () => findProjectInfo,\n getTokenPayload: () => getTokenPayload,\n getVercelCliToken: () => getVercelCliToken,\n getVercelDataDir: () => getVercelDataDir,\n getVercelOidcToken: () => getVercelOidcToken,\n isExpired: () => isExpired,\n loadToken: () => loadToken,\n saveToken: () => saveToken\n });\n module.exports = __toCommonJS(token_util_exports);\n var path = __toESM(__require(\"path\"));\n var fs = __toESM(__require(\"fs\"));\n var import_token_error = require_token_error();\n var import_token_io = require_token_io();\n function getVercelDataDir() {\n const vercelFolder = \"com.vercel.cli\";\n const dataDir = (0, import_token_io.getUserDataDir)();\n if (!dataDir) {\n return null;\n }\n return path.join(dataDir, vercelFolder);\n }\n function getVercelCliToken() {\n const dataDir = getVercelDataDir();\n if (!dataDir) {\n return null;\n }\n const tokenPath = path.join(dataDir, \"auth.json\");\n if (!fs.existsSync(tokenPath)) {\n return null;\n }\n const token = fs.readFileSync(tokenPath, \"utf8\");\n if (!token) {\n return null;\n }\n return JSON.parse(token).token;\n }\n async function getVercelOidcToken(authToken, projectId, teamId) {\n try {\n const url = `https://api.vercel.com/v1/projects/${projectId}/token?source=vercel-oidc-refresh${teamId ? `&teamId=${teamId}` : \"\"}`;\n const res = await fetch(url, {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${authToken}`\n }\n });\n if (!res.ok) {\n throw new import_token_error.VercelOidcTokenError(\n `Failed to refresh OIDC token: ${res.statusText}`\n );\n }\n const tokenRes = await res.json();\n assertVercelOidcTokenResponse(tokenRes);\n return tokenRes;\n } catch (e) {\n throw new import_token_error.VercelOidcTokenError(`Failed to refresh OIDC token`, e);\n }\n }\n function assertVercelOidcTokenResponse(res) {\n if (!res || typeof res !== \"object\") {\n throw new TypeError(\"Expected an object\");\n }\n if (!(\"token\" in res) || typeof res.token !== \"string\") {\n throw new TypeError(\"Expected a string-valued token property\");\n }\n }\n function findProjectInfo() {\n const dir = (0, import_token_io.findRootDir)();\n if (!dir) {\n throw new import_token_error.VercelOidcTokenError(\"Unable to find root directory\");\n }\n try {\n const prjPath = path.join(dir, \".vercel\", \"project.json\");\n if (!fs.existsSync(prjPath)) {\n throw new import_token_error.VercelOidcTokenError(\"project.json not found\");\n }\n const prj = JSON.parse(fs.readFileSync(prjPath, \"utf8\"));\n if (typeof prj.projectId !== \"string\" && typeof prj.orgId !== \"string\") {\n throw new TypeError(\"Expected a string-valued projectId property\");\n }\n return { projectId: prj.projectId, teamId: prj.orgId };\n } catch (e) {\n throw new import_token_error.VercelOidcTokenError(`Unable to find project ID`, e);\n }\n }\n function saveToken(token, projectId) {\n try {\n const dir = (0, import_token_io.getUserDataDir)();\n if (!dir) {\n throw new import_token_error.VercelOidcTokenError(\"Unable to find user data directory\");\n }\n const tokenPath = path.join(dir, \"com.vercel.token\", `${projectId}.json`);\n const tokenJson = JSON.stringify(token);\n fs.mkdirSync(path.dirname(tokenPath), { mode: 504, recursive: true });\n fs.writeFileSync(tokenPath, tokenJson);\n fs.chmodSync(tokenPath, 432);\n return;\n } catch (e) {\n throw new import_token_error.VercelOidcTokenError(`Failed to save token`, e);\n }\n }\n function loadToken(projectId) {\n try {\n const dir = (0, import_token_io.getUserDataDir)();\n if (!dir) {\n return null;\n }\n const tokenPath = path.join(dir, \"com.vercel.token\", `${projectId}.json`);\n if (!fs.existsSync(tokenPath)) {\n return null;\n }\n const token = JSON.parse(fs.readFileSync(tokenPath, \"utf8\"));\n assertVercelOidcTokenResponse(token);\n return token;\n } catch (e) {\n throw new import_token_error.VercelOidcTokenError(`Failed to load token`, e);\n }\n }\n function getTokenPayload(token) {\n const tokenParts = token.split(\".\");\n if (tokenParts.length !== 3) {\n throw new import_token_error.VercelOidcTokenError(\"Invalid token\");\n }\n const base64 = tokenParts[1].replace(/-/g, \"+\").replace(/_/g, \"/\");\n const padded = base64.padEnd(\n base64.length + (4 - base64.length % 4) % 4,\n \"=\"\n );\n return JSON.parse(Buffer.from(padded, \"base64\").toString(\"utf8\"));\n }\n function isExpired(token) {\n return token.exp * 1e3 < Date.now();\n }\n }\n});\n\nexport { require_token_util };\n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