@aikaara/chat-sdk 0.8.2 → 0.8.3
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-BCjKRkD8.cjs +978 -0
- package/dist/MountTenant-CxO7hJgs.mjs +14978 -0
- package/dist/cdn/aikaara-chat.iife.js +62 -62
- package/dist/headless.cjs +1 -1
- package/dist/headless.d.ts +316 -4
- package/dist/headless.mjs +19 -16
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +316 -4
- package/dist/index.mjs +29 -26
- package/dist/ui.cjs +1 -1
- package/dist/ui.mjs +1 -1
- package/package.json +1 -1
- package/dist/MountTenant-DvmiAoZ_.cjs +0 -978
- package/dist/MountTenant-DzNgBTiU.mjs +0 -14736
package/dist/index.d.ts
CHANGED
|
@@ -293,7 +293,17 @@ export declare class ApiClient {
|
|
|
293
293
|
private apiKey?;
|
|
294
294
|
private authToken?;
|
|
295
295
|
protected userToken: string;
|
|
296
|
+
private refreshHook;
|
|
296
297
|
constructor(baseUrl: string, userToken: string, apiKey?: string, authToken?: string);
|
|
298
|
+
/**
|
|
299
|
+
* Install a refresh hook. When a request returns 401 the client invokes
|
|
300
|
+
* the hook, replaces its in-memory `authToken`, and retries exactly once.
|
|
301
|
+
*/
|
|
302
|
+
setAuthRefreshHook(hook: AuthRefreshHook | null): void;
|
|
303
|
+
/** Surface the current bearer (e.g. for upload adapters that share it). */
|
|
304
|
+
getAuthToken(): string | undefined;
|
|
305
|
+
/** Replace the bearer used by subsequent requests. */
|
|
306
|
+
setAuthToken(next: string | undefined): void;
|
|
297
307
|
createConversation(params: {
|
|
298
308
|
systemPromptId?: number;
|
|
299
309
|
channel?: string;
|
|
@@ -304,8 +314,17 @@ export declare class ApiClient {
|
|
|
304
314
|
getMessages(conversationId: string): Promise<Message[]>;
|
|
305
315
|
private mapMessage;
|
|
306
316
|
private request;
|
|
317
|
+
private fetchWithHeaders;
|
|
307
318
|
}
|
|
308
319
|
|
|
320
|
+
export declare type ApiPanelFieldFormat = 'text' | 'currency' | 'date' | 'number';
|
|
321
|
+
|
|
322
|
+
export declare type ApiPanelRefresh = 'load' | 'assistant' | 'interval' | '30s' | '5m' | 'manual';
|
|
323
|
+
|
|
324
|
+
export declare type ApiPanelRender = 'fields' | 'steps';
|
|
325
|
+
|
|
326
|
+
export declare type ApiPanelSource = 'api' | 'paste';
|
|
327
|
+
|
|
309
328
|
export declare interface AppContext {
|
|
310
329
|
/** Current page/route path in the host app (e.g., '/products/42') */
|
|
311
330
|
currentPage: string;
|
|
@@ -321,6 +340,30 @@ export declare interface AppContext {
|
|
|
321
340
|
custom?: Record<string, unknown>;
|
|
322
341
|
}
|
|
323
342
|
|
|
343
|
+
/**
|
|
344
|
+
* Static page metadata written by the dashboard's App Layout tab.
|
|
345
|
+
* The hosted-shell renders top/bottom nav from this list; SDK code
|
|
346
|
+
* doesn't consume it.
|
|
347
|
+
*/
|
|
348
|
+
export declare interface AppPageDef {
|
|
349
|
+
id: string;
|
|
350
|
+
name: string;
|
|
351
|
+
/** Icon name from the shell's icon set (Chat, Sparkle, Book, …). */
|
|
352
|
+
icon?: string;
|
|
353
|
+
/** `"chat"` (default surface) or `"static"` (placeholder). */
|
|
354
|
+
kind?: 'chat' | 'static';
|
|
355
|
+
hint?: string;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* Hook the API client uses to recover from a 401. Wired up by the higher
|
|
360
|
+
* level mount when `descriptor.sso.autoRefresh === true`: the discovered
|
|
361
|
+
* partner token is re-read, exchanged for a fresh chat JWT, and the
|
|
362
|
+
* `authToken` field below is updated in place so the retry sends the new
|
|
363
|
+
* bearer. Returning `null` (or throwing) lets the original 401 propagate.
|
|
364
|
+
*/
|
|
365
|
+
declare type AuthRefreshHook = () => Promise<string | null>;
|
|
366
|
+
|
|
324
367
|
export declare class ChannelSubscription {
|
|
325
368
|
readonly identifier: string;
|
|
326
369
|
private callbacks;
|
|
@@ -475,6 +518,16 @@ export declare class ConversationManager {
|
|
|
475
518
|
private saveToStorage;
|
|
476
519
|
}
|
|
477
520
|
|
|
521
|
+
export declare interface CookieSourceConfig {
|
|
522
|
+
/** Cookie name. */
|
|
523
|
+
name?: string;
|
|
524
|
+
/**
|
|
525
|
+
* Informational only. The browser enforces the actual domain scope; we
|
|
526
|
+
* surface this so dashboards can document intent.
|
|
527
|
+
*/
|
|
528
|
+
domain?: string;
|
|
529
|
+
}
|
|
530
|
+
|
|
478
531
|
declare interface CreateConversationResponse {
|
|
479
532
|
id: string;
|
|
480
533
|
status: string;
|
|
@@ -488,6 +541,23 @@ export declare function createTiledeskHistoryAdapter(config: TiledeskHistoryAdap
|
|
|
488
541
|
|
|
489
542
|
export declare type CredentialProviders = Record<string, () => string | Promise<string>>;
|
|
490
543
|
|
|
544
|
+
export declare interface DiscoveredToken {
|
|
545
|
+
/** The raw partner token. */
|
|
546
|
+
token: string;
|
|
547
|
+
/** Echoed so callers can log + alert when the source changes mid-flow. */
|
|
548
|
+
source: TokenSourceKind;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
/**
|
|
552
|
+
* Dispatcher. Resolves the partner token according to
|
|
553
|
+
* `descriptor.tokenSource`. Returns a Promise so async-only sources
|
|
554
|
+
* (`postmsg`, `global`) share the same surface as synchronous ones.
|
|
555
|
+
*
|
|
556
|
+
* Throws when the token can't be found — callers decide whether to
|
|
557
|
+
* fall back to a login screen (per `descriptor.fallback`).
|
|
558
|
+
*/
|
|
559
|
+
export declare function discoverToken(opts: TokenDiscoveryOptions): Promise<DiscoveredToken>;
|
|
560
|
+
|
|
491
561
|
export declare interface EditEntityAction {
|
|
492
562
|
action: 'edit_entity';
|
|
493
563
|
entity_type: string;
|
|
@@ -665,8 +735,25 @@ export declare interface FormRegistration {
|
|
|
665
735
|
getCurrentValues: () => Record<string, unknown>;
|
|
666
736
|
}
|
|
667
737
|
|
|
738
|
+
export declare interface GlobalSourceConfig {
|
|
739
|
+
/** Dot-path into `window` (e.g. `"PartnerSDK.session.token"`). */
|
|
740
|
+
path?: string;
|
|
741
|
+
/** Max poll time in ms (default 2000). */
|
|
742
|
+
timeoutMs?: number;
|
|
743
|
+
/** Poll interval in ms (default 100). */
|
|
744
|
+
intervalMs?: number;
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
export declare interface HashSourceConfig {
|
|
748
|
+
/** Hash key (after `#…&key=value&…`). Default `"token"`. */
|
|
749
|
+
key?: string;
|
|
750
|
+
}
|
|
751
|
+
|
|
668
752
|
export declare function inferTiledeskRole(message: TiledeskMessage, cfg: TiledeskRoleConfig): TiledeskRole;
|
|
669
753
|
|
|
754
|
+
export declare interface InitSourceConfig {
|
|
755
|
+
}
|
|
756
|
+
|
|
670
757
|
/**
|
|
671
758
|
* Self-echo detector — Tiledesk fans the user's outgoing publish back
|
|
672
759
|
* as a `clientadded` event on the same connection. UI must dedupe against
|
|
@@ -802,6 +889,21 @@ export declare interface NavigateAction {
|
|
|
802
889
|
|
|
803
890
|
export declare function parseTiledeskTemplate(message: TiledeskMessage): TiledeskParsedTemplate;
|
|
804
891
|
|
|
892
|
+
export declare interface PostMsgSourceConfig {
|
|
893
|
+
/** Message envelope `type` field that gates which postMessage we accept. */
|
|
894
|
+
type?: string;
|
|
895
|
+
/** Property inside `event.data` carrying the token. Default `"token"`. */
|
|
896
|
+
key?: string;
|
|
897
|
+
/**
|
|
898
|
+
* Allowed origins (comma-separated or single string). When set, messages
|
|
899
|
+
* from any other origin are ignored. When unset every origin is accepted
|
|
900
|
+
* — partners are encouraged to set this in production.
|
|
901
|
+
*/
|
|
902
|
+
origins?: string;
|
|
903
|
+
/** Milliseconds to wait before rejecting. Default 30_000. */
|
|
904
|
+
timeoutMs?: number;
|
|
905
|
+
}
|
|
906
|
+
|
|
805
907
|
/**
|
|
806
908
|
* One HTTP call run by the SDK before auth. Failure of `soft: true` steps
|
|
807
909
|
* is logged and ignored; failure of strict steps aborts the mount.
|
|
@@ -851,6 +953,11 @@ export declare interface Presigned3StepAdapterConfig {
|
|
|
851
953
|
extraHeaders?: Record<string, string>;
|
|
852
954
|
}
|
|
853
955
|
|
|
956
|
+
export declare interface QuerySourceConfig {
|
|
957
|
+
/** Query-string parameter name. Default `"token"`. */
|
|
958
|
+
key?: string;
|
|
959
|
+
}
|
|
960
|
+
|
|
854
961
|
export declare function registerComponents(): void;
|
|
855
962
|
|
|
856
963
|
/**
|
|
@@ -858,7 +965,7 @@ export declare function registerComponents(): void;
|
|
|
858
965
|
* loader runs. Both kinds resolve to a `Promise<HTMLElement>` after load,
|
|
859
966
|
* which the runtime appends into the slot anchor.
|
|
860
967
|
*/
|
|
861
|
-
declare type RemoteComponent = {
|
|
968
|
+
export declare type RemoteComponent = {
|
|
862
969
|
kind: 'iife-element';
|
|
863
970
|
/** URL of an IIFE bundle that calls `customElements.define(tag, …)`. */
|
|
864
971
|
scriptUrl: string;
|
|
@@ -899,7 +1006,7 @@ declare type RemoteComponent = {
|
|
|
899
1006
|
* `redirectIfFails` lets a guard send the user to another route id
|
|
900
1007
|
* instead of erroring. Useful for `'authed'` failing → redirect to login.
|
|
901
1008
|
*/
|
|
902
|
-
declare interface RouteDef {
|
|
1009
|
+
export declare interface RouteDef {
|
|
903
1010
|
path: string;
|
|
904
1011
|
component: string;
|
|
905
1012
|
guards?: string[];
|
|
@@ -970,6 +1077,41 @@ export declare interface SessionAuthDescriptor {
|
|
|
970
1077
|
|
|
971
1078
|
export declare type SessionTokenProvider = string | (() => string | Promise<string>);
|
|
972
1079
|
|
|
1080
|
+
export declare interface SidePanelDef {
|
|
1081
|
+
enabled?: boolean;
|
|
1082
|
+
type: SidePanelType;
|
|
1083
|
+
title?: string;
|
|
1084
|
+
mobile?: SidePanelMobile;
|
|
1085
|
+
steps?: Array<{
|
|
1086
|
+
name: string;
|
|
1087
|
+
hint?: string;
|
|
1088
|
+
}>;
|
|
1089
|
+
emptyText?: string;
|
|
1090
|
+
allowUpload?: boolean;
|
|
1091
|
+
summaryFields?: string[];
|
|
1092
|
+
supportPhone?: string;
|
|
1093
|
+
supportHours?: string;
|
|
1094
|
+
showHumanHandoff?: boolean;
|
|
1095
|
+
source?: ApiPanelSource;
|
|
1096
|
+
endpoint?: string;
|
|
1097
|
+
sampleJson?: string;
|
|
1098
|
+
refresh?: ApiPanelRefresh;
|
|
1099
|
+
intervalSec?: number;
|
|
1100
|
+
render?: ApiPanelRender;
|
|
1101
|
+
fields?: Array<{
|
|
1102
|
+
label: string;
|
|
1103
|
+
path: string;
|
|
1104
|
+
format?: ApiPanelFieldFormat;
|
|
1105
|
+
}>;
|
|
1106
|
+
stepsPath?: string;
|
|
1107
|
+
stepStatusKey?: string;
|
|
1108
|
+
customUrl?: string;
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
export declare type SidePanelMobile = 'drawer' | 'hidden';
|
|
1112
|
+
|
|
1113
|
+
export declare type SidePanelType = 'steps' | 'files' | 'summary' | 'support' | 'api' | 'custom';
|
|
1114
|
+
|
|
973
1115
|
export declare interface SlugMountedWidget extends MountedTenantWidget {
|
|
974
1116
|
fullName: string;
|
|
975
1117
|
/** Resolved descriptor (fallback ⊕ fetched ⊕ overrides). Host reads
|
|
@@ -977,6 +1119,13 @@ export declare interface SlugMountedWidget extends MountedTenantWidget {
|
|
|
977
1119
|
descriptor: WidgetConfigDescriptor;
|
|
978
1120
|
/** Force a fresh /chatbuddy/auth-style refetch (clears cached requestId). */
|
|
979
1121
|
refreshAuth(): Promise<void>;
|
|
1122
|
+
/**
|
|
1123
|
+
* Re-discover the partner token (per `descriptor.sso.tokenSource`) and
|
|
1124
|
+
* re-exchange for a fresh chat JWT. Returns the new bearer or null when
|
|
1125
|
+
* discovery fails. Only available when `descriptor.sso.autoRefresh` is
|
|
1126
|
+
* `true`; returns `null` immediately otherwise.
|
|
1127
|
+
*/
|
|
1128
|
+
refreshPartnerAuth(): Promise<string | null>;
|
|
980
1129
|
}
|
|
981
1130
|
|
|
982
1131
|
export declare interface SlugMountOptions {
|
|
@@ -1020,6 +1169,13 @@ export declare interface SlugMountOptions {
|
|
|
1020
1169
|
* without host code per call.
|
|
1021
1170
|
*/
|
|
1022
1171
|
identity?: Record<string, string | undefined>;
|
|
1172
|
+
/**
|
|
1173
|
+
* Partner token supplied directly by the embedding host. Used by
|
|
1174
|
+
* `descriptor.sso.tokenSource === "init"` (v2 sign-in flow) — every
|
|
1175
|
+
* other source kind discovers the token from the page itself
|
|
1176
|
+
* (query / hash / cookie / storage / postMessage / global).
|
|
1177
|
+
*/
|
|
1178
|
+
partnerToken?: string;
|
|
1023
1179
|
};
|
|
1024
1180
|
/** Optional escape hatches; merge over descriptor-driven defaults. */
|
|
1025
1181
|
hooks?: {
|
|
@@ -1080,8 +1236,37 @@ export declare interface SsoDescriptor {
|
|
|
1080
1236
|
apiKey?: string;
|
|
1081
1237
|
/** Extra static headers attached to the exchange POST. */
|
|
1082
1238
|
headers?: Record<string, string>;
|
|
1083
|
-
/**
|
|
1084
|
-
|
|
1239
|
+
/**
|
|
1240
|
+
* Legacy v1 shape — explicit list of credential sources the browser
|
|
1241
|
+
* reads + posts to the exchange endpoint. Still supported for the
|
|
1242
|
+
* bandhan-itr / myfinancials cohort that shipped before the v2
|
|
1243
|
+
* sign-in tab. Mutually exclusive with `tokenSource` (v2).
|
|
1244
|
+
*/
|
|
1245
|
+
collect?: SsoCollectSpec[];
|
|
1246
|
+
/** Provider family. `"partner"` is the only value today. */
|
|
1247
|
+
provider?: string;
|
|
1248
|
+
/** Recipe id paired with this descriptor (e.g. `partner_token_to_backend_jwt`). */
|
|
1249
|
+
flow?: string;
|
|
1250
|
+
/** Skip the login screen entirely — read token, exchange, mount chat. */
|
|
1251
|
+
skipLogin?: boolean;
|
|
1252
|
+
/** Re-read the token source on any request that 401s. */
|
|
1253
|
+
autoRefresh?: boolean;
|
|
1254
|
+
/** Selects which token reader runs at boot. */
|
|
1255
|
+
tokenSource?: TokenSourceKind;
|
|
1256
|
+
/** Per-source config (only the matching block is emitted by the dashboard). */
|
|
1257
|
+
tokenSourceConfig?: TokenSourceConfig;
|
|
1258
|
+
/** What to do when token-discovery fails — show a fallback screen. */
|
|
1259
|
+
fallback?: {
|
|
1260
|
+
enabled?: boolean;
|
|
1261
|
+
method?: 'phone' | 'email';
|
|
1262
|
+
};
|
|
1263
|
+
/** Dot-paths into the partner identity payload returned by `auth`. */
|
|
1264
|
+
map?: {
|
|
1265
|
+
id?: string;
|
|
1266
|
+
email?: string;
|
|
1267
|
+
name?: string;
|
|
1268
|
+
phone?: string;
|
|
1269
|
+
};
|
|
1085
1270
|
}
|
|
1086
1271
|
|
|
1087
1272
|
export declare class SsoExchangeAdapter {
|
|
@@ -1141,6 +1326,15 @@ export declare interface SsoIdentity {
|
|
|
1141
1326
|
*/
|
|
1142
1327
|
export declare type SsoSourceKind = 'cookie' | 'localStorage' | 'sessionStorage' | 'url_param' | 'header_meta' | 'callback';
|
|
1143
1328
|
|
|
1329
|
+
export declare interface StorageSourceConfig {
|
|
1330
|
+
/** `"local"` (default) or `"session"`. */
|
|
1331
|
+
store?: 'local' | 'session';
|
|
1332
|
+
/** Storage key. */
|
|
1333
|
+
key?: string;
|
|
1334
|
+
/** Optional dot-path. When set the value is JSON.parsed and walked. */
|
|
1335
|
+
path?: string;
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1144
1338
|
declare type SubscriptionCallback = (data: unknown) => void;
|
|
1145
1339
|
|
|
1146
1340
|
declare interface TemplateMessageEvent {
|
|
@@ -1425,6 +1619,102 @@ export declare interface TiledeskTransportConfig {
|
|
|
1425
1619
|
debug?: boolean;
|
|
1426
1620
|
}
|
|
1427
1621
|
|
|
1622
|
+
export declare interface TokenDiscoveryDescriptor {
|
|
1623
|
+
/** `"partner"` today; reserved for future SSO families. */
|
|
1624
|
+
provider?: string;
|
|
1625
|
+
/** Recipe id the backend pairs with this descriptor. */
|
|
1626
|
+
flow?: string;
|
|
1627
|
+
/** When true the embedded SDK skips the login UI entirely. */
|
|
1628
|
+
skipLogin?: boolean;
|
|
1629
|
+
/** When true the SDK re-reads the source on 401 retries. */
|
|
1630
|
+
autoRefresh?: boolean;
|
|
1631
|
+
/** One of the seven supported source kinds. */
|
|
1632
|
+
tokenSource: TokenSourceKind;
|
|
1633
|
+
/** Source-specific config; only the matching block is read. */
|
|
1634
|
+
tokenSourceConfig?: TokenSourceConfig;
|
|
1635
|
+
/** Fallback (e.g. show a phone OTP screen) when discovery fails. */
|
|
1636
|
+
fallback?: {
|
|
1637
|
+
enabled?: boolean;
|
|
1638
|
+
method?: 'phone' | 'email';
|
|
1639
|
+
};
|
|
1640
|
+
/** Dot-paths into the partner identity payload returned by the auth call. */
|
|
1641
|
+
map?: {
|
|
1642
|
+
id?: string;
|
|
1643
|
+
email?: string;
|
|
1644
|
+
name?: string;
|
|
1645
|
+
phone?: string;
|
|
1646
|
+
};
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1649
|
+
export declare class TokenDiscoveryError extends Error {
|
|
1650
|
+
readonly source: string;
|
|
1651
|
+
constructor(source: string, msg: string);
|
|
1652
|
+
}
|
|
1653
|
+
|
|
1654
|
+
export declare interface TokenDiscoveryOptions {
|
|
1655
|
+
/** Descriptor from `widget_configs/:slug` (`configurations.sso`). */
|
|
1656
|
+
descriptor: TokenDiscoveryDescriptor;
|
|
1657
|
+
/**
|
|
1658
|
+
* Initial token explicitly passed to the SDK by the parent caller. Used
|
|
1659
|
+
* by the `init` source kind; ignored by every other.
|
|
1660
|
+
*/
|
|
1661
|
+
initToken?: string;
|
|
1662
|
+
}
|
|
1663
|
+
|
|
1664
|
+
/**
|
|
1665
|
+
* Thin wrapper that re-runs `discoverToken` on demand. Used by
|
|
1666
|
+
* `ApiClient` when a request 401s and `descriptor.sso.autoRefresh` is set.
|
|
1667
|
+
*
|
|
1668
|
+
* The first call caches the token; `.refresh()` forces a re-read of the
|
|
1669
|
+
* source. `init` mode can't be refreshed (the partner already gave us the
|
|
1670
|
+
* single token) — callers should fall through to fallback there.
|
|
1671
|
+
*/
|
|
1672
|
+
export declare class TokenDiscoveryReader {
|
|
1673
|
+
private readonly opts;
|
|
1674
|
+
private cached;
|
|
1675
|
+
constructor(opts: TokenDiscoveryOptions);
|
|
1676
|
+
get descriptor(): TokenDiscoveryDescriptor;
|
|
1677
|
+
/** Resolve the token. Returns cache if present. */
|
|
1678
|
+
get(): Promise<DiscoveredToken>;
|
|
1679
|
+
/**
|
|
1680
|
+
* Re-evaluate the source. For `init` mode (where the SDK has no way to
|
|
1681
|
+
* re-read) this returns the cached token unchanged — callers should
|
|
1682
|
+
* treat repeated 401s after a refresh attempt as terminal.
|
|
1683
|
+
*/
|
|
1684
|
+
refresh(): Promise<DiscoveredToken>;
|
|
1685
|
+
}
|
|
1686
|
+
|
|
1687
|
+
export declare type TokenSourceConfig = InitSourceConfig | QuerySourceConfig | HashSourceConfig | PostMsgSourceConfig | CookieSourceConfig | StorageSourceConfig | GlobalSourceConfig;
|
|
1688
|
+
|
|
1689
|
+
/**
|
|
1690
|
+
* Partner-token discovery dispatcher (v2 sign-in flow).
|
|
1691
|
+
*
|
|
1692
|
+
* The dashboard's Sign-in tab writes a `descriptor.sso` block that names
|
|
1693
|
+
* one of seven token-source modes plus a per-mode config block. At runtime
|
|
1694
|
+
* the SDK reads the descriptor, dispatches to the matching reader, and
|
|
1695
|
+
* returns the raw partner token. When `descriptor.sso.skipLogin === true`
|
|
1696
|
+
* the host shell uses the token directly to do the auth exchange; when
|
|
1697
|
+
* `descriptor.sso.autoRefresh === true` the reader is re-evaluated on any
|
|
1698
|
+
* request that returned 401 (see {@link ApiClient}).
|
|
1699
|
+
*
|
|
1700
|
+
* Reading flows:
|
|
1701
|
+
* - `init` — supplied at construction (e.g. `Aikaara.init({token})`).
|
|
1702
|
+
* - `query` — `URLSearchParams(location.search).get(cfg.key)`.
|
|
1703
|
+
* - `hash` — `location.hash` parsed as URLSearchParams; cfg.key wins.
|
|
1704
|
+
* - `postmsg` — `window.addEventListener('message')` filtered by
|
|
1705
|
+
* `cfg.type` + `cfg.key`; origins allowlist optional.
|
|
1706
|
+
* - `cookie` — `document.cookie` parsed; domain scope is informational
|
|
1707
|
+
* (browser already enforces it for the running page).
|
|
1708
|
+
* - `storage` — `(localStorage|sessionStorage).getItem(cfg.key)`; when
|
|
1709
|
+
* `cfg.path` is set, parsed as JSON + dot-path resolved.
|
|
1710
|
+
* - `global` — `window[cfg.path]` resolved via dot-path; polled for
|
|
1711
|
+
* up to 2 seconds for late-loading partner SDKs.
|
|
1712
|
+
*
|
|
1713
|
+
* The dispatcher is intentionally side-effect-free apart from
|
|
1714
|
+
* `postmsg` (which has to attach a listener). Callers control caching.
|
|
1715
|
+
*/
|
|
1716
|
+
export declare type TokenSourceKind = 'init' | 'query' | 'hash' | 'postmsg' | 'cookie' | 'storage' | 'global';
|
|
1717
|
+
|
|
1428
1718
|
export declare interface ToolCall {
|
|
1429
1719
|
id: string;
|
|
1430
1720
|
type: 'function';
|
|
@@ -1722,6 +2012,28 @@ export declare interface WidgetConfigDescriptor {
|
|
|
1722
2012
|
defaultRoute: string;
|
|
1723
2013
|
/** Map of route id → definition. */
|
|
1724
2014
|
routes: Record<string, RouteDef>;
|
|
2015
|
+
/**
|
|
2016
|
+
* Static page list rendered by the hosted-shell's top/bottom nav. The
|
|
2017
|
+
* dashboard's App Layout tab writes this; the SDK doesn't read it.
|
|
2018
|
+
* Surfaced here so descriptor consumers get a typed view.
|
|
2019
|
+
*/
|
|
2020
|
+
pages?: AppPageDef[];
|
|
2021
|
+
/** Side panels wrapping the chat — see {@link SidePanelDef}. */
|
|
2022
|
+
panels?: {
|
|
2023
|
+
left?: SidePanelDef;
|
|
2024
|
+
right?: SidePanelDef;
|
|
2025
|
+
};
|
|
2026
|
+
};
|
|
2027
|
+
/**
|
|
2028
|
+
* Tenant-side API config consumed by the side-panel runtime. Right now
|
|
2029
|
+
* only the `api`-type panel uses this — it prefixes `panel.endpoint`
|
|
2030
|
+
* with `api.baseUrl` and sends the chat JWT as `Authorization`. Other
|
|
2031
|
+
* descriptor blocks (`upload`, `historyApiBase`, etc.) keep their own
|
|
2032
|
+
* fields for backwards compatibility.
|
|
2033
|
+
*/
|
|
2034
|
+
api?: {
|
|
2035
|
+
/** Absolute base URL for tenant API calls. No trailing slash. */
|
|
2036
|
+
baseUrl?: string;
|
|
1725
2037
|
};
|
|
1726
2038
|
/**
|
|
1727
2039
|
* Unified slot map. Supersedes `templates` and the bespoke
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as o } from "./MountTenant-
|
|
2
|
-
import { A as u, a as m, b as
|
|
3
|
-
import { FormBridge as
|
|
1
|
+
import { r as o } from "./MountTenant-CxO7hJgs.mjs";
|
|
2
|
+
import { A as u, a as m, b as k, c as g, d as h, e as A, f as C, g as T, h as b, i as v, j as f, k as y, C as S, l as w, m as E, E as M, M as x, S as B, n as F, T as U, o as D, p as I, q as j, s as q, t as H, u as P, v as R, w as W, x as z, y as K, z as L, B as O, D as G, F as J } from "./MountTenant-CxO7hJgs.mjs";
|
|
3
|
+
import { FormBridge as Q } from "./headless.mjs";
|
|
4
4
|
function l(e) {
|
|
5
5
|
o();
|
|
6
6
|
const a = document.createElement("aikaara-chat-widget"), r = {
|
|
@@ -31,37 +31,40 @@ function d() {
|
|
|
31
31
|
export {
|
|
32
32
|
u as ActionCableClient,
|
|
33
33
|
m as AikaaraChatBubble,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
k as AikaaraChatClient,
|
|
35
|
+
g as AikaaraChatHeader,
|
|
36
|
+
h as AikaaraChatInput,
|
|
37
37
|
A as AikaaraChatWidget,
|
|
38
38
|
C as AikaaraErrorBanner,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
T as AikaaraMessageBubble,
|
|
40
|
+
b as AikaaraMessageList,
|
|
41
|
+
v as AikaaraStreamingMessage,
|
|
42
|
+
f as AikaaraTypingIndicator,
|
|
43
|
+
y as ApiClient,
|
|
44
|
+
S as ChannelSubscription,
|
|
45
45
|
w as ConnectionManager,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
E as ConversationManager,
|
|
47
|
+
M as EventEmitter,
|
|
48
|
+
Q as FormBridge,
|
|
49
49
|
x as MessageStore,
|
|
50
50
|
B as SessionAuthAdapter,
|
|
51
51
|
F as SsoExchangeAdapter,
|
|
52
52
|
U as TiledeskTransport,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
53
|
+
D as TokenDiscoveryError,
|
|
54
|
+
I as TokenDiscoveryReader,
|
|
55
|
+
j as clearPersistedConversationId,
|
|
56
|
+
q as collectSsoCredentials,
|
|
57
|
+
H as createFetchUploadAdapter,
|
|
58
|
+
P as createPresigned3StepUploadAdapter,
|
|
59
|
+
R as createTiledeskHistoryAdapter,
|
|
60
|
+
W as discoverToken,
|
|
61
|
+
z as extractTiledeskFileEnvelope,
|
|
62
|
+
K as inferTiledeskRole,
|
|
63
|
+
L as isTiledeskSelfEcho,
|
|
61
64
|
l as mount,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
O as mountFromSlug,
|
|
66
|
+
G as mountTenantWidget,
|
|
67
|
+
J as parseTiledeskTemplate,
|
|
65
68
|
o as registerComponents,
|
|
66
69
|
d as unmount
|
|
67
70
|
};
|
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-BCjKRkD8.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.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { G as i, a as s, c as e, d as t, e as A, H as k, f as n, I as o, g, h as l, J as d, K as m, i as p, L as C, N as h, O as b, j as M, r as c } from "./MountTenant-CxO7hJgs.mjs";
|
|
2
2
|
export {
|
|
3
3
|
i as AikaaraChat,
|
|
4
4
|
s as AikaaraChatBubble,
|