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

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