@assistant-ui/react-mcp 0.1.17 → 0.1.19
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 +1 -2
- package/dist/auth/buildHeaders.d.ts.map +1 -1
- package/dist/auth/createOAuthProvider.d.ts +5 -6
- package/dist/auth/createOAuthProvider.d.ts.map +1 -1
- package/dist/auth/types.d.ts +1 -2
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/connector.d.ts +1 -2
- package/dist/connector.d.ts.map +1 -1
- package/dist/context/McpConnectorByIndexProvider.d.ts +1 -2
- package/dist/context/McpConnectorByIndexProvider.d.ts.map +1 -1
- package/dist/context/McpCustomServerByIndexProvider.d.ts +1 -2
- package/dist/context/McpCustomServerByIndexProvider.d.ts.map +1 -1
- package/dist/context/McpServerByIdProvider.d.ts +1 -2
- package/dist/context/McpServerByIdProvider.d.ts.map +1 -1
- package/dist/hooks/useMcpOAuthCallback.d.ts +5 -6
- package/dist/hooks/useMcpOAuthCallback.d.ts.map +1 -1
- package/dist/hooks/useMcpOAuthCallback.js +4 -0
- package/dist/hooks/useMcpOAuthCallback.js.map +1 -1
- package/dist/mcp-scope.d.ts +14 -15
- package/dist/mcp-scope.d.ts.map +1 -1
- package/dist/primitives/addForm/McpAddFormAuthFields.d.ts +4 -4
- package/dist/primitives/addForm/McpAddFormAuthFields.d.ts.map +1 -1
- package/dist/primitives/addForm/McpAddFormAuthFields.js +28 -38
- package/dist/primitives/addForm/McpAddFormAuthFields.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormAuthSelect.d.ts +2 -3
- package/dist/primitives/addForm/McpAddFormAuthSelect.d.ts.map +1 -1
- package/dist/primitives/addForm/McpAddFormBearerTokenField.d.ts +10 -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 +2 -3
- package/dist/primitives/addForm/McpAddFormCancel.d.ts.map +1 -1
- package/dist/primitives/addForm/McpAddFormError.d.ts +2 -3
- package/dist/primitives/addForm/McpAddFormError.d.ts.map +1 -1
- package/dist/primitives/addForm/McpAddFormError.js +30 -10
- package/dist/primitives/addForm/McpAddFormError.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormNameField.d.ts +2 -3
- package/dist/primitives/addForm/McpAddFormNameField.d.ts.map +1 -1
- package/dist/primitives/addForm/McpAddFormNameField.js +31 -18
- package/dist/primitives/addForm/McpAddFormNameField.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormRoot.d.ts +2 -3
- package/dist/primitives/addForm/McpAddFormRoot.d.ts.map +1 -1
- package/dist/primitives/addForm/McpAddFormRoot.js +32 -11
- package/dist/primitives/addForm/McpAddFormRoot.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormScopesField.d.ts +10 -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 +2 -3
- package/dist/primitives/addForm/McpAddFormSubmit.d.ts.map +1 -1
- package/dist/primitives/addForm/McpAddFormUrlField.d.ts +2 -3
- package/dist/primitives/addForm/McpAddFormUrlField.d.ts.map +1 -1
- package/dist/primitives/addForm/McpAddFormUrlField.js +31 -18
- package/dist/primitives/addForm/McpAddFormUrlField.js.map +1 -1
- package/dist/primitives/addForm/context.d.ts +13 -6
- package/dist/primitives/addForm/context.d.ts.map +1 -1
- package/dist/primitives/addForm/context.js.map +1 -1
- package/dist/primitives/addForm.d.ts +4 -2
- package/dist/primitives/addForm.js +5 -1
- package/dist/primitives/addForm.js.map +1 -1
- package/dist/primitives/elicitation/McpElicitationPrimitiveAccept.d.ts +2 -3
- package/dist/primitives/elicitation/McpElicitationPrimitiveAccept.d.ts.map +1 -1
- package/dist/primitives/elicitation/McpElicitationPrimitiveCancel.d.ts +2 -3
- package/dist/primitives/elicitation/McpElicitationPrimitiveCancel.d.ts.map +1 -1
- package/dist/primitives/elicitation/McpElicitationPrimitiveDecline.d.ts +2 -3
- package/dist/primitives/elicitation/McpElicitationPrimitiveDecline.d.ts.map +1 -1
- package/dist/primitives/elicitation/McpElicitationPrimitiveError.d.ts +2 -3
- package/dist/primitives/elicitation/McpElicitationPrimitiveError.d.ts.map +1 -1
- package/dist/primitives/elicitation/McpElicitationPrimitiveFields.d.ts +3 -3
- package/dist/primitives/elicitation/McpElicitationPrimitiveFields.d.ts.map +1 -1
- package/dist/primitives/elicitation/McpElicitationPrimitiveItems.d.ts +3 -3
- package/dist/primitives/elicitation/McpElicitationPrimitiveItems.d.ts.map +1 -1
- package/dist/primitives/elicitation/McpElicitationPrimitiveMessage.d.ts +2 -3
- package/dist/primitives/elicitation/McpElicitationPrimitiveMessage.d.ts.map +1 -1
- package/dist/primitives/elicitation/McpElicitationPrimitiveRoot.d.ts +2 -3
- package/dist/primitives/elicitation/McpElicitationPrimitiveRoot.d.ts.map +1 -1
- package/dist/primitives/elicitation/context.d.ts +7 -8
- package/dist/primitives/elicitation/context.d.ts.map +1 -1
- package/dist/primitives/elicitation/initialElicitationDraft.d.ts +1 -2
- package/dist/primitives/elicitation/initialElicitationDraft.d.ts.map +1 -1
- package/dist/primitives/elicitation/prepareElicitationContent.d.ts +1 -2
- 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/manager/McpManagerAddCustomTrigger.d.ts +2 -3
- package/dist/primitives/manager/McpManagerAddCustomTrigger.d.ts.map +1 -1
- package/dist/primitives/manager/McpManagerConnectors.d.ts +2 -3
- package/dist/primitives/manager/McpManagerConnectors.d.ts.map +1 -1
- package/dist/primitives/manager/McpManagerCustomServers.d.ts +2 -3
- package/dist/primitives/manager/McpManagerCustomServers.d.ts.map +1 -1
- package/dist/primitives/manager/McpManagerRoot.d.ts +2 -3
- package/dist/primitives/manager/McpManagerRoot.d.ts.map +1 -1
- package/dist/primitives/server/McpServerConnectButton.d.ts +2 -3
- package/dist/primitives/server/McpServerConnectButton.d.ts.map +1 -1
- package/dist/primitives/server/McpServerDisconnectButton.d.ts +2 -3
- package/dist/primitives/server/McpServerDisconnectButton.d.ts.map +1 -1
- package/dist/primitives/server/McpServerError.d.ts +2 -3
- package/dist/primitives/server/McpServerError.d.ts.map +1 -1
- package/dist/primitives/server/McpServerIcon.d.ts +2 -3
- package/dist/primitives/server/McpServerIcon.d.ts.map +1 -1
- package/dist/primitives/server/McpServerName.d.ts +2 -3
- package/dist/primitives/server/McpServerName.d.ts.map +1 -1
- package/dist/primitives/server/McpServerOAuthLink.d.ts +2 -3
- package/dist/primitives/server/McpServerOAuthLink.d.ts.map +1 -1
- package/dist/primitives/server/McpServerRemoveButton.d.ts +2 -3
- package/dist/primitives/server/McpServerRemoveButton.d.ts.map +1 -1
- package/dist/primitives/server/McpServerRoot.d.ts +2 -3
- package/dist/primitives/server/McpServerRoot.d.ts.map +1 -1
- package/dist/primitives/server/McpServerStatus.d.ts +2 -3
- package/dist/primitives/server/McpServerStatus.d.ts.map +1 -1
- package/dist/primitives/server/McpServerToolName.d.ts +2 -3
- package/dist/primitives/server/McpServerToolName.d.ts.map +1 -1
- package/dist/primitives/server/McpServerTools.d.ts +3 -4
- package/dist/primitives/server/McpServerTools.d.ts.map +1 -1
- package/dist/resources/McpManagerResource.d.ts +2 -3
- package/dist/resources/McpManagerResource.d.ts.map +1 -1
- package/dist/resources/McpManagerResource.js +358 -244
- package/dist/resources/McpManagerResource.js.map +1 -1
- package/dist/resources/McpServerRemovalFence.d.ts +6 -0
- package/dist/resources/McpServerRemovalFence.d.ts.map +1 -0
- package/dist/resources/McpServerRemovalFence.js +11 -0
- package/dist/resources/McpServerRemovalFence.js.map +1 -0
- package/dist/resources/McpServerResource.d.ts +3 -4
- package/dist/resources/McpServerResource.d.ts.map +1 -1
- package/dist/resources/McpServerResource.js +9 -5
- package/dist/resources/McpServerResource.js.map +1 -1
- package/dist/resources/storage/McpCustomStorage.d.ts +1 -2
- package/dist/resources/storage/McpCustomStorage.d.ts.map +1 -1
- package/dist/resources/storage/McpLocalStorage.d.ts +4 -5
- package/dist/resources/storage/McpLocalStorage.d.ts.map +1 -1
- package/dist/resources/storage/McpLocalStorage.js +2 -1
- package/dist/resources/storage/McpLocalStorage.js.map +1 -1
- package/dist/resources/storage/McpMemoryStorage.d.ts +1 -2
- package/dist/resources/storage/McpMemoryStorage.d.ts.map +1 -1
- package/dist/resources/storage/types.d.ts +12 -11
- package/dist/resources/storage/types.d.ts.map +1 -1
- package/dist/resources/validateElicitationContent.d.ts +1 -2
- package/dist/resources/validateElicitationContent.d.ts.map +1 -1
- package/dist/utils/createMcpId.d.ts +1 -2
- package/dist/utils/createMcpId.d.ts.map +1 -1
- package/dist/utils/invokeMcpCallback.d.ts +1 -2
- package/dist/utils/invokeMcpCallback.d.ts.map +1 -1
- package/dist/utils/serverId.d.ts +2 -3
- package/dist/utils/serverId.d.ts.map +1 -1
- package/dist/utils/serverUrl.d.ts +3 -4
- 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 +310 -0
- package/src/primitives/addForm/McpAddFormAuthFields.tsx +26 -16
- package/src/primitives/addForm/McpAddFormBearerTokenField.tsx +46 -0
- package/src/primitives/addForm/McpAddFormError.tsx +17 -3
- package/src/primitives/addForm/McpAddFormNameField.tsx +13 -1
- package/src/primitives/addForm/McpAddFormRoot.test.tsx +65 -0
- package/src/primitives/addForm/McpAddFormRoot.tsx +51 -8
- package/src/primitives/addForm/McpAddFormScopesField.tsx +34 -0
- package/src/primitives/addForm/McpAddFormUrlField.tsx +12 -1
- package/src/primitives/addForm/context.tsx +10 -0
- package/src/primitives/addForm.ts +2 -0
- package/src/primitives/elicitation/prepareElicitationContent.ts +8 -6
- package/src/resources/McpManagerResource.test.ts +797 -9
- package/src/resources/McpManagerResource.ts +242 -60
- package/src/resources/McpServerRemovalFence.ts +21 -0
- package/src/resources/McpServerResource.test.ts +9 -6
- package/src/resources/McpServerResource.ts +11 -6
- package/src/resources/storage/McpLocalStorage.test.ts +2 -0
- package/src/resources/storage/McpLocalStorage.ts +2 -1
- package/src/resources/storage/types.ts +10 -8
|
@@ -4,12 +4,17 @@ import {
|
|
|
4
4
|
type FormEventHandler,
|
|
5
5
|
forwardRef,
|
|
6
6
|
useCallback,
|
|
7
|
+
useId,
|
|
7
8
|
useMemo,
|
|
8
9
|
useState,
|
|
9
10
|
} from "react";
|
|
10
11
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
11
12
|
import { useAui } from "@assistant-ui/store";
|
|
12
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
AddFormContext,
|
|
15
|
+
type AddFormFieldIds,
|
|
16
|
+
type AddFormState,
|
|
17
|
+
} from "./context";
|
|
13
18
|
import type { MCPAuthConfig } from "../../mcp-scope";
|
|
14
19
|
import { invokeMcpCallback } from "../../utils/invokeMcpCallback";
|
|
15
20
|
|
|
@@ -21,6 +26,7 @@ const INITIAL: AddFormState = {
|
|
|
21
26
|
scopes: "",
|
|
22
27
|
submitting: false,
|
|
23
28
|
error: null,
|
|
29
|
+
errorField: null,
|
|
24
30
|
};
|
|
25
31
|
|
|
26
32
|
function validateUrl(raw: string): { url: string } | { error: string } {
|
|
@@ -54,11 +60,30 @@ export const McpAddFormPrimitiveRoot = forwardRef<
|
|
|
54
60
|
McpAddFormPrimitiveRoot.Props
|
|
55
61
|
>(({ onSubmitted, onCancel, ...props }, ref) => {
|
|
56
62
|
const aui = useAui();
|
|
63
|
+
const formId = useId();
|
|
57
64
|
const [state, setState] = useState<AddFormState>(INITIAL);
|
|
65
|
+
const ids = useMemo<AddFormFieldIds>(
|
|
66
|
+
() => ({
|
|
67
|
+
bearerToken: `${formId}-bearer-token`,
|
|
68
|
+
scopes: `${formId}-oauth-scopes`,
|
|
69
|
+
error: `${formId}-error`,
|
|
70
|
+
}),
|
|
71
|
+
[formId],
|
|
72
|
+
);
|
|
58
73
|
|
|
59
74
|
const setField = useCallback(
|
|
60
75
|
<K extends keyof AddFormState>(key: K, value: AddFormState[K]) => {
|
|
61
|
-
setState((prev) =>
|
|
76
|
+
setState((prev) => {
|
|
77
|
+
const clearsError =
|
|
78
|
+
prev.errorField === "form" ||
|
|
79
|
+
prev.errorField === key ||
|
|
80
|
+
(key === "authType" && prev.errorField === "bearerToken");
|
|
81
|
+
return {
|
|
82
|
+
...prev,
|
|
83
|
+
[key]: value,
|
|
84
|
+
...(clearsError ? { error: null, errorField: null } : {}),
|
|
85
|
+
};
|
|
86
|
+
});
|
|
62
87
|
},
|
|
63
88
|
[],
|
|
64
89
|
);
|
|
@@ -87,19 +112,36 @@ export const McpAddFormPrimitiveRoot = forwardRef<
|
|
|
87
112
|
const submit = useCallback(async () => {
|
|
88
113
|
if (state.submitting) return;
|
|
89
114
|
if (!state.name.trim()) {
|
|
90
|
-
setState((p) => ({
|
|
115
|
+
setState((p) => ({
|
|
116
|
+
...p,
|
|
117
|
+
error: "Name is required",
|
|
118
|
+
errorField: "name",
|
|
119
|
+
}));
|
|
91
120
|
return;
|
|
92
121
|
}
|
|
93
122
|
if (state.authType === "bearer" && !state.bearerToken.trim()) {
|
|
94
|
-
setState((p) => ({
|
|
123
|
+
setState((p) => ({
|
|
124
|
+
...p,
|
|
125
|
+
error: "Bearer token is required",
|
|
126
|
+
errorField: "bearerToken",
|
|
127
|
+
}));
|
|
95
128
|
return;
|
|
96
129
|
}
|
|
97
130
|
const urlResult = validateUrl(state.url);
|
|
98
131
|
if ("error" in urlResult) {
|
|
99
|
-
setState((p) => ({
|
|
132
|
+
setState((p) => ({
|
|
133
|
+
...p,
|
|
134
|
+
error: urlResult.error,
|
|
135
|
+
errorField: "url",
|
|
136
|
+
}));
|
|
100
137
|
return;
|
|
101
138
|
}
|
|
102
|
-
setState((p) => ({
|
|
139
|
+
setState((p) => ({
|
|
140
|
+
...p,
|
|
141
|
+
submitting: true,
|
|
142
|
+
error: null,
|
|
143
|
+
errorField: null,
|
|
144
|
+
}));
|
|
103
145
|
try {
|
|
104
146
|
const id = await aui.mcp.addCustomServer({
|
|
105
147
|
name: state.name.trim(),
|
|
@@ -113,6 +155,7 @@ export const McpAddFormPrimitiveRoot = forwardRef<
|
|
|
113
155
|
...p,
|
|
114
156
|
submitting: false,
|
|
115
157
|
error: err instanceof Error ? err.message : String(err),
|
|
158
|
+
errorField: "form",
|
|
116
159
|
}));
|
|
117
160
|
}
|
|
118
161
|
}, [aui, buildAuth, onSubmitted, state]);
|
|
@@ -123,8 +166,8 @@ export const McpAddFormPrimitiveRoot = forwardRef<
|
|
|
123
166
|
}, [onCancel]);
|
|
124
167
|
|
|
125
168
|
const value = useMemo(
|
|
126
|
-
() => ({ state, setField, reset, submit, cancel }),
|
|
127
|
-
[state, setField, reset, submit, cancel],
|
|
169
|
+
() => ({ state, ids, setField, reset, submit, cancel }),
|
|
170
|
+
[state, ids, setField, reset, submit, cancel],
|
|
128
171
|
);
|
|
129
172
|
|
|
130
173
|
const onFormSubmit: FormEventHandler<HTMLFormElement> = (e) => {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type ComponentPropsWithoutRef,
|
|
3
|
+
type ComponentRef,
|
|
4
|
+
forwardRef,
|
|
5
|
+
} from "react";
|
|
6
|
+
import { Primitive } from "@radix-ui/react-primitive";
|
|
7
|
+
import { useAddForm } from "./context";
|
|
8
|
+
|
|
9
|
+
export namespace McpAddFormPrimitiveScopesField {
|
|
10
|
+
export type Element = ComponentRef<typeof Primitive.input>;
|
|
11
|
+
export type Props = Omit<
|
|
12
|
+
ComponentPropsWithoutRef<typeof Primitive.input>,
|
|
13
|
+
"value" | "onChange" | "type"
|
|
14
|
+
>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const McpAddFormPrimitiveScopesField = forwardRef<
|
|
18
|
+
McpAddFormPrimitiveScopesField.Element,
|
|
19
|
+
McpAddFormPrimitiveScopesField.Props
|
|
20
|
+
>((props, ref) => {
|
|
21
|
+
const { state, setField } = useAddForm();
|
|
22
|
+
return (
|
|
23
|
+
<Primitive.input
|
|
24
|
+
type="text"
|
|
25
|
+
placeholder="Scopes (space-separated, optional)"
|
|
26
|
+
{...props}
|
|
27
|
+
ref={ref}
|
|
28
|
+
value={state.scopes}
|
|
29
|
+
onChange={(e) => setField("scopes", e.target.value)}
|
|
30
|
+
/>
|
|
31
|
+
);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
McpAddFormPrimitiveScopesField.displayName = "McpAddFormPrimitive.ScopesField";
|
|
@@ -18,13 +18,24 @@ export const McpAddFormPrimitiveUrlField = forwardRef<
|
|
|
18
18
|
McpAddFormPrimitiveUrlField.Element,
|
|
19
19
|
McpAddFormPrimitiveUrlField.Props
|
|
20
20
|
>((props, ref) => {
|
|
21
|
-
const { state, setField } = useAddForm();
|
|
21
|
+
const { state, ids, setField } = useAddForm();
|
|
22
22
|
return (
|
|
23
23
|
<Primitive.input
|
|
24
24
|
type="url"
|
|
25
25
|
inputMode="url"
|
|
26
26
|
placeholder="https://example.com/mcp"
|
|
27
27
|
{...props}
|
|
28
|
+
aria-invalid={
|
|
29
|
+
props["aria-invalid"] ?? (state.errorField === "url" ? true : undefined)
|
|
30
|
+
}
|
|
31
|
+
aria-describedby={
|
|
32
|
+
[
|
|
33
|
+
props["aria-describedby"],
|
|
34
|
+
state.errorField === "url" ? ids.error : null,
|
|
35
|
+
]
|
|
36
|
+
.filter(Boolean)
|
|
37
|
+
.join(" ") || undefined
|
|
38
|
+
}
|
|
28
39
|
ref={ref}
|
|
29
40
|
value={state.url}
|
|
30
41
|
onChange={(e) => setField("url", e.target.value)}
|
|
@@ -3,6 +3,14 @@ import type { MCPAuthConfig } from "../../mcp-scope";
|
|
|
3
3
|
|
|
4
4
|
export type AddFormAuthType = MCPAuthConfig["type"];
|
|
5
5
|
|
|
6
|
+
export type AddFormErrorField = "name" | "url" | "bearerToken" | "form" | null;
|
|
7
|
+
|
|
8
|
+
export type AddFormFieldIds = {
|
|
9
|
+
bearerToken: string;
|
|
10
|
+
scopes: string;
|
|
11
|
+
error: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
6
14
|
export type AddFormState = {
|
|
7
15
|
name: string;
|
|
8
16
|
url: string;
|
|
@@ -11,10 +19,12 @@ export type AddFormState = {
|
|
|
11
19
|
scopes: string;
|
|
12
20
|
submitting: boolean;
|
|
13
21
|
error: string | null;
|
|
22
|
+
errorField: AddFormErrorField;
|
|
14
23
|
};
|
|
15
24
|
|
|
16
25
|
export type AddFormContextValue = {
|
|
17
26
|
state: AddFormState;
|
|
27
|
+
ids: AddFormFieldIds;
|
|
18
28
|
setField: <K extends keyof AddFormState>(
|
|
19
29
|
key: K,
|
|
20
30
|
value: AddFormState[K],
|
|
@@ -3,6 +3,8 @@ export { McpAddFormPrimitiveNameField as NameField } from "./addForm/McpAddFormN
|
|
|
3
3
|
export { McpAddFormPrimitiveUrlField as UrlField } from "./addForm/McpAddFormUrlField";
|
|
4
4
|
export { McpAddFormPrimitiveAuthSelect as AuthSelect } from "./addForm/McpAddFormAuthSelect";
|
|
5
5
|
export { McpAddFormPrimitiveAuthFields as AuthFields } from "./addForm/McpAddFormAuthFields";
|
|
6
|
+
export { McpAddFormPrimitiveBearerTokenField as BearerTokenField } from "./addForm/McpAddFormBearerTokenField";
|
|
7
|
+
export { McpAddFormPrimitiveScopesField as ScopesField } from "./addForm/McpAddFormScopesField";
|
|
6
8
|
export { McpAddFormPrimitiveSubmit as Submit } from "./addForm/McpAddFormSubmit";
|
|
7
9
|
export { McpAddFormPrimitiveCancel as Cancel } from "./addForm/McpAddFormCancel";
|
|
8
10
|
export { McpAddFormPrimitiveError as Error } from "./addForm/McpAddFormError";
|
|
@@ -72,12 +72,14 @@ export const prepareElicitationContent = (
|
|
|
72
72
|
const contentWithBooleanDefaults = {
|
|
73
73
|
...candidateContent,
|
|
74
74
|
...Object.fromEntries(
|
|
75
|
-
missingRequiredBooleans.map(({ property }) =>
|
|
76
|
-
property
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
75
|
+
missingRequiredBooleans.map(({ property }) => {
|
|
76
|
+
const schema = properties[property];
|
|
77
|
+
const defaultValue = isRecord(schema) ? schema.default : undefined;
|
|
78
|
+
return [
|
|
79
|
+
property,
|
|
80
|
+
typeof defaultValue === "boolean" ? defaultValue : false,
|
|
81
|
+
];
|
|
82
|
+
}),
|
|
81
83
|
),
|
|
82
84
|
};
|
|
83
85
|
const validationErrors = validateElicitationContent(
|