@magemetrics/core 0.11.3 → 0.11.5

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/dist/index.d.ts CHANGED
@@ -150,9 +150,6 @@ declare interface components {
150
150
  ReportData: {
151
151
  [key: string]: unknown;
152
152
  }[];
153
- VisualizationData: {
154
- [key: string]: string | (number | null) | unknown | null;
155
- }[];
156
153
  VisualizationWithData: {
157
154
  id: number;
158
155
  flow_data_id: number;
@@ -275,6 +272,9 @@ declare interface components {
275
272
  sampledCount: number;
276
273
  };
277
274
  };
275
+ VisualizationData: {
276
+ [key: string]: string | (number | null) | unknown | null;
277
+ }[];
278
278
  /** @description Prompt starter template */
279
279
  PromptStarter: {
280
280
  id: number;
@@ -292,7 +292,7 @@ declare interface components {
292
292
  /** Format: uuid */
293
293
  id: string;
294
294
  /** Format: uuid */
295
- agent_id: string;
295
+ agent_id: string | null;
296
296
  /** Format: uuid */
297
297
  flow_id: string | null;
298
298
  /** @enum {string} */
@@ -334,7 +334,18 @@ declare interface components {
334
334
  [key: string]: unknown;
335
335
  };
336
336
  } | null;
337
+ cached?: boolean;
337
338
  };
339
+ StartAgentRunRequest: {
340
+ /** Format: uuid */
341
+ agent_id: string;
342
+ /** @default {} */
343
+ inputs: {
344
+ [key: string]: unknown;
345
+ };
346
+ execution_context?: components["schemas"]["ExecutionContextInput"];
347
+ };
348
+ ExecutionContextInput: components["schemas"]["ImpersonateContext"] | components["schemas"]["CustomMetadataContext"];
338
349
  ImpersonateContext: {
339
350
  /**
340
351
  * @description discriminator enum property added by openapi-typescript
@@ -355,20 +366,12 @@ declare interface components {
355
366
  [key: string]: unknown;
356
367
  };
357
368
  };
358
- ExecutionContextInput: components["schemas"]["ImpersonateContext"] | components["schemas"]["CustomMetadataContext"];
359
- StartAgentRunRequest: {
360
- /** Format: uuid */
361
- agent_id: string;
362
- /** @default {} */
363
- inputs: {
364
- [key: string]: unknown;
365
- };
366
- execution_context?: components["schemas"]["ExecutionContextInput"];
369
+ AgentRunCountsResponse: {
370
+ [key: string]: number;
367
371
  };
368
372
  Agent: {
369
373
  /** Format: uuid */
370
374
  id: string;
371
- company_id: number;
372
375
  name: string;
373
376
  objective: string | null;
374
377
  generated_objective_fragment: string | null;
@@ -410,6 +413,20 @@ declare interface components {
410
413
  /** @description Detailed steps or description of what the task will do */
411
414
  description?: string;
412
415
  }[] | null;
416
+ model_config: {
417
+ /** @enum {string} */
418
+ model: "gemini-3.1-pro-preview";
419
+ /** @enum {string} */
420
+ thinking?: "low" | "high";
421
+ } | {
422
+ /** @enum {string} */
423
+ model: "claude-sonnet-4-6" | "claude-opus-4-6";
424
+ /** @enum {string} */
425
+ effort?: "low" | "medium" | "high";
426
+ } | {
427
+ /** @enum {string} */
428
+ model: "claude-haiku-4-5";
429
+ } | null;
413
430
  master_prompt_name: string | null;
414
431
  master_prompt_version: number | null;
415
432
  created_at: string;
@@ -427,14 +444,6 @@ declare interface components {
427
444
  /** @enum {string} */
428
445
  type: "global";
429
446
  };
430
- SchemaPath: {
431
- /** @description Schema or dataset name in the source database */
432
- dataset: string;
433
- /** @description Table name in the source database */
434
- table_name: string;
435
- /** @description Column name (optional). Omit for table-level items, include for column-level items. */
436
- column_name?: string;
437
- };
438
447
  CreateSchemaKnowledgeItem: {
439
448
  content: string;
440
449
  /** @description Optional identifier from your system, used for lookup and batch operations */
@@ -448,6 +457,14 @@ declare interface components {
448
457
  type: "schema";
449
458
  path: components["schemas"]["SchemaPath"];
450
459
  };
460
+ SchemaPath: {
461
+ /** @description Schema or dataset name in the source database */
462
+ dataset: string;
463
+ /** @description Table name in the source database */
464
+ table_name: string;
465
+ /** @description Column name (optional). Omit for table-level items, include for column-level items. */
466
+ column_name?: string;
467
+ };
451
468
  };
452
469
  responses: never;
453
470
  parameters: never;
@@ -3219,6 +3236,20 @@ declare interface operations {
3219
3236
  /** @description Detailed steps or description of what the task will do */
3220
3237
  description?: string;
3221
3238
  }[];
3239
+ model_config?: {
3240
+ /** @enum {string} */
3241
+ model: "gemini-3.1-pro-preview";
3242
+ /** @enum {string} */
3243
+ thinking?: "low" | "high";
3244
+ } | {
3245
+ /** @enum {string} */
3246
+ model: "claude-sonnet-4-6" | "claude-opus-4-6";
3247
+ /** @enum {string} */
3248
+ effort?: "low" | "medium" | "high";
3249
+ } | {
3250
+ /** @enum {string} */
3251
+ model: "claude-haiku-4-5";
3252
+ };
3222
3253
  master_prompt_name?: string;
3223
3254
  master_prompt_version?: number;
3224
3255
  };
@@ -3359,6 +3390,20 @@ declare interface operations {
3359
3390
  /** @description Detailed steps or description of what the task will do */
3360
3391
  description?: string;
3361
3392
  }[] | null;
3393
+ model_config?: {
3394
+ /** @enum {string} */
3395
+ model: "gemini-3.1-pro-preview";
3396
+ /** @enum {string} */
3397
+ thinking?: "low" | "high";
3398
+ } | {
3399
+ /** @enum {string} */
3400
+ model: "claude-sonnet-4-6" | "claude-opus-4-6";
3401
+ /** @enum {string} */
3402
+ effort?: "low" | "medium" | "high";
3403
+ } | {
3404
+ /** @enum {string} */
3405
+ model: "claude-haiku-4-5";
3406
+ } | null;
3362
3407
  master_prompt_name?: string | null;
3363
3408
  master_prompt_version?: number | null;
3364
3409
  };
package/dist/index.js CHANGED
@@ -58,7 +58,7 @@ var addApiKeyHeader = (apiKey) => {
58
58
 
59
59
  // package.json
60
60
  var package_default = {
61
- version: "0.11.3"};
61
+ version: "0.11.5"};
62
62
 
63
63
  // src/core/MageMetricsEventEmitter.ts
64
64
  var MageMetricsEventEmitter = class {
@@ -152,7 +152,7 @@ var hashString = (value) => {
152
152
  return Array.from(hash).map((b) => b.toString(16).padStart(2, "0")).join("");
153
153
  };
154
154
 
155
- // ../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@8.1.0_zod@4.3.6/node_modules/@asteasolutions/zod-to-openapi/dist/index.mjs
155
+ // ../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@8.4.1_zod@4.3.6/node_modules/@asteasolutions/zod-to-openapi/dist/index.mjs
156
156
  function __rest(s, e) {
157
157
  var t = {};
158
158
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -170,9 +170,11 @@ var ZodTypeKeys = {
170
170
  ZodBigInt: "bigint",
171
171
  ZodBoolean: "boolean",
172
172
  ZodDefault: "default",
173
+ ZodPrefault: "prefault",
173
174
  ZodTransform: "transform",
174
175
  ZodEnum: "enum",
175
176
  ZodIntersection: "intersection",
177
+ ZodLazy: "lazy",
176
178
  ZodLiteral: "literal",
177
179
  ZodNever: "never",
178
180
  ZodNull: "null",
@@ -191,7 +193,8 @@ var ZodTypeKeys = {
191
193
  ZodDiscriminatedUnion: "union",
192
194
  ZodUnknown: "unknown",
193
195
  ZodVoid: "void",
194
- ZodDate: "date"
196
+ ZodDate: "date",
197
+ ZodTemplateLiteral: "template_literal"
195
198
  };
196
199
  function isZodType(schema, typeNames) {
197
200
  const typeNamesArray = Array.isArray(typeNames) ? typeNames : [typeNames];
@@ -205,7 +208,7 @@ function isZodType(schema, typeNames) {
205
208
  });
206
209
  }
207
210
  function isAnyZodType(schema) {
208
- return "def" in schema;
211
+ return schema && "def" in schema;
209
212
  }
210
213
  var $ZodRegistry = class {
211
214
  constructor() {
@@ -284,6 +287,7 @@ var Metadata = class {
284
287
  "ZodOptional",
285
288
  "ZodNullable",
286
289
  "ZodDefault",
290
+ "ZodPrefault",
287
291
  "ZodReadonly",
288
292
  "ZodNonOptional"
289
293
  ]) && isAnyZodType(schema._zod.def.innerType)) {
@@ -344,7 +348,8 @@ var Metadata = class {
344
348
  return this.unwrapUntil(schema);
345
349
  }
346
350
  static getDefaultValue(zodSchema) {
347
- const unwrapped = this.unwrapUntil(zodSchema, "ZodDefault");
351
+ var _a;
352
+ const unwrapped = (_a = this.unwrapUntil(zodSchema, "ZodDefault")) !== null && _a !== void 0 ? _a : this.unwrapUntil(zodSchema, "ZodPrefault");
348
353
  return unwrapped === null || unwrapped === void 0 ? void 0 : unwrapped._zod.def.defaultValue;
349
354
  }
350
355
  static unwrapUntil(schema, typeName) {
@@ -355,6 +360,7 @@ var Metadata = class {
355
360
  "ZodOptional",
356
361
  "ZodNullable",
357
362
  "ZodDefault",
363
+ "ZodPrefault",
358
364
  "ZodReadonly",
359
365
  "ZodNonOptional"
360
366
  ]) && isAnyZodType(schema._zod.def.innerType)) {
@@ -417,7 +423,13 @@ function extendZodWithOpenApi(zod) {
417
423
  param: Object.assign(Object.assign({}, currentMetadata === null || currentMetadata === void 0 ? void 0 : currentMetadata.param), param)
418
424
  } : void 0);
419
425
  const result = new this.constructor(this._def);
420
- Metadata.setMetadataInRegistry(result, Object.assign(Object.assign({}, Object.keys(_internal).length > 0 ? { _internal } : void 0), resultMetadata));
426
+ function setMetadata(schema) {
427
+ Metadata.setMetadataInRegistry(schema, Object.assign(Object.assign({}, Object.keys(_internal).length > 0 ? { _internal } : void 0), resultMetadata));
428
+ }
429
+ setMetadata(result);
430
+ if (isZodType(result, "ZodLazy")) {
431
+ setMetadata(this);
432
+ }
421
433
  if (isZodType(result, "ZodObject")) {
422
434
  const currentMetadata2 = Metadata.getMetadataFromRegistry(result);
423
435
  const originalExtend = result.extend;
@@ -470,7 +482,7 @@ function getOpenApiConfiguration(refOrOpenapi, metadataOrOptions, options) {
470
482
  };
471
483
  }
472
484
 
473
- // ../../node_modules/.pnpm/hono@4.11.10/node_modules/hono/dist/router/reg-exp-router/node.js
485
+ // ../../node_modules/.pnpm/hono@4.12.7/node_modules/hono/dist/router/reg-exp-router/node.js
474
486
  new Set(".\\+*[^]$()");
475
487
  var createRoute = (routeConfig) => {
476
488
  const route = {
@@ -627,7 +639,7 @@ var ExternalAuthProvider = class {
627
639
  supabaseClient = null;
628
640
  noAuthApiClient = null;
629
641
  authApiResponse = null;
630
- processedJwt = Symbol("initial");
642
+ processedJwt = /* @__PURE__ */ Symbol("initial");
631
643
  userId = null;
632
644
  events = new MageMetricsEventEmitter();
633
645
  constructor(config) {
@@ -669,7 +681,7 @@ var ExternalAuthProvider = class {
669
681
  async updateExternalJwt(jwt) {
670
682
  if (this.config.externalJwt === jwt) return;
671
683
  this.config.externalJwt = jwt;
672
- this.processedJwt = Symbol("updating");
684
+ this.processedJwt = /* @__PURE__ */ Symbol("updating");
673
685
  await this.initialize();
674
686
  }
675
687
  async logout() {
@@ -833,10 +845,9 @@ var ExternalAuthProvider = class {
833
845
  }
834
846
  }
835
847
  };
836
- var SupabaseUserHeaderSchema = z.object({
848
+ var SupabaseHeaderSchema = z.object({
837
849
  [HEADER_SP_TOKEN]: z.string().optional()
838
850
  });
839
- var SupabaseHeaderSchema = SupabaseUserHeaderSchema;
840
851
  var FEEDBACK_OPTIONS = [
841
852
  { label: "Helpful", value: "helpful" },
842
853
  { label: "Partially helpful", value: "partially helpful" },