@mastra/auth-workos 0.0.0-consolidate-changesets-20250904042643 → 0.0.0-elated-armadillo-be37a1-20251219210627

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/CHANGELOG.md +80 -18
  2. package/README.md +2 -6
  3. package/dist/index.cjs +23 -309
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.js +23 -309
  6. package/dist/index.js.map +1 -1
  7. package/package.json +14 -9
  8. package/dist/chunk-32EQK4OY.js +0 -974
  9. package/dist/chunk-32EQK4OY.js.map +0 -1
  10. package/dist/chunk-B2N25K77.cjs +0 -979
  11. package/dist/chunk-B2N25K77.cjs.map +0 -1
  12. package/dist/chunk-G7ML3FDV.js +0 -9
  13. package/dist/chunk-G7ML3FDV.js.map +0 -1
  14. package/dist/chunk-UYPX6MT6.cjs +0 -32
  15. package/dist/chunk-UYPX6MT6.cjs.map +0 -1
  16. package/dist/getMachineId-bsd-G4THBH3V.js +0 -23
  17. package/dist/getMachineId-bsd-G4THBH3V.js.map +0 -1
  18. package/dist/getMachineId-bsd-GQTQCD37.cjs +0 -25
  19. package/dist/getMachineId-bsd-GQTQCD37.cjs.map +0 -1
  20. package/dist/getMachineId-darwin-3P7FJFHV.js +0 -24
  21. package/dist/getMachineId-darwin-3P7FJFHV.js.map +0 -1
  22. package/dist/getMachineId-darwin-43NRSF2D.cjs +0 -26
  23. package/dist/getMachineId-darwin-43NRSF2D.cjs.map +0 -1
  24. package/dist/getMachineId-linux-H4F4I7A5.js +0 -19
  25. package/dist/getMachineId-linux-H4F4I7A5.js.map +0 -1
  26. package/dist/getMachineId-linux-TZ3NOAZ5.cjs +0 -21
  27. package/dist/getMachineId-linux-TZ3NOAZ5.cjs.map +0 -1
  28. package/dist/getMachineId-unsupported-EZLLFFYA.cjs +0 -13
  29. package/dist/getMachineId-unsupported-EZLLFFYA.cjs.map +0 -1
  30. package/dist/getMachineId-unsupported-T3AERO5R.js +0 -11
  31. package/dist/getMachineId-unsupported-T3AERO5R.js.map +0 -1
  32. package/dist/getMachineId-win-B5AEGZT7.cjs +0 -47
  33. package/dist/getMachineId-win-B5AEGZT7.cjs.map +0 -1
  34. package/dist/getMachineId-win-Z5QAASBF.js +0 -25
  35. package/dist/getMachineId-win-Z5QAASBF.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,28 +1,90 @@
1
1
  # @mastra/auth-workos
2
2
 
3
- ## 0.0.0-consolidate-changesets-20250904042643
3
+ ## 0.0.0-elated-armadillo-be37a1-20251219210627
4
+
5
+ ### Major Changes
6
+
7
+ - Bump minimum required Node.js version to 22.13.0 ([#9706](https://github.com/mastra-ai/mastra/pull/9706))
8
+
9
+ - Experimental auth -> auth ([#9660](https://github.com/mastra-ai/mastra/pull/9660))
10
+
11
+ - Mark as stable ([`83d5942`](https://github.com/mastra-ai/mastra/commit/83d5942669ce7bba4a6ca4fd4da697a10eb5ebdc))
12
+
13
+ ### Patch Changes
14
+
15
+ - Allow provider to pass through options to the auth config ([#10284](https://github.com/mastra-ai/mastra/pull/10284))
16
+
17
+ - Updated dependencies [[`dd1c38d`](https://github.com/mastra-ai/mastra/commit/dd1c38d1b75f1b695c27b40d8d9d6ed00d5e0f6f), [`a0a5b4b`](https://github.com/mastra-ai/mastra/commit/a0a5b4bbebe6c701ebbadf744873aa0d5ca01371), [`83d5942`](https://github.com/mastra-ai/mastra/commit/83d5942669ce7bba4a6ca4fd4da697a10eb5ebdc)]:
18
+ - @mastra/auth@0.0.0-elated-armadillo-be37a1-20251219210627
19
+
20
+ ## 1.0.0-beta.1
21
+
22
+ ### Patch Changes
23
+
24
+ - Allow provider to pass through options to the auth config ([#10284](https://github.com/mastra-ai/mastra/pull/10284))
25
+
26
+ - Updated dependencies [[`a0a5b4b`](https://github.com/mastra-ai/mastra/commit/a0a5b4bbebe6c701ebbadf744873aa0d5ca01371)]:
27
+ - @mastra/auth@1.0.0-beta.1
28
+
29
+ ## 1.0.0-beta.0
30
+
31
+ ### Major Changes
32
+
33
+ - Bump minimum required Node.js version to 22.13.0 ([#9706](https://github.com/mastra-ai/mastra/pull/9706))
34
+
35
+ - Experimental auth -> auth ([#9660](https://github.com/mastra-ai/mastra/pull/9660))
36
+
37
+ - Mark as stable ([`83d5942`](https://github.com/mastra-ai/mastra/commit/83d5942669ce7bba4a6ca4fd4da697a10eb5ebdc))
38
+
39
+ ### Patch Changes
40
+
41
+ - Updated dependencies [[`dd1c38d`](https://github.com/mastra-ai/mastra/commit/dd1c38d1b75f1b695c27b40d8d9d6ed00d5e0f6f), [`83d5942`](https://github.com/mastra-ai/mastra/commit/83d5942669ce7bba4a6ca4fd4da697a10eb5ebdc)]:
42
+ - @mastra/auth@1.0.0-beta.0
43
+
44
+ ## 0.10.7
45
+
46
+ ### Patch Changes
47
+
48
+ - Update package.json and README ([#7886](https://github.com/mastra-ai/mastra/pull/7886))
49
+
50
+ - Updated dependencies []:
51
+ - @mastra/auth@0.1.3
52
+
53
+ ## 0.10.7-alpha.0
54
+
55
+ ### Patch Changes
56
+
57
+ - Update package.json and README ([#7886](https://github.com/mastra-ai/mastra/pull/7886))
58
+
59
+ - Updated dependencies []:
60
+ - @mastra/auth@0.1.3
61
+
62
+ ## 0.10.6
63
+
64
+ ### Patch Changes
65
+
66
+ - dependencies updates: ([#7568](https://github.com/mastra-ai/mastra/pull/7568))
67
+ - Updated dependency [`@workos-inc/node@^7.69.2` ↗︎](https://www.npmjs.com/package/@workos-inc/node/v/7.69.2) (from `^7.69.1`, in `dependencies`)
68
+ - Updated dependencies []:
69
+ - @mastra/auth@0.1.3
70
+
71
+ ## 0.10.6-alpha.0
72
+
73
+ ### Patch Changes
74
+
75
+ - dependencies updates: ([#7568](https://github.com/mastra-ai/mastra/pull/7568))
76
+ - Updated dependency [`@workos-inc/node@^7.69.2` ↗︎](https://www.npmjs.com/package/@workos-inc/node/v/7.69.2) (from `^7.69.1`, in `dependencies`)
77
+ - Updated dependencies []:
78
+ - @mastra/auth@0.1.3
79
+
80
+ ## 0.10.5
4
81
 
5
82
  ### Patch Changes
6
83
 
7
84
  - de3cbc6: Update the `package.json` file to include additional fields like `repository`, `homepage` or `files`.
8
- - f5e7282: Cookie vuln
9
- MastraEmbeddingModel and ts hack
10
- Support file download
11
- Add tripwire chunk to streamVNext full stream
12
- Ensure original stacktrace is preserved during workflow runs
13
- improveEmbeddingModelStuff
14
- upgrade ai v5 versions to latest for core and memory
15
- Add maxSteps
16
- Pass provider options
17
- fix default stream options onFinish being overridden
18
- add deployer, server and clientjs handlers for agent builder template
19
- temp disable agent-builder workflows import
20
- Inngest: move zod to peerDependencies
21
- added providerOptions to createVectorQueryTool and createGraphRAGTool
22
- dependencies updates:
23
- - Updated dependency [`zod-to-json-schema@^3.24.6` ↗︎](https://www.npmjs.com/package/zod-to-json-schema/v/3.24.6) (from `^3.24.5`, in `dependencies`)
85
+ - cb9aa8c: Cookie vuln
24
86
  - Updated dependencies [de3cbc6]
25
- - @mastra/auth@0.0.0-consolidate-changesets-20250904042643
87
+ - @mastra/auth@0.1.3
26
88
 
27
89
  ## 0.10.5-alpha.1
28
90
 
package/README.md CHANGED
@@ -22,7 +22,7 @@ pnpm add @mastra/auth-workos
22
22
  ## Usage
23
23
 
24
24
  ```typescript
25
- import { Mastra } from '@mastra/core';
25
+ import { Mastra } from '@mastra/core/mastra';
26
26
  import { MastraAuthWorkos } from '@mastra/auth-workos';
27
27
 
28
28
  // Initialize with environment variables
@@ -38,7 +38,7 @@ const auth = new MastraAuthWorkos({
38
38
  const mastra = new Mastra({
39
39
  ...
40
40
  server: {
41
- experimental_auth: auth,
41
+ auth,
42
42
  },
43
43
  });
44
44
  ```
@@ -72,7 +72,3 @@ Verifies a JWT token using WorkOS JWKS and returns the user information if valid
72
72
  ### `authorizeUser(user: WorkosUser): Promise<boolean>`
73
73
 
74
74
  Checks if a user has admin privileges by verifying their organization memberships and roles.
75
-
76
- ## License
77
-
78
- MIT
package/dist/index.cjs CHANGED
@@ -1,217 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var chunkB2N25K77_cjs = require('./chunk-B2N25K77.cjs');
4
3
  var auth = require('@mastra/auth');
5
4
  var node = require('@workos-inc/node');
6
5
 
7
- // ../../packages/core/dist/chunk-R7K2QO7M.js
8
- function hasActiveTelemetry(tracerName = "default-tracer") {
9
- try {
10
- return !!chunkB2N25K77_cjs.trace.getTracer(tracerName);
11
- } catch {
12
- return false;
13
- }
14
- }
15
- function getBaggageValues(ctx) {
16
- const currentBaggage = chunkB2N25K77_cjs.propagation.getBaggage(ctx);
17
- const requestId = currentBaggage?.getEntry("http.request_id")?.value;
18
- const componentName = currentBaggage?.getEntry("componentName")?.value;
19
- const runId = currentBaggage?.getEntry("runId")?.value;
20
- const threadId = currentBaggage?.getEntry("threadId")?.value;
21
- const resourceId = currentBaggage?.getEntry("resourceId")?.value;
22
- return {
23
- requestId,
24
- componentName,
25
- runId,
26
- threadId,
27
- resourceId
28
- };
29
- }
30
- function isStreamingResult(result, methodName) {
31
- if (methodName === "stream" || methodName === "streamVNext") {
32
- return true;
33
- }
34
- if (result && typeof result === "object" && result !== null) {
35
- const obj = result;
36
- return "textStream" in obj || "objectStream" in obj || "usagePromise" in obj || "finishReasonPromise" in obj;
37
- }
38
- return false;
39
- }
40
- function enhanceStreamingArgumentsWithTelemetry(args, span, spanName, methodName) {
41
- if (methodName === "stream" || methodName === "streamVNext") {
42
- const enhancedArgs = [...args];
43
- const streamOptions = enhancedArgs.length > 1 && enhancedArgs[1] || {};
44
- const enhancedStreamOptions = { ...streamOptions };
45
- const originalOnFinish = enhancedStreamOptions.onFinish;
46
- enhancedStreamOptions.onFinish = async (finishData) => {
47
- try {
48
- const telemetryData = {
49
- text: finishData.text,
50
- usage: finishData.usage,
51
- finishReason: finishData.finishReason,
52
- toolCalls: finishData.toolCalls,
53
- toolResults: finishData.toolResults,
54
- warnings: finishData.warnings,
55
- ...finishData.object !== void 0 && { object: finishData.object }
56
- };
57
- span.setAttribute(`${spanName}.result`, JSON.stringify(telemetryData));
58
- span.setStatus({ code: chunkB2N25K77_cjs.SpanStatusCode.OK });
59
- span.end();
60
- } catch (error) {
61
- debugger;
62
- console.warn("Telemetry capture failed:", error);
63
- span.setAttribute(`${spanName}.result`, "[Telemetry Capture Error]");
64
- span.setStatus({ code: chunkB2N25K77_cjs.SpanStatusCode.ERROR });
65
- span.end();
66
- }
67
- if (originalOnFinish) {
68
- return await originalOnFinish(finishData);
69
- }
70
- };
71
- enhancedStreamOptions.onFinish.__hasOriginalOnFinish = !!originalOnFinish;
72
- enhancedArgs[1] = enhancedStreamOptions;
73
- span.__mastraStreamingSpan = true;
74
- return enhancedArgs;
75
- }
76
- return args;
77
- }
78
- function withSpan(options) {
79
- return function(_target, propertyKey, descriptor) {
80
- if (!descriptor || typeof descriptor === "number") return;
81
- const originalMethod = descriptor.value;
82
- const methodName = String(propertyKey);
83
- descriptor.value = function(...args) {
84
- if (options?.skipIfNoTelemetry && !hasActiveTelemetry(options?.tracerName)) {
85
- return originalMethod.apply(this, args);
86
- }
87
- const tracer = chunkB2N25K77_cjs.trace.getTracer(options?.tracerName ?? "default-tracer");
88
- let spanName;
89
- let spanKind;
90
- if (typeof options === "string") {
91
- spanName = options;
92
- } else if (options) {
93
- spanName = options.spanName || methodName;
94
- spanKind = options.spanKind;
95
- } else {
96
- spanName = methodName;
97
- }
98
- const span = tracer.startSpan(spanName, { kind: spanKind });
99
- let ctx = chunkB2N25K77_cjs.trace.setSpan(chunkB2N25K77_cjs.context.active(), span);
100
- args.forEach((arg, index) => {
101
- try {
102
- span.setAttribute(`${spanName}.argument.${index}`, JSON.stringify(arg));
103
- } catch {
104
- span.setAttribute(`${spanName}.argument.${index}`, "[Not Serializable]");
105
- }
106
- });
107
- const { requestId, componentName, runId, threadId, resourceId } = getBaggageValues(ctx);
108
- if (requestId) {
109
- span.setAttribute("http.request_id", requestId);
110
- }
111
- if (threadId) {
112
- span.setAttribute("threadId", threadId);
113
- }
114
- if (resourceId) {
115
- span.setAttribute("resourceId", resourceId);
116
- }
117
- if (componentName) {
118
- span.setAttribute("componentName", componentName);
119
- span.setAttribute("runId", runId);
120
- } else if (this && typeof this === "object" && "name" in this) {
121
- const contextObj = this;
122
- span.setAttribute("componentName", contextObj.name);
123
- if (contextObj.runId) {
124
- span.setAttribute("runId", contextObj.runId);
125
- }
126
- ctx = chunkB2N25K77_cjs.propagation.setBaggage(
127
- ctx,
128
- chunkB2N25K77_cjs.propagation.createBaggage({
129
- // @ts-ignore
130
- componentName: { value: this.name },
131
- // @ts-ignore
132
- runId: { value: this.runId },
133
- // @ts-ignore
134
- "http.request_id": { value: requestId },
135
- // @ts-ignore
136
- threadId: { value: threadId },
137
- // @ts-ignore
138
- resourceId: { value: resourceId }
139
- })
140
- );
141
- }
142
- let result;
143
- try {
144
- const enhancedArgs = isStreamingResult(result, methodName) ? enhanceStreamingArgumentsWithTelemetry(args, span, spanName, methodName) : args;
145
- result = chunkB2N25K77_cjs.context.with(ctx, () => originalMethod.apply(this, enhancedArgs));
146
- if (result instanceof Promise) {
147
- return result.then((resolvedValue) => {
148
- if (isStreamingResult(resolvedValue, methodName)) {
149
- return resolvedValue;
150
- } else {
151
- try {
152
- span.setAttribute(`${spanName}.result`, JSON.stringify(resolvedValue));
153
- } catch {
154
- span.setAttribute(`${spanName}.result`, "[Not Serializable]");
155
- }
156
- return resolvedValue;
157
- }
158
- }).finally(() => {
159
- if (!span.__mastraStreamingSpan) {
160
- span.end();
161
- }
162
- });
163
- }
164
- if (!isStreamingResult(result, methodName)) {
165
- try {
166
- span.setAttribute(`${spanName}.result`, JSON.stringify(result));
167
- } catch {
168
- span.setAttribute(`${spanName}.result`, "[Not Serializable]");
169
- }
170
- }
171
- return result;
172
- } catch (error) {
173
- span.setStatus({
174
- code: chunkB2N25K77_cjs.SpanStatusCode.ERROR,
175
- message: error instanceof Error ? error.message : "Unknown error"
176
- });
177
- if (error instanceof Error) {
178
- span.recordException(error);
179
- }
180
- throw error;
181
- } finally {
182
- if (!(result instanceof Promise) && !isStreamingResult(result, methodName)) {
183
- span.end();
184
- }
185
- }
186
- };
187
- return descriptor;
188
- };
189
- }
190
- function InstrumentClass(options) {
191
- return function(target) {
192
- const methods = Object.getOwnPropertyNames(target.prototype);
193
- methods.forEach((method) => {
194
- if (options?.excludeMethods?.includes(method) || method === "constructor") return;
195
- if (options?.methodFilter && !options.methodFilter(method)) return;
196
- const descriptor = Object.getOwnPropertyDescriptor(target.prototype, method);
197
- if (descriptor && typeof descriptor.value === "function") {
198
- Object.defineProperty(
199
- target.prototype,
200
- method,
201
- withSpan({
202
- spanName: options?.prefix ? `${options.prefix}.${method}` : method,
203
- skipIfNoTelemetry: true,
204
- spanKind: options?.spanKind || chunkB2N25K77_cjs.SpanKind.INTERNAL,
205
- tracerName: options?.tracerName
206
- })(target, method, descriptor)
207
- );
208
- }
209
- });
210
- return target;
211
- };
212
- }
6
+ // src/index.ts
213
7
 
214
- // ../../packages/core/dist/chunk-X3GXU6TZ.js
8
+ // ../../packages/core/dist/chunk-NRUZYMHE.js
215
9
  var RegisteredLogger = {
216
10
  LLM: "LLM"};
217
11
  var LogLevel = {
@@ -233,11 +27,11 @@ var MastraLogger = class {
233
27
  }
234
28
  trackException(_error) {
235
29
  }
236
- async getLogs(transportId, params) {
30
+ async listLogs(transportId, params) {
237
31
  if (!transportId || !this.transports.has(transportId)) {
238
32
  return { logs: [], total: 0, page: params?.page ?? 1, perPage: params?.perPage ?? 100, hasMore: false };
239
33
  }
240
- return this.transports.get(transportId).getLogs(params) ?? {
34
+ return this.transports.get(transportId).listLogs(params) ?? {
241
35
  logs: [],
242
36
  total: 0,
243
37
  page: params?.page ?? 1,
@@ -245,7 +39,7 @@ var MastraLogger = class {
245
39
  hasMore: false
246
40
  };
247
41
  }
248
- async getLogsByRunId({
42
+ async listLogsByRunId({
249
43
  transportId,
250
44
  runId,
251
45
  fromDate,
@@ -258,7 +52,7 @@ var MastraLogger = class {
258
52
  if (!transportId || !this.transports.has(transportId) || !runId) {
259
53
  return { logs: [], total: 0, page: page ?? 1, perPage: perPage ?? 100, hasMore: false };
260
54
  }
261
- return this.transports.get(transportId).getLogsByRunId({ runId, fromDate, toDate, logLevel, filters, page, perPage }) ?? {
55
+ return this.transports.get(transportId).listLogsByRunId({ runId, fromDate, toDate, logLevel, filters, page, perPage }) ?? {
262
56
  logs: [],
263
57
  total: 0,
264
58
  page: page ?? 1,
@@ -273,7 +67,7 @@ var ConsoleLogger = class extends MastraLogger {
273
67
  }
274
68
  debug(message, ...args) {
275
69
  if (this.level === LogLevel.DEBUG) {
276
- console.debug(message, ...args);
70
+ console.info(message, ...args);
277
71
  }
278
72
  }
279
73
  info(message, ...args) {
@@ -283,7 +77,7 @@ var ConsoleLogger = class extends MastraLogger {
283
77
  }
284
78
  warn(message, ...args) {
285
79
  if (this.level === LogLevel.WARN || this.level === LogLevel.INFO || this.level === LogLevel.DEBUG) {
286
- console.warn(message, ...args);
80
+ console.info(message, ...args);
287
81
  }
288
82
  }
289
83
  error(message, ...args) {
@@ -291,20 +85,19 @@ var ConsoleLogger = class extends MastraLogger {
291
85
  console.error(message, ...args);
292
86
  }
293
87
  }
294
- async getLogs(_transportId, _params) {
88
+ async listLogs(_transportId, _params) {
295
89
  return { logs: [], total: 0, page: _params?.page ?? 1, perPage: _params?.perPage ?? 100, hasMore: false };
296
90
  }
297
- async getLogsByRunId(_args) {
91
+ async listLogsByRunId(_args) {
298
92
  return { logs: [], total: 0, page: _args.page ?? 1, perPage: _args.perPage ?? 100, hasMore: false };
299
93
  }
300
94
  };
301
95
 
302
- // ../../packages/core/dist/chunk-6GF5M4GX.js
96
+ // ../../packages/core/dist/chunk-LSHPJWM5.js
303
97
  var MastraBase = class {
304
98
  component = RegisteredLogger.LLM;
305
99
  logger;
306
100
  name;
307
- telemetry;
308
101
  constructor({ component, name }) {
309
102
  this.component = component || RegisteredLogger.LLM;
310
103
  this.name = name;
@@ -320,111 +113,32 @@ var MastraBase = class {
320
113
  this.logger.debug(`Logger updated [component=${this.component}] [name=${this.name}]`);
321
114
  }
322
115
  }
323
- /**
324
- * Set the telemetry for the
325
- * @param telemetry
326
- */
327
- __setTelemetry(telemetry) {
328
- this.telemetry = telemetry;
329
- if (this.component !== RegisteredLogger.LLM) {
330
- this.logger.debug(`Telemetry updated [component=${this.component}] [name=${this.telemetry.name}]`);
331
- }
332
- }
333
- /**
334
- * Get the telemetry on the vector
335
- * @returns telemetry
336
- */
337
- __getTelemetry() {
338
- return this.telemetry;
339
- }
340
- /*
341
- get experimental_telemetry config
342
- */
343
- get experimental_telemetry() {
344
- return this.telemetry ? {
345
- // tracer: this.telemetry.tracer,
346
- tracer: this.telemetry.getBaggageTracer(),
347
- isEnabled: !!this.telemetry.tracer
348
- } : void 0;
349
- }
350
- };
351
-
352
- // ../../packages/core/dist/chunk-3HXBPDKN.js
353
- var __create = Object.create;
354
- var __defProp = Object.defineProperty;
355
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
356
- var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
357
- var __typeError = (msg) => {
358
- throw TypeError(msg);
359
- };
360
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
361
- enumerable: true,
362
- configurable: true,
363
- writable: true,
364
- value
365
- }) : obj[key] = value;
366
- var __name = (target, value) => __defProp(target, "name", {
367
- value,
368
- configurable: true
369
- });
370
- var __decoratorStart = (base) => [, , , __create(base?.[__knownSymbol("metadata")] ?? null)];
371
- var __decoratorStrings = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
372
- var __expectFn = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError("Function expected") : fn;
373
- var __decoratorContext = (kind, name, done, metadata, fns) => ({
374
- kind: __decoratorStrings[kind],
375
- name,
376
- metadata,
377
- addInitializer: (fn) => done._ ? __typeError("Already initialized") : fns.push(__expectFn(fn || null))
378
- });
379
- var __decoratorMetadata = (array, target) => __defNormalProp(target, __knownSymbol("metadata"), array[3]);
380
- var __runInitializers = (array, flags, self, value) => {
381
- for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) fns[i].call(self) ;
382
- return value;
383
- };
384
- var __decorateElement = (array, flags, name, decorators, target, extra) => {
385
- var it, done, ctx, k = flags & 7, p = false;
386
- var j = 0;
387
- var extraInitializers = array[j] || (array[j] = []);
388
- var desc = k && ((target = target.prototype), k < 5 && (k > 3 || !p) && __getOwnPropDesc(target , name));
389
- __name(target, name);
390
- for (var i = decorators.length - 1; i >= 0; i--) {
391
- ctx = __decoratorContext(k, name, done = {}, array[3], extraInitializers);
392
- it = (0, decorators[i])(target, ctx), done._ = 1;
393
- __expectFn(it) && (target = it);
394
- }
395
- return __decoratorMetadata(array, target), desc && __defProp(target, name, desc), p ? k ^ 4 ? extra : desc : target;
396
116
  };
397
117
 
398
118
  // ../../packages/core/dist/server/index.js
399
- var _MastraAuthProvider_decorators;
400
- var _init;
401
- var _a;
402
- _MastraAuthProvider_decorators = [InstrumentClass({
403
- prefix: "auth",
404
- excludeMethods: ["__setTools", "__setLogger", "__setTelemetry", "#log"]
405
- })];
406
- var MastraAuthProvider = class extends (_a = MastraBase) {
119
+ var MastraAuthProvider = class extends MastraBase {
120
+ protected;
121
+ public;
407
122
  constructor(options) {
408
- super({
409
- component: "AUTH",
410
- name: options?.name
411
- });
123
+ super({ component: "AUTH", name: options?.name });
412
124
  if (options?.authorizeUser) {
413
125
  this.authorizeUser = options.authorizeUser.bind(this);
414
126
  }
127
+ this.protected = options?.protected;
128
+ this.public = options?.public;
415
129
  }
416
130
  registerOptions(opts) {
417
131
  if (opts?.authorizeUser) {
418
132
  this.authorizeUser = opts.authorizeUser.bind(this);
419
133
  }
134
+ if (opts?.protected) {
135
+ this.protected = opts.protected;
136
+ }
137
+ if (opts?.public) {
138
+ this.public = opts.public;
139
+ }
420
140
  }
421
141
  };
422
- MastraAuthProvider = /* @__PURE__ */ ((_) => {
423
- _init = __decoratorStart(_a);
424
- MastraAuthProvider = __decorateElement(_init, 0, "MastraAuthProvider", _MastraAuthProvider_decorators, MastraAuthProvider);
425
- __runInitializers(_init, 1, MastraAuthProvider);
426
- return MastraAuthProvider;
427
- })();
428
142
  var MastraAuthWorkos = class extends MastraAuthProvider {
429
143
  workos;
430
144
  constructor(options) {