@waniwani/sdk 0.12.13 → 0.12.14-beta.0
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/dist/chat/embed.js +102 -102
- package/dist/chat/embed.js.map +1 -1
- package/dist/chat/index.d.ts +105 -0
- package/dist/chat/index.js +7 -7
- package/dist/chat/index.js.map +1 -1
- package/dist/legacy/index.d.ts +83 -0
- package/dist/legacy/index.js +13 -13
- package/dist/legacy/index.js.map +1 -1
- package/package.json +1 -1
package/dist/legacy/index.d.ts
CHANGED
|
@@ -1195,6 +1195,73 @@ interface NextJsHandlerResult {
|
|
|
1195
1195
|
*/
|
|
1196
1196
|
declare function toNextJsHandler(client: WaniWaniClient, options: NextJsHandlerOptions): NextJsHandlerResult;
|
|
1197
1197
|
|
|
1198
|
+
/**
|
|
1199
|
+
* English catalog. Source of truth — every other locale must mirror this
|
|
1200
|
+
* shape exactly (the `Messages` type is inferred from here).
|
|
1201
|
+
*/
|
|
1202
|
+
interface Messages {
|
|
1203
|
+
promptInput: {
|
|
1204
|
+
placeholder: string;
|
|
1205
|
+
uploadFiles: string;
|
|
1206
|
+
stop: string;
|
|
1207
|
+
submit: string;
|
|
1208
|
+
removeAttachments: string;
|
|
1209
|
+
};
|
|
1210
|
+
workingIndicator: {
|
|
1211
|
+
default: string;
|
|
1212
|
+
};
|
|
1213
|
+
reasoning: {
|
|
1214
|
+
thinking: string;
|
|
1215
|
+
thoughtBrief: string;
|
|
1216
|
+
thoughtForSeconds: (count: number) => string;
|
|
1217
|
+
};
|
|
1218
|
+
tool: {
|
|
1219
|
+
copy: string;
|
|
1220
|
+
copied: string;
|
|
1221
|
+
request: string;
|
|
1222
|
+
response: string;
|
|
1223
|
+
error: string;
|
|
1224
|
+
};
|
|
1225
|
+
attachments: {
|
|
1226
|
+
attachmentFallback: string;
|
|
1227
|
+
fileFallback: string;
|
|
1228
|
+
};
|
|
1229
|
+
threadMenu: {
|
|
1230
|
+
newChat: string;
|
|
1231
|
+
threadHistory: string;
|
|
1232
|
+
deleteThread: string;
|
|
1233
|
+
noPreviousChats: string;
|
|
1234
|
+
hiddenThreads: (count: number) => string;
|
|
1235
|
+
};
|
|
1236
|
+
chatQueue: {
|
|
1237
|
+
attachmentFallback: string;
|
|
1238
|
+
removeFromQueue: string;
|
|
1239
|
+
queued: (count: number) => string;
|
|
1240
|
+
};
|
|
1241
|
+
poweredBy: {
|
|
1242
|
+
label: string;
|
|
1243
|
+
};
|
|
1244
|
+
aiDisclaimer: {
|
|
1245
|
+
default: string;
|
|
1246
|
+
};
|
|
1247
|
+
exportSession: {
|
|
1248
|
+
saving: string;
|
|
1249
|
+
saved: string;
|
|
1250
|
+
error: string;
|
|
1251
|
+
export: string;
|
|
1252
|
+
tooltip: string;
|
|
1253
|
+
};
|
|
1254
|
+
widgetErrorBoundary: {
|
|
1255
|
+
failedToLoad: string;
|
|
1256
|
+
retry: string;
|
|
1257
|
+
};
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
type DeepPartial<T> = T extends (...args: never[]) => unknown ? T : T extends object ? {
|
|
1261
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
1262
|
+
} : T;
|
|
1263
|
+
type MessageOverrides = DeepPartial<Messages>;
|
|
1264
|
+
|
|
1198
1265
|
/**
|
|
1199
1266
|
* Built-in theme presets. `auto` follows the host's `prefers-color-scheme`
|
|
1200
1267
|
* and switches at runtime without re-rendering.
|
|
@@ -1368,6 +1435,22 @@ interface ChatBaseProps {
|
|
|
1368
1435
|
* Pass a string to override the wording, or `false` to hide it entirely.
|
|
1369
1436
|
*/
|
|
1370
1437
|
disclaimer?: string | false;
|
|
1438
|
+
/**
|
|
1439
|
+
* UI language for built-in labels (buttons, placeholders, status text).
|
|
1440
|
+
* Supports `"en"`, `"fr"`, `"es"`. When omitted, the widget detects the
|
|
1441
|
+
* locale from `<html lang>` and `navigator.language(s)`, falling back
|
|
1442
|
+
* to English.
|
|
1443
|
+
*/
|
|
1444
|
+
locale?: string;
|
|
1445
|
+
/**
|
|
1446
|
+
* Per-key overrides on top of the resolved locale catalog. Use this to
|
|
1447
|
+
* tweak individual built-in strings without contributing a new locale.
|
|
1448
|
+
*
|
|
1449
|
+
* ```tsx
|
|
1450
|
+
* messages={{ promptInput: { placeholder: "Ask the agent…" } }}
|
|
1451
|
+
* ```
|
|
1452
|
+
*/
|
|
1453
|
+
messages?: MessageOverrides;
|
|
1371
1454
|
}
|
|
1372
1455
|
/** Handler signature for MCP tool calls from widgets. */
|
|
1373
1456
|
type CallToolHandler = (params: {
|