@collective-intelligence/ai 0.0.0-placeholder.0 → 0.7.1

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.
Files changed (172) hide show
  1. package/AGENTS.md +52 -0
  2. package/README.md +463 -1
  3. package/dist/api/access-check.d.ts +18 -0
  4. package/dist/api/answer-sources.d.ts +48 -0
  5. package/dist/api/attachments-api.d.ts +187 -0
  6. package/dist/api/catalog-api.d.ts +408 -0
  7. package/dist/api/chat-api.d.ts +2401 -0
  8. package/dist/api/chat-surface-api.d.ts +4186 -0
  9. package/dist/api/compaction.d.ts +52 -0
  10. package/dist/api/conversations.d.ts +107 -0
  11. package/dist/api/errors.d.ts +117 -0
  12. package/dist/api/feedback-api.d.ts +185 -0
  13. package/dist/api/files.d.ts +22 -0
  14. package/dist/api/ids.d.ts +33 -0
  15. package/dist/api/index.d.ts +21 -0
  16. package/dist/api/intents-api.d.ts +65 -0
  17. package/dist/api/place-context.d.ts +34 -0
  18. package/dist/api/projects-api.d.ts +718 -0
  19. package/dist/api/speech-api.d.ts +345 -0
  20. package/dist/api/transcript.d.ts +260 -0
  21. package/dist/api/turns.d.ts +196 -0
  22. package/dist/api.d.ts +21 -0
  23. package/dist/api.js +1 -0
  24. package/dist/domain/access.d.ts +29 -0
  25. package/dist/domain/context-trail.d.ts +65 -0
  26. package/dist/domain/data-parts.d.ts +247 -0
  27. package/dist/domain/errors.d.ts +28 -0
  28. package/dist/domain/index.d.ts +14 -0
  29. package/dist/domain/intents.d.ts +101 -0
  30. package/dist/domain/message.d.ts +173 -0
  31. package/dist/domain/place.d.ts +17 -0
  32. package/dist/domain/runtime-value.d.ts +16 -0
  33. package/dist/domain-50vzrrp9.js +2 -0
  34. package/dist/domain-5fpd4fte.js +1 -0
  35. package/dist/domain-9wzbv87n.js +2 -0
  36. package/dist/domain-g97xs965.js +2 -0
  37. package/dist/domain-hk3yw2m7.js +1 -0
  38. package/dist/domain-qyts6dgz.js +0 -0
  39. package/dist/domain-s07s1ry1.js +2 -0
  40. package/dist/domain.d.ts +14 -0
  41. package/dist/domain.js +1 -0
  42. package/dist/headless/access/access-store.d.ts +28 -0
  43. package/dist/headless/access/visibility.d.ts +24 -0
  44. package/dist/headless/blocked-state.d.ts +21 -0
  45. package/dist/headless/chat-registry.d.ts +63 -0
  46. package/dist/headless/chat-session-provider.d.ts +109 -0
  47. package/dist/headless/chat-surface.d.ts +4210 -0
  48. package/dist/headless/host-ports.d.ts +146 -0
  49. package/dist/headless/index.d.ts +33 -0
  50. package/dist/headless/intents/card-ends.d.ts +22 -0
  51. package/dist/headless/intents/intent-call.d.ts +28 -0
  52. package/dist/headless/intents/intents-provider.d.ts +108 -0
  53. package/dist/headless/intents/page-registry.d.ts +129 -0
  54. package/dist/headless/intents/use-intent-dispatch.d.ts +60 -0
  55. package/dist/headless/intents/use-intents.d.ts +11 -0
  56. package/dist/headless/intents/use-returned-intent-handle.d.ts +11 -0
  57. package/dist/headless/launch/chat-launch.d.ts +42 -0
  58. package/dist/headless/launch/launch-target.d.ts +25 -0
  59. package/dist/headless/launch/submit.d.ts +29 -0
  60. package/dist/headless/run-state.d.ts +16 -0
  61. package/dist/headless/sent-files.d.ts +20 -0
  62. package/dist/headless/server-started-turn-follow.proof.d.ts +26 -0
  63. package/dist/headless/session-machine.d.ts +745 -0
  64. package/dist/headless/trail/buffer.d.ts +48 -0
  65. package/dist/headless/trail/json-ld.d.ts +10 -0
  66. package/dist/headless/trail/switches.d.ts +10 -0
  67. package/dist/headless/trail/trail-provider.d.ts +53 -0
  68. package/dist/headless/transcript-messages.d.ts +26 -0
  69. package/dist/headless.d.ts +33 -0
  70. package/dist/headless.js +2 -0
  71. package/dist/transport/chat-client.d.ts +25 -0
  72. package/dist/transport/chat-transport.d.ts +57 -0
  73. package/dist/transport/index.d.ts +6 -0
  74. package/dist/transport/simulated-chat-transport.d.ts +39 -0
  75. package/dist/transport.d.ts +6 -0
  76. package/dist/transport.js +1 -0
  77. package/dist/views/assistant-sidebar/assistant-sidebar.d.ts +15 -0
  78. package/dist/views/assistant-sidebar/layout.d.ts +47 -0
  79. package/dist/views/assistant-sidebar/toggle.d.ts +14 -0
  80. package/dist/views/assistant-sidebar/use-shortcut.d.ts +11 -0
  81. package/dist/views/blocked/chat-blocked-state.d.ts +15 -0
  82. package/dist/views/chat-operations.d.ts +46 -0
  83. package/dist/views/chat-root.d.ts +14 -0
  84. package/dist/views/chat.d.ts +51 -0
  85. package/dist/views/composer/capability-picker.d.ts +77 -0
  86. package/dist/views/composer/capability-pickers.d.ts +24 -0
  87. package/dist/views/composer/chat-composer.d.ts +15 -0
  88. package/dist/views/composer/composer-picks.d.ts +31 -0
  89. package/dist/views/composer/composer-trail.d.ts +21 -0
  90. package/dist/views/composer/draft-attachments.d.ts +36 -0
  91. package/dist/views/composer/queued-messages.d.ts +9 -0
  92. package/dist/views/composer/send-menu.d.ts +11 -0
  93. package/dist/views/composer/slash-suggestions.d.ts +37 -0
  94. package/dist/views/composer/trail-chips.d.ts +15 -0
  95. package/dist/views/composer/voice-input/microphone.d.ts +14 -0
  96. package/dist/views/composer/voice-input/remote-transcription.d.ts +12 -0
  97. package/dist/views/composer/voice-input/use-voice-input.d.ts +30 -0
  98. package/dist/views/composer/voice-input/voice-input.d.ts +15 -0
  99. package/dist/views/dock/chat-dock.d.ts +57 -0
  100. package/dist/views/dock/dock-session.d.ts +22 -0
  101. package/dist/views/header/chat-header.d.ts +10 -0
  102. package/dist/views/header/compaction-controls.d.ts +17 -0
  103. package/dist/views/header/memory-switch.d.ts +16 -0
  104. package/dist/views/index.d.ts +58 -0
  105. package/dist/views/intents/form-fields.d.ts +38 -0
  106. package/dist/views/intents/intent-card.d.ts +61 -0
  107. package/dist/views/intents/intent-form.d.ts +23 -0
  108. package/dist/views/intents/intent-notices.d.ts +39 -0
  109. package/dist/views/intents/intent-trigger.d.ts +46 -0
  110. package/dist/views/intents/labels.d.ts +23 -0
  111. package/dist/views/labels/en.d.ts +3 -0
  112. package/dist/views/labels/index.d.ts +13 -0
  113. package/dist/views/labels/it.d.ts +3 -0
  114. package/dist/views/labels/types.d.ts +7 -0
  115. package/dist/views/launch/chat-launch-button.d.ts +21 -0
  116. package/dist/views/parts/answer-feedback.d.ts +26 -0
  117. package/dist/views/parts/evidence-part.d.ts +8 -0
  118. package/dist/views/parts/file-part.d.ts +8 -0
  119. package/dist/views/parts/image-generation-part.d.ts +9 -0
  120. package/dist/views/parts/image-generation.d.ts +84 -0
  121. package/dist/views/parts/intent-card-part.d.ts +8 -0
  122. package/dist/views/parts/memory-evidence-part.d.ts +7 -0
  123. package/dist/views/parts/message-parts.d.ts +21 -0
  124. package/dist/views/parts/question-part.d.ts +8 -0
  125. package/dist/views/parts/read-aloud.d.ts +23 -0
  126. package/dist/views/parts/reasoning-part.d.ts +8 -0
  127. package/dist/views/parts/steering-message-part.d.ts +7 -0
  128. package/dist/views/parts/text-part.d.ts +4 -0
  129. package/dist/views/parts/tool-part.d.ts +11 -0
  130. package/dist/views/parts/types.d.ts +103 -0
  131. package/dist/views/parts/use-read-aloud.d.ts +13 -0
  132. package/dist/views/run-trace/message-run.d.ts +17 -0
  133. package/dist/views/run-trace/run-stream.d.ts +128 -0
  134. package/dist/views/run-trace/run-trace-parts.d.ts +26 -0
  135. package/dist/views/run-trace/run-trace.d.ts +31 -0
  136. package/dist/views/sidebar/conversation-dialogs.d.ts +38 -0
  137. package/dist/views/sidebar/conversation-row.d.ts +23 -0
  138. package/dist/views/sidebar/conversation-sidebar.d.ts +10 -0
  139. package/dist/views/sidebar/date-groups.d.ts +12 -0
  140. package/dist/views/sidebar/history-filter.d.ts +57 -0
  141. package/dist/views/sidebar/projects/project-dialogs.d.ts +40 -0
  142. package/dist/views/sidebar/projects/project-files.d.ts +16 -0
  143. package/dist/views/sidebar/projects/project-groups.d.ts +19 -0
  144. package/dist/views/sidebar/projects/project-view.d.ts +21 -0
  145. package/dist/views/sidebar/projects/projects-section.d.ts +21 -0
  146. package/dist/views/sidebar/projects/use-chat-projects.d.ts +32 -0
  147. package/dist/views/slots.d.ts +148 -0
  148. package/dist/views/transcript/chat-transcript.d.ts +13 -0
  149. package/dist/views/transcript/sent-trail.d.ts +13 -0
  150. package/dist/views/transcript/use-image-reload.d.ts +16 -0
  151. package/dist/views.d.ts +58 -0
  152. package/dist/views.js +3 -0
  153. package/docs/guide/ai/index.md +377 -0
  154. package/docs/guide/ai/studio.md +245 -0
  155. package/docs/guide/data/connectors.md +267 -0
  156. package/docs/guide/data/datasets.md +145 -0
  157. package/docs/guide/data/documents.md +235 -0
  158. package/docs/guide/data/index.md +62 -0
  159. package/docs/guide/data/knowledge.md +214 -0
  160. package/docs/guide/develop/extensions.md +299 -0
  161. package/docs/guide/develop/external-apps.md +279 -0
  162. package/docs/guide/develop/infrastructure.md +135 -0
  163. package/docs/guide/develop/sdks.md +233 -0
  164. package/docs/guide/index.md +83 -0
  165. package/docs/guide/platform/access.md +311 -0
  166. package/docs/guide/platform/architecture.md +166 -0
  167. package/docs/guide/platform/built-ins.md +225 -0
  168. package/docs/guide/platform/entrypoints.md +318 -0
  169. package/docs/guide/scenarios/index.md +130 -0
  170. package/docs/guide/template/index.md +295 -0
  171. package/docs/guide/template/state-machines.md +294 -0
  172. package/package.json +120 -4
@@ -0,0 +1,61 @@
1
+ import type { IntentHandle, IntentResult } from "../../domain/index.js";
2
+ /** The state of the Dispatch Record of an Intent card, as the transcript read joins it. */
3
+ export type IntentCardState = {
4
+ readonly kind: "completed";
5
+ readonly result: IntentResult;
6
+ } | {
7
+ readonly kind: "ended";
8
+ } | {
9
+ readonly kind: "failed";
10
+ readonly reason: string;
11
+ } | {
12
+ readonly kind: "running";
13
+ };
14
+ /** One Intent card: a `dispatch_intent` call, or a Launched Intent, joined to its Dispatch Record. */
15
+ export interface IntentCardData {
16
+ /** The display name of the Intent; the FQN shows without it. */
17
+ readonly displayName?: string | undefined;
18
+ readonly fqn: string;
19
+ readonly handle: IntentHandle;
20
+ readonly state: IntentCardState;
21
+ }
22
+ /** The texts of an Intent card; an app passes its own for another language. */
23
+ export interface IntentCardLabels {
24
+ readonly completed: string;
25
+ /** A record that the caller can no longer read. */
26
+ readonly ended: string;
27
+ readonly failed: string;
28
+ /** The title, with `{name}` for the Intent name. */
29
+ readonly title: string;
30
+ readonly working: string;
31
+ }
32
+ export declare const intentCardLabels: {
33
+ readonly en: {
34
+ readonly completed: "Completed";
35
+ readonly ended: "Result no longer available";
36
+ readonly failed: "Failed";
37
+ readonly title: "Intent {name}";
38
+ readonly working: "Working";
39
+ };
40
+ readonly it: {
41
+ readonly completed: "Completato";
42
+ readonly ended: "Risultato non più disponibile";
43
+ readonly failed: "Non riuscito";
44
+ readonly title: "Intent {name}";
45
+ readonly working: "In corso";
46
+ };
47
+ };
48
+ export interface IntentCardProps {
49
+ readonly card: IntentCardData;
50
+ readonly className?: string | undefined;
51
+ readonly labels?: Partial<IntentCardLabels> | undefined;
52
+ /** The language of the card; `en` when not set. */
53
+ readonly locale?: keyof typeof intentCardLabels | undefined;
54
+ }
55
+ /**
56
+ * The Intent card renderer (ARC-013): the Intent by its display name, else
57
+ * its FQN; working while its Dispatch Record holds no end, then the Intent
58
+ * Result or the failure reason. Every transcript read brings the state, so
59
+ * the card holds none.
60
+ */
61
+ export declare const IntentCard: ({ card, className, labels: custom, locale }: IntentCardProps) => import("react").JSX.Element;
@@ -0,0 +1,23 @@
1
+ import type { IntentFieldProblem } from "../../domain/index.js";
2
+ import type { IntentInputs } from "../../headless/index.js";
3
+ import type { IntentLabels } from "./labels.js";
4
+ export interface IntentFormProps {
5
+ readonly className?: string;
6
+ readonly disabled?: boolean;
7
+ readonly fqn: string;
8
+ readonly labels?: Partial<IntentLabels>;
9
+ /** Gets the inputs of the form when the user sends it. */
10
+ readonly onSubmit: (inputs: IntentInputs) => void;
11
+ /** The fields that the Input Gate refused, from a `needs_input` outcome. */
12
+ readonly problems?: readonly IntentFieldProblem[];
13
+ /** The inputs that the form starts with. */
14
+ readonly values?: IntentInputs;
15
+ }
16
+ /**
17
+ * The input form of an Intent, built from its input schema: flat fields
18
+ * (text, number, boolean, choice, date) and a JSON field for nested values.
19
+ * It marks each `missing` and `invalid` field of a `needs_input` outcome.
20
+ * Without an `intents` transport, or for an Intent that the user may not
21
+ * trigger, it renders nothing.
22
+ */
23
+ export declare const IntentForm: ({ fqn, ...props }: IntentFormProps) => import("react").JSX.Element | null;
@@ -0,0 +1,39 @@
1
+ /** The texts of the in-page Intent notices. */
2
+ export interface IntentNoticeLabels {
3
+ readonly dismiss: string;
4
+ /** A run that completed. */
5
+ readonly done: string;
6
+ /** A run that failed, before its reason. */
7
+ readonly failed: string;
8
+ /** The name of the region that holds the notices. */
9
+ readonly region: string;
10
+ }
11
+ /** The texts of the in-page Intent notices in each language that the package ships. */
12
+ export declare const intentNoticeLabels: {
13
+ readonly en: {
14
+ readonly dismiss: "Dismiss";
15
+ readonly done: "Done";
16
+ readonly failed: "Failed";
17
+ readonly region: "Intent results";
18
+ };
19
+ readonly it: {
20
+ readonly dismiss: "Chiudi";
21
+ readonly done: "Completato";
22
+ readonly failed: "Non riuscito";
23
+ readonly region: "Risultati degli Intent";
24
+ };
25
+ };
26
+ /** A language of the in-page Intent notices. */
27
+ export type IntentNoticeLocale = keyof typeof intentNoticeLabels;
28
+ export interface IntentNoticesProps {
29
+ /** Texts that replace the texts of the locale. */
30
+ readonly labels?: Partial<IntentNoticeLabels> | undefined;
31
+ /** The language of the notices; `en` when not set. */
32
+ readonly locale?: IntentNoticeLocale | undefined;
33
+ }
34
+ /**
35
+ * The in-page notices of the notification dispatches that ended, on any
36
+ * page of the app: the Intent name, and Done or Failed with the failure
37
+ * reason. Render it once inside `IntentsProvider`.
38
+ */
39
+ export declare const IntentNotices: ({ labels: custom, locale }: IntentNoticesProps) => import("react").JSX.Element | null;
@@ -0,0 +1,46 @@
1
+ import type { ReactNode } from "react";
2
+ import type { IntentResult, IntentResultTarget } from "../../domain/index.js";
3
+ import type { IntentDispatchOptions, IntentInputs } from "../../headless/index.js";
4
+ import type { IntentLabels } from "./labels.js";
5
+ /** The props of every trigger, whatever its Result Target. */
6
+ type TriggerProps = Readonly<{
7
+ /** The content of the button; the display name of the Intent without it. */
8
+ children?: ReactNode;
9
+ className?: string;
10
+ fqn: string;
11
+ /** The inputs that the page already has. */
12
+ inputs?: IntentInputs;
13
+ labels?: Partial<IntentLabels>;
14
+ }>;
15
+ /** A trigger that dispatches the Intent itself. */
16
+ type DispatchTriggerProps = TriggerProps & IntentDispatchOptions & Readonly<{
17
+ /** Gets the Intent Result when the Intent completes. */
18
+ onResult?: (result: IntentResult) => void;
19
+ /**
20
+ * Shows the Intent Result when the Intent completes: the trigger has no
21
+ * result view of its own.
22
+ */
23
+ render?: (result: IntentResult) => ReactNode;
24
+ }>;
25
+ /**
26
+ * A trigger with the chat Result Target: it makes a Chat Launch, and the
27
+ * chat dispatches the Intent and shows its result. The Intent Result reaches
28
+ * the page only through `useIntentResult`.
29
+ */
30
+ type LaunchTriggerProps = TriggerProps & Readonly<{
31
+ onResult?: never;
32
+ render?: never;
33
+ resultTarget: Extract<IntentResultTarget, "chat">;
34
+ }>;
35
+ export type IntentTriggerProps = DispatchTriggerProps | LaunchTriggerProps;
36
+ /**
37
+ * A button that dispatches one Intent and shows only its states: ready,
38
+ * working, the input form on `needs_input`, done and failed. It gives the
39
+ * Intent Result to the app through `onResult` or `render`. With the chat
40
+ * Result Target it dispatches nothing: it makes a Chat Launch with the
41
+ * Intent and its inputs, and the chat dispatches it, asks for missing
42
+ * inputs and shows the result. Without an `IntentsApi` on `IntentsProvider` it
43
+ * renders nothing; it needs no chat.
44
+ */
45
+ export declare const IntentTrigger: (props: IntentTriggerProps) => import("react").JSX.Element;
46
+ export {};
@@ -0,0 +1,23 @@
1
+ /** The texts of the Intent controls; an app passes its own for another language. */
2
+ export interface IntentLabels {
3
+ /** The empty choice of a choice field. */
4
+ readonly choose: string;
5
+ /** An Async Intent that started its run. */
6
+ readonly dispatched: string;
7
+ /** A completed Intent when no `render` shows its result. */
8
+ readonly done: string;
9
+ readonly failed: string;
10
+ /** The mark of a field that the Input Gate refused for another rule. */
11
+ readonly invalid: string;
12
+ /** The mark of a JSON field whose text is not JSON. */
13
+ readonly invalidJson: string;
14
+ /** The mark of a field that the Input Gate found missing. */
15
+ readonly missing: string;
16
+ /** Why a trigger with the chat Result Target is disabled: no chat on the page takes the launch. */
17
+ readonly noChat: string;
18
+ readonly notAllowed: string;
19
+ /** The submit button of the input form. */
20
+ readonly submit: string;
21
+ readonly working: string;
22
+ }
23
+ export declare const defaultIntentLabels: IntentLabels;
@@ -0,0 +1,3 @@
1
+ import type { ChatLabels } from "./types.js";
2
+ /** The English labels of the default chat. */
3
+ export declare const en: ChatLabels;
@@ -0,0 +1,13 @@
1
+ import type { ChatLabels } from "./types.js";
2
+ export type { ChatLabelKey, ChatLabels } from "./types.js";
3
+ /** The labels of the default chat in each language that it ships (AC-199). */
4
+ export declare const chatLabels: {
5
+ readonly en: Readonly<Record<import("./types.js").ChatLabelKey, string>>;
6
+ readonly it: Readonly<Record<import("./types.js").ChatLabelKey, string>>;
7
+ };
8
+ /** A language of the default chat. */
9
+ export type ChatLocale = keyof typeof chatLabels;
10
+ /** The labels of `locale`, each one that `overrides` holds replaced (AC-200). */
11
+ export declare const labelsOf: (locale: ChatLocale, overrides: Partial<ChatLabels> | undefined) => ChatLabels;
12
+ /** A label with each `{name}` placeholder replaced by the value of `name` (AC-201). */
13
+ export declare const fillLabel: (label: string, values: Readonly<Partial<Record<string, string>>>) => string;
@@ -0,0 +1,3 @@
1
+ import type { ChatLabels } from "./types.js";
2
+ /** The Italian labels of the default chat. */
3
+ export declare const it: ChatLabels;
@@ -0,0 +1,7 @@
1
+ /** The name of each text that the default chat shows. */
2
+ export type ChatLabelKey = "actionFailed" | "addProjectFiles" | "agent" | "agentConversationNoProjectContext" | "agentRefreshFailed" | "agentTurnBlocked" | "agentTurnBlockedWithReason" | "agentTurnCancelled" | "agentTurnFailed" | "agentTurnNoReply" | "agentTurnPaused" | "agentTurnWorking" | "allListedPlaces" | "appNotAvailable" | "appNotAvailableDescription" | "approvalApprove" | "approvalApproving" | "approvalComment" | "approvalCommentPlaceholder" | "approvalConfirmReject" | "approvalDecideHint" | "approvalDecision" | "approvalDecisionApproved" | "approvalDecisionRejected" | "approvalDecisions" | "approvalEligibleDirect" | "approvalEligibleGroup" | "approvalExpires" | "approvalLoadFailed" | "approvalModeAll" | "approvalModeAny" | "approvalOutcomeAlreadyApproved" | "approvalOutcomeAlreadyDecided" | "approvalOutcomeContinuationFailed" | "approvalOutcomeContinuationInProgress" | "approvalOutcomeReconciliationRequired" | "approvalOutcomeRecorded" | "approvalReadOnly" | "approvalReadOnlyHint" | "approvalReject" | "approvalRejectReason" | "approvalRejectReasonPlaceholder" | "approvalResolution" | "approvalStatusApproved" | "approvalStatusCancelled" | "approvalStatusExpired" | "approvalStatusPending" | "approvalStatusRejected" | "approvalStepProgress" | "approvalSteps" | "approvalTitle" | "artifactCurrent" | "artifactFailed" | "artifactFiles" | "artifactLeased" | "artifactPending" | "artifactProcessed" | "artifactSkipped" | "assistant" | "assistantSidebarCollapse" | "assistantSidebarDelete" | "assistantSidebarDeleteTitle" | "assistantSidebarToggle" | "attach" | "attachmentDownload" | "attachmentDownloadFile" | "attachmentDownloading" | "attachmentNotAttached" | "attachmentOversized" | "attachmentPreview" | "attachmentPreviewDescription" | "attachmentRemove" | "attachmentTooManyFiles" | "attachmentUnsupported" | "attachmentsNotAttached" | "cancel" | "chatNotAvailable" | "chatNotAvailableDescription" | "clearAgent" | "clearSearch" | "clearSkills" | "clearTools" | "compact" | "compacted" | "compactedContext" | "compactedContextDescription" | "compactionCoveredMessages" | "compactionCoveredRuns" | "compactionFailed" | "compactionMarker" | "compactionMessages" | "compactionNotChanged" | "compactionRuns" | "compactionStatus" | "composerDrop" | "composerInput" | "composerPlaceholder" | "contextUsage" | "conversationActions" | "conversationNotMoved" | "conversationTitle" | "conversations" | "conversationsDescription" | "conversationsNotLoaded" | "createProject" | "delete" | "deleteConversation" | "deleteConversationDescription" | "deleteProject" | "deleteProjectDescription" | "deleteProjectFile" | "deleteProjectTitle" | "downloadProjectFile" | "draft" | "earlier" | "editQueuedMessage" | "emptyDescription" | "emptyTitle" | "evidenceContradiction" | "evidenceEmpty" | "evidenceLinks" | "evidenceOmitted" | "evidenceOpen" | "evidenceOpenSource" | "evidenceOpening" | "evidenceRelevance" | "evidenceShowMore" | "evidenceSources" | "evidenceUnavailable" | "evidenceWarnings" | "feedbackGroup" | "feedbackNegative" | "feedbackNote" | "feedbackNoteDescription" | "feedbackNoteTitle" | "feedbackPositive" | "feedbackSaving" | "feedbackSubmit" | "fileDownload" | "fileOpen" | "filePreview" | "filePreviewDescription" | "historyFilter" | "imageActualCost" | "imageAspectRatio" | "imageBackground" | "imageCost" | "imageCostSource" | "imageCostUnavailable" | "imageCount" | "imageDeployment" | "imageDetailsUnavailable" | "imageEstimatedCost" | "imageFormat" | "imageModel" | "imageModelVersion" | "imageProvider" | "imageProviderConfigured" | "imageProviderModel" | "imageQuality" | "imageReferenceImages" | "imageResolution" | "imageStatusAttentionRequired" | "imageStatusCancelled" | "imageStatusCompleted" | "imageStatusFailed" | "imageStatusPartial" | "imageStatusPending" | "imageStatusRunning" | "imageTitle" | "intentApprovalInputs" | "intentApprovalTitle" | "intentCardCompleted" | "intentCardEnded" | "intentCardFailed" | "intentCardTitle" | "intentCardWorking" | "launchIntoAgentConversation" | "launchIntoBusyConversation" | "loading" | "memoryCreated" | "memoryDisabled" | "memoryMerged" | "memoryNotChanged" | "memoryOff" | "memoryOn" | "memoryRetrieved" | "memorySaved" | "memorySelected" | "memorySkipped" | "memorySuggested" | "memorySuperseded" | "memoryTitle" | "memoryUsed" | "memoryUsedEvent" | "moveToProject" | "multipleSkills" | "multipleTools" | "newChat" | "newProject" | "noAgents" | "noChat" | "noCompactionSummary" | "noConversations" | "noConversationsDescription" | "noProjectFiles" | "noProjectFilesDescription" | "noProjects" | "noSearchResults" | "noSkills" | "noTools" | "openConversation" | "openConversationList" | "openProject" | "optionsError" | "permissionAllowAlways" | "permissionAllowThisConversation" | "permissionDeny" | "permissionDescription" | "permissionRegion" | "permissionSkill" | "permissionTitle" | "permissionTool" | "personalAgent" | "pickAgent" | "previousSevenDays" | "projectActions" | "projectConversations" | "projectConversationsToggle" | "projectDescription" | "projectFileFailed" | "projectFileFailedHelp" | "projectFileInContext" | "projectFileNotAdded" | "projectFileNotDeleted" | "projectFileNotDownloaded" | "projectFileNotInContext" | "projectFileNotInContextHelp" | "projectFileRejectedMalformed" | "projectFileRejectedOversized" | "projectFileRejectedTooManyFiles" | "projectFileRejectedUnsupported" | "projectFileTruncated" | "projectFileTruncatedHelp" | "projectFiles" | "projectFilesFull" | "projectFilesHelp" | "projectFilesNotAdded" | "projectFilesNotLoaded" | "projectFilesUsage" | "projectFilesUsageValue" | "projectInstructions" | "projectInstructionsHelp" | "projectInstructionsNotSaved" | "projectInstructionsTooLong" | "projectName" | "projectNameHelp" | "projectNoConversations" | "projectNoConversationsDescription" | "projectNotDeleted" | "projectNotSaved" | "projects" | "projectsNotLoaded" | "questionAnswer" | "questionApprovalCompleted" | "questionApprove" | "questionCancelled" | "questionCompleted" | "questionConfirmHint" | "questionConfirmTitle" | "questionContinue" | "questionFailed" | "questionOtherAnswer" | "questionOtherOption" | "questionPreview" | "questionResponding" | "questionRevise" | "questionReviseLabel" | "questionTextAnswer" | "questionTextPlaceholder" | "questionTool" | "queuedMessageNotRemoved" | "queuedMessages" | "readAloud" | "readAloudFailed" | "readAloudStop" | "reasoning" | "refreshConversation" | "regenerate" | "removeFromProject" | "removeQueuedMessage" | "rename" | "renameConversation" | "renameConversationDescription" | "renameProject" | "reset" | "retry" | "runApprovalNeeded" | "runCardDetail" | "runCardStatus" | "runCardTitle" | "runCardTraceLink" | "runInputNeeded" | "runOutputPending" | "runPermissionNeeded" | "runProcessedCount" | "runProgressLost" | "runRequestsWaiting" | "runReserved" | "runStatusActive" | "runStatusAnswerReceived" | "runStatusCompleted" | "runStatusFailed" | "runStatusNeedsInput" | "runStatusResponseFailed" | "runStatusStopped" | "runStatusWaitingForApproval" | "runTerminal" | "save" | "searchAgents" | "searchConversations" | "searchSkills" | "searchTools" | "selectAgent" | "selectSkills" | "selectTools" | "selectedSkills" | "send" | "sendAfterThisAnswer" | "sendFailed" | "sendOptions" | "serviceNotAvailable" | "serviceNotAvailableDescription" | "signInToChat" | "signInToChatDescription" | "skillOwnModeNotice" | "skills" | "steeringMessageSent" | "stepAccepted" | "stepApproval" | "stepCommand" | "stepCommandFallback" | "stepCompacted" | "stepCompacting" | "stepCompactionFailed" | "stepCompactionReused" | "stepDone" | "stepDuration" | "stepFile" | "stepFileFallback" | "stepInput" | "stepModel" | "stepPermission" | "stepRun" | "stepRunFailed" | "stepSkill" | "stepSkillFallback" | "stepTool" | "stepToolFallback" | "stepUpdated" | "stepsSummary" | "stepsSummaryFailed" | "stop" | "stopFailed" | "submitting" | "thisPlace" | "today" | "tools" | "trailChips" | "trailEvent" | "trailNotice" | "trailPage" | "trailRemove" | "trailSent" | "transcriptError" | "transcriptErrorDescription" | "unknownPlace" | "voiceInput" | "voiceInputFailed" | "voiceInputStop" | "voiceInputTimeLimit" | "voiceInputTooLong" | "voiceInputTranscribing" | "working" | "yesterday" | "you";
3
+ /**
4
+ * Every text of the default chat. A `{name}` placeholder in a label shows the
5
+ * value of `name`, for example `{title}` the Conversation title.
6
+ */
7
+ export type ChatLabels = Readonly<Record<ChatLabelKey, string>>;
@@ -0,0 +1,21 @@
1
+ import type { ReactNode } from "react";
2
+ import type { PreparedTurn } from "../../domain/index.js";
3
+ import type { ChatLaunchOptions } from "../../headless/index.js";
4
+ import type { ChatLabels, ChatLocale } from "../labels/index.js";
5
+ export type ChatLaunchButtonProps = ChatLaunchOptions & Readonly<{
6
+ children: ReactNode;
7
+ className?: string | undefined;
8
+ /** Labels that replace the labels of the locale; the button reads `noChat`. */
9
+ labels?: Partial<ChatLabels> | undefined;
10
+ /** The language of the labels; `en` when not set. */
11
+ locale?: ChatLocale | undefined;
12
+ /** The turn that the button sends to the shared chat. */
13
+ turn: PreparedTurn;
14
+ }>;
15
+ /**
16
+ * A button that opens the shared chat with a Prepared Turn (#632 AC-161):
17
+ * "Do that via AI" with an Intent, a message or a Skill, or "Ask AI about
18
+ * this" with `prefill`. It makes a Chat Launch through `useLaunch`, and is
19
+ * disabled, with its reason, while no Launch Target exists.
20
+ */
21
+ export declare const ChatLaunchButton: ({ children, className, labels, locale, turn, ...options }: ChatLaunchButtonProps) => import("react").JSX.Element;
@@ -0,0 +1,26 @@
1
+ import type { ComponentType } from "react";
2
+ import type { InvocationId } from "../../api/index.js";
3
+ import type { CiUIMessage } from "../../domain/index.js";
4
+ import type { ChatLabels } from "../labels/index.js";
5
+ import type { ChatAnswerFeedbackProps } from "./types.js";
6
+ /** What the default answer feedback control takes: the part props without the answer. */
7
+ export type ChatAnswerFeedbackControlProps = Omit<ChatAnswerFeedbackProps, "message"> & Readonly<{
8
+ className?: string | undefined;
9
+ }>;
10
+ /**
11
+ * The default answer feedback control (AC-088): thumbs up rates the answer
12
+ * helpful; thumbs down asks for a note first, and the note is required. A
13
+ * second press on the chosen rating clears it.
14
+ */
15
+ export declare const ChatAnswerFeedback: ({ className, clear, error, labels, pending, submit, value }: ChatAnswerFeedbackControlProps) => import("react").JSX.Element;
16
+ /**
17
+ * The answer feedback of one finished answer that the user can rate. The
18
+ * `AnswerFeedback` part component replaces the control; the chat keeps the
19
+ * saves.
20
+ */
21
+ export declare const AnswerFeedback: ({ Control, invocationId, labels, message }: Readonly<{
22
+ Control: ComponentType<ChatAnswerFeedbackProps>;
23
+ invocationId: InvocationId;
24
+ labels: ChatLabels;
25
+ message: CiUIMessage;
26
+ }>) => import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import type { Evidence } from "../../domain/index.js";
2
+ import type { ChatMessagePartProps } from "./types.js";
3
+ /**
4
+ * A `data-evidence` part: the evidence of one tool result as a table,
5
+ * sources, links, a summary, warnings, JSON or images. Only `http` and
6
+ * `https` URLs are linked or shown.
7
+ */
8
+ export declare const EvidencePart: ({ labels, part }: ChatMessagePartProps<Evidence>) => import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import type { FileUIPart } from "ai";
2
+ import type { ChatMessagePartProps } from "./types.js";
3
+ /**
4
+ * A file of a message, such as a chat attachment that the user sent: an
5
+ * image with its preview, any other file, or an image without a URL (storage
6
+ * removed it), as a chip with its name.
7
+ */
8
+ export declare const FilePart: ({ part }: ChatMessagePartProps<FileUIPart>) => import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import type { ImageGeneration } from "./image-generation.js";
2
+ import type { ChatMessagePartProps } from "./types.js";
3
+ /**
4
+ * The image generation of an answer (AC-090): its state, its error, the
5
+ * generated images with the caller's media URLs and the public facts of its
6
+ * provider, controls and cost. While the job runs it shows its state only;
7
+ * the chat reads the messages again until the images arrive.
8
+ */
9
+ export declare const ImageGenerationPart: ({ labels, part }: ChatMessagePartProps<ImageGeneration>) => import("react").JSX.Element;
@@ -0,0 +1,84 @@
1
+ import * as Option from "effect/Option";
2
+ import * as Schema from "effect/Schema";
3
+ import type { CiUIMessage } from "../../domain/index.js";
4
+ import type { ChatLabels } from "../labels/index.js";
5
+ import type { ChatToolPart } from "./types.js";
6
+ declare const imageStatuses: readonly ["attention_required", "cancelled", "completed", "failed", "partial", "pending", "running"];
7
+ /** The state of an image generation job. */
8
+ export type ImageStatus = (typeof imageStatuses)[number];
9
+ /** A generated image as the server publishes it: a managed file with the caller's media URL. */
10
+ declare const ImageFileSchema: Schema.Struct<{
11
+ readonly filename: Schema.String;
12
+ readonly id: Schema.String;
13
+ readonly mimeType: Schema.String;
14
+ readonly source: Schema.Literal<"managed">;
15
+ readonly url: Schema.String;
16
+ }>;
17
+ export type ImageFile = typeof ImageFileSchema.Type;
18
+ /** The provider and model that made the images. */
19
+ declare const ImageProvenanceSchema: Schema.Struct<{
20
+ readonly deploymentName: Schema.optionalKey<Schema.NullOr<Schema.String>>;
21
+ readonly modelName: Schema.String;
22
+ readonly modelVersion: Schema.optionalKey<Schema.NullOr<Schema.String>>;
23
+ readonly providerRoute: Schema.String;
24
+ readonly routeModelName: Schema.optionalKey<Schema.NullOr<Schema.String>>;
25
+ }>;
26
+ /** The controls that the generation used; the prompt is never read. */
27
+ declare const ImageParametersSchema: Schema.Struct<{
28
+ readonly aspectRatio: Schema.optionalKey<Schema.NullOr<Schema.String>>;
29
+ readonly background: Schema.optionalKey<Schema.NullOr<Schema.String>>;
30
+ readonly count: Schema.optionalKey<Schema.NullOr<Schema.Finite>>;
31
+ readonly format: Schema.optionalKey<Schema.NullOr<Schema.String>>;
32
+ readonly quality: Schema.optionalKey<Schema.NullOr<Schema.String>>;
33
+ readonly referenceImages: Schema.optionalKey<Schema.NullOr<Schema.$Array<Schema.Unknown>>>;
34
+ readonly resolution: Schema.optionalKey<Schema.NullOr<Schema.String>>;
35
+ }>;
36
+ /** The cost of the generation and its source. */
37
+ declare const ImageUsageSchema: Schema.Struct<{
38
+ readonly amount: Schema.optionalKey<Schema.NullOr<Schema.String>>;
39
+ readonly currency: Schema.optionalKey<Schema.NullOr<Schema.String>>;
40
+ readonly kind: Schema.String;
41
+ readonly source: Schema.optionalKey<Schema.NullOr<Schema.String>>;
42
+ }>;
43
+ /**
44
+ * One image generation of an answer, as its part shows it (AC-090): its
45
+ * state, its images, its error and the facts of its provider, controls and
46
+ * cost. The prompt and the storage ids never show.
47
+ */
48
+ export type ImageGeneration = Readonly<{
49
+ errorMessage: string | undefined;
50
+ /** The generated images that the user may see: managed image files with a web URL. */
51
+ files: readonly ImageFile[];
52
+ jobId: string;
53
+ parameters: typeof ImageParametersSchema.Type | undefined;
54
+ provenance: typeof ImageProvenanceSchema.Type | undefined;
55
+ /** The server published the result; the job view of a live stream has no images yet. */
56
+ published: boolean;
57
+ status: ImageStatus;
58
+ usage: typeof ImageUsageSchema.Type | undefined;
59
+ }>;
60
+ /**
61
+ * The image generation of a finished tool call, or none when its output is
62
+ * no image job. The output decides, not the tool name: the model knows the
63
+ * image tool by its binding name.
64
+ */
65
+ export declare const imageGenerationOfPart: (part: ChatToolPart) => Option.Option<ImageGeneration>;
66
+ /** Whether an answer of the messages still waits for a generated image. */
67
+ export declare const imagePending: (messages: readonly CiUIMessage[]) => boolean;
68
+ export declare const imageStatusLabels: {
69
+ readonly attention_required: "imageStatusAttentionRequired";
70
+ readonly cancelled: "imageStatusCancelled";
71
+ readonly completed: "imageStatusCompleted";
72
+ readonly failed: "imageStatusFailed";
73
+ readonly partial: "imageStatusPartial";
74
+ readonly pending: "imageStatusPending";
75
+ readonly running: "imageStatusRunning";
76
+ };
77
+ /** One fact of the provenance, controls or cost of a generation. */
78
+ export type ImageFact = Readonly<{
79
+ label: string;
80
+ value: string;
81
+ }>;
82
+ /** The public facts of a generation: provenance, controls and cost. */
83
+ export declare const imageFactsOf: (labels: ChatLabels, generation: ImageGeneration) => readonly ImageFact[];
84
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { IntentCardPart } from "../../domain/index.js";
2
+ import type { ChatMessagePartProps } from "./types.js";
3
+ /**
4
+ * A `data-intent-card` part (AC-045): the Intent card of one Dispatch
5
+ * Record, with the chat labels of the locale. The part holds the state that
6
+ * the stream or the last transcript read gave it.
7
+ */
8
+ export declare const IntentCardMessagePart: ({ labels, part }: ChatMessagePartProps<IntentCardPart>) => import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import type { MemoryEvidence } from "../../domain/index.js";
2
+ import type { ChatMessagePartProps } from "./types.js";
3
+ /**
4
+ * A `data-memory-evidence` part: what the turn did with memories, with the
5
+ * used and saved counts and whether memory was off. Nothing without events.
6
+ */
7
+ export declare const MemoryEvidencePart: ({ labels, part }: ChatMessagePartProps<MemoryEvidence>) => import("react").JSX.Element | null;
@@ -0,0 +1,21 @@
1
+ import type { CiAskUserOutput, CiUIMessage } from "../../domain/index.js";
2
+ import type { ChatLabels } from "../labels/index.js";
3
+ import type { ChatApprovalAnswer, ChatMessagePartComponents } from "./types.js";
4
+ /** The renderer of each part: the replacement from `components`, else the default. */
5
+ export type ChatPartRenderers = Required<ChatMessagePartComponents>;
6
+ export declare const partRenderersOf: (components?: ChatMessagePartComponents) => ChatPartRenderers;
7
+ /** How the user answers the waits of an answer. */
8
+ export type ChatPartAnswers = Readonly<{
9
+ answerApproval: (answer: ChatApprovalAnswer) => void;
10
+ answerQuestion: (toolCallId: string, output: CiAskUserOutput) => void;
11
+ }>;
12
+ type MessagePartProps = Readonly<{
13
+ answers: ChatPartAnswers;
14
+ labels: ChatLabels;
15
+ message: CiUIMessage;
16
+ part: CiUIMessage["parts"][number];
17
+ renderers: ChatPartRenderers;
18
+ }>;
19
+ /** Each part of a message, in order, with the renderer of its kind. */
20
+ export declare const MessageParts: ({ message, ...props }: Omit<MessagePartProps, "part">) => import("react").JSX.Element[];
21
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { ChatQuestionPartProps } from "./types.js";
2
+ /**
3
+ * A `ci_ask_user` question (AC-374): the AI Elements Questionnaire while it
4
+ * waits, with the agent's options and, when it allows one, the user's own
5
+ * text; the answer goes back with `addToolOutput`. An answered question
6
+ * shows its answer. The card stays while Steering Messages wait (AC-258).
7
+ */
8
+ export declare const QuestionPart: ({ answer, labels, part }: ChatQuestionPartProps) => import("react").JSX.Element;
@@ -0,0 +1,23 @@
1
+ import type { ComponentType } from "react";
2
+ import type { InvocationId } from "../../api/index.js";
3
+ import type { CiUIMessage } from "../../domain/index.js";
4
+ import type { ChatLabels } from "../labels/index.js";
5
+ import type { ChatReadAloudProps } from "./types.js";
6
+ /**
7
+ * The default read-aloud button (AC-148, AC-149): play, or stop while a part
8
+ * loads or plays, with the `readAloud`, `readAloudStop` and
9
+ * `readAloudFailed` labels.
10
+ */
11
+ export declare const ReadAloudButton: ({ labels, playback, toggle }: ChatReadAloudProps) => import("react").JSX.Element;
12
+ /**
13
+ * The read-aloud control of one answer, which the transcript shows only
14
+ * while the speech availability answer reports read aloud (AC-150, AC-151,
15
+ * AC-264, AC-272). The `ReadAloud` part component replaces the button; the
16
+ * chat keeps the playback.
17
+ */
18
+ export declare const ReadAloud: ({ Control, invocationId, labels, message }: Readonly<{
19
+ Control: ComponentType<ChatReadAloudProps>;
20
+ invocationId: InvocationId;
21
+ labels: ChatLabels;
22
+ message: CiUIMessage;
23
+ }>) => import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import type { ReasoningUIPart } from "ai";
2
+ import type { ChatMessagePartProps } from "./types.js";
3
+ /**
4
+ * A reasoning part. It opens while it streams and starts closed in an
5
+ * earlier answer; after that only the user opens or closes it: `defaultOpen`
6
+ * keeps the panel from following the stream.
7
+ */
8
+ export declare const ReasoningPart: ({ labels, part }: ChatMessagePartProps<ReasoningUIPart>) => import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import type { Experimental_SteeringMessageUIPart as SteeringMessageUIPart } from "ai";
2
+ import type { ChatMessagePartProps } from "./types.js";
3
+ /**
4
+ * A Steering Message where it joined the answer (Q278): the user's words in
5
+ * a bubble at the end of the row, below the steps the answer took before it.
6
+ */
7
+ export declare const SteeringMessagePart: ({ labels, part }: ChatMessagePartProps<SteeringMessageUIPart>) => import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import type { TextUIPart } from "ai";
2
+ import type { ChatMessagePartProps } from "./types.js";
3
+ /** A text part: its markdown rendered with Streamdown (AC-310). */
4
+ export declare const TextPart: ({ part }: ChatMessagePartProps<TextUIPart>) => import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import type { ChatToolPartProps } from "./types.js";
2
+ /**
3
+ * A tool call of an answer: the AI Elements Tool with its input and output,
4
+ * and, when the call asks for approval, the AI Elements Confirmation (AC-372):
5
+ * approve and reject while the part is `approval-requested`, the decision
6
+ * once it is `approval-responded`, `output-denied` or done (AC-373). The
7
+ * approval of a `dispatch_intent` call names the Intent, by the title of the
8
+ * part when the stream gives one, else by its FQN, and shows its inputs
9
+ * (AC-018).
10
+ */
11
+ export declare const ToolPart: ({ answerApproval, labels, part }: ChatToolPartProps) => import("react").JSX.Element;
@@ -0,0 +1,103 @@
1
+ import type { DynamicToolUIPart, Experimental_SteeringMessageUIPart as SteeringMessageUIPart, FileUIPart, ReasoningUIPart, TextUIPart, ToolUIPart } from "ai";
2
+ import type { ComponentType } from "react";
3
+ import type { CiAnswerSentiment, CiAskUserInput, CiAskUserOutput, CiTools, CiUIMessage, Evidence, IntentCardPart, MemoryEvidence } from "../../domain/index.js";
4
+ import type { ChatLabels } from "../labels/index.js";
5
+ import type { ImageGeneration } from "./image-generation.js";
6
+ /** What every part renderer receives: its part, the message that holds it and the labels. */
7
+ export type ChatMessagePartProps<Part> = Readonly<{
8
+ labels: ChatLabels;
9
+ message: CiUIMessage;
10
+ part: Part;
11
+ }>;
12
+ /** A tool call of an answer: a CI tool, or any other tool as a dynamic tool part. */
13
+ export type ChatToolPart = DynamicToolUIPart | ToolUIPart<CiTools>;
14
+ /** The user's decision on one tool approval (AC-372). */
15
+ export type ChatApprovalAnswer = Readonly<{
16
+ approvalId: string;
17
+ approved: boolean;
18
+ }>;
19
+ /** What the tool part receives: the tool call and how to answer its approval. */
20
+ export type ChatToolPartProps = ChatMessagePartProps<ChatToolPart> & Readonly<{
21
+ /** Answers the approval with `addToolApprovalResponse`; the chat then sends it. */
22
+ answerApproval: (answer: ChatApprovalAnswer) => void;
23
+ }>;
24
+ /** A `ci_ask_user` question that waits for the user or has its answer. */
25
+ export type ChatQuestion = Readonly<{
26
+ input: CiAskUserInput;
27
+ /** The user's answer; absent while the question waits. */
28
+ output: CiAskUserOutput | undefined;
29
+ toolCallId: string;
30
+ }>;
31
+ /** What the question part receives: the question and how to answer it (AC-374). */
32
+ export type ChatQuestionPartProps = ChatMessagePartProps<ChatQuestion> & Readonly<{
33
+ /** Answers the question with `addToolOutput` and sends the answer. */
34
+ answer: (output: CiAskUserOutput) => void;
35
+ }>;
36
+ /** Where the reading of one answer is: idle, loading or playing a part, or failed. */
37
+ export type ChatReadAloudPlayback = Readonly<{
38
+ partIndex: number;
39
+ status: "loading";
40
+ }> | Readonly<{
41
+ partIndex: number;
42
+ status: "playing";
43
+ }> | Readonly<{
44
+ status: "failed";
45
+ }> | Readonly<{
46
+ status: "idle";
47
+ }>;
48
+ /**
49
+ * What the read-aloud control receives (AC-149): the answer, its reading and
50
+ * the start or stop action. It renders only while read aloud is available.
51
+ */
52
+ export type ChatReadAloudProps = Readonly<{
53
+ labels: ChatLabels;
54
+ message: CiUIMessage;
55
+ playback: ChatReadAloudPlayback;
56
+ /** Starts reading from the first part, or stops the reading that runs. */
57
+ toggle: () => void;
58
+ }>;
59
+ /** A rating to save: the sentiment, and the note of a negative rating (`null` for none). */
60
+ export type ChatAnswerFeedbackInput = Readonly<{
61
+ note: string | null;
62
+ sentiment: CiAnswerSentiment;
63
+ }>;
64
+ /**
65
+ * What the answer feedback control receives (AC-088): the user's rating of
66
+ * the answer, the save that runs, and the rate and clear actions. It renders
67
+ * on each finished answer that the user can rate.
68
+ */
69
+ export type ChatAnswerFeedbackProps = Readonly<{
70
+ /** The text of the last failed save; `null` without one. */
71
+ error: string | null;
72
+ labels: ChatLabels;
73
+ /** The answer that the user rates. */
74
+ message: CiUIMessage;
75
+ /** A rating is being saved. */
76
+ pending: boolean;
77
+ /** Clears the user's rating. */
78
+ clear: () => void;
79
+ /** Rates the answer. */
80
+ submit: (input: ChatAnswerFeedbackInput) => void;
81
+ /** The user's rating; `null` for none. */
82
+ value: CiAnswerSentiment | null;
83
+ }>;
84
+ /**
85
+ * Renderers that replace the default renderer of a message part, by part
86
+ * (AC-196): each one receives only its part, so it stays pure over it.
87
+ */
88
+ export type ChatMessagePartComponents = Readonly<{
89
+ AnswerFeedback?: ComponentType<ChatAnswerFeedbackProps>;
90
+ Evidence?: ComponentType<ChatMessagePartProps<Evidence>>;
91
+ File?: ComponentType<ChatMessagePartProps<FileUIPart>>;
92
+ /** A finished call of the image tool, as its generation (AC-090). */
93
+ ImageGeneration?: ComponentType<ChatMessagePartProps<ImageGeneration>>;
94
+ /** A `data-intent-card` part: one Intent run and the state of its Dispatch Record (AC-045). */
95
+ IntentCard?: ComponentType<ChatMessagePartProps<IntentCardPart>>;
96
+ MemoryEvidence?: ComponentType<ChatMessagePartProps<MemoryEvidence>>;
97
+ Question?: ComponentType<ChatQuestionPartProps>;
98
+ ReadAloud?: ComponentType<ChatReadAloudProps>;
99
+ Reasoning?: ComponentType<ChatMessagePartProps<ReasoningUIPart>>;
100
+ SteeringMessage?: ComponentType<ChatMessagePartProps<SteeringMessageUIPart>>;
101
+ Text?: ComponentType<ChatMessagePartProps<TextUIPart>>;
102
+ Tool?: ComponentType<ChatToolPartProps>;
103
+ }>;