@chatsystem/client 1.3.1 → 1.3.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/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  import { CompanySettingsDTO } from '@chatsystem/shared';
2
+ import { INTERACTIVE_WIDGET_PROTOCOL_V3 } from '@chatsystem/shared';
3
+ import { InteractiveWidgetResultDTO } from '@chatsystem/shared';
2
4
  import { JSX as JSX_2 } from 'react/jsx-runtime';
3
5
  import { ReactNode } from 'react';
4
6
 
@@ -105,6 +107,20 @@ export declare type WidgetIdentityRequest = {
105
107
  requiredCapabilities?: string[];
106
108
  };
107
109
 
110
+ declare type WidgetInteractionResultRequest = {
111
+ apiUrl: string;
112
+ appToken: string;
113
+ continuationId: string;
114
+ discussionId: number;
115
+ submissionId: string;
116
+ result: InteractiveWidgetResultDTO;
117
+ resultToken: string;
118
+ authorizationToken?: string;
119
+ signal: AbortSignal;
120
+ };
121
+
122
+ declare type WidgetInteractionResumeRequest = Omit<WidgetInteractionResultRequest, "submissionId" | "result">;
123
+
108
124
  /**
109
125
  * Owns one ChatSystem conversation and all of its mutable execution state.
110
126
  *
@@ -128,6 +144,18 @@ export declare function WidgetRuntime({ appToken, agentId, shouldDisplayLogs, ap
128
144
  export declare interface WidgetRuntimeAdapter {
129
145
  loadCompanySettings(request: WidgetSettingsRequest): Promise<CompanySettingsWithBranding>;
130
146
  sendTextPrompt(request: WidgetTextPromptRequest): Promise<Response>;
147
+ /** Optional transport: its presence advertises V2 interactive continuation. */
148
+ submitInteractionResult?(request: WidgetInteractionResultRequest): Promise<Response>;
149
+ /** Resumes an already accepted submission without retransmitting its values. */
150
+ resumeInteraction?(request: WidgetInteractionResumeRequest): Promise<Response>;
151
+ /**
152
+ * Browser-only widget features supported by this custom server boundary.
153
+ * `localPreview` needs no submit or resume transport: values remain in the
154
+ * browser and are discarded once their terminal state has been rendered.
155
+ */
156
+ interactiveWidgetCapabilities?: Readonly<{
157
+ localPreview?: boolean;
158
+ }>;
131
159
  /** Called after a successful response stream has been fully consumed. */
132
160
  onAssistantResponseCompleted?(response: Response): void | Promise<void>;
133
161
  }
@@ -168,6 +196,8 @@ export declare type WidgetTextPromptRequest = {
168
196
  query: string;
169
197
  language: string;
170
198
  discussionId: number | null;
199
+ /** Protocol already constrained by this adapter's declared capabilities. */
200
+ interactiveWidgetProtocolVersion?: typeof INTERACTIVE_WIDGET_PROTOCOL_V3;
171
201
  signal: AbortSignal;
172
202
  };
173
203