@magemetrics/core 0.12.2 → 0.13.0

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 (3) hide show
  1. package/dist/index.d.ts +801 -34
  2. package/dist/index.js +760 -37
  3. package/package.json +4 -4
package/dist/index.d.ts CHANGED
@@ -336,8 +336,6 @@ declare interface components {
336
336
  id: string;
337
337
  /** Format: uuid */
338
338
  agent_id: string | null;
339
- /** Format: uuid */
340
- flow_id: string | null;
341
339
  /** @enum {string} */
342
340
  status: "pending" | "running" | "post_processing" | "completed" | "failed" | "cancelled";
343
341
  created_at: string;
@@ -377,6 +375,8 @@ declare interface components {
377
375
  [key: string]: unknown;
378
376
  };
379
377
  } | null;
378
+ /** Format: uuid */
379
+ agent_version_id?: string | null;
380
380
  cached?: boolean;
381
381
  };
382
382
  StartAgentRunRequest: {
@@ -415,6 +415,7 @@ declare interface components {
415
415
  Agent: {
416
416
  /** Format: uuid */
417
417
  id: string;
418
+ created_at: string;
418
419
  name: string;
419
420
  objective: string | null;
420
421
  generated_objective_fragment: string | null;
@@ -449,7 +450,75 @@ declare interface components {
449
450
  })[] | null;
450
451
  output_schema: {
451
452
  [key: string]: unknown;
453
+ };
454
+ task_plan: {
455
+ id: string;
456
+ title: string;
457
+ /** @description Detailed steps or description of what the task will do */
458
+ description?: string;
459
+ }[] | null;
460
+ model_config: {
461
+ /** @enum {string} */
462
+ model: "gemini-3.1-pro-preview";
463
+ /** @enum {string} */
464
+ thinking?: "low" | "high";
465
+ } | {
466
+ /** @enum {string} */
467
+ model: "gemini-2.5-pro";
468
+ /** @enum {string} */
469
+ thinking?: "low" | "high";
470
+ } | {
471
+ /** @enum {string} */
472
+ model: "claude-sonnet-4-6" | "claude-opus-4-6";
473
+ /** @enum {string} */
474
+ effort?: "low" | "medium" | "high";
475
+ } | {
476
+ /** @enum {string} */
477
+ model: "claude-haiku-4-5" | "claude-opus-4-5";
452
478
  } | null;
479
+ /** @enum {string} */
480
+ execution_platform: "native" | "sandbox" | "sandbox_public";
481
+ updated_at: string;
482
+ };
483
+ AgentVersion: {
484
+ /** Format: uuid */
485
+ id: string;
486
+ version: number;
487
+ name: string;
488
+ objective: string | null;
489
+ generated_objective_fragment: string | null;
490
+ active_tools: string[] | null;
491
+ input_schema: ({
492
+ id: string;
493
+ name: string;
494
+ description?: string;
495
+ /** @enum {string} */
496
+ type: "enum";
497
+ options: {
498
+ value: string;
499
+ fragment?: string;
500
+ }[];
501
+ /** @default false */
502
+ useFragmentMapping: boolean;
503
+ /** @default false */
504
+ required: boolean;
505
+ } | {
506
+ id: string;
507
+ name: string;
508
+ description?: string;
509
+ /** @enum {string} */
510
+ type: "text";
511
+ /**
512
+ * @default false
513
+ * @enum {boolean}
514
+ */
515
+ useFragmentMapping: false;
516
+ /** @default false */
517
+ required: boolean;
518
+ })[] | null;
519
+ output_schema: {
520
+ [key: string]: unknown;
521
+ };
453
522
  task_plan: {
454
523
  id: string;
455
524
  title: string;
@@ -477,15 +546,13 @@ declare interface components {
477
546
  } | null;
478
547
  /** @enum {string} */
479
548
  execution_platform: "native" | "sandbox" | "sandbox_public";
480
- master_prompt_name: string | null;
481
- master_prompt_version: number | null;
549
+ restored_from_version?: number | null;
482
550
  created_at: string;
483
- updated_at: string;
484
551
  };
485
552
  CreateGlobalKnowledgeItem: {
486
553
  content: string;
487
- /** @description Optional identifier from your system, used for lookup and batch operations */
488
- external_id?: string;
554
+ /** @description Stable, client-defined identifier from your system.Use it to look up, update, or upsert the item without tracking Magemetrics internal IDs. */
555
+ client_reference_id?: string;
489
556
  /** @default true */
490
557
  is_active: boolean;
491
558
  tags?: string[];
@@ -496,8 +563,8 @@ declare interface components {
496
563
  };
497
564
  CreateSchemaKnowledgeItem: {
498
565
  content: string;
499
- /** @description Optional identifier from your system, used for lookup and batch operations */
500
- external_id?: string;
566
+ /** @description Stable, client-defined identifier from your system.Use it to look up, update, or upsert the item without tracking Magemetrics internal IDs. */
567
+ client_reference_id?: string;
501
568
  /** @default true */
502
569
  is_active: boolean;
503
570
  tags?: string[];
@@ -515,6 +582,31 @@ declare interface components {
515
582
  /** @description Column name (optional). Omit for table-level items, include for column-level items. */
516
583
  column_name?: string;
517
584
  };
585
+ UpsertGlobalKnowledgeItem: {
586
+ content: string;
587
+ /** @description Stable, client-defined identifier from your system.Use it to look up, update, or upsert the item without tracking Magemetrics internal IDs. */
588
+ client_reference_id: string;
589
+ /** @default true */
590
+ is_active: boolean;
591
+ tags?: string[];
592
+ /** @description IDs of applications this item is scoped to. Empty or omitted means all applications. */
593
+ application_ids?: number[];
594
+ /** @enum {string} */
595
+ type: "global";
596
+ };
597
+ UpsertSchemaKnowledgeItem: {
598
+ content: string;
599
+ /** @description Stable, client-defined identifier from your system.Use it to look up, update, or upsert the item without tracking Magemetrics internal IDs. */
600
+ client_reference_id: string;
601
+ /** @default true */
602
+ is_active: boolean;
603
+ tags?: string[];
604
+ /** @description IDs of applications this item is scoped to. Empty or omitted means all applications. */
605
+ application_ids?: number[];
606
+ /** @enum {string} */
607
+ type: "schema";
608
+ path: components["schemas"]["SchemaPath"];
609
+ };
518
610
  StatisticsResponse: {
519
611
  /** @description The time period in days for these statistics */
520
612
  period_days: number;
@@ -533,7 +625,7 @@ declare interface components {
533
625
  /** @description Statistics for agent-generated content (custom agent runs only) */
534
626
  AgentGeneratedStatistics: {
535
627
  /** @description Number of custom agent runs */
536
- agent_runs: number;
628
+ agent_runs: number | null;
537
629
  };
538
630
  };
539
631
  responses: never;
@@ -572,11 +664,15 @@ declare type CustomDataParts = {
572
664
  };
573
665
  "report-status": {
574
666
  status: string | null;
667
+ report_id?: string;
668
+ tool_call_id?: string;
575
669
  };
576
670
  "report-narration": {
577
671
  step_name: string;
578
672
  step_order: number;
579
673
  narration: string;
674
+ report_id?: string;
675
+ tool_call_id?: string;
580
676
  };
581
677
  };
582
678
 
@@ -705,7 +801,7 @@ declare const inputSchema_10: z.ZodObject<{
705
801
  }, z.core.$strip>;
706
802
 
707
803
  declare const inputSchema_2: z.ZodObject<{
708
- reportId: z.ZodNumber;
804
+ reportId: z.ZodUnion<[z.ZodNumber, z.ZodUUID]>;
709
805
  chartType: z.ZodEnum<{
710
806
  bar: "bar";
711
807
  "line/area": "line/area";
@@ -871,7 +967,6 @@ export declare class MageMetricsClient {
871
967
  }[]>;
872
968
  getFlowDataReports: (flowId: string) => Promise<{
873
969
  created_at: string;
874
- flow_id: string;
875
970
  id: number;
876
971
  uuid: string;
877
972
  title: string;
@@ -906,6 +1001,101 @@ export declare class MageMetricsClient {
906
1001
  materialized_error_message: string | null;
907
1002
  materialized_status: "completed" | "running" | "failed" | null;
908
1003
  }[]>;
1004
+ getAgentRunReports: (agentRunId: string) => Promise<{
1005
+ created_at: string;
1006
+ id: number;
1007
+ uuid: string;
1008
+ title: string;
1009
+ request: string | null;
1010
+ data_summary: {
1011
+ [x: string]: unknown;
1012
+ columns: {
1013
+ [x: string]: {
1014
+ [x: string]: unknown;
1015
+ position?: number | undefined;
1016
+ data_type: string;
1017
+ null_count: number | null;
1018
+ unique_count: number | null;
1019
+ unique_percentage: number | null;
1020
+ min_value?: number | null | undefined;
1021
+ max_value?: number | null | undefined;
1022
+ avg_value?: number | null | undefined;
1023
+ median_value?: number | null | undefined;
1024
+ std_value?: number | null | undefined;
1025
+ min_date?: string | null | undefined;
1026
+ max_date?: string | null | undefined;
1027
+ min_length?: number | null | undefined;
1028
+ max_length?: number | null | undefined;
1029
+ avg_length?: number | null | undefined;
1030
+ };
1031
+ };
1032
+ };
1033
+ status: string | null;
1034
+ is_removed: boolean;
1035
+ is_materialized: boolean | null;
1036
+ last_materialized_at: string | null;
1037
+ materialized_error_message: string | null;
1038
+ materialized_status: "completed" | "running" | "failed" | null;
1039
+ }[]>;
1040
+ getAgentRunVisualizations: (agentRunId: string) => Promise<{
1041
+ id: number;
1042
+ uuid: string;
1043
+ report_uuid: string;
1044
+ flow_data_id: number;
1045
+ created_at: string;
1046
+ flow_data?: {
1047
+ is_materialized: boolean | null;
1048
+ last_materialized_at: string | null;
1049
+ materialized_error_message: string | null;
1050
+ materialized_status: "completed" | "running" | "failed" | null;
1051
+ } | undefined;
1052
+ materialization?: {
1053
+ is_materialized: boolean | null;
1054
+ last_materialized_at: string | null;
1055
+ materialized_error_message: string | null;
1056
+ materialized_status: "completed" | "running" | "failed" | null;
1057
+ } | undefined;
1058
+ configuration: {
1059
+ type: "bar";
1060
+ title: string;
1061
+ config_version: 2;
1062
+ xAxisLabel: string;
1063
+ yAxisLabel: string;
1064
+ categoryColumn: string;
1065
+ secondaryCategoryColumn?: string | undefined;
1066
+ valueColumn: string;
1067
+ } | {
1068
+ type: "line/area";
1069
+ config_version: 2;
1070
+ title: string;
1071
+ xAxisColumn: string;
1072
+ valueColumns: string[];
1073
+ yAxisLabels: string[];
1074
+ } | {
1075
+ type: "line/area-categorical";
1076
+ title: string;
1077
+ config_version: 2;
1078
+ valueColumn: string;
1079
+ xAxisColumn: string;
1080
+ xAxisLabel: string;
1081
+ yAxisLabel: string;
1082
+ categoryColumn: string;
1083
+ } | {
1084
+ type: "scatter";
1085
+ title: string;
1086
+ config_version: 2;
1087
+ xAxisLabel: string;
1088
+ yAxisLabel: string;
1089
+ xAxisValueColumn: string;
1090
+ yAxisValueColumn: string;
1091
+ } | {
1092
+ type: "pie";
1093
+ title: string;
1094
+ config_version: 2;
1095
+ categoryColumn: string;
1096
+ valueColumn: string;
1097
+ };
1098
+ }[]>;
909
1099
  getFlow: (flowId: string) => Promise<{
910
1100
  created_at: string;
911
1101
  id: string;
@@ -971,20 +1161,20 @@ export declare class MageMetricsClient {
971
1161
  is_public: boolean;
972
1162
  }>;
973
1163
  };
974
- exportReportData: (reportId: number, format?: "text" | "blob") => Promise<{
1164
+ exportReportData: (reportId: string, format?: "text" | "blob") => Promise<{
975
1165
  filename: string;
976
1166
  data: Blob | string;
977
1167
  }>;
978
1168
  getChatTransport: (flowId: string, options?: MageMetricsChatTransportOptions) => MageMetricsChatTransport;
979
1169
  getChatMessages: (flowId: string) => Promise<MMChatUIMessage[]>;
980
- fetchReportData: (reportId: number, { columns, limit, sorting, filters, cursor }: ReportDataFilters, signal?: AbortSignal) => Promise<{
1170
+ fetchReportData: (reportId: string, { columns, limit, sorting, filters, cursor }: ReportDataFilters, signal?: AbortSignal) => Promise<{
981
1171
  [x: string]: unknown;
982
1172
  }[]>;
983
1173
  createSpeechToken: () => Promise<{
984
1174
  token: string;
985
1175
  expiresAt: string;
986
1176
  }>;
987
- getReport: (reportId: number) => Promise<{
1177
+ getReport: (reportId: string) => Promise<{
988
1178
  columns: {
989
1179
  name: string;
990
1180
  data_type: string;
@@ -996,7 +1186,7 @@ export declare class MageMetricsClient {
996
1186
  rowCount: {
997
1187
  count: number;
998
1188
  };
999
- data: (reportId: number, { columns, limit, sorting, filters, cursor }: ReportDataFilters, signal?: AbortSignal) => Promise<{
1189
+ data: (reportId: string, { columns, limit, sorting, filters, cursor }: ReportDataFilters, signal?: AbortSignal) => Promise<{
1000
1190
  [x: string]: unknown;
1001
1191
  }[]>;
1002
1192
  }>;
@@ -1251,6 +1441,17 @@ declare interface operations {
1251
1441
  "application/json": components["schemas"]["ReportData"];
1252
1442
  };
1253
1443
  };
1444
+ /** @description Invalid canvas, report or flow */
1445
+ 400: {
1446
+ headers: {
1447
+ [name: string]: unknown;
1448
+ };
1449
+ content: {
1450
+ "application/json": {
1451
+ error: string;
1452
+ };
1453
+ };
1454
+ };
1254
1455
  /** @description Unable to retrieve report with this id */
1255
1456
  404: {
1256
1457
  headers: {
@@ -1300,6 +1501,17 @@ declare interface operations {
1300
1501
  };
1301
1502
  };
1302
1503
  };
1504
+ /** @description Invalid canvas, report or flow */
1505
+ 400: {
1506
+ headers: {
1507
+ [name: string]: unknown;
1508
+ };
1509
+ content: {
1510
+ "application/json": {
1511
+ error: string;
1512
+ };
1513
+ };
1514
+ };
1303
1515
  /** @description Unable to retrieve report with this id */
1304
1516
  404: {
1305
1517
  headers: {
@@ -1553,7 +1765,6 @@ declare interface operations {
1553
1765
  content: {
1554
1766
  "application/json": {
1555
1767
  created_at: string;
1556
- flow_id: string;
1557
1768
  /**
1558
1769
  * @deprecated
1559
1770
  * @description Deprecated: use uuid.
@@ -2113,7 +2324,6 @@ declare interface operations {
2113
2324
  content: {
2114
2325
  "application/json": {
2115
2326
  created_at: string;
2116
- flow_id: string;
2117
2327
  /**
2118
2328
  * @deprecated
2119
2329
  * @description Deprecated: use uuid.
@@ -3036,6 +3246,7 @@ declare interface operations {
3036
3246
  query?: never;
3037
3247
  header?: {
3038
3248
  "sp-access-token"?: string;
3249
+ "X-Application-Name"?: string;
3039
3250
  };
3040
3251
  path?: never;
3041
3252
  cookie?: never;
@@ -3136,29 +3347,245 @@ declare interface operations {
3136
3347
  };
3137
3348
  };
3138
3349
  };
3139
- listAgents: {
3350
+ getAgentRunReports: {
3140
3351
  parameters: {
3141
3352
  query?: never;
3142
3353
  header?: {
3143
3354
  "sp-access-token"?: string;
3144
3355
  };
3145
- path?: never;
3356
+ path: {
3357
+ id: string;
3358
+ };
3146
3359
  cookie?: never;
3147
3360
  };
3148
3361
  requestBody?: never;
3149
3362
  responses: {
3150
- /** @description List of agents for the company */
3363
+ /** @description Reports generated by this agent run */
3151
3364
  200: {
3152
3365
  headers: {
3153
3366
  [name: string]: unknown;
3154
3367
  };
3155
3368
  content: {
3156
- "application/json": components["schemas"]["Agent"][];
3369
+ "application/json": {
3370
+ created_at: string;
3371
+ /**
3372
+ * @deprecated
3373
+ * @description Deprecated: use uuid.
3374
+ */
3375
+ id: number;
3376
+ uuid: string;
3377
+ title: string;
3378
+ request: string | null;
3379
+ data_summary: {
3380
+ columns: {
3381
+ [key: string]: {
3382
+ position?: number;
3383
+ data_type: string;
3384
+ null_count: number | null;
3385
+ unique_count: number | null;
3386
+ unique_percentage: number | null;
3387
+ min_value?: number | null;
3388
+ max_value?: number | null;
3389
+ avg_value?: number | null;
3390
+ median_value?: number | null;
3391
+ std_value?: number | null;
3392
+ min_date?: string | null;
3393
+ max_date?: string | null;
3394
+ min_length?: number | null;
3395
+ max_length?: number | null;
3396
+ avg_length?: number | null;
3397
+ } & {
3398
+ [key: string]: unknown;
3399
+ };
3400
+ };
3401
+ } & {
3402
+ [key: string]: unknown;
3403
+ };
3404
+ status: string | null;
3405
+ is_removed: boolean;
3406
+ is_materialized: boolean | null;
3407
+ last_materialized_at: string | null;
3408
+ materialized_error_message: string | null;
3409
+ /** @enum {string|null} */
3410
+ materialized_status: "completed" | "running" | "failed" | null;
3411
+ }[];
3157
3412
  };
3158
3413
  };
3159
- /** @description Internal server error */
3160
- 500: {
3161
- headers: {
3414
+ /** @description Agent run not found */
3415
+ 404: {
3416
+ headers: {
3417
+ [name: string]: unknown;
3418
+ };
3419
+ content: {
3420
+ "application/json": {
3421
+ error: string;
3422
+ };
3423
+ };
3424
+ };
3425
+ /** @description Internal server error */
3426
+ 500: {
3427
+ headers: {
3428
+ [name: string]: unknown;
3429
+ };
3430
+ content: {
3431
+ "application/json": {
3432
+ error: string;
3433
+ };
3434
+ };
3435
+ };
3436
+ };
3437
+ };
3438
+ getAgentRunVisualizations: {
3439
+ parameters: {
3440
+ query?: never;
3441
+ header?: {
3442
+ "sp-access-token"?: string;
3443
+ };
3444
+ path: {
3445
+ id: string;
3446
+ };
3447
+ cookie?: never;
3448
+ };
3449
+ requestBody?: never;
3450
+ responses: {
3451
+ /** @description Visualizations generated by this agent run */
3452
+ 200: {
3453
+ headers: {
3454
+ [name: string]: unknown;
3455
+ };
3456
+ content: {
3457
+ "application/json": {
3458
+ /**
3459
+ * @deprecated
3460
+ * @description Deprecated: use uuid.
3461
+ */
3462
+ id: number;
3463
+ uuid: string;
3464
+ report_uuid: string;
3465
+ /**
3466
+ * @deprecated
3467
+ * @description Deprecated: use report_uuid.
3468
+ */
3469
+ flow_data_id: number;
3470
+ created_at: string;
3471
+ /**
3472
+ * @deprecated
3473
+ * @description Deprecated: use materialization.
3474
+ */
3475
+ flow_data?: {
3476
+ is_materialized: boolean | null;
3477
+ last_materialized_at: string | null;
3478
+ materialized_error_message: string | null;
3479
+ /** @enum {string|null} */
3480
+ materialized_status: "completed" | "running" | "failed" | null;
3481
+ };
3482
+ materialization?: {
3483
+ is_materialized: boolean | null;
3484
+ last_materialized_at: string | null;
3485
+ materialized_error_message: string | null;
3486
+ /** @enum {string|null} */
3487
+ materialized_status: "completed" | "running" | "failed" | null;
3488
+ };
3489
+ configuration: {
3490
+ /** @enum {string} */
3491
+ type: "bar";
3492
+ title: string;
3493
+ /** @enum {number} */
3494
+ config_version: 2;
3495
+ xAxisLabel: string;
3496
+ yAxisLabel: string;
3497
+ categoryColumn: string;
3498
+ secondaryCategoryColumn?: string;
3499
+ valueColumn: string;
3500
+ } | {
3501
+ /** @enum {string} */
3502
+ type: "line/area";
3503
+ /** @enum {number} */
3504
+ config_version: 2;
3505
+ title: string;
3506
+ xAxisColumn: string;
3507
+ valueColumns: string[];
3508
+ yAxisLabels: string[];
3509
+ } | {
3510
+ /** @enum {string} */
3511
+ type: "line/area-categorical";
3512
+ title: string;
3513
+ /** @enum {number} */
3514
+ config_version: 2;
3515
+ valueColumn: string;
3516
+ xAxisColumn: string;
3517
+ xAxisLabel: string;
3518
+ yAxisLabel: string;
3519
+ categoryColumn: string;
3520
+ } | {
3521
+ /** @enum {string} */
3522
+ type: "scatter";
3523
+ title: string;
3524
+ /** @enum {number} */
3525
+ config_version: 2;
3526
+ xAxisLabel: string;
3527
+ yAxisLabel: string;
3528
+ xAxisValueColumn: string;
3529
+ yAxisValueColumn: string;
3530
+ } | {
3531
+ /** @enum {string} */
3532
+ type: "pie";
3533
+ title: string;
3534
+ /** @enum {number} */
3535
+ config_version: 2;
3536
+ categoryColumn: string;
3537
+ valueColumn: string;
3538
+ };
3539
+ }[];
3540
+ };
3541
+ };
3542
+ /** @description Agent run not found */
3543
+ 404: {
3544
+ headers: {
3545
+ [name: string]: unknown;
3546
+ };
3547
+ content: {
3548
+ "application/json": {
3549
+ error: string;
3550
+ };
3551
+ };
3552
+ };
3553
+ /** @description Internal server error */
3554
+ 500: {
3555
+ headers: {
3556
+ [name: string]: unknown;
3557
+ };
3558
+ content: {
3559
+ "application/json": {
3560
+ error: string;
3561
+ };
3562
+ };
3563
+ };
3564
+ };
3565
+ };
3566
+ listAgents: {
3567
+ parameters: {
3568
+ query?: never;
3569
+ header?: {
3570
+ "sp-access-token"?: string;
3571
+ };
3572
+ path?: never;
3573
+ cookie?: never;
3574
+ };
3575
+ requestBody?: never;
3576
+ responses: {
3577
+ /** @description List of agents for the company */
3578
+ 200: {
3579
+ headers: {
3580
+ [name: string]: unknown;
3581
+ };
3582
+ content: {
3583
+ "application/json": components["schemas"]["Agent"][];
3584
+ };
3585
+ };
3586
+ /** @description Internal server error */
3587
+ 500: {
3588
+ headers: {
3162
3589
  [name: string]: unknown;
3163
3590
  };
3164
3591
  content: {
@@ -3247,8 +3674,6 @@ declare interface operations {
3247
3674
  * @enum {string}
3248
3675
  */
3249
3676
  execution_platform?: "native" | "sandbox" | "sandbox_public";
3250
- master_prompt_name?: string;
3251
- master_prompt_version?: number;
3252
3677
  };
3253
3678
  };
3254
3679
  };
@@ -3380,7 +3805,7 @@ declare interface operations {
3380
3805
  })[] | null;
3381
3806
  output_schema?: {
3382
3807
  [key: string]: unknown;
3383
- } | null;
3808
+ };
3384
3809
  task_plan?: {
3385
3810
  id: string;
3386
3811
  title: string;
@@ -3408,8 +3833,6 @@ declare interface operations {
3408
3833
  } | null;
3409
3834
  /** @enum {string} */
3410
3835
  execution_platform?: "native" | "sandbox" | "sandbox_public";
3411
- master_prompt_name?: string | null;
3412
- master_prompt_version?: number | null;
3413
3836
  };
3414
3837
  };
3415
3838
  };
@@ -3507,6 +3930,99 @@ declare interface operations {
3507
3930
  };
3508
3931
  };
3509
3932
  };
3933
+ listAgentVersions: {
3934
+ parameters: {
3935
+ query?: never;
3936
+ header?: {
3937
+ "sp-access-token"?: string;
3938
+ };
3939
+ path: {
3940
+ id: string;
3941
+ };
3942
+ cookie?: never;
3943
+ };
3944
+ requestBody?: never;
3945
+ responses: {
3946
+ /** @description List of versions for the agent (newest first) */
3947
+ 200: {
3948
+ headers: {
3949
+ [name: string]: unknown;
3950
+ };
3951
+ content: {
3952
+ "application/json": components["schemas"]["AgentVersion"][];
3953
+ };
3954
+ };
3955
+ /** @description Agent not found */
3956
+ 404: {
3957
+ headers: {
3958
+ [name: string]: unknown;
3959
+ };
3960
+ content: {
3961
+ "application/json": {
3962
+ error: string;
3963
+ };
3964
+ };
3965
+ };
3966
+ /** @description Internal server error */
3967
+ 500: {
3968
+ headers: {
3969
+ [name: string]: unknown;
3970
+ };
3971
+ content: {
3972
+ "application/json": {
3973
+ error: string;
3974
+ };
3975
+ };
3976
+ };
3977
+ };
3978
+ };
3979
+ restoreAgentVersion: {
3980
+ parameters: {
3981
+ query?: never;
3982
+ header?: {
3983
+ "sp-access-token"?: string;
3984
+ };
3985
+ path: {
3986
+ id: string;
3987
+ version: number;
3988
+ };
3989
+ cookie?: never;
3990
+ };
3991
+ requestBody?: never;
3992
+ responses: {
3993
+ /** @description The agent after restoring the version (new version created) */
3994
+ 200: {
3995
+ headers: {
3996
+ [name: string]: unknown;
3997
+ };
3998
+ content: {
3999
+ "application/json": components["schemas"]["Agent"];
4000
+ };
4001
+ };
4002
+ /** @description Agent or version not found */
4003
+ 404: {
4004
+ headers: {
4005
+ [name: string]: unknown;
4006
+ };
4007
+ content: {
4008
+ "application/json": {
4009
+ error: string;
4010
+ };
4011
+ };
4012
+ };
4013
+ /** @description Internal server error */
4014
+ 500: {
4015
+ headers: {
4016
+ [name: string]: unknown;
4017
+ };
4018
+ content: {
4019
+ "application/json": {
4020
+ error: string;
4021
+ };
4022
+ };
4023
+ };
4024
+ };
4025
+ };
3510
4026
  listApplications: {
3511
4027
  parameters: {
3512
4028
  query?: never;
@@ -3807,8 +4323,12 @@ declare interface operations {
3807
4323
  /** @description Schema or dataset name in the source database */
3808
4324
  dataset: string;
3809
4325
  table_name: string;
4326
+ /** @description Catalog/lakehouse name for backends with a 3-level namespace (e.g. Microsoft Fabric). NULL otherwise. */
4327
+ database: string | null;
3810
4328
  description: string | null;
3811
4329
  is_visible: boolean;
4330
+ /** @description IDs of applications this table is linked to. Empty means no links. */
4331
+ application_ids: number[];
3812
4332
  created_at: string;
3813
4333
  updated_at: string;
3814
4334
  }[];
@@ -3842,11 +4362,13 @@ declare interface operations {
3842
4362
  /** @description Schema or dataset name in the source database */
3843
4363
  dataset: string;
3844
4364
  table_name: string;
4365
+ /** @description Optional catalog/lakehouse name for backends with a 3-level namespace (e.g. Microsoft Fabric: [lakehouse].[schema].[table]). Leave unset for backends where the connection default catalog suffices. */
4366
+ database?: string | null;
3845
4367
  /** @default true */
3846
4368
  is_visible?: boolean;
3847
4369
  /** @description Optional RLS policy to create alongside the table */
3848
4370
  rls_policy?: {
3849
- /** @description SQL condition appended to queries on this table to restrict row access. Use [var:name] for context variables and [table:name] for table references — these are auto-detected and stored as context_variables and depends_on_tables. */
4371
+ /** @description SQL condition appended to queries on this table to restrict row access. Use [var:name] for context variables and [table:dataset.name] for table references — these are auto-detected and stored as context_variables and depends_on_tables. */
3850
4372
  condition: string;
3851
4373
  /** @default true */
3852
4374
  is_active?: boolean;
@@ -3865,6 +4387,8 @@ declare interface operations {
3865
4387
  /** @default true */
3866
4388
  is_active?: boolean;
3867
4389
  }[];
4390
+ /** @description IDs of applications to link this table to. Omitting or passing [] creates no links. */
4391
+ application_ids?: number[];
3868
4392
  };
3869
4393
  };
3870
4394
  };
@@ -3880,8 +4404,12 @@ declare interface operations {
3880
4404
  /** @description Schema or dataset name in the source database */
3881
4405
  dataset: string;
3882
4406
  table_name: string;
4407
+ /** @description Catalog/lakehouse name for backends with a 3-level namespace (e.g. Microsoft Fabric). NULL otherwise. */
4408
+ database: string | null;
3883
4409
  description: string | null;
3884
4410
  is_visible: boolean;
4411
+ /** @description IDs of applications this table is linked to. Empty means no links. */
4412
+ application_ids: number[];
3885
4413
  created_at: string;
3886
4414
  updated_at: string;
3887
4415
  columns: {
@@ -3983,6 +4511,151 @@ declare interface operations {
3983
4511
  };
3984
4512
  };
3985
4513
  };
4514
+ createTablesBatch: {
4515
+ parameters: {
4516
+ query?: never;
4517
+ header?: {
4518
+ "sp-access-token"?: string;
4519
+ };
4520
+ path?: never;
4521
+ cookie?: never;
4522
+ };
4523
+ requestBody: {
4524
+ content: {
4525
+ "application/json": {
4526
+ /** @description Schema or dataset name in the source database */
4527
+ dataset: string;
4528
+ table_name: string;
4529
+ /** @description Optional catalog/lakehouse name for backends with a 3-level namespace (e.g. Microsoft Fabric: [lakehouse].[schema].[table]). Leave unset for backends where the connection default catalog suffices. */
4530
+ database?: string | null;
4531
+ /** @default true */
4532
+ is_visible?: boolean;
4533
+ /** @description Optional RLS policy to create alongside the table */
4534
+ rls_policy?: {
4535
+ /** @description SQL condition appended to queries on this table to restrict row access. Use [var:name] for context variables and [table:dataset.name] for table references — these are auto-detected and stored as context_variables and depends_on_tables. */
4536
+ condition: string;
4537
+ /** @default true */
4538
+ is_active?: boolean;
4539
+ };
4540
+ /** @description Optional access rules to create alongside the table */
4541
+ access?: {
4542
+ /** @description Top-level field name in the user metadata (e.g., company_id, department_name) */
4543
+ context_variable: string;
4544
+ /**
4545
+ * @description Comparison operator. Must be "=" or "!=".
4546
+ * @enum {string}
4547
+ */
4548
+ operator: "=" | "!=";
4549
+ /** @description Static value to compare against, e.g. `user_123`. */
4550
+ value: string;
4551
+ /** @default true */
4552
+ is_active?: boolean;
4553
+ }[];
4554
+ /** @description IDs of applications to link this table to. Omitting or passing [] creates no links. */
4555
+ application_ids?: number[];
4556
+ }[];
4557
+ };
4558
+ };
4559
+ responses: {
4560
+ /** @description Batch creation results. Each item indicates whether the table was created or failed, with per-table error details. */
4561
+ 200: {
4562
+ headers: {
4563
+ [name: string]: unknown;
4564
+ };
4565
+ content: {
4566
+ "application/json": {
4567
+ results: ({
4568
+ /** @enum {string} */
4569
+ status: "created";
4570
+ dataset: string;
4571
+ table_name: string;
4572
+ table: {
4573
+ id: number;
4574
+ /** @description Schema or dataset name in the source database */
4575
+ dataset: string;
4576
+ table_name: string;
4577
+ /** @description Catalog/lakehouse name for backends with a 3-level namespace (e.g. Microsoft Fabric). NULL otherwise. */
4578
+ database: string | null;
4579
+ description: string | null;
4580
+ is_visible: boolean;
4581
+ /** @description IDs of applications this table is linked to. Empty means no links. */
4582
+ application_ids: number[];
4583
+ created_at: string;
4584
+ updated_at: string;
4585
+ columns: {
4586
+ id: number;
4587
+ table_id: number;
4588
+ name: string;
4589
+ data_type: string | null;
4590
+ description: string | null;
4591
+ /** @description Whether this column is visible to end users */
4592
+ is_visible: boolean;
4593
+ /** @description Whether this column is indexed for search and filtering */
4594
+ is_indexed: boolean;
4595
+ created_at: string;
4596
+ updated_at: string;
4597
+ }[];
4598
+ rls_policy: {
4599
+ id: number;
4600
+ table_id: number;
4601
+ /** @description SQL condition appended to queries on this table to restrict row access */
4602
+ condition: string;
4603
+ /** @description Variables referenced in the condition, resolved from user context at query time */
4604
+ context_variables: string[];
4605
+ /** @description Other tables referenced by this policy's condition (for query planning) */
4606
+ depends_on_tables: string[];
4607
+ is_active: boolean;
4608
+ created_at: string;
4609
+ updated_at: string;
4610
+ } | null;
4611
+ access: {
4612
+ id: number;
4613
+ table_id: number;
4614
+ /** @description Top-level field name in the user metadata (e.g., company_id, department_name) */
4615
+ context_variable: string;
4616
+ /** @description Comparison operator. Must be "=" or "!=". */
4617
+ operator: string;
4618
+ /** @description Static value to compare against, e.g. `user_123`. */
4619
+ value: string;
4620
+ is_active: boolean;
4621
+ created_at: string;
4622
+ updated_at: string;
4623
+ }[];
4624
+ };
4625
+ } | {
4626
+ /** @enum {string} */
4627
+ status: "failed";
4628
+ dataset: string;
4629
+ table_name: string;
4630
+ error: string;
4631
+ })[];
4632
+ };
4633
+ };
4634
+ };
4635
+ /** @description Invalid request (e.g. empty array or exceeds 50 items) */
4636
+ 400: {
4637
+ headers: {
4638
+ [name: string]: unknown;
4639
+ };
4640
+ content: {
4641
+ "application/json": {
4642
+ error: string;
4643
+ };
4644
+ };
4645
+ };
4646
+ /** @description Internal server error */
4647
+ 500: {
4648
+ headers: {
4649
+ [name: string]: unknown;
4650
+ };
4651
+ content: {
4652
+ "application/json": {
4653
+ error: string;
4654
+ };
4655
+ };
4656
+ };
4657
+ };
4658
+ };
3986
4659
  getTable: {
3987
4660
  parameters: {
3988
4661
  query?: never;
@@ -4007,8 +4680,12 @@ declare interface operations {
4007
4680
  /** @description Schema or dataset name in the source database */
4008
4681
  dataset: string;
4009
4682
  table_name: string;
4683
+ /** @description Catalog/lakehouse name for backends with a 3-level namespace (e.g. Microsoft Fabric). NULL otherwise. */
4684
+ database: string | null;
4010
4685
  description: string | null;
4011
4686
  is_visible: boolean;
4687
+ /** @description IDs of applications this table is linked to. Empty means no links. */
4688
+ application_ids: number[];
4012
4689
  created_at: string;
4013
4690
  updated_at: string;
4014
4691
  columns: {
@@ -4144,7 +4821,7 @@ declare interface operations {
4144
4821
  is_visible?: boolean;
4145
4822
  /** @description Upsert the RLS policy: updates existing if found, creates if not (condition required for create) */
4146
4823
  rls_policy?: {
4147
- /** @description SQL condition appended to queries on this table to restrict row access. Use [var:name] for context variables and [table:name] for table references — these are auto-detected and stored as context_variables and depends_on_tables. */
4824
+ /** @description SQL condition appended to queries on this table to restrict row access. Use [var:name] for context variables and [table:dataset.name] for table references — these are auto-detected and stored as context_variables and depends_on_tables. */
4148
4825
  condition?: string;
4149
4826
  /** @default true */
4150
4827
  is_active?: boolean;
@@ -4163,6 +4840,8 @@ declare interface operations {
4163
4840
  /** @default true */
4164
4841
  is_active?: boolean;
4165
4842
  }[];
4843
+ /** @description Replace table-to-application links. Empty array clears all links. */
4844
+ application_ids?: number[];
4166
4845
  };
4167
4846
  };
4168
4847
  };
@@ -4178,8 +4857,12 @@ declare interface operations {
4178
4857
  /** @description Schema or dataset name in the source database */
4179
4858
  dataset: string;
4180
4859
  table_name: string;
4860
+ /** @description Catalog/lakehouse name for backends with a 3-level namespace (e.g. Microsoft Fabric). NULL otherwise. */
4861
+ database: string | null;
4181
4862
  description: string | null;
4182
4863
  is_visible: boolean;
4864
+ /** @description IDs of applications this table is linked to. Empty means no links. */
4865
+ application_ids: number[];
4183
4866
  created_at: string;
4184
4867
  updated_at: string;
4185
4868
  columns: {
@@ -4331,7 +5014,7 @@ declare interface operations {
4331
5014
  requestBody: {
4332
5015
  content: {
4333
5016
  "application/json": {
4334
- /** @description SQL condition appended to queries on this table to restrict row access. Use [var:name] for context variables and [table:name] for table references — these are auto-detected and stored as context_variables and depends_on_tables. */
5017
+ /** @description SQL condition appended to queries on this table to restrict row access. Use [var:name] for context variables and [table:dataset.name] for table references — these are auto-detected and stored as context_variables and depends_on_tables. */
4335
5018
  condition: string;
4336
5019
  /** @default true */
4337
5020
  is_active?: boolean;
@@ -4518,7 +5201,7 @@ declare interface operations {
4518
5201
  requestBody: {
4519
5202
  content: {
4520
5203
  "application/json": {
4521
- /** @description SQL condition appended to queries on this table to restrict row access. Use [var:name] for context variables and [table:name] for table references — these are auto-detected and stored as context_variables and depends_on_tables. */
5204
+ /** @description SQL condition appended to queries on this table to restrict row access. Use [var:name] for context variables and [table:dataset.name] for table references — these are auto-detected and stored as context_variables and depends_on_tables. */
4522
5205
  condition?: string;
4523
5206
  is_active?: boolean;
4524
5207
  };
@@ -5118,6 +5801,7 @@ declare interface operations {
5118
5801
  query?: never;
5119
5802
  header?: {
5120
5803
  "sp-access-token"?: string;
5804
+ "X-Application-Name"?: string;
5121
5805
  };
5122
5806
  path?: never;
5123
5807
  cookie?: never;
@@ -5803,6 +6487,38 @@ declare interface paths {
5803
6487
  patch?: never;
5804
6488
  trace?: never;
5805
6489
  };
6490
+ "/api/v1/agent-runs/{id}/reports": {
6491
+ parameters: {
6492
+ query?: never;
6493
+ header?: never;
6494
+ path?: never;
6495
+ cookie?: never;
6496
+ };
6497
+ get: operations["getAgentRunReports"];
6498
+ put?: never;
6499
+ post?: never;
6500
+ delete?: never;
6501
+ options?: never;
6502
+ head?: never;
6503
+ patch?: never;
6504
+ trace?: never;
6505
+ };
6506
+ "/api/v1/agent-runs/{id}/visualizations": {
6507
+ parameters: {
6508
+ query?: never;
6509
+ header?: never;
6510
+ path?: never;
6511
+ cookie?: never;
6512
+ };
6513
+ get: operations["getAgentRunVisualizations"];
6514
+ put?: never;
6515
+ post?: never;
6516
+ delete?: never;
6517
+ options?: never;
6518
+ head?: never;
6519
+ patch?: never;
6520
+ trace?: never;
6521
+ };
5806
6522
  "/api/v1/agents": {
5807
6523
  parameters: {
5808
6524
  query?: never;
@@ -5835,6 +6551,38 @@ declare interface paths {
5835
6551
  patch?: never;
5836
6552
  trace?: never;
5837
6553
  };
6554
+ "/api/v1/agents/{id}/versions": {
6555
+ parameters: {
6556
+ query?: never;
6557
+ header?: never;
6558
+ path?: never;
6559
+ cookie?: never;
6560
+ };
6561
+ get: operations["listAgentVersions"];
6562
+ put?: never;
6563
+ post?: never;
6564
+ delete?: never;
6565
+ options?: never;
6566
+ head?: never;
6567
+ patch?: never;
6568
+ trace?: never;
6569
+ };
6570
+ "/api/v1/agents/{id}/versions/{version}/restore": {
6571
+ parameters: {
6572
+ query?: never;
6573
+ header?: never;
6574
+ path?: never;
6575
+ cookie?: never;
6576
+ };
6577
+ get?: never;
6578
+ put?: never;
6579
+ post: operations["restoreAgentVersion"];
6580
+ delete?: never;
6581
+ options?: never;
6582
+ head?: never;
6583
+ patch?: never;
6584
+ trace?: never;
6585
+ };
5838
6586
  "/api/v1/applications": {
5839
6587
  parameters: {
5840
6588
  query?: never;
@@ -5883,6 +6631,22 @@ declare interface paths {
5883
6631
  patch?: never;
5884
6632
  trace?: never;
5885
6633
  };
6634
+ "/api/v1/tables/batch": {
6635
+ parameters: {
6636
+ query?: never;
6637
+ header?: never;
6638
+ path?: never;
6639
+ cookie?: never;
6640
+ };
6641
+ get?: never;
6642
+ put?: never;
6643
+ post: operations["createTablesBatch"];
6644
+ delete?: never;
6645
+ options?: never;
6646
+ head?: never;
6647
+ patch?: never;
6648
+ trace?: never;
6649
+ };
5886
6650
  "/api/v1/tables/{id}": {
5887
6651
  parameters: {
5888
6652
  query?: never;
@@ -6059,6 +6823,7 @@ declare const redactedOutputSchema: z.ZodObject<{
6059
6823
  status: z.ZodLiteral<"success">;
6060
6824
  public: z.ZodObject<{
6061
6825
  flowDataId: z.ZodNumber;
6826
+ reportId: z.ZodString;
6062
6827
  answer: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6063
6828
  title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6064
6829
  }, z.core.$strip>;
@@ -6093,7 +6858,9 @@ declare const redactedOutputSchema_2: z.ZodObject<{
6093
6858
  status: z.ZodLiteral<"success">;
6094
6859
  public: z.ZodObject<{
6095
6860
  flowDataId: z.ZodNumber;
6861
+ reportId: z.ZodString;
6096
6862
  flowDataVisualizationId: z.ZodNumber;
6863
+ visualizationId: z.ZodString;
6097
6864
  title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6098
6865
  type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6099
6866
  }, z.core.$strip>;