@talk2view/sdk 0.21.3 → 0.21.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 +124 -46
- package/dist/assistant-ui/index.d.ts.map +1 -1
- package/dist/assistant-ui/index.js +12 -7
- package/dist/assistant-ui/index.js.map +1 -1
- package/dist/auth.d.ts +23 -4
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +48 -22
- package/dist/auth.js.map +1 -1
- package/dist/chat/lib/use-conversations.d.ts.map +1 -1
- package/dist/chat/lib/use-conversations.js +23 -6
- package/dist/chat/lib/use-conversations.js.map +1 -1
- package/dist/chat/provider.d.ts +20 -2
- package/dist/chat/provider.d.ts.map +1 -1
- package/dist/chat/provider.js +3 -1
- package/dist/chat/provider.js.map +1 -1
- package/dist/chat/views/account.d.ts.map +1 -1
- package/dist/chat/views/account.js +22 -9
- package/dist/chat/views/account.js.map +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +5 -4
- package/dist/client.js.map +1 -1
- package/dist/errors.d.ts +7 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +7 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +31 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +64 -10
- package/dist/index.js.map +1 -1
- package/dist/storage.d.ts +6 -0
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +6 -0
- package/dist/storage.js.map +1 -1
- package/dist/tools.d.ts +2 -1
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +23 -10
- package/dist/tools.js.map +1 -1
- package/dist/types.d.ts +6 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/ui/components/ChatPanel.d.ts +5 -1
- package/dist/ui/components/ChatPanel.d.ts.map +1 -1
- package/dist/ui/components/ChatPanel.js +5 -1
- package/dist/ui/components/ChatPanel.js.map +1 -1
- package/docs/chat.md +86 -15
- package/docs/voice.md +18 -8
- package/package.json +5 -5
|
@@ -6,7 +6,11 @@ export interface ChatPanelProps {
|
|
|
6
6
|
suggestions?: string[];
|
|
7
7
|
};
|
|
8
8
|
signupUrl?: string;
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Let logged-out visitors chat as guests (default true). That needs a partner
|
|
11
|
+
* key that allows guests: where the engine refuses, the sign-in form shows
|
|
12
|
+
* instead. false always asks visitors to sign in first.
|
|
13
|
+
*/
|
|
10
14
|
allowAnonymous?: boolean;
|
|
11
15
|
/** URL of a password-reset page. When set, the login form shows a
|
|
12
16
|
* "Forgot password?" link to it. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatPanel.d.ts","sourceRoot":"","sources":["../../../src/ui/components/ChatPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAarD,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB
|
|
1
|
+
{"version":3,"file":"ChatPanel.d.ts","sourceRoot":"","sources":["../../../src/ui/components/ChatPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAarD,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;yCACqC;IACrC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;mDAC+C;IAC/C,mBAAmB,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IACzC;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,GAAG,IAAI,CAAC;IAC3F;;;OAGG;IACH,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC;IAClF,+FAA+F;IAC/F,kBAAkB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,KAAK,KAAK,CAAC,SAAS,CAAC;IACpF,2FAA2F;IAC3F,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,wBAAgB,SAAS,CAAC,EACxB,OAAO,EACP,SAAS,EACT,cAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,GACvB,EAAE,cAAc,2CAqHhB;AAED,wEAAwE;AACxE,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,cAAc,EAAE,GACzB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GAAG,IAAI,CAUzD"}
|
|
@@ -38,7 +38,11 @@ export function ChatPanel({ welcome, signupUrl, allowAnonymous = true, resetPass
|
|
|
38
38
|
return (_jsxs("div", { style: {
|
|
39
39
|
display: 'flex', flexDirection: 'column', height: '100%',
|
|
40
40
|
background: 'var(--t2v-bg)', fontSize: `${fontSize}rem`, fontFamily: 'var(--t2v-font)',
|
|
41
|
-
}, children: [inChat && (_jsx(ChatHeader, { view: view, isAuthenticated: isAuthenticated, isAnonymous: isAnonymous, onSettingsClick: () => setView('settings'), onSignIn: () => setView('login'), onBackClick: () => setView('chat'), onNewChat: () => clearMessages(), onSignOut: () => t2v.auth.logout() })), showLoginGate ? (_jsx(LoginForm, { signupUrl: signupUrl, resetPasswordUrl: resetPasswordUrl, resetPasswordTarget: resetPasswordTarget, heading: demoLimitReached ? 'You’ve reached the demo limit' : undefined,
|
|
41
|
+
}, children: [inChat && (_jsx(ChatHeader, { view: view, isAuthenticated: isAuthenticated, isAnonymous: isAnonymous, onSettingsClick: () => setView('settings'), onSignIn: () => setView('login'), onBackClick: () => setView('chat'), onNewChat: () => clearMessages(), onSignOut: () => t2v.auth.logout() })), showLoginGate ? (_jsx(LoginForm, { signupUrl: signupUrl, resetPasswordUrl: resetPasswordUrl, resetPasswordTarget: resetPasswordTarget, heading: demoLimitReached ? 'You’ve reached the demo limit' : undefined,
|
|
42
|
+
// /ui saves nothing: the conversation lives in this page's memory.
|
|
43
|
+
// Once the visitor is signed in to an account, <Talk2View> puts it
|
|
44
|
+
// back on screen and resends the turn the limit stopped.
|
|
45
|
+
subheading: demoLimitReached ? 'Create an account to keep chatting — this conversation carries on.' : undefined, defaultMode: demoLimitReached ? 'signup' : 'login' })) : view === 'settings' ? (_jsx("div", { style: { flex: 1, overflow: 'auto' }, children: _jsx(SettingsPanel, { hideHeader: true }) })) : view === 'login' ? (_jsx(LoginForm, { signupUrl: signupUrl, defaultMode: "login", resetPasswordUrl: resetPasswordUrl, resetPasswordTarget: resetPasswordTarget })) : messages.length === 0 ? (_jsx(WelcomeScreen, { heading: welcome?.heading, suggestions: welcome?.suggestions })) : (_jsx(MessageList, { groupAssistantMessages: groupAssistantMessages })), inChat && view === 'chat' && isToolDestructive && pendingApproval &&
|
|
42
46
|
isToolDestructive(pendingApproval.toolName, pendingApproval.arguments) && (_jsx(DestructiveBanner, { toolName: pendingApproval.toolName, activity: describeToolActivity?.(pendingApproval.toolName, pendingApproval.arguments) ?? null, render: destructiveWarning })), inChat && view === 'chat' && describeToolActivity && (_jsx(AgentStatusRow, { describeToolActivity: describeToolActivity })), inChat && view === 'chat' && error && (_jsxs("div", { role: "alert", style: {
|
|
43
47
|
display: 'flex', alignItems: 'flex-start', gap: '8px',
|
|
44
48
|
margin: '0 12px 8px', padding: '8px 12px',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatPanel.js","sourceRoot":"","sources":["../../../src/ui/components/ChatPanel.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAEjC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,MAAM,UAAU,GAA2B,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"ChatPanel.js","sourceRoot":"","sources":["../../../src/ui/components/ChatPanel.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAEjC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,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mB;oBAC1B,UAAU,EAAE,QAAQ;oBACpB,QAAQ,EAAE,QAAQ;oBAClB,YAAY,EAAE,UAAU;iBACzB,aAEA,UAAU,EACV,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,IAC7B,IACH,CACP,CAAC;AACJ,CAAC;AAED,SAAS,GAAG,CAAC,EAAE,KAAK,EAAqB;IACvC,OAAO,CACL,eACE,KAAK,EAAE;YACL,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC;YACT,YAAY,EAAE,CAAC;YACf,UAAU,EAAE,mBAAmB;YAC/B,SAAS,EAAE,wCAAwC;YACnD,cAAc,EAAE,GAAG,KAAK,IAAI;YAC5B,OAAO,EAAE,cAAc;SACxB,GACD,CACH,CAAC;AACJ,CAAC;AAED,uFAAuF;AACvF,SAAS,iBAAiB,CAAC,EACzB,QAAQ,EACR,QAAQ,EACR,MAAM,GAKP;IACC,OAAO,CACL,cACE,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE;YACL,OAAO,EAAE,UAAU;YACnB,QAAQ,EAAE,MAAM;YAChB,UAAU,EAAE,iBAAiB;YAC7B,KAAK,EAAE,SAAS;YAChB,UAAU,EAAE,yBAAyB;YACrC,SAAS,EAAE,mCAAmC;YAC9C,YAAY,EAAE,mCAAmC;YACjD,OAAO,EAAE,MAAM;YACf,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,CAAC;SACP,YAEA,MAAM,CAAC,CAAC,CAAC,CACR,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAC3B,CAAC,CAAC,CAAC,CACF,8BACE,oDAA0B,EAC1B,2DAC8B,2BAAS,QAAQ,IAAI,QAAQ,GAAU,kCAE9D,IACN,CACJ,GACG,CACP,CAAC;AACJ,CAAC"}
|
package/docs/chat.md
CHANGED
|
@@ -13,6 +13,14 @@ import '@talk2view/sdk/chat.css';
|
|
|
13
13
|
A runnable version of everything below, in a Vite app with no Tailwind, is in
|
|
14
14
|
[`examples/react-chat`](../examples/react-chat).
|
|
15
15
|
|
|
16
|
+
Talk2View is not a medical device and is not for diagnosis or treatment. Do not
|
|
17
|
+
let the chat carry protected health information (PHI) or any other data that
|
|
18
|
+
can identify a patient: what end-users type, attach or say, and what your tools
|
|
19
|
+
return, goes to third-party AI providers, and Talk2View has no safeguard that
|
|
20
|
+
detects, redacts or blocks it. The
|
|
21
|
+
[Terms of Use](https://talk2view.com/legal/terms-of-use) and the
|
|
22
|
+
[Privacy Policy](https://talk2view.com/legal/privacy-policy) say this in full.
|
|
23
|
+
|
|
16
24
|
---
|
|
17
25
|
|
|
18
26
|
## Contents
|
|
@@ -55,14 +63,31 @@ half-typed message.
|
|
|
55
63
|
|
|
56
64
|
The views are Account, Skills, Settings and Chats.
|
|
57
65
|
|
|
66
|
+
**Account** signs the end-user in to their Talk2View account, or creates one,
|
|
67
|
+
with email and password, or with Apple or Google where those are available.
|
|
68
|
+
Both forms carry a consent line under the heading, above every way in: "By
|
|
69
|
+
continuing, you agree to Talk2View’s Terms of Use and Privacy Policy." The two
|
|
70
|
+
links open in a new tab. `termsUrl` and `privacyUrl` change where they point,
|
|
71
|
+
for another copy of Talk2View's own documents such as a translation. The
|
|
72
|
+
wording stays the same, because the accounts are Talk2View's: never point them
|
|
73
|
+
at your own terms, which belong in `footer`. Someone already signed in does not
|
|
74
|
+
see it.
|
|
75
|
+
|
|
76
|
+
**Chats** lists the end-user's earlier conversations. They are kept in the
|
|
77
|
+
browser, not in the account — see
|
|
78
|
+
[Conversations are kept in this browser](#conversations-are-kept-in-this-browser).
|
|
79
|
+
|
|
58
80
|
**Skills** is the end-user's own knowledge: markdown they write once — a
|
|
59
81
|
protocol, a house style, the way their team names things — that the agent can
|
|
60
|
-
load when it helps. They are kept
|
|
61
|
-
chats, where they merge with the partner's and the
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
`
|
|
82
|
+
load when it helps. They are kept in the browser, not in the account, and sent
|
|
83
|
+
with the chats made from it, where they merge with the partner's and the
|
|
84
|
+
built-in skills and win over both. They belong to the browser rather than to
|
|
85
|
+
anyone in it: signing out leaves them, and on a shared browser whoever signs in
|
|
86
|
+
next sees them in Skills and sends them with their own chats. A skill can be
|
|
87
|
+
switched off without deleting it, and a `.md` file can be imported, taking its
|
|
88
|
+
`name` and `description` from frontmatter when it has any. Turn the view off
|
|
89
|
+
with `features={{ skills: false }}`; the underlying `client.skills` API stays
|
|
90
|
+
available either way.
|
|
66
91
|
|
|
67
92
|
### `<Talk2ViewChatLauncher>`
|
|
68
93
|
|
|
@@ -108,10 +133,12 @@ take directly.
|
|
|
108
133
|
| `tools` | none | Your client tools. They run in your app. |
|
|
109
134
|
| `systemPrompt` | none | Your own instructions, sent with every message. Changing it does not restart the conversation. |
|
|
110
135
|
| `welcome` | `{}` | `heading` and `suggestions` on the empty chat. Clicking a suggestion sends it. |
|
|
111
|
-
| `allowAnonymous` | `true` | Logged-out visitors chat as guests. `false` shows sign-in first — **
|
|
136
|
+
| `allowAnonymous` | `true` | Logged-out visitors chat as guests where your key allows it. `false` shows sign-in first — **see the [notes below](#guest-sessions-need-guest-access-on-your-key)**. |
|
|
112
137
|
| `features` | all on | `{ dictation, attachments, settings, account, threadList, skills, voice }`. `voice` is the realtime voice button beside the launcher, shown only for partners with voice enabled — see [voice.md](voice.md). |
|
|
113
138
|
| `fontFamily` | inherit | Your own font stack. Default: whatever the page uses. |
|
|
114
139
|
| `resetPasswordUrl` | none | Where "Forgot it?" goes. Without it the link is not shown. |
|
|
140
|
+
| `termsUrl` | `'https://talk2view.com/legal/terms-of-use'` | Where the consent line's "Terms of Use" link goes: Talk2View's own terms, or another copy of them. Not yours — the line names Talk2View's, and yours go in `footer`. An empty string means the default. |
|
|
141
|
+
| `privacyUrl` | `'https://talk2view.com/legal/privacy-policy'` | Where the consent line's "Privacy Policy" link goes: Talk2View's own policy, or another copy of it. An empty string means the default. |
|
|
115
142
|
| `footer` | none | A short line under the composer — your terms, a disclaimer. |
|
|
116
143
|
| `describeToolActivity` | none | `(name, args) => string \| null`. What a running tool is doing, in your words. |
|
|
117
144
|
| `isToolDestructive` | none | `(name, args) => boolean`. Warn before this call. |
|
|
@@ -135,10 +162,21 @@ Launcher only:
|
|
|
135
162
|
These are the things that surprise people. None of them is a bug; all of them
|
|
136
163
|
have cost someone an afternoon.
|
|
137
164
|
|
|
165
|
+
### Guest sessions need guest access on your key
|
|
166
|
+
|
|
167
|
+
`allowAnonymous` lets the chat try; the engine decides. It starts a guest
|
|
168
|
+
session only for a partner key with guest access switched on. That is off by
|
|
169
|
+
default: switch it on under **Settings → Anonymous access** in the dashboard.
|
|
170
|
+
Guest sign-in also needs a CAPTCHA check by default, and the chat sends none,
|
|
171
|
+
so ask Talk2View to set your key up for guests as well. Talk2View sets the
|
|
172
|
+
daily limit on new guests. When the engine refuses, or when a guest's allowance
|
|
173
|
+
or your daily guest limit runs out, the chat opens Account and asks the visitor
|
|
174
|
+
to sign in.
|
|
175
|
+
|
|
138
176
|
### `allowAnonymous: false` also stops guest sessions
|
|
139
177
|
|
|
140
178
|
It is not only a screen. The gate is computed from whether anyone is signed in,
|
|
141
|
-
and the client
|
|
179
|
+
and the client tries to start a guest session on demand — listing the models for
|
|
142
180
|
Settings would be enough — which would sign the visitor in and open the gate
|
|
143
181
|
from behind. So `allowAnonymous: false` also turns off `anonymousAutoStart`.
|
|
144
182
|
|
|
@@ -149,6 +187,30 @@ to), pass both explicitly:
|
|
|
149
187
|
<Talk2ViewChat partnerKey="…" allowAnonymous={false} anonymousAutoStart />
|
|
150
188
|
```
|
|
151
189
|
|
|
190
|
+
### Conversations are kept in this browser
|
|
191
|
+
|
|
192
|
+
With the thread list on (`features.threadList`, the default), the conversations
|
|
193
|
+
in Chats are saved in the browser's `localStorage`: one entry per partner key
|
|
194
|
+
(`t2v_chat_conversations_v1:<partner key>`), divided by end-user, so each
|
|
195
|
+
account and each guest sees only their own. The engine has no API to list or
|
|
196
|
+
fetch a past conversation, so they do not follow anyone to another browser,
|
|
197
|
+
another device or another app. For each partner key the browser keeps up to 50
|
|
198
|
+
conversations per end-user, fewer if they are long, for the eight end-users —
|
|
199
|
+
guests included — who used it most recently.
|
|
200
|
+
|
|
201
|
+
The conversation on screen goes when its account signs out, when that session
|
|
202
|
+
ends, or when another account signs in. Signing out does not delete the saved
|
|
203
|
+
ones: they stay in the browser and are listed again when the same account signs
|
|
204
|
+
back in there. Only a conversation that a guest, or a visitor before any
|
|
205
|
+
session, started on the page carries on into the account they then sign in to —
|
|
206
|
+
never one from another account, and never past a sign-out.
|
|
207
|
+
|
|
208
|
+
With the thread list off, nothing is saved: the conversation lives in memory,
|
|
209
|
+
is lost on reload, and goes on the same sign-outs and account changes. When it
|
|
210
|
+
goes because an account's session ended on its own — the sign-in expired, or
|
|
211
|
+
the account signed out in another tab — the chat says "Session expired. Please
|
|
212
|
+
log in again."
|
|
213
|
+
|
|
152
214
|
### A page with no font gets a serif chat
|
|
153
215
|
|
|
154
216
|
`--t2v-font` is `inherit`. That is the design: the chat looks like part of your
|
|
@@ -160,8 +222,8 @@ font on `body`, or pass one:
|
|
|
160
222
|
<Talk2ViewChat partnerKey="…" fontFamily='"Space Grotesk", system-ui, sans-serif' />
|
|
161
223
|
```
|
|
162
224
|
|
|
163
|
-
Nothing is fetched for it. The chat never loads a font
|
|
164
|
-
|
|
225
|
+
Nothing is fetched for it. The chat never loads a font or a stylesheet, so
|
|
226
|
+
whatever you name has to be available to the page.
|
|
165
227
|
|
|
166
228
|
### `isToolDestructive` is your claim about your own tool
|
|
167
229
|
|
|
@@ -353,8 +415,17 @@ retires the label beside the mark.
|
|
|
353
415
|
|
|
354
416
|
## Content Security Policy, and hosts with no CSS loader
|
|
355
417
|
|
|
356
|
-
|
|
357
|
-
A `connect-src` that allows
|
|
418
|
+
Without voice, the chat fetches nothing at runtime but your Talk2View engine: no
|
|
419
|
+
fonts, no CDN, no stylesheet, no script. A `connect-src` that allows the engine
|
|
420
|
+
is all it needs, plus `blob:` in a strict `img-src` for the previews of files
|
|
421
|
+
the end-user attaches.
|
|
422
|
+
|
|
423
|
+
Voice needs more. A call downloads Daily's call engine from
|
|
424
|
+
`https://c.daily.co` and runs it through `Function()`, so it needs
|
|
425
|
+
`https://c.daily.co` in `connect-src` and `'unsafe-eval'` in `script-src`, or no
|
|
426
|
+
call starts — see [voice.md](voice.md#browser-requirements). If you would rather
|
|
427
|
+
allow neither, `features={{ voice: false }}` keeps the microphone off the
|
|
428
|
+
launcher.
|
|
358
429
|
|
|
359
430
|
`import '@talk2view/sdk/chat.css'` needs a build that can import CSS. Some hosts
|
|
360
431
|
cannot — an Office add-in's webpack with no CSS rule, a strict `style-src` that
|
|
@@ -403,9 +474,9 @@ Stated plainly, because it is large.
|
|
|
403
474
|
|
|
404
475
|
| | gzip |
|
|
405
476
|
|---|---|
|
|
406
|
-
| `@talk2view/sdk` (the core client) | 11.
|
|
407
|
-
| `@talk2view/sdk/ui` (the previous chat panel) | 40.
|
|
408
|
-
| **`@talk2view/sdk/chat`** | **
|
|
477
|
+
| `@talk2view/sdk` (the core client) | 11.5 KB |
|
|
478
|
+
| `@talk2view/sdk/ui` (the previous chat panel) | 40.9 KB |
|
|
479
|
+
| **`@talk2view/sdk/chat`** | **373.3 KB** |
|
|
409
480
|
| A whole page containing the chat and React | ~437 KB |
|
|
410
481
|
|
|
411
482
|
The first three exclude React and React DOM, which your app already has. The
|
package/docs/voice.md
CHANGED
|
@@ -77,12 +77,22 @@ call ends with `'error'`), `auth_expired` (the sign-in expired; the call ends wi
|
|
|
77
77
|
- **HTTPS.** Browsers only give microphone access on a secure page (localhost
|
|
78
78
|
counts as secure).
|
|
79
79
|
- **Microphone permission.** The browser asks on the first press. If the
|
|
80
|
-
end-user refuses, the call ends with a `mic_unavailable` error.
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
end-user refuses, the call ends with a `mic_unavailable` error. Inside an
|
|
81
|
+
`<iframe>` from another origin, the iframe needs `allow="microphone"`.
|
|
82
|
+
- **WebRTC.** The call is a WebRTC connection to Talk2View's voice service,
|
|
83
|
+
through the ICE servers the engine hands out for each call. A network that
|
|
84
|
+
blocks WebRTC fails with `transport_error`.
|
|
83
85
|
- **Content-Security-Policy.** Your bundler puts the Pipecat client libraries
|
|
84
|
-
in a separate chunk that loads from your own origin on the first press.
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
in a separate chunk that loads from your own origin on the first press.
|
|
87
|
+
Starting a call, Pipecat's WebRTC transport has Daily's library
|
|
88
|
+
(`@daily-co/daily-js`) download its call engine from `https://c.daily.co`
|
|
89
|
+
and run it through `Function()`. So voice needs `https://c.daily.co` in
|
|
90
|
+
`connect-src` and `'unsafe-eval'` in `script-src`; without either, no call
|
|
91
|
+
starts. The call's offer then goes to the voice URL the engine returns,
|
|
92
|
+
which on Talk2View's hosted engine is the engine itself, so `connect-src`
|
|
93
|
+
must allow your engine too. If Daily's download fails, its library tries to
|
|
94
|
+
send an error report to Daily's own error tracking (Sentry); you can leave
|
|
95
|
+
that blocked.
|
|
96
|
+
|
|
97
|
+
A chat-only integration never loads the Pipecat libraries or Daily's call
|
|
98
|
+
engine.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@talk2view/sdk",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.4",
|
|
4
4
|
"description": "Talk2View SDK — Add AI-powered natural language control to any application",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"@pipecat-ai/small-webrtc-transport": "1.10.8",
|
|
87
87
|
"class-variance-authority": "^0.7.1",
|
|
88
88
|
"clsx": "^2.1.1",
|
|
89
|
-
"dompurify": "^3.4.
|
|
89
|
+
"dompurify": "^3.4.16",
|
|
90
90
|
"lucide-react": "^1.8.0",
|
|
91
91
|
"marked": "^15.0.0",
|
|
92
92
|
"remark-gfm": "^4.0.1",
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
"agent",
|
|
140
140
|
"tools"
|
|
141
141
|
],
|
|
142
|
-
"homepage": "https://talk2view.com",
|
|
142
|
+
"homepage": "https://docs.talk2view.com",
|
|
143
143
|
"license": "MIT",
|
|
144
144
|
"repository": {
|
|
145
145
|
"type": "git",
|
|
@@ -149,10 +149,10 @@
|
|
|
149
149
|
"*.css"
|
|
150
150
|
],
|
|
151
151
|
"bugs": {
|
|
152
|
-
"url": "https://
|
|
152
|
+
"url": "https://github.com/Talk2View/talk2view-typescript/issues"
|
|
153
153
|
},
|
|
154
154
|
"engines": {
|
|
155
|
-
"node": ">=
|
|
155
|
+
"node": "^22.14.0 || ^24.0.0 || >=26.0.0"
|
|
156
156
|
},
|
|
157
157
|
"publishConfig": {
|
|
158
158
|
"access": "public"
|