@aikaara/chat-sdk 0.7.7 → 0.8.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/{MountTenant-5pQsm4CF.mjs → MountTenant-CdaBBA2O.mjs} +3060 -3019
- package/dist/{MountTenant-DiXJuVIV.cjs → MountTenant-DHxy8WY9.cjs} +61 -56
- package/dist/cdn/aikaara-chat.iife.js +66 -61
- package/dist/headless.cjs +1 -1
- package/dist/headless.d.ts +38 -1
- package/dist/headless.mjs +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +46 -1
- package/dist/index.mjs +2 -2
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +15 -0
- package/dist/ui.mjs +1 -1
- package/package.json +1 -1
package/dist/headless.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./MountTenant-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./MountTenant-DHxy8WY9.cjs");class r extends i.EventEmitter{registration=null;pendingEdits=[];constructor(e){super(),this.setupListeners(e)}registerForm(e){this.registration=e;const t=this.pendingEdits.filter(s=>s.entity_type===e.entityType&&String(s.entity_id)===String(e.entityId));if(t.length>0){for(const s of t)e.onFieldUpdate(s.fields),this.emit("edit:applied",{entityType:s.entity_type,entityId:s.entity_id,fields:s.fields});this.pendingEdits=this.pendingEdits.filter(s=>!(s.entity_type===e.entityType&&String(s.entity_id)===String(e.entityId)))}}unregisterForm(e,t){this.registration?.entityType===e&&String(this.registration?.entityId)===String(t)&&(this.registration=null)}get currentForm(){return this.registration}pushFieldUpdates(e,t,s){this.registration&&this.registration.entityType===e&&String(this.registration.entityId)===String(t)?(this.registration.onFieldUpdate(s),this.emit("edit:applied",{entityType:e,entityId:t,fields:s})):(this.pendingEdits.push({action:"edit_entity",entity_type:e,entity_id:t,fields:s}),this.emit("edit:pending",{entityType:e,entityId:t,fields:s}))}async requestSave(){if(!this.registration)return{success:!1,error:"No form registered"};try{return await this.registration.onSave(),this.emit("save:success",{entityType:this.registration.entityType,entityId:this.registration.entityId}),{success:!0}}catch(e){const t=e instanceof Error?e.message:"Save failed";return this.emit("save:error",{entityType:this.registration.entityType,entityId:this.registration.entityId,error:t}),{success:!1,error:t}}}async requestTest(e){if(!this.registration?.onTest)return{success:!1,error:"Current form does not support testing"};try{return await this.registration.onTest(e),{success:!0}}catch(t){return{success:!1,error:t instanceof Error?t.message:"Test failed"}}}setupListeners(e){e.on("action:edit_entity",t=>{this.pushFieldUpdates(t.entity_type,t.entity_id,t.fields)}),e.on("action:save_entity",t=>{this.requestSave()}),e.on("action:test_tool",t=>{this.emit("test:triggered",{toolId:t.tool_id,parameters:t.parameters}),this.requestTest(t.parameters)})}}exports.ActionCableClient=i.ActionCableClient;exports.AikaaraChatClient=i.AikaaraChatClient;exports.ApiClient=i.ApiClient;exports.ChannelSubscription=i.ChannelSubscription;exports.ConnectionManager=i.ConnectionManager;exports.ConversationManager=i.ConversationManager;exports.EventEmitter=i.EventEmitter;exports.MessageStore=i.MessageStore;exports.SessionAuthAdapter=i.SessionAuthAdapter;exports.SsoExchangeAdapter=i.SsoExchangeAdapter;exports.TiledeskTransport=i.TiledeskTransport;exports.clearPersistedConversationId=i.clearPersistedConversationId;exports.collectSsoCredentials=i.collectSsoCredentials;exports.createFetchUploadAdapter=i.createFetchUploadAdapter;exports.createPresigned3StepUploadAdapter=i.createPresigned3StepUploadAdapter;exports.createTiledeskHistoryAdapter=i.createTiledeskHistoryAdapter;exports.extractTiledeskFileEnvelope=i.extractTiledeskFileEnvelope;exports.inferTiledeskRole=i.inferTiledeskRole;exports.isTiledeskSelfEcho=i.isTiledeskSelfEcho;exports.mountFromSlug=i.mountFromSlug;exports.mountTenantWidget=i.mount;exports.parseTiledeskTemplate=i.parseTiledeskTemplate;exports.FormBridge=r;
|
package/dist/headless.d.ts
CHANGED
|
@@ -1026,7 +1026,7 @@ export declare interface SlugMountedWidget extends MountedTenantWidget {
|
|
|
1026
1026
|
export declare interface SlugMountOptions {
|
|
1027
1027
|
/** Container element or CSS selector (e.g. `#chat`). */
|
|
1028
1028
|
container: HTMLElement | string;
|
|
1029
|
-
/** Tenant identifier — the SDK fetches `${configBase}/widget_configs/${slug}`. */
|
|
1029
|
+
/** Tenant identifier — the SDK fetches `${configBase}/api/v1/widget_configs/${slug}`. */
|
|
1030
1030
|
slug: string;
|
|
1031
1031
|
/** Defaults to `https://api.aikaara.com`. Override for self-hosted aikaara. */
|
|
1032
1032
|
configBase?: string;
|
|
@@ -1678,6 +1678,13 @@ export declare interface WidgetConfig extends ChatClientConfig {
|
|
|
1678
1678
|
placeholder?: string;
|
|
1679
1679
|
showTimestamps?: boolean;
|
|
1680
1680
|
persistConversation?: boolean;
|
|
1681
|
+
showHeader?: boolean;
|
|
1682
|
+
hideSystemMessages?: string[];
|
|
1683
|
+
timestampFormat?: 'time' | 'datetime' | 'date' | 'none';
|
|
1684
|
+
input?: {
|
|
1685
|
+
attachPosition?: 'left' | 'right';
|
|
1686
|
+
sendButtonShape?: 'circle' | 'square';
|
|
1687
|
+
};
|
|
1681
1688
|
showBubble?: boolean;
|
|
1682
1689
|
bubbleText?: string;
|
|
1683
1690
|
bubbleIcon?: string;
|
|
@@ -1708,6 +1715,36 @@ export declare interface WidgetConfigDescriptor {
|
|
|
1708
1715
|
placeholder?: string;
|
|
1709
1716
|
showTimestamps?: boolean;
|
|
1710
1717
|
persistConversation?: boolean;
|
|
1718
|
+
/**
|
|
1719
|
+
* When false, suppress the SDK-rendered `<aikaara-chat-header>` (title +
|
|
1720
|
+
* subtitle bar). Useful for embed mounts where the host page already shows
|
|
1721
|
+
* the conversation title in its own toolbar (e.g. bandhan's
|
|
1722
|
+
* "File ITR with Tax Expert" top bar). Defaults to true.
|
|
1723
|
+
*/
|
|
1724
|
+
showHeader?: boolean;
|
|
1725
|
+
/**
|
|
1726
|
+
* Strings (case-insensitive) that should NOT render as visible system
|
|
1727
|
+
* pills / messages. Lets tenants hide infrastructure chatter like
|
|
1728
|
+
* `CHAT_INITIATED` (pre-existing user-side filter) or `Group created`
|
|
1729
|
+
* (Tiledesk's auto-emitted notification when a support-group is minted).
|
|
1730
|
+
* Matches both `system` role and assistant content. Defaults to none.
|
|
1731
|
+
*/
|
|
1732
|
+
hideSystemMessages?: string[];
|
|
1733
|
+
/**
|
|
1734
|
+
* Timestamp display under each bubble.
|
|
1735
|
+
* - `time` (default): locale time, e.g. "11:26 AM" / "23:14".
|
|
1736
|
+
* - `datetime`: short month/day + time, e.g. "May 08, 11:26 AM".
|
|
1737
|
+
* - `date`: short month/day only.
|
|
1738
|
+
* - `none`: equivalent to `showTimestamps: false`.
|
|
1739
|
+
*/
|
|
1740
|
+
timestampFormat?: 'time' | 'datetime' | 'date' | 'none';
|
|
1741
|
+
/** Composer styling — attach button position and send button shape. */
|
|
1742
|
+
input?: {
|
|
1743
|
+
/** Where the paperclip button sits relative to the textarea. Default `left`. */
|
|
1744
|
+
attachPosition?: 'left' | 'right';
|
|
1745
|
+
/** Round (default) or filled square send button. */
|
|
1746
|
+
sendButtonShape?: 'circle' | 'square';
|
|
1747
|
+
};
|
|
1711
1748
|
/**
|
|
1712
1749
|
* Full theme token set. Mirrored as CSS variables (`--aikaara-*`) on the
|
|
1713
1750
|
* widget root so any inner web-component can style itself by referencing
|
package/dist/headless.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as s } from "./MountTenant-
|
|
2
|
-
import { A as p, b as l, k as g, C as h, l as c, m as y, M as u, S as m, n as f, T as S, o as T, p as _, q as E, s as v, t as C, u as F, v as A, w as k, x as I, y as x, z as U } from "./MountTenant-
|
|
1
|
+
import { E as s } from "./MountTenant-CdaBBA2O.mjs";
|
|
2
|
+
import { A as p, b as l, k as g, C as h, l as c, m as y, M as u, S as m, n as f, T as S, o as T, p as _, q as E, s as v, t as C, u as F, v as A, w as k, x as I, y as x, z as U } from "./MountTenant-CdaBBA2O.mjs";
|
|
3
3
|
class a extends s {
|
|
4
4
|
registration = null;
|
|
5
5
|
pendingEdits = [];
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./MountTenant-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./MountTenant-DHxy8WY9.cjs"),s=require("./headless.cjs");function l(a){e.registerComponents();const t=document.createElement("aikaara-chat-widget"),i={baseUrl:"base-url",userToken:"user-token",apiKey:"api-key",title:"title",subtitle:"subtitle",theme:"theme",primaryColor:"primary-color",position:"position",width:"width",height:"height",placeholder:"placeholder",welcomeMessage:"welcome-message",avatarUrl:"avatar-url"};for(const[n,o]of Object.entries(i)){const r=a[n];r!=null&&t.setAttribute(o,String(r))}return t.configure(a),document.body.appendChild(t),t}function d(){const a=document.querySelector("aikaara-chat-widget");a&&a.remove()}exports.ActionCableClient=e.ActionCableClient;exports.AikaaraChatBubble=e.AikaaraChatBubble;exports.AikaaraChatClient=e.AikaaraChatClient;exports.AikaaraChatHeader=e.AikaaraChatHeader;exports.AikaaraChatInput=e.AikaaraChatInput;exports.AikaaraChatWidget=e.AikaaraChatWidget;exports.AikaaraErrorBanner=e.AikaaraErrorBanner;exports.AikaaraMessageBubble=e.AikaaraMessageBubble;exports.AikaaraMessageList=e.AikaaraMessageList;exports.AikaaraStreamingMessage=e.AikaaraStreamingMessage;exports.AikaaraTypingIndicator=e.AikaaraTypingIndicator;exports.ApiClient=e.ApiClient;exports.ChannelSubscription=e.ChannelSubscription;exports.ConnectionManager=e.ConnectionManager;exports.ConversationManager=e.ConversationManager;exports.EventEmitter=e.EventEmitter;exports.MessageStore=e.MessageStore;exports.SessionAuthAdapter=e.SessionAuthAdapter;exports.SsoExchangeAdapter=e.SsoExchangeAdapter;exports.TiledeskTransport=e.TiledeskTransport;exports.clearPersistedConversationId=e.clearPersistedConversationId;exports.collectSsoCredentials=e.collectSsoCredentials;exports.createFetchUploadAdapter=e.createFetchUploadAdapter;exports.createPresigned3StepUploadAdapter=e.createPresigned3StepUploadAdapter;exports.createTiledeskHistoryAdapter=e.createTiledeskHistoryAdapter;exports.extractTiledeskFileEnvelope=e.extractTiledeskFileEnvelope;exports.inferTiledeskRole=e.inferTiledeskRole;exports.isTiledeskSelfEcho=e.isTiledeskSelfEcho;exports.mountFromSlug=e.mountFromSlug;exports.mountTenantWidget=e.mount;exports.parseTiledeskTemplate=e.parseTiledeskTemplate;exports.registerComponents=e.registerComponents;exports.FormBridge=s.FormBridge;exports.mount=l;exports.unmount=d;
|
package/dist/index.d.ts
CHANGED
|
@@ -228,8 +228,16 @@ export declare class AikaaraMessageList extends HTMLElement {
|
|
|
228
228
|
private container;
|
|
229
229
|
private welcomeMessage;
|
|
230
230
|
private showTimestamps;
|
|
231
|
+
private timestampFormat;
|
|
232
|
+
private hideSystemMessages;
|
|
231
233
|
private linkHandlers;
|
|
232
234
|
private getLinkBearer;
|
|
235
|
+
setHideSystemMessages(items: string[]): void;
|
|
236
|
+
setTimestampFormat(fmt: 'time' | 'datetime' | 'date' | 'none'): void;
|
|
237
|
+
/** Returns true when a message should be hidden by the descriptor's
|
|
238
|
+
* `hideSystemMessages` filter. Matches the trimmed content
|
|
239
|
+
* case-insensitively against any configured needle (substring match). */
|
|
240
|
+
private shouldHideMessage;
|
|
233
241
|
setLinkConfig(handlers: LinkHandler[], bearer?: (source: 'session' | 'chat' | 'none') => Promise<string | null>): void;
|
|
234
242
|
constructor();
|
|
235
243
|
connectedCallback(): void;
|
|
@@ -917,7 +925,7 @@ export declare interface SlugMountedWidget extends MountedTenantWidget {
|
|
|
917
925
|
export declare interface SlugMountOptions {
|
|
918
926
|
/** Container element or CSS selector (e.g. `#chat`). */
|
|
919
927
|
container: HTMLElement | string;
|
|
920
|
-
/** Tenant identifier — the SDK fetches `${configBase}/widget_configs/${slug}`. */
|
|
928
|
+
/** Tenant identifier — the SDK fetches `${configBase}/api/v1/widget_configs/${slug}`. */
|
|
921
929
|
slug: string;
|
|
922
930
|
/** Defaults to `https://api.aikaara.com`. Override for self-hosted aikaara. */
|
|
923
931
|
configBase?: string;
|
|
@@ -1430,6 +1438,13 @@ export declare interface WidgetConfig extends ChatClientConfig {
|
|
|
1430
1438
|
placeholder?: string;
|
|
1431
1439
|
showTimestamps?: boolean;
|
|
1432
1440
|
persistConversation?: boolean;
|
|
1441
|
+
showHeader?: boolean;
|
|
1442
|
+
hideSystemMessages?: string[];
|
|
1443
|
+
timestampFormat?: 'time' | 'datetime' | 'date' | 'none';
|
|
1444
|
+
input?: {
|
|
1445
|
+
attachPosition?: 'left' | 'right';
|
|
1446
|
+
sendButtonShape?: 'circle' | 'square';
|
|
1447
|
+
};
|
|
1433
1448
|
showBubble?: boolean;
|
|
1434
1449
|
bubbleText?: string;
|
|
1435
1450
|
bubbleIcon?: string;
|
|
@@ -1460,6 +1475,36 @@ export declare interface WidgetConfigDescriptor {
|
|
|
1460
1475
|
placeholder?: string;
|
|
1461
1476
|
showTimestamps?: boolean;
|
|
1462
1477
|
persistConversation?: boolean;
|
|
1478
|
+
/**
|
|
1479
|
+
* When false, suppress the SDK-rendered `<aikaara-chat-header>` (title +
|
|
1480
|
+
* subtitle bar). Useful for embed mounts where the host page already shows
|
|
1481
|
+
* the conversation title in its own toolbar (e.g. bandhan's
|
|
1482
|
+
* "File ITR with Tax Expert" top bar). Defaults to true.
|
|
1483
|
+
*/
|
|
1484
|
+
showHeader?: boolean;
|
|
1485
|
+
/**
|
|
1486
|
+
* Strings (case-insensitive) that should NOT render as visible system
|
|
1487
|
+
* pills / messages. Lets tenants hide infrastructure chatter like
|
|
1488
|
+
* `CHAT_INITIATED` (pre-existing user-side filter) or `Group created`
|
|
1489
|
+
* (Tiledesk's auto-emitted notification when a support-group is minted).
|
|
1490
|
+
* Matches both `system` role and assistant content. Defaults to none.
|
|
1491
|
+
*/
|
|
1492
|
+
hideSystemMessages?: string[];
|
|
1493
|
+
/**
|
|
1494
|
+
* Timestamp display under each bubble.
|
|
1495
|
+
* - `time` (default): locale time, e.g. "11:26 AM" / "23:14".
|
|
1496
|
+
* - `datetime`: short month/day + time, e.g. "May 08, 11:26 AM".
|
|
1497
|
+
* - `date`: short month/day only.
|
|
1498
|
+
* - `none`: equivalent to `showTimestamps: false`.
|
|
1499
|
+
*/
|
|
1500
|
+
timestampFormat?: 'time' | 'datetime' | 'date' | 'none';
|
|
1501
|
+
/** Composer styling — attach button position and send button shape. */
|
|
1502
|
+
input?: {
|
|
1503
|
+
/** Where the paperclip button sits relative to the textarea. Default `left`. */
|
|
1504
|
+
attachPosition?: 'left' | 'right';
|
|
1505
|
+
/** Round (default) or filled square send button. */
|
|
1506
|
+
sendButtonShape?: 'circle' | 'square';
|
|
1507
|
+
};
|
|
1463
1508
|
/**
|
|
1464
1509
|
* Full theme token set. Mirrored as CSS variables (`--aikaara-*`) on the
|
|
1465
1510
|
* widget root so any inner web-component can style itself by referencing
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as o } from "./MountTenant-
|
|
2
|
-
import { A as u, a as m, b as g, c as h, d as k, e as A, f as C, g as b, h as f, i as S, j as T, k as v, C as y, l as w, m as M, E, M as x, S as B, n as F, T as U, o as I, p as j, q, s as H, t as P, u as W, v as z, w as K, x as L, y as O, z as R } from "./MountTenant-
|
|
1
|
+
import { r as o } from "./MountTenant-CdaBBA2O.mjs";
|
|
2
|
+
import { A as u, a as m, b as g, c as h, d as k, e as A, f as C, g as b, h as f, i as S, j as T, k as v, C as y, l as w, m as M, E, M as x, S as B, n as F, T as U, o as I, p as j, q, s as H, t as P, u as W, v as z, w as K, x as L, y as O, z as R } from "./MountTenant-CdaBBA2O.mjs";
|
|
3
3
|
import { FormBridge as G } from "./headless.mjs";
|
|
4
4
|
function l(e) {
|
|
5
5
|
o();
|
package/dist/ui.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./MountTenant-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./MountTenant-DHxy8WY9.cjs");exports.AikaaraChat=a.AikaaraChat;exports.AikaaraChatBubble=a.AikaaraChatBubble;exports.AikaaraChatHeader=a.AikaaraChatHeader;exports.AikaaraChatInput=a.AikaaraChatInput;exports.AikaaraChatWidget=a.AikaaraChatWidget;exports.AikaaraComparePlans=a.AikaaraComparePlans;exports.AikaaraErrorBanner=a.AikaaraErrorBanner;exports.AikaaraLinkModal=a.AikaaraLinkModal;exports.AikaaraMessageBubble=a.AikaaraMessageBubble;exports.AikaaraMessageList=a.AikaaraMessageList;exports.AikaaraModalAction=a.AikaaraModalAction;exports.AikaaraOptionList=a.AikaaraOptionList;exports.AikaaraStreamingMessage=a.AikaaraStreamingMessage;exports.AikaaraSubmitAction=a.AikaaraSubmitAction;exports.AikaaraSystemPill=a.AikaaraSystemPill;exports.AikaaraTemplateRenderer=a.AikaaraTemplateRenderer;exports.AikaaraTypingIndicator=a.AikaaraTypingIndicator;exports.registerComponents=a.registerComponents;
|
package/dist/ui.d.ts
CHANGED
|
@@ -286,8 +286,16 @@ export declare class AikaaraMessageList extends HTMLElement {
|
|
|
286
286
|
private container;
|
|
287
287
|
private welcomeMessage;
|
|
288
288
|
private showTimestamps;
|
|
289
|
+
private timestampFormat;
|
|
290
|
+
private hideSystemMessages;
|
|
289
291
|
private linkHandlers;
|
|
290
292
|
private getLinkBearer;
|
|
293
|
+
setHideSystemMessages(items: string[]): void;
|
|
294
|
+
setTimestampFormat(fmt: 'time' | 'datetime' | 'date' | 'none'): void;
|
|
295
|
+
/** Returns true when a message should be hidden by the descriptor's
|
|
296
|
+
* `hideSystemMessages` filter. Matches the trimmed content
|
|
297
|
+
* case-insensitively against any configured needle (substring match). */
|
|
298
|
+
private shouldHideMessage;
|
|
291
299
|
setLinkConfig(handlers: LinkHandler[], bearer?: (source: 'session' | 'chat' | 'none') => Promise<string | null>): void;
|
|
292
300
|
constructor();
|
|
293
301
|
connectedCallback(): void;
|
|
@@ -1155,6 +1163,13 @@ declare interface WidgetConfig extends ChatClientConfig {
|
|
|
1155
1163
|
placeholder?: string;
|
|
1156
1164
|
showTimestamps?: boolean;
|
|
1157
1165
|
persistConversation?: boolean;
|
|
1166
|
+
showHeader?: boolean;
|
|
1167
|
+
hideSystemMessages?: string[];
|
|
1168
|
+
timestampFormat?: 'time' | 'datetime' | 'date' | 'none';
|
|
1169
|
+
input?: {
|
|
1170
|
+
attachPosition?: 'left' | 'right';
|
|
1171
|
+
sendButtonShape?: 'circle' | 'square';
|
|
1172
|
+
};
|
|
1158
1173
|
showBubble?: boolean;
|
|
1159
1174
|
bubbleText?: string;
|
|
1160
1175
|
bubbleIcon?: string;
|
package/dist/ui.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as i, a as s, c as e, d as t, e as A, D as k, f as n, F as o, g, h as l, G as d, H as m, i as p, I as C, J as h, K as b, j as M, r as c } from "./MountTenant-
|
|
1
|
+
import { B as i, a as s, c as e, d as t, e as A, D as k, f as n, F as o, g, h as l, G as d, H as m, i as p, I as C, J as h, K as b, j as M, r as c } from "./MountTenant-CdaBBA2O.mjs";
|
|
2
2
|
export {
|
|
3
3
|
i as AikaaraChat,
|
|
4
4
|
s as AikaaraChatBubble,
|