@asanchez-sa/abby 0.0.0-stage → 0.1.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 (391) hide show
  1. package/README.md +217 -2
  2. package/dist/_virtual/_rolldown/runtime.js +26 -0
  3. package/dist/agents/approvals.d.ts +46 -0
  4. package/dist/agents/approvals.js +58 -0
  5. package/dist/agents/changes.d.ts +21 -0
  6. package/dist/agents/changes.js +21 -0
  7. package/dist/agents/hooks.d.ts +20 -0
  8. package/dist/agents/hooks.js +58 -0
  9. package/dist/agents/index.d.ts +11 -0
  10. package/dist/agents/index.js +9 -0
  11. package/dist/agents/run-tool.d.ts +44 -0
  12. package/dist/agents/run-tool.js +79 -0
  13. package/dist/agents/ui-sdk.d.ts +5 -0
  14. package/dist/agents/ui-sdk.js +3 -0
  15. package/dist/behaviors/canvas/index.d.ts +2 -0
  16. package/dist/behaviors/canvas/index.js +1 -0
  17. package/dist/behaviors/canvas/ui-sdk.d.ts +2 -0
  18. package/dist/behaviors/canvas/ui-sdk.js +1 -0
  19. package/dist/behaviors/drag-and-drop/index.d.ts +2 -0
  20. package/dist/behaviors/drag-and-drop/index.js +1 -0
  21. package/dist/behaviors/drag-and-drop/ui-sdk.d.ts +2 -0
  22. package/dist/behaviors/drag-and-drop/ui-sdk.js +1 -0
  23. package/dist/behaviors/dragging/index.d.ts +2 -0
  24. package/dist/behaviors/dragging/index.js +1 -0
  25. package/dist/behaviors/dragging/ui-sdk.d.ts +2 -0
  26. package/dist/behaviors/dragging/ui-sdk.js +1 -0
  27. package/dist/behaviors/focus/index.d.ts +2 -0
  28. package/dist/behaviors/focus/index.js +1 -0
  29. package/dist/behaviors/focus/ui-sdk.d.ts +2 -0
  30. package/dist/behaviors/focus/ui-sdk.js +1 -0
  31. package/dist/behaviors/lists/index.d.ts +3 -0
  32. package/dist/behaviors/lists/index.js +3 -0
  33. package/dist/behaviors/lists/ui-sdk.d.ts +3 -0
  34. package/dist/behaviors/lists/ui-sdk.js +3 -0
  35. package/dist/behaviors/popups/index.d.ts +3 -0
  36. package/dist/behaviors/popups/index.js +3 -0
  37. package/dist/behaviors/popups/ui-sdk.d.ts +3 -0
  38. package/dist/behaviors/popups/ui-sdk.js +3 -0
  39. package/dist/behaviors/preferences/index.d.ts +3 -0
  40. package/dist/behaviors/preferences/index.js +3 -0
  41. package/dist/behaviors/preferences/ui-sdk.d.ts +3 -0
  42. package/dist/behaviors/preferences/ui-sdk.js +3 -0
  43. package/dist/behaviors/selection/index.d.ts +3 -0
  44. package/dist/behaviors/selection/index.js +3 -0
  45. package/dist/behaviors/selection/indicator.d.ts +13 -0
  46. package/dist/behaviors/selection/indicator.js +20 -0
  47. package/dist/behaviors/selection/ui-sdk.d.ts +2 -0
  48. package/dist/behaviors/selection/ui-sdk.js +1 -0
  49. package/dist/behaviors/transitions/index.d.ts +3 -0
  50. package/dist/behaviors/transitions/index.js +3 -0
  51. package/dist/behaviors/transitions/ui-sdk.d.ts +3 -0
  52. package/dist/behaviors/transitions/ui-sdk.js +3 -0
  53. package/dist/behaviors/trees/index.d.ts +2 -0
  54. package/dist/behaviors/trees/index.js +1 -0
  55. package/dist/behaviors/trees/ui-sdk.d.ts +2 -0
  56. package/dist/behaviors/trees/ui-sdk.js +1 -0
  57. package/dist/components/accordion/accordion.d.ts +13 -0
  58. package/dist/components/accordion/accordion.js +165 -0
  59. package/dist/components/alert/alert.d.ts +13 -0
  60. package/dist/components/alert/alert.js +131 -0
  61. package/dist/components/alert-dialog/alert-dialog.d.ts +15 -0
  62. package/dist/components/alert-dialog/alert-dialog.js +257 -0
  63. package/dist/components/aspect-ratio/aspect-ratio.d.ts +7 -0
  64. package/dist/components/aspect-ratio/aspect-ratio.js +57 -0
  65. package/dist/components/attachment/attachment.d.ts +48 -0
  66. package/dist/components/attachment/attachment.js +372 -0
  67. package/dist/components/autocomplete/autocomplete.d.ts +32 -0
  68. package/dist/components/autocomplete/autocomplete.js +466 -0
  69. package/dist/components/avatar/avatar.d.ts +6 -0
  70. package/dist/components/avatar/avatar.js +100 -0
  71. package/dist/components/avatar-group/avatar-group.d.ts +9 -0
  72. package/dist/components/avatar-group/avatar-group.js +75 -0
  73. package/dist/components/badge/badge.d.ts +15 -0
  74. package/dist/components/badge/badge.js +31 -0
  75. package/dist/components/breadcrumb/breadcrumb.d.ts +24 -0
  76. package/dist/components/breadcrumb/breadcrumb.js +279 -0
  77. package/dist/components/bubble/bubble.d.ts +26 -0
  78. package/dist/components/bubble/bubble.js +173 -0
  79. package/dist/components/button/button.d.ts +18 -0
  80. package/dist/components/button/button.js +91 -0
  81. package/dist/components/button-group/button-group.d.ts +15 -0
  82. package/dist/components/button-group/button-group.js +71 -0
  83. package/dist/components/calendar/calendar.d.ts +29 -0
  84. package/dist/components/calendar/calendar.js +453 -0
  85. package/dist/components/card/card.d.ts +14 -0
  86. package/dist/components/card/card.js +213 -0
  87. package/dist/components/carousel/carousel.d.ts +16 -0
  88. package/dist/components/carousel/carousel.js +364 -0
  89. package/dist/components/chain-of-thought/chain-of-thought.d.ts +72 -0
  90. package/dist/components/chain-of-thought/chain-of-thought.js +491 -0
  91. package/dist/components/chat/chat.d.ts +48 -0
  92. package/dist/components/chat/chat.js +207 -0
  93. package/dist/components/checkbox/checkbox.d.ts +10 -0
  94. package/dist/components/checkbox/checkbox.js +118 -0
  95. package/dist/components/checkpoint/checkpoint.d.ts +24 -0
  96. package/dist/components/checkpoint/checkpoint.js +178 -0
  97. package/dist/components/choice-cards/choice-cards.d.ts +38 -0
  98. package/dist/components/choice-cards/choice-cards.js +255 -0
  99. package/dist/components/code-block/code-block.d.ts +58 -0
  100. package/dist/components/code-block/code-block.js +506 -0
  101. package/dist/components/code-block/highlighter.js +96 -0
  102. package/dist/components/code-block/use-highlighted-code.d.ts +11 -0
  103. package/dist/components/code-block/use-highlighted-code.js +54 -0
  104. package/dist/components/collapsible/collapsible.d.ts +10 -0
  105. package/dist/components/collapsible/collapsible.js +92 -0
  106. package/dist/components/color-picker/color-picker.d.ts +17 -0
  107. package/dist/components/color-picker/color-picker.js +395 -0
  108. package/dist/components/combobox/combobox.d.ts +54 -0
  109. package/dist/components/combobox/combobox.js +683 -0
  110. package/dist/components/command/command.d.ts +23 -0
  111. package/dist/components/command/command.js +373 -0
  112. package/dist/components/command-dock/command-dock.d.ts +118 -0
  113. package/dist/components/command-dock/command-dock.js +944 -0
  114. package/dist/components/confirmation/confirmation.d.ts +58 -0
  115. package/dist/components/confirmation/confirmation.js +181 -0
  116. package/dist/components/context/context.d.ts +82 -0
  117. package/dist/components/context/context.js +490 -0
  118. package/dist/components/date-input/date-input.d.ts +16 -0
  119. package/dist/components/date-input/date-input.js +89 -0
  120. package/dist/components/date-picker/date-picker.d.ts +28 -0
  121. package/dist/components/date-picker/date-picker.js +361 -0
  122. package/dist/components/dialog/dialog.d.ts +14 -0
  123. package/dist/components/dialog/dialog.js +261 -0
  124. package/dist/components/drawer/drawer.d.ts +16 -0
  125. package/dist/components/drawer/drawer.js +309 -0
  126. package/dist/components/empty/empty.d.ts +18 -0
  127. package/dist/components/empty/empty.js +192 -0
  128. package/dist/components/field/field.d.ts +15 -0
  129. package/dist/components/field/field.js +261 -0
  130. package/dist/components/file-input/file-input.d.ts +12 -0
  131. package/dist/components/file-input/file-input.js +216 -0
  132. package/dist/components/file-tree/file-tree.d.ts +45 -0
  133. package/dist/components/file-tree/file-tree.js +283 -0
  134. package/dist/components/hover-card/hover-card.d.ts +10 -0
  135. package/dist/components/hover-card/hover-card.js +118 -0
  136. package/dist/components/icon/icon.d.ts +14 -0
  137. package/dist/components/icon/icon.js +60 -0
  138. package/dist/components/image-cropper/image-cropper.d.ts +15 -0
  139. package/dist/components/image-cropper/image-cropper.js +334 -0
  140. package/dist/components/inline-citation/inline-citation.d.ts +46 -0
  141. package/dist/components/inline-citation/inline-citation.js +269 -0
  142. package/dist/components/input/input.d.ts +9 -0
  143. package/dist/components/input/input.js +43 -0
  144. package/dist/components/input-group/input-group.d.ts +42 -0
  145. package/dist/components/input-group/input-group.js +192 -0
  146. package/dist/components/item/item.d.ts +32 -0
  147. package/dist/components/item/item.js +394 -0
  148. package/dist/components/kbd/kbd.d.ts +9 -0
  149. package/dist/components/kbd/kbd.js +75 -0
  150. package/dist/components/label/label.d.ts +6 -0
  151. package/dist/components/label/label.js +40 -0
  152. package/dist/components/link/link.d.ts +21 -0
  153. package/dist/components/link/link.js +126 -0
  154. package/dist/components/listbox/listbox.d.ts +20 -0
  155. package/dist/components/listbox/listbox.js +199 -0
  156. package/dist/components/marker/marker.d.ts +11 -0
  157. package/dist/components/marker/marker.js +88 -0
  158. package/dist/components/menu/menu.d.ts +38 -0
  159. package/dist/components/menu/menu.js +553 -0
  160. package/dist/components/menubar/menubar.d.ts +9 -0
  161. package/dist/components/menubar/menubar.js +47 -0
  162. package/dist/components/message/message.d.ts +44 -0
  163. package/dist/components/message/message.js +328 -0
  164. package/dist/components/message-scroller/message-scroller.d.ts +111 -0
  165. package/dist/components/message-scroller/message-scroller.js +957 -0
  166. package/dist/components/meter/meter.d.ts +8 -0
  167. package/dist/components/meter/meter.js +162 -0
  168. package/dist/components/model-selector/model-selector.d.ts +155 -0
  169. package/dist/components/model-selector/model-selector.js +905 -0
  170. package/dist/components/native-select/native-select.d.ts +27 -0
  171. package/dist/components/native-select/native-select.js +226 -0
  172. package/dist/components/navigation-menu/navigation-menu.d.ts +29 -0
  173. package/dist/components/navigation-menu/navigation-menu.js +318 -0
  174. package/dist/components/not-label.js +9 -0
  175. package/dist/components/note-editor/blocks.d.ts +22 -0
  176. package/dist/components/note-editor/blocks.js +245 -0
  177. package/dist/components/note-editor/diff.d.ts +19 -0
  178. package/dist/components/note-editor/diff.js +64 -0
  179. package/dist/components/note-editor/editor.js +249 -0
  180. package/dist/components/note-editor/note-editor.d.ts +109 -0
  181. package/dist/components/note-editor/note-editor.js +954 -0
  182. package/dist/components/note-editor/parts/comments.d.ts +24 -0
  183. package/dist/components/note-editor/parts/comments.js +336 -0
  184. package/dist/components/note-editor/parts/header.d.ts +25 -0
  185. package/dist/components/note-editor/parts/header.js +263 -0
  186. package/dist/components/note-editor/parts/history.d.ts +56 -0
  187. package/dist/components/note-editor/parts/history.js +409 -0
  188. package/dist/components/note-editor/parts/presence.d.ts +31 -0
  189. package/dist/components/note-editor/parts/presence.js +140 -0
  190. package/dist/components/note-editor/parts/suggestions.d.ts +45 -0
  191. package/dist/components/note-editor/parts/suggestions.js +316 -0
  192. package/dist/components/note-editor/parts/toolbar.d.ts +38 -0
  193. package/dist/components/note-editor/parts/toolbar.js +683 -0
  194. package/dist/components/note-editor/people.d.ts +84 -0
  195. package/dist/components/note-editor/people.js +276 -0
  196. package/dist/components/note-editor/person.d.ts +11 -0
  197. package/dist/components/note-editor/person.js +15 -0
  198. package/dist/components/note-place/note-place.d.ts +42 -0
  199. package/dist/components/note-place/note-place.js +256 -0
  200. package/dist/components/note-status/note-status.d.ts +59 -0
  201. package/dist/components/note-status/note-status.js +380 -0
  202. package/dist/components/number-input/number-input.d.ts +12 -0
  203. package/dist/components/number-input/number-input.js +252 -0
  204. package/dist/components/otp-input/otp-input.d.ts +12 -0
  205. package/dist/components/otp-input/otp-input.js +136 -0
  206. package/dist/components/pagination/pagination.d.ts +23 -0
  207. package/dist/components/pagination/pagination.js +218 -0
  208. package/dist/components/password-input/password-input.d.ts +11 -0
  209. package/dist/components/password-input/password-input.js +117 -0
  210. package/dist/components/plan/plan.d.ts +51 -0
  211. package/dist/components/plan/plan.js +320 -0
  212. package/dist/components/popover/popover.d.ts +16 -0
  213. package/dist/components/popover/popover.js +268 -0
  214. package/dist/components/preferences/preferences.d.ts +5 -0
  215. package/dist/components/preferences/preferences.js +18 -0
  216. package/dist/components/progress/progress.d.ts +8 -0
  217. package/dist/components/progress/progress.js +162 -0
  218. package/dist/components/prompt-input/prompt-input.d.ts +247 -0
  219. package/dist/components/prompt-input/prompt-input.js +1367 -0
  220. package/dist/components/questionnaire/questionnaire.d.ts +174 -0
  221. package/dist/components/questionnaire/questionnaire.js +1628 -0
  222. package/dist/components/queue/queue.d.ts +82 -0
  223. package/dist/components/queue/queue.js +471 -0
  224. package/dist/components/radio/radio.d.ts +7 -0
  225. package/dist/components/radio/radio.js +101 -0
  226. package/dist/components/rating/rating.d.ts +10 -0
  227. package/dist/components/rating/rating.js +95 -0
  228. package/dist/components/reasoning/reasoning.d.ts +50 -0
  229. package/dist/components/reasoning/reasoning.js +233 -0
  230. package/dist/components/resizable/resizable.d.ts +6 -0
  231. package/dist/components/resizable/resizable.js +100 -0
  232. package/dist/components/scroll-area/scroll-area.d.ts +17 -0
  233. package/dist/components/scroll-area/scroll-area.js +211 -0
  234. package/dist/components/segmented-control/segmented-control.d.ts +16 -0
  235. package/dist/components/segmented-control/segmented-control.js +142 -0
  236. package/dist/components/select/select.d.ts +43 -0
  237. package/dist/components/select/select.js +577 -0
  238. package/dist/components/separator/separator.d.ts +4 -0
  239. package/dist/components/separator/separator.js +38 -0
  240. package/dist/components/sheet/sheet.d.ts +24 -0
  241. package/dist/components/sheet/sheet.js +330 -0
  242. package/dist/components/sidebar/sidebar.d.ts +138 -0
  243. package/dist/components/sidebar/sidebar.js +1374 -0
  244. package/dist/components/skeleton/skeleton.d.ts +4 -0
  245. package/dist/components/skeleton/skeleton.js +40 -0
  246. package/dist/components/slider/slider.d.ts +9 -0
  247. package/dist/components/slider/slider.js +193 -0
  248. package/dist/components/sources/sources.d.ts +35 -0
  249. package/dist/components/sources/sources.js +209 -0
  250. package/dist/components/spinner/spinner.d.ts +11 -0
  251. package/dist/components/spinner/spinner.js +59 -0
  252. package/dist/components/stack-trace/parse-stack-trace.d.ts +21 -0
  253. package/dist/components/stack-trace/parse-stack-trace.js +61 -0
  254. package/dist/components/stack-trace/stack-trace.d.ts +79 -0
  255. package/dist/components/stack-trace/stack-trace.js +434 -0
  256. package/dist/components/subagent/subagent.d.ts +71 -0
  257. package/dist/components/subagent/subagent.js +450 -0
  258. package/dist/components/suggestion/suggestion.d.ts +21 -0
  259. package/dist/components/suggestion/suggestion.js +130 -0
  260. package/dist/components/switch/switch.d.ts +6 -0
  261. package/dist/components/switch/switch.js +70 -0
  262. package/dist/components/table/table.d.ts +19 -0
  263. package/dist/components/table/table.js +284 -0
  264. package/dist/components/table-of-contents/spy.js +84 -0
  265. package/dist/components/table-of-contents/table-of-contents.d.ts +92 -0
  266. package/dist/components/table-of-contents/table-of-contents.js +787 -0
  267. package/dist/components/tabs/tabs.d.ts +25 -0
  268. package/dist/components/tabs/tabs.js +273 -0
  269. package/dist/components/task/task.d.ts +40 -0
  270. package/dist/components/task/task.js +262 -0
  271. package/dist/components/terminal/terminal.d.ts +82 -0
  272. package/dist/components/terminal/terminal.js +457 -0
  273. package/dist/components/test-results/test-results.d.ts +127 -0
  274. package/dist/components/test-results/test-results.js +687 -0
  275. package/dist/components/textarea/textarea.d.ts +8 -0
  276. package/dist/components/textarea/textarea.js +43 -0
  277. package/dist/components/time-input/time-input.d.ts +7 -0
  278. package/dist/components/time-input/time-input.js +82 -0
  279. package/dist/components/timeline/timeline.d.ts +19 -0
  280. package/dist/components/timeline/timeline.js +247 -0
  281. package/dist/components/toast/toast.d.ts +12 -0
  282. package/dist/components/toast/toast.js +285 -0
  283. package/dist/components/toggle/toggle.d.ts +15 -0
  284. package/dist/components/toggle/toggle.js +137 -0
  285. package/dist/components/token-input/token-input.d.ts +7 -0
  286. package/dist/components/token-input/token-input.js +117 -0
  287. package/dist/components/tool/tool.d.ts +66 -0
  288. package/dist/components/tool/tool.js +413 -0
  289. package/dist/components/toolbar/toolbar.d.ts +91 -0
  290. package/dist/components/toolbar/toolbar.js +655 -0
  291. package/dist/components/tooltip/tooltip.d.ts +8 -0
  292. package/dist/components/tooltip/tooltip.js +97 -0
  293. package/dist/components/trace/trace.d.ts +31 -0
  294. package/dist/components/trace/trace.js +309 -0
  295. package/dist/components/tree/tree.d.ts +13 -0
  296. package/dist/components/tree/tree.js +258 -0
  297. package/dist/components/trigger-menu/trigger-menu.d.ts +30 -0
  298. package/dist/components/trigger-menu/trigger-menu.js +352 -0
  299. package/dist/components/usage/usage.d.ts +132 -0
  300. package/dist/components/usage/usage.js +1368 -0
  301. package/dist/components/waterfall/waterfall.d.ts +20 -0
  302. package/dist/components/waterfall/waterfall.js +360 -0
  303. package/dist/components/week-strip/week-strip.d.ts +177 -0
  304. package/dist/components/week-strip/week-strip.js +1081 -0
  305. package/dist/core/index.d.ts +7 -0
  306. package/dist/core/index.js +27 -0
  307. package/dist/core/ui-sdk.d.ts +3 -0
  308. package/dist/core/ui-sdk.js +3 -0
  309. package/dist/core/use-primitive-state.d.ts +14 -0
  310. package/dist/core/use-primitive-state.js +25 -0
  311. package/dist/styles/LICENSE-shadcn.md +21 -0
  312. package/dist/styles/color-scheme.css +32 -0
  313. package/dist/styles/components.css +303 -0
  314. package/dist/styles/index.css +41 -0
  315. package/dist/styles/tokens.css +474 -0
  316. package/dist/styles/typeset/shadcn.css +506 -0
  317. package/dist/styles/typeset.css +70 -0
  318. package/dist/styles/utilities.css +555 -0
  319. package/dist/tools/observe/index.d.ts +2 -0
  320. package/dist/tools/observe/index.js +3 -0
  321. package/dist/tools/observe/ui-sdk.d.ts +1 -0
  322. package/dist/tools/observe/ui-sdk.js +2 -0
  323. package/dist/tools/testing/check-agent.d.ts +28 -0
  324. package/dist/tools/testing/check-agent.js +42 -0
  325. package/dist/tools/testing/index.d.ts +4 -0
  326. package/dist/tools/testing/index.js +4 -0
  327. package/dist/tools/testing/ui-sdk.d.ts +1 -0
  328. package/dist/tools/testing/ui-sdk.js +2 -0
  329. package/dist/utilities/cn/index.d.ts +12 -0
  330. package/dist/utilities/cn/index.js +47 -0
  331. package/dist/utilities/color/index.d.ts +2 -0
  332. package/dist/utilities/color/index.js +3 -0
  333. package/dist/utilities/color/ui-sdk.d.ts +1 -0
  334. package/dist/utilities/color/ui-sdk.js +2 -0
  335. package/dist/utilities/date/index.d.ts +2 -0
  336. package/dist/utilities/date/index.js +6 -0
  337. package/dist/utilities/date/ui-sdk.d.ts +1 -0
  338. package/dist/utilities/date/ui-sdk.js +2 -0
  339. package/dist/utilities/image/index.d.ts +2 -0
  340. package/dist/utilities/image/index.js +3 -0
  341. package/dist/utilities/image/ui-sdk.d.ts +1 -0
  342. package/dist/utilities/image/ui-sdk.js +2 -0
  343. package/dist/utilities/mobile/index.d.ts +2 -0
  344. package/dist/utilities/mobile/index.js +1 -0
  345. package/dist/utilities/mobile/ui-sdk.d.ts +2 -0
  346. package/dist/utilities/mobile/ui-sdk.js +1 -0
  347. package/dist/utilities/number/index.d.ts +2 -0
  348. package/dist/utilities/number/index.js +3 -0
  349. package/dist/utilities/number/ui-sdk.d.ts +1 -0
  350. package/dist/utilities/number/ui-sdk.js +2 -0
  351. package/dist/utilities/platform/index.d.ts +3 -0
  352. package/dist/utilities/platform/index.js +14 -0
  353. package/dist/utilities/platform/ui-sdk.d.ts +3 -0
  354. package/dist/utilities/platform/ui-sdk.js +3 -0
  355. package/dist/utilities/storage/index.d.ts +2 -0
  356. package/dist/utilities/storage/index.js +1 -0
  357. package/dist/utilities/storage/ui-sdk.d.ts +2 -0
  358. package/dist/utilities/storage/ui-sdk.js +1 -0
  359. package/dist/utilities/text/index.d.ts +3 -0
  360. package/dist/utilities/text/index.js +3 -0
  361. package/dist/utilities/text/ui-sdk.d.ts +3 -0
  362. package/dist/utilities/text/ui-sdk.js +3 -0
  363. package/package.json +192 -4
  364. package/skills/agent-ready-ui/SKILL.md +229 -0
  365. package/skills/blocks/SKILL.md +262 -0
  366. package/skills/compose-screens/SKILL.md +354 -0
  367. package/skills/note-editor/SKILL.md +493 -0
  368. package/skills/note-status/SKILL.md +295 -0
  369. package/skills/setup/SKILL.md +136 -0
  370. package/skills/theming/SKILL.md +216 -0
  371. package/src/blocks/notes/adapters.ts +77 -0
  372. package/src/blocks/notes/data.ts +508 -0
  373. package/src/blocks/notes/notes-block.tsx +244 -0
  374. package/src/blocks/notes/parts/home.tsx +219 -0
  375. package/src/blocks/notes/parts/no-access.tsx +84 -0
  376. package/src/blocks/notes/parts/note-screen.tsx +412 -0
  377. package/src/blocks/notes/parts/notes-sidebar.tsx +277 -0
  378. package/src/blocks/notes/parts/panels.tsx +393 -0
  379. package/src/blocks/notes/parts/place.ts +15 -0
  380. package/src/blocks/notes/parts/review-dialog.tsx +159 -0
  381. package/src/blocks/notes/parts/share.tsx +172 -0
  382. package/src/blocks/notes/texts.ts +135 -0
  383. package/src/blocks/shell/adapters.ts +69 -0
  384. package/src/blocks/shell/data.ts +281 -0
  385. package/src/blocks/shell/parts/compose.tsx +292 -0
  386. package/src/blocks/shell/parts/home.tsx +203 -0
  387. package/src/blocks/shell/parts/marks.tsx +144 -0
  388. package/src/blocks/shell/parts/rail.tsx +166 -0
  389. package/src/blocks/shell/parts/rooms-column.tsx +326 -0
  390. package/src/blocks/shell/shell-block.tsx +210 -0
  391. package/src/blocks/shell/texts.ts +80 -0
package/README.md CHANGED
@@ -1,3 +1,218 @@
1
- # Temporary Holding Version
1
+ # abby
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Sistema de diseño para React, construido sobre [ui-sdk](https://ui-sdk.dev/) y Tailwind CSS 4, con React Compiler.
4
+
5
+ ## Desarrollo
6
+
7
+ ```bash
8
+ vp install # instalar dependencias (bun)
9
+ vp exec playwright install chromium # una vez, para los tests en navegador
10
+ vp run storybook # Storybook en http://localhost:6006
11
+ vp check # formato, lint y tipos
12
+ vp test # stories como tests en Chromium, con a11y, en claro y oscuro
13
+ vp run build # compilar la librería en dist/
14
+ vp run sync # regenerar los reexports y el skill tras actualizar ui-sdk
15
+ vp run skills # compilar y validar las skills de skills/
16
+ ```
17
+
18
+ ## Publicar
19
+
20
+ abby se publica en npm como [`@asanchez-sa/abby`](https://www.npmjs.com/package/@asanchez-sa/abby), público. El nombre `abby` ya es de otro paquete en npm, así que el repositorio se queda con `abby` y `scripts/release.ts` cambia el nombre solo en la copia que se publica. `bun publish` directo falla a propósito.
21
+
22
+ 1. Sube `version` en `package.json` y ejecuta `vp exec intent validate --set-version <versión>`.
23
+ 2. Haz commit, crea la etiqueta y súbela: `git tag v<versión> && git push origin v<versión>`.
24
+ 3. El workflow `Release` (`.github/workflows/release.yml`) comprueba, compila y publica. npm confía en él por OIDC (trusted publishing): no hay token guardado en GitHub.
25
+
26
+ A mano, con `npm login` hecho: `vp run build`, luego `vp run release -- --publish --dry-run` para ver qué se publicaría y `vp run release -- --publish` para publicar.
27
+
28
+ ## Uso en una app
29
+
30
+ La app necesita React 19 y Tailwind CSS 4. Instala abby con el alias `abby`, para que los imports sean `abby/...` como en esta guía, en las skills y en los blocks:
31
+
32
+ ```bash
33
+ bun add abby@npm:@asanchez-sa/abby # o npm install / pnpm add, con el mismo argumento
34
+ ```
35
+
36
+ Si la máquina manda el scope `@asanchez-sa` a otro registro (una línea `@asanchez-sa:registry=...` en `~/.npmrc`, por ejemplo hacia GitHub Packages), la app añade en su propio `.npmrc`:
37
+
38
+ ```ini
39
+ @asanchez-sa:registry=https://registry.npmjs.org/
40
+ ```
41
+
42
+ En su hoja de estilos global:
43
+
44
+ ```css
45
+ @layer ui-sdk;
46
+ @import "tailwindcss";
47
+ @import "abby/styles.css";
48
+ ```
49
+
50
+ ```tsx
51
+ import { Button } from "abby/button";
52
+
53
+ <Button variant="outline">Guardar</Button>;
54
+ ```
55
+
56
+ ### Temas, typeset y utilidades
57
+
58
+ ```css
59
+ @layer ui-sdk;
60
+ @import "tailwindcss";
61
+ @import "abby/styles.css";
62
+ @import "abby/typeset.css"; /* opcional: estilo para markdown y HTML renderizado */
63
+ ```
64
+
65
+ El aspecto de abby es el de Alma, que trae `abby/styles.css` sin nada más: tranquilo, denso y rápido. La ventana es un papel cálido con el contenido en una tarjeta blanca encima, los bordes son líneas finas, los botones y campos son cápsulas, hay una sola acción en tinta por vista, el foco siempre es azul y el texto va en tres grises, en claro y en oscuro. Hoy es el único tema. Un tema nuevo sería un archivo `abby/themes/<nombre>.css` que se activa con `data-theme="<nombre>"` y cambia los colores, los radios, las sombras, el peso de los títulos, el foco y el velo de los diálogos.
66
+
67
+ `abby/typeset.css` da estilo al markdown renderizado y al HTML plano dentro de un contenedor, sin poner clases en el contenido. Trae las fuentes Geist y tres presets: `typeset-docs` (páginas largas), `typeset-chat` (respuestas de chat) y `typeset-compact` (paneles densos).
68
+
69
+ ```tsx
70
+ <div className="typeset typeset-docs max-w-[37em]">{contenido}</div>
71
+ ```
72
+
73
+ Un componente de abby dentro del contenedor conserva su estilo. Para excluir otro bloque, ponle `not-typeset` o `data-not-typeset`.
74
+
75
+ Los tokens usan los nombres de shadcn (`bg-card`, `text-muted-foreground`, `bg-sidebar-accent`, `rounded-lg`…). `abby/styles.css` trae además las utilidades `scroll-fade`, `shimmer` y `no-scrollbar`, y `abby/utilities/cn` exporta `cn` y `cva`.
76
+
77
+ ### Modo oscuro
78
+
79
+ Los colores de abby siguen el esquema del dispositivo sin más configuración. Para que la persona pueda elegir claro, oscuro o sistema, y que la elección se guarde:
80
+
81
+ ```tsx
82
+ import { createColorScheme, Preferences } from "abby/behaviors/preferences";
83
+ import { createLocalStorage } from "abby/utilities/storage";
84
+
85
+ const colorScheme = createColorScheme({
86
+ storage: createLocalStorage("color-scheme"),
87
+ global: true,
88
+ });
89
+
90
+ <Preferences preferences={[colorScheme]}>
91
+ <App />
92
+ </Preferences>;
93
+ ```
94
+
95
+ `colorScheme.set("dark")` cambia la elección. Para evitar el parpadeo al cargar, inserta `preferencesScript([colorScheme])` al principio del `<head>`; la guía completa está en <https://ui-sdk.dev/docs/guides/dark-mode>.
96
+
97
+ Además de los componentes, abby reexporta las bases de ui-sdk por entrada:
98
+
99
+ ```ts
100
+ import { definePrimitive } from "abby/core";
101
+ import { createRovingFocus } from "abby/behaviors/focus";
102
+ import { fuzzyScore } from "abby/utilities/text";
103
+ import { checkPattern } from "abby/tools/testing";
104
+ import { createAgent, registerTools } from "abby/agents";
105
+ ```
106
+
107
+ ## Agentes
108
+
109
+ Un agente puede usar la interfaz igual que una persona: lee los componentes y llama a sus acciones a través del puente de ui-sdk, sin capturas ni clics. Crea el puente una vez, en código de cliente, antes de pintar la página:
110
+
111
+ ```ts
112
+ import { createAgent, createApprovals } from "abby/agents";
113
+
114
+ export const approvals = createApprovals();
115
+ export const agent = createAgent({ allow: approvals.allow });
116
+ ```
117
+
118
+ `abby/agents` trae lo que hace falta para conectarlo a un chat:
119
+
120
+ | Pieza | Para qué sirve |
121
+ | ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
122
+ | `createApprovals` y `useApprovals` | Los pasos que esperan a la persona (los marcados con `data-agent-confirm`). Pinta un `Confirmation` por cada uno. |
123
+ | `agentTools` y `runAgentTool` | Las tres herramientas (`snapshot`, `act`, `query`) para tu modelo, y la función que ejecuta cada llamada sobre el puente. |
124
+ | `actAndCheck` | `agent.act` con `unchanged`: los pasos que la app rechazó, que `act` solo da por hechos. `runAgentTool` lo usa. |
125
+ | `collectChanges` | Lo que cambió la persona desde el último turno, para contárselo al modelo. |
126
+ | `createHistory`, `useAgentHistory` | La lista de cambios y quién hizo cada uno. `history.undoSource("agent")` deshace solo los del agente, desde un `Checkpoint`. |
127
+ | `stageChanges` | Pone una sugerencia en los controles reales, y `revert()` la quita si la persona la descarta. |
128
+ | `registerTools` | Ofrece las mismas herramientas al agente del navegador (WebMCP). |
129
+
130
+ ```tsx
131
+ const pending = useApprovals(approvals);
132
+
133
+ {
134
+ pending.map((approval) => (
135
+ <Confirmation
136
+ key={approval.id}
137
+ approval={{ id: approval.id }}
138
+ state="approval-requested"
139
+ aria-label={approval.confirm}
140
+ >
141
+ <ConfirmationTitle>{approval.confirm}</ConfirmationTitle>
142
+ <ConfirmationActions>
143
+ <ConfirmationAction variant="outline" onClick={() => approvals.reject(approval.id)}>
144
+ Denegar
145
+ </ConfirmationAction>
146
+ <ConfirmationAction onClick={() => approvals.approve(approval.id)}>
147
+ Aprobar
148
+ </ConfirmationAction>
149
+ </ConfirmationActions>
150
+ </Confirmation>
151
+ ));
152
+ }
153
+ ```
154
+
155
+ ```ts
156
+ // Con el bucle de herramientas de tu SDK de modelo
157
+ const result = await runAgentTool(agent, call.name, call.input);
158
+
159
+ // Para el agente del navegador: el puente ya pregunta, así que aquí no se pregunta dos veces
160
+ registerTools(agent, { allow: () => true });
161
+ ```
162
+
163
+ El ejemplo completo, con sus pruebas, es la story AI Elements/Agent Bridge (`src/ai-elements/agent-bridge.stories.tsx`).
164
+
165
+ Para que un agente pueda usar tu pantalla:
166
+
167
+ - Cada control tiene un nombre único: un `FieldLabel`, el texto del botón o `aria-label`. Un nombre no debe contener el de otro control ("Region" y "Suggest a region" chocan).
168
+ - Un enlace es `Link` de `abby/link`; el agente no ve un `<a>` suelto ni puede pulsar un `Button` renderizado como enlace.
169
+ - Las listas reciben `items`, para que el agente lea las opciones sin abrirlas.
170
+ - Lo que no debe hacer solo lleva `data-agent-confirm="lo que hace"`; lo que no debe leer, `data-agent-secret`; lo que no debe ver, `data-agent-hidden`.
171
+ - Las reglas de negocio van en `onValueChange` (y los demás `on…Change`), donde `details.source === "agent"` distingue al agente y `details.cancel()` rechaza el cambio.
172
+ - `checkAgent(agent)` de `abby/tools/testing` falla en un test si queda un control sin nombre, dos con el mismo o un botón que el agente no puede pulsar.
173
+
174
+ ## Skills para el agente de código de la app
175
+
176
+ abby publica [Agent Skills](https://agentskills.io) con [TanStack Intent](https://tanstack.com/intent/latest): guías cortas, con la versión del paquete, que le dicen al agente que programa la app (Claude Code, Cursor, Copilot, Codex…) cómo usar abby. Viajan dentro del paquete, en `skills/`, y se actualizan al actualizar abby.
177
+
178
+ | Skill | Cuándo la carga el agente |
179
+ | ----------------- | -------------------------------------------------------------------------------- |
180
+ | `setup` | Instalar abby: el orden de los CSS, las entradas, `"use client"`. |
181
+ | `theming` | Tokens en vez de colores de paleta, modo oscuro, temas, typeset, `cn`. |
182
+ | `compose-screens` | Pantallas, formularios y popups con los componentes: partes, tamaños, `items`. |
183
+ | `agent-ready-ui` | Que un agente de IA pueda usar la interfaz: nombres, aprobaciones, `checkAgent`. |
184
+
185
+ En la app, una vez:
186
+
187
+ ```bash
188
+ vp add -D @tanstack/intent # o el gestor de la app; fija la versión en el lockfile
189
+ vp exec intent install # escribe en AGENTS.md (o CLAUDE.md…) cómo descubrir y cargar skills
190
+ ```
191
+
192
+ Con otro gestor, `pnpm exec intent`, `bunx intent` o `npx intent` hacen lo mismo.
193
+
194
+ Intent lee los `SKILL.md` de `node_modules` sin ejecutar código de los paquetes. Solo carga los paquetes que la app permite, en su `package.json`:
195
+
196
+ ```json
197
+ {
198
+ "intent": {
199
+ "skills": ["@asanchez-sa/abby", "@ui-sdk/core"],
200
+ "exclude": ["@asanchez-sa/abby#agent-ready-ui"]
201
+ }
202
+ }
203
+ ```
204
+
205
+ - `skills` es la lista de lo permitido: `@asanchez-sa/abby` permite todas sus skills, `@asanchez-sa/abby#theming` solo una. `[]` no permite nada. Intent nombra el paquete por su nombre en npm, no por el alias: con `"abby"` no encuentra nada.
206
+ - `exclude` quita skills concretas, también con comodines (`*#experimental-*`). `vp exec intent exclude add <patrón>` la mantiene.
207
+ - `@ui-sdk/core` trae su propia skill. Las de abby mandan en imports y estilos; la de ui-sdk explica el puente de agentes y las primitivas a fondo.
208
+
209
+ El agente carga solo la guía de la tarea que tiene delante:
210
+
211
+ ```bash
212
+ vp exec intent list # paquetes y skills disponibles
213
+ vp exec intent load @asanchez-sa/abby#setup # el contenido de una skill
214
+ ```
215
+
216
+ `vp exec intent hooks install` añade hooks para Claude Code, Codex o Copilot que recuerdan cargar la skill antes de editar. Son una comodidad, no una barrera de seguridad: no comprueban que el agente siga la guía. La protección es la lista `skills` del `package.json`.
217
+
218
+ La estructura de carpetas está descrita en `AGENTS.md`.
@@ -0,0 +1,26 @@
1
+ // \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __exportAll = (all, no_symbols) => {
7
+ let target = {};
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
13
+ return target;
14
+ };
15
+ var __copyProps = (to, from, except, desc) => {
16
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
17
+ key = keys[i];
18
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
19
+ get: ((k) => from[k]).bind(null, key),
20
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
21
+ });
22
+ }
23
+ return to;
24
+ };
25
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
26
+ export { __exportAll, __reExport };
@@ -0,0 +1,46 @@
1
+ import { ui_sdk_d_exports } from "./ui-sdk.js";
2
+ /** A step that waits for the person: what it is, and how to answer it. */
3
+ type Approval = {
4
+ /** Unique among the approvals of one `createApprovals`. */
5
+ id: string;
6
+ /** The step as the bridge resolved it: its component, action and arguments. */
7
+ step: ui_sdk_d_exports.AgentAction;
8
+ /** What the step does, from its `data-agent-confirm` mark, when it has one. */
9
+ confirm: string | undefined;
10
+ };
11
+ type ApprovalsOptions = {
12
+ /**
13
+ * Which steps wait for the person. By default the ones marked with
14
+ * `data-agent-confirm`. Return true for more, like every `press`.
15
+ */
16
+ needs?: (step: ui_sdk_d_exports.AgentAction) => boolean;
17
+ };
18
+ /**
19
+ * The steps of an agent that wait for a yes or a no, as a list a chat can
20
+ * show. `allow` goes to `createAgent`: a step that needs the person stays
21
+ * pending until `approve(id)` or `reject(id)` runs, and is rejected when the
22
+ * bridge stops waiting for it.
23
+ *
24
+ * @example
25
+ * const approvals = createApprovals()
26
+ * const agent = createAgent({ allow: approvals.allow })
27
+ * approvals.subscribe(() => render(approvals.pending()))
28
+ * // in the chat: a Confirmation per pending approval
29
+ * approvals.approve(approval.id)
30
+ */
31
+ declare function createApprovals({ needs }?: ApprovalsOptions): {
32
+ /** For `createAgent({ allow })`, and for `registerTools` when the bridge has none. */
33
+ allow: (step: ui_sdk_d_exports.AgentAction, context?: {
34
+ signal?: AbortSignal;
35
+ }) => boolean | Promise<boolean>;
36
+ /** The steps waiting, oldest first. The same array until one is added or answered. */
37
+ pending: () => readonly Approval[];
38
+ /** Lets the step run. */
39
+ approve: (id: string) => void;
40
+ /** Refuses the step: its `act` call fails there, and earlier steps stay applied. */
41
+ reject: (id: string) => void;
42
+ /** Calls `listener` whenever the pending steps change, until the returned function runs. */
43
+ subscribe: (listener: () => void) => () => void;
44
+ };
45
+ type Approvals = ReturnType<typeof createApprovals>;
46
+ export { type Approval, type Approvals, type ApprovalsOptions, createApprovals };
@@ -0,0 +1,58 @@
1
+ // src/agents/approvals.ts
2
+ /**
3
+ * The steps of an agent that wait for a yes or a no, as a list a chat can
4
+ * show. `allow` goes to `createAgent`: a step that needs the person stays
5
+ * pending until `approve(id)` or `reject(id)` runs, and is rejected when the
6
+ * bridge stops waiting for it.
7
+ *
8
+ * @example
9
+ * const approvals = createApprovals()
10
+ * const agent = createAgent({ allow: approvals.allow })
11
+ * approvals.subscribe(() => render(approvals.pending()))
12
+ * // in the chat: a Confirmation per pending approval
13
+ * approvals.approve(approval.id)
14
+ */
15
+ function createApprovals({ needs = (step) => step.confirm !== void 0 } = {}) {
16
+ let pending = [];
17
+ let count = 0;
18
+ const answers = /* @__PURE__ */ new Map();
19
+ const listeners = /* @__PURE__ */ new Set();
20
+ const answer = (id, approved) => {
21
+ const resolve = answers.get(id);
22
+ if (!resolve) return;
23
+ answers.delete(id);
24
+ pending = pending.filter((approval) => approval.id !== id);
25
+ resolve(approved);
26
+ for (const listener of listeners) listener();
27
+ };
28
+ return {
29
+ /** For `createAgent({ allow })`, and for `registerTools` when the bridge has none. */
30
+ allow: (step, context) => {
31
+ if (!needs(step)) return true;
32
+ const id = `approval-${++count}`;
33
+ const asked = new Promise((resolve) => answers.set(id, resolve));
34
+ pending = [...pending, {
35
+ id,
36
+ step,
37
+ confirm: step.confirm
38
+ }];
39
+ context?.signal?.addEventListener("abort", () => answer(id, false), { once: true });
40
+ for (const listener of listeners) listener();
41
+ return asked;
42
+ },
43
+ /** The steps waiting, oldest first. The same array until one is added or answered. */
44
+ pending: () => pending,
45
+ /** Lets the step run. */
46
+ approve: (id) => answer(id, true),
47
+ /** Refuses the step: its `act` call fails there, and earlier steps stay applied. */
48
+ reject: (id) => answer(id, false),
49
+ /** Calls `listener` whenever the pending steps change, until the returned function runs. */
50
+ subscribe: (listener) => {
51
+ listeners.add(listener);
52
+ return () => {
53
+ listeners.delete(listener);
54
+ };
55
+ }
56
+ };
57
+ }
58
+ export { createApprovals };
@@ -0,0 +1,21 @@
1
+ import { ui_sdk_d_exports } from "./ui-sdk.js";
2
+ type Agent = ReturnType<typeof ui_sdk_d_exports.createAgent>;
3
+ type CollectChangesOptions = {
4
+ /** Whose changes to leave out. The agent's own by default, since it made them. */
5
+ ignore?: (change: ui_sdk_d_exports.ObservedChange) => boolean;
6
+ };
7
+ /**
8
+ * Keeps what changed on the page between an agent's turns, so its next turn
9
+ * starts knowing it. `take()` returns the changes since the last call, oldest
10
+ * first, and forgets them; `stop()` ends it.
11
+ *
12
+ * @example
13
+ * const changes = collectChanges(agent)
14
+ * // before each turn
15
+ * const context = changes.take().map((change) => `${change.label}: ${change.previous} → ${change.value}`)
16
+ */
17
+ declare function collectChanges(agent: Agent, { ignore }?: CollectChangesOptions): {
18
+ take: () => ui_sdk_d_exports.ObservedChange[];
19
+ stop: () => void;
20
+ };
21
+ export { type CollectChangesOptions, collectChanges };
@@ -0,0 +1,21 @@
1
+ // src/agents/changes.ts
2
+ /**
3
+ * Keeps what changed on the page between an agent's turns, so its next turn
4
+ * starts knowing it. `take()` returns the changes since the last call, oldest
5
+ * first, and forgets them; `stop()` ends it.
6
+ *
7
+ * @example
8
+ * const changes = collectChanges(agent)
9
+ * // before each turn
10
+ * const context = changes.take().map((change) => `${change.label}: ${change.previous} → ${change.value}`)
11
+ */
12
+ function collectChanges(agent, { ignore = (change) => change.source === "agent" } = {}) {
13
+ const changes = [];
14
+ return {
15
+ take: () => changes.splice(0),
16
+ stop: agent.subscribe((change) => {
17
+ if (!ignore(change)) changes.push(change);
18
+ })
19
+ };
20
+ }
21
+ export { collectChanges };
@@ -0,0 +1,20 @@
1
+ import { Approval, Approvals } from "./approvals.js";
2
+ import { ui_sdk_d_exports } from "./ui-sdk.js";
3
+ type History = ReturnType<typeof ui_sdk_d_exports.createHistory>;
4
+ /**
5
+ * The steps waiting for the person, for a chat to draw one `Confirmation`
6
+ * each. It renders again when one is added or answered.
7
+ */
8
+ declare function useApprovals(approvals: Approvals): readonly Approval[];
9
+ type HistoryState = {
10
+ /** Every entry, oldest first. */
11
+ entries: readonly ui_sdk_d_exports.HistoryEntry[];
12
+ /** How many entries are applied: `entries.length` is now, 0 is the start. */
13
+ position: number;
14
+ };
15
+ /**
16
+ * A history's entries and position, for a list of what changed or a
17
+ * `Checkpoint` that goes back. It renders again when either changes.
18
+ */
19
+ declare function useAgentHistory(history: History): HistoryState;
20
+ export { type HistoryState, useAgentHistory, useApprovals };
@@ -0,0 +1,58 @@
1
+ "use client";
2
+ import { c } from "react/compiler-runtime";
3
+ import { useSyncExternalStore } from "react";
4
+ // src/agents/hooks.ts
5
+ const none = [];
6
+ /**
7
+ * The steps waiting for the person, for a chat to draw one `Confirmation`
8
+ * each. It renders again when one is added or answered.
9
+ */
10
+ function useApprovals(approvals) {
11
+ return useSyncExternalStore(approvals.subscribe, approvals.pending, _temp);
12
+ }
13
+ function _temp() {
14
+ return none;
15
+ }
16
+ const empty = {
17
+ entries: [],
18
+ position: 0
19
+ };
20
+ const reads = /* @__PURE__ */ new WeakMap();
21
+ function read(history) {
22
+ let state = reads.get(history);
23
+ if (!state) {
24
+ state = {
25
+ entries: [...history.entries()],
26
+ position: history.position()
27
+ };
28
+ reads.set(history, state);
29
+ }
30
+ return state;
31
+ }
32
+ /**
33
+ * A history's entries and position, for a list of what changed or a
34
+ * `Checkpoint` that goes back. It renders again when either changes.
35
+ */
36
+ function useAgentHistory(history) {
37
+ const $ = c(3);
38
+ let t0;
39
+ let t1;
40
+ if ($[0] !== history) {
41
+ t0 = (listener) => history.subscribe(() => {
42
+ reads.delete(history);
43
+ listener();
44
+ });
45
+ t1 = () => read(history);
46
+ $[0] = history;
47
+ $[1] = t0;
48
+ $[2] = t1;
49
+ } else {
50
+ t0 = $[1];
51
+ t1 = $[2];
52
+ }
53
+ return useSyncExternalStore(t0, t1, _temp2);
54
+ }
55
+ function _temp2() {
56
+ return empty;
57
+ }
58
+ export { useAgentHistory, useApprovals };
@@ -0,0 +1,11 @@
1
+ import { ui_sdk_d_exports } from "./ui-sdk.js";
2
+ import { Approval, Approvals, ApprovalsOptions, createApprovals } from "./approvals.js";
3
+ import { CollectChangesOptions, collectChanges } from "./changes.js";
4
+ import { HistoryState, useAgentHistory, useApprovals } from "./hooks.js";
5
+ import { AgentToolName, UnchangedStep, actAndCheck, runAgentTool } from "./run-tool.js";
6
+ export * from "@ui-sdk/core/agent";
7
+ export * from "@ui-sdk/core/history";
8
+ declare namespace index_d_exports {
9
+ export { AgentToolName, Approval, Approvals, ApprovalsOptions, CollectChangesOptions, HistoryState, UnchangedStep, actAndCheck, collectChanges, createApprovals, runAgentTool, useAgentHistory, useApprovals };
10
+ }
11
+ export { type AgentToolName, type Approval, type Approvals, type ApprovalsOptions, type CollectChangesOptions, type HistoryState, type UnchangedStep, actAndCheck, collectChanges, createApprovals, index_d_exports, runAgentTool, useAgentHistory, useApprovals };
@@ -0,0 +1,9 @@
1
+ import "../_virtual/_rolldown/runtime.js";
2
+ import "./ui-sdk.js";
3
+ import { createApprovals } from "./approvals.js";
4
+ import { collectChanges } from "./changes.js";
5
+ import { useAgentHistory, useApprovals } from "./hooks.js";
6
+ import { actAndCheck, runAgentTool } from "./run-tool.js";
7
+ export * from "@ui-sdk/core/agent";
8
+ export * from "@ui-sdk/core/history";
9
+ export { actAndCheck, collectChanges, createApprovals, runAgentTool, useAgentHistory, useApprovals };
@@ -0,0 +1,44 @@
1
+ import { ui_sdk_d_exports } from "./ui-sdk.js";
2
+ type Agent = ReturnType<typeof ui_sdk_d_exports.createAgent>;
3
+ type ActInput = Parameters<Agent["act"]>[0];
4
+ type ActResult = Awaited<ReturnType<Agent["act"]>>;
5
+ /** The names of the bridge's three tools, as `agentTools` lists them. */
6
+ type AgentToolName = "snapshot" | "act" | "query";
7
+ /** A step that ran and left its component as it was. */
8
+ type UnchangedStep = {
9
+ /** The step's index in the call, from zero. */
10
+ step: number;
11
+ /** The component it ran on. */
12
+ ref: string;
13
+ action: string;
14
+ /** What happened, in words a model can act on. */
15
+ message: string;
16
+ };
17
+ /**
18
+ * Runs steps as `agent.act` does, and adds what it leaves out: the steps that
19
+ * ran and changed nothing. `act` reports no error when the app cancels a
20
+ * change in `onValueChange`, so a model would take a refused step for done.
21
+ * Each one is listed in `unchanged`, with why in `message`. A step whose
22
+ * component already held the value isn't listed.
23
+ *
24
+ * @example
25
+ * const result = await actAndCheck(agent, { steps: [{ ref: "Plan", action: "setValue", args: ["Enterprise"] }] })
26
+ * result.unchanged // [{ step: 0, ref: "c4", action: "setValue", message: 'setValue changed nothing on "Plan" (c4): …' }]
27
+ */
28
+ declare function actAndCheck(agent: Agent, input: ActInput): Promise<ActResult & {
29
+ unchanged?: UnchangedStep[];
30
+ }>;
31
+ /**
32
+ * Runs a model's tool call on the bridge and resolves with what to send back.
33
+ * The names and inputs are those of `agentTools`. `act` runs through
34
+ * `actAndCheck`, so its result says which steps the app refused. A name that
35
+ * isn't one of the tools resolves with `{ error }`, as a failed call does, so
36
+ * the model reads why and tries again.
37
+ *
38
+ * @example
39
+ * // with your model SDK's tool loop
40
+ * const tools = agentTools.map(({ name, description, inputSchema }) => ({ name, description, input_schema: inputSchema }))
41
+ * const result = await runAgentTool(agent, call.name, call.input)
42
+ */
43
+ declare function runAgentTool(agent: Agent, name: string, input?: unknown): Promise<unknown>;
44
+ export { type AgentToolName, type UnchangedStep, actAndCheck, runAgentTool };
@@ -0,0 +1,79 @@
1
+ // src/agents/run-tool.ts
2
+ const same = (a, b) => a === b || String(a) === String(b) || JSON.stringify(a) === JSON.stringify(b);
3
+ const isEmpty = (value) => value == null || value === "" || Array.isArray(value) && value.length === 0;
4
+ /** Labels compare as the bridge matches them: without case or accents. */
5
+ const plain = (text) => String(text).normalize("NFD").replace(/\p{Diacritic}/gu, "").toLowerCase().trim();
6
+ /** Whether the component already holds what the step asked for, so nothing had to change. */
7
+ function holds(entry, key, step) {
8
+ const value = entry[key];
9
+ if (step.action === "clear") return isEmpty(value);
10
+ const asked = step.args?.[0];
11
+ if (same(value, asked)) return true;
12
+ return (entry.items ?? []).some((item) => plain(item.label) === plain(asked) && same(item.value, value));
13
+ }
14
+ /**
15
+ * Runs steps as `agent.act` does, and adds what it leaves out: the steps that
16
+ * ran and changed nothing. `act` reports no error when the app cancels a
17
+ * change in `onValueChange`, so a model would take a refused step for done.
18
+ * Each one is listed in `unchanged`, with why in `message`. A step whose
19
+ * component already held the value isn't listed.
20
+ *
21
+ * @example
22
+ * const result = await actAndCheck(agent, { steps: [{ ref: "Plan", action: "setValue", args: ["Enterprise"] }] })
23
+ * result.unchanged // [{ step: 0, ref: "c4", action: "setValue", message: 'setValue changed nothing on "Plan" (c4): …' }]
24
+ */
25
+ async function actAndCheck(agent, input) {
26
+ const result = await agent.act(input);
27
+ const entries = new Map(agent.snapshot().map((entry) => [entry.ref, entry]));
28
+ const unchanged = [];
29
+ for (const done of result.steps ?? []) {
30
+ const step = input.steps[done.step];
31
+ if (!step || done.result !== false || (done.changes?.length ?? 0) > 0) continue;
32
+ const set = /^set([A-Z])(.*)$/.exec(step.action);
33
+ const key = set ? set[1].toLowerCase() + set[2] : "value";
34
+ const entry = entries.get(done.ref);
35
+ const name = entry?.label ? `"${entry.label}" (${done.ref})` : done.ref;
36
+ if (!entry || !(set || step.action === "clear")) {
37
+ unchanged.push({
38
+ step: done.step,
39
+ ref: done.ref,
40
+ action: step.action,
41
+ message: `${step.action} changed nothing on ${name}.`
42
+ });
43
+ continue;
44
+ }
45
+ if (holds(entry, key, step)) continue;
46
+ const now = entry[key] === "[redacted]" ? `its ${key} is a secret, so it can't be read back` : `its ${key} is still ${JSON.stringify(entry[key])}`;
47
+ unchanged.push({
48
+ step: done.step,
49
+ ref: done.ref,
50
+ action: step.action,
51
+ message: `${step.action} changed nothing on ${name}: ${now}. The app refused the change, or doesn't take that value. Don't retry it: tell the person.`
52
+ });
53
+ }
54
+ return unchanged.length > 0 ? {
55
+ ...result,
56
+ unchanged
57
+ } : result;
58
+ }
59
+ /**
60
+ * Runs a model's tool call on the bridge and resolves with what to send back.
61
+ * The names and inputs are those of `agentTools`. `act` runs through
62
+ * `actAndCheck`, so its result says which steps the app refused. A name that
63
+ * isn't one of the tools resolves with `{ error }`, as a failed call does, so
64
+ * the model reads why and tries again.
65
+ *
66
+ * @example
67
+ * // with your model SDK's tool loop
68
+ * const tools = agentTools.map(({ name, description, inputSchema }) => ({ name, description, input_schema: inputSchema }))
69
+ * const result = await runAgentTool(agent, call.name, call.input)
70
+ */
71
+ async function runAgentTool(agent, name, input = {}) {
72
+ switch (name) {
73
+ case "snapshot": return agent.snapshot();
74
+ case "act": return actAndCheck(agent, input);
75
+ case "query": return agent.query(input);
76
+ default: return { error: `No tool "${name}". The tools are snapshot, act and query.` };
77
+ }
78
+ }
79
+ export { actAndCheck, runAgentTool };
@@ -0,0 +1,5 @@
1
+ export * from "@ui-sdk/core/agent";
2
+ export * from "@ui-sdk/core/history";
3
+ import * as import__ui_sdk_core_agent from "@ui-sdk/core/agent";
4
+ import * as import__ui_sdk_core_history from "@ui-sdk/core/history";
5
+ export { import__ui_sdk_core_history as ui_sdk_d_exports };
@@ -0,0 +1,3 @@
1
+ import "../_virtual/_rolldown/runtime.js";
2
+ export * from "@ui-sdk/core/agent";
3
+ export * from "@ui-sdk/core/history";
@@ -0,0 +1,2 @@
1
+ import { CanvasRect, ConnectDraft, ConnectMessage, ConnectOptions, ConnectReason, Viewport, ViewportOptions, ViewportReason, connectMessage, createConnect, createViewport } from "./ui-sdk.js";
2
+ export { type CanvasRect, type ConnectDraft, type ConnectMessage, type ConnectOptions, type ConnectReason, type Viewport, type ViewportOptions, type ViewportReason, connectMessage, createConnect, createViewport };
@@ -0,0 +1 @@
1
+ export { connectMessage, createConnect, createViewport } from "./ui-sdk.js";
@@ -0,0 +1,2 @@
1
+ import { CanvasRect, ConnectDraft, ConnectMessage, ConnectOptions, ConnectReason, Viewport, ViewportOptions, ViewportReason, connectMessage, createConnect, createViewport } from "@ui-sdk/core";
2
+ export { type CanvasRect, type ConnectDraft, type ConnectMessage, type ConnectOptions, type ConnectReason, type Viewport, type ViewportOptions, type ViewportReason, connectMessage, createConnect, createViewport };
@@ -0,0 +1 @@
1
+ export { connectMessage, createConnect, createViewport } from "@ui-sdk/core";
@@ -0,0 +1,2 @@
1
+ import { AutoScrollOptions, BindDragOptions, DragPreview, PointerSample, Reorder, ReorderDraft, ReorderMessage, ReorderOptions, ReorderOrientation, ReorderReason, Transfer, TransferDraft, TransferLists, TransferMessage, TransferOptions, TransferReason, TreePlace, TreeReorder, TreeReorderDraft, TreeReorderMessage, TreeReorderOptions, TreeReorderReason, TreeReorderRow, bindDrag, bindDragPreview, createAutoScroll, createReorder, createTransfer, createTreeReorder, dragThreshold, reorderMessage, subtreeEnd, transferMessage, treeReorderMessage } from "./ui-sdk.js";
2
+ export { type AutoScrollOptions, type BindDragOptions, type DragPreview, type PointerSample, type Reorder, type ReorderDraft, type ReorderMessage, type ReorderOptions, type ReorderOrientation, type ReorderReason, type Transfer, type TransferDraft, type TransferLists, type TransferMessage, type TransferOptions, type TransferReason, type TreePlace, type TreeReorder, type TreeReorderDraft, type TreeReorderMessage, type TreeReorderOptions, type TreeReorderReason, type TreeReorderRow, bindDrag, bindDragPreview, createAutoScroll, createReorder, createTransfer, createTreeReorder, dragThreshold, reorderMessage, subtreeEnd, transferMessage, treeReorderMessage };