@assistant-ui/react-mcp 0.0.10 → 0.0.12
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.js.map +1 -1
- package/dist/auth/createOAuthProvider.js.map +1 -1
- package/dist/connector.js.map +1 -1
- package/dist/context/McpConnectorByIndexProvider.js +29 -6
- package/dist/context/McpConnectorByIndexProvider.js.map +1 -1
- package/dist/context/McpCustomServerByIndexProvider.js +29 -6
- package/dist/context/McpCustomServerByIndexProvider.js.map +1 -1
- package/dist/context/McpServerByIdProvider.js +29 -6
- package/dist/context/McpServerByIdProvider.js.map +1 -1
- package/dist/hooks/useMcpOAuthCallback.js +30 -2
- package/dist/hooks/useMcpOAuthCallback.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormAuthFields.js +59 -16
- package/dist/primitives/addForm/McpAddFormAuthFields.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormAuthSelect.js +33 -9
- package/dist/primitives/addForm/McpAddFormAuthSelect.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormCancel.js +24 -7
- package/dist/primitives/addForm/McpAddFormCancel.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormError.js +16 -5
- package/dist/primitives/addForm/McpAddFormError.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormNameField.js +25 -8
- package/dist/primitives/addForm/McpAddFormNameField.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormRoot.js +10 -10
- package/dist/primitives/addForm/McpAddFormRoot.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormSubmit.js +20 -7
- package/dist/primitives/addForm/McpAddFormSubmit.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormUrlField.js +26 -9
- package/dist/primitives/addForm/McpAddFormUrlField.js.map +1 -1
- package/dist/primitives/addForm/context.js.map +1 -1
- package/dist/primitives/addForm.js.map +1 -1
- package/dist/primitives/manager/McpManagerAddCustomTrigger.js +14 -5
- package/dist/primitives/manager/McpManagerAddCustomTrigger.js.map +1 -1
- package/dist/primitives/manager/McpManagerConnectors.js.map +1 -1
- package/dist/primitives/manager/McpManagerCustomServers.js.map +1 -1
- package/dist/primitives/manager/McpManagerRoot.js +19 -6
- package/dist/primitives/manager/McpManagerRoot.js.map +1 -1
- package/dist/primitives/manager.js.map +1 -1
- package/dist/primitives/server/McpServerConnectButton.js +31 -9
- package/dist/primitives/server/McpServerConnectButton.js.map +1 -1
- package/dist/primitives/server/McpServerDisconnectButton.js +28 -8
- package/dist/primitives/server/McpServerDisconnectButton.js.map +1 -1
- package/dist/primitives/server/McpServerError.js +20 -6
- package/dist/primitives/server/McpServerError.js.map +1 -1
- package/dist/primitives/server/McpServerIcon.js +41 -9
- package/dist/primitives/server/McpServerIcon.js.map +1 -1
- package/dist/primitives/server/McpServerName.js +20 -6
- package/dist/primitives/server/McpServerName.js.map +1 -1
- package/dist/primitives/server/McpServerOAuthLink.js +35 -9
- package/dist/primitives/server/McpServerOAuthLink.js.map +1 -1
- package/dist/primitives/server/McpServerRemoveButton.js +28 -8
- package/dist/primitives/server/McpServerRemoveButton.js.map +1 -1
- package/dist/primitives/server/McpServerRoot.js +37 -12
- package/dist/primitives/server/McpServerRoot.js.map +1 -1
- package/dist/primitives/server/McpServerStatus.js +22 -7
- package/dist/primitives/server/McpServerStatus.js.map +1 -1
- package/dist/primitives/server/McpServerToolName.js +18 -6
- package/dist/primitives/server/McpServerToolName.js.map +1 -1
- package/dist/primitives/server/McpServerTools.js +31 -6
- package/dist/primitives/server/McpServerTools.js.map +1 -1
- package/dist/primitives/server.js.map +1 -1
- package/dist/resources/McpManagerResource.d.ts.map +1 -1
- package/dist/resources/McpManagerResource.js +286 -99
- package/dist/resources/McpManagerResource.js.map +1 -1
- package/dist/resources/McpServerResource.js +31 -31
- package/dist/resources/McpServerResource.js.map +1 -1
- package/dist/resources/storage/McpCustomStorage.js.map +1 -1
- package/dist/resources/storage/McpLocalStorage.js.map +1 -1
- package/dist/resources/storage/McpMemoryStorage.js.map +1 -1
- package/dist/utils/serverId.js.map +1 -1
- package/package.json +6 -6
- package/src/resources/McpManagerResource.ts +21 -13
|
@@ -1,18 +1,32 @@
|
|
|
1
1
|
import { useAuiState } from "@assistant-ui/store";
|
|
2
|
+
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
2
3
|
import { forwardRef } from "@assistant-ui/tap/react-shim";
|
|
3
4
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
4
5
|
import { jsx } from "react/jsx-runtime";
|
|
5
6
|
//#region src/primitives/server/McpServerError.tsx
|
|
6
7
|
const McpServerPrimitiveError = forwardRef((props, ref) => {
|
|
7
|
-
const
|
|
8
|
+
const $ = c(4);
|
|
9
|
+
const message = useAuiState(_temp);
|
|
8
10
|
if (message === null) return null;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
const t0 = props.children ?? message;
|
|
12
|
+
let t1;
|
|
13
|
+
if ($[0] !== props || $[1] !== ref || $[2] !== t0) {
|
|
14
|
+
t1 = /* @__PURE__ */ jsx(Primitive.div, {
|
|
15
|
+
...props,
|
|
16
|
+
ref,
|
|
17
|
+
children: t0
|
|
18
|
+
});
|
|
19
|
+
$[0] = props;
|
|
20
|
+
$[1] = ref;
|
|
21
|
+
$[2] = t0;
|
|
22
|
+
$[3] = t1;
|
|
23
|
+
} else t1 = $[3];
|
|
24
|
+
return t1;
|
|
14
25
|
});
|
|
15
26
|
McpServerPrimitiveError.displayName = "McpServerPrimitive.Error";
|
|
27
|
+
function _temp(s) {
|
|
28
|
+
return s.mcpServer.lastError?.message ?? null;
|
|
29
|
+
}
|
|
16
30
|
//#endregion
|
|
17
31
|
export { McpServerPrimitiveError };
|
|
18
32
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpServerError.js","names":[],"sources":["../../../src/primitives/server/McpServerError.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport namespace McpServerPrimitiveError {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div>;\n}\n\nexport const McpServerPrimitiveError = forwardRef<\n McpServerPrimitiveError.Element,\n McpServerPrimitiveError.Props\n>((props, ref) => {\n const message = useAuiState((s) => s.mcpServer.lastError?.message ?? null);\n if (message === null) return null;\n return (\n <Primitive.div {...props} ref={ref}>\n {props.children ?? message}\n </Primitive.div>\n );\n});\n\nMcpServerPrimitiveError.displayName = \"McpServerPrimitive.Error\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"McpServerError.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAuiState","McpServerPrimitiveError","Element","div","Props","props","ref","$","_c","message","_temp","t0","children","t1","displayName","s","mcpServer","lastError"],"sources":["../../../src/primitives/server/McpServerError.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport namespace McpServerPrimitiveError {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div>;\n}\n\nexport const McpServerPrimitiveError = forwardRef<\n McpServerPrimitiveError.Element,\n McpServerPrimitiveError.Props\n>((props, ref) => {\n const message = useAuiState((s) => s.mcpServer.lastError?.message ?? null);\n if (message === null) return null;\n return (\n <Primitive.div {...props} ref={ref}>\n {props.children ?? message}\n </Primitive.div>\n );\n});\n\nMcpServerPrimitiveError.displayName = \"McpServerPrimitive.Error\";\n"],"mappings":";;;;;;AAaA,MAAaK,0BAA0BH,YAGrCO,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAAC,UAAgBT,YAAYU,KAA6C;CACzE,IAAID,YAAY,MAAI,OAAS;CAGxB,MAAAE,KAAAN,MAAKO,YAALH;CAAyB,IAAAI;CAAA,IAAAN,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAI,IAAA;EAD5BE,KAAA,oBAAA,UAAA,KAAA;GAAA,GAAmBR;GAAYC;aAC5BK;EACH,CAAA;EAAgBJ,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAI;EAAAJ,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OAFhBM;AAEgB,CAEnB;AAEDZ,wBAAwBa,cAAc;AAVpC,SAAAJ,MAAAK,GAAA;CAAA,OACmCA,EAACC,UAAUC,WAAmBR,WAA9B;AAAsC"}
|
|
@@ -1,21 +1,53 @@
|
|
|
1
1
|
import { useAuiState } from "@assistant-ui/store";
|
|
2
|
+
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
2
3
|
import { forwardRef } from "@assistant-ui/tap/react-shim";
|
|
3
4
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
4
5
|
import { jsx } from "react/jsx-runtime";
|
|
5
6
|
//#region src/primitives/server/McpServerIcon.tsx
|
|
6
|
-
const McpServerPrimitiveIcon = forwardRef((
|
|
7
|
-
const
|
|
8
|
-
|
|
7
|
+
const McpServerPrimitiveIcon = forwardRef((t0, ref) => {
|
|
8
|
+
const $ = c(9);
|
|
9
|
+
let alt;
|
|
10
|
+
let props;
|
|
11
|
+
let src;
|
|
12
|
+
if ($[0] !== t0) {
|
|
13
|
+
({src, alt, ...props} = t0);
|
|
14
|
+
$[0] = t0;
|
|
15
|
+
$[1] = alt;
|
|
16
|
+
$[2] = props;
|
|
17
|
+
$[3] = src;
|
|
18
|
+
} else {
|
|
19
|
+
alt = $[1];
|
|
20
|
+
props = $[2];
|
|
21
|
+
src = $[3];
|
|
22
|
+
}
|
|
23
|
+
const iconUrl = useAuiState(_temp);
|
|
24
|
+
const name = useAuiState(_temp2);
|
|
9
25
|
const effective = src ?? iconUrl;
|
|
10
26
|
if (!effective) return null;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
27
|
+
const t1 = alt ?? name;
|
|
28
|
+
let t2;
|
|
29
|
+
if ($[4] !== effective || $[5] !== props || $[6] !== ref || $[7] !== t1) {
|
|
30
|
+
t2 = /* @__PURE__ */ jsx(Primitive.img, {
|
|
31
|
+
...props,
|
|
32
|
+
ref,
|
|
33
|
+
src: effective,
|
|
34
|
+
alt: t1
|
|
35
|
+
});
|
|
36
|
+
$[4] = effective;
|
|
37
|
+
$[5] = props;
|
|
38
|
+
$[6] = ref;
|
|
39
|
+
$[7] = t1;
|
|
40
|
+
$[8] = t2;
|
|
41
|
+
} else t2 = $[8];
|
|
42
|
+
return t2;
|
|
17
43
|
});
|
|
18
44
|
McpServerPrimitiveIcon.displayName = "McpServerPrimitive.Icon";
|
|
45
|
+
function _temp(s) {
|
|
46
|
+
return s.mcpServer.icon ?? null;
|
|
47
|
+
}
|
|
48
|
+
function _temp2(s_0) {
|
|
49
|
+
return s_0.mcpServer.name;
|
|
50
|
+
}
|
|
19
51
|
//#endregion
|
|
20
52
|
export { McpServerPrimitiveIcon };
|
|
21
53
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpServerIcon.js","names":[],"sources":["../../../src/primitives/server/McpServerIcon.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport namespace McpServerPrimitiveIcon {\n export type Element = ComponentRef<typeof Primitive.img>;\n export type Props = Omit<\n ComponentPropsWithoutRef<typeof Primitive.img>,\n \"src\" | \"alt\"\n > & {\n /** Override the icon URL. Defaults to the server's icon prop. */\n src?: string;\n alt?: string;\n };\n}\n\nexport const McpServerPrimitiveIcon = forwardRef<\n McpServerPrimitiveIcon.Element,\n McpServerPrimitiveIcon.Props\n>(({ src, alt, ...props }, ref) => {\n const iconUrl = useAuiState((s) => s.mcpServer.icon ?? null);\n const name = useAuiState((s) => s.mcpServer.name);\n const effective = src ?? iconUrl;\n if (!effective) return null;\n return (\n <Primitive.img {...props} ref={ref} src={effective} alt={alt ?? name} />\n );\n});\n\nMcpServerPrimitiveIcon.displayName = \"McpServerPrimitive.Icon\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"McpServerIcon.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAuiState","McpServerPrimitiveIcon","Element","img","Props","Omit","src","alt","t0","ref","$","_c","props","iconUrl","_temp","name","_temp2","effective","t1","t2","displayName","s","mcpServer","icon","s_0"],"sources":["../../../src/primitives/server/McpServerIcon.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport namespace McpServerPrimitiveIcon {\n export type Element = ComponentRef<typeof Primitive.img>;\n export type Props = Omit<\n ComponentPropsWithoutRef<typeof Primitive.img>,\n \"src\" | \"alt\"\n > & {\n /** Override the icon URL. Defaults to the server's icon prop. */\n src?: string;\n alt?: string;\n };\n}\n\nexport const McpServerPrimitiveIcon = forwardRef<\n McpServerPrimitiveIcon.Element,\n McpServerPrimitiveIcon.Props\n>(({ src, alt, ...props }, ref) => {\n const iconUrl = useAuiState((s) => s.mcpServer.icon ?? null);\n const name = useAuiState((s) => s.mcpServer.name);\n const effective = src ?? iconUrl;\n if (!effective) return null;\n return (\n <Primitive.img {...props} ref={ref} src={effective} alt={alt ?? name} />\n );\n});\n\nMcpServerPrimitiveIcon.displayName = \"McpServerPrimitive.Icon\";\n"],"mappings":";;;;;;AAoBA,MAAaK,yBAAyBH,YAGpCU,IAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAJ;CAAA,IAAAK;CAAA,IAAAN;CAAA,IAAAI,EAAA,OAAAF,IAAA;EAAC,CAAA,CAAAF,KAAAC,QAAAK,SAAAJ;EAAsBE,EAAA,KAAAF;EAAAE,EAAA,KAAAH;EAAAG,EAAA,KAAAE;EAAAF,EAAA,KAAAJ;CAAA,OAAA;EAAAC,MAAAG,EAAA;EAAAE,QAAAF,EAAA;EAAAJ,MAAAI,EAAA;CAAA;CACvB,MAAAG,UAAgBb,YAAYc,KAA+B;CAC3D,MAAAC,OAAaf,YAAYgB,MAAuB;CAChD,MAAAC,YAAkBX,OAAAO;CAClB,IAAI,CAACI,WAAS,OAAS;CAEoC,MAAAC,KAAAX,OAAAQ;CAAW,IAAAI;CAAA,IAAAT,EAAA,OAAAO,aAAAP,EAAA,OAAAE,SAAAF,EAAA,OAAAD,OAAAC,EAAA,OAAAQ,IAAA;EAApEC,KAAA,oBAAA,UAAA,KAAA;GAAA,GAAmBP;GAAYH;GAAUQ,KAAAA;GAAgB,KAAAC;EAAW,CAAA;EAAIR,EAAA,KAAAO;EAAAP,EAAA,KAAAE;EAAAF,EAAA,KAAAD;EAAAC,EAAA,KAAAQ;EAAAR,EAAA,KAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAA,OAAxES;AAAwE,CAE3E;AAEDlB,uBAAuBmB,cAAc;AAVnC,SAAAN,MAAAO,GAAA;CAAA,OACmCA,EAACC,UAAUC,QAAX;AAAwB;AAD3D,SAAAP,OAAAQ,KAAA;CAAA,OAEgCH,IAACC,UAAUP;AAAK"}
|
|
@@ -1,17 +1,31 @@
|
|
|
1
1
|
import { useAuiState } from "@assistant-ui/store";
|
|
2
|
+
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
2
3
|
import { forwardRef } from "@assistant-ui/tap/react-shim";
|
|
3
4
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
4
5
|
import { jsx } from "react/jsx-runtime";
|
|
5
6
|
//#region src/primitives/server/McpServerName.tsx
|
|
6
7
|
const McpServerPrimitiveName = forwardRef((props, ref) => {
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
const $ = c(4);
|
|
9
|
+
const name = useAuiState(_temp);
|
|
10
|
+
const t0 = props.children ?? name;
|
|
11
|
+
let t1;
|
|
12
|
+
if ($[0] !== props || $[1] !== ref || $[2] !== t0) {
|
|
13
|
+
t1 = /* @__PURE__ */ jsx(Primitive.span, {
|
|
14
|
+
...props,
|
|
15
|
+
ref,
|
|
16
|
+
children: t0
|
|
17
|
+
});
|
|
18
|
+
$[0] = props;
|
|
19
|
+
$[1] = ref;
|
|
20
|
+
$[2] = t0;
|
|
21
|
+
$[3] = t1;
|
|
22
|
+
} else t1 = $[3];
|
|
23
|
+
return t1;
|
|
13
24
|
});
|
|
14
25
|
McpServerPrimitiveName.displayName = "McpServerPrimitive.Name";
|
|
26
|
+
function _temp(s) {
|
|
27
|
+
return s.mcpServer.name;
|
|
28
|
+
}
|
|
15
29
|
//#endregion
|
|
16
30
|
export { McpServerPrimitiveName };
|
|
17
31
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpServerName.js","names":[],"sources":["../../../src/primitives/server/McpServerName.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport namespace McpServerPrimitiveName {\n export type Element = ComponentRef<typeof Primitive.span>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.span>;\n}\n\nexport const McpServerPrimitiveName = forwardRef<\n McpServerPrimitiveName.Element,\n McpServerPrimitiveName.Props\n>((props, ref) => {\n const name = useAuiState((s) => s.mcpServer.name);\n return (\n <Primitive.span {...props} ref={ref}>\n {props.children ?? name}\n </Primitive.span>\n );\n});\n\nMcpServerPrimitiveName.displayName = \"McpServerPrimitive.Name\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"McpServerName.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAuiState","McpServerPrimitiveName","Element","span","Props","props","ref","$","_c","name","_temp","t0","children","t1","displayName","s","mcpServer"],"sources":["../../../src/primitives/server/McpServerName.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport namespace McpServerPrimitiveName {\n export type Element = ComponentRef<typeof Primitive.span>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.span>;\n}\n\nexport const McpServerPrimitiveName = forwardRef<\n McpServerPrimitiveName.Element,\n McpServerPrimitiveName.Props\n>((props, ref) => {\n const name = useAuiState((s) => s.mcpServer.name);\n return (\n <Primitive.span {...props} ref={ref}>\n {props.children ?? name}\n </Primitive.span>\n );\n});\n\nMcpServerPrimitiveName.displayName = \"McpServerPrimitive.Name\";\n"],"mappings":";;;;;;AAaA,MAAaK,yBAAyBH,YAGpCO,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAAC,OAAaT,YAAYU,KAAuB;CAG3C,MAAAC,KAAAN,MAAKO,YAALH;CAAsB,IAAAI;CAAA,IAAAN,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAI,IAAA;EADzBE,KAAA,oBAAA,UAAA,MAAA;GAAA,GAAoBR;GAAYC;aAC7BK;EACH,CAAA;EAAiBJ,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAI;EAAAJ,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OAFjBM;AAEiB,CAEpB;AAEDZ,uBAAuBa,cAAc;AATnC,SAAAJ,MAAAK,GAAA;CAAA,OACgCA,EAACC,UAAUP;AAAK"}
|
|
@@ -1,21 +1,47 @@
|
|
|
1
1
|
import { useAuiState } from "@assistant-ui/store";
|
|
2
|
+
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
2
3
|
import { forwardRef } from "@assistant-ui/tap/react-shim";
|
|
3
4
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
4
5
|
import { jsx } from "react/jsx-runtime";
|
|
5
6
|
//#region src/primitives/server/McpServerOAuthLink.tsx
|
|
6
|
-
const McpServerPrimitiveOAuthLink = forwardRef((
|
|
7
|
-
const
|
|
7
|
+
const McpServerPrimitiveOAuthLink = forwardRef((t0, ref) => {
|
|
8
|
+
const $ = c(8);
|
|
9
|
+
let href;
|
|
10
|
+
let props;
|
|
11
|
+
if ($[0] !== t0) {
|
|
12
|
+
({href, ...props} = t0);
|
|
13
|
+
$[0] = t0;
|
|
14
|
+
$[1] = href;
|
|
15
|
+
$[2] = props;
|
|
16
|
+
} else {
|
|
17
|
+
href = $[1];
|
|
18
|
+
props = $[2];
|
|
19
|
+
}
|
|
20
|
+
const url = useAuiState(_temp);
|
|
8
21
|
const effective = href ?? url;
|
|
9
22
|
if (!effective) return null;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
23
|
+
const t1 = props.rel ?? "noopener noreferrer";
|
|
24
|
+
let t2;
|
|
25
|
+
if ($[3] !== effective || $[4] !== props || $[5] !== ref || $[6] !== t1) {
|
|
26
|
+
t2 = /* @__PURE__ */ jsx(Primitive.a, {
|
|
27
|
+
target: "_blank",
|
|
28
|
+
...props,
|
|
29
|
+
ref,
|
|
30
|
+
href: effective,
|
|
31
|
+
rel: t1
|
|
32
|
+
});
|
|
33
|
+
$[3] = effective;
|
|
34
|
+
$[4] = props;
|
|
35
|
+
$[5] = ref;
|
|
36
|
+
$[6] = t1;
|
|
37
|
+
$[7] = t2;
|
|
38
|
+
} else t2 = $[7];
|
|
39
|
+
return t2;
|
|
17
40
|
});
|
|
18
41
|
McpServerPrimitiveOAuthLink.displayName = "McpServerPrimitive.OAuthLink";
|
|
42
|
+
function _temp(s) {
|
|
43
|
+
return s.mcpServer.authorizationUrl;
|
|
44
|
+
}
|
|
19
45
|
//#endregion
|
|
20
46
|
export { McpServerPrimitiveOAuthLink };
|
|
21
47
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpServerOAuthLink.js","names":[],"sources":["../../../src/primitives/server/McpServerOAuthLink.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport namespace McpServerPrimitiveOAuthLink {\n export type Element = ComponentRef<typeof Primitive.a>;\n export type Props = Omit<\n ComponentPropsWithoutRef<typeof Primitive.a>,\n \"href\"\n > & {\n /** Optional href override; defaults to the server's authorizationUrl. */\n href?: string;\n };\n}\n\nexport const McpServerPrimitiveOAuthLink = forwardRef<\n McpServerPrimitiveOAuthLink.Element,\n McpServerPrimitiveOAuthLink.Props\n>(({ href, ...props }, ref) => {\n const url = useAuiState((s) => s.mcpServer.authorizationUrl);\n const effective = href ?? url;\n if (!effective) return null;\n return (\n <Primitive.a\n target=\"_blank\"\n {...props}\n ref={ref}\n href={effective}\n rel={props.rel ?? \"noopener noreferrer\"}\n />\n );\n});\n\nMcpServerPrimitiveOAuthLink.displayName = \"McpServerPrimitive.OAuthLink\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"McpServerOAuthLink.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAuiState","McpServerPrimitiveOAuthLink","Element","a","Props","Omit","href","t0","ref","$","_c","props","url","_temp","effective","t1","rel","t2","displayName","s","mcpServer","authorizationUrl"],"sources":["../../../src/primitives/server/McpServerOAuthLink.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport namespace McpServerPrimitiveOAuthLink {\n export type Element = ComponentRef<typeof Primitive.a>;\n export type Props = Omit<\n ComponentPropsWithoutRef<typeof Primitive.a>,\n \"href\"\n > & {\n /** Optional href override; defaults to the server's authorizationUrl. */\n href?: string;\n };\n}\n\nexport const McpServerPrimitiveOAuthLink = forwardRef<\n McpServerPrimitiveOAuthLink.Element,\n McpServerPrimitiveOAuthLink.Props\n>(({ href, ...props }, ref) => {\n const url = useAuiState((s) => s.mcpServer.authorizationUrl);\n const effective = href ?? url;\n if (!effective) return null;\n return (\n <Primitive.a\n target=\"_blank\"\n {...props}\n ref={ref}\n href={effective}\n rel={props.rel ?? \"noopener noreferrer\"}\n />\n );\n});\n\nMcpServerPrimitiveOAuthLink.displayName = \"McpServerPrimitive.OAuthLink\";\n"],"mappings":";;;;;;AAmBA,MAAaK,8BAA8BH,YAGzCS,IAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAJ;CAAA,IAAAK;CAAA,IAAAF,EAAA,OAAAF,IAAA;EAAC,CAAA,CAAAD,SAAAK,SAAAJ;EAAkBE,EAAA,KAAAF;EAAAE,EAAA,KAAAH;EAAAG,EAAA,KAAAE;CAAA,OAAA;EAAAL,OAAAG,EAAA;EAAAE,QAAAF,EAAA;CAAA;CACnB,MAAAG,MAAYZ,YAAYa,KAAmC;CAC3D,MAAAC,YAAkBR,QAAAM;CAClB,IAAI,CAACE,WAAS,OAAS;CAOd,MAAAC,KAAAJ,MAAKK,OAAL;CAAkC,IAAAC;CAAA,IAAAR,EAAA,OAAAK,aAAAL,EAAA,OAAAE,SAAAF,EAAA,OAAAD,OAAAC,EAAA,OAAAM,IAAA;EALzCE,KAAA,oBAAA,UAAA,GAAA;GACS,QAAA;GAAQ,GACXN;GACCH;GACCM,MAAAA;GACD,KAAAC;EAAkC,CAAA;EACvCN,EAAA,KAAAK;EAAAL,EAAA,KAAAE;EAAAF,EAAA,KAAAD;EAAAC,EAAA,KAAAM;EAAAN,EAAA,KAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,OANFQ;AAME,CAEL;AAEDhB,4BAA4BiB,cAAc;AAfxC,SAAAL,MAAAM,GAAA;CAAA,OAC+BA,EAACC,UAAUC;AAAiB"}
|
|
@@ -1,24 +1,44 @@
|
|
|
1
1
|
import { useAui, useAuiState } from "@assistant-ui/store";
|
|
2
|
+
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
2
3
|
import { forwardRef } from "@assistant-ui/tap/react-shim";
|
|
3
4
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
4
5
|
import { jsx } from "react/jsx-runtime";
|
|
5
6
|
//#region src/primitives/server/McpServerRemoveButton.tsx
|
|
6
7
|
const McpServerPrimitiveRemoveButton = forwardRef((props, ref) => {
|
|
7
|
-
const
|
|
8
|
+
const $ = c(7);
|
|
9
|
+
const kind = useAuiState(_temp);
|
|
8
10
|
const aui = useAui();
|
|
9
11
|
if (kind !== "custom") return null;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
ref,
|
|
14
|
-
onClick: (e) => {
|
|
12
|
+
let t0;
|
|
13
|
+
if ($[0] !== aui || $[1] !== props) {
|
|
14
|
+
t0 = (e) => {
|
|
15
15
|
props.onClick?.(e);
|
|
16
16
|
if (e.defaultPrevented) return;
|
|
17
17
|
aui.mcpServer().remove();
|
|
18
|
-
}
|
|
19
|
-
|
|
18
|
+
};
|
|
19
|
+
$[0] = aui;
|
|
20
|
+
$[1] = props;
|
|
21
|
+
$[2] = t0;
|
|
22
|
+
} else t0 = $[2];
|
|
23
|
+
let t1;
|
|
24
|
+
if ($[3] !== props || $[4] !== ref || $[5] !== t0) {
|
|
25
|
+
t1 = /* @__PURE__ */ jsx(Primitive.button, {
|
|
26
|
+
...props,
|
|
27
|
+
type: "button",
|
|
28
|
+
ref,
|
|
29
|
+
onClick: t0
|
|
30
|
+
});
|
|
31
|
+
$[3] = props;
|
|
32
|
+
$[4] = ref;
|
|
33
|
+
$[5] = t0;
|
|
34
|
+
$[6] = t1;
|
|
35
|
+
} else t1 = $[6];
|
|
36
|
+
return t1;
|
|
20
37
|
});
|
|
21
38
|
McpServerPrimitiveRemoveButton.displayName = "McpServerPrimitive.RemoveButton";
|
|
39
|
+
function _temp(s) {
|
|
40
|
+
return s.mcpServer.kind;
|
|
41
|
+
}
|
|
22
42
|
//#endregion
|
|
23
43
|
export { McpServerPrimitiveRemoveButton };
|
|
24
44
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpServerRemoveButton.js","names":[],"sources":["../../../src/primitives/server/McpServerRemoveButton.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAui, useAuiState } from \"@assistant-ui/store\";\n\nexport namespace McpServerPrimitiveRemoveButton {\n export type Element = ComponentRef<typeof Primitive.button>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.button>;\n}\n\nexport const McpServerPrimitiveRemoveButton = forwardRef<\n McpServerPrimitiveRemoveButton.Element,\n McpServerPrimitiveRemoveButton.Props\n>((props, ref) => {\n const kind = useAuiState((s) => s.mcpServer.kind);\n const aui = useAui();\n if (kind !== \"custom\") return null;\n return (\n <Primitive.button\n {...props}\n type=\"button\"\n ref={ref}\n onClick={(e) => {\n props.onClick?.(e);\n if (e.defaultPrevented) return;\n void aui.mcpServer().remove();\n }}\n />\n );\n});\n\nMcpServerPrimitiveRemoveButton.displayName = \"McpServerPrimitive.RemoveButton\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"McpServerRemoveButton.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAui","useAuiState","McpServerPrimitiveRemoveButton","Element","button","Props","props","ref","$","_c","kind","_temp","aui","t0","e","onClick","defaultPrevented","mcpServer","remove","t1","displayName","s"],"sources":["../../../src/primitives/server/McpServerRemoveButton.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAui, useAuiState } from \"@assistant-ui/store\";\n\nexport namespace McpServerPrimitiveRemoveButton {\n export type Element = ComponentRef<typeof Primitive.button>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.button>;\n}\n\nexport const McpServerPrimitiveRemoveButton = forwardRef<\n McpServerPrimitiveRemoveButton.Element,\n McpServerPrimitiveRemoveButton.Props\n>((props, ref) => {\n const kind = useAuiState((s) => s.mcpServer.kind);\n const aui = useAui();\n if (kind !== \"custom\") return null;\n return (\n <Primitive.button\n {...props}\n type=\"button\"\n ref={ref}\n onClick={(e) => {\n props.onClick?.(e);\n if (e.defaultPrevented) return;\n void aui.mcpServer().remove();\n }}\n />\n );\n});\n\nMcpServerPrimitiveRemoveButton.displayName = \"McpServerPrimitive.RemoveButton\";\n"],"mappings":";;;;;;AAaA,MAAaM,iCAAiCJ,YAG5CQ,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAAC,OAAaT,YAAYU,KAAuB;CAChD,MAAAC,MAAYZ,OAAO;CACnB,IAAIU,SAAS,UAAQ,OAAS;CAAK,IAAAG;CAAA,IAAAL,EAAA,OAAAI,OAAAJ,EAAA,OAAAF,OAAA;EAMtBO,MAAAC,MAAA;GACPR,MAAKS,UAAWD,CAAC;GACjB,IAAIA,EAACE,kBAAiB;GACjBJ,IAAGK,UAAW,CAAC,CAAAC,OAAQ;EAAC;EAC9BV,EAAA,KAAAI;EAAAJ,EAAA,KAAAF;EAAAE,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,IAAAW;CAAA,IAAAX,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAK,IAAA;EARHM,KAAA,oBAAA,UAAA,QAAA;GAAA,GACMb;GACC,MAAA;GACAC;GACI,SAAAM;EAIR,CAAA;EACDL,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAK;EAAAL,EAAA,KAAAW;CAAA,OAAAA,KAAAX,EAAA;CAAA,OATFW;AASE,CAEL;AAEDjB,+BAA+BkB,cAAc;AAlB3C,SAAAT,MAAAU,GAAA;CAAA,OACgCA,EAACJ,UAAUP;AAAK"}
|
|
@@ -1,23 +1,48 @@
|
|
|
1
1
|
import { useAuiState } from "@assistant-ui/store";
|
|
2
|
+
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
2
3
|
import { forwardRef } from "@assistant-ui/tap/react-shim";
|
|
3
4
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
4
5
|
import { jsx } from "react/jsx-runtime";
|
|
5
6
|
//#region src/primitives/server/McpServerRoot.tsx
|
|
6
7
|
const McpServerPrimitiveRoot = forwardRef((props, ref) => {
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
8
|
+
const $ = c(7);
|
|
9
|
+
const id = useAuiState(_temp);
|
|
10
|
+
const kind = useAuiState(_temp2);
|
|
11
|
+
const connectionState = useAuiState(_temp3);
|
|
12
|
+
const t0 = useAuiState(_temp4) || void 0;
|
|
13
|
+
let t1;
|
|
14
|
+
if ($[0] !== connectionState || $[1] !== id || $[2] !== kind || $[3] !== props || $[4] !== ref || $[5] !== t0) {
|
|
15
|
+
t1 = /* @__PURE__ */ jsx(Primitive.div, {
|
|
16
|
+
...props,
|
|
17
|
+
ref,
|
|
18
|
+
"data-server-id": id,
|
|
19
|
+
"data-kind": kind,
|
|
20
|
+
"data-connection-state": connectionState,
|
|
21
|
+
"data-has-error": t0
|
|
22
|
+
});
|
|
23
|
+
$[0] = connectionState;
|
|
24
|
+
$[1] = id;
|
|
25
|
+
$[2] = kind;
|
|
26
|
+
$[3] = props;
|
|
27
|
+
$[4] = ref;
|
|
28
|
+
$[5] = t0;
|
|
29
|
+
$[6] = t1;
|
|
30
|
+
} else t1 = $[6];
|
|
31
|
+
return t1;
|
|
19
32
|
});
|
|
20
33
|
McpServerPrimitiveRoot.displayName = "McpServerPrimitive.Root";
|
|
34
|
+
function _temp(s) {
|
|
35
|
+
return s.mcpServer.id;
|
|
36
|
+
}
|
|
37
|
+
function _temp2(s_0) {
|
|
38
|
+
return s_0.mcpServer.kind;
|
|
39
|
+
}
|
|
40
|
+
function _temp3(s_1) {
|
|
41
|
+
return s_1.mcpServer.connectionState;
|
|
42
|
+
}
|
|
43
|
+
function _temp4(s_2) {
|
|
44
|
+
return s_2.mcpServer.lastError !== null;
|
|
45
|
+
}
|
|
21
46
|
//#endregion
|
|
22
47
|
export { McpServerPrimitiveRoot };
|
|
23
48
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpServerRoot.js","names":[],"sources":["../../../src/primitives/server/McpServerRoot.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport namespace McpServerPrimitiveRoot {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div>;\n}\n\nexport const McpServerPrimitiveRoot = forwardRef<\n McpServerPrimitiveRoot.Element,\n McpServerPrimitiveRoot.Props\n>((props, ref) => {\n const id = useAuiState((s) => s.mcpServer.id);\n const kind = useAuiState((s) => s.mcpServer.kind);\n const connectionState = useAuiState((s) => s.mcpServer.connectionState);\n const hasError = useAuiState((s) => s.mcpServer.lastError !== null);\n\n return (\n <Primitive.div\n {...props}\n ref={ref}\n data-server-id={id}\n data-kind={kind}\n data-connection-state={connectionState}\n data-has-error={hasError || undefined}\n />\n );\n});\n\nMcpServerPrimitiveRoot.displayName = \"McpServerPrimitive.Root\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"McpServerRoot.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAuiState","McpServerPrimitiveRoot","Element","div","Props","props","ref","$","_c","id","_temp","kind","_temp2","connectionState","_temp3","hasError","_temp4","t0","undefined","t1","displayName","s","mcpServer","s_0","s_1","s_2","lastError"],"sources":["../../../src/primitives/server/McpServerRoot.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport namespace McpServerPrimitiveRoot {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div>;\n}\n\nexport const McpServerPrimitiveRoot = forwardRef<\n McpServerPrimitiveRoot.Element,\n McpServerPrimitiveRoot.Props\n>((props, ref) => {\n const id = useAuiState((s) => s.mcpServer.id);\n const kind = useAuiState((s) => s.mcpServer.kind);\n const connectionState = useAuiState((s) => s.mcpServer.connectionState);\n const hasError = useAuiState((s) => s.mcpServer.lastError !== null);\n\n return (\n <Primitive.div\n {...props}\n ref={ref}\n data-server-id={id}\n data-kind={kind}\n data-connection-state={connectionState}\n data-has-error={hasError || undefined}\n />\n );\n});\n\nMcpServerPrimitiveRoot.displayName = \"McpServerPrimitive.Root\";\n"],"mappings":";;;;;;AAaA,MAAaK,yBAAyBH,YAGpCO,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAAC,KAAWT,YAAYU,KAAqB;CAC5C,MAAAC,OAAaX,YAAYY,MAAuB;CAChD,MAAAC,kBAAwBb,YAAYc,MAAkC;CAUlD,MAAAG,KATHjB,YAAYgB,MASTD,KAAAG,KAAAA;CAAqB,IAAAC;CAAA,IAAAZ,EAAA,OAAAM,mBAAAN,EAAA,OAAAE,MAAAF,EAAA,OAAAI,QAAAJ,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAU,IAAA;EANvCE,KAAA,oBAAA,UAAA,KAAA;GAAA,GACMd;GACCC;GACWG,kBAAAA;GACLE,aAAAA;GACYE,yBAAAA;GACP,kBAAAI;EAAqB,CAAA;EACrCV,EAAA,KAAAM;EAAAN,EAAA,KAAAE;EAAAF,EAAA,KAAAI;EAAAJ,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAU;EAAAV,EAAA,KAAAY;CAAA,OAAAA,KAAAZ,EAAA;CAAA,OAPFY;AAOE,CAEL;AAEDlB,uBAAuBmB,cAAc;AAlBnC,SAAAV,MAAAW,GAAA;CAAA,OAC8BA,EAACC,UAAUb;AAAG;AAD5C,SAAAG,OAAAW,KAAA;CAAA,OAEgCF,IAACC,UAAUX;AAAK;AAFhD,SAAAG,OAAAU,KAAA;CAAA,OAG2CH,IAACC,UAAUT;AAAgB;AAHtE,SAAAG,OAAAS,KAAA;CAAA,OAIoCJ,IAACC,UAAUI,cAAe;AAAI"}
|
|
@@ -1,18 +1,33 @@
|
|
|
1
1
|
import { useAuiState } from "@assistant-ui/store";
|
|
2
|
+
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
2
3
|
import { forwardRef } from "@assistant-ui/tap/react-shim";
|
|
3
4
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
4
5
|
import { jsx } from "react/jsx-runtime";
|
|
5
6
|
//#region src/primitives/server/McpServerStatus.tsx
|
|
6
7
|
const McpServerPrimitiveStatus = forwardRef((props, ref) => {
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
const $ = c(5);
|
|
9
|
+
const state = useAuiState(_temp);
|
|
10
|
+
const t0 = props.children ?? state;
|
|
11
|
+
let t1;
|
|
12
|
+
if ($[0] !== props || $[1] !== ref || $[2] !== state || $[3] !== t0) {
|
|
13
|
+
t1 = /* @__PURE__ */ jsx(Primitive.span, {
|
|
14
|
+
...props,
|
|
15
|
+
ref,
|
|
16
|
+
"data-state": state,
|
|
17
|
+
children: t0
|
|
18
|
+
});
|
|
19
|
+
$[0] = props;
|
|
20
|
+
$[1] = ref;
|
|
21
|
+
$[2] = state;
|
|
22
|
+
$[3] = t0;
|
|
23
|
+
$[4] = t1;
|
|
24
|
+
} else t1 = $[4];
|
|
25
|
+
return t1;
|
|
14
26
|
});
|
|
15
27
|
McpServerPrimitiveStatus.displayName = "McpServerPrimitive.Status";
|
|
28
|
+
function _temp(s) {
|
|
29
|
+
return s.mcpServer.connectionState;
|
|
30
|
+
}
|
|
16
31
|
//#endregion
|
|
17
32
|
export { McpServerPrimitiveStatus };
|
|
18
33
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpServerStatus.js","names":[],"sources":["../../../src/primitives/server/McpServerStatus.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport namespace McpServerPrimitiveStatus {\n export type Element = ComponentRef<typeof Primitive.span>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.span>;\n}\n\nexport const McpServerPrimitiveStatus = forwardRef<\n McpServerPrimitiveStatus.Element,\n McpServerPrimitiveStatus.Props\n>((props, ref) => {\n const state = useAuiState((s) => s.mcpServer.connectionState);\n return (\n <Primitive.span {...props} ref={ref} data-state={state}>\n {props.children ?? state}\n </Primitive.span>\n );\n});\n\nMcpServerPrimitiveStatus.displayName = \"McpServerPrimitive.Status\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"McpServerStatus.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAuiState","McpServerPrimitiveStatus","Element","span","Props","props","ref","$","_c","state","_temp","t0","children","t1","displayName","s","mcpServer","connectionState"],"sources":["../../../src/primitives/server/McpServerStatus.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport namespace McpServerPrimitiveStatus {\n export type Element = ComponentRef<typeof Primitive.span>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.span>;\n}\n\nexport const McpServerPrimitiveStatus = forwardRef<\n McpServerPrimitiveStatus.Element,\n McpServerPrimitiveStatus.Props\n>((props, ref) => {\n const state = useAuiState((s) => s.mcpServer.connectionState);\n return (\n <Primitive.span {...props} ref={ref} data-state={state}>\n {props.children ?? state}\n </Primitive.span>\n );\n});\n\nMcpServerPrimitiveStatus.displayName = \"McpServerPrimitive.Status\";\n"],"mappings":";;;;;;AAaA,MAAaK,2BAA2BH,YAGtCO,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAAC,QAAcT,YAAYU,KAAkC;CAGvD,MAAAC,KAAAN,MAAKO,YAALH;CAAuB,IAAAI;CAAA,IAAAN,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAE,SAAAF,EAAA,OAAAI,IAAA;EAD1BE,KAAA,oBAAA,UAAA,MAAA;GAAA,GAAoBR;GAAYC;GAAiBG,cAAAA;aAC9CE;EACH,CAAA;EAAiBJ,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAI;EAAAJ,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OAFjBM;AAEiB,CAEpB;AAEDZ,yBAAyBa,cAAc;AATrC,SAAAJ,MAAAK,GAAA;CAAA,OACiCA,EAACC,UAAUC;AAAgB"}
|
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
import { useMcpServerTool } from "./McpServerTools.js";
|
|
2
|
+
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
2
3
|
import { forwardRef } from "@assistant-ui/tap/react-shim";
|
|
3
4
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
4
5
|
import { jsx } from "react/jsx-runtime";
|
|
5
6
|
//#region src/primitives/server/McpServerToolName.tsx
|
|
6
7
|
const McpServerPrimitiveToolName = forwardRef((props, ref) => {
|
|
8
|
+
const $ = c(5);
|
|
7
9
|
const tool = useMcpServerTool();
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
const t0 = props.children ?? tool.name;
|
|
11
|
+
let t1;
|
|
12
|
+
if ($[0] !== props || $[1] !== ref || $[2] !== t0 || $[3] !== tool.name) {
|
|
13
|
+
t1 = /* @__PURE__ */ jsx(Primitive.span, {
|
|
14
|
+
...props,
|
|
15
|
+
ref,
|
|
16
|
+
"data-tool-name": tool.name,
|
|
17
|
+
children: t0
|
|
18
|
+
});
|
|
19
|
+
$[0] = props;
|
|
20
|
+
$[1] = ref;
|
|
21
|
+
$[2] = t0;
|
|
22
|
+
$[3] = tool.name;
|
|
23
|
+
$[4] = t1;
|
|
24
|
+
} else t1 = $[4];
|
|
25
|
+
return t1;
|
|
14
26
|
});
|
|
15
27
|
McpServerPrimitiveToolName.displayName = "McpServerPrimitive.ToolName";
|
|
16
28
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpServerToolName.js","names":[],"sources":["../../../src/primitives/server/McpServerToolName.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useMcpServerTool } from \"./McpServerTools\";\n\nexport namespace McpServerPrimitiveToolName {\n export type Element = ComponentRef<typeof Primitive.span>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.span>;\n}\n\nexport const McpServerPrimitiveToolName = forwardRef<\n McpServerPrimitiveToolName.Element,\n McpServerPrimitiveToolName.Props\n>((props, ref) => {\n const tool = useMcpServerTool();\n return (\n <Primitive.span {...props} ref={ref} data-tool-name={tool.name}>\n {props.children ?? tool.name}\n </Primitive.span>\n );\n});\n\nMcpServerPrimitiveToolName.displayName = \"McpServerPrimitive.ToolName\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"McpServerToolName.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useMcpServerTool","McpServerPrimitiveToolName","Element","span","Props","props","ref","$","_c","tool","t0","children","name","t1","displayName"],"sources":["../../../src/primitives/server/McpServerToolName.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useMcpServerTool } from \"./McpServerTools\";\n\nexport namespace McpServerPrimitiveToolName {\n export type Element = ComponentRef<typeof Primitive.span>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.span>;\n}\n\nexport const McpServerPrimitiveToolName = forwardRef<\n McpServerPrimitiveToolName.Element,\n McpServerPrimitiveToolName.Props\n>((props, ref) => {\n const tool = useMcpServerTool();\n return (\n <Primitive.span {...props} ref={ref} data-tool-name={tool.name}>\n {props.children ?? tool.name}\n </Primitive.span>\n );\n});\n\nMcpServerPrimitiveToolName.displayName = \"McpServerPrimitive.ToolName\";\n"],"mappings":";;;;;;AAaA,MAAaK,6BAA6BH,YAGxCO,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAAC,OAAaT,iBAAiB;CAGzB,MAAAU,KAAAL,MAAKM,YAAaF,KAAIG;CAAK,IAAAC;CAAA,IAAAN,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAG,MAAAH,EAAA,OAAAE,KAAAG,MAAA;EAD9BC,KAAA,oBAAA,UAAA,MAAA;GAAA,GAAoBR;GAAYC;GAAqB,kBAAAG,KAAIG;aACtDF;EACH,CAAA;EAAiBH,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAG;EAAAH,EAAA,KAAAE,KAAAG;EAAAL,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OAFjBM;AAEiB,CAEpB;AAEDZ,2BAA2Ba,cAAc"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useAuiState } from "@assistant-ui/store";
|
|
2
|
+
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
2
3
|
import { createContext, useContext } from "@assistant-ui/tap/react-shim";
|
|
3
4
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
4
5
|
//#region src/primitives/server/McpServerTools.tsx
|
|
@@ -8,15 +9,39 @@ const useMcpServerTool = () => {
|
|
|
8
9
|
if (!tool) throw new Error("useMcpServerTool must be used inside <McpServerPrimitive.Tools>");
|
|
9
10
|
return tool;
|
|
10
11
|
};
|
|
11
|
-
const McpServerPrimitiveTools = (
|
|
12
|
-
const
|
|
12
|
+
const McpServerPrimitiveTools = (t0) => {
|
|
13
|
+
const $ = c(7);
|
|
14
|
+
const { children } = t0;
|
|
15
|
+
const tools = useAuiState(_temp);
|
|
13
16
|
if (tools.length === 0) return null;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
let t1;
|
|
18
|
+
if ($[0] !== children || $[1] !== tools) {
|
|
19
|
+
let t2;
|
|
20
|
+
if ($[3] !== children) {
|
|
21
|
+
t2 = (tool) => /* @__PURE__ */ jsx(ToolContext.Provider, {
|
|
22
|
+
value: tool,
|
|
23
|
+
children: typeof children === "function" ? children(tool) : children
|
|
24
|
+
}, tool.name);
|
|
25
|
+
$[3] = children;
|
|
26
|
+
$[4] = t2;
|
|
27
|
+
} else t2 = $[4];
|
|
28
|
+
t1 = tools.map(t2);
|
|
29
|
+
$[0] = children;
|
|
30
|
+
$[1] = tools;
|
|
31
|
+
$[2] = t1;
|
|
32
|
+
} else t1 = $[2];
|
|
33
|
+
let t2;
|
|
34
|
+
if ($[5] !== t1) {
|
|
35
|
+
t2 = /* @__PURE__ */ jsx(Fragment, { children: t1 });
|
|
36
|
+
$[5] = t1;
|
|
37
|
+
$[6] = t2;
|
|
38
|
+
} else t2 = $[6];
|
|
39
|
+
return t2;
|
|
18
40
|
};
|
|
19
41
|
McpServerPrimitiveTools.displayName = "McpServerPrimitive.Tools";
|
|
42
|
+
function _temp(s) {
|
|
43
|
+
return s.mcpServer.tools;
|
|
44
|
+
}
|
|
20
45
|
//#endregion
|
|
21
46
|
export { McpServerPrimitiveTools, useMcpServerTool };
|
|
22
47
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpServerTools.js","names":[],"sources":["../../../src/primitives/server/McpServerTools.tsx"],"sourcesContent":["import { type FC, type ReactNode, createContext, useContext } from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\nimport type { MCPToolInfo } from \"../../mcp-scope\";\n\nconst ToolContext = createContext<MCPToolInfo | null>(null);\n\nexport const useMcpServerTool = (): MCPToolInfo => {\n const tool = useContext(ToolContext);\n if (!tool) {\n throw new Error(\n \"useMcpServerTool must be used inside <McpServerPrimitive.Tools>\",\n );\n }\n return tool;\n};\n\nexport namespace McpServerPrimitiveTools {\n export type Props = {\n children: ReactNode | ((tool: MCPToolInfo) => ReactNode);\n };\n}\n\nexport const McpServerPrimitiveTools: FC<McpServerPrimitiveTools.Props> = ({\n children,\n}) => {\n const tools = useAuiState((s) => s.mcpServer.tools);\n if (tools.length === 0) return null;\n return (\n <>\n {tools.map((tool) => (\n <ToolContext.Provider key={tool.name} value={tool}>\n {typeof children === \"function\" ? children(tool) : children}\n </ToolContext.Provider>\n ))}\n </>\n );\n};\n\nMcpServerPrimitiveTools.displayName = \"McpServerPrimitive.Tools\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"McpServerTools.js","names":["FC","ReactNode","createContext","useContext","useAuiState","MCPToolInfo","ToolContext","useMcpServerTool","tool","Error","McpServerPrimitiveTools","Props","children","t0","$","_c","tools","_temp","length","t1","t2","name","map","displayName","s","mcpServer"],"sources":["../../../src/primitives/server/McpServerTools.tsx"],"sourcesContent":["import { type FC, type ReactNode, createContext, useContext } from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\nimport type { MCPToolInfo } from \"../../mcp-scope\";\n\nconst ToolContext = createContext<MCPToolInfo | null>(null);\n\nexport const useMcpServerTool = (): MCPToolInfo => {\n const tool = useContext(ToolContext);\n if (!tool) {\n throw new Error(\n \"useMcpServerTool must be used inside <McpServerPrimitive.Tools>\",\n );\n }\n return tool;\n};\n\nexport namespace McpServerPrimitiveTools {\n export type Props = {\n children: ReactNode | ((tool: MCPToolInfo) => ReactNode);\n };\n}\n\nexport const McpServerPrimitiveTools: FC<McpServerPrimitiveTools.Props> = ({\n children,\n}) => {\n const tools = useAuiState((s) => s.mcpServer.tools);\n if (tools.length === 0) return null;\n return (\n <>\n {tools.map((tool) => (\n <ToolContext.Provider key={tool.name} value={tool}>\n {typeof children === \"function\" ? children(tool) : children}\n </ToolContext.Provider>\n ))}\n </>\n );\n};\n\nMcpServerPrimitiveTools.displayName = \"McpServerPrimitive.Tools\";\n"],"mappings":";;;;;AAIA,MAAMM,cAAcJ,cAAkC,IAAI;AAE1D,MAAaK,yBAAmB;CAC9B,MAAAC,OAAaL,WAAWG,WAAW;CACnC,IAAI,CAACE,MACH,MAAM,IAAIC,MACR,iEACF;CACD,OACMD;AAAI;AASb,MAAaE,2BAA6DG,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAC,MAAA,EAAAH,aAAAC;CAGzE,MAAAG,QAAcZ,YAAYa,KAAwB;CAClD,IAAID,MAAKE,WAAY,GAAC,OAAS;CAAK,IAAAC;CAAA,IAAAL,EAAA,OAAAF,YAAAE,EAAA,OAAAE,OAAA;EAAA,IAAAI;EAAA,IAAAN,EAAA,OAAAF,UAAA;GAGrBQ,MAAAZ,SACT,oBAAA,YAAA,UAAA;IAA6CA,OAAAA;cAC1C,OAAOI,aAAa,aAAaA,SAASJ,IAAe,IAAzDI;GACH,GAF2BJ,KAAIa,IAE/B;GACDP,EAAA,KAAAF;GAAAE,EAAA,KAAAM;EAAA,OAAAA,KAAAN,EAAA;EAJAK,KAAAH,MAAKM,IAAKF,EAIV;EAACN,EAAA,KAAAF;EAAAE,EAAA,KAAAE;EAAAF,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,IAAAM;CAAA,IAAAN,EAAA,OAAAK,IAAA;EALJC,KAAA,oBAAA,UAAA,EAAA,UACGD,GAIC,CAAA;EACDL,EAAA,KAAAK;EAAAL,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OANHM;AAMG;AAIPV,wBAAwBa,cAAc;AAhBoC,SAAAN,MAAAO,GAAA;CAAA,OAGvCA,EAACC,UAAUT;AAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","names":[],"sources":["../../src/primitives/server.ts"],"sourcesContent":["export { McpServerPrimitiveRoot as Root } from \"./server/McpServerRoot\";\nexport { McpServerPrimitiveName as Name } from \"./server/McpServerName\";\nexport { McpServerPrimitiveStatus as Status } from \"./server/McpServerStatus\";\nexport { McpServerPrimitiveError as Error } from \"./server/McpServerError\";\nexport { McpServerPrimitiveIcon as Icon } from \"./server/McpServerIcon\";\nexport { McpServerPrimitiveConnectButton as ConnectButton } from \"./server/McpServerConnectButton\";\nexport { McpServerPrimitiveDisconnectButton as DisconnectButton } from \"./server/McpServerDisconnectButton\";\nexport { McpServerPrimitiveRemoveButton as RemoveButton } from \"./server/McpServerRemoveButton\";\nexport { McpServerPrimitiveOAuthLink as OAuthLink } from \"./server/McpServerOAuthLink\";\nexport {\n McpServerPrimitiveTools as Tools,\n useMcpServerTool,\n} from \"./server/McpServerTools\";\nexport { McpServerPrimitiveToolName as ToolName } from \"./server/McpServerToolName\";\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"server.js","names":["McpServerPrimitiveRoot","Root","McpServerPrimitiveName","Name","McpServerPrimitiveStatus","Status","McpServerPrimitiveError","Error","McpServerPrimitiveIcon","Icon","McpServerPrimitiveConnectButton","ConnectButton","McpServerPrimitiveDisconnectButton","DisconnectButton","McpServerPrimitiveRemoveButton","RemoveButton","McpServerPrimitiveOAuthLink","OAuthLink","McpServerPrimitiveTools","Tools","useMcpServerTool","McpServerPrimitiveToolName","ToolName"],"sources":["../../src/primitives/server.ts"],"sourcesContent":["export { McpServerPrimitiveRoot as Root } from \"./server/McpServerRoot\";\nexport { McpServerPrimitiveName as Name } from \"./server/McpServerName\";\nexport { McpServerPrimitiveStatus as Status } from \"./server/McpServerStatus\";\nexport { McpServerPrimitiveError as Error } from \"./server/McpServerError\";\nexport { McpServerPrimitiveIcon as Icon } from \"./server/McpServerIcon\";\nexport { McpServerPrimitiveConnectButton as ConnectButton } from \"./server/McpServerConnectButton\";\nexport { McpServerPrimitiveDisconnectButton as DisconnectButton } from \"./server/McpServerDisconnectButton\";\nexport { McpServerPrimitiveRemoveButton as RemoveButton } from \"./server/McpServerRemoveButton\";\nexport { McpServerPrimitiveOAuthLink as OAuthLink } from \"./server/McpServerOAuthLink\";\nexport {\n McpServerPrimitiveTools as Tools,\n useMcpServerTool,\n} from \"./server/McpServerTools\";\nexport { McpServerPrimitiveToolName as ToolName } from \"./server/McpServerToolName\";\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpManagerResource.d.ts","names":[],"sources":["../../src/resources/McpManagerResource.ts"],"mappings":";;;;;KAoBY,uBAAA;EACV,UAAA,GAAa,YAAA;EACb,OAAA,GAAU,iBAAiB,cAFM;EAIjC,gBAAA,uBAF2B;EAI3B,WAAA;AAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"McpManagerResource.d.ts","names":[],"sources":["../../src/resources/McpManagerResource.ts"],"mappings":";;;;;KAoBY,uBAAA;EACV,UAAA,GAAa,YAAA;EACb,OAAA,GAAU,iBAAiB,cAFM;EAIjC,gBAAA,uBAF2B;EAI3B,WAAA;AAAA;AAAA,cA4NW,kBAAA,8BAAkB,QAAA,CAAA,YAAA,UAAA,KAAA,EAAA,uBAAA"}
|