@mcp-b/char 0.1.3 → 0.1.4
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/README.md +11 -13
- package/dist/custom-elements.json +491 -141
- package/dist/display-mode-policy.d.ts.map +1 -1
- package/dist/index.d.ts +89 -114
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +699 -281
- package/dist/index.js.map +1 -1
- package/dist/shell-component.d.ts +79 -86
- package/dist/shell-component.d.ts.map +1 -1
- package/dist/shell-component.js +689 -281
- package/dist/shell-component.js.map +1 -1
- package/dist/shell-standalone.iife.js +689 -281
- package/dist/shell-standalone.iife.js.map +1 -1
- package/dist/utils.d.ts +0 -13
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1 -2
- package/dist/utils.js.map +1 -1
- package/dist/web-component-standalone.iife.js +25 -89
- package/dist/web-component-standalone.iife.js.map +1 -1
- package/dist/web-component.d.ts +20 -83
- package/dist/web-component.d.ts.map +1 -1
- package/dist/web-component.js +25 -89
- package/dist/web-component.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -27,7 +27,12 @@ Importing `@mcp-b/char` root also registers both.
|
|
|
27
27
|
Use this when your app already owns all host chrome/layout.
|
|
28
28
|
|
|
29
29
|
```html
|
|
30
|
-
<char-agent
|
|
30
|
+
<char-agent
|
|
31
|
+
id="assistant"
|
|
32
|
+
publishable-key="pk_live_your_key_here"
|
|
33
|
+
style="width: 420px; height: 100vh"
|
|
34
|
+
display-mode="inline"
|
|
35
|
+
></char-agent>
|
|
31
36
|
<script type="module">
|
|
32
37
|
import '@mcp-b/char/web-component'
|
|
33
38
|
|
|
@@ -35,8 +40,9 @@ Use this when your app already owns all host chrome/layout.
|
|
|
35
40
|
const agent = document.querySelector('#assistant')
|
|
36
41
|
|
|
37
42
|
agent?.connect({
|
|
43
|
+
publishableKey: 'pk_live_your_key_here',
|
|
44
|
+
// Optional per-user identity token:
|
|
38
45
|
idToken: '<id-token>',
|
|
39
|
-
clientId: '<oidc-client-id>',
|
|
40
46
|
})
|
|
41
47
|
</script>
|
|
42
48
|
```
|
|
@@ -52,22 +58,14 @@ Use this when your app already owns all host chrome/layout.
|
|
|
52
58
|
Use this when you want built-in host behavior and responsive policy.
|
|
53
59
|
|
|
54
60
|
```html
|
|
55
|
-
<char-agent-shell
|
|
56
|
-
id="assistant-shell"
|
|
57
|
-
panel-width="420"
|
|
58
|
-
pip-position="bottom-center"
|
|
59
|
-
fullscreen-breakpoint="1024"
|
|
60
|
-
></char-agent-shell>
|
|
61
|
+
<char-agent-shell id="assistant-shell"></char-agent-shell>
|
|
61
62
|
<script type="module">
|
|
62
63
|
import '@mcp-b/char/shell-component'
|
|
63
64
|
|
|
64
65
|
/** @type {import('@mcp-b/char/shell-component').CharAgentShellElement | null} */
|
|
65
66
|
const shell = document.querySelector('#assistant-shell')
|
|
66
67
|
|
|
67
|
-
shell?.
|
|
68
|
-
idToken: '<id-token>',
|
|
69
|
-
clientId: '<oidc-client-id>',
|
|
70
|
-
})
|
|
68
|
+
shell?.setAuth({ publishableKey: 'pk_live_your_key_here', idToken: '<id-token>' })
|
|
71
69
|
</script>
|
|
72
70
|
```
|
|
73
71
|
|
|
@@ -75,7 +73,7 @@ Shell mode policy:
|
|
|
75
73
|
|
|
76
74
|
- closed -> `pip`
|
|
77
75
|
- open desktop -> `inline`
|
|
78
|
-
- open
|
|
76
|
+
- open on narrow viewport -> `fullscreen`
|
|
79
77
|
|
|
80
78
|
Availability policy:
|
|
81
79
|
|