@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,77 @@
1
+ import type { ReactNode } from "react";
2
+ import type { ChatCapability } from "../../headless/index.js";
3
+ /** One option of a picker list: a Skill, a tool or an Agent. */
4
+ export type ChatPickerOption = Readonly<{
5
+ /** A line below the name; `null` or blank shows none. */
6
+ description: string | null;
7
+ /** Shown at the end of the option, for example a "Personal" mark. */
8
+ end?: ReactNode;
9
+ id: string;
10
+ /** The icon tile of the option; the initial of the name without one. */
11
+ icon?: ReactNode;
12
+ /** More words that the search matches, for example the slash name of a Skill. */
13
+ keywords: readonly string[];
14
+ name: string;
15
+ }>;
16
+ /** The texts of a picker. */
17
+ export type ChatPickerLabels = Readonly<{
18
+ /** Accessible name of the clear button. */
19
+ clear: string;
20
+ /** Shown when no option matches the search. */
21
+ empty: string;
22
+ /** Shown when the list could not load. */
23
+ error: string;
24
+ /** The trigger text for more than one choice, with a `{count}` placeholder. */
25
+ multiple: string;
26
+ /** The trigger text without a choice. */
27
+ none: string;
28
+ search: string;
29
+ /** Accessible name of the trigger. */
30
+ select: string;
31
+ }>;
32
+ /** A list of the chat catalog: its options once read, and whether the read failed. */
33
+ export type ChatPickerList<A> = Readonly<{
34
+ failed: boolean;
35
+ /** `undefined` while the list loads or when it failed. */
36
+ items: readonly A[] | undefined;
37
+ }>;
38
+ type PickerProps = Readonly<{
39
+ /** The chosen option ids, in the order of their choice. */
40
+ chosen: readonly Readonly<{
41
+ id: string;
42
+ name: string;
43
+ }>[];
44
+ /** The picker data part, for example `skill-picker`. */
45
+ dataPart: string;
46
+ disabled?: boolean;
47
+ failed: boolean;
48
+ icon: ReactNode;
49
+ labels: ChatPickerLabels;
50
+ /** Picks or unpicks an option. */
51
+ onToggle: (option: ChatPickerOption) => void;
52
+ /** Removes every choice; absent when the choice cannot be cleared. */
53
+ onClear: (() => void) | undefined;
54
+ options: readonly ChatPickerOption[] | undefined;
55
+ /** `true` closes the list after a pick: a picker of one choice. */
56
+ single?: boolean;
57
+ }>;
58
+ /**
59
+ * A searchable list in the composer toolbar that picks options: a press on
60
+ * an option picks it, a second press on a chosen option removes it, and the
61
+ * clear button removes every choice.
62
+ */
63
+ export declare const ChatPicker: ({ chosen, dataPart, disabled, failed, icon, labels, onClear, onToggle, options, single }: PickerProps) => import("react").JSX.Element;
64
+ /**
65
+ * The choice of one capability kind, and the changes that keep the choice
66
+ * of the other kind: a toggle of one option and a clear of the kind.
67
+ */
68
+ export declare const capabilityChoice: (capabilities: readonly ChatCapability[], setCapabilities: (capabilities: readonly ChatCapability[]) => void, kind: ChatCapability["kind"]) => {
69
+ chosen: Readonly<{
70
+ id: string;
71
+ kind: "skill" | "tool";
72
+ name: string;
73
+ }>[];
74
+ onClear: () => void;
75
+ onToggle: ({ id, name }: ChatPickerOption) => void;
76
+ };
77
+ export {};
@@ -0,0 +1,24 @@
1
+ import type { CatalogSkill } from "../../api/index.js";
2
+ import type { ChatCapability } from "../../headless/index.js";
3
+ import type { ChatAgentPickerProps, ChatCapabilityPickersProps } from "../slots.js";
4
+ import type { ChatPickerList } from "./capability-picker.js";
5
+ /** The Skills of the Place, read once when the composer mounts. */
6
+ export declare const useChatSkills: () => ChatPickerList<CatalogSkill>;
7
+ /**
8
+ * The default Skill and tool pickers of the composer (AC-091): "Skills", the
9
+ * Skill name or "N skills", and the same for tools. The picks go with each
10
+ * turn of the open Conversation as its selected capabilities.
11
+ */
12
+ export declare const ChatCapabilityPickers: ({ capabilities, disabled, labels, setCapabilities, skills }: ChatCapabilityPickersProps) => import("react").JSX.Element;
13
+ /**
14
+ * The Agent of a new chat (AC-203): the Agents that the user can talk to,
15
+ * with their responsibility and a mark on personal Agents. It reads them
16
+ * when it mounts.
17
+ */
18
+ export declare const ChatAgentPicker: ({ agentId, clearable, disabled, labels, onChange }: ChatAgentPickerProps) => import("react").JSX.Element;
19
+ /**
20
+ * Whether a picked Skill reads in its own mode, which reads all Organization
21
+ * data whatever the access of the user. A source without a mode, or a Skill
22
+ * without `dataAccess`, reads in the own mode.
23
+ */
24
+ export declare const picksOwnModeSkill: (skills: readonly CatalogSkill[], capabilities: readonly ChatCapability[]) => boolean;
@@ -0,0 +1,15 @@
1
+ import type { ChatComposerProps } from "../slots.js";
2
+ /**
3
+ * The message box of the chat on the AI Elements prompt input: the draft of
4
+ * the Chat Session with its files, the Queued Messages, the voice control,
5
+ * the `composerAccessory` slot, the Agent picker of a new chat, the Skill
6
+ * and tool pickers (AC-091) and Send. Send (and Enter) starts a turn, or
7
+ * steers the running answer (AC-100); while an answer runs, the Send menu
8
+ * offers "Send after this answer" (AC-114) and Stop stops it. The steer or
9
+ * queue policy is the session machine's: the composer keeps no queue. It
10
+ * takes no message until the Chat Session is ready, and no second message
11
+ * while a send is on its way (`busy`); the draft stays open to typing. The
12
+ * picked Skills and tools are the session's: they go with each turn of the
13
+ * open Conversation.
14
+ */
15
+ export declare const ChatComposer: ({ agentChoice, className, composerParts, labels, send, slots }: ChatComposerProps) => import("react").JSX.Element;
@@ -0,0 +1,31 @@
1
+ import type { ChatSession } from "../../headless/index.js";
2
+ import type { ChatLabels } from "../labels/index.js";
3
+ import type { ChatAgentChoice, ChatComposerPartComponents } from "../slots.js";
4
+ type ComposerPicksInput = Readonly<{
5
+ agentChoice: ChatAgentChoice;
6
+ composerParts: ChatComposerPartComponents | undefined;
7
+ disabled: boolean;
8
+ labels: ChatLabels;
9
+ /** Called when the user picks or clears the agent of a new chat. */
10
+ onAgentPicked: () => void;
11
+ running: boolean;
12
+ session: ChatSession;
13
+ }>;
14
+ /**
15
+ * What the user picks in the composer besides the text (AC-091, AC-203):
16
+ * the agent of a new chat, kept here until the message goes, and the Skills
17
+ * and tools of the open Conversation, kept in the Chat Session so that each
18
+ * turn carries them. It gives the composer the pickers, the slash list, the
19
+ * own-mode notice and the key handler of the message input.
20
+ */
21
+ export declare const useComposerPicks: ({ agentChoice, composerParts, disabled, labels, onAgentPicked, running, session }: ComposerPicksInput) => {
22
+ /** The agent that a message of a new chat starts with, if the user picked one. */
23
+ agentId: (string & import("effect/Brand").Brand<"@collective-intelligence/ai/AgentId">) | null;
24
+ handleKeyDown: (event: import("react").KeyboardEvent<HTMLTextAreaElement>) => void;
25
+ notice: import("react").JSX.Element | null;
26
+ pickers: import("react").JSX.Element;
27
+ suggestions: import("react").JSX.Element;
28
+ /** The chat model answers the draft, so it takes files, Skills and tools. */
29
+ takesCapabilities: boolean;
30
+ };
31
+ export {};
@@ -0,0 +1,21 @@
1
+ import type { ChatLabels } from "../labels/index.js";
2
+ interface ComposerTrailProps {
3
+ readonly labels: ChatLabels;
4
+ }
5
+ /**
6
+ * The switches of the Context Trail of this chat, as the Place Context
7
+ * read when the chat started (AC-230); both off until it answers.
8
+ */
9
+ export declare const useTrailSwitches: () => {
10
+ enabled: boolean;
11
+ visible: boolean;
12
+ };
13
+ /**
14
+ * The Context Trail above the composer while the trail is enabled and
15
+ * visible: one chip with a remove button for each entry that the next turn
16
+ * carries (AC-231). A removed entry stays out until it changes (AC-232).
17
+ */
18
+ export declare const ComposerTrailChips: ({ labels }: ComposerTrailProps) => import("react").JSX.Element | null;
19
+ /** The one fixed line below the composer while the trail is enabled and hidden (AC-234). */
20
+ export declare const ComposerTrailNotice: ({ labels }: ComposerTrailProps) => import("react").JSX.Element | null;
21
+ export {};
@@ -0,0 +1,36 @@
1
+ import type { FileUIPart } from "ai";
2
+ import type { ChatLabels } from "../labels/index.js";
3
+ /** The most files of one message: the server takes 10 in one upload. */
4
+ export declare const maxDraftFiles = 10;
5
+ /** The largest file that the server takes: 10 MiB. */
6
+ export declare const maxDraftFileBytes: number;
7
+ /**
8
+ * Why files were not attached, as the prompt input reports it: a file type
9
+ * that the chat does not take, a file over the size limit, or too many
10
+ * files for one message.
11
+ */
12
+ export type DraftFileRejection = "accept" | "max_file_size" | "max_files";
13
+ /**
14
+ * Why files were not attached, in words. A draft that takes no files (an
15
+ * agent answers it, or an answer runs) refuses each file and names no limit.
16
+ */
17
+ export declare const rejectionText: (rejection: DraftFileRejection, takesFiles: boolean, labels: ChatLabels) => string;
18
+ /**
19
+ * The `accept` value of the prompt input: the extensions and media types
20
+ * of a chat attachment, read once when the composer mounts. Until they are
21
+ * read, every type passes; the server checks the type again.
22
+ */
23
+ export declare const useDraftFileTypes: () => string | undefined;
24
+ /**
25
+ * The files of a sent draft: the prompt input gives each file as a data
26
+ * URL, and the upload takes the file itself.
27
+ */
28
+ export declare const filesOf: (parts: readonly FileUIPart[]) => readonly File[];
29
+ /** The button that opens the file chooser of the prompt input. */
30
+ export declare const AttachButton: ({ labels }: Readonly<{
31
+ labels: ChatLabels;
32
+ }>) => import("react").JSX.Element;
33
+ /** The files of the draft above its text, each with its preview and its remove button. */
34
+ export declare const DraftAttachments: ({ labels }: Readonly<{
35
+ labels: ChatLabels;
36
+ }>) => import("react").JSX.Element | null;
@@ -0,0 +1,9 @@
1
+ import type { ChatLabels } from "../labels/index.js";
2
+ /**
3
+ * The waiting Queued Messages of the open Conversation above the composer,
4
+ * in run order, as `listQueuedMessages` answers them (AC-301), each with
5
+ * Edit and Remove. It shows nothing while none waits.
6
+ */
7
+ export declare const QueuedMessages: ({ labels }: Readonly<{
8
+ labels: ChatLabels;
9
+ }>) => import("react").JSX.Element | null;
@@ -0,0 +1,11 @@
1
+ import type { ChatLabels } from "../labels/index.js";
2
+ /**
3
+ * The Send menu of a running answer, beside Send, which steers it (AC-100):
4
+ * "Send after this answer" saves the draft as a Queued Message (AC-114).
5
+ */
6
+ export declare const SendMenu: ({ disabled, labels, onQueue }: Readonly<{
7
+ /** `true` while the draft cannot wait for the answer, for example when it is empty. */
8
+ disabled: boolean;
9
+ labels: ChatLabels;
10
+ onQueue: () => void;
11
+ }>) => import("react").JSX.Element;
@@ -0,0 +1,37 @@
1
+ import type { KeyboardEvent } from "react";
2
+ import type { CatalogSkill } from "../../api/index.js";
3
+ import type { ChatCapability, ChatSession } from "../../headless/index.js";
4
+ /**
5
+ * The Skills that the slash word at the end of the draft names and that the
6
+ * user has not picked yet: a slug that starts with the word, or a name that
7
+ * holds it. None without a slash word.
8
+ */
9
+ export declare const slashMatches: (draft: string, skills: readonly CatalogSkill[], capabilities: readonly ChatCapability[]) => readonly CatalogSkill[];
10
+ /** The draft without its slash word, after the user picked a Skill with it. */
11
+ export declare const withoutSlashWord: (draft: string) => string;
12
+ /**
13
+ * The slash list of the draft: the Skills that its slash word offers while
14
+ * the draft takes Skills, a pick that adds one to the session's picks and
15
+ * drops the slash word, and the key handler of the message input.
16
+ */
17
+ export declare const useSlashSkills: (session: Pick<ChatSession, "capabilities" | "draft" | "setCapabilities" | "setDraft">, skills: readonly CatalogSkill[], enabled: boolean) => {
18
+ handleChoose: ({ id, name }: CatalogSkill) => void;
19
+ handleKeyDown: (event: KeyboardEvent<HTMLTextAreaElement>) => void;
20
+ matches: readonly {
21
+ readonly dataAccess: {
22
+ readonly datasets?: "skill" | "user";
23
+ readonly documents?: "skill" | "user";
24
+ readonly knowledge?: "skill" | "user";
25
+ } | null;
26
+ readonly description: string | null;
27
+ readonly fqn: string;
28
+ readonly id: string;
29
+ readonly name: string;
30
+ readonly slug: string;
31
+ }[];
32
+ };
33
+ /** The Skills that the slash word offers, above the message input. */
34
+ export declare const SlashSuggestions: ({ matches, onChoose }: Readonly<{
35
+ matches: readonly CatalogSkill[];
36
+ onChoose: (skill: CatalogSkill) => void;
37
+ }>) => import("react").JSX.Element | null;
@@ -0,0 +1,15 @@
1
+ import type { ContextTrailEntry } from "../../domain/index.js";
2
+ import type { ChatLabels } from "../labels/index.js";
3
+ export interface TrailChipsProps {
4
+ readonly entries: readonly ContextTrailEntry[];
5
+ readonly labels: ChatLabels;
6
+ /** Removes the entry of a chip; without it the chips are read only, as on a sent turn. */
7
+ readonly onRemove?: ((entry: ContextTrailEntry) => void) | undefined;
8
+ /** The accessible name of the row. */
9
+ readonly region: string;
10
+ }
11
+ /**
12
+ * One chip for each Context Trail Entry (Q60), for the composer and a sent
13
+ * user message; nothing when the trail is empty.
14
+ */
15
+ export declare const TrailChips: ({ entries, labels, onRemove, region }: TrailChipsProps) => import("react").JSX.Element | null;
@@ -0,0 +1,14 @@
1
+ import type { AiResult } from "../../../domain/index.js";
2
+ /** One recording of the microphone. */
3
+ export interface MicrophoneCapture {
4
+ /** Stops the recording and drops it. */
5
+ readonly cancel: () => void;
6
+ /** Stops the recording and answers its audio. */
7
+ readonly stop: () => Promise<Blob>;
8
+ }
9
+ /**
10
+ * Starts recording the default microphone of the browser. Stopping or
11
+ * cancelling releases the microphone; a recorder that cannot start
12
+ * releases it at once.
13
+ */
14
+ export declare const captureMicrophone: () => Promise<AiResult<MicrophoneCapture>>;
@@ -0,0 +1,12 @@
1
+ import type { AiResult } from "../../../domain/index.js";
2
+ import type { ChatSession } from "../../../headless/index.js";
3
+ /**
4
+ * Transcribes one recorded clip with the default speech-to-text model of
5
+ * the Organization (FLOW-005) through the Chat Session's typed client
6
+ * (`useChatSession().call`): it reserves the clip, puts its bytes at the
7
+ * presigned upload, then asks for its text. The server drops the clip after
8
+ * the transcription; the text goes nowhere but to the caller, which puts it
9
+ * into the draft (AC-138). A recording above the clip limit fails with
10
+ * `invalid_request` before any request, as the server refuses it.
11
+ */
12
+ export declare const transcribeRecording: (call: ChatSession["call"], audio: Blob) => Promise<AiResult<string>>;
@@ -0,0 +1,30 @@
1
+ import type { SpeechInputPort } from "../../../headless/index.js";
2
+ import type { ChatComposerDraft } from "../../slots.js";
3
+ /**
4
+ * Where a voice input is: it records between two presses, then transcribes.
5
+ * `tooLong` tells a recording above the clip limit from another failure;
6
+ * `stoppedAtLimit` tells that the time limit ended the last recording.
7
+ */
8
+ export type VoiceInputState = Readonly<{
9
+ status: "failed";
10
+ tooLong: boolean;
11
+ }> | Readonly<{
12
+ status: "idle" | "transcribing";
13
+ stoppedAtLimit: boolean;
14
+ }> | Readonly<{
15
+ status: "recording";
16
+ }> | Readonly<{
17
+ status: "starting";
18
+ }>;
19
+ /** The draft with the dictated text after it, on a new line. */
20
+ export declare const withDictation: (draft: string, text: string) => string;
21
+ /**
22
+ * Drives one voice control over `port`: the first press records, the next
23
+ * one, or the time limit, transcribes and writes the text into the draft.
24
+ * The text never goes out by itself: the user sends the draft (AC-138).
25
+ * Unmounting drops a recording that runs, and one that starts after it.
26
+ */
27
+ export declare const useVoiceInput: (port: SpeechInputPort, draft: ChatComposerDraft) => {
28
+ state: VoiceInputState;
29
+ toggle: () => void;
30
+ };
@@ -0,0 +1,15 @@
1
+ import type { ChatLabels } from "../../labels/index.js";
2
+ import type { ChatComposerDraft } from "../../slots.js";
3
+ /**
4
+ * The default voice control of the composer. It records the microphone and
5
+ * transcribes remotely, so it shows only while the speech availability
6
+ * answer reports remote transcription (AC-134, AC-270). The transcribed
7
+ * text goes into the draft and never goes out by itself (AC-138). A host
8
+ * that passes its own `speechInput` port renders its own voice control, for
9
+ * example in `composerAccessory`: then this one renders nothing, so the
10
+ * chat shows one voice control.
11
+ */
12
+ export declare const ChatVoiceInput: ({ draft, labels }: Readonly<{
13
+ draft: ChatComposerDraft;
14
+ labels: ChatLabels;
15
+ }>) => import("react").JSX.Element | null;
@@ -0,0 +1,57 @@
1
+ import type { ComponentType } from "react";
2
+ import type { DraftUpdate, Place } from "../../domain/index.js";
3
+ import type { AiHostPorts, ChatSurfaceOptions } from "../../headless/index.js";
4
+ import type { CiChatTransport } from "../../transport/index.js";
5
+ import type { ChatLabels, ChatLocale } from "../labels/index.js";
6
+ import type { ChatComponents, ChatPartProps, ChatSlots } from "../slots.js";
7
+ import type { ChatDockSubject } from "./dock-session.js";
8
+ /** Content that the dock inserts at fixed places: the chat slots without the sidebar. */
9
+ export type ChatDockSlots = Omit<ChatSlots, "sidebarFooter" | "sidebarHeader">;
10
+ /** Parts that replace the defaults of the dock, by part name. */
11
+ export type ChatDockComponents = Pick<ChatComponents, "ChatBlockedState" | "ChatComposer" | "ChatTranscript" | "messageParts"> & Readonly<{
12
+ ChatDockHeader?: ComponentType<ChatPartProps>;
13
+ }>;
14
+ /** A part of the dock: `ChatDock` is the element that holds the others. */
15
+ export type ChatDockPart = "ChatBlockedState" | "ChatComposer" | "ChatDock" | "ChatDockHeader" | "ChatTranscript";
16
+ /** A class name for each part of the dock, set beside its `data-part` attribute. */
17
+ export type ChatDockClassNames = Readonly<Partial<Record<ChatDockPart, string>>>;
18
+ export type ChatDockProps = Readonly<{
19
+ /** The mount of the typed client, as for `ChatSessionProvider`; the dock adds the draft header. */
20
+ api: ChatSurfaceOptions;
21
+ classNames?: ChatDockClassNames;
22
+ components?: ChatDockComponents;
23
+ /**
24
+ * The host ports, as for `ChatSessionProvider`, without `sessions`: the
25
+ * dock opens the latest Conversation of its draft from the server's list.
26
+ */
27
+ host?: AiHostPorts;
28
+ labels?: Partial<ChatLabels>;
29
+ locale?: ChatLocale;
30
+ /** Gets each `data-draft-update` of the dock's draft as the answer streams; the page applies it. */
31
+ onDraftUpdate?: (update: DraftUpdate) => void;
32
+ /** The agent of every Conversation of the dock (a UUID). */
33
+ pinnedAgentId: string;
34
+ /** The Place of the dock: the Dashboard of the Organization. */
35
+ place: Place;
36
+ slots?: ChatDockSlots;
37
+ /** The draft that the dock's Conversations point at; another draft starts another session. */
38
+ subject: ChatDockSubject;
39
+ /** The chat transport, as for `ChatSessionProvider`; the dock adds the draft header. */
40
+ transport: CiChatTransport;
41
+ }>;
42
+ /**
43
+ * The head of the dock: the title of the open Conversation, the "new chat"
44
+ * action, the header actions, and a failure with its retry.
45
+ */
46
+ export declare const ChatDockHeader: ({ className, labels, newChat, slots }: ChatPartProps) => import("react").JSX.Element;
47
+ /**
48
+ * The docked chat of a Dashboard draft (ARC-038, FLOW-016): a pinned agent,
49
+ * no Conversation sidebar (AC-348), one Conversation per draft with a "new
50
+ * chat" action (AC-349): it opens the draft's latest Conversation again. It runs its own Chat Session on the host's `api`
51
+ * and `transport`, and names its draft in the `x-chat-subject` header of
52
+ * every request, send and resume, so the Dashboard mount links new
53
+ * Conversations to the draft and checks the draft's manage permission;
54
+ * other mounts on the same `api` and `transport` send no such header. The
55
+ * draft updates of the answers go to `onDraftUpdate`.
56
+ */
57
+ export declare const ChatDock: (props: ChatDockProps) => import("react").JSX.Element;
@@ -0,0 +1,22 @@
1
+ import type { DraftSubjectKind, DraftUpdate } from "../../domain/index.js";
2
+ import type { ChatSurfaceOptions } from "../../headless/index.js";
3
+ import type { CiChatTransport } from "../../transport/index.js";
4
+ /** The draft that a dock's Conversations point at: one kind of Dashboard draft and its id. */
5
+ export type ChatDockSubject = Readonly<{
6
+ id: string;
7
+ kind: DraftSubjectKind;
8
+ }>;
9
+ /** The header that names the draft of a request on the Dashboard mount. */
10
+ export declare const chatSubjectHeaderName = "x-chat-subject";
11
+ /** The header value of a draft: `<kind>:<id>`. */
12
+ export declare const chatSubjectHeaderValue: ({ id, kind }: ChatDockSubject) => string;
13
+ /** The typed client of `api`, with the draft named on each request. */
14
+ export declare const withSubjectApi: (api: ChatSurfaceOptions, subject: ChatDockSubject) => ChatSurfaceOptions;
15
+ /**
16
+ * `transport`, with the draft named on each send and resume, and each
17
+ * `data-draft-update` of the draft given to `onDraftUpdate` as the answer
18
+ * streams. A resume replays the running turn from its start, so the page
19
+ * may get an update again; an update sets values, so applying it twice
20
+ * changes nothing.
21
+ */
22
+ export declare const withSubjectTransport: (transport: CiChatTransport, subject: ChatDockSubject, onDraftUpdate: (update: DraftUpdate) => void) => CiChatTransport;
@@ -0,0 +1,10 @@
1
+ import type { ChatHeaderProps } from "../slots.js";
2
+ /**
3
+ * The title of the open Conversation, its Agent, its controls (memory
4
+ * switch, compaction, refresh) and the header actions, with notices and
5
+ * failures below. Below the Studio breakpoint, a button opens the
6
+ * Conversation list. An Agent Conversation has no memory switch and no
7
+ * compaction. A control whose host port or feature flag is off is hidden
8
+ * (AC-190).
9
+ */
10
+ export declare const ChatHeader: ({ className, labels, openConversations, slots }: ChatHeaderProps) => import("react").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import type { ConversationId } from "../../api/index.js";
2
+ import type { ChatAction } from "../chat-operations.js";
3
+ import type { ChatLabels } from "../labels/index.js";
4
+ type CompactionControlsProps = Readonly<{
5
+ /** The open Conversation; give the controls a `key` with it. */
6
+ conversationId: ConversationId;
7
+ labels: ChatLabels;
8
+ write: ChatAction;
9
+ }>;
10
+ /**
11
+ * Compacts the open Conversation, or, once it is compacted, opens its
12
+ * summary with Regenerate and Reset. A reset closes the summary. It reads
13
+ * the compaction of the Conversation when it opens, and again after each
14
+ * operation.
15
+ */
16
+ export declare const CompactionControls: ({ conversationId, labels, write }: CompactionControlsProps) => import("react").JSX.Element | null;
17
+ export {};
@@ -0,0 +1,16 @@
1
+ import type { Conversation } from "../../api/index.js";
2
+ import type { ChatAction } from "../chat-operations.js";
3
+ import type { ChatLabels } from "../labels/index.js";
4
+ type MemorySwitchProps = Readonly<{
5
+ /** The open Conversation, from the list. */
6
+ conversation: Conversation;
7
+ labels: ChatLabels;
8
+ write: ChatAction;
9
+ }>;
10
+ /**
11
+ * The memory switch of the open Conversation: one toggle button whose name
12
+ * tells the current state ("Memory on" or "Memory off") and whose
13
+ * `aria-pressed` is `true` while memory is on.
14
+ */
15
+ export declare const MemorySwitch: ({ conversation, labels, write }: MemorySwitchProps) => import("react").JSX.Element;
16
+ export {};
@@ -0,0 +1,58 @@
1
+ export { AssistantSidebar } from "./assistant-sidebar/assistant-sidebar.js";
2
+ export type { AssistantSidebarProps } from "./assistant-sidebar/assistant-sidebar.js";
3
+ export { AssistantSidebarLayout } from "./assistant-sidebar/layout.js";
4
+ export type { AssistantSidebarLayoutProps, AssistantSidebarShortcuts } from "./assistant-sidebar/layout.js";
5
+ export { AssistantSidebarToggle } from "./assistant-sidebar/toggle.js";
6
+ export type { AssistantSidebarToggleProps } from "./assistant-sidebar/toggle.js";
7
+ export { ChatBlockedState } from "./blocked/chat-blocked-state.js";
8
+ export { Chat } from "./chat.js";
9
+ export type { ChatProps } from "./chat.js";
10
+ export { ChatRoot } from "./chat-root.js";
11
+ export type { ChatRootProps } from "./chat-root.js";
12
+ export { ChatPicker } from "./composer/capability-picker.js";
13
+ export type { ChatPickerLabels, ChatPickerList, ChatPickerOption } from "./composer/capability-picker.js";
14
+ export { ChatAgentPicker, ChatCapabilityPickers } from "./composer/capability-pickers.js";
15
+ export { ChatComposer } from "./composer/chat-composer.js";
16
+ export { transcribeRecording } from "./composer/voice-input/remote-transcription.js";
17
+ export { ChatDock, ChatDockHeader } from "./dock/chat-dock.js";
18
+ export type { ChatDockClassNames, ChatDockComponents, ChatDockPart, ChatDockProps, ChatDockSlots } from "./dock/chat-dock.js";
19
+ export { chatSubjectHeaderName, chatSubjectHeaderValue } from "./dock/dock-session.js";
20
+ export type { ChatDockSubject } from "./dock/dock-session.js";
21
+ export { ChatHeader } from "./header/chat-header.js";
22
+ export { IntentCard, intentCardLabels } from "./intents/intent-card.js";
23
+ export type { IntentCardData, IntentCardLabels, IntentCardProps, IntentCardState } from "./intents/intent-card.js";
24
+ export { IntentForm } from "./intents/intent-form.js";
25
+ export type { IntentFormProps } from "./intents/intent-form.js";
26
+ export { IntentNotices, intentNoticeLabels } from "./intents/intent-notices.js";
27
+ export type { IntentNoticeLabels, IntentNoticeLocale, IntentNoticesProps } from "./intents/intent-notices.js";
28
+ export { IntentTrigger } from "./intents/intent-trigger.js";
29
+ export type { IntentTriggerProps } from "./intents/intent-trigger.js";
30
+ export { defaultIntentLabels } from "./intents/labels.js";
31
+ export type { IntentLabels } from "./intents/labels.js";
32
+ export { chatLabels, fillLabel } from "./labels/index.js";
33
+ export { ChatLaunchButton } from "./launch/chat-launch-button.js";
34
+ export type { ChatLaunchButtonProps } from "./launch/chat-launch-button.js";
35
+ export type { ChatLabelKey, ChatLabels, ChatLocale } from "./labels/index.js";
36
+ export { ConversationSidebar } from "./sidebar/conversation-sidebar.js";
37
+ export type { ChatHistory, ChatHistoryFilter, ChatHistoryFilterValue } from "./sidebar/history-filter.js";
38
+ export { ChatAnswerFeedback } from "./parts/answer-feedback.js";
39
+ export type { ChatAnswerFeedbackControlProps } from "./parts/answer-feedback.js";
40
+ export { EvidencePart } from "./parts/evidence-part.js";
41
+ export { FilePart } from "./parts/file-part.js";
42
+ export type { ImageFile, ImageGeneration, ImageStatus } from "./parts/image-generation.js";
43
+ export { ImageGenerationPart } from "./parts/image-generation-part.js";
44
+ export { IntentCardMessagePart } from "./parts/intent-card-part.js";
45
+ export { MemoryEvidencePart } from "./parts/memory-evidence-part.js";
46
+ export { QuestionPart } from "./parts/question-part.js";
47
+ export { ReadAloudButton } from "./parts/read-aloud.js";
48
+ export { ReasoningPart } from "./parts/reasoning-part.js";
49
+ export { SteeringMessagePart } from "./parts/steering-message-part.js";
50
+ export { TextPart } from "./parts/text-part.js";
51
+ export { ToolPart } from "./parts/tool-part.js";
52
+ export { RunTrace } from "./run-trace/run-trace.js";
53
+ export type { RunTraceProps } from "./run-trace/run-trace.js";
54
+ export type { RunTraceStatus } from "./run-trace/run-stream.js";
55
+ export type { ChatAnswerFeedbackInput, ChatAnswerFeedbackProps, ChatApprovalAnswer, ChatMessagePartComponents, ChatMessagePartProps, ChatQuestion, ChatQuestionPartProps, ChatReadAloudPlayback, ChatReadAloudProps, ChatToolPart, ChatToolPartProps } from "./parts/types.js";
56
+ export type { ChatProjects } from "./sidebar/projects/use-chat-projects.js";
57
+ export type { ChatAgentChoice, ChatAgentPickerProps, ChatBlockedStateProps, ChatCapabilityPickersProps, ChatClassNames, ChatComponents, ChatComposerAccessory, ChatComposerDraft, ChatComposerPartComponents, ChatComposerProps, ChatHeaderProps, ChatPart, ChatPartProps, ChatSend, ChatSendMessage, ChatSlots, ChatTranscriptProps, ConversationSidebarProps } from "./slots.js";
58
+ export { ChatTranscript } from "./transcript/chat-transcript.js";
@@ -0,0 +1,38 @@
1
+ import type { IntentCatalogEntry, IntentFieldProblem } from "../../domain/index.js";
2
+ import type { IntentInputs } from "../../headless/index.js";
3
+ type FieldKind = Readonly<{
4
+ kind: "boolean" | "date" | "json" | "number" | "text";
5
+ }> | Readonly<{
6
+ kind: "choice";
7
+ options: readonly string[];
8
+ }>;
9
+ /** One flat field of the input form, from one property of the input schema. */
10
+ export type FormField = FieldKind & Readonly<{
11
+ description: string | undefined;
12
+ label: string;
13
+ name: string;
14
+ required: boolean;
15
+ }>;
16
+ /** What the user entered: the checkbox state, or the text of the control. */
17
+ export type FormDraft = Readonly<Record<string, boolean | string>>;
18
+ /**
19
+ * The fields of the top-level properties of an input schema: text, number,
20
+ * boolean, choice and date fields for flat values, and a JSON field for
21
+ * nested or untyped values.
22
+ */
23
+ export declare const fieldsOf: (schema: IntentCatalogEntry["inputSchema"]) => readonly FormField[];
24
+ /** The draft of each field, filled from the inputs that the form starts with. */
25
+ export declare const draftOf: (fields: readonly FormField[], values: IntentInputs) => FormDraft;
26
+ /**
27
+ * The inputs of a submit: the starting inputs that no field shows, then the
28
+ * value of each field. Answers the names of the JSON fields whose text is
29
+ * not JSON instead, when there are any.
30
+ */
31
+ export declare const inputsOf: (fields: readonly FormField[], draft: FormDraft, values: IntentInputs) => Readonly<{
32
+ inputs: IntentInputs;
33
+ }> | Readonly<{
34
+ unparsed: readonly string[];
35
+ }>;
36
+ /** The problems of each field, by field name; the root and unknown names under `""`. */
37
+ export declare const problemsByField: (fields: readonly FormField[], problems: readonly IntentFieldProblem[]) => ReadonlyMap<string, readonly IntentFieldProblem[]>;
38
+ export {};