@assistant-ui/react-mcp 0.1.18 → 0.1.20
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/auth/buildHeaders.d.ts +3 -6
- package/dist/auth/buildHeaders.d.ts.map +1 -1
- package/dist/auth/createOAuthProvider.d.ts +24 -26
- package/dist/auth/createOAuthProvider.d.ts.map +1 -1
- package/dist/auth/types.d.ts +13 -16
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/connector.d.ts +2 -5
- package/dist/connector.d.ts.map +1 -1
- package/dist/context/McpConnectorByIndexProvider.d.ts +3 -6
- package/dist/context/McpConnectorByIndexProvider.d.ts.map +1 -1
- package/dist/context/McpConnectorByIndexProvider.js +1 -1
- package/dist/context/McpCustomServerByIndexProvider.d.ts +3 -6
- package/dist/context/McpCustomServerByIndexProvider.d.ts.map +1 -1
- package/dist/context/McpCustomServerByIndexProvider.js +1 -1
- package/dist/context/McpServerByIdProvider.d.ts +3 -6
- package/dist/context/McpServerByIdProvider.d.ts.map +1 -1
- package/dist/context/McpServerByIdProvider.js +1 -1
- package/dist/hooks/useMcpOAuthCallback.d.ts +14 -17
- package/dist/hooks/useMcpOAuthCallback.d.ts.map +1 -1
- package/dist/hooks/useMcpOAuthCallback.js +6 -2
- package/dist/hooks/useMcpOAuthCallback.js.map +1 -1
- package/dist/index.d.ts +19 -18
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -4
- package/dist/mcp-scope.d.ts +124 -127
- package/dist/mcp-scope.d.ts.map +1 -1
- package/dist/primitives/addForm/McpAddFormAuthFields.d.ts +14 -16
- package/dist/primitives/addForm/McpAddFormAuthFields.d.ts.map +1 -1
- package/dist/primitives/addForm/McpAddFormAuthFields.js +18 -71
- package/dist/primitives/addForm/McpAddFormAuthFields.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormAuthSelect.d.ts +5 -8
- package/dist/primitives/addForm/McpAddFormAuthSelect.d.ts.map +1 -1
- package/dist/primitives/addForm/McpAddFormAuthSelect.js +1 -1
- package/dist/primitives/addForm/McpAddFormBearerTokenField.d.ts +8 -0
- package/dist/primitives/addForm/McpAddFormBearerTokenField.d.ts.map +1 -0
- package/dist/primitives/addForm/McpAddFormBearerTokenField.js +50 -0
- package/dist/primitives/addForm/McpAddFormBearerTokenField.js.map +1 -0
- package/dist/primitives/addForm/McpAddFormCancel.d.ts +6 -9
- package/dist/primitives/addForm/McpAddFormCancel.d.ts.map +1 -1
- package/dist/primitives/addForm/McpAddFormCancel.js +1 -1
- package/dist/primitives/addForm/McpAddFormError.d.ts +6 -9
- package/dist/primitives/addForm/McpAddFormError.d.ts.map +1 -1
- package/dist/primitives/addForm/McpAddFormError.js +1 -1
- package/dist/primitives/addForm/McpAddFormNameField.d.ts +5 -8
- package/dist/primitives/addForm/McpAddFormNameField.d.ts.map +1 -1
- package/dist/primitives/addForm/McpAddFormNameField.js +1 -1
- package/dist/primitives/addForm/McpAddFormRoot.d.ts +11 -14
- package/dist/primitives/addForm/McpAddFormRoot.d.ts.map +1 -1
- package/dist/primitives/addForm/McpAddFormRoot.js +2 -2
- package/dist/primitives/addForm/McpAddFormScopesField.d.ts +8 -0
- package/dist/primitives/addForm/McpAddFormScopesField.d.ts.map +1 -0
- package/dist/primitives/addForm/McpAddFormScopesField.js +38 -0
- package/dist/primitives/addForm/McpAddFormScopesField.js.map +1 -0
- package/dist/primitives/addForm/McpAddFormSubmit.d.ts +6 -9
- package/dist/primitives/addForm/McpAddFormSubmit.d.ts.map +1 -1
- package/dist/primitives/addForm/McpAddFormSubmit.js +1 -1
- package/dist/primitives/addForm/McpAddFormUrlField.d.ts +5 -8
- package/dist/primitives/addForm/McpAddFormUrlField.d.ts.map +1 -1
- package/dist/primitives/addForm/McpAddFormUrlField.js +1 -1
- package/dist/primitives/addForm/context.d.ts +25 -28
- package/dist/primitives/addForm/context.d.ts.map +1 -1
- package/dist/primitives/addForm.d.ts +10 -13
- package/dist/primitives/addForm.d.ts.map +1 -1
- package/dist/primitives/addForm.js +5 -1
- package/dist/primitives/addForm.js.map +1 -1
- package/dist/primitives/elicitation/McpElicitationPrimitiveAccept.d.ts +6 -9
- package/dist/primitives/elicitation/McpElicitationPrimitiveAccept.d.ts.map +1 -1
- package/dist/primitives/elicitation/McpElicitationPrimitiveAccept.js +2 -2
- package/dist/primitives/elicitation/McpElicitationPrimitiveCancel.d.ts +6 -9
- package/dist/primitives/elicitation/McpElicitationPrimitiveCancel.d.ts.map +1 -1
- package/dist/primitives/elicitation/McpElicitationPrimitiveCancel.js +2 -2
- package/dist/primitives/elicitation/McpElicitationPrimitiveDecline.d.ts +6 -9
- package/dist/primitives/elicitation/McpElicitationPrimitiveDecline.d.ts.map +1 -1
- package/dist/primitives/elicitation/McpElicitationPrimitiveDecline.js +2 -2
- package/dist/primitives/elicitation/McpElicitationPrimitiveError.d.ts +6 -9
- package/dist/primitives/elicitation/McpElicitationPrimitiveError.d.ts.map +1 -1
- package/dist/primitives/elicitation/McpElicitationPrimitiveError.js +1 -1
- package/dist/primitives/elicitation/McpElicitationPrimitiveFields.d.ts +8 -10
- package/dist/primitives/elicitation/McpElicitationPrimitiveFields.d.ts.map +1 -1
- package/dist/primitives/elicitation/McpElicitationPrimitiveFields.js +1 -1
- package/dist/primitives/elicitation/McpElicitationPrimitiveItems.d.ts +8 -11
- package/dist/primitives/elicitation/McpElicitationPrimitiveItems.d.ts.map +1 -1
- package/dist/primitives/elicitation/McpElicitationPrimitiveItems.js +2 -2
- package/dist/primitives/elicitation/McpElicitationPrimitiveMessage.d.ts +6 -9
- package/dist/primitives/elicitation/McpElicitationPrimitiveMessage.d.ts.map +1 -1
- package/dist/primitives/elicitation/McpElicitationPrimitiveMessage.js +1 -1
- package/dist/primitives/elicitation/McpElicitationPrimitiveRoot.d.ts +6 -9
- package/dist/primitives/elicitation/McpElicitationPrimitiveRoot.d.ts.map +1 -1
- package/dist/primitives/elicitation/McpElicitationPrimitiveRoot.js +1 -1
- package/dist/primitives/elicitation/context.d.ts +15 -18
- package/dist/primitives/elicitation/context.d.ts.map +1 -1
- package/dist/primitives/elicitation/initialElicitationDraft.d.ts +1 -4
- package/dist/primitives/elicitation/initialElicitationDraft.d.ts.map +1 -1
- package/dist/primitives/elicitation/prepareElicitationContent.d.ts +4 -7
- package/dist/primitives/elicitation/prepareElicitationContent.d.ts.map +1 -1
- package/dist/primitives/elicitation/prepareElicitationContent.js +5 -1
- package/dist/primitives/elicitation/prepareElicitationContent.js.map +1 -1
- package/dist/primitives/elicitation.d.ts +8 -14
- package/dist/primitives/elicitation.d.ts.map +1 -1
- package/dist/primitives/manager/McpManagerAddCustomTrigger.d.ts +6 -9
- package/dist/primitives/manager/McpManagerAddCustomTrigger.d.ts.map +1 -1
- package/dist/primitives/manager/McpManagerAddCustomTrigger.js +1 -1
- package/dist/primitives/manager/McpManagerConnectors.d.ts +14 -17
- package/dist/primitives/manager/McpManagerConnectors.d.ts.map +1 -1
- package/dist/primitives/manager/McpManagerConnectors.js +1 -1
- package/dist/primitives/manager/McpManagerCustomServers.d.ts +14 -17
- package/dist/primitives/manager/McpManagerCustomServers.d.ts.map +1 -1
- package/dist/primitives/manager/McpManagerCustomServers.js +1 -1
- package/dist/primitives/manager/McpManagerRoot.d.ts +6 -9
- package/dist/primitives/manager/McpManagerRoot.d.ts.map +1 -1
- package/dist/primitives/manager/McpManagerRoot.js +2 -2
- package/dist/primitives/manager.d.ts +4 -9
- package/dist/primitives/manager.d.ts.map +1 -1
- package/dist/primitives/server/McpServerConnectButton.d.ts +6 -9
- package/dist/primitives/server/McpServerConnectButton.d.ts.map +1 -1
- package/dist/primitives/server/McpServerConnectButton.js +2 -2
- package/dist/primitives/server/McpServerDisconnectButton.d.ts +6 -9
- package/dist/primitives/server/McpServerDisconnectButton.d.ts.map +1 -1
- package/dist/primitives/server/McpServerDisconnectButton.js +2 -2
- package/dist/primitives/server/McpServerError.d.ts +6 -9
- package/dist/primitives/server/McpServerError.d.ts.map +1 -1
- package/dist/primitives/server/McpServerError.js +2 -2
- package/dist/primitives/server/McpServerIcon.d.ts +12 -15
- package/dist/primitives/server/McpServerIcon.d.ts.map +1 -1
- package/dist/primitives/server/McpServerIcon.js +2 -2
- package/dist/primitives/server/McpServerName.d.ts +6 -9
- package/dist/primitives/server/McpServerName.d.ts.map +1 -1
- package/dist/primitives/server/McpServerName.js +2 -2
- package/dist/primitives/server/McpServerOAuthLink.d.ts +11 -14
- package/dist/primitives/server/McpServerOAuthLink.d.ts.map +1 -1
- package/dist/primitives/server/McpServerOAuthLink.js +2 -2
- package/dist/primitives/server/McpServerRemoveButton.d.ts +6 -9
- package/dist/primitives/server/McpServerRemoveButton.d.ts.map +1 -1
- package/dist/primitives/server/McpServerRemoveButton.js +2 -2
- package/dist/primitives/server/McpServerRoot.d.ts +6 -9
- package/dist/primitives/server/McpServerRoot.d.ts.map +1 -1
- package/dist/primitives/server/McpServerRoot.js +2 -2
- package/dist/primitives/server/McpServerStatus.d.ts +6 -9
- package/dist/primitives/server/McpServerStatus.d.ts.map +1 -1
- package/dist/primitives/server/McpServerStatus.js +2 -2
- package/dist/primitives/server/McpServerToolName.d.ts +6 -9
- package/dist/primitives/server/McpServerToolName.d.ts.map +1 -1
- package/dist/primitives/server/McpServerToolName.js +1 -1
- package/dist/primitives/server/McpServerTools.d.ts +8 -11
- package/dist/primitives/server/McpServerTools.d.ts.map +1 -1
- package/dist/primitives/server/McpServerTools.js +2 -2
- package/dist/primitives/server.d.ts +11 -16
- package/dist/primitives/server.d.ts.map +1 -1
- package/dist/resources/McpManagerResource.d.ts +13 -16
- package/dist/resources/McpManagerResource.d.ts.map +1 -1
- package/dist/resources/McpManagerResource.js +95 -64
- package/dist/resources/McpManagerResource.js.map +1 -1
- package/dist/resources/McpServerRemovalFence.d.ts +3 -6
- package/dist/resources/McpServerRemovalFence.d.ts.map +1 -1
- package/dist/resources/McpServerResource.d.ts +21 -24
- package/dist/resources/McpServerResource.d.ts.map +1 -1
- package/dist/resources/McpServerResource.js +55 -47
- package/dist/resources/McpServerResource.js.map +1 -1
- package/dist/resources/storage/McpCustomStorage.d.ts +2 -5
- package/dist/resources/storage/McpCustomStorage.d.ts.map +1 -1
- package/dist/resources/storage/McpLocalStorage.d.ts +18 -21
- package/dist/resources/storage/McpLocalStorage.d.ts.map +1 -1
- package/dist/resources/storage/McpLocalStorage.js +1 -1
- package/dist/resources/storage/McpMemoryStorage.d.ts +2 -5
- package/dist/resources/storage/McpMemoryStorage.d.ts.map +1 -1
- package/dist/resources/storage/types.d.ts +24 -27
- package/dist/resources/storage/types.d.ts.map +1 -1
- package/dist/resources/validateElicitationContent.d.ts +4 -6
- package/dist/resources/validateElicitationContent.d.ts.map +1 -1
- package/dist/utils/createMcpId.d.ts +1 -4
- package/dist/utils/createMcpId.d.ts.map +1 -1
- package/dist/utils/invokeMcpCallback.d.ts +1 -4
- package/dist/utils/invokeMcpCallback.d.ts.map +1 -1
- package/dist/utils/serverId.d.ts +2 -5
- package/dist/utils/serverId.d.ts.map +1 -1
- package/dist/utils/serverUrl.d.ts +4 -7
- package/dist/utils/serverUrl.d.ts.map +1 -1
- package/package.json +11 -10
- package/src/hooks/useMcpOAuthCallback.test.ts +53 -0
- package/src/hooks/useMcpOAuthCallback.tsx +12 -0
- package/src/index.ts +2 -1
- package/src/primitives/addForm/McpAddFormAccessibility.test.tsx +49 -0
- package/src/primitives/addForm/McpAddFormAuthFields.tsx +7 -15
- package/src/primitives/addForm/McpAddFormBearerTokenField.tsx +46 -0
- package/src/primitives/addForm/McpAddFormRoot.test.tsx +65 -0
- package/src/primitives/addForm/McpAddFormScopesField.tsx +34 -0
- package/src/primitives/addForm.ts +2 -0
- package/src/primitives/elicitation/prepareElicitationContent.ts +8 -6
- package/src/resources/McpManagerResource.test.ts +85 -0
- package/src/resources/McpManagerResource.ts +56 -23
- package/src/resources/McpServerResource.test.ts +121 -6
- package/src/resources/McpServerResource.ts +28 -12
package/dist/mcp-scope.d.ts
CHANGED
|
@@ -1,150 +1,147 @@
|
|
|
1
1
|
import "@assistant-ui/store";
|
|
2
|
-
|
|
3
|
-
type
|
|
4
|
-
type: "none";
|
|
2
|
+
export type MCPAuthConfig = {
|
|
3
|
+
type: "none";
|
|
5
4
|
} | {
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
type: "bearer";
|
|
6
|
+
token?: string | undefined;
|
|
8
7
|
} | {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
type: "oauth";
|
|
9
|
+
scopes?: string[] | undefined;
|
|
10
|
+
authorizationEndpoint?: string | undefined;
|
|
11
|
+
tokenEndpoint?: string | undefined;
|
|
12
|
+
registrationEndpoint?: string | undefined;
|
|
13
|
+
clientId?: string | undefined;
|
|
14
|
+
clientSecret?: string | undefined;
|
|
16
15
|
};
|
|
17
|
-
type MCPResponseCacheConfig = {
|
|
18
|
-
|
|
16
|
+
export type MCPResponseCacheConfig = {
|
|
17
|
+
readonly defaultTtlMs?: number;
|
|
19
18
|
};
|
|
20
|
-
type MCPConnector = {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
export type MCPConnector = {
|
|
20
|
+
id: string;
|
|
21
|
+
name: string;
|
|
22
|
+
url: string;
|
|
23
|
+
icon?: string | undefined;
|
|
24
|
+
auth: MCPAuthConfig;
|
|
25
|
+
connectionTimeout?: number | undefined;
|
|
26
|
+
readonly cache?: MCPResponseCacheConfig | undefined;
|
|
27
|
+
readonly elicitation?: boolean | undefined;
|
|
29
28
|
};
|
|
30
|
-
type MCPCustomServerRecord = {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
29
|
+
export type MCPCustomServerRecord = {
|
|
30
|
+
id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
url: string;
|
|
33
|
+
auth: MCPAuthConfig;
|
|
34
|
+
connectionTimeout?: number | undefined;
|
|
35
|
+
readonly cache?: MCPResponseCacheConfig | undefined;
|
|
36
|
+
readonly elicitation?: boolean | undefined;
|
|
37
|
+
createdAt: number;
|
|
39
38
|
};
|
|
40
|
-
type MCPServerKind = "connector" | "custom";
|
|
41
|
-
type MCPConnectionState = "disconnected" | "authRequired" | "authPending" | "connecting" | "connected" | "error";
|
|
42
|
-
type MCPToolInfo = {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
export type MCPServerKind = "connector" | "custom";
|
|
40
|
+
export type MCPConnectionState = "disconnected" | "authRequired" | "authPending" | "connecting" | "connected" | "error";
|
|
41
|
+
export type MCPToolInfo = {
|
|
42
|
+
name: string;
|
|
43
|
+
description?: string | undefined;
|
|
44
|
+
inputSchema: unknown;
|
|
46
45
|
};
|
|
47
|
-
type MCPElicitation = {
|
|
48
|
-
|
|
49
|
-
readonly message: string;
|
|
50
|
-
readonly requestedSchema: unknown;
|
|
51
|
-
readonly error?: {
|
|
46
|
+
export type MCPElicitation = {
|
|
47
|
+
readonly id: string;
|
|
52
48
|
readonly message: string;
|
|
53
|
-
readonly
|
|
54
|
-
|
|
49
|
+
readonly requestedSchema: unknown;
|
|
50
|
+
readonly error?: {
|
|
51
|
+
readonly message: string;
|
|
52
|
+
readonly properties?: readonly string[] | undefined;
|
|
53
|
+
} | undefined;
|
|
55
54
|
};
|
|
56
|
-
type MCPElicitationResponse = {
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
export type MCPElicitationResponse = {
|
|
56
|
+
action: "accept";
|
|
57
|
+
content: Record<string, unknown>;
|
|
59
58
|
} | {
|
|
60
|
-
|
|
59
|
+
action: "decline";
|
|
61
60
|
} | {
|
|
62
|
-
|
|
61
|
+
action: "cancel";
|
|
63
62
|
};
|
|
64
|
-
type MCPServerState = {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
63
|
+
export type MCPServerState = {
|
|
64
|
+
id: string;
|
|
65
|
+
kind: MCPServerKind;
|
|
66
|
+
name: string;
|
|
67
|
+
url: string;
|
|
68
|
+
icon?: string | undefined;
|
|
69
|
+
connectionState: MCPConnectionState;
|
|
70
|
+
lastError: {
|
|
71
|
+
message: string;
|
|
72
|
+
} | null;
|
|
73
|
+
tools: MCPToolInfo[];
|
|
74
|
+
authorizationUrl: string | null;
|
|
75
|
+
readonly pendingElicitations: readonly MCPElicitation[];
|
|
77
76
|
};
|
|
78
|
-
type MCPManagerState = {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
export type MCPManagerState = {
|
|
78
|
+
servers: MCPServerState[];
|
|
79
|
+
connectors: MCPServerState[];
|
|
80
|
+
customServers: MCPServerState[];
|
|
81
|
+
isHydrated: boolean;
|
|
83
82
|
};
|
|
84
|
-
type MCPServerMethods = {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
83
|
+
export type MCPServerMethods = {
|
|
84
|
+
getState: () => MCPServerState;
|
|
85
|
+
connect: () => Promise<void>;
|
|
86
|
+
disconnect: () => Promise<void>;
|
|
87
|
+
remove: () => Promise<void>;
|
|
88
|
+
callTool: (name: string, args: unknown) => Promise<unknown>;
|
|
89
|
+
/** List resources exposed by the server. Returns the raw MCP `ListResourcesResult`. */
|
|
90
|
+
listResources: (params?: {
|
|
91
|
+
cursor?: string | undefined;
|
|
92
|
+
}) => Promise<unknown>;
|
|
93
|
+
/** Read a resource by URI. Returns the raw MCP `ReadResourceResult`. */
|
|
94
|
+
readResource: (uri: string) => Promise<unknown>;
|
|
95
|
+
/** OAuth only: pass full callback URL (e.g. window.location.href) */
|
|
96
|
+
completeAuth: (callbackUrl: string) => Promise<void>;
|
|
97
|
+
answerElicitation(id: string, response: MCPElicitationResponse): readonly {
|
|
98
|
+
property: string;
|
|
99
|
+
message: string;
|
|
100
|
+
}[] | undefined;
|
|
102
101
|
};
|
|
103
|
-
type MCPServerQuery = {
|
|
104
|
-
|
|
105
|
-
} | {
|
|
106
|
-
kind: "connector";
|
|
107
|
-
index: number;
|
|
102
|
+
export type MCPServerQuery = {
|
|
103
|
+
id: string;
|
|
108
104
|
} | {
|
|
109
|
-
|
|
110
|
-
index: number;
|
|
111
|
-
};
|
|
112
|
-
type MCPManagerMethods = {
|
|
113
|
-
getState: () => MCPManagerState;
|
|
114
|
-
/** Look up a server by id, or by index within its kind. */
|
|
115
|
-
server: (query: MCPServerQuery) => MCPServerMethods;
|
|
116
|
-
/** Convenience: equivalent to `server({ kind: "connector", index })`. */
|
|
117
|
-
connector: (query: {
|
|
105
|
+
kind: "connector";
|
|
118
106
|
index: number;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
customServer: (query: {
|
|
107
|
+
} | {
|
|
108
|
+
kind: "custom";
|
|
122
109
|
index: number;
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
110
|
+
};
|
|
111
|
+
export type MCPManagerMethods = {
|
|
112
|
+
getState: () => MCPManagerState;
|
|
113
|
+
/** Look up a server by id, or by index within its kind. */
|
|
114
|
+
server: (query: MCPServerQuery) => MCPServerMethods;
|
|
115
|
+
/** Convenience: equivalent to `server({ kind: "connector", index })`. */
|
|
116
|
+
connector: (query: {
|
|
117
|
+
index: number;
|
|
118
|
+
}) => MCPServerMethods;
|
|
119
|
+
/** Convenience: equivalent to `server({ kind: "custom", index })`. */
|
|
120
|
+
customServer: (query: {
|
|
121
|
+
index: number;
|
|
122
|
+
}) => MCPServerMethods;
|
|
123
|
+
addCustomServer: (input: {
|
|
124
|
+
name: string;
|
|
125
|
+
url: string;
|
|
126
|
+
auth: MCPAuthConfig;
|
|
127
|
+
connectionTimeout?: number | undefined;
|
|
128
|
+
readonly cache?: MCPResponseCacheConfig | undefined;
|
|
129
|
+
readonly elicitation?: boolean | undefined;
|
|
130
|
+
}) => Promise<string>;
|
|
131
|
+
removeServer: (id: string) => Promise<void>;
|
|
133
132
|
};
|
|
134
133
|
declare module "@assistant-ui/store" {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
134
|
+
interface ScopeRegistry {
|
|
135
|
+
mcp: {
|
|
136
|
+
methods: MCPManagerMethods;
|
|
137
|
+
};
|
|
138
|
+
mcpServer: {
|
|
139
|
+
methods: MCPServerMethods;
|
|
140
|
+
meta: {
|
|
141
|
+
source: "mcp";
|
|
142
|
+
query: MCPServerQuery;
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
}
|
|
147
146
|
}
|
|
148
|
-
//#endregion
|
|
149
|
-
export { MCPAuthConfig, MCPConnectionState, MCPConnector, MCPCustomServerRecord, MCPElicitation, MCPElicitationResponse, MCPManagerMethods, MCPManagerState, MCPResponseCacheConfig, MCPServerKind, MCPServerMethods, MCPServerQuery, MCPServerState, MCPToolInfo };
|
|
150
147
|
//# sourceMappingURL=mcp-scope.d.ts.map
|
package/dist/mcp-scope.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-scope.d.ts","
|
|
1
|
+
{"version":3,"file":"mcp-scope.d.ts","sourceRoot":"","sources":["../src/mcp-scope.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAE7B,MAAM,MAAM,a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AE,KAAK,CAAC;gBAAC,KAAK,EAAE,cAAc,CAAA;aAAE,CAAC;SAChD,CAAC;KACH;CACF"}
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import type { FC } from "react";
|
|
2
|
+
import { type AddFormAuthType } from "./context.js";
|
|
3
|
+
export declare namespace McpAddFormPrimitiveAuthFields {
|
|
4
|
+
type Props = {
|
|
5
|
+
/**
|
|
6
|
+
* Optional render override. Receives the current auth type so apps can render
|
|
7
|
+
* fully custom inputs, bound to the form through `BearerTokenField` and
|
|
8
|
+
* `ScopesField`. Defaults to a minimal built-in for bearer / oauth.
|
|
9
|
+
*/
|
|
10
|
+
children?: FC<{
|
|
11
|
+
authType: AddFormAuthType;
|
|
12
|
+
}>;
|
|
13
|
+
};
|
|
14
14
|
}
|
|
15
|
-
declare const McpAddFormPrimitiveAuthFields: FC<McpAddFormPrimitiveAuthFields.Props>;
|
|
16
|
-
//#endregion
|
|
17
|
-
export { McpAddFormPrimitiveAuthFields };
|
|
15
|
+
export declare const McpAddFormPrimitiveAuthFields: FC<McpAddFormPrimitiveAuthFields.Props>;
|
|
18
16
|
//# sourceMappingURL=McpAddFormAuthFields.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpAddFormAuthFields.d.ts","
|
|
1
|
+
{"version":3,"file":"McpAddFormAuthFields.d.ts","sourceRoot":"","sources":["../../../src/primitives/addForm/McpAddFormAuthFields.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,EAAE,KAAK,eAAe,EAAc,qBAAkB;AAE7D,yBAAiB,6BAA6B,CAAC;IAC7C,KAAY,KAAK,GAAG;QAClB;;;;WAIG;QACH,QAAQ,CAAC,EAAE,EAAE,CAAC;YAAE,QAAQ,EAAE,eAAe,CAAA;SAAE,CAAC,CAAC;KAC9C,CAAC;CACH;AAED,eAAO,MAAM,6BAA6B,EAAE,EAAE,CAC5C,6BAA6B,CAAC,KAAK,CAyCpC,CAAC"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { useAddForm } from "./context.js";
|
|
2
|
+
import { McpAddFormPrimitiveBearerTokenField } from "./McpAddFormBearerTokenField.js";
|
|
3
|
+
import { McpAddFormPrimitiveScopesField } from "./McpAddFormScopesField.js";
|
|
2
4
|
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
3
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
6
|
//#region src/primitives/addForm/McpAddFormAuthFields.tsx
|
|
5
7
|
const McpAddFormPrimitiveAuthFields = (t0) => {
|
|
6
|
-
const $ = c(
|
|
8
|
+
const $ = c(7);
|
|
7
9
|
const { children } = t0;
|
|
8
|
-
const { state, ids
|
|
10
|
+
const { state, ids } = useAddForm();
|
|
9
11
|
if (children) {
|
|
10
12
|
const Render = children;
|
|
11
13
|
let t1;
|
|
@@ -20,89 +22,34 @@ const McpAddFormPrimitiveAuthFields = (t0) => {
|
|
|
20
22
|
if (state.authType === "bearer") {
|
|
21
23
|
let t1;
|
|
22
24
|
if ($[3] !== ids.bearerToken) {
|
|
23
|
-
t1 = /* @__PURE__ */ jsx("label", {
|
|
25
|
+
t1 = /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
|
|
24
26
|
htmlFor: ids.bearerToken,
|
|
25
27
|
"data-mcp-auth-field-label": "bearer-token",
|
|
26
28
|
children: "Bearer token"
|
|
27
|
-
})
|
|
29
|
+
}), /* @__PURE__ */ jsx(McpAddFormPrimitiveBearerTokenField, {
|
|
30
|
+
id: ids.bearerToken,
|
|
31
|
+
"data-mcp-auth-field": "bearer-token"
|
|
32
|
+
})] });
|
|
28
33
|
$[3] = ids.bearerToken;
|
|
29
34
|
$[4] = t1;
|
|
30
35
|
} else t1 = $[4];
|
|
31
|
-
|
|
32
|
-
if ($[5] !== setField) {
|
|
33
|
-
t2 = (e) => setField("bearerToken", e.target.value);
|
|
34
|
-
$[5] = setField;
|
|
35
|
-
$[6] = t2;
|
|
36
|
-
} else t2 = $[6];
|
|
37
|
-
const t3 = state.errorField === "bearerToken" ? true : void 0;
|
|
38
|
-
const t4 = state.errorField === "bearerToken" ? ids.error : void 0;
|
|
39
|
-
let t5;
|
|
40
|
-
if ($[7] !== ids.bearerToken || $[8] !== state.bearerToken || $[9] !== t2 || $[10] !== t3 || $[11] !== t4) {
|
|
41
|
-
t5 = /* @__PURE__ */ jsx("input", {
|
|
42
|
-
id: ids.bearerToken,
|
|
43
|
-
type: "password",
|
|
44
|
-
value: state.bearerToken,
|
|
45
|
-
onChange: t2,
|
|
46
|
-
"aria-invalid": t3,
|
|
47
|
-
"aria-describedby": t4,
|
|
48
|
-
"data-mcp-auth-field": "bearer-token"
|
|
49
|
-
});
|
|
50
|
-
$[7] = ids.bearerToken;
|
|
51
|
-
$[8] = state.bearerToken;
|
|
52
|
-
$[9] = t2;
|
|
53
|
-
$[10] = t3;
|
|
54
|
-
$[11] = t4;
|
|
55
|
-
$[12] = t5;
|
|
56
|
-
} else t5 = $[12];
|
|
57
|
-
let t6;
|
|
58
|
-
if ($[13] !== t1 || $[14] !== t5) {
|
|
59
|
-
t6 = /* @__PURE__ */ jsxs("div", { children: [t1, t5] });
|
|
60
|
-
$[13] = t1;
|
|
61
|
-
$[14] = t5;
|
|
62
|
-
$[15] = t6;
|
|
63
|
-
} else t6 = $[15];
|
|
64
|
-
return t6;
|
|
36
|
+
return t1;
|
|
65
37
|
}
|
|
66
38
|
if (state.authType === "oauth") {
|
|
67
39
|
let t1;
|
|
68
|
-
if ($[
|
|
69
|
-
t1 = /* @__PURE__ */ jsx("label", {
|
|
40
|
+
if ($[5] !== ids.scopes) {
|
|
41
|
+
t1 = /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
|
|
70
42
|
htmlFor: ids.scopes,
|
|
71
43
|
"data-mcp-auth-field-label": "oauth-scopes",
|
|
72
44
|
children: "OAuth scopes"
|
|
73
|
-
})
|
|
74
|
-
$[16] = ids.scopes;
|
|
75
|
-
$[17] = t1;
|
|
76
|
-
} else t1 = $[17];
|
|
77
|
-
let t2;
|
|
78
|
-
if ($[18] !== setField) {
|
|
79
|
-
t2 = (e_0) => setField("scopes", e_0.target.value);
|
|
80
|
-
$[18] = setField;
|
|
81
|
-
$[19] = t2;
|
|
82
|
-
} else t2 = $[19];
|
|
83
|
-
let t3;
|
|
84
|
-
if ($[20] !== ids.scopes || $[21] !== state.scopes || $[22] !== t2) {
|
|
85
|
-
t3 = /* @__PURE__ */ jsx("input", {
|
|
45
|
+
}), /* @__PURE__ */ jsx(McpAddFormPrimitiveScopesField, {
|
|
86
46
|
id: ids.scopes,
|
|
87
|
-
type: "text",
|
|
88
|
-
placeholder: "Scopes (space-separated, optional)",
|
|
89
|
-
value: state.scopes,
|
|
90
|
-
onChange: t2,
|
|
91
47
|
"data-mcp-auth-field": "oauth-scopes"
|
|
92
|
-
});
|
|
93
|
-
$[
|
|
94
|
-
$[
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
} else t3 = $[23];
|
|
98
|
-
let t4;
|
|
99
|
-
if ($[24] !== t1 || $[25] !== t3) {
|
|
100
|
-
t4 = /* @__PURE__ */ jsxs("div", { children: [t1, t3] });
|
|
101
|
-
$[24] = t1;
|
|
102
|
-
$[25] = t3;
|
|
103
|
-
$[26] = t4;
|
|
104
|
-
} else t4 = $[26];
|
|
105
|
-
return t4;
|
|
48
|
+
})] });
|
|
49
|
+
$[5] = ids.scopes;
|
|
50
|
+
$[6] = t1;
|
|
51
|
+
} else t1 = $[6];
|
|
52
|
+
return t1;
|
|
106
53
|
}
|
|
107
54
|
return null;
|
|
108
55
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpAddFormAuthFields.js","names":["FC","AddFormAuthType","useAddForm","McpAddFormPrimitiveAuthFields","Props","children","authType","t0","$","_c","state","ids","
|
|
1
|
+
{"version":3,"file":"McpAddFormAuthFields.js","names":["FC","McpAddFormPrimitiveBearerTokenField","McpAddFormPrimitiveScopesField","AddFormAuthType","useAddForm","McpAddFormPrimitiveAuthFields","Props","children","authType","t0","$","_c","state","ids","Render","t1","bearerToken","scopes","displayName"],"sources":["../../../src/primitives/addForm/McpAddFormAuthFields.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { McpAddFormPrimitiveBearerTokenField } from \"./McpAddFormBearerTokenField\";\nimport { McpAddFormPrimitiveScopesField } from \"./McpAddFormScopesField\";\nimport { type AddFormAuthType, useAddForm } from \"./context\";\n\nexport namespace McpAddFormPrimitiveAuthFields {\n export type Props = {\n /**\n * Optional render override. Receives the current auth type so apps can render\n * fully custom inputs, bound to the form through `BearerTokenField` and\n * `ScopesField`. Defaults to a minimal built-in for bearer / oauth.\n */\n children?: FC<{ authType: AddFormAuthType }>;\n };\n}\n\nexport const McpAddFormPrimitiveAuthFields: FC<\n McpAddFormPrimitiveAuthFields.Props\n> = ({ children }) => {\n const { state, ids } = useAddForm();\n\n if (children) {\n const Render = children;\n return <Render authType={state.authType} />;\n }\n\n if (state.authType === \"bearer\") {\n return (\n <div>\n <label\n htmlFor={ids.bearerToken}\n data-mcp-auth-field-label=\"bearer-token\"\n >\n Bearer token\n </label>\n <McpAddFormPrimitiveBearerTokenField\n id={ids.bearerToken}\n data-mcp-auth-field=\"bearer-token\"\n />\n </div>\n );\n }\n\n if (state.authType === \"oauth\") {\n return (\n <div>\n <label htmlFor={ids.scopes} data-mcp-auth-field-label=\"oauth-scopes\">\n OAuth scopes\n </label>\n <McpAddFormPrimitiveScopesField\n id={ids.scopes}\n data-mcp-auth-field=\"oauth-scopes\"\n />\n </div>\n );\n }\n\n return null;\n};\n\nMcpAddFormPrimitiveAuthFields.displayName =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OAEM;AAAI;AAGbV,8BAA8Ba,cAAc"}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { ComponentPropsWithoutRef, ComponentRef } from "react";
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ComponentRef } from "react";
|
|
2
2
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
type Props = Omit<ComponentPropsWithoutRef<typeof Primitive.select>, "value" | "onChange">;
|
|
3
|
+
export declare namespace McpAddFormPrimitiveAuthSelect {
|
|
4
|
+
type Element = ComponentRef<typeof Primitive.select>;
|
|
5
|
+
type Props = Omit<ComponentPropsWithoutRef<typeof Primitive.select>, "value" | "onChange">;
|
|
7
6
|
}
|
|
8
|
-
declare const McpAddFormPrimitiveAuthSelect: import("react").ForwardRefExoticComponent<McpAddFormPrimitiveAuthSelect.Props & import("react").RefAttributes<HTMLSelectElement>>;
|
|
9
|
-
//#endregion
|
|
10
|
-
export { McpAddFormPrimitiveAuthSelect };
|
|
7
|
+
export declare const McpAddFormPrimitiveAuthSelect: import("react").ForwardRefExoticComponent<McpAddFormPrimitiveAuthSelect.Props & import("react").RefAttributes<HTMLSelectElement>>;
|
|
11
8
|
//# sourceMappingURL=McpAddFormAuthSelect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpAddFormAuthSelect.d.ts","
|
|
1
|
+
{"version":3,"file":"McpAddFormAuthSelect.d.ts","sourceRoot":"","sources":["../../../src/primitives/addForm/McpAddFormAuthSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,YAAY,EAElB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAetD,yBAAiB,6BAA6B,CAAC;IAC7C,KAAY,OAAO,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC;IAC5D,KAAY,KAAK,GAAG,IAAI,CACtB,wBAAwB,CAAC,OAAO,SAAS,CAAC,MAAM,CAAC,EACjD,OAAO,GAAG,UAAU,CACrB,CAAC;CACH;AAED,eAAO,MAAM,6BAA6B,mIAwBxC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useAddForm } from "./context.js";
|
|
2
2
|
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
4
|
import { forwardRef } from "@assistant-ui/tap/react-shim";
|
|
4
5
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
5
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
//#region src/primitives/addForm/McpAddFormAuthSelect.tsx
|
|
7
7
|
const AUTH_TYPES = /* @__PURE__ */ new Set([
|
|
8
8
|
"none",
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ComponentRef } from "react";
|
|
2
|
+
import { Primitive } from "@radix-ui/react-primitive";
|
|
3
|
+
export declare namespace McpAddFormPrimitiveBearerTokenField {
|
|
4
|
+
type Element = ComponentRef<typeof Primitive.input>;
|
|
5
|
+
type Props = Omit<ComponentPropsWithoutRef<typeof Primitive.input>, "value" | "onChange" | "type">;
|
|
6
|
+
}
|
|
7
|
+
export declare const McpAddFormPrimitiveBearerTokenField: import("react").ForwardRefExoticComponent<McpAddFormPrimitiveBearerTokenField.Props & import("react").RefAttributes<HTMLInputElement>>;
|
|
8
|
+
//# sourceMappingURL=McpAddFormBearerTokenField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"McpAddFormBearerTokenField.d.ts","sourceRoot":"","sources":["../../../src/primitives/addForm/McpAddFormBearerTokenField.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,YAAY,EAElB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAGtD,yBAAiB,mCAAmC,CAAC;IACnD,KAAY,OAAO,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC;IAC3D,KAAY,KAAK,GAAG,IAAI,CACtB,wBAAwB,CAAC,OAAO,SAAS,CAAC,KAAK,CAAC,EAChD,OAAO,GAAG,UAAU,GAAG,MAAM,CAC9B,CAAC;CACH;AAED,eAAO,MAAM,mCAAmC,wIA0B9C,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { useAddForm } from "./context.js";
|
|
2
|
+
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { forwardRef } from "@assistant-ui/tap/react-shim";
|
|
5
|
+
import { Primitive } from "@radix-ui/react-primitive";
|
|
6
|
+
//#region src/primitives/addForm/McpAddFormBearerTokenField.tsx
|
|
7
|
+
const McpAddFormPrimitiveBearerTokenField = forwardRef((props, ref) => {
|
|
8
|
+
const $ = c(13);
|
|
9
|
+
const { state, ids, setField } = useAddForm();
|
|
10
|
+
const t0 = props["aria-invalid"] ?? (state.errorField === "bearerToken" ? true : void 0);
|
|
11
|
+
let t1;
|
|
12
|
+
if ($[0] !== ids || $[1] !== props || $[2] !== state.errorField) {
|
|
13
|
+
t1 = [props["aria-describedby"], state.errorField === "bearerToken" ? ids.error : null].filter(Boolean).join(" ") || void 0;
|
|
14
|
+
$[0] = ids;
|
|
15
|
+
$[1] = props;
|
|
16
|
+
$[2] = state.errorField;
|
|
17
|
+
$[3] = t1;
|
|
18
|
+
} else t1 = $[3];
|
|
19
|
+
let t2;
|
|
20
|
+
if ($[4] !== setField) {
|
|
21
|
+
t2 = (e) => setField("bearerToken", e.target.value);
|
|
22
|
+
$[4] = setField;
|
|
23
|
+
$[5] = t2;
|
|
24
|
+
} else t2 = $[5];
|
|
25
|
+
let t3;
|
|
26
|
+
if ($[6] !== props || $[7] !== ref || $[8] !== state.bearerToken || $[9] !== t0 || $[10] !== t1 || $[11] !== t2) {
|
|
27
|
+
t3 = /* @__PURE__ */ jsx(Primitive.input, {
|
|
28
|
+
type: "password",
|
|
29
|
+
...props,
|
|
30
|
+
"aria-invalid": t0,
|
|
31
|
+
"aria-describedby": t1,
|
|
32
|
+
ref,
|
|
33
|
+
value: state.bearerToken,
|
|
34
|
+
onChange: t2
|
|
35
|
+
});
|
|
36
|
+
$[6] = props;
|
|
37
|
+
$[7] = ref;
|
|
38
|
+
$[8] = state.bearerToken;
|
|
39
|
+
$[9] = t0;
|
|
40
|
+
$[10] = t1;
|
|
41
|
+
$[11] = t2;
|
|
42
|
+
$[12] = t3;
|
|
43
|
+
} else t3 = $[12];
|
|
44
|
+
return t3;
|
|
45
|
+
});
|
|
46
|
+
McpAddFormPrimitiveBearerTokenField.displayName = "McpAddFormPrimitive.BearerTokenField";
|
|
47
|
+
//#endregion
|
|
48
|
+
export { McpAddFormPrimitiveBearerTokenField };
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=McpAddFormBearerTokenField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"McpAddFormBearerTokenField.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAddForm","McpAddFormPrimitiveBearerTokenField","Element","input","Props","Omit","props","ref","$","_c","state","ids","setField","t0","errorField","undefined","t1","error","filter","Boolean","join","t2","e","target","value","t3","bearerToken","displayName"],"sources":["../../../src/primitives/addForm/McpAddFormBearerTokenField.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAddForm } from \"./context\";\n\nexport namespace McpAddFormPrimitiveBearerTokenField {\n export type Element = ComponentRef<typeof Primitive.input>;\n export type Props = Omit<\n ComponentPropsWithoutRef<typeof Primitive.input>,\n \"value\" | \"onChange\" | \"type\"\n >;\n}\n\nexport const McpAddFormPrimitiveBearerTokenField = forwardRef<\n McpAddFormPrimitiveBearerTokenField.Element,\n McpAddFormPrimitiveBearerTokenField.Props\n>((props, ref) => {\n const { state, ids, setField } = useAddForm();\n return (\n <Primitive.input\n type=\"password\"\n {...props}\n aria-invalid={\n props[\"aria-invalid\"] ??\n (state.errorField === \"bearerToken\" ? true : undefined)\n }\n aria-describedby={\n [\n props[\"aria-describedby\"],\n state.errorField === \"bearerToken\" ? ids.error : null,\n ]\n .filter(Boolean)\n .join(\" \") || undefined\n }\n ref={ref}\n value={state.bearerToken}\n onChange={(e) => setField(\"bearerToken\", e.target.value)}\n />\n );\n});\n\nMcpAddFormPrimitiveBearerTokenField.displayName =\n \"McpAddFormPrimitive.BearerTokenField\";\n"],"mappings":";;;;;;AAgBA,MAAaK,sCAAsCH,YAGjDQ,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CACA,MAAA,EAAAC,OAAAC,KAAAC,aAAiCZ,WAAW;CAMtC,MAAAa,KAAAP,MAAM,oBACLI,MAAKI,eAAgB,gBAArB,OAAAC,KAAAA;CAAsD,IAAAC;CAAA,IAAAR,EAAA,OAAAG,OAAAH,EAAA,OAAAF,SAAAE,EAAA,OAAAE,MAAAI,YAAA;EAGvDE,KAAA,CACEV,MAAM,qBACNI,MAAKI,eAAgB,gBAAgBH,IAAGM,QAAxC,IAAqD,CACtD,CAAAC,OACSC,OAAO,CAAC,CAAAC,KACV,GAAgB,KALxBL,KAAAA;EAKyBP,EAAA,KAAAG;EAAAH,EAAA,KAAAF;EAAAE,EAAA,KAAAE,MAAAI;EAAAN,EAAA,KAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,IAAAa;CAAA,IAAAb,EAAA,OAAAI,UAAA;EAIjBS,MAAAC,MAAOV,SAAS,eAAeU,EAACC,OAAOC,KAAM;EAAChB,EAAA,KAAAI;EAAAJ,EAAA,KAAAa;CAAA,OAAAA,KAAAb,EAAA;CAAA,IAAAiB;CAAA,IAAAjB,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAE,MAAAgB,eAAAlB,EAAA,OAAAK,MAAAL,EAAA,QAAAQ,MAAAR,EAAA,QAAAa,IAAA;EAjB1DI,KAAA,oBAAA,UAAA,OAAA;GACO,MAAA;GAAU,GACXnB;GAEF,gBAAAO;GAIA,oBAAAG;GAOGT;GACE,OAAAG,MAAKgB;GACF,UAAAL;EAA8C,CAAA;EACxDb,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAE,MAAAgB;EAAAlB,EAAA,KAAAK;EAAAL,EAAA,MAAAQ;EAAAR,EAAA,MAAAa;EAAAb,EAAA,MAAAiB;CAAA,OAAAA,KAAAjB,EAAA;CAAA,OAlBFiB;AAkBE,CAEL;AAEDxB,oCAAoC0B,cAClC"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { ComponentPropsWithoutRef, ComponentRef } from "react";
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ComponentRef } from "react";
|
|
2
2
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
type Props = ComponentPropsWithoutRef<typeof Primitive.button>;
|
|
3
|
+
export declare namespace McpAddFormPrimitiveCancel {
|
|
4
|
+
type Element = ComponentRef<typeof Primitive.button>;
|
|
5
|
+
type Props = ComponentPropsWithoutRef<typeof Primitive.button>;
|
|
7
6
|
}
|
|
8
|
-
declare const McpAddFormPrimitiveCancel: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
9
|
-
|
|
7
|
+
export declare const McpAddFormPrimitiveCancel: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
8
|
+
asChild?: boolean;
|
|
10
9
|
}, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
11
|
-
//#endregion
|
|
12
|
-
export { McpAddFormPrimitiveCancel };
|
|
13
10
|
//# sourceMappingURL=McpAddFormCancel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpAddFormCancel.d.ts","
|
|
1
|
+
{"version":3,"file":"McpAddFormCancel.d.ts","sourceRoot":"","sources":["../../../src/primitives/addForm/McpAddFormCancel.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,YAAY,EAElB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAGtD,yBAAiB,yBAAyB,CAAC;IACzC,KAAY,OAAO,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC;IAC5D,KAAY,KAAK,GAAG,wBAAwB,CAAC,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC;CACvE;AAED,eAAO,MAAM,yBAAyB;;6DAiBpC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useAddForm } from "./context.js";
|
|
2
2
|
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
4
|
import { forwardRef } from "@assistant-ui/tap/react-shim";
|
|
4
5
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
5
|
-
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
//#region src/primitives/addForm/McpAddFormCancel.tsx
|
|
7
7
|
const McpAddFormPrimitiveCancel = forwardRef((props, ref) => {
|
|
8
8
|
const $ = c(7);
|