@streamoid/agent 0.6.26 → 0.6.28
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 +51 -7
- package/dist/index.js +10301 -10277
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -197,11 +197,44 @@ export interface ConversationSearchDialogProps {
|
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
/** "Search or Ask CXO" — the command dialog a host opens from its sidebar's
|
|
200
|
-
* search trigger, identical in every product.
|
|
200
|
+
* search trigger, identical in every product. The presentation only; see
|
|
201
|
+
* {@link AskCxoDialog} for the same thing with the host wiring done. */
|
|
201
202
|
export declare function ConversationSearchDialog(
|
|
202
203
|
props: ConversationSearchDialogProps,
|
|
203
204
|
): ReactElement;
|
|
204
205
|
|
|
206
|
+
export interface AskCxoDialogProps
|
|
207
|
+
extends Pick<
|
|
208
|
+
ConversationSearchDialogProps,
|
|
209
|
+
| 'workspaceId'
|
|
210
|
+
| 'search'
|
|
211
|
+
| 'onClose'
|
|
212
|
+
| 'placeholder'
|
|
213
|
+
| 'emptyStateTitle'
|
|
214
|
+
| 'emptyStateDescription'
|
|
215
|
+
> {
|
|
216
|
+
/** Show the chat panel. `chatId` is the conversation the user picked out of
|
|
217
|
+
* the results, or `null` when they asked something new — hand that `null`
|
|
218
|
+
* straight to the panel's `chatId` and let the chat create the conversation
|
|
219
|
+
* itself. */
|
|
220
|
+
onOpenChat(chatId: string | null): void;
|
|
221
|
+
/** Drop the Ask row and Enter-to-ask, leaving a plain conversation search. */
|
|
222
|
+
searchOnly?: boolean;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* "Search or Ask CXO", wired the fast way — PREFER THIS over
|
|
227
|
+
* {@link ConversationSearchDialog}.
|
|
228
|
+
*
|
|
229
|
+
* Both hosts that wired `onAsk` by hand got it wrong the same two ways: they
|
|
230
|
+
* awaited the send before opening the panel (2.655s of nothing, measured on
|
|
231
|
+
* artifax.test) and then handed the panel a conversation id the server had not
|
|
232
|
+
* seen, which costs another spinner and a `/messages` fetch that returns
|
|
233
|
+
* nothing. This asks for one callback — "show the chat, on this conversation or
|
|
234
|
+
* on nothing" — and does the rest. Nothing in it touches the network.
|
|
235
|
+
*/
|
|
236
|
+
export declare function AskCxoDialog(props: AskCxoDialogProps): ReactElement;
|
|
237
|
+
|
|
205
238
|
/** Input for {@link startConversation}. */
|
|
206
239
|
export interface StartConversationInput {
|
|
207
240
|
workspaceId: string;
|
|
@@ -209,19 +242,30 @@ export interface StartConversationInput {
|
|
|
209
242
|
email: string;
|
|
210
243
|
/** The user's first message. Trimmed; empty is rejected. */
|
|
211
244
|
prompt: string;
|
|
245
|
+
/** The background send failed. Nothing waits for it, so this is the only way
|
|
246
|
+
* to hear about a message that never reached the server. */
|
|
247
|
+
onSendFailed?(error: unknown): void;
|
|
212
248
|
}
|
|
213
249
|
|
|
214
250
|
/**
|
|
215
|
-
* Start a NEW conversation from a first message and return its id
|
|
216
|
-
*
|
|
217
|
-
*
|
|
251
|
+
* Start a NEW conversation from a first message and return its id.
|
|
252
|
+
*
|
|
253
|
+
* @deprecated Use {@link AskCxoDialog}, or {@link enqueueChatPrompt} directly.
|
|
254
|
+
* The id this returns is for a conversation the SERVER HAS NOT SEEN YET, and a
|
|
255
|
+
* host that passes it to the panel lands on the panel's "open an existing
|
|
256
|
+
* conversation" path: blank transcript, full-column spinner, and a `/messages`
|
|
257
|
+
* fetch for a conversation that has none — 714ms of it on artifax.test.
|
|
258
|
+
*
|
|
259
|
+
* It also no longer waits for the send. It used to await the POST before
|
|
260
|
+
* resolving, which bought a full round trip (2.655s, measured) for an id
|
|
261
|
+
* generated client-side on the line above. So the returned id is no longer a
|
|
262
|
+
* receipt: it means "this is the conversation your message is on its way to".
|
|
263
|
+
* `null` still means the inputs were incomplete and nothing was sent; a
|
|
264
|
+
* rejection is reported through `onSendFailed`.
|
|
218
265
|
*
|
|
219
266
|
* Delegates to the same send path the chat itself uses, so `enc_token`,
|
|
220
267
|
* `color_mode` and `host_context` are filled in from inside the bundle; a host
|
|
221
268
|
* cannot see those and should not try to send them itself.
|
|
222
|
-
*
|
|
223
|
-
* Resolves `null` when the inputs are incomplete or the send fails, so a caller
|
|
224
|
-
* can show "could not start this chat" without unpacking an error.
|
|
225
269
|
*/
|
|
226
270
|
export declare function startConversation(
|
|
227
271
|
input: StartConversationInput,
|