@vinaverse/client 0.0.0-stage → 0.1.0-alpha.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/LICENSE +202 -0
- package/README.md +94 -2
- package/dist/chunk-AWHPWRGT.js +1318 -0
- package/dist/chunk-AWHPWRGT.js.map +1 -0
- package/dist/conversation/index.cjs +2275 -0
- package/dist/conversation/index.cjs.map +1 -0
- package/dist/conversation/index.d.cts +371 -0
- package/dist/conversation/index.d.ts +371 -0
- package/dist/conversation/index.js +952 -0
- package/dist/conversation/index.js.map +1 -0
- package/dist/index.cjs +1328 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/session--W6JXfwo.d.cts +2028 -0
- package/dist/session--W6JXfwo.d.ts +2028 -0
- package/package.json +80 -3
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
import { Q as Question, A as AnswerInput, H as HeldCard, T as ToolLine, S as SessionInfo, C as ClientSecret, a as SessionOptions, P as ProposalOutcome } from '../session--W6JXfwo.cjs';
|
|
2
|
+
export { b as CONTRACT, c as Card, d as CardKind, e as ClientErrorCode, f as HeldQuestion, g as Proposal, V as VinaverseClientError, i as isKnownCard } from '../session--W6JXfwo.cjs';
|
|
3
|
+
|
|
4
|
+
type AnswerProblem =
|
|
5
|
+
/** Nothing chosen or typed, and the question is required (or skipped while required). */
|
|
6
|
+
'required'
|
|
7
|
+
/** Fewer choices than `min`. */
|
|
8
|
+
| 'too_few'
|
|
9
|
+
/** More choices than `max`, or more than one where one is asked. */
|
|
10
|
+
| 'too_many'
|
|
11
|
+
/** A value that is not on the card, `none_of_the_above` with another choice, or a form the kind does not take. */
|
|
12
|
+
| 'not_allowed'
|
|
13
|
+
/** The text, or the "Other" text, is longer than the card allows (in code points). */
|
|
14
|
+
| 'too_long'
|
|
15
|
+
/** A number outside `min`…`max`, or off its `step`. */
|
|
16
|
+
| 'out_of_range'
|
|
17
|
+
/** Not a calendar date, or outside the card's bounds. */
|
|
18
|
+
| 'bad_date';
|
|
19
|
+
/** Unicode code points, as the contract counts every text limit (an emoji outside the BMP is one). */
|
|
20
|
+
declare function codePoints(text: string): number;
|
|
21
|
+
/**
|
|
22
|
+
* The first rule an answer breaks, or null when it can be sent. For `rate_each`, check each row's answer against
|
|
23
|
+
* the question: one column from `options`, or `skipped` when not required. A kind this client does not know is the
|
|
24
|
+
* server's to judge (null).
|
|
25
|
+
*/
|
|
26
|
+
declare function answerProblem(question: Question, input: AnswerInput): AnswerProblem | null;
|
|
27
|
+
|
|
28
|
+
/** Whether a prefix may be registered: the contract's prefix pattern, no refused scheme, no control character. */
|
|
29
|
+
declare function isValidLinkPrefix(prefix: string): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Whether a card's link may be opened: it starts with one of the registered prefixes (invalid ones are ignored) and
|
|
32
|
+
* what follows is a path and an optional query of the allowed characters. Route by the page it names; never open a
|
|
33
|
+
* query value.
|
|
34
|
+
*/
|
|
35
|
+
declare function isAllowedLink(link: string, prefixes: readonly string[]): boolean;
|
|
36
|
+
|
|
37
|
+
type ConversationStatus =
|
|
38
|
+
/** Asking the tenant's backend for a session. */
|
|
39
|
+
'starting'
|
|
40
|
+
/** The backend gave no session (`getSession` failed): `start()` tries again. */
|
|
41
|
+
| 'unavailable' | 'connecting' | 'ready' | 'reconnecting'
|
|
42
|
+
/** Disconnected after a normal close: the next action connects again. */
|
|
43
|
+
| 'idle'
|
|
44
|
+
/** The reconnect attempts are spent, or the app reported no network: the next action, or `setOnline(true)`, connects. */
|
|
45
|
+
| 'offline'
|
|
46
|
+
/** Turns run over SSE: answers to question cards need the WebSocket (`answersNeedWebSocket`). */
|
|
47
|
+
| 'sse'
|
|
48
|
+
/** The session ended; `next` says how the conversation goes on. */
|
|
49
|
+
| 'ended'
|
|
50
|
+
/** The client secret was refused and no fresh one could be had. */
|
|
51
|
+
| 'unauthorized'
|
|
52
|
+
/** `dispose()` or `clear()` closed it. */
|
|
53
|
+
| 'closed';
|
|
54
|
+
/** What the UI shows above the conversation, if anything. Copy is the UI's. */
|
|
55
|
+
type ConversationBanner = 'connecting' | 'reconnecting' | 'offline' | 'continued_elsewhere' | 'unavailable' | null;
|
|
56
|
+
type MessageState =
|
|
57
|
+
/** On the server (a turn started with it, or the agent's or staff's reply). */
|
|
58
|
+
'sent'
|
|
59
|
+
/** Recorded for the business during a takeover (`input.received`). */
|
|
60
|
+
| 'delivered'
|
|
61
|
+
/** Sent, not acknowledged yet. */
|
|
62
|
+
| 'sending'
|
|
63
|
+
/** Held for the next session: "sends when you continue", never a failure. */
|
|
64
|
+
| 'held'
|
|
65
|
+
/** Refused for good, or its retries spent: shown with `rejection`; `retry(key)` sends it again. */
|
|
66
|
+
| 'not_sent'
|
|
67
|
+
/** The agent's reply still streaming: its text comes from `getStreaming()`. */
|
|
68
|
+
| 'streaming';
|
|
69
|
+
interface MessageItem {
|
|
70
|
+
readonly type: 'message';
|
|
71
|
+
readonly key: string;
|
|
72
|
+
/** `agent` for the protocol's `assistant`; `staff` is a person from the business. */
|
|
73
|
+
readonly role: 'agent' | 'person' | 'staff' | (string & {});
|
|
74
|
+
readonly text: string;
|
|
75
|
+
readonly state: MessageState;
|
|
76
|
+
/** A reply cut off after part of it streamed: `blocked`, `interrupted` or `failed`. */
|
|
77
|
+
readonly partial?: 'blocked' | 'interrupted' | 'failed';
|
|
78
|
+
/** The agent's reply is a guardrail refusal of the person's message. */
|
|
79
|
+
readonly refusal?: true;
|
|
80
|
+
/** Why a `not_sent` message was refused (`input.rejected`, or the client's own reason). */
|
|
81
|
+
readonly rejection?: {
|
|
82
|
+
readonly code: string;
|
|
83
|
+
readonly message: string;
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
interface CardItem {
|
|
87
|
+
readonly type: 'card';
|
|
88
|
+
/** The card's `id`. */
|
|
89
|
+
readonly key: string;
|
|
90
|
+
readonly card: HeldCard;
|
|
91
|
+
/** A proposal being decided by the tenant's handler (`decideProposal`): draw its buttons busy. */
|
|
92
|
+
readonly busy: boolean;
|
|
93
|
+
/** Restored from `persistence` after a restart: drawn as it was, taking no answer or action. */
|
|
94
|
+
readonly restored?: true;
|
|
95
|
+
/** The tenant's decision on this proposal failed (`decideProposal` threw): nothing was reported; it may be tried again. */
|
|
96
|
+
readonly decisionError?: true;
|
|
97
|
+
}
|
|
98
|
+
type SystemEvent = 'takeover_started' | 'takeover_ended' | 'handoff_created' | 'flow_completed' | 'turn_failed';
|
|
99
|
+
interface SystemItem {
|
|
100
|
+
readonly type: 'system';
|
|
101
|
+
readonly key: string;
|
|
102
|
+
readonly event: SystemEvent;
|
|
103
|
+
/**
|
|
104
|
+
* `takeover_started`: `by`; `handoff_created`: `expected_response`; `flow_completed`: `result`, `code`;
|
|
105
|
+
* `turn_failed` (a turn that failed before any of its reply streamed): `code`, `message`, `retryable`.
|
|
106
|
+
*/
|
|
107
|
+
readonly data: Readonly<Record<string, string | boolean | null>>;
|
|
108
|
+
}
|
|
109
|
+
type TimelineItem = MessageItem | CardItem | SystemItem;
|
|
110
|
+
interface ConversationView {
|
|
111
|
+
readonly status: ConversationStatus;
|
|
112
|
+
readonly banner: ConversationBanner;
|
|
113
|
+
/**
|
|
114
|
+
* How the conversation goes on after the session ended: `continue` on the person's next action (it resumes on its
|
|
115
|
+
* own), `continue_here` only when the person asks (`continueHere()`: it continued on another device).
|
|
116
|
+
*/
|
|
117
|
+
readonly next: 'continue' | 'continue_here' | null;
|
|
118
|
+
readonly agent: {
|
|
119
|
+
readonly name: string | null;
|
|
120
|
+
readonly avatarUrl: string | null;
|
|
121
|
+
};
|
|
122
|
+
/** The server's AI disclosure; null until the first one, when the UI shows its own line. Never hidden. */
|
|
123
|
+
readonly disclosure: string | null;
|
|
124
|
+
/** While a person from the business replies: their role (`by`, never a name). */
|
|
125
|
+
readonly takeover: {
|
|
126
|
+
readonly by: string | null;
|
|
127
|
+
readonly at: string;
|
|
128
|
+
} | null;
|
|
129
|
+
/** Oldest first: history restored from `persistence`, then the conversation. */
|
|
130
|
+
readonly items: readonly TimelineItem[];
|
|
131
|
+
/** The turn's tool lines while it runs ("Searching professionals…"); empty otherwise. */
|
|
132
|
+
readonly activity: readonly ToolLine[];
|
|
133
|
+
/** A turn is in progress: the agent is working or replying (`cancel()` stops it). */
|
|
134
|
+
readonly responding: boolean;
|
|
135
|
+
/** The newest open question card's `id`. */
|
|
136
|
+
readonly openQuestion: string | null;
|
|
137
|
+
/** Over SSE: question cards cannot be answered, so the UI points to the composer. */
|
|
138
|
+
readonly answersNeedWebSocket: boolean;
|
|
139
|
+
readonly turnsLeft: number | null;
|
|
140
|
+
/**
|
|
141
|
+
* The conversation kept on the device (`persistence`): `none` without it, `restoring` while async storage is read
|
|
142
|
+
* (draw a skeleton, not an empty conversation), `restored` once read, whatever it held.
|
|
143
|
+
*/
|
|
144
|
+
readonly history: 'none' | 'restoring' | 'restored';
|
|
145
|
+
}
|
|
146
|
+
/** The reply streaming now, flushed at most once per frame. */
|
|
147
|
+
interface StreamingText {
|
|
148
|
+
/** The streaming message item's `key`. */
|
|
149
|
+
readonly key: string;
|
|
150
|
+
readonly turnId: string;
|
|
151
|
+
readonly text: string;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/** Why the store asks the tenant's backend for a session. */
|
|
155
|
+
type SessionReason =
|
|
156
|
+
/** The conversation opens (`start()`). */
|
|
157
|
+
'open'
|
|
158
|
+
/** The session ended (idle, expired, its turn limit) and the person acted again. */
|
|
159
|
+
| 'resume'
|
|
160
|
+
/** The conversation continued on another device, and the person chose to continue here. */
|
|
161
|
+
| 'continue_here';
|
|
162
|
+
interface SessionRequest {
|
|
163
|
+
readonly reason: SessionReason;
|
|
164
|
+
/** The conversation so far, when known: the backend names it (with its `conversation_key`) to resume it. */
|
|
165
|
+
readonly conversationId: string | null;
|
|
166
|
+
/** For `subject.locale` and `subject.timezone`, which the backend sets. */
|
|
167
|
+
readonly locale?: string;
|
|
168
|
+
readonly timeZone?: string;
|
|
169
|
+
/**
|
|
170
|
+
* Aborted when the answer is no longer wanted (the conversation was disposed or cleared, or a newer request took
|
|
171
|
+
* its place): pass it to `fetch`, so a late answer never opens a socket after the person left.
|
|
172
|
+
*/
|
|
173
|
+
readonly signal?: AbortSignal;
|
|
174
|
+
}
|
|
175
|
+
/** What `createSession` gave the tenant's backend, as it passes it on: the session, its agent and disclosure. */
|
|
176
|
+
type ConversationSession = SessionInfo & {
|
|
177
|
+
readonly agent?: {
|
|
178
|
+
readonly display_name?: string;
|
|
179
|
+
readonly avatar_url?: string;
|
|
180
|
+
};
|
|
181
|
+
readonly disclosure?: string;
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* Runs a callback before the next frame; `requestAnimationFrame` where there is one. Every listener, of the view and
|
|
185
|
+
* of the streaming text, is called from it, at most once per frame: a zone.js app re-enters its zone here once. A
|
|
186
|
+
* test passes one that runs the callback at once.
|
|
187
|
+
*/
|
|
188
|
+
interface FrameScheduler {
|
|
189
|
+
request(callback: () => void): unknown;
|
|
190
|
+
cancel(handle: unknown): void;
|
|
191
|
+
}
|
|
192
|
+
/** Where the drawn conversation is kept across app restarts (opt-in; prefer encrypted storage). */
|
|
193
|
+
interface ConversationPersistence {
|
|
194
|
+
getItem(key: string): string | null | Promise<string | null>;
|
|
195
|
+
setItem(key: string, value: string): void | Promise<void>;
|
|
196
|
+
removeItem(key: string): void | Promise<void>;
|
|
197
|
+
}
|
|
198
|
+
interface ConversationOptions {
|
|
199
|
+
/**
|
|
200
|
+
* A session from the tenant's backend, which creates it with its service key (the app never holds one). Asked once
|
|
201
|
+
* per need: when the conversation opens, and on the person's action after a session ended.
|
|
202
|
+
*/
|
|
203
|
+
readonly getSession: (request: SessionRequest) => Promise<ConversationSession>;
|
|
204
|
+
/** A fresh client secret for a session (on 4401), from the tenant's backend. */
|
|
205
|
+
readonly refreshSecret?: (sessionId: string) => Promise<ClientSecret | string>;
|
|
206
|
+
readonly locale?: string;
|
|
207
|
+
readonly timeZone?: string;
|
|
208
|
+
/** The prefixes the tenant registered for card links (`checkLink`). */
|
|
209
|
+
readonly deepLinkPrefixes?: readonly string[];
|
|
210
|
+
/** Keep the drawn conversation across restarts (off unless given). */
|
|
211
|
+
readonly persistence?: ConversationPersistence;
|
|
212
|
+
/** Its key; one per signed-in person. Default `vinaverse.conversation`. */
|
|
213
|
+
readonly persistenceKey?: string;
|
|
214
|
+
/** Default: `requestAnimationFrame`, else a 16 ms timer, resolved when first used (never at import or creation). */
|
|
215
|
+
readonly scheduler?: FrameScheduler;
|
|
216
|
+
/** The transport's own options (`auth`, `webSocket`, `fetch`, delays…). */
|
|
217
|
+
readonly transport?: Omit<SessionOptions, 'session' | 'refreshSecret' | 'engine' | 'createId'>;
|
|
218
|
+
/** New `client_event_id`s. Default: random, `ce_` and 22 characters. */
|
|
219
|
+
readonly createId?: () => string;
|
|
220
|
+
/** Something failed that no call returned: getting a session, an input that could not be delivered. */
|
|
221
|
+
readonly onError?: (error: unknown) => void;
|
|
222
|
+
/**
|
|
223
|
+
* Close the connection while the app is in the background, and open it again in the foreground (a backend that
|
|
224
|
+
* mints a client secret per connection: with `refreshSecret`, a fresh one is asked for first). Default false: the
|
|
225
|
+
* connection stays, with no pings, until the session idles out. Nothing typed or answered is lost either way.
|
|
226
|
+
*/
|
|
227
|
+
readonly closeInBackground?: boolean;
|
|
228
|
+
}
|
|
229
|
+
/** A text is at most 2000 code points (`TurnInput`). */
|
|
230
|
+
declare const MAX_TEXT = 2000;
|
|
231
|
+
declare class ConversationStore {
|
|
232
|
+
private readonly options;
|
|
233
|
+
private readonly engine;
|
|
234
|
+
private session;
|
|
235
|
+
private info;
|
|
236
|
+
private getting;
|
|
237
|
+
private failed;
|
|
238
|
+
private disposed;
|
|
239
|
+
private online;
|
|
240
|
+
private foreground;
|
|
241
|
+
private lastStatus;
|
|
242
|
+
private offlineAfterRetries;
|
|
243
|
+
/** The id the next send gets, so a text typed before the session keeps its key. */
|
|
244
|
+
private nextId;
|
|
245
|
+
private readonly sent;
|
|
246
|
+
private readonly early;
|
|
247
|
+
private readonly retried;
|
|
248
|
+
private readonly busy;
|
|
249
|
+
/** Proposals whose tenant decision threw: shown as recoverable, the person may decide again. */
|
|
250
|
+
private readonly decisionErrors;
|
|
251
|
+
private system;
|
|
252
|
+
/** Numbers system rows that carry no id of their own. */
|
|
253
|
+
private systemSeq;
|
|
254
|
+
private history;
|
|
255
|
+
private historyState;
|
|
256
|
+
/** A resumed session.ready carried a transcript: the server's history replaced what the device kept. */
|
|
257
|
+
private transcriptSeen;
|
|
258
|
+
/** The session of the last session.ready: a card of another one takes no tap (§6). */
|
|
259
|
+
private readySession;
|
|
260
|
+
private cardOrder;
|
|
261
|
+
private kept;
|
|
262
|
+
private locale;
|
|
263
|
+
/** The request for a session in flight, to abort when it is no longer wanted. */
|
|
264
|
+
private fetching;
|
|
265
|
+
private view;
|
|
266
|
+
private readonly listeners;
|
|
267
|
+
private streaming;
|
|
268
|
+
private readonly streamListeners;
|
|
269
|
+
/** The frame that will notify, and what it will notify about. */
|
|
270
|
+
private frame;
|
|
271
|
+
private framePending;
|
|
272
|
+
private viewDirty;
|
|
273
|
+
private streamDirty;
|
|
274
|
+
private persistTimer;
|
|
275
|
+
private unsubscribe;
|
|
276
|
+
constructor(options: ConversationOptions);
|
|
277
|
+
getSnapshot: () => ConversationView;
|
|
278
|
+
subscribe: (listener: () => void) => (() => void);
|
|
279
|
+
getStreaming: () => StreamingText | null;
|
|
280
|
+
subscribeStreaming: (listener: () => void) => (() => void);
|
|
281
|
+
/** Whether a card's link may be opened (the deep-link rule, against `deepLinkPrefixes`). */
|
|
282
|
+
checkLink(link: string): boolean;
|
|
283
|
+
/** Ask for a session and connect, early: a client secret must open its first connection within two minutes. */
|
|
284
|
+
start(): void;
|
|
285
|
+
/** Close for good. */
|
|
286
|
+
dispose(): void;
|
|
287
|
+
/** Close for good and forget the conversation kept on the device (sign-out). Never throws for the storage. */
|
|
288
|
+
clear(): void;
|
|
289
|
+
/**
|
|
290
|
+
* The person switched the app's language: the UI's words change at once (the kit's own locale); the next session
|
|
291
|
+
* asks for this locale (`subject.locale`). The open session keeps its language: the agent answers in the new one
|
|
292
|
+
* from the next session, and the store never starts a session for it.
|
|
293
|
+
*/
|
|
294
|
+
setLocale(locale: string | undefined): void;
|
|
295
|
+
/** The app came to the foreground or went to the background (AppState, `visibilitychange`). */
|
|
296
|
+
setForeground(foreground: boolean): void;
|
|
297
|
+
/** In the background (`closeInBackground`): the connection is closed; the engine keeps what was sent, to resend. */
|
|
298
|
+
private suspended;
|
|
299
|
+
private suspend;
|
|
300
|
+
/** Back in the foreground: a new connection to the same session, with a fresh secret when the backend gives one. */
|
|
301
|
+
private wake;
|
|
302
|
+
/** The network as the app sees it; null when unknown. Back online reconnects a connection that gave up. */
|
|
303
|
+
setOnline(online: boolean | null): void;
|
|
304
|
+
/** Send a typed message; returns its `client_event_id`. Typed before a session exists, it is sent once one does. */
|
|
305
|
+
send(text: string): string;
|
|
306
|
+
/** Answer a question card (a `rate_each` row by its `question_id`); returns the `client_event_id`. */
|
|
307
|
+
answer(cardId: string, questionId: string, answer: AnswerInput): string;
|
|
308
|
+
/** A card action (`ui.action`) other than a proposal's outcome. */
|
|
309
|
+
cardAction(cardId: string, action: string): string;
|
|
310
|
+
/**
|
|
311
|
+
* Decide a proposal: `decide` is the tenant's own call (its backend, the person's token), which confirms or
|
|
312
|
+
* declines it and says the outcome; the store then reports it. One decision per card; the card is busy meanwhile.
|
|
313
|
+
* Resolves to the outcome reported, or null when the card was busy or already decided.
|
|
314
|
+
*
|
|
315
|
+
* Only an outcome `decide` resolves with is reported (§6: the first is final). When `decide` throws, or resolves
|
|
316
|
+
* with anything but `confirmed`, `declined`, `failed` or `expired`, nothing is reported: the backend may have
|
|
317
|
+
* applied the change, so the outcome stays unknown; the card shows `decisionError` and the person may decide
|
|
318
|
+
* again. When the conversation is disposed meanwhile (sign-out), the outcome is not reported either: the tenant's
|
|
319
|
+
* backend holds it, and the session takes it as unknown.
|
|
320
|
+
*/
|
|
321
|
+
decideProposal(cardId: string, decide: () => Promise<ProposalOutcome>): Promise<ProposalOutcome | null>;
|
|
322
|
+
/** Send a "not sent" message again, as a new message (the person's action). Returns the new id. */
|
|
323
|
+
retry(key: string): string | null;
|
|
324
|
+
/** After the conversation continued on another device: continue it here (the person's choice). */
|
|
325
|
+
continueHere(): Promise<void>;
|
|
326
|
+
/** Stop the turn in progress. */
|
|
327
|
+
cancel(): void;
|
|
328
|
+
private ensureSession;
|
|
329
|
+
private fetchSession;
|
|
330
|
+
private open;
|
|
331
|
+
/** What was typed before there was a session to take it. */
|
|
332
|
+
private flushEarly;
|
|
333
|
+
/** A new session for the conversation, then `resume()`: once per person action, never in a loop. */
|
|
334
|
+
private resuming;
|
|
335
|
+
private resumeWith;
|
|
336
|
+
/** The person acted after the session ended idle, expired or at its limit: the next session takes what they sent. */
|
|
337
|
+
private continueIfEnded;
|
|
338
|
+
private reconnectIfDown;
|
|
339
|
+
private statusChanged;
|
|
340
|
+
private event;
|
|
341
|
+
/**
|
|
342
|
+
* A resumed session's transcript replaced the messages, and a chat transcript carries text only: the engine drops
|
|
343
|
+
* the cards it drew, and draws the pending ones again at the end. Each card on screen is anchored just after the
|
|
344
|
+
* message it followed (by key; the transcript keeps the live keys), so a pending proposal stays where it was, and a
|
|
345
|
+
* card the transcript dropped stays drawn there; taking no tap when it belongs to an earlier session.
|
|
346
|
+
*/
|
|
347
|
+
private anchorCards;
|
|
348
|
+
/**
|
|
349
|
+
* Recomputes now (getSnapshot and getStreaming are always current) and notifies from the scheduler, at most once
|
|
350
|
+
* per frame, both channels in the same flush: a streamed reply that completes becomes its message in one frame.
|
|
351
|
+
*/
|
|
352
|
+
private update;
|
|
353
|
+
private scheduleNotify;
|
|
354
|
+
/** Calls the listeners of what changed since the last flush. */
|
|
355
|
+
private flush;
|
|
356
|
+
private compute;
|
|
357
|
+
private status;
|
|
358
|
+
private nextFrom;
|
|
359
|
+
/** The streamed text, current at once; its listeners hear of it with the next flush. */
|
|
360
|
+
private stream;
|
|
361
|
+
private scheduler;
|
|
362
|
+
private key;
|
|
363
|
+
private restore;
|
|
364
|
+
private schedulePersist;
|
|
365
|
+
private live;
|
|
366
|
+
private required;
|
|
367
|
+
}
|
|
368
|
+
/** One conversation with an agent, for any UI: see `ConversationStore`. */
|
|
369
|
+
declare function createConversation(options: ConversationOptions): ConversationStore;
|
|
370
|
+
|
|
371
|
+
export { AnswerInput, type AnswerProblem, type CardItem, type ConversationBanner, type ConversationOptions, type ConversationPersistence, type ConversationSession, type ConversationStatus, ConversationStore, type ConversationView, type FrameScheduler, HeldCard, MAX_TEXT, type MessageItem, type MessageState, ProposalOutcome, Question, type SessionReason, type SessionRequest, type StreamingText, type SystemEvent, type SystemItem, type TimelineItem, ToolLine, answerProblem, codePoints, createConversation, isAllowedLink, isValidLinkPrefix };
|