@uptiqai/widgets-sdk 1.332.0 → 1.334.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/index.d.ts CHANGED
@@ -153,6 +153,11 @@ declare type CommonWidgetProps = {
153
153
  hideTokenUsage?: boolean;
154
154
  isConsumer?: boolean;
155
155
  solutionDetails?: SolutionDetails;
156
+ authToken?: string;
157
+ /** Business the runs are attributed to, sent with every message. */
158
+ businessId?: string;
159
+ /** Shows a Developer Mode toggle in the sidebar, which reveals testing settings such as the identity token and business ID. */
160
+ allowDeveloperMode?: boolean;
156
161
  };
157
162
 
158
163
  export declare type ContextualKnowledge = {
@@ -231,7 +236,7 @@ export declare type ConversationSummaryPayload = {
231
236
 
232
237
  export declare const createHeadlessAgentInstance: (params: CreateHeadlessAgentInstanceParams) => HeadlessAgentInstance;
233
238
 
234
- export declare type CreateHeadlessAgentInstanceParams = Pick<CreateWidgetInstanceParams, 'config' | 'user' | 'instanceId'>;
239
+ export declare type CreateHeadlessAgentInstanceParams = Pick<CreateWidgetInstanceParams, 'config' | 'user' | 'instanceId' | 'authToken' | 'businessId'>;
235
240
 
236
241
  declare type CreateWidgetInstanceParams = Omit<CommonWidgetProps, 'theme'> & {
237
242
  instanceId: string;
@@ -332,6 +337,8 @@ export declare type HeadlessAgentInstance = {
332
337
  cleanup: () => void;
333
338
  getConversation: (executionId: string) => Promise<Conversation>;
334
339
  listConversations: (params?: ListConversationsParams) => Promise<GetConversationsResult>;
340
+ /** Replaces the identity token sent with every later message, e.g. after the host refreshes it. */
341
+ setAuthToken: (token?: string) => void;
335
342
  };
336
343
 
337
344
  declare type HeadlessEmitPayload<T extends HeadlessEmitType> = T extends 'query' ? QueryPayload : ConversationSummaryPayload;
@@ -648,18 +655,13 @@ declare type WidgetConfig = {
648
655
  serverUrl: string;
649
656
  agentId: string;
650
657
  widgetKey: string;
658
+ accessToken?: string;
659
+ refreshToken?: string;
651
660
  appWidgetKey?: string;
652
661
  agentExecutorVersion?: string;
653
662
  appId?: string;
654
663
  accountId?: string;
655
664
  variables?: Record<string, string>;
656
- /**
657
- * Authenticates the session as the signed-in user rather than as the widget key's owner, so what
658
- * it reads and writes belongs to that user's workspace. A getter rather than a string: it is read
659
- * per request and per socket connect, so a token the host refreshes is picked up mid-session.
660
- * Only hosts running inside an authenticated app can supply this.
661
- */
662
- getAccessToken?: () => string | Promise<string>;
663
665
  enableDeprecatedModelMigration?: boolean;
664
666
  };
665
667