@assistant-ui/react 0.5.75 → 0.5.77
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.mts +196 -180
- package/dist/index.d.ts +196 -180
- package/dist/index.js +525 -456
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +463 -394
- package/dist/index.mjs.map +1 -1
- package/dist/styles/index.css +149 -19
- package/dist/styles/index.css.map +1 -1
- package/dist/styles/tailwindcss/base-components.css +14 -2
- package/dist/styles/tailwindcss/thread.css +26 -10
- package/package.json +4 -3
package/dist/index.d.mts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { A as Attachment, P as PendingAttachment, T as ThreadMessage, C as CoreMessage, a as AppendMessage, M as ModelConfig, b as ModelConfigProvider, c as ThreadAssistantContentPart, d as MessageStatus, e as ThreadStep, f as PendingAttachmentStatus, g as CompleteAttachment, h as CompleteAttachmentStatus, i as Tool, j as TextContentPart, I as ImageContentPart, k as ToolCallContentPart, l as CoreToolCallContentPart, U as UIContentPart, m as CreateEdgeRuntimeAPIOptions, n as ThreadUserContentPart, o as ContentPartStatus, p as ToolCallContentPartStatus } from './edge-rTP-G718.mjs';
|
1
|
+
import { A as Attachment$1, P as PendingAttachment, T as ThreadMessage, C as CoreMessage, a as AppendMessage, M as ModelConfig, b as ModelConfigProvider, c as ThreadAssistantContentPart, d as MessageStatus, e as ThreadStep, f as PendingAttachmentStatus, g as CompleteAttachment, h as CompleteAttachmentStatus, i as Tool, j as TextContentPart, I as ImageContentPart, k as ToolCallContentPart, l as CoreToolCallContentPart, U as UIContentPart, m as CreateEdgeRuntimeAPIOptions, n as ThreadUserContentPart, o as ContentPartStatus, p as ToolCallContentPartStatus } from './edge-rTP-G718.mjs';
|
2
2
|
export { q as AttachmentStatus, v as CoreAssistantContentPart, y as CoreAssistantMessage, w as CoreSystemMessage, u as CoreUserContentPart, x as CoreUserMessage, E as EdgeRuntimeRequestOptions, s as ThreadAssistantMessage, r as ThreadSystemMessage, t as ThreadUserMessage } from './edge-rTP-G718.mjs';
|
3
3
|
import * as react from 'react';
|
4
4
|
import { ComponentType, PropsWithChildren, FC, ElementRef, ComponentPropsWithoutRef, ElementType, ReactNode } from 'react';
|
@@ -15,8 +15,8 @@ import 'json-schema';
|
|
15
15
|
import 'zod';
|
16
16
|
|
17
17
|
type ComposerRuntimeCore = Readonly<{
|
18
|
-
|
19
|
-
|
18
|
+
attachments: readonly Attachment$1[];
|
19
|
+
getAttachmentAccept(): string;
|
20
20
|
addAttachment: (file: File) => Promise<void>;
|
21
21
|
removeAttachment: (attachmentId: string) => Promise<void>;
|
22
22
|
isEditing: boolean;
|
@@ -93,7 +93,7 @@ type RuntimeCapabilities = Readonly<{
|
|
93
93
|
reload: boolean;
|
94
94
|
cancel: boolean;
|
95
95
|
unstable_copy: boolean;
|
96
|
-
|
96
|
+
speech: boolean;
|
97
97
|
attachments: boolean;
|
98
98
|
feedback: boolean;
|
99
99
|
}>;
|
@@ -114,6 +114,9 @@ type SpeechState = Readonly<{
|
|
114
114
|
messageId: string;
|
115
115
|
status: SpeechSynthesisAdapter.Status;
|
116
116
|
}>;
|
117
|
+
type SubmittedFeedback = Readonly<{
|
118
|
+
type: "negative" | "positive";
|
119
|
+
}>;
|
117
120
|
type ThreadRuntimeCore = Readonly<{
|
118
121
|
getBranches: (messageId: string) => readonly string[];
|
119
122
|
switchToBranch: (branchId: string) => void;
|
@@ -123,12 +126,13 @@ type ThreadRuntimeCore = Readonly<{
|
|
123
126
|
addToolResult: (options: AddToolResultOptions) => void;
|
124
127
|
speak: (messageId: string) => void;
|
125
128
|
stopSpeaking: () => void;
|
129
|
+
getSubmittedFeedback: (messageId: string) => SubmittedFeedback | undefined;
|
126
130
|
submitFeedback: (feedback: SubmitFeedbackOptions) => void;
|
127
131
|
getModelConfig: () => ModelConfig;
|
128
132
|
composer: ThreadComposerRuntimeCore;
|
129
133
|
getEditComposer: (messageId: string) => ComposerRuntimeCore | undefined;
|
130
134
|
beginEdit: (messageId: string) => void;
|
131
|
-
speech: SpeechState |
|
135
|
+
speech: SpeechState | undefined;
|
132
136
|
capabilities: Readonly<RuntimeCapabilities>;
|
133
137
|
threadId: string;
|
134
138
|
isDisabled: boolean;
|
@@ -199,6 +203,14 @@ declare abstract class BaseAssistantRuntimeCore<TThreadRuntime extends ThreadRun
|
|
199
203
|
private subscriptionHandler;
|
200
204
|
}
|
201
205
|
|
206
|
+
type FeedbackAdapterFeedback = {
|
207
|
+
message: ThreadMessage;
|
208
|
+
type: "positive" | "negative";
|
209
|
+
};
|
210
|
+
type FeedbackAdapter = {
|
211
|
+
submit: (feedback: FeedbackAdapterFeedback) => void;
|
212
|
+
};
|
213
|
+
|
202
214
|
type AttachmentAdapter = {
|
203
215
|
accept: string;
|
204
216
|
add(state: {
|
@@ -206,12 +218,26 @@ type AttachmentAdapter = {
|
|
206
218
|
}): Promise<Omit<PendingAttachment, "status"> & {
|
207
219
|
status?: PendingAttachmentStatus;
|
208
220
|
}>;
|
209
|
-
remove(attachment: Attachment): Promise<void>;
|
221
|
+
remove(attachment: Attachment$1): Promise<void>;
|
210
222
|
send(attachment: PendingAttachment): Promise<Omit<CompleteAttachment, "status"> & {
|
211
223
|
status?: CompleteAttachmentStatus;
|
212
224
|
}>;
|
213
225
|
};
|
214
226
|
|
227
|
+
type LocalRuntimeOptions = {
|
228
|
+
initialMessages?: readonly CoreMessage[] | undefined;
|
229
|
+
maxSteps?: number | undefined;
|
230
|
+
/**
|
231
|
+
* @deprecated Use `maxSteps` (which is `maxToolRoundtrips` + 1; if you set `maxToolRoundtrips` to 2, set `maxSteps` to 3) instead. This field will be removed in v0.6.
|
232
|
+
*/
|
233
|
+
maxToolRoundtrips?: number | undefined;
|
234
|
+
adapters?: {
|
235
|
+
attachments?: AttachmentAdapter | undefined;
|
236
|
+
speech?: SpeechSynthesisAdapter | undefined;
|
237
|
+
feedback?: FeedbackAdapter | undefined;
|
238
|
+
} | undefined;
|
239
|
+
};
|
240
|
+
|
215
241
|
declare class SimpleImageAttachmentAdapter implements AttachmentAdapter {
|
216
242
|
accept: string;
|
217
243
|
add(state: {
|
@@ -242,15 +268,16 @@ declare class CompositeAttachmentAdapter implements AttachmentAdapter {
|
|
242
268
|
send(attachment: PendingAttachment): Promise<Omit<CompleteAttachment, "status"> & {
|
243
269
|
status?: CompleteAttachmentStatus;
|
244
270
|
}>;
|
245
|
-
remove(attachment: Attachment): Promise<void>;
|
271
|
+
remove(attachment: Attachment$1): Promise<void>;
|
246
272
|
}
|
247
273
|
|
248
274
|
declare abstract class BaseComposerRuntimeCore implements ComposerRuntimeCore {
|
249
275
|
readonly isEditing = true;
|
250
|
-
|
276
|
+
protected abstract getAttachmentAdapter(): AttachmentAdapter | undefined;
|
277
|
+
getAttachmentAccept(): string;
|
251
278
|
private _attachments;
|
252
|
-
protected set attachments(value: readonly Attachment[]);
|
253
|
-
get attachments(): readonly Attachment[];
|
279
|
+
protected set attachments(value: readonly Attachment$1[]);
|
280
|
+
get attachments(): readonly Attachment$1[];
|
254
281
|
abstract get canCancel(): boolean;
|
255
282
|
get isEmpty(): boolean;
|
256
283
|
private _text;
|
@@ -260,8 +287,6 @@ declare abstract class BaseComposerRuntimeCore implements ComposerRuntimeCore {
|
|
260
287
|
send(): Promise<void>;
|
261
288
|
abstract handleSend(message: Omit<AppendMessage, "parentId">): void;
|
262
289
|
abstract cancel(): void;
|
263
|
-
protected _attachmentAdapter?: AttachmentAdapter | undefined;
|
264
|
-
setAttachmentAdapter(adapter: AttachmentAdapter | undefined): void;
|
265
290
|
addAttachment(file: File): Promise<void>;
|
266
291
|
removeAttachment(attachmentId: string): Promise<void>;
|
267
292
|
private _subscriptions;
|
@@ -274,42 +299,30 @@ declare class DefaultThreadComposerRuntimeCore extends BaseComposerRuntimeCore i
|
|
274
299
|
private _canCancel;
|
275
300
|
get canCancel(): boolean;
|
276
301
|
get attachments(): readonly PendingAttachment[];
|
277
|
-
|
302
|
+
protected getAttachmentAdapter(): AttachmentAdapter | undefined;
|
303
|
+
constructor(runtime: Omit<ThreadRuntimeCore, "composer"> & {
|
304
|
+
adapters?: {
|
305
|
+
attachments?: AttachmentAdapter | undefined;
|
306
|
+
} | undefined;
|
307
|
+
});
|
278
308
|
connect(): Unsubscribe;
|
279
309
|
handleSend(message: Omit<AppendMessage, "parentId">): Promise<void>;
|
280
310
|
cancel(): Promise<void>;
|
281
311
|
}
|
282
312
|
|
283
|
-
type FeedbackAdapterFeedback = {
|
284
|
-
message: ThreadMessage;
|
285
|
-
type: "positive" | "negative";
|
286
|
-
};
|
287
|
-
type FeedbackAdapter = {
|
288
|
-
submit: (feedback: FeedbackAdapterFeedback) => void;
|
289
|
-
};
|
290
|
-
|
291
|
-
type LocalRuntimeOptions = {
|
292
|
-
initialMessages?: readonly CoreMessage[] | undefined;
|
293
|
-
maxSteps?: number | undefined;
|
294
|
-
/**
|
295
|
-
* @deprecated Use `maxSteps` (which is `maxToolRoundtrips` + 1; if you set `maxToolRoundtrips` to 2, set `maxSteps` to 3) instead. This field will be removed in v0.6.
|
296
|
-
*/
|
297
|
-
maxToolRoundtrips?: number | undefined;
|
298
|
-
adapters?: {
|
299
|
-
attachments?: AttachmentAdapter | undefined;
|
300
|
-
speech?: SpeechSynthesisAdapter | undefined;
|
301
|
-
feedback?: FeedbackAdapter | undefined;
|
302
|
-
} | undefined;
|
303
|
-
};
|
304
|
-
|
305
313
|
declare class DefaultEditComposerRuntimeCore extends BaseComposerRuntimeCore {
|
306
314
|
private runtime;
|
307
315
|
private endEditCallback;
|
308
316
|
get canCancel(): boolean;
|
317
|
+
protected getAttachmentAdapter(): AttachmentAdapter | undefined;
|
309
318
|
private _nonTextParts;
|
310
319
|
private _previousText;
|
311
320
|
private _parentId;
|
312
|
-
constructor(runtime: Omit<ThreadRuntimeCore, "composer"
|
321
|
+
constructor(runtime: Omit<ThreadRuntimeCore, "composer"> & {
|
322
|
+
adapters?: {
|
323
|
+
attachments?: AttachmentAdapter | undefined;
|
324
|
+
} | undefined;
|
325
|
+
}, endEditCallback: () => void, { parentId, message }: {
|
313
326
|
parentId: string | null;
|
314
327
|
message: ThreadMessage;
|
315
328
|
});
|
@@ -317,52 +330,80 @@ declare class DefaultEditComposerRuntimeCore extends BaseComposerRuntimeCore {
|
|
317
330
|
cancel(): Promise<void>;
|
318
331
|
}
|
319
332
|
|
320
|
-
|
333
|
+
type BaseThreadAdapters = {
|
334
|
+
speech?: SpeechSynthesisAdapter | undefined;
|
335
|
+
feedback?: FeedbackAdapter | undefined;
|
336
|
+
attachments?: AttachmentAdapter | undefined;
|
337
|
+
};
|
338
|
+
declare abstract class BaseThreadRuntimeCore implements ThreadRuntimeCore {
|
321
339
|
private configProvider;
|
322
|
-
adapter: ChatModelAdapter;
|
323
340
|
private _subscriptions;
|
324
|
-
|
325
|
-
|
341
|
+
protected readonly repository: MessageRepository;
|
342
|
+
abstract get adapters(): BaseThreadAdapters | undefined;
|
343
|
+
abstract get threadId(): string;
|
344
|
+
abstract get isDisabled(): boolean;
|
345
|
+
abstract get suggestions(): readonly ThreadSuggestion[];
|
346
|
+
abstract get extras(): unknown;
|
347
|
+
abstract get capabilities(): RuntimeCapabilities;
|
348
|
+
abstract append(message: AppendMessage): void;
|
349
|
+
abstract startRun(parentId: string | null): void;
|
350
|
+
abstract addToolResult(options: AddToolResultOptions): void;
|
351
|
+
abstract cancelRun(): void;
|
352
|
+
get messages(): ThreadMessage[];
|
353
|
+
readonly composer: DefaultThreadComposerRuntimeCore;
|
354
|
+
constructor(configProvider: ModelConfigProvider);
|
355
|
+
getModelConfig(): ModelConfig;
|
356
|
+
private _editComposers;
|
357
|
+
getEditComposer(messageId: string): DefaultEditComposerRuntimeCore | undefined;
|
358
|
+
beginEdit(messageId: string): void;
|
359
|
+
getBranches(messageId: string): string[];
|
360
|
+
switchToBranch(branchId: string): void;
|
361
|
+
protected notifySubscribers(): void;
|
362
|
+
subscribe(callback: () => void): Unsubscribe;
|
363
|
+
private _submittedFeedback;
|
364
|
+
getSubmittedFeedback(messageId: string): Readonly<{
|
365
|
+
type: "negative" | "positive";
|
366
|
+
}> | undefined;
|
367
|
+
submitFeedback({ messageId, type }: SubmitFeedbackOptions): void;
|
368
|
+
private _stopSpeaking;
|
369
|
+
speech: SpeechState | undefined;
|
370
|
+
speak(messageId: string): void;
|
371
|
+
stopSpeaking(): void;
|
372
|
+
export(): ExportedMessageRepository;
|
373
|
+
import(data: ExportedMessageRepository): void;
|
374
|
+
}
|
375
|
+
|
376
|
+
declare class LocalThreadRuntimeCore extends BaseThreadRuntimeCore implements ThreadRuntimeCore {
|
377
|
+
adapter: ChatModelAdapter;
|
326
378
|
readonly capabilities: {
|
327
379
|
switchToBranch: boolean;
|
328
380
|
edit: boolean;
|
329
381
|
reload: boolean;
|
330
382
|
cancel: boolean;
|
331
383
|
unstable_copy: boolean;
|
332
|
-
|
384
|
+
speech: boolean;
|
333
385
|
attachments: boolean;
|
334
386
|
feedback: boolean;
|
335
387
|
};
|
388
|
+
private abortController;
|
336
389
|
readonly threadId: string;
|
337
390
|
readonly isDisabled = false;
|
338
391
|
readonly suggestions: readonly ThreadSuggestion[];
|
339
|
-
get
|
340
|
-
|
392
|
+
get adapters(): {
|
393
|
+
attachments?: AttachmentAdapter | undefined;
|
394
|
+
speech?: SpeechSynthesisAdapter | undefined;
|
395
|
+
feedback?: FeedbackAdapter | undefined;
|
396
|
+
} | undefined;
|
341
397
|
constructor(configProvider: ModelConfigProvider, adapter: ChatModelAdapter, { initialMessages, ...options }: LocalRuntimeOptions);
|
342
|
-
getModelConfig(): ModelConfig;
|
343
398
|
private _options;
|
344
399
|
get options(): LocalRuntimeOptions;
|
345
400
|
get extras(): undefined;
|
346
401
|
set options({ initialMessages, ...options }: LocalRuntimeOptions);
|
347
|
-
private _editComposers;
|
348
|
-
getEditComposer(messageId: string): DefaultEditComposerRuntimeCore | undefined;
|
349
|
-
beginEdit(messageId: string): void;
|
350
|
-
getBranches(messageId: string): string[];
|
351
|
-
switchToBranch(branchId: string): void;
|
352
402
|
append(message: AppendMessage): Promise<void>;
|
353
403
|
startRun(parentId: string | null): Promise<void>;
|
354
404
|
private performRoundtrip;
|
355
405
|
cancelRun(): void;
|
356
|
-
private notifySubscribers;
|
357
|
-
subscribe(callback: () => void): Unsubscribe;
|
358
406
|
addToolResult({ messageId, toolCallId, result, }: AddToolResultOptions): void;
|
359
|
-
private _stopSpeaking;
|
360
|
-
speech: SpeechState | null;
|
361
|
-
speak(messageId: string): void;
|
362
|
-
stopSpeaking(): void;
|
363
|
-
submitFeedback({ messageId, type }: SubmitFeedbackOptions): void;
|
364
|
-
export(): ExportedMessageRepository;
|
365
|
-
import(data: ExportedMessageRepository): void;
|
366
407
|
}
|
367
408
|
|
368
409
|
declare class LocalRuntimeCore extends BaseAssistantRuntimeCore<LocalThreadRuntimeCore> {
|
@@ -390,10 +431,11 @@ type AssistantRuntime = {
|
|
390
431
|
*/
|
391
432
|
subscribe(callback: () => void): Unsubscribe;
|
392
433
|
};
|
393
|
-
declare class AssistantRuntimeImpl
|
394
|
-
private _core;
|
395
|
-
|
396
|
-
|
434
|
+
declare class AssistantRuntimeImpl implements AssistantRuntimeCore, AssistantRuntime {
|
435
|
+
private readonly _core;
|
436
|
+
private readonly _thread;
|
437
|
+
protected constructor(_core: AssistantRuntimeCore, _thread: ThreadRuntime);
|
438
|
+
get thread(): ThreadRuntime;
|
397
439
|
switchToNewThread(): void;
|
398
440
|
switchToThread(threadId: string): void;
|
399
441
|
/**
|
@@ -405,13 +447,13 @@ declare class AssistantRuntimeImpl<TThreadRuntime extends ThreadRuntime = Thread
|
|
405
447
|
* @deprecated Thread is now static and never gets updated. This will be removed in 0.6.0.
|
406
448
|
*/
|
407
449
|
subscribe(callback: () => void): Unsubscribe;
|
450
|
+
protected static createThreadRuntime(_core: AssistantRuntimeCore, CustomThreadRuntime?: new (binding: ThreadRuntimeCoreBinding) => ThreadRuntime): ThreadRuntime;
|
451
|
+
static create(_core: AssistantRuntimeCore, CustomThreadRuntime?: new (binding: ThreadRuntimeCoreBinding) => ThreadRuntime): AssistantRuntime;
|
408
452
|
}
|
409
453
|
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
reset(options?: Parameters<LocalRuntimeCore["reset"]>[0]): void;
|
414
|
-
}
|
454
|
+
type LocalRuntime = AssistantRuntime & {
|
455
|
+
reset: (options?: Parameters<LocalRuntimeCore["reset"]>[0]) => void;
|
456
|
+
};
|
415
457
|
declare const useLocalRuntime: (adapter: ChatModelAdapter, options?: LocalRuntimeOptions) => LocalRuntime;
|
416
458
|
|
417
459
|
declare function toLanguageModelMessages(message: readonly CoreMessage[] | readonly ThreadMessage[]): LanguageModelV1Message[];
|
@@ -504,10 +546,6 @@ type ExternalStoreAdapterBase<T> = {
|
|
504
546
|
onAddToolResult?: ((options: AddToolResultOptions) => Promise<void> | void) | undefined;
|
505
547
|
onSwitchToThread?: ((threadId: string) => Promise<void> | void) | undefined;
|
506
548
|
onSwitchToNewThread?: (() => Promise<void> | void) | undefined;
|
507
|
-
/**
|
508
|
-
* @deprecated Provide a speech adapter to `ExternalStoreAdapter.adapters.speech` instead. This will be removed in 0.6.
|
509
|
-
*/
|
510
|
-
onSpeak?: ((message: ThreadMessage) => SpeechSynthesisAdapter.Utterance) | undefined;
|
511
549
|
convertMessage?: ExternalStoreMessageConverter<T> | undefined;
|
512
550
|
adapters?: {
|
513
551
|
attachments?: AttachmentAdapter | undefined;
|
@@ -520,30 +558,6 @@ type ExternalStoreAdapterBase<T> = {
|
|
520
558
|
};
|
521
559
|
type ExternalStoreAdapter<T = ThreadMessage> = ExternalStoreAdapterBase<T> & (T extends ThreadMessage ? object : ExternalStoreMessageConverterAdapter<T>);
|
522
560
|
|
523
|
-
declare const useExternalStoreRuntime: <T>(store: ExternalStoreAdapter<T>) => AssistantRuntimeImpl<ThreadRuntimeImpl>;
|
524
|
-
|
525
|
-
declare const getExternalStoreMessage: <T>(message: ThreadMessage) => T | undefined;
|
526
|
-
|
527
|
-
declare namespace useExternalMessageConverter {
|
528
|
-
type Message = ThreadMessageLike | {
|
529
|
-
role: "tool";
|
530
|
-
toolCallId: string;
|
531
|
-
toolName?: string | undefined;
|
532
|
-
result: any;
|
533
|
-
};
|
534
|
-
type Callback<T> = (message: T) => Message | Message[];
|
535
|
-
}
|
536
|
-
declare const useExternalMessageConverter: <T extends WeakKey>({ callback, messages, isRunning, }: {
|
537
|
-
callback: useExternalMessageConverter.Callback<T>;
|
538
|
-
messages: T[];
|
539
|
-
isRunning: boolean;
|
540
|
-
}) => ThreadMessage[];
|
541
|
-
|
542
|
-
type DangerousInBrowserAdapterOptions = CreateEdgeRuntimeAPIOptions;
|
543
|
-
|
544
|
-
type DangerousInBrowserRuntimeOptions = DangerousInBrowserAdapterOptions & LocalRuntimeOptions;
|
545
|
-
declare const useDangerousInBrowserRuntime: (options: DangerousInBrowserRuntimeOptions) => LocalRuntime;
|
546
|
-
|
547
561
|
type Subscribable = {
|
548
562
|
subscribe: (callback: () => void) => Unsubscribe;
|
549
563
|
};
|
@@ -586,8 +600,7 @@ type LegacyThreadComposerState = Readonly<{
|
|
586
600
|
value: string;
|
587
601
|
/** @deprecated Use `useComposerRuntime().setText` instead. This will be removed in 0.6.0. */
|
588
602
|
setValue: (value: string) => void;
|
589
|
-
|
590
|
-
attachments: readonly Attachment[];
|
603
|
+
attachments: readonly Attachment$1[];
|
591
604
|
/** @deprecated Use `useComposerRuntime().addAttachment` instead. This will be removed in 0.6.0. */
|
592
605
|
addAttachment: (file: File) => Promise<void>;
|
593
606
|
/** @deprecated Use `useComposerRuntime().removeAttachment` instead. This will be removed in 0.6.0. */
|
@@ -613,8 +626,7 @@ type LegacyThreadComposerState = Readonly<{
|
|
613
626
|
}>;
|
614
627
|
type BaseComposerState = {
|
615
628
|
text: string;
|
616
|
-
|
617
|
-
attachments: readonly Attachment[];
|
629
|
+
attachments: readonly Attachment$1[];
|
618
630
|
canCancel: boolean;
|
619
631
|
isEditing: boolean;
|
620
632
|
isEmpty: boolean;
|
@@ -638,14 +650,13 @@ type ComposerRuntime = {
|
|
638
650
|
readonly canCancel: boolean;
|
639
651
|
/** @deprecated Use `getState().text` instead. This will be removed in 0.6.0. */
|
640
652
|
readonly text: string;
|
641
|
-
/** @deprecated Use `getState().attachmentAccept` instead. This will be removed in 0.6.0. */
|
642
|
-
readonly attachmentAccept: string;
|
643
653
|
/** @deprecated Use `getState().attachments` instead. This will be removed in 0.6.0. */
|
644
|
-
readonly attachments: readonly Attachment[];
|
654
|
+
readonly attachments: readonly Attachment$1[];
|
645
655
|
/** @deprecated Use `getState().text` instead. This will be removed in 0.6.0. */
|
646
656
|
readonly value: string;
|
647
657
|
setText(text: string): void;
|
648
658
|
setValue(text: string): void;
|
659
|
+
getAttachmentAccept(): string;
|
649
660
|
addAttachment(file: File): Promise<void>;
|
650
661
|
/** @deprecated Use `getAttachmentById(id).removeAttachment()` instead. This will be removed in 0.6.0. */
|
651
662
|
removeAttachment(attachmentId: string): Promise<void>;
|
@@ -676,14 +687,10 @@ declare abstract class ComposerRuntimeImpl implements ComposerRuntimeCore, Compo
|
|
676
687
|
* @deprecated Use `getState().text` instead. This will be removed in 0.6.0.
|
677
688
|
*/
|
678
689
|
get text(): string;
|
679
|
-
/**
|
680
|
-
* @deprecated Use `getState().attachmentAccept` instead. This will be removed in 0.6.0.
|
681
|
-
*/
|
682
|
-
get attachmentAccept(): string;
|
683
690
|
/**
|
684
691
|
* @deprecated Use `getState().attachments` instead. This will be removed in 0.6.0.
|
685
692
|
*/
|
686
|
-
get attachments(): readonly Attachment[] | (readonly Attachment[] & readonly PendingAttachment[]);
|
693
|
+
get attachments(): readonly Attachment$1[] | (readonly Attachment$1[] & readonly PendingAttachment[]);
|
687
694
|
/**
|
688
695
|
* @deprecated Use `getState().text` instead. This will be removed in 0.6.0.
|
689
696
|
*/
|
@@ -703,6 +710,7 @@ declare abstract class ComposerRuntimeImpl implements ComposerRuntimeCore, Compo
|
|
703
710
|
send(): void;
|
704
711
|
cancel(): void;
|
705
712
|
subscribe(callback: () => void): Unsubscribe;
|
713
|
+
getAttachmentAccept(): string;
|
706
714
|
abstract getAttachmentByIndex(idx: number): AttachmentRuntime;
|
707
715
|
}
|
708
716
|
type ThreadComposerRuntime = Omit<ComposerRuntime, "getState" | "getAttachmentByIndex"> & {
|
@@ -724,7 +732,7 @@ declare class ThreadComposerRuntimeImpl extends ComposerRuntimeImpl implements T
|
|
724
732
|
get type(): "thread";
|
725
733
|
private _getState;
|
726
734
|
constructor(core: ThreadComposerRuntimeCoreBinding);
|
727
|
-
get attachments(): readonly Attachment[] & readonly PendingAttachment[];
|
735
|
+
get attachments(): readonly Attachment$1[] & readonly PendingAttachment[];
|
728
736
|
getState(): ThreadComposerState;
|
729
737
|
private _focusListeners;
|
730
738
|
/**
|
@@ -777,12 +785,12 @@ type ThreadComposerAttachmentState = PendingAttachment & {
|
|
777
785
|
*/
|
778
786
|
attachment: PendingAttachment;
|
779
787
|
};
|
780
|
-
type EditComposerAttachmentState = Attachment & {
|
788
|
+
type EditComposerAttachmentState = Attachment$1 & {
|
781
789
|
source: "edit-composer";
|
782
790
|
/**
|
783
791
|
* @deprecated You can directly access content part fields in the state. Replace `.attachment.type` with `.type` etc. This will be removed in 0.6.0.
|
784
792
|
*/
|
785
|
-
attachment: Attachment;
|
793
|
+
attachment: Attachment$1;
|
786
794
|
};
|
787
795
|
type AttachmentState = ThreadComposerAttachmentState | EditComposerAttachmentState | MessageAttachmentState;
|
788
796
|
type AttachmentSnapshotBinding<Source extends AttachmentRuntimeSource> = SubscribableWithState<AttachmentState & {
|
@@ -837,7 +845,8 @@ type MessageState = ThreadMessage & {
|
|
837
845
|
branches: readonly string[];
|
838
846
|
branchNumber: number;
|
839
847
|
branchCount: number;
|
840
|
-
speech: SpeechState |
|
848
|
+
speech: SpeechState | undefined;
|
849
|
+
submittedFeedback: SubmittedFeedback | undefined;
|
841
850
|
};
|
842
851
|
type MessageStateBinding = SubscribableWithState<MessageState>;
|
843
852
|
type MessageRuntime = {
|
@@ -880,6 +889,30 @@ declare class MessageRuntimeImpl implements MessageRuntime {
|
|
880
889
|
getAttachmentByIndex(idx: number): MessageAttachmentRuntimeImpl;
|
881
890
|
}
|
882
891
|
|
892
|
+
declare const useExternalStoreRuntime: <T>(store: ExternalStoreAdapter<T>) => AssistantRuntime;
|
893
|
+
|
894
|
+
declare const getExternalStoreMessage: <T>(message: ThreadMessage) => T | undefined;
|
895
|
+
|
896
|
+
declare namespace useExternalMessageConverter {
|
897
|
+
type Message = ThreadMessageLike | {
|
898
|
+
role: "tool";
|
899
|
+
toolCallId: string;
|
900
|
+
toolName?: string | undefined;
|
901
|
+
result: any;
|
902
|
+
};
|
903
|
+
type Callback<T> = (message: T) => Message | Message[];
|
904
|
+
}
|
905
|
+
declare const useExternalMessageConverter: <T extends WeakKey>({ callback, messages, isRunning, }: {
|
906
|
+
callback: useExternalMessageConverter.Callback<T>;
|
907
|
+
messages: T[];
|
908
|
+
isRunning: boolean;
|
909
|
+
}) => ThreadMessage[];
|
910
|
+
|
911
|
+
type DangerousInBrowserAdapterOptions = CreateEdgeRuntimeAPIOptions;
|
912
|
+
|
913
|
+
type DangerousInBrowserRuntimeOptions = DangerousInBrowserAdapterOptions & LocalRuntimeOptions;
|
914
|
+
declare const useDangerousInBrowserRuntime: (options: DangerousInBrowserRuntimeOptions) => LocalRuntime;
|
915
|
+
|
883
916
|
type CreateAppendMessage = string | {
|
884
917
|
parentId?: string | null | undefined;
|
885
918
|
role?: AppendMessage["role"] | undefined;
|
@@ -895,7 +928,7 @@ type ThreadState = Readonly<{
|
|
895
928
|
messages: readonly ThreadMessage[];
|
896
929
|
suggestions: readonly ThreadSuggestion[];
|
897
930
|
extras: unknown;
|
898
|
-
speech: SpeechState |
|
931
|
+
speech: SpeechState | undefined;
|
899
932
|
}>;
|
900
933
|
type ThreadRuntime = {
|
901
934
|
composer: ThreadComposerRuntime;
|
@@ -940,7 +973,7 @@ type ThreadRuntime = {
|
|
940
973
|
/**
|
941
974
|
* @deprecated Use `getState().speechState` instead. This will be removed in 0.6.0.
|
942
975
|
*/
|
943
|
-
speech: SpeechState |
|
976
|
+
speech: SpeechState | undefined;
|
944
977
|
/**
|
945
978
|
* @deprecated Use `getState().extras` instead. This will be removed in 0.6.0.
|
946
979
|
*/
|
@@ -961,6 +994,10 @@ type ThreadRuntime = {
|
|
961
994
|
* @deprecated Use `getMesssageById(id).speak()` instead. This will be removed in 0.6.0.
|
962
995
|
*/
|
963
996
|
speak: (messageId: string) => void;
|
997
|
+
/**
|
998
|
+
* @deprecated Use `getMesssageById(id).getState().submittedFeedback` instead. This will be removed in 0.6.0.
|
999
|
+
*/
|
1000
|
+
getSubmittedFeedback: (messageId: string) => SubmittedFeedback | undefined;
|
964
1001
|
/**
|
965
1002
|
* @deprecated Use `getMesssageById(id).submitFeedback({ type })` instead. This will be removed in 0.6.0.
|
966
1003
|
*/
|
@@ -996,7 +1033,7 @@ declare class ThreadRuntimeImpl implements ThreadRuntimeCore, ThreadRuntime {
|
|
996
1033
|
reload: boolean;
|
997
1034
|
cancel: boolean;
|
998
1035
|
unstable_copy: boolean;
|
999
|
-
|
1036
|
+
speech: boolean;
|
1000
1037
|
attachments: boolean;
|
1001
1038
|
feedback: boolean;
|
1002
1039
|
}>;
|
@@ -1018,7 +1055,7 @@ declare class ThreadRuntimeImpl implements ThreadRuntimeCore, ThreadRuntime {
|
|
1018
1055
|
get speech(): Readonly<{
|
1019
1056
|
messageId: string;
|
1020
1057
|
status: SpeechSynthesisAdapter.Status;
|
1021
|
-
}> |
|
1058
|
+
}> | undefined;
|
1022
1059
|
unstable_getCore(): Readonly<{
|
1023
1060
|
getBranches: (messageId: string) => readonly string[];
|
1024
1061
|
switchToBranch: (branchId: string) => void;
|
@@ -1028,12 +1065,13 @@ declare class ThreadRuntimeImpl implements ThreadRuntimeCore, ThreadRuntime {
|
|
1028
1065
|
addToolResult: (options: AddToolResultOptions) => void;
|
1029
1066
|
speak: (messageId: string) => void;
|
1030
1067
|
stopSpeaking: () => void;
|
1068
|
+
getSubmittedFeedback: (messageId: string) => SubmittedFeedback | undefined;
|
1031
1069
|
submitFeedback: (feedback: SubmitFeedbackOptions) => void;
|
1032
1070
|
getModelConfig: () => ModelConfig;
|
1033
1071
|
composer: ThreadComposerRuntimeCore;
|
1034
1072
|
getEditComposer: (messageId: string) => ComposerRuntimeCore | undefined;
|
1035
1073
|
beginEdit: (messageId: string) => void;
|
1036
|
-
speech: SpeechState |
|
1074
|
+
speech: SpeechState | undefined;
|
1037
1075
|
capabilities: Readonly<RuntimeCapabilities>;
|
1038
1076
|
threadId: string;
|
1039
1077
|
isDisabled: boolean;
|
@@ -1055,7 +1093,7 @@ declare class ThreadRuntimeImpl implements ThreadRuntimeCore, ThreadRuntime {
|
|
1055
1093
|
messages: readonly ThreadMessage[];
|
1056
1094
|
suggestions: readonly ThreadSuggestion[];
|
1057
1095
|
extras: unknown;
|
1058
|
-
speech: SpeechState |
|
1096
|
+
speech: SpeechState | undefined;
|
1059
1097
|
}>;
|
1060
1098
|
append(message: CreateAppendMessage): void;
|
1061
1099
|
subscribe(callback: () => void): Unsubscribe;
|
@@ -1079,6 +1117,9 @@ declare class ThreadRuntimeImpl implements ThreadRuntimeCore, ThreadRuntime {
|
|
1079
1117
|
*/
|
1080
1118
|
speak(messageId: string): void;
|
1081
1119
|
stopSpeaking(): void;
|
1120
|
+
getSubmittedFeedback(messageId: string): Readonly<{
|
1121
|
+
type: "negative" | "positive";
|
1122
|
+
}> | undefined;
|
1082
1123
|
/**
|
1083
1124
|
* @deprecated Use `getMesssageById(id).submitFeedback({ type })` instead. This will be removed in 0.6.0.
|
1084
1125
|
*/
|
@@ -1087,8 +1128,8 @@ declare class ThreadRuntimeImpl implements ThreadRuntimeCore, ThreadRuntime {
|
|
1087
1128
|
* @deprecated Use `getMesssageById(id).getMessageByIndex(idx).composer` instead. This will be removed in 0.6.0.
|
1088
1129
|
*/
|
1089
1130
|
getEditComposer(messageId: string): Readonly<{
|
1090
|
-
|
1091
|
-
|
1131
|
+
attachments: readonly Attachment$1[];
|
1132
|
+
getAttachmentAccept(): string;
|
1092
1133
|
addAttachment: (file: File) => Promise<void>;
|
1093
1134
|
removeAttachment: (attachmentId: string) => Promise<void>;
|
1094
1135
|
isEditing: boolean;
|
@@ -1188,10 +1229,6 @@ type MessageUtilsState = Readonly<{
|
|
1188
1229
|
setIsCopied: (value: boolean) => void;
|
1189
1230
|
isHovering: boolean;
|
1190
1231
|
setIsHovering: (value: boolean) => void;
|
1191
|
-
/** @deprecated This will be moved to `useMessage().submittedFeedback`. This will be removed in 0.6.0. */
|
1192
|
-
submittedFeedback: "positive" | "negative" | null;
|
1193
|
-
/** @deprecated This will be moved to `useMessageRuntime().submitFeedback()` instead. This will be removed in 0.6.0. */
|
1194
|
-
setSubmittedFeedback: (feedback: "positive" | "negative" | null) => void;
|
1195
1232
|
}>;
|
1196
1233
|
|
1197
1234
|
type ThreadViewportState = Readonly<{
|
@@ -1360,7 +1397,7 @@ declare const useThread: {
|
|
1360
1397
|
reload: boolean;
|
1361
1398
|
cancel: boolean;
|
1362
1399
|
unstable_copy: boolean;
|
1363
|
-
|
1400
|
+
speech: boolean;
|
1364
1401
|
attachments: boolean;
|
1365
1402
|
feedback: boolean;
|
1366
1403
|
}>;
|
@@ -1370,7 +1407,7 @@ declare const useThread: {
|
|
1370
1407
|
speech: Readonly<{
|
1371
1408
|
messageId: string;
|
1372
1409
|
status: SpeechSynthesisAdapter.Status;
|
1373
|
-
}> |
|
1410
|
+
}> | undefined;
|
1374
1411
|
}>;
|
1375
1412
|
<TSelected>(selector: (state: Readonly<{
|
1376
1413
|
threadId: string;
|
@@ -1382,7 +1419,7 @@ declare const useThread: {
|
|
1382
1419
|
reload: boolean;
|
1383
1420
|
cancel: boolean;
|
1384
1421
|
unstable_copy: boolean;
|
1385
|
-
|
1422
|
+
speech: boolean;
|
1386
1423
|
attachments: boolean;
|
1387
1424
|
feedback: boolean;
|
1388
1425
|
}>;
|
@@ -1392,7 +1429,7 @@ declare const useThread: {
|
|
1392
1429
|
speech: Readonly<{
|
1393
1430
|
messageId: string;
|
1394
1431
|
status: SpeechSynthesisAdapter.Status;
|
1395
|
-
}> |
|
1432
|
+
}> | undefined;
|
1396
1433
|
}>) => TSelected): TSelected;
|
1397
1434
|
(options: {
|
1398
1435
|
optional: true;
|
@@ -1406,7 +1443,7 @@ declare const useThread: {
|
|
1406
1443
|
reload: boolean;
|
1407
1444
|
cancel: boolean;
|
1408
1445
|
unstable_copy: boolean;
|
1409
|
-
|
1446
|
+
speech: boolean;
|
1410
1447
|
attachments: boolean;
|
1411
1448
|
feedback: boolean;
|
1412
1449
|
}>;
|
@@ -1416,7 +1453,7 @@ declare const useThread: {
|
|
1416
1453
|
speech: Readonly<{
|
1417
1454
|
messageId: string;
|
1418
1455
|
status: SpeechSynthesisAdapter.Status;
|
1419
|
-
}> |
|
1456
|
+
}> | undefined;
|
1420
1457
|
}> | null;
|
1421
1458
|
<TSelected>(options: {
|
1422
1459
|
optional: true;
|
@@ -1430,7 +1467,7 @@ declare const useThread: {
|
|
1430
1467
|
reload: boolean;
|
1431
1468
|
cancel: boolean;
|
1432
1469
|
unstable_copy: boolean;
|
1433
|
-
|
1470
|
+
speech: boolean;
|
1434
1471
|
attachments: boolean;
|
1435
1472
|
feedback: boolean;
|
1436
1473
|
}>;
|
@@ -1440,7 +1477,7 @@ declare const useThread: {
|
|
1440
1477
|
speech: Readonly<{
|
1441
1478
|
messageId: string;
|
1442
1479
|
status: SpeechSynthesisAdapter.Status;
|
1443
|
-
}> |
|
1480
|
+
}> | undefined;
|
1444
1481
|
}>) => TSelected;
|
1445
1482
|
}): TSelected | null;
|
1446
1483
|
};
|
@@ -1455,7 +1492,7 @@ declare const useThreadStore: {
|
|
1455
1492
|
reload: boolean;
|
1456
1493
|
cancel: boolean;
|
1457
1494
|
unstable_copy: boolean;
|
1458
|
-
|
1495
|
+
speech: boolean;
|
1459
1496
|
attachments: boolean;
|
1460
1497
|
feedback: boolean;
|
1461
1498
|
}>;
|
@@ -1465,7 +1502,7 @@ declare const useThreadStore: {
|
|
1465
1502
|
speech: Readonly<{
|
1466
1503
|
messageId: string;
|
1467
1504
|
status: SpeechSynthesisAdapter.Status;
|
1468
|
-
}> |
|
1505
|
+
}> | undefined;
|
1469
1506
|
}>>;
|
1470
1507
|
(options: {
|
1471
1508
|
optional: true;
|
@@ -1479,7 +1516,7 @@ declare const useThreadStore: {
|
|
1479
1516
|
reload: boolean;
|
1480
1517
|
cancel: boolean;
|
1481
1518
|
unstable_copy: boolean;
|
1482
|
-
|
1519
|
+
speech: boolean;
|
1483
1520
|
attachments: boolean;
|
1484
1521
|
feedback: boolean;
|
1485
1522
|
}>;
|
@@ -1489,7 +1526,7 @@ declare const useThreadStore: {
|
|
1489
1526
|
speech: Readonly<{
|
1490
1527
|
messageId: string;
|
1491
1528
|
status: SpeechSynthesisAdapter.Status;
|
1492
|
-
}> |
|
1529
|
+
}> | undefined;
|
1493
1530
|
}>> | null;
|
1494
1531
|
};
|
1495
1532
|
/**
|
@@ -1617,16 +1654,12 @@ declare const useMessageUtils: {
|
|
1617
1654
|
setIsCopied: (value: boolean) => void;
|
1618
1655
|
isHovering: boolean;
|
1619
1656
|
setIsHovering: (value: boolean) => void;
|
1620
|
-
submittedFeedback: "positive" | "negative" | null;
|
1621
|
-
setSubmittedFeedback: (feedback: "positive" | "negative" | null) => void;
|
1622
1657
|
}>;
|
1623
1658
|
<TSelected>(selector: (state: Readonly<{
|
1624
1659
|
isCopied: boolean;
|
1625
1660
|
setIsCopied: (value: boolean) => void;
|
1626
1661
|
isHovering: boolean;
|
1627
1662
|
setIsHovering: (value: boolean) => void;
|
1628
|
-
submittedFeedback: "positive" | "negative" | null;
|
1629
|
-
setSubmittedFeedback: (feedback: "positive" | "negative" | null) => void;
|
1630
1663
|
}>) => TSelected): TSelected;
|
1631
1664
|
(options: {
|
1632
1665
|
optional: true;
|
@@ -1635,8 +1668,6 @@ declare const useMessageUtils: {
|
|
1635
1668
|
setIsCopied: (value: boolean) => void;
|
1636
1669
|
isHovering: boolean;
|
1637
1670
|
setIsHovering: (value: boolean) => void;
|
1638
|
-
submittedFeedback: "positive" | "negative" | null;
|
1639
|
-
setSubmittedFeedback: (feedback: "positive" | "negative" | null) => void;
|
1640
1671
|
}> | null;
|
1641
1672
|
<TSelected>(options: {
|
1642
1673
|
optional: true;
|
@@ -1645,8 +1676,6 @@ declare const useMessageUtils: {
|
|
1645
1676
|
setIsCopied: (value: boolean) => void;
|
1646
1677
|
isHovering: boolean;
|
1647
1678
|
setIsHovering: (value: boolean) => void;
|
1648
|
-
submittedFeedback: "positive" | "negative" | null;
|
1649
|
-
setSubmittedFeedback: (feedback: "positive" | "negative" | null) => void;
|
1650
1679
|
}>) => TSelected;
|
1651
1680
|
}): TSelected | null;
|
1652
1681
|
};
|
@@ -1656,8 +1685,6 @@ declare const useMessageUtilsStore: {
|
|
1656
1685
|
setIsCopied: (value: boolean) => void;
|
1657
1686
|
isHovering: boolean;
|
1658
1687
|
setIsHovering: (value: boolean) => void;
|
1659
|
-
submittedFeedback: "positive" | "negative" | null;
|
1660
|
-
setSubmittedFeedback: (feedback: "positive" | "negative" | null) => void;
|
1661
1688
|
}>>;
|
1662
1689
|
(options: {
|
1663
1690
|
optional: true;
|
@@ -1666,8 +1693,6 @@ declare const useMessageUtilsStore: {
|
|
1666
1693
|
setIsCopied: (value: boolean) => void;
|
1667
1694
|
isHovering: boolean;
|
1668
1695
|
setIsHovering: (value: boolean) => void;
|
1669
|
-
submittedFeedback: "positive" | "negative" | null;
|
1670
|
-
setSubmittedFeedback: (feedback: "positive" | "negative" | null) => void;
|
1671
1696
|
}>> | null;
|
1672
1697
|
};
|
1673
1698
|
declare const useEditComposer: {
|
@@ -1858,6 +1883,7 @@ type MessageIfFilters = {
|
|
1858
1883
|
lastOrHover: boolean | undefined;
|
1859
1884
|
speaking: boolean | undefined;
|
1860
1885
|
hasAttachments: boolean | undefined;
|
1886
|
+
hasContent: boolean | undefined;
|
1861
1887
|
submittedFeedback: "positive" | "negative" | null | undefined;
|
1862
1888
|
};
|
1863
1889
|
type UseMessageIfProps = RequireAtLeastOne<MessageIfFilters>;
|
@@ -2655,7 +2681,7 @@ declare const TooltipIconButton: react.ForwardRefExoticComponent<Omit<Omit<react
|
|
2655
2681
|
} & react.RefAttributes<HTMLButtonElement>>;
|
2656
2682
|
|
2657
2683
|
declare const AssistantActionBar: FC;
|
2658
|
-
declare const exports$
|
2684
|
+
declare const exports$b: {
|
2659
2685
|
Root: react.ForwardRefExoticComponent<Partial<Omit<Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
2660
2686
|
ref?: ((instance: HTMLDivElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLDivElement> | null | undefined;
|
2661
2687
|
} & {
|
@@ -2671,7 +2697,7 @@ declare const exports$c: {
|
|
2671
2697
|
FeedbackPositive: react.ForwardRefExoticComponent<Partial<TooltipIconButtonProps> & react.RefAttributes<HTMLButtonElement>>;
|
2672
2698
|
FeedbackNegative: react.ForwardRefExoticComponent<Partial<TooltipIconButtonProps> & react.RefAttributes<HTMLButtonElement>>;
|
2673
2699
|
};
|
2674
|
-
declare const _default$
|
2700
|
+
declare const _default$a: typeof AssistantActionBar & typeof exports$b;
|
2675
2701
|
|
2676
2702
|
declare const AssistantMessage: FC;
|
2677
2703
|
/**
|
@@ -2683,7 +2709,7 @@ declare namespace AssistantMessageContent {
|
|
2683
2709
|
type Props = MessagePrimitiveContent.Props & ComponentPropsWithoutRef<"div">;
|
2684
2710
|
}
|
2685
2711
|
declare const AssistantMessageContent: react.ForwardRefExoticComponent<MessagePrimitiveContent.Props & Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
2686
|
-
declare const exports$
|
2712
|
+
declare const exports$a: {
|
2687
2713
|
Root: react.ForwardRefExoticComponent<Partial<Omit<Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
2688
2714
|
ref?: ((instance: HTMLDivElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLDivElement> | null | undefined;
|
2689
2715
|
} & {
|
@@ -2692,14 +2718,14 @@ declare const exports$b: {
|
|
2692
2718
|
Avatar: FC;
|
2693
2719
|
Content: react.ForwardRefExoticComponent<MessagePrimitiveContent.Props & Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
2694
2720
|
};
|
2695
|
-
declare const _default$
|
2721
|
+
declare const _default$9: typeof AssistantMessage & typeof exports$a;
|
2696
2722
|
|
2697
2723
|
declare const AssistantModal: FC<ThreadConfig>;
|
2698
2724
|
declare namespace AssistantModalRoot {
|
2699
2725
|
type Props = AssistantModalPrimitiveRoot.Props & ThreadConfigProviderProps;
|
2700
2726
|
}
|
2701
2727
|
declare const AssistantModalRoot: FC<AssistantModalRoot.Props>;
|
2702
|
-
declare const exports$
|
2728
|
+
declare const exports$9: {
|
2703
2729
|
Root: FC<AssistantModalRoot.Props>;
|
2704
2730
|
Trigger: react.ForwardRefExoticComponent<Partial<TooltipIconButtonProps> & react.RefAttributes<HTMLButtonElement>>;
|
2705
2731
|
Content: react.ForwardRefExoticComponent<Partial<Omit<Omit<PopoverPrimitive.PopoverContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & {
|
@@ -2710,10 +2736,10 @@ declare const exports$a: {
|
|
2710
2736
|
} & react.RefAttributes<HTMLButtonElement>>;
|
2711
2737
|
Anchor: react.ForwardRefExoticComponent<Partial<Omit<Omit<PopoverPrimitive.PopoverAnchorProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>, "ref">> & react.RefAttributes<HTMLDivElement>>;
|
2712
2738
|
};
|
2713
|
-
declare const _default$
|
2739
|
+
declare const _default$8: typeof AssistantModal & typeof exports$9;
|
2714
2740
|
|
2715
2741
|
declare const BranchPicker: FC;
|
2716
|
-
declare const exports$
|
2742
|
+
declare const exports$8: {
|
2717
2743
|
Root: react.ForwardRefExoticComponent<Partial<Omit<Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
2718
2744
|
ref?: ((instance: HTMLDivElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLDivElement> | null | undefined;
|
2719
2745
|
} & {
|
@@ -2724,7 +2750,7 @@ declare const exports$9: {
|
|
2724
2750
|
Previous: react.ForwardRefExoticComponent<Partial<TooltipIconButtonProps> & react.RefAttributes<HTMLButtonElement>>;
|
2725
2751
|
Next: react.ForwardRefExoticComponent<Partial<TooltipIconButtonProps> & react.RefAttributes<HTMLButtonElement>>;
|
2726
2752
|
};
|
2727
|
-
declare const _default$
|
2753
|
+
declare const _default$7: typeof BranchPicker & typeof exports$8;
|
2728
2754
|
|
2729
2755
|
declare const Composer: FC;
|
2730
2756
|
declare const ComposerInputStyled: react.ForwardRefExoticComponent<Partial<Omit<react_textarea_autosize.TextareaAutosizeProps & {
|
@@ -2745,7 +2771,7 @@ declare const ComposerInput: react.ForwardRefExoticComponent<Omit<Partial<Omit<r
|
|
2745
2771
|
submitOnEnter?: boolean | undefined;
|
2746
2772
|
cancelOnEscape?: boolean | undefined;
|
2747
2773
|
} & react.RefAttributes<HTMLTextAreaElement>, "ref">> & react.RefAttributes<HTMLTextAreaElement>, "ref"> & react.RefAttributes<HTMLTextAreaElement>>;
|
2748
|
-
declare const exports$
|
2774
|
+
declare const exports$7: {
|
2749
2775
|
Root: react.ForwardRefExoticComponent<Partial<Omit<Omit<Omit<react.DetailedHTMLProps<react.FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, "ref"> & {
|
2750
2776
|
ref?: ((instance: HTMLFormElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLFormElement> | null | undefined;
|
2751
2777
|
} & {
|
@@ -2762,10 +2788,10 @@ declare const exports$8: {
|
|
2762
2788
|
AddAttachment: react.ForwardRefExoticComponent<Partial<TooltipIconButtonProps> & react.RefAttributes<HTMLButtonElement>>;
|
2763
2789
|
Attachments: FC<Partial<ComposerPrimitiveAttachments.Props>>;
|
2764
2790
|
};
|
2765
|
-
declare const _default$
|
2791
|
+
declare const _default$6: typeof Composer & typeof exports$7;
|
2766
2792
|
|
2767
|
-
declare const
|
2768
|
-
declare const exports$
|
2793
|
+
declare const Attachment: FC;
|
2794
|
+
declare const exports$6: {
|
2769
2795
|
Root: react.ForwardRefExoticComponent<Partial<Omit<Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
2770
2796
|
ref?: ((instance: HTMLDivElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLDivElement> | null | undefined;
|
2771
2797
|
} & {
|
@@ -2773,10 +2799,10 @@ declare const exports$7: {
|
|
2773
2799
|
}, "ref"> & react.RefAttributes<HTMLDivElement>, "ref">> & react.RefAttributes<HTMLDivElement>>;
|
2774
2800
|
Remove: react.ForwardRefExoticComponent<Partial<TooltipIconButtonProps> & react.RefAttributes<HTMLButtonElement>>;
|
2775
2801
|
};
|
2776
|
-
declare const _default$
|
2802
|
+
declare const _default$5: typeof Attachment & typeof exports$6;
|
2777
2803
|
|
2778
2804
|
declare const EditComposer: FC;
|
2779
|
-
declare const exports$
|
2805
|
+
declare const exports$5: {
|
2780
2806
|
Root: react.ForwardRefExoticComponent<Partial<Omit<Omit<Omit<react.DetailedHTMLProps<react.FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, "ref"> & {
|
2781
2807
|
ref?: ((instance: HTMLFormElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLFormElement> | null | undefined;
|
2782
2808
|
} & {
|
@@ -2791,7 +2817,7 @@ declare const exports$6: {
|
|
2791
2817
|
Cancel: react.ForwardRefExoticComponent<Partial<ButtonProps> & react.RefAttributes<HTMLButtonElement>>;
|
2792
2818
|
Send: react.ForwardRefExoticComponent<Partial<ButtonProps> & react.RefAttributes<HTMLButtonElement>>;
|
2793
2819
|
};
|
2794
|
-
declare const _default$
|
2820
|
+
declare const _default$4: typeof EditComposer & typeof exports$5;
|
2795
2821
|
|
2796
2822
|
declare const Thread: FC<ThreadConfig>;
|
2797
2823
|
/**
|
@@ -2811,7 +2837,7 @@ declare const ThreadRoot: react.ForwardRefExoticComponent<Omit<Omit<react.Detail
|
|
2811
2837
|
} & {
|
2812
2838
|
children?: react.ReactNode | undefined;
|
2813
2839
|
} & react.RefAttributes<HTMLDivElement>>;
|
2814
|
-
declare const exports$
|
2840
|
+
declare const exports$4: {
|
2815
2841
|
Root: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
2816
2842
|
ref?: ((instance: HTMLDivElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLDivElement> | null | undefined;
|
2817
2843
|
} & {
|
@@ -2839,7 +2865,7 @@ declare const exports$5: {
|
|
2839
2865
|
ScrollToBottom: react.ForwardRefExoticComponent<Partial<TooltipIconButtonProps> & react.RefAttributes<HTMLButtonElement>>;
|
2840
2866
|
ViewportFooter: react.ForwardRefExoticComponent<Partial<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">> & react.RefAttributes<HTMLDivElement>>;
|
2841
2867
|
};
|
2842
|
-
declare const _default$
|
2868
|
+
declare const _default$3: typeof Thread & typeof exports$4;
|
2843
2869
|
|
2844
2870
|
declare const UserMessage: FC;
|
2845
2871
|
/**
|
@@ -2851,7 +2877,7 @@ declare namespace UserMessageContent {
|
|
2851
2877
|
type Props = MessagePrimitiveContent.Props & ComponentPropsWithoutRef<"div">;
|
2852
2878
|
}
|
2853
2879
|
declare const UserMessageContent: react.ForwardRefExoticComponent<MessagePrimitiveContent.Props & Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
2854
|
-
declare const exports$
|
2880
|
+
declare const exports$3: {
|
2855
2881
|
Root: react.ForwardRefExoticComponent<Partial<Omit<Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
2856
2882
|
ref?: ((instance: HTMLDivElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLDivElement> | null | undefined;
|
2857
2883
|
} & {
|
@@ -2860,10 +2886,10 @@ declare const exports$4: {
|
|
2860
2886
|
Content: react.ForwardRefExoticComponent<MessagePrimitiveContent.Props & Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
2861
2887
|
Attachments: FC<Partial<MessagePrimitiveAttachments.Props>>;
|
2862
2888
|
};
|
2863
|
-
declare const _default$
|
2889
|
+
declare const _default$2: typeof UserMessage & typeof exports$3;
|
2864
2890
|
|
2865
2891
|
declare const UserActionBar: FC;
|
2866
|
-
declare const exports$
|
2892
|
+
declare const exports$2: {
|
2867
2893
|
Root: react.ForwardRefExoticComponent<Partial<Omit<Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
2868
2894
|
ref?: ((instance: HTMLDivElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLDivElement> | null | undefined;
|
2869
2895
|
} & {
|
@@ -2871,17 +2897,7 @@ declare const exports$3: {
|
|
2871
2897
|
}, "ref"> & UseActionBarFloatStatusProps & react.RefAttributes<HTMLDivElement>, "ref">> & react.RefAttributes<HTMLDivElement>>;
|
2872
2898
|
Edit: react.ForwardRefExoticComponent<Partial<TooltipIconButtonProps> & react.RefAttributes<HTMLButtonElement>>;
|
2873
2899
|
};
|
2874
|
-
declare const _default$
|
2875
|
-
|
2876
|
-
declare const UserMessageAttachment: FC;
|
2877
|
-
declare const exports$2: {
|
2878
|
-
Root: react.ForwardRefExoticComponent<Partial<Omit<Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
2879
|
-
ref?: ((instance: HTMLDivElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLDivElement> | null | undefined;
|
2880
|
-
} & {
|
2881
|
-
asChild?: boolean;
|
2882
|
-
}, "ref"> & react.RefAttributes<HTMLDivElement>, "ref">> & react.RefAttributes<HTMLDivElement>>;
|
2883
|
-
};
|
2884
|
-
declare const _default$1: typeof UserMessageAttachment & typeof exports$2;
|
2900
|
+
declare const _default$1: typeof UserActionBar & typeof exports$2;
|
2885
2901
|
|
2886
2902
|
declare const ThreadWelcome: FC;
|
2887
2903
|
declare const ThreadWelcomeMessageStyled: react.ForwardRefExoticComponent<Partial<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref">> & react.RefAttributes<HTMLParagraphElement>>;
|
@@ -2984,7 +3000,7 @@ declare const useSmoothStatus: {
|
|
2984
3000
|
}): TSelected | null;
|
2985
3001
|
};
|
2986
3002
|
|
2987
|
-
type internal_AssistantRuntimeImpl
|
3003
|
+
type internal_AssistantRuntimeImpl = AssistantRuntimeImpl;
|
2988
3004
|
declare const internal_AssistantRuntimeImpl: typeof AssistantRuntimeImpl;
|
2989
3005
|
type internal_BaseAssistantRuntimeCore<TThreadRuntime extends ThreadRuntimeCore> = BaseAssistantRuntimeCore<TThreadRuntime>;
|
2990
3006
|
declare const internal_BaseAssistantRuntimeCore: typeof BaseAssistantRuntimeCore;
|
@@ -3007,4 +3023,4 @@ declare namespace internal {
|
|
3007
3023
|
export { internal_AssistantRuntimeImpl as AssistantRuntimeImpl, internal_BaseAssistantRuntimeCore as BaseAssistantRuntimeCore, internal_DefaultThreadComposerRuntimeCore as DefaultThreadComposerRuntimeCore, internal_MessageRepository as MessageRepository, internal_ProxyConfigProvider as ProxyConfigProvider, type internal_ThreadRuntimeCore as ThreadRuntimeCore, type internal_ThreadRuntimeCoreBinding as ThreadRuntimeCoreBinding, internal_ThreadRuntimeImpl as ThreadRuntimeImpl, internal_TooltipIconButton as TooltipIconButton, internal_generateId as generateId, internal_useSmooth as useSmooth, internal_useSmoothStatus as useSmoothStatus, internal_withSmoothContextProvider as withSmoothContextProvider };
|
3008
3024
|
}
|
3009
3025
|
|
3010
|
-
export { index$7 as ActionBarPrimitive, type ActionBarPrimitiveCopyProps, type ActionBarPrimitiveEditProps, type ActionBarPrimitiveFeedbackNegativeProps, type ActionBarPrimitiveFeedbackPositiveProps, type ActionBarPrimitiveReloadProps, type ActionBarPrimitiveRootProps, type ActionBarPrimitiveSpeakProps, type ActionBarPrimitiveStopSpeakingProps, type AddToolResultOptions, AppendMessage, _default$
|
3026
|
+
export { index$7 as ActionBarPrimitive, type ActionBarPrimitiveCopyProps, type ActionBarPrimitiveEditProps, type ActionBarPrimitiveFeedbackNegativeProps, type ActionBarPrimitiveFeedbackPositiveProps, type ActionBarPrimitiveReloadProps, type ActionBarPrimitiveRootProps, type ActionBarPrimitiveSpeakProps, type ActionBarPrimitiveStopSpeakingProps, type AddToolResultOptions, AppendMessage, _default$a as AssistantActionBar, type AssistantContextValue, _default$9 as AssistantMessage, type AssistantMessageConfig, type AssistantMessageContentProps, _default$8 as AssistantModal, index$6 as AssistantModalPrimitive, type AssistantModalPrimitiveContentProps, type AssistantModalPrimitiveRootProps, type AssistantModalPrimitiveTriggerProps, type AssistantRuntime, AssistantRuntimeProvider, type AssistantTool, type AssistantToolProps, type AssistantToolUI, type AssistantToolUIProps, type AssistantToolUIsState, Attachment$1 as Attachment, type AttachmentAdapter, index$5 as AttachmentPrimitive, _default$5 as AttachmentUI, _default$7 as BranchPicker, index$4 as BranchPickerPrimitive, type BranchPickerPrimitiveCountProps, type BranchPickerPrimitiveNextProps, type BranchPickerPrimitiveNumberProps, type BranchPickerPrimitivePreviousProps, type BranchPickerPrimitiveRootProps, type ChatModelAdapter, type ChatModelRunOptions, type ChatModelRunResult, type ChatModelRunUpdate, CompleteAttachment, _default$6 as Composer, _default$5 as ComposerAttachment, type ComposerContextValue, type ComposerInputProps, index$3 as ComposerPrimitive, type ComposerPrimitiveCancelProps, type ComposerPrimitiveIfProps, type ComposerPrimitiveInputProps, type ComposerPrimitiveRootProps, type ComposerPrimitiveSendProps, type ComposerRuntime, type ComposerState, CompositeAttachmentAdapter, exports as ContentPart, type ContentPartContextValue, index$2 as ContentPartPrimitive, type ContentPartPrimitiveDisplayProps, type ContentPartPrimitiveImageProps, type ContentPartPrimitiveInProgressProps, type ContentPartPrimitiveTextProps, type ContentPartRuntime, CoreMessage, type DangerousInBrowserRuntimeOptions, EdgeChatAdapter, type EdgeRuntimeOptions, _default$4 as EditComposer, type EditComposerRuntime, type EditComposerState, type EmptyContentPartComponent, type EmptyContentPartProps, type ExternalStoreAdapter, type ExternalStoreMessageConverter, internal as INTERNAL, ImageContentPart, type ImageContentPartComponent, type ImageContentPartProps, type LocalRuntimeOptions, type MessageContextValue, index$1 as MessagePrimitive, type MessagePrimitiveContentProps, type MessagePrimitiveIfProps, type MessagePrimitiveInProgressProps, type MessagePrimitiveRootProps, type MessageRuntime, type MessageState, MessageStatus, type MessageUtilsState, ModelConfig, ModelConfigProvider, PendingAttachment, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, SpeechSynthesisAdapter, StreamUtils, type StringsConfig, type SubmitFeedbackOptions, type SuggestionConfig, TextContentPart, type TextContentPartComponent, type TextContentPartProps, TextContentPartProvider, _default$3 as Thread, ThreadAssistantContentPart, type ThreadComposerRuntime, type ThreadComposerState, type ThreadConfig, ThreadConfigProvider, type ThreadConfigProviderProps, type ThreadContextValue, ThreadMessage, type ThreadMessageLike, index as ThreadPrimitive, type ThreadPrimitiveEmptyProps, type ThreadPrimitiveIfProps, type ThreadPrimitiveMessagesProps, type ThreadPrimitiveRootProps, type ThreadPrimitiveScrollToBottomProps, type ThreadPrimitiveSuggestionProps, type ThreadPrimitiveViewportProps, type ThreadRootProps, type ThreadRuntime, type ThreadState, type ThreadSuggestion, ThreadUserContentPart, type ThreadViewportState, _default as ThreadWelcome, type ThreadWelcomeConfig, type ThreadWelcomeMessageProps, type ThreadWelcomeSuggestionProps, Tool, ToolCallContentPart, type ToolCallContentPartComponent, type ToolCallContentPartProps, UIContentPart, type UIContentPartComponent, type UIContentPartProps, type Unsubscribe, type UseActionBarCopyProps, _default$1 as UserActionBar, _default$2 as UserMessage, _default$5 as UserMessageAttachment, type UserMessageConfig, type UserMessageContentProps, WebSpeechSynthesisAdapter, fromCoreMessage, fromCoreMessages, fromLanguageModelMessages, fromLanguageModelTools, getExternalStoreMessage, makeAssistantTool, makeAssistantToolUI, streamUtils, subscribeToMainThread, toCoreMessage, toCoreMessages, toLanguageModelMessages, toLanguageModelTools, useActionBarCopy, useActionBarEdit, useActionBarFeedbackNegative, useActionBarFeedbackPositive, useActionBarReload, useActionBarSpeak, useActionBarStopSpeaking, useAppendMessage, useAssistantActions, useAssistantActionsStore, useAssistantContext, useAssistantInstructions, useAssistantRuntime, useAssistantRuntimeStore, useAssistantTool, useAssistantToolUI, useBranchPickerCount, useBranchPickerNext, useBranchPickerNumber, useBranchPickerPrevious, useComposer, useComposerAddAttachment, useComposerCancel, useComposerContext, useComposerIf, useComposerRuntime, useComposerSend, useComposerStore, useContentPart, useContentPartContext, useContentPartDisplay, useContentPartImage, useContentPartRuntime, useContentPartStore, useContentPartText, useDangerousInBrowserRuntime, useEdgeRuntime, useEditComposer, useEditComposerStore, useExternalMessageConverter, useExternalStoreRuntime, useLocalRuntime, useMessage, useMessageContext, useMessageIf, useMessageRuntime, useMessageStore, useMessageUtils, useMessageUtilsStore, useSwitchToNewThread, useThread, useThreadActions, useThreadActionsStore, useThreadComposer, useThreadComposerStore, useThreadConfig, useThreadContext, useThreadEmpty, useThreadIf, useThreadMessages, useThreadMessagesStore, useThreadRuntime, useThreadRuntimeStore, useThreadScrollToBottom, useThreadStore, useThreadSuggestion, useThreadViewport, useThreadViewportStore, useToolUIs, useToolUIsStore };
|