@runtypelabs/persona 3.25.0 → 3.27.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/src/types.ts CHANGED
@@ -1,5 +1,10 @@
1
1
  import type { AgentWidgetPlugin } from "./plugins/types";
2
2
  import type { DeepPartial, PersonaTheme } from "./types/theme";
3
+ import type {
4
+ RuntypeClientChatRequest,
5
+ RuntypeClientFeedbackRequest,
6
+ RuntypeStopReasonKind,
7
+ } from "./generated/runtype-openapi-contract";
3
8
 
4
9
  // ============================================================================
5
10
  // Multi-Modal Content Types
@@ -2232,6 +2237,10 @@ export type ClientChatRequest = {
2232
2237
  * widget retries once with the full `clientTools[]`.
2233
2238
  */
2234
2239
  clientToolsFingerprint?: string;
2240
+ /** Stable client-owned turn ID for stale stream suppression (from Core public OpenAPI). */
2241
+ turnId?: RuntypeClientChatRequest['turnId'];
2242
+ /** Whether this turn should interrupt a prior in-flight response (from Core public OpenAPI). */
2243
+ submitMode?: RuntypeClientChatRequest['submitMode'];
2235
2244
  };
2236
2245
 
2237
2246
  /**
@@ -2246,7 +2255,7 @@ export type ClientToolsResendRequiredResponse = {
2246
2255
  /**
2247
2256
  * Feedback types supported by the API
2248
2257
  */
2249
- export type ClientFeedbackType = 'upvote' | 'downvote' | 'copy' | 'csat' | 'nps';
2258
+ export type ClientFeedbackType = RuntypeClientFeedbackRequest['type'];
2250
2259
 
2251
2260
  /**
2252
2261
  * Request payload for /v1/client/feedback endpoint
@@ -3810,13 +3819,7 @@ export type AgentWidgetMessageVariant = "assistant" | "reasoning" | "tool" | "ap
3810
3819
  *
3811
3820
  * Absent (`undefined`) means "not reported" — distinct from `'unknown'`.
3812
3821
  */
3813
- export type StopReasonKind =
3814
- | 'end_turn'
3815
- | 'max_tool_calls'
3816
- | 'length'
3817
- | 'content_filter'
3818
- | 'error'
3819
- | 'unknown';
3822
+ export type StopReasonKind = RuntypeStopReasonKind;
3820
3823
 
3821
3824
  /**
3822
3825
  * Represents a message in the chat conversation.
@@ -4136,6 +4139,9 @@ export type AgentWidgetInitOptions = {
4136
4139
  target: string | HTMLElement;
4137
4140
  config?: AgentWidgetConfig;
4138
4141
  useShadowDom?: boolean;
4142
+ /** Fired when the widget controller is mounted and its API is callable. */
4143
+ onChatReady?: () => void;
4144
+ /** @deprecated Use `onChatReady`. Retained as an alias; removed in the next major. */
4139
4145
  onReady?: () => void;
4140
4146
  windowKey?: string; // If provided, stores the controller on window[windowKey] for global access
4141
4147
  debugTools?: boolean;