@kitn.ai/ui 0.19.0 → 0.20.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 (235) hide show
  1. package/LICENSE +6 -0
  2. package/NOTICE +54 -0
  3. package/dist/components/audio-visualizer/audio-visualizer.voice-fixture.d.ts +59 -0
  4. package/dist/components/audio-visualizer/aurora.glsl.d.ts +114 -0
  5. package/dist/components/audio-visualizer/index.d.ts +155 -0
  6. package/dist/components/audio-visualizer/shader-canvas.d.ts +130 -0
  7. package/dist/components/audio-visualizer/sizes.d.ts +25 -0
  8. package/dist/components/audio-visualizer/variant-aurora.d.ts +89 -0
  9. package/dist/components/audio-visualizer/variant-bar.d.ts +46 -0
  10. package/dist/components/audio-visualizer/variant-custom.d.ts +73 -0
  11. package/dist/components/audio-visualizer/variant-grid.d.ts +22 -0
  12. package/dist/components/audio-visualizer/variant-radial.d.ts +13 -0
  13. package/dist/components/audio-visualizer/variant-wave.d.ts +11 -0
  14. package/dist/components/audio-visualizer/wave.glsl.d.ts +16 -0
  15. package/dist/create-tween-hvpmSuwW.js +7 -0
  16. package/dist/custom-elements.json +282 -0
  17. package/dist/elements/agent-card.js +1 -1
  18. package/dist/elements/artifact.js +1 -1
  19. package/dist/elements/attachments.js +1 -1
  20. package/dist/elements/audio-visualizer.d.ts +1 -0
  21. package/dist/elements/audio-visualizer.js +1 -0
  22. package/dist/elements/autoloader.js +1 -1
  23. package/dist/elements/avatar.js +1 -1
  24. package/dist/elements/badge.js +1 -1
  25. package/dist/elements/button.js +1 -1
  26. package/dist/elements/card.js +1 -1
  27. package/dist/elements/cards.js +1 -1
  28. package/dist/elements/chain-of-thought.js +1 -1
  29. package/dist/elements/chat-scope-picker.js +1 -1
  30. package/dist/elements/chat-workspace.js +1 -1
  31. package/dist/elements/chat.js +1 -1
  32. package/dist/elements/checkpoint.js +1 -1
  33. package/dist/elements/choice.js +1 -1
  34. package/dist/elements/chunks/{Icon-11SRdjJ4.js → Icon-Tj58ES_d.js} +1 -1
  35. package/dist/elements/chunks/{action-icons-CtRg17uX.js → action-icons-ns1Fnedj.js} +1 -1
  36. package/dist/elements/chunks/arrow-left-DQocUFvy.js +1 -0
  37. package/dist/elements/chunks/{attachments-CBqQRh60.js → attachments-mCB5F1Fq.js} +1 -1
  38. package/dist/elements/chunks/audio-visualizer-BqNy7dfm.js +1 -0
  39. package/dist/elements/chunks/{badge-CxklEXQm.js → badge-B4Zuajl2.js} +1 -1
  40. package/dist/elements/chunks/{button-BD7lUvVB.js → button-ZWNif3--.js} +1 -1
  41. package/dist/elements/chunks/{card-B-PRGXdj.js → card-BkHbp4BA.js} +1 -1
  42. package/dist/elements/chunks/{chat-thread-DIZbRIKG.js → chat-thread-CkRN6pZ7.js} +1 -1
  43. package/dist/elements/chunks/check-B9-gn6SS.js +1 -0
  44. package/dist/elements/chunks/chevron-down-BNsxc2hk.js +1 -0
  45. package/dist/elements/chunks/chevron-right-Hv00StBO.js +1 -0
  46. package/dist/elements/chunks/circle-0e3KJTDr.js +1 -0
  47. package/dist/elements/chunks/circle-check-BNAS0JEy.js +1 -0
  48. package/dist/elements/chunks/{circle-x-mtjCO_Ok.js → circle-x-B7faJFlY.js} +1 -1
  49. package/dist/elements/chunks/{code-block-BeWVttmU.js → code-block-BFUHn6Va.js} +1 -1
  50. package/dist/elements/chunks/collapsible-DM1Ckd4e.js +1 -0
  51. package/dist/elements/chunks/{composer-CavJww3d.js → composer-BguS0QL_.js} +2 -2
  52. package/dist/elements/chunks/{context-CnlsNJSJ.js → context-Cb7k4F-v.js} +1 -1
  53. package/dist/elements/chunks/{conversation-list-5O_KdI_I.js → conversation-list-CvoAkWhN.js} +1 -1
  54. package/dist/elements/chunks/create-tween-oVvAIG8r.js +7 -0
  55. package/dist/elements/chunks/{default-input-CB46cJJ1.js → default-input-Cqqilg9t.js} +1 -1
  56. package/dist/elements/chunks/define-D1din7Ld.js +1 -0
  57. package/dist/elements/chunks/{disclosure-BtFK3a-M.js → disclosure-CIZ5c8nO.js} +1 -1
  58. package/dist/elements/chunks/{download-qJv1dS3M.js → download-Dsbg3ste.js} +1 -1
  59. package/dist/elements/chunks/{dropdown-UhtAueYR.js → dropdown-BDd1-Zgi.js} +1 -1
  60. package/dist/elements/chunks/{ellipsis-B1sOOqiJ.js → ellipsis-Dw6qrss-.js} +1 -1
  61. package/dist/elements/chunks/{external-link-DToP_VKE.js → external-link-Vt74zAoL.js} +1 -1
  62. package/dist/elements/chunks/{file-text-BwUs_Pj4.js → file-text-CZrZF6_v.js} +1 -1
  63. package/dist/elements/chunks/{file-tree-C6RhmSnX.js → file-tree-DF4okKyo.js} +1 -1
  64. package/dist/elements/chunks/{folder-H_Xp0GYP.js → folder-glP5rha4.js} +1 -1
  65. package/dist/elements/chunks/{hover-card-Dn3yrk1l.js → hover-card-Cmm6Q53m.js} +1 -1
  66. package/dist/elements/chunks/{icon-BrxJQXzC.js → icon-BLb8beoi.js} +1 -1
  67. package/dist/elements/chunks/{info-11eT2q5H.js → info-CIsv92JK.js} +1 -1
  68. package/dist/elements/chunks/{input-B9oZKDfb.js → input-Dds1kFyt.js} +1 -1
  69. package/dist/elements/chunks/{kbd-D2fx3rWh.js → kbd-De_xbgi9.js} +1 -1
  70. package/dist/elements/chunks/{link-B-RNYWNw.js → link-i4r_k7z4.js} +1 -1
  71. package/dist/elements/chunks/{loader-BJh_aRlp.js → loader-BmQH4s3V.js} +1 -1
  72. package/dist/elements/chunks/{markdown-BIpjrDFv.js → markdown-Zi21WhUz.js} +7 -7
  73. package/dist/elements/chunks/{message-CPfqj8Gi.js → message-BqyXDN3-.js} +1 -1
  74. package/dist/elements/chunks/{message-feedback-8uj0aVYh.js → message-feedback-Djr3z6Yb.js} +1 -1
  75. package/dist/elements/chunks/message-square-vFAgbDaX.js +1 -0
  76. package/dist/elements/chunks/{minimize-2-C9qkiTJg.js → minimize-2--ifeCGrl.js} +1 -1
  77. package/dist/elements/chunks/{model-switcher-DRrMcRXH.js → model-switcher-B94YAKsM.js} +1 -1
  78. package/dist/elements/chunks/{overlay-C8_FUL8q.js → overlay-kD8dwRv_.js} +1 -1
  79. package/dist/elements/chunks/{paperclip-MA9hxLhW.js → paperclip-q21dYOSK.js} +1 -1
  80. package/dist/elements/chunks/{progress-bar-y5G6HDjg.js → progress-bar-BrAIIaaJ.js} +1 -1
  81. package/dist/elements/chunks/{prompt-suggestion-LalWvCJy.js → prompt-suggestion-Bjn2K-fR.js} +1 -1
  82. package/dist/elements/chunks/reasoning-DTpCGtnY.js +1 -0
  83. package/dist/elements/chunks/{resizable-xhYF5lCQ.js → resizable-Dp4JExql.js} +1 -1
  84. package/dist/elements/chunks/{rotate-cw-2ndEXjgS.js → rotate-cw-CFWWkpj2.js} +1 -1
  85. package/dist/elements/chunks/{scroll-area-BzOPDXrZ.js → scroll-area-Bb0kHH1j.js} +1 -1
  86. package/dist/elements/chunks/scroll-button-B0cH5fXf.js +1 -0
  87. package/dist/elements/chunks/{separator-CPvL5Xdl.js → separator-9kRgr1X9.js} +1 -1
  88. package/dist/elements/chunks/{settings-hmzIuNXD.js → settings-B8lmec4D.js} +1 -1
  89. package/dist/elements/chunks/{settings-group-BiIym17O.js → settings-group-I0hEuXiN.js} +1 -1
  90. package/dist/elements/chunks/{share-BbziTAzn.js → share-C3lTiYGt.js} +1 -1
  91. package/dist/elements/chunks/{skeleton-Bxhs1thL.js → skeleton-DSXW5Yya.js} +1 -1
  92. package/dist/elements/chunks/{star-BHL3Va5p.js → star-CSJtGxgv.js} +1 -1
  93. package/dist/elements/chunks/{store-tpnnWlxY.js → store-CHyW95TP.js} +1 -1
  94. package/dist/elements/chunks/{text-shimmer-1DCKivKx.js → text-shimmer-Cn9TmNpI.js} +1 -1
  95. package/dist/elements/chunks/{textarea-Czaowo9F.js → textarea-CUwqAX0G.js} +1 -1
  96. package/dist/elements/chunks/{thumbs-up-CdLqA13R.js → thumbs-up-PNVVThEF.js} +1 -1
  97. package/dist/elements/chunks/{toast-store-BvBquUFA.js → toast-store-DKbQn3Wn.js} +1 -1
  98. package/dist/elements/chunks/{tool-4P_ne8Go.js → tool-DjTRpIpl.js} +1 -1
  99. package/dist/elements/chunks/tooltip-CgBZCVKp.js +1 -0
  100. package/dist/elements/chunks/{triangle-alert-BllqxXq8.js → triangle-alert-DsHTHCPm.js} +1 -1
  101. package/dist/elements/chunks/{use-card-resolution-73xiddIW.js → use-card-resolution-BSu_XHjH.js} +1 -1
  102. package/dist/elements/chunks/variant-aurora-Dc4nQUia.js +218 -0
  103. package/dist/elements/chunks/variant-custom-y_3kVQhS.js +1 -0
  104. package/dist/elements/chunks/variant-wave-D5OR1-9Z.js +116 -0
  105. package/dist/elements/chunks/{video-O9rA6k7S.js → video-B7vmenoC.js} +1 -1
  106. package/dist/elements/chunks/x-GRUeeQFT.js +1 -0
  107. package/dist/elements/coachmark.js +1 -1
  108. package/dist/elements/code-block.js +1 -1
  109. package/dist/elements/command.js +1 -1
  110. package/dist/elements/compare.js +1 -1
  111. package/dist/elements/composer.js +1 -1
  112. package/dist/elements/confirm-card.js +1 -1
  113. package/dist/elements/context-meter.js +1 -1
  114. package/dist/elements/conversation-list.js +1 -1
  115. package/dist/elements/define.d.ts +11 -0
  116. package/dist/elements/dialog.js +1 -1
  117. package/dist/elements/editable-label.js +1 -1
  118. package/dist/elements/embed.js +1 -1
  119. package/dist/elements/empty.js +1 -1
  120. package/dist/elements/feedback-bar.js +1 -1
  121. package/dist/elements/file-tree.js +1 -1
  122. package/dist/elements/file-upload.js +1 -1
  123. package/dist/elements/form.js +1 -1
  124. package/dist/elements/hover-card.js +1 -1
  125. package/dist/elements/icon.js +1 -1
  126. package/dist/elements/image.js +1 -1
  127. package/dist/elements/input.js +1 -1
  128. package/dist/elements/kbd.js +1 -1
  129. package/dist/elements/link-preview.js +1 -1
  130. package/dist/elements/loader.js +1 -1
  131. package/dist/elements/markdown.js +1 -1
  132. package/dist/elements/menu.js +1 -1
  133. package/dist/elements/message-skills.js +1 -1
  134. package/dist/elements/message.js +1 -1
  135. package/dist/elements/model-switcher.js +1 -1
  136. package/dist/elements/nav.js +1 -1
  137. package/dist/elements/notice.js +1 -1
  138. package/dist/elements/pane-group.js +1 -1
  139. package/dist/elements/pane.js +1 -1
  140. package/dist/elements/popover.js +1 -1
  141. package/dist/elements/progress-bar.js +1 -1
  142. package/dist/elements/prompt-dock.js +1 -1
  143. package/dist/elements/prompt-input.js +1 -1
  144. package/dist/elements/prompt-suggestions.js +1 -1
  145. package/dist/elements/reasoning.js +1 -1
  146. package/dist/elements/remote.js +1 -1
  147. package/dist/elements/resizable.js +1 -1
  148. package/dist/elements/response-stream.js +1 -1
  149. package/dist/elements/screen.js +1 -1
  150. package/dist/elements/scroll-area.js +1 -1
  151. package/dist/elements/scroll-button.js +1 -1
  152. package/dist/elements/search.js +1 -1
  153. package/dist/elements/segmented.js +1 -1
  154. package/dist/elements/separator.js +1 -1
  155. package/dist/elements/setting-item.js +1 -1
  156. package/dist/elements/settings-group.js +1 -1
  157. package/dist/elements/skeleton.js +1 -1
  158. package/dist/elements/slots.d.ts +12 -0
  159. package/dist/elements/source.js +1 -1
  160. package/dist/elements/status.js +1 -1
  161. package/dist/elements/switch.js +1 -1
  162. package/dist/elements/tabs.js +1 -1
  163. package/dist/elements/tasks.js +1 -1
  164. package/dist/elements/text-shimmer.js +1 -1
  165. package/dist/elements/thinking-bar.js +1 -1
  166. package/dist/elements/thread.js +1 -1
  167. package/dist/elements/toast.js +1 -1
  168. package/dist/elements/tool.js +1 -1
  169. package/dist/elements/tooltip.js +1 -1
  170. package/dist/elements/voice-input.js +1 -1
  171. package/dist/elements/voice-output.js +1 -1
  172. package/dist/elements.d.ts +38 -0
  173. package/dist/index.js +18 -17
  174. package/dist/kai.es.js +1 -1
  175. package/dist/llms/llms-full.txt +40 -4
  176. package/dist/llms/llms.txt +3 -3
  177. package/dist/primitives/audio-bands.d.ts +106 -0
  178. package/dist/primitives/create-tween.d.ts +33 -0
  179. package/dist/primitives/use-audio-analysis.d.ts +149 -0
  180. package/dist/primitives/use-sequencer.d.ts +13 -0
  181. package/dist/primitives/use-voice-recorder.d.ts +1 -0
  182. package/dist/primitives/visualizer-sequences.d.ts +39 -0
  183. package/dist/react/index.d.ts +41 -0
  184. package/dist/react.js +159 -153
  185. package/dist/register-impl-DQyejdfb.js +145 -0
  186. package/dist/test-utils/fake-clock.d.ts +45 -0
  187. package/dist/variant-aurora-DVtGqVH6.js +218 -0
  188. package/dist/variant-custom-Dif-IV4u.js +1 -0
  189. package/dist/variant-wave-DbfNdvSi.js +116 -0
  190. package/frameworks/react/index.tsx +42 -0
  191. package/llms-full.txt +40 -4
  192. package/llms.txt +3 -3
  193. package/package.json +6 -3
  194. package/src/components/audio-visualizer/audio-visualizer.voice-fixture.ts +257 -0
  195. package/src/components/audio-visualizer/aurora.glsl.ts +330 -0
  196. package/src/components/audio-visualizer/index.tsx +442 -0
  197. package/src/components/audio-visualizer/shader-canvas.tsx +846 -0
  198. package/src/components/audio-visualizer/sizes.ts +54 -0
  199. package/src/components/audio-visualizer/variant-aurora.tsx +299 -0
  200. package/src/components/audio-visualizer/variant-bar.tsx +143 -0
  201. package/src/components/audio-visualizer/variant-custom.tsx +338 -0
  202. package/src/components/audio-visualizer/variant-grid.tsx +170 -0
  203. package/src/components/audio-visualizer/variant-radial.tsx +158 -0
  204. package/src/components/audio-visualizer/variant-wave.tsx +125 -0
  205. package/src/components/audio-visualizer/wave.glsl.ts +130 -0
  206. package/src/components/component-meta.json +24 -24
  207. package/src/elements/audio-visualizer.tsx +183 -0
  208. package/src/elements/compiled.css +1 -1
  209. package/src/elements/define.tsx +12 -1
  210. package/src/elements/element-manifest.json +4 -0
  211. package/src/elements/element-meta.json +170 -0
  212. package/src/elements/element-types.d.ts +38 -0
  213. package/src/elements/register-impl.ts +1 -0
  214. package/src/elements/slots.ts +35 -0
  215. package/src/primitives/audio-bands.ts +174 -0
  216. package/src/primitives/create-tween.ts +214 -0
  217. package/src/primitives/use-audio-analysis.ts +321 -0
  218. package/src/primitives/use-sequencer.ts +53 -0
  219. package/src/primitives/use-voice-recorder.ts +16 -4
  220. package/src/primitives/visualizer-sequences.ts +350 -0
  221. package/src/test-utils/fake-clock.ts +88 -0
  222. package/dist/elements/chunks/arrow-left-CifsGq8x.js +0 -1
  223. package/dist/elements/chunks/check-CUKS495w.js +0 -1
  224. package/dist/elements/chunks/chevron-down-AELmYT1j.js +0 -1
  225. package/dist/elements/chunks/chevron-right-C8g26oKh.js +0 -1
  226. package/dist/elements/chunks/circle-DGcI8Cft.js +0 -1
  227. package/dist/elements/chunks/circle-check-DuU0IcBQ.js +0 -1
  228. package/dist/elements/chunks/collapsible-DGjADCN6.js +0 -1
  229. package/dist/elements/chunks/define-DfTe4zwZ.js +0 -1
  230. package/dist/elements/chunks/message-square-CCSQ4M9g.js +0 -1
  231. package/dist/elements/chunks/reasoning-CW3SDdb4.js +0 -1
  232. package/dist/elements/chunks/scroll-button-B1x4cYqM.js +0 -1
  233. package/dist/elements/chunks/tooltip-CBeFqJKk.js +0 -1
  234. package/dist/elements/chunks/x-DeS3rQhx.js +0 -1
  235. package/dist/register-impl-CaaHJcea.js +0 -145
@@ -0,0 +1,89 @@
1
+ import { JSX } from 'solid-js';
2
+ import { VisualizerState } from '../../primitives/visualizer-sequences';
3
+ import { ShaderVariantProps } from './index';
4
+ /**
5
+ * Per-state uniform targets, straight from fact sheet section 5's measured
6
+ * table (`.superpowers/sdd/2026-08-07-audio-visualizers/reference/
7
+ * aura-prototype/lk-aura-factsheet.md`) and reconciled against `aurora.glsl.ts`'s
8
+ * own module doc / the Task 14 report's "Uniform list for Task 15" table.
9
+ *
10
+ * ATTRIBUTION: these same values are upstream's, and upstream's copy is
11
+ * Apache-2.0. They live in `packages/shadcn/hooks/agents-ui/
12
+ * use-agent-audio-visualizer-aura.ts` -- the aura DRIVING hook, which carries
13
+ * no Polyform header and is ordinary Apache-2.0 code, unlike the aura
14
+ * COMPONENT and its inline shader. Every row below matches that hook: the
15
+ * four state rows, the listening spring (1.0s, bounce 0.35), the tween and
16
+ * pulse cadences, and the analyser settings the visualizer feeds from
17
+ * (fftSize 512, smoothingTimeConstant 0.55). Recorded in `packages/ui/NOTICE`
18
+ * as an attribution rather than a port, since no code was copied. This is
19
+ * the BEHAVIOUR layer only -- `aurora.glsl.ts` (the rendering) is original
20
+ * work and owes the hook nothing. See `docs/provenance/aurora-clean-room.md`
21
+ * section 7 for the license map that separates the two upstream files.
22
+ *
23
+ * Deliberately NOT `shaderTargets()` (primitives/visualizer-sequences.ts):
24
+ * that helper only carries two axes -- a 0..1 "energy" intensity and a 1..4
25
+ * speed -- built for the OLD custom/aura convention. This shader's real table
26
+ * is non-monotonic across those same two axes (thinking/connecting has LOWER
27
+ * amplitude than idle despite HIGHER brightness) and every value below is a
28
+ * direct fact-sheet pass-through, not a normalized knob, so reusing that
29
+ * helper cannot reproduce it. The Task 14 report calls this out explicitly
30
+ * and asks for this shader's own mapping, parallel to how `waveTargets()`
31
+ * already exists alongside `shaderTargets()` for the wave shader.
32
+ *
33
+ * `speed` here is fact sheet section 5's `S / 20` (state speed 10..70,
34
+ * divided by 20) -- NOT the raw 10..70 value. `complexity` is `freqParam`
35
+ * directly.
36
+ *
37
+ * `rotation` (deg/s, positive = clockwise ON SCREEN) is NOT from the fact
38
+ * sheet: it is this port's own solid-body trim on top of the wind's
39
+ * emergent angular drift, calibrated offline (campaign task #6's probe,
40
+ * replicating scripts/aurora-audit.mjs's estimator at its capture cadence)
41
+ * so the audit-measured per-state rotation lands on the reference values:
42
+ * speaking ~+17 (their +12.9, Rob's reference ~20 CW), listening ~+4.6,
43
+ * thinking ~+9. The wind supplies most of the apparent motion (post-flip
44
+ * it reads ~+22 CW at speaking, ~0 elsewhere); these trims close the
45
+ * per-state gaps. Like `speed`, rotation is never tweened.
46
+ *
47
+ * Connecting originally carried the probe's -4.7 CCW as a -5.5 trim,
48
+ * flipped to the clockwise equivalent (same magnitude) 2026-08-10
49
+ * (supervisor call, Rob delegated): the direction split came from the
50
+ * screenshot-cadence estimator later shown unreliable (closing-sweep
51
+ * finding: IQR swamps the medians), upstream's hook drives thinking and
52
+ * connecting with identical dynamics, and opposite spins on adjacent
53
+ * transitional states read inconsistent. Single-line revert (connecting's
54
+ * `rotation` below) if the eye test ever disagrees.
55
+ */
56
+ declare function auroraTargets(state: VisualizerState): {
57
+ intensity: number | [number, number];
58
+ speed: number;
59
+ complexity: number;
60
+ amplitude: number;
61
+ scale: number;
62
+ rotation: number;
63
+ };
64
+ /**
65
+ * A glowing, drifting aura: 36 phase-offset rings folded through a warp
66
+ * cascade into soft veils. See `aurora.glsl.ts`'s module doc for the shader
67
+ * itself and its provenance.
68
+ *
69
+ * The uniform contract is a direct pass-through of fact sheet section 5's
70
+ * measured per-state table (`auroraTargets` above), NOT the 0..1 convention
71
+ * `wave` and `custom` use. There is deliberately no `uVolume` uniform: the
72
+ * shader would double-apply voice-driven growth if it read one itself on top
73
+ * of whatever this component also does at the state layer, so the live
74
+ * volume drives the scale TWEEN here, in exactly one place (the
75
+ * volume-override effect below), and nowhere else.
76
+ *
77
+ * `dark` is an extra field on top of `ShaderVariantProps`, not yet a member
78
+ * of that shared type: it is meant to carry the FACADE's already-resolved
79
+ * `theme="light"|"dark"|"auto"` decision (see `define.tsx`'s
80
+ * `createDarkMode`), threaded down through the dispatcher, once that wiring
81
+ * lands (see the task report for the exact shape requested). Optional, with
82
+ * a live `prefers-color-scheme` fallback, so this component still works
83
+ * correctly when mounted standalone (no facade above it resolving a
84
+ * `theme` attribute at all).
85
+ */
86
+ export default function AuroraVisualizer(props: ShaderVariantProps & {
87
+ dark?: boolean;
88
+ }): JSX.Element;
89
+ export { auroraTargets };
@@ -0,0 +1,46 @@
1
+ import { JSX } from 'solid-js';
2
+ import { VisualizerState } from '../../primitives/visualizer-sequences';
3
+ import { VisualizerSize } from './sizes';
4
+ /** Props every DOM variant takes. The dispatcher supplies all of them. */
5
+ export interface VariantProps {
6
+ state: VisualizerState;
7
+ size: VisualizerSize;
8
+ /** Multiband levels, 0..1. Only read while `state === 'speaking'`. */
9
+ bands: number[];
10
+ /** `prefers-reduced-motion`: pin the sequencer at its first frame. */
11
+ frozen: boolean;
12
+ /** Overrides the inherited `currentColor` the bars are painted with. */
13
+ color?: string;
14
+ class?: string;
15
+ /**
16
+ * Render each element yourself. Receives the element's static index plus
17
+ * `highlighted` and `value` as live accessors, not plain values: the
18
+ * markup is only mapped once per position (see the `<Index>` note below),
19
+ * so you must CALL `highlighted()` and `value()` from inside your own JSX
20
+ * for them to stay live. Destructuring them into a plain variable freezes
21
+ * them at that moment. `::part(bar)` / `::part(bar highlighted)` (or
22
+ * `cell`) handle restyling from outside; this render-prop is for replacing
23
+ * the markup outright.
24
+ *
25
+ * In bar and grid, your returned element IS the drawn item. Radial is the
26
+ * exception: it always wraps whatever you return in its own positioning
27
+ * element, because each spoke must be absolutely placed around the ring.
28
+ * You still control the markup inside that wrapper, just not its position.
29
+ */
30
+ children?: (item: {
31
+ index: number;
32
+ highlighted: () => boolean;
33
+ value: () => number;
34
+ }) => JSX.Element;
35
+ }
36
+ /**
37
+ * Vertical bars that rise with the audio while speaking, and run a scripted
38
+ * pattern in every other state.
39
+ *
40
+ * Ported from livekit/components-js
41
+ * `packages/shadcn/components/agents-ui/agent-audio-visualizer-bar.tsx`
42
+ * (Apache License 2.0).
43
+ */
44
+ export declare function BarVisualizer(props: VariantProps & {
45
+ barCount?: number;
46
+ }): JSX.Element;
@@ -0,0 +1,73 @@
1
+ import { JSX } from 'solid-js';
2
+ import { UniformSpec } from './shader-canvas';
3
+ import { ShaderVariantProps } from './index';
4
+ /**
5
+ * Uniforms every custom shader receives without asking: the standard set
6
+ * (`uColor`, `uIntensity`, `uSpeed`, `uComplexity`) plus the audio pair that
7
+ * ONLY this variant gets. Upstream's shader path only ever hands a shader a
8
+ * scalar volume; `uBands` -- a per-band `float` array -- has no equivalent
9
+ * there, so a spectrum-reactive custom shader is possible here and not
10
+ * there. `iTime`/`iResolution`/`iMouse`/`iFrame`/`iDate` are declared by
11
+ * `ShaderCanvas` itself for every shader, custom or not, so they are not
12
+ * repeated here.
13
+ *
14
+ * `extra` is a consumer's `ShaderSpec.uniforms` -- untrusted input. Every
15
+ * entry is checked with `uniformProblem` before being merged in; a bad
16
+ * `type`/`value` pairing throws rather than being handed to `ShaderCanvas`,
17
+ * where the mismatch would otherwise throw a `TypeError` inside WebGL's
18
+ * `uniform*` setters, called from `ShaderCanvas`'s OWN
19
+ * `requestAnimationFrame` loop, where nothing catches it and the canvas
20
+ * silently stops animating. `CustomVisualizer` below is what turns that
21
+ * throw into the same `onUnavailable` seam every other shader failure uses
22
+ * -- see its own doc for how.
23
+ *
24
+ * Pure and synchronous: reads no signals, schedules nothing. Task 15 reuses
25
+ * it as-is.
26
+ */
27
+ export declare function customUniforms(values: {
28
+ color: string;
29
+ intensity: number;
30
+ speed: number;
31
+ complexity: number;
32
+ volume: number;
33
+ bands: number[];
34
+ }, extra?: Record<string, UniformSpec>): Record<string, UniformSpec>;
35
+ /**
36
+ * Renders a consumer-supplied fragment shader.
37
+ *
38
+ * The shader must define `mainImage(out vec4 fragColor, in vec2 fragCoord)`
39
+ * and gets the five ShaderToy built-ins (`iTime`, `iResolution`, `iMouse`,
40
+ * `iFrame`, `iDate`) plus every uniform `customUniforms` above declares.
41
+ * `ShaderCanvas` DECLARES all of them for you -- declaring the SAME name
42
+ * again inside the shader body is a GLSL redefinition and fails to compile.
43
+ *
44
+ * `fragColor` MUST be premultiplied: `vec4(rgb * alpha, alpha)`, never
45
+ * `vec4(rgb, alpha)`. The canvas composites using the browser's default
46
+ * `premultipliedAlpha: true`; a translucent edge written the natural
47
+ * (straight-alpha) way gets a dark fringe where it meets a light page. For
48
+ * example, a shader painting a soft circle that fades to transparent at its
49
+ * edge:
50
+ *
51
+ * ```glsl
52
+ * void mainImage(out vec4 fragColor, in vec2 fragCoord) {
53
+ * vec2 uv = fragCoord / iResolution.xy;
54
+ * float alpha = smoothstep(1.0, 0.0, length(uv - 0.5) * 2.0) * uIntensity;
55
+ * fragColor = vec4(uColor * alpha, alpha); // premultiplied -- NOT vec4(uColor, alpha)
56
+ * }
57
+ * ```
58
+ *
59
+ * `uVolume` (scalar) and `uBands` (a `float[N]` array, `N` tracking the
60
+ * visualizer's actual band count) are this task's differentiating feature:
61
+ * upstream's shader path only ever hands a shader a scalar, so a
62
+ * spectrum-reactive custom shader is only possible here.
63
+ *
64
+ * A bad `props.shader.uniforms` entry (an unrecognized `type`, or a `value`
65
+ * that does not match it) is logged loudly via `console.error` -- it is a
66
+ * bug in the consumer's shader spec they need to see -- and routed through
67
+ * `props.onUnavailable`, same as a shader compile or link failure. A
68
+ * missing WebGL context logs quietly via `console.warn`: that is an
69
+ * expected environment limitation, not a bug. `props.shader` being absent
70
+ * entirely is neither: it renders an empty placeholder and does not call
71
+ * `onUnavailable` at all, since nothing was ever asked to render.
72
+ */
73
+ export default function CustomVisualizer(props: ShaderVariantProps): JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { JSX } from 'solid-js';
2
+ import { VariantProps } from './variant-bar';
3
+ /**
4
+ * A grid of dots that pulses with the audio.
5
+ *
6
+ * Ported from livekit/components-js
7
+ * `packages/shadcn/components/agents-ui/agent-audio-visualizer-grid.tsx`
8
+ * (Apache License 2.0), except the speaking threshold remap — see the
9
+ * divergence note above.
10
+ */
11
+ export declare function GridVisualizer(props: VariantProps & {
12
+ /** Rows AND columns of the (always square) grid. Default from the size
13
+ * preset. Replaced the former independent rowCount/columnCount pre-1.0:
14
+ * columns alone carry the audio signal, so a non-square grid only ever
15
+ * changed threshold-ring resolution — never expression (Rob, 2026-08-09;
16
+ * upstream is square-by-default via `rowCount ?? columnCount` too). */
17
+ count?: number;
18
+ /** Ring distance from center for the connecting animation, in cells. */
19
+ spread?: number;
20
+ /** Ms between scripted frames. Default 100. */
21
+ interval?: number;
22
+ }): JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { JSX } from 'solid-js';
2
+ import { VariantProps } from './variant-bar';
3
+ /**
4
+ * Bars arranged around a circle, growing outward with the audio.
5
+ *
6
+ * Ported from livekit/components-js
7
+ * `packages/shadcn/components/agents-ui/agent-audio-visualizer-radial.tsx`
8
+ * (Apache License 2.0).
9
+ */
10
+ export declare function RadialVisualizer(props: VariantProps & {
11
+ barCount?: number;
12
+ radius?: number;
13
+ }): JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { JSX } from 'solid-js';
2
+ import { ShaderVariantProps } from './index';
3
+ /**
4
+ * A flowing oscilloscope line.
5
+ *
6
+ * Ported from livekit/components-js `agent-audio-visualizer-wave.tsx`
7
+ * (Apache License 2.0). The shader itself (`wave.glsl.ts`) is copied
8
+ * verbatim; this wrapper replaces upstream's React component and its
9
+ * `motion` dependency with Solid signals and `createTween`.
10
+ */
11
+ export default function WaveVisualizer(props: ShaderVariantProps): JSX.Element;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Oscilloscope wave fragment shader.
3
+ *
4
+ * Copied verbatim from livekit/components-js
5
+ * `packages/shadcn/components/agents-ui/agent-audio-visualizer-wave.tsx`
6
+ * (Apache License 2.0). Unmodified apart from being extracted to its own
7
+ * module: no GLSL lines were added, removed, or reformatted. The source
8
+ * contained no `uniform ...;` declarations to strip -- `uFrequency`,
9
+ * `uSpeed`, `uAmplitude`, `uLineWidth`, `uSmoothing`, `uColor`,
10
+ * `uColorShift`, and `uMix` are all bound by the caller (see uses of
11
+ * `ShaderCanvas` below), which is what declares them.
12
+ *
13
+ * Uniforms are declared by ShaderCanvas. Do not declare them here.
14
+ */
15
+ declare const _default: "\nconst float TAU = 6.28318530718;\n\n// Noise for dithering\nvec2 randFibo(vec2 p) {\n p = fract(p * vec2(443.897, 441.423));\n p += dot(p, p.yx + 19.19);\n return fract((p.xx + p.yx) * p.xy);\n}\n\n// Luma for alpha\nfloat luma(vec3 color) {\n return dot(color, vec3(0.299, 0.587, 0.114));\n}\n\n// RGB to HSV\nvec3 rgb2hsv(vec3 c) {\n vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\n vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));\n vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));\n float d = q.x - min(q.w, q.y);\n float e = 1.0e-10;\n return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);\n}\n\n// HSV to RGB\nvec3 hsv2rgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\n// Bell curve function for attenuation from center with rounded top\nfloat bellCurve(float distanceFromCenter, float maxDistance) {\n float normalizedDistance = distanceFromCenter / maxDistance;\n // Use cosine with high power for smooth rounded top\n return pow(cos(normalizedDistance * (3.14159265359 / 4.0)), 16.0);\n}\n\n// Calculate the sine wave\nfloat oscilloscopeWave(float x, float centerX, float time) {\n float relativeX = x - centerX;\n float maxDistance = centerX;\n float distanceFromCenter = abs(relativeX);\n\n // Apply bell curve for amplitude attenuation\n float bell = bellCurve(distanceFromCenter, maxDistance);\n\n // Calculate wave with uniforms and bell curve attenuation\n float wave = sin(relativeX * uFrequency + time * uSpeed) * uAmplitude * bell;\n\n return wave;\n}\n\nvoid mainImage(out vec4 fragColor, in vec2 fragCoord) {\n vec2 uv = fragCoord / iResolution.xy;\n vec2 pos = uv - 0.5;\n\n // Calculate center and positions\n float centerX = 0.5;\n float centerY = 0.5;\n float x = uv.x;\n float y = uv.y;\n\n // Convert line width from pixels to UV space\n // Use the average of width and height to handle aspect ratio\n float pixelSize = 2.0 / (iResolution.x + iResolution.y);\n float lineWidthUV = uLineWidth * pixelSize;\n float smoothingUV = uSmoothing * pixelSize;\n\n // Find minimum distance to the wave by sampling nearby points\n // This gives us consistent line width without high-frequency artifacts\n const int NUM_SAMPLES = 50; // Must be const for GLSL loop\n float minDist = 1000.0;\n float sampleRange = 0.02; // Range to search for closest point\n\n for(int i = 0; i < NUM_SAMPLES; i++) {\n float offset = (float(i) / float(NUM_SAMPLES - 1) - 0.5) * sampleRange;\n float sampleX = x + offset;\n float waveY = centerY + oscilloscopeWave(sampleX, centerX, iTime);\n\n // Calculate distance from current pixel to this point on the wave\n vec2 wavePoint = vec2(sampleX, waveY);\n vec2 currentPoint = vec2(x, y);\n float dist = distance(currentPoint, wavePoint);\n\n minDist = min(minDist, dist);\n }\n\n // Solid line with smooth edges using minimum distance\n float line = smoothstep(lineWidthUV + smoothingUV, lineWidthUV - smoothingUV, minDist);\n\n vec3 color = uColor;\n if(abs(uColorShift) > 0.01) {\n // Keep the center 50% at base color, then ramp shift across outer 25% on each side.\n float centerBandHalfWidth = 0.2;\n float edgeBandWidth = 0.5;\n float distanceFromCenter = abs(x - centerX);\n float edgeFactor = clamp((distanceFromCenter - centerBandHalfWidth) / edgeBandWidth, 0.0, 1.0);\n vec3 hsv = rgb2hsv(color);\n // Hue shift is zero in the center band and strongest at far edges.\n hsv.x = fract(hsv.x + edgeFactor * uColorShift * 0.3);\n color = hsv2rgb(hsv);\n }\n\n // Apply line intensity\n color *= line;\n\n // Add dithering for smoother gradients\n // color += (randFibo(fragCoord).x - 0.5) / 255.0;\n\n // Calculate alpha based on line intensity\n float alpha = line * uMix;\n\n fragColor = vec4(color * uMix, alpha);\n}";
16
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import{t as we,u as Le,c as ye,e as Re}from"./register-impl-DQyejdfb.js";import{c as B,o as U,d as le,u as fe,b as Ie,f as ce}from"./kai.es.js";var Pe=we("<canvas part=canvas>");const ue="#1FD5F9";function me(e){const n=e.trim().match(/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/);if(!n)return me(ue);const[,o,a,l]=n;return[parseInt(o,16)/255,parseInt(a,16)/255,parseInt(l,16)/255]}const Ce={"1f":"float","1i":"int","1fv":"float","2f":"vec2","3f":"vec3","3fv":"vec3","4f":"vec4","4fv":"vec4",Matrix2fv:"mat2",Matrix3fv:"mat3",Matrix4fv:"mat4"},_e={"1fv":1,"3fv":3,"4fv":4,Matrix2fv:4,Matrix3fv:9,Matrix4fv:16};function Oe(e){const n=_e[e.type];if(!n||!Array.isArray(e.value))return;const o=e.value.length/n;return o>1&&Number.isInteger(o)?o:void 0}function ve(e){return e.arraySize??Oe(e)}const ke=["uniform float iTime;","uniform vec2 iResolution;","uniform vec4 iMouse;","uniform int iFrame;","uniform vec4 iDate;"].join(`
2
+ `),Te=`
3
+ attribute vec3 aVertexPosition;
4
+ void main() { gl_Position = vec4(aVertexPosition, 1.0); }
5
+ `;function De(e,n,o){const a=Object.entries(n).map(([l,i])=>{const v=ve(i),m=v?`[${v}]`:"";return`uniform ${Ce[i.type]} ${l}${m};`}).join(`
6
+ `);return[`precision ${o} float;`,ke,a,e,"void main() { mainImage(gl_FragColor, gl_FragCoord.xy); }"].join(`
7
+ `)}function Be(e){return Object.keys(e).sort().map(n=>{const o=e[n];return`${n}:${o.type}:${ve(o)??""}`}).join("|")}function de(e,n,o){const a=e.createShader(n);if(!a)return"Could not create a WebGL shader.";if(e.shaderSource(a,o),e.compileShader(a),!e.getShaderParameter(a,e.COMPILE_STATUS)){const l=e.getShaderInfoLog(a)??"Unknown shader compile error.";return e.deleteShader(a),l}return a}function Ne(e,n,o){const a=o.value;switch(o.type){case"1f":e.uniform1f(n,a);break;case"1i":e.uniform1i(n,a);break;case"1fv":e.uniform1fv(n,a);break;case"2f":e.uniform2fv(n,a);break;case"3f":case"3fv":e.uniform3fv(n,a);break;case"4f":case"4fv":e.uniform4fv(n,a);break;case"Matrix2fv":e.uniformMatrix2fv(n,!1,a);break;case"Matrix3fv":e.uniformMatrix3fv(n,!1,a);break;case"Matrix4fv":e.uniformMatrix4fv(n,!1,a);break}}function $e(e){let n;const o=B(()=>Be(e.uniforms??{})),a=B(()=>e.fragment),l=B(()=>e.precision??"highp");let i="none",v=null,m=null,r=null,c=null,f=0,h=null,u=!1,M=!1,F=!1,E=!1,p,A=!1,w=!0,R=!1,I=0,P=0,q=0;const ge=()=>{var s;return v||(v=n.getContext("webgl")??n.getContext("experimental-webgl"),v&&(i="live",m=((s=v.getExtension)==null?void 0:s.call(v,"WEBGL_lose_context"))??null),v)},j=()=>{f!==0||!c||E||(P=performance.now(),f=requestAnimationFrame(c))},G=()=>{f!==0&&(cancelAnimationFrame(f),f=0,I+=Math.max(0,performance.now()-P))},T=()=>{G();const s=r;r=null,s?.()},be=()=>{!m||i!=="live"||(i="losing",m.loseContext())},V=()=>{m&&(i="restoring",m.restoreContext())},O=()=>{if(!(E||M||F))if(w||R){if(i==="losing"||i==="restoring")return;if(i==="lost"){V();return}Ae()}else m&&i==="live"?(T(),be()):G()},xe=s=>{s===w||E||(w=s,O())},H=s=>{var g;s.preventDefault();const L=i==="losing";if(i="lost",T(),L){O();return}F=!0,(g=e.onError)==null||g.call(e,"WebGL context was lost.")},Y=()=>{i="live",O()},pe=()=>{A||(A=!0,n.addEventListener("webglcontextlost",H,!1),n.addEventListener("webglcontextrestored",Y,!1),!(typeof IntersectionObserver>"u")&&(w=!1,p=new IntersectionObserver(s=>{const g=s[s.length-1];g&&xe(g.isIntersecting)},{threshold:0}),p.observe(n)))},Ae=()=>{var s,g,L,z,X;if(E||M||F||u)return;const K=h;if(!K)return;if(r){j();return}const t=ge();if(!t){M=!0,(s=e.onError)==null||s.call(e,"WebGL is not available in this browser.");return}if(t.isContextLost()){V();return}const{source:Se,uniforms:Fe}=K,y=de(t,t.VERTEX_SHADER,Te);if(typeof y=="string"){u=!0,(g=e.onError)==null||g.call(e,y);return}const C=de(t,t.FRAGMENT_SHADER,Se);if(typeof C=="string"){t.deleteShader(y),u=!0,(L=e.onError)==null||L.call(e,C);return}const b=t.createProgram();if(!b){t.deleteShader(y),t.deleteShader(C),u=!0,(z=e.onError)==null||z.call(e,"Could not create a WebGL program.");return}if(t.attachShader(b,y),t.attachShader(b,C),t.linkProgram(b),!t.getProgramParameter(b,t.LINK_STATUS)){const d=t.getProgramInfoLog(b)??"Shader program failed to link.";t.deleteProgram(b),t.deleteShader(y),t.deleteShader(C),u=!0,(X=e.onError)==null||X.call(e,d);return}t.useProgram(b);const J=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,J),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,0,1,-1,0,-1,1,0,1,1,0]),t.STATIC_DRAW);const Q=t.getAttribLocation(b,"aVertexPosition");t.enableVertexAttribArray(Q),t.vertexAttribPointer(Q,3,t.FLOAT,!1,0,0),t.enable(t.BLEND),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA);const _=d=>t.getUniformLocation(b,d),Z=_("iTime"),ee=_("iResolution"),te=_("iMouse"),ne=_("iFrame"),re=_("iDate"),Ee=Object.keys(Fe).map(d=>[d,_(d)]),N=[0,0,0,0],oe=d=>{const x=n.getBoundingClientRect();N[0]=d.clientX-x.left,N[1]=x.height-(d.clientY-x.top)};n.addEventListener("pointermove",oe,{passive:!0});const $=()=>{const d=globalThis.devicePixelRatio??1,x=Math.max(1,Math.floor(n.clientWidth*d)),k=Math.max(1,Math.floor(n.clientHeight*d));(n.width!==x||n.height!==k)&&(n.width=x,n.height=k,t.viewport(0,0,x,k))},D=typeof ResizeObserver<"u"?new ResizeObserver($):void 0;D?.observe(n),$();const ae=d=>{var x;if(F||t.isContextLost())return;$();const k=Math.max(0,(I+(d-P))/1e3);if(Z&&t.uniform1f(Z,k),ee&&t.uniform2fv(ee,[n.width,n.height]),te&&t.uniform4fv(te,N),ne&&t.uniform1i(ne,q),re){const S=new Date;t.uniform4fv(re,[S.getFullYear(),S.getMonth(),S.getDate(),S.getHours()*3600+S.getMinutes()*60+S.getSeconds()])}for(const[S,ie]of Ee){const se=(x=e.uniforms)==null?void 0:x[S];se&&ie&&Ne(t,ie,se)}t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_STRIP,0,4),q++,f=requestAnimationFrame(ae)};r=()=>{c=null,D?.disconnect(),n.removeEventListener("pointermove",oe),t.deleteProgram(b),t.deleteShader(y),t.deleteShader(C),t.deleteBuffer(J)},c=ae,j()};U(()=>{E=!0,p?.disconnect(),A&&(n.removeEventListener("webglcontextlost",H),n.removeEventListener("webglcontextrestored",Y)),T(),m&&i==="live"&&m.loseContext()});const Me=B(()=>e.animateWhenNotVisible??!1);return le(()=>{R=Me(),O()}),le(()=>{const s=a(),g=l();o();const L=fe(()=>e.uniforms??{});h={source:De(s,L,g),uniforms:L},u=!1,pe(),O(),U(T)}),(()=>{var s=Pe(),g=n;return typeof g=="function"?Le(g,s):n=s,Ie(()=>ye(s,Re("block h-full w-full",e.class))),s})()}function W(e,n,o,a){const l=r=>3*(1-r)*(1-r)*r*e+3*(1-r)*r*r*o+r*r*r,i=r=>3*(1-r)*(1-r)*r*n+3*(1-r)*r*r*a+r*r*r,v=r=>3*(1-r)*(1-r)*e+6*(1-r)*r*(o-e)+3*r*r*(1-o);function m(r){let c=0,f=1;for(let h=0;h<30;h++){const u=(c+f)/2;l(u)<r?c=u:f=u}return(c+f)/2}return r=>{if(r<=0)return 0;if(r>=1)return 1;let c=r;for(let f=0;f<8;f++){const h=v(c);if(Math.abs(h)<1e-6)return i(m(r));const u=c-(l(c)-r)/h;if(u<=0||u>=1)return i(m(r));c=u}return i(c)}}const Ue={linear:e=>e,easeIn:W(.42,0,1,1),easeOut:W(0,0,.58,1),easeInOut:W(.42,0,.58,1)};function We(e,n){const o=Math.max(.05,1-Math.min(.95,n)),a=10,l=a*Math.sqrt(Math.max(0,1-o*o));return 1-Math.exp(-o*a*e)*(Math.cos(l*e)+o*a/(l||1)*Math.sin(l*e))}function he(e){return"type"in e&&e.type==="spring"}function qe(e){const[n,o]=ce(e),[a,l]=ce(!1);let i=0,v=!1;const m=()=>{i&&cancelAnimationFrame(i),i=0};U(()=>{v=!0,m(),l(!1)});function r(c,f){if(m(),v)return;const h=Array.isArray(c),[u,M]=h?c:[fe(n),c];if(!f||!he(f)&&f.duration===0){l(!1),o(h?u:M);return}const F=f.duration*1e3;if(F<=0){l(!1),o(M);return}if(typeof requestAnimationFrame>"u"){l(!1),o(M);return}const E=he(f)?I=>We(I,f.bounce):Ue[f.ease??"easeOut"];let p=u,A=M;h&&o(u);let w=performance.now();const R=I=>{const P=Math.min(1,(I-w)/F);if(o(p+(A-p)*E(P)),P<1){i=requestAnimationFrame(R);return}if(!h){o(A),i=0,l(!1);return}o(A),[p,A]=[A,p],w=performance.now(),i=requestAnimationFrame(R)};l(!0),i=requestAnimationFrame(R)}return{value:n,animating:a,to:r}}export{ue as D,$e as S,qe as c,me as h};
@@ -698,6 +698,288 @@
698
698
  }
699
699
  ]
700
700
  },
701
+ {
702
+ "kind": "class",
703
+ "customElement": true,
704
+ "tagName": "kai-audio-visualizer",
705
+ "name": "KaiAudioVisualizerElement",
706
+ "description": "",
707
+ "members": [
708
+ {
709
+ "kind": "field",
710
+ "name": "variant",
711
+ "type": {
712
+ "text": "undefined | string"
713
+ },
714
+ "description": "Look to render: `bar` (default), `grid`, `radial`, `wave`, `aurora`, `custom`. `aura` is accepted as a LiveKit-markup alias for `aurora`. Attribute: `variant`.",
715
+ "privacy": "public"
716
+ },
717
+ {
718
+ "kind": "field",
719
+ "name": "state",
720
+ "type": {
721
+ "text": "undefined | string"
722
+ },
723
+ "description": "`idle` (default), `connecting`, `listening`, `thinking`, `speaking`, `disconnected` (connection down: the dead, flat look). LiveKit's room-lifecycle state names are accepted as aliases. Attribute: `state`.",
724
+ "privacy": "public"
725
+ },
726
+ {
727
+ "kind": "field",
728
+ "name": "size",
729
+ "type": {
730
+ "text": "undefined | string"
731
+ },
732
+ "description": "`icon` | `sm` | `md` (default) | `lg` | `xl`. Attribute: `size`.",
733
+ "privacy": "public"
734
+ },
735
+ {
736
+ "kind": "field",
737
+ "name": "barCount",
738
+ "type": {
739
+ "text": "undefined | number"
740
+ },
741
+ "description": "Bars to draw. Bar and radial only. Attribute: `bar-count`.",
742
+ "privacy": "public"
743
+ },
744
+ {
745
+ "kind": "field",
746
+ "name": "count",
747
+ "type": {
748
+ "text": "undefined | number"
749
+ },
750
+ "description": "Grid only: rows and columns of the (always square) grid. Attribute: `count`.",
751
+ "privacy": "public"
752
+ },
753
+ {
754
+ "kind": "field",
755
+ "name": "radius",
756
+ "type": {
757
+ "text": "undefined | number"
758
+ },
759
+ "description": "Radial only: ring distance from center, in px. Attribute: `radius`.",
760
+ "privacy": "public"
761
+ },
762
+ {
763
+ "kind": "field",
764
+ "name": "spread",
765
+ "type": {
766
+ "text": "undefined | number"
767
+ },
768
+ "description": "Grid only: ring distance for the connecting animation, in cells. Attribute: `spread`.",
769
+ "privacy": "public"
770
+ },
771
+ {
772
+ "kind": "field",
773
+ "name": "interval",
774
+ "type": {
775
+ "text": "undefined | number"
776
+ },
777
+ "description": "Grid only: ms between scripted frames. Attribute: `interval`.",
778
+ "privacy": "public"
779
+ },
780
+ {
781
+ "kind": "field",
782
+ "name": "color",
783
+ "type": {
784
+ "text": "undefined | string"
785
+ },
786
+ "description": "CSS color for the geometry, overriding the inherited `currentColor`. Attribute: `color`.",
787
+ "privacy": "public"
788
+ },
789
+ {
790
+ "kind": "field",
791
+ "name": "complexity",
792
+ "type": {
793
+ "text": "undefined | number"
794
+ },
795
+ "description": "Shader variants only: pattern density, 0..1. Attribute: `complexity`.",
796
+ "privacy": "public"
797
+ },
798
+ {
799
+ "kind": "field",
800
+ "name": "label",
801
+ "type": {
802
+ "text": "undefined | string"
803
+ },
804
+ "description": "Setting this makes the element an announced image (`role=\"img\"`) instead of decorative (`aria-hidden`). Attribute: `label`.",
805
+ "privacy": "public"
806
+ },
807
+ {
808
+ "kind": "field",
809
+ "name": "stream",
810
+ "type": {
811
+ "text": "undefined | MediaStream"
812
+ },
813
+ "description": "Live microphone or WebRTC audio to analyze. JS property only.",
814
+ "privacy": "public"
815
+ },
816
+ {
817
+ "kind": "field",
818
+ "name": "audioElement",
819
+ "type": {
820
+ "text": "undefined | HTMLMediaElement"
821
+ },
822
+ "description": "An `<audio>` or `<video>` element to tap for its audio. JS property only.",
823
+ "privacy": "public"
824
+ },
825
+ {
826
+ "kind": "field",
827
+ "name": "bands",
828
+ "type": {
829
+ "text": "undefined | number[]"
830
+ },
831
+ "description": "Pre-computed levels, 0..1. Set this and no AudioContext is ever built, which is what keeps headless/SSR rendering and browser-speech-synthesis playback (which exposes no audio node) free of Web Audio entirely. JS property only. A new array reference is required for each update; mutating the existing array in place will not re-render.",
832
+ "privacy": "public"
833
+ },
834
+ {
835
+ "kind": "field",
836
+ "name": "shader",
837
+ "type": {
838
+ "text": "undefined | { fragment: string; uniforms?: undefined | Record<string, { type: \"1f\" | \"1i\" | \"1fv\" | \"2f\" | \"3f\" | \"3fv\" | \"4f\" | \"4fv\" | \"Matrix2fv\" | \"Matrix3fv\" | \"Matrix4fv\"; value: number | number[] }> }"
839
+ },
840
+ "description": "Custom fragment shader for `variant=\"custom\"`. JS property only.",
841
+ "privacy": "public"
842
+ },
843
+ {
844
+ "kind": "field",
845
+ "name": "animateWhenNotVisible",
846
+ "type": {
847
+ "text": "undefined | false | true"
848
+ },
849
+ "description": "Shader variants only: keep animating while scrolled off screen. Off by default, which stops drawing and releases the WebGL context until the element comes back (browsers ration contexts to roughly 16 a page). Does not override `prefers-reduced-motion`. Attribute: `animate-when-not-visible`.",
850
+ "privacy": "public"
851
+ }
852
+ ],
853
+ "attributes": [
854
+ {
855
+ "name": "theme",
856
+ "type": {
857
+ "text": "'light' | 'dark' | 'auto'"
858
+ },
859
+ "description": "Color mode (auto follows prefers-color-scheme)."
860
+ },
861
+ {
862
+ "name": "variant",
863
+ "fieldName": "variant",
864
+ "type": {
865
+ "text": "undefined | string"
866
+ },
867
+ "description": "Look to render: `bar` (default), `grid`, `radial`, `wave`, `aurora`, `custom`. `aura` is accepted as a LiveKit-markup alias for `aurora`. Attribute: `variant`."
868
+ },
869
+ {
870
+ "name": "state",
871
+ "fieldName": "state",
872
+ "type": {
873
+ "text": "undefined | string"
874
+ },
875
+ "description": "`idle` (default), `connecting`, `listening`, `thinking`, `speaking`, `disconnected` (connection down: the dead, flat look). LiveKit's room-lifecycle state names are accepted as aliases. Attribute: `state`."
876
+ },
877
+ {
878
+ "name": "size",
879
+ "fieldName": "size",
880
+ "type": {
881
+ "text": "undefined | string"
882
+ },
883
+ "description": "`icon` | `sm` | `md` (default) | `lg` | `xl`. Attribute: `size`."
884
+ },
885
+ {
886
+ "name": "bar-count",
887
+ "fieldName": "barCount",
888
+ "type": {
889
+ "text": "undefined | number"
890
+ },
891
+ "description": "Bars to draw. Bar and radial only. Attribute: `bar-count`."
892
+ },
893
+ {
894
+ "name": "count",
895
+ "fieldName": "count",
896
+ "type": {
897
+ "text": "undefined | number"
898
+ },
899
+ "description": "Grid only: rows and columns of the (always square) grid. Attribute: `count`."
900
+ },
901
+ {
902
+ "name": "radius",
903
+ "fieldName": "radius",
904
+ "type": {
905
+ "text": "undefined | number"
906
+ },
907
+ "description": "Radial only: ring distance from center, in px. Attribute: `radius`."
908
+ },
909
+ {
910
+ "name": "spread",
911
+ "fieldName": "spread",
912
+ "type": {
913
+ "text": "undefined | number"
914
+ },
915
+ "description": "Grid only: ring distance for the connecting animation, in cells. Attribute: `spread`."
916
+ },
917
+ {
918
+ "name": "interval",
919
+ "fieldName": "interval",
920
+ "type": {
921
+ "text": "undefined | number"
922
+ },
923
+ "description": "Grid only: ms between scripted frames. Attribute: `interval`."
924
+ },
925
+ {
926
+ "name": "color",
927
+ "fieldName": "color",
928
+ "type": {
929
+ "text": "undefined | string"
930
+ },
931
+ "description": "CSS color for the geometry, overriding the inherited `currentColor`. Attribute: `color`."
932
+ },
933
+ {
934
+ "name": "complexity",
935
+ "fieldName": "complexity",
936
+ "type": {
937
+ "text": "undefined | number"
938
+ },
939
+ "description": "Shader variants only: pattern density, 0..1. Attribute: `complexity`."
940
+ },
941
+ {
942
+ "name": "label",
943
+ "fieldName": "label",
944
+ "type": {
945
+ "text": "undefined | string"
946
+ },
947
+ "description": "Setting this makes the element an announced image (`role=\"img\"`) instead of decorative (`aria-hidden`). Attribute: `label`."
948
+ },
949
+ {
950
+ "name": "animate-when-not-visible",
951
+ "fieldName": "animateWhenNotVisible",
952
+ "type": {
953
+ "text": "undefined | false | true"
954
+ },
955
+ "description": "Shader variants only: keep animating while scrolled off screen. Off by default, which stops drawing and releases the WebGL context until the element comes back (browsers ration contexts to roughly 16 a page). Does not override `prefers-reduced-motion`. Attribute: `animate-when-not-visible`."
956
+ }
957
+ ],
958
+ "events": [],
959
+ "cssProperties": [],
960
+ "cssParts": [
961
+ {
962
+ "name": "bar",
963
+ "description": "A single bar in the `bar` variant, or a single spoke in the `radial` variant. Also carries `data-kai-index` and `data-kai-highlighted` (\"true\"/\"false\") for use inside the shadow root; to style the lit state from OUTSIDE, combine with the `highlighted` part below rather than an attribute selector.",
964
+ "recipe": "kai-audio-visualizer::part(bar) { border-radius: 2px }\nkai-audio-visualizer::part(bar highlighted) { background: var(--brand) }"
965
+ },
966
+ {
967
+ "name": "cell",
968
+ "description": "A single dot in the `grid` variant. Also carries `data-kai-index` and `data-kai-highlighted` (\"true\"/\"false\") for use inside the shadow root; to style the lit state from OUTSIDE, combine with the `highlighted` part below rather than an attribute selector.",
969
+ "recipe": "kai-audio-visualizer::part(cell) { border-radius: 9999px }\nkai-audio-visualizer::part(cell highlighted) { background: var(--brand) }"
970
+ },
971
+ {
972
+ "name": "highlighted",
973
+ "description": "A second part TOKEN present on a `bar` or `cell` exactly when the sequencer or live audio has it lit, not a standalone styleable element. Combine it in the same `::part()` argument: `::part(bar highlighted)` or `::part(cell highlighted)`. This is the external equivalent of the internal `data-kai-highlighted=\"true\"` attribute, which a `::part()` selector cannot reach (an attribute selector cannot follow a pseudo-element).",
974
+ "recipe": "kai-audio-visualizer::part(bar highlighted) { background: var(--brand) }\nkai-audio-visualizer::part(cell highlighted) { background: var(--brand) }"
975
+ },
976
+ {
977
+ "name": "canvas",
978
+ "description": "The WebGL canvas backing the `wave` and `aurora` variants. Restyle its size or radius, or layer a mask/filter, from outside.",
979
+ "recipe": "kai-audio-visualizer::part(canvas) { border-radius: 0.75rem }"
980
+ }
981
+ ]
982
+ },
701
983
  {
702
984
  "kind": "class",
703
985
  "customElement": true,
@@ -1 +1 @@
1
- import{c as r,m as S,s as q,i,a as f,b as d,S as v,d as m,t as b,e as B,f as I}from"./chunks/define-DfTe4zwZ.js";import{c as u}from"./chunks/cn-CU7UAWzk.js";import{I as N}from"./chunks/Icon-11SRdjJ4.js";import{e as j}from"./chunks/ellipsis-B1sOOqiJ.js";var D=[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]],E=l=>r(N,S(l,{name:"Bell",iconNode:D})),H=E,L=b("<span aria-hidden=true>"),P=b("<span>"),W=b('<span class="inline-flex items-center gap-1 rounded-full bg-tool-amber/15 px-2 py-0.5 text-[11px] font-medium text-tool-amber">Needs you'),O=b("<button type=button part=menu aria-label=More>"),R=b('<div><span class="inline-flex shrink-0 items-center gap-1.5"role=status><span class="relative inline-flex"><span aria-hidden=true part=status></span></span></span><button type=button><span class="block truncate text-sm font-medium leading-tight text-foreground"></span></button><span class="flex shrink-0 items-center gap-2">');const M={working:"bg-tool-blue",idle:"bg-muted-foreground",done:"bg-tool-green",error:"bg-tool-red",blocked:"bg-tool-amber"},T={working:"text-tool-blue",idle:"text-muted-foreground",done:"text-tool-green",error:"text-tool-red",blocked:"text-tool-amber"},X={working:"Working",idle:"Idle",done:"Done",error:"Error",blocked:"Blocked"};function _(l){const[t]=q(l,["name","status","needsAttention","active","onActivate","onClick","onMenu","class","leading","subtitle","lastLine"]),o=()=>t.status.tone,z=()=>{var n,a;(n=t.onActivate)==null||n.call(t),(a=t.onClick)==null||a.call(t)};return(()=>{var n=R(),a=n.firstChild,p=a.firstChild,h=p.firstChild,c=a.nextSibling,$=c.firstChild,x=c.nextSibling;return i(p,r(v,{get when(){return t.status.pulse},get children(){var e=L();return f(()=>d(e,u("absolute inline-flex h-full w-full animate-ping rounded-full opacity-75 motion-reduce:hidden",M[o()]))),e}}),h),i(a,r(v,{get when(){return t.status.label},get children(){var e=P();return i(e,()=>t.status.label),f(()=>d(e,u("text-[11px] font-medium leading-none",T[o()]))),e}}),null),c.$$click=z,i($,()=>t.name),i(x,r(v,{get when(){return t.needsAttention},get children(){var e=W(),s=e.firstChild;return i(e,r(H,{class:"size-3","aria-hidden":"true"}),s),e}}),null),i(x,r(v,{get when(){return t.onMenu},get children(){var e=O();return e.$$click=s=>{var g;s.stopPropagation(),(g=t.onMenu)==null||g.call(t,s)},i(e,r(j,{class:"size-4","aria-hidden":"true"})),f(()=>d(e,u("relative z-10 inline-flex size-7 shrink-0 items-center justify-center rounded-md","text-muted-foreground outline-none transition-colors","hover:bg-surface-sunken hover:text-foreground","focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring"))),e}}),null),f(e=>{var s=t.active?"":void 0,g=t.needsAttention?"":void 0,k=u("group relative flex w-full cursor-pointer items-center gap-3 rounded-lg border px-3 py-2.5 text-left","transition-[background-color,border-color,box-shadow]",t.active?"border-primary bg-accent":"border-border bg-surface hover:bg-accent",t.needsAttention&&"border-tool-amber/50 ring-2 ring-inset ring-tool-amber/60",t.class),w=t.status.label??X[o()],y=u("relative inline-block size-2 rounded-full",M[o()]),A=t.active?"true":void 0,C=u("min-w-0 flex-1 text-left outline-none","before:absolute before:inset-0 before:rounded-lg before:content-['']","focus-visible:before:ring-2 focus-visible:before:ring-inset focus-visible:before:ring-ring");return s!==e.e&&m(n,"data-active",e.e=s),g!==e.t&&m(n,"data-needs-attention",e.t=g),k!==e.a&&d(n,e.a=k),w!==e.o&&m(a,"aria-label",e.o=w),y!==e.i&&d(h,e.i=y),A!==e.n&&m(c,"aria-current",e.n=A),C!==e.s&&d(c,e.s=C),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),n})()}B(["click"]),I("kai-agent-card",{name:void 0,active:void 0,needsAttention:void 0,status:void 0},(l,{dispatch:t,flag:o})=>r(_,{get name(){return l.name??""},get active(){return o("active")},get needsAttention(){return o("needsAttention")},get status(){return l.status??{tone:"idle"}},onActivate:()=>t("kai-activate"),onMenu:()=>t("kai-menu")}));
1
+ import{c as r,m as S,s as q,i,a as f,b as d,S as v,d as m,t as b,e as B,f as I}from"./chunks/define-D1din7Ld.js";import{c as u}from"./chunks/cn-CU7UAWzk.js";import{I as N}from"./chunks/Icon-Tj58ES_d.js";import{e as j}from"./chunks/ellipsis-Dw6qrss-.js";var D=[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]],E=l=>r(N,S(l,{name:"Bell",iconNode:D})),H=E,L=b("<span aria-hidden=true>"),P=b("<span>"),W=b('<span class="inline-flex items-center gap-1 rounded-full bg-tool-amber/15 px-2 py-0.5 text-[11px] font-medium text-tool-amber">Needs you'),O=b("<button type=button part=menu aria-label=More>"),R=b('<div><span class="inline-flex shrink-0 items-center gap-1.5"role=status><span class="relative inline-flex"><span aria-hidden=true part=status></span></span></span><button type=button><span class="block truncate text-sm font-medium leading-tight text-foreground"></span></button><span class="flex shrink-0 items-center gap-2">');const M={working:"bg-tool-blue",idle:"bg-muted-foreground",done:"bg-tool-green",error:"bg-tool-red",blocked:"bg-tool-amber"},T={working:"text-tool-blue",idle:"text-muted-foreground",done:"text-tool-green",error:"text-tool-red",blocked:"text-tool-amber"},X={working:"Working",idle:"Idle",done:"Done",error:"Error",blocked:"Blocked"};function _(l){const[t]=q(l,["name","status","needsAttention","active","onActivate","onClick","onMenu","class","leading","subtitle","lastLine"]),o=()=>t.status.tone,z=()=>{var n,a;(n=t.onActivate)==null||n.call(t),(a=t.onClick)==null||a.call(t)};return(()=>{var n=R(),a=n.firstChild,p=a.firstChild,h=p.firstChild,c=a.nextSibling,$=c.firstChild,x=c.nextSibling;return i(p,r(v,{get when(){return t.status.pulse},get children(){var e=L();return f(()=>d(e,u("absolute inline-flex h-full w-full animate-ping rounded-full opacity-75 motion-reduce:hidden",M[o()]))),e}}),h),i(a,r(v,{get when(){return t.status.label},get children(){var e=P();return i(e,()=>t.status.label),f(()=>d(e,u("text-[11px] font-medium leading-none",T[o()]))),e}}),null),c.$$click=z,i($,()=>t.name),i(x,r(v,{get when(){return t.needsAttention},get children(){var e=W(),s=e.firstChild;return i(e,r(H,{class:"size-3","aria-hidden":"true"}),s),e}}),null),i(x,r(v,{get when(){return t.onMenu},get children(){var e=O();return e.$$click=s=>{var g;s.stopPropagation(),(g=t.onMenu)==null||g.call(t,s)},i(e,r(j,{class:"size-4","aria-hidden":"true"})),f(()=>d(e,u("relative z-10 inline-flex size-7 shrink-0 items-center justify-center rounded-md","text-muted-foreground outline-none transition-colors","hover:bg-surface-sunken hover:text-foreground","focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring"))),e}}),null),f(e=>{var s=t.active?"":void 0,g=t.needsAttention?"":void 0,k=u("group relative flex w-full cursor-pointer items-center gap-3 rounded-lg border px-3 py-2.5 text-left","transition-[background-color,border-color,box-shadow]",t.active?"border-primary bg-accent":"border-border bg-surface hover:bg-accent",t.needsAttention&&"border-tool-amber/50 ring-2 ring-inset ring-tool-amber/60",t.class),w=t.status.label??X[o()],y=u("relative inline-block size-2 rounded-full",M[o()]),A=t.active?"true":void 0,C=u("min-w-0 flex-1 text-left outline-none","before:absolute before:inset-0 before:rounded-lg before:content-['']","focus-visible:before:ring-2 focus-visible:before:ring-inset focus-visible:before:ring-ring");return s!==e.e&&m(n,"data-active",e.e=s),g!==e.t&&m(n,"data-needs-attention",e.t=g),k!==e.a&&d(n,e.a=k),w!==e.o&&m(a,"aria-label",e.o=w),y!==e.i&&d(h,e.i=y),A!==e.n&&m(c,"aria-current",e.n=A),C!==e.s&&d(c,e.s=C),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),n})()}B(["click"]),I("kai-agent-card",{name:void 0,active:void 0,needsAttention:void 0,status:void 0},(l,{dispatch:t,flag:o})=>r(_,{get name(){return l.name??""},get active(){return o("active")},get needsAttention(){return o("needsAttention")},get status(){return l.status??{tone:"idle"}},onActivate:()=>t("kai-activate"),onMenu:()=>t("kai-menu")}));