@rudderhq/shared 0.6.2 → 0.6.3
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/chat-transcript-provenance.d.ts.map +1 -1
- package/dist/chat-transcript-provenance.js +28 -8
- package/dist/chat-transcript-provenance.js.map +1 -1
- package/dist/chat-transcript-provenance.test.js +57 -0
- package/dist/chat-transcript-provenance.test.js.map +1 -1
- package/dist/constants.d.ts +8 -6
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +5 -3
- package/dist/constants.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/types/chat.d.ts +2 -0
- package/dist/types/chat.d.ts.map +1 -1
- package/dist/types/mcp.d.ts +13 -1
- package/dist/types/mcp.d.ts.map +1 -1
- package/dist/validators/mcp.d.ts +208 -1
- package/dist/validators/mcp.d.ts.map +1 -1
- package/dist/validators/mcp.js +33 -2
- package/dist/validators/mcp.js.map +1 -1
- package/dist/validators/mcp.test.js +18 -2
- package/dist/validators/mcp.test.js.map +1 -1
- package/package.json +1 -1
package/dist/validators/mcp.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const mcpConnectionProviderSchema: z.ZodEnum<["supabase", "linear", "notion", "custom"]>;
|
|
3
|
+
export declare const mcpConnectionScopeSchema: z.ZodEnum<["organization", "agent"]>;
|
|
3
4
|
export declare const mcpConnectionTransportSchema: z.ZodEnum<["stdio", "streamable_http", "legacy_manual"]>;
|
|
4
5
|
export declare const mcpConnectionAccessModeSchema: z.ZodEnum<["provider_default", "read_only", "read_write"]>;
|
|
5
6
|
export declare const mcpAgentAccessModeSchema: z.ZodEnum<["none", "read_only", "read_write", "provider_granted", "full"]>;
|
|
@@ -271,10 +272,12 @@ export declare const mcpConnectionSafeConfigSchema: z.ZodUnion<[z.ZodEffects<z.Z
|
|
|
271
272
|
excluded: string[];
|
|
272
273
|
};
|
|
273
274
|
}>]>;
|
|
274
|
-
export declare const createMcpConnectionSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
275
|
+
export declare const createMcpConnectionSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
275
276
|
name: z.ZodString;
|
|
276
277
|
displayName: z.ZodString;
|
|
277
278
|
provider: z.ZodEnum<["supabase", "linear", "notion", "custom"]>;
|
|
279
|
+
scope: z.ZodEnum<["organization", "agent"]>;
|
|
280
|
+
ownerAgentId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
278
281
|
transport: z.ZodEnum<["stdio", "streamable_http", "legacy_manual"]>;
|
|
279
282
|
externalScope: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
280
283
|
accessMode: z.ZodOptional<z.ZodEnum<["provider_default", "read_only", "read_write"]>>;
|
|
@@ -422,6 +425,7 @@ export declare const createMcpConnectionSchema: z.ZodEffects<z.ZodEffects<z.ZodE
|
|
|
422
425
|
bearerToken?: string | undefined;
|
|
423
426
|
}>>;
|
|
424
427
|
}, "strict", z.ZodTypeAny, {
|
|
428
|
+
scope: "organization" | "agent";
|
|
425
429
|
displayName: string;
|
|
426
430
|
name: string;
|
|
427
431
|
transport: "stdio" | "streamable_http" | "legacy_manual";
|
|
@@ -456,6 +460,7 @@ export declare const createMcpConnectionSchema: z.ZodEffects<z.ZodEffects<z.ZodE
|
|
|
456
460
|
startupTimeoutMs: number;
|
|
457
461
|
toolTimeoutMs: number;
|
|
458
462
|
required: boolean;
|
|
463
|
+
ownerAgentId?: string | null | undefined;
|
|
459
464
|
accessMode?: "provider_default" | "read_only" | "read_write" | undefined;
|
|
460
465
|
secrets?: {
|
|
461
466
|
env?: Record<string, string> | undefined;
|
|
@@ -464,10 +469,12 @@ export declare const createMcpConnectionSchema: z.ZodEffects<z.ZodEffects<z.ZodE
|
|
|
464
469
|
} | undefined;
|
|
465
470
|
externalScope?: string | null | undefined;
|
|
466
471
|
}, {
|
|
472
|
+
scope: "organization" | "agent";
|
|
467
473
|
displayName: string;
|
|
468
474
|
name: string;
|
|
469
475
|
transport: "stdio" | "streamable_http" | "legacy_manual";
|
|
470
476
|
provider: "supabase" | "linear" | "notion" | "custom";
|
|
477
|
+
ownerAgentId?: string | null | undefined;
|
|
471
478
|
accessMode?: "provider_default" | "read_only" | "read_write" | undefined;
|
|
472
479
|
safeConfig?: {
|
|
473
480
|
command: string;
|
|
@@ -506,6 +513,7 @@ export declare const createMcpConnectionSchema: z.ZodEffects<z.ZodEffects<z.ZodE
|
|
|
506
513
|
toolTimeoutMs?: number | undefined;
|
|
507
514
|
required?: boolean | undefined;
|
|
508
515
|
}>, {
|
|
516
|
+
scope: "organization" | "agent";
|
|
509
517
|
displayName: string;
|
|
510
518
|
name: string;
|
|
511
519
|
transport: "stdio" | "streamable_http" | "legacy_manual";
|
|
@@ -540,6 +548,7 @@ export declare const createMcpConnectionSchema: z.ZodEffects<z.ZodEffects<z.ZodE
|
|
|
540
548
|
startupTimeoutMs: number;
|
|
541
549
|
toolTimeoutMs: number;
|
|
542
550
|
required: boolean;
|
|
551
|
+
ownerAgentId?: string | null | undefined;
|
|
543
552
|
accessMode?: "provider_default" | "read_only" | "read_write" | undefined;
|
|
544
553
|
secrets?: {
|
|
545
554
|
env?: Record<string, string> | undefined;
|
|
@@ -548,10 +557,12 @@ export declare const createMcpConnectionSchema: z.ZodEffects<z.ZodEffects<z.ZodE
|
|
|
548
557
|
} | undefined;
|
|
549
558
|
externalScope?: string | null | undefined;
|
|
550
559
|
}, {
|
|
560
|
+
scope: "organization" | "agent";
|
|
551
561
|
displayName: string;
|
|
552
562
|
name: string;
|
|
553
563
|
transport: "stdio" | "streamable_http" | "legacy_manual";
|
|
554
564
|
provider: "supabase" | "linear" | "notion" | "custom";
|
|
565
|
+
ownerAgentId?: string | null | undefined;
|
|
555
566
|
accessMode?: "provider_default" | "read_only" | "read_write" | undefined;
|
|
556
567
|
safeConfig?: {
|
|
557
568
|
command: string;
|
|
@@ -590,6 +601,7 @@ export declare const createMcpConnectionSchema: z.ZodEffects<z.ZodEffects<z.ZodE
|
|
|
590
601
|
toolTimeoutMs?: number | undefined;
|
|
591
602
|
required?: boolean | undefined;
|
|
592
603
|
}>, {
|
|
604
|
+
scope: "organization" | "agent";
|
|
593
605
|
displayName: string;
|
|
594
606
|
name: string;
|
|
595
607
|
transport: "stdio" | "streamable_http" | "legacy_manual";
|
|
@@ -624,6 +636,7 @@ export declare const createMcpConnectionSchema: z.ZodEffects<z.ZodEffects<z.ZodE
|
|
|
624
636
|
startupTimeoutMs: number;
|
|
625
637
|
toolTimeoutMs: number;
|
|
626
638
|
required: boolean;
|
|
639
|
+
ownerAgentId?: string | null | undefined;
|
|
627
640
|
accessMode?: "provider_default" | "read_only" | "read_write" | undefined;
|
|
628
641
|
secrets?: {
|
|
629
642
|
env?: Record<string, string> | undefined;
|
|
@@ -632,10 +645,12 @@ export declare const createMcpConnectionSchema: z.ZodEffects<z.ZodEffects<z.ZodE
|
|
|
632
645
|
} | undefined;
|
|
633
646
|
externalScope?: string | null | undefined;
|
|
634
647
|
}, {
|
|
648
|
+
scope: "organization" | "agent";
|
|
635
649
|
displayName: string;
|
|
636
650
|
name: string;
|
|
637
651
|
transport: "stdio" | "streamable_http" | "legacy_manual";
|
|
638
652
|
provider: "supabase" | "linear" | "notion" | "custom";
|
|
653
|
+
ownerAgentId?: string | null | undefined;
|
|
639
654
|
accessMode?: "provider_default" | "read_only" | "read_write" | undefined;
|
|
640
655
|
safeConfig?: {
|
|
641
656
|
command: string;
|
|
@@ -674,6 +689,7 @@ export declare const createMcpConnectionSchema: z.ZodEffects<z.ZodEffects<z.ZodE
|
|
|
674
689
|
toolTimeoutMs?: number | undefined;
|
|
675
690
|
required?: boolean | undefined;
|
|
676
691
|
}>, {
|
|
692
|
+
scope: "organization" | "agent";
|
|
677
693
|
displayName: string;
|
|
678
694
|
name: string;
|
|
679
695
|
transport: "stdio" | "streamable_http" | "legacy_manual";
|
|
@@ -708,6 +724,7 @@ export declare const createMcpConnectionSchema: z.ZodEffects<z.ZodEffects<z.ZodE
|
|
|
708
724
|
startupTimeoutMs: number;
|
|
709
725
|
toolTimeoutMs: number;
|
|
710
726
|
required: boolean;
|
|
727
|
+
ownerAgentId?: string | null | undefined;
|
|
711
728
|
accessMode?: "provider_default" | "read_only" | "read_write" | undefined;
|
|
712
729
|
secrets?: {
|
|
713
730
|
env?: Record<string, string> | undefined;
|
|
@@ -716,10 +733,100 @@ export declare const createMcpConnectionSchema: z.ZodEffects<z.ZodEffects<z.ZodE
|
|
|
716
733
|
} | undefined;
|
|
717
734
|
externalScope?: string | null | undefined;
|
|
718
735
|
}, {
|
|
736
|
+
scope: "organization" | "agent";
|
|
719
737
|
displayName: string;
|
|
720
738
|
name: string;
|
|
721
739
|
transport: "stdio" | "streamable_http" | "legacy_manual";
|
|
722
740
|
provider: "supabase" | "linear" | "notion" | "custom";
|
|
741
|
+
ownerAgentId?: string | null | undefined;
|
|
742
|
+
accessMode?: "provider_default" | "read_only" | "read_write" | undefined;
|
|
743
|
+
safeConfig?: {
|
|
744
|
+
command: string;
|
|
745
|
+
args?: string[] | undefined;
|
|
746
|
+
cwd?: string | undefined;
|
|
747
|
+
staticEnv?: Record<string, string> | undefined;
|
|
748
|
+
forwardedEnv?: string[] | undefined;
|
|
749
|
+
secretEnvNames?: string[] | undefined;
|
|
750
|
+
toolAllowlist?: string[] | undefined;
|
|
751
|
+
toolDenylist?: string[] | undefined;
|
|
752
|
+
} | {
|
|
753
|
+
url?: string | undefined;
|
|
754
|
+
toolAllowlist?: string[] | undefined;
|
|
755
|
+
toolDenylist?: string[] | undefined;
|
|
756
|
+
staticHeaders?: Record<string, string> | undefined;
|
|
757
|
+
headersFromEnv?: Record<string, string> | undefined;
|
|
758
|
+
bearerTokenEnvVar?: string | undefined;
|
|
759
|
+
secretHeaderNames?: string[] | undefined;
|
|
760
|
+
hasBearerToken?: boolean | undefined;
|
|
761
|
+
} | {
|
|
762
|
+
legacyConfigRetained: true;
|
|
763
|
+
} | {
|
|
764
|
+
featureGroups: {
|
|
765
|
+
mode: "provider_default";
|
|
766
|
+
excluded: string[];
|
|
767
|
+
};
|
|
768
|
+
} | undefined;
|
|
769
|
+
secrets?: {
|
|
770
|
+
env?: Record<string, string> | undefined;
|
|
771
|
+
headers?: Record<string, string> | undefined;
|
|
772
|
+
bearerToken?: string | undefined;
|
|
773
|
+
} | undefined;
|
|
774
|
+
enabled?: boolean | undefined;
|
|
775
|
+
externalScope?: string | null | undefined;
|
|
776
|
+
startupTimeoutMs?: number | undefined;
|
|
777
|
+
toolTimeoutMs?: number | undefined;
|
|
778
|
+
required?: boolean | undefined;
|
|
779
|
+
}>, {
|
|
780
|
+
scope: "organization" | "agent";
|
|
781
|
+
displayName: string;
|
|
782
|
+
name: string;
|
|
783
|
+
transport: "stdio" | "streamable_http" | "legacy_manual";
|
|
784
|
+
safeConfig: {
|
|
785
|
+
command: string;
|
|
786
|
+
args?: string[] | undefined;
|
|
787
|
+
cwd?: string | undefined;
|
|
788
|
+
staticEnv?: Record<string, string> | undefined;
|
|
789
|
+
forwardedEnv?: string[] | undefined;
|
|
790
|
+
secretEnvNames?: string[] | undefined;
|
|
791
|
+
toolAllowlist?: string[] | undefined;
|
|
792
|
+
toolDenylist?: string[] | undefined;
|
|
793
|
+
} | {
|
|
794
|
+
url?: string | undefined;
|
|
795
|
+
toolAllowlist?: string[] | undefined;
|
|
796
|
+
toolDenylist?: string[] | undefined;
|
|
797
|
+
staticHeaders?: Record<string, string> | undefined;
|
|
798
|
+
headersFromEnv?: Record<string, string> | undefined;
|
|
799
|
+
bearerTokenEnvVar?: string | undefined;
|
|
800
|
+
secretHeaderNames?: string[] | undefined;
|
|
801
|
+
hasBearerToken?: boolean | undefined;
|
|
802
|
+
} | {
|
|
803
|
+
legacyConfigRetained: true;
|
|
804
|
+
} | {
|
|
805
|
+
featureGroups: {
|
|
806
|
+
mode: "provider_default";
|
|
807
|
+
excluded: string[];
|
|
808
|
+
};
|
|
809
|
+
};
|
|
810
|
+
enabled: boolean;
|
|
811
|
+
provider: "supabase" | "linear" | "notion" | "custom";
|
|
812
|
+
startupTimeoutMs: number;
|
|
813
|
+
toolTimeoutMs: number;
|
|
814
|
+
required: boolean;
|
|
815
|
+
ownerAgentId?: string | null | undefined;
|
|
816
|
+
accessMode?: "provider_default" | "read_only" | "read_write" | undefined;
|
|
817
|
+
secrets?: {
|
|
818
|
+
env?: Record<string, string> | undefined;
|
|
819
|
+
headers?: Record<string, string> | undefined;
|
|
820
|
+
bearerToken?: string | undefined;
|
|
821
|
+
} | undefined;
|
|
822
|
+
externalScope?: string | null | undefined;
|
|
823
|
+
}, {
|
|
824
|
+
scope: "organization" | "agent";
|
|
825
|
+
displayName: string;
|
|
826
|
+
name: string;
|
|
827
|
+
transport: "stdio" | "streamable_http" | "legacy_manual";
|
|
828
|
+
provider: "supabase" | "linear" | "notion" | "custom";
|
|
829
|
+
ownerAgentId?: string | null | undefined;
|
|
723
830
|
accessMode?: "provider_default" | "read_only" | "read_write" | undefined;
|
|
724
831
|
safeConfig?: {
|
|
725
832
|
command: string;
|
|
@@ -759,6 +866,7 @@ export declare const createMcpConnectionSchema: z.ZodEffects<z.ZodEffects<z.ZodE
|
|
|
759
866
|
required?: boolean | undefined;
|
|
760
867
|
}>, {
|
|
761
868
|
accessMode: "provider_default" | "read_only" | "read_write";
|
|
869
|
+
scope: "organization" | "agent";
|
|
762
870
|
displayName: string;
|
|
763
871
|
name: string;
|
|
764
872
|
transport: "stdio" | "streamable_http" | "legacy_manual";
|
|
@@ -793,6 +901,7 @@ export declare const createMcpConnectionSchema: z.ZodEffects<z.ZodEffects<z.ZodE
|
|
|
793
901
|
startupTimeoutMs: number;
|
|
794
902
|
toolTimeoutMs: number;
|
|
795
903
|
required: boolean;
|
|
904
|
+
ownerAgentId?: string | null | undefined;
|
|
796
905
|
secrets?: {
|
|
797
906
|
env?: Record<string, string> | undefined;
|
|
798
907
|
headers?: Record<string, string> | undefined;
|
|
@@ -800,10 +909,12 @@ export declare const createMcpConnectionSchema: z.ZodEffects<z.ZodEffects<z.ZodE
|
|
|
800
909
|
} | undefined;
|
|
801
910
|
externalScope?: string | null | undefined;
|
|
802
911
|
}, {
|
|
912
|
+
scope: "organization" | "agent";
|
|
803
913
|
displayName: string;
|
|
804
914
|
name: string;
|
|
805
915
|
transport: "stdio" | "streamable_http" | "legacy_manual";
|
|
806
916
|
provider: "supabase" | "linear" | "notion" | "custom";
|
|
917
|
+
ownerAgentId?: string | null | undefined;
|
|
807
918
|
accessMode?: "provider_default" | "read_only" | "read_write" | undefined;
|
|
808
919
|
safeConfig?: {
|
|
809
920
|
command: string;
|
|
@@ -1762,6 +1873,8 @@ export declare const mcpConnectionMutationConfigSchema: z.ZodEffects<z.ZodEffect
|
|
|
1762
1873
|
export declare const mcpConnectionSummarySchema: z.ZodObject<{
|
|
1763
1874
|
id: z.ZodString;
|
|
1764
1875
|
orgId: z.ZodString;
|
|
1876
|
+
scope: z.ZodEnum<["organization", "agent"]>;
|
|
1877
|
+
ownerAgentId: z.ZodNullable<z.ZodString>;
|
|
1765
1878
|
name: z.ZodString;
|
|
1766
1879
|
displayName: z.ZodString;
|
|
1767
1880
|
provider: z.ZodEnum<["supabase", "linear", "notion", "custom"]>;
|
|
@@ -1902,6 +2015,8 @@ export declare const mcpConnectionSummarySchema: z.ZodObject<{
|
|
|
1902
2015
|
status: "active" | "disabled" | "error" | "revoked" | "draft" | "authorizing" | "selecting_scope" | "needs_reauth";
|
|
1903
2016
|
id: string;
|
|
1904
2017
|
orgId: string;
|
|
2018
|
+
ownerAgentId: string | null;
|
|
2019
|
+
scope: "organization" | "agent";
|
|
1905
2020
|
displayName: string;
|
|
1906
2021
|
createdAt: string;
|
|
1907
2022
|
updatedAt: string;
|
|
@@ -1949,6 +2064,8 @@ export declare const mcpConnectionSummarySchema: z.ZodObject<{
|
|
|
1949
2064
|
status: "active" | "disabled" | "error" | "revoked" | "draft" | "authorizing" | "selecting_scope" | "needs_reauth";
|
|
1950
2065
|
id: string;
|
|
1951
2066
|
orgId: string;
|
|
2067
|
+
ownerAgentId: string | null;
|
|
2068
|
+
scope: "organization" | "agent";
|
|
1952
2069
|
displayName: string;
|
|
1953
2070
|
createdAt: string;
|
|
1954
2071
|
updatedAt: string;
|
|
@@ -2275,6 +2392,8 @@ export declare const mcpAgentConnectionSummarySchema: z.ZodObject<{
|
|
|
2275
2392
|
connection: z.ZodObject<{
|
|
2276
2393
|
id: z.ZodString;
|
|
2277
2394
|
orgId: z.ZodString;
|
|
2395
|
+
scope: z.ZodEnum<["organization", "agent"]>;
|
|
2396
|
+
ownerAgentId: z.ZodNullable<z.ZodString>;
|
|
2278
2397
|
name: z.ZodString;
|
|
2279
2398
|
displayName: z.ZodString;
|
|
2280
2399
|
provider: z.ZodEnum<["supabase", "linear", "notion", "custom"]>;
|
|
@@ -2415,6 +2534,8 @@ export declare const mcpAgentConnectionSummarySchema: z.ZodObject<{
|
|
|
2415
2534
|
status: "active" | "disabled" | "error" | "revoked" | "draft" | "authorizing" | "selecting_scope" | "needs_reauth";
|
|
2416
2535
|
id: string;
|
|
2417
2536
|
orgId: string;
|
|
2537
|
+
ownerAgentId: string | null;
|
|
2538
|
+
scope: "organization" | "agent";
|
|
2418
2539
|
displayName: string;
|
|
2419
2540
|
createdAt: string;
|
|
2420
2541
|
updatedAt: string;
|
|
@@ -2462,6 +2583,8 @@ export declare const mcpAgentConnectionSummarySchema: z.ZodObject<{
|
|
|
2462
2583
|
status: "active" | "disabled" | "error" | "revoked" | "draft" | "authorizing" | "selecting_scope" | "needs_reauth";
|
|
2463
2584
|
id: string;
|
|
2464
2585
|
orgId: string;
|
|
2586
|
+
ownerAgentId: string | null;
|
|
2587
|
+
scope: "organization" | "agent";
|
|
2465
2588
|
displayName: string;
|
|
2466
2589
|
createdAt: string;
|
|
2467
2590
|
updatedAt: string;
|
|
@@ -2591,6 +2714,8 @@ export declare const mcpAgentConnectionSummarySchema: z.ZodObject<{
|
|
|
2591
2714
|
status: "active" | "disabled" | "error" | "revoked" | "draft" | "authorizing" | "selecting_scope" | "needs_reauth";
|
|
2592
2715
|
id: string;
|
|
2593
2716
|
orgId: string;
|
|
2717
|
+
ownerAgentId: string | null;
|
|
2718
|
+
scope: "organization" | "agent";
|
|
2594
2719
|
displayName: string;
|
|
2595
2720
|
createdAt: string;
|
|
2596
2721
|
updatedAt: string;
|
|
@@ -2664,6 +2789,8 @@ export declare const mcpAgentConnectionSummarySchema: z.ZodObject<{
|
|
|
2664
2789
|
status: "active" | "disabled" | "error" | "revoked" | "draft" | "authorizing" | "selecting_scope" | "needs_reauth";
|
|
2665
2790
|
id: string;
|
|
2666
2791
|
orgId: string;
|
|
2792
|
+
ownerAgentId: string | null;
|
|
2793
|
+
scope: "organization" | "agent";
|
|
2667
2794
|
displayName: string;
|
|
2668
2795
|
createdAt: string;
|
|
2669
2796
|
updatedAt: string;
|
|
@@ -2850,6 +2977,7 @@ export declare const mcpProviderAvailabilitySchema: z.ZodEffects<z.ZodObject<{
|
|
|
2850
2977
|
scopeMode: z.ZodNullable<z.ZodEnum<["account", "workspace", "legacy_project"]>>;
|
|
2851
2978
|
revision: z.ZodNullable<z.ZodNumber>;
|
|
2852
2979
|
affectedAgentCount: z.ZodOptional<z.ZodNumber>;
|
|
2980
|
+
agentConnectionCount: z.ZodOptional<z.ZodNumber>;
|
|
2853
2981
|
historicalGrantConnectionIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2854
2982
|
}, "strict", z.ZodTypeAny, {
|
|
2855
2983
|
connectionId: string | null;
|
|
@@ -2858,6 +2986,7 @@ export declare const mcpProviderAvailabilitySchema: z.ZodEffects<z.ZodObject<{
|
|
|
2858
2986
|
scopeMode: "account" | "workspace" | "legacy_project" | null;
|
|
2859
2987
|
revision: number | null;
|
|
2860
2988
|
affectedAgentCount?: number | undefined;
|
|
2989
|
+
agentConnectionCount?: number | undefined;
|
|
2861
2990
|
historicalGrantConnectionIds?: string[] | undefined;
|
|
2862
2991
|
}, {
|
|
2863
2992
|
connectionId: string | null;
|
|
@@ -2866,17 +2995,55 @@ export declare const mcpProviderAvailabilitySchema: z.ZodEffects<z.ZodObject<{
|
|
|
2866
2995
|
scopeMode: "account" | "workspace" | "legacy_project" | null;
|
|
2867
2996
|
revision: number | null;
|
|
2868
2997
|
affectedAgentCount?: number | undefined;
|
|
2998
|
+
agentConnectionCount?: number | undefined;
|
|
2869
2999
|
historicalGrantConnectionIds?: string[] | undefined;
|
|
2870
3000
|
}>;
|
|
2871
3001
|
agent: z.ZodOptional<z.ZodObject<{
|
|
2872
3002
|
access: z.ZodEnum<["none", "read_only", "read_write", "provider_granted", "full"]>;
|
|
2873
3003
|
activeRunUsesOlderPolicy: z.ZodBoolean;
|
|
3004
|
+
connection: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
3005
|
+
state: z.ZodEnum<["not_connected", "connecting", "connected", "needs_attention", "disconnected"]>;
|
|
3006
|
+
connectionId: z.ZodString;
|
|
3007
|
+
maxAccess: z.ZodEnum<["read_only", "read_write", "provider_granted"]>;
|
|
3008
|
+
revision: z.ZodNumber;
|
|
3009
|
+
}, "strict", z.ZodTypeAny, {
|
|
3010
|
+
connectionId: string;
|
|
3011
|
+
state: "not_connected" | "connecting" | "connected" | "needs_attention" | "disconnected";
|
|
3012
|
+
maxAccess: "read_only" | "read_write" | "provider_granted";
|
|
3013
|
+
revision: number;
|
|
3014
|
+
}, {
|
|
3015
|
+
connectionId: string;
|
|
3016
|
+
state: "not_connected" | "connecting" | "connected" | "needs_attention" | "disconnected";
|
|
3017
|
+
maxAccess: "read_only" | "read_write" | "provider_granted";
|
|
3018
|
+
revision: number;
|
|
3019
|
+
}>>>;
|
|
3020
|
+
effectiveSource: z.ZodDefault<z.ZodEnum<["agent", "organization", "none"]>>;
|
|
3021
|
+
effectiveConnectionId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
3022
|
+
explicitlyDisabled: z.ZodDefault<z.ZodBoolean>;
|
|
2874
3023
|
}, "strict", z.ZodTypeAny, {
|
|
3024
|
+
connection: {
|
|
3025
|
+
connectionId: string;
|
|
3026
|
+
state: "not_connected" | "connecting" | "connected" | "needs_attention" | "disconnected";
|
|
3027
|
+
maxAccess: "read_only" | "read_write" | "provider_granted";
|
|
3028
|
+
revision: number;
|
|
3029
|
+
} | null;
|
|
2875
3030
|
access: "read_only" | "read_write" | "none" | "provider_granted" | "full";
|
|
2876
3031
|
activeRunUsesOlderPolicy: boolean;
|
|
3032
|
+
effectiveSource: "organization" | "agent" | "none";
|
|
3033
|
+
effectiveConnectionId: string | null;
|
|
3034
|
+
explicitlyDisabled: boolean;
|
|
2877
3035
|
}, {
|
|
2878
3036
|
access: "read_only" | "read_write" | "none" | "provider_granted" | "full";
|
|
2879
3037
|
activeRunUsesOlderPolicy: boolean;
|
|
3038
|
+
connection?: {
|
|
3039
|
+
connectionId: string;
|
|
3040
|
+
state: "not_connected" | "connecting" | "connected" | "needs_attention" | "disconnected";
|
|
3041
|
+
maxAccess: "read_only" | "read_write" | "provider_granted";
|
|
3042
|
+
revision: number;
|
|
3043
|
+
} | null | undefined;
|
|
3044
|
+
effectiveSource?: "organization" | "agent" | "none" | undefined;
|
|
3045
|
+
effectiveConnectionId?: string | null | undefined;
|
|
3046
|
+
explicitlyDisabled?: boolean | undefined;
|
|
2880
3047
|
}>>;
|
|
2881
3048
|
}, "strict", z.ZodTypeAny, {
|
|
2882
3049
|
organization: {
|
|
@@ -2886,12 +3053,22 @@ export declare const mcpProviderAvailabilitySchema: z.ZodEffects<z.ZodObject<{
|
|
|
2886
3053
|
scopeMode: "account" | "workspace" | "legacy_project" | null;
|
|
2887
3054
|
revision: number | null;
|
|
2888
3055
|
affectedAgentCount?: number | undefined;
|
|
3056
|
+
agentConnectionCount?: number | undefined;
|
|
2889
3057
|
historicalGrantConnectionIds?: string[] | undefined;
|
|
2890
3058
|
};
|
|
2891
3059
|
provider: "supabase" | "linear" | "notion";
|
|
2892
3060
|
agent?: {
|
|
3061
|
+
connection: {
|
|
3062
|
+
connectionId: string;
|
|
3063
|
+
state: "not_connected" | "connecting" | "connected" | "needs_attention" | "disconnected";
|
|
3064
|
+
maxAccess: "read_only" | "read_write" | "provider_granted";
|
|
3065
|
+
revision: number;
|
|
3066
|
+
} | null;
|
|
2893
3067
|
access: "read_only" | "read_write" | "none" | "provider_granted" | "full";
|
|
2894
3068
|
activeRunUsesOlderPolicy: boolean;
|
|
3069
|
+
effectiveSource: "organization" | "agent" | "none";
|
|
3070
|
+
effectiveConnectionId: string | null;
|
|
3071
|
+
explicitlyDisabled: boolean;
|
|
2895
3072
|
} | undefined;
|
|
2896
3073
|
}, {
|
|
2897
3074
|
organization: {
|
|
@@ -2901,12 +3078,22 @@ export declare const mcpProviderAvailabilitySchema: z.ZodEffects<z.ZodObject<{
|
|
|
2901
3078
|
scopeMode: "account" | "workspace" | "legacy_project" | null;
|
|
2902
3079
|
revision: number | null;
|
|
2903
3080
|
affectedAgentCount?: number | undefined;
|
|
3081
|
+
agentConnectionCount?: number | undefined;
|
|
2904
3082
|
historicalGrantConnectionIds?: string[] | undefined;
|
|
2905
3083
|
};
|
|
2906
3084
|
provider: "supabase" | "linear" | "notion";
|
|
2907
3085
|
agent?: {
|
|
2908
3086
|
access: "read_only" | "read_write" | "none" | "provider_granted" | "full";
|
|
2909
3087
|
activeRunUsesOlderPolicy: boolean;
|
|
3088
|
+
connection?: {
|
|
3089
|
+
connectionId: string;
|
|
3090
|
+
state: "not_connected" | "connecting" | "connected" | "needs_attention" | "disconnected";
|
|
3091
|
+
maxAccess: "read_only" | "read_write" | "provider_granted";
|
|
3092
|
+
revision: number;
|
|
3093
|
+
} | null | undefined;
|
|
3094
|
+
effectiveSource?: "organization" | "agent" | "none" | undefined;
|
|
3095
|
+
effectiveConnectionId?: string | null | undefined;
|
|
3096
|
+
explicitlyDisabled?: boolean | undefined;
|
|
2910
3097
|
} | undefined;
|
|
2911
3098
|
}>, {
|
|
2912
3099
|
organization: {
|
|
@@ -2916,12 +3103,22 @@ export declare const mcpProviderAvailabilitySchema: z.ZodEffects<z.ZodObject<{
|
|
|
2916
3103
|
scopeMode: "account" | "workspace" | "legacy_project" | null;
|
|
2917
3104
|
revision: number | null;
|
|
2918
3105
|
affectedAgentCount?: number | undefined;
|
|
3106
|
+
agentConnectionCount?: number | undefined;
|
|
2919
3107
|
historicalGrantConnectionIds?: string[] | undefined;
|
|
2920
3108
|
};
|
|
2921
3109
|
provider: "supabase" | "linear" | "notion";
|
|
2922
3110
|
agent?: {
|
|
3111
|
+
connection: {
|
|
3112
|
+
connectionId: string;
|
|
3113
|
+
state: "not_connected" | "connecting" | "connected" | "needs_attention" | "disconnected";
|
|
3114
|
+
maxAccess: "read_only" | "read_write" | "provider_granted";
|
|
3115
|
+
revision: number;
|
|
3116
|
+
} | null;
|
|
2923
3117
|
access: "read_only" | "read_write" | "none" | "provider_granted" | "full";
|
|
2924
3118
|
activeRunUsesOlderPolicy: boolean;
|
|
3119
|
+
effectiveSource: "organization" | "agent" | "none";
|
|
3120
|
+
effectiveConnectionId: string | null;
|
|
3121
|
+
explicitlyDisabled: boolean;
|
|
2925
3122
|
} | undefined;
|
|
2926
3123
|
}, {
|
|
2927
3124
|
organization: {
|
|
@@ -2931,12 +3128,22 @@ export declare const mcpProviderAvailabilitySchema: z.ZodEffects<z.ZodObject<{
|
|
|
2931
3128
|
scopeMode: "account" | "workspace" | "legacy_project" | null;
|
|
2932
3129
|
revision: number | null;
|
|
2933
3130
|
affectedAgentCount?: number | undefined;
|
|
3131
|
+
agentConnectionCount?: number | undefined;
|
|
2934
3132
|
historicalGrantConnectionIds?: string[] | undefined;
|
|
2935
3133
|
};
|
|
2936
3134
|
provider: "supabase" | "linear" | "notion";
|
|
2937
3135
|
agent?: {
|
|
2938
3136
|
access: "read_only" | "read_write" | "none" | "provider_granted" | "full";
|
|
2939
3137
|
activeRunUsesOlderPolicy: boolean;
|
|
3138
|
+
connection?: {
|
|
3139
|
+
connectionId: string;
|
|
3140
|
+
state: "not_connected" | "connecting" | "connected" | "needs_attention" | "disconnected";
|
|
3141
|
+
maxAccess: "read_only" | "read_write" | "provider_granted";
|
|
3142
|
+
revision: number;
|
|
3143
|
+
} | null | undefined;
|
|
3144
|
+
effectiveSource?: "organization" | "agent" | "none" | undefined;
|
|
3145
|
+
effectiveConnectionId?: string | null | undefined;
|
|
3146
|
+
explicitlyDisabled?: boolean | undefined;
|
|
2940
3147
|
} | undefined;
|
|
2941
3148
|
}>;
|
|
2942
3149
|
export type CreateMcpConnection = z.infer<typeof createMcpConnectionSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/validators/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/validators/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkCxB,eAAO,MAAM,2BAA2B,uDAAmC,CAAC;AAC5E,eAAO,MAAM,wBAAwB,sCAAgC,CAAC;AACtE,eAAO,MAAM,4BAA4B,0DAAoC,CAAC;AAC9E,eAAO,MAAM,6BAA6B,4DAAsC,CAAC;AACjF,eAAO,MAAM,wBAAwB,4EAAiC,CAAC;AACvE,eAAO,MAAM,iCAAiC,wCAA0C,CAAC;AACzF,eAAO,MAAM,0BAA0B,uDAAmC,CAAC;AAC3E,eAAO,MAAM,kCAAkC,4FAA2C,CAAC;AAC3F,eAAO,MAAM,4BAA4B,mFAAsC,CAAC;AAChF,eAAO,MAAM,0BAA0B,4DAA0D,CAAC;AAClG,eAAO,MAAM,yBAAyB,kHAAkC,CAAC;AACzE,eAAO,MAAM,yBAAy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,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
|
package/dist/validators/mcp.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { MCP_AGENT_ACCESS_MODES, MCP_AGENT_BINDING_STATUSES, MCP_CONNECTION_ACCESS_MODES, MCP_CONNECTION_CANONICAL_STATES, MCP_CONNECTION_PROVIDERS, MCP_CONNECTION_STATUSES, MCP_CONNECTION_TRANSPORTS, MCP_OAUTH_GRANT_STATUSES, MCP_PROVIDER_CATALOG, MCP_PROVIDER_ORGANIZATION_STATES, MCP_PROVIDER_SCOPE_MODES, MCP_TOOL_CAPABILITY_CLASSES, } from "../constants.js";
|
|
2
|
+
import { MCP_AGENT_ACCESS_MODES, MCP_AGENT_BINDING_STATUSES, MCP_CONNECTION_ACCESS_MODES, MCP_CONNECTION_CANONICAL_STATES, MCP_CONNECTION_PROVIDERS, MCP_CONNECTION_SCOPES, MCP_CONNECTION_STATUSES, MCP_CONNECTION_TRANSPORTS, MCP_OAUTH_GRANT_STATUSES, MCP_PROVIDER_CATALOG, MCP_PROVIDER_ORGANIZATION_STATES, MCP_PROVIDER_SCOPE_MODES, MCP_TOOL_CAPABILITY_CLASSES, } from "../constants.js";
|
|
3
3
|
const uuidSchema = z.string().uuid();
|
|
4
4
|
const timestampSchema = z.string().datetime({ offset: true });
|
|
5
5
|
const connectionNameSchema = z.string()
|
|
@@ -17,6 +17,7 @@ const externalMcpToolNameSchema = z.string()
|
|
|
17
17
|
.regex(/^[A-Za-z0-9_.-]+$/, "Use an exact MCP tool name");
|
|
18
18
|
const externalMcpToolFilterSchema = z.array(externalMcpToolNameSchema).max(500);
|
|
19
19
|
export const mcpConnectionProviderSchema = z.enum(MCP_CONNECTION_PROVIDERS);
|
|
20
|
+
export const mcpConnectionScopeSchema = z.enum(MCP_CONNECTION_SCOPES);
|
|
20
21
|
export const mcpConnectionTransportSchema = z.enum(MCP_CONNECTION_TRANSPORTS);
|
|
21
22
|
export const mcpConnectionAccessModeSchema = z.enum(MCP_CONNECTION_ACCESS_MODES);
|
|
22
23
|
export const mcpAgentAccessModeSchema = z.enum(MCP_AGENT_ACCESS_MODES);
|
|
@@ -132,6 +133,8 @@ const mcpConnectionInputFields = {
|
|
|
132
133
|
name: connectionNameSchema,
|
|
133
134
|
displayName: z.string().trim().min(1).max(120),
|
|
134
135
|
provider: mcpConnectionProviderSchema,
|
|
136
|
+
scope: mcpConnectionScopeSchema,
|
|
137
|
+
ownerAgentId: uuidSchema.optional().nullable(),
|
|
135
138
|
transport: mcpConnectionTransportSchema,
|
|
136
139
|
externalScope: z.string().trim().min(1).max(512).optional().nullable(),
|
|
137
140
|
accessMode: mcpConnectionAccessModeSchema.optional(),
|
|
@@ -150,7 +153,7 @@ const providerAccessModes = {
|
|
|
150
153
|
};
|
|
151
154
|
function defaultAccessMode(provider) {
|
|
152
155
|
if (provider === "supabase")
|
|
153
|
-
return "
|
|
156
|
+
return "read_write";
|
|
154
157
|
if (provider === "linear")
|
|
155
158
|
return "read_write";
|
|
156
159
|
return "provider_default";
|
|
@@ -315,6 +318,22 @@ function validateConnectionSecretMutation(value, ctx) {
|
|
|
315
318
|
}
|
|
316
319
|
export const createMcpConnectionSchema = z.object(mcpConnectionInputFields)
|
|
317
320
|
.strict()
|
|
321
|
+
.superRefine((value, ctx) => {
|
|
322
|
+
if (value.scope === "organization" && value.ownerAgentId) {
|
|
323
|
+
ctx.addIssue({
|
|
324
|
+
code: z.ZodIssueCode.custom,
|
|
325
|
+
path: ["ownerAgentId"],
|
|
326
|
+
message: "Organization MCP connections cannot have an owner agent",
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
if (value.scope === "agent" && !value.ownerAgentId) {
|
|
330
|
+
ctx.addIssue({
|
|
331
|
+
code: z.ZodIssueCode.custom,
|
|
332
|
+
path: ["ownerAgentId"],
|
|
333
|
+
message: "Agent MCP connections require an owner agent",
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
})
|
|
318
337
|
.superRefine((value, ctx) => {
|
|
319
338
|
if (reservedMcpConnectionNames.has(value.name)) {
|
|
320
339
|
ctx.addIssue({
|
|
@@ -373,6 +392,8 @@ export const mcpConnectionMutationConfigSchema = z.object({
|
|
|
373
392
|
export const mcpConnectionSummarySchema = z.object({
|
|
374
393
|
id: uuidSchema,
|
|
375
394
|
orgId: uuidSchema,
|
|
395
|
+
scope: mcpConnectionScopeSchema,
|
|
396
|
+
ownerAgentId: uuidSchema.nullable(),
|
|
376
397
|
name: connectionNameSchema,
|
|
377
398
|
displayName: z.string().min(1).max(120),
|
|
378
399
|
provider: mcpConnectionProviderSchema,
|
|
@@ -523,11 +544,21 @@ export const mcpProviderAvailabilitySchema = z.object({
|
|
|
523
544
|
scopeMode: mcpProviderScopeModeSchema.nullable(),
|
|
524
545
|
revision: z.number().int().positive().nullable(),
|
|
525
546
|
affectedAgentCount: z.number().int().nonnegative().optional(),
|
|
547
|
+
agentConnectionCount: z.number().int().nonnegative().optional(),
|
|
526
548
|
historicalGrantConnectionIds: z.array(uuidSchema).max(100).optional(),
|
|
527
549
|
}).strict(),
|
|
528
550
|
agent: z.object({
|
|
529
551
|
access: mcpAgentAccessModeSchema,
|
|
530
552
|
activeRunUsesOlderPolicy: z.boolean(),
|
|
553
|
+
connection: z.object({
|
|
554
|
+
state: mcpProviderOrganizationStateSchema,
|
|
555
|
+
connectionId: uuidSchema,
|
|
556
|
+
maxAccess: mcpProviderMaxAccessSchema,
|
|
557
|
+
revision: z.number().int().positive(),
|
|
558
|
+
}).strict().nullable().default(null),
|
|
559
|
+
effectiveSource: z.enum(["agent", "organization", "none"]).default("none"),
|
|
560
|
+
effectiveConnectionId: uuidSchema.nullable().default(null),
|
|
561
|
+
explicitlyDisabled: z.boolean().default(false),
|
|
531
562
|
}).strict().optional(),
|
|
532
563
|
}).strict().superRefine((value, ctx) => {
|
|
533
564
|
const connectedState = value.organization.state === "connected";
|