@aintela/chat 0.2.49 → 0.2.50

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.js CHANGED
@@ -4,7 +4,7 @@ import { A as m, a as T, C as L, M as x, b as P, S as U, i as f } from "./Memory
4
4
  import { C as M, C as y } from "./ClientMessage-EKgfuTp8.js";
5
5
  import { C as D, P as B } from "./Prompt-DZb7OaPp.js";
6
6
  import { A as k, a as F, b, c as N, d as H, e as G, C as O, f as W, D as w, E as z, g as J, G as j, h as K, M as q, i as X, R as Y, j as Q, S as Z, l as $, m as ee, n as ae, o as te, p as se, q as ne, r as oe, s as re, t as ie, u as ce } from "./environmentUtils-CUVZ6Dq1.js";
7
- import { A as Ae, a as Se, E as Ce, H as pe, I as ge, L as de, W as Ie } from "./httpArtifactService-CcYAfh2q.js";
7
+ import { A as Ae, a as Se, E as Ce, H as pe, I as ge, L as de, W as Ie } from "./httpArtifactService-JtkC1T7n.js";
8
8
  import { A as he } from "./artifactHtmlHandler-CMQJf1cX.js";
9
9
  import { H as ue, d as me, r as Te } from "./httpSessionService-BDlqebW2.js";
10
10
  import { APPBAR_V2_HEIGHT as xe, ASK_USER_CANCELLED as Pe, AgentActivityV2 as Ue, AiChat as fe, AiChatDrawer as Re, AiChatFloating as Me, AiChatFloatingV2 as ye, AiChatProvider as _e, AiChatServiceContext as De, AiChatV2Pane as Be, AppBarV2 as Ve, AppRailV2 as ke, AppShellV2 as Fe, ArtifactRender as be, AskUserDialog as Ne, AskUserSheet as He, BoxedPart as Ge, BrainIcon as Oe, ChartIcon as We, ChatIcon as we, ChatPane as ze, ChatsHistoryV2 as Je, CheckIcon as je, ChevronIcon as Ke, ChevronRightIcon as qe, CloseIcon as Xe, CodeIcon as Ye, ComposerIcon as Qe, CurrentMessage as Ze, DEFAULT_PART_RENDERERS as $e, DashboardIcon as ea, DataExplorerIcon as aa, DelayTextComponent as ta, EnvironmentProvider as sa, FileIcon as na, FunctionPart as oa, GlobeIcon as ra, HistoryIcon as ia, IDLE_TIMEOUT as ca, InertEnvironmentProvider as la, JsxErrorBoundary as Aa, LIVE_TSX_DEFAULT_MAX_CHARS_FOR_FULL as Sa, LastPromptsV2 as Ca, LinearBackgroundProgress as pa, LinearProgressBarWithMarkers as ga, ListCheckIcon as da, LiveJsxBlock as Ia, LiveTsxConfigProvider as Ea, LlmResponseRender as ha, LoadingDots as va, LockClosedIcon as ua, LockOpenIcon as ma, MOBILE_NAV_DEFAULT as Ta, MarkdownExtended as La, MenuIcon as xa, Message as Pa, MobileDrawerV2 as Ua, PanelIcon as fa, PauseIcon as Ra, PinIcon as Ma, PlusIcon as ya, PromptDateMarkers as _a, PromptV2 as Da, RunProgressPanelV2 as Ba, RunProgressStripV2 as Va, SearchIcon as ka, SendIcon as Fa, SessionStateManagerService as ba, SparkleIcon as Na, Sparkline as Ha, StopIcon as Ga, Stopwatch as Oa, SubAgentBox as Wa, SubAgentBoxV2 as wa, SuspendedPart as za, TableIcon as Ja, TaskListV2 as ja, TerminalIcon as Ka, TextPart as qa, ThoughtPart as Xa, ToolIcon as Ya, TrashIcon as Qa, TurnAwareButton as Za, UiToolDispatcher as $a, UsersIcon as et, V2_CHART_PALETTE as at, WARNING_THRESHOLD as tt, WaitingPart as st, classifyPart as nt, configureFriendlyMapping as ot, createAiChatEngine as rt, createAiChatSessionStore as it, createAiChatSessionStore as ct, createUiToolRegistry as lt, disposeSharedAiChatEngine as At, extendDefaultScope as St, extendModuleRegistry as Ct, getDefaultJsxScope as pt, getFriendlyLabel as gt, getSharedAiChatEngine as dt, parseClientOutput as It, parseContentBlocks as Et, parseUiArgs as ht, useAiChatServices as vt, useAiChatSessionStore as ut, useEnvironment as mt, useEnvironmentOptional as Tt, useLiveSession as Lt, useLiveTsxMaxCharsForFull as xt, useParkedAskUser as Pt, useResponsiveLayout as Ut, useTurnOpen as ft, v2Card as Rt, v2Chip as Mt, v2IconBtn as yt, v2MonoMeta as _t, v2SectionLabel as Dt, v2Theme as Bt } from "./components.js";
package/dist/services.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as t, a as s, E as r, H as o, I as c, L as n, W as i } from "./httpArtifactService-CcYAfh2q.js";
1
+ import { A as t, a as s, E as r, H as o, I as c, L as n, W as i } from "./httpArtifactService-JtkC1T7n.js";
2
2
  import { A as v } from "./artifactHtmlHandler-CMQJf1cX.js";
3
3
  import { H, d as f, r as p } from "./httpSessionService-BDlqebW2.js";
4
4
  export {
@@ -40,7 +40,14 @@ export declare class SessionStateManagerService {
40
40
  beat(): void;
41
41
  createSession(context: AgentContext, sessionId: string): Promise<ChatSession>;
42
42
  retrieveSession(_context: AgentContext, sessionId: string): Promise<ChatSession | null>;
43
- bindAndOpenLiveSession(context: AgentContext, sessionId?: string): Promise<void>;
43
+ /**
44
+ * @param options.resume keep the socket's replay cursor, so the server replays what was
45
+ * emitted while we were away. Use it when redialling a session the client already holds
46
+ * (an app returning to the foreground); leave it off for a fresh user-initiated open.
47
+ */
48
+ bindAndOpenLiveSession(context: AgentContext, sessionId?: string, options?: {
49
+ resume?: boolean;
50
+ }): Promise<void>;
44
51
  closeLiveConnection(stoneCold?: boolean, closeTurn?: boolean): Promise<void>;
45
52
  stop(): Promise<void>;
46
53
  processRetryLoop(_identification?: string): void;
@@ -102,9 +102,18 @@ export declare class WebSocketConnecionV2 implements IWebSocketConnection {
102
102
  private hasEverReceivedPacket;
103
103
  constructor(baseUrl?: string, getToken?: () => string | undefined);
104
104
  /**
105
- * Connect to the WebSocket endpoint
106
- */
107
- connect(sessionId?: string): Promise<string>;
105
+ * Connect to the WebSocket endpoint.
106
+ *
107
+ * `options.resume` keeps the replay cursor so the server can send back everything emitted
108
+ * while we were away (`?lastSeq=N`). Until it existed, only the socket's OWN
109
+ * `scheduleReconnect` could resume: every other caller landed in the "fresh connect" branch
110
+ * below, which discards `lastSeq`. A host that redials deliberately — a mobile app coming
111
+ * back to the foreground, say — therefore lost every frame emitted while it was suspended,
112
+ * silently, because the transcript looked intact right up to the gap.
113
+ */
114
+ connect(sessionId?: string, options?: {
115
+ resume?: boolean;
116
+ }): Promise<string>;
108
117
  /**
109
118
  * Returns true when the close code is something we believe a fresh connect
110
119
  * (with the same sessionId) can recover from. We deliberately do NOT retry
@@ -66,7 +66,14 @@ export interface IWebSocketConnection {
66
66
  * reset partial-streaming state for the affected session.
67
67
  */
68
68
  onRewindLost?: (sessionId: string, resumingFromSeq: number) => void;
69
- connect: (sessionId?: string) => Promise<string>;
69
+ /**
70
+ * Open the socket. `options.resume` keeps the replay cursor so the server replays what was
71
+ * emitted while we were gone (`?lastSeq=N`); without it a connect is treated as fresh and
72
+ * the cursor is discarded.
73
+ */
74
+ connect: (sessionId?: string, options?: {
75
+ resume?: boolean;
76
+ }) => Promise<string>;
70
77
  sendMessage: (message: IMessage) => void;
71
78
  suspendStream: () => void;
72
79
  disconnect: () => void;
@@ -108,7 +108,14 @@ export declare abstract class AgentGatewayService {
108
108
  hasState(): boolean;
109
109
  protected buildAgentParams(): string;
110
110
  abstract finalResponse(interactionId: string, agentInteraction: Interaction, author: string, subAgentId?: string): void;
111
- openConnection(sessionId?: string): Promise<string>;
111
+ /**
112
+ * Open the live connection. `options.resume` asks the transport to keep its replay cursor,
113
+ * so the server sends back whatever was emitted while we were disconnected — see
114
+ * WebSocketConnectionV2.connect.
115
+ */
116
+ openConnection(sessionId?: string, options?: {
117
+ resume?: boolean;
118
+ }): Promise<string>;
112
119
  abstract closeConnection(closeTurn: boolean): Promise<SendMessageResponse | null>;
113
120
  protected Error(errorMessage?: string | undefined): Promise<void>;
114
121
  private pendingCurrentMessage;
@@ -49,7 +49,9 @@ export declare class AgentGatewayWSAsync extends AgentGatewayService {
49
49
  check(): Promise<boolean>;
50
50
  lastConnectionPromise: Promise<string> | null;
51
51
  socketState: ConnectionState;
52
- openConnection(sessionId?: string): Promise<string>;
52
+ openConnection(sessionId?: string, options?: {
53
+ resume?: boolean;
54
+ }): Promise<string>;
53
55
  closeConnection(closeTurn?: boolean): Promise<SendMessageResponse | null>;
54
56
  simulateDisconnect(code?: number, reason?: string): void;
55
57
  sleep(ms: number): Promise<unknown>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aintela/chat",
3
- "version": "0.2.49",
3
+ "version": "0.2.50",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"