@frontera-sdk/chat-ui 1.50.59 → 1.50.60

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.
Files changed (42) hide show
  1. package/README.md +41 -12
  2. package/dist/agent-picker.js +4 -4
  3. package/dist/{esm-MHF25KDL.js → browser-B7HPFETX.js} +1 -1
  4. package/dist/browser-DK2ZWH4A.js +2081 -0
  5. package/dist/chat.d.ts +12 -8
  6. package/dist/chat.js +109 -50
  7. package/dist/{chunk-CWC2IOX7.js → chunk-26L3ST3H.js} +1147 -1787
  8. package/dist/{chunk-BEJ3HQG4.js → chunk-37G6MHWS.js} +12 -9
  9. package/dist/{chunk-ZS6PXIZP.js → chunk-BDJFVRYR.js} +16 -3
  10. package/dist/{chunk-PQZ2CS26.js → chunk-CDTES65T.js} +17 -41
  11. package/dist/{chunk-2KEBRV3W.js → chunk-F6PEZE7A.js} +1 -2
  12. package/dist/{chunk-IBCOQG5T.js → chunk-FDGBZFGN.js} +5 -4
  13. package/dist/{chunk-XSEN6ISU.js → chunk-FNIHHKOZ.js} +25 -8
  14. package/dist/{chunk-SZTQOXLD.js → chunk-IQXJEZM7.js} +14 -14
  15. package/dist/{chunk-AQGBRSIP.js → chunk-J7EWRXEC.js} +1 -1
  16. package/dist/{chunk-IHBTHNXV.js → chunk-KHF7OM3F.js} +2 -2
  17. package/dist/{chunk-VDZH5Z3K.js → chunk-PH7AYVSS.js} +2 -2
  18. package/dist/{chunk-GTQH7MPF.js → chunk-ROJM44GB.js} +1 -1
  19. package/dist/{chunk-76WUIIOX.js → chunk-S3ECTKA3.js} +2 -2
  20. package/dist/{chunk-FXKXDR5K.js → chunk-TSKFBMGC.js} +1 -1
  21. package/dist/{chunk-466MYFJD.js → chunk-UTKQ6G2A.js} +3 -3
  22. package/dist/{chunk-IQRPGFLI.js → chunk-V44YVBRX.js} +3 -35
  23. package/dist/chunk-WDYCLC4F.js +35 -0
  24. package/dist/chunk-XLX3L3P4.js +43 -0
  25. package/dist/client.js +3 -2
  26. package/dist/credential.js +2 -1
  27. package/dist/frame.js +2 -5
  28. package/dist/header.js +11 -11
  29. package/dist/message.js +11 -11
  30. package/dist/new-session.d.ts +128 -3
  31. package/dist/new-session.js +5 -5
  32. package/dist/parts.js +5 -5
  33. package/dist/{pdf-deck-view-inner-3PVGFH26.js → pdf-deck-view-inner-AY4FYDAJ.js} +4 -4
  34. package/dist/{pdf-document-view-inner-CP6VFHG4.js → pdf-document-view-inner-NC5MBN7X.js} +4 -4
  35. package/dist/pending-cards.js +5 -5
  36. package/dist/platform.css +88 -101
  37. package/dist/{univer-workbook-N5IIN7CH.js → univer-workbook-LSBVETAQ.js} +22824 -31017
  38. package/package.json +25 -5
  39. package/src/styles.css +20 -5
  40. package/dist/chunk-DGDHKMDB.js +0 -10
  41. package/dist/lib-3ZKX25RJ.js +0 -4511
  42. package/dist/new-session-Dw7JOgzu.d.ts +0 -141
package/README.md CHANGED
@@ -68,13 +68,39 @@ Pass exactly one. All four are mutually exclusive in the type.
68
68
 
69
69
  | Prop | Type | Notes |
70
70
  |---|---|---|
71
- | `tokenEndpoint` | `string` | **Recommended.** URL on your server. Renewal handled for you; the API origin arrives with the token. |
71
+ | `tokenEndpoint` | `string` | **Recommended.** URL on your server. Renewal handled for you. Return `apiBaseUrl` alongside the token, or pass it as a prop — the exchange does not include it. |
72
72
  | `token` + `apiBaseUrl` | `string` + `string` | You own replacing it before it expires. The chat stops when it does. |
73
73
  | `getToken` | `() => Promise<{ token, expiresAt, apiBaseUrl? }>` | Called again on renewal. |
74
74
  | `client` | `FronteraClient \| (() => FronteraClient \| null)` | You built one yourself, e.g. from `useChatClient`. |
75
75
 
76
76
  ---
77
77
 
78
+ ## Upgrading
79
+
80
+ ### `modes`, `modelMode` and `defaultMode` are gone — use `modelSelector`
81
+
82
+ The model is bound to the Agent on the deployment. A list supplied by the host
83
+ could only ever disagree with what actually runs, and the disagreement was
84
+ invisible: the picker showed one model and the reply came from another.
85
+
86
+ What remains is `modelSelector?: boolean` — whether the picker appears at all.
87
+ Which modes it offers, and which one starts selected, now come from the agent.
88
+
89
+ | Before | After |
90
+ |---|---|
91
+ | `modes={[...]}` | delete it — the agent's own modes are used |
92
+ | `modes={[]}` to hide the picker | `modelSelector={false}` |
93
+ | `modelMode="fast"` to pin a model | configure that mode as the agent's default; the prop has no replacement |
94
+ | `defaultMode="fast"` | same — it is the agent's default mode now |
95
+
96
+ TypeScript reports these as unknown props. **JavaScript does not** — an ignored
97
+ `modelMode` leaves the chat running the agent's default mode, and a `modes={[]}`
98
+ that used to hide the picker now shows it, since `modelSelector` defaults to
99
+ `true`. Search your integration for all three names.
100
+
101
+ Ship this with a deployment whose `/v1/chat-agents` projects agent modes. An
102
+ older deployment answers without them and the picker renders empty.
103
+
78
104
  ## Props
79
105
 
80
106
  Everything below is optional.
@@ -87,9 +113,7 @@ Everything below is optional.
87
113
  | `fileUpload` | `boolean` | `true` | Paperclip **and** drop-anywhere-on-the-conversation. `false` makes the whole surface inert. |
88
114
  | `appsButton` | `boolean` | `false` | Plugins button — connect accounts before asking. Requires `connectRedirectUri`. |
89
115
  | `shortcuts` | `Shortcut[]` | none | Starter cards on an empty conversation. Off by default: each default card needs a computer-equipped agent. |
90
- | `modes` | `Record<string, ModelConfig>` | none | Model picker. Omit to hide it. |
91
- | `modelMode` | `string` | — | Controlled mode key. |
92
- | `defaultMode` | `string` | — | Initial mode key. |
116
+ | `modelSelector` | `boolean` | `true` | Model picker. What it offers comes from the **agent**; it hides itself when there is one mode and no effort levels. |
93
117
  | `placeholder` | `string` | `"Assign a task or ask anything..."` | Composer placeholder. |
94
118
 
95
119
  ```ts
@@ -172,13 +196,18 @@ export async function POST(req: Request) {
172
196
  const user = await currentUser(req) // YOUR session
173
197
  if (!user) return new Response('unauthorized', { status: 401 })
174
198
 
175
- return Response.json(
176
- await exchangeChatToken(frontera, {
177
- externalUserId: user.id, // never from the body
178
- ttlSeconds: 1800, // 60–86400, default 3600
179
- capabilities: ['plugin-connect'],
180
- }),
181
- )
199
+ const token = await exchangeChatToken(frontera, {
200
+ externalUserId: user.id, // never from the body
201
+ ttlSeconds: 1800, // 60–86400, default 3600
202
+ capabilities: ['plugin-connect'],
203
+ })
204
+
205
+ // `apiBaseUrl` is yours to add — the exchange returns only the token and its
206
+ // expiry, and the component has no other way to learn which deployment the
207
+ // token belongs to. Without it: "No apiBaseUrl: pass one, or return it from
208
+ // your token endpoint". It is the origin the browser is about to call, so
209
+ // there is nothing secret in it.
210
+ return Response.json({ ...token, apiBaseUrl: process.env.FRONTERA_API_URL })
182
211
  }
183
212
  ```
184
213
 
@@ -190,7 +219,7 @@ export async function POST(req: Request) {
190
219
  | Per-user choice | none — `agentId` naming a different agent is `403`, `agentIds` is `403` | `agentId` for one, `agentIds` for a subset (max 50) |
191
220
  | Agent picker | never shown, nothing to pick | shown, limited to what you minted |
192
221
  | If leaked | one agent | every chat agent |
193
- | Extra requirement | — | must be scoped **`chat`**; an `mcp`-scoped key is refused, naming its scope |
222
+ | Extra requirement | — | create it with the **Embedded chat** purpose (Workspace settings → API Keys); a platform-access key is refused, naming its scope |
194
223
 
195
224
  One surface, one agent → agent key, and stop there. A picker, or different
196
225
  agents for different customers → workspace key.
@@ -1,8 +1,8 @@
1
1
  'use client';
2
- export { AgentPicker, useChatAgents } from './chunk-VDZH5Z3K.js';
3
- import './chunk-ZS6PXIZP.js';
4
- import './chunk-FXKXDR5K.js';
5
- import './chunk-DGDHKMDB.js';
2
+ export { AgentPicker, useChatAgents } from './chunk-PH7AYVSS.js';
3
+ import './chunk-BDJFVRYR.js';
4
+ import './chunk-TSKFBMGC.js';
5
+ import './chunk-XLX3L3P4.js';
6
6
  import './chunk-AFVU5VT6.js';
7
7
  import './chunk-7ADM3CKD.js';
8
8
  import './chunk-PR4QN5HX.js';
@@ -1,3 +1,3 @@
1
1
  'use client';
2
- export { AsyncGzip as AsyncCompress, AsyncDecompress, AsyncDeflate, AsyncGunzip, AsyncGzip, AsyncInflate, AsyncUnzipInflate, AsyncUnzlib, AsyncZipDeflate, AsyncZlib, Gzip as Compress, DecodeUTF8, Decompress, Deflate, EncodeUTF8, FlateErrorCode, Gunzip, Gzip, Inflate, Unzip, UnzipInflate, UnzipPassThrough, Unzlib, Zip, ZipDeflate, ZipPassThrough, Zlib, gzip as compress, gzipSync as compressSync, decompress, decompressSync, deflate, deflateSync, gunzip, gunzipSync, gzip, gzipSync, inflate, inflateSync, strFromU8, strToU8, unzip, unzipSync, unzlib, unzlibSync, zip, zipSync, zlib, zlibSync } from './chunk-PQZ2CS26.js';
2
+ export { AsyncGzip as AsyncCompress, AsyncDecompress, AsyncDeflate, AsyncGunzip, AsyncGzip, AsyncInflate, AsyncUnzipInflate, AsyncUnzlib, AsyncZipDeflate, AsyncZlib, Gzip as Compress, DecodeUTF8, Decompress, Deflate, EncodeUTF8, FlateErrorCode, Gunzip, Gzip, Inflate, Unzip, UnzipInflate, UnzipPassThrough, Unzlib, Zip, ZipDeflate, ZipPassThrough, Zlib, gzip as compress, gzipSync as compressSync, decompress, decompressSync, deflate, deflateSync, gunzip, gunzipSync, gzip, gzipSync, inflate, inflateSync, strFromU8, strToU8, unzip, unzipSync, unzlib, unzlibSync, zip, zipSync, zlib, zlibSync } from './chunk-CDTES65T.js';
3
3
  import './chunk-PR4QN5HX.js';