@aiquants/chat 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +89 -0
- package/README.md +218 -26
- package/dist/{ChatAnswerHtml-3K6G6UKC.js → ChatAnswerHtml-UNWOOMYK.js} +1 -1
- package/dist/{chunk-7CEL735H.js → chunk-44WLZMPZ.js} +1 -1
- package/dist/chunk-5MWD2PSY.js +1 -0
- package/dist/chunk-GSCTWGZT.js +1 -0
- package/dist/chunk-HC7HXC2K.js +1 -0
- package/dist/{chunk-PLNRET3Z.js → chunk-KNPMHSTQ.js} +1 -1
- package/dist/{chunk-7KWWXSGA.js → chunk-NWDLT2AZ.js} +1 -1
- package/dist/client.cjs +2 -2
- package/dist/client.d.cts +5 -5
- package/dist/client.d.ts +5 -5
- package/dist/client.js +1 -1
- package/dist/{httpTransport-BAaKwioS.d.ts → httpTransport-Cgj10OUn.d.ts} +1 -1
- package/dist/{httpTransport-D_JJABMq.d.cts → httpTransport-o7MkPUuY.d.cts} +1 -1
- package/dist/{index-iHWm67aF.d.cts → index-g-wjju1F.d.cts} +9518 -1785
- package/dist/{index-iHWm67aF.d.ts → index-g-wjju1F.d.ts} +9518 -1785
- package/dist/protocol.cjs +1 -1
- package/dist/protocol.d.cts +1 -1
- package/dist/protocol.d.ts +1 -1
- package/dist/protocol.js +1 -1
- package/dist/react.cjs +2 -2
- package/dist/react.d.cts +210 -24
- package/dist/react.d.ts +210 -24
- package/dist/react.js +2 -2
- package/dist/{runStream-DLhaMZSu.d.ts → runStream-Wn5F3RKe.d.ts} +3 -1
- package/dist/{runStream-Dd5YdJoh.d.cts → runStream-jp4rlkIw.d.cts} +3 -1
- package/dist/testing.cjs +6 -6
- package/dist/testing.d.cts +55 -4
- package/dist/testing.d.ts +55 -4
- package/dist/testing.js +6 -6
- package/dist/{transport-Clvkp7mW.d.ts → transport-CYd9hh42.d.cts} +23 -1
- package/dist/{transport-5ExGY_ti.d.cts → transport-DlhniH4C.d.ts} +23 -1
- package/package.json +5 -5
- package/dist/chunk-4NR4KSV6.js +0 -1
- package/dist/chunk-TQNSD6RJ.js +0 -1
- package/dist/chunk-WGNEBS4H.js +0 -1
package/dist/react.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { L as ChatBusinessError, a2 as ChatHostRefusalRole, S as ChatErrorBody, a4 as ChatLimitKey, a1 as ChatFailureCode, aX as chatFailureDetailSchemas, U as ChatEventData, ax as chatAttachmentFragments, D as ChatAttachment, G as ChatAttachmentKind, aq as ChatVocabulary, N as ChatConversation, a7 as ChatModelList, aj as ChatSettings, a9 as ChatPolicy, ap as ChatUserSettingsUpdate } from "./index-g-wjju1F.cjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import * as react from "react";
|
|
4
4
|
import { ReactNode, RefObject } from "react";
|
|
5
5
|
import { MermaidDrawer } from "@aiquants/markdown";
|
|
6
6
|
import { MarkdownConverter } from "@aiquants/markdown/converter";
|
|
7
|
-
import { C as ChatStreamNotice, n as ChatStreamNoticeAction, e as ChatRunStreams } from "./runStream-
|
|
8
|
-
import { e as ChatTransport } from "./transport-
|
|
7
|
+
import { C as ChatStreamNotice, n as ChatStreamNoticeAction, e as ChatRunStreams } from "./runStream-jp4rlkIw.cjs";
|
|
8
|
+
import { e as ChatTransport } from "./transport-CYd9hh42.cjs";
|
|
9
9
|
import { PagedState } from "@aiquants/console-ui";
|
|
10
10
|
import "@aiquants/sse";
|
|
11
11
|
import "@aiquants/sse/client";
|
|
@@ -269,6 +269,7 @@ type ChatComposerProps = {
|
|
|
269
269
|
readonly value: string;
|
|
270
270
|
readonly onValueChange: (value: string) => void;
|
|
271
271
|
readonly phase: ChatComposerPhase;
|
|
272
|
+
readonly runElsewhere: boolean;
|
|
272
273
|
readonly onSend: (text: string) => void;
|
|
273
274
|
readonly onStop: () => void;
|
|
274
275
|
readonly notice: ChatStreamNotice | null;
|
|
@@ -278,9 +279,20 @@ type ChatComposerProps = {
|
|
|
278
279
|
readonly limits: ChatComposerLimits;
|
|
279
280
|
readonly sendKey: ChatVocabulary<"send_keys">;
|
|
280
281
|
readonly contentBaseUrl: string;
|
|
282
|
+
readonly inputRef: RefObject<HTMLTextAreaElement | null> | null;
|
|
281
283
|
readonly testId: string;
|
|
282
284
|
};
|
|
283
285
|
declare const ChatComposer: (props: ChatComposerProps) => react.JSX.Element;
|
|
286
|
+
type ChatConsentConversationProps = {
|
|
287
|
+
readonly transport: ChatTransport;
|
|
288
|
+
readonly hostRefusalCodes: ChatHostRefusalCodes;
|
|
289
|
+
readonly conversationUid: string;
|
|
290
|
+
readonly onChanged: () => void;
|
|
291
|
+
readonly onDeleted: (conversation: ChatConversation) => void;
|
|
292
|
+
readonly headingLevel: 1 | 2 | 3;
|
|
293
|
+
readonly testId: string;
|
|
294
|
+
};
|
|
295
|
+
declare const ChatConsentConversation: (props: ChatConsentConversationProps) => ReactNode;
|
|
284
296
|
type ChatTextLanguage = "ja" | "en" | "screen";
|
|
285
297
|
type ChatMessageAuthor = {
|
|
286
298
|
readonly role: "user";
|
|
@@ -289,15 +301,78 @@ type ChatMessageAuthor = {
|
|
|
289
301
|
readonly model: string | null;
|
|
290
302
|
readonly status: ChatAnswerStatus;
|
|
291
303
|
};
|
|
304
|
+
type ChatSendOptions = {
|
|
305
|
+
readonly transport: ChatTransport;
|
|
306
|
+
readonly window: ChatConversationWindow;
|
|
307
|
+
readonly hostRefusalCodes: ChatHostRefusalCodes;
|
|
308
|
+
};
|
|
309
|
+
type ChatSendMessage = {
|
|
310
|
+
readonly text: string;
|
|
311
|
+
readonly attachmentIds: readonly string[];
|
|
312
|
+
};
|
|
313
|
+
type ChatSendOutcome = "accepted" | "not-sent";
|
|
314
|
+
type ChatRewriteKind = "edit" | "regenerate";
|
|
315
|
+
type ChatRewriteOutcome = {
|
|
316
|
+
readonly kind: "accepted";
|
|
317
|
+
readonly siblingUid: string;
|
|
318
|
+
} | {
|
|
319
|
+
readonly kind: "not-sent";
|
|
320
|
+
};
|
|
321
|
+
type ChatRewriteProblem = {
|
|
322
|
+
readonly messageUid: string;
|
|
323
|
+
readonly kind: ChatRewriteKind;
|
|
324
|
+
readonly occurrence: number;
|
|
325
|
+
} & ({
|
|
326
|
+
readonly cause: "unreached";
|
|
327
|
+
} | {
|
|
328
|
+
readonly cause: "refused";
|
|
329
|
+
readonly refusal: ChatRefusal;
|
|
330
|
+
} | {
|
|
331
|
+
readonly cause: "incompatible";
|
|
332
|
+
});
|
|
333
|
+
type ChatRewriteState = {
|
|
334
|
+
readonly pending: {
|
|
335
|
+
readonly messageUid: string;
|
|
336
|
+
readonly kind: ChatRewriteKind;
|
|
337
|
+
} | null;
|
|
338
|
+
readonly accepted: {
|
|
339
|
+
readonly messageUid: string;
|
|
340
|
+
readonly kind: ChatRewriteKind;
|
|
341
|
+
readonly siblingUid: string;
|
|
342
|
+
} | null;
|
|
343
|
+
readonly problem: ChatRewriteProblem | null;
|
|
344
|
+
readonly block: "sending" | "writing" | null;
|
|
345
|
+
};
|
|
346
|
+
type ChatSend = {
|
|
347
|
+
readonly phase: ChatComposerPhase;
|
|
348
|
+
readonly problem: ChatComposerProblem | null;
|
|
349
|
+
readonly runElsewhere: boolean;
|
|
350
|
+
readonly sentMessageUid: string | null;
|
|
351
|
+
readonly send: (message: ChatSendMessage) => Promise<ChatSendOutcome>;
|
|
352
|
+
readonly edit: (messageUid: string, message: ChatSendMessage) => Promise<ChatRewriteOutcome>;
|
|
353
|
+
readonly regenerate: (messageUid: string) => Promise<ChatRewriteOutcome>;
|
|
354
|
+
readonly rewrite: ChatRewriteState;
|
|
355
|
+
readonly stop: () => void;
|
|
356
|
+
};
|
|
357
|
+
declare const useChatSend: (options: ChatSendOptions) => ChatSend;
|
|
292
358
|
type ChatListMessage = {
|
|
293
359
|
readonly messageUid: string;
|
|
294
360
|
readonly author: ChatMessageAuthor;
|
|
295
361
|
readonly createdAt: string;
|
|
296
362
|
readonly text: ChatMessageText;
|
|
363
|
+
readonly sourceText: string;
|
|
297
364
|
readonly marks: number;
|
|
298
365
|
readonly language: ChatTextLanguage;
|
|
366
|
+
readonly contextCutBefore: boolean;
|
|
367
|
+
readonly branch: ChatMessageBranch | null;
|
|
299
368
|
};
|
|
300
|
-
type
|
|
369
|
+
type ChatMessageBranch = {
|
|
370
|
+
readonly position: number;
|
|
371
|
+
readonly count: number;
|
|
372
|
+
readonly previous: string | null;
|
|
373
|
+
readonly next: string | null;
|
|
374
|
+
};
|
|
375
|
+
type ChatMessageListLimits = Readonly<Pick<Record<ChatLimitKey, number>, "CHAT_RENDER_LIST_OVERSCAN_ROWS" | "CHAT_USER_MESSAGE_MAX_CHARS">>;
|
|
301
376
|
type ChatMessageListProps = {
|
|
302
377
|
readonly messages: readonly ChatListMessage[];
|
|
303
378
|
readonly notificationLevel: ChatVocabulary<"notification_levels">;
|
|
@@ -311,15 +386,24 @@ type ChatMessageListProps = {
|
|
|
311
386
|
readonly onLoadOlder: () => void;
|
|
312
387
|
readonly olderReading: boolean;
|
|
313
388
|
readonly olderFailure: ChatOlderFailure | null;
|
|
389
|
+
readonly onSwitchBranch: (messageUid: string, siblingUid: string) => Promise<ChatBranchSwitchOutcome>;
|
|
390
|
+
readonly branchSwitch: ChatBranchSwitchState;
|
|
391
|
+
readonly onEditMessage: (messageUid: string, message: ChatSendMessage) => Promise<ChatRewriteOutcome>;
|
|
392
|
+
readonly onRegenerateMessage: (messageUid: string) => Promise<ChatRewriteOutcome>;
|
|
393
|
+
readonly rewrite: ChatRewriteState;
|
|
394
|
+
readonly messageActionsDisplay: ChatVocabulary<"message_actions_displays">;
|
|
395
|
+
readonly sendKey: ChatVocabulary<"send_keys">;
|
|
314
396
|
readonly testId: string;
|
|
315
397
|
};
|
|
316
|
-
declare const ChatMessageList: ({ messages, notificationLevel, followScroll, reduceMotion, sentMessageUid, labelledBy, headingLevel, limits, older, onLoadOlder, olderReading, olderFailure, testId }: ChatMessageListProps) => react.JSX.Element;
|
|
398
|
+
declare const ChatMessageList: ({ messages, notificationLevel, followScroll, reduceMotion, sentMessageUid, labelledBy, headingLevel, limits, older, onLoadOlder, olderReading, olderFailure, onSwitchBranch, branchSwitch, onEditMessage, onRegenerateMessage, rewrite, messageActionsDisplay, sendKey, testId, }: ChatMessageListProps) => react.JSX.Element;
|
|
317
399
|
type ChatConversationOptions = {
|
|
318
400
|
readonly transport: ChatTransport;
|
|
319
401
|
readonly streams: ChatRunStreams;
|
|
320
402
|
readonly conversationUid: string;
|
|
321
403
|
readonly hostRefusalCodes: ChatHostRefusalCodes;
|
|
404
|
+
readonly limits: ChatConversationLimits;
|
|
322
405
|
};
|
|
406
|
+
type ChatConversationLimits = Readonly<Pick<Record<ChatLimitKey, number>, "CHAT_RUN_POLL_INTERVAL_MS">>;
|
|
323
407
|
type ChatConversationState = {
|
|
324
408
|
readonly kind: "loading";
|
|
325
409
|
} | {
|
|
@@ -343,7 +427,29 @@ type ChatConversationWindow = {
|
|
|
343
427
|
readonly loadOlder: () => void;
|
|
344
428
|
readonly olderReading: boolean;
|
|
345
429
|
readonly olderFailure: ChatOlderFailure | null;
|
|
430
|
+
readonly switchBranch: (messageUid: string, siblingUid: string) => Promise<ChatBranchSwitchOutcome>;
|
|
431
|
+
readonly branchSwitch: ChatBranchSwitchState;
|
|
432
|
+
readonly runElsewhere: boolean;
|
|
433
|
+
};
|
|
434
|
+
type ChatBranchSwitchState = {
|
|
435
|
+
readonly switching: {
|
|
436
|
+
readonly messageUid: string;
|
|
437
|
+
readonly siblingUid: string;
|
|
438
|
+
} | null;
|
|
439
|
+
readonly problem: ChatBranchSwitchProblem | null;
|
|
346
440
|
};
|
|
441
|
+
type ChatBranchSwitchProblem = {
|
|
442
|
+
readonly messageUid: string;
|
|
443
|
+
readonly occurrence: number;
|
|
444
|
+
} & ({
|
|
445
|
+
readonly cause: "unreached";
|
|
446
|
+
} | {
|
|
447
|
+
readonly cause: "refused";
|
|
448
|
+
readonly refusal: ChatRefusal;
|
|
449
|
+
} | {
|
|
450
|
+
readonly cause: "incompatible";
|
|
451
|
+
});
|
|
452
|
+
type ChatBranchSwitchOutcome = "switched" | "not-switched";
|
|
347
453
|
type ChatOlderFailure = {
|
|
348
454
|
readonly cause: "unreached" | "incompatible";
|
|
349
455
|
readonly occurrence: number;
|
|
@@ -357,6 +463,45 @@ type ChatConversationGateProps = {
|
|
|
357
463
|
readonly testId: string;
|
|
358
464
|
};
|
|
359
465
|
declare const ChatConversationGate: ({ conversation, onReopen, focusAfterOpen, children, testId }: ChatConversationGateProps) => ReactNode;
|
|
466
|
+
type ChatConversationActionsOptions = {
|
|
467
|
+
readonly transport: ChatTransport;
|
|
468
|
+
readonly window: ChatConversationWindow;
|
|
469
|
+
readonly hostRefusalCodes: ChatHostRefusalCodes;
|
|
470
|
+
readonly onChanged: () => void;
|
|
471
|
+
readonly onDeleted: (conversation: ChatConversation) => void;
|
|
472
|
+
};
|
|
473
|
+
type ChatConversationAction = "rename" | "pin" | "delete";
|
|
474
|
+
type ChatConversationActionPhase = "ready" | "renaming" | "pinning" | "stopping" | "deleting";
|
|
475
|
+
type ChatConversationActionProblem = {
|
|
476
|
+
readonly action: ChatConversationAction;
|
|
477
|
+
readonly occurrence: number;
|
|
478
|
+
} & ({
|
|
479
|
+
readonly cause: "unreached";
|
|
480
|
+
} | {
|
|
481
|
+
readonly cause: "refused";
|
|
482
|
+
readonly refusal: ChatRefusal;
|
|
483
|
+
} | {
|
|
484
|
+
readonly cause: "incompatible";
|
|
485
|
+
});
|
|
486
|
+
type ChatConversationActionOutcome = "done" | "not-done";
|
|
487
|
+
type ChatConversationActions = {
|
|
488
|
+
readonly phase: ChatConversationActionPhase;
|
|
489
|
+
readonly problem: ChatConversationActionProblem | null;
|
|
490
|
+
readonly landed: ChatConversation | null;
|
|
491
|
+
readonly rename: (title: string) => Promise<ChatConversationActionOutcome>;
|
|
492
|
+
readonly setPinned: (pinned: boolean) => Promise<ChatConversationActionOutcome>;
|
|
493
|
+
readonly remove: (signal: AbortSignal) => Promise<ChatConversationActionOutcome>;
|
|
494
|
+
};
|
|
495
|
+
declare const chatConversationShownRow: (row: ChatConversation, landed: ChatConversation | null) => ChatConversation;
|
|
496
|
+
declare const useChatConversationActions: (options: ChatConversationActionsOptions) => ChatConversationActions;
|
|
497
|
+
type ChatConversationHeadingProps = {
|
|
498
|
+
readonly conversation: ChatConversation;
|
|
499
|
+
readonly actions: ChatConversationActions;
|
|
500
|
+
readonly level: 1 | 2 | 3;
|
|
501
|
+
readonly labelId: string;
|
|
502
|
+
readonly testId: string;
|
|
503
|
+
};
|
|
504
|
+
declare const ChatConversationHeading: ({ conversation, actions, level, labelId, testId }: ChatConversationHeadingProps) => react.JSX.Element;
|
|
360
505
|
type ChatConversationListLimits = {
|
|
361
506
|
readonly CHAT_TITLE_SEARCH_PAUSE_MS: number;
|
|
362
507
|
};
|
|
@@ -484,6 +629,64 @@ type ChatNewConversationChoicesProps = {
|
|
|
484
629
|
readonly testId: string;
|
|
485
630
|
};
|
|
486
631
|
declare const ChatNewConversationChoices: ({ choice, phase, testId }: ChatNewConversationChoicesProps) => react.JSX.Element;
|
|
632
|
+
type ChatPolicyOptions = {
|
|
633
|
+
readonly transport: ChatTransport;
|
|
634
|
+
readonly hostRefusalCodes: ChatHostRefusalCodes;
|
|
635
|
+
};
|
|
636
|
+
type ChatPolicyState = {
|
|
637
|
+
readonly kind: "reading";
|
|
638
|
+
} | {
|
|
639
|
+
readonly kind: "consented";
|
|
640
|
+
readonly policy: Extract<ChatPolicy, {
|
|
641
|
+
readonly consent: "current";
|
|
642
|
+
}>;
|
|
643
|
+
} | {
|
|
644
|
+
readonly kind: "consent-needed";
|
|
645
|
+
readonly policy: Exclude<ChatPolicy, {
|
|
646
|
+
readonly consent: "current";
|
|
647
|
+
}>;
|
|
648
|
+
} | {
|
|
649
|
+
readonly kind: "not-published";
|
|
650
|
+
readonly retry: () => void;
|
|
651
|
+
} | {
|
|
652
|
+
readonly kind: "refused";
|
|
653
|
+
readonly refusal: ChatRefusal;
|
|
654
|
+
readonly retry: (() => void) | null;
|
|
655
|
+
} | {
|
|
656
|
+
readonly kind: "failed";
|
|
657
|
+
readonly cause: "unreached" | "incompatible";
|
|
658
|
+
readonly retry: () => void;
|
|
659
|
+
};
|
|
660
|
+
type ChatPolicyConsentProblem = {
|
|
661
|
+
readonly occurrence: number;
|
|
662
|
+
} & ({
|
|
663
|
+
readonly cause: "superseded";
|
|
664
|
+
} | {
|
|
665
|
+
readonly cause: "unreached";
|
|
666
|
+
} | {
|
|
667
|
+
readonly cause: "refused";
|
|
668
|
+
readonly refusal: ChatRefusal;
|
|
669
|
+
} | {
|
|
670
|
+
readonly cause: "incompatible";
|
|
671
|
+
});
|
|
672
|
+
type ChatPolicyConsentOutcome = "consented" | "not-consented";
|
|
673
|
+
type ChatPolicyAccess = {
|
|
674
|
+
readonly state: ChatPolicyState;
|
|
675
|
+
readonly consenting: boolean;
|
|
676
|
+
readonly problem: ChatPolicyConsentProblem | null;
|
|
677
|
+
readonly consent: () => Promise<ChatPolicyConsentOutcome>;
|
|
678
|
+
readonly transport: ChatTransport;
|
|
679
|
+
};
|
|
680
|
+
declare const useChatPolicy: (options: ChatPolicyOptions) => ChatPolicyAccess;
|
|
681
|
+
type ChatPolicyGateProps = {
|
|
682
|
+
readonly policy: ChatPolicyAccess;
|
|
683
|
+
readonly focusAfterConsent: RefObject<HTMLElement | null>;
|
|
684
|
+
readonly aside: ReactNode;
|
|
685
|
+
readonly children: () => ReactNode;
|
|
686
|
+
readonly headingLevel: 1 | 2 | 3;
|
|
687
|
+
readonly testId: string;
|
|
688
|
+
};
|
|
689
|
+
declare const ChatPolicyGate: ({ policy, focusAfterConsent, aside, children, headingLevel, testId }: ChatPolicyGateProps) => ReactNode;
|
|
487
690
|
type ChatSettingsOptions = {
|
|
488
691
|
readonly transport: ChatTransport;
|
|
489
692
|
readonly hostRefusalCodes: ChatHostRefusalCodes;
|
|
@@ -578,22 +781,5 @@ type ChatComposerAttachmentsState = {
|
|
|
578
781
|
};
|
|
579
782
|
declare const useChatComposerAttachments: (options: ChatComposerAttachmentsOptions) => ChatComposerAttachmentsState;
|
|
580
783
|
declare const useChatConversationCreatedAnnouncer: () => (() => void);
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
readonly window: ChatConversationWindow;
|
|
584
|
-
readonly hostRefusalCodes: ChatHostRefusalCodes;
|
|
585
|
-
};
|
|
586
|
-
type ChatSendMessage = {
|
|
587
|
-
readonly text: string;
|
|
588
|
-
readonly attachmentIds: readonly string[];
|
|
589
|
-
};
|
|
590
|
-
type ChatSendOutcome = "accepted" | "not-sent";
|
|
591
|
-
type ChatSend = {
|
|
592
|
-
readonly phase: ChatComposerPhase;
|
|
593
|
-
readonly problem: ChatComposerProblem | null;
|
|
594
|
-
readonly sentMessageUid: string | null;
|
|
595
|
-
readonly send: (message: ChatSendMessage) => Promise<ChatSendOutcome>;
|
|
596
|
-
readonly stop: () => void;
|
|
597
|
-
};
|
|
598
|
-
declare const useChatSend: (options: ChatSendOptions) => ChatSend;
|
|
599
|
-
export { CHAT_LAYOUT, type ChatAnswerRenderLimits, ChatAnswerRendering, type ChatAnswerRenderingProps, type ChatAnswerStatus, type ChatAttachmentLimits, type ChatAttachmentPrecheckRefusal, type ChatChoosableModel, ChatComposer, type ChatComposerAltTextOutcome, type ChatComposerAttachment, type ChatComposerAttachments, type ChatComposerAttachmentsLimits, type ChatComposerAttachmentsOptions, type ChatComposerAttachmentsState, type ChatComposerLimits, type ChatComposerPhase, type ChatComposerProblem, type ChatComposerProps, type ChatComposerRestore, type ChatComposerSaveAltText, ChatConversationGate, type ChatConversationGateProps, ChatConversationList, type ChatConversationListLimits, type ChatConversationListOptions, type ChatConversationListProps, type ChatConversationListState, type ChatConversationListViewLimits, type ChatConversationOptions, type ChatConversationSection, type ChatConversationState, type ChatConversationWindow, type ChatConversionLimits, type ChatConverterTimeouts, type ChatDiagramFileContext, type ChatDiagramFormat, ChatFrame, type ChatFrameProps, type ChatHostRefusalCodes, type ChatLayoutColumn, type ChatLayoutColumns, type ChatLayoutPlan, type ChatLayoutRule, type ChatListMessage, type ChatMarkdownConverterFactory, type ChatMediaRecorderLike, type ChatMediaStreamLike, type ChatMessageAuthor, ChatMessageList, type ChatMessageListLimits, type ChatMessageListProps, type ChatMessageText, type ChatMicrophone, type ChatMicrophoneProblem, type ChatMicrophoneScope, type ChatModelAttachmentFlags, type ChatModels, type ChatModelsOptions, type ChatModelsQuery, type ChatModelsState, type ChatNewConversation, type ChatNewConversationChoice, type ChatNewConversationChoiceOptions, ChatNewConversationChoices, type ChatNewConversationChoicesProps, type ChatNewConversationMessage, type ChatNewConversationOptions, type ChatNewConversationOutcome, type ChatOlderFailure, type ChatPinnedSide, type ChatRecording, type ChatRecordingListener, type ChatRecordingRequest, type ChatRecordingStart, type ChatRefusal, type ChatRefusalStatusClass, type ChatSend, type ChatSendMessage, type ChatSendOptions, type ChatSendOutcome, type ChatSettingsAccess, ChatSettingsForm, type ChatSettingsFormProps, ChatSettingsGate, type ChatSettingsGateProps, type ChatSettingsOptions, type ChatSettingsProblem, type ChatSettingsSaveOutcome, type ChatSettingsState, ChatTalkFlow, type ChatTalkFlowProps, ChatTalkHeading, type ChatTalkHeadingProps, assertValidChatHostRefusalCodes, chatAttachmentHasUnreadText, chatAttachmentsRefusedByModel, chatBrowserMicrophone, chatDeclaredAttachmentKind, chatFilePickerAccept, chatFrameBlockSizePx, chatLayoutPlan, chatLayoutRule, chatModelAttachmentKinds, chatModelTakesKind, chatRefusal, diagramFileName, precheckChatAttachment, useChatComposerAttachments, useChatConversation, useChatConversationCreatedAnnouncer, useChatConversationList, useChatModels, useChatNewConversation, useChatNewConversationChoice, useChatSend, useChatSettings };
|
|
784
|
+
declare const useChatConversationDeletedAnnouncer: () => ((conversation: Pick<ChatConversation, "title">) => void);
|
|
785
|
+
export { CHAT_LAYOUT, type ChatAnswerRenderLimits, ChatAnswerRendering, type ChatAnswerRenderingProps, type ChatAnswerStatus, type ChatAttachmentLimits, type ChatAttachmentPrecheckRefusal, type ChatBranchSwitchOutcome, type ChatBranchSwitchProblem, type ChatBranchSwitchState, type ChatChoosableModel, ChatComposer, type ChatComposerAltTextOutcome, type ChatComposerAttachment, type ChatComposerAttachments, type ChatComposerAttachmentsLimits, type ChatComposerAttachmentsOptions, type ChatComposerAttachmentsState, type ChatComposerLimits, type ChatComposerPhase, type ChatComposerProblem, type ChatComposerProps, type ChatComposerRestore, type ChatComposerSaveAltText, ChatConsentConversation, type ChatConsentConversationProps, type ChatConversationAction, type ChatConversationActionOutcome, type ChatConversationActionPhase, type ChatConversationActionProblem, type ChatConversationActions, type ChatConversationActionsOptions, ChatConversationGate, type ChatConversationGateProps, ChatConversationHeading, type ChatConversationHeadingProps, type ChatConversationLimits, ChatConversationList, type ChatConversationListLimits, type ChatConversationListOptions, type ChatConversationListProps, type ChatConversationListState, type ChatConversationListViewLimits, type ChatConversationOptions, type ChatConversationSection, type ChatConversationState, type ChatConversationWindow, type ChatConversionLimits, type ChatConverterTimeouts, type ChatDiagramFileContext, type ChatDiagramFormat, ChatFrame, type ChatFrameProps, type ChatHostRefusalCodes, type ChatLayoutColumn, type ChatLayoutColumns, type ChatLayoutPlan, type ChatLayoutRule, type ChatListMessage, type ChatMarkdownConverterFactory, type ChatMediaRecorderLike, type ChatMediaStreamLike, type ChatMessageAuthor, type ChatMessageBranch, ChatMessageList, type ChatMessageListLimits, type ChatMessageListProps, type ChatMessageText, type ChatMicrophone, type ChatMicrophoneProblem, type ChatMicrophoneScope, type ChatModelAttachmentFlags, type ChatModels, type ChatModelsOptions, type ChatModelsQuery, type ChatModelsState, type ChatNewConversation, type ChatNewConversationChoice, type ChatNewConversationChoiceOptions, ChatNewConversationChoices, type ChatNewConversationChoicesProps, type ChatNewConversationMessage, type ChatNewConversationOptions, type ChatNewConversationOutcome, type ChatOlderFailure, type ChatPinnedSide, type ChatPolicyAccess, type ChatPolicyConsentOutcome, type ChatPolicyConsentProblem, ChatPolicyGate, type ChatPolicyGateProps, type ChatPolicyOptions, type ChatPolicyState, type ChatRecording, type ChatRecordingListener, type ChatRecordingRequest, type ChatRecordingStart, type ChatRefusal, type ChatRefusalStatusClass, type ChatRewriteKind, type ChatRewriteOutcome, type ChatRewriteProblem, type ChatRewriteState, type ChatSend, type ChatSendMessage, type ChatSendOptions, type ChatSendOutcome, type ChatSettingsAccess, ChatSettingsForm, type ChatSettingsFormProps, ChatSettingsGate, type ChatSettingsGateProps, type ChatSettingsOptions, type ChatSettingsProblem, type ChatSettingsSaveOutcome, type ChatSettingsState, ChatTalkFlow, type ChatTalkFlowProps, ChatTalkHeading, type ChatTalkHeadingProps, assertValidChatHostRefusalCodes, chatAttachmentHasUnreadText, chatAttachmentsRefusedByModel, chatBrowserMicrophone, chatConversationShownRow, chatDeclaredAttachmentKind, chatFilePickerAccept, chatFrameBlockSizePx, chatLayoutPlan, chatLayoutRule, chatModelAttachmentKinds, chatModelTakesKind, chatRefusal, diagramFileName, precheckChatAttachment, useChatComposerAttachments, useChatConversation, useChatConversationActions, useChatConversationCreatedAnnouncer, useChatConversationDeletedAnnouncer, useChatConversationList, useChatModels, useChatNewConversation, useChatNewConversationChoice, useChatPolicy, useChatSend, useChatSettings };
|
package/dist/react.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { L as ChatBusinessError, a2 as ChatHostRefusalRole, S as ChatErrorBody, a4 as ChatLimitKey, a1 as ChatFailureCode, aX as chatFailureDetailSchemas, U as ChatEventData, ax as chatAttachmentFragments, D as ChatAttachment, G as ChatAttachmentKind, aq as ChatVocabulary, N as ChatConversation, a7 as ChatModelList, aj as ChatSettings, a9 as ChatPolicy, ap as ChatUserSettingsUpdate } from "./index-g-wjju1F.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import * as react from "react";
|
|
4
4
|
import { ReactNode, RefObject } from "react";
|
|
5
5
|
import { MermaidDrawer } from "@aiquants/markdown";
|
|
6
6
|
import { MarkdownConverter } from "@aiquants/markdown/converter";
|
|
7
|
-
import { C as ChatStreamNotice, n as ChatStreamNoticeAction, e as ChatRunStreams } from "./runStream-
|
|
8
|
-
import { e as ChatTransport } from "./transport-
|
|
7
|
+
import { C as ChatStreamNotice, n as ChatStreamNoticeAction, e as ChatRunStreams } from "./runStream-Wn5F3RKe.js";
|
|
8
|
+
import { e as ChatTransport } from "./transport-DlhniH4C.js";
|
|
9
9
|
import { PagedState } from "@aiquants/console-ui";
|
|
10
10
|
import "@aiquants/sse";
|
|
11
11
|
import "@aiquants/sse/client";
|
|
@@ -269,6 +269,7 @@ type ChatComposerProps = {
|
|
|
269
269
|
readonly value: string;
|
|
270
270
|
readonly onValueChange: (value: string) => void;
|
|
271
271
|
readonly phase: ChatComposerPhase;
|
|
272
|
+
readonly runElsewhere: boolean;
|
|
272
273
|
readonly onSend: (text: string) => void;
|
|
273
274
|
readonly onStop: () => void;
|
|
274
275
|
readonly notice: ChatStreamNotice | null;
|
|
@@ -278,9 +279,20 @@ type ChatComposerProps = {
|
|
|
278
279
|
readonly limits: ChatComposerLimits;
|
|
279
280
|
readonly sendKey: ChatVocabulary<"send_keys">;
|
|
280
281
|
readonly contentBaseUrl: string;
|
|
282
|
+
readonly inputRef: RefObject<HTMLTextAreaElement | null> | null;
|
|
281
283
|
readonly testId: string;
|
|
282
284
|
};
|
|
283
285
|
declare const ChatComposer: (props: ChatComposerProps) => react.JSX.Element;
|
|
286
|
+
type ChatConsentConversationProps = {
|
|
287
|
+
readonly transport: ChatTransport;
|
|
288
|
+
readonly hostRefusalCodes: ChatHostRefusalCodes;
|
|
289
|
+
readonly conversationUid: string;
|
|
290
|
+
readonly onChanged: () => void;
|
|
291
|
+
readonly onDeleted: (conversation: ChatConversation) => void;
|
|
292
|
+
readonly headingLevel: 1 | 2 | 3;
|
|
293
|
+
readonly testId: string;
|
|
294
|
+
};
|
|
295
|
+
declare const ChatConsentConversation: (props: ChatConsentConversationProps) => ReactNode;
|
|
284
296
|
type ChatTextLanguage = "ja" | "en" | "screen";
|
|
285
297
|
type ChatMessageAuthor = {
|
|
286
298
|
readonly role: "user";
|
|
@@ -289,15 +301,78 @@ type ChatMessageAuthor = {
|
|
|
289
301
|
readonly model: string | null;
|
|
290
302
|
readonly status: ChatAnswerStatus;
|
|
291
303
|
};
|
|
304
|
+
type ChatSendOptions = {
|
|
305
|
+
readonly transport: ChatTransport;
|
|
306
|
+
readonly window: ChatConversationWindow;
|
|
307
|
+
readonly hostRefusalCodes: ChatHostRefusalCodes;
|
|
308
|
+
};
|
|
309
|
+
type ChatSendMessage = {
|
|
310
|
+
readonly text: string;
|
|
311
|
+
readonly attachmentIds: readonly string[];
|
|
312
|
+
};
|
|
313
|
+
type ChatSendOutcome = "accepted" | "not-sent";
|
|
314
|
+
type ChatRewriteKind = "edit" | "regenerate";
|
|
315
|
+
type ChatRewriteOutcome = {
|
|
316
|
+
readonly kind: "accepted";
|
|
317
|
+
readonly siblingUid: string;
|
|
318
|
+
} | {
|
|
319
|
+
readonly kind: "not-sent";
|
|
320
|
+
};
|
|
321
|
+
type ChatRewriteProblem = {
|
|
322
|
+
readonly messageUid: string;
|
|
323
|
+
readonly kind: ChatRewriteKind;
|
|
324
|
+
readonly occurrence: number;
|
|
325
|
+
} & ({
|
|
326
|
+
readonly cause: "unreached";
|
|
327
|
+
} | {
|
|
328
|
+
readonly cause: "refused";
|
|
329
|
+
readonly refusal: ChatRefusal;
|
|
330
|
+
} | {
|
|
331
|
+
readonly cause: "incompatible";
|
|
332
|
+
});
|
|
333
|
+
type ChatRewriteState = {
|
|
334
|
+
readonly pending: {
|
|
335
|
+
readonly messageUid: string;
|
|
336
|
+
readonly kind: ChatRewriteKind;
|
|
337
|
+
} | null;
|
|
338
|
+
readonly accepted: {
|
|
339
|
+
readonly messageUid: string;
|
|
340
|
+
readonly kind: ChatRewriteKind;
|
|
341
|
+
readonly siblingUid: string;
|
|
342
|
+
} | null;
|
|
343
|
+
readonly problem: ChatRewriteProblem | null;
|
|
344
|
+
readonly block: "sending" | "writing" | null;
|
|
345
|
+
};
|
|
346
|
+
type ChatSend = {
|
|
347
|
+
readonly phase: ChatComposerPhase;
|
|
348
|
+
readonly problem: ChatComposerProblem | null;
|
|
349
|
+
readonly runElsewhere: boolean;
|
|
350
|
+
readonly sentMessageUid: string | null;
|
|
351
|
+
readonly send: (message: ChatSendMessage) => Promise<ChatSendOutcome>;
|
|
352
|
+
readonly edit: (messageUid: string, message: ChatSendMessage) => Promise<ChatRewriteOutcome>;
|
|
353
|
+
readonly regenerate: (messageUid: string) => Promise<ChatRewriteOutcome>;
|
|
354
|
+
readonly rewrite: ChatRewriteState;
|
|
355
|
+
readonly stop: () => void;
|
|
356
|
+
};
|
|
357
|
+
declare const useChatSend: (options: ChatSendOptions) => ChatSend;
|
|
292
358
|
type ChatListMessage = {
|
|
293
359
|
readonly messageUid: string;
|
|
294
360
|
readonly author: ChatMessageAuthor;
|
|
295
361
|
readonly createdAt: string;
|
|
296
362
|
readonly text: ChatMessageText;
|
|
363
|
+
readonly sourceText: string;
|
|
297
364
|
readonly marks: number;
|
|
298
365
|
readonly language: ChatTextLanguage;
|
|
366
|
+
readonly contextCutBefore: boolean;
|
|
367
|
+
readonly branch: ChatMessageBranch | null;
|
|
299
368
|
};
|
|
300
|
-
type
|
|
369
|
+
type ChatMessageBranch = {
|
|
370
|
+
readonly position: number;
|
|
371
|
+
readonly count: number;
|
|
372
|
+
readonly previous: string | null;
|
|
373
|
+
readonly next: string | null;
|
|
374
|
+
};
|
|
375
|
+
type ChatMessageListLimits = Readonly<Pick<Record<ChatLimitKey, number>, "CHAT_RENDER_LIST_OVERSCAN_ROWS" | "CHAT_USER_MESSAGE_MAX_CHARS">>;
|
|
301
376
|
type ChatMessageListProps = {
|
|
302
377
|
readonly messages: readonly ChatListMessage[];
|
|
303
378
|
readonly notificationLevel: ChatVocabulary<"notification_levels">;
|
|
@@ -311,15 +386,24 @@ type ChatMessageListProps = {
|
|
|
311
386
|
readonly onLoadOlder: () => void;
|
|
312
387
|
readonly olderReading: boolean;
|
|
313
388
|
readonly olderFailure: ChatOlderFailure | null;
|
|
389
|
+
readonly onSwitchBranch: (messageUid: string, siblingUid: string) => Promise<ChatBranchSwitchOutcome>;
|
|
390
|
+
readonly branchSwitch: ChatBranchSwitchState;
|
|
391
|
+
readonly onEditMessage: (messageUid: string, message: ChatSendMessage) => Promise<ChatRewriteOutcome>;
|
|
392
|
+
readonly onRegenerateMessage: (messageUid: string) => Promise<ChatRewriteOutcome>;
|
|
393
|
+
readonly rewrite: ChatRewriteState;
|
|
394
|
+
readonly messageActionsDisplay: ChatVocabulary<"message_actions_displays">;
|
|
395
|
+
readonly sendKey: ChatVocabulary<"send_keys">;
|
|
314
396
|
readonly testId: string;
|
|
315
397
|
};
|
|
316
|
-
declare const ChatMessageList: ({ messages, notificationLevel, followScroll, reduceMotion, sentMessageUid, labelledBy, headingLevel, limits, older, onLoadOlder, olderReading, olderFailure, testId }: ChatMessageListProps) => react.JSX.Element;
|
|
398
|
+
declare const ChatMessageList: ({ messages, notificationLevel, followScroll, reduceMotion, sentMessageUid, labelledBy, headingLevel, limits, older, onLoadOlder, olderReading, olderFailure, onSwitchBranch, branchSwitch, onEditMessage, onRegenerateMessage, rewrite, messageActionsDisplay, sendKey, testId, }: ChatMessageListProps) => react.JSX.Element;
|
|
317
399
|
type ChatConversationOptions = {
|
|
318
400
|
readonly transport: ChatTransport;
|
|
319
401
|
readonly streams: ChatRunStreams;
|
|
320
402
|
readonly conversationUid: string;
|
|
321
403
|
readonly hostRefusalCodes: ChatHostRefusalCodes;
|
|
404
|
+
readonly limits: ChatConversationLimits;
|
|
322
405
|
};
|
|
406
|
+
type ChatConversationLimits = Readonly<Pick<Record<ChatLimitKey, number>, "CHAT_RUN_POLL_INTERVAL_MS">>;
|
|
323
407
|
type ChatConversationState = {
|
|
324
408
|
readonly kind: "loading";
|
|
325
409
|
} | {
|
|
@@ -343,7 +427,29 @@ type ChatConversationWindow = {
|
|
|
343
427
|
readonly loadOlder: () => void;
|
|
344
428
|
readonly olderReading: boolean;
|
|
345
429
|
readonly olderFailure: ChatOlderFailure | null;
|
|
430
|
+
readonly switchBranch: (messageUid: string, siblingUid: string) => Promise<ChatBranchSwitchOutcome>;
|
|
431
|
+
readonly branchSwitch: ChatBranchSwitchState;
|
|
432
|
+
readonly runElsewhere: boolean;
|
|
433
|
+
};
|
|
434
|
+
type ChatBranchSwitchState = {
|
|
435
|
+
readonly switching: {
|
|
436
|
+
readonly messageUid: string;
|
|
437
|
+
readonly siblingUid: string;
|
|
438
|
+
} | null;
|
|
439
|
+
readonly problem: ChatBranchSwitchProblem | null;
|
|
346
440
|
};
|
|
441
|
+
type ChatBranchSwitchProblem = {
|
|
442
|
+
readonly messageUid: string;
|
|
443
|
+
readonly occurrence: number;
|
|
444
|
+
} & ({
|
|
445
|
+
readonly cause: "unreached";
|
|
446
|
+
} | {
|
|
447
|
+
readonly cause: "refused";
|
|
448
|
+
readonly refusal: ChatRefusal;
|
|
449
|
+
} | {
|
|
450
|
+
readonly cause: "incompatible";
|
|
451
|
+
});
|
|
452
|
+
type ChatBranchSwitchOutcome = "switched" | "not-switched";
|
|
347
453
|
type ChatOlderFailure = {
|
|
348
454
|
readonly cause: "unreached" | "incompatible";
|
|
349
455
|
readonly occurrence: number;
|
|
@@ -357,6 +463,45 @@ type ChatConversationGateProps = {
|
|
|
357
463
|
readonly testId: string;
|
|
358
464
|
};
|
|
359
465
|
declare const ChatConversationGate: ({ conversation, onReopen, focusAfterOpen, children, testId }: ChatConversationGateProps) => ReactNode;
|
|
466
|
+
type ChatConversationActionsOptions = {
|
|
467
|
+
readonly transport: ChatTransport;
|
|
468
|
+
readonly window: ChatConversationWindow;
|
|
469
|
+
readonly hostRefusalCodes: ChatHostRefusalCodes;
|
|
470
|
+
readonly onChanged: () => void;
|
|
471
|
+
readonly onDeleted: (conversation: ChatConversation) => void;
|
|
472
|
+
};
|
|
473
|
+
type ChatConversationAction = "rename" | "pin" | "delete";
|
|
474
|
+
type ChatConversationActionPhase = "ready" | "renaming" | "pinning" | "stopping" | "deleting";
|
|
475
|
+
type ChatConversationActionProblem = {
|
|
476
|
+
readonly action: ChatConversationAction;
|
|
477
|
+
readonly occurrence: number;
|
|
478
|
+
} & ({
|
|
479
|
+
readonly cause: "unreached";
|
|
480
|
+
} | {
|
|
481
|
+
readonly cause: "refused";
|
|
482
|
+
readonly refusal: ChatRefusal;
|
|
483
|
+
} | {
|
|
484
|
+
readonly cause: "incompatible";
|
|
485
|
+
});
|
|
486
|
+
type ChatConversationActionOutcome = "done" | "not-done";
|
|
487
|
+
type ChatConversationActions = {
|
|
488
|
+
readonly phase: ChatConversationActionPhase;
|
|
489
|
+
readonly problem: ChatConversationActionProblem | null;
|
|
490
|
+
readonly landed: ChatConversation | null;
|
|
491
|
+
readonly rename: (title: string) => Promise<ChatConversationActionOutcome>;
|
|
492
|
+
readonly setPinned: (pinned: boolean) => Promise<ChatConversationActionOutcome>;
|
|
493
|
+
readonly remove: (signal: AbortSignal) => Promise<ChatConversationActionOutcome>;
|
|
494
|
+
};
|
|
495
|
+
declare const chatConversationShownRow: (row: ChatConversation, landed: ChatConversation | null) => ChatConversation;
|
|
496
|
+
declare const useChatConversationActions: (options: ChatConversationActionsOptions) => ChatConversationActions;
|
|
497
|
+
type ChatConversationHeadingProps = {
|
|
498
|
+
readonly conversation: ChatConversation;
|
|
499
|
+
readonly actions: ChatConversationActions;
|
|
500
|
+
readonly level: 1 | 2 | 3;
|
|
501
|
+
readonly labelId: string;
|
|
502
|
+
readonly testId: string;
|
|
503
|
+
};
|
|
504
|
+
declare const ChatConversationHeading: ({ conversation, actions, level, labelId, testId }: ChatConversationHeadingProps) => react.JSX.Element;
|
|
360
505
|
type ChatConversationListLimits = {
|
|
361
506
|
readonly CHAT_TITLE_SEARCH_PAUSE_MS: number;
|
|
362
507
|
};
|
|
@@ -484,6 +629,64 @@ type ChatNewConversationChoicesProps = {
|
|
|
484
629
|
readonly testId: string;
|
|
485
630
|
};
|
|
486
631
|
declare const ChatNewConversationChoices: ({ choice, phase, testId }: ChatNewConversationChoicesProps) => react.JSX.Element;
|
|
632
|
+
type ChatPolicyOptions = {
|
|
633
|
+
readonly transport: ChatTransport;
|
|
634
|
+
readonly hostRefusalCodes: ChatHostRefusalCodes;
|
|
635
|
+
};
|
|
636
|
+
type ChatPolicyState = {
|
|
637
|
+
readonly kind: "reading";
|
|
638
|
+
} | {
|
|
639
|
+
readonly kind: "consented";
|
|
640
|
+
readonly policy: Extract<ChatPolicy, {
|
|
641
|
+
readonly consent: "current";
|
|
642
|
+
}>;
|
|
643
|
+
} | {
|
|
644
|
+
readonly kind: "consent-needed";
|
|
645
|
+
readonly policy: Exclude<ChatPolicy, {
|
|
646
|
+
readonly consent: "current";
|
|
647
|
+
}>;
|
|
648
|
+
} | {
|
|
649
|
+
readonly kind: "not-published";
|
|
650
|
+
readonly retry: () => void;
|
|
651
|
+
} | {
|
|
652
|
+
readonly kind: "refused";
|
|
653
|
+
readonly refusal: ChatRefusal;
|
|
654
|
+
readonly retry: (() => void) | null;
|
|
655
|
+
} | {
|
|
656
|
+
readonly kind: "failed";
|
|
657
|
+
readonly cause: "unreached" | "incompatible";
|
|
658
|
+
readonly retry: () => void;
|
|
659
|
+
};
|
|
660
|
+
type ChatPolicyConsentProblem = {
|
|
661
|
+
readonly occurrence: number;
|
|
662
|
+
} & ({
|
|
663
|
+
readonly cause: "superseded";
|
|
664
|
+
} | {
|
|
665
|
+
readonly cause: "unreached";
|
|
666
|
+
} | {
|
|
667
|
+
readonly cause: "refused";
|
|
668
|
+
readonly refusal: ChatRefusal;
|
|
669
|
+
} | {
|
|
670
|
+
readonly cause: "incompatible";
|
|
671
|
+
});
|
|
672
|
+
type ChatPolicyConsentOutcome = "consented" | "not-consented";
|
|
673
|
+
type ChatPolicyAccess = {
|
|
674
|
+
readonly state: ChatPolicyState;
|
|
675
|
+
readonly consenting: boolean;
|
|
676
|
+
readonly problem: ChatPolicyConsentProblem | null;
|
|
677
|
+
readonly consent: () => Promise<ChatPolicyConsentOutcome>;
|
|
678
|
+
readonly transport: ChatTransport;
|
|
679
|
+
};
|
|
680
|
+
declare const useChatPolicy: (options: ChatPolicyOptions) => ChatPolicyAccess;
|
|
681
|
+
type ChatPolicyGateProps = {
|
|
682
|
+
readonly policy: ChatPolicyAccess;
|
|
683
|
+
readonly focusAfterConsent: RefObject<HTMLElement | null>;
|
|
684
|
+
readonly aside: ReactNode;
|
|
685
|
+
readonly children: () => ReactNode;
|
|
686
|
+
readonly headingLevel: 1 | 2 | 3;
|
|
687
|
+
readonly testId: string;
|
|
688
|
+
};
|
|
689
|
+
declare const ChatPolicyGate: ({ policy, focusAfterConsent, aside, children, headingLevel, testId }: ChatPolicyGateProps) => ReactNode;
|
|
487
690
|
type ChatSettingsOptions = {
|
|
488
691
|
readonly transport: ChatTransport;
|
|
489
692
|
readonly hostRefusalCodes: ChatHostRefusalCodes;
|
|
@@ -578,22 +781,5 @@ type ChatComposerAttachmentsState = {
|
|
|
578
781
|
};
|
|
579
782
|
declare const useChatComposerAttachments: (options: ChatComposerAttachmentsOptions) => ChatComposerAttachmentsState;
|
|
580
783
|
declare const useChatConversationCreatedAnnouncer: () => (() => void);
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
readonly window: ChatConversationWindow;
|
|
584
|
-
readonly hostRefusalCodes: ChatHostRefusalCodes;
|
|
585
|
-
};
|
|
586
|
-
type ChatSendMessage = {
|
|
587
|
-
readonly text: string;
|
|
588
|
-
readonly attachmentIds: readonly string[];
|
|
589
|
-
};
|
|
590
|
-
type ChatSendOutcome = "accepted" | "not-sent";
|
|
591
|
-
type ChatSend = {
|
|
592
|
-
readonly phase: ChatComposerPhase;
|
|
593
|
-
readonly problem: ChatComposerProblem | null;
|
|
594
|
-
readonly sentMessageUid: string | null;
|
|
595
|
-
readonly send: (message: ChatSendMessage) => Promise<ChatSendOutcome>;
|
|
596
|
-
readonly stop: () => void;
|
|
597
|
-
};
|
|
598
|
-
declare const useChatSend: (options: ChatSendOptions) => ChatSend;
|
|
599
|
-
export { CHAT_LAYOUT, type ChatAnswerRenderLimits, ChatAnswerRendering, type ChatAnswerRenderingProps, type ChatAnswerStatus, type ChatAttachmentLimits, type ChatAttachmentPrecheckRefusal, type ChatChoosableModel, ChatComposer, type ChatComposerAltTextOutcome, type ChatComposerAttachment, type ChatComposerAttachments, type ChatComposerAttachmentsLimits, type ChatComposerAttachmentsOptions, type ChatComposerAttachmentsState, type ChatComposerLimits, type ChatComposerPhase, type ChatComposerProblem, type ChatComposerProps, type ChatComposerRestore, type ChatComposerSaveAltText, ChatConversationGate, type ChatConversationGateProps, ChatConversationList, type ChatConversationListLimits, type ChatConversationListOptions, type ChatConversationListProps, type ChatConversationListState, type ChatConversationListViewLimits, type ChatConversationOptions, type ChatConversationSection, type ChatConversationState, type ChatConversationWindow, type ChatConversionLimits, type ChatConverterTimeouts, type ChatDiagramFileContext, type ChatDiagramFormat, ChatFrame, type ChatFrameProps, type ChatHostRefusalCodes, type ChatLayoutColumn, type ChatLayoutColumns, type ChatLayoutPlan, type ChatLayoutRule, type ChatListMessage, type ChatMarkdownConverterFactory, type ChatMediaRecorderLike, type ChatMediaStreamLike, type ChatMessageAuthor, ChatMessageList, type ChatMessageListLimits, type ChatMessageListProps, type ChatMessageText, type ChatMicrophone, type ChatMicrophoneProblem, type ChatMicrophoneScope, type ChatModelAttachmentFlags, type ChatModels, type ChatModelsOptions, type ChatModelsQuery, type ChatModelsState, type ChatNewConversation, type ChatNewConversationChoice, type ChatNewConversationChoiceOptions, ChatNewConversationChoices, type ChatNewConversationChoicesProps, type ChatNewConversationMessage, type ChatNewConversationOptions, type ChatNewConversationOutcome, type ChatOlderFailure, type ChatPinnedSide, type ChatRecording, type ChatRecordingListener, type ChatRecordingRequest, type ChatRecordingStart, type ChatRefusal, type ChatRefusalStatusClass, type ChatSend, type ChatSendMessage, type ChatSendOptions, type ChatSendOutcome, type ChatSettingsAccess, ChatSettingsForm, type ChatSettingsFormProps, ChatSettingsGate, type ChatSettingsGateProps, type ChatSettingsOptions, type ChatSettingsProblem, type ChatSettingsSaveOutcome, type ChatSettingsState, ChatTalkFlow, type ChatTalkFlowProps, ChatTalkHeading, type ChatTalkHeadingProps, assertValidChatHostRefusalCodes, chatAttachmentHasUnreadText, chatAttachmentsRefusedByModel, chatBrowserMicrophone, chatDeclaredAttachmentKind, chatFilePickerAccept, chatFrameBlockSizePx, chatLayoutPlan, chatLayoutRule, chatModelAttachmentKinds, chatModelTakesKind, chatRefusal, diagramFileName, precheckChatAttachment, useChatComposerAttachments, useChatConversation, useChatConversationCreatedAnnouncer, useChatConversationList, useChatModels, useChatNewConversation, useChatNewConversationChoice, useChatSend, useChatSettings };
|
|
784
|
+
declare const useChatConversationDeletedAnnouncer: () => ((conversation: Pick<ChatConversation, "title">) => void);
|
|
785
|
+
export { CHAT_LAYOUT, type ChatAnswerRenderLimits, ChatAnswerRendering, type ChatAnswerRenderingProps, type ChatAnswerStatus, type ChatAttachmentLimits, type ChatAttachmentPrecheckRefusal, type ChatBranchSwitchOutcome, type ChatBranchSwitchProblem, type ChatBranchSwitchState, type ChatChoosableModel, ChatComposer, type ChatComposerAltTextOutcome, type ChatComposerAttachment, type ChatComposerAttachments, type ChatComposerAttachmentsLimits, type ChatComposerAttachmentsOptions, type ChatComposerAttachmentsState, type ChatComposerLimits, type ChatComposerPhase, type ChatComposerProblem, type ChatComposerProps, type ChatComposerRestore, type ChatComposerSaveAltText, ChatConsentConversation, type ChatConsentConversationProps, type ChatConversationAction, type ChatConversationActionOutcome, type ChatConversationActionPhase, type ChatConversationActionProblem, type ChatConversationActions, type ChatConversationActionsOptions, ChatConversationGate, type ChatConversationGateProps, ChatConversationHeading, type ChatConversationHeadingProps, type ChatConversationLimits, ChatConversationList, type ChatConversationListLimits, type ChatConversationListOptions, type ChatConversationListProps, type ChatConversationListState, type ChatConversationListViewLimits, type ChatConversationOptions, type ChatConversationSection, type ChatConversationState, type ChatConversationWindow, type ChatConversionLimits, type ChatConverterTimeouts, type ChatDiagramFileContext, type ChatDiagramFormat, ChatFrame, type ChatFrameProps, type ChatHostRefusalCodes, type ChatLayoutColumn, type ChatLayoutColumns, type ChatLayoutPlan, type ChatLayoutRule, type ChatListMessage, type ChatMarkdownConverterFactory, type ChatMediaRecorderLike, type ChatMediaStreamLike, type ChatMessageAuthor, type ChatMessageBranch, ChatMessageList, type ChatMessageListLimits, type ChatMessageListProps, type ChatMessageText, type ChatMicrophone, type ChatMicrophoneProblem, type ChatMicrophoneScope, type ChatModelAttachmentFlags, type ChatModels, type ChatModelsOptions, type ChatModelsQuery, type ChatModelsState, type ChatNewConversation, type ChatNewConversationChoice, type ChatNewConversationChoiceOptions, ChatNewConversationChoices, type ChatNewConversationChoicesProps, type ChatNewConversationMessage, type ChatNewConversationOptions, type ChatNewConversationOutcome, type ChatOlderFailure, type ChatPinnedSide, type ChatPolicyAccess, type ChatPolicyConsentOutcome, type ChatPolicyConsentProblem, ChatPolicyGate, type ChatPolicyGateProps, type ChatPolicyOptions, type ChatPolicyState, type ChatRecording, type ChatRecordingListener, type ChatRecordingRequest, type ChatRecordingStart, type ChatRefusal, type ChatRefusalStatusClass, type ChatRewriteKind, type ChatRewriteOutcome, type ChatRewriteProblem, type ChatRewriteState, type ChatSend, type ChatSendMessage, type ChatSendOptions, type ChatSendOutcome, type ChatSettingsAccess, ChatSettingsForm, type ChatSettingsFormProps, ChatSettingsGate, type ChatSettingsGateProps, type ChatSettingsOptions, type ChatSettingsProblem, type ChatSettingsSaveOutcome, type ChatSettingsState, ChatTalkFlow, type ChatTalkFlowProps, ChatTalkHeading, type ChatTalkHeadingProps, assertValidChatHostRefusalCodes, chatAttachmentHasUnreadText, chatAttachmentsRefusedByModel, chatBrowserMicrophone, chatConversationShownRow, chatDeclaredAttachmentKind, chatFilePickerAccept, chatFrameBlockSizePx, chatLayoutPlan, chatLayoutRule, chatModelAttachmentKinds, chatModelTakesKind, chatRefusal, diagramFileName, precheckChatAttachment, useChatComposerAttachments, useChatConversation, useChatConversationActions, useChatConversationCreatedAnnouncer, useChatConversationDeletedAnnouncer, useChatConversationList, useChatModels, useChatNewConversation, useChatNewConversationChoice, useChatPolicy, useChatSend, useChatSettings };
|