@ciridae/ui-agent 0.3.2 → 0.3.6

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 (250) hide show
  1. package/README.md +8 -2
  2. package/dist/ciridae-agent.css +5 -0
  3. package/dist/ciridae-agent.css.d.ts +2 -0
  4. package/dist/components/agentic/agent-card.d.ts +28 -0
  5. package/dist/components/agentic/agent-card.js +27 -0
  6. package/dist/components/agentic/agent-composer.d.ts +42 -0
  7. package/dist/components/agentic/agent-composer.js +89 -0
  8. package/dist/components/agentic/agent-context.d.ts +28 -0
  9. package/dist/components/agentic/agent-context.js +102 -0
  10. package/dist/components/agentic/agent-plan.js +1 -1
  11. package/dist/components/agentic/approval-request.d.ts +1 -1
  12. package/dist/components/agentic/assistant-mark-icon.d.ts +9 -0
  13. package/dist/components/agentic/assistant-mark-icon.js +12 -0
  14. package/dist/components/agentic/attachments-actions.d.ts +10 -0
  15. package/dist/components/agentic/attachments-actions.js +142 -0
  16. package/dist/components/agentic/attachments-context.d.ts +25 -0
  17. package/dist/components/agentic/attachments-context.js +196 -0
  18. package/dist/components/agentic/attachments-model.d.ts +23 -0
  19. package/dist/components/agentic/attachments-model.js +226 -0
  20. package/dist/components/agentic/attachments-preview.d.ts +7 -0
  21. package/dist/components/agentic/attachments-preview.js +25 -0
  22. package/dist/components/agentic/attachments-types.d.ts +87 -0
  23. package/dist/components/agentic/attachments-types.js +1 -0
  24. package/dist/components/agentic/attachments-ui.d.ts +14 -0
  25. package/dist/components/agentic/attachments-ui.js +90 -0
  26. package/dist/components/agentic/attachments.d.ts +5 -124
  27. package/dist/components/agentic/attachments.js +5 -591
  28. package/dist/components/agentic/audio-player.d.ts +16 -0
  29. package/dist/components/agentic/audio-player.js +21 -0
  30. package/dist/components/agentic/breathing-grid-icon.css +45 -0
  31. package/dist/components/agentic/breathing-grid-icon.css.d.ts +2 -0
  32. package/dist/components/agentic/breathing-grid-icon.d.ts +6 -0
  33. package/dist/components/agentic/breathing-grid-icon.js +7 -0
  34. package/dist/components/agentic/canvas.d.ts +10 -0
  35. package/dist/components/agentic/canvas.js +22 -0
  36. package/dist/components/agentic/code-block.js +1 -1
  37. package/dist/components/agentic/commit.d.ts +57 -0
  38. package/dist/components/agentic/commit.js +85 -0
  39. package/dist/components/agentic/connection.d.ts +3 -0
  40. package/dist/components/agentic/connection.js +8 -0
  41. package/dist/components/agentic/controls.d.ts +6 -0
  42. package/dist/components/agentic/controls.js +7 -0
  43. package/dist/components/agentic/conversation.d.ts +1 -1
  44. package/dist/components/agentic/edge.d.ts +8 -0
  45. package/dist/components/agentic/edge.js +65 -0
  46. package/dist/components/agentic/effort-selector.d.ts +43 -0
  47. package/dist/components/agentic/effort-selector.js +47 -0
  48. package/dist/components/agentic/environment-variables.d.ts +32 -0
  49. package/dist/components/agentic/environment-variables.js +66 -0
  50. package/dist/components/agentic/jsx-preview.d.ts +19 -0
  51. package/dist/components/agentic/jsx-preview.js +34 -0
  52. package/dist/components/agentic/message.d.ts +4 -4
  53. package/dist/components/agentic/message.js +48 -8
  54. package/dist/components/agentic/mic-selector.d.ts +58 -0
  55. package/dist/components/agentic/mic-selector.js +173 -0
  56. package/dist/components/agentic/node.d.ts +26 -0
  57. package/dist/components/agentic/node.js +29 -0
  58. package/dist/components/agentic/open-in-chat.d.ts +9 -0
  59. package/dist/components/agentic/open-in-chat.js +8 -0
  60. package/dist/components/agentic/package-info.d.ts +30 -0
  61. package/dist/components/agentic/package-info.js +44 -0
  62. package/dist/components/agentic/panel.d.ts +6 -0
  63. package/dist/components/agentic/panel.js +7 -0
  64. package/dist/components/agentic/persona.d.ts +16 -0
  65. package/dist/components/agentic/persona.js +116 -0
  66. package/dist/components/agentic/prompt-input-select.js +1 -1
  67. package/dist/components/agentic/prompt-input.d.ts +9 -9
  68. package/dist/components/agentic/prompt-input.js +7 -7
  69. package/dist/components/agentic/reasoning.d.ts +1 -1
  70. package/dist/components/agentic/reasoning.js +2 -2
  71. package/dist/components/agentic/run-checkpoint.d.ts +1 -1
  72. package/dist/components/agentic/shimmer.d.ts +2 -2
  73. package/dist/components/agentic/speech-input.d.ts +24 -0
  74. package/dist/components/agentic/speech-input.js +30 -0
  75. package/dist/components/agentic/stack-trace.d.ts +27 -0
  76. package/dist/components/agentic/stack-trace.js +76 -0
  77. package/dist/components/agentic/suggestion.d.ts +12 -0
  78. package/dist/components/agentic/suggestion.js +15 -0
  79. package/dist/components/agentic/test-results.d.ts +51 -0
  80. package/dist/components/agentic/test-results.js +83 -0
  81. package/dist/components/agentic/theme.d.ts +5 -0
  82. package/dist/components/agentic/theme.js +31 -0
  83. package/dist/components/agentic/tool.d.ts +1 -1
  84. package/dist/components/agentic/toolbar.d.ts +6 -0
  85. package/dist/components/agentic/toolbar.js +7 -0
  86. package/dist/components/agentic/transcription.d.ts +20 -0
  87. package/dist/components/agentic/transcription.js +32 -0
  88. package/dist/components/agentic/use-controllable-state.d.ts +6 -0
  89. package/dist/components/agentic/use-controllable-state.js +13 -0
  90. package/dist/components/agentic/voice-selector.d.ts +69 -0
  91. package/dist/components/agentic/voice-selector.js +122 -0
  92. package/dist/components/blocks/artifact-workbench.d.ts +9 -0
  93. package/dist/components/blocks/artifact-workbench.js +28 -0
  94. package/dist/components/blocks/tool-approval-panel.d.ts +11 -0
  95. package/dist/components/blocks/tool-approval-panel.js +11 -0
  96. package/dist/components/blocks/voice-agent-panel.d.ts +14 -0
  97. package/dist/components/blocks/voice-agent-panel.js +60 -0
  98. package/dist/components/blocks/workflow-canvas-panel.d.ts +18 -0
  99. package/dist/components/blocks/workflow-canvas-panel.js +106 -0
  100. package/dist/entries/agent-card.d.ts +1 -0
  101. package/dist/entries/agent-card.js +1 -0
  102. package/dist/entries/agent-composer.d.ts +1 -0
  103. package/dist/entries/agent-composer.js +1 -0
  104. package/dist/entries/agent-context.d.ts +1 -0
  105. package/dist/entries/agent-context.js +1 -0
  106. package/dist/entries/agent-plan.d.ts +1 -0
  107. package/dist/entries/agent-plan.js +1 -0
  108. package/dist/entries/agent-queue.d.ts +1 -0
  109. package/dist/entries/agent-queue.js +1 -0
  110. package/dist/entries/agent-task.d.ts +1 -0
  111. package/dist/entries/agent-task.js +1 -0
  112. package/dist/entries/agentic-types.d.ts +1 -0
  113. package/dist/entries/agentic-types.js +1 -0
  114. package/dist/entries/approval-request.d.ts +1 -0
  115. package/dist/entries/approval-request.js +1 -0
  116. package/dist/entries/artifact-workbench.d.ts +1 -0
  117. package/dist/entries/artifact-workbench.js +1 -0
  118. package/dist/entries/artifact.d.ts +1 -0
  119. package/dist/entries/artifact.js +1 -0
  120. package/dist/entries/assistant-mark-icon.d.ts +1 -0
  121. package/dist/entries/assistant-mark-icon.js +1 -0
  122. package/dist/entries/attachments-actions.d.ts +1 -0
  123. package/dist/entries/attachments-actions.js +1 -0
  124. package/dist/entries/attachments-context.d.ts +1 -0
  125. package/dist/entries/attachments-context.js +1 -0
  126. package/dist/entries/attachments-model.d.ts +1 -0
  127. package/dist/entries/attachments-model.js +1 -0
  128. package/dist/entries/attachments-preview.d.ts +1 -0
  129. package/dist/entries/attachments-preview.js +1 -0
  130. package/dist/entries/attachments-types.d.ts +1 -0
  131. package/dist/entries/attachments-types.js +1 -0
  132. package/dist/entries/attachments-ui.d.ts +1 -0
  133. package/dist/entries/attachments-ui.js +1 -0
  134. package/dist/entries/attachments.d.ts +1 -0
  135. package/dist/entries/attachments.js +1 -0
  136. package/dist/entries/audio-player.d.ts +1 -0
  137. package/dist/entries/audio-player.js +1 -0
  138. package/dist/entries/breathing-grid-icon.d.ts +1 -0
  139. package/dist/entries/breathing-grid-icon.js +1 -0
  140. package/dist/entries/canvas.d.ts +1 -0
  141. package/dist/entries/canvas.js +1 -0
  142. package/dist/entries/clipboard.d.ts +1 -0
  143. package/dist/entries/clipboard.js +1 -0
  144. package/dist/entries/code-block.d.ts +1 -0
  145. package/dist/entries/code-block.js +1 -0
  146. package/dist/entries/commit.d.ts +1 -0
  147. package/dist/entries/commit.js +1 -0
  148. package/dist/entries/connection.d.ts +1 -0
  149. package/dist/entries/connection.js +1 -0
  150. package/dist/entries/controls.d.ts +1 -0
  151. package/dist/entries/controls.js +1 -0
  152. package/dist/entries/conversation.d.ts +1 -0
  153. package/dist/entries/conversation.js +1 -0
  154. package/dist/entries/edge.d.ts +1 -0
  155. package/dist/entries/edge.js +1 -0
  156. package/dist/entries/effort-selector.d.ts +1 -0
  157. package/dist/entries/effort-selector.js +1 -0
  158. package/dist/entries/environment-variables.d.ts +1 -0
  159. package/dist/entries/environment-variables.js +1 -0
  160. package/dist/entries/file-tree.d.ts +1 -0
  161. package/dist/entries/file-tree.js +1 -0
  162. package/dist/entries/image.d.ts +1 -0
  163. package/dist/entries/image.js +1 -0
  164. package/dist/entries/inline-citation.d.ts +1 -0
  165. package/dist/entries/inline-citation.js +1 -0
  166. package/dist/entries/jsx-preview.d.ts +1 -0
  167. package/dist/entries/jsx-preview.js +1 -0
  168. package/dist/entries/message-branch.d.ts +1 -0
  169. package/dist/entries/message-branch.js +1 -0
  170. package/dist/entries/message.d.ts +1 -0
  171. package/dist/entries/message.js +1 -0
  172. package/dist/entries/mic-selector.d.ts +1 -0
  173. package/dist/entries/mic-selector.js +1 -0
  174. package/dist/entries/model-selector.d.ts +1 -0
  175. package/dist/entries/model-selector.js +1 -0
  176. package/dist/entries/node.d.ts +1 -0
  177. package/dist/entries/node.js +1 -0
  178. package/dist/entries/open-in-chat.d.ts +1 -0
  179. package/dist/entries/open-in-chat.js +1 -0
  180. package/dist/entries/package-info.d.ts +1 -0
  181. package/dist/entries/package-info.js +1 -0
  182. package/dist/entries/panel.d.ts +1 -0
  183. package/dist/entries/panel.js +1 -0
  184. package/dist/entries/persona.d.ts +1 -0
  185. package/dist/entries/persona.js +1 -0
  186. package/dist/entries/prompt-input-action-menu.d.ts +1 -0
  187. package/dist/entries/prompt-input-action-menu.js +1 -0
  188. package/dist/entries/prompt-input-command.d.ts +1 -0
  189. package/dist/entries/prompt-input-command.js +1 -0
  190. package/dist/entries/prompt-input-hover-card.d.ts +1 -0
  191. package/dist/entries/prompt-input-hover-card.js +1 -0
  192. package/dist/entries/prompt-input-select.d.ts +1 -0
  193. package/dist/entries/prompt-input-select.js +1 -0
  194. package/dist/entries/prompt-input-tabs.d.ts +1 -0
  195. package/dist/entries/prompt-input-tabs.js +1 -0
  196. package/dist/entries/prompt-input.d.ts +1 -0
  197. package/dist/entries/prompt-input.js +1 -0
  198. package/dist/entries/reasoning.d.ts +1 -0
  199. package/dist/entries/reasoning.js +1 -0
  200. package/dist/entries/run-checkpoint.d.ts +1 -0
  201. package/dist/entries/run-checkpoint.js +1 -0
  202. package/dist/entries/run-trace.d.ts +1 -0
  203. package/dist/entries/run-trace.js +1 -0
  204. package/dist/entries/sandbox.d.ts +1 -0
  205. package/dist/entries/sandbox.js +1 -0
  206. package/dist/entries/schema-display.d.ts +1 -0
  207. package/dist/entries/schema-display.js +1 -0
  208. package/dist/entries/shimmer.d.ts +1 -0
  209. package/dist/entries/shimmer.js +1 -0
  210. package/dist/entries/snippet.d.ts +1 -0
  211. package/dist/entries/snippet.js +1 -0
  212. package/dist/entries/sources.d.ts +1 -0
  213. package/dist/entries/sources.js +1 -0
  214. package/dist/entries/speech-input.d.ts +1 -0
  215. package/dist/entries/speech-input.js +1 -0
  216. package/dist/entries/stack-trace.d.ts +1 -0
  217. package/dist/entries/stack-trace.js +1 -0
  218. package/dist/entries/suggestion.d.ts +1 -0
  219. package/dist/entries/suggestion.js +1 -0
  220. package/dist/entries/terminal.d.ts +1 -0
  221. package/dist/entries/terminal.js +1 -0
  222. package/dist/entries/test-results.d.ts +1 -0
  223. package/dist/entries/test-results.js +1 -0
  224. package/dist/entries/theme.d.ts +1 -0
  225. package/dist/entries/theme.js +1 -0
  226. package/dist/entries/tool-approval-panel.d.ts +1 -0
  227. package/dist/entries/tool-approval-panel.js +1 -0
  228. package/dist/entries/tool.d.ts +1 -0
  229. package/dist/entries/tool.js +1 -0
  230. package/dist/entries/toolbar.d.ts +1 -0
  231. package/dist/entries/toolbar.js +1 -0
  232. package/dist/entries/transcription.d.ts +1 -0
  233. package/dist/entries/transcription.js +1 -0
  234. package/dist/entries/types.d.ts +1 -0
  235. package/dist/entries/types.js +1 -0
  236. package/dist/entries/use-controllable-state.d.ts +1 -0
  237. package/dist/entries/use-controllable-state.js +1 -0
  238. package/dist/entries/voice-agent-panel.d.ts +1 -0
  239. package/dist/entries/voice-agent-panel.js +1 -0
  240. package/dist/entries/voice-selector.d.ts +1 -0
  241. package/dist/entries/voice-selector.js +1 -0
  242. package/dist/entries/web-preview.d.ts +1 -0
  243. package/dist/entries/web-preview.js +1 -0
  244. package/dist/entries/workflow-canvas-panel.d.ts +1 -0
  245. package/dist/entries/workflow-canvas-panel.js +1 -0
  246. package/dist/style-imports.d.ts +3 -0
  247. package/dist/styled-system/styles.css +422 -0
  248. package/dist/styled-system/styles.css.d.ts +2 -0
  249. package/dist/styles.css +7 -0
  250. package/package.json +17 -137
@@ -0,0 +1,20 @@
1
+ import type * as React from "react";
2
+ import type { AgenticTranscriptSegment } from "./types";
3
+ type TranscriptionProps = React.ComponentProps<"div"> & {
4
+ segments?: AgenticTranscriptSegment[];
5
+ };
6
+ type TranscriptionSegmentProps = React.ComponentProps<"div"> & {
7
+ segment?: AgenticTranscriptSegment;
8
+ };
9
+ type TranscriptionSpeakerProps = React.ComponentProps<"span">;
10
+ type TranscriptionTextProps = React.ComponentProps<"p">;
11
+ type TranscriptionTimestampProps = React.ComponentProps<"span">;
12
+ type TranscriptionEmptyProps = React.ComponentProps<"div">;
13
+ declare function Transcription({ children, className, segments, ...props }: TranscriptionProps): React.JSX.Element;
14
+ declare function TranscriptionSegment({ children, className, segment, ...props }: TranscriptionSegmentProps): React.JSX.Element;
15
+ declare function TranscriptionSpeaker({ className, ...props }: TranscriptionSpeakerProps): React.JSX.Element;
16
+ declare function TranscriptionText({ className, ...props }: TranscriptionTextProps): React.JSX.Element;
17
+ declare function TranscriptionTimestamp({ className, ...props }: TranscriptionTimestampProps): React.JSX.Element;
18
+ declare function TranscriptionEmpty({ className, children, ...props }: TranscriptionEmptyProps): React.JSX.Element;
19
+ export { Transcription, TranscriptionEmpty, TranscriptionSegment, TranscriptionSpeaker, TranscriptionText, TranscriptionTimestamp, };
20
+ export type { TranscriptionEmptyProps, TranscriptionProps, TranscriptionSegmentProps, TranscriptionSpeakerProps, TranscriptionTextProps, TranscriptionTimestampProps, };
@@ -0,0 +1,32 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Badge } from "@ciridae/ui/badge";
3
+ import { cn } from "@ciridae/ui/utils";
4
+ function Transcription({ children, className, segments, ...props }) {
5
+ return (_jsx("div", { "data-slot": "transcription", className: cn("grid max-h-80 gap-2 overflow-auto rounded-lg border bg-card p-3", className), ...props, children: children ??
6
+ (segments && segments.length > 0 ? (segments.map((segment) => _jsx(TranscriptionSegment, { segment: segment }, segment.id))) : (_jsx(TranscriptionEmpty, {}))) }));
7
+ }
8
+ function TranscriptionSegment({ children, className, segment, ...props }) {
9
+ return (_jsx("div", { "data-role": segment?.role, "data-slot": "transcription-segment", "data-status": segment?.status, className: cn("grid gap-1 rounded-md px-2 py-1.5", "data-[role=assistant]:bg-muted/40 data-[status=error]:bg-destructive/5 data-[status=interim]:opacity-70", className), ...props, children: children ?? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex min-w-0 items-center justify-between gap-2", children: [_jsx(TranscriptionSpeaker, { children: getSpeakerLabel(segment) }), segment?.createdAt ? (_jsx(TranscriptionTimestamp, { children: segment.createdAt })) : null] }), _jsx(TranscriptionText, { children: segment?.text }), segment?.status && segment.status !== "final" ? (_jsx(Badge, { className: "w-fit", variant: segment.status === "error" ? "destructive" : "outline", children: segment.status })) : null] })) }));
10
+ }
11
+ function TranscriptionSpeaker({ className, ...props }) {
12
+ return (_jsx("span", { "data-slot": "transcription-speaker", className: cn("text-xs font-medium text-muted-foreground", className), ...props }));
13
+ }
14
+ function TranscriptionText({ className, ...props }) {
15
+ return (_jsx("p", { "data-slot": "transcription-text", className: cn("text-sm leading-relaxed text-foreground", className), ...props }));
16
+ }
17
+ function TranscriptionTimestamp({ className, ...props }) {
18
+ return (_jsx("span", { "data-slot": "transcription-timestamp", className: cn("font-mono text-xs text-muted-foreground tabular-nums", className), ...props }));
19
+ }
20
+ function TranscriptionEmpty({ className, children, ...props }) {
21
+ return (_jsx("div", { "data-slot": "transcription-empty", className: cn("rounded-md bg-muted/40 p-4 text-sm text-muted-foreground", className), ...props, children: children ?? "No transcript yet" }));
22
+ }
23
+ function getSpeakerLabel(segment) {
24
+ if (!segment)
25
+ return "Speaker";
26
+ if (segment.role === "assistant")
27
+ return "Assistant";
28
+ if (segment.role === "system")
29
+ return "System";
30
+ return "You";
31
+ }
32
+ export { Transcription, TranscriptionEmpty, TranscriptionSegment, TranscriptionSpeaker, TranscriptionText, TranscriptionTimestamp, };
@@ -0,0 +1,6 @@
1
+ declare function useControllableState<T>({ defaultValue, onChange, value, }: {
2
+ defaultValue: T;
3
+ onChange?: (value: T) => void;
4
+ value?: T;
5
+ }): readonly [T, (nextValue: T) => void];
6
+ export { useControllableState };
@@ -0,0 +1,13 @@
1
+ import * as React from "react";
2
+ function useControllableState({ defaultValue, onChange, value, }) {
3
+ const [internalValue, setInternalValue] = React.useState(defaultValue);
4
+ const isControlled = value !== undefined;
5
+ const currentValue = isControlled ? value : internalValue;
6
+ const setCurrentValue = React.useCallback((nextValue) => {
7
+ if (!isControlled)
8
+ setInternalValue(nextValue);
9
+ onChange?.(nextValue);
10
+ }, [isControlled, onChange]);
11
+ return [currentValue, setCurrentValue];
12
+ }
13
+ export { useControllableState };
@@ -0,0 +1,69 @@
1
+ import * as React from "react";
2
+ import type { AgenticVoiceOption } from "./types";
3
+ import { CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut } from "@ciridae/ui/command";
4
+ import { Dialog, DialogContent, DialogTrigger } from "@ciridae/ui/dialog";
5
+ type VoiceSelectorContextValue = {
6
+ open: boolean;
7
+ setOpen: (open: boolean) => void;
8
+ setValue: (value: string | undefined) => void;
9
+ value: string | undefined;
10
+ voices: AgenticVoiceOption[];
11
+ };
12
+ type VoiceSelectorProps = React.ComponentProps<typeof Dialog> & {
13
+ defaultValue?: string;
14
+ onValueChange?: (value: string | undefined) => void;
15
+ value?: string;
16
+ voices?: AgenticVoiceOption[];
17
+ };
18
+ type VoiceSelectorTriggerProps = React.ComponentProps<typeof DialogTrigger>;
19
+ type VoiceSelectorContentProps = React.ComponentProps<typeof DialogContent> & {
20
+ title?: React.ReactNode;
21
+ };
22
+ type VoiceSelectorDialogProps = React.ComponentProps<typeof CommandDialog>;
23
+ type VoiceSelectorInputProps = React.ComponentProps<typeof CommandInput>;
24
+ type VoiceSelectorListProps = React.ComponentProps<typeof CommandList>;
25
+ type VoiceSelectorEmptyProps = React.ComponentProps<typeof CommandEmpty>;
26
+ type VoiceSelectorGroupProps = React.ComponentProps<typeof CommandGroup>;
27
+ type VoiceSelectorItemProps = React.ComponentProps<typeof CommandItem> & {
28
+ voice?: AgenticVoiceOption;
29
+ };
30
+ type VoiceSelectorShortcutProps = React.ComponentProps<typeof CommandShortcut>;
31
+ type VoiceSelectorSeparatorProps = React.ComponentProps<typeof CommandSeparator>;
32
+ type VoiceSelectorMetadataProps = React.ComponentProps<"span"> & {
33
+ value?: string;
34
+ };
35
+ type VoiceSelectorNameProps = React.ComponentProps<"span">;
36
+ type VoiceSelectorDescriptionProps = React.ComponentProps<"span">;
37
+ type VoiceSelectorAttributesProps = React.ComponentProps<"div">;
38
+ type VoiceSelectorBulletProps = React.ComponentProps<"span">;
39
+ type VoiceSelectorValueProps = React.ComponentProps<"span"> & {
40
+ placeholder?: string;
41
+ };
42
+ type VoiceSelectorPreviewProps = Omit<React.ComponentProps<"button">, "children"> & {
43
+ loading?: boolean;
44
+ onPlay?: () => void;
45
+ playing?: boolean;
46
+ };
47
+ declare function VoiceSelector({ children, defaultOpen, defaultValue, onOpenChange, onValueChange, open: openProp, value: valueProp, voices, ...props }: VoiceSelectorProps): React.JSX.Element;
48
+ declare function useVoiceSelector(): VoiceSelectorContextValue;
49
+ declare function VoiceSelectorTrigger(props: VoiceSelectorTriggerProps): React.JSX.Element;
50
+ declare function VoiceSelectorContent({ children, className, title, ...props }: VoiceSelectorContentProps): React.JSX.Element;
51
+ declare function VoiceSelectorDialog(props: VoiceSelectorDialogProps): React.JSX.Element;
52
+ declare function VoiceSelectorInput({ className, ...props }: VoiceSelectorInputProps): React.JSX.Element;
53
+ declare function VoiceSelectorList(props: VoiceSelectorListProps): React.JSX.Element;
54
+ declare function VoiceSelectorEmpty(props: VoiceSelectorEmptyProps): React.JSX.Element;
55
+ declare function VoiceSelectorGroup(props: VoiceSelectorGroupProps): React.JSX.Element;
56
+ declare function VoiceSelectorItem({ children, onSelect, value, voice, ...props }: VoiceSelectorItemProps): React.JSX.Element;
57
+ declare function VoiceSelectorShortcut(props: VoiceSelectorShortcutProps): React.JSX.Element;
58
+ declare function VoiceSelectorSeparator(props: VoiceSelectorSeparatorProps): React.JSX.Element;
59
+ declare function VoiceSelectorGender({ className, value, ...props }: VoiceSelectorMetadataProps): React.JSX.Element;
60
+ declare function VoiceSelectorAccent({ children, className, value, ...props }: VoiceSelectorMetadataProps): React.JSX.Element;
61
+ declare function VoiceSelectorAge({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
62
+ declare function VoiceSelectorName({ className, ...props }: VoiceSelectorNameProps): React.JSX.Element;
63
+ declare function VoiceSelectorDescription({ className, ...props }: VoiceSelectorDescriptionProps): React.JSX.Element;
64
+ declare function VoiceSelectorAttributes({ className, ...props }: VoiceSelectorAttributesProps): React.JSX.Element;
65
+ declare function VoiceSelectorBullet({ className, ...props }: VoiceSelectorBulletProps): React.JSX.Element;
66
+ declare function VoiceSelectorValue({ className, placeholder, ...props }: VoiceSelectorValueProps): React.JSX.Element;
67
+ declare function VoiceSelectorPreview({ className, loading, onClick, onPlay, playing, type, ...props }: VoiceSelectorPreviewProps): React.JSX.Element;
68
+ export { VoiceSelector, VoiceSelectorAccent, VoiceSelectorAge, VoiceSelectorAttributes, VoiceSelectorBullet, VoiceSelectorContent, VoiceSelectorDescription, VoiceSelectorDialog, VoiceSelectorEmpty, VoiceSelectorGender, VoiceSelectorGroup, VoiceSelectorInput, VoiceSelectorItem, VoiceSelectorList, VoiceSelectorName, VoiceSelectorPreview, VoiceSelectorSeparator, VoiceSelectorShortcut, VoiceSelectorTrigger, VoiceSelectorValue, useVoiceSelector, };
69
+ export type { VoiceSelectorAttributesProps, VoiceSelectorBulletProps, VoiceSelectorContentProps, VoiceSelectorDescriptionProps, VoiceSelectorDialogProps, VoiceSelectorEmptyProps, VoiceSelectorGroupProps, VoiceSelectorInputProps, VoiceSelectorItemProps, VoiceSelectorListProps, VoiceSelectorNameProps, VoiceSelectorPreviewProps, VoiceSelectorProps, VoiceSelectorSeparatorProps, VoiceSelectorShortcutProps, VoiceSelectorTriggerProps, VoiceSelectorValueProps, };
@@ -0,0 +1,122 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ /* eslint-disable max-lines, react-refresh/only-export-components */
3
+ import { CircleSmallIcon, MarsIcon, PauseIcon, PlayIcon, TransgenderIcon, VenusAndMarsIcon, VenusIcon, } from "lucide-react";
4
+ import * as React from "react";
5
+ import { Button } from "@ciridae/ui/button";
6
+ import { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, } from "@ciridae/ui/command";
7
+ import { Dialog, DialogContent, DialogTitle, DialogTrigger } from "@ciridae/ui/dialog";
8
+ import { Spinner } from "@ciridae/ui/spinner";
9
+ import { cn } from "@ciridae/ui/utils";
10
+ import { useControllableState } from "./use-controllable-state";
11
+ const VoiceSelectorContext = React.createContext(null);
12
+ function VoiceSelector({ children, defaultOpen = false, defaultValue, onOpenChange, onValueChange, open: openProp, value: valueProp, voices = [], ...props }) {
13
+ const [value, setValue] = useControllableState({
14
+ defaultValue,
15
+ onChange: onValueChange,
16
+ value: valueProp,
17
+ });
18
+ const [open, setOpen] = useControllableState({
19
+ defaultValue: defaultOpen,
20
+ onChange: onOpenChange,
21
+ value: openProp,
22
+ });
23
+ const contextValue = React.useMemo(() => ({ open, setOpen, setValue, value, voices }), [open, setOpen, setValue, value, voices]);
24
+ return (_jsx(VoiceSelectorContext.Provider, { value: contextValue, children: _jsx(Dialog, { onOpenChange: setOpen, open: open, ...props, children: children ?? _jsx(VoiceSelectorDefaultContent, {}) }) }));
25
+ }
26
+ function VoiceSelectorDefaultContent() {
27
+ const { voices } = useVoiceSelector();
28
+ return (_jsxs(_Fragment, { children: [_jsx(VoiceSelectorTrigger, { asChild: true, children: _jsx(Button, { className: "w-64 justify-between", variant: "outline", children: _jsx(VoiceSelectorValue, { className: "max-w-52 text-left" }) }) }), _jsxs(VoiceSelectorContent, { children: [_jsx(VoiceSelectorInput, { placeholder: "Search voices..." }), _jsxs(VoiceSelectorList, { children: [_jsx(VoiceSelectorEmpty, { children: "No voices found." }), _jsx(VoiceSelectorGroup, { heading: "Voices", children: voices.map((voice) => (_jsx(VoiceSelectorItem, { voice: voice }, voice.id))) })] })] })] }));
29
+ }
30
+ function useVoiceSelector() {
31
+ const context = React.useContext(VoiceSelectorContext);
32
+ if (!context)
33
+ throw new Error("VoiceSelector components must be used within VoiceSelector");
34
+ return context;
35
+ }
36
+ function VoiceSelectorTrigger(props) {
37
+ return _jsx(DialogTrigger, { ...props });
38
+ }
39
+ function VoiceSelectorContent({ children, className, title = "Voice selector", ...props }) {
40
+ return (_jsxs(DialogContent, { "aria-describedby": undefined, className: cn("overflow-hidden p-0 sm:max-w-xl", className), ...props, children: [_jsx(DialogTitle, { className: "sr-only", children: title }), _jsx(Command, { className: "**:data-[slot=command-input-wrapper]:h-auto", children: children })] }));
41
+ }
42
+ function VoiceSelectorDialog(props) {
43
+ return _jsx(CommandDialog, { ...props });
44
+ }
45
+ function VoiceSelectorInput({ className, ...props }) {
46
+ return _jsx(CommandInput, { className: cn("h-auto py-3", className), ...props });
47
+ }
48
+ function VoiceSelectorList(props) {
49
+ return _jsx(CommandList, { ...props });
50
+ }
51
+ function VoiceSelectorEmpty(props) {
52
+ return _jsx(CommandEmpty, { ...props });
53
+ }
54
+ function VoiceSelectorGroup(props) {
55
+ return _jsx(CommandGroup, { ...props });
56
+ }
57
+ function VoiceSelectorItem({ children, onSelect, value, voice, ...props }) {
58
+ const { setOpen, setValue } = useVoiceSelector();
59
+ const itemValue = value ?? voice?.id;
60
+ return (_jsx(CommandItem, { onSelect: (currentValue) => {
61
+ setValue(itemValue ?? currentValue);
62
+ setOpen(false);
63
+ onSelect?.(currentValue);
64
+ }, value: itemValue, ...props, children: children ?? (voice ? _jsx(VoiceSelectorOption, { voice: voice }) : null) }));
65
+ }
66
+ function VoiceSelectorOption({ voice }) {
67
+ return (_jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [_jsxs("div", { className: "grid min-w-0 flex-1 gap-1", children: [_jsx(VoiceSelectorName, { children: voice.label }), _jsxs(VoiceSelectorAttributes, { children: [voice.gender ? _jsx(VoiceSelectorGender, { value: voice.gender }) : null, voice.accent ? _jsx(VoiceSelectorAccent, { value: voice.accent }) : null, voice.age ? _jsx(VoiceSelectorAge, { children: voice.age }) : null] }), voice.description ? (_jsx(VoiceSelectorDescription, { children: voice.description })) : null] }), voice.previewLabel ? (_jsx(VoiceSelectorShortcut, { children: voice.previewLabel })) : null] }));
68
+ }
69
+ function VoiceSelectorShortcut(props) {
70
+ return _jsx(CommandShortcut, { ...props });
71
+ }
72
+ function VoiceSelectorSeparator(props) {
73
+ return _jsx(CommandSeparator, { ...props });
74
+ }
75
+ function VoiceSelectorGender({ className, value, ...props }) {
76
+ return (_jsx("span", { className: cn("inline-flex items-center gap-1", className), ...props, children: _jsx(VoiceSelectorGenderIcon, { value: value }) }));
77
+ }
78
+ function VoiceSelectorAccent({ children, className, value, ...props }) {
79
+ return (_jsx("span", { className: cn("font-mono text-[0.6875rem] uppercase", className), ...props, children: children ?? value }));
80
+ }
81
+ function VoiceSelectorAge({ className, ...props }) {
82
+ return _jsx("span", { className: cn("text-[0.6875rem]", className), ...props });
83
+ }
84
+ function VoiceSelectorName({ className, ...props }) {
85
+ return _jsx("span", { className: cn("truncate font-medium", className), ...props });
86
+ }
87
+ function VoiceSelectorDescription({ className, ...props }) {
88
+ return _jsx("span", { className: cn("truncate text-xs text-muted-foreground", className), ...props });
89
+ }
90
+ function VoiceSelectorAttributes({ className, ...props }) {
91
+ return (_jsx("div", { className: cn("flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground", className), ...props }));
92
+ }
93
+ function VoiceSelectorBullet({ className, ...props }) {
94
+ return (_jsx("span", { className: cn("text-muted-foreground", className), ...props, children: "-" }));
95
+ }
96
+ function VoiceSelectorValue({ className, placeholder = "Select voice", ...props }) {
97
+ const { value, voices } = useVoiceSelector();
98
+ const voice = voices.find((candidate) => candidate.id === value);
99
+ return (_jsx("span", { className: cn("truncate", className), ...props, children: voice?.label ?? placeholder }));
100
+ }
101
+ function VoiceSelectorPreview({ className, loading, onClick, onPlay, playing, type = "button", ...props }) {
102
+ const Icon = loading ? Spinner : playing ? PauseIcon : PlayIcon;
103
+ return (_jsx("button", { "aria-label": playing ? "Pause voice preview" : "Play voice preview", className: cn("inline-flex size-7 shrink-0 items-center justify-center rounded-md border bg-background text-foreground transition-colors hover:bg-accent hover:text-accent-foreground", className), onClick: (event) => {
104
+ event.stopPropagation();
105
+ onClick?.(event);
106
+ if (!event.defaultPrevented)
107
+ onPlay?.();
108
+ }, ...props, type: type, children: _jsx(Icon, { className: "size-3.5" }) }));
109
+ }
110
+ function VoiceSelectorGenderIcon({ value }) {
111
+ if (value === "male")
112
+ return _jsx(MarsIcon, { className: "size-3.5" });
113
+ if (value === "female")
114
+ return _jsx(VenusIcon, { className: "size-3.5" });
115
+ if (value === "transgender")
116
+ return _jsx(TransgenderIcon, { className: "size-3.5" });
117
+ if (value === "androgyne" || value === "intersex") {
118
+ return _jsx(VenusAndMarsIcon, { className: "size-3.5" });
119
+ }
120
+ return _jsx(CircleSmallIcon, { className: "size-3.5" });
121
+ }
122
+ export { VoiceSelector, VoiceSelectorAccent, VoiceSelectorAge, VoiceSelectorAttributes, VoiceSelectorBullet, VoiceSelectorContent, VoiceSelectorDescription, VoiceSelectorDialog, VoiceSelectorEmpty, VoiceSelectorGender, VoiceSelectorGroup, VoiceSelectorInput, VoiceSelectorItem, VoiceSelectorList, VoiceSelectorName, VoiceSelectorPreview, VoiceSelectorSeparator, VoiceSelectorShortcut, VoiceSelectorTrigger, VoiceSelectorValue, useVoiceSelector, };
@@ -0,0 +1,9 @@
1
+ import type * as React from "react";
2
+ type ArtifactWorkbenchProps = React.ComponentProps<"div"> & {
3
+ code: string;
4
+ previewUrl: string;
5
+ title: string;
6
+ };
7
+ declare function ArtifactWorkbench({ className, code, previewUrl, title, ...props }: ArtifactWorkbenchProps): React.JSX.Element;
8
+ export { ArtifactWorkbench };
9
+ export type { ArtifactWorkbenchProps };
@@ -0,0 +1,28 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Artifact, ArtifactContent, ArtifactDescription, ArtifactHeader, ArtifactTitle, } from "../agentic/artifact";
3
+ import { CodeBlock, CodeBlockContent, CodeBlockCopyButton, CodeBlockHeader, CodeBlockTitle, } from "../agentic/code-block";
4
+ import { Sandbox, SandboxContent, SandboxHeader, SandboxTabContent, SandboxTabs, SandboxTabsBar, SandboxTabsList, SandboxTabsTrigger, } from "../agentic/sandbox";
5
+ import { WebPreview, WebPreviewBody, WebPreviewNavigation, WebPreviewNavigationButton, WebPreviewUrl, } from "../agentic/web-preview";
6
+ import { cn } from "@ciridae/ui/utils";
7
+ function ArtifactWorkbench({ className, code, previewUrl, title, ...props }) {
8
+ return (_jsxs("div", { "data-slot": "artifact-workbench", className: cn("grid w-full gap-4 lg:grid-cols-[minmax(0,1fr)_minmax(18rem,24rem)]", className), ...props, children: [_jsx(ArtifactWorkbenchPreviewPane, { previewUrl: previewUrl, title: title }), _jsx(ArtifactWorkbenchSourcePane, { code: code })] }));
9
+ }
10
+ function ArtifactWorkbenchPreviewPane({ previewUrl, title, }) {
11
+ return (_jsxs(Artifact, { children: [_jsx(ArtifactHeader, { children: _jsx(ArtifactWorkbenchTitle, { title: title }) }), _jsx(ArtifactContent, { children: _jsx(ArtifactWorkbenchWebPreview, { previewUrl: previewUrl }) })] }));
12
+ }
13
+ function ArtifactWorkbenchTitle({ title }) {
14
+ return (_jsxs("div", { className: "min-w-0", children: [_jsx(ArtifactTitle, { children: title }), _jsx(ArtifactDescription, { children: "Generated output preview." })] }));
15
+ }
16
+ function ArtifactWorkbenchWebPreview({ previewUrl }) {
17
+ return (_jsxs(WebPreview, { url: previewUrl, children: [_jsxs(WebPreviewNavigation, { children: [_jsx(WebPreviewNavigationButton, { action: "back" }), _jsx(WebPreviewNavigationButton, { action: "forward" }), _jsx(WebPreviewUrl, {})] }), _jsx(WebPreviewBody, {})] }));
18
+ }
19
+ function ArtifactWorkbenchSourcePane({ code }) {
20
+ return (_jsxs(Sandbox, { defaultOpen: true, children: [_jsx(SandboxHeader, { description: "Review generated source.", title: "Source" }), _jsx(SandboxContent, { children: _jsx(ArtifactWorkbenchSourceTabs, { code: code }) })] }));
21
+ }
22
+ function ArtifactWorkbenchSourceTabs({ code }) {
23
+ return (_jsxs(SandboxTabs, { defaultValue: "code", children: [_jsx(SandboxTabsBar, { children: _jsx(SandboxTabsList, { children: _jsx(SandboxTabsTrigger, { value: "code", children: "Code" }) }) }), _jsx(SandboxTabContent, { value: "code", children: _jsx(ArtifactWorkbenchCode, { code: code }) })] }));
24
+ }
25
+ function ArtifactWorkbenchCode({ code }) {
26
+ return (_jsxs(CodeBlock, { code: code, language: "tsx", children: [_jsxs(CodeBlockHeader, { children: [_jsx(CodeBlockTitle, { children: "component.tsx" }), _jsx(CodeBlockCopyButton, {})] }), _jsx(CodeBlockContent, {})] }));
27
+ }
28
+ export { ArtifactWorkbench };
@@ -0,0 +1,11 @@
1
+ import type * as React from "react";
2
+ import type { AgenticApproval, AgenticToolPart } from "../agentic/types";
3
+ type ToolApprovalPanelProps = React.ComponentProps<"div"> & {
4
+ approval?: AgenticApproval;
5
+ onApprove?: () => void;
6
+ onReject?: () => void;
7
+ tool: AgenticToolPart;
8
+ };
9
+ declare function ToolApprovalPanel({ approval, className, onApprove, onReject, tool, ...props }: ToolApprovalPanelProps): React.JSX.Element;
10
+ export { ToolApprovalPanel };
11
+ export type { ToolApprovalPanelProps };
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ApprovalRequest, ApprovalRequestAction, ApprovalRequestActions, ApprovalRequestDescription, ApprovalRequestPending, ApprovalRequestTitle, } from "../agentic/approval-request";
3
+ import { Tool, ToolContent, ToolHeader, ToolInput, ToolOutput } from "../agentic/tool";
4
+ import { cn } from "@ciridae/ui/utils";
5
+ function ToolApprovalPanel({ approval, className, onApprove, onReject, tool, ...props }) {
6
+ return (_jsx("div", { "data-slot": "tool-approval-panel", className: cn("grid gap-3", className), ...props, children: _jsxs(Tool, { defaultOpen: true, children: [_jsx(ToolHeader, { state: tool.state, title: tool.toolName, type: tool.type }), _jsxs(ToolContent, { children: [_jsx(ToolInput, { input: tool.input }), _jsx(ToolApprovalPanelRequest, { approval: approval, onApprove: onApprove, onReject: onReject, state: tool.state }), _jsx(ToolOutput, { errorText: tool.errorText, output: tool.output })] })] }) }));
7
+ }
8
+ function ToolApprovalPanelRequest({ approval, onApprove, onReject, state, }) {
9
+ return (_jsx(ApprovalRequest, { approval: approval, state: state, children: _jsxs(ApprovalRequestPending, { children: [_jsx(ApprovalRequestTitle, { children: "Approve this tool call?" }), _jsx(ApprovalRequestDescription, { children: "Review the requested parameters before the host app continues." }), _jsxs(ApprovalRequestActions, { children: [_jsx(ApprovalRequestAction, { variant: "outline", onClick: onReject, children: "Reject" }), _jsx(ApprovalRequestAction, { onClick: onApprove, children: "Approve" })] })] }) }));
10
+ }
11
+ export { ToolApprovalPanel };
@@ -0,0 +1,14 @@
1
+ import * as React from "react";
2
+ import type { AgenticAudioSource, AgenticMicOption, AgenticSpeechStatus, AgenticTranscriptSegment, AgenticVoiceOption } from "../agentic/types";
3
+ type VoiceAgentPanelProps = React.ComponentProps<"div"> & {
4
+ audio?: AgenticAudioSource;
5
+ mics?: AgenticMicOption[];
6
+ selectedMicId?: string;
7
+ selectedVoiceId?: string;
8
+ status?: AgenticSpeechStatus;
9
+ transcript?: AgenticTranscriptSegment[];
10
+ voices?: AgenticVoiceOption[];
11
+ };
12
+ declare function VoiceAgentPanel({ audio, className, mics, selectedMicId, selectedVoiceId, status, transcript, voices, ...props }: VoiceAgentPanelProps): React.JSX.Element;
13
+ export { VoiceAgentPanel };
14
+ export type { VoiceAgentPanelProps };
@@ -0,0 +1,60 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { AudioPlayer } from "../agentic/audio-player";
4
+ import { MicSelector } from "../agentic/mic-selector";
5
+ import { Persona } from "../agentic/persona";
6
+ import { SpeechInput } from "../agentic/speech-input";
7
+ import { Transcription } from "../agentic/transcription";
8
+ import { VoiceSelector } from "../agentic/voice-selector";
9
+ import { Badge } from "@ciridae/ui/badge";
10
+ import { cn } from "@ciridae/ui/utils";
11
+ const defaultMics = [
12
+ { id: "studio", label: "Studio mic", description: "Noise reduction on" },
13
+ { id: "system", label: "System input", description: "Default device" },
14
+ ];
15
+ const defaultVoices = [
16
+ { id: "calm", label: "Calm operator", description: "Measured and concise" },
17
+ { id: "bright", label: "Bright guide", description: "Higher energy" },
18
+ ];
19
+ const defaultTranscript = [
20
+ {
21
+ id: "user-1",
22
+ role: "user",
23
+ status: "final",
24
+ text: "Summarize the approval risk before we let the agent update files.",
25
+ createdAt: "00:04",
26
+ },
27
+ {
28
+ id: "assistant-1",
29
+ role: "assistant",
30
+ status: "final",
31
+ text: "The tool request is limited to a component preview update. No runtime integration or backend state is involved.",
32
+ createdAt: "00:10",
33
+ },
34
+ ];
35
+ function VoiceAgentPanel({ audio = {
36
+ description: "Latest assistant turn",
37
+ duration: "0:18",
38
+ title: "Voice response",
39
+ }, className, mics = defaultMics, selectedMicId = "studio", selectedVoiceId = "calm", status = "listening", transcript = defaultTranscript, voices = defaultVoices, ...props }) {
40
+ const [resolvedMicId, setResolvedMicId] = React.useState(selectedMicId);
41
+ const [resolvedVoiceId, setResolvedVoiceId] = React.useState(selectedVoiceId);
42
+ React.useEffect(() => setResolvedMicId(selectedMicId), [selectedMicId]);
43
+ React.useEffect(() => setResolvedVoiceId(selectedVoiceId), [selectedVoiceId]);
44
+ return (_jsxs("div", { "data-slot": "voice-agent-panel", className: cn("grid w-full min-w-0 gap-4 rounded-lg border bg-background p-4", className), ...props, children: [_jsxs("div", { className: "flex flex-col gap-3 md:flex-row md:items-start md:justify-between", children: [_jsxs("div", { className: "min-w-0", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [_jsx("h3", { className: "truncate text-sm font-medium", children: "Voice agent" }), _jsx(Badge, { variant: "outline", children: status })] }), _jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: "Review voice state, transcript, persona, and playback controls." })] }), _jsxs("div", { className: "flex min-w-0 flex-wrap items-center gap-2", children: [_jsx(MicSelector, { value: resolvedMicId, onValueChange: setResolvedMicId, mics: mics }), _jsx(VoiceSelector, { value: resolvedVoiceId, onValueChange: setResolvedVoiceId, voices: voices })] })] }), _jsxs("div", { className: "grid gap-4 lg:grid-cols-[minmax(14rem,18rem)_minmax(0,1fr)]", children: [_jsxs("div", { className: "grid gap-3", children: [_jsx(VoiceAgentPresence, { status: status }), _jsx(SpeechInput, { status: status })] }), _jsxs("div", { className: "grid min-w-0 gap-3", children: [_jsx(Transcription, { segments: transcript }), _jsx(AudioPlayer, { ...audio })] })] })] }));
45
+ }
46
+ function VoiceAgentPresence({ status }) {
47
+ return (_jsxs("div", { className: "grid justify-items-center gap-3 rounded-lg border bg-card p-4 text-center", children: [_jsx(Persona, { className: "size-40", state: getPersonaState(status) }), _jsxs("div", { className: "grid gap-1", children: [_jsx("p", { className: "text-sm font-medium", children: "Operations copilot" }), _jsx("p", { className: "text-sm text-muted-foreground", children: "Focused on decisions, blockers, and next actions." })] })] }));
48
+ }
49
+ function getPersonaState(status) {
50
+ if (status === "listening")
51
+ return "listening";
52
+ if (status === "processing")
53
+ return "thinking";
54
+ if (status === "speaking")
55
+ return "speaking";
56
+ if (status === "error")
57
+ return "asleep";
58
+ return "idle";
59
+ }
60
+ export { VoiceAgentPanel };
@@ -0,0 +1,18 @@
1
+ import type * as React from "react";
2
+ import type { Edge as FlowEdge, Node as FlowNode } from "@xyflow/react";
3
+ type WorkflowNodeData = {
4
+ description: string;
5
+ status: "queued" | "running" | "complete" | "review";
6
+ title: string;
7
+ [key: string]: unknown;
8
+ };
9
+ type WorkflowNode = FlowNode<WorkflowNodeData, "workflow">;
10
+ type WorkflowCanvasPanelProps = React.ComponentProps<"div"> & {
11
+ description?: string;
12
+ edges?: FlowEdge[];
13
+ nodes?: WorkflowNode[];
14
+ title?: string;
15
+ };
16
+ declare function WorkflowCanvasPanel({ className, description, edges, nodes, title, ...props }: WorkflowCanvasPanelProps): React.JSX.Element;
17
+ export { WorkflowCanvasPanel };
18
+ export type { WorkflowCanvasPanelProps };
@@ -0,0 +1,106 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { GitBranchIcon, Maximize2Icon } from "lucide-react";
3
+ import { MarkerType, useEdgesState, useNodesState } from "@xyflow/react";
4
+ import { useEffect } from "react";
5
+ import { Canvas } from "../agentic/canvas";
6
+ import { Connection } from "../agentic/connection";
7
+ import { Controls } from "../agentic/controls";
8
+ import { Edge } from "../agentic/edge";
9
+ import { Node, NodeAction, NodeContent, NodeDescription, NodeFooter, NodeHeader, NodeTitle, } from "../agentic/node";
10
+ import { Panel } from "../agentic/panel";
11
+ import { Toolbar } from "../agentic/toolbar";
12
+ import { Badge } from "@ciridae/ui/badge";
13
+ import { Button } from "@ciridae/ui/button";
14
+ import { cn } from "@ciridae/ui/utils";
15
+ const nodeTypes = { workflow: WorkflowCanvasPanelNode };
16
+ const edgeTypes = { animated: Edge.Animated };
17
+ const defaultNodes = [
18
+ {
19
+ id: "prompt",
20
+ type: "workflow",
21
+ position: { x: 0, y: 80 },
22
+ data: {
23
+ description: "Collect user goal and files.",
24
+ status: "complete",
25
+ title: "Prompt intake",
26
+ },
27
+ },
28
+ {
29
+ id: "plan",
30
+ type: "workflow",
31
+ position: { x: 320, y: 0 },
32
+ data: {
33
+ description: "Draft steps and dependencies.",
34
+ status: "complete",
35
+ title: "Plan",
36
+ },
37
+ },
38
+ {
39
+ id: "approval",
40
+ type: "workflow",
41
+ position: { x: 320, y: 180 },
42
+ data: {
43
+ description: "Request approval for a file edit.",
44
+ status: "review",
45
+ title: "Tool approval",
46
+ },
47
+ },
48
+ {
49
+ id: "artifact",
50
+ type: "workflow",
51
+ position: { x: 650, y: 80 },
52
+ data: {
53
+ description: "Generate preview and source.",
54
+ status: "running",
55
+ title: "Artifact",
56
+ },
57
+ },
58
+ ];
59
+ const defaultEdges = [
60
+ {
61
+ id: "prompt-plan",
62
+ source: "prompt",
63
+ target: "plan",
64
+ type: "animated",
65
+ markerEnd: { type: MarkerType.ArrowClosed },
66
+ },
67
+ {
68
+ id: "prompt-approval",
69
+ source: "prompt",
70
+ target: "approval",
71
+ type: "animated",
72
+ markerEnd: { type: MarkerType.ArrowClosed },
73
+ },
74
+ {
75
+ id: "plan-artifact",
76
+ source: "plan",
77
+ target: "artifact",
78
+ type: "animated",
79
+ markerEnd: { type: MarkerType.ArrowClosed },
80
+ },
81
+ {
82
+ id: "approval-artifact",
83
+ source: "approval",
84
+ target: "artifact",
85
+ type: "animated",
86
+ markerEnd: { type: MarkerType.ArrowClosed },
87
+ },
88
+ ];
89
+ function WorkflowCanvasPanel({ className, description = "UI-only agent workflow map.", edges = defaultEdges, nodes = defaultNodes, title = "Agent workflow", ...props }) {
90
+ const [flowNodes, setFlowNodes, onNodesChange] = useNodesState(nodes);
91
+ const [flowEdges, setFlowEdges, onEdgesChange] = useEdgesState(edges);
92
+ useEffect(() => {
93
+ setFlowNodes(nodes);
94
+ }, [nodes, setFlowNodes]);
95
+ useEffect(() => {
96
+ setFlowEdges(edges);
97
+ }, [edges, setFlowEdges]);
98
+ return (_jsx("div", { "data-slot": "workflow-canvas-panel", className: cn("grid h-full min-h-[30rem] w-full min-w-0 gap-3", className), ...props, children: _jsxs(Canvas, { className: "h-full w-full min-w-0", connectionLineComponent: Connection, edgeTypes: edgeTypes, edges: flowEdges, fitViewOptions: { padding: 0.28 }, nodeTypes: nodeTypes, nodes: flowNodes, onEdgesChange: onEdgesChange, onNodesChange: onNodesChange, children: [_jsx(Controls, {}), _jsx(Panel, { position: "top-left", children: _jsx(WorkflowCanvasPanelSummary, { description: description, title: title }) })] }) }));
99
+ }
100
+ function WorkflowCanvasPanelSummary({ description, title, }) {
101
+ return (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(GitBranchIcon, { "aria-hidden": "true", className: "size-4 text-muted-foreground" }), _jsxs("div", { children: [_jsx("div", { className: "text-sm font-medium", children: title }), _jsx("div", { className: "text-xs text-muted-foreground", children: description })] })] }));
102
+ }
103
+ function WorkflowCanvasPanelNode({ data, id, selected }) {
104
+ return (_jsxs(Node, { "data-selected": selected ? "true" : undefined, children: [_jsx(Toolbar, { isVisible: true, nodeId: id, children: _jsx(Button, { "aria-label": `Open ${data.title}`, size: "icon", type: "button", variant: "ghost", children: _jsx(Maximize2Icon, { "aria-hidden": "true", className: "size-4" }) }) }), _jsxs(NodeHeader, { children: [_jsx(NodeTitle, { children: data.title }), _jsx(NodeAction, { children: _jsx(Badge, { variant: data.status === "review" ? "outline" : "secondary", children: data.status }) }), _jsx(NodeDescription, { children: data.description })] }), _jsx(NodeContent, { children: _jsx("div", { className: "rounded-md border bg-muted/40 px-3 py-2 text-xs text-muted-foreground", children: "Host apps own execution and persistence." }) }), _jsxs(NodeFooter, { children: [_jsx("span", { children: "UI only" }), _jsx("span", { className: "font-mono", children: id })] })] }));
105
+ }
106
+ export { WorkflowCanvasPanel };
@@ -0,0 +1 @@
1
+ export * from "../components/agentic/agent-card";
@@ -0,0 +1 @@
1
+ export * from "../components/agentic/agent-card";
@@ -0,0 +1 @@
1
+ export * from "../components/agentic/agent-composer";
@@ -0,0 +1 @@
1
+ export * from "../components/agentic/agent-composer";
@@ -0,0 +1 @@
1
+ export * from "../components/agentic/agent-context";
@@ -0,0 +1 @@
1
+ export * from "../components/agentic/agent-context";
@@ -0,0 +1 @@
1
+ export * from "../components/agentic/agent-plan";
@@ -0,0 +1 @@
1
+ export * from "../components/agentic/agent-plan";
@@ -0,0 +1 @@
1
+ export * from "../components/agentic/agent-queue";
@@ -0,0 +1 @@
1
+ export * from "../components/agentic/agent-queue";
@@ -0,0 +1 @@
1
+ export * from "../components/agentic/agent-task";
@@ -0,0 +1 @@
1
+ export * from "../components/agentic/agent-task";
@@ -0,0 +1 @@
1
+ export * from "../components/agentic/types";
@@ -0,0 +1 @@
1
+ export * from "../components/agentic/types";
@@ -0,0 +1 @@
1
+ export * from "../components/agentic/approval-request";
@@ -0,0 +1 @@
1
+ export * from "../components/agentic/approval-request";
@@ -0,0 +1 @@
1
+ export * from "../components/blocks/artifact-workbench";
@@ -0,0 +1 @@
1
+ export * from "../components/blocks/artifact-workbench";
@@ -0,0 +1 @@
1
+ export * from "../components/agentic/artifact";
@@ -0,0 +1 @@
1
+ export * from "../components/agentic/artifact";
@@ -0,0 +1 @@
1
+ export * from "../components/agentic/assistant-mark-icon";
@@ -0,0 +1 @@
1
+ export * from "../components/agentic/assistant-mark-icon";
@@ -0,0 +1 @@
1
+ export * from "../components/agentic/attachments-actions";
@@ -0,0 +1 @@
1
+ export * from "../components/agentic/attachments-actions";