@mcp-b/embedded-agent 1.2.5-beta.0 → 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.
@@ -1,73 +1,52 @@
1
- import { FC } from "react";
2
-
3
1
  //#region src/web-component.d.ts
4
-
5
2
  /**
6
- * Development mode configuration
3
+ * WebMCP Agent
7
4
  *
8
- * In dev mode, you provide your own API keys for testing.
9
- * Requests still go through WebMCP infrastructure (Cloudflare Workers),
10
- * but use your keys so there's no cost to us during development.
11
- */
12
- interface DevModeConfig {
13
- /** Your Anthropic API key for chat (required for dev mode) */
14
- anthropicApiKey: string;
15
- /** Your OpenAI API key for voice mode (optional) */
16
- openaiApiKey?: string;
17
- /** Use window.location.origin instead of production API (for internal development) */
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
- * A fully self-contained chat widget with:
49
- * - MCP tool support (connect to any MCP server)
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
- * Just add your app ID and you're done. Everything else is handled.
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 { DevModeConfig, EmbeddedAgent, EmbeddedAgentProps, registerWebMCPAgent };
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":";;;;;;;;;;;UAuEiB,aAAA;;;;;;;;;;;UAYA,kBAAA;;;;;;;YAQN;;;;;;;;;;;;;;;;;;;;;;;;;;cA4BE,eAAe,GAAG;;;;;;;;;;;;;;iBA8Ef,mBAAA"}
1
+ {"version":3,"file":"web-component.d.ts","names":[],"sources":["../src/web-component.tsx"],"sourcesContent":[],"mappings":";;AA8OA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAgB,mBAAA"}