@mastra/react 0.1.0-beta.9 → 1.0.0-beta.25

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,379 @@
1
1
  # @mastra/react-hooks
2
2
 
3
+ ## 1.0.0-beta.25
4
+
5
+ ### Minor Changes
6
+
7
+ - Added human-in-the-loop (HITL) tool approval support for `generate()` method. ([#12056](https://github.com/mastra-ai/mastra/pull/12056))
8
+
9
+ **Why:** This provides parity between `stream()` and `generate()` for tool approval flows, allowing non-streaming use cases to leverage `requireToolApproval` without needing to switch to streaming.
10
+
11
+ Previously, tool approval with `requireToolApproval` only worked with `stream()`. Now you can use the same approval flow with `generate()` for non-streaming use cases.
12
+
13
+ **Using tool approval with generate()**
14
+
15
+ ```typescript
16
+ const output = await agent.generate('Find user John', {
17
+ requireToolApproval: true,
18
+ });
19
+
20
+ // Check if a tool is waiting for approval
21
+ if (output.finishReason === 'suspended') {
22
+ console.log('Tool requires approval:', output.suspendPayload.toolName);
23
+
24
+ // Approve the tool call
25
+ const result = await agent.approveToolCallGenerate({
26
+ runId: output.runId,
27
+ toolCallId: output.suspendPayload.toolCallId,
28
+ });
29
+
30
+ console.log(result.text);
31
+ }
32
+ ```
33
+
34
+ **Declining a tool call**
35
+
36
+ ```typescript
37
+ if (output.finishReason === 'suspended') {
38
+ const result = await agent.declineToolCallGenerate({
39
+ runId: output.runId,
40
+ toolCallId: output.suspendPayload.toolCallId,
41
+ });
42
+ }
43
+ ```
44
+
45
+ **New methods added:**
46
+ - `agent.approveToolCallGenerate({ runId, toolCallId })` - Approves a pending tool call and returns the complete result
47
+ - `agent.declineToolCallGenerate({ runId, toolCallId })` - Declines a pending tool call and returns the complete result
48
+
49
+ **Server routes added:**
50
+ - `POST /api/agents/:agentId/approve-tool-call-generate`
51
+ - `POST /api/agents/:agentId/decline-tool-call-generate`
52
+
53
+ The playground UI now also supports tool approval when using generate mode.
54
+
55
+ ### Patch Changes
56
+
57
+ - Updated dependencies [[`ed3e3dd`](https://github.com/mastra-ai/mastra/commit/ed3e3ddec69d564fe2b125e083437f76331f1283), [`47b1c16`](https://github.com/mastra-ai/mastra/commit/47b1c16a01c7ffb6765fe1e499b49092f8b7eba3), [`9312dcd`](https://github.com/mastra-ai/mastra/commit/9312dcd1c6f5b321929e7d382e763d95fdc030f5)]:
58
+ - @mastra/client-js@1.0.0-beta.25
59
+
60
+ ## 1.0.0-beta.24
61
+
62
+ ### Major Changes
63
+
64
+ - **Fixed:** Align `Agent.network` with core and update `@mastra/react` network usage. ([#12015](https://github.com/mastra-ai/mastra/pull/12015))
65
+
66
+ ### Patch Changes
67
+
68
+ - Fixed compatibility with updated `@mastra/client-js` generate and stream API signatures ([#12011](https://github.com/mastra-ai/mastra/pull/12011))
69
+
70
+ - Updated dependencies [[`461e448`](https://github.com/mastra-ai/mastra/commit/461e448852fe999506a6046d50b1efc27d8aa378)]:
71
+ - @mastra/client-js@1.0.0-beta.24
72
+
73
+ ## 0.1.0-beta.23
74
+
75
+ ### Patch Changes
76
+
77
+ - Updated dependencies:
78
+ - @mastra/client-js@1.0.0-beta.23
79
+
80
+ ## 0.1.0-beta.22
81
+
82
+ ### Patch Changes
83
+
84
+ - Removes the deprecated `threadId` and `resourceId` options from `AgentExecutionOptions`. These have been deprecated for months in favour of the `memory` option. ([#11897](https://github.com/mastra-ai/mastra/pull/11897))
85
+
86
+ ### Breaking Changes
87
+
88
+ #### `@mastra/core`
89
+
90
+ The `threadId` and `resourceId` options have been removed from `agent.generate()` and `agent.stream()`. Use the `memory` option instead:
91
+
92
+ ```ts
93
+ // Before
94
+ await agent.stream('Hello', {
95
+ threadId: 'thread-123',
96
+ resourceId: 'user-456',
97
+ });
98
+
99
+ // After
100
+ await agent.stream('Hello', {
101
+ memory: {
102
+ thread: 'thread-123',
103
+ resource: 'user-456',
104
+ },
105
+ });
106
+ ```
107
+
108
+ #### `@mastra/server`
109
+
110
+ The `threadId`, `resourceId`, and `resourceid` fields have been removed from the main agent execution body schema. The server now expects the `memory` option format in request bodies. Legacy routes (`/api/agents/:agentId/generate-legacy` and `/api/agents/:agentId/stream-legacy`) continue to support the deprecated fields.
111
+
112
+ #### `@mastra/react`
113
+
114
+ The `useChat` hook now internally converts `threadId` to the `memory` option format when making API calls. No changes needed in component code - the hook handles the conversion automatically.
115
+
116
+ #### `@mastra/client-js`
117
+
118
+ When using the client SDK agent methods, use the `memory` option instead of `threadId`/`resourceId`:
119
+
120
+ ```ts
121
+ const agent = client.getAgent('my-agent');
122
+
123
+ // Before
124
+ await agent.generate({
125
+ messages: [...],
126
+ threadId: 'thread-123',
127
+ resourceId: 'user-456',
128
+ });
129
+
130
+ // After
131
+ await agent.generate({
132
+ messages: [...],
133
+ memory: {
134
+ thread: 'thread-123',
135
+ resource: 'user-456',
136
+ },
137
+ });
138
+ ```
139
+
140
+ - Add human-in-the-loop (HITL) support to agent networks ([#11678](https://github.com/mastra-ai/mastra/pull/11678))
141
+ - Add suspend/resume capabilities to agent network
142
+ - Enable auto-resume for suspended network execution via `autoResumeSuspendedTools`
143
+
144
+ `agent.resumeNetwork`, `agent.approveNetworkToolCall`, `agent.declineNetworkToolCall`
145
+
146
+ - Fix text parts incorrectly merging across tool calls ([#11783](https://github.com/mastra-ai/mastra/pull/11783))
147
+
148
+ Previously, when an agent produced text before and after a tool call (e.g., "Let me search for that" → tool call → "Here's what I found"), the text parts would be merged into a single part, losing the separation. This fix introduces a `textId` property to track separate text streams, ensuring each text stream maintains its own text part in the UI message.
149
+
150
+ Fixes #11577
151
+
152
+ - Updated dependencies [[`9d5059e`](https://github.com/mastra-ai/mastra/commit/9d5059eae810829935fb08e81a9bb7ecd5b144a7), [`ef756c6`](https://github.com/mastra-ai/mastra/commit/ef756c65f82d16531c43f49a27290a416611e526), [`610a70b`](https://github.com/mastra-ai/mastra/commit/610a70bdad282079f0c630e0d7bb284578f20151)]:
153
+ - @mastra/client-js@1.0.0-beta.22
154
+
155
+ ## 0.1.0-beta.21
156
+
157
+ ### Patch Changes
158
+
159
+ - Updated dependencies:
160
+ - @mastra/client-js@1.0.0-beta.21
161
+
162
+ ## 0.1.0-beta.20
163
+
164
+ ### Patch Changes
165
+
166
+ - Fix TypeScript errors during build declaration generation ([#11682](https://github.com/mastra-ai/mastra/pull/11682))
167
+
168
+ Updated test file `toUIMessage.test.ts` to match current `@mastra/core` types:
169
+ - Changed `error` property from string to `Error` object (per `StepFailure` type)
170
+ - Added missing `resumeSchema` property to `tool-call-approval` payloads (per `ToolCallApprovalPayload` type)
171
+ - Added `zod` as peer/dev dependency for test type support
172
+
173
+ - Fixed agent network not returning text response when routing agent handles requests without delegation. ([#11497](https://github.com/mastra-ai/mastra/pull/11497))
174
+
175
+ **What changed:**
176
+ - 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
177
+ - Added fallback in transformers to ensure text is always returned even if core events are missing
178
+
179
+ **Why this matters:**
180
+ 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.
181
+
182
+ Fixes #11219
183
+
184
+ - 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))
185
+
186
+ - 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)]:
187
+ - @mastra/client-js@1.0.0-beta.20
188
+
189
+ ## 0.1.0-beta.19
190
+
191
+ ### Patch Changes
192
+
193
+ - Updated dependencies:
194
+ - @mastra/client-js@1.0.0-beta.19
195
+
196
+ ## 0.1.0-beta.18
197
+
198
+ ### Patch Changes
199
+
200
+ - Updated dependencies:
201
+ - @mastra/client-js@1.0.0-beta.18
202
+
203
+ ## 0.1.0-beta.17
204
+
205
+ ### Patch Changes
206
+
207
+ - Updated dependencies:
208
+ - @mastra/client-js@1.0.0-beta.17
209
+
210
+ ## 0.1.0-beta.16
211
+
212
+ ### Patch Changes
213
+
214
+ - Updated dependencies [[`6cbb549`](https://github.com/mastra-ai/mastra/commit/6cbb549475201a2fbf158f0fd7323f6495f46d08)]:
215
+ - @mastra/client-js@1.0.0-beta.16
216
+
217
+ ## 0.1.0-beta.15
218
+
219
+ ### Minor Changes
220
+
221
+ - Unified observability schema with entity-based span identification ([#11132](https://github.com/mastra-ai/mastra/pull/11132))
222
+
223
+ ## What changed
224
+
225
+ Spans now use a unified identification model with `entityId`, `entityType`, and `entityName` instead of separate `agentId`, `toolId`, `workflowId` fields.
226
+
227
+ **Before:**
228
+
229
+ ```typescript
230
+ // Old span structure
231
+ span.agentId; // 'my-agent'
232
+ span.toolId; // undefined
233
+ span.workflowId; // undefined
234
+ ```
235
+
236
+ **After:**
237
+
238
+ ```typescript
239
+ // New span structure
240
+ span.entityType; // EntityType.AGENT
241
+ span.entityId; // 'my-agent'
242
+ span.entityName; // 'My Agent'
243
+ ```
244
+
245
+ ## New `listTraces()` API
246
+
247
+ Query traces with filtering, pagination, and sorting:
248
+
249
+ ```typescript
250
+ const { spans, pagination } = await storage.listTraces({
251
+ filters: {
252
+ entityType: EntityType.AGENT,
253
+ entityId: 'my-agent',
254
+ userId: 'user-123',
255
+ environment: 'production',
256
+ status: TraceStatus.SUCCESS,
257
+ startedAt: { start: new Date('2024-01-01'), end: new Date('2024-01-31') },
258
+ },
259
+ pagination: { page: 0, perPage: 50 },
260
+ orderBy: { field: 'startedAt', direction: 'DESC' },
261
+ });
262
+ ```
263
+
264
+ **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`.
265
+
266
+ ## New retrieval methods
267
+ - `getSpan({ traceId, spanId })` - Get a single span
268
+ - `getRootSpan({ traceId })` - Get the root span of a trace
269
+ - `getTrace({ traceId })` - Get all spans for a trace
270
+
271
+ ## Backward compatibility
272
+
273
+ The legacy `getTraces()` method continues to work. When you pass `name: "agent run: my-agent"`, it automatically transforms to `entityId: "my-agent", entityType: AGENT`.
274
+
275
+ ## Migration
276
+
277
+ **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`.
278
+
279
+ **No action required:** Your existing code continues to work. Adopt the new fields and `listTraces()` API at your convenience.
280
+
281
+ ### Patch Changes
282
+
283
+ - 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)]:
284
+ - @mastra/client-js@1.0.0-beta.15
285
+
286
+ ## 0.1.0-beta.14
287
+
288
+ ### Patch Changes
289
+
290
+ - Updated dependencies [[`66741d1`](https://github.com/mastra-ai/mastra/commit/66741d1a99c4f42cf23a16109939e8348ac6852e), [`a7ce182`](https://github.com/mastra-ai/mastra/commit/a7ce1822a8785ce45d62dd5c911af465e144f7d7)]:
291
+ - @mastra/client-js@1.0.0-beta.14
292
+
293
+ ## 0.1.0-beta.13
294
+
295
+ ### Patch Changes
296
+
297
+ - Updated dependencies:
298
+ - @mastra/client-js@1.0.0-beta.13
299
+
300
+ ## 0.1.0-beta.12
301
+
302
+ ### Patch Changes
303
+
304
+ - Remove redundant toolCalls from network agent finalResult ([#11189](https://github.com/mastra-ai/mastra/pull/11189))
305
+
306
+ 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.
307
+
308
+ **Before:** `finalResult: { text, toolCalls, messages }`
309
+ **After:** `finalResult: { text, messages }`
310
+
311
+ +**Migration:** If you were accessing `finalResult.toolCalls`, retrieve tool calls from `finalResult.messages` by filtering for messages with `type: 'tool-call'`.
312
+
313
+ Updated `@mastra/react` to extract tool calls directly from the `messages` array instead of the removed `toolCalls` field when resolving initial messages from memory.
314
+
315
+ Fixes #11059
316
+
317
+ - Auto resume suspended tools if `autoResumeSuspendedTools: true` ([#11157](https://github.com/mastra-ai/mastra/pull/11157))
318
+
319
+ The flag can be added to `defaultAgentOptions` when creating the agent or to options in `agent.stream` or `agent.generate`
320
+
321
+ ```typescript
322
+ const agent = new Agent({
323
+ //...agent information,
324
+ defaultAgentOptions: {
325
+ autoResumeSuspendedTools: true,
326
+ },
327
+ });
328
+ ```
329
+
330
+ - 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)]:
331
+ - @mastra/client-js@1.0.0-beta.12
332
+
333
+ ## 0.1.0-beta.11
334
+
335
+ ### Patch Changes
336
+
337
+ - 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))
338
+
339
+ When a workflow contains an agent step that triggers a tripwire, the workflow returns with `status: 'tripwire'` and includes tripwire details:
340
+
341
+ ```typescript showLineNumbers copy
342
+ const run = await workflow.createRun();
343
+ const result = await run.start({ inputData: { message: 'Hello' } });
344
+
345
+ if (result.status === 'tripwire') {
346
+ console.log('Workflow terminated by tripwire:', result.tripwire?.reason);
347
+ console.log('Processor ID:', result.tripwire?.processorId);
348
+ console.log('Retry requested:', result.tripwire?.retry);
349
+ }
350
+ ```
351
+
352
+ Adds new UI state for tripwire in agent chat and workflow UI.
353
+
354
+ 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).
355
+
356
+ - Updated dependencies [[`3bf6c5f`](https://github.com/mastra-ai/mastra/commit/3bf6c5f104c25226cd84e0c77f9dec15f2cac2db)]:
357
+ - @mastra/client-js@1.0.0-beta.11
358
+
359
+ ## 0.1.0-beta.10
360
+
361
+ ### Minor Changes
362
+
363
+ - 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))
364
+
365
+ ### Patch Changes
366
+
367
+ - fix: persist data-\* chunks from writer.custom() to memory storage ([#10884](https://github.com/mastra-ai/mastra/pull/10884))
368
+ - Add persistence for custom data chunks (`data-*` parts) emitted via `writer.custom()` in tools
369
+ - Data chunks are now saved to message storage so they survive page refreshes
370
+ - Update `@assistant-ui/react` to v0.11.47 with native `DataMessagePart` support
371
+ - Convert `data-*` parts to `DataMessagePart` format (`{ type: 'data', name: string, data: T }`)
372
+ - Update related `@assistant-ui/*` packages for compatibility
373
+
374
+ - Updated dependencies [[`261473a`](https://github.com/mastra-ai/mastra/commit/261473ac637e633064a22076671e2e02b002214d)]:
375
+ - @mastra/client-js@1.0.0-beta.10
376
+
3
377
  ## 0.1.0-beta.9
4
378
 
5
379
  ### Patch Changes
@@ -0,0 +1,249 @@
1
+ import { _ as __commonJS, a as __require2, r as require_token_error } from './index-D3JtF_Zl.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-Ax1F4Y75.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-55VPMN3N-Ax1F4Y75.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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