@parallelworks/ui 0.18.0 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/README.md +86 -6
  2. package/dist/ai/adapter/memoryStore.d.ts +8 -0
  3. package/dist/ai/adapter/mock/index.d.ts +2 -0
  4. package/dist/ai/adapter/mock/index.js +81 -0
  5. package/dist/ai/adapter/mock/mockAdapter.d.ts +4 -0
  6. package/dist/ai/adapter/openai/createOpenAIStream.d.ts +9 -0
  7. package/dist/ai/adapter/openai/errors.d.ts +3 -0
  8. package/dist/ai/adapter/openai/index.d.ts +6 -0
  9. package/dist/ai/adapter/openai/index.js +334 -0
  10. package/dist/ai/adapter/openai/openaiAdapter.d.ts +9 -0
  11. package/dist/ai/adapter/openai/responses.d.ts +4 -0
  12. package/dist/ai/adapter/openai/sse.d.ts +24 -0
  13. package/dist/ai/adapter/openai/wire.d.ts +40 -0
  14. package/dist/ai/adapter/types.d.ts +131 -0
  15. package/dist/ai/agent/classifier.d.ts +2 -0
  16. package/dist/ai/agent/diff.d.ts +35 -0
  17. package/dist/ai/agent/diffHighlight.d.ts +6 -0
  18. package/dist/ai/agent/index.d.ts +6 -0
  19. package/dist/ai/agent/permissions.d.ts +11 -0
  20. package/dist/ai/agent/toolfmt.d.ts +18 -0
  21. package/dist/ai/agent/transcript.d.ts +38 -0
  22. package/dist/ai/ai.css +325 -0
  23. package/dist/ai/components/AllocationSelector.d.ts +4 -0
  24. package/dist/ai/components/AttachmentManager.d.ts +1 -0
  25. package/dist/ai/components/AttachmentUpload.d.ts +24 -0
  26. package/dist/ai/components/BlockedGroupBanner.d.ts +1 -0
  27. package/dist/ai/components/BranchNavigator.d.ts +8 -0
  28. package/dist/ai/components/ChatEmptyState.d.ts +3 -0
  29. package/dist/ai/components/ChatInput.d.ts +45 -0
  30. package/dist/ai/components/ChatLayout.d.ts +5 -0
  31. package/dist/ai/components/ChatMessage.d.ts +24 -0
  32. package/dist/ai/components/ChatMessageList.d.ts +35 -0
  33. package/dist/ai/components/ChatSidebar.d.ts +5 -0
  34. package/dist/ai/components/ChatThread.d.ts +3 -0
  35. package/dist/ai/components/ComposerChrome.d.ts +18 -0
  36. package/dist/ai/components/ComposerFrame.d.ts +16 -0
  37. package/dist/ai/components/DragOverlay.d.ts +5 -0
  38. package/dist/ai/components/ModelSelector.d.ts +6 -0
  39. package/dist/ai/components/ShareDialog.d.ts +11 -0
  40. package/dist/ai/components/SlashMenu.d.ts +28 -0
  41. package/dist/ai/components/agent/ActivityLine.d.ts +21 -0
  42. package/dist/ai/components/agent/AgentMessageParts.d.ts +54 -0
  43. package/dist/ai/components/agent/PermissionPicker.d.ts +11 -0
  44. package/dist/ai/components/attachmentKeys.d.ts +4 -0
  45. package/dist/ai/core/ChatProvider.d.ts +66 -0
  46. package/dist/ai/core/KeyboardShortcutsProvider.d.ts +5 -0
  47. package/dist/ai/core/chatReducer.d.ts +114 -0
  48. package/dist/ai/core/config.d.ts +47 -0
  49. package/dist/ai/core/events.d.ts +1 -0
  50. package/dist/ai/core/exportConversation.d.ts +4 -0
  51. package/dist/ai/core/greeting.d.ts +3 -0
  52. package/dist/ai/core/parts.d.ts +11 -0
  53. package/dist/ai/core/useDragDrop.d.ts +14 -0
  54. package/dist/ai/core/useKeyboardShortcuts.d.ts +12 -0
  55. package/dist/ai/core/useSSEStream.d.ts +34 -0
  56. package/dist/ai/index.d.ts +40 -0
  57. package/dist/ai/index.js +6645 -0
  58. package/dist/ai/strings.d.ts +167 -0
  59. package/dist/ai/types.d.ts +236 -0
  60. package/dist/ai/ui/Avatar.d.ts +8 -0
  61. package/dist/ai/ui/Dropdown.d.ts +31 -0
  62. package/dist/ai/ui/Markdown.d.ts +8 -0
  63. package/dist/ai/ui/Notice.d.ts +21 -0
  64. package/dist/ai/ui/buttons.d.ts +1 -0
  65. package/dist/ai/ui/codeBreaks.d.ts +16 -0
  66. package/dist/ai/ui/prose.d.ts +1 -0
  67. package/dist/ai/ui/sidebar.d.ts +81 -0
  68. package/dist/ai/utils.d.ts +4 -0
  69. package/dist/assets/{editor.worker-CuBRIwi-.js → editor.worker-BmHUIVG4.js} +194 -163
  70. package/dist/assets/{json.worker-8ytS02vz.js → json.worker-D8bJ92nw.js} +384 -338
  71. package/dist/assets/{yaml.worker-DJC-VUcv.js → yaml.worker-C4gyGAko.js} +15657 -13823
  72. package/dist/chunks/{CodePreviewEditor-4lx3kE-w.js → CodePreviewEditor-YqQBz1YL.js} +1 -1
  73. package/dist/chunks/ConfirmModal-aOR4O1QE.js +79 -0
  74. package/dist/chunks/{FieldWrapper-Bef01EWO.js → FieldWrapper-Cszwg-4B.js} +3 -7
  75. package/dist/chunks/{CreateModal-BY6DLmur.js → Markdown-CM-FenNE.js} +19 -91
  76. package/dist/chunks/Monaco-DJ8MW-Dq.js +110 -0
  77. package/dist/chunks/{PageHeader-l49p1nM9.js → PageHeader-0kG_iypP.js} +67 -65
  78. package/dist/chunks/{Provider-Ghua9PkN.js → Provider-CDYurraE.js} +54 -20
  79. package/dist/chunks/{SwitchToggle-CHPP8uZQ.js → SwitchToggle-DShNdcao.js} +135 -132
  80. package/dist/chunks/{Table-4OHjdKdO.js → Table-DU2MW8xz.js} +5 -3
  81. package/dist/chunks/{Tooltip-Crxo_eU_.js → Tooltip-K5HJr4_p.js} +31 -4
  82. package/dist/chunks/duration-BOv8Phl8.js +17 -0
  83. package/dist/chunks/{editor-9_uVtUyy.js → editor-Dk1rbV75.js} +32 -18
  84. package/dist/chunks/focus-D_iZJTW1.js +7 -0
  85. package/dist/chunks/{list-qrojZZNv.js → list-CJm875m7.js} +377 -370
  86. package/dist/chunks/logviewer-BTKuQWzw.js +828 -0
  87. package/dist/chunks/memoryStore-CC91S5LP.js +152 -0
  88. package/dist/chunks/types-Yy0NrerF.js +11 -0
  89. package/dist/components/Avatar.d.ts +1 -1
  90. package/dist/components/Breadcrumbs.d.ts +1 -1
  91. package/dist/components/Dropdown.d.ts +1 -1
  92. package/dist/components/EmptyState.d.ts +1 -1
  93. package/dist/components/Indicator.d.ts +2 -2
  94. package/dist/components/Input.d.ts +1 -1
  95. package/dist/components/LetterBadge.d.ts +1 -1
  96. package/dist/components/MarkdownImpl.d.ts +1 -1
  97. package/dist/components/Provider.d.ts +16 -65
  98. package/dist/components/SettingRow.d.ts +1 -1
  99. package/dist/components/SettingsGroup.d.ts +1 -1
  100. package/dist/components/focus.d.ts +2 -0
  101. package/dist/components/keys.d.ts +12 -0
  102. package/dist/duration.d.ts +3 -0
  103. package/dist/editor/Monaco.d.ts +1 -20
  104. package/dist/editor/index.d.ts +2 -1
  105. package/dist/editor/index.js +2 -2
  106. package/dist/editor/yaml.d.ts +5 -0
  107. package/dist/engine.d.ts +98 -0
  108. package/dist/file-explorer/FileExplorer.d.ts +11 -2
  109. package/dist/file-explorer/FileExplorerContext.d.ts +1 -1
  110. package/dist/file-explorer/FilePreview/CodePreviewEditor.d.ts +1 -1
  111. package/dist/file-explorer/FilePreview/previewType.d.ts +1 -1
  112. package/dist/file-explorer/FileRow.d.ts +1 -1
  113. package/dist/file-explorer/helpers.d.ts +4 -4
  114. package/dist/file-explorer/index.d.ts +3 -3
  115. package/dist/file-explorer/index.js +613 -647
  116. package/dist/file-explorer/lib/types.d.ts +6 -1
  117. package/dist/file-explorer/lib/utils.d.ts +1 -3
  118. package/dist/file-explorer/useNearEnd.d.ts +1 -1
  119. package/dist/form/FieldWrapper.d.ts +2 -2
  120. package/dist/form/Fields/ResourceOptionIcon.d.ts +1 -1
  121. package/dist/form/Form.d.ts +4 -21
  122. package/dist/form/index.d.ts +11 -12
  123. package/dist/form/index.js +1488 -1611
  124. package/dist/form/lib.d.ts +6 -1
  125. package/dist/form/types/fieldComponentTypes.d.ts +3 -2
  126. package/dist/form/types/fieldTypes.d.ts +6 -20
  127. package/dist/form/useParsedOpts.d.ts +1 -1
  128. package/dist/form/utils/{slurmDuration.d.ts → duration.d.ts} +2 -2
  129. package/dist/{workflow → graph}/MatrixGroup.d.ts +2 -2
  130. package/dist/{workflow → graph}/index.d.ts +1 -1
  131. package/dist/{workflow → graph}/index.js +215 -180
  132. package/dist/{workflow → graph}/types.d.ts +3 -3
  133. package/dist/icons.d.ts +20 -21
  134. package/dist/index.d.ts +38 -40
  135. package/dist/index.js +347 -346
  136. package/dist/list/ListTable.d.ts +1 -1
  137. package/dist/list/ListViewControls.d.ts +2 -2
  138. package/dist/list/index.d.ts +9 -9
  139. package/dist/list/index.js +2 -2
  140. package/dist/logviewer/LogViewer.d.ts +1 -1
  141. package/dist/logviewer/index.d.ts +1 -0
  142. package/dist/logviewer/index.js +2 -742
  143. package/dist/logviewer/segments.d.ts +9 -0
  144. package/dist/styles/fonts.css +4 -4
  145. package/dist/styles/theme.css +6 -4
  146. package/dist/styles.css +1 -1
  147. package/dist/theme/index.js +2 -2
  148. package/package.json +38 -14
  149. package/LICENSE +0 -202
  150. package/dist/chunks/Monaco-C1POOdVv.js +0 -1046
  151. package/dist/editor/usesGitlab.d.ts +0 -97
  152. package/dist/form/Fields/BucketReadOnlyField.d.ts +0 -7
  153. package/dist/form/types/workflow-schema.d.ts +0 -1145
  154. package/dist/form/utils/pwResolver.d.ts +0 -18
  155. package/dist/chunks/{MarkdownImpl-Bq4QhrtA.js → MarkdownImpl-CyeTVvSt.js} +1 -1
  156. /package/dist/{workflow → graph}/AnnotationBanner.d.ts +0 -0
  157. /package/dist/{workflow → graph}/Collapse.d.ts +0 -0
  158. /package/dist/{workflow → graph}/DependencyGraph.d.ts +0 -0
  159. /package/dist/{workflow → graph}/JobSummary.d.ts +0 -0
  160. /package/dist/{workflow → graph}/Reveal.d.ts +0 -0
  161. /package/dist/{workflow → graph}/TreeView.d.ts +0 -0
@@ -0,0 +1,24 @@
1
+ import type { ApprovalAnswerValue, AttachmentRef, ChatMessage as Message } from '../types.js';
2
+ interface ChatMessageProps {
3
+ message: Message;
4
+ allMessages: Message[];
5
+ isStreaming?: boolean;
6
+ isEditing?: boolean;
7
+ showAuthor?: boolean | undefined;
8
+ currentUsername?: string | undefined;
9
+ attachmentDownloadUrl?: ((id: string) => string) | undefined;
10
+ onOpenAttachment?: ((attachment: AttachmentRef) => void) | undefined;
11
+ onNavigateBranch?: ((messageId: string) => void) | undefined;
12
+ onEdit?: ((messageId: string) => void) | undefined;
13
+ onSaveEdit?: ((messageId: string, content: string) => void) | undefined;
14
+ onCancelEdit?: (() => void) | undefined;
15
+ onRegenerate?: ((messageId: string) => void) | undefined;
16
+ onRetry?: ((messageId: string) => void) | undefined;
17
+ onOpenReasoning?: ((reasoning: string, duration: number | null) => void) | undefined;
18
+ onApprovalAnswer?: ((id: string, answer: ApprovalAnswerValue) => void) | undefined;
19
+ /** Drops the row's horizontal padding, for hosts that constrain the column themselves. */
20
+ flush?: boolean | undefined;
21
+ }
22
+ declare function ChatMessage({ message, allMessages, isStreaming, isEditing, showAuthor, currentUsername, attachmentDownloadUrl, onOpenAttachment, onNavigateBranch, onEdit, onSaveEdit, onCancelEdit, onRegenerate, onRetry, onOpenReasoning, onApprovalAnswer, flush, }: ChatMessageProps): import("react").JSX.Element | null;
23
+ declare const _default: import("react").MemoExoticComponent<typeof ChatMessage>;
24
+ export default _default;
@@ -0,0 +1,35 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { ApprovalAnswerValue, ChatMessage as Message } from '../types.js';
3
+ interface ChatMessageListProps {
4
+ messages: Message[];
5
+ allMessages: Message[];
6
+ streamingMessage?: Message | null;
7
+ queuedMessages?: Message[];
8
+ onRemoveQueued?: (id: string) => void;
9
+ editingMessageId?: string | null | undefined;
10
+ showAuthor?: boolean;
11
+ currentUsername?: string;
12
+ onNavigateBranch?: (messageId: string) => void;
13
+ onEditMessage?: ((messageId: string) => void) | undefined;
14
+ onSaveEdit?: (messageId: string, content: string) => void;
15
+ onCancelEdit?: () => void;
16
+ onRegenerateMessage?: ((messageId: string) => void) | undefined;
17
+ onRetryMessage?: ((messageId: string) => void) | undefined;
18
+ onOpenReasoning?: (reasoning: string, duration: number | null) => void;
19
+ onApprovalAnswer?: (id: string, answer: ApprovalAnswerValue) => void;
20
+ inputElement?: ReactNode;
21
+ /** Whether a turn is in flight, when the host tracks that itself rather
22
+ * than streaming through the provider. */
23
+ isStreaming?: boolean;
24
+ /** Rows without their own side padding, for a host that pads the column. */
25
+ flush?: boolean;
26
+ /** Names the list as a live log for assistive technology. */
27
+ label?: string;
28
+ /** Rendered after the last message, inside the scrolling column. */
29
+ footer?: ReactNode;
30
+ /** Off for a host that shows the turn's activity elsewhere, so the wait
31
+ * for the first frame is not announced twice. */
32
+ workingIndicator?: boolean;
33
+ }
34
+ export default function ChatMessageList({ messages, allMessages, streamingMessage, queuedMessages, onRemoveQueued, editingMessageId, showAuthor, currentUsername, onNavigateBranch, onEditMessage, onSaveEdit, onCancelEdit, onRegenerateMessage, onRetryMessage, onOpenReasoning, onApprovalAnswer, inputElement, isStreaming: isStreamingProp, flush, label, footer, workingIndicator, }: ChatMessageListProps): import("react").JSX.Element;
35
+ export {};
@@ -0,0 +1,5 @@
1
+ export type ConversationGroupKey = 'groupToday' | 'groupYesterday' | 'groupThisWeek' | 'groupThisMonth' | 'groupOlder';
2
+ export default function ChatSidebar({ actions, }: {
3
+ /** False when the host's page header carries new chat, attachments and search. */
4
+ actions?: boolean;
5
+ }): import("react").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export default function ChatThread({ conversationId }: {
2
+ conversationId: string;
3
+ }): import("react").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import type { ReactNode } from 'react';
2
+ /** Where the turn runs, sitting above the composer the way the terminal shows
3
+ * it: the machine, the workspace, and whatever else names the place. */
4
+ export declare function ComposerContext({ children }: {
5
+ children: ReactNode;
6
+ }): import("react").JSX.Element;
7
+ /** What the turn runs as, sitting under the composer: the surface's own
8
+ * controls on the left, the model on the right, both reading as plain text. */
9
+ export declare function ComposerSettings({ left, children }: {
10
+ left?: ReactNode;
11
+ children?: ReactNode;
12
+ }): import("react").JSX.Element;
13
+ /** The two selectors every surface carries, bare so they read as text beside
14
+ * whatever the surface puts next to them. */
15
+ export declare function ComposerControls({ targetSession }: {
16
+ targetSession?: string | null | undefined;
17
+ }): import("react").JSX.Element;
18
+ export declare function ConnectToolsLink(): import("react").JSX.Element | null;
@@ -0,0 +1,16 @@
1
+ import type { ReactNode } from 'react';
2
+ /** The column a composer sits in: notices above it, what the agent is doing
3
+ * right now, a row of chips saying where the message goes, the box itself,
4
+ * and a row of settings under it with the model and allocation on the right. */
5
+ export default function ComposerFrame({ notices, activity, above, belowLeft, belowRight, hint, className, children, }: {
6
+ notices?: ReactNode;
7
+ /** Sits where a terminal's spinner line would, just above the box. */
8
+ activity?: ReactNode;
9
+ above?: ReactNode;
10
+ belowLeft?: ReactNode;
11
+ /** Defaults to the model and allocation pickers. */
12
+ belowRight?: ReactNode;
13
+ hint?: string | undefined;
14
+ className?: string;
15
+ children: ReactNode;
16
+ }): import("react").JSX.Element;
@@ -0,0 +1,5 @@
1
+ interface DragOverlayProps {
2
+ className?: string;
3
+ }
4
+ export default function DragOverlay({ className }: DragOverlayProps): import("react").JSX.Element;
5
+ export {};
@@ -0,0 +1,6 @@
1
+ export declare function getProviderKeyFromModelId(modelId: string): string;
2
+ export default function ModelSelector({ targetSession, variant, }: {
3
+ targetSession?: string | null | undefined;
4
+ /** 'bare' drops the border and the icon, for a toolbar that reads as text. */
5
+ variant?: 'default' | 'bare';
6
+ }): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ interface ShareDialogProps {
2
+ conversationId: string;
3
+ isOpen: boolean;
4
+ onClose: () => void;
5
+ }
6
+ export default function ShareDialog({ conversationId, isOpen, onClose }: ShareDialogProps): import("react").JSX.Element | null;
7
+ export declare function ShareButton({ conversationId, disabled, }: {
8
+ conversationId: string;
9
+ disabled?: boolean;
10
+ }): import("react").JSX.Element | null;
11
+ export {};
@@ -0,0 +1,28 @@
1
+ import { type KeyboardEvent } from 'react';
2
+ export interface SlashCommandOption {
3
+ name: string;
4
+ description?: string | undefined;
5
+ usage?: string | undefined;
6
+ }
7
+ export interface SlashMenuConfig {
8
+ commands: SlashCommandOption[];
9
+ /** Names the listbox for assistive tech. */
10
+ label: string;
11
+ /** Called when the input first reads as a command, so a host can load the list lazily. */
12
+ onOpen?: (() => void) | undefined;
13
+ }
14
+ export declare function slashMatches(input: string, commands: SlashCommandOption[]): SlashCommandOption[];
15
+ /** The palette's open state and keys; the caller owns the input. */
16
+ export declare function useSlashMenu(input: string, config: SlashMenuConfig | undefined, setInput: (value: string) => void): {
17
+ open: boolean;
18
+ matches: SlashCommandOption[];
19
+ active: number;
20
+ choose: (name: string) => void;
21
+ handleKey: (e: KeyboardEvent<HTMLTextAreaElement>) => boolean;
22
+ };
23
+ export declare function SlashMenu({ label, matches, active, onChoose, }: {
24
+ label: string;
25
+ matches: SlashCommandOption[];
26
+ active: number;
27
+ onChoose: (name: string) => void;
28
+ }): import("react").JSX.Element;
@@ -0,0 +1,21 @@
1
+ /** The agent status words: one is picked per turn and held until it ends. */
2
+ export declare const activityWords: readonly ['Thinking', 'Cogitating', 'Pondering', 'Percolating', 'Ruminating', 'Noodling', 'Conjuring', 'Simmering', 'Marinating', 'Tinkering', 'Scheming', 'Brewing', 'Wrangling', 'Finagling', 'Spelunking', 'Puttering', 'Composing', 'Synthesizing', 'Deliberating', 'Mulling', 'Contemplating', 'Vibing', 'Whittling', 'Concocting', 'Formulating', 'Hatching', 'Herding', 'Ideating', 'Manifesting', 'Moseying', 'Musing', 'Percussing', 'Reticulating', 'Schlepping', 'Stewing', 'Transmuting', 'Wibbling', 'Crunching', 'Forging', 'Cooking'];
3
+ export declare function randomActivityWord(): string;
4
+ /** Elapsed run time the way an agent status line prints it: 45s, 2m13s,
5
+ * 1h2m3s. */
6
+ export declare function formatElapsed(seconds: number): string;
7
+ /** Token counts the way an agent status line prints them: 512, 1.2k, 3.4M. */
8
+ export declare function compactCount(n: number): string;
9
+ /** The terminal's "it's working" line for a running turn: spinner, status
10
+ * word, how long the turn has run, its token counts so far, and a way to
11
+ * stop it. */
12
+ export default function ActivityLine({ startedAt, inputTokens, outputTokens, onStop, stopping, word, testId, }: {
13
+ startedAt: string | null | undefined;
14
+ inputTokens?: number | undefined;
15
+ outputTokens?: number | undefined;
16
+ onStop?: (() => void) | undefined;
17
+ stopping?: boolean;
18
+ /** Replaces the turn's word, the way a running hook names itself. */
19
+ word?: string | undefined;
20
+ testId?: string;
21
+ }): import("react").JSX.Element;
@@ -0,0 +1,54 @@
1
+ import { type PartRendererProps } from '../../core/config.js';
2
+ import type { ApprovalPart, MessagePart, NoticePart, ReasoningPart, SubagentPart, TodoSnapshotPart, ToolCallPart } from '../../types.js';
3
+ export declare function ToolCallBlock({ part }: {
4
+ part: ToolCallPart;
5
+ }): import("react").JSX.Element;
6
+ /** Drawn the way the TUI draws a delegated Task: a tool-shaped header
7
+ * `Task(description)`, and under it the latest action while running or
8
+ * `Done (summary)` once finished. Expanding shows the whole activity feed. */
9
+ export declare function SubagentCard({ part }: {
10
+ part: SubagentPart;
11
+ }): import("react").JSX.Element;
12
+ export declare function ApprovalBlock({ part, onApprovalAnswer, }: {
13
+ part: ApprovalPart;
14
+ onApprovalAnswer?: PartRendererProps['onApprovalAnswer'];
15
+ }): import("react").JSX.Element;
16
+ export declare function TodoSnapshotBlock({ part }: {
17
+ part: TodoSnapshotPart;
18
+ }): import("react").JSX.Element;
19
+ export declare function NoticeBlock({ part }: {
20
+ part: NoticePart;
21
+ }): import("react").JSX.Element;
22
+ /** The TUI's thought: the body shows while it streams, then folds to its
23
+ * label and opens on request. The composer's activity line carries the
24
+ * live signal, so nothing here animates. */
25
+ export declare function ReasoningBlock({ part, isStreaming, }: {
26
+ part: ReasoningPart;
27
+ isStreaming?: boolean;
28
+ }): import("react").JSX.Element;
29
+ type RunMember = {
30
+ part: ToolCallPart | ReasoningPart;
31
+ index: number;
32
+ };
33
+ type RenderItem = {
34
+ kind: 'single';
35
+ part: MessagePart;
36
+ index: number;
37
+ } | {
38
+ kind: 'reasoning';
39
+ parts: ReasoningPart[];
40
+ index: number;
41
+ } | {
42
+ kind: 'rollup';
43
+ members: RunMember[];
44
+ };
45
+ /** Two thoughts with nothing visible between them read as one, not as a
46
+ * stack of identical lines. */
47
+ export declare function mergeReasoning(parts: ReasoningPart[]): ReasoningPart;
48
+ export declare function buildRenderItems(parts: MessagePart[]): RenderItem[];
49
+ export default function AgentMessageParts({ message, isStreaming, onApprovalAnswer, }: {
50
+ message: PartRendererProps['message'];
51
+ isStreaming?: boolean;
52
+ onApprovalAnswer?: PartRendererProps['onApprovalAnswer'];
53
+ }): import("react").JSX.Element;
54
+ export {};
@@ -0,0 +1,11 @@
1
+ import { type PermissionMode } from '../../agent/permissions.js';
2
+ /** What the agent may do, as a toolbar chip: the choices stop at the machine's
3
+ * ceiling, and a mode set elsewhere (plan, or one past the ceiling) still
4
+ * shows by name. */
5
+ export default function PermissionPicker({ mode, onPick, ceiling, disabled, }: {
6
+ mode: string | undefined;
7
+ onPick: (mode: PermissionMode) => void;
8
+ /** The machine's remoteMaxPermissionMode; unknown offers the daemon default. */
9
+ ceiling: string | undefined;
10
+ disabled?: boolean;
11
+ }): import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import type { AttachmentPage } from '../adapter/types.js';
2
+ export declare const ATTACHMENTS_PAGE_SIZE = 24;
3
+ export declare function attachmentsPageKey(index: number, previousPage: AttachmentPage | null): [string, string] | null;
4
+ export declare const ATTACHMENTS_INFINITE_KEY: string;
@@ -0,0 +1,66 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { ChatAdapter } from '../adapter/types.js';
3
+ import type { ChatModel, ChatNavigation, ChatNotify, ChatUser, Conversation, ConversationSummary, ChatMessage as Message, MessagePart, ProviderInfo, UnreachableSession } from '../types.js';
4
+ import { type ChatUIConfig } from './config.js';
5
+ interface ChatContextValue {
6
+ adapter: ChatAdapter;
7
+ currentUser: ChatUser;
8
+ navigation: ChatNavigation;
9
+ notify: ChatNotify;
10
+ activeConversationId: string | null;
11
+ conversations: ConversationSummary[];
12
+ currentConversation: Conversation | null;
13
+ providers: ProviderInfo[];
14
+ models: ChatModel[];
15
+ unreachableSessions: UnreachableSession[];
16
+ selectedProvider: string | null;
17
+ isSelectedModelAvailable: boolean;
18
+ selectedAllocation: string | null;
19
+ isLoading: boolean;
20
+ isLoadingConversation: boolean;
21
+ isLoadingModels: boolean;
22
+ hasLoadedModels: boolean;
23
+ modelsError: string | null;
24
+ isStreaming: boolean;
25
+ isThinking: boolean;
26
+ streamingContent: string;
27
+ streamingReasoning: string;
28
+ streamingParts: MessagePart[];
29
+ thinkingStartTime: number | null;
30
+ sidebarCollapsed: boolean;
31
+ queuedMessages: Message[];
32
+ loadConversations: () => Promise<void>;
33
+ loadConversation: (id: string) => Promise<void>;
34
+ loadProviders: () => Promise<void>;
35
+ refreshProviders: () => Promise<void>;
36
+ refreshModels: () => Promise<void>;
37
+ createConversation: (title?: string) => Promise<string | null>;
38
+ deleteConversation: (id: string) => Promise<boolean>;
39
+ sendMessage: (content: string, attachmentIds?: string[], parentId?: string, attachmentMeta?: Record<string, {
40
+ filename: string;
41
+ contentType: string;
42
+ size: number;
43
+ }>) => Promise<boolean>;
44
+ retryMessage: (messageId: string) => Promise<boolean>;
45
+ setSelectedProvider: (providerId: string | null) => void;
46
+ setSelectedAllocation: (allocation: string | null) => void;
47
+ stopStreaming: () => void;
48
+ removeQueuedMessage: (id: string) => void;
49
+ flushQueuedMessages: () => void;
50
+ toggleSidebar: () => void;
51
+ updateConversationTitle: (id: string, title: string) => Promise<boolean>;
52
+ navigateToBranch: (messageId: string) => void;
53
+ clearCurrentConversation: () => void;
54
+ }
55
+ export declare function useChat(): ChatContextValue;
56
+ export interface ChatProviderProps {
57
+ adapter: ChatAdapter;
58
+ currentUser: ChatUser;
59
+ navigation: ChatNavigation;
60
+ notify: ChatNotify;
61
+ activeConversationId?: string | null;
62
+ config?: ChatUIConfig;
63
+ children: ReactNode;
64
+ }
65
+ export declare function ChatProvider({ adapter, currentUser, navigation, notify, activeConversationId, config, children, }: ChatProviderProps): import("react").JSX.Element;
66
+ export {};
@@ -0,0 +1,5 @@
1
+ interface KeyboardShortcutsProviderProps {
2
+ children: React.ReactNode;
3
+ }
4
+ export declare function KeyboardShortcutsProvider({ children }: KeyboardShortcutsProviderProps): import("react").JSX.Element;
5
+ export {};
@@ -0,0 +1,114 @@
1
+ import type { PartDelta } from '../adapter/types.js';
2
+ import type { ChatMessage, ChatModel, Conversation, ConversationSummary, MessagePart, ProviderInfo, UnreachableSession } from '../types.js';
3
+ export interface ChatState {
4
+ conversations: ConversationSummary[];
5
+ currentConversation: Conversation | null;
6
+ providers: ProviderInfo[];
7
+ models: ChatModel[];
8
+ unreachableSessions: UnreachableSession[];
9
+ selectedProvider: string | null;
10
+ selectedAllocation: string | null;
11
+ isLoading: boolean;
12
+ isLoadingConversation: boolean;
13
+ isLoadingModels: boolean;
14
+ hasLoadedModels: boolean;
15
+ modelsError: string | null;
16
+ isStreaming: boolean;
17
+ isThinking: boolean;
18
+ streamingContent: string;
19
+ streamingReasoning: string;
20
+ streamingParts: MessagePart[];
21
+ thinkingStartTime: number | null;
22
+ sidebarCollapsed: boolean;
23
+ queuedMessages: ChatMessage[];
24
+ }
25
+ export type ChatAction = {
26
+ type: 'SET_CONVERSATIONS';
27
+ conversations: ConversationSummary[];
28
+ } | {
29
+ type: 'SET_CURRENT_CONVERSATION';
30
+ conversation: Conversation | null;
31
+ } | {
32
+ type: 'UPDATE_CURRENT_CONVERSATION_TITLE';
33
+ title: string;
34
+ } | {
35
+ type: 'SET_PROVIDERS';
36
+ providers: ProviderInfo[];
37
+ } | {
38
+ type: 'SET_MODELS';
39
+ models: ChatModel[];
40
+ unreachableSessions?: UnreachableSession[];
41
+ } | {
42
+ type: 'SET_SELECTED_PROVIDER';
43
+ providerId: string | null;
44
+ } | {
45
+ type: 'SET_SELECTED_ALLOCATION';
46
+ allocation: string | null;
47
+ } | {
48
+ type: 'SET_LOADING';
49
+ isLoading: boolean;
50
+ } | {
51
+ type: 'SET_LOADING_MODELS';
52
+ isLoadingModels: boolean;
53
+ } | {
54
+ type: 'SET_MODELS_ERROR';
55
+ error: string | null;
56
+ } | {
57
+ type: 'SET_STREAMING';
58
+ isStreaming: boolean;
59
+ conversationId?: string;
60
+ } | {
61
+ type: 'SET_THINKING';
62
+ isThinking: boolean;
63
+ } | {
64
+ type: 'APPEND_STREAMING_CONTENT';
65
+ content: string;
66
+ conversationId: string;
67
+ } | {
68
+ type: 'APPEND_STREAMING_REASONING';
69
+ reasoning: string;
70
+ conversationId: string;
71
+ } | {
72
+ type: 'APPLY_STREAMING_PART';
73
+ delta: PartDelta;
74
+ conversationId: string;
75
+ } | {
76
+ type: 'CLEAR_STREAMING_CONTENT';
77
+ conversationId?: string;
78
+ } | {
79
+ type: 'ADD_MESSAGE';
80
+ message: ChatMessage;
81
+ conversationId: string;
82
+ } | {
83
+ type: 'UPDATE_MESSAGE';
84
+ messageId: string;
85
+ updates: Partial<ChatMessage>;
86
+ conversationId: string;
87
+ } | {
88
+ type: 'TOGGLE_SIDEBAR';
89
+ } | {
90
+ type: 'ADD_CONVERSATION';
91
+ conversation: ConversationSummary;
92
+ } | {
93
+ type: 'REMOVE_CONVERSATION';
94
+ conversationId: string;
95
+ } | {
96
+ type: 'SET_LOADING_CONVERSATION';
97
+ isLoadingConversation: boolean;
98
+ } | {
99
+ type: 'RESTORE_BACKGROUND_STREAM';
100
+ content: string;
101
+ reasoning: string;
102
+ parts?: MessagePart[];
103
+ } | {
104
+ type: 'ADD_QUEUED_MESSAGE';
105
+ message: ChatMessage;
106
+ conversationId?: string;
107
+ } | {
108
+ type: 'REMOVE_QUEUED_MESSAGE';
109
+ id: string;
110
+ } | {
111
+ type: 'CLEAR_QUEUED_MESSAGES';
112
+ };
113
+ export declare const initialState: ChatState;
114
+ export declare function chatReducer(state: ChatState, action: ChatAction): ChatState;
@@ -0,0 +1,47 @@
1
+ import { type ComponentType, type MouseEventHandler, type ReactNode } from 'react';
2
+ import type { Components } from 'streamdown';
3
+ import { type ChatStrings } from '../strings.js';
4
+ import type { ApprovalAnswerValue, ChatLinkTarget, ChatMessage, CspKind, MessagePart, MessagePartKind } from '../types.js';
5
+ export interface PartRendererProps {
6
+ part: MessagePart;
7
+ message: ChatMessage;
8
+ isStreaming?: boolean;
9
+ onApprovalAnswer?: (id: string, answer: ApprovalAnswerValue) => void;
10
+ }
11
+ export interface ChatLinkProps {
12
+ target: ChatLinkTarget;
13
+ className?: string;
14
+ title?: string;
15
+ onClick?: MouseEventHandler;
16
+ children: ReactNode;
17
+ }
18
+ export interface ChatUIConfig {
19
+ LinkComponent?: ComponentType<ChatLinkProps>;
20
+ extraLinks?: {
21
+ connectTools?: string;
22
+ manageProviders?: string;
23
+ addProvider?: string;
24
+ providerSettings?: (owner: string, name: string) => string;
25
+ };
26
+ slots?: {
27
+ composerUsage?: ReactNode;
28
+ providerIcon?: (cspKind: CspKind, className?: string) => ReactNode;
29
+ partRenderers?: Partial<Record<MessagePartKind, ComponentType<PartRendererProps>>>;
30
+ };
31
+ strings?: {
32
+ [S in keyof ChatStrings]?: Partial<ChatStrings[S]>;
33
+ };
34
+ markdownComponents?: Components;
35
+ suggestedPrompts?: string[];
36
+ }
37
+ export interface ResolvedChatConfig {
38
+ LinkComponent: ComponentType<ChatLinkProps>;
39
+ extraLinks: NonNullable<ChatUIConfig['extraLinks']>;
40
+ slots: NonNullable<ChatUIConfig['slots']>;
41
+ strings: ChatStrings;
42
+ markdownComponents?: Components;
43
+ suggestedPrompts?: string[];
44
+ }
45
+ export declare function resolveChatConfig(config?: ChatUIConfig): ResolvedChatConfig;
46
+ export declare const ChatConfigProvider: import("react").Provider<ResolvedChatConfig>;
47
+ export declare function useChatConfig(): ResolvedChatConfig;
@@ -0,0 +1 @@
1
+ export declare const FOCUS_SIDEBAR_SEARCH_EVENT = "aichat:focus-sidebar-search";
@@ -0,0 +1,4 @@
1
+ import type { Conversation } from '../types.js';
2
+ export declare function conversationToMarkdown(conversation: Conversation): string;
3
+ export declare function exportFilename(title?: string | null): string;
4
+ export declare function downloadText(filename: string, text: string): void;
@@ -0,0 +1,3 @@
1
+ export declare function getGreeting(user: {
2
+ name?: string | null;
3
+ } | null): string;
@@ -0,0 +1,11 @@
1
+ import type { PartDelta } from '../adapter/types.js';
2
+ import type { MessagePart } from '../types.js';
3
+ /** Fold one streamed PartDelta into a parts timeline. Pure: returns a new
4
+ * array, leaving the input untouched, so it works for both reducer state
5
+ * and the provider's local accumulation. Unknown target ids are dropped
6
+ * rather than invented — an end without a start has nothing to render. */
7
+ export declare function applyPartDelta(parts: MessagePart[], delta: PartDelta): MessagePart[];
8
+ /** A turn can end (completed or stopped) with tool calls still marked
9
+ * running — the transport died before their tool_end arrived. A stored
10
+ * message must not spin forever, so close them out as interrupted. */
11
+ export declare function finalizeParts(parts: MessagePart[]): MessagePart[];
@@ -0,0 +1,14 @@
1
+ import { type DragEvent } from 'react';
2
+ interface UseDragDropOptions {
3
+ onFilesDropped: (files: FileList) => void;
4
+ }
5
+ export default function useDragDrop({ onFilesDropped }: UseDragDropOptions): {
6
+ isDragging: boolean;
7
+ dragHandlers: {
8
+ onDragEnter: (e: DragEvent) => void;
9
+ onDragLeave: (e: DragEvent) => void;
10
+ onDragOver: (e: DragEvent) => void;
11
+ onDrop: (e: DragEvent) => void;
12
+ };
13
+ };
14
+ export {};
@@ -0,0 +1,12 @@
1
+ import type { ChatMessage } from '../types.js';
2
+ interface UseKeyboardShortcutsOptions {
3
+ enabled?: boolean;
4
+ }
5
+ export declare function useKeyboardShortcuts(options?: UseKeyboardShortcutsOptions): {
6
+ getLastUserMessage: () => ChatMessage | null;
7
+ getLastAssistantMessage: () => string | null | undefined;
8
+ handleNewConversation: () => void;
9
+ handleCopyLastResponse: () => Promise<void>;
10
+ handleStopGeneration: () => void;
11
+ };
12
+ export {};
@@ -0,0 +1,34 @@
1
+ import type { MessagePart } from '../types.js';
2
+ import type { ChatAction } from './chatReducer.js';
3
+ interface BackgroundStream {
4
+ content: string;
5
+ reasoning: string;
6
+ parts: MessagePart[];
7
+ messageId: string | null;
8
+ isActive: boolean;
9
+ }
10
+ interface UseSSEStreamResult {
11
+ /** Feed a chunk of text into the animation buffer */
12
+ onStreamingChunk: (chunk: string) => void;
13
+ /** Start the animation loop for a conversation */
14
+ startStreaming: (conversationId: string) => void;
15
+ /** Stop the animation loop, flush remaining content */
16
+ stopAnimationLoop: () => {
17
+ unrevealed: string;
18
+ conversationId: string | null;
19
+ };
20
+ /** Reset all animation refs (used when navigating away) */
21
+ resetAnimationRefs: () => void;
22
+ /** Ref to the target content buffer */
23
+ targetStreamContentRef: React.RefObject<string>;
24
+ /** Ref tracking whether streaming is active */
25
+ streamActiveRef: React.MutableRefObject<boolean>;
26
+ /** Ref tracking which conversation is being streamed */
27
+ streamingConversationIdRef: React.MutableRefObject<string | null>;
28
+ /** Per-conversation background stream storage */
29
+ backgroundStreamsRef: React.MutableRefObject<Map<string, BackgroundStream>>;
30
+ /** AbortController ref for cancelling fetch requests */
31
+ abortControllerRef: React.MutableRefObject<AbortController | null>;
32
+ }
33
+ export declare function useSSEStream(dispatch: React.Dispatch<ChatAction>): UseSSEStreamResult;
34
+ export {};
@@ -0,0 +1,40 @@
1
+ export { durationToAbsHumanDuration } from '../duration.js';
2
+ export * from './adapter/types.js';
3
+ export * from './agent/index.js';
4
+ export { default as AllocationSelector } from './components/AllocationSelector.js';
5
+ export { default as AttachmentManager } from './components/AttachmentManager.js';
6
+ export { type Attachment, type AttachmentUploadHandle, default as AttachmentUpload, } from './components/AttachmentUpload.js';
7
+ export { compactCount, default as ActivityLine, formatElapsed, } from './components/agent/ActivityLine.js';
8
+ export { ApprovalBlock, default as AgentMessageParts, } from './components/agent/AgentMessageParts.js';
9
+ export { default as PermissionPicker } from './components/agent/PermissionPicker.js';
10
+ export { default as BlockedGroupBanner } from './components/BlockedGroupBanner.js';
11
+ export { default as BranchNavigator } from './components/BranchNavigator.js';
12
+ export { default as ChatEmptyState } from './components/ChatEmptyState.js';
13
+ export { type ChatInputHandle, default as ChatInput, } from './components/ChatInput.js';
14
+ export { default as ChatLayout } from './components/ChatLayout.js';
15
+ export { default as ChatMessageView } from './components/ChatMessage.js';
16
+ export { default as ChatMessageList } from './components/ChatMessageList.js';
17
+ export { default as ChatSidebar } from './components/ChatSidebar.js';
18
+ export { default as ChatThread } from './components/ChatThread.js';
19
+ export { ComposerContext, ComposerControls, ComposerSettings, ConnectToolsLink, } from './components/ComposerChrome.js';
20
+ export { default as ComposerFrame } from './components/ComposerFrame.js';
21
+ export { default as DragOverlay } from './components/DragOverlay.js';
22
+ export { default as ModelSelector, getProviderKeyFromModelId, } from './components/ModelSelector.js';
23
+ export { default as ShareDialog, ShareButton, } from './components/ShareDialog.js';
24
+ export { type SlashCommandOption, type SlashMenuConfig, slashMatches, } from './components/SlashMenu.js';
25
+ export { ChatProvider, type ChatProviderProps, useChat, } from './core/ChatProvider.js';
26
+ export { type ChatAction, type ChatState, chatReducer, initialState, } from './core/chatReducer.js';
27
+ export type { PartRendererProps } from './core/config.js';
28
+ export { type ChatLinkProps, type ChatUIConfig, resolveChatConfig, useChatConfig, } from './core/config.js';
29
+ export { FOCUS_SIDEBAR_SEARCH_EVENT } from './core/events.js';
30
+ export { getGreeting } from './core/greeting.js';
31
+ export { KeyboardShortcutsProvider } from './core/KeyboardShortcutsProvider.js';
32
+ export { applyPartDelta, finalizeParts } from './core/parts.js';
33
+ export { default as useDragDrop } from './core/useDragDrop.js';
34
+ export { useKeyboardShortcuts } from './core/useKeyboardShortcuts.js';
35
+ export { type ChatStrings, defaultChatStrings } from './strings.js';
36
+ export * from './types.js';
37
+ export { type DropdownOption, default as Dropdown } from './ui/Dropdown.js';
38
+ export { NoticeBar, NoticeCard, type NoticeTone } from './ui/Notice.js';
39
+ export { RenameDialog, type RowDialogStrings, SidebarGroupHeading, SidebarPanel, SidebarRailItem, SidebarRow, SidebarToggle, useRowDialogs, } from './ui/sidebar.js';
40
+ export { formatFileSize, isMac, isOrgModel } from './utils.js';