@kitn.ai/ui 0.28.0 → 0.29.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 (376) hide show
  1. package/README.md +1 -1
  2. package/dist/agent-tooling/construct/public.d.ts +15 -0
  3. package/dist/agent-tooling/construct/schema.d.ts +111 -0
  4. package/dist/construct-cli.es.js +3 -3
  5. package/dist/construct.d.ts +5 -0
  6. package/dist/construct.js +327 -0
  7. package/dist/core-C8fzo39E.js +1 -12
  8. package/dist/engine-javascript-C1x7zo1_.js +1 -141
  9. package/dist/mcp.es.js +1 -1
  10. package/package.json +16 -16
  11. package/bin/route.test.js +0 -58
  12. package/src/agent-tooling/README.md +0 -192
  13. package/src/agent-tooling/archetypes.ts +0 -205
  14. package/src/agent-tooling/catalog/README.md +0 -676
  15. package/src/agent-tooling/catalog/catalog-types.ts +0 -231
  16. package/src/agent-tooling/catalog/fabrications.ts +0 -96
  17. package/src/agent-tooling/catalog/invariants.ts +0 -284
  18. package/src/agent-tooling/catalog/labs-titles.ts +0 -114
  19. package/src/agent-tooling/catalog/scenarios.ts +0 -87
  20. package/src/agent-tooling/catalog/surfaces.ts +0 -347
  21. package/src/agent-tooling/construct/cli-entry.ts +0 -8
  22. package/src/agent-tooling/construct/cli.ts +0 -147
  23. package/src/agent-tooling/construct/codegen.ts +0 -1635
  24. package/src/agent-tooling/construct/construct.v1.schema.json +0 -319
  25. package/src/agent-tooling/construct/dev.ts +0 -148
  26. package/src/agent-tooling/construct/fixtures/demo-widget.construct.json +0 -7
  27. package/src/agent-tooling/construct/fixtures/ops-console.construct.json +0 -44
  28. package/src/agent-tooling/construct/fixtures/owner-widget.construct.json +0 -32
  29. package/src/agent-tooling/construct/schema.ts +0 -452
  30. package/src/agent-tooling/integrations/anthropic.ts +0 -442
  31. package/src/agent-tooling/integrations/cloudflare.ts +0 -218
  32. package/src/agent-tooling/integrations/langgraph.ts +0 -133
  33. package/src/agent-tooling/integrations/mastra.ts +0 -182
  34. package/src/agent-tooling/integrations/mock.ts +0 -148
  35. package/src/agent-tooling/integrations/ollama.ts +0 -97
  36. package/src/agent-tooling/integrations/openai.ts +0 -95
  37. package/src/agent-tooling/integrations/openrouter.ts +0 -82
  38. package/src/agent-tooling/integrations/pi.ts +0 -176
  39. package/src/agent-tooling/integrations/pydantic-ai.ts +0 -108
  40. package/src/agent-tooling/integrations/vercel-ai-sdk.ts +0 -398
  41. package/src/agent-tooling/mcp/css-raw.d.ts +0 -12
  42. package/src/agent-tooling/mcp/manifest.ts +0 -422
  43. package/src/agent-tooling/mcp/server.ts +0 -116
  44. package/src/agent-tooling/mcp/stdio.ts +0 -18
  45. package/src/agent-tooling/mcp/tools/construct.ts +0 -130
  46. package/src/agent-tooling/mcp/tools/debug.ts +0 -621
  47. package/src/agent-tooling/mcp/tools/reference.ts +0 -980
  48. package/src/agent-tooling/mcp/tools/scaffold.ts +0 -6708
  49. package/src/agent-tooling/mcp/tools/theme.ts +0 -456
  50. package/src/agent-tooling/mcp/tools/types.ts +0 -14
  51. package/src/agent-tooling/mcp/validate-args.ts +0 -141
  52. package/src/agent-tooling/recipes/composed-thread.ts +0 -714
  53. package/src/agent-tooling/recipes/index.ts +0 -22
  54. package/src/agent-tooling/recipes/types.ts +0 -32
  55. package/src/agent-tooling/registry.ts +0 -132
  56. package/src/agent-tooling/route-emit.ts +0 -305
  57. package/src/agent-tooling/types.ts +0 -390
  58. package/src/components/artifact-card.tsx +0 -120
  59. package/src/components/artifact.tsx +0 -914
  60. package/src/components/attachment-types.ts +0 -66
  61. package/src/components/attachments.tsx +0 -536
  62. package/src/components/audio-visualizer/audio-visualizer.voice-fixture.ts +0 -257
  63. package/src/components/audio-visualizer/aurora.glsl.ts +0 -330
  64. package/src/components/audio-visualizer/fit-scale.ts +0 -112
  65. package/src/components/audio-visualizer/index.tsx +0 -528
  66. package/src/components/audio-visualizer/labs/lab-choreography.ts +0 -187
  67. package/src/components/audio-visualizer/labs/lab-shaders.ts +0 -363
  68. package/src/components/audio-visualizer/labs/lab-visualizer.tsx +0 -102
  69. package/src/components/audio-visualizer/shader-canvas.tsx +0 -876
  70. package/src/components/audio-visualizer/sizes.ts +0 -54
  71. package/src/components/audio-visualizer/variant-aurora.tsx +0 -305
  72. package/src/components/audio-visualizer/variant-bar.tsx +0 -175
  73. package/src/components/audio-visualizer/variant-custom.tsx +0 -344
  74. package/src/components/audio-visualizer/variant-grid.tsx +0 -175
  75. package/src/components/audio-visualizer/variant-radial.tsx +0 -163
  76. package/src/components/audio-visualizer/variant-wave.tsx +0 -130
  77. package/src/components/audio-visualizer/wave.glsl.ts +0 -130
  78. package/src/components/card-fallback.tsx +0 -60
  79. package/src/components/card-renderer.tsx +0 -220
  80. package/src/components/card.tsx +0 -212
  81. package/src/components/chain-of-thought.tsx +0 -348
  82. package/src/components/chat-container.tsx +0 -89
  83. package/src/components/chat-scope-picker.tsx +0 -57
  84. package/src/components/chat-thread.tsx +0 -1014
  85. package/src/components/checkpoint.tsx +0 -88
  86. package/src/components/choice-card.tsx +0 -743
  87. package/src/components/coachmark.tsx +0 -249
  88. package/src/components/code-block.tsx +0 -181
  89. package/src/components/composer-dom.ts +0 -159
  90. package/src/components/composer-highlight.ts +0 -242
  91. package/src/components/composer-history.ts +0 -82
  92. package/src/components/composer.tsx +0 -1075
  93. package/src/components/confirm-card.tsx +0 -402
  94. package/src/components/context.tsx +0 -377
  95. package/src/components/conversation-item.tsx +0 -241
  96. package/src/components/conversation-list.tsx +0 -429
  97. package/src/components/conversation-panel.tsx +0 -118
  98. package/src/components/dismissed-stub.tsx +0 -80
  99. package/src/components/embed.tsx +0 -200
  100. package/src/components/empty.tsx +0 -177
  101. package/src/components/feedback-bar.tsx +0 -166
  102. package/src/components/file-tree.tsx +0 -530
  103. package/src/components/file-upload.tsx +0 -167
  104. package/src/components/form-widgets.tsx +0 -525
  105. package/src/components/form.tsx +0 -1296
  106. package/src/components/home-panel.tsx +0 -159
  107. package/src/components/image.tsx +0 -65
  108. package/src/components/link-preview.tsx +0 -195
  109. package/src/components/loader.tsx +0 -367
  110. package/src/components/markdown.tsx +0 -162
  111. package/src/components/message-skills.tsx +0 -40
  112. package/src/components/message.tsx +0 -765
  113. package/src/components/model-switcher.tsx +0 -132
  114. package/src/components/prompt-input.tsx +0 -188
  115. package/src/components/prompt-suggestion.tsx +0 -150
  116. package/src/components/reasoning.tsx +0 -293
  117. package/src/components/response-compare-types.ts +0 -152
  118. package/src/components/response-compare.tsx +0 -455
  119. package/src/components/response-stream.tsx +0 -109
  120. package/src/components/screen.tsx +0 -181
  121. package/src/components/scroll-button.tsx +0 -93
  122. package/src/components/source.tsx +0 -192
  123. package/src/components/tasks-card.tsx +0 -801
  124. package/src/components/text-shimmer.tsx +0 -37
  125. package/src/components/thinking-bar.tsx +0 -50
  126. package/src/components/thread.tsx +0 -228
  127. package/src/components/toast.tsx +0 -503
  128. package/src/components/tool-classify.ts +0 -26
  129. package/src/components/tool-types.ts +0 -49
  130. package/src/components/tool.tsx +0 -190
  131. package/src/components/use-card-resolution.ts +0 -44
  132. package/src/components/voice-input.tsx +0 -222
  133. package/src/components/voice-output.tsx +0 -242
  134. package/src/components/widget-tab-bar.tsx +0 -73
  135. package/src/components/workspace-shell.tsx +0 -285
  136. package/src/diagnostics/hook.ts +0 -352
  137. package/src/diagnostics/index.ts +0 -82
  138. package/src/diagnostics/report-request.ts +0 -296
  139. package/src/elements/agent-card.tsx +0 -67
  140. package/src/elements/artifact.tsx +0 -194
  141. package/src/elements/attachments.tsx +0 -140
  142. package/src/elements/audio-visualizer.tsx +0 -227
  143. package/src/elements/autoloader.ts +0 -89
  144. package/src/elements/avatar.tsx +0 -33
  145. package/src/elements/badge.tsx +0 -32
  146. package/src/elements/button.tsx +0 -149
  147. package/src/elements/card.tsx +0 -133
  148. package/src/elements/cards.tsx +0 -266
  149. package/src/elements/chain-of-thought.tsx +0 -141
  150. package/src/elements/chat-scope-picker.tsx +0 -65
  151. package/src/elements/chat-types.ts +0 -102
  152. package/src/elements/chat-workspace.tsx +0 -188
  153. package/src/elements/chat.tsx +0 -304
  154. package/src/elements/checkbox-group.tsx +0 -164
  155. package/src/elements/checkbox.tsx +0 -134
  156. package/src/elements/checkpoint.tsx +0 -47
  157. package/src/elements/choice.tsx +0 -100
  158. package/src/elements/coachmark.tsx +0 -90
  159. package/src/elements/code-block.tsx +0 -60
  160. package/src/elements/command.tsx +0 -197
  161. package/src/elements/compare.tsx +0 -111
  162. package/src/elements/compiled.css +0 -2
  163. package/src/elements/composer.tsx +0 -162
  164. package/src/elements/confirm-card.tsx +0 -76
  165. package/src/elements/context-meter.tsx +0 -107
  166. package/src/elements/conversation-item.tsx +0 -120
  167. package/src/elements/conversation-list.tsx +0 -203
  168. package/src/elements/css.ts +0 -5
  169. package/src/elements/default-input.tsx +0 -392
  170. package/src/elements/define-entry.ts +0 -12
  171. package/src/elements/define.tsx +0 -563
  172. package/src/elements/diagnostic-events.ts +0 -114
  173. package/src/elements/dialog.tsx +0 -145
  174. package/src/elements/disclosure.ts +0 -95
  175. package/src/elements/dock.tsx +0 -215
  176. package/src/elements/dropdown.tsx +0 -123
  177. package/src/elements/editable-label.tsx +0 -140
  178. package/src/elements/element-data-types.ts +0 -152
  179. package/src/elements/element-diagnostics.ts +0 -392
  180. package/src/elements/element-manifest.json +0 -354
  181. package/src/elements/element-nonscalar.json +0 -187
  182. package/src/elements/element-types.d.ts +0 -4353
  183. package/src/elements/embed.tsx +0 -35
  184. package/src/elements/empty.tsx +0 -29
  185. package/src/elements/feedback-bar.tsx +0 -66
  186. package/src/elements/file-tree.tsx +0 -62
  187. package/src/elements/file-upload.tsx +0 -44
  188. package/src/elements/form.tsx +0 -94
  189. package/src/elements/hover-card.tsx +0 -80
  190. package/src/elements/icon.tsx +0 -41
  191. package/src/elements/image.tsx +0 -32
  192. package/src/elements/input.tsx +0 -492
  193. package/src/elements/kbd.tsx +0 -45
  194. package/src/elements/link-preview.tsx +0 -34
  195. package/src/elements/loader.tsx +0 -25
  196. package/src/elements/markdown.tsx +0 -38
  197. package/src/elements/menu.tsx +0 -241
  198. package/src/elements/message-skills.tsx +0 -83
  199. package/src/elements/message.tsx +0 -361
  200. package/src/elements/model-switcher.tsx +0 -121
  201. package/src/elements/nav.tsx +0 -87
  202. package/src/elements/notice.tsx +0 -53
  203. package/src/elements/pane-grid.tsx +0 -111
  204. package/src/elements/pane-group.tsx +0 -119
  205. package/src/elements/pane.tsx +0 -129
  206. package/src/elements/popover.tsx +0 -81
  207. package/src/elements/progress-bar.tsx +0 -39
  208. package/src/elements/prompt-dock.tsx +0 -82
  209. package/src/elements/prompt-input.tsx +0 -240
  210. package/src/elements/prompt-suggestions.tsx +0 -113
  211. package/src/elements/radio-group.tsx +0 -129
  212. package/src/elements/reasoning.tsx +0 -71
  213. package/src/elements/register-impl.ts +0 -148
  214. package/src/elements/register.ts +0 -76
  215. package/src/elements/remote.tsx +0 -225
  216. package/src/elements/resizable.globals.d.ts +0 -36
  217. package/src/elements/resizable.tsx +0 -704
  218. package/src/elements/response-stream.tsx +0 -40
  219. package/src/elements/screen.tsx +0 -90
  220. package/src/elements/scroll-area.tsx +0 -33
  221. package/src/elements/scroll-button.tsx +0 -179
  222. package/src/elements/search.tsx +0 -185
  223. package/src/elements/segmented.tsx +0 -129
  224. package/src/elements/select.tsx +0 -165
  225. package/src/elements/separator.tsx +0 -36
  226. package/src/elements/setting-item.tsx +0 -50
  227. package/src/elements/settings-group.tsx +0 -37
  228. package/src/elements/skeleton.tsx +0 -45
  229. package/src/elements/slider.tsx +0 -171
  230. package/src/elements/slot-text.ts +0 -73
  231. package/src/elements/slots.ts +0 -787
  232. package/src/elements/source.tsx +0 -126
  233. package/src/elements/status.tsx +0 -42
  234. package/src/elements/styles.css +0 -328
  235. package/src/elements/switch.tsx +0 -118
  236. package/src/elements/tabs.tsx +0 -95
  237. package/src/elements/tasks.tsx +0 -103
  238. package/src/elements/text-shimmer.tsx +0 -28
  239. package/src/elements/thinking-bar.tsx +0 -43
  240. package/src/elements/thread.tsx +0 -139
  241. package/src/elements/toast.tsx +0 -106
  242. package/src/elements/tool.tsx +0 -78
  243. package/src/elements/tooltip.tsx +0 -85
  244. package/src/elements/validate-messages.ts +0 -76
  245. package/src/elements/voice-input.tsx +0 -100
  246. package/src/elements/voice-output.tsx +0 -82
  247. package/src/index.ts +0 -430
  248. package/src/primitives/audio-bands.ts +0 -174
  249. package/src/primitives/card-component-types.ts +0 -63
  250. package/src/primitives/card-contract.ts +0 -80
  251. package/src/primitives/card-data-types.ts +0 -361
  252. package/src/primitives/card-host.tsx +0 -37
  253. package/src/primitives/card-recovery.ts +0 -160
  254. package/src/primitives/card-registry.tsx +0 -78
  255. package/src/primitives/card-resolution.ts +0 -36
  256. package/src/primitives/card-routing.ts +0 -85
  257. package/src/primitives/card-schemas/artifact.schema.json +0 -92
  258. package/src/primitives/card-schemas/card-envelope.schema.json +0 -14
  259. package/src/primitives/card-schemas/card-event.schema.json +0 -12
  260. package/src/primitives/card-schemas/choice.schema.json +0 -75
  261. package/src/primitives/card-schemas/confirm.schema.json +0 -65
  262. package/src/primitives/card-schemas/embed.schema.json +0 -63
  263. package/src/primitives/card-schemas/form.result.schema.json +0 -7
  264. package/src/primitives/card-schemas/form.schema.json +0 -53
  265. package/src/primitives/card-schemas/link.schema.json +0 -54
  266. package/src/primitives/card-schemas/tasks.result.schema.json +0 -16
  267. package/src/primitives/card-schemas/tasks.schema.json +0 -83
  268. package/src/primitives/card-tags.ts +0 -61
  269. package/src/primitives/card-validate-cards.ts +0 -255
  270. package/src/primitives/card-validate-schemas.ts +0 -58
  271. package/src/primitives/card-validate.ts +0 -131
  272. package/src/primitives/chat-config.tsx +0 -103
  273. package/src/primitives/composer-model.ts +0 -49
  274. package/src/primitives/composer-triggers.ts +0 -35
  275. package/src/primitives/controllable.ts +0 -21
  276. package/src/primitives/conversation-store.ts +0 -248
  277. package/src/primitives/create-kai-chat.ts +0 -66
  278. package/src/primitives/create-tween.ts +0 -266
  279. package/src/primitives/embed-providers.ts +0 -254
  280. package/src/primitives/field-mask.ts +0 -256
  281. package/src/primitives/field-semantics.ts +0 -115
  282. package/src/primitives/highlighter.ts +0 -157
  283. package/src/primitives/input-mask.ts +0 -853
  284. package/src/primitives/link-preview.ts +0 -87
  285. package/src/primitives/message-feedback.ts +0 -124
  286. package/src/primitives/pdf-preview.ts +0 -121
  287. package/src/primitives/toast-store.ts +0 -338
  288. package/src/primitives/url-scheme-policy.ts +0 -70
  289. package/src/primitives/use-audio-analysis.ts +0 -340
  290. package/src/primitives/use-auto-resize.ts +0 -31
  291. package/src/primitives/use-resize-observer.ts +0 -45
  292. package/src/primitives/use-sequencer.ts +0 -72
  293. package/src/primitives/use-speech-recognition.ts +0 -146
  294. package/src/primitives/use-stick-to-bottom.ts +0 -75
  295. package/src/primitives/use-text-stream.ts +0 -143
  296. package/src/primitives/use-voice-recorder.ts +0 -62
  297. package/src/primitives/visualizer-sequences.ts +0 -350
  298. package/src/remote/host-embed.ts +0 -345
  299. package/src/remote/index.ts +0 -2
  300. package/src/remote/origin.ts +0 -30
  301. package/src/remote/provider-runtime.ts +0 -262
  302. package/src/remote/provider.ts +0 -2
  303. package/src/remote/validate.ts +0 -22
  304. package/src/remote/version.ts +0 -12
  305. package/src/remote/wire.ts +0 -48
  306. package/src/schemas/from-tool-call.ts +0 -151
  307. package/src/schemas/index.ts +0 -341
  308. package/src/schemas/provider-subsets.ts +0 -538
  309. package/src/schemas/registry.ts +0 -355
  310. package/src/schemas/tool-defs.ts +0 -793
  311. package/src/solid.ts +0 -173
  312. package/src/state/index.ts +0 -44
  313. package/src/state/messages.ts +0 -53
  314. package/src/state/mock.ts +0 -297
  315. package/src/state/parts.ts +0 -295
  316. package/src/state/persistence.ts +0 -180
  317. package/src/state/stream.ts +0 -246
  318. package/src/state/suggestions.ts +0 -9
  319. package/src/state/threads.ts +0 -142
  320. package/src/test-utils/fake-clock.ts +0 -88
  321. package/src/types.ts +0 -95
  322. package/src/ui/action-icons.ts +0 -53
  323. package/src/ui/agent-card.tsx +0 -218
  324. package/src/ui/avatar.tsx +0 -23
  325. package/src/ui/badge.tsx +0 -21
  326. package/src/ui/button.tsx +0 -49
  327. package/src/ui/card.tsx +0 -245
  328. package/src/ui/checkbox-group.tsx +0 -153
  329. package/src/ui/checkbox.tsx +0 -63
  330. package/src/ui/collapsible.tsx +0 -163
  331. package/src/ui/command.tsx +0 -103
  332. package/src/ui/dialog.tsx +0 -223
  333. package/src/ui/dock.tsx +0 -630
  334. package/src/ui/dropdown.tsx +0 -636
  335. package/src/ui/editable-label.tsx +0 -112
  336. package/src/ui/hover-card.tsx +0 -345
  337. package/src/ui/icon.tsx +0 -167
  338. package/src/ui/input.tsx +0 -391
  339. package/src/ui/kbd.tsx +0 -118
  340. package/src/ui/nav.tsx +0 -282
  341. package/src/ui/notice.tsx +0 -84
  342. package/src/ui/overlay.tsx +0 -277
  343. package/src/ui/pane-grid.tsx +0 -117
  344. package/src/ui/pane-group.tsx +0 -291
  345. package/src/ui/pane.tsx +0 -193
  346. package/src/ui/popover.tsx +0 -106
  347. package/src/ui/progress-bar.tsx +0 -83
  348. package/src/ui/prompt-dock.tsx +0 -145
  349. package/src/ui/radio.tsx +0 -150
  350. package/src/ui/resizable.tsx +0 -693
  351. package/src/ui/scroll-area.tsx +0 -26
  352. package/src/ui/segmented.tsx +0 -109
  353. package/src/ui/select.tsx +0 -168
  354. package/src/ui/separator.tsx +0 -10
  355. package/src/ui/settings-group.tsx +0 -67
  356. package/src/ui/skeleton.tsx +0 -73
  357. package/src/ui/slider.tsx +0 -178
  358. package/src/ui/status.tsx +0 -48
  359. package/src/ui/switch.tsx +0 -119
  360. package/src/ui/tabs.tsx +0 -168
  361. package/src/ui/textarea.tsx +0 -21
  362. package/src/ui/tooltip.tsx +0 -118
  363. package/src/utils/cn.ts +0 -30
  364. package/src/wire/chunk.ts +0 -248
  365. package/src/wire/consume.ts +0 -599
  366. package/src/wire/diagnostics.ts +0 -727
  367. package/src/wire/encode-probe.ts +0 -214
  368. package/src/wire/encode.ts +0 -947
  369. package/src/wire/files.ts +0 -342
  370. package/src/wire/formats/anthropic.ts +0 -274
  371. package/src/wire/formats/openai.ts +0 -228
  372. package/src/wire/index.ts +0 -95
  373. package/src/wire/media-types.ts +0 -344
  374. package/src/wire/read.ts +0 -396
  375. package/src/wire/sink-helpers.ts +0 -50
  376. package/src/wire/sse.ts +0 -153
@@ -1,148 +0,0 @@
1
- // Component registration implementation. Importing this file defines all kitn
2
- // custom elements as a side effect. It is dynamically imported (browser-only)
3
- // from ./register.ts so the elements entry is SSR-import-safe — see the comment
4
- // there. This file is hand-maintained (the generator gen-element-api.mjs SKIPs
5
- // register.ts AND this file); keep the component import list here in sync.
6
- import { installKaiDevtoolsHook } from '../diagnostics/hook';
7
- import { emitElementRegistry } from './element-diagnostics';
8
- import './conversation-list';
9
- import './conversation-item';
10
- import './prompt-input';
11
- import './chat';
12
- import './chat-workspace';
13
- // Message-list composable (the scrolling thread slice, sans composer/header)
14
- import './thread';
15
- // Composable leaf elements (spike — see docs/handoff + examples/composable)
16
- import './thinking-bar';
17
- import './model-switcher';
18
- import './attachments';
19
- // Phase 1 — message-rendering core
20
- import './message';
21
- import './markdown';
22
- import './code-block';
23
- import './reasoning';
24
- import './tool';
25
- // Phase 2 — header / meta
26
- import './context-meter';
27
- import './feedback-bar';
28
- import './chat-scope-picker';
29
- // Phase 3 — input ecosystem
30
- import './prompt-suggestions';
31
- import './file-upload';
32
- import './voice-input';
33
- import './audio-visualizer';
34
- // Phase 4 — indicators & leaves
35
- import './loader';
36
- import './text-shimmer';
37
- import './image';
38
- import './checkpoint';
39
- import './message-skills';
40
- import './source';
41
- import './response-stream';
42
- import './empty';
43
- import './status';
44
- import './nav';
45
- import './progress-bar';
46
- import './coachmark';
47
- import './tabs';
48
- import './voice-output';
49
- import './screen';
50
- import './chain-of-thought';
51
- import './resizable';
52
- import './file-tree';
53
- import './artifact';
54
- import './scroll-button';
55
- import './popover';
56
- import './switch';
57
- import './checkbox';
58
- import './checkbox-group';
59
- import './radio-group';
60
- import './slider';
61
- import './select';
62
- import './button';
63
- import './avatar';
64
- import './badge';
65
- import './tooltip';
66
- import './notice';
67
- import './icon';
68
- import './separator';
69
- import './scroll-area';
70
- import './hover-card';
71
- import './skeleton';
72
- import './toast';
73
- // Generative-UI cards (Card Contract)
74
- import './card';
75
- import './form';
76
- import './link-preview';
77
- import './embed';
78
- import './confirm-card';
79
- import './tasks';
80
- import './choice';
81
- import './cards';
82
- // Dual-response comparison (preference capture)
83
- import './compare';
84
- // Rich text composer with entity pills, trigger menus, and keyword highlighting
85
- import './composer';
86
- // W3 phase 2: cascading action menu from a JSON items-tree
87
- import './menu';
88
- // The same Dropdown surface with a consumer-owned body: you slot the rows
89
- // instead of handing over an items tree (the shape a framework consumer needs
90
- // when the rows are their own components).
91
- import './dropdown';
92
- // W4 phase 1: grouped filterable command/mention palette
93
- import './command';
94
- // Prompt dock + settings building blocks (graduated from SolidJS prototypes)
95
- import './prompt-dock';
96
- import './segmented';
97
- import './settings-group';
98
- import './setting-item';
99
- // Multi-agent workspace primitives (graduated from SolidJS prototypes)
100
- import './pane';
101
- import './pane-group';
102
- import './pane-grid';
103
- import './agent-card';
104
- import './dialog';
105
- import './dock';
106
- // Input & search field family
107
- import './input';
108
- import './search';
109
- import './kbd';
110
- import './editable-label';
111
-
112
- // The devtools recorder hook, installed HERE because this file is already the
113
- // browser-only half of the elements entry (register.ts gates it behind a window
114
- // check and a dynamic import). So an app that registers the kai-* elements gets
115
- // the hook with no work, while an SSR import of the entry still touches no
116
- // global.
117
- //
118
- // At the BOTTOM, and it makes no difference: `import` declarations are hoisted,
119
- // so every element module above has already evaluated by the time any statement
120
- // in this file runs. Written here anyway so the order you read is the order that
121
- // happens. Nothing above emits a diagnostic event, so there is nothing to miss.
122
- //
123
- // Idempotent and near-free: with no activation signal it allocates no buffer,
124
- // makes no subscription, and leaves emission a guarded no-op. An app importing
125
- // the SolidJS components directly never runs this file and must call
126
- // `installKaiDevtoolsHook()` itself -- see the docblock in ../diagnostics/index.
127
- installKaiDevtoolsHook();
128
-
129
- // One registry snapshot, right after the hook installs and therefore after every
130
- // element above has registered (import declarations are hoisted, so they all ran
131
- // before this line).
132
- //
133
- // WHY HERE AND NOT INSIDE THE HOOK. The hook lives in ../diagnostics, which is
134
- // its own rollup bundle and must stay free of any element import -- pulling the
135
- // manifest in there would drag element bytes into a consumer who only parses
136
- // streams. The dependency goes elements -> diagnostics, never back.
137
- //
138
- // WHY EMIT AT ALL WHEN A PANEL IS USUALLY NOT THERE YET. On the recording branch
139
- // the hook has already subscribed by this point, so this snapshot lands in the
140
- // history buffer and a panel attaching seconds later still sees the state at
141
- // load -- which is the state that answers the hydration question. On the dormant
142
- // branch `emitElementRegistry()` short-circuits on the active check and costs a
143
- // symbol read.
144
- //
145
- // A panel attaching mid-session with no history gets no snapshot from here and
146
- // should ask for a fresh one: `emitElementRegistry()` is exported from
147
- // @kitn.ai/ui/elements for exactly that.
148
- emitElementRegistry();
@@ -1,76 +0,0 @@
1
- // Single entry that registers all kitn custom elements. Importing this file
2
- // (or the built bundle) defines the elements as a side effect — but ONLY in a
3
- // browser/DOM context.
4
- //
5
- // SSR-safe: the kai-* elements bundle Solid's client runtime, which touches
6
- // `window` at module-eval (delegateEvents(events, doc = window.document)). With
7
- // no `window`, a static import would throw. So the actual component registration
8
- // lives in ./register-impl and is loaded behind a browser check + dynamic
9
- // import() — static ESM imports hoist + evaluate unconditionally, so a bare `if`
10
- // cannot gate them; a dynamic import() can. On the server this module is inert
11
- // (no DOM → no registration → no throw); in the browser it registers as before.
12
- //
13
- // Registration is async (a microtask after this module loads). Consumers that
14
- // need the upgraded element (e.g. the React runtime) guard with
15
- // customElements.whenDefined(), which resolves once the impl chunk has run.
16
- /** Resolves once the kai-* elements are registered (browser); inert on the server.
17
- * Await this instead of customElements.whenDefined for a single ready signal.
18
- *
19
- * NOTE: this MUST stay an exported binding. A bare `void import('./register-impl')`
20
- * is a result-unused dynamic import that the single-entry register-all build
21
- * (vite.config.ts → dist/kai.es.js) tree-shakes away as dead code, leaving the
22
- * bundle with NOTHING registered. Exporting the promise keeps the import live. */
23
- export const elementsReady: Promise<unknown> =
24
- typeof window !== 'undefined' && typeof customElements !== 'undefined'
25
- ? import('./register-impl')
26
- : Promise.resolve();
27
-
28
- export type { ChatMessage, ChatMessageAction } from './chat-types';
29
- export { configureCodeHighlighting, isCodeHighlightingEnabled } from '../primitives/highlighter';
30
- export type { CodeHighlightingOptions } from '../primitives/highlighter';
31
-
32
- // ToolPart.kind's doc comment in the shipped dist/elements.d.ts says "Derive with
33
- // `classifyTool(type)`", but the function was exported from NO public entry, so a
34
- // consumer following our own docs hit an unresolvable import. Total, deterministic
35
- // and always terminating in 'generic' — safe to expose, and needed by anyone
36
- // rendering tool calls themselves. tool-classify.ts imports nothing, so this stays
37
- // SSR-safe and adds no weight to the register-all bundle.
38
- export { classifyTool } from '../components/tool-classify';
39
- export type { ToolKind } from '../components/tool-classify';
40
-
41
- // Element-layer diagnostics. `emitElementRegistry()` re-emits the which-elements-
42
- // are-defined snapshot on demand, for a panel that attached mid-session and so
43
- // missed the one register-impl emits at load. SSR-safe and a no-op with no
44
- // subscriber, so calling it unconditionally is fine.
45
- //
46
- // WHY THIS ONE PRODUCER IS PUBLIC while `@kitn.ai/ui/diagnostics` deliberately
47
- // keeps `emitWireDiagnostic`, `nextStreamId` and `setWirePayloadCapture`
48
- // internal. That rule exists because a consumer able to forge events or reset
49
- // the stream counter can make a panel lie about a stream that never happened,
50
- // and one able to flip payload capture can start recording an app's users'
51
- // conversations without the app deciding to. This function takes no arguments
52
- // and reports nothing but `customElements.get()` over the manifest: there is no
53
- // value to forge, no counter to move and no capture to arm. It can only tell the
54
- // truth about the registry, which is the one thing a late-attaching panel cannot
55
- // find out for itself.
56
- //
57
- // The event TYPES are re-exported here as well as from @kitn.ai/ui/diagnostics:
58
- // a consumer already importing the elements entry should not have to add a
59
- // second specifier to name the events it is handed.
60
- export { emitElementRegistry } from './element-diagnostics';
61
- export type {
62
- ElementDiagnosticBase,
63
- ElementDiagnosticEvent,
64
- ElementRegistryEvent,
65
- ElementViolationEvent,
66
- ElementViolationKind,
67
- } from './diagnostic-events';
68
-
69
- // Imperative toast API — usable directly from the elements entry so consumers
70
- // who only import the web-components bundle still get `toast()`. The store is
71
- // SSR-safe (no DOM touched until the first toast is raised on the client).
72
- export { toast, configureToasts } from '../primitives/toast-store';
73
- export type {
74
- ToastConfig,
75
- ToastItem, ToastVariant, ToastAction, ToastOptions, ToastHandle,
76
- } from '../primitives/toast-store';
@@ -1,225 +0,0 @@
1
- // src/elements/remote.tsx
2
- // <kai-remote> — Shadow-DOM facade that mounts a sandboxed cross-origin iframe
3
- // card via mountRemoteCard(), re-emits every CardEvent as a bubbling+composed
4
- // kai-card CustomEvent, and validates the provider-origin before mounting.
5
- import { createEffect, createSignal, onCleanup, onMount } from 'solid-js';
6
- import { defineWebComponent } from './define';
7
- import { mountRemoteCard } from '../remote/host-embed';
8
- import type { RemoteCardHandle } from '../remote/host-embed';
9
- import type { CardEnvelope, CardContext, CardPolicy, CardEvent } from '../primitives/card-contract';
10
- import { emitCardEvent } from '../primitives/card-routing';
11
-
12
- interface Props extends Record<string, unknown> {
13
- /** The remote card URL. Attribute: `src`. */
14
- src?: string;
15
- /** Exact provider origin (https: or http://localhost for dev). Attribute: `provider-origin`. */
16
- providerOrigin?: string;
17
- /** The card envelope to render. JS property only. */
18
- envelope?: Record<string, unknown>;
19
- /** Optional routing policy. JS property only. */
20
- policy?: Record<string, unknown>;
21
- }
22
-
23
- /**
24
- * Validate that `origin` is a single absolute origin that is either:
25
- * - an https: origin (e.g. "https://provider.example")
26
- * - http://localhost or http://127.0.0.1 (local dev only)
27
- *
28
- * Rejects "*", comma-lists, bare paths, and any other http: origin.
29
- */
30
- function isValidProviderOrigin(origin: string | undefined): boolean {
31
- if (!origin) return false;
32
- // Reject wildcard and comma-lists immediately.
33
- if (origin === '*' || origin.includes(',')) return false;
34
- let parsed: URL;
35
- try {
36
- parsed = new URL(origin);
37
- } catch {
38
- return false;
39
- }
40
- // Must be an exact origin: no pathname beyond '/', no search, no hash.
41
- if (parsed.pathname !== '/' || parsed.search !== '' || parsed.hash !== '') return false;
42
- if (parsed.protocol === 'https:') return true;
43
- if (parsed.protocol === 'http:') {
44
- return parsed.hostname === 'localhost' || parsed.hostname === '127.0.0.1';
45
- }
46
- return false;
47
- }
48
-
49
- /**
50
- * Build a CardPolicy that re-emits each routed CardEvent as a bubbling+composed
51
- * `kai-card` CustomEvent on `element`, AND delegates to the caller-supplied `policy`.
52
- */
53
- function buildWrappedPolicy(element: HTMLElement, userPolicy: CardPolicy | undefined): CardPolicy {
54
- function emit(ev: CardEvent): void {
55
- emitCardEvent(element, ev);
56
- }
57
- return {
58
- onSubmit(cardId, data) {
59
- emit({ kind: 'submit', cardId, data });
60
- userPolicy?.onSubmit?.(cardId, data);
61
- },
62
- onAction(cardId, action, payload) {
63
- emit({ kind: 'action', cardId, action, payload });
64
- userPolicy?.onAction?.(cardId, action, payload);
65
- },
66
- onSendPrompt(text, opts) {
67
- // send-prompt doesn't carry cardId in the policy signature; we use a placeholder.
68
- emit({ kind: 'send-prompt', cardId: '', text, mode: opts.mode, context: opts.context });
69
- userPolicy?.onSendPrompt?.(text, opts);
70
- },
71
- onOpen(url, target) {
72
- // open doesn't carry cardId in the policy signature.
73
- emit({ kind: 'open', cardId: '', url, target });
74
- userPolicy?.onOpen?.(url, target);
75
- },
76
- onState(cardId, patch) {
77
- emit({ kind: 'state', cardId, patch });
78
- userPolicy?.onState?.(cardId, patch);
79
- },
80
- onDismiss(cardId) {
81
- emit({ kind: 'dismiss', cardId });
82
- userPolicy?.onDismiss?.(cardId);
83
- },
84
- onReopen(cardId) {
85
- emit({ kind: 'reopen', cardId });
86
- userPolicy?.onReopen?.(cardId);
87
- },
88
- onError(cardId, message) {
89
- emit({ kind: 'error', cardId, message });
90
- userPolicy?.onError?.(cardId, message);
91
- },
92
- maxSendPromptMode: userPolicy?.maxSendPromptMode,
93
- };
94
- }
95
-
96
- /**
97
- * `<kai-remote>` — mounts a sandboxed cross-origin iframe card.
98
- *
99
- * Required props:
100
- * - `provider-origin` attribute: the exact HTTPS origin of the card provider
101
- * (or http://localhost for local dev).
102
- * - `src` attribute: the URL of the card page (must share the provider origin).
103
- * - `envelope` JS property: the CardEnvelope to render.
104
- *
105
- * Optional:
106
- * - `policy` JS property: a CardPolicy for routing card events.
107
- * - `theme` attribute (inherited from defineWebComponent): 'light' | 'dark' | 'auto'.
108
- *
109
- * Every routed CardEvent is also dispatched as a bubbling+composed `kai-card`
110
- * CustomEvent off the host element.
111
- */
112
- defineWebComponent<Props>(
113
- 'kai-remote',
114
- {
115
- src: undefined,
116
- providerOrigin: undefined,
117
- envelope: undefined,
118
- policy: undefined,
119
- },
120
- (props, { element }) => {
121
- // Lifted out of onMount so the theme effect (below) can re-push context to the
122
- // live bridge after mount. `undefined` until the iframe is successfully mounted.
123
- let handle: RemoteCardHandle | undefined;
124
-
125
- // Resolve dark mode the SAME way native elements do (see createDarkMode in
126
- // define.tsx): the `theme` prop is 'light' | 'dark' | 'auto' (default 'auto',
127
- // which follows the OS `prefers-color-scheme`). Tracked reactively so a host /
128
- // Storybook theme toggle flows through the effect below.
129
- const [systemDark, setSystemDark] = createSignal(false);
130
- if (typeof window !== 'undefined' && typeof window.matchMedia === 'function') {
131
- const mq = window.matchMedia('(prefers-color-scheme: dark)');
132
- setSystemDark(mq.matches);
133
- const onChange = (e: MediaQueryListEvent) => setSystemDark(e.matches);
134
- mq.addEventListener('change', onChange);
135
- onCleanup(() => mq.removeEventListener('change', onChange));
136
- }
137
- const isDark = () => {
138
- const theme = (props.theme as string | undefined) ?? 'auto';
139
- return theme === 'dark' || (theme === 'auto' && systemDark());
140
- };
141
-
142
- onMount(() => {
143
- const shadow = element.shadowRoot;
144
- if (!shadow) return;
145
-
146
- function renderError(message: string): void {
147
- const alert = document.createElement('div');
148
- alert.setAttribute('role', 'alert');
149
- alert.textContent = message;
150
- shadow!.appendChild(alert);
151
- }
152
-
153
- // Validate provider-origin before attempting any mount.
154
- const providerOrigin = props.providerOrigin;
155
- if (!isValidProviderOrigin(providerOrigin)) {
156
- renderError(
157
- `[kai-remote] Invalid provider-origin "${providerOrigin ?? ''}". ` +
158
- `Must be an absolute https: origin, or http://localhost / http://127.0.0.1 for local dev.`,
159
- );
160
- return;
161
- }
162
-
163
- const src = props.src;
164
- if (!src) {
165
- renderError('[kai-remote] Missing required "src" attribute.');
166
- return;
167
- }
168
-
169
- const envelope = props.envelope as CardEnvelope | undefined;
170
- if (!envelope) {
171
- renderError('[kai-remote] Missing required "envelope" property.');
172
- return;
173
- }
174
-
175
- // Derive a minimal CardContext. Theme resolved the same way native elements
176
- // do (isDark(), above); read untracked here so this initial mount doesn't
177
- // re-run on theme change — the createEffect below pushes later changes.
178
- const context: CardContext = {
179
- theme: { mode: isDark() ? 'dark' : 'light' },
180
- locale: (typeof navigator !== 'undefined' && navigator.language) || 'en',
181
- };
182
-
183
- const userPolicy = props.policy as CardPolicy | undefined;
184
- const wrappedPolicy = buildWrappedPolicy(element, userPolicy);
185
-
186
- // Create a container inside the shadow root for mountRemoteCard.
187
- const container = document.createElement('div');
188
- shadow.appendChild(container);
189
-
190
- try {
191
- handle = mountRemoteCard({
192
- container,
193
- providerOrigin: providerOrigin as string,
194
- src,
195
- envelope,
196
- context,
197
- policy: wrappedPolicy,
198
- });
199
- } catch (err) {
200
- const message = err instanceof Error ? err.message : String(err);
201
- renderError(`[kai-remote] Mount failed: ${message}`);
202
- container.remove();
203
- return;
204
- }
205
-
206
- onCleanup(() => {
207
- handle?.destroy();
208
- handle = undefined;
209
- });
210
- });
211
-
212
- // React to later host/Storybook theme toggles: re-push a fresh resolved theme
213
- // to the live bridge so the framed card re-themes (consistent with native
214
- // elements). No-op until the iframe has mounted (handle is set). The bridge
215
- // does a dispose+remount on a genuine theme change — see provider-runtime.ts;
216
- // token/locale refreshes stay silent.
217
- createEffect(() => {
218
- const mode = isDark() ? 'dark' : 'light';
219
- handle?.updateContext({ theme: { mode } });
220
- });
221
-
222
- // This element renders purely into the shadow root via onMount — no JSX return needed.
223
- return <></>;
224
- },
225
- );
@@ -1,36 +0,0 @@
1
- // src/elements/resizable.globals.d.ts
2
- // Hand-authored ambient types for the cross-element maximize PROTOCOL — the two
3
- // raw composed CustomEvents `<kai-artifact>` and `<kai-resizable>`/`<kai-resizable-item>`
4
- // exchange. The generated element-types.d.ts emits no HTMLElementEventMap entries,
5
- // so without this `el.addEventListener('kai-maximize-intent', e => e.detail)` is
6
- // TS2339 on `Event`. NOT regenerated by `npm run build`.
7
- //
8
- // THE FILENAME IS LOAD-BEARING and must not go back to `resizable.d.ts`.
9
- // TypeScript drops a .d.ts when a same-named .ts/.tsx sits beside it, and
10
- // `resizable.tsx` does. Under the old name this whole file was in NO tsc
11
- // program, so every augmentation below was inert. Measured on the same probe,
12
- // `el.addEventListener('kai-maximize-intent', e => e.detail)`:
13
- // resizable.d.ts TS2339: Property 'detail' does not exist on 'Event'
14
- // resizable.globals.d.ts clean -- narrowed to CustomEvent<KaiMaximizeIntentDetail>
15
- //
16
- // This file used to ALSO declare a global `KaiResizableElement` carrying
17
- // `maximize`/`restore` plus an HTMLElementTagNameMap entry pointing at it. That
18
- // half never worked: element-types.d.ts declares its own module-scoped
19
- // `KaiResizableElement` and maps the tag to THAT, so the two entries collided
20
- // (TS2717, invisible under the `skipLibCheck: true` every pass sets) and the
21
- // generated one won — `document.querySelector('kai-resizable').maximize(0)` stayed
22
- // TS2339. The methods now come from the GENERATOR (resizable.tsx routes them
23
- // through `ctx.expose`, gen-element-types.mjs emits them onto the element
24
- // interface), so the duplicate is gone and there is exactly one declaration of
25
- // each name. Do not reintroduce it: a hand-written interface cannot win against
26
- // the generated one, and generated files are regenerated.
27
- import type { KaiMaximizeIntentDetail, KaiMaximizeStateDetail } from './resizable';
28
-
29
- declare global {
30
- interface HTMLElementEventMap {
31
- 'kai-maximize-intent': CustomEvent<KaiMaximizeIntentDetail>;
32
- 'kai-maximize-state': CustomEvent<KaiMaximizeStateDetail>;
33
- }
34
- }
35
-
36
- export {};