@assistant-ui/react-mcp 0.1.20 → 0.1.21
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/LICENSE +1 -1
- package/dist/context/McpConnectorByIndexProvider.js.map +1 -1
- package/dist/context/McpCustomServerByIndexProvider.js.map +1 -1
- package/dist/context/McpServerByIdProvider.js.map +1 -1
- package/dist/hooks/useMcpOAuthCallback.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormAuthFields.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormAuthSelect.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormBearerTokenField.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormCancel.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormError.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormNameField.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormScopesField.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormSubmit.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormUrlField.js.map +1 -1
- package/dist/primitives/elicitation/McpElicitationPrimitiveAccept.js.map +1 -1
- package/dist/primitives/elicitation/McpElicitationPrimitiveCancel.js.map +1 -1
- package/dist/primitives/elicitation/McpElicitationPrimitiveDecline.js.map +1 -1
- package/dist/primitives/elicitation/McpElicitationPrimitiveError.js.map +1 -1
- package/dist/primitives/elicitation/McpElicitationPrimitiveFields.js.map +1 -1
- package/dist/primitives/elicitation/McpElicitationPrimitiveItems.js.map +1 -1
- package/dist/primitives/elicitation/McpElicitationPrimitiveMessage.js.map +1 -1
- package/dist/primitives/elicitation/McpElicitationPrimitiveRoot.js.map +1 -1
- package/dist/primitives/manager/McpManagerAddCustomTrigger.js.map +1 -1
- package/dist/primitives/manager/McpManagerRoot.js.map +1 -1
- package/dist/primitives/server/McpServerConnectButton.js.map +1 -1
- package/dist/primitives/server/McpServerDisconnectButton.js.map +1 -1
- package/dist/primitives/server/McpServerError.js.map +1 -1
- package/dist/primitives/server/McpServerIcon.js.map +1 -1
- package/dist/primitives/server/McpServerName.js.map +1 -1
- package/dist/primitives/server/McpServerOAuthLink.js.map +1 -1
- package/dist/primitives/server/McpServerRemoveButton.js.map +1 -1
- package/dist/primitives/server/McpServerRoot.js.map +1 -1
- package/dist/primitives/server/McpServerStatus.js.map +1 -1
- package/dist/primitives/server/McpServerToolName.js.map +1 -1
- package/dist/primitives/server/McpServerTools.js.map +1 -1
- package/dist/resources/McpManagerResource.js.map +1 -1
- package/dist/resources/storage/McpLocalStorage.js.map +1 -1
- package/package.json +12 -9
package/LICENSE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpConnectorByIndexProvider.js","names":["FC","PropsWithChildren","useAui","AuiConfig","AuiProvider","Derived","McpConnectorByIndexProvider","index","t0","$","_c","children","aui","t1","mcpServer","source","query","kind","get","parent","mcp","connector","config","t2"],"sources":["../../src/context/McpConnectorByIndexProvider.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport { useAui, AuiConfig, AuiProvider, Derived } from \"@assistant-ui/store\";\n\nexport const McpConnectorByIndexProvider: FC<\n PropsWithChildren<{ index: number }>\n> = ({ index, children }) => {\n const aui = useAui();\n const config = AuiConfig({\n mcpServer: Derived({\n source: \"mcp\",\n query: { kind: \"connector\", index },\n get: (parent) => parent.mcp.connector({ index }),\n }),\n });\n return (\n <AuiProvider extends={aui} config={config}>\n {children}\n </AuiProvider>\n );\n};\n"],"mappings":";;;;AAGA,MAAaM,+BAETE,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAC,MAAA,EAAAH,OAAAI,aAAAH;CACH,MAAAI,MAAYV,OAAO;CAAE,IAAAW;CAAA,IAAAJ,EAAA,OAAAF,OAAA;EACNM,KAAAV,UAAU,EAAAW,WACZT,QAAQ;GAAAU,QACT;GAAKC,OACN;IAAAC,MAAQ;IAAWV;GAAQ;GAACW,MAC9BC,WAAYA,OAAMC,IAAIC,UAAW,EAAAd,MAAQ,CAAC;EACjD,CAAC,EACH,CAAC;EAACE,EAAA,KAAAF;EAAAE,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CANF,MAAAa,SAAeT;CAMZ,IAAAU;CAAA,IAAAd,EAAA,OAAAG,OAAAH,EAAA,OAAAE,YAAAF,EAAA,OAAAa,QAAA;EAEDC,KAAA,oBAAC,aAAD;GAAsBX,SAAAA;GAAaU;GAChCX;EADS,CAAA;EAEEF,EAAA,KAAAG;EAAAH,EAAA,KAAAE;EAAAF,EAAA,KAAAa;EAAAb,EAAA,KAAAc;CAAA,OAAAA,KAAAd,EAAA;CAAA,OAFdc;AAEc"}
|
|
1
|
+
{"version":3,"file":"McpConnectorByIndexProvider.js","names":["FC","PropsWithChildren","useAui","AuiConfig","AuiProvider","Derived","McpConnectorByIndexProvider","index","t0","$","_c","children","aui","t1","mcpServer","source","query","kind","get","parent","mcp","connector","config","t2","_c"],"sources":["../../src/context/McpConnectorByIndexProvider.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport { useAui, AuiConfig, AuiProvider, Derived } from \"@assistant-ui/store\";\n\nexport const McpConnectorByIndexProvider: FC<\n PropsWithChildren<{ index: number }>\n> = ({ index, children }) => {\n const aui = useAui();\n const config = AuiConfig({\n mcpServer: Derived({\n source: \"mcp\",\n query: { kind: \"connector\", index },\n get: (parent) => parent.mcp.connector({ index }),\n }),\n });\n return (\n <AuiProvider extends={aui} config={config}>\n {children}\n </AuiProvider>\n );\n};\n"],"mappings":";;;;AAGA,MAAaM,+BAETE,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAC,MAAA,EAAAH,OAAAI,aAAAH;CACH,MAAAI,MAAYV,OAAO;CAAE,IAAAW;CAAA,IAAAJ,EAAA,OAAAF,OAAA;EACNM,KAAAV,UAAU,EAAAW,WACZT,QAAQ;GAAAU,QACT;GAAKC,OACN;IAAAC,MAAQ;IAAWV;GAAQ;GAACW,MAC9BC,WAAYA,OAAMC,IAAIC,UAAW,EAAAd,MAAQ,CAAC;EACjD,CAAC,EACH,CAAC;EAACE,EAAA,KAAAF;EAAAE,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CANF,MAAAa,SAAeT;CAMZ,IAAAU;CAAA,IAAAd,EAAA,OAAAG,OAAAH,EAAA,OAAAE,YAAAF,EAAA,OAAAa,QAAA;EAEDC,KAAA,oBAAC,aAAD;GAAsBX,SAAAA;GAAaU;GAChCX;EADS,CAAA;EAEEF,EAAA,KAAAG;EAAAH,EAAA,KAAAE;EAAAF,EAAA,KAAAa;EAAAb,EAAA,KAAAc;CAAA,OAAAA,KAAAd,EAAA;CAAA,OAFdc;AAEc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpCustomServerByIndexProvider.js","names":["FC","PropsWithChildren","useAui","AuiConfig","AuiProvider","Derived","McpCustomServerByIndexProvider","index","t0","$","_c","children","aui","t1","mcpServer","source","query","kind","get","parent","mcp","customServer","config","t2"],"sources":["../../src/context/McpCustomServerByIndexProvider.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport { useAui, AuiConfig, AuiProvider, Derived } from \"@assistant-ui/store\";\n\nexport const McpCustomServerByIndexProvider: FC<\n PropsWithChildren<{ index: number }>\n> = ({ index, children }) => {\n const aui = useAui();\n const config = AuiConfig({\n mcpServer: Derived({\n source: \"mcp\",\n query: { kind: \"custom\", index },\n get: (parent) => parent.mcp.customServer({ index }),\n }),\n });\n return (\n <AuiProvider extends={aui} config={config}>\n {children}\n </AuiProvider>\n );\n};\n"],"mappings":";;;;AAGA,MAAaM,kCAETE,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAC,MAAA,EAAAH,OAAAI,aAAAH;CACH,MAAAI,MAAYV,OAAO;CAAE,IAAAW;CAAA,IAAAJ,EAAA,OAAAF,OAAA;EACNM,KAAAV,UAAU,EAAAW,WACZT,QAAQ;GAAAU,QACT;GAAKC,OACN;IAAAC,MAAQ;IAAQV;GAAQ;GAACW,MAC3BC,WAAYA,OAAMC,IAAIC,aAAc,EAAAd,MAAQ,CAAC;EACpD,CAAC,EACH,CAAC;EAACE,EAAA,KAAAF;EAAAE,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CANF,MAAAa,SAAeT;CAMZ,IAAAU;CAAA,IAAAd,EAAA,OAAAG,OAAAH,EAAA,OAAAE,YAAAF,EAAA,OAAAa,QAAA;EAEDC,KAAA,oBAAC,aAAD;GAAsBX,SAAAA;GAAaU;GAChCX;EADS,CAAA;EAEEF,EAAA,KAAAG;EAAAH,EAAA,KAAAE;EAAAF,EAAA,KAAAa;EAAAb,EAAA,KAAAc;CAAA,OAAAA,KAAAd,EAAA;CAAA,OAFdc;AAEc"}
|
|
1
|
+
{"version":3,"file":"McpCustomServerByIndexProvider.js","names":["FC","PropsWithChildren","useAui","AuiConfig","AuiProvider","Derived","McpCustomServerByIndexProvider","index","t0","$","_c","children","aui","t1","mcpServer","source","query","kind","get","parent","mcp","customServer","config","t2","_c"],"sources":["../../src/context/McpCustomServerByIndexProvider.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport { useAui, AuiConfig, AuiProvider, Derived } from \"@assistant-ui/store\";\n\nexport const McpCustomServerByIndexProvider: FC<\n PropsWithChildren<{ index: number }>\n> = ({ index, children }) => {\n const aui = useAui();\n const config = AuiConfig({\n mcpServer: Derived({\n source: \"mcp\",\n query: { kind: \"custom\", index },\n get: (parent) => parent.mcp.customServer({ index }),\n }),\n });\n return (\n <AuiProvider extends={aui} config={config}>\n {children}\n </AuiProvider>\n );\n};\n"],"mappings":";;;;AAGA,MAAaM,kCAETE,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAC,MAAA,EAAAH,OAAAI,aAAAH;CACH,MAAAI,MAAYV,OAAO;CAAE,IAAAW;CAAA,IAAAJ,EAAA,OAAAF,OAAA;EACNM,KAAAV,UAAU,EAAAW,WACZT,QAAQ;GAAAU,QACT;GAAKC,OACN;IAAAC,MAAQ;IAAQV;GAAQ;GAACW,MAC3BC,WAAYA,OAAMC,IAAIC,aAAc,EAAAd,MAAQ,CAAC;EACpD,CAAC,EACH,CAAC;EAACE,EAAA,KAAAF;EAAAE,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CANF,MAAAa,SAAeT;CAMZ,IAAAU;CAAA,IAAAd,EAAA,OAAAG,OAAAH,EAAA,OAAAE,YAAAF,EAAA,OAAAa,QAAA;EAEDC,KAAA,oBAAC,aAAD;GAAsBX,SAAAA;GAAaU;GAChCX;EADS,CAAA;EAEEF,EAAA,KAAAG;EAAAH,EAAA,KAAAE;EAAAF,EAAA,KAAAa;EAAAb,EAAA,KAAAc;CAAA,OAAAA,KAAAd,EAAA;CAAA,OAFdc;AAEc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpServerByIdProvider.js","names":["FC","PropsWithChildren","useAui","AuiConfig","AuiProvider","Derived","McpServerByIdProvider","id","t0","$","_c","children","aui","t1","mcpServer","source","query","get","parent","mcp","server","config","t2"],"sources":["../../src/context/McpServerByIdProvider.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport { useAui, AuiConfig, AuiProvider, Derived } from \"@assistant-ui/store\";\n\nexport const McpServerByIdProvider: FC<PropsWithChildren<{ id: string }>> = ({\n id,\n children,\n}) => {\n const aui = useAui();\n const config = AuiConfig({\n mcpServer: Derived({\n source: \"mcp\",\n query: { id },\n get: (parent) => parent.mcp.server({ id }),\n }),\n });\n return (\n <AuiProvider extends={aui} config={config}>\n {children}\n </AuiProvider>\n );\n};\n"],"mappings":";;;;AAGA,MAAaM,yBAA+DE,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAC,MAAA,EAAAH,IAAAI,aAAAH;CAI3E,MAAAI,MAAYV,OAAO;CAAE,IAAAW;CAAA,IAAAJ,EAAA,OAAAF,IAAA;EACNM,KAAAV,UAAU,EAAAW,WACZT,QAAQ;GAAAU,QACT;GAAKC,OACN,EAAAT,GAAK;GAACU,MACRC,WAAYA,OAAMC,IAAIC,OAAQ,EAAAb,GAAK,CAAC;EAC3C,CAAC,EACH,CAAC;EAACE,EAAA,KAAAF;EAAAE,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CANF,MAAAY,SAAeR;CAMZ,IAAAS;CAAA,IAAAb,EAAA,OAAAG,OAAAH,EAAA,OAAAE,YAAAF,EAAA,OAAAY,QAAA;EAEDC,KAAA,oBAAC,aAAD;GAAsBV,SAAAA;GAAaS;GAChCV;EADS,CAAA;EAEEF,EAAA,KAAAG;EAAAH,EAAA,KAAAE;EAAAF,EAAA,KAAAY;EAAAZ,EAAA,KAAAa;CAAA,OAAAA,KAAAb,EAAA;CAAA,OAFda;AAEc"}
|
|
1
|
+
{"version":3,"file":"McpServerByIdProvider.js","names":["FC","PropsWithChildren","useAui","AuiConfig","AuiProvider","Derived","McpServerByIdProvider","id","t0","$","_c","children","aui","t1","mcpServer","source","query","get","parent","mcp","server","config","t2","_c"],"sources":["../../src/context/McpServerByIdProvider.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport { useAui, AuiConfig, AuiProvider, Derived } from \"@assistant-ui/store\";\n\nexport const McpServerByIdProvider: FC<PropsWithChildren<{ id: string }>> = ({\n id,\n children,\n}) => {\n const aui = useAui();\n const config = AuiConfig({\n mcpServer: Derived({\n source: \"mcp\",\n query: { id },\n get: (parent) => parent.mcp.server({ id }),\n }),\n });\n return (\n <AuiProvider extends={aui} config={config}>\n {children}\n </AuiProvider>\n );\n};\n"],"mappings":";;;;AAGA,MAAaM,yBAA+DE,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAC,MAAA,EAAAH,IAAAI,aAAAH;CAI3E,MAAAI,MAAYV,OAAO;CAAE,IAAAW;CAAA,IAAAJ,EAAA,OAAAF,IAAA;EACNM,KAAAV,UAAU,EAAAW,WACZT,QAAQ;GAAAU,QACT;GAAKC,OACN,EAAAT,GAAK;GAACU,MACRC,WAAYA,OAAMC,IAAIC,OAAQ,EAAAb,GAAK,CAAC;EAC3C,CAAC,EACH,CAAC;EAACE,EAAA,KAAAF;EAAAE,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CANF,MAAAY,SAAeR;CAMZ,IAAAS;CAAA,IAAAb,EAAA,OAAAG,OAAAH,EAAA,OAAAE,YAAAF,EAAA,OAAAY,QAAA;EAEDC,KAAA,oBAAC,aAAD;GAAsBV,SAAAA;GAAaS;GAChCV;EADS,CAAA;EAEEF,EAAA,KAAAG;EAAAH,EAAA,KAAAE;EAAAF,EAAA,KAAAY;EAAAZ,EAAA,KAAAa;CAAA,OAAAA,KAAAb,EAAA;CAAA,OAFda;AAEc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMcpOAuthCallback.js","names":["FC","ReactNode","useEffect","useInsertionEffect","useRef","useState","useAui","decodeServerIdFromState","invokeMcpCallback","createMcpOAuthCallbackError","err","serverId","Error","message","String","cause","UseMcpOAuthCallbackOptions","url","onComplete","onError","UseMcpOAuthCallbackResult","status","error","useMcpOAuthCallback","opts","aui","result","setResult","startedRef","optsRef","current","window","location","href","superseded","parsed","URL","state","searchParams","get","mcp","server","id","completeAuth","McpOAuthCallback","children","t0","$","_c","t1","t2"],"sources":["../../src/hooks/useMcpOAuthCallback.tsx"],"sourcesContent":["import {\n type FC,\n type ReactNode,\n useEffect,\n useInsertionEffect,\n useRef,\n useState,\n} from \"react\";\nimport { useAui } from \"@assistant-ui/store\";\nimport { decodeServerIdFromState } from \"../auth/createOAuthProvider\";\nimport { invokeMcpCallback } from \"../utils/invokeMcpCallback\";\n\nexport const createMcpOAuthCallbackError = (\n err: unknown,\n serverId: string | null,\n): Error => {\n const message = err instanceof Error ? err.message : String(err);\n if (serverId) {\n return new Error(\n `MCP OAuth callback for server \"${serverId}\" failed: ${message}`,\n { cause: err },\n );\n }\n return new Error(`MCP OAuth callback failed: ${message}`, { cause: err });\n};\n\nexport type UseMcpOAuthCallbackOptions = {\n /** Defaults to `window.location.href`. */\n url?: string;\n onComplete?: (serverId: string) => void;\n onError?: (err: Error) => void;\n};\n\nexport type UseMcpOAuthCallbackResult = {\n status: \"idle\" | \"running\" | \"done\" | \"error\";\n serverId: string | null;\n error: Error | null;\n};\n\nexport function useMcpOAuthCallback(\n opts: UseMcpOAuthCallbackOptions = {},\n): UseMcpOAuthCallbackResult {\n const aui = useAui();\n const [result, setResult] = useState<UseMcpOAuthCallbackResult>({\n status: \"idle\",\n serverId: null,\n error: null,\n });\n // Guard against React 18 Strict Mode's mount-unmount-remount: the effect\n // body must not run completeAuth twice for the same URL, otherwise the\n // single-use OAuth code is double-redeemed and the second attempt 4xxs.\n const startedRef = useRef<string | null>(null);\n const optsRef = useRef(opts);\n useInsertionEffect(() => {\n optsRef.current = opts;\n });\n\n useEffect(() => {\n const url =\n opts.url ?? (typeof window !== \"undefined\" ? window.location.href : null);\n if (!url) return;\n if (startedRef.current === url) return;\n startedRef.current = url;\n\n // A callback page can be handed a second login URL while the first\n // completeAuth is still in flight. That attempt keeps running, so it\n // publishes only while its own URL is still the one being attempted;\n // otherwise an older failure would overwrite the newer attempt's success.\n // The check is against `startedRef` rather than a teardown flag so that\n // Strict Mode's unmount-remount, which starts no new attempt, still\n // publishes the result of the one already running.\n const superseded = () => startedRef.current !== url;\n\n void (async () => {\n let serverId: string | null = null;\n try {\n const parsed = new URL(url);\n const state = parsed.searchParams.get(\"state\");\n if (state) serverId = decodeServerIdFromState(state);\n if (!state) throw new Error('missing \"state\" parameter');\n if (!serverId) {\n throw new Error(\"state was not created by assistant-ui MCP\");\n }\n if (superseded()) return;\n setResult({ status: \"running\", serverId, error: null });\n await aui.mcp.server({ id: serverId }).completeAuth(url);\n if (superseded()) return;\n setResult({ status: \"done\", serverId, error: null });\n } catch (err) {\n if (superseded()) return;\n const error = createMcpOAuthCallbackError(err, serverId);\n setResult({ status: \"error\", serverId, error });\n invokeMcpCallback(\"onError\", optsRef.current.onError, error);\n return;\n }\n\n invokeMcpCallback(\"onComplete\", optsRef.current.onComplete, serverId);\n })();\n }, [aui, opts.url]);\n\n return result;\n}\n\nexport const McpOAuthCallback: FC<\n UseMcpOAuthCallbackOptions & {\n children?: (result: UseMcpOAuthCallbackResult) => ReactNode;\n }\n> = ({ children, ...opts }) => {\n const result = useMcpOAuthCallback(opts);\n if (children) return <>{children(result)}</>;\n return null;\n};\n"],"mappings":";;;;;;;AAYA,MAAaS,+BACXC,KACAC,aACU;CACV,MAAME,UAAUH,eAAeE,QAAQF,IAAIG,UAAUC,OAAOJ,GAAG;CAC/D,IAAIC,UACF,OAAO,IAAIC,MACT,kCAAkCD,SAAQ,YAAaE,WACvD,EAAEE,OAAOL,IAAI,CACf;CAEF,OAAO,IAAIE,MAAM,8BAA8BC,WAAW,EAAEE,OAAOL,IAAI,CAAC;AAC1E;AAeA,SAAgBa,oBACdC,OAAmC,CAAC,GACT;CAC3B,MAAMC,MAAMnB,OAAO;CACnB,MAAM,CAACoB,QAAQC,aAAatB,SAAoC;EAC9DgB,QAAQ;EACRV,UAAU;EACVW,OAAO;CACT,CAAC;CAID,MAAMM,aAAaxB,OAAsB,IAAI;CAC7C,MAAMyB,UAAUzB,OAAOoB,IAAI;CAC3BrB,yBAAyB;EACvB0B,QAAQC,UAAUN;CACpB,CAAC;CAEDtB,gBAAgB;EACd,MAAMe,MACJO,KAAKP,QAAQ,OAAOc,WAAW,cAAcA,OAAOC,SAASC,OAAO;EACtE,IAAI,CAAChB,KAAK;EACV,IAAIW,WAAWE,YAAYb,KAAK;EAChCW,WAAWE,UAAUb;EASrB,MAAMiB,mBAAmBN,WAAWE,YAAYb;EAEhD,CAAM,YAAY;GAChB,IAAIN,WAA0B;GAC9B,IAAI;IAEF,MAAM0B,QAAQF,IADKC,IAAInB,GACTkB,CAAM,CAACG,aAAaC,IAAI,OAAO;IAC7C,IAAIF,OAAO1B,WAAWJ,wBAAwB8B,KAAK;IACnD,IAAI,CAACA,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AG;EAAA,IAAAH,EAAA,OAAAE,IAAA;GAAnBC,KAAA,oBAAA,UAAA,EAAA,UAAGD,GAAgB,CAAA;GAAIF,EAAA,KAAAE;GAAAF,EAAA,KAAAG;EAAA,OAAAA,KAAAH,EAAA;EAAA,OAAvBG;CAAuB;CAAC,OACtC;AAAI"}
|
|
1
|
+
{"version":3,"file":"useMcpOAuthCallback.js","names":["FC","ReactNode","useEffect","useInsertionEffect","useRef","useState","useAui","decodeServerIdFromState","invokeMcpCallback","createMcpOAuthCallbackError","err","serverId","Error","message","String","cause","UseMcpOAuthCallbackOptions","url","onComplete","onError","UseMcpOAuthCallbackResult","status","error","useMcpOAuthCallback","opts","aui","result","setResult","startedRef","optsRef","current","window","location","href","superseded","parsed","URL","state","searchParams","get","mcp","server","id","completeAuth","McpOAuthCallback","children","t0","$","_c","t1","t2","_c"],"sources":["../../src/hooks/useMcpOAuthCallback.tsx"],"sourcesContent":["import {\n type FC,\n type ReactNode,\n useEffect,\n useInsertionEffect,\n useRef,\n useState,\n} from \"react\";\nimport { useAui } from \"@assistant-ui/store\";\nimport { decodeServerIdFromState } from \"../auth/createOAuthProvider\";\nimport { invokeMcpCallback } from \"../utils/invokeMcpCallback\";\n\nexport const createMcpOAuthCallbackError = (\n err: unknown,\n serverId: string | null,\n): Error => {\n const message = err instanceof Error ? err.message : String(err);\n if (serverId) {\n return new Error(\n `MCP OAuth callback for server \"${serverId}\" failed: ${message}`,\n { cause: err },\n );\n }\n return new Error(`MCP OAuth callback failed: ${message}`, { cause: err });\n};\n\nexport type UseMcpOAuthCallbackOptions = {\n /** Defaults to `window.location.href`. */\n url?: string;\n onComplete?: (serverId: string) => void;\n onError?: (err: Error) => void;\n};\n\nexport type UseMcpOAuthCallbackResult = {\n status: \"idle\" | \"running\" | \"done\" | \"error\";\n serverId: string | null;\n error: Error | null;\n};\n\nexport function useMcpOAuthCallback(\n opts: UseMcpOAuthCallbackOptions = {},\n): UseMcpOAuthCallbackResult {\n const aui = useAui();\n const [result, setResult] = useState<UseMcpOAuthCallbackResult>({\n status: \"idle\",\n serverId: null,\n error: null,\n });\n // Guard against React 18 Strict Mode's mount-unmount-remount: the effect\n // body must not run completeAuth twice for the same URL, otherwise the\n // single-use OAuth code is double-redeemed and the second attempt 4xxs.\n const startedRef = useRef<string | null>(null);\n const optsRef = useRef(opts);\n useInsertionEffect(() => {\n optsRef.current = opts;\n });\n\n useEffect(() => {\n const url =\n opts.url ?? (typeof window !== \"undefined\" ? window.location.href : null);\n if (!url) return;\n if (startedRef.current === url) return;\n startedRef.current = url;\n\n // A callback page can be handed a second login URL while the first\n // completeAuth is still in flight. That attempt keeps running, so it\n // publishes only while its own URL is still the one being attempted;\n // otherwise an older failure would overwrite the newer attempt's success.\n // The check is against `startedRef` rather than a teardown flag so that\n // Strict Mode's unmount-remount, which starts no new attempt, still\n // publishes the result of the one already running.\n const superseded = () => startedRef.current !== url;\n\n void (async () => {\n let serverId: string | null = null;\n try {\n const parsed = new URL(url);\n const state = parsed.searchParams.get(\"state\");\n if (state) serverId = decodeServerIdFromState(state);\n if (!state) throw new Error('missing \"state\" parameter');\n if (!serverId) {\n throw new Error(\"state was not created by assistant-ui MCP\");\n }\n if (superseded()) return;\n setResult({ status: \"running\", serverId, error: null });\n await aui.mcp.server({ id: serverId }).completeAuth(url);\n if (superseded()) return;\n setResult({ status: \"done\", serverId, error: null });\n } catch (err) {\n if (superseded()) return;\n const error = createMcpOAuthCallbackError(err, serverId);\n setResult({ status: \"error\", serverId, error });\n invokeMcpCallback(\"onError\", optsRef.current.onError, error);\n return;\n }\n\n invokeMcpCallback(\"onComplete\", optsRef.current.onComplete, serverId);\n })();\n }, [aui, opts.url]);\n\n return result;\n}\n\nexport const McpOAuthCallback: FC<\n UseMcpOAuthCallbackOptions & {\n children?: (result: UseMcpOAuthCallbackResult) => ReactNode;\n }\n> = ({ children, ...opts }) => {\n const result = useMcpOAuthCallback(opts);\n if (children) return <>{children(result)}</>;\n return null;\n};\n"],"mappings":";;;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iveBearerTokenField","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 = \"McpAddFormPrimitive.AuthFields\";\n"],"mappings":";;;;;;AAgBA,MAAaK,iCAETI,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAC,MAAA,EAAAJ,aAAAE;CACH,MAAA,EAAAG,OAAAC,QAAuBT,WAAW;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Props","children","authType","t0","$","_c","state","ids","Render","t1","bearerToken","scopes","displayName","_c"],"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 = \"McpAddFormPrimitive.AuthFields\";\n"],"mappings":";;;;;;AAgBA,MAAaK,iCAETI,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAC,MAAA,EAAAJ,aAAAE;CACH,MAAA,EAAAG,OAAAC,QAAuBT,WAAW;CAElC,IAAIG,UAAQ;EACV,MAAAO,SAAeP;EAAS,IAAAQ;EAAA,IAAAL,EAAA,OAAAI,UAAAJ,EAAA,OAAAE,MAAAJ,UAAA;GACjBO,KAAA,oBAAC,QAAD,EAAkB,UAAAH,MAAKJ,SAAS,CAAA;GAAIE,EAAA,KAAAI;GAAAJ,EAAA,KAAAE,MAAAJ;GAAAE,EAAA,KAAAK;EAAA,OAAAA,KAAAL,EAAA;EAAA,OAApCK;CAAoC;CAG7C,IAAIH,MAAKJ,aAAc,UAAQ;EAAA,IAAAO;EAAA,IAAAL,EAAA,OAAAG,IAAAG,aAAA;GAE3BD,KAAA,qBAAA,OAAA,EAAA,UAAA,CACE,oBAAA,SAAA;IACW,SAAAF,IAAGG;IACc,6BAAA;IAC3B,UAAA;GAEO,CAAA,GACR,oBAAC,qCAAD;IACM,IAAAH,IAAGG;IACa,uBAAA;GAAc,CAAA,CAEhC,EAAA,CAAA;GAAAN,EAAA,KAAAG,IAAAG;GAAAN,EAAA,KAAAK;EAAA,OAAAA,KAAAL,EAAA;EAAA,OAXNK;CAWM;CAIV,IAAIH,MAAKJ,aAAc,SAAO;EAAA,IAAAO;EAAA,IAAAL,EAAA,OAAAG,IAAAI,QAAA;GAE1BF,KAAA,qBAAA,OAAA,EAAA,UAAA,CACE,oBAAA,SAAA;IAAgB,SAAAF,IAAGI;IAAmC,6BAAA;IAAe,UAAA;GAE7D,CAAA,GACR,oBAAC,gCAAD;IACM,IAAAJ,IAAGI;IACa,uBAAA;GAAc,CAAA,CAEhC,EAAA,CAAA;GAAAP,EAAA,KAAAG,IAAAI;GAAAP,EAAA,KAAAK;EAAA,OAAAA,KAAAL,EAAA;EAAA,OARNK;CAQM;CAET,OAEM;AAAI;AAGbV,8BAA8Ba,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpAddFormAuthSelect.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAddForm","AddFormAuthType","AUTH_TYPES","ReadonlySet","Set","asAuthType","value","has","McpAddFormPrimitiveAuthSelect","Element","select","Props","Omit","props","ref","$","_c","state","setField","t0","e","next","target","t1","children","t2","authType","displayName"],"sources":["../../../src/primitives/addForm/McpAddFormAuthSelect.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAddForm, type AddFormAuthType } from \"./context\";\n\nconst AUTH_TYPES: ReadonlySet<AddFormAuthType> = new Set([\n \"none\",\n \"bearer\",\n \"oauth\",\n]);\n\nfunction asAuthType(value: string): AddFormAuthType | null {\n return (AUTH_TYPES as ReadonlySet<string>).has(value)\n ? (value as AddFormAuthType)\n : null;\n}\n\nexport namespace McpAddFormPrimitiveAuthSelect {\n export type Element = ComponentRef<typeof Primitive.select>;\n export type Props = Omit<\n ComponentPropsWithoutRef<typeof Primitive.select>,\n \"value\" | \"onChange\"\n >;\n}\n\nexport const McpAddFormPrimitiveAuthSelect = forwardRef<\n McpAddFormPrimitiveAuthSelect.Element,\n McpAddFormPrimitiveAuthSelect.Props\n>((props, ref) => {\n const { state, setField } = useAddForm();\n return (\n <Primitive.select\n {...props}\n ref={ref}\n value={state.authType}\n onChange={(e) => {\n const next = asAuthType(e.target.value);\n if (next) setField(\"authType\", next);\n }}\n >\n {props.children ?? (\n <>\n <option value=\"oauth\">OAuth</option>\n <option value=\"bearer\">Bearer token</option>\n <option value=\"none\">None</option>\n </>\n )}\n </Primitive.select>\n );\n});\n\nMcpAddFormPrimitiveAuthSelect.displayName = \"McpAddFormPrimitive.AuthSelect\";\n"],"mappings":";;;;;;AAQA,MAAMM,6BAA2C,IAAIE,IAAI;CACvD;CACA;CACA;AAAO,CACR;AAED,SAASC,WAAWC,OAAuC;CACzD,OAAQJ,WAAmCK,IAAID,KAAK,IAC/CA,QACD;AACN;AAUA,MAAaE,gCAAgCV,YAG3Ce,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CACA,MAAA,EAAAC,OAAAC,aAA4BlB,WAAW;CAAE,IAAAmB;CAAA,IAAAJ,EAAA,OAAAG,UAAA;EAM3BC,MAAAC,MAAA;GACR,MAAAC,OAAahB,WAAWe,EAACE,OAAOhB,KAAM;GACtC,IAAIe,MAAMH,SAAS,YAAYG,IAAI;EAAE;EACtCN,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,IAAAQ;CAAA,IAAAR,EAAA,OAAAF,MAAAW,UAAA;EAEAD,KAAAV,MAAKW,YAAL,qBAAA,UAAA,EAAA,UAAA;GAEG,oBAAA,UAAA;IAAc,OAAA;IAAQ,UAAA;GAAc,CAAA;GACpC,oBAAA,UAAA;IAAc,OAAA;IAAS,UAAA;GAAqB,CAAA;GAC5C,oBAAA,UAAA;IAAc,OAAA;IAAO,UAAA;GAAa,CAAA;EAAA,EAAA,CAAA;EAErCT,EAAA,KAAAF,MAAAW;EAAAT,EAAA,KAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,IAAAU;CAAA,IAAAV,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAE,MAAAS,YAAAX,EAAA,OAAAI,MAAAJ,EAAA,OAAAQ,IAAA;EAfHE,KAAA,oBAAA,UAAA,QAAA;GAAA,GACMZ;GACCC;GACE,OAAAG,MAAKS;GACF,UAAAP;GAKTI,UAAAA;EAOH,CAAA;EAAmBR,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAE,MAAAS;EAAAX,EAAA,KAAAI;EAAAJ,EAAA,KAAAQ;EAAAR,EAAA,KAAAU;CAAA,OAAAA,KAAAV,EAAA;CAAA,OAhBnBU;AAgBmB,CAEtB;AAEDjB,8BAA8BmB,cAAc"}
|
|
1
|
+
{"version":3,"file":"McpAddFormAuthSelect.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAddForm","AddFormAuthType","AUTH_TYPES","ReadonlySet","Set","asAuthType","value","has","McpAddFormPrimitiveAuthSelect","Element","select","Props","Omit","props","ref","$","_c","state","setField","t0","e","next","target","t1","children","t2","authType","displayName","_c"],"sources":["../../../src/primitives/addForm/McpAddFormAuthSelect.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAddForm, type AddFormAuthType } from \"./context\";\n\nconst AUTH_TYPES: ReadonlySet<AddFormAuthType> = new Set([\n \"none\",\n \"bearer\",\n \"oauth\",\n]);\n\nfunction asAuthType(value: string): AddFormAuthType | null {\n return (AUTH_TYPES as ReadonlySet<string>).has(value)\n ? (value as AddFormAuthType)\n : null;\n}\n\nexport namespace McpAddFormPrimitiveAuthSelect {\n export type Element = ComponentRef<typeof Primitive.select>;\n export type Props = Omit<\n ComponentPropsWithoutRef<typeof Primitive.select>,\n \"value\" | \"onChange\"\n >;\n}\n\nexport const McpAddFormPrimitiveAuthSelect = forwardRef<\n McpAddFormPrimitiveAuthSelect.Element,\n McpAddFormPrimitiveAuthSelect.Props\n>((props, ref) => {\n const { state, setField } = useAddForm();\n return (\n <Primitive.select\n {...props}\n ref={ref}\n value={state.authType}\n onChange={(e) => {\n const next = asAuthType(e.target.value);\n if (next) setField(\"authType\", next);\n }}\n >\n {props.children ?? (\n <>\n <option value=\"oauth\">OAuth</option>\n <option value=\"bearer\">Bearer token</option>\n <option value=\"none\">None</option>\n </>\n )}\n </Primitive.select>\n );\n});\n\nMcpAddFormPrimitiveAuthSelect.displayName = \"McpAddFormPrimitive.AuthSelect\";\n"],"mappings":";;;;;;AAQA,MAAMM,6BAA2C,IAAIE,IAAI;CACvD;CACA;CACA;AAAO,CACR;AAED,SAASC,WAAWC,OAAuC;CACzD,OAAQJ,WAAmCK,IAAID,KAAK,IAC/CA,QACD;AACN;AAUA,MAAaE,gCAAgCV,YAG3Ce,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CACA,MAAA,EAAAC,OAAAC,aAA4BlB,WAAW;CAAE,IAAAmB;CAAA,IAAAJ,EAAA,OAAAG,UAAA;EAM3BC,MAAAC,MAAA;GACR,MAAAC,OAAahB,WAAWe,EAACE,OAAOhB,KAAM;GACtC,IAAIe,MAAMH,SAAS,YAAYG,IAAI;EAAE;EACtCN,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,IAAAQ;CAAA,IAAAR,EAAA,OAAAF,MAAAW,UAAA;EAEAD,KAAAV,MAAKW,YAAL,qBAAA,UAAA,EAAA,UAAA;GAEG,oBAAA,UAAA;IAAc,OAAA;IAAQ,UAAA;GAAc,CAAA;GACpC,oBAAA,UAAA;IAAc,OAAA;IAAS,UAAA;GAAqB,CAAA;GAC5C,oBAAA,UAAA;IAAc,OAAA;IAAO,UAAA;GAAa,CAAA;EAAA,EAAA,CAAA;EAErCT,EAAA,KAAAF,MAAAW;EAAAT,EAAA,KAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,IAAAU;CAAA,IAAAV,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAE,MAAAS,YAAAX,EAAA,OAAAI,MAAAJ,EAAA,OAAAQ,IAAA;EAfHE,KAAA,oBAAA,UAAA,QAAA;GAAA,GACMZ;GACCC;GACE,OAAAG,MAAKS;GACF,UAAAP;GAKTI,UAAAA;EAOH,CAAA;EAAmBR,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAE,MAAAS;EAAAX,EAAA,KAAAI;EAAAJ,EAAA,KAAAQ;EAAAR,EAAA,KAAAU;CAAA,OAAAA,KAAAV,EAAA;CAAA,OAhBnBU;AAgBmB,CAEtB;AAEDjB,8BAA8BmB,cAAc"}
|
|
@@ -1 +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
|
+
{"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","_c"],"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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpAddFormCancel.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAddForm","McpAddFormPrimitiveCancel","Element","button","Props","props","ref","$","_c","cancel","t0","e","onClick","defaultPrevented","t1","displayName"],"sources":["../../../src/primitives/addForm/McpAddFormCancel.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 McpAddFormPrimitiveCancel {\n export type Element = ComponentRef<typeof Primitive.button>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.button>;\n}\n\nexport const McpAddFormPrimitiveCancel = forwardRef<\n McpAddFormPrimitiveCancel.Element,\n McpAddFormPrimitiveCancel.Props\n>((props, ref) => {\n const { cancel } = useAddForm();\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 cancel();\n }}\n />\n );\n});\n\nMcpAddFormPrimitiveCancel.displayName = \"McpAddFormPrimitive.Cancel\";\n"],"mappings":";;;;;;AAaA,MAAaK,4BAA4BH,YAGvCO,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAA,EAAAC,WAAmBT,WAAW;CAAE,IAAAU;CAAA,IAAAH,EAAA,OAAAE,UAAAF,EAAA,OAAAF,OAAA;EAMnBK,MAAAC,MAAA;GACPN,MAAKO,UAAWD,CAAC;GACjB,IAAIA,EAACE,kBAAiB;GACtBJ,OAAO;EAAC;EACTF,EAAA,KAAAE;EAAAF,EAAA,KAAAF;EAAAE,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAAA,IAAAO;CAAA,IAAAP,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAG,IAAA;EARHI,KAAA,oBAAA,UAAA,QAAA;GAAA,GACMT;GACC,MAAA;GACAC;GACI,SAAAI;EAIR,CAAA;EACDH,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAG;EAAAH,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,OATFO;AASE,CAEL;AAEDb,0BAA0Bc,cAAc"}
|
|
1
|
+
{"version":3,"file":"McpAddFormCancel.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAddForm","McpAddFormPrimitiveCancel","Element","button","Props","props","ref","$","_c","cancel","t0","e","onClick","defaultPrevented","t1","displayName","_c"],"sources":["../../../src/primitives/addForm/McpAddFormCancel.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 McpAddFormPrimitiveCancel {\n export type Element = ComponentRef<typeof Primitive.button>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.button>;\n}\n\nexport const McpAddFormPrimitiveCancel = forwardRef<\n McpAddFormPrimitiveCancel.Element,\n McpAddFormPrimitiveCancel.Props\n>((props, ref) => {\n const { cancel } = useAddForm();\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 cancel();\n }}\n />\n );\n});\n\nMcpAddFormPrimitiveCancel.displayName = \"McpAddFormPrimitive.Cancel\";\n"],"mappings":";;;;;;AAaA,MAAaK,4BAA4BH,YAGvCO,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAA,EAAAC,WAAmBT,WAAW;CAAE,IAAAU;CAAA,IAAAH,EAAA,OAAAE,UAAAF,EAAA,OAAAF,OAAA;EAMnBK,MAAAC,MAAA;GACPN,MAAKO,UAAWD,CAAC;GACjB,IAAIA,EAACE,kBAAiB;GACtBJ,OAAO;EAAC;EACTF,EAAA,KAAAE;EAAAF,EAAA,KAAAF;EAAAE,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAAA,IAAAO;CAAA,IAAAP,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAG,IAAA;EARHI,KAAA,oBAAA,UAAA,QAAA;GAAA,GACMT;GACC,MAAA;GACAC;GACI,SAAAI;EAIR,CAAA;EACDH,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAG;EAAAH,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,OATFO;AASE,CAEL;AAEDb,0BAA0Bc,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpAddFormError.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","isValidElement","Primitive","useAddForm","McpAddFormPrimitiveError","Element","div","Props","props","ref","$","_c","state","ids","error","childId","asChild","children","id","undefined","customId","needsDescriptionWrapper","t0","t1","role","t2","t3","t4","displayName"],"sources":["../../../src/primitives/addForm/McpAddFormError.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n isValidElement,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAddForm } from \"./context\";\n\nexport namespace McpAddFormPrimitiveError {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div>;\n}\n\nexport const McpAddFormPrimitiveError = forwardRef<\n McpAddFormPrimitiveError.Element,\n McpAddFormPrimitiveError.Props\n>((props, ref) => {\n const { state, ids } = useAddForm();\n if (!state.error) return null;\n const childId =\n props.asChild && isValidElement<{ id?: string }>(props.children)\n ? props.children.props.id\n : undefined;\n const customId = childId ?? props.id;\n const needsDescriptionWrapper =\n customId !== undefined && customId !== ids.error;\n const error = (\n <Primitive.div\n {...props}\n id={needsDescriptionWrapper ? props.id : ids.error}\n role={props.role ?? \"alert\"}\n ref={ref}\n >\n {props.children ?? state.error}\n </Primitive.div>\n );\n return needsDescriptionWrapper ? <div id={ids.error}>{error}</div> : error;\n});\n\nMcpAddFormPrimitiveError.displayName = \"McpAddFormPrimitive.Error\";\n"],"mappings":";;;;;;AAcA,MAAaM,2BAA2BJ,YAGtCQ,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CACA,MAAA,EAAAC,OAAAC,QAAuBV,WAAW;CAClC,IAAI,CAACS,MAAKE,OAAM,OAAS;CAKzB,MAAAM,YAHEZ,MAAKQ,WAAYf,eAAgCO,MAAKS,QAAS,IAC3DT,MAAKS,SAAST,MAAMU,KADxBC,KAAAA,MAG0BX,MAAKU;CACjC,MAAAG,0BACED,aAAaD,KAAAA,KAAaC,aAAaP,IAAGC;CAIpC,MAAAQ,KAAAD,0BAA0Bb,MAAKU,KAAML,IAAGC;CACtC,MAAAS,KAAAf,MAAKgB,QAAL;CAGL,MAAAC,KAAAjB,MAAKS,YAAaL,MAAKE;CAAM,IAAAY;CAAA,IAAAhB,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAY,MAAAZ,EAAA,OAAAa,MAAAb,EAAA,OAAAe,IAAA;EANhCC,KAAA,oBAAA,UAAA,KAAA;GAAA,GACMlB;GACA,IAAAc;GACE,MAAAC;GACDd;GAEJgB,UAAAA;EACH,CAAA;EAAgBf,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAY;EAAAZ,EAAA,KAAAa;EAAAb,EAAA,KAAAe;EAAAf,EAAA,KAAAgB;CAAA,OAAAA,KAAAhB,EAAA;CARlB,MAAAI,QACEY;CAQA,IAAAC;CAAA,IAAAjB,EAAA,OAAAI,SAAAJ,EAAA,OAAAG,OAAAH,EAAA,OAAAW,yBAAA;EACKM,KAAAN,0BAA0B,oBAAA,OAAA;GAAS,IAAAR,IAAGC;GAASA,UAAAA;EAAY,CAAA,IAA3DA;EAAmEJ,EAAA,KAAAI;EAAAJ,EAAA,KAAAG;EAAAH,EAAA,KAAAW;EAAAX,EAAA,KAAAiB;CAAA,OAAAA,KAAAjB,EAAA;CAAA,OAAnEiB;AAAmE,CAC3E;AAEDvB,yBAAyBwB,cAAc"}
|
|
1
|
+
{"version":3,"file":"McpAddFormError.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","isValidElement","Primitive","useAddForm","McpAddFormPrimitiveError","Element","div","Props","props","ref","$","_c","state","ids","error","childId","asChild","children","id","undefined","customId","needsDescriptionWrapper","t0","t1","role","t2","t3","t4","displayName","_c"],"sources":["../../../src/primitives/addForm/McpAddFormError.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n isValidElement,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAddForm } from \"./context\";\n\nexport namespace McpAddFormPrimitiveError {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div>;\n}\n\nexport const McpAddFormPrimitiveError = forwardRef<\n McpAddFormPrimitiveError.Element,\n McpAddFormPrimitiveError.Props\n>((props, ref) => {\n const { state, ids } = useAddForm();\n if (!state.error) return null;\n const childId =\n props.asChild && isValidElement<{ id?: string }>(props.children)\n ? props.children.props.id\n : undefined;\n const customId = childId ?? props.id;\n const needsDescriptionWrapper =\n customId !== undefined && customId !== ids.error;\n const error = (\n <Primitive.div\n {...props}\n id={needsDescriptionWrapper ? props.id : ids.error}\n role={props.role ?? \"alert\"}\n ref={ref}\n >\n {props.children ?? state.error}\n </Primitive.div>\n );\n return needsDescriptionWrapper ? <div id={ids.error}>{error}</div> : error;\n});\n\nMcpAddFormPrimitiveError.displayName = \"McpAddFormPrimitive.Error\";\n"],"mappings":";;;;;;AAcA,MAAaM,2BAA2BJ,YAGtCQ,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CACA,MAAA,EAAAC,OAAAC,QAAuBV,WAAW;CAClC,IAAI,CAACS,MAAKE,OAAM,OAAS;CAKzB,MAAAM,YAHEZ,MAAKQ,WAAYf,eAAgCO,MAAKS,QAAS,IAC3DT,MAAKS,SAAST,MAAMU,KADxBC,KAAAA,MAG0BX,MAAKU;CACjC,MAAAG,0BACED,aAAaD,KAAAA,KAAaC,aAAaP,IAAGC;CAIpC,MAAAQ,KAAAD,0BAA0Bb,MAAKU,KAAML,IAAGC;CACtC,MAAAS,KAAAf,MAAKgB,QAAL;CAGL,MAAAC,KAAAjB,MAAKS,YAAaL,MAAKE;CAAM,IAAAY;CAAA,IAAAhB,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAY,MAAAZ,EAAA,OAAAa,MAAAb,EAAA,OAAAe,IAAA;EANhCC,KAAA,oBAAA,UAAA,KAAA;GAAA,GACMlB;GACA,IAAAc;GACE,MAAAC;GACDd;GAEJgB,UAAAA;EACH,CAAA;EAAgBf,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAY;EAAAZ,EAAA,KAAAa;EAAAb,EAAA,KAAAe;EAAAf,EAAA,KAAAgB;CAAA,OAAAA,KAAAhB,EAAA;CARlB,MAAAI,QACEY;CAQA,IAAAC;CAAA,IAAAjB,EAAA,OAAAI,SAAAJ,EAAA,OAAAG,OAAAH,EAAA,OAAAW,yBAAA;EACKM,KAAAN,0BAA0B,oBAAA,OAAA;GAAS,IAAAR,IAAGC;GAASA,UAAAA;EAAY,CAAA,IAA3DA;EAAmEJ,EAAA,KAAAI;EAAAJ,EAAA,KAAAG;EAAAH,EAAA,KAAAW;EAAAX,EAAA,KAAAiB;CAAA,OAAAA,KAAAjB,EAAA;CAAA,OAAnEiB;AAAmE,CAC3E;AAEDvB,yBAAyBwB,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpAddFormNameField.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAddForm","McpAddFormPrimitiveNameField","Element","input","Props","Omit","props","ref","$","_c","state","ids","setField","t0","errorField","undefined","t1","error","filter","Boolean","join","t2","e","target","value","t3","name","displayName"],"sources":["../../../src/primitives/addForm/McpAddFormNameField.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 McpAddFormPrimitiveNameField {\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 McpAddFormPrimitiveNameField = forwardRef<\n McpAddFormPrimitiveNameField.Element,\n McpAddFormPrimitiveNameField.Props\n>((props, ref) => {\n const { state, ids, setField } = useAddForm();\n return (\n <Primitive.input\n type=\"text\"\n placeholder=\"Name\"\n {...props}\n aria-invalid={\n props[\"aria-invalid\"] ??\n (state.errorField === \"name\" ? true : undefined)\n }\n aria-describedby={\n [\n props[\"aria-describedby\"],\n state.errorField === \"name\" ? ids.error : null,\n ]\n .filter(Boolean)\n .join(\" \") || undefined\n }\n ref={ref}\n value={state.name}\n onChange={(e) => setField(\"name\", e.target.value)}\n />\n );\n});\n\nMcpAddFormPrimitiveNameField.displayName = \"McpAddFormPrimitive.NameField\";\n"],"mappings":";;;;;;AAgBA,MAAaK,+BAA+BH,YAG1CQ,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CACA,MAAA,EAAAC,OAAAC,KAAAC,aAAiCZ,WAAW;CAOtC,MAAAa,KAAAP,MAAM,oBACLI,MAAKI,eAAgB,SAArB,OAAAC,KAAAA;CAA+C,IAAAC;CAAA,IAAAR,EAAA,OAAAG,OAAAH,EAAA,OAAAF,SAAAE,EAAA,OAAAE,MAAAI,YAAA;EAGhDE,KAAA,CACEV,MAAM,qBACNI,MAAKI,eAAgB,SAASH,IAAGM,QAAjC,IAA8C,CAC/C,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,QAAQU,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,QAAAlB,EAAA,OAAAK,MAAAL,EAAA,QAAAQ,MAAAR,EAAA,QAAAa,IAAA;EAlBnDI,KAAA,oBAAA,UAAA,OAAA;GACO,MAAA;GACO,aAAA;GAAM,GACdnB;GAEF,gBAAAO;GAIA,oBAAAG;GAOGT;GACE,OAAAG,MAAKgB;GACF,UAAAL;EAAuC,CAAA;EACjDb,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,OAnBFiB;AAmBE,CAEL;AAEDxB,6BAA6B0B,cAAc"}
|
|
1
|
+
{"version":3,"file":"McpAddFormNameField.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAddForm","McpAddFormPrimitiveNameField","Element","input","Props","Omit","props","ref","$","_c","state","ids","setField","t0","errorField","undefined","t1","error","filter","Boolean","join","t2","e","target","value","t3","name","displayName","_c"],"sources":["../../../src/primitives/addForm/McpAddFormNameField.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 McpAddFormPrimitiveNameField {\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 McpAddFormPrimitiveNameField = forwardRef<\n McpAddFormPrimitiveNameField.Element,\n McpAddFormPrimitiveNameField.Props\n>((props, ref) => {\n const { state, ids, setField } = useAddForm();\n return (\n <Primitive.input\n type=\"text\"\n placeholder=\"Name\"\n {...props}\n aria-invalid={\n props[\"aria-invalid\"] ??\n (state.errorField === \"name\" ? true : undefined)\n }\n aria-describedby={\n [\n props[\"aria-describedby\"],\n state.errorField === \"name\" ? ids.error : null,\n ]\n .filter(Boolean)\n .join(\" \") || undefined\n }\n ref={ref}\n value={state.name}\n onChange={(e) => setField(\"name\", e.target.value)}\n />\n );\n});\n\nMcpAddFormPrimitiveNameField.displayName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CAAA,OAAAA,KAAAjB,EAAA;CAAA,OAnBFiB;AAmBE,CAEL;AAEDxB,6BAA6B0B,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpAddFormScopesField.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAddForm","McpAddFormPrimitiveScopesField","Element","input","Props","Omit","props","ref","$","_c","state","setField","t0","e","target","value","t1","scopes","displayName"],"sources":["../../../src/primitives/addForm/McpAddFormScopesField.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 McpAddFormPrimitiveScopesField {\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 McpAddFormPrimitiveScopesField = forwardRef<\n McpAddFormPrimitiveScopesField.Element,\n McpAddFormPrimitiveScopesField.Props\n>((props, ref) => {\n const { state, setField } = useAddForm();\n return (\n <Primitive.input\n type=\"text\"\n placeholder=\"Scopes (space-separated, optional)\"\n {...props}\n ref={ref}\n value={state.scopes}\n onChange={(e) => setField(\"scopes\", e.target.value)}\n />\n );\n});\n\nMcpAddFormPrimitiveScopesField.displayName = \"McpAddFormPrimitive.ScopesField\";\n"],"mappings":";;;;;;AAgBA,MAAaK,iCAAiCH,YAG5CQ,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAA,EAAAC,OAAAC,aAA4BX,WAAW;CAAE,IAAAY;CAAA,IAAAJ,EAAA,OAAAG,UAAA;EAQ3BC,MAAAC,MAAOF,SAAS,UAAUE,EAACC,OAAOC,KAAM;EAACP,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,IAAAQ;CAAA,IAAAR,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAE,MAAAO,UAAAT,EAAA,OAAAI,IAAA;EANrDI,KAAA,oBAAA,UAAA,OAAA;GACO,MAAA;GACO,aAAA;GAAoC,GAC5CV;GACCC;GACE,OAAAG,MAAKO;GACF,UAAAL;EAAyC,CAAA;EACnDJ,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAE,MAAAO;EAAAT,EAAA,KAAAI;EAAAJ,EAAA,KAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,OAPFQ;AAOE,CAEL;AAEDf,+BAA+BiB,cAAc"}
|
|
1
|
+
{"version":3,"file":"McpAddFormScopesField.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAddForm","McpAddFormPrimitiveScopesField","Element","input","Props","Omit","props","ref","$","_c","state","setField","t0","e","target","value","t1","scopes","displayName","_c"],"sources":["../../../src/primitives/addForm/McpAddFormScopesField.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 McpAddFormPrimitiveScopesField {\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 McpAddFormPrimitiveScopesField = forwardRef<\n McpAddFormPrimitiveScopesField.Element,\n McpAddFormPrimitiveScopesField.Props\n>((props, ref) => {\n const { state, setField } = useAddForm();\n return (\n <Primitive.input\n type=\"text\"\n placeholder=\"Scopes (space-separated, optional)\"\n {...props}\n ref={ref}\n value={state.scopes}\n onChange={(e) => setField(\"scopes\", e.target.value)}\n />\n );\n});\n\nMcpAddFormPrimitiveScopesField.displayName = \"McpAddFormPrimitive.ScopesField\";\n"],"mappings":";;;;;;AAgBA,MAAaK,iCAAiCH,YAG5CQ,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAA,EAAAC,OAAAC,aAA4BX,WAAW;CAAE,IAAAY;CAAA,IAAAJ,EAAA,OAAAG,UAAA;EAQ3BC,MAAAC,MAAOF,SAAS,UAAUE,EAACC,OAAOC,KAAM;EAACP,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,IAAAQ;CAAA,IAAAR,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAE,MAAAO,UAAAT,EAAA,OAAAI,IAAA;EANrDI,KAAA,oBAAA,UAAA,OAAA;GACO,MAAA;GACO,aAAA;GAAoC,GAC5CV;GACCC;GACE,OAAAG,MAAKO;GACF,UAAAL;EAAyC,CAAA;EACnDJ,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAE,MAAAO;EAAAT,EAAA,KAAAI;EAAAJ,EAAA,KAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,OAPFQ;AAOE,CAEL;AAEDf,+BAA+BiB,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpAddFormSubmit.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAddForm","McpAddFormPrimitiveSubmit","Element","button","Props","props","ref","$","_c","state","t0","disabled","submitting","t1","undefined","t2","displayName"],"sources":["../../../src/primitives/addForm/McpAddFormSubmit.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 McpAddFormPrimitiveSubmit {\n export type Element = ComponentRef<typeof Primitive.button>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.button>;\n}\n\nexport const McpAddFormPrimitiveSubmit = forwardRef<\n McpAddFormPrimitiveSubmit.Element,\n McpAddFormPrimitiveSubmit.Props\n>((props, ref) => {\n const { state } = useAddForm();\n return (\n <Primitive.button\n type=\"submit\"\n {...props}\n ref={ref}\n disabled={props.disabled || state.submitting}\n data-submitting={state.submitting || undefined}\n />\n );\n});\n\nMcpAddFormPrimitiveSubmit.displayName = \"McpAddFormPrimitive.Submit\";\n"],"mappings":";;;;;;AAaA,MAAaK,4BAA4BH,YAGvCO,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAA,EAAAC,UAAkBT,WAAW;CAMf,MAAAU,KAAAL,MAAKM,YAAaF,MAAKG;CAChB,MAAAC,KAAAJ,MAAKG,cAALE,KAAAA;CAA6B,IAAAC;CAAA,IAAAR,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAG,MAAAH,EAAA,OAAAM,IAAA;EALhDE,KAAA,oBAAA,UAAA,QAAA;GACO,MAAA;GAAQ,GACTV;GACCC;GACK,UAAAI;GACO,mBAAAG;EAA6B,CAAA;EAC9CN,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAG;EAAAH,EAAA,KAAAM;EAAAN,EAAA,KAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,OANFQ;AAME,CAEL;AAEDd,0BAA0Be,cAAc"}
|
|
1
|
+
{"version":3,"file":"McpAddFormSubmit.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAddForm","McpAddFormPrimitiveSubmit","Element","button","Props","props","ref","$","_c","state","t0","disabled","submitting","t1","undefined","t2","displayName","_c"],"sources":["../../../src/primitives/addForm/McpAddFormSubmit.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 McpAddFormPrimitiveSubmit {\n export type Element = ComponentRef<typeof Primitive.button>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.button>;\n}\n\nexport const McpAddFormPrimitiveSubmit = forwardRef<\n McpAddFormPrimitiveSubmit.Element,\n McpAddFormPrimitiveSubmit.Props\n>((props, ref) => {\n const { state } = useAddForm();\n return (\n <Primitive.button\n type=\"submit\"\n {...props}\n ref={ref}\n disabled={props.disabled || state.submitting}\n data-submitting={state.submitting || undefined}\n />\n );\n});\n\nMcpAddFormPrimitiveSubmit.displayName = \"McpAddFormPrimitive.Submit\";\n"],"mappings":";;;;;;AAaA,MAAaK,4BAA4BH,YAGvCO,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAA,EAAAC,UAAkBT,WAAW;CAMf,MAAAU,KAAAL,MAAKM,YAAaF,MAAKG;CAChB,MAAAC,KAAAJ,MAAKG,cAALE,KAAAA;CAA6B,IAAAC;CAAA,IAAAR,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAG,MAAAH,EAAA,OAAAM,IAAA;EALhDE,KAAA,oBAAA,UAAA,QAAA;GACO,MAAA;GAAQ,GACTV;GACCC;GACK,UAAAI;GACO,mBAAAG;EAA6B,CAAA;EAC9CN,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAG;EAAAH,EAAA,KAAAM;EAAAN,EAAA,KAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,OANFQ;AAME,CAEL;AAEDd,0BAA0Be,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpAddFormUrlField.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAddForm","McpAddFormPrimitiveUrlField","Element","input","Props","Omit","props","ref","$","_c","state","ids","setField","t0","errorField","undefined","t1","error","filter","Boolean","join","t2","e","target","value","t3","url","displayName"],"sources":["../../../src/primitives/addForm/McpAddFormUrlField.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 McpAddFormPrimitiveUrlField {\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 McpAddFormPrimitiveUrlField = forwardRef<\n McpAddFormPrimitiveUrlField.Element,\n McpAddFormPrimitiveUrlField.Props\n>((props, ref) => {\n const { state, ids, setField } = useAddForm();\n return (\n <Primitive.input\n type=\"url\"\n inputMode=\"url\"\n placeholder=\"https://example.com/mcp\"\n {...props}\n aria-invalid={\n props[\"aria-invalid\"] ?? (state.errorField === \"url\" ? true : undefined)\n }\n aria-describedby={\n [\n props[\"aria-describedby\"],\n state.errorField === \"url\" ? ids.error : null,\n ]\n .filter(Boolean)\n .join(\" \") || undefined\n }\n ref={ref}\n value={state.url}\n onChange={(e) => setField(\"url\", e.target.value)}\n />\n );\n});\n\nMcpAddFormPrimitiveUrlField.displayName = \"McpAddFormPrimitive.UrlField\";\n"],"mappings":";;;;;;AAgBA,MAAaK,8BAA8BH,YAGzCQ,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CACA,MAAA,EAAAC,OAAAC,KAAAC,aAAiCZ,WAAW;CAQtC,MAAAa,KAAAP,MAAM,oBAAoBI,MAAKI,eAAgB,QAArB,OAAAC,KAAAA;CAA8C,IAAAC;CAAA,IAAAR,EAAA,OAAAG,OAAAH,EAAA,OAAAF,SAAAE,EAAA,OAAAE,MAAAI,YAAA;EAGxEE,KAAA,CACEV,MAAM,qBACNI,MAAKI,eAAgB,QAAQH,IAAGM,QAAhC,IAA6C,CAC9C,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,OAAOU,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,OAAAlB,EAAA,OAAAK,MAAAL,EAAA,QAAAQ,MAAAR,EAAA,QAAAa,IAAA;EAlBlDI,KAAA,oBAAA,UAAA,OAAA;GACO,MAAA;GACK,WAAA;GACE,aAAA;GAAyB,GACjCnB;GAEF,gBAAAO;GAGA,oBAAAG;GAOGT;GACE,OAAAG,MAAKgB;GACF,UAAAL;EAAsC,CAAA;EAChDb,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,OAnBFiB;AAmBE,CAEL;AAEDxB,4BAA4B0B,cAAc"}
|
|
1
|
+
{"version":3,"file":"McpAddFormUrlField.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAddForm","McpAddFormPrimitiveUrlField","Element","input","Props","Omit","props","ref","$","_c","state","ids","setField","t0","errorField","undefined","t1","error","filter","Boolean","join","t2","e","target","value","t3","url","displayName","_c"],"sources":["../../../src/primitives/addForm/McpAddFormUrlField.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 McpAddFormPrimitiveUrlField {\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 McpAddFormPrimitiveUrlField = forwardRef<\n McpAddFormPrimitiveUrlField.Element,\n McpAddFormPrimitiveUrlField.Props\n>((props, ref) => {\n const { state, ids, setField } = useAddForm();\n return (\n <Primitive.input\n type=\"url\"\n inputMode=\"url\"\n placeholder=\"https://example.com/mcp\"\n {...props}\n aria-invalid={\n props[\"aria-invalid\"] ?? (state.errorField === \"url\" ? true : undefined)\n }\n aria-describedby={\n [\n props[\"aria-describedby\"],\n state.errorField === \"url\" ? ids.error : null,\n ]\n .filter(Boolean)\n .join(\" \") || undefined\n }\n ref={ref}\n value={state.url}\n onChange={(e) => setField(\"url\", e.target.value)}\n />\n );\n});\n\nMcpAddFormPrimitiveUrlField.displayName = \"McpAddFormPrimitive.UrlField\";\n"],"mappings":";;;;;;AAgBA,MAAaK,8BAA8BH,YAGzCQ,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CACA,MAAA,EAAAC,OAAAC,KAAAC,aAAiCZ,WAAW;CAQtC,MAAAa,KAAAP,MAAM,oBAAoBI,MAAKI,eAAgB,QAArB,OAAAC,KAAAA;CAA8C,IAAAC;CAAA,IAAAR,EAAA,OAAAG,OAAAH,EAAA,OAAAF,SAAAE,EAAA,OAAAE,MAAAI,YAAA;EAGxEE,KAAA,CACEV,MAAM,qBACNI,MAAKI,eAAgB,QAAQH,IAAGM,QAAhC,IAA6C,CAC9C,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,OAAOU,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,OAAAlB,EAAA,OAAAK,MAAAL,EAAA,QAAAQ,MAAAR,EAAA,QAAAa,IAAA;EAlBlDI,KAAA,oBAAA,UAAA,OAAA;GACO,MAAA;GACK,WAAA;GACE,aAAA;GAAyB,GACjCnB;GAEF,gBAAAO;GAGA,oBAAAG;GAOGT;GACE,OAAAG,MAAKgB;GACF,UAAAL;EAAsC,CAAA;EAChDb,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,OAnBFiB;AAmBE,CAEL;AAEDxB,4BAA4B0B,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpElicitationPrimitiveAccept.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAui","useElicitationContext","prepareElicitationContent","McpElicitationPrimitiveAccept","Element","button","Props","props","ref","$","_c","elicitation","draft","aui","T0","content","hasInvalid","hasMissingRequired","t0","t1","t2","t3","t4","t5","requestedSchema","t6","missingRequired","invalid","length","disabled","undefined","join","id","event","onClick","defaultPrevented","mcpServer","answerElicitation","action","t7","displayName"],"sources":["../../../src/primitives/elicitation/McpElicitationPrimitiveAccept.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAui } from \"@assistant-ui/store\";\nimport { useElicitationContext } from \"./context\";\nimport { prepareElicitationContent } from \"./prepareElicitationContent\";\n\nexport namespace McpElicitationPrimitiveAccept {\n export type Element = ComponentRef<typeof Primitive.button>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.button>;\n}\n\nexport const McpElicitationPrimitiveAccept = forwardRef<\n McpElicitationPrimitiveAccept.Element,\n McpElicitationPrimitiveAccept.Props\n>((props, ref) => {\n const { elicitation, draft } = useElicitationContext();\n const aui = useAui();\n const { content, missingRequired, invalid } = prepareElicitationContent(\n elicitation.requestedSchema,\n draft,\n );\n const hasMissingRequired = missingRequired.length > 0;\n const hasInvalid = invalid.length > 0;\n return (\n <Primitive.button\n {...props}\n type=\"button\"\n ref={ref}\n disabled={props.disabled || hasMissingRequired || hasInvalid}\n data-missing-required={hasMissingRequired ? \"\" : undefined}\n data-invalid={hasInvalid ? invalid.join(\",\") : undefined}\n onClick={(event) => {\n props.onClick?.(event);\n if (event.defaultPrevented || hasMissingRequired || hasInvalid) return;\n aui.mcpServer.answerElicitation(elicitation.id, {\n action: \"accept\",\n content,\n });\n }}\n />\n );\n});\n\nMcpElicitationPrimitiveAccept.displayName = \"McpElicitationPrimitive.Accept\";\n"],"mappings":";;;;;;;;AAeA,MAAaO,gCAAgCL,YAG3CS,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CACA,MAAA,EAAAC,aAAAC,UAA+BX,sBAAsB;CACrD,MAAAY,MAAYb,OAAO;CAAE,IAAAc;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAd,EAAA,OAAAG,SAAAH,EAAA,OAAAE,YAAAa,mBAAAf,EAAA,OAAAF,SAAAE,EAAA,OAAAD,KAAA;EACrB,MAAA,EAAAO,SAAAU,IAAAC,iBAAAC,YAA8CzB,0BAC5CS,YAAWa,iBACXZ,KACF;EAHAG,UAAAU;EAIAR,qBAA2BS,gBAAeE,SAAU;EACpDZ,aAAmBW,QAAOC,SAAU;EAEjCd,KAAAf,UAASM;EACJE,KAAAA;EACCY,KAAA;EACAX,KAAAA;EACKa,KAAAd,MAAKsB,YAALZ,sBAAAD;EACaM,KAAAL,qBAAA,KAAAa,KAAAA;EACTP,KAAAP,aAAaW,QAAOI,KAAM,GAAe,IAAzCD,KAAA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,EAAA,QAAAgB,IAAA;EAdHc,KAAA,oBAAC,IAAD;GAAiB,GACXhC;GACC,MAAAY;GACAX,KAAAA;GACK,UAAAa;GACa,yBAAAC;GACT,gBAAAC;GACL,SAAAE;EAOR,CAAA;EACDhB,EAAA,MAAAK;EAAAL,EAAA,MAAAS;EAAAT,EAAA,MAAAU;EAAAV,EAAA,MAAAW;EAAAX,EAAA,MAAAY;EAAAZ,EAAA,MAAAa;EAAAb,EAAA,MAAAc;EAAAd,EAAA,MAAAgB;EAAAhB,EAAA,MAAA8B;CAAA,OAAAA,KAAA9B,EAAA;CAAA,OAfF8B;AAeE,CAEL;AAEDpC,8BAA8BqC,cAAc"}
|
|
1
|
+
{"version":3,"file":"McpElicitationPrimitiveAccept.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAui","useElicitationContext","prepareElicitationContent","McpElicitationPrimitiveAccept","Element","button","Props","props","ref","$","_c","elicitation","draft","aui","T0","content","hasInvalid","hasMissingRequired","t0","t1","t2","t3","t4","t5","requestedSchema","t6","missingRequired","invalid","length","disabled","undefined","join","id","event","onClick","defaultPrevented","mcpServer","answerElicitation","action","t7","displayName","_c"],"sources":["../../../src/primitives/elicitation/McpElicitationPrimitiveAccept.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAui } from \"@assistant-ui/store\";\nimport { useElicitationContext } from \"./context\";\nimport { prepareElicitationContent } from \"./prepareElicitationContent\";\n\nexport namespace McpElicitationPrimitiveAccept {\n export type Element = ComponentRef<typeof Primitive.button>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.button>;\n}\n\nexport const McpElicitationPrimitiveAccept = forwardRef<\n McpElicitationPrimitiveAccept.Element,\n McpElicitationPrimitiveAccept.Props\n>((props, ref) => {\n const { elicitation, draft } = useElicitationContext();\n const aui = useAui();\n const { content, missingRequired, invalid } = prepareElicitationContent(\n elicitation.requestedSchema,\n draft,\n );\n const hasMissingRequired = missingRequired.length > 0;\n const hasInvalid = invalid.length > 0;\n return (\n <Primitive.button\n {...props}\n type=\"button\"\n ref={ref}\n disabled={props.disabled || hasMissingRequired || hasInvalid}\n data-missing-required={hasMissingRequired ? \"\" : undefined}\n data-invalid={hasInvalid ? invalid.join(\",\") : undefined}\n onClick={(event) => {\n props.onClick?.(event);\n if (event.defaultPrevented || hasMissingRequired || hasInvalid) return;\n aui.mcpServer.answerElicitation(elicitation.id, {\n action: \"accept\",\n content,\n });\n }}\n />\n );\n});\n\nMcpElicitationPrimitiveAccept.displayName = \"McpElicitationPrimitive.Accept\";\n"],"mappings":";;;;;;;;AAeA,MAAaO,gCAAgCL,YAG3CS,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CACA,MAAA,EAAAC,aAAAC,UAA+BX,sBAAsB;CACrD,MAAAY,MAAYb,OAAO;CAAE,IAAAc;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAd,EAAA,OAAAG,SAAAH,EAAA,OAAAE,YAAAa,mBAAAf,EAAA,OAAAF,SAAAE,EAAA,OAAAD,KAAA;EACrB,MAAA,EAAAO,SAAAU,IAAAC,iBAAAC,YAA8CzB,0BAC5CS,YAAWa,iBACXZ,KACF;EAHAG,UAAAU;EAIAR,qBAA2BS,gBAAeE,SAAU;EACpDZ,aAAmBW,QAAOC,SAAU;EAEjCd,KAAAf,UAASM;EACJE,KAAAA;EACCY,KAAA;EACAX,KAAAA;EACKa,KAAAd,MAAKsB,YAALZ,sBAAAD;EACaM,KAAAL,qBAAA,KAAAa,KAAAA;EACTP,KAAAP,aAAaW,QAAOI,KAAM,GAAe,IAAzCD,KAAAA;EAA0CrB,EAAA,KAAAG;EAAAH,EAAA,KAAAE,YAAAa;EAAAf,EAAA,KAAAF;EAAAE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,KAAAA;GACK,UAAAa;GACa,yBAAAC;GACT,gBAAAC;GACL,SAAAE;EAOR,CAAA;EACDhB,EAAA,MAAAK;EAAAL,EAAA,MAAAS;EAAAT,EAAA,MAAAU;EAAAV,EAAA,MAAAW;EAAAX,EAAA,MAAAY;EAAAZ,EAAA,MAAAa;EAAAb,EAAA,MAAAc;EAAAd,EAAA,MAAAgB;EAAAhB,EAAA,MAAA8B;CAAA,OAAAA,KAAA9B,EAAA;CAAA,OAfF8B;AAeE,CAEL;AAEDpC,8BAA8BqC,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpElicitationPrimitiveCancel.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAui","useMcpElicitation","McpElicitationPrimitiveCancel","Element","button","Props","props","ref","$","_c","elicitation","aui","t0","event","onClick","defaultPrevented","mcpServer","answerElicitation","id","action","t1","displayName"],"sources":["../../../src/primitives/elicitation/McpElicitationPrimitiveCancel.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAui } from \"@assistant-ui/store\";\nimport { useMcpElicitation } from \"./context\";\n\nexport namespace McpElicitationPrimitiveCancel {\n export type Element = ComponentRef<typeof Primitive.button>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.button>;\n}\n\nexport const McpElicitationPrimitiveCancel = forwardRef<\n McpElicitationPrimitiveCancel.Element,\n McpElicitationPrimitiveCancel.Props\n>((props, ref) => {\n const elicitation = useMcpElicitation();\n const aui = useAui();\n return (\n <Primitive.button\n {...props}\n type=\"button\"\n ref={ref}\n onClick={(event) => {\n props.onClick?.(event);\n if (event.defaultPrevented) return;\n aui.mcpServer.answerElicitation(elicitation.id, {\n action: \"cancel\",\n });\n }}\n />\n );\n});\n\nMcpElicitationPrimitiveCancel.displayName = \"McpElicitationPrimitive.Cancel\";\n"],"mappings":";;;;;;;AAcA,MAAaM,gCAAgCJ,YAG3CQ,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAAC,cAAoBT,kBAAkB;CACtC,MAAAU,MAAYX,OAAO;CAAE,IAAAY;CAAA,IAAAJ,EAAA,OAAAG,OAAAH,EAAA,OAAAE,eAAAF,EAAA,OAAAF,OAAA;EAMRM,MAAAC,UAAA;GACPP,MAAKQ,UAAWD,KAAK;GACrB,IAAIA,MAAKE,kBAAiB;GAC1BJ,IAAGK,UAAUC,kBAAmBP,YAAWQ,IAAK,EAAAC,QACtC,SACV,CAAC;EAAC;EACHX,EAAA,KAAAG;EAAAH,EAAA,KAAAE;EAAAF,EAAA,KAAAF;EAAAE,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,IAAAY;CAAA,IAAAZ,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAI,IAAA;EAVHQ,KAAA,oBAAA,UAAA,QAAA;GAAA,GACMd;GACC,MAAA;GACAC;GACI,SAAAK;EAMR,CAAA;EACDJ,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAI;EAAAJ,EAAA,KAAAY;CAAA,OAAAA,KAAAZ,EAAA;CAAA,OAXFY;AAWE,CAEL;AAEDlB,8BAA8BmB,cAAc"}
|
|
1
|
+
{"version":3,"file":"McpElicitationPrimitiveCancel.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAui","useMcpElicitation","McpElicitationPrimitiveCancel","Element","button","Props","props","ref","$","_c","elicitation","aui","t0","event","onClick","defaultPrevented","mcpServer","answerElicitation","id","action","t1","displayName","_c"],"sources":["../../../src/primitives/elicitation/McpElicitationPrimitiveCancel.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAui } from \"@assistant-ui/store\";\nimport { useMcpElicitation } from \"./context\";\n\nexport namespace McpElicitationPrimitiveCancel {\n export type Element = ComponentRef<typeof Primitive.button>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.button>;\n}\n\nexport const McpElicitationPrimitiveCancel = forwardRef<\n McpElicitationPrimitiveCancel.Element,\n McpElicitationPrimitiveCancel.Props\n>((props, ref) => {\n const elicitation = useMcpElicitation();\n const aui = useAui();\n return (\n <Primitive.button\n {...props}\n type=\"button\"\n ref={ref}\n onClick={(event) => {\n props.onClick?.(event);\n if (event.defaultPrevented) return;\n aui.mcpServer.answerElicitation(elicitation.id, {\n action: \"cancel\",\n });\n }}\n />\n );\n});\n\nMcpElicitationPrimitiveCancel.displayName = \"McpElicitationPrimitive.Cancel\";\n"],"mappings":";;;;;;;AAcA,MAAaM,gCAAgCJ,YAG3CQ,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAAC,cAAoBT,kBAAkB;CACtC,MAAAU,MAAYX,OAAO;CAAE,IAAAY;CAAA,IAAAJ,EAAA,OAAAG,OAAAH,EAAA,OAAAE,eAAAF,EAAA,OAAAF,OAAA;EAMRM,MAAAC,UAAA;GACPP,MAAKQ,UAAWD,KAAK;GACrB,IAAIA,MAAKE,kBAAiB;GAC1BJ,IAAGK,UAAUC,kBAAmBP,YAAWQ,IAAK,EAAAC,QACtC,SACV,CAAC;EAAC;EACHX,EAAA,KAAAG;EAAAH,EAAA,KAAAE;EAAAF,EAAA,KAAAF;EAAAE,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,IAAAY;CAAA,IAAAZ,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAI,IAAA;EAVHQ,KAAA,oBAAA,UAAA,QAAA;GAAA,GACMd;GACC,MAAA;GACAC;GACI,SAAAK;EAMR,CAAA;EACDJ,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAI;EAAAJ,EAAA,KAAAY;CAAA,OAAAA,KAAAZ,EAAA;CAAA,OAXFY;AAWE,CAEL;AAEDlB,8BAA8BmB,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpElicitationPrimitiveDecline.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAui","useMcpElicitation","McpElicitationPrimitiveDecline","Element","button","Props","props","ref","$","_c","elicitation","aui","t0","event","onClick","defaultPrevented","mcpServer","answerElicitation","id","action","t1","displayName"],"sources":["../../../src/primitives/elicitation/McpElicitationPrimitiveDecline.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAui } from \"@assistant-ui/store\";\nimport { useMcpElicitation } from \"./context\";\n\nexport namespace McpElicitationPrimitiveDecline {\n export type Element = ComponentRef<typeof Primitive.button>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.button>;\n}\n\nexport const McpElicitationPrimitiveDecline = forwardRef<\n McpElicitationPrimitiveDecline.Element,\n McpElicitationPrimitiveDecline.Props\n>((props, ref) => {\n const elicitation = useMcpElicitation();\n const aui = useAui();\n return (\n <Primitive.button\n {...props}\n type=\"button\"\n ref={ref}\n onClick={(event) => {\n props.onClick?.(event);\n if (event.defaultPrevented) return;\n aui.mcpServer.answerElicitation(elicitation.id, {\n action: \"decline\",\n });\n }}\n />\n );\n});\n\nMcpElicitationPrimitiveDecline.displayName = \"McpElicitationPrimitive.Decline\";\n"],"mappings":";;;;;;;AAcA,MAAaM,iCAAiCJ,YAG5CQ,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAAC,cAAoBT,kBAAkB;CACtC,MAAAU,MAAYX,OAAO;CAAE,IAAAY;CAAA,IAAAJ,EAAA,OAAAG,OAAAH,EAAA,OAAAE,eAAAF,EAAA,OAAAF,OAAA;EAMRM,MAAAC,UAAA;GACPP,MAAKQ,UAAWD,KAAK;GACrB,IAAIA,MAAKE,kBAAiB;GAC1BJ,IAAGK,UAAUC,kBAAmBP,YAAWQ,IAAK,EAAAC,QACtC,UACV,CAAC;EAAC;EACHX,EAAA,KAAAG;EAAAH,EAAA,KAAAE;EAAAF,EAAA,KAAAF;EAAAE,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,IAAAY;CAAA,IAAAZ,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAI,IAAA;EAVHQ,KAAA,oBAAA,UAAA,QAAA;GAAA,GACMd;GACC,MAAA;GACAC;GACI,SAAAK;EAMR,CAAA;EACDJ,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAI;EAAAJ,EAAA,KAAAY;CAAA,OAAAA,KAAAZ,EAAA;CAAA,OAXFY;AAWE,CAEL;AAEDlB,+BAA+BmB,cAAc"}
|
|
1
|
+
{"version":3,"file":"McpElicitationPrimitiveDecline.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAui","useMcpElicitation","McpElicitationPrimitiveDecline","Element","button","Props","props","ref","$","_c","elicitation","aui","t0","event","onClick","defaultPrevented","mcpServer","answerElicitation","id","action","t1","displayName","_c"],"sources":["../../../src/primitives/elicitation/McpElicitationPrimitiveDecline.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAui } from \"@assistant-ui/store\";\nimport { useMcpElicitation } from \"./context\";\n\nexport namespace McpElicitationPrimitiveDecline {\n export type Element = ComponentRef<typeof Primitive.button>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.button>;\n}\n\nexport const McpElicitationPrimitiveDecline = forwardRef<\n McpElicitationPrimitiveDecline.Element,\n McpElicitationPrimitiveDecline.Props\n>((props, ref) => {\n const elicitation = useMcpElicitation();\n const aui = useAui();\n return (\n <Primitive.button\n {...props}\n type=\"button\"\n ref={ref}\n onClick={(event) => {\n props.onClick?.(event);\n if (event.defaultPrevented) return;\n aui.mcpServer.answerElicitation(elicitation.id, {\n action: \"decline\",\n });\n }}\n />\n );\n});\n\nMcpElicitationPrimitiveDecline.displayName = \"McpElicitationPrimitive.Decline\";\n"],"mappings":";;;;;;;AAcA,MAAaM,iCAAiCJ,YAG5CQ,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAAC,cAAoBT,kBAAkB;CACtC,MAAAU,MAAYX,OAAO;CAAE,IAAAY;CAAA,IAAAJ,EAAA,OAAAG,OAAAH,EAAA,OAAAE,eAAAF,EAAA,OAAAF,OAAA;EAMRM,MAAAC,UAAA;GACPP,MAAKQ,UAAWD,KAAK;GACrB,IAAIA,MAAKE,kBAAiB;GAC1BJ,IAAGK,UAAUC,kBAAmBP,YAAWQ,IAAK,EAAAC,QACtC,UACV,CAAC;EAAC;EACHX,EAAA,KAAAG;EAAAH,EAAA,KAAAE;EAAAF,EAAA,KAAAF;EAAAE,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,IAAAY;CAAA,IAAAZ,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAI,IAAA;EAVHQ,KAAA,oBAAA,UAAA,QAAA;GAAA,GACMd;GACC,MAAA;GACAC;GACI,SAAAK;EAMR,CAAA;EACDJ,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAI;EAAAJ,EAAA,KAAAY;CAAA,OAAAA,KAAAZ,EAAA;CAAA,OAXFY;AAWE,CAEL;AAEDlB,+BAA+BmB,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpElicitationPrimitiveError.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useMcpElicitation","McpElicitationPrimitiveError","Element","div","Props","props","ref","$","_c","error","t0","properties","join","t1","children","message","t2","displayName"],"sources":["../../../src/primitives/elicitation/McpElicitationPrimitiveError.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useMcpElicitation } from \"./context\";\n\nexport namespace McpElicitationPrimitiveError {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div>;\n}\n\nexport const McpElicitationPrimitiveError = forwardRef<\n McpElicitationPrimitiveError.Element,\n McpElicitationPrimitiveError.Props\n>((props, ref) => {\n const error = useMcpElicitation().error;\n if (!error) return null;\n return (\n <Primitive.div\n {...props}\n ref={ref}\n data-properties={error.properties?.join(\",\")}\n >\n {props.children ?? error.message}\n </Primitive.div>\n );\n});\n\nMcpElicitationPrimitiveError.displayName = \"McpElicitationPrimitive.Error\";\n"],"mappings":";;;;;;AAaA,MAAaK,+BAA+BH,YAG1CO,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAAC,QAAcT,kBAAkB,CAAC,CAAAS;CACjC,IAAI,CAACA,OAAK,OAAS;CAAK,IAAAC;CAAA,IAAAH,EAAA,OAAAE,MAAAE,YAAA;EAKHD,KAAAD,MAAKE,YAAiBC,KAAC,GAAG;EAACL,EAAA,KAAAE,MAAAE;EAAAJ,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAE3C,MAAAM,KAAAR,MAAKS,YAAaL,MAAKM;CAAQ,IAAAC;CAAA,IAAAT,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAG,MAAAH,EAAA,OAAAM,IAAA;EALlCG,KAAA,oBAAA,UAAA,KAAA;GAAA,GACMX;GACCC;GACY,mBAAAI;GAEhBG,UAAAA;EACH,CAAA;EAAgBN,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAG;EAAAH,EAAA,KAAAM;EAAAN,EAAA,KAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAA,OANhBS;AAMgB,CAEnB;AAEDf,6BAA6BgB,cAAc"}
|
|
1
|
+
{"version":3,"file":"McpElicitationPrimitiveError.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useMcpElicitation","McpElicitationPrimitiveError","Element","div","Props","props","ref","$","_c","error","t0","properties","join","t1","children","message","t2","displayName","_c"],"sources":["../../../src/primitives/elicitation/McpElicitationPrimitiveError.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useMcpElicitation } from \"./context\";\n\nexport namespace McpElicitationPrimitiveError {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div>;\n}\n\nexport const McpElicitationPrimitiveError = forwardRef<\n McpElicitationPrimitiveError.Element,\n McpElicitationPrimitiveError.Props\n>((props, ref) => {\n const error = useMcpElicitation().error;\n if (!error) return null;\n return (\n <Primitive.div\n {...props}\n ref={ref}\n data-properties={error.properties?.join(\",\")}\n >\n {props.children ?? error.message}\n </Primitive.div>\n );\n});\n\nMcpElicitationPrimitiveError.displayName = \"McpElicitationPrimitive.Error\";\n"],"mappings":";;;;;;AAaA,MAAaK,+BAA+BH,YAG1CO,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAAC,QAAcT,kBAAkB,CAAC,CAAAS;CACjC,IAAI,CAACA,OAAK,OAAS;CAAK,IAAAC;CAAA,IAAAH,EAAA,OAAAE,MAAAE,YAAA;EAKHD,KAAAD,MAAKE,YAAiBC,KAAC,GAAG;EAACL,EAAA,KAAAE,MAAAE;EAAAJ,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAE3C,MAAAM,KAAAR,MAAKS,YAAaL,MAAKM;CAAQ,IAAAC;CAAA,IAAAT,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAG,MAAAH,EAAA,OAAAM,IAAA;EALlCG,KAAA,oBAAA,UAAA,KAAA;GAAA,GACMX;GACCC;GACY,mBAAAI;GAEhBG,UAAAA;EACH,CAAA;EAAgBN,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAG;EAAAH,EAAA,KAAAM;EAAAN,EAAA,KAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAA,OANhBS;AAMgB,CAEnB;AAEDf,6BAA6BgB,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpElicitationPrimitiveFields.js","names":["FC","ReactNode","ElicitationFieldContext","ElicitationFieldContextValue","useElicitationContext","useMcpElicitationField","McpElicitationPrimitiveFields","Props","children","field","t0","$","_c","elicitation","draft","setField","properties","requestedSchema","Record","Array","isArray","t1","t2","Symbol","for","bb0","fields","Object","entries","length","map","t3","name","schema","value","hasOwn","undefined","setValue","displayName"],"sources":["../../../src/primitives/elicitation/McpElicitationPrimitiveFields.tsx"],"sourcesContent":["import { type FC, type ReactNode } from \"react\";\nimport {\n ElicitationFieldContext,\n type ElicitationFieldContextValue,\n useElicitationContext,\n} from \"./context\";\n\nexport { useMcpElicitationField } from \"./context\";\n\nexport namespace McpElicitationPrimitiveFields {\n export type Props = {\n children: (field: ElicitationFieldContextValue) => ReactNode;\n };\n}\n\nexport const McpElicitationPrimitiveFields: FC<\n McpElicitationPrimitiveFields.Props\n> = ({ children }) => {\n const { elicitation, draft, setField } = useElicitationContext();\n const properties = (\n elicitation.requestedSchema as {\n properties?: Record<string, unknown> | undefined;\n } | null\n )?.properties;\n\n if (\n properties === null ||\n typeof properties !== \"object\" ||\n Array.isArray(properties)\n ) {\n return null;\n }\n\n const fields = Object.entries(properties);\n if (fields.length === 0) return null;\n\n return (\n <>\n {fields.map(([name, schema]) => {\n const field = {\n name,\n schema,\n value: Object.hasOwn(draft, name) ? draft[name] : undefined,\n setValue: (value: unknown) => setField(name, value),\n };\n return (\n <ElicitationFieldContext.Provider key={name} value={field}>\n {children(field)}\n </ElicitationFieldContext.Provider>\n );\n })}\n </>\n );\n};\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cG;AAIPf,8BAA8BgC,cAAc"}
|
|
1
|
+
{"version":3,"file":"McpElicitationPrimitiveFields.js","names":["FC","ReactNode","ElicitationFieldContext","ElicitationFieldContextValue","useElicitationContext","useMcpElicitationField","McpElicitationPrimitiveFields","Props","children","field","t0","$","_c","elicitation","draft","setField","properties","requestedSchema","Record","Array","isArray","t1","t2","Symbol","for","bb0","fields","Object","entries","length","map","t3","name","schema","value","hasOwn","undefined","setValue","displayName","_c"],"sources":["../../../src/primitives/elicitation/McpElicitationPrimitiveFields.tsx"],"sourcesContent":["import { type FC, type ReactNode } from \"react\";\nimport {\n ElicitationFieldContext,\n type ElicitationFieldContextValue,\n useElicitationContext,\n} from \"./context\";\n\nexport { useMcpElicitationField } from \"./context\";\n\nexport namespace McpElicitationPrimitiveFields {\n export type Props = {\n children: (field: ElicitationFieldContextValue) => ReactNode;\n };\n}\n\nexport const McpElicitationPrimitiveFields: FC<\n McpElicitationPrimitiveFields.Props\n> = ({ children }) => {\n const { elicitation, draft, setField } = useElicitationContext();\n const properties = (\n elicitation.requestedSchema as {\n properties?: Record<string, unknown> | undefined;\n } | null\n )?.properties;\n\n if (\n properties === null ||\n typeof properties !== \"object\" ||\n Array.isArray(properties)\n ) {\n return null;\n }\n\n const fields = Object.entries(properties);\n if (fields.length === 0) return null;\n\n return (\n <>\n {fields.map(([name, schema]) => {\n const field = {\n name,\n schema,\n value: Object.hasOwn(draft, name) ? draft[name] : undefined,\n setValue: (value: unknown) => setField(name, value),\n };\n return (\n <ElicitationFieldContext.Provider key={name} value={field}>\n {children(field)}\n </ElicitationFieldContext.Provider>\n );\n })}\n </>\n );\n};\n\nMcpElicitationPrimitiveFields.displayName = \"McpElicitationPrimitive.Fields\";\n"],"mappings":";;;;;AAeA,MAAaM,iCAETI,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAC,MAAA,EAAAJ,aAAAE;CACH,MAAA,EAAAG,aAAAC,OAAAC,aAAyCX,sBAAsB;CAC/D,MAAAY,aACEH,YAAWI,iBAGAD;CAEb,IACEA,eAAe,QACf,OAAOA,eAAe,YACtBG,MAAKC,QAASJ,UAAU,GAAC,OAElB;CACR,IAAAK;CAAA,IAAAC;CAAA,IAAAX,EAAA,OAAAH,YAAAG,EAAA,OAAAG,SAAAH,EAAA,OAAAK,cAAAL,EAAA,OAAAI,UAAA;EAG+BO,KAAAC,OAAIC,IAAJ,6BAAG;EAACC,KAAA;GADpC,MAAAC,SAAeC,OAAMC,QAASZ,UAAU;GACxC,IAAIU,OAAMG,WAAY,GAAC;IAASP,KAAA;IAAA,MAAAG;GAAI;GAGlCJ,KAAA,oBAAA,UAAA,EAAA,UACGK,OAAMI,KAAKC,OAAA;IAAC,MAAA,CAAAC,MAAAC,UAAAF;IACX,MAAAtB,QAAc;KAAAuB;KAAAC;KAAAC,OAGLP,OAAMQ,OAAQrB,OAAOkB,IAA8B,IAAtBlB,MAAMkB,QAAnCI,KAAAA;KAAoDC,WACjDH,UAAoBnB,SAASiB,MAAME,KAAK;IACpD;IAAE,OAEA,oBAAA,wBAAA,UAAA;KAAoDzB,OAAAA;KACjDD,UAAAA,SAASC,KAAK;IACjB,GAFuCuB,IAEvC;GAAmC,CAEtC,EAAC,CAAA;EACD;EAAArB,EAAA,KAAAH;EAAAG,EAAA,KAAAG;EAAAH,EAAA,KAAAK;EAAAL,EAAA,KAAAI;EAAAJ,EAAA,KAAAU;EAAAV,EAAA,KAAAW;CAAA,OAAA;EAAAD,KAAAV,EAAA;EAAAW,KAAAX,EAAA;CAAA;CAAA,IAAAW,OAAAC,OAAAC,IAAA,6BAAA,GAAA,OAAAF;CAAA,OAdHD;AAcG;AAIPf,8BAA8BgC,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpElicitationPrimitiveItems.js","names":["FC","ReactNode","useCallback","useMemo","useState","useAuiState","MCPElicitation","ElicitationContext","initialElicitationDraft","useMcpElicitation","McpElicitationPrimitiveItems","Props","children","elicitation","McpElicitationPrimitiveItem","t0","$","_c","t1","requestedSchema","draft","setDraft","t2","Symbol","for","name","value","current","setField","t3","context","t4","t5","elicitations","_temp","length","id","map","displayName","state","mcpServer","pendingElicitations"],"sources":["../../../src/primitives/elicitation/McpElicitationPrimitiveItems.tsx"],"sourcesContent":["import { type FC, type ReactNode, useCallback, useMemo, useState } from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\nimport type { MCPElicitation } from \"../../mcp-scope\";\nimport { ElicitationContext } from \"./context\";\nimport { initialElicitationDraft } from \"./initialElicitationDraft\";\n\nexport { useMcpElicitation } from \"./context\";\n\nexport namespace McpElicitationPrimitiveItems {\n export type Props = {\n children: ReactNode | ((elicitation: MCPElicitation) => ReactNode);\n };\n}\n\nconst McpElicitationPrimitiveItem: FC<{\n elicitation: MCPElicitation;\n children: McpElicitationPrimitiveItems.Props[\"children\"];\n}> = ({ elicitation, children }) => {\n const [draft, setDraft] = useState<Record<string, unknown>>(() =>\n initialElicitationDraft(elicitation.requestedSchema),\n );\n const setField = useCallback((name: string, value: unknown) => {\n setDraft((current) => ({ ...current, [name]: value }));\n }, []);\n const context = useMemo(\n () => ({ elicitation, draft, setField }),\n [elicitation, draft, setField],\n );\n\n return (\n <ElicitationContext.Provider value={context}>\n {typeof children === \"function\" ? children(elicitation) : children}\n </ElicitationContext.Provider>\n );\n};\n\nexport const McpElicitationPrimitiveItems: FC<\n McpElicitationPrimitiveItems.Props\n> = ({ children }) => {\n const elicitations = useAuiState(\n (state) => state.mcpServer.pendingElicitations,\n );\n if (elicitations.length === 0) return null;\n return (\n <>\n {elicitations.map((elicitation) => (\n <McpElicitationPrimitiveItem\n key={elicitation.id}\n elicitation={elicitation}\n >\n {children}\n </McpElicitationPrimitiveItem>\n ))}\n </>\n );\n};\n\nMcpElicitationPrimitiveItems.displayName = \"McpElicitationPrimitive.Items\";\n"],"mappings":";;;;;;;AAcA,MAAMc,+BAGDC,OAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAC,MAAA,EAAAJ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A,EAAAL,aAAAG;CACH,MAAAkB,eAAqB5B,YACnB6B,KACF;CACA,IAAID,aAAYE,WAAY,GAAC,OAAS;CAAK,IAAAjB;CAAA,IAAAF,EAAA,OAAAJ,YAAAI,EAAA,OAAAiB,cAAA;EAAA,IAAAX;EAAA,IAAAN,EAAA,OAAAJ,UAAA;GAGrBU,MAAAT,gBAChB,oBAAC,6BAAD;IAEeA;IAEZD;GAJyB,GACrBC,YAAWuB,EADU;GAM7BpB,EAAA,KAAAJ;GAAAI,EAAA,KAAAM;EAAA,OAAAA,KAAAN,EAAA;EAPAE,KAAAe,aAAYI,IAAKf,EAOjB;EAACN,EAAA,KAAAJ;EAAAI,EAAA,KAAAiB;EAAAjB,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,IAAAM;CAAA,IAAAN,EAAA,OAAAE,IAAA;EARJI,KAAA,oBAAA,UAAA,EAAA,UACGJ,GAOC,CAAA;EACDF,EAAA,KAAAE;EAAAF,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OATHM;AASG;AAIPZ,6BAA6B4B,cAAc;AAnBvC,SAAAJ,MAAAK,OAAA;CAAA,OAEWA,MAAKC,UAAUC;AAAoB"}
|
|
1
|
+
{"version":3,"file":"McpElicitationPrimitiveItems.js","names":["FC","ReactNode","useCallback","useMemo","useState","useAuiState","MCPElicitation","ElicitationContext","initialElicitationDraft","useMcpElicitation","McpElicitationPrimitiveItems","Props","children","elicitation","McpElicitationPrimitiveItem","t0","$","_c","t1","requestedSchema","draft","setDraft","t2","Symbol","for","name","value","current","setField","t3","context","t4","t5","elicitations","_temp","length","id","map","displayName","state","mcpServer","pendingElicitations","_c"],"sources":["../../../src/primitives/elicitation/McpElicitationPrimitiveItems.tsx"],"sourcesContent":["import { type FC, type ReactNode, useCallback, useMemo, useState } from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\nimport type { MCPElicitation } from \"../../mcp-scope\";\nimport { ElicitationContext } from \"./context\";\nimport { initialElicitationDraft } from \"./initialElicitationDraft\";\n\nexport { useMcpElicitation } from \"./context\";\n\nexport namespace McpElicitationPrimitiveItems {\n export type Props = {\n children: ReactNode | ((elicitation: MCPElicitation) => ReactNode);\n };\n}\n\nconst McpElicitationPrimitiveItem: FC<{\n elicitation: MCPElicitation;\n children: McpElicitationPrimitiveItems.Props[\"children\"];\n}> = ({ elicitation, children }) => {\n const [draft, setDraft] = useState<Record<string, unknown>>(() =>\n initialElicitationDraft(elicitation.requestedSchema),\n );\n const setField = useCallback((name: string, value: unknown) => {\n setDraft((current) => ({ ...current, [name]: value }));\n }, []);\n const context = useMemo(\n () => ({ elicitation, draft, setField }),\n [elicitation, draft, setField],\n );\n\n return (\n <ElicitationContext.Provider value={context}>\n {typeof children === \"function\" ? children(elicitation) : children}\n </ElicitationContext.Provider>\n );\n};\n\nexport const McpElicitationPrimitiveItems: FC<\n McpElicitationPrimitiveItems.Props\n> = ({ children }) => {\n const elicitations = useAuiState(\n (state) => state.mcpServer.pendingElicitations,\n );\n if (elicitations.length === 0) return null;\n return (\n <>\n {elicitations.map((elicitation) => (\n <McpElicitationPrimitiveItem\n key={elicitation.id}\n elicitation={elicitation}\n >\n {children}\n </McpElicitationPrimitiveItem>\n ))}\n </>\n );\n};\n\nMcpElicitationPrimitiveItems.displayName = \"McpElicitationPrimitive.Items\";\n"],"mappings":";;;;;;;AAcA,MAAMc,+BAGDC,OAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAC,MAAA,EAAAJ,aAAAD,aAAAG;CAAyB,IAAAG;CAAA,IAAAF,EAAA,OAAAH,YAAAM,iBAAA;EAC+BD,WAC1DV,wBAAwBK,YAAWM,eAAgB;EAACH,EAAA,KAAAH,YAAAM;EAAAH,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CADtD,MAAA,CAAAI,OAAAC,YAA0BjB,SAAkCc,EAE5D;CAAE,IAAAI;CAAA,IAAAN,EAAA,OAAAO,OAAAC,IAAA,2BAAA,GAAA;E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J;GAAAI,EAAA,KAAAM;EAAA,OAAAA,KAAAN,EAAA;EAPAE,KAAAe,aAAYI,IAAKf,EAOjB;EAACN,EAAA,KAAAJ;EAAAI,EAAA,KAAAiB;EAAAjB,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,IAAAM;CAAA,IAAAN,EAAA,OAAAE,IAAA;EARJI,KAAA,oBAAA,UAAA,EAAA,UACGJ,GAOC,CAAA;EACDF,EAAA,KAAAE;EAAAF,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OATHM;AASG;AAIPZ,6BAA6B4B,cAAc;AAnBvC,SAAAJ,MAAAK,OAAA;CAAA,OAEWA,MAAKC,UAAUC;AAAoB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpElicitationPrimitiveMessage.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useMcpElicitation","McpElicitationPrimitiveMessage","Element","span","Props","props","ref","$","_c","elicitation","t0","children","message","t1","displayName"],"sources":["../../../src/primitives/elicitation/McpElicitationPrimitiveMessage.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useMcpElicitation } from \"./context\";\n\nexport namespace McpElicitationPrimitiveMessage {\n export type Element = ComponentRef<typeof Primitive.span>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.span>;\n}\n\nexport const McpElicitationPrimitiveMessage = forwardRef<\n McpElicitationPrimitiveMessage.Element,\n McpElicitationPrimitiveMessage.Props\n>((props, ref) => {\n const elicitation = useMcpElicitation();\n return (\n <Primitive.span {...props} ref={ref}>\n {props.children ?? elicitation.message}\n </Primitive.span>\n );\n});\n\nMcpElicitationPrimitiveMessage.displayName = \"McpElicitationPrimitive.Message\";\n"],"mappings":";;;;;;AAaA,MAAaK,iCAAiCH,YAG5CO,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAAC,cAAoBT,kBAAkB;CAGjC,MAAAU,KAAAL,MAAKM,YAAaF,YAAWG;CAAQ,IAAAC;CAAA,IAAAN,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAG,IAAA;EADxCG,KAAA,oBAAA,UAAA,MAAA;GAAA,GAAoBR;GAAYC;GAC7BI,UAAAA;EACH,CAAA;EAAiBH,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAG;EAAAH,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OAFjBM;AAEiB,CAEpB;AAEDZ,+BAA+Ba,cAAc"}
|
|
1
|
+
{"version":3,"file":"McpElicitationPrimitiveMessage.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useMcpElicitation","McpElicitationPrimitiveMessage","Element","span","Props","props","ref","$","_c","elicitation","t0","children","message","t1","displayName","_c"],"sources":["../../../src/primitives/elicitation/McpElicitationPrimitiveMessage.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useMcpElicitation } from \"./context\";\n\nexport namespace McpElicitationPrimitiveMessage {\n export type Element = ComponentRef<typeof Primitive.span>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.span>;\n}\n\nexport const McpElicitationPrimitiveMessage = forwardRef<\n McpElicitationPrimitiveMessage.Element,\n McpElicitationPrimitiveMessage.Props\n>((props, ref) => {\n const elicitation = useMcpElicitation();\n return (\n <Primitive.span {...props} ref={ref}>\n {props.children ?? elicitation.message}\n </Primitive.span>\n );\n});\n\nMcpElicitationPrimitiveMessage.displayName = \"McpElicitationPrimitive.Message\";\n"],"mappings":";;;;;;AAaA,MAAaK,iCAAiCH,YAG5CO,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAAC,cAAoBT,kBAAkB;CAGjC,MAAAU,KAAAL,MAAKM,YAAaF,YAAWG;CAAQ,IAAAC;CAAA,IAAAN,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAG,IAAA;EADxCG,KAAA,oBAAA,UAAA,MAAA;GAAA,GAAoBR;GAAYC;GAC7BI,UAAAA;EACH,CAAA;EAAiBH,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAG;EAAAH,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OAFjBM;AAEiB,CAEpB;AAEDZ,+BAA+Ba,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpElicitationPrimitiveRoot.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useMcpElicitation","McpElicitationPrimitiveRoot","Element","div","Props","props","ref","$","_c","elicitation","t0","id","displayName"],"sources":["../../../src/primitives/elicitation/McpElicitationPrimitiveRoot.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useMcpElicitation } from \"./context\";\n\nexport namespace McpElicitationPrimitiveRoot {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div>;\n}\n\nexport const McpElicitationPrimitiveRoot = forwardRef<\n McpElicitationPrimitiveRoot.Element,\n McpElicitationPrimitiveRoot.Props\n>((props, ref) => {\n const elicitation = useMcpElicitation();\n return (\n <Primitive.div {...props} ref={ref} data-elicitation-id={elicitation.id} />\n );\n});\n\nMcpElicitationPrimitiveRoot.displayName = \"McpElicitationPrimitive.Root\";\n"],"mappings":";;;;;;AAaA,MAAaK,8BAA8BH,YAGzCO,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAAC,cAAoBT,kBAAkB;CAAE,IAAAU;CAAA,IAAAH,EAAA,OAAAE,YAAAE,MAAAJ,EAAA,OAAAF,SAAAE,EAAA,OAAAD,KAAA;EAEtCI,KAAA,oBAAA,UAAA,KAAA;GAAA,GAAmBL;GAAYC;GAA0B,uBAAAG,YAAWE;EAAG,CAAA;EAAIJ,EAAA,KAAAE,YAAAE;EAAAJ,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAAA,OAA3EG;AAA2E,CAE9E;AAEDT,4BAA4BW,cAAc"}
|
|
1
|
+
{"version":3,"file":"McpElicitationPrimitiveRoot.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useMcpElicitation","McpElicitationPrimitiveRoot","Element","div","Props","props","ref","$","_c","elicitation","t0","id","displayName","_c"],"sources":["../../../src/primitives/elicitation/McpElicitationPrimitiveRoot.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useMcpElicitation } from \"./context\";\n\nexport namespace McpElicitationPrimitiveRoot {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div>;\n}\n\nexport const McpElicitationPrimitiveRoot = forwardRef<\n McpElicitationPrimitiveRoot.Element,\n McpElicitationPrimitiveRoot.Props\n>((props, ref) => {\n const elicitation = useMcpElicitation();\n return (\n <Primitive.div {...props} ref={ref} data-elicitation-id={elicitation.id} />\n );\n});\n\nMcpElicitationPrimitiveRoot.displayName = \"McpElicitationPrimitive.Root\";\n"],"mappings":";;;;;;AAaA,MAAaK,8BAA8BH,YAGzCO,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAAC,cAAoBT,kBAAkB;CAAE,IAAAU;CAAA,IAAAH,EAAA,OAAAE,YAAAE,MAAAJ,EAAA,OAAAF,SAAAE,EAAA,OAAAD,KAAA;EAEtCI,KAAA,oBAAA,UAAA,KAAA;GAAA,GAAmBL;GAAYC;GAA0B,uBAAAG,YAAWE;EAAG,CAAA;EAAIJ,EAAA,KAAAE,YAAAE;EAAAJ,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAAA,OAA3EG;AAA2E,CAE9E;AAEDT,4BAA4BW,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpManagerAddCustomTrigger.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","McpManagerPrimitiveAddCustomTrigger","Element","button","Props","props","ref","$","_c","t0","displayName"],"sources":["../../../src/primitives/manager/McpManagerAddCustomTrigger.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\n\nexport namespace McpManagerPrimitiveAddCustomTrigger {\n export type Element = ComponentRef<typeof Primitive.button>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.button>;\n}\n\nexport const McpManagerPrimitiveAddCustomTrigger = forwardRef<\n McpManagerPrimitiveAddCustomTrigger.Element,\n McpManagerPrimitiveAddCustomTrigger.Props\n>((props, ref) => {\n return <Primitive.button {...props} type=\"button\" ref={ref} />;\n});\n\nMcpManagerPrimitiveAddCustomTrigger.displayName =\n \"McpManagerPrimitive.AddCustomTrigger\";\n"],"mappings":";;;;;AAYA,MAAaI,sCAAsCF,YAGjDM,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAF,SAAAE,EAAA,OAAAD,KAAA;EACOG,KAAA,oBAAA,UAAA,QAAA;GAAA,GAAsBJ;GAAY,MAAA;GAAcC;EAAG,CAAA;EAAIC,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,OAAvDE;AAAuD,CAC/D;AAEDR,oCAAoCS,cAClC"}
|
|
1
|
+
{"version":3,"file":"McpManagerAddCustomTrigger.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","McpManagerPrimitiveAddCustomTrigger","Element","button","Props","props","ref","$","_c","t0","displayName","_c"],"sources":["../../../src/primitives/manager/McpManagerAddCustomTrigger.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\n\nexport namespace McpManagerPrimitiveAddCustomTrigger {\n export type Element = ComponentRef<typeof Primitive.button>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.button>;\n}\n\nexport const McpManagerPrimitiveAddCustomTrigger = forwardRef<\n McpManagerPrimitiveAddCustomTrigger.Element,\n McpManagerPrimitiveAddCustomTrigger.Props\n>((props, ref) => {\n return <Primitive.button {...props} type=\"button\" ref={ref} />;\n});\n\nMcpManagerPrimitiveAddCustomTrigger.displayName =\n \"McpManagerPrimitive.AddCustomTrigger\";\n"],"mappings":";;;;;AAYA,MAAaI,sCAAsCF,YAGjDM,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAF,SAAAE,EAAA,OAAAD,KAAA;EACOG,KAAA,oBAAA,UAAA,QAAA;GAAA,GAAsBJ;GAAY,MAAA;GAAcC;EAAG,CAAA;EAAIC,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,OAAvDE;AAAuD,CAC/D;AAEDR,oCAAoCS,cAClC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpManagerRoot.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAuiState","McpManagerPrimitiveRoot","Element","div","Props","props","ref","$","_c","isHydrated","_temp","t0","undefined","t1","displayName","s","mcp"],"sources":["../../../src/primitives/manager/McpManagerRoot.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 McpManagerPrimitiveRoot {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div>;\n}\n\nexport const McpManagerPrimitiveRoot = forwardRef<\n McpManagerPrimitiveRoot.Element,\n McpManagerPrimitiveRoot.Props\n>((props, ref) => {\n const isHydrated = useAuiState((s) => s.mcp.isHydrated);\n return (\n <Primitive.div\n {...props}\n ref={ref}\n data-mcp-hydrated={isHydrated || undefined}\n />\n );\n});\n\nMcpManagerPrimitiveRoot.displayName = \"McpManagerPrimitive.Root\";\n"],"mappings":";;;;;;AAaA,MAAaK,0BAA0BH,YAGrCO,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAMuB,MAAAG,KALJX,YAAYU,KAKRD,KAAAG,KAAAA;CAAuB,IAAAC;CAAA,IAAAN,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAI,IAAA;EAH5CE,KAAA,oBAAA,UAAA,KAAA;GAAA,GACMR;GACCC;GACc,qBAAAK;EAAuB,CAAA;EAC1CJ,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAI;EAAAJ,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OAJFM;AAIE,CAEL;AAEDZ,wBAAwBa,cAAc;AAXpC,SAAAJ,MAAAK,GAAA;CAAA,OACsCA,EAACC,IAAIP;AAAW"}
|
|
1
|
+
{"version":3,"file":"McpManagerRoot.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAuiState","McpManagerPrimitiveRoot","Element","div","Props","props","ref","$","_c","isHydrated","_temp","t0","undefined","t1","displayName","s","mcp","_c"],"sources":["../../../src/primitives/manager/McpManagerRoot.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 McpManagerPrimitiveRoot {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div>;\n}\n\nexport const McpManagerPrimitiveRoot = forwardRef<\n McpManagerPrimitiveRoot.Element,\n McpManagerPrimitiveRoot.Props\n>((props, ref) => {\n const isHydrated = useAuiState((s) => s.mcp.isHydrated);\n return (\n <Primitive.div\n {...props}\n ref={ref}\n data-mcp-hydrated={isHydrated || undefined}\n />\n );\n});\n\nMcpManagerPrimitiveRoot.displayName = \"McpManagerPrimitive.Root\";\n"],"mappings":";;;;;;AAaA,MAAaK,0BAA0BH,YAGrCO,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAMuB,MAAAG,KALJX,YAAYU,KAKRD,KAAAG,KAAAA;CAAuB,IAAAC;CAAA,IAAAN,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAI,IAAA;EAH5CE,KAAA,oBAAA,UAAA,KAAA;GAAA,GACMR;GACCC;GACc,qBAAAK;EAAuB,CAAA;EAC1CJ,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAI;EAAAJ,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OAJFM;AAIE,CAEL;AAEDZ,wBAAwBa,cAAc;AAXpC,SAAAJ,MAAAK,GAAA;CAAA,OACsCA,EAACC,IAAIP;AAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpServerConnectButton.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAui","useAuiState","McpServerPrimitiveConnectButton","Element","button","Props","CONNECTABLE","Set","props","ref","$","_c","state","_temp","aui","has","t0","undefined","t1","e","onClick","defaultPrevented","mcpServer","connect","t2","displayName","s","connectionState"],"sources":["../../../src/primitives/server/McpServerConnectButton.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 McpServerPrimitiveConnectButton {\n export type Element = ComponentRef<typeof Primitive.button>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.button>;\n}\n\nconst CONNECTABLE = new Set([\"disconnected\", \"error\", \"authRequired\"]);\n\nexport const McpServerPrimitiveConnectButton = forwardRef<\n McpServerPrimitiveConnectButton.Element,\n McpServerPrimitiveConnectButton.Props\n>((props, ref) => {\n const state = useAuiState((s) => s.mcpServer.connectionState);\n const aui = useAui();\n if (!CONNECTABLE.has(state)) return null;\n return (\n <Primitive.button\n {...props}\n type=\"button\"\n ref={ref}\n data-state-hint={state === \"authRequired\" ? \"auth-required\" : undefined}\n onClick={(e) => {\n props.onClick?.(e);\n if (e.defaultPrevented) return;\n void aui.mcpServer.connect();\n }}\n />\n );\n});\n\nMcpServerPrimitiveConnectButton.displayName =\n \"McpServerPrimitive.ConnectButton\";\n"],"mappings":";;;;;;AAaA,MAAMU,8BAAc,IAAIC,IAAI;CAAC;CAAgB;CAAS;AAAc,CAAC;AAErE,MAAaL,kCAAkCJ,YAG7CU,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAAC,QAAcX,YAAYY,KAAkC;CAC5D,MAAAC,MAAYd,OAAO;CACnB,IAAI,CAACM,YAAWS,IAAKH,KAAK,GAAC,OAAS;CAMf,MAAAI,KAAAJ,UAAU,iBAAV,kBAAAK,KAAAA;CAAsD,IAAAC;CAAA,IAAAR,EAAA,OAAAI,OAAAJ,EAAA,OAAAF,OAAA;EAC9DU,MAAAC,MAAA;GACPX,MAAKY,UAAWD,CAAC;GACjB,IAAIA,EAACE,kBAAiB;GACjBP,IAAGQ,UAAUC,QAAS;EAAC;EAC7Bb,EAAA,KAAAI;EAAAJ,EAAA,KAAAF;EAAAE,EAAA,KAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,IAAAc;CAAA,IAAAd,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAM,MAAAN,EAAA,OAAAQ,IAAA;EATHM,KAAA,oBAAA,UAAA,QAAA;GAAA,GACMhB;GACC,MAAA;GACAC;GACY,mBAAAO;GACR,SAAAE;EAIR,CAAA;EACDR,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAM;EAAAN,EAAA,KAAAQ;EAAAR,EAAA,KAAAc;CAAA,OAAAA,KAAAd,EAAA;CAAA,OAVFc;AAUE,CAEL;AAEDtB,gCAAgCuB,cAC9B;AApBA,SAAAZ,MAAAa,GAAA;CAAA,OACiCA,EAACJ,UAAUK;AAAgB"}
|
|
1
|
+
{"version":3,"file":"McpServerConnectButton.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAui","useAuiState","McpServerPrimitiveConnectButton","Element","button","Props","CONNECTABLE","Set","props","ref","$","_c","state","_temp","aui","has","t0","undefined","t1","e","onClick","defaultPrevented","mcpServer","connect","t2","displayName","s","connectionState","_c"],"sources":["../../../src/primitives/server/McpServerConnectButton.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 McpServerPrimitiveConnectButton {\n export type Element = ComponentRef<typeof Primitive.button>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.button>;\n}\n\nconst CONNECTABLE = new Set([\"disconnected\", \"error\", \"authRequired\"]);\n\nexport const McpServerPrimitiveConnectButton = forwardRef<\n McpServerPrimitiveConnectButton.Element,\n McpServerPrimitiveConnectButton.Props\n>((props, ref) => {\n const state = useAuiState((s) => s.mcpServer.connectionState);\n const aui = useAui();\n if (!CONNECTABLE.has(state)) return null;\n return (\n <Primitive.button\n {...props}\n type=\"button\"\n ref={ref}\n data-state-hint={state === \"authRequired\" ? \"auth-required\" : undefined}\n onClick={(e) => {\n props.onClick?.(e);\n if (e.defaultPrevented) return;\n void aui.mcpServer.connect();\n }}\n />\n );\n});\n\nMcpServerPrimitiveConnectButton.displayName =\n \"McpServerPrimitive.ConnectButton\";\n"],"mappings":";;;;;;AAaA,MAAMU,8BAAc,IAAIC,IAAI;CAAC;CAAgB;CAAS;AAAc,CAAC;AAErE,MAAaL,kCAAkCJ,YAG7CU,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAAC,QAAcX,YAAYY,KAAkC;CAC5D,MAAAC,MAAYd,OAAO;CACnB,IAAI,CAACM,YAAWS,IAAKH,KAAK,GAAC,OAAS;CAMf,MAAAI,KAAAJ,UAAU,iBAAV,kBAAAK,KAAAA;CAAsD,IAAAC;CAAA,IAAAR,EAAA,OAAAI,OAAAJ,EAAA,OAAAF,OAAA;EAC9DU,MAAAC,MAAA;GACPX,MAAKY,UAAWD,CAAC;GACjB,IAAIA,EAACE,kBAAiB;GACjBP,IAAGQ,UAAUC,QAAS;EAAC;EAC7Bb,EAAA,KAAAI;EAAAJ,EAAA,KAAAF;EAAAE,EAAA,KAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,IAAAc;CAAA,IAAAd,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAM,MAAAN,EAAA,OAAAQ,IAAA;EATHM,KAAA,oBAAA,UAAA,QAAA;GAAA,GACMhB;GACC,MAAA;GACAC;GACY,mBAAAO;GACR,SAAAE;EAIR,CAAA;EACDR,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAM;EAAAN,EAAA,KAAAQ;EAAAR,EAAA,KAAAc;CAAA,OAAAA,KAAAd,EAAA;CAAA,OAVFc;AAUE,CAEL;AAEDtB,gCAAgCuB,cAC9B;AApBA,SAAAZ,MAAAa,GAAA;CAAA,OACiCA,EAACJ,UAAUK;AAAgB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpServerDisconnectButton.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAui","useAuiState","McpServerPrimitiveDisconnectButton","Element","button","Props","DISCONNECTABLE","Set","props","ref","$","_c","state","_temp","aui","has","t0","e","onClick","defaultPrevented","mcpServer","disconnect","t1","displayName","s","connectionState"],"sources":["../../../src/primitives/server/McpServerDisconnectButton.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 McpServerPrimitiveDisconnectButton {\n export type Element = ComponentRef<typeof Primitive.button>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.button>;\n}\n\nconst DISCONNECTABLE = new Set([\"connected\", \"connecting\", \"authPending\"]);\n\nexport const McpServerPrimitiveDisconnectButton = forwardRef<\n McpServerPrimitiveDisconnectButton.Element,\n McpServerPrimitiveDisconnectButton.Props\n>((props, ref) => {\n const state = useAuiState((s) => s.mcpServer.connectionState);\n const aui = useAui();\n if (!DISCONNECTABLE.has(state)) 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.disconnect();\n }}\n />\n );\n});\n\nMcpServerPrimitiveDisconnectButton.displayName =\n \"McpServerPrimitive.DisconnectButton\";\n"],"mappings":";;;;;;AAaA,MAAMU,iCAAiB,IAAIC,IAAI;CAAC;CAAa;CAAc;AAAa,CAAC;AAEzE,MAAaL,qCAAqCJ,YAGhDU,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAAC,QAAcX,YAAYY,KAAkC;CAC5D,MAAAC,MAAYd,OAAO;CACnB,IAAI,CAACM,eAAcS,IAAKH,KAAK,GAAC,OAAS;CAAK,IAAAI;CAAA,IAAAN,EAAA,OAAAI,OAAAJ,EAAA,OAAAF,OAAA;EAM/BQ,MAAAC,MAAA;GACPT,MAAKU,UAAWD,CAAC;GACjB,IAAIA,EAACE,kBAAiB;GACjBL,IAAGM,UAAUC,WAAY;EAAC;EAChCX,EAAA,KAAAI;EAAAJ,EAAA,KAAAF;EAAAE,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,IAAAY;CAAA,IAAAZ,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAM,IAAA;EARHM,KAAA,oBAAA,UAAA,QAAA;GAAA,GACMd;GACC,MAAA;GACAC;GACI,SAAAO;EAIR,CAAA;EACDN,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAM;EAAAN,EAAA,KAAAY;CAAA,OAAAA,KAAAZ,EAAA;CAAA,OATFY;AASE,CAEL;AAEDpB,mCAAmCqB,cACjC;AAnBA,SAAAV,MAAAW,GAAA;CAAA,OACiCA,EAACJ,UAAUK;AAAgB"}
|
|
1
|
+
{"version":3,"file":"McpServerDisconnectButton.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAui","useAuiState","McpServerPrimitiveDisconnectButton","Element","button","Props","DISCONNECTABLE","Set","props","ref","$","_c","state","_temp","aui","has","t0","e","onClick","defaultPrevented","mcpServer","disconnect","t1","displayName","s","connectionState","_c"],"sources":["../../../src/primitives/server/McpServerDisconnectButton.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 McpServerPrimitiveDisconnectButton {\n export type Element = ComponentRef<typeof Primitive.button>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.button>;\n}\n\nconst DISCONNECTABLE = new Set([\"connected\", \"connecting\", \"authPending\"]);\n\nexport const McpServerPrimitiveDisconnectButton = forwardRef<\n McpServerPrimitiveDisconnectButton.Element,\n McpServerPrimitiveDisconnectButton.Props\n>((props, ref) => {\n const state = useAuiState((s) => s.mcpServer.connectionState);\n const aui = useAui();\n if (!DISCONNECTABLE.has(state)) 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.disconnect();\n }}\n />\n );\n});\n\nMcpServerPrimitiveDisconnectButton.displayName =\n \"McpServerPrimitive.DisconnectButton\";\n"],"mappings":";;;;;;AAaA,MAAMU,iCAAiB,IAAIC,IAAI;CAAC;CAAa;CAAc;AAAa,CAAC;AAEzE,MAAaL,qCAAqCJ,YAGhDU,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAAC,QAAcX,YAAYY,KAAkC;CAC5D,MAAAC,MAAYd,OAAO;CACnB,IAAI,CAACM,eAAcS,IAAKH,KAAK,GAAC,OAAS;CAAK,IAAAI;CAAA,IAAAN,EAAA,OAAAI,OAAAJ,EAAA,OAAAF,OAAA;EAM/BQ,MAAAC,MAAA;GACPT,MAAKU,UAAWD,CAAC;GACjB,IAAIA,EAACE,kBAAiB;GACjBL,IAAGM,UAAUC,WAAY;EAAC;EAChCX,EAAA,KAAAI;EAAAJ,EAAA,KAAAF;EAAAE,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,IAAAY;CAAA,IAAAZ,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAM,IAAA;EARHM,KAAA,oBAAA,UAAA,QAAA;GAAA,GACMd;GACC,MAAA;GACAC;GACI,SAAAO;EAIR,CAAA;EACDN,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAM;EAAAN,EAAA,KAAAY;CAAA,OAAAA,KAAAZ,EAAA;CAAA,OATFY;AASE,CAEL;AAEDpB,mCAAmCqB,cACjC;AAnBA,SAAAV,MAAAW,GAAA;CAAA,OACiCA,EAACJ,UAAUK;AAAgB"}
|
|
@@ -1 +1 @@
|
|
|
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;GAC5BK,UAAAA;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
|
+
{"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","_c"],"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;GAC5BK,UAAAA;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 +1 @@
|
|
|
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,KAAA,GAAAK,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
|
+
{"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","_c"],"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,KAAA,GAAAK,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 +1 @@
|
|
|
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;GAC7BK,UAAAA;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
|
+
{"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","_c"],"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;GAC7BK,UAAAA;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 +1 @@
|
|
|
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,MAAA,GAAAK,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
|
+
{"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","_c"],"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,MAAA,GAAAK,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 +1 @@
|
|
|
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","catch","_temp2","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().catch(() => undefined);\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,UAAUC,OAAQ,CAAC,CAAAC,MAAOC,MAAe;EAAC;EACnDZ,EAAA,KAAAI;EAAAJ,EAAA,KAAAF;EAAAE,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,IAAAa;CAAA,IAAAb,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAK,IAAA;EARHQ,KAAA,oBAAA,UAAA,QAAA;GAAA,GACMf;GACC,MAAA;GACAC;GACI,SAAAM;EAIR,CAAA;EACDL,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAK;EAAAL,EAAA,KAAAa;CAAA,OAAAA,KAAAb,EAAA;CAAA,OATFa;AASE,CAEL;AAEDnB,+BAA+BoB,cAAc;AAlB3C,SAAAX,MAAAY,GAAA;CAAA,OACgCA,EAACN,UAAUP;AAAK;AADhD,SAAAU,SAAA,CAAA"}
|
|
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","catch","_temp2","t1","displayName","s","_c"],"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().catch(() => undefined);\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,UAAUC,OAAQ,CAAC,CAAAC,MAAOC,MAAe;EAAC;EACnDZ,EAAA,KAAAI;EAAAJ,EAAA,KAAAF;EAAAE,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,IAAAa;CAAA,IAAAb,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAK,IAAA;EARHQ,KAAA,oBAAA,UAAA,QAAA;GAAA,GACMf;GACC,MAAA;GACAC;GACI,SAAAM;EAIR,CAAA;EACDL,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAK;EAAAL,EAAA,KAAAa;CAAA,OAAAA,KAAAb,EAAA;CAAA,OATFa;AASE,CAEL;AAEDnB,+BAA+BoB,cAAc;AAlB3C,SAAAX,MAAAY,GAAA;CAAA,OACgCA,EAACN,UAAUP;AAAK;AADhD,SAAAU,SAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
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
|
+
{"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","_c"],"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 +1 @@
|
|
|
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;GAC9CE,UAAAA;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
|
+
{"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","_c"],"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;GAC9CE,UAAAA;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 +1 @@
|
|
|
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;GACtDF,UAAAA;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
|
+
{"version":3,"file":"McpServerToolName.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useMcpServerTool","McpServerPrimitiveToolName","Element","span","Props","props","ref","$","_c","tool","t0","children","name","t1","displayName","_c"],"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;GACtDF,UAAAA;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 +1 @@
|
|
|
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;IAC1C,UAAA,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
|
+
{"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","_c"],"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;IAC1C,UAAA,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":"McpManagerResource.js","names":["useState","useEffect","useMemo","useEffectEvent","useRef","useCallback","useResource","resource","withKey","useClientLookup","useAssistantClientRef","attachTransformScopes","ClientOutput","useAssistantScopeEffect","ModelContext","createMcpId","clearOAuthProviderAuthState","Tool","McpServerResource","withMcpServerRemovalFence","McpLocalStorage","MCPStorage","MCPStorageElement","assertUniqueServerIds","MCPAuthConfig","MCPConnector","MCPCustomServerRecord","MCPManagerState","McpManagerResourceProps","connectors","storage","oauthRedirectUri","autoConnect","connectionTimeout","defaultRedirectUri","window","location","origin","NO_CONNECTORS","reportCustomStorageFailure","operation","error","console","reportBlockedCustomServerPersistence","persistCustomServers","records","saveCustomServers","CustomServerPersistenceQueues","Map","Promise","enqueueCustomServerTask","persistenceQueues","scopeKey","task","previous","get","next","resolve","then","set","delete","enqueueCustomServerPersistence","holdCustomServerPersistence","release","gate","deduplicateCustomServers","seen","Set","filter","record","has","id","add","McpCustomServersResourceProps","useMcpCustomServersResource","t0","$","_c","t1","Symbol","for","customServers","setCustomServers","isHydrated","setIsHydrated","t2","customServersRef","hydrationStateRef","hasPendingMutationRef","removedBeforeHydration","_temp","reportedBlockedPersistenceRef","t3","signal","pendingPersistence","cancelled","loadedRecords","loadCustomServers","t4","current","hadPendingMutation","hydratedRecords","mergedRecords","prev","length","persistedIds","map","_temp2","r_0","r","hydrate","signal_0","t5","t6","updater","updateCustomServers","t7","prev_0","record_0","removeCustomServer","t8","McpCustomServersResource","useMcpManagerResource","props","redirectUri","storageElement","_temp3","storageScopeKey","scopeId","undefined","_temp4","_temp5","c_0","c","kind","name","url","icon","auth","cache","elicitation","onRemove","_temp6","connectorElements","s_0","s","customElements","serverElements","lookup","all","state","_temp7","_temp8","servers","out","server","connectionState","tool","tools","fullName","type","description","parameters","inputSchema","execute","args","key","callTool","toolkit","clientRef","client","modelContext","register","getModelContext","t9","index","list","entry","Error","serverByKind","t10","t11","query","t12","t13","t14","index_0","t15","index_1","connectionTimeout_0","createdAt","Date","now","some","c_1","remove","releasePersistence","t16","getState","connector","customServer","addCustomServer","removeServer","McpManagerResource","scopes","parent","source","s_1","s_2"],"sources":["../../src/resources/McpManagerResource.ts"],"sourcesContent":["import {\n useState,\n useEffect,\n useMemo,\n useEffectEvent,\n useRef,\n useCallback,\n} from \"react\";\nimport { useResource, resource, withKey } from \"@assistant-ui/tap\";\nimport {\n useClientLookup,\n useAssistantClientRef,\n attachTransformScopes,\n type ClientOutput,\n} from \"@assistant-ui/store\";\nimport { useAssistantScopeEffect } from \"@assistant-ui/store/client\";\nimport { ModelContext } from \"@assistant-ui/core/store\";\nimport { createMcpId } from \"../utils/createMcpId\";\nimport { clearOAuthProviderAuthState } from \"../auth/createOAuthProvider\";\nimport type { Tool } from \"assistant-stream\";\nimport { McpServerResource } from \"./McpServerResource\";\nimport { withMcpServerRemovalFence } from \"./McpServerRemovalFence\";\nimport { McpLocalStorage } from \"./storage/McpLocalStorage\";\nimport type { MCPStorage, MCPStorageElement } from \"./storage/types\";\nimport { assertUniqueServerIds } from \"../utils/serverId\";\nimport type {\n MCPAuthConfig,\n MCPConnector,\n MCPCustomServerRecord,\n MCPManagerState,\n} from \"../mcp-scope\";\n\nexport type McpManagerResourceProps = {\n connectors?: MCPConnector[] | undefined;\n storage?: MCPStorageElement | undefined;\n /** OAuth redirect target. Defaults to `${origin}/mcp/callback`. */\n oauthRedirectUri?: string | undefined;\n /** Connect on mount when usable auth exists. Default true. */\n autoConnect?: boolean | undefined;\n /** Optional timeout in milliseconds for connect/listTools calls. Disabled by default. */\n connectionTimeout?: number | undefined;\n};\n\nfunction defaultRedirectUri(): string {\n if (typeof window === \"undefined\") return \"\";\n return `${window.location.origin}/mcp/callback`;\n}\n\n// Stable empty fallback so an absent `connectors` prop doesn't produce a fresh\n// array each render (which would invalidate the serverElements memo below).\nconst NO_CONNECTORS: MCPConnector[] = [];\n\nconst reportCustomStorageFailure = (\n operation: \"load\" | \"save\",\n error: unknown,\n) => {\n console.error(\n `[assistant-ui/react-mcp] failed to ${operation} custom servers:`,\n error,\n );\n};\n\nconst reportBlockedCustomServerPersistence = () => {\n console.error(\n \"[assistant-ui/react-mcp] custom server changes remain in memory because loading the persisted list failed; remount the manager to retry\",\n );\n};\n\nconst persistCustomServers = async (\n storage: MCPStorage,\n records: MCPCustomServerRecord[],\n) => {\n try {\n await storage.saveCustomServers(records);\n } catch (error) {\n reportCustomStorageFailure(\"save\", error);\n }\n};\n\ntype CustomServerPersistenceQueues = Map<string, Promise<void>>;\n\nconst enqueueCustomServerTask = (\n persistenceQueues: CustomServerPersistenceQueues,\n scopeKey: string,\n task: () => Promise<void>,\n) => {\n const previous = persistenceQueues.get(scopeKey);\n const next = (previous ?? Promise.resolve()).then(task);\n persistenceQueues.set(scopeKey, next);\n void next.then(() => {\n if (persistenceQueues.get(scopeKey) === next) {\n persistenceQueues.delete(scopeKey);\n }\n });\n};\n\nconst enqueueCustomServerPersistence = (\n persistenceQueues: CustomServerPersistenceQueues,\n scopeKey: string,\n storage: MCPStorage,\n records: MCPCustomServerRecord[],\n) =>\n enqueueCustomServerTask(persistenceQueues, scopeKey, () =>\n persistCustomServers(storage, records),\n );\n\nconst holdCustomServerPersistence = (\n persistenceQueues: CustomServerPersistenceQueues,\n scopeKey: string,\n) => {\n let release = () => {};\n const gate = new Promise<void>((resolve) => {\n release = resolve;\n });\n enqueueCustomServerTask(persistenceQueues, scopeKey, () => gate);\n return release;\n};\n\nconst deduplicateCustomServers = (records: MCPCustomServerRecord[]) => {\n const seen = new Set<string>();\n return records.filter((record) => {\n if (seen.has(record.id)) {\n console.error(\n `[assistant-ui/react-mcp] ignored duplicate custom server id \"${record.id}\" loaded from storage`,\n );\n return false;\n }\n seen.add(record.id);\n return true;\n });\n};\n\ntype McpCustomServersResourceProps = {\n storage: MCPStorage;\n scopeKey: string;\n persistenceQueues: CustomServerPersistenceQueues;\n};\n\nconst useMcpCustomServersResource = ({\n storage,\n scopeKey,\n persistenceQueues,\n}: McpCustomServersResourceProps) => {\n const [customServers, setCustomServers] = useState<MCPCustomServerRecord[]>(\n [],\n );\n const [isHydrated, setIsHydrated] = useState(false);\n\n const customServersRef = useRef<MCPCustomServerRecord[]>([]);\n const hydrationStateRef = useRef<\"pending\" | \"succeeded\" | \"failed\">(\n \"pending\",\n );\n const hasPendingMutationRef = useRef(false);\n const [removedBeforeHydration] = useState(() => new Set<string>());\n const reportedBlockedPersistenceRef = useRef(false);\n\n const hydrate = useEffectEvent(async (signal: { cancelled: boolean }) => {\n // A revisited scope must not read behind writes still queued against it.\n while (true) {\n const pendingPersistence = persistenceQueues.get(scopeKey);\n if (!pendingPersistence) break;\n await pendingPersistence;\n if (signal.cancelled) return;\n if (persistenceQueues.get(scopeKey) === pendingPersistence) break;\n }\n\n let records: Awaited<ReturnType<typeof storage.loadCustomServers>>;\n try {\n const loadedRecords = await storage.loadCustomServers();\n records = deduplicateCustomServers(loadedRecords);\n } catch (error) {\n if (!signal.cancelled) {\n reportCustomStorageFailure(\"load\", error);\n hydrationStateRef.current = \"failed\";\n if (hasPendingMutationRef.current) {\n reportBlockedCustomServerPersistence();\n reportedBlockedPersistenceRef.current = true;\n }\n setIsHydrated(true);\n }\n return;\n }\n // Merge rather than replace so any addCustomServer calls that\n // happened before hydration resolved aren't silently overwritten.\n // Persisted order wins; pre-hydration locals append.\n const hadPendingMutation = hasPendingMutationRef.current;\n const hydratedRecords = records.filter(\n (record) => !removedBeforeHydration.has(record.id),\n );\n const mergedRecords = (() => {\n const prev = customServersRef.current;\n if (prev.length === 0) return hydratedRecords;\n const persistedIds = new Set(hydratedRecords.map((r) => r.id));\n return [\n ...hydratedRecords,\n ...prev.filter((r) => !persistedIds.has(r.id)),\n ];\n })();\n customServersRef.current = mergedRecords;\n hydrationStateRef.current = \"succeeded\";\n hasPendingMutationRef.current = false;\n if (hadPendingMutation) {\n enqueueCustomServerPersistence(\n persistenceQueues,\n scopeKey,\n storage,\n mergedRecords,\n );\n }\n if (signal.cancelled) return;\n setCustomServers(mergedRecords);\n setIsHydrated(true);\n });\n\n useEffect(() => {\n const signal = { cancelled: false };\n // Hydration reads persisted records asynchronously; there is no earlier\n // point than mount at which to start it.\n // eslint-disable-next-line react-hooks/set-state-in-effect\n void hydrate(signal);\n return () => {\n signal.cancelled = true;\n };\n }, []);\n\n const updateCustomServers = useCallback(\n (\n updater: (records: MCPCustomServerRecord[]) => MCPCustomServerRecord[],\n ) => {\n const next = updater(customServersRef.current);\n customServersRef.current = next;\n setCustomServers(next);\n\n if (hydrationStateRef.current === \"succeeded\") {\n enqueueCustomServerPersistence(\n persistenceQueues,\n scopeKey,\n storage,\n next,\n );\n return;\n }\n\n hasPendingMutationRef.current = true;\n if (\n hydrationStateRef.current === \"failed\" &&\n !reportedBlockedPersistenceRef.current\n ) {\n reportBlockedCustomServerPersistence();\n reportedBlockedPersistenceRef.current = true;\n }\n },\n [persistenceQueues, scopeKey, storage],\n );\n\n const removeCustomServer = useCallback(\n (id: string) => {\n if (hydrationStateRef.current === \"pending\") {\n removedBeforeHydration.add(id);\n }\n updateCustomServers((prev) => prev.filter((record) => record.id !== id));\n },\n [removedBeforeHydration, updateCustomServers],\n );\n\n return {\n customServers,\n isHydrated,\n updateCustomServers,\n removeCustomServer,\n };\n};\n\nconst McpCustomServersResource = resource(useMcpCustomServersResource);\n\nconst useMcpManagerResource = (\n props: McpManagerResourceProps,\n): ClientOutput<\"mcp\"> => {\n const connectors = props.connectors ?? NO_CONNECTORS;\n const autoConnect = props.autoConnect ?? true;\n const redirectUri = props.oauthRedirectUri ?? defaultRedirectUri();\n const connectionTimeout = props.connectionTimeout;\n\n const storageElement = props.storage ?? McpLocalStorage();\n const storage = useResource(storageElement);\n const [persistenceQueues] = useState<CustomServerPersistenceQueues>(\n () => new Map(),\n );\n const storageScopeKey =\n storage.scopeId === undefined ? \"unscoped\" : `scoped:${storage.scopeId}`;\n const { customServers, isHydrated, updateCustomServers, removeCustomServer } =\n useResource(\n withKey(\n storageScopeKey,\n McpCustomServersResource({\n storage,\n scopeKey: storageScopeKey,\n persistenceQueues,\n }),\n ),\n );\n\n const serverElements = useMemo(() => {\n assertUniqueServerIds([\n ...connectors.map((c) => c.id),\n ...customServers.map((s) => s.id),\n ]);\n\n const connectorElements = connectors.map((c) =>\n withKey(\n c.id,\n McpServerResource({\n id: c.id,\n kind: \"connector\",\n name: c.name,\n url: c.url,\n icon: c.icon,\n auth: c.auth,\n storage,\n redirectUri,\n autoConnect,\n connectionTimeout: c.connectionTimeout ?? connectionTimeout,\n ...(c.cache !== undefined ? { cache: c.cache } : {}),\n ...(c.elicitation !== undefined\n ? { elicitation: c.elicitation }\n : {}),\n onRemove: async () => {\n // connectors cannot be removed\n },\n }),\n ),\n );\n const customElements = customServers.map((s) =>\n withKey(\n s.id,\n McpServerResource(\n withMcpServerRemovalFence(\n {\n id: s.id,\n kind: \"custom\",\n name: s.name,\n url: s.url,\n auth: s.auth,\n storage,\n redirectUri,\n autoConnect,\n connectionTimeout: s.connectionTimeout ?? connectionTimeout,\n ...(s.cache !== undefined ? { cache: s.cache } : {}),\n ...(s.elicitation !== undefined\n ? { elicitation: s.elicitation }\n : {}),\n onRemove: async () => {\n removeCustomServer(s.id);\n },\n },\n () =>\n holdCustomServerPersistence(persistenceQueues, storageScopeKey),\n ),\n ),\n ),\n );\n return [...connectorElements, ...customElements];\n }, [\n connectors,\n customServers,\n storage,\n redirectUri,\n autoConnect,\n connectionTimeout,\n removeCustomServer,\n persistenceQueues,\n storageScopeKey,\n ]);\n\n const lookup = useClientLookup(serverElements);\n\n const state = useMemo<MCPManagerState>(() => {\n const all = lookup.state;\n return {\n servers: all,\n connectors: all.filter((s) => s.kind === \"connector\"),\n customServers: all.filter((s) => s.kind === \"custom\"),\n isHydrated,\n };\n }, [lookup.state, isHydrated]);\n\n // ─── Auto-register MCP tools as frontend tools in modelContext ─────\n // Build the toolkit from connected servers; re-register when the visible\n // tool surface changes. Tool names are prefixed with the server id to\n // avoid collisions across connected servers — connector ids must not\n // contain `__` (enforced by `defineConnector`); `addCustomServer`\n // generates UUIDs that satisfy the constraint by construction.\n const toolkit = useMemo<Record<string, Tool<any, any>>>(() => {\n const out: Record<string, Tool<any, any>> = {};\n for (const server of state.servers) {\n if (server.connectionState !== \"connected\") continue;\n for (const tool of server.tools) {\n const fullName = `${server.id}__${tool.name}`;\n out[fullName] = {\n type: \"frontend\",\n ...(tool.description !== undefined\n ? { description: tool.description }\n : {}),\n parameters: tool.inputSchema as never,\n execute: (args) =>\n lookup.get({ key: server.id }).callTool(tool.name, args as unknown),\n };\n }\n }\n return out;\n }, [state, lookup]);\n\n const clientRef = useAssistantClientRef();\n\n useAssistantScopeEffect(\n \"modelContext\",\n () => {\n const client = clientRef.current;\n if (!client) return;\n return client.modelContext.register({\n getModelContext: () => ({ tools: toolkit }),\n });\n },\n [toolkit],\n );\n\n const serverByKind = (kind: \"connector\" | \"custom\", index: number) => {\n const list = kind === \"connector\" ? state.connectors : state.customServers;\n const entry = list[index];\n if (!entry) {\n throw new Error(\n `McpManagerResource: no ${kind} at index ${index} (length ${list.length})`,\n );\n }\n return lookup.get({ key: entry.id });\n };\n\n return {\n getState: () => state,\n server: (query) => {\n if (\"id\" in query) return lookup.get({ key: query.id });\n return serverByKind(query.kind, query.index);\n },\n connector: ({ index }) => serverByKind(\"connector\", index),\n customServer: ({ index }) => serverByKind(\"custom\", index),\n addCustomServer: async ({\n name,\n url,\n auth,\n connectionTimeout,\n cache,\n elicitation,\n }) => {\n const record: MCPCustomServerRecord = {\n id: createMcpId(),\n name,\n url,\n auth: auth as MCPAuthConfig,\n connectionTimeout,\n ...(cache !== undefined ? { cache } : {}),\n ...(elicitation !== undefined ? { elicitation } : {}),\n createdAt: Date.now(),\n };\n updateCustomServers((prev) => [...prev, record]);\n return record.id;\n },\n removeServer: async (id) => {\n // removeServer is custom-server only — connectors are app-defined\n // and not user-removable. Refuse rather than silently no-op.\n if (state.connectors.some((c) => c.id === id)) {\n throw new Error(\n `Cannot remove connector \"${id}\" — connectors are app-defined and not removable. Use a custom server id instead.`,\n );\n }\n // Delegate to McpServerResource.remove() which disconnects,\n // clears auth state, and unregisters from customServers in one\n // place. Fallback to manual cleanup if the lookup is empty\n // (server already gone).\n try {\n await lookup.get({ key: id }).remove();\n } catch {\n const releasePersistence = holdCustomServerPersistence(\n persistenceQueues,\n storageScopeKey,\n );\n try {\n await clearOAuthProviderAuthState(storage, id);\n removeCustomServer(id);\n } catch (error) {\n releasePersistence();\n throw error;\n }\n releasePersistence();\n }\n },\n };\n};\n\nexport const McpManagerResource = resource(useMcpManagerResource);\n\n// Ensure modelContext exists as a sibling when the manager mounts. If an\n// ancestor (e.g. a chat runtime) already provides modelContext, this is a\n// no-op; otherwise it's auto-mounted alongside `mcp`.\nattachTransformScopes(useMcpManagerResource, (scopes, parent) => {\n if (!scopes.modelContext && parent.modelContext.source === null) {\n scopes.modelContext = ModelContext();\n }\n});\n"],"mappings":";;;;;;;;;;;;;AA2CA,SAASkC,qBAA6B;CACpC,IAAI,OAAOC,WAAW,aAAa,OAAO;CAC1C,OAAO,GAAGA,OAAOC,SAASC,OAAM;AAClC;AAIA,MAAMC,gBAAgC,CAAA;AAEtC,MAAMC,8BACJC,WACAC,UACG;CACHC,QAAQD,MACN,sCAAsCD,UAAS,mBAC/CC,KACF;AACF;AAEA,MAAME,6CAA6C;CACjDD,QAAQD,MACN,yIACF;AACF;AAEA,MAAMG,uBAAuB,OAC3Bd,SACAe,YACG;CACH,IAAI;EACF,MAAMf,QAAQgB,kBAAkBD,OAAO;CACzC,SAASJ,OAAO;EACdF,2BAA2B,QAAQE,KAAK;CAC1C;AACF;AAIA,MAAMS,2BACJC,mBACAC,UACAC,SACG;CAEH,MAAMG,QADWL,k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AA,uBAWpB,IAAI9E,IAAI;AAAC;AAXW,SAAAkF,OAAAG,GAAA;CAAA,OA6BCA,EAAC9D;AAAG;AA7BL,SAAA4D,OAAAc,GAAA;CAAA,OA8BIA,EAAC1E;AAAG;AA9BR,eAAAuE,SAAA,CAAA;AAAA,SAAAS,OAAAwD,KAAA;CAAA,OAyGM9D,IAACX,SAAU;AAAW;AAzG5B,SAAAkB,OAAAwD,KAAA;CAAA,OA0GS/D,IAACX,SAAU;AAAQ"}
|
|
1
|
+
{"version":3,"file":"McpManagerResource.js","names":["useState","useEffect","useMemo","useEffectEvent","useRef","useCallback","useResource","resource","withKey","useClientLookup","useAssistantClientRef","attachTransformScopes","ClientOutput","useAssistantScopeEffect","ModelContext","createMcpId","clearOAuthProviderAuthState","Tool","McpServerResource","withMcpServerRemovalFence","McpLocalStorage","MCPStorage","MCPStorageElement","assertUniqueServerIds","MCPAuthConfig","MCPConnector","MCPCustomServerRecord","MCPManagerState","McpManagerResourceProps","connectors","storage","oauthRedirectUri","autoConnect","connectionTimeout","defaultRedirectUri","window","location","origin","NO_CONNECTORS","reportCustomStorageFailure","operation","error","console","reportBlockedCustomServerPersistence","persistCustomServers","records","saveCustomServers","CustomServerPersistenceQueues","Map","Promise","enqueueCustomServerTask","persistenceQueues","scopeKey","task","previous","get","next","resolve","then","set","delete","enqueueCustomServerPersistence","holdCustomServerPersistence","release","gate","deduplicateCustomServers","seen","Set","filter","record","has","id","add","McpCustomServersResourceProps","useMcpCustomServersResource","t0","$","_c","t1","Symbol","for","customServers","setCustomServers","isHydrated","setIsHydrated","t2","customServersRef","hydrationStateRef","hasPendingMutationRef","removedBeforeHydration","_temp","reportedBlockedPersistenceRef","t3","signal","pendingPersistence","cancelled","loadedRecords","loadCustomServers","t4","current","hadPendingMutation","hydratedRecords","mergedRecords","prev","length","persistedIds","map","_temp2","r_0","r","hydrate","signal_0","t5","t6","updater","updateCustomServers","t7","prev_0","record_0","removeCustomServer","t8","McpCustomServersResource","useMcpManagerResource","props","redirectUri","storageElement","_temp3","storageScopeKey","scopeId","undefined","_temp4","_temp5","c_0","c","kind","name","url","icon","auth","cache","elicitation","onRemove","_temp6","connectorElements","s_0","s","customElements","serverElements","lookup","all","state","_temp7","_temp8","servers","out","server","connectionState","tool","tools","fullName","type","description","parameters","inputSchema","execute","args","key","callTool","toolkit","clientRef","client","modelContext","register","getModelContext","t9","index","list","entry","Error","serverByKind","t10","t11","query","t12","t13","t14","index_0","t15","index_1","connectionTimeout_0","createdAt","Date","now","some","c_1","remove","releasePersistence","t16","getState","connector","customServer","addCustomServer","removeServer","McpManagerResource","scopes","parent","source","s_1","s_2","_c","storageElement","serverElements"],"sources":["../../src/resources/McpManagerResource.ts"],"sourcesContent":["import {\n useState,\n useEffect,\n useMemo,\n useEffectEvent,\n useRef,\n useCallback,\n} from \"react\";\nimport { useResource, resource, withKey } from \"@assistant-ui/tap\";\nimport {\n useClientLookup,\n useAssistantClientRef,\n attachTransformScopes,\n type ClientOutput,\n} from \"@assistant-ui/store\";\nimport { useAssistantScopeEffect } from \"@assistant-ui/store/client\";\nimport { ModelContext } from \"@assistant-ui/core/store\";\nimport { createMcpId } from \"../utils/createMcpId\";\nimport { clearOAuthProviderAuthState } from \"../auth/createOAuthProvider\";\nimport type { Tool } from \"assistant-stream\";\nimport { McpServerResource } from \"./McpServerResource\";\nimport { withMcpServerRemovalFence } from \"./McpServerRemovalFence\";\nimport { McpLocalStorage } from \"./storage/McpLocalStorage\";\nimport type { MCPStorage, MCPStorageElement } from \"./storage/types\";\nimport { assertUniqueServerIds } from \"../utils/serverId\";\nimport type {\n MCPAuthConfig,\n MCPConnector,\n MCPCustomServerRecord,\n MCPManagerState,\n} from \"../mcp-scope\";\n\nexport type McpManagerResourceProps = {\n connectors?: MCPConnector[] | undefined;\n storage?: MCPStorageElement | undefined;\n /** OAuth redirect target. Defaults to `${origin}/mcp/callback`. */\n oauthRedirectUri?: string | undefined;\n /** Connect on mount when usable auth exists. Default true. */\n autoConnect?: boolean | undefined;\n /** Optional timeout in milliseconds for connect/listTools calls. Disabled by default. */\n connectionTimeout?: number | undefined;\n};\n\nfunction defaultRedirectUri(): string {\n if (typeof window === \"undefined\") return \"\";\n return `${window.location.origin}/mcp/callback`;\n}\n\n// Stable empty fallback so an absent `connectors` prop doesn't produce a fresh\n// array each render (which would invalidate the serverElements memo below).\nconst NO_CONNECTORS: MCPConnector[] = [];\n\nconst reportCustomStorageFailure = (\n operation: \"load\" | \"save\",\n error: unknown,\n) => {\n console.error(\n `[assistant-ui/react-mcp] failed to ${operation} custom servers:`,\n error,\n );\n};\n\nconst reportBlockedCustomServerPersistence = () => {\n console.error(\n \"[assistant-ui/react-mcp] custom server changes remain in memory because loading the persisted list failed; remount the manager to retry\",\n );\n};\n\nconst persistCustomServers = async (\n storage: MCPStorage,\n records: MCPCustomServerRecord[],\n) => {\n try {\n await storage.saveCustomServers(records);\n } catch (error) {\n reportCustomStorageFailure(\"save\", error);\n }\n};\n\ntype CustomServerPersistenceQueues = Map<string, Promise<void>>;\n\nconst enqueueCustomServerTask = (\n persistenceQueues: CustomServerPersistenceQueues,\n scopeKey: string,\n task: () => Promise<void>,\n) => {\n const previous = persistenceQueues.get(scopeKey);\n const next = (previous ?? Promise.resolve()).then(task);\n persistenceQueues.set(scopeKey, next);\n void next.then(() => {\n if (persistenceQueues.get(scopeKey) === next) {\n persistenceQueues.delete(scopeKey);\n }\n });\n};\n\nconst enqueueCustomServerPersistence = (\n persistenceQueues: CustomServerPersistenceQueues,\n scopeKey: string,\n storage: MCPStorage,\n records: MCPCustomServerRecord[],\n) =>\n enqueueCustomServerTask(persistenceQueues, scopeKey, () =>\n persistCustomServers(storage, records),\n );\n\nconst holdCustomServerPersistence = (\n persistenceQueues: CustomServerPersistenceQueues,\n scopeKey: string,\n) => {\n let release = () => {};\n const gate = new Promise<void>((resolve) => {\n release = resolve;\n });\n enqueueCustomServerTask(persistenceQueues, scopeKey, () => gate);\n return release;\n};\n\nconst deduplicateCustomServers = (records: MCPCustomServerRecord[]) => {\n const seen = new Set<string>();\n return records.filter((record) => {\n if (seen.has(record.id)) {\n console.error(\n `[assistant-ui/react-mcp] ignored duplicate custom server id \"${record.id}\" loaded from storage`,\n );\n return false;\n }\n seen.add(record.id);\n return true;\n });\n};\n\ntype McpCustomServersResourceProps = {\n storage: MCPStorage;\n scopeKey: string;\n persistenceQueues: CustomServerPersistenceQueues;\n};\n\nconst useMcpCustomServersResource = ({\n storage,\n scopeKey,\n persistenceQueues,\n}: McpCustomServersResourceProps) => {\n const [customServers, setCustomServers] = useState<MCPCustomServerRecord[]>(\n [],\n );\n const [isHydrated, setIsHydrated] = useState(false);\n\n const customServersRef = useRef<MCPCustomServerRecord[]>([]);\n const hydrationStateRef = useRef<\"pending\" | \"succeeded\" | \"failed\">(\n \"pending\",\n );\n const hasPendingMutationRef = useRef(false);\n const [removedBeforeHydration] = useState(() => new Set<string>());\n const reportedBlockedPersistenceRef = useRef(false);\n\n const hydrate = useEffectEvent(async (signal: { cancelled: boolean }) => {\n // A revisited scope must not read behind writes still queued against it.\n while (true) {\n const pendingPersistence = persistenceQueues.get(scopeKey);\n if (!pendingPersistence) break;\n await pendingPersistence;\n if (signal.cancelled) return;\n if (persistenceQueues.get(scopeKey) === pendingPersistence) break;\n }\n\n let records: Awaited<ReturnType<typeof storage.loadCustomServers>>;\n try {\n const loadedRecords = await storage.loadCustomServers();\n records = deduplicateCustomServers(loadedRecords);\n } catch (error) {\n if (!signal.cancelled) {\n reportCustomStorageFailure(\"load\", error);\n hydrationStateRef.current = \"failed\";\n if (hasPendingMutationRef.current) {\n reportBlockedCustomServerPersistence();\n reportedBlockedPersistenceRef.current = true;\n }\n setIsHydrated(true);\n }\n return;\n }\n // Merge rather than replace so any addCustomServer calls that\n // happened before hydration resolved aren't silently overwritten.\n // Persisted order wins; pre-hydration locals append.\n const hadPendingMutation = hasPendingMutationRef.current;\n const hydratedRecords = records.filter(\n (record) => !removedBeforeHydration.has(record.id),\n );\n const mergedRecords = (() => {\n const prev = customServersRef.current;\n if (prev.length === 0) return hydratedRecords;\n const persistedIds = new Set(hydratedRecords.map((r) => r.id));\n return [\n ...hydratedRecords,\n ...prev.filter((r) => !persistedIds.has(r.id)),\n ];\n })();\n customServersRef.current = mergedRecords;\n hydrationStateRef.current = \"succeeded\";\n hasPendingMutationRef.current = false;\n if (hadPendingMutation) {\n enqueueCustomServerPersistence(\n persistenceQueues,\n scopeKey,\n storage,\n mergedRecords,\n );\n }\n if (signal.cancelled) return;\n setCustomServers(mergedRecords);\n setIsHydrated(true);\n });\n\n useEffect(() => {\n const signal = { cancelled: false };\n // Hydration reads persisted records asynchronously; there is no earlier\n // point than mount at which to start it.\n // eslint-disable-next-line react-hooks/set-state-in-effect\n void hydrate(signal);\n return () => {\n signal.cancelled = true;\n };\n }, []);\n\n const updateCustomServers = useCallback(\n (\n updater: (records: MCPCustomServerRecord[]) => MCPCustomServerRecord[],\n ) => {\n const next = updater(customServersRef.current);\n customServersRef.current = next;\n setCustomServers(next);\n\n if (hydrationStateRef.current === \"succeeded\") {\n enqueueCustomServerPersistence(\n persistenceQueues,\n scopeKey,\n storage,\n next,\n );\n return;\n }\n\n hasPendingMutationRef.current = true;\n if (\n hydrationStateRef.current === \"failed\" &&\n !reportedBlockedPersistenceRef.current\n ) {\n reportBlockedCustomServerPersistence();\n reportedBlockedPersistenceRef.current = true;\n }\n },\n [persistenceQueues, scopeKey, storage],\n );\n\n const removeCustomServer = useCallback(\n (id: string) => {\n if (hydrationStateRef.current === \"pending\") {\n removedBeforeHydration.add(id);\n }\n updateCustomServers((prev) => prev.filter((record) => record.id !== id));\n },\n [removedBeforeHydration, updateCustomServers],\n );\n\n return {\n customServers,\n isHydrated,\n updateCustomServers,\n removeCustomServer,\n };\n};\n\nconst McpCustomServersResource = resource(useMcpCustomServersResource);\n\nconst useMcpManagerResource = (\n props: McpManagerResourceProps,\n): ClientOutput<\"mcp\"> => {\n const connectors = props.connectors ?? NO_CONNECTORS;\n const autoConnect = props.autoConnect ?? true;\n const redirectUri = props.oauthRedirectUri ?? defaultRedirectUri();\n const connectionTimeout = props.connectionTimeout;\n\n const storageElement = props.storage ?? McpLocalStorage();\n const storage = useResource(storageElement);\n const [persistenceQueues] = useState<CustomServerPersistenceQueues>(\n () => new Map(),\n );\n const storageScopeKey =\n storage.scopeId === undefined ? \"unscoped\" : `scoped:${storage.scopeId}`;\n const { customServers, isHydrated, updateCustomServers, removeCustomServer } =\n useResource(\n withKey(\n storageScopeKey,\n McpCustomServersResource({\n storage,\n scopeKey: storageScopeKey,\n persistenceQueues,\n }),\n ),\n );\n\n const serverElements = useMemo(() => {\n assertUniqueServerIds([\n ...connectors.map((c) => c.id),\n ...customServers.map((s) => s.id),\n ]);\n\n const connectorElements = connectors.map((c) =>\n withKey(\n c.id,\n McpServerResource({\n id: c.id,\n kind: \"connector\",\n name: c.name,\n url: c.url,\n icon: c.icon,\n auth: c.auth,\n storage,\n redirectUri,\n autoConnect,\n connectionTimeout: c.connectionTimeout ?? connectionTimeout,\n ...(c.cache !== undefined ? { cache: c.cache } : {}),\n ...(c.elicitation !== undefined\n ? { elicitation: c.elicitation }\n : {}),\n onRemove: async () => {\n // connectors cannot be removed\n },\n }),\n ),\n );\n const customElements = customServers.map((s) =>\n withKey(\n s.id,\n McpServerResource(\n withMcpServerRemovalFence(\n {\n id: s.id,\n kind: \"custom\",\n name: s.name,\n url: s.url,\n auth: s.auth,\n storage,\n redirectUri,\n autoConnect,\n connectionTimeout: s.connectionTimeout ?? connectionTimeout,\n ...(s.cache !== undefined ? { cache: s.cache } : {}),\n ...(s.elicitation !== undefined\n ? { elicitation: s.elicitation }\n : {}),\n onRemove: async () => {\n removeCustomServer(s.id);\n },\n },\n () =>\n holdCustomServerPersistence(persistenceQueues, storageScopeKey),\n ),\n ),\n ),\n );\n return [...connectorElements, ...customElements];\n }, [\n connectors,\n customServers,\n storage,\n redirectUri,\n autoConnect,\n connectionTimeout,\n removeCustomServer,\n persistenceQueues,\n storageScopeKey,\n ]);\n\n const lookup = useClientLookup(serverElements);\n\n const state = useMemo<MCPManagerState>(() => {\n const all = lookup.state;\n return {\n servers: all,\n connectors: all.filter((s) => s.kind === \"connector\"),\n customServers: all.filter((s) => s.kind === \"custom\"),\n isHydrated,\n };\n }, [lookup.state, isHydrated]);\n\n // ─── Auto-register MCP tools as frontend tools in modelContext ─────\n // Build the toolkit from connected servers; re-register when the visible\n // tool surface changes. Tool names are prefixed with the server id to\n // avoid collisions across connected servers — connector ids must not\n // contain `__` (enforced by `defineConnector`); `addCustomServer`\n // generates UUIDs that satisfy the constraint by construction.\n const toolkit = useMemo<Record<string, Tool<any, any>>>(() => {\n const out: Record<string, Tool<any, any>> = {};\n for (const server of state.servers) {\n if (server.connectionState !== \"connected\") continue;\n for (const tool of server.tools) {\n const fullName = `${server.id}__${tool.name}`;\n out[fullName] = {\n type: \"frontend\",\n ...(tool.description !== undefined\n ? { description: tool.description }\n : {}),\n parameters: tool.inputSchema as never,\n execute: (args) =>\n lookup.get({ key: server.id }).callTool(tool.name, args as unknown),\n };\n }\n }\n return out;\n }, [state, lookup]);\n\n const clientRef = useAssistantClientRef();\n\n useAssistantScopeEffect(\n \"modelContext\",\n () => {\n const client = clientRef.current;\n if (!client) return;\n return client.modelContext.register({\n getModelContext: () => ({ tools: toolkit }),\n });\n },\n [toolkit],\n );\n\n const serverByKind = (kind: \"connector\" | \"custom\", index: number) => {\n const list = kind === \"connector\" ? state.connectors : state.customServers;\n const entry = list[index];\n if (!entry) {\n throw new Error(\n `McpManagerResource: no ${kind} at index ${index} (length ${list.length})`,\n );\n }\n return lookup.get({ key: entry.id });\n };\n\n return {\n getState: () => state,\n server: (query) => {\n if (\"id\" in query) return lookup.get({ key: query.id });\n return serverByKind(query.kind, query.index);\n },\n connector: ({ index }) => serverByKind(\"connector\", index),\n customServer: ({ index }) => serverByKind(\"custom\", index),\n addCustomServer: async ({\n name,\n url,\n auth,\n connectionTimeout,\n cache,\n elicitation,\n }) => {\n const record: MCPCustomServerRecord = {\n id: createMcpId(),\n name,\n url,\n auth: auth as MCPAuthConfig,\n connectionTimeout,\n ...(cache !== undefined ? { cache } : {}),\n ...(elicitation !== undefined ? { elicitation } : {}),\n createdAt: Date.now(),\n };\n updateCustomServers((prev) => [...prev, record]);\n return record.id;\n },\n removeServer: async (id) => {\n // removeServer is custom-server only — connectors are app-defined\n // and not user-removable. Refuse rather than silently no-op.\n if (state.connectors.some((c) => c.id === id)) {\n throw new Error(\n `Cannot remove connector \"${id}\" — connectors are app-defined and not removable. Use a custom server id instead.`,\n );\n }\n // Delegate to McpServerResource.remove() which disconnects,\n // clears auth state, and unregisters from customServers in one\n // place. Fallback to manual cleanup if the lookup is empty\n // (server already gone).\n try {\n await lookup.get({ key: id }).remove();\n } catch {\n const releasePersistence = holdCustomServerPersistence(\n persistenceQueues,\n storageScopeKey,\n );\n try {\n await clearOAuthProviderAuthState(storage, id);\n removeCustomServer(id);\n } catch (error) {\n releasePersistence();\n throw error;\n }\n releasePersistence();\n }\n },\n };\n};\n\nexport const McpManagerResource = resource(useMcpManagerResource);\n\n// Ensure modelContext exists as a sibling when the manager mounts. If an\n// ancestor (e.g. a chat runtime) already provides modelContext, this is a\n// no-op; otherwise it's auto-mounted alongside `mcp`.\nattachTransformScopes(useMcpManagerResource, (scopes, parent) => {\n if (!scopes.modelContext && parent.modelContext.source === null) {\n scopes.modelContext = ModelContext();\n }\n});\n"],"mappings":";;;;;;;;;;;;;AA2CA,SAASkC,qBAA6B;CACpC,IAAI,OAAOC,WAAW,aAAa,OAAO;CAC1C,OAAO,GAAGA,OAAOC,SAASC,OAAM;AAClC;AAIA,MAAMC,gBAAgC,CAAA;AAEtC,MAAMC,8BACJC,WACAC,UACG;CACHC,QAAQD,MACN,sCAAsCD,UAAS,mBAC/CC,KACF;AACF;AAEA,MAAME,6CAA6C;CACjDD,QAAQD,MACN,yIACF;AACF;AAEA,MAAMG,uBAAuB,OAC3Bd,SACAe,YACG;CACH,IAAI;EACF,MAAM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CAAC;AAjXmC,SAAA4E,QAAA;CAAA,uBAec,IAAIvB,IAAY;AAAC;AAf/B,SAAAwC,OAAAE,GAAA;CAAA,OAsD0BA,EAACtC;AAAG;AAmFpC,SAAAuD,SAAA;CAAA,uBAWpB,IAAI9E,IAAI;AAAC;AAXW,SAAAkF,OAAAG,GAAA;CAAA,OA6BCA,EAAC9D;AAAG;AA7BL,SAAA4D,OAAAc,GAAA;CAAA,OA8BIA,EAAC1E;AAAG;AA9BR,eAAAuE,SAAA,CAAA;AAAA,SAAAS,OAAAwD,KAAA;CAAA,OAyGM9D,IAACX,SAAU;AAAW;AAzG5B,SAAAkB,OAAAwD,KAAA;CAAA,OA0GS/D,IAACX,SAAU;AAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpLocalStorage.js","names":["resource","useMemo","OAuthMetadataSchema","OAuthClientInformationFullSchema","OAuthProtectedResourceMetadataSchema","OAuthTokensSchema","normalizeMcpServerUrl","MCPAuthConfig","MCPCustomServerRecord","MCPPersistedAuthState","assertValidServerId","MCPStorage","McpLocalStorageOptions","keyPrefix","storage","Storage","scopeId","resolveStorage","opts","globalThis","localStorage","isRecord","value","Record","Array","isArray","isOptionalString","undefined","isNonEmptyString","trim","length","isOptionalNonEmptyString","isOptionalStringArray","every","item","isOptionalConnectionTimeout","Number","isFinite","isValidServerId","id","isMCPAuthConfig","auth","type","token","scopes","authorizationEndpoint","tokenEndpoint","registrationEndpoint","clientId","clientSecret","isCustomServerRecord","name","url","createdAt","connectionTimeout","normalizeCustomServerRecord","record","normalizeCustomServerRecords","flatMap","normalizeOAuthTokens","result","safeParse","success","data","normalizeClientInformation","isSecureNetworkUrl","URL","isIpv4Loopback","test","hostname","protocol","endsWith","isMcpServerUrl","normalizeDiscoveryState","authorizationServerUrl","state","NonNullable","resourceMetadataUrl","metadata","authorizationServerMetadata","resourceMetadata","normalizePersistedAuthState","serverUrl","tokensClientId","codeVerifier","tokens","clientInformation","clientInformationSource","discoveryState","Object","keys","useMcpLocalStorage","t0","$","_c","t1","prefix","t2","customServersKey","t3","authKey","t4","key","fallback","raw","getItem","JSON","parse","T","read","t5","key_0","setItem","stringify","write","t6","key_1","removeItem","remove","t7","t8","t9","records","t10","id_0","t11","id_1","t12","id_2","t13","loadCustomServers","saveCustomServers","loadAuthState","saveAuthState","clearAuthState","McpLocalStorage"],"sources":["../../../src/resources/storage/McpLocalStorage.ts"],"sourcesContent":["import { resource } from \"@assistant-ui/tap\";\nimport { useMemo } from \"react\";\nimport {\n OAuthMetadataSchema,\n OAuthClientInformationFullSchema,\n OAuthProtectedResourceMetadataSchema,\n OAuthTokensSchema,\n} from \"@modelcontextprotocol/core\";\nimport { normalizeMcpServerUrl } from \"../../utils/serverUrl\";\nimport type { MCPAuthConfig, MCPCustomServerRecord } from \"../../mcp-scope\";\nimport type { MCPPersistedAuthState } from \"../../auth/types\";\nimport { assertValidServerId } from \"../../utils/serverId\";\nimport type { MCPStorage } from \"./types\";\n\nexport type McpLocalStorageOptions = {\n /** Namespace prefix for keys. Default \"aui-mcp\". */\n keyPrefix?: string;\n /** Override the underlying Storage. Defaults to globalThis.localStorage. */\n storage?: Storage;\n /**\n * Stable identity for the backing data, used to key server reconnects.\n * Required to get reconnect-on-swap behavior when `storage` is overridden;\n * without it a custom backing store declares no scope, since a prefix\n * alone cannot distinguish two different stores.\n */\n scopeId?: string;\n};\n\nfunction resolveStorage(opts: McpLocalStorageOptions): Storage | null {\n if (opts.storage) return opts.storage;\n if (typeof globalThis !== \"undefined\" && \"localStorage\" in globalThis) {\n try {\n return (globalThis as { localStorage: Storage }).localStorage;\n } catch {\n return null;\n }\n }\n return null;\n}\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nconst isOptionalString = (value: unknown): value is string | undefined =>\n value === undefined || typeof value === \"string\";\n\nconst isNonEmptyString = (value: unknown): value is string =>\n typeof value === \"string\" && value.trim().length > 0;\n\nconst isOptionalNonEmptyString = (\n value: unknown,\n): value is string | undefined =>\n value === undefined || isNonEmptyString(value);\n\nconst isOptionalStringArray = (value: unknown): value is string[] | undefined =>\n value === undefined ||\n (Array.isArray(value) && value.every((item) => typeof item === \"string\"));\n\nconst isOptionalConnectionTimeout = (\n value: unknown,\n): value is number | undefined =>\n value === undefined ||\n (typeof value === \"number\" && Number.isFinite(value) && value >= 0);\n\nconst isValidServerId = (id: string): boolean => {\n try {\n assertValidServerId(id);\n return true;\n } catch {\n return false;\n }\n};\n\nconst isMCPAuthConfig = (auth: unknown): auth is MCPAuthConfig => {\n if (!isRecord(auth)) return false;\n\n switch (auth.type) {\n case \"none\":\n return true;\n case \"bearer\":\n return isOptionalNonEmptyString(auth.token);\n case \"oauth\":\n return (\n isOptionalStringArray(auth.scopes) &&\n isOptionalString(auth.authorizationEndpoint) &&\n isOptionalString(auth.tokenEndpoint) &&\n isOptionalString(auth.registrationEndpoint) &&\n isOptionalString(auth.clientId) &&\n isOptionalString(auth.clientSecret)\n );\n default:\n return false;\n }\n};\n\nconst isCustomServerRecord = (\n value: unknown,\n): value is MCPCustomServerRecord => {\n if (!isRecord(value)) return false;\n if (typeof value.id !== \"string\" || !isValidServerId(value.id)) {\n return false;\n }\n return (\n isNonEmptyString(value.name) &&\n isNonEmptyString(value.url) &&\n Number.isFinite(value.createdAt) &&\n isMCPAuthConfig(value.auth) &&\n isOptionalConnectionTimeout(value.connectionTimeout)\n );\n};\n\nconst normalizeCustomServerRecord = (\n value: unknown,\n): MCPCustomServerRecord | null => {\n if (isCustomServerRecord(value)) return value;\n if (!isRecord(value)) return null;\n\n const record = { ...value };\n delete record.connectionTimeout;\n return isCustomServerRecord(record) ? record : null;\n};\n\nexport const normalizeCustomServerRecords = (\n value: unknown,\n): MCPCustomServerRecord[] => {\n if (!Array.isArray(value)) return [];\n return value.flatMap((item) => {\n const record = normalizeCustomServerRecord(item);\n return record === null ? [] : [record];\n });\n};\n\nconst normalizeOAuthTokens = (\n value: unknown,\n): MCPPersistedAuthState[\"tokens\"] | undefined => {\n const result = OAuthTokensSchema.safeParse(value);\n return result.success ? result.data : undefined;\n};\n\nconst normalizeClientInformation = (\n value: unknown,\n): MCPPersistedAuthState[\"clientInformation\"] | undefined => {\n const result = OAuthClientInformationFullSchema.safeParse(value);\n return result.success ? result.data : undefined;\n};\n\nconst isSecureNetworkUrl = (value: unknown): value is string => {\n if (!isNonEmptyString(value)) return false;\n try {\n const url = new URL(value);\n const isIpv4Loopback = /^127(?:\\.\\d{1,3}){3}$/.test(url.hostname);\n return (\n url.protocol === \"https:\" ||\n (url.protocol === \"http:\" &&\n (url.hostname === \"localhost\" ||\n url.hostname.endsWith(\".localhost\") ||\n isIpv4Loopback ||\n url.hostname === \"[::1]\"))\n );\n } catch {\n return false;\n }\n};\n\nconst isMcpServerUrl = (value: unknown): value is string => {\n if (typeof value !== \"string\") return false;\n try {\n const url = new URL(value);\n return url.protocol === \"https:\" || url.protocol === \"http:\";\n } catch {\n return false;\n }\n};\n\nconst normalizeDiscoveryState = (\n value: unknown,\n): MCPPersistedAuthState[\"discoveryState\"] | undefined => {\n if (!isRecord(value) || !isSecureNetworkUrl(value.authorizationServerUrl)) {\n return undefined;\n }\n\n // A malformed optional field is dropped alone: keeping the validated\n // authorization server URL preserves the redirect-time binding, and the SDK\n // re-discovers whatever metadata is missing.\n const state: NonNullable<MCPPersistedAuthState[\"discoveryState\"]> = {\n authorizationServerUrl: value.authorizationServerUrl,\n };\n\n if (isSecureNetworkUrl(value.resourceMetadataUrl)) {\n state.resourceMetadataUrl = value.resourceMetadataUrl;\n }\n\n const metadata = OAuthMetadataSchema.safeParse(\n value.authorizationServerMetadata,\n );\n if (metadata.success) state.authorizationServerMetadata = metadata.data;\n\n const resourceMetadata = OAuthProtectedResourceMetadataSchema.safeParse(\n value.resourceMetadata,\n );\n if (resourceMetadata.success) state.resourceMetadata = resourceMetadata.data;\n\n return state;\n};\n\nexport const normalizePersistedAuthState = (\n value: unknown,\n): MCPPersistedAuthState | null => {\n if (!isRecord(value)) return null;\n if (\"serverUrl\" in value && !isMcpServerUrl(value.serverUrl)) return null;\n\n const state: MCPPersistedAuthState = {};\n if (isMcpServerUrl(value.serverUrl)) {\n state.serverUrl = normalizeMcpServerUrl(value.serverUrl);\n }\n if (isNonEmptyString(value.token)) state.token = value.token;\n if (isNonEmptyString(value.tokensClientId)) {\n state.tokensClientId = value.tokensClientId;\n }\n if (isNonEmptyString(value.codeVerifier)) {\n state.codeVerifier = value.codeVerifier;\n }\n if (isNonEmptyString(value.state)) state.state = value.state;\n\n const tokens = normalizeOAuthTokens(value.tokens);\n if (tokens) state.tokens = tokens;\n\n const clientInformation = normalizeClientInformation(value.clientInformation);\n if (clientInformation) state.clientInformation = clientInformation;\n if (value.clientInformationSource === \"registered\") {\n state.clientInformationSource = value.clientInformationSource;\n }\n\n const discoveryState = normalizeDiscoveryState(value.discoveryState);\n if (discoveryState) state.discoveryState = discoveryState;\n\n return Object.keys(state).length > 0 ? state : null;\n};\n\nconst useMcpLocalStorage = (opts: McpLocalStorageOptions = {}): MCPStorage => {\n const prefix = opts.keyPrefix ?? \"aui-mcp\";\n const storage = resolveStorage(opts);\n // Deriving a scope from the prefix is only honest for the shared\n // globalThis.localStorage; two custom backing stores under one prefix hold\n // different data, so an overridden backing declares no scope unless the\n // caller names one.\n const scopeId =\n opts.scopeId ??\n (opts.storage === undefined ? `local-storage:${prefix}` : undefined);\n\n // Callers key per-server coordination state on this instance, so it has to\n // stay referentially stable for as long as the underlying store does.\n return useMemo(() => {\n const customServersKey = `${prefix}:custom-servers`;\n const authKey = (id: string) => `${prefix}:auth:${id}`;\n\n const read = <T>(key: string, fallback: T): T => {\n if (!storage) return fallback;\n try {\n const raw = storage.getItem(key);\n if (raw == null) return fallback;\n return JSON.parse(raw) as T;\n } catch {\n return fallback;\n }\n };\n\n const write = (key: string, value: unknown): void => {\n if (!storage) return;\n try {\n storage.setItem(key, JSON.stringify(value));\n } catch {\n // quota or serialization failure — silently drop\n }\n };\n\n const remove = (key: string): void => {\n if (!storage) return;\n try {\n storage.removeItem(key);\n } catch {\n // ignore\n }\n };\n\n return {\n ...(scopeId !== undefined ? { scopeId } : {}),\n loadCustomServers: async () =>\n normalizeCustomServerRecords(read<unknown>(customServersKey, [])),\n saveCustomServers: async (records) => {\n write(customServersKey, records);\n },\n loadAuthState: async (id) =>\n normalizePersistedAuthState(read<unknown>(authKey(id), null)),\n saveAuthState: async (id, state) => {\n write(authKey(id), state);\n },\n clearAuthState: async (id) => {\n remove(authKey(id));\n },\n };\n }, [prefix, storage, scopeId]);\n};\n\nexport const McpLocalStorage = resource(useMcpLocalStorage);\n"],"mappings":";;;;;;;AA4BA,SAASiB,eAAeC,MAA8C;CACpE,IAAIA,KAAKJ,SAAS,OAAOI,KAAKJ;CAC9B,IAAI,OAAOK,eAAe,eAAe,kBAAkBA,YACzD,IAAI;EACF,OAAQA,WAAyCC;CACnD,QAAQ;EACN,OAAO;CACT;CAEF,OAAO;AACT;AAEA,MAAMC,YAAYC,UAChB,OAAOA,UAAU,YAAYA,UAAU,QAAQ,CAACE,MAAMC,QAAQH,KAAK;AAErE,MAAMI,oBAAoBJ,UACxBA,UAAUK,KAAAA,KAAa,OAAOL,UAAU;AAE1C,MAAMM,oBAAoBN,UACxB,OAAOA,UAAU,YAAYA,MAAMO,KAAK,CAAC,CAACC,SAAS;AAErD,MAAMC,4BACJT,UAEAA,UAAUK,KAAAA,KAAaC,iBAAiBN,KAAK;AAE/C,MAAMU,yBAAyBV,UAC7BA,UAAUK,KAAAA,KACTH,MAAMC,QAAQH,KAAK,KAAKA,MAAMW,OAAOC,SAAS,OAAOA,SAAS,QAAQ;AAEzE,MAAMC,+BACJb,UAEAA,UAAUK,KAAAA,KACT,OAAOL,UAAU,YAAYc,OAAOC,SAASf,KAAK,KAAKA,SAAS;AAEnE,MAAMgB,mBAAmBC,OAAwB;CAC/C,IAAI;EACF7B,oBAAoB6B,EAAE;EACtB,OAAO;CACT,QAAQ;EACN,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,QAAQ7D,IAAE,GAAGoC,KAAK;EAAC;EAC1BkB,EAAA,MAAAO;EAAAP,EAAA,MAAAqB;EAAArB,EAAA,MAAAgC;CAAA,OAAAA,MAAAhC,EAAA;CAAA,IAAAkC;CAAA,IAAAlC,EAAA,QAAAO,WAAAP,EAAA,QAAAyB,QAAA;EACeS,MAAA,OAAAC,SAAA;GACdV,OAAOlB,QAAQ7D,IAAE,CAAC;EAAC;EACpBsD,EAAA,MAAAO;EAAAP,EAAA,MAAAyB;EAAAzB,EAAA,MAAAkC;CAAA,OAAAA,MAAAlC,EAAA;CAAA,IAAAoC;CAAA,IAAApC,EAAA,QAAA8B,OAAA9B,EAAA,QAAAgC,OAAAhC,EAAA,QAAAkC,OAAAlC,EAAA,QAAA0B,MAAA1B,EAAA,QAAA2B,MAAA3B,EAAA,QAAA4B,IAAA;EAdIQ,MAAA;GAAA,GACDV;GAAwCW,mBACzBV;GACgDW,mBAChDV;GAElBW,eACcT;GACgDU,eAChDR;GAEdS,gBACeP;EAGlB;EAAClC,EAAA,MAAA8B;EAAA9B,EAAA,MAAAgC;EAAAhC,EAAA,MAAAkC;EAAAlC,EAAA,MAAA0B;EAAA1B,EAAA,MAAA2B;EAAA3B,EAAA,MAAA4B;EAAA5B,EAAA,MAAAoC;CAAA,OAAAA,MAAApC,EAAA;CAAA,OAfDoC;AAeE;AAIN,MAAaM,kBAAkBvI,SAAS2F,kBAAkB"}
|
|
1
|
+
{"version":3,"file":"McpLocalStorage.js","names":["resource","useMemo","OAuthMetadataSchema","OAuthClientInformationFullSchema","OAuthProtectedResourceMetadataSchema","OAuthTokensSchema","normalizeMcpServerUrl","MCPAuthConfig","MCPCustomServerRecord","MCPPersistedAuthState","assertValidServerId","MCPStorage","McpLocalStorageOptions","keyPrefix","storage","Storage","scopeId","resolveStorage","opts","globalThis","localStorage","isRecord","value","Record","Array","isArray","isOptionalString","undefined","isNonEmptyString","trim","length","isOptionalNonEmptyString","isOptionalStringArray","every","item","isOptionalConnectionTimeout","Number","isFinite","isValidServerId","id","isMCPAuthConfig","auth","type","token","scopes","authorizationEndpoint","tokenEndpoint","registrationEndpoint","clientId","clientSecret","isCustomServerRecord","name","url","createdAt","connectionTimeout","normalizeCustomServerRecord","record","normalizeCustomServerRecords","flatMap","normalizeOAuthTokens","result","safeParse","success","data","normalizeClientInformation","isSecureNetworkUrl","URL","isIpv4Loopback","test","hostname","protocol","endsWith","isMcpServerUrl","normalizeDiscoveryState","authorizationServerUrl","state","NonNullable","resourceMetadataUrl","metadata","authorizationServerMetadata","resourceMetadata","normalizePersistedAuthState","serverUrl","tokensClientId","codeVerifier","tokens","clientInformation","clientInformationSource","discoveryState","Object","keys","useMcpLocalStorage","t0","$","_c","t1","prefix","t2","customServersKey","t3","authKey","t4","key","fallback","raw","getItem","JSON","parse","T","read","t5","key_0","setItem","stringify","write","t6","key_1","removeItem","remove","t7","t8","t9","records","t10","id_0","t11","id_1","t12","id_2","t13","loadCustomServers","saveCustomServers","loadAuthState","saveAuthState","clearAuthState","McpLocalStorage","_c"],"sources":["../../../src/resources/storage/McpLocalStorage.ts"],"sourcesContent":["import { resource } from \"@assistant-ui/tap\";\nimport { useMemo } from \"react\";\nimport {\n OAuthMetadataSchema,\n OAuthClientInformationFullSchema,\n OAuthProtectedResourceMetadataSchema,\n OAuthTokensSchema,\n} from \"@modelcontextprotocol/core\";\nimport { normalizeMcpServerUrl } from \"../../utils/serverUrl\";\nimport type { MCPAuthConfig, MCPCustomServerRecord } from \"../../mcp-scope\";\nimport type { MCPPersistedAuthState } from \"../../auth/types\";\nimport { assertValidServerId } from \"../../utils/serverId\";\nimport type { MCPStorage } from \"./types\";\n\nexport type McpLocalStorageOptions = {\n /** Namespace prefix for keys. Default \"aui-mcp\". */\n keyPrefix?: string;\n /** Override the underlying Storage. Defaults to globalThis.localStorage. */\n storage?: Storage;\n /**\n * Stable identity for the backing data, used to key server reconnects.\n * Required to get reconnect-on-swap behavior when `storage` is overridden;\n * without it a custom backing store declares no scope, since a prefix\n * alone cannot distinguish two different stores.\n */\n scopeId?: string;\n};\n\nfunction resolveStorage(opts: McpLocalStorageOptions): Storage | null {\n if (opts.storage) return opts.storage;\n if (typeof globalThis !== \"undefined\" && \"localStorage\" in globalThis) {\n try {\n return (globalThis as { localStorage: Storage }).localStorage;\n } catch {\n return null;\n }\n }\n return null;\n}\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nconst isOptionalString = (value: unknown): value is string | undefined =>\n value === undefined || typeof value === \"string\";\n\nconst isNonEmptyString = (value: unknown): value is string =>\n typeof value === \"string\" && value.trim().length > 0;\n\nconst isOptionalNonEmptyString = (\n value: unknown,\n): value is string | undefined =>\n value === undefined || isNonEmptyString(value);\n\nconst isOptionalStringArray = (value: unknown): value is string[] | undefined =>\n value === undefined ||\n (Array.isArray(value) && value.every((item) => typeof item === \"string\"));\n\nconst isOptionalConnectionTimeout = (\n value: unknown,\n): value is number | undefined =>\n value === undefined ||\n (typeof value === \"number\" && Number.isFinite(value) && value >= 0);\n\nconst isValidServerId = (id: string): boolean => {\n try {\n assertValidServerId(id);\n return true;\n } catch {\n return false;\n }\n};\n\nconst isMCPAuthConfig = (auth: unknown): auth is MCPAuthConfig => {\n if (!isRecord(auth)) return false;\n\n switch (auth.type) {\n case \"none\":\n return true;\n case \"bearer\":\n return isOptionalNonEmptyString(auth.token);\n case \"oauth\":\n return (\n isOptionalStringArray(auth.scopes) &&\n isOptionalString(auth.authorizationEndpoint) &&\n isOptionalString(auth.tokenEndpoint) &&\n isOptionalString(auth.registrationEndpoint) &&\n isOptionalString(auth.clientId) &&\n isOptionalString(auth.clientSecret)\n );\n default:\n return false;\n }\n};\n\nconst isCustomServerRecord = (\n value: unknown,\n): value is MCPCustomServerRecord => {\n if (!isRecord(value)) return false;\n if (typeof value.id !== \"string\" || !isValidServerId(value.id)) {\n return false;\n }\n return (\n isNonEmptyString(value.name) &&\n isNonEmptyString(value.url) &&\n Number.isFinite(value.createdAt) &&\n isMCPAuthConfig(value.auth) &&\n isOptionalConnectionTimeout(value.connectionTimeout)\n );\n};\n\nconst normalizeCustomServerRecord = (\n value: unknown,\n): MCPCustomServerRecord | null => {\n if (isCustomServerRecord(value)) return value;\n if (!isRecord(value)) return null;\n\n const record = { ...value };\n delete record.connectionTimeout;\n return isCustomServerRecord(record) ? record : null;\n};\n\nexport const normalizeCustomServerRecords = (\n value: unknown,\n): MCPCustomServerRecord[] => {\n if (!Array.isArray(value)) return [];\n return value.flatMap((item) => {\n const record = normalizeCustomServerRecord(item);\n return record === null ? [] : [record];\n });\n};\n\nconst normalizeOAuthTokens = (\n value: unknown,\n): MCPPersistedAuthState[\"tokens\"] | undefined => {\n const result = OAuthTokensSchema.safeParse(value);\n return result.success ? result.data : undefined;\n};\n\nconst normalizeClientInformation = (\n value: unknown,\n): MCPPersistedAuthState[\"clientInformation\"] | undefined => {\n const result = OAuthClientInformationFullSchema.safeParse(value);\n return result.success ? result.data : undefined;\n};\n\nconst isSecureNetworkUrl = (value: unknown): value is string => {\n if (!isNonEmptyString(value)) return false;\n try {\n const url = new URL(value);\n const isIpv4Loopback = /^127(?:\\.\\d{1,3}){3}$/.test(url.hostname);\n return (\n url.protocol === \"https:\" ||\n (url.protocol === \"http:\" &&\n (url.hostname === \"localhost\" ||\n url.hostname.endsWith(\".localhost\") ||\n isIpv4Loopback ||\n url.hostname === \"[::1]\"))\n );\n } catch {\n return false;\n }\n};\n\nconst isMcpServerUrl = (value: unknown): value is string => {\n if (typeof value !== \"string\") return false;\n try {\n const url = new URL(value);\n return url.protocol === \"https:\" || url.protocol === \"http:\";\n } catch {\n return false;\n }\n};\n\nconst normalizeDiscoveryState = (\n value: unknown,\n): MCPPersistedAuthState[\"discoveryState\"] | undefined => {\n if (!isRecord(value) || !isSecureNetworkUrl(value.authorizationServerUrl)) {\n return undefined;\n }\n\n // A malformed optional field is dropped alone: keeping the validated\n // authorization server URL preserves the redirect-time binding, and the SDK\n // re-discovers whatever metadata is missing.\n const state: NonNullable<MCPPersistedAuthState[\"discoveryState\"]> = {\n authorizationServerUrl: value.authorizationServerUrl,\n };\n\n if (isSecureNetworkUrl(value.resourceMetadataUrl)) {\n state.resourceMetadataUrl = value.resourceMetadataUrl;\n }\n\n const metadata = OAuthMetadataSchema.safeParse(\n value.authorizationServerMetadata,\n );\n if (metadata.success) state.authorizationServerMetadata = metadata.data;\n\n const resourceMetadata = OAuthProtectedResourceMetadataSchema.safeParse(\n value.resourceMetadata,\n );\n if (resourceMetadata.success) state.resourceMetadata = resourceMetadata.data;\n\n return state;\n};\n\nexport const normalizePersistedAuthState = (\n value: unknown,\n): MCPPersistedAuthState | null => {\n if (!isRecord(value)) return null;\n if (\"serverUrl\" in value && !isMcpServerUrl(value.serverUrl)) return null;\n\n const state: MCPPersistedAuthState = {};\n if (isMcpServerUrl(value.serverUrl)) {\n state.serverUrl = normalizeMcpServerUrl(value.serverUrl);\n }\n if (isNonEmptyString(value.token)) state.token = value.token;\n if (isNonEmptyString(value.tokensClientId)) {\n state.tokensClientId = value.tokensClientId;\n }\n if (isNonEmptyString(value.codeVerifier)) {\n state.codeVerifier = value.codeVerifier;\n }\n if (isNonEmptyString(value.state)) state.state = value.state;\n\n const tokens = normalizeOAuthTokens(value.tokens);\n if (tokens) state.tokens = tokens;\n\n const clientInformation = normalizeClientInformation(value.clientInformation);\n if (clientInformation) state.clientInformation = clientInformation;\n if (value.clientInformationSource === \"registered\") {\n state.clientInformationSource = value.clientInformationSource;\n }\n\n const discoveryState = normalizeDiscoveryState(value.discoveryState);\n if (discoveryState) state.discoveryState = discoveryState;\n\n return Object.keys(state).length > 0 ? state : null;\n};\n\nconst useMcpLocalStorage = (opts: McpLocalStorageOptions = {}): MCPStorage => {\n const prefix = opts.keyPrefix ?? \"aui-mcp\";\n const storage = resolveStorage(opts);\n // Deriving a scope from the prefix is only honest for the shared\n // globalThis.localStorage; two custom backing stores under one prefix hold\n // different data, so an overridden backing declares no scope unless the\n // caller names one.\n const scopeId =\n opts.scopeId ??\n (opts.storage === undefined ? `local-storage:${prefix}` : undefined);\n\n // Callers key per-server coordination state on this instance, so it has to\n // stay referentially stable for as long as the underlying store does.\n return useMemo(() => {\n const customServersKey = `${prefix}:custom-servers`;\n const authKey = (id: string) => `${prefix}:auth:${id}`;\n\n const read = <T>(key: string, fallback: T): T => {\n if (!storage) return fallback;\n try {\n const raw = storage.getItem(key);\n if (raw == null) return fallback;\n return JSON.parse(raw) as T;\n } catch {\n return fallback;\n }\n };\n\n const write = (key: string, value: unknown): void => {\n if (!storage) return;\n try {\n storage.setItem(key, JSON.stringify(value));\n } catch {\n // quota or serialization failure — silently drop\n }\n };\n\n const remove = (key: string): void => {\n if (!storage) return;\n try {\n storage.removeItem(key);\n } catch {\n // ignore\n }\n };\n\n return {\n ...(scopeId !== undefined ? { scopeId } : {}),\n loadCustomServers: async () =>\n normalizeCustomServerRecords(read<unknown>(customServersKey, [])),\n saveCustomServers: async (records) => {\n write(customServersKey, records);\n },\n loadAuthState: async (id) =>\n normalizePersistedAuthState(read<unknown>(authKey(id), null)),\n saveAuthState: async (id, state) => {\n write(authKey(id), state);\n },\n clearAuthState: async (id) => {\n remove(authKey(id));\n },\n };\n }, [prefix, storage, scopeId]);\n};\n\nexport const McpLocalStorage = resource(useMcpLocalStorage);\n"],"mappings":";;;;;;;AA4BA,SAASiB,eAAeC,MAA8C;CACpE,IAAIA,KAAKJ,SAAS,OAAOI,KAAKJ;CAC9B,IAAI,OAAOK,eAAe,eAAe,kBAAkBA,YACzD,IAAI;EACF,OAAQA,WAAyCC;CACnD,QAAQ;EACN,OAAO;CACT;CAEF,OAAO;AACT;AAEA,MAAMC,YAAYC,UAChB,OAAOA,UAAU,YAAYA,UAAU,QAAQ,CAACE,MAAMC,QAAQH,KAAK;AAErE,MAAMI,oBAAoBJ,UACxBA,UAAUK,KAAAA,KAAa,OAAOL,UAAU;AAE1C,MAAMM,oBAAoBN,UACxB,OAAOA,UAAU,YAAYA,MA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;CAAA,OAfDoC;AAeE;AAIN,MAAaM,kBAAkBvI,SAAS2F,kBAAkB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@assistant-ui/react-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.21",
|
|
4
4
|
"description": "MCP server configuration and connection primitives for @assistant-ui",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
],
|
|
28
28
|
"sideEffects": false,
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@assistant-ui/core": "^0.3.
|
|
31
|
-
"@assistant-ui/store": "^0.3.
|
|
32
|
-
"@assistant-ui/tap": "^0.9.
|
|
33
|
-
"@modelcontextprotocol/client": "^2.
|
|
34
|
-
"@modelcontextprotocol/core": "^2.
|
|
30
|
+
"@assistant-ui/core": "^0.3.23",
|
|
31
|
+
"@assistant-ui/store": "^0.3.17",
|
|
32
|
+
"@assistant-ui/tap": "^0.9.21",
|
|
33
|
+
"@modelcontextprotocol/client": "^2.2.0",
|
|
34
|
+
"@modelcontextprotocol/core": "^2.2.0",
|
|
35
35
|
"@radix-ui/react-primitive": "^2.1.10",
|
|
36
|
-
"assistant-stream": "^0.3.
|
|
36
|
+
"assistant-stream": "^0.3.47"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"@types/react": "*",
|
|
@@ -45,13 +45,14 @@
|
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@assistant-ui/x-buildutils": "0.0.
|
|
48
|
+
"@assistant-ui/x-buildutils": "0.0.30",
|
|
49
|
+
"@assistant-ui/x-react18": "0.0.0",
|
|
49
50
|
"@testing-library/dom": "^10.4.2",
|
|
50
51
|
"@testing-library/react": "^16.3.3",
|
|
51
52
|
"@types/react": "^19.3.0",
|
|
52
53
|
"jsdom": "^30.0.1",
|
|
53
54
|
"react": "^19.3.0",
|
|
54
|
-
"vitest": "^5.0.
|
|
55
|
+
"vitest": "^5.0.3"
|
|
55
56
|
},
|
|
56
57
|
"publishConfig": {
|
|
57
58
|
"access": "public",
|
|
@@ -70,6 +71,8 @@
|
|
|
70
71
|
"build": "aui-build",
|
|
71
72
|
"test": "vitest run",
|
|
72
73
|
"typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.test.json",
|
|
74
|
+
"test:peer-react18": "vitest run --config vitest.peer-react18.config.ts",
|
|
75
|
+
"test:types:peer-react18": "aui-react18-types",
|
|
73
76
|
"test:watch": "vitest"
|
|
74
77
|
}
|
|
75
78
|
}
|