@mcp-b/embedded-agent 1.2.5-beta.1 → 1.2.6
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 +23 -0
- package/README.md +212 -43
- package/dist/jsx.d.ts +45 -0
- package/dist/styles/globals.css +2 -2
- package/dist/styles.d.ts +2 -0
- package/dist/web-component-standalone.css +37 -0
- package/dist/web-component-standalone.css.map +1 -0
- package/dist/web-component-standalone.iife.js +118570 -145
- package/dist/web-component-standalone.iife.js.map +1 -0
- package/dist/web-component.d.ts +38 -59
- package/dist/web-component.d.ts.map +1 -1
- package/dist/web-component.js +10437 -8737
- package/dist/web-component.js.map +1 -1
- package/package.json +59 -35
- package/dist/index.d.ts +0 -136
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -9441
- package/dist/index.js.map +0 -1
package/dist/web-component.d.ts
CHANGED
|
@@ -1,73 +1,52 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
|
-
|
|
3
1
|
//#region src/web-component.d.ts
|
|
4
|
-
|
|
5
2
|
/**
|
|
6
|
-
*
|
|
3
|
+
* WebMCP Agent
|
|
7
4
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
useLocalApi?: boolean;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Props for the EmbeddedAgent component
|
|
22
|
-
*/
|
|
23
|
-
interface EmbeddedAgentProps {
|
|
24
|
-
/** Your WebMCP app ID - get one at webmcp.ai */
|
|
25
|
-
appId: string;
|
|
26
|
-
/**
|
|
27
|
-
* Development mode - use your own API keys for testing.
|
|
28
|
-
* In production, leave this undefined to use your WebMCP plan.
|
|
29
|
-
*/
|
|
30
|
-
devMode?: DevModeConfig;
|
|
31
|
-
/**
|
|
32
|
-
* Disable shadow DOM style isolation.
|
|
33
|
-
* NOT RECOMMENDED - only use this if you need to customize internal styles
|
|
34
|
-
* and understand the risks of style conflicts with the host page.
|
|
35
|
-
*
|
|
36
|
-
* When enabled:
|
|
37
|
-
* - Styles are injected globally into document.head
|
|
38
|
-
* - Host page styles may affect the agent widget
|
|
39
|
-
* - Agent styles may leak to the host page
|
|
40
|
-
*
|
|
41
|
-
* @default false
|
|
42
|
-
*/
|
|
43
|
-
disableShadowDOM?: boolean;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* EmbeddedAgent - Drop-in AI chat widget
|
|
5
|
+
* An Intercom-like AI chat widget with MCP tool support and voice mode.
|
|
6
|
+
* Drop it into your app and you're done - uses your existing SSO token.
|
|
7
|
+
*
|
|
8
|
+
* Styles are isolated by default using Shadow DOM. Customize appearance
|
|
9
|
+
* via CSS variables on the host element.
|
|
10
|
+
*
|
|
11
|
+
* @example SSO-First (production usage)
|
|
12
|
+
* ```tsx
|
|
13
|
+
* // Use your existing IDP token - no additional login needed
|
|
14
|
+
* const { session } = useOktaAuth() // or Azure, Auth0, Google, etc.
|
|
47
15
|
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* - Voice mode (talk to your AI assistant)
|
|
51
|
-
* - Action-first UI (shows what the AI is doing, not just typing)
|
|
52
|
-
* - Shadow DOM isolation (styles don't leak in or out)
|
|
16
|
+
* <webmcp-agent auth-token={session.idToken} />
|
|
17
|
+
* ```
|
|
53
18
|
*
|
|
54
|
-
*
|
|
19
|
+
* @example React
|
|
20
|
+
* ```tsx
|
|
21
|
+
* import '@mcp-b/embedded-agent/web-component'
|
|
22
|
+
*
|
|
23
|
+
* function App() {
|
|
24
|
+
* const { session } = useOktaAuth()
|
|
25
|
+
* return <webmcp-agent auth-token={session.idToken} />
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @example Stateless (dev/anonymous - no auth required)
|
|
30
|
+
* ```tsx
|
|
31
|
+
* // No auth token = stateless mode (messages in memory only)
|
|
32
|
+
* <webmcp-agent />
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @example CSS variable theming
|
|
36
|
+
* ```css
|
|
37
|
+
* webmcp-agent {
|
|
38
|
+
* --wm-color-primary: #0f766e;
|
|
39
|
+
* --wm-radius: 12px;
|
|
40
|
+
* }
|
|
41
|
+
* ```
|
|
55
42
|
*/
|
|
56
|
-
declare const EmbeddedAgent: FC<EmbeddedAgentProps>;
|
|
57
43
|
/**
|
|
58
44
|
* Register the <webmcp-agent> custom element
|
|
59
45
|
*
|
|
60
46
|
* Called automatically when importing this module.
|
|
61
|
-
*
|
|
62
|
-
* With shadow DOM (default):
|
|
63
|
-
* - Styles are injected into the shadow root, not the document
|
|
64
|
-
* - Complete isolation from host page styles
|
|
65
|
-
*
|
|
66
|
-
* With disableShadowDOM:
|
|
67
|
-
* - Styles are injected into document.head on first render
|
|
68
|
-
* - May conflict with host page styles
|
|
47
|
+
* Styles are injected into the shadow root by ShadowRoot component.
|
|
69
48
|
*/
|
|
70
49
|
declare function registerWebMCPAgent(tagName?: string): void;
|
|
71
50
|
//#endregion
|
|
72
|
-
export {
|
|
51
|
+
export { registerWebMCPAgent };
|
|
73
52
|
//# sourceMappingURL=web-component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-component.d.ts","names":[],"sources":["../src/web-component.tsx"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"web-component.d.ts","names":[],"sources":["../src/web-component.tsx"],"sourcesContent":[],"mappings":";;AA8OA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAgB,mBAAA"}
|