@arbidocs/blocks 0.4.2 → 0.4.3

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 (139) hide show
  1. package/README.md +42 -0
  2. package/dist/agents/index.cjs +147 -146
  3. package/dist/agents/index.js +3 -2
  4. package/dist/chat/AssistantDock.d.ts +39 -0
  5. package/dist/chat/ChatDocuments.d.ts +17 -0
  6. package/dist/chat/ChatPage.d.ts +16 -0
  7. package/dist/chat/ChatThreads.d.ts +28 -0
  8. package/dist/chat/chat-page-types.d.ts +121 -0
  9. package/dist/chat/chat-surface.d.ts +9 -0
  10. package/dist/chat/index.cjs +247 -205
  11. package/dist/chat/index.d.ts +6 -0
  12. package/dist/chat/index.js +4 -2
  13. package/dist/{chunk-OBLSURHV.js → chunk-2NNTQLBY.js} +3 -3
  14. package/dist/{chunk-OBLSURHV.js.map → chunk-2NNTQLBY.js.map} +1 -1
  15. package/dist/chunk-2VBJ763Y.js +296 -0
  16. package/dist/chunk-2VBJ763Y.js.map +1 -0
  17. package/dist/{chunk-2ORA62OF.js → chunk-67MKU5U7.js} +3 -3
  18. package/dist/{chunk-2ORA62OF.js.map → chunk-67MKU5U7.js.map} +1 -1
  19. package/dist/{chunk-AE5FHFZ5.cjs → chunk-6CHMNKXC.cjs} +6 -6
  20. package/dist/{chunk-AE5FHFZ5.cjs.map → chunk-6CHMNKXC.cjs.map} +1 -1
  21. package/dist/{chunk-ITGHMJOM.js → chunk-AAY5ASZD.js} +5 -4
  22. package/dist/chunk-AAY5ASZD.js.map +1 -0
  23. package/dist/chunk-ATXPAD6S.cjs +1952 -0
  24. package/dist/chunk-ATXPAD6S.cjs.map +1 -0
  25. package/dist/{chunk-YBXCZEWS.js → chunk-B673CCW5.js} +29 -6
  26. package/dist/chunk-B673CCW5.js.map +1 -0
  27. package/dist/{chunk-2K33YGM6.cjs → chunk-DN3NFNIA.cjs} +63 -294
  28. package/dist/chunk-DN3NFNIA.cjs.map +1 -0
  29. package/dist/{chunk-XQ7PKKDY.cjs → chunk-G4YOH5DU.cjs} +3 -3
  30. package/dist/{chunk-XQ7PKKDY.cjs.map → chunk-G4YOH5DU.cjs.map} +1 -1
  31. package/dist/{chunk-AXIZ2MDV.js → chunk-HER7MTRR.js} +3 -3
  32. package/dist/{chunk-AXIZ2MDV.js.map → chunk-HER7MTRR.js.map} +1 -1
  33. package/dist/chunk-JPO3F4J7.js +1899 -0
  34. package/dist/chunk-JPO3F4J7.js.map +1 -0
  35. package/dist/{chunk-WJMEXTVD.cjs → chunk-KDG6FER6.cjs} +28 -2
  36. package/dist/chunk-KDG6FER6.cjs.map +1 -0
  37. package/dist/chunk-KHX2BX3S.cjs +307 -0
  38. package/dist/chunk-KHX2BX3S.cjs.map +1 -0
  39. package/dist/{chunk-WTNMWEBC.js → chunk-NJL4LIXX.js} +4 -3
  40. package/dist/chunk-NJL4LIXX.js.map +1 -0
  41. package/dist/{chunk-J2BGSWXM.cjs → chunk-O637DUKS.cjs} +27 -27
  42. package/dist/{chunk-J2BGSWXM.cjs.map → chunk-O637DUKS.cjs.map} +1 -1
  43. package/dist/{chunk-WW6EOVZA.js → chunk-OXF2IFXG.js} +26 -3
  44. package/dist/chunk-OXF2IFXG.js.map +1 -0
  45. package/dist/{chunk-6HIPFEID.cjs → chunk-PBS5MFIY.cjs} +4 -4
  46. package/dist/{chunk-6HIPFEID.cjs.map → chunk-PBS5MFIY.cjs.map} +1 -1
  47. package/dist/{chunk-AZQDNYH4.js → chunk-RCP6THBS.js} +9 -1249
  48. package/dist/chunk-RCP6THBS.js.map +1 -0
  49. package/dist/{chunk-GDFWJ73C.cjs → chunk-RIL7G7AS.cjs} +4 -1286
  50. package/dist/chunk-RIL7G7AS.cjs.map +1 -0
  51. package/dist/{chunk-DREI7EQ2.cjs → chunk-SS23F63U.cjs} +9 -9
  52. package/dist/{chunk-DREI7EQ2.cjs.map → chunk-SS23F63U.cjs.map} +1 -1
  53. package/dist/{chunk-7PEELPMA.js → chunk-TI4UTYRL.js} +62 -285
  54. package/dist/chunk-TI4UTYRL.js.map +1 -0
  55. package/dist/{chunk-XNBAXRY7.cjs → chunk-VXOGANFJ.cjs} +13 -12
  56. package/dist/chunk-VXOGANFJ.cjs.map +1 -0
  57. package/dist/{chunk-6P6AEQJB.js → chunk-WJZBJUPX.js} +4 -4
  58. package/dist/{chunk-6P6AEQJB.js.map → chunk-WJZBJUPX.js.map} +1 -1
  59. package/dist/{chunk-UFHMLHIR.cjs → chunk-XAJIKT6Y.cjs} +32 -11
  60. package/dist/chunk-XAJIKT6Y.cjs.map +1 -0
  61. package/dist/{chunk-G3G7LZPM.cjs → chunk-XKKGGUU2.cjs} +29 -3
  62. package/dist/chunk-XKKGGUU2.cjs.map +1 -0
  63. package/dist/{chunk-UWGIB3VQ.js → chunk-XNOASBGW.js} +33 -12
  64. package/dist/chunk-XNOASBGW.js.map +1 -0
  65. package/dist/{chunk-CTZ5745I.js → chunk-XQKGYGCJ.js} +3 -3
  66. package/dist/{chunk-CTZ5745I.js.map → chunk-XQKGYGCJ.js.map} +1 -1
  67. package/dist/{chunk-54Q3RNJU.cjs → chunk-ZVPTFTGV.cjs} +4 -3
  68. package/dist/chunk-ZVPTFTGV.cjs.map +1 -0
  69. package/dist/citations/index.cjs +11 -11
  70. package/dist/citations/index.js +2 -2
  71. package/dist/components/MemberAvatarStack.d.ts +7 -2
  72. package/dist/connect/index.cjs +41 -12
  73. package/dist/connect/index.cjs.map +1 -1
  74. package/dist/connect/index.d.ts +3 -2
  75. package/dist/connect/index.js +20 -4
  76. package/dist/connect/index.js.map +1 -1
  77. package/dist/connection/ConnectionProvider.d.ts +2 -0
  78. package/dist/connection/ai.d.ts +13 -1
  79. package/dist/connection/useConnectedShellWorkspaces.d.ts +15 -0
  80. package/dist/facts/index.cjs +3 -3
  81. package/dist/facts/index.cjs.map +1 -1
  82. package/dist/facts/index.js +2 -2
  83. package/dist/facts/index.js.map +1 -1
  84. package/dist/files/index.cjs +4 -3
  85. package/dist/files/index.cjs.map +1 -1
  86. package/dist/files/index.js +4 -3
  87. package/dist/files/index.js.map +1 -1
  88. package/dist/home/index.cjs +18 -17
  89. package/dist/home/index.cjs.map +1 -1
  90. package/dist/home/index.js +3 -2
  91. package/dist/home/index.js.map +1 -1
  92. package/dist/index.cjs +637 -580
  93. package/dist/index.cjs.map +1 -1
  94. package/dist/index.d.ts +1 -1
  95. package/dist/index.js +13 -12
  96. package/dist/index.js.map +1 -1
  97. package/dist/lib/format.d.ts +31 -0
  98. package/dist/retrieval/index.cjs +36 -36
  99. package/dist/retrieval/index.js +1 -1
  100. package/dist/settings/index.cjs +12 -10
  101. package/dist/settings/index.cjs.map +1 -1
  102. package/dist/settings/index.js +12 -10
  103. package/dist/settings/index.js.map +1 -1
  104. package/dist/shell/SplitLayout.d.ts +32 -0
  105. package/dist/shell/index.cjs +72 -68
  106. package/dist/shell/index.d.ts +1 -0
  107. package/dist/shell/index.js +2 -2
  108. package/dist/site/index.cjs +71 -71
  109. package/dist/site/index.js +3 -3
  110. package/dist/studio/index.cjs +79 -76
  111. package/dist/studio/index.cjs.map +1 -1
  112. package/dist/studio/index.js +9 -6
  113. package/dist/studio/index.js.map +1 -1
  114. package/dist/workspaces/WorkspaceGallery.d.ts +42 -0
  115. package/dist/workspaces/index.cjs +74 -7
  116. package/dist/workspaces/index.cjs.map +1 -1
  117. package/dist/workspaces/index.d.ts +2 -0
  118. package/dist/workspaces/index.js +73 -7
  119. package/dist/workspaces/index.js.map +1 -1
  120. package/package.json +3 -3
  121. package/src/blocks.css +10 -13
  122. package/dist/chunk-2K33YGM6.cjs.map +0 -1
  123. package/dist/chunk-54Q3RNJU.cjs.map +0 -1
  124. package/dist/chunk-7PEELPMA.js.map +0 -1
  125. package/dist/chunk-AZQDNYH4.js.map +0 -1
  126. package/dist/chunk-G3G7LZPM.cjs.map +0 -1
  127. package/dist/chunk-GDFWJ73C.cjs.map +0 -1
  128. package/dist/chunk-ITGHMJOM.js.map +0 -1
  129. package/dist/chunk-SCFYPAG6.cjs +0 -18
  130. package/dist/chunk-SCFYPAG6.cjs.map +0 -1
  131. package/dist/chunk-UFHMLHIR.cjs.map +0 -1
  132. package/dist/chunk-UWGIB3VQ.js.map +0 -1
  133. package/dist/chunk-WJMEXTVD.cjs.map +0 -1
  134. package/dist/chunk-WTNMWEBC.js.map +0 -1
  135. package/dist/chunk-WW6EOVZA.js.map +0 -1
  136. package/dist/chunk-XNBAXRY7.cjs.map +0 -1
  137. package/dist/chunk-YBXCZEWS.js.map +0 -1
  138. package/dist/chunk-YDHO4AVL.js +0 -16
  139. package/dist/chunk-YDHO4AVL.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- export { ACTION_LABELS, AgentAvatarField, AgentBar, AgentBarIconButton, AgentBarMenu, AgentBarNotes, AgentBarProbeAnswer, AgentBarQueuedNote, AgentBarStatus, AgentCard, AgentCreateView, AgentCreatedView, AgentCreator, AgentEditView, AgentGallery, AgentMainView, AgentSelect, AgentTypeSelector, CapabilityGrid, CapabilityTile, ConfigField, ConfigForm, ConsentActions, ConsentBulletList, ConsentCard, ConsentFootnote, ConsentHeader, ConsentMessage, ConsentNotice, ConsentPage, ConsentPermissionList, ConsentSection, ConsentStrong, ConsentText, CopyableUrl, DEFAULT_AGENT_AVATAR_FIELD_LABELS, DEFAULT_AGENT_BAR_LABELS, DEFAULT_AGENT_CARD_LABELS, DEFAULT_AGENT_CREATOR_LABELS, DEFAULT_AGENT_GALLERY_LABELS, DEFAULT_AGENT_SELECT_LABELS, DEFAULT_AGENT_STEPS_LABELS, DEFAULT_AGENT_TYPE_SELECTOR_LABELS, DEFAULT_AUTHORIZE_AGENT_LABELS, DEFAULT_CONFIG_FIELD_LABELS, DEFAULT_CONFIG_FORM_LABELS, DEFAULT_CONSENT_ACTIONS_LABELS, DEFAULT_COPYABLE_URL_LABELS, DEFAULT_LIVE_RUNS_BANNER_LABELS, DEFAULT_RECURRENCE, DEFAULT_RECURRENCE_BUILDER_LABELS, DEFAULT_SCHEMA_FORM_LABELS, DEFAULT_SKILL_CARD_LABELS, DEFAULT_SKILL_EDIT_FORM_LABELS, DEFAULT_SKILL_GENERATE_FORM_LABELS, DEFAULT_SKILL_GLOBAL_BADGE_LABELS, DEFAULT_SKILL_ROW_LABELS, DEFAULT_SKILL_VIEW_TOGGLE_LABELS, DEFAULT_SUBAGENT_ROSTER_LABELS, DEFAULT_TASKS_CHROME_LABELS, DEFAULT_TASK_COLUMN_LABELS, DEFAULT_TASK_COMPOSER_LABELS, DEFAULT_TASK_PLAN_LABELS, DEFAULT_TASK_ROW_ACTIONS_LABELS, DEFAULT_TASK_RUNS_DIALOG_LABELS, DEFAULT_TUPLE_ARRAY_FIELD_LABELS, DEFAULT_UPLOAD_TASK_ITEM_LABELS, DEFAULT_UPLOAD_TASK_LIST_LABELS, DEFAULT_WORKFLOW_CONFIG_DIALOG_LABELS, EMPTY_WORKFLOW_SCOPE, GoalCriteria, LiveRunsBanner, NewTaskEmptyAction, RecurrenceBuilder, SKILL_PROMPT_FALLBACK_PLACEHOLDER, SKILL_PROMPT_LABEL, STATUS_LABELS, SchemaForm, SkillActionButton, SkillCard, SkillDetail, SkillDetailSection, SkillEditForm, SkillFilterChips, SkillGenerateForm, SkillGlobalBadge, SkillRow, SkillTile, SkillTypeBadge, SkillViewToggle, StepDetail, StepNarration, StepOutcome, StepParams, StepRow, StepSummary, StepTrace, StepTraceSummary, SubAgentLane, SubStepGroup, SubagentRoster, TRIGGER_LABELS, TaskComposer, TaskPlan, TaskRowActions, TaskRunsDialog, TasksBulkBar, TasksToolbar, TupleArrayField, UploadTaskItem, UploadTaskList, WEEKDAYS, WorkflowConfigDialog, WorkflowLauncher, buildLaunch, buildRRule, composeWorkflowPrompt, createTaskColumns, defaultInputs, defaultTaskComposerValues, deriveAgentName, describeRRule, formatElapsed, goalProgress, humanizeSection, inferType, inputsFromContext, isEmptyWorkflowScope, isOutOfBounds, isValidAgentName, isWorkflowScope, nextCriterionId, parseRRule, prettifyKey, promptFieldName, skillToWorkflow, statusBadgeVariant, summarizeAgent, summarizeCapabilities, validateInputs, workflowAccepts, workflowFromFrontmatter, workflowsAccepting, workflowsForHost } from '../chunk-ITGHMJOM.js';
3
- import '../chunk-WTNMWEBC.js';
2
+ export { ACTION_LABELS, AgentAvatarField, AgentBar, AgentBarIconButton, AgentBarMenu, AgentBarNotes, AgentBarProbeAnswer, AgentBarQueuedNote, AgentBarStatus, AgentCard, AgentCreateView, AgentCreatedView, AgentCreator, AgentEditView, AgentGallery, AgentMainView, AgentSelect, AgentTypeSelector, CapabilityGrid, CapabilityTile, ConfigField, ConfigForm, ConsentActions, ConsentBulletList, ConsentCard, ConsentFootnote, ConsentHeader, ConsentMessage, ConsentNotice, ConsentPage, ConsentPermissionList, ConsentSection, ConsentStrong, ConsentText, CopyableUrl, DEFAULT_AGENT_AVATAR_FIELD_LABELS, DEFAULT_AGENT_BAR_LABELS, DEFAULT_AGENT_CARD_LABELS, DEFAULT_AGENT_CREATOR_LABELS, DEFAULT_AGENT_GALLERY_LABELS, DEFAULT_AGENT_SELECT_LABELS, DEFAULT_AGENT_STEPS_LABELS, DEFAULT_AGENT_TYPE_SELECTOR_LABELS, DEFAULT_AUTHORIZE_AGENT_LABELS, DEFAULT_CONFIG_FIELD_LABELS, DEFAULT_CONFIG_FORM_LABELS, DEFAULT_CONSENT_ACTIONS_LABELS, DEFAULT_COPYABLE_URL_LABELS, DEFAULT_LIVE_RUNS_BANNER_LABELS, DEFAULT_RECURRENCE, DEFAULT_RECURRENCE_BUILDER_LABELS, DEFAULT_SCHEMA_FORM_LABELS, DEFAULT_SKILL_CARD_LABELS, DEFAULT_SKILL_EDIT_FORM_LABELS, DEFAULT_SKILL_GENERATE_FORM_LABELS, DEFAULT_SKILL_GLOBAL_BADGE_LABELS, DEFAULT_SKILL_ROW_LABELS, DEFAULT_SKILL_VIEW_TOGGLE_LABELS, DEFAULT_SUBAGENT_ROSTER_LABELS, DEFAULT_TASKS_CHROME_LABELS, DEFAULT_TASK_COLUMN_LABELS, DEFAULT_TASK_COMPOSER_LABELS, DEFAULT_TASK_PLAN_LABELS, DEFAULT_TASK_ROW_ACTIONS_LABELS, DEFAULT_TASK_RUNS_DIALOG_LABELS, DEFAULT_TUPLE_ARRAY_FIELD_LABELS, DEFAULT_UPLOAD_TASK_ITEM_LABELS, DEFAULT_UPLOAD_TASK_LIST_LABELS, DEFAULT_WORKFLOW_CONFIG_DIALOG_LABELS, EMPTY_WORKFLOW_SCOPE, GoalCriteria, LiveRunsBanner, NewTaskEmptyAction, RecurrenceBuilder, SKILL_PROMPT_FALLBACK_PLACEHOLDER, SKILL_PROMPT_LABEL, STATUS_LABELS, SchemaForm, SkillActionButton, SkillCard, SkillDetail, SkillDetailSection, SkillEditForm, SkillFilterChips, SkillGenerateForm, SkillGlobalBadge, SkillRow, SkillTile, SkillTypeBadge, SkillViewToggle, StepDetail, StepNarration, StepOutcome, StepParams, StepRow, StepSummary, StepTrace, StepTraceSummary, SubAgentLane, SubStepGroup, SubagentRoster, TRIGGER_LABELS, TaskComposer, TaskPlan, TaskRowActions, TaskRunsDialog, TasksBulkBar, TasksToolbar, TupleArrayField, UploadTaskItem, UploadTaskList, WEEKDAYS, WorkflowConfigDialog, WorkflowLauncher, buildLaunch, buildRRule, composeWorkflowPrompt, createTaskColumns, defaultInputs, defaultTaskComposerValues, deriveAgentName, describeRRule, formatElapsed, goalProgress, humanizeSection, inferType, inputsFromContext, isEmptyWorkflowScope, isOutOfBounds, isValidAgentName, isWorkflowScope, nextCriterionId, parseRRule, prettifyKey, promptFieldName, skillToWorkflow, statusBadgeVariant, summarizeAgent, summarizeCapabilities, validateInputs, workflowAccepts, workflowFromFrontmatter, workflowsAccepting, workflowsForHost } from '../chunk-AAY5ASZD.js';
3
+ import '../chunk-NJL4LIXX.js';
4
4
  import '../chunk-CQCC7LE7.js';
5
5
  import '../chunk-P6GHJSLR.js';
6
6
  import '../chunk-S7PSMMRG.js';
@@ -9,6 +9,7 @@ import '../chunk-NUNKSZKU.js';
9
9
  import '../chunk-UBNVIIBT.js';
10
10
  import '../chunk-NPLYHR2E.js';
11
11
  import '../chunk-76JDDMSP.js';
12
+ import '../chunk-OXF2IFXG.js';
12
13
  import '../chunk-7F6CBP3Z.js';
13
14
  //# sourceMappingURL=index.js.map
14
15
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,39 @@
1
+ import type { ChatPageController, ChatPageProps } from './chat-page-types';
2
+ declare function set(next: boolean): void;
3
+ export declare function useAssistantDock(): {
4
+ isOpen: boolean;
5
+ setOpen: typeof set;
6
+ toggle: () => void;
7
+ };
8
+ export interface AssistantDockToggleProps {
9
+ /** Accessible name. Default "Open assistant chat". */
10
+ label?: string;
11
+ testId?: string;
12
+ }
13
+ /** Topbar button that opens and closes the dock. Renders nothing while a page chat is mounted. */
14
+ export declare function AssistantDockToggle({ label, testId, }: AssistantDockToggleProps): import("react").JSX.Element | null;
15
+ export interface AssistantDockProps extends Omit<ChatPageProps, 'chat' | 'surface'> {
16
+ chat: ChatPageController;
17
+ /** Phone layout: the dock covers the screen as a modal. */
18
+ isMobile?: boolean;
19
+ /** Desktop width. Default 380. */
20
+ width?: number | string;
21
+ /** Accessible name of the dock. Default "Assistant chat". */
22
+ label?: string;
23
+ closeLabel?: string;
24
+ }
25
+ /**
26
+ * The assistant as a right-hand dock: `Shell.Dock` around the same `ChatPage` as the full page
27
+ * (`surface="dock"`), with its open state in `useAssistantDock`. It yields to a mounted page chat
28
+ * (`useChatSurface`), so the host only mounts it once, next to `Shell.Root`'s `aside`:
29
+ *
30
+ * ```tsx
31
+ * <Shell.Root aside={<AssistantDock chat={chat} isMobile={isMobile} />} ... />
32
+ * <AssistantDockToggle /> // in the topbar
33
+ * ```
34
+ *
35
+ * Keep the `chat` controller in a component that stays mounted (the layout), so the conversation
36
+ * survives closing the dock.
37
+ */
38
+ export declare function AssistantDock({ chat, isMobile, width, label, closeLabel, headerActions, ...pageProps }: AssistantDockProps): import("react").JSX.Element | null;
39
+ export {};
@@ -0,0 +1,17 @@
1
+ import type { ChatPageController, ChatPageLabels } from './chat-page-types';
2
+ interface ChatDocumentsProps {
3
+ chat: Pick<ChatPageController, 'documents' | 'isUploading' | 'toggleDocument' | 'selectAllDocuments'>;
4
+ labels: ChatPageLabels;
5
+ onPickFiles: () => void;
6
+ testIds?: Partial<{
7
+ documents: string;
8
+ upload: string;
9
+ }>;
10
+ }
11
+ /**
12
+ * The document context chip of the composer: how many documents the questions are grounded on,
13
+ * and a popover to pick them or upload more. The count is on the chip, the names are in the list,
14
+ * so the same part reads in a dock (no room) and on a page.
15
+ */
16
+ export declare function ChatDocuments({ chat, labels, onPickFiles, testIds }: ChatDocumentsProps): import("react").JSX.Element;
17
+ export {};
@@ -0,0 +1,16 @@
1
+ import { type ChatPageProps } from './chat-page-types';
2
+ /**
3
+ * A complete assistant chat, composed from the same parts as the dock: conversation list with
4
+ * auto-titles, message list, composer with the document chip and upload, empty state, error and
5
+ * retry. Drive it with `useArbiChat()` from `@arbidocs/react` (or fill `ChatPageController`).
6
+ *
7
+ * It sizes to its container, not the viewport (container queries on the root), so it holds up in
8
+ * a card, beside an open dock or on a phone: the conversation list is a column from 48rem and a
9
+ * select below; the `aside` slot (workflow launcher) is a column from 72rem and a collapsible
10
+ * panel below. Give it a height (`h-full` of a sized parent, or a `className`). Colours come from
11
+ * the tokens only; the user bubble has two optional ones (see `USER_BUBBLE`).
12
+ *
13
+ * With `surface="page"` it claims the page-chat slot, so `useChatSurface()` tells the host's dock
14
+ * to yield: one chat on screen, never two.
15
+ */
16
+ export declare function ChatPage({ chat, surface, header, headerActions, aside, prompts, emptyTitle, emptyDescription, identity, renderContent, accept, labels, className, testIds, }: ChatPageProps): import("react").JSX.Element;
@@ -0,0 +1,28 @@
1
+ import type { ChatPageLabels, ChatPageThread } from './chat-page-types';
2
+ interface ThreadProps {
3
+ threads: ReadonlyArray<ChatPageThread>;
4
+ activeId: string;
5
+ labels: ChatPageLabels;
6
+ onSelect: (id: string) => void;
7
+ onNew: () => void;
8
+ onDelete?: (id: string) => void;
9
+ testIds?: Partial<{
10
+ list: string;
11
+ row: string;
12
+ delete: string;
13
+ new: string;
14
+ select: string;
15
+ }>;
16
+ }
17
+ /**
18
+ * The conversation list as a column (wide containers): New chat on top, one row per thread with a
19
+ * delete action. The active row is `aria-current`. Rows are real buttons, so keyboard and touch
20
+ * work; delete is always visible on touch and appears on hover/focus elsewhere.
21
+ */
22
+ export declare function ChatThreadList({ threads, activeId, labels, onSelect, onNew, onDelete, testIds, }: ThreadProps): import("react").JSX.Element;
23
+ /**
24
+ * The conversation list as one native select (narrow containers, the dock). Native on purpose:
25
+ * the platform picker on a phone, a label for screen readers, text at least 16px on touch.
26
+ */
27
+ export declare function ChatThreadSelect({ threads, activeId, labels, onSelect, testIds, }: Pick<ThreadProps, 'threads' | 'activeId' | 'labels' | 'onSelect' | 'testIds'>): import("react").JSX.Element;
28
+ export {};
@@ -0,0 +1,121 @@
1
+ import type { ReactNode } from 'react';
2
+ /**
3
+ * The view-model of a chat page. It is the shape `useArbiChat()` from `@arbidocs/react` returns,
4
+ * so `<ChatPage chat={useArbiChat(...)} />` works without an adapter; any other source (a demo,
5
+ * another backend) can fill it in. Plain data and callbacks: no SDK, store or router.
6
+ */
7
+ export interface ChatPageMessage {
8
+ id: string;
9
+ role: 'user' | 'assistant';
10
+ /** Markdown for an assistant message, plain text for a user message. */
11
+ content: string;
12
+ status: 'streaming' | 'complete' | 'error';
13
+ /** Why an assistant message failed. */
14
+ error?: string;
15
+ /** Agent steps the answer took so far. */
16
+ stepCount?: number;
17
+ }
18
+ export interface ChatPageThread {
19
+ id: string;
20
+ /** Empty until the first question titles it. */
21
+ title: string;
22
+ }
23
+ export interface ChatPageDocument {
24
+ id: string;
25
+ name: string;
26
+ isSelected: boolean;
27
+ }
28
+ export interface ChatPageController {
29
+ threads: ReadonlyArray<ChatPageThread>;
30
+ activeThreadId: string;
31
+ messages: ReadonlyArray<ChatPageMessage>;
32
+ isRunning: boolean;
33
+ /** The last turn failed. */
34
+ error: string | null;
35
+ documents: ReadonlyArray<ChatPageDocument>;
36
+ isLoadingDocuments: boolean;
37
+ isUploading: boolean;
38
+ uploadError: string | null;
39
+ send: (text: string) => void | Promise<void>;
40
+ retry: () => void | Promise<void>;
41
+ selectThread: (id: string) => void;
42
+ newThread: () => void;
43
+ /** Omit to hide the delete action. */
44
+ deleteThread?: (id: string) => void;
45
+ toggleDocument: (id: string) => void;
46
+ selectAllDocuments: () => void;
47
+ upload: (files: File[]) => void | Promise<void>;
48
+ }
49
+ /** Every fixed string of the chat page. Pass a partial `labels` to translate or reword. */
50
+ export interface ChatPageLabels {
51
+ /** Accessible name of the whole chat. */
52
+ chat: string;
53
+ conversations: string;
54
+ newChat: string;
55
+ untitled: string;
56
+ deleteConversation: (title: string) => string;
57
+ /** Assistant name on the answer's byline. */
58
+ assistant: string;
59
+ thinking: string;
60
+ steps: (count: number) => string;
61
+ responseFailed: string;
62
+ answerFailedTitle: string;
63
+ uploadFailedTitle: string;
64
+ placeholder: string;
65
+ composerAriaLabel: string;
66
+ documentsInChat: (selected: number, total: number) => string;
67
+ documentsHeading: string;
68
+ selectAllDocuments: string;
69
+ noDocuments: string;
70
+ uploadDocuments: string;
71
+ uploading: string;
72
+ emptyTitle: string;
73
+ emptyDescription: string;
74
+ emptyUploadTitle: string;
75
+ emptyUploadDescription: string;
76
+ workflows: string;
77
+ loadingDocuments: string;
78
+ }
79
+ export declare const DEFAULT_CHAT_PAGE_LABELS: ChatPageLabels;
80
+ export interface ChatPageProps {
81
+ chat: ChatPageController;
82
+ /**
83
+ * `page` (default): a full-page chat; while it is mounted the dock yields (see
84
+ * `useChatSurface`). `dock`: the same chat in the dock, which does not claim the page slot.
85
+ */
86
+ surface?: 'page' | 'dock';
87
+ /** Replaces the heading (default: the active conversation's title). */
88
+ header?: ReactNode;
89
+ /** Actions at the right of the header bar. */
90
+ headerActions?: ReactNode;
91
+ /**
92
+ * The workflow launcher column. A column beside the chat when the container is wide, a
93
+ * collapsible panel under the header when it is not (so an open dock never squeezes it).
94
+ */
95
+ aside?: ReactNode;
96
+ /** Starter questions on the empty conversation; clicking one fills the composer. */
97
+ prompts?: ReadonlyArray<string>;
98
+ /** Heading of the empty state; wins over `labels.emptyTitle`. */
99
+ emptyTitle?: string;
100
+ /** Sub-heading of the empty state; wins over `labels.emptyDescription`. */
101
+ emptyDescription?: string;
102
+ /** Identity chip on the answer's byline (default: the assistant label). */
103
+ identity?: ReactNode;
104
+ /** Renders an answer. Default: the shared markdown renderer (lists, tables, cited words). */
105
+ renderContent?: (message: ChatPageMessage) => ReactNode;
106
+ /** Accepted upload types for the file picker. */
107
+ accept?: string;
108
+ labels?: Partial<ChatPageLabels>;
109
+ className?: string;
110
+ testIds?: Partial<{
111
+ root: string;
112
+ transcript: string;
113
+ input: string;
114
+ send: string;
115
+ documents: string;
116
+ upload: string;
117
+ alert: string;
118
+ asideToggle: string;
119
+ aside: string;
120
+ }>;
121
+ }
@@ -0,0 +1,9 @@
1
+ /** Claims the page-chat slot while `enabled` and the caller is mounted. `ChatPage` calls this. */
2
+ export declare function useRegisterEmbeddedChat(enabled?: boolean): void;
3
+ export interface ChatSurface {
4
+ /** A full-page chat is mounted. */
5
+ hasEmbeddedChat: boolean;
6
+ /** The dock (and its topbar button) may be offered: false while a page chat is mounted. */
7
+ isDockAvailable: boolean;
8
+ }
9
+ export declare function useChatSurface(): ChatSurface;