@magemetrics/core 0.14.0 → 0.14.1

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
@@ -146,6 +146,7 @@ export declare type CanonicalDataType = z.infer<typeof CanonicalDataTypeSchema>;
146
146
 
147
147
  declare const CanonicalDataTypeSchema: z.ZodEnum<{
148
148
  boolean: "boolean";
149
+ date: "date";
149
150
  array: "array";
150
151
  text: "text";
151
152
  json: "json";
@@ -184,6 +185,8 @@ export declare interface ColumnSort {
184
185
 
185
186
  declare interface components {
186
187
  schemas: {
188
+ /** Format: uuid */
189
+ CanvasId: string;
187
190
  ReportColumns: {
188
191
  name: string;
189
192
  data_type: string;
@@ -191,14 +194,12 @@ declare interface components {
191
194
  renderType?: string;
192
195
  unit?: string;
193
196
  /** @enum {string} */
194
- canonicalDataType?: "numeric" | "boolean" | "datetime" | "text" | "array" | "json" | "other";
197
+ canonicalDataType?: "numeric" | "boolean" | "datetime" | "date" | "text" | "array" | "json" | "other";
195
198
  formatHint?: {
196
199
  isNumeric?: boolean;
197
200
  isLikelyYear?: boolean;
198
201
  };
199
202
  }[];
200
- /** Format: uuid */
201
- CanvasId: string;
202
203
  ReportData: {
203
204
  [key: string]: unknown;
204
205
  }[];
@@ -366,9 +367,6 @@ declare interface components {
366
367
  sampledCount: number;
367
368
  };
368
369
  };
369
- VisualizationData: {
370
- [key: string]: string | (number | null) | unknown | null;
371
- }[];
372
370
  /** @description Prompt starter template */
373
371
  PromptStarter: {
374
372
  id: number;
@@ -445,36 +443,11 @@ declare interface components {
445
443
  };
446
444
  execution_context?: components["schemas"]["ExecutionContextInput"];
447
445
  };
448
- ExecutionContextInput: components["schemas"]["ImpersonateContext"] | components["schemas"]["CustomMetadataContext"];
449
- ImpersonateContext: {
450
- /**
451
- * @description discriminator enum property added by openapi-typescript
452
- * @enum {string}
453
- */
454
- mode: "impersonate";
455
- /** @description The user ID in the customer's system */
456
- external_user_id: string;
457
- };
458
- CustomMetadataContext: {
459
- /**
460
- * @description discriminator enum property added by openapi-typescript
461
- * @enum {string}
462
- */
463
- mode: "custom";
464
- /** @description Raw metadata key-value pairs for data access rules */
465
- metadata: {
466
- [key: string]: unknown;
467
- };
468
- };
469
- AgentRunCountsResponse: {
470
- [key: string]: number;
471
- };
472
446
  Agent: {
473
447
  /** Format: uuid */
474
448
  id: string;
475
449
  created_at: string;
476
450
  name: string;
477
- objective: string | null;
478
451
  generated_objective_fragment: string | null;
479
452
  active_tools: string[] | null;
480
453
  input_schema: ({
@@ -536,13 +509,13 @@ declare interface components {
536
509
  /** @enum {string} */
537
510
  execution_platform: "native" | "sandbox" | "sandbox_public";
538
511
  updated_at: string;
512
+ version_count: number;
539
513
  };
540
514
  AgentVersion: {
541
515
  /** Format: uuid */
542
516
  id: string;
543
517
  version: number;
544
518
  name: string;
545
- objective: string | null;
546
519
  generated_objective_fragment: string | null;
547
520
  active_tools: string[] | null;
548
521
  input_schema: ({
@@ -606,70 +579,36 @@ declare interface components {
606
579
  restored_from_version?: number | null;
607
580
  created_at: string;
608
581
  };
609
- CreateGlobalKnowledgeItem: {
610
- content: string;
611
- /** @description Stable, client-defined identifier from your system.Use it to look up, update, or upsert the item without tracking Magemetrics internal IDs. */
612
- client_reference_id?: string;
613
- /** @default true */
614
- is_active: boolean;
615
- tags?: string[];
616
- /** @description IDs of applications this item is scoped to. Empty or omitted means all applications. */
617
- application_ids?: number[];
618
- /** @enum {string} */
619
- type: "global";
620
- };
621
- CreateSchemaKnowledgeItem: {
622
- content: string;
623
- /** @description Stable, client-defined identifier from your system.Use it to look up, update, or upsert the item without tracking Magemetrics internal IDs. */
624
- client_reference_id?: string;
625
- /** @default true */
626
- is_active: boolean;
627
- tags?: string[];
628
- /** @description IDs of applications this item is scoped to. Empty or omitted means all applications. */
629
- application_ids?: number[];
630
- /** @enum {string} */
631
- type: "schema";
632
- path: components["schemas"]["SchemaPath"];
633
- };
634
- SchemaPath: {
635
- /** @description Schema or dataset name in the source database */
636
- dataset: string;
637
- /** @description Table name in the source database */
638
- table_name: string;
639
- /** @description Column name (optional). Omit for table-level items, include for column-level items. */
640
- column_name?: string;
641
- };
642
- UpsertGlobalKnowledgeItem: {
643
- content: string;
644
- /** @description Stable, client-defined identifier from your system.Use it to look up, update, or upsert the item without tracking Magemetrics internal IDs. */
645
- client_reference_id: string;
646
- /** @default true */
647
- is_active: boolean;
648
- tags?: string[];
649
- /** @description IDs of applications this item is scoped to. Empty or omitted means all applications. */
650
- application_ids?: number[];
651
- /** @enum {string} */
652
- type: "global";
653
- };
654
- UpsertSchemaKnowledgeItem: {
655
- content: string;
656
- /** @description Stable, client-defined identifier from your system.Use it to look up, update, or upsert the item without tracking Magemetrics internal IDs. */
657
- client_reference_id: string;
658
- /** @default true */
659
- is_active: boolean;
660
- tags?: string[];
661
- /** @description IDs of applications this item is scoped to. Empty or omitted means all applications. */
662
- application_ids?: number[];
663
- /** @enum {string} */
664
- type: "schema";
665
- path: components["schemas"]["SchemaPath"];
666
- };
582
+ ExecutionContextInput: components["schemas"]["ImpersonateContext"] | components["schemas"]["CustomMetadataContext"];
667
583
  StatisticsResponse: {
668
584
  /** @description The time period in days for these statistics */
669
585
  period_days: number;
670
586
  user_generated: components["schemas"]["UserGeneratedStatistics"];
671
587
  agent_generated: components["schemas"]["AgentGeneratedStatistics"];
672
588
  };
589
+ VisualizationData: {
590
+ [key: string]: string | (number | null) | unknown | null;
591
+ }[];
592
+ ImpersonateContext: {
593
+ /**
594
+ * @description discriminator enum property added by openapi-typescript
595
+ * @enum {string}
596
+ */
597
+ mode: "impersonate";
598
+ /** @description The user ID in the customer's system */
599
+ external_user_id: string;
600
+ };
601
+ CustomMetadataContext: {
602
+ /**
603
+ * @description discriminator enum property added by openapi-typescript
604
+ * @enum {string}
605
+ */
606
+ mode: "custom";
607
+ /** @description Raw metadata key-value pairs for data access rules */
608
+ metadata: {
609
+ [key: string]: unknown;
610
+ };
611
+ };
673
612
  /** @description Statistics for user-generated content (conversations, reports, visualizations) */
674
613
  UserGeneratedStatistics: {
675
614
  /** @description Number of user-created conversations */
@@ -867,6 +806,7 @@ declare const FrontendReportColumnsSchema: z.ZodArray<z.ZodObject<{
867
806
  unit: z.ZodOptional<z.ZodString>;
868
807
  canonicalDataType: z.ZodOptional<z.ZodEnum<{
869
808
  boolean: "boolean";
809
+ date: "date";
870
810
  array: "array";
871
811
  text: "text";
872
812
  json: "json";
@@ -1192,6 +1132,11 @@ declare const inputSchema_5: z.ZodObject<{}, z.core.$strip>;
1192
1132
  declare const inputSchema_6: z.ZodObject<{
1193
1133
  dataset: z.ZodString;
1194
1134
  table_name: z.ZodString;
1135
+ includeDescriptions: z.ZodDefault<z.ZodBoolean>;
1136
+ includeDataTypes: z.ZodDefault<z.ZodBoolean>;
1137
+ includeSampleValues: z.ZodDefault<z.ZodBoolean>;
1138
+ includeStatistics: z.ZodDefault<z.ZodBoolean>;
1139
+ includeFreshness: z.ZodDefault<z.ZodBoolean>;
1195
1140
  }, z.core.$strip>;
1196
1141
 
1197
1142
  declare const inputSchema_7: z.ZodObject<{
@@ -1561,7 +1506,7 @@ export declare class MageMetricsClient {
1561
1506
  dataType: string;
1562
1507
  renderType?: string | undefined;
1563
1508
  unit?: string | undefined;
1564
- canonicalDataType?: "numeric" | "boolean" | "datetime" | "text" | "array" | "json" | "other" | undefined;
1509
+ canonicalDataType?: "numeric" | "boolean" | "datetime" | "date" | "text" | "array" | "json" | "other" | undefined;
1565
1510
  formatHint?: {
1566
1511
  isNumeric?: boolean | undefined;
1567
1512
  isLikelyYear?: boolean | undefined;
@@ -2796,13 +2741,6 @@ declare interface operations {
2796
2741
  "application/json": {
2797
2742
  userQuery: string;
2798
2743
  applicationName?: string;
2799
- files?: {
2800
- /** @enum {string} */
2801
- type: "file";
2802
- mediaType: string;
2803
- filename?: string;
2804
- url: string;
2805
- }[];
2806
2744
  uploadedFileIds?: string[];
2807
2745
  };
2808
2746
  };
@@ -3998,7 +3936,6 @@ declare interface operations {
3998
3936
  content: {
3999
3937
  "application/json": {
4000
3938
  name: string;
4001
- objective?: string;
4002
3939
  generated_objective_fragment?: string;
4003
3940
  /** @default [] */
4004
3941
  active_tools?: string[];
@@ -4161,7 +4098,6 @@ declare interface operations {
4161
4098
  content: {
4162
4099
  "application/json": {
4163
4100
  name?: string;
4164
- objective?: string | null;
4165
4101
  generated_objective_fragment?: string | null;
4166
4102
  active_tools?: string[];
4167
4103
  input_schema?: ({
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.14.0"};
61
+ version: "0.14.1"};
62
62
 
63
63
  // src/core/MageMetricsEventEmitter.ts
64
64
  var MageMetricsEventEmitter = class {
@@ -483,7 +483,7 @@ function getOpenApiConfiguration(refOrOpenapi, metadataOrOptions, options) {
483
483
  };
484
484
  }
485
485
 
486
- // ../../node_modules/.pnpm/hono@4.12.18/node_modules/hono/dist/router/reg-exp-router/node.js
486
+ // ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/router/reg-exp-router/node.js
487
487
  new Set(".\\+*[^]$()");
488
488
  var createRoute = (routeConfig) => {
489
489
  const route = {
@@ -1089,10 +1089,30 @@ var BusinessExplanationSchema = z.object({
1089
1089
  explanation: z.string()
1090
1090
  }))
1091
1091
  });
1092
+ var MONTH_ABBREVIATION_LOCALE = "en-month-abbreviation";
1092
1093
  dayjs.extend(relativeTime);
1093
1094
  dayjs.extend(customParseFormat);
1094
1095
  dayjs.extend(utc);
1095
1096
  dayjs.extend(timezone);
1097
+ dayjs.locale({
1098
+ name: MONTH_ABBREVIATION_LOCALE,
1099
+ monthsShort: [
1100
+ "Jan.",
1101
+ "Feb.",
1102
+ "Mar.",
1103
+ "Apr.",
1104
+ "May",
1105
+ "Jun.",
1106
+ "Jul.",
1107
+ "Aug.",
1108
+ "Sep.",
1109
+ "Oct.",
1110
+ "Nov.",
1111
+ "Dec."
1112
+ ],
1113
+ formats: {},
1114
+ relativeTime: {}
1115
+ }, void 0, true);
1096
1116
  var daysjs_default = dayjs;
1097
1117
 
1098
1118
  // ../shared/dist/src/data/FormattedData.js
@@ -1392,6 +1412,7 @@ var CanonicalDataTypeSchema = z.enum([
1392
1412
  "numeric",
1393
1413
  "boolean",
1394
1414
  "datetime",
1415
+ "date",
1395
1416
  "text",
1396
1417
  "array",
1397
1418
  "json",
@@ -1661,12 +1682,6 @@ var parseReportId = (val, ctx) => {
1661
1682
  var ReportId = z.string().transform((val, ctx) => parseReportId(val, ctx)).openapi({ type: "string", description: "Numeric legacy ID or UUID" });
1662
1683
  var ReportIdFromBody = z.union([z.string(), z.number()]).transform((val, ctx) => parseReportId(String(val), ctx));
1663
1684
  var ReportIdParam = z.object({ report_id: ReportId }).openapi("ReportId", { type: "integer" });
1664
- var CreateFlowFileSchema = z.object({
1665
- type: z.literal("file"),
1666
- mediaType: z.string(),
1667
- filename: z.string().optional(),
1668
- url: z.string()
1669
- });
1670
1685
  var RetrieveFlowDataReports = createRoute({
1671
1686
  method: "get",
1672
1687
  path: "/api/v1/flows/{flowId}/data-reports",
@@ -2390,7 +2405,6 @@ var CreateFlow = createRoute({
2390
2405
  schema: z.object({
2391
2406
  userQuery: z.string(),
2392
2407
  applicationName: z.string().optional(),
2393
- files: z.array(CreateFlowFileSchema).max(CHAT_MAX_FILE_COUNT).optional(),
2394
2408
  uploadedFileIds: z.array(UploadedFileIdSchema).max(CHAT_MAX_FILE_COUNT).optional()
2395
2409
  })
2396
2410
  }
@@ -3295,7 +3309,6 @@ var BaseAgentSchema = z.object({
3295
3309
  });
3296
3310
  var AgentBehaviorSchema = z.object({
3297
3311
  name: z.string(),
3298
- objective: z.string().nullable(),
3299
3312
  generated_objective_fragment: z.string().nullable(),
3300
3313
  active_tools: z.array(z.string()).nullable(),
3301
3314
  input_schema: AgentInputSchemaSchema.nullable(),
@@ -3308,11 +3321,11 @@ var AgentSchema = z.object({
3308
3321
  ...BaseAgentSchema.shape,
3309
3322
  ...AgentBehaviorSchema.shape,
3310
3323
  updated_at: z.string(),
3311
- current_version_id: z.uuid()
3324
+ current_version_id: z.uuid(),
3325
+ version_count: z.number().int().positive()
3312
3326
  });
3313
3327
  z.object({
3314
3328
  name: z.string().min(1, "Name is required"),
3315
- objective: z.string().optional(),
3316
3329
  generated_objective_fragment: z.string().optional(),
3317
3330
  active_tools: z.array(z.string()).default([]),
3318
3331
  input_schema: AgentInputSchemaSchema.optional(),
@@ -3323,7 +3336,6 @@ z.object({
3323
3336
  });
3324
3337
  var DbUpdateAgentSchema = z.object({
3325
3338
  name: z.string().min(1).optional(),
3326
- objective: z.string().nullable().optional(),
3327
3339
  generated_objective_fragment: z.string().nullable().optional(),
3328
3340
  active_tools: z.array(z.string()).optional(),
3329
3341
  input_schema: AgentInputSchemaSchema.nullable().optional(),
@@ -4851,19 +4863,33 @@ z.object({
4851
4863
  result: z.discriminatedUnion("status", [RedactedSuccessVersion2, ErrorVersion3]).optional()
4852
4864
  });
4853
4865
  var GET_AVAILABLE_COLUMNS_FOR_TABLE = "getAvailableColumnsForTable";
4866
+ var ColumnMetadataSchema2 = z.object({
4867
+ // Always returned (not gated by any flag)
4868
+ name: z.string(),
4869
+ // includeDescriptions flag
4870
+ description: z.string().nullable().optional(),
4871
+ // includeDataTypes flag
4872
+ data_type: z.string().nullable().optional(),
4873
+ canonical_data_type: z.string().nullable().optional(),
4874
+ // includeSampleValues flag
4875
+ sample_values: z.array(z.unknown()).nullable().optional(),
4876
+ // includeStatistics flag
4877
+ null_percentage: z.number().nullable().optional(),
4878
+ unique_values: z.number().nullable().optional(),
4879
+ min_value: z.number().nullable().optional(),
4880
+ max_value: z.number().nullable().optional(),
4881
+ min_date: z.string().nullable().optional(),
4882
+ max_date: z.string().nullable().optional(),
4883
+ has_null: z.boolean().nullable().optional(),
4884
+ // includeFreshness flag
4885
+ updated_at: z.string().nullable().optional()
4886
+ });
4854
4887
  var SuccessVersion4 = z.object({
4855
4888
  status: z.literal("success"),
4856
4889
  public: z.looseObject({}),
4857
4890
  private: z.object({
4858
4891
  message: z.string().optional(),
4859
- columns: z.object({
4860
- name: z.string(),
4861
- data_type: z.string().nullable(),
4862
- description: z.string().nullable(),
4863
- null_percentage: z.number().nullable(),
4864
- unique_values: z.number().nullable(),
4865
- sample_values: z.array(z.any()).nullable()
4866
- }).array()
4892
+ columns: ColumnMetadataSchema2.array()
4867
4893
  })
4868
4894
  });
4869
4895
  var RedactedSuccessVersion3 = SuccessVersion4.omit({
@@ -4885,7 +4911,12 @@ GetAvailableColumnsForTableResponse.extend({
4885
4911
  });
4886
4912
  z.object({
4887
4913
  dataset: z.string().describe("The dataset (schema) the table belongs to."),
4888
- table_name: z.string().describe("A table name of the database for which to retrieve all column names and information.")
4914
+ table_name: z.string().describe("A table name of the database for which to retrieve all column names and information."),
4915
+ includeDescriptions: z.boolean().default(true).describe("Include semantic column descriptions in metadata. Default: true."),
4916
+ includeDataTypes: z.boolean().default(true).describe("Include canonical and raw data types in metadata. Default: true."),
4917
+ includeSampleValues: z.boolean().default(false).describe("Include indexing-time snapshot example values in metadata. Use only for illustrative examples, NOT for min/max questions. Default: false."),
4918
+ includeStatistics: z.boolean().default(false).describe("Include min/max, cardinality, and null statistics in metadata. Set to true when answering questions about extremes or data distribution shape (but not full distributions, which require querying the data directly). Default: false."),
4919
+ includeFreshness: z.boolean().default(false).describe("Include last synced timestamp for columns. Set to true when answering questions about data freshness or when the data was last updated. Default: false.")
4889
4920
  });
4890
4921
  var outputResultSchema3 = z.discriminatedUnion("status", [SuccessVersion4, ErrorVersion4]).optional();
4891
4922
  z.object({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magemetrics/core",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "description": "MageMetrics client library",
5
5
  "files": [
6
6
  "dist/"
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@noble/hashes": "^2.2.0",
37
- "@supabase/auth-js": "^2.105.4",
37
+ "@supabase/auth-js": "^2.107.0",
38
38
  "@xyflow/system": "^0.0.76",
39
39
  "ai": "6.0.175",
40
40
  "dayjs": "^1.11.20",