@magemetrics/core 0.0.60 → 0.1.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.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,10 @@
1
1
  import { Client } from 'openapi-fetch';
2
+ import { DefaultChatTransport } from 'ai';
3
+ import { HttpChatTransportInitOptions } from 'ai';
4
+ import type { InferUITool } from 'ai';
2
5
  import type { Simplify } from 'type-fest';
6
+ import type { Tool } from 'ai';
7
+ import type { UIMessage } from 'ai';
3
8
  import { z } from 'zod';
4
9
 
5
10
  /**
@@ -212,6 +217,21 @@ declare interface components {
212
217
  pathItems: never;
213
218
  }
214
219
 
220
+ /**
221
+ * Parameters for starting a flow
222
+ */
223
+ export declare type CreateFlowParam = {
224
+ query: string;
225
+ } | {
226
+ triggerId: string;
227
+ variables: Record<string, string>;
228
+ };
229
+
230
+ declare type CustomDataParts = {
231
+ "quick-actions": z.infer<typeof QuickActionsSchema>;
232
+ signal: z.infer<typeof SignalWithReportIdSchema>;
233
+ };
234
+
215
235
  declare type ExtractInsightResponse = z.infer<typeof ExtractInsightResponseSchema>;
216
236
 
217
237
  declare const ExtractInsightResponseSchema: z.ZodUnion<[z.ZodObject<{
@@ -381,8 +401,92 @@ export declare type GenerateInsightParam = {
381
401
 
382
402
  export declare const getPublicApiClient: (apiUrl: string, apiKey: string) => Client<NoAuthPaths>;
383
403
 
404
+ declare const inputSchema: z.ZodObject<{
405
+ userRequest: z.ZodString;
406
+ isNewAnalysisGoal: z.ZodBoolean;
407
+ responseType: z.ZodEnum<["text", "table", "visualization"]>;
408
+ difficultyLevel: z.ZodEnum<["simple", "moderate", "complex"]>;
409
+ }, "strip", z.ZodTypeAny, {
410
+ userRequest: string;
411
+ isNewAnalysisGoal: boolean;
412
+ responseType: "text" | "table" | "visualization";
413
+ difficultyLevel: "simple" | "moderate" | "complex";
414
+ }, {
415
+ userRequest: string;
416
+ isNewAnalysisGoal: boolean;
417
+ responseType: "text" | "table" | "visualization";
418
+ difficultyLevel: "simple" | "moderate" | "complex";
419
+ }>;
420
+
421
+ declare const inputSchema_2: z.ZodObject<{
422
+ chartType: z.ZodEnum<["bar", "line/area", "scatter", "pie"]>;
423
+ columnConfiguration: z.ZodObject<{
424
+ dimensionColumn: z.ZodString;
425
+ valueColumns: z.ZodArray<z.ZodString, "many">;
426
+ }, "strip", z.ZodTypeAny, {
427
+ dimensionColumn: string;
428
+ valueColumns: string[];
429
+ }, {
430
+ dimensionColumn: string;
431
+ valueColumns: string[];
432
+ }>;
433
+ explanations: z.ZodString;
434
+ }, "strip", z.ZodTypeAny, {
435
+ chartType: "bar" | "line/area" | "scatter" | "pie";
436
+ columnConfiguration: {
437
+ dimensionColumn: string;
438
+ valueColumns: string[];
439
+ };
440
+ explanations: string;
441
+ }, {
442
+ chartType: "bar" | "line/area" | "scatter" | "pie";
443
+ columnConfiguration: {
444
+ dimensionColumn: string;
445
+ valueColumns: string[];
446
+ };
447
+ explanations: string;
448
+ }>;
449
+
450
+ declare const inputSchema_3: z.ZodObject<{
451
+ thought: z.ZodString;
452
+ }, "strip", z.ZodTypeAny, {
453
+ thought: string;
454
+ }, {
455
+ thought: string;
456
+ }>;
457
+
458
+ declare const inputSchema_4: z.ZodObject<{
459
+ value: z.ZodString;
460
+ }, "strip", z.ZodTypeAny, {
461
+ value: string;
462
+ }, {
463
+ value: string;
464
+ }>;
465
+
466
+ declare const inputSchema_5: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
467
+
468
+ declare const inputSchema_6: z.ZodObject<{
469
+ table_name: z.ZodString;
470
+ }, "strip", z.ZodTypeAny, {
471
+ table_name: string;
472
+ }, {
473
+ table_name: string;
474
+ }>;
475
+
476
+ declare const inputSchema_7: z.ZodObject<{
477
+ query: z.ZodString;
478
+ }, "strip", z.ZodTypeAny, {
479
+ query: string;
480
+ }, {
481
+ query: string;
482
+ }>;
483
+
384
484
  declare type InternalApiClient = Simplify<Client<NoAuthPaths, `${string}/${string}`>>;
385
485
 
486
+ export declare class MageMetricsChatTransport extends DefaultChatTransport<MMChatUIMessage> {
487
+ constructor(apiUrl: string, flowId: string, options?: Omit<HttpChatTransportInitOptions<MMChatUIMessage>, "api" | "headers" | "prepareSendMessagesRequest">);
488
+ }
489
+
386
490
  /**
387
491
  * Core MageMetrics client that handles authentication lifecycle and provides
388
492
  * a promise-based API that automatically waits for authentication to complete.
@@ -431,13 +535,7 @@ export declare class MageMetricsClient {
431
535
  getRecentFlows: (params?: {
432
536
  limit?: number;
433
537
  }) => Promise<FrontendRecentFlows[]>;
434
- /**
435
- * @deprecated Use `createFlow` instead.
436
- * @param request the user request
437
- * @returns the id of the created flow
438
- */
439
- startFlow: (request: StartFlowParam) => Promise<string>;
440
- createFlow: (request: StartFlowParam) => Promise<{
538
+ createFlow: (request: CreateFlowParam) => Promise<{
441
539
  flowId: string;
442
540
  }>;
443
541
  getDashboard: (dashboardId: string) => Promise<FrontendDashboard>;
@@ -525,6 +623,18 @@ export declare class MemoryStorageAdapter implements AsyncStorage {
525
623
  removeItem(key: string): Promise<void>;
526
624
  }
527
625
 
626
+ declare type MMChatUIMessage = UIMessage<unknown, CustomDataParts, MMUiTools>;
627
+
628
+ declare type MMUiTools = {
629
+ generateDataReport: UiTool;
630
+ generateVisualization: UiTool_2;
631
+ think: UiTool_3;
632
+ valueBasedColumnSearch: UiTool_4;
633
+ getAvailableTables: UiTool_5;
634
+ getAvailableColumnsForTable: UiTool_6;
635
+ webSearch: UiTool_7;
636
+ };
637
+
528
638
  declare type NoAuthPaths = Simplify<{
529
639
  [Path in keyof paths]: RemoveAuthHeader<paths[Path]>;
530
640
  }>;
@@ -2463,7 +2573,7 @@ declare interface operations {
2463
2573
  };
2464
2574
  };
2465
2575
  };
2466
- getSankeyData: {
2576
+ listSankeyUserFilters: {
2467
2577
  parameters: {
2468
2578
  query?: never;
2469
2579
  header?: never;
@@ -2471,6 +2581,58 @@ declare interface operations {
2471
2581
  cookie?: never;
2472
2582
  };
2473
2583
  requestBody?: never;
2584
+ responses: {
2585
+ /** @description List of available user filters */
2586
+ 200: {
2587
+ headers: {
2588
+ [name: string]: unknown;
2589
+ };
2590
+ content: {
2591
+ "application/json": {
2592
+ id: number;
2593
+ field_key: string;
2594
+ display_name: string;
2595
+ /** @default true */
2596
+ is_active: boolean;
2597
+ /** @default false */
2598
+ include_visualization: boolean;
2599
+ values: (string | {
2600
+ label: string;
2601
+ value: string;
2602
+ })[];
2603
+ }[];
2604
+ };
2605
+ };
2606
+ /** @description Something wrong happened */
2607
+ 500: {
2608
+ headers: {
2609
+ [name: string]: unknown;
2610
+ };
2611
+ content: {
2612
+ "application/json": {
2613
+ error: string;
2614
+ };
2615
+ };
2616
+ };
2617
+ };
2618
+ };
2619
+ getSankeyData: {
2620
+ parameters: {
2621
+ query?: {
2622
+ user_id?: string;
2623
+ cluster_id?: number | null;
2624
+ subcluster_id?: number | null;
2625
+ /** @description Comma-separated list of bins: lt0.6,0.6-0.8,0.8-1 (applies to average score) */
2626
+ score_ranges?: string;
2627
+ /** @description JSON-encoded map of { [field_key]: string[] } to be passed to RPC */
2628
+ external_filters?: string;
2629
+ max_results?: number;
2630
+ };
2631
+ header?: never;
2632
+ path?: never;
2633
+ cookie?: never;
2634
+ };
2635
+ requestBody?: never;
2474
2636
  responses: {
2475
2637
  /** @description Sankey data retrieved successfully */
2476
2638
  200: {
@@ -2480,17 +2642,16 @@ declare interface operations {
2480
2642
  content: {
2481
2643
  "application/json": {
2482
2644
  metadata: {
2483
- embedding_type: string;
2484
- approach: string;
2485
2645
  total_clusters: number;
2486
- total_noise_points: number;
2487
2646
  total_requests: number;
2488
2647
  generation_timestamp: string;
2489
2648
  };
2490
2649
  clusters: {
2491
2650
  cluster_id: number;
2651
+ subcluster_id?: number | null;
2492
2652
  cluster_name: string;
2493
2653
  representative_questions: {
2654
+ subcluster_id: number;
2494
2655
  question: string;
2495
2656
  count: number;
2496
2657
  sample_requests: string[];
@@ -2503,6 +2664,27 @@ declare interface operations {
2503
2664
  avg_assumptions_score?: number | null;
2504
2665
  avg_friendliness_score?: number | null;
2505
2666
  }[];
2667
+ rows?: {
2668
+ flow_data_id: number;
2669
+ company_id: number;
2670
+ main_cluster_id: number;
2671
+ main_cluster_name: string;
2672
+ subcluster_id: number | null;
2673
+ subcluster_name: string | null;
2674
+ core_question: string | null;
2675
+ /** Format: uuid */
2676
+ user_id: string;
2677
+ initial_user_request: string | null;
2678
+ flow_data_request: string | null;
2679
+ flow_data_created_at: string | null;
2680
+ confidence_score: number | null;
2681
+ assumptions_score: number | null;
2682
+ friendliness_score: number | null;
2683
+ user_email: string | null;
2684
+ external: {
2685
+ [key: string]: unknown;
2686
+ } | null;
2687
+ }[];
2506
2688
  };
2507
2689
  };
2508
2690
  };
@@ -3322,6 +3504,22 @@ declare interface paths {
3322
3504
  patch?: never;
3323
3505
  trace?: never;
3324
3506
  };
3507
+ "/api/v1/admin-console/usage-insights/filters": {
3508
+ parameters: {
3509
+ query?: never;
3510
+ header?: never;
3511
+ path?: never;
3512
+ cookie?: never;
3513
+ };
3514
+ get: operations["listSankeyUserFilters"];
3515
+ put?: never;
3516
+ post?: never;
3517
+ delete?: never;
3518
+ options?: never;
3519
+ head?: never;
3520
+ patch?: never;
3521
+ trace?: never;
3522
+ };
3325
3523
  "/api/v1/admin-console/usage-insights/sankey": {
3326
3524
  parameters: {
3327
3525
  query?: never;
@@ -3420,6 +3618,598 @@ declare interface paths {
3420
3618
  };
3421
3619
  }
3422
3620
 
3621
+ declare const QuickActionsSchema: z.ZodArray<z.ZodObject<{
3622
+ label: z.ZodString;
3623
+ explanation: z.ZodString;
3624
+ }, "strip", z.ZodTypeAny, {
3625
+ label: string;
3626
+ explanation: string;
3627
+ }, {
3628
+ label: string;
3629
+ explanation: string;
3630
+ }>, "many">;
3631
+
3632
+ declare const redactedOutputSchema: z.ZodObject<{
3633
+ tool: z.ZodLiteral<"generateDataReport">;
3634
+ result: z.ZodOptional<z.ZodDiscriminatedUnion<"status", [z.ZodObject<Omit<{
3635
+ status: z.ZodLiteral<"success">;
3636
+ public: z.ZodObject<{
3637
+ flowDataId: z.ZodNumber;
3638
+ answer: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3639
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3640
+ }, "strip", z.ZodTypeAny, {
3641
+ flowDataId: number;
3642
+ title?: string | null | undefined;
3643
+ answer?: string | null | undefined;
3644
+ }, {
3645
+ flowDataId: number;
3646
+ title?: string | null | undefined;
3647
+ answer?: string | null | undefined;
3648
+ }>;
3649
+ private: z.ZodObject<{
3650
+ sql: z.ZodString;
3651
+ dataReportSummary: z.ZodString;
3652
+ }, "strip", z.ZodTypeAny, {
3653
+ sql: string;
3654
+ dataReportSummary: string;
3655
+ }, {
3656
+ sql: string;
3657
+ dataReportSummary: string;
3658
+ }>;
3659
+ }, "private">, "strip", z.ZodTypeAny, {
3660
+ status: "success";
3661
+ public: {
3662
+ flowDataId: number;
3663
+ title?: string | null | undefined;
3664
+ answer?: string | null | undefined;
3665
+ };
3666
+ }, {
3667
+ status: "success";
3668
+ public: {
3669
+ flowDataId: number;
3670
+ title?: string | null | undefined;
3671
+ answer?: string | null | undefined;
3672
+ };
3673
+ }>, z.ZodObject<{
3674
+ status: z.ZodLiteral<"error">;
3675
+ message: z.ZodString;
3676
+ }, "strip", z.ZodTypeAny, {
3677
+ message: string;
3678
+ status: "error";
3679
+ }, {
3680
+ message: string;
3681
+ status: "error";
3682
+ }>]>>;
3683
+ }, "strip", z.ZodTypeAny, {
3684
+ tool: "generateDataReport";
3685
+ result?: {
3686
+ status: "success";
3687
+ public: {
3688
+ flowDataId: number;
3689
+ title?: string | null | undefined;
3690
+ answer?: string | null | undefined;
3691
+ };
3692
+ } | {
3693
+ message: string;
3694
+ status: "error";
3695
+ } | undefined;
3696
+ }, {
3697
+ tool: "generateDataReport";
3698
+ result?: {
3699
+ status: "success";
3700
+ public: {
3701
+ flowDataId: number;
3702
+ title?: string | null | undefined;
3703
+ answer?: string | null | undefined;
3704
+ };
3705
+ } | {
3706
+ message: string;
3707
+ status: "error";
3708
+ } | undefined;
3709
+ }>;
3710
+
3711
+ declare const redactedOutputSchema_2: z.ZodObject<{
3712
+ tool: z.ZodLiteral<"generateVisualization">;
3713
+ result: z.ZodOptional<z.ZodDiscriminatedUnion<"status", [z.ZodObject<Omit<{
3714
+ status: z.ZodLiteral<"success">;
3715
+ public: z.ZodObject<{
3716
+ flowDataId: z.ZodNumber;
3717
+ flowDataVisualizationId: z.ZodNumber;
3718
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3719
+ type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3720
+ }, "strip", z.ZodTypeAny, {
3721
+ flowDataId: number;
3722
+ flowDataVisualizationId: number;
3723
+ type?: string | null | undefined;
3724
+ title?: string | null | undefined;
3725
+ }, {
3726
+ flowDataId: number;
3727
+ flowDataVisualizationId: number;
3728
+ type?: string | null | undefined;
3729
+ title?: string | null | undefined;
3730
+ }>;
3731
+ private: z.ZodObject<{
3732
+ sql: z.ZodOptional<z.ZodString>;
3733
+ dataReportSummary: z.ZodOptional<z.ZodString>;
3734
+ }, "strip", z.ZodTypeAny, {
3735
+ sql?: string | undefined;
3736
+ dataReportSummary?: string | undefined;
3737
+ }, {
3738
+ sql?: string | undefined;
3739
+ dataReportSummary?: string | undefined;
3740
+ }>;
3741
+ }, "private">, "strip", z.ZodTypeAny, {
3742
+ status: "success";
3743
+ public: {
3744
+ flowDataId: number;
3745
+ flowDataVisualizationId: number;
3746
+ type?: string | null | undefined;
3747
+ title?: string | null | undefined;
3748
+ };
3749
+ }, {
3750
+ status: "success";
3751
+ public: {
3752
+ flowDataId: number;
3753
+ flowDataVisualizationId: number;
3754
+ type?: string | null | undefined;
3755
+ title?: string | null | undefined;
3756
+ };
3757
+ }>, z.ZodObject<{
3758
+ status: z.ZodLiteral<"error">;
3759
+ message: z.ZodString;
3760
+ }, "strip", z.ZodTypeAny, {
3761
+ message: string;
3762
+ status: "error";
3763
+ }, {
3764
+ message: string;
3765
+ status: "error";
3766
+ }>]>>;
3767
+ }, "strip", z.ZodTypeAny, {
3768
+ tool: "generateVisualization";
3769
+ result?: {
3770
+ status: "success";
3771
+ public: {
3772
+ flowDataId: number;
3773
+ flowDataVisualizationId: number;
3774
+ type?: string | null | undefined;
3775
+ title?: string | null | undefined;
3776
+ };
3777
+ } | {
3778
+ message: string;
3779
+ status: "error";
3780
+ } | undefined;
3781
+ }, {
3782
+ tool: "generateVisualization";
3783
+ result?: {
3784
+ status: "success";
3785
+ public: {
3786
+ flowDataId: number;
3787
+ flowDataVisualizationId: number;
3788
+ type?: string | null | undefined;
3789
+ title?: string | null | undefined;
3790
+ };
3791
+ } | {
3792
+ message: string;
3793
+ status: "error";
3794
+ } | undefined;
3795
+ }>;
3796
+
3797
+ declare const redactedOutputSchema_3: z.ZodObject<{
3798
+ tool: z.ZodLiteral<"valueBasedColumnSearch">;
3799
+ result: z.ZodOptional<z.ZodDiscriminatedUnion<"status", [z.ZodObject<Omit<{
3800
+ status: z.ZodLiteral<"success">;
3801
+ public: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
3802
+ private: z.ZodObject<{
3803
+ message: z.ZodOptional<z.ZodString>;
3804
+ columns: z.ZodArray<z.ZodObject<{
3805
+ id: z.ZodNumber;
3806
+ name: z.ZodString;
3807
+ data_type: z.ZodNullable<z.ZodString>;
3808
+ description: z.ZodNullable<z.ZodString>;
3809
+ null_percentage: z.ZodNullable<z.ZodNumber>;
3810
+ unique_values: z.ZodNullable<z.ZodNumber>;
3811
+ sample_values: z.ZodNullable<z.ZodArray<z.ZodAny, "many">>;
3812
+ table: z.ZodObject<{
3813
+ table_name: z.ZodString;
3814
+ description: z.ZodNullable<z.ZodString>;
3815
+ }, "strip", z.ZodTypeAny, {
3816
+ description: string | null;
3817
+ table_name: string;
3818
+ }, {
3819
+ description: string | null;
3820
+ table_name: string;
3821
+ }>;
3822
+ matched_values: z.ZodArray<z.ZodString, "many">;
3823
+ }, "strip", z.ZodTypeAny, {
3824
+ description: string | null;
3825
+ name: string;
3826
+ table: {
3827
+ description: string | null;
3828
+ table_name: string;
3829
+ };
3830
+ id: number;
3831
+ data_type: string | null;
3832
+ null_percentage: number | null;
3833
+ unique_values: number | null;
3834
+ sample_values: any[] | null;
3835
+ matched_values: string[];
3836
+ }, {
3837
+ description: string | null;
3838
+ name: string;
3839
+ table: {
3840
+ description: string | null;
3841
+ table_name: string;
3842
+ };
3843
+ id: number;
3844
+ data_type: string | null;
3845
+ null_percentage: number | null;
3846
+ unique_values: number | null;
3847
+ sample_values: any[] | null;
3848
+ matched_values: string[];
3849
+ }>, "many">;
3850
+ }, "strip", z.ZodTypeAny, {
3851
+ columns: {
3852
+ description: string | null;
3853
+ name: string;
3854
+ table: {
3855
+ description: string | null;
3856
+ table_name: string;
3857
+ };
3858
+ id: number;
3859
+ data_type: string | null;
3860
+ null_percentage: number | null;
3861
+ unique_values: number | null;
3862
+ sample_values: any[] | null;
3863
+ matched_values: string[];
3864
+ }[];
3865
+ message?: string | undefined;
3866
+ }, {
3867
+ columns: {
3868
+ description: string | null;
3869
+ name: string;
3870
+ table: {
3871
+ description: string | null;
3872
+ table_name: string;
3873
+ };
3874
+ id: number;
3875
+ data_type: string | null;
3876
+ null_percentage: number | null;
3877
+ unique_values: number | null;
3878
+ sample_values: any[] | null;
3879
+ matched_values: string[];
3880
+ }[];
3881
+ message?: string | undefined;
3882
+ }>;
3883
+ }, "private">, "strip", z.ZodTypeAny, {
3884
+ status: "success";
3885
+ public: {};
3886
+ }, {
3887
+ status: "success";
3888
+ public: {};
3889
+ }>, z.ZodObject<{
3890
+ status: z.ZodLiteral<"error">;
3891
+ message: z.ZodString;
3892
+ }, "strip", z.ZodTypeAny, {
3893
+ message: string;
3894
+ status: "error";
3895
+ }, {
3896
+ message: string;
3897
+ status: "error";
3898
+ }>]>>;
3899
+ }, "strip", z.ZodTypeAny, {
3900
+ tool: "valueBasedColumnSearch";
3901
+ result?: {
3902
+ status: "success";
3903
+ public: {};
3904
+ } | {
3905
+ message: string;
3906
+ status: "error";
3907
+ } | undefined;
3908
+ }, {
3909
+ tool: "valueBasedColumnSearch";
3910
+ result?: {
3911
+ status: "success";
3912
+ public: {};
3913
+ } | {
3914
+ message: string;
3915
+ status: "error";
3916
+ } | undefined;
3917
+ }>;
3918
+
3919
+ declare const redactedOutputSchema_4: z.ZodObject<{
3920
+ tool: z.ZodLiteral<"getAvailableTables">;
3921
+ result: z.ZodOptional<z.ZodDiscriminatedUnion<"status", [z.ZodObject<Omit<{
3922
+ status: z.ZodLiteral<"success">;
3923
+ public: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
3924
+ private: z.ZodObject<{
3925
+ tables: z.ZodArray<z.ZodObject<{
3926
+ id: z.ZodNumber;
3927
+ table_name: z.ZodString;
3928
+ description: z.ZodNullable<z.ZodString>;
3929
+ }, "strip", z.ZodTypeAny, {
3930
+ description: string | null;
3931
+ id: number;
3932
+ table_name: string;
3933
+ }, {
3934
+ description: string | null;
3935
+ id: number;
3936
+ table_name: string;
3937
+ }>, "many">;
3938
+ }, "strip", z.ZodTypeAny, {
3939
+ tables: {
3940
+ description: string | null;
3941
+ id: number;
3942
+ table_name: string;
3943
+ }[];
3944
+ }, {
3945
+ tables: {
3946
+ description: string | null;
3947
+ id: number;
3948
+ table_name: string;
3949
+ }[];
3950
+ }>;
3951
+ }, "private">, "strip", z.ZodTypeAny, {
3952
+ status: "success";
3953
+ public: {};
3954
+ }, {
3955
+ status: "success";
3956
+ public: {};
3957
+ }>, z.ZodObject<{
3958
+ status: z.ZodLiteral<"error">;
3959
+ message: z.ZodString;
3960
+ }, "strip", z.ZodTypeAny, {
3961
+ message: string;
3962
+ status: "error";
3963
+ }, {
3964
+ message: string;
3965
+ status: "error";
3966
+ }>]>>;
3967
+ }, "strip", z.ZodTypeAny, {
3968
+ tool: "getAvailableTables";
3969
+ result?: {
3970
+ status: "success";
3971
+ public: {};
3972
+ } | {
3973
+ message: string;
3974
+ status: "error";
3975
+ } | undefined;
3976
+ }, {
3977
+ tool: "getAvailableTables";
3978
+ result?: {
3979
+ status: "success";
3980
+ public: {};
3981
+ } | {
3982
+ message: string;
3983
+ status: "error";
3984
+ } | undefined;
3985
+ }>;
3986
+
3987
+ declare const redactedOutputSchema_5: z.ZodObject<{
3988
+ tool: z.ZodLiteral<"getAvailableColumnsForTable">;
3989
+ result: z.ZodOptional<z.ZodDiscriminatedUnion<"status", [z.ZodObject<Omit<{
3990
+ status: z.ZodLiteral<"success">;
3991
+ public: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
3992
+ private: z.ZodObject<{
3993
+ message: z.ZodOptional<z.ZodString>;
3994
+ columns: z.ZodArray<z.ZodObject<{
3995
+ id: z.ZodNumber;
3996
+ name: z.ZodString;
3997
+ data_type: z.ZodNullable<z.ZodString>;
3998
+ description: z.ZodNullable<z.ZodString>;
3999
+ null_percentage: z.ZodNullable<z.ZodNumber>;
4000
+ unique_values: z.ZodNullable<z.ZodNumber>;
4001
+ sample_values: z.ZodNullable<z.ZodArray<z.ZodAny, "many">>;
4002
+ }, "strip", z.ZodTypeAny, {
4003
+ description: string | null;
4004
+ name: string;
4005
+ id: number;
4006
+ data_type: string | null;
4007
+ null_percentage: number | null;
4008
+ unique_values: number | null;
4009
+ sample_values: any[] | null;
4010
+ }, {
4011
+ description: string | null;
4012
+ name: string;
4013
+ id: number;
4014
+ data_type: string | null;
4015
+ null_percentage: number | null;
4016
+ unique_values: number | null;
4017
+ sample_values: any[] | null;
4018
+ }>, "many">;
4019
+ }, "strip", z.ZodTypeAny, {
4020
+ columns: {
4021
+ description: string | null;
4022
+ name: string;
4023
+ id: number;
4024
+ data_type: string | null;
4025
+ null_percentage: number | null;
4026
+ unique_values: number | null;
4027
+ sample_values: any[] | null;
4028
+ }[];
4029
+ message?: string | undefined;
4030
+ }, {
4031
+ columns: {
4032
+ description: string | null;
4033
+ name: string;
4034
+ id: number;
4035
+ data_type: string | null;
4036
+ null_percentage: number | null;
4037
+ unique_values: number | null;
4038
+ sample_values: any[] | null;
4039
+ }[];
4040
+ message?: string | undefined;
4041
+ }>;
4042
+ }, "private">, "strip", z.ZodTypeAny, {
4043
+ status: "success";
4044
+ public: {};
4045
+ }, {
4046
+ status: "success";
4047
+ public: {};
4048
+ }>, z.ZodObject<{
4049
+ status: z.ZodLiteral<"error">;
4050
+ message: z.ZodString;
4051
+ }, "strip", z.ZodTypeAny, {
4052
+ message: string;
4053
+ status: "error";
4054
+ }, {
4055
+ message: string;
4056
+ status: "error";
4057
+ }>]>>;
4058
+ }, "strip", z.ZodTypeAny, {
4059
+ tool: "getAvailableColumnsForTable";
4060
+ result?: {
4061
+ status: "success";
4062
+ public: {};
4063
+ } | {
4064
+ message: string;
4065
+ status: "error";
4066
+ } | undefined;
4067
+ }, {
4068
+ tool: "getAvailableColumnsForTable";
4069
+ result?: {
4070
+ status: "success";
4071
+ public: {};
4072
+ } | {
4073
+ message: string;
4074
+ status: "error";
4075
+ } | undefined;
4076
+ }>;
4077
+
4078
+ declare const redactedOutputSchema_6: z.ZodObject<{
4079
+ tool: z.ZodLiteral<"search">;
4080
+ result: z.ZodOptional<z.ZodDiscriminatedUnion<"status", [z.ZodObject<Omit<{
4081
+ status: z.ZodLiteral<"success">;
4082
+ public: z.ZodObject<{
4083
+ sources: z.ZodOptional<z.ZodArray<z.ZodObject<{
4084
+ sourceType: z.ZodLiteral<"url">;
4085
+ id: z.ZodString;
4086
+ url: z.ZodString;
4087
+ title: z.ZodString;
4088
+ }, "strip", z.ZodTypeAny, {
4089
+ title: string;
4090
+ id: string;
4091
+ sourceType: "url";
4092
+ url: string;
4093
+ }, {
4094
+ title: string;
4095
+ id: string;
4096
+ sourceType: "url";
4097
+ url: string;
4098
+ }>, "many">>;
4099
+ }, "strip", z.ZodTypeAny, {
4100
+ sources?: {
4101
+ title: string;
4102
+ id: string;
4103
+ sourceType: "url";
4104
+ url: string;
4105
+ }[] | undefined;
4106
+ }, {
4107
+ sources?: {
4108
+ title: string;
4109
+ id: string;
4110
+ sourceType: "url";
4111
+ url: string;
4112
+ }[] | undefined;
4113
+ }>;
4114
+ private: z.ZodObject<{
4115
+ answer: z.ZodOptional<z.ZodString>;
4116
+ }, "strip", z.ZodTypeAny, {
4117
+ answer?: string | undefined;
4118
+ }, {
4119
+ answer?: string | undefined;
4120
+ }>;
4121
+ }, "private">, "strip", z.ZodTypeAny, {
4122
+ status: "success";
4123
+ public: {
4124
+ sources?: {
4125
+ title: string;
4126
+ id: string;
4127
+ sourceType: "url";
4128
+ url: string;
4129
+ }[] | undefined;
4130
+ };
4131
+ }, {
4132
+ status: "success";
4133
+ public: {
4134
+ sources?: {
4135
+ title: string;
4136
+ id: string;
4137
+ sourceType: "url";
4138
+ url: string;
4139
+ }[] | undefined;
4140
+ };
4141
+ }>, z.ZodObject<{
4142
+ status: z.ZodLiteral<"error">;
4143
+ message: z.ZodString;
4144
+ }, "strip", z.ZodTypeAny, {
4145
+ message: string;
4146
+ status: "error";
4147
+ }, {
4148
+ message: string;
4149
+ status: "error";
4150
+ }>]>>;
4151
+ }, "strip", z.ZodTypeAny, {
4152
+ tool: "search";
4153
+ result?: {
4154
+ status: "success";
4155
+ public: {
4156
+ sources?: {
4157
+ title: string;
4158
+ id: string;
4159
+ sourceType: "url";
4160
+ url: string;
4161
+ }[] | undefined;
4162
+ };
4163
+ } | {
4164
+ message: string;
4165
+ status: "error";
4166
+ } | undefined;
4167
+ }, {
4168
+ tool: "search";
4169
+ result?: {
4170
+ status: "success";
4171
+ public: {
4172
+ sources?: {
4173
+ title: string;
4174
+ id: string;
4175
+ sourceType: "url";
4176
+ url: string;
4177
+ }[] | undefined;
4178
+ };
4179
+ } | {
4180
+ message: string;
4181
+ status: "error";
4182
+ } | undefined;
4183
+ }>;
4184
+
4185
+ declare const RedactedThinkResponse: z.ZodObject<{
4186
+ tool: z.ZodDefault<z.ZodLiteral<"think">>;
4187
+ } & {
4188
+ result: z.ZodOptional<z.ZodObject<Omit<{
4189
+ status: z.ZodLiteral<"success">;
4190
+ public: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
4191
+ private: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
4192
+ }, "private">, "strip", z.ZodTypeAny, {
4193
+ status: "success";
4194
+ public: {};
4195
+ }, {
4196
+ status: "success";
4197
+ public: {};
4198
+ }>>;
4199
+ }, "strip", z.ZodTypeAny, {
4200
+ tool: "think";
4201
+ result?: {
4202
+ status: "success";
4203
+ public: {};
4204
+ } | undefined;
4205
+ }, {
4206
+ tool?: "think" | undefined;
4207
+ result?: {
4208
+ status: "success";
4209
+ public: {};
4210
+ } | undefined;
4211
+ }>;
4212
+
3423
4213
  declare type RemoveAuthHeader<PathSchema> = Simplify<{
3424
4214
  [Method in keyof PathSchema]: RemoveParams<PathSchema[Method], ToRemove>;
3425
4215
  }>;
@@ -3442,15 +4232,26 @@ declare type RemoveParamsConfig = Simplify<{
3442
4232
  cookie?: string;
3443
4233
  }>;
3444
4234
 
3445
- /**
3446
- * Parameters for starting a flow
3447
- */
3448
- export declare type StartFlowParam = {
3449
- query: string;
3450
- } | {
3451
- triggerId: string;
3452
- variables: Record<string, string>;
3453
- };
4235
+ declare const SignalWithReportIdSchema: z.ZodObject<{
4236
+ rule: z.ZodString;
4237
+ metric: z.ZodString;
4238
+ trigger: z.ZodString;
4239
+ implementation: z.ZodString;
4240
+ } & {
4241
+ reportId: z.ZodNumber;
4242
+ }, "strip", z.ZodTypeAny, {
4243
+ rule: string;
4244
+ metric: string;
4245
+ trigger: string;
4246
+ implementation: string;
4247
+ reportId: number;
4248
+ }, {
4249
+ rule: string;
4250
+ metric: string;
4251
+ trigger: string;
4252
+ implementation: string;
4253
+ reportId: number;
4254
+ }>;
3454
4255
 
3455
4256
  /**
3456
4257
  * Token storage keys
@@ -3461,4 +4262,18 @@ declare type ToRemove = Simplify<{
3461
4262
  header: "sp-access-token";
3462
4263
  }>;
3463
4264
 
4265
+ declare type UiTool = InferUITool<Tool<z.infer<typeof inputSchema>, z.infer<typeof redactedOutputSchema>>>;
4266
+
4267
+ declare type UiTool_2 = InferUITool<Tool<z.infer<typeof inputSchema_2>, z.infer<typeof redactedOutputSchema_2>>>;
4268
+
4269
+ declare type UiTool_3 = InferUITool<Tool<z.infer<typeof inputSchema_3>, z.infer<typeof RedactedThinkResponse>>>;
4270
+
4271
+ declare type UiTool_4 = InferUITool<Tool<z.infer<typeof inputSchema_4>, z.infer<typeof redactedOutputSchema_3>>>;
4272
+
4273
+ declare type UiTool_5 = InferUITool<Tool<z.infer<typeof inputSchema_5>, z.infer<typeof redactedOutputSchema_4>>>;
4274
+
4275
+ declare type UiTool_6 = InferUITool<Tool<z.infer<typeof inputSchema_6>, z.infer<typeof redactedOutputSchema_5>>>;
4276
+
4277
+ declare type UiTool_7 = InferUITool<Tool<z.infer<typeof inputSchema_7>, z.infer<typeof redactedOutputSchema_6>>>;
4278
+
3464
4279
  export { }