@chatsystem/client 1.3.1 → 1.3.2

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
@@ -1,4 +1,5 @@
1
1
  import { CompanySettingsDTO } from '@chatsystem/shared';
2
+ import { InteractiveWidgetResultDTO } from '@chatsystem/shared';
2
3
  import { JSX as JSX_2 } from 'react/jsx-runtime';
3
4
  import { ReactNode } from 'react';
4
5
 
@@ -105,6 +106,20 @@ export declare type WidgetIdentityRequest = {
105
106
  requiredCapabilities?: string[];
106
107
  };
107
108
 
109
+ declare type WidgetInteractionResultRequest = {
110
+ apiUrl: string;
111
+ appToken: string;
112
+ continuationId: string;
113
+ discussionId: number;
114
+ submissionId: string;
115
+ result: InteractiveWidgetResultDTO;
116
+ resultToken: string;
117
+ authorizationToken?: string;
118
+ signal: AbortSignal;
119
+ };
120
+
121
+ declare type WidgetInteractionResumeRequest = Omit<WidgetInteractionResultRequest, "submissionId" | "result">;
122
+
108
123
  /**
109
124
  * Owns one ChatSystem conversation and all of its mutable execution state.
110
125
  *
@@ -128,6 +143,10 @@ export declare function WidgetRuntime({ appToken, agentId, shouldDisplayLogs, ap
128
143
  export declare interface WidgetRuntimeAdapter {
129
144
  loadCompanySettings(request: WidgetSettingsRequest): Promise<CompanySettingsWithBranding>;
130
145
  sendTextPrompt(request: WidgetTextPromptRequest): Promise<Response>;
146
+ /** Optional transport: its presence advertises V2 interactive continuation. */
147
+ submitInteractionResult?(request: WidgetInteractionResultRequest): Promise<Response>;
148
+ /** Resumes an already accepted submission without retransmitting its values. */
149
+ resumeInteraction?(request: WidgetInteractionResumeRequest): Promise<Response>;
131
150
  /** Called after a successful response stream has been fully consumed. */
132
151
  onAssistantResponseCompleted?(response: Response): void | Promise<void>;
133
152
  }