@mcp-elements/vue 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +356 -2
- package/dist/index.js +761 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
|
-
import {
|
|
2
|
+
import { PropType, VNode, Ref, ComputedRef } from 'vue';
|
|
3
|
+
import { SelectOption, ToolStateApi, JsonSchema, ScopeDescriptor, ToolStateSnapshot, OAuthFlowApi, OAuthFlowSnapshot, AppMessageEnvelope, FieldDescriptor } from '@mcp-elements/core';
|
|
3
4
|
|
|
4
5
|
type ButtonVariant = 'primary' | 'secondary' | 'outline' | 'ghost' | 'destructive' | 'link';
|
|
5
6
|
type ButtonSize = 'sm' | 'md' | 'lg' | 'icon';
|
|
@@ -609,4 +610,357 @@ declare const McpeTabs: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
609
610
|
tabs: TabsItem[];
|
|
610
611
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
611
612
|
|
|
612
|
-
|
|
613
|
+
type McpConnectionStatus = 'connected' | 'connecting' | 'disconnected' | 'error';
|
|
614
|
+
declare const McpeMcpServerStatus: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
615
|
+
status: {
|
|
616
|
+
type: PropType<McpConnectionStatus>;
|
|
617
|
+
required: true;
|
|
618
|
+
};
|
|
619
|
+
serverName: {
|
|
620
|
+
type: StringConstructor;
|
|
621
|
+
default: string;
|
|
622
|
+
};
|
|
623
|
+
class: {
|
|
624
|
+
type: StringConstructor;
|
|
625
|
+
default: string;
|
|
626
|
+
};
|
|
627
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
628
|
+
[key: string]: any;
|
|
629
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
630
|
+
status: {
|
|
631
|
+
type: PropType<McpConnectionStatus>;
|
|
632
|
+
required: true;
|
|
633
|
+
};
|
|
634
|
+
serverName: {
|
|
635
|
+
type: StringConstructor;
|
|
636
|
+
default: string;
|
|
637
|
+
};
|
|
638
|
+
class: {
|
|
639
|
+
type: StringConstructor;
|
|
640
|
+
default: string;
|
|
641
|
+
};
|
|
642
|
+
}>> & Readonly<{}>, {
|
|
643
|
+
class: string;
|
|
644
|
+
serverName: string;
|
|
645
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
646
|
+
|
|
647
|
+
declare const McpeMcpToolCall: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
648
|
+
state: {
|
|
649
|
+
type: PropType<ToolStateApi>;
|
|
650
|
+
required: true;
|
|
651
|
+
};
|
|
652
|
+
toolName: {
|
|
653
|
+
type: StringConstructor;
|
|
654
|
+
default: string;
|
|
655
|
+
};
|
|
656
|
+
args: {
|
|
657
|
+
type: PropType<Record<string, unknown>>;
|
|
658
|
+
default: undefined;
|
|
659
|
+
};
|
|
660
|
+
class: {
|
|
661
|
+
type: StringConstructor;
|
|
662
|
+
default: string;
|
|
663
|
+
};
|
|
664
|
+
}>, () => VNode<vue.RendererNode, vue.RendererElement, {
|
|
665
|
+
[key: string]: any;
|
|
666
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, "retry"[], "retry", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
667
|
+
state: {
|
|
668
|
+
type: PropType<ToolStateApi>;
|
|
669
|
+
required: true;
|
|
670
|
+
};
|
|
671
|
+
toolName: {
|
|
672
|
+
type: StringConstructor;
|
|
673
|
+
default: string;
|
|
674
|
+
};
|
|
675
|
+
args: {
|
|
676
|
+
type: PropType<Record<string, unknown>>;
|
|
677
|
+
default: undefined;
|
|
678
|
+
};
|
|
679
|
+
class: {
|
|
680
|
+
type: StringConstructor;
|
|
681
|
+
default: string;
|
|
682
|
+
};
|
|
683
|
+
}>> & Readonly<{
|
|
684
|
+
onRetry?: ((...args: any[]) => any) | undefined;
|
|
685
|
+
}>, {
|
|
686
|
+
class: string;
|
|
687
|
+
args: Record<string, unknown>;
|
|
688
|
+
toolName: string;
|
|
689
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
690
|
+
|
|
691
|
+
declare const McpeMcpToolForm: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
692
|
+
schema: {
|
|
693
|
+
type: PropType<JsonSchema>;
|
|
694
|
+
required: true;
|
|
695
|
+
};
|
|
696
|
+
loading: {
|
|
697
|
+
type: BooleanConstructor;
|
|
698
|
+
default: boolean;
|
|
699
|
+
};
|
|
700
|
+
submitLabel: {
|
|
701
|
+
type: StringConstructor;
|
|
702
|
+
default: string;
|
|
703
|
+
};
|
|
704
|
+
class: {
|
|
705
|
+
type: StringConstructor;
|
|
706
|
+
default: string;
|
|
707
|
+
};
|
|
708
|
+
}>, () => VNode<vue.RendererNode, vue.RendererElement, {
|
|
709
|
+
[key: string]: any;
|
|
710
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, "submit"[], "submit", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
711
|
+
schema: {
|
|
712
|
+
type: PropType<JsonSchema>;
|
|
713
|
+
required: true;
|
|
714
|
+
};
|
|
715
|
+
loading: {
|
|
716
|
+
type: BooleanConstructor;
|
|
717
|
+
default: boolean;
|
|
718
|
+
};
|
|
719
|
+
submitLabel: {
|
|
720
|
+
type: StringConstructor;
|
|
721
|
+
default: string;
|
|
722
|
+
};
|
|
723
|
+
class: {
|
|
724
|
+
type: StringConstructor;
|
|
725
|
+
default: string;
|
|
726
|
+
};
|
|
727
|
+
}>> & Readonly<{
|
|
728
|
+
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
729
|
+
}>, {
|
|
730
|
+
class: string;
|
|
731
|
+
loading: boolean;
|
|
732
|
+
submitLabel: string;
|
|
733
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
734
|
+
|
|
735
|
+
declare const McpeMcpConsentDialog: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
736
|
+
open: {
|
|
737
|
+
type: BooleanConstructor;
|
|
738
|
+
required: true;
|
|
739
|
+
};
|
|
740
|
+
serverName: {
|
|
741
|
+
type: StringConstructor;
|
|
742
|
+
required: true;
|
|
743
|
+
};
|
|
744
|
+
serverIcon: {
|
|
745
|
+
type: StringConstructor;
|
|
746
|
+
default: undefined;
|
|
747
|
+
};
|
|
748
|
+
scopes: {
|
|
749
|
+
type: PropType<string[]>;
|
|
750
|
+
default: () => never[];
|
|
751
|
+
};
|
|
752
|
+
}>, () => VNode<vue.RendererNode, vue.RendererElement, {
|
|
753
|
+
[key: string]: any;
|
|
754
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("approve" | "deny")[], "approve" | "deny", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
755
|
+
open: {
|
|
756
|
+
type: BooleanConstructor;
|
|
757
|
+
required: true;
|
|
758
|
+
};
|
|
759
|
+
serverName: {
|
|
760
|
+
type: StringConstructor;
|
|
761
|
+
required: true;
|
|
762
|
+
};
|
|
763
|
+
serverIcon: {
|
|
764
|
+
type: StringConstructor;
|
|
765
|
+
default: undefined;
|
|
766
|
+
};
|
|
767
|
+
scopes: {
|
|
768
|
+
type: PropType<string[]>;
|
|
769
|
+
default: () => never[];
|
|
770
|
+
};
|
|
771
|
+
}>> & Readonly<{
|
|
772
|
+
onApprove?: ((...args: any[]) => any) | undefined;
|
|
773
|
+
onDeny?: ((...args: any[]) => any) | undefined;
|
|
774
|
+
}>, {
|
|
775
|
+
serverIcon: string;
|
|
776
|
+
scopes: string[];
|
|
777
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
778
|
+
|
|
779
|
+
declare const McpeMcpScopeInspector: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
780
|
+
scopes: {
|
|
781
|
+
type: PropType<string | ScopeDescriptor[]>;
|
|
782
|
+
default: string;
|
|
783
|
+
};
|
|
784
|
+
descriptions: {
|
|
785
|
+
type: PropType<Record<string, string>>;
|
|
786
|
+
default: () => {};
|
|
787
|
+
};
|
|
788
|
+
class: {
|
|
789
|
+
type: StringConstructor;
|
|
790
|
+
default: string;
|
|
791
|
+
};
|
|
792
|
+
}>, () => VNode<vue.RendererNode, vue.RendererElement, {
|
|
793
|
+
[key: string]: any;
|
|
794
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
795
|
+
scopes: {
|
|
796
|
+
type: PropType<string | ScopeDescriptor[]>;
|
|
797
|
+
default: string;
|
|
798
|
+
};
|
|
799
|
+
descriptions: {
|
|
800
|
+
type: PropType<Record<string, string>>;
|
|
801
|
+
default: () => {};
|
|
802
|
+
};
|
|
803
|
+
class: {
|
|
804
|
+
type: StringConstructor;
|
|
805
|
+
default: string;
|
|
806
|
+
};
|
|
807
|
+
}>> & Readonly<{}>, {
|
|
808
|
+
class: string;
|
|
809
|
+
scopes: string | ScopeDescriptor[];
|
|
810
|
+
descriptions: Record<string, string>;
|
|
811
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
812
|
+
|
|
813
|
+
interface McpResource {
|
|
814
|
+
uri: string;
|
|
815
|
+
name: string;
|
|
816
|
+
mimeType?: string;
|
|
817
|
+
description?: string;
|
|
818
|
+
}
|
|
819
|
+
declare const McpeMcpResourceBrowser: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
820
|
+
resources: {
|
|
821
|
+
type: PropType<McpResource[]>;
|
|
822
|
+
default: () => never[];
|
|
823
|
+
};
|
|
824
|
+
selectedUri: {
|
|
825
|
+
type: StringConstructor;
|
|
826
|
+
default: undefined;
|
|
827
|
+
};
|
|
828
|
+
loading: {
|
|
829
|
+
type: BooleanConstructor;
|
|
830
|
+
default: boolean;
|
|
831
|
+
};
|
|
832
|
+
class: {
|
|
833
|
+
type: StringConstructor;
|
|
834
|
+
default: string;
|
|
835
|
+
};
|
|
836
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
837
|
+
[key: string]: any;
|
|
838
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, "select"[], "select", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
839
|
+
resources: {
|
|
840
|
+
type: PropType<McpResource[]>;
|
|
841
|
+
default: () => never[];
|
|
842
|
+
};
|
|
843
|
+
selectedUri: {
|
|
844
|
+
type: StringConstructor;
|
|
845
|
+
default: undefined;
|
|
846
|
+
};
|
|
847
|
+
loading: {
|
|
848
|
+
type: BooleanConstructor;
|
|
849
|
+
default: boolean;
|
|
850
|
+
};
|
|
851
|
+
class: {
|
|
852
|
+
type: StringConstructor;
|
|
853
|
+
default: string;
|
|
854
|
+
};
|
|
855
|
+
}>> & Readonly<{
|
|
856
|
+
onSelect?: ((...args: any[]) => any) | undefined;
|
|
857
|
+
}>, {
|
|
858
|
+
class: string;
|
|
859
|
+
loading: boolean;
|
|
860
|
+
resources: McpResource[];
|
|
861
|
+
selectedUri: string;
|
|
862
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
863
|
+
|
|
864
|
+
declare const McpeMcpAppFrame: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
865
|
+
src: {
|
|
866
|
+
type: StringConstructor;
|
|
867
|
+
required: true;
|
|
868
|
+
};
|
|
869
|
+
height: {
|
|
870
|
+
type: NumberConstructor;
|
|
871
|
+
default: number;
|
|
872
|
+
};
|
|
873
|
+
sandbox: {
|
|
874
|
+
type: StringConstructor;
|
|
875
|
+
default: string;
|
|
876
|
+
};
|
|
877
|
+
class: {
|
|
878
|
+
type: StringConstructor;
|
|
879
|
+
default: string;
|
|
880
|
+
};
|
|
881
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
882
|
+
[key: string]: any;
|
|
883
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, "message"[], "message", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
884
|
+
src: {
|
|
885
|
+
type: StringConstructor;
|
|
886
|
+
required: true;
|
|
887
|
+
};
|
|
888
|
+
height: {
|
|
889
|
+
type: NumberConstructor;
|
|
890
|
+
default: number;
|
|
891
|
+
};
|
|
892
|
+
sandbox: {
|
|
893
|
+
type: StringConstructor;
|
|
894
|
+
default: string;
|
|
895
|
+
};
|
|
896
|
+
class: {
|
|
897
|
+
type: StringConstructor;
|
|
898
|
+
default: string;
|
|
899
|
+
};
|
|
900
|
+
}>> & Readonly<{
|
|
901
|
+
onMessage?: ((...args: any[]) => any) | undefined;
|
|
902
|
+
}>, {
|
|
903
|
+
class: string;
|
|
904
|
+
height: number;
|
|
905
|
+
sandbox: string;
|
|
906
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
907
|
+
|
|
908
|
+
interface UseMcpToolState {
|
|
909
|
+
/** The underlying tool-state machine (call start/markRunning/markDone/…). */
|
|
910
|
+
api: ToolStateApi;
|
|
911
|
+
/** Reactive snapshot of the machine, updated on every transition. */
|
|
912
|
+
snapshot: Ref<ToolStateSnapshot>;
|
|
913
|
+
}
|
|
914
|
+
/**
|
|
915
|
+
* Vue composable wrapping the framework-free `createToolState()` machine.
|
|
916
|
+
* Creates one machine instance and mirrors it into a reactive ref; the
|
|
917
|
+
* subscription is cleaned up automatically on unmount.
|
|
918
|
+
*/
|
|
919
|
+
declare function useMcpToolState(): UseMcpToolState;
|
|
920
|
+
|
|
921
|
+
interface UseMcpOAuth {
|
|
922
|
+
/** The underlying OAuth flow machine (call start/markAuthorized/…). */
|
|
923
|
+
api: OAuthFlowApi;
|
|
924
|
+
/** Reactive snapshot of the flow, updated on every transition. */
|
|
925
|
+
snapshot: Ref<OAuthFlowSnapshot>;
|
|
926
|
+
}
|
|
927
|
+
/**
|
|
928
|
+
* Vue composable wrapping the framework-free `createOAuthFlow()` machine.
|
|
929
|
+
* Mirrors the flow state into a reactive ref; cleans up on unmount.
|
|
930
|
+
*/
|
|
931
|
+
declare function useMcpOAuth(): UseMcpOAuth;
|
|
932
|
+
|
|
933
|
+
interface UseMcpAppBridgeOptions {
|
|
934
|
+
/** Called for every well-formed envelope received from the iframe. */
|
|
935
|
+
onMessage?: (env: AppMessageEnvelope) => void;
|
|
936
|
+
}
|
|
937
|
+
interface UseMcpAppBridge {
|
|
938
|
+
/** Bind this to the iframe element (`ref="frameRef"` / `:ref="frameRef"`). */
|
|
939
|
+
frameRef: Ref<HTMLIFrameElement | null>;
|
|
940
|
+
/** Post an envelope to the framed MCP App. */
|
|
941
|
+
send: (env: AppMessageEnvelope) => void;
|
|
942
|
+
}
|
|
943
|
+
/**
|
|
944
|
+
* Vue composable that wires a postMessage `createAppBridge()` to an iframe.
|
|
945
|
+
* Establishes the bridge once the iframe is mounted and tears down the
|
|
946
|
+
* window listener + subscription on unmount.
|
|
947
|
+
*/
|
|
948
|
+
declare function useMcpAppBridge(options?: UseMcpAppBridgeOptions): UseMcpAppBridge;
|
|
949
|
+
|
|
950
|
+
interface UseMcpSchemaForm {
|
|
951
|
+
/** Form fields derived from the JSON Schema. */
|
|
952
|
+
fields: ComputedRef<FieldDescriptor[]>;
|
|
953
|
+
/** Reactive map of field key → current value. */
|
|
954
|
+
values: Record<string, unknown>;
|
|
955
|
+
/** Set a single field's value. */
|
|
956
|
+
setValue: (key: string, value: unknown) => void;
|
|
957
|
+
/** Reset all values to the schema defaults. */
|
|
958
|
+
reset: () => void;
|
|
959
|
+
}
|
|
960
|
+
/**
|
|
961
|
+
* Vue composable that turns a JSON Schema into reactive form state via the
|
|
962
|
+
* framework-free `schemaToFields()`. Re-seeds defaults when the schema changes.
|
|
963
|
+
*/
|
|
964
|
+
declare function useMcpSchemaForm(schema: JsonSchema | (() => JsonSchema)): UseMcpSchemaForm;
|
|
965
|
+
|
|
966
|
+
export { type McpConnectionStatus, type McpResource, McpeAlert, McpeBadge, McpeButton, McpeCard, McpeCardContent, McpeCardDescription, McpeCardFooter, McpeCardHeader, McpeCardTitle, McpeDialog, McpeInput, McpeMcpAppFrame, McpeMcpConsentDialog, McpeMcpResourceBrowser, McpeMcpScopeInspector, McpeMcpServerStatus, McpeMcpToolCall, McpeMcpToolForm, McpeSelect, McpeSwitch, McpeTabs, McpeTextarea, type UseMcpAppBridge, type UseMcpAppBridgeOptions, type UseMcpOAuth, type UseMcpSchemaForm, type UseMcpToolState, useMcpAppBridge, useMcpOAuth, useMcpSchemaForm, useMcpToolState };
|