@adea-ai/ui 0.140.0 → 0.142.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 (455) hide show
  1. package/dist/components/composites/appearance-editor/appearance-editor.js +2 -2
  2. package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
  3. package/dist/components/composites/catalog-browser/catalog-browser-group.js +1 -1
  4. package/dist/components/composites/chain-of-thought/chain-of-thought.d.ts +56 -0
  5. package/dist/components/composites/chain-of-thought/chain-of-thought.d.ts.map +1 -0
  6. package/dist/components/composites/chain-of-thought/chain-of-thought.js +117 -0
  7. package/dist/components/composites/chain-of-thought/chain-of-thought.js.map +1 -0
  8. package/dist/components/composites/chain-of-thought/index.d.ts +2 -0
  9. package/dist/components/composites/chain-of-thought/index.d.ts.map +1 -0
  10. package/dist/components/composites/chain-of-thought/index.js +2 -0
  11. package/dist/components/composites/chat/chat.d.ts +67 -0
  12. package/dist/components/composites/chat/chat.d.ts.map +1 -0
  13. package/dist/components/composites/chat/chat.js +179 -0
  14. package/dist/components/composites/chat/chat.js.map +1 -0
  15. package/dist/components/composites/chat/index.d.ts +2 -0
  16. package/dist/components/composites/chat/index.d.ts.map +1 -0
  17. package/dist/components/composites/chat/index.js +2 -0
  18. package/dist/components/composites/checkpoint/checkpoint-model.d.ts +34 -0
  19. package/dist/components/composites/checkpoint/checkpoint-model.d.ts.map +1 -0
  20. package/dist/components/composites/checkpoint/checkpoint-model.js +48 -0
  21. package/dist/components/composites/checkpoint/checkpoint-model.js.map +1 -0
  22. package/dist/components/composites/checkpoint/checkpoint.d.ts +48 -0
  23. package/dist/components/composites/checkpoint/checkpoint.d.ts.map +1 -0
  24. package/dist/components/composites/checkpoint/checkpoint.js +160 -0
  25. package/dist/components/composites/checkpoint/checkpoint.js.map +1 -0
  26. package/dist/components/composites/checkpoint/index.d.ts +3 -0
  27. package/dist/components/composites/checkpoint/index.d.ts.map +1 -0
  28. package/dist/components/composites/checkpoint/index.js +3 -0
  29. package/dist/components/composites/confirmation/confirmation-model.d.ts +45 -0
  30. package/dist/components/composites/confirmation/confirmation-model.d.ts.map +1 -0
  31. package/dist/components/composites/confirmation/confirmation-model.js +51 -0
  32. package/dist/components/composites/confirmation/confirmation-model.js.map +1 -0
  33. package/dist/components/composites/confirmation/confirmation.d.ts +72 -0
  34. package/dist/components/composites/confirmation/confirmation.d.ts.map +1 -0
  35. package/dist/components/composites/confirmation/confirmation.js +300 -0
  36. package/dist/components/composites/confirmation/confirmation.js.map +1 -0
  37. package/dist/components/composites/confirmation/index.d.ts +3 -0
  38. package/dist/components/composites/confirmation/index.d.ts.map +1 -0
  39. package/dist/components/composites/confirmation/index.js +3 -0
  40. package/dist/components/composites/context/context-model.d.ts +69 -0
  41. package/dist/components/composites/context/context-model.d.ts.map +1 -0
  42. package/dist/components/composites/context/context-model.js +122 -0
  43. package/dist/components/composites/context/context-model.js.map +1 -0
  44. package/dist/components/composites/context/context.d.ts +38 -0
  45. package/dist/components/composites/context/context.d.ts.map +1 -0
  46. package/dist/components/composites/context/context.js +234 -0
  47. package/dist/components/composites/context/context.js.map +1 -0
  48. package/dist/components/composites/context/index.d.ts +3 -0
  49. package/dist/components/composites/context/index.d.ts.map +1 -0
  50. package/dist/components/composites/context/index.js +3 -0
  51. package/dist/components/composites/file-tree/build-file-tree.d.ts +138 -0
  52. package/dist/components/composites/file-tree/build-file-tree.d.ts.map +1 -0
  53. package/dist/components/composites/file-tree/build-file-tree.js +325 -0
  54. package/dist/components/composites/file-tree/build-file-tree.js.map +1 -0
  55. package/dist/components/composites/file-tree/file-tree.d.ts +74 -0
  56. package/dist/components/composites/file-tree/file-tree.d.ts.map +1 -0
  57. package/dist/components/composites/file-tree/file-tree.js +389 -0
  58. package/dist/components/composites/file-tree/file-tree.js.map +1 -0
  59. package/dist/components/composites/file-tree/index.d.ts +3 -0
  60. package/dist/components/composites/file-tree/index.d.ts.map +1 -0
  61. package/dist/components/composites/file-tree/index.js +3 -0
  62. package/dist/components/composites/inline-citation/citation.d.ts +37 -0
  63. package/dist/components/composites/inline-citation/citation.d.ts.map +1 -0
  64. package/dist/components/composites/inline-citation/citation.js +52 -0
  65. package/dist/components/composites/inline-citation/citation.js.map +1 -0
  66. package/dist/components/composites/inline-citation/index.d.ts +3 -0
  67. package/dist/components/composites/inline-citation/index.d.ts.map +1 -0
  68. package/dist/components/composites/inline-citation/index.js +3 -0
  69. package/dist/components/composites/inline-citation/inline-citation.d.ts +64 -0
  70. package/dist/components/composites/inline-citation/inline-citation.d.ts.map +1 -0
  71. package/dist/components/composites/inline-citation/inline-citation.js +272 -0
  72. package/dist/components/composites/inline-citation/inline-citation.js.map +1 -0
  73. package/dist/components/composites/message-scroller/index.d.ts +3 -0
  74. package/dist/components/composites/message-scroller/index.d.ts.map +1 -0
  75. package/dist/components/composites/message-scroller/index.js +3 -0
  76. package/dist/components/composites/message-scroller/message-scroller.d.ts +55 -0
  77. package/dist/components/composites/message-scroller/message-scroller.d.ts.map +1 -0
  78. package/dist/components/composites/message-scroller/message-scroller.js +201 -0
  79. package/dist/components/composites/message-scroller/message-scroller.js.map +1 -0
  80. package/dist/components/composites/message-scroller/scroll-anchor.d.ts +66 -0
  81. package/dist/components/composites/message-scroller/scroll-anchor.d.ts.map +1 -0
  82. package/dist/components/composites/message-scroller/scroll-anchor.js +122 -0
  83. package/dist/components/composites/message-scroller/scroll-anchor.js.map +1 -0
  84. package/dist/components/composites/model-selector/index.d.ts +3 -0
  85. package/dist/components/composites/model-selector/index.d.ts.map +1 -0
  86. package/dist/components/composites/model-selector/index.js +3 -0
  87. package/dist/components/composites/model-selector/model-selector.d.ts +55 -0
  88. package/dist/components/composites/model-selector/model-selector.d.ts.map +1 -0
  89. package/dist/components/composites/model-selector/model-selector.js +490 -0
  90. package/dist/components/composites/model-selector/model-selector.js.map +1 -0
  91. package/dist/components/composites/model-selector/models.d.ts +51 -0
  92. package/dist/components/composites/model-selector/models.d.ts.map +1 -0
  93. package/dist/components/composites/model-selector/models.js +71 -0
  94. package/dist/components/composites/model-selector/models.js.map +1 -0
  95. package/dist/components/composites/plan/index.d.ts +2 -0
  96. package/dist/components/composites/plan/index.d.ts.map +1 -0
  97. package/dist/components/composites/plan/index.js +2 -0
  98. package/dist/components/composites/plan/plan.d.ts +61 -0
  99. package/dist/components/composites/plan/plan.d.ts.map +1 -0
  100. package/dist/components/composites/plan/plan.js +130 -0
  101. package/dist/components/composites/plan/plan.js.map +1 -0
  102. package/dist/components/composites/queue/index.d.ts +2 -0
  103. package/dist/components/composites/queue/index.d.ts.map +1 -0
  104. package/dist/components/composites/queue/index.js +2 -0
  105. package/dist/components/composites/queue/queue.d.ts +77 -0
  106. package/dist/components/composites/queue/queue.d.ts.map +1 -0
  107. package/dist/components/composites/queue/queue.js +271 -0
  108. package/dist/components/composites/queue/queue.js.map +1 -0
  109. package/dist/components/composites/reasoning/index.d.ts +2 -0
  110. package/dist/components/composites/reasoning/index.d.ts.map +1 -0
  111. package/dist/components/composites/reasoning/index.js +2 -0
  112. package/dist/components/composites/reasoning/reasoning.d.ts +62 -0
  113. package/dist/components/composites/reasoning/reasoning.d.ts.map +1 -0
  114. package/dist/components/composites/reasoning/reasoning.js +156 -0
  115. package/dist/components/composites/reasoning/reasoning.js.map +1 -0
  116. package/dist/components/composites/sources/index.d.ts +3 -0
  117. package/dist/components/composites/sources/index.d.ts.map +1 -0
  118. package/dist/components/composites/sources/index.js +3 -0
  119. package/dist/components/composites/sources/source.d.ts +46 -0
  120. package/dist/components/composites/sources/source.d.ts.map +1 -0
  121. package/dist/components/composites/sources/source.js +74 -0
  122. package/dist/components/composites/sources/source.js.map +1 -0
  123. package/dist/components/composites/sources/sources.d.ts +45 -0
  124. package/dist/components/composites/sources/sources.d.ts.map +1 -0
  125. package/dist/components/composites/sources/sources.js +175 -0
  126. package/dist/components/composites/sources/sources.js.map +1 -0
  127. package/dist/components/composites/stack-trace/index.d.ts +3 -0
  128. package/dist/components/composites/stack-trace/index.d.ts.map +1 -0
  129. package/dist/components/composites/stack-trace/index.js +3 -0
  130. package/dist/components/composites/stack-trace/parse-stack-trace.d.ts +118 -0
  131. package/dist/components/composites/stack-trace/parse-stack-trace.d.ts.map +1 -0
  132. package/dist/components/composites/stack-trace/parse-stack-trace.js +376 -0
  133. package/dist/components/composites/stack-trace/parse-stack-trace.js.map +1 -0
  134. package/dist/components/composites/stack-trace/stack-trace.d.ts +63 -0
  135. package/dist/components/composites/stack-trace/stack-trace.d.ts.map +1 -0
  136. package/dist/components/composites/stack-trace/stack-trace.js +491 -0
  137. package/dist/components/composites/stack-trace/stack-trace.js.map +1 -0
  138. package/dist/components/composites/subagent/index.d.ts +2 -0
  139. package/dist/components/composites/subagent/index.d.ts.map +1 -0
  140. package/dist/components/composites/subagent/index.js +2 -0
  141. package/dist/components/composites/subagent/subagent.d.ts +55 -0
  142. package/dist/components/composites/subagent/subagent.d.ts.map +1 -0
  143. package/dist/components/composites/subagent/subagent.js +138 -0
  144. package/dist/components/composites/subagent/subagent.js.map +1 -0
  145. package/dist/components/composites/suggestion/index.d.ts +2 -0
  146. package/dist/components/composites/suggestion/index.d.ts.map +1 -0
  147. package/dist/components/composites/suggestion/index.js +2 -0
  148. package/dist/components/composites/suggestion/suggestion.d.ts +37 -0
  149. package/dist/components/composites/suggestion/suggestion.d.ts.map +1 -0
  150. package/dist/components/composites/suggestion/suggestion.js +100 -0
  151. package/dist/components/composites/suggestion/suggestion.js.map +1 -0
  152. package/dist/components/composites/task/index.d.ts +2 -0
  153. package/dist/components/composites/task/index.d.ts.map +1 -0
  154. package/dist/components/composites/task/index.js +2 -0
  155. package/dist/components/composites/task/task.d.ts +96 -0
  156. package/dist/components/composites/task/task.d.ts.map +1 -0
  157. package/dist/components/composites/task/task.js +311 -0
  158. package/dist/components/composites/task/task.js.map +1 -0
  159. package/dist/components/composites/terminal/ansi.d.ts +101 -0
  160. package/dist/components/composites/terminal/ansi.d.ts.map +1 -0
  161. package/dist/components/composites/terminal/ansi.js +544 -0
  162. package/dist/components/composites/terminal/ansi.js.map +1 -0
  163. package/dist/components/composites/terminal/index.d.ts +4 -0
  164. package/dist/components/composites/terminal/index.d.ts.map +1 -0
  165. package/dist/components/composites/terminal/index.js +4 -0
  166. package/dist/components/composites/terminal/terminal-model.d.ts +63 -0
  167. package/dist/components/composites/terminal/terminal-model.d.ts.map +1 -0
  168. package/dist/components/composites/terminal/terminal-model.js +69 -0
  169. package/dist/components/composites/terminal/terminal-model.js.map +1 -0
  170. package/dist/components/composites/terminal/terminal.d.ts +88 -0
  171. package/dist/components/composites/terminal/terminal.d.ts.map +1 -0
  172. package/dist/components/composites/terminal/terminal.js +500 -0
  173. package/dist/components/composites/terminal/terminal.js.map +1 -0
  174. package/dist/components/composites/test-results/index.d.ts +3 -0
  175. package/dist/components/composites/test-results/index.d.ts.map +1 -0
  176. package/dist/components/composites/test-results/index.js +3 -0
  177. package/dist/components/composites/test-results/test-results-model.d.ts +154 -0
  178. package/dist/components/composites/test-results/test-results-model.d.ts.map +1 -0
  179. package/dist/components/composites/test-results/test-results-model.js +252 -0
  180. package/dist/components/composites/test-results/test-results-model.js.map +1 -0
  181. package/dist/components/composites/test-results/test-results.d.ts +60 -0
  182. package/dist/components/composites/test-results/test-results.d.ts.map +1 -0
  183. package/dist/components/composites/test-results/test-results.js +631 -0
  184. package/dist/components/composites/test-results/test-results.js.map +1 -0
  185. package/dist/components/composites/tool/format-tool-value.d.ts +37 -0
  186. package/dist/components/composites/tool/format-tool-value.d.ts.map +1 -0
  187. package/dist/components/composites/tool/format-tool-value.js +135 -0
  188. package/dist/components/composites/tool/format-tool-value.js.map +1 -0
  189. package/dist/components/composites/tool/index.d.ts +3 -0
  190. package/dist/components/composites/tool/index.d.ts.map +1 -0
  191. package/dist/components/composites/tool/index.js +3 -0
  192. package/dist/components/composites/tool/tool.d.ts +69 -0
  193. package/dist/components/composites/tool/tool.d.ts.map +1 -0
  194. package/dist/components/composites/tool/tool.js +214 -0
  195. package/dist/components/composites/tool/tool.js.map +1 -0
  196. package/dist/components/composites/update-dialog/update-dialog.js +1 -1
  197. package/dist/components/conversation/conversation-surface.d.ts +7 -0
  198. package/dist/components/conversation/conversation-surface.d.ts.map +1 -1
  199. package/dist/components/conversation/conversation-surface.js +2 -0
  200. package/dist/components/conversation/conversation-surface.js.map +1 -1
  201. package/dist/components/conversation/scroll-follow-core.d.ts +24 -0
  202. package/dist/components/conversation/scroll-follow-core.d.ts.map +1 -1
  203. package/dist/components/conversation/scroll-follow-core.js +23 -1
  204. package/dist/components/conversation/scroll-follow-core.js.map +1 -1
  205. package/dist/components/conversation/scroll-follow.d.ts +3 -0
  206. package/dist/components/conversation/scroll-follow.d.ts.map +1 -1
  207. package/dist/components/conversation/scroll-follow.js +80 -1
  208. package/dist/components/conversation/scroll-follow.js.map +1 -1
  209. package/dist/components/ui/attachment/attachment.d.ts +58 -0
  210. package/dist/components/ui/attachment/attachment.d.ts.map +1 -0
  211. package/dist/components/ui/attachment/attachment.js +279 -0
  212. package/dist/components/ui/attachment/attachment.js.map +1 -0
  213. package/dist/components/ui/attachment/index.d.ts +2 -0
  214. package/dist/components/ui/attachment/index.d.ts.map +1 -0
  215. package/dist/components/ui/attachment/index.js +2 -0
  216. package/dist/components/ui/badge/badge.d.ts +1 -1
  217. package/dist/components/ui/bubble/bubble.d.ts +33 -0
  218. package/dist/components/ui/bubble/bubble.d.ts.map +1 -0
  219. package/dist/components/ui/bubble/bubble.js +95 -0
  220. package/dist/components/ui/bubble/bubble.js.map +1 -0
  221. package/dist/components/ui/bubble/index.d.ts +2 -0
  222. package/dist/components/ui/bubble/index.d.ts.map +1 -0
  223. package/dist/components/ui/bubble/index.js +2 -0
  224. package/dist/components/ui/button/button.d.ts +1 -1
  225. package/dist/components/ui/code-block/code-block.d.ts +56 -3
  226. package/dist/components/ui/code-block/code-block.d.ts.map +1 -1
  227. package/dist/components/ui/code-block/code-block.js +231 -50
  228. package/dist/components/ui/code-block/code-block.js.map +1 -1
  229. package/dist/components/ui/code-block/index.d.ts +1 -1
  230. package/dist/components/ui/code-block/index.d.ts.map +1 -1
  231. package/dist/components/ui/code-block/index.js +2 -2
  232. package/dist/components/ui/field/number-field.d.ts +21 -4
  233. package/dist/components/ui/field/number-field.d.ts.map +1 -1
  234. package/dist/components/ui/field/number-field.js +22 -11
  235. package/dist/components/ui/field/number-field.js.map +1 -1
  236. package/dist/components/ui/marker/index.d.ts +2 -0
  237. package/dist/components/ui/marker/index.d.ts.map +1 -0
  238. package/dist/components/ui/marker/index.js +2 -0
  239. package/dist/components/ui/marker/marker.d.ts +35 -0
  240. package/dist/components/ui/marker/marker.d.ts.map +1 -0
  241. package/dist/components/ui/marker/marker.js +123 -0
  242. package/dist/components/ui/marker/marker.js.map +1 -0
  243. package/dist/components/ui/message/cite-ranges.d.ts +42 -0
  244. package/dist/components/ui/message/cite-ranges.d.ts.map +1 -0
  245. package/dist/components/ui/message/cite-ranges.js +105 -0
  246. package/dist/components/ui/message/cite-ranges.js.map +1 -0
  247. package/dist/components/ui/message/index.d.ts +4 -0
  248. package/dist/components/ui/message/index.d.ts.map +1 -0
  249. package/dist/components/ui/message/index.js +4 -0
  250. package/dist/components/ui/message/message.d.ts +95 -0
  251. package/dist/components/ui/message/message.d.ts.map +1 -0
  252. package/dist/components/ui/message/message.js +443 -0
  253. package/dist/components/ui/message/message.js.map +1 -0
  254. package/dist/components/ui/message/parse-message-text.d.ts +93 -0
  255. package/dist/components/ui/message/parse-message-text.d.ts.map +1 -0
  256. package/dist/components/ui/message/parse-message-text.js +365 -0
  257. package/dist/components/ui/message/parse-message-text.js.map +1 -0
  258. package/dist/components/ui/questionnaire/index.d.ts +2 -0
  259. package/dist/components/ui/questionnaire/index.d.ts.map +1 -0
  260. package/dist/components/ui/questionnaire/index.js +2 -0
  261. package/dist/components/ui/questionnaire/questionnaire.d.ts +83 -0
  262. package/dist/components/ui/questionnaire/questionnaire.d.ts.map +1 -0
  263. package/dist/components/ui/questionnaire/questionnaire.js +470 -0
  264. package/dist/components/ui/questionnaire/questionnaire.js.map +1 -0
  265. package/dist/components/ui/status-chip/status-chip.d.ts +1 -1
  266. package/dist/components/ui/switch/switch.js +11 -11
  267. package/dist/components/ui/switch/switch.js.map +1 -1
  268. package/dist/components/ui/trace/index.d.ts +2 -0
  269. package/dist/components/ui/trace/index.d.ts.map +1 -0
  270. package/dist/components/ui/trace/index.js +2 -0
  271. package/dist/components/ui/trace/trace.d.ts +72 -0
  272. package/dist/components/ui/trace/trace.d.ts.map +1 -0
  273. package/dist/components/ui/trace/trace.js +340 -0
  274. package/dist/components/ui/trace/trace.js.map +1 -0
  275. package/dist/index.d.ts +26 -0
  276. package/dist/index.d.ts.map +1 -1
  277. package/dist/index.js +46 -5
  278. package/dist/r/attachment.json +25 -0
  279. package/dist/r/bubble.json +22 -0
  280. package/dist/r/chain-of-thought.json +26 -0
  281. package/dist/r/chat.json +24 -0
  282. package/dist/r/checkpoint.json +35 -0
  283. package/dist/r/confirmation.json +34 -0
  284. package/dist/r/context.json +33 -0
  285. package/dist/r/file-tree.json +32 -0
  286. package/dist/r/inline-citation.json +35 -0
  287. package/dist/r/marker.json +22 -0
  288. package/dist/r/message-scroller.json +31 -0
  289. package/dist/r/message.json +33 -0
  290. package/dist/r/model-selector.json +34 -0
  291. package/dist/r/plan.json +26 -0
  292. package/dist/r/questionnaire.json +28 -0
  293. package/dist/r/queue.json +26 -0
  294. package/dist/r/reasoning.json +26 -0
  295. package/dist/r/registry.json +811 -52
  296. package/dist/r/sources.json +32 -0
  297. package/dist/r/src/components/composites/chain-of-thought/chain-of-thought.tsx +141 -0
  298. package/dist/r/src/components/composites/chain-of-thought/index.ts +11 -0
  299. package/dist/r/src/components/composites/chat/chat.tsx +190 -0
  300. package/dist/r/src/components/composites/chat/index.ts +11 -0
  301. package/dist/r/src/components/composites/checkpoint/checkpoint-model.ts +71 -0
  302. package/dist/r/src/components/composites/checkpoint/checkpoint.tsx +214 -0
  303. package/dist/r/src/components/composites/checkpoint/index.ts +8 -0
  304. package/dist/r/src/components/composites/confirmation/confirmation-model.ts +83 -0
  305. package/dist/r/src/components/composites/confirmation/confirmation.tsx +311 -0
  306. package/dist/r/src/components/composites/confirmation/index.ts +9 -0
  307. package/dist/r/src/components/composites/context/context-model.ts +168 -0
  308. package/dist/r/src/components/composites/context/context.tsx +187 -0
  309. package/dist/r/src/components/composites/context/index.ts +18 -0
  310. package/dist/r/src/components/composites/file-tree/build-file-tree.ts +456 -0
  311. package/dist/r/src/components/composites/file-tree/file-tree.tsx +405 -0
  312. package/dist/r/src/components/composites/file-tree/index.ts +25 -0
  313. package/dist/r/src/components/composites/inline-citation/citation.ts +78 -0
  314. package/dist/r/src/components/composites/inline-citation/index.ts +9 -0
  315. package/dist/r/src/components/composites/inline-citation/inline-citation.tsx +285 -0
  316. package/dist/r/src/components/composites/message-scroller/index.ts +2 -0
  317. package/dist/r/src/components/composites/message-scroller/message-scroller.tsx +301 -0
  318. package/dist/r/src/components/composites/message-scroller/scroll-anchor.ts +170 -0
  319. package/dist/r/src/components/composites/model-selector/index.ts +14 -0
  320. package/dist/r/src/components/composites/model-selector/model-selector.tsx +420 -0
  321. package/dist/r/src/components/composites/model-selector/models.ts +103 -0
  322. package/dist/r/src/components/composites/plan/index.ts +1 -0
  323. package/dist/r/src/components/composites/plan/plan.tsx +155 -0
  324. package/dist/r/src/components/composites/queue/index.ts +10 -0
  325. package/dist/r/src/components/composites/queue/queue.tsx +264 -0
  326. package/dist/r/src/components/composites/reasoning/index.ts +1 -0
  327. package/dist/r/src/components/composites/reasoning/reasoning.tsx +176 -0
  328. package/dist/r/src/components/composites/sources/index.ts +11 -0
  329. package/dist/r/src/components/composites/sources/source.ts +116 -0
  330. package/dist/r/src/components/composites/sources/sources.tsx +163 -0
  331. package/dist/r/src/components/composites/stack-trace/index.ts +19 -0
  332. package/dist/r/src/components/composites/stack-trace/parse-stack-trace.ts +507 -0
  333. package/dist/r/src/components/composites/stack-trace/stack-trace.tsx +395 -0
  334. package/dist/r/src/components/composites/subagent/index.ts +1 -0
  335. package/dist/r/src/components/composites/subagent/subagent.tsx +159 -0
  336. package/dist/r/src/components/composites/suggestion/index.ts +1 -0
  337. package/dist/r/src/components/composites/suggestion/suggestion.tsx +140 -0
  338. package/dist/r/src/components/composites/task/index.ts +14 -0
  339. package/dist/r/src/components/composites/task/task.tsx +317 -0
  340. package/dist/r/src/components/composites/terminal/ansi.ts +674 -0
  341. package/dist/r/src/components/composites/terminal/index.ts +20 -0
  342. package/dist/r/src/components/composites/terminal/terminal-model.ts +111 -0
  343. package/dist/r/src/components/composites/terminal/terminal.tsx +574 -0
  344. package/dist/r/src/components/composites/test-results/index.ts +20 -0
  345. package/dist/r/src/components/composites/test-results/test-results-model.ts +368 -0
  346. package/dist/r/src/components/composites/test-results/test-results.tsx +586 -0
  347. package/dist/r/src/components/composites/tool/format-tool-value.ts +221 -0
  348. package/dist/r/src/components/composites/tool/index.ts +2 -0
  349. package/dist/r/src/components/composites/tool/tool.tsx +228 -0
  350. package/dist/r/src/components/conversation/conversation-surface.tsx +9 -0
  351. package/dist/r/src/components/conversation/scroll-follow-core.ts +31 -0
  352. package/dist/r/src/components/conversation/scroll-follow.ts +92 -0
  353. package/dist/r/src/components/ui/attachment/attachment.tsx +282 -0
  354. package/dist/r/src/components/ui/attachment/index.ts +10 -0
  355. package/dist/r/src/components/ui/bubble/bubble.tsx +86 -0
  356. package/dist/r/src/components/ui/bubble/index.ts +1 -0
  357. package/dist/r/src/components/ui/code-block/code-block.tsx +256 -26
  358. package/dist/r/src/components/ui/code-block/index.ts +9 -1
  359. package/dist/r/src/components/ui/field/number-field.tsx +51 -14
  360. package/dist/r/src/components/ui/marker/index.ts +1 -0
  361. package/dist/r/src/components/ui/marker/marker.tsx +90 -0
  362. package/dist/r/src/components/ui/message/cite-ranges.ts +144 -0
  363. package/dist/r/src/components/ui/message/index.ts +23 -0
  364. package/dist/r/src/components/ui/message/message.tsx +434 -0
  365. package/dist/r/src/components/ui/message/parse-message-text.ts +450 -0
  366. package/dist/r/src/components/ui/questionnaire/index.ts +10 -0
  367. package/dist/r/src/components/ui/questionnaire/questionnaire.tsx +446 -0
  368. package/dist/r/src/components/ui/trace/index.ts +9 -0
  369. package/dist/r/src/components/ui/trace/trace.tsx +334 -0
  370. package/dist/r/src/styles/base.css +34 -0
  371. package/dist/r/stack-trace.json +32 -0
  372. package/dist/r/subagent.json +27 -0
  373. package/dist/r/suggestion.json +24 -0
  374. package/dist/r/task.json +28 -0
  375. package/dist/r/terminal.json +35 -0
  376. package/dist/r/test-results.json +33 -0
  377. package/dist/r/tool.json +31 -0
  378. package/dist/r/trace.json +25 -0
  379. package/package.json +6 -3
  380. package/registry.json +811 -52
  381. package/src/components/composites/chain-of-thought/chain-of-thought.tsx +141 -0
  382. package/src/components/composites/chain-of-thought/index.ts +11 -0
  383. package/src/components/composites/chat/chat.tsx +190 -0
  384. package/src/components/composites/chat/index.ts +11 -0
  385. package/src/components/composites/checkpoint/checkpoint-model.ts +71 -0
  386. package/src/components/composites/checkpoint/checkpoint.tsx +214 -0
  387. package/src/components/composites/checkpoint/index.ts +8 -0
  388. package/src/components/composites/confirmation/confirmation-model.ts +83 -0
  389. package/src/components/composites/confirmation/confirmation.tsx +311 -0
  390. package/src/components/composites/confirmation/index.ts +9 -0
  391. package/src/components/composites/context/context-model.ts +168 -0
  392. package/src/components/composites/context/context.tsx +187 -0
  393. package/src/components/composites/context/index.ts +18 -0
  394. package/src/components/composites/file-tree/build-file-tree.ts +456 -0
  395. package/src/components/composites/file-tree/file-tree.tsx +405 -0
  396. package/src/components/composites/file-tree/index.ts +25 -0
  397. package/src/components/composites/inline-citation/citation.ts +78 -0
  398. package/src/components/composites/inline-citation/index.ts +9 -0
  399. package/src/components/composites/inline-citation/inline-citation.tsx +285 -0
  400. package/src/components/composites/message-scroller/index.ts +2 -0
  401. package/src/components/composites/message-scroller/message-scroller.tsx +301 -0
  402. package/src/components/composites/message-scroller/scroll-anchor.ts +170 -0
  403. package/src/components/composites/model-selector/index.ts +14 -0
  404. package/src/components/composites/model-selector/model-selector.tsx +420 -0
  405. package/src/components/composites/model-selector/models.ts +103 -0
  406. package/src/components/composites/plan/index.ts +1 -0
  407. package/src/components/composites/plan/plan.tsx +155 -0
  408. package/src/components/composites/queue/index.ts +10 -0
  409. package/src/components/composites/queue/queue.tsx +264 -0
  410. package/src/components/composites/reasoning/index.ts +1 -0
  411. package/src/components/composites/reasoning/reasoning.tsx +176 -0
  412. package/src/components/composites/sources/index.ts +11 -0
  413. package/src/components/composites/sources/source.ts +116 -0
  414. package/src/components/composites/sources/sources.tsx +163 -0
  415. package/src/components/composites/stack-trace/index.ts +19 -0
  416. package/src/components/composites/stack-trace/parse-stack-trace.ts +507 -0
  417. package/src/components/composites/stack-trace/stack-trace.tsx +395 -0
  418. package/src/components/composites/subagent/index.ts +1 -0
  419. package/src/components/composites/subagent/subagent.tsx +159 -0
  420. package/src/components/composites/suggestion/index.ts +1 -0
  421. package/src/components/composites/suggestion/suggestion.tsx +140 -0
  422. package/src/components/composites/task/index.ts +14 -0
  423. package/src/components/composites/task/task.tsx +317 -0
  424. package/src/components/composites/terminal/ansi.ts +674 -0
  425. package/src/components/composites/terminal/index.ts +20 -0
  426. package/src/components/composites/terminal/terminal-model.ts +111 -0
  427. package/src/components/composites/terminal/terminal.tsx +574 -0
  428. package/src/components/composites/test-results/index.ts +20 -0
  429. package/src/components/composites/test-results/test-results-model.ts +368 -0
  430. package/src/components/composites/test-results/test-results.tsx +586 -0
  431. package/src/components/composites/tool/format-tool-value.ts +221 -0
  432. package/src/components/composites/tool/index.ts +2 -0
  433. package/src/components/composites/tool/tool.tsx +228 -0
  434. package/src/components/conversation/conversation-surface.tsx +9 -0
  435. package/src/components/conversation/scroll-follow-core.ts +31 -0
  436. package/src/components/conversation/scroll-follow.ts +92 -0
  437. package/src/components/ui/attachment/attachment.tsx +282 -0
  438. package/src/components/ui/attachment/index.ts +10 -0
  439. package/src/components/ui/bubble/bubble.tsx +86 -0
  440. package/src/components/ui/bubble/index.ts +1 -0
  441. package/src/components/ui/code-block/code-block.tsx +256 -26
  442. package/src/components/ui/code-block/index.ts +9 -1
  443. package/src/components/ui/field/number-field.tsx +51 -14
  444. package/src/components/ui/marker/index.ts +1 -0
  445. package/src/components/ui/marker/marker.tsx +90 -0
  446. package/src/components/ui/message/cite-ranges.ts +144 -0
  447. package/src/components/ui/message/index.ts +23 -0
  448. package/src/components/ui/message/message.tsx +434 -0
  449. package/src/components/ui/message/parse-message-text.ts +450 -0
  450. package/src/components/ui/questionnaire/index.ts +10 -0
  451. package/src/components/ui/questionnaire/questionnaire.tsx +446 -0
  452. package/src/components/ui/trace/index.ts +9 -0
  453. package/src/components/ui/trace/trace.tsx +334 -0
  454. package/src/index.ts +26 -0
  455. package/src/styles/base.css +34 -0
@@ -0,0 +1,154 @@
1
+ /**
2
+ * The test run's pure rules: what the listed tests add up to, how that compares
3
+ * with the counts the host reported, and how a duration is said.
4
+ *
5
+ * The one rule that shapes everything here is that a count is a claim. There are
6
+ * two honest sources for one — the host's own tally (`summary`), and the tests it
7
+ * chose to list — and they are allowed to disagree: a host may list only the
8
+ * failures, a runner may count tests it did not stream, a suite may have been cut
9
+ * short. So nothing is silently recomputed. A supplied count is shown as given; if
10
+ * the tests listed do not add up to it, the listed number is shown beside it; and
11
+ * when no summary was supplied, the counts that are shown are labelled as coming
12
+ * from the tests listed, not presented as the run's totals.
13
+ */
14
+ export type TestOutcome = 'passed' | 'failed' | 'skipped';
15
+ /** `running` and `pending` are states of a test that has no outcome yet; they are not counted. */
16
+ export type TestCaseStatus = TestOutcome | 'running' | 'pending';
17
+ export type TestCase = Readonly<{
18
+ /** Stable identity for keyed rendering. Defaults to the position. */
19
+ id?: string;
20
+ name: string;
21
+ /** Absent means the host did not say; the test is listed and nothing is claimed. */
22
+ status?: TestCaseStatus;
23
+ durationMs?: number;
24
+ /** The failure message, as text. */
25
+ message?: string;
26
+ /** A stack trace for `StackTrace` to read. */
27
+ stack?: string;
28
+ /** A unified diff of expected against actual for `DiffBlock`. */
29
+ diff?: string;
30
+ }>;
31
+ export type TestSuite = Readonly<{
32
+ id?: string;
33
+ name: string;
34
+ /** The file the suite lives in, shown as text. */
35
+ file?: string;
36
+ durationMs?: number;
37
+ tests?: readonly TestCase[];
38
+ suites?: readonly TestSuite[];
39
+ }>;
40
+ /** The host's own tally. Every field is optional; only supplied ones are shown. */
41
+ export type TestSummary = Readonly<{
42
+ passed?: number;
43
+ failed?: number;
44
+ skipped?: number;
45
+ total?: number;
46
+ durationMs?: number;
47
+ }>;
48
+ export type ListedCounts = Readonly<{
49
+ passed: number;
50
+ failed: number;
51
+ skipped: number;
52
+ running: number;
53
+ pending: number;
54
+ /** Tests listed with no status. */
55
+ unknown: number;
56
+ /** Every test listed, whatever its status. */
57
+ total: number;
58
+ }>;
59
+ /** Count the tests in a list of suites, at any depth. Iterative: suites come from a host. */
60
+ export declare function listedCounts(suites: readonly TestSuite[]): ListedCounts;
61
+ export type CountLine = Readonly<{
62
+ outcome: TestOutcome;
63
+ /** The number to show: the host's if it gave one, otherwise the listed one. */
64
+ count: number;
65
+ /** How many tests of this outcome are listed. */
66
+ listed: number;
67
+ /** The host gave a count and the list does not agree with it. */
68
+ differs: boolean;
69
+ }>;
70
+ export type RunCounts = Readonly<{
71
+ /** Whose numbers these are. `listed` must be labelled as such. */
72
+ basis: 'reported' | 'listed';
73
+ lines: readonly CountLine[];
74
+ /** The host's total, when supplied. */
75
+ reportedTotal?: number;
76
+ /** The reported total, when the host gave one and the list disagrees. */
77
+ totalNote?: Readonly<{
78
+ reported: number;
79
+ listed: number;
80
+ }>;
81
+ }>;
82
+ /**
83
+ * Decide which numbers to show.
84
+ *
85
+ * With a summary: exactly the counts it supplied, as given. `differs` is set
86
+ * when tests are listed at all and the listed number for that outcome is not the
87
+ * supplied one — a host that lists only failures will see "40 passed (0 listed)",
88
+ * which is true and tells the reader the list is partial. Without a summary: the
89
+ * outcomes that occur among the listed tests, with `basis: 'listed'`.
90
+ */
91
+ export declare function reconcileCounts(summary: TestSummary | undefined, listed: ListedCounts): RunCounts;
92
+ /** The words for one count: "38 passed", or "40 passed (38 listed)" when the list disagrees. */
93
+ export declare function describeCount(line: CountLine): string;
94
+ /**
95
+ * A duration. `short` is for a meta column ("120 ms", "3.4 s"); `long` is for a
96
+ * sentence ("120 milliseconds", "3.4 seconds", "2 minutes 5 seconds"). Anything
97
+ * that is not a finite non-negative number has no duration, so none is drawn.
98
+ */
99
+ export declare function formatDuration(ms: unknown, style?: 'short' | 'long'): string | undefined;
100
+ export type SuiteState = 'failed' | 'passed' | 'running' | undefined;
101
+ /**
102
+ * What a suite can say about itself from the tests listed in it. Any listed
103
+ * failure makes it `failed`; a listed test still running makes it `running`;
104
+ * `passed` needs at least one passed test and every listed test to be passed or
105
+ * skipped. Anything else — no tests, a test with no status — is silence.
106
+ */
107
+ export declare function suiteState(counts: ListedCounts): SuiteState;
108
+ /** A suite's key among its siblings: its id if it has one, otherwise its position. */
109
+ export declare function suiteKey(parent: string, suite: TestSuite, index: number): string;
110
+ export declare function testKey(parent: string, test: TestCase, index: number): string;
111
+ /** Distinguish repeated ids without tying a row to the object instance it renders. */
112
+ export declare function repeatedKey(key: string, occurrence: number): string;
113
+ /**
114
+ * A row's identity among its siblings only: the host id verbatim, or its
115
+ * position when it has none. The leading letter keeps the two apart, so an id
116
+ * that looks like a position never collides with one. A row's place in the tree
117
+ * is the list of these keys from the root, never one string that nests its
118
+ * parent's, so a key stays as long as its own id however deep the row sits.
119
+ */
120
+ export declare function siblingKey(item: Readonly<{
121
+ id?: string;
122
+ }>, index: number): string;
123
+ export type BoundedEntry<T> = Readonly<{
124
+ key: string;
125
+ item: T;
126
+ index: number;
127
+ }>;
128
+ /** Build keyed rows only for the currently visible prefix of a bounded list. */
129
+ export declare function boundedEntries<T>(items: readonly T[], visibleCount: number, itemKey: (item: T, index: number) => string): Readonly<{
130
+ entries: readonly BoundedEntry<T>[];
131
+ byKey: ReadonlyMap<string, BoundedEntry<T>>;
132
+ }>;
133
+ /** The key of the first failing test in reading order. */
134
+ export declare function firstFailureKey(suites: readonly TestSuite[]): string | undefined;
135
+ export type FirstFailureRenderPath = Readonly<{
136
+ /**
137
+ * The rendering key of each suite from the root through the suite containing
138
+ * the failure, one entry per level. A key is unique among its siblings, so
139
+ * a suite is on the path when its entry at its own depth is its key and its
140
+ * parent was on the path.
141
+ */
142
+ suites: readonly string[];
143
+ /** The failed test's rendering key among the tests of the last suite on the path. */
144
+ test: string;
145
+ }>;
146
+ /** True when both describe the same failure at the same place in the tree. */
147
+ export declare function sameFailure(left: FirstFailureRenderPath | undefined, right: FirstFailureRenderPath | undefined): boolean;
148
+ /**
149
+ * The first failure's unique rendering keys, including its ancestor suites. The
150
+ * work is linear in the suites visited and the path it returns is linear in the
151
+ * depth, so a long chain of nested suites costs no more than a wide list.
152
+ */
153
+ export declare function firstFailureRenderPath(suites: readonly TestSuite[]): FirstFailureRenderPath | undefined;
154
+ //# sourceMappingURL=test-results-model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-results-model.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/test-results/test-results-model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAA;AACzD,kGAAkG;AAClG,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,CAAA;AAEhE,MAAM,MAAM,QAAQ,GAAG,QAAQ,CAAC;IAC9B,qEAAqE;IACrE,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,oFAAoF;IACpF,MAAM,CAAC,EAAE,cAAc,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,oCAAoC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,iEA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: 0,
6
+ running: 0,
7
+ pending: 0,
8
+ unknown: 0,
9
+ total: 0
10
+ };
11
+ var KNOWN_STATUSES = /* @__PURE__ */ new Set([
12
+ "passed",
13
+ "failed",
14
+ "skipped",
15
+ "running",
16
+ "pending"
17
+ ]);
18
+ /** Count the tests in a list of suites, at any depth. Iterative: suites come from a host. */
19
+ function listedCounts(suites) {
20
+ const counts = { ...empty };
21
+ const stack = [...suites];
22
+ while (stack.length > 0) {
23
+ const suite = stack.pop();
24
+ for (const test of suite.tests ?? []) {
25
+ counts.total += 1;
26
+ if (test.status !== void 0 && KNOWN_STATUSES.has(test.status)) counts[test.status] += 1;
27
+ else counts.unknown += 1;
28
+ }
29
+ for (const child of suite.suites ?? []) stack.push(child);
30
+ }
31
+ return counts;
32
+ }
33
+ function validCount(value) {
34
+ return typeof value === "number" && Number.isInteger(value) && value >= 0;
35
+ }
36
+ var OUTCOMES = [
37
+ "failed",
38
+ "passed",
39
+ "skipped"
40
+ ];
41
+ /**
42
+ * Decide which numbers to show.
43
+ *
44
+ * With a summary: exactly the counts it supplied, as given. `differs` is set
45
+ * when tests are listed at all and the listed number for that outcome is not the
46
+ * supplied one — a host that lists only failures will see "40 passed (0 listed)",
47
+ * which is true and tells the reader the list is partial. Without a summary: the
48
+ * outcomes that occur among the listed tests, with `basis: 'listed'`.
49
+ */
50
+ function reconcileCounts(summary, listed) {
51
+ const supplied = OUTCOMES.filter((outcome) => validCount(summary?.[outcome]));
52
+ const hasTotal = validCount(summary?.total);
53
+ if (summary && (supplied.length > 0 || hasTotal)) {
54
+ const lines = supplied.map((outcome) => {
55
+ const count = summary[outcome];
56
+ return {
57
+ outcome,
58
+ count,
59
+ listed: listed[outcome],
60
+ differs: listed.total > 0 && listed[outcome] !== count
61
+ };
62
+ });
63
+ const totalNote = hasTotal && listed.total > 0 && summary.total !== listed.total ? {
64
+ reported: summary.total,
65
+ listed: listed.total
66
+ } : void 0;
67
+ return {
68
+ basis: "reported",
69
+ lines,
70
+ ...hasTotal && { reportedTotal: summary.total },
71
+ ...totalNote && { totalNote }
72
+ };
73
+ }
74
+ return {
75
+ basis: "listed",
76
+ lines: OUTCOMES.filter((outcome) => listed[outcome] > 0).map((outcome) => ({
77
+ outcome,
78
+ count: listed[outcome],
79
+ listed: listed[outcome],
80
+ differs: false
81
+ }))
82
+ };
83
+ }
84
+ /** The words for one count: "38 passed", or "40 passed (38 listed)" when the list disagrees. */
85
+ function describeCount(line) {
86
+ const base = `${line.count.toLocaleString()} ${line.outcome}`;
87
+ return line.differs ? `${base} (${line.listed.toLocaleString()} listed)` : base;
88
+ }
89
+ var plural = (n, one) => n === 1 ? one : `${one}s`;
90
+ /**
91
+ * A duration. `short` is for a meta column ("120 ms", "3.4 s"); `long` is for a
92
+ * sentence ("120 milliseconds", "3.4 seconds", "2 minutes 5 seconds"). Anything
93
+ * that is not a finite non-negative number has no duration, so none is drawn.
94
+ */
95
+ function formatDuration(ms, style = "short") {
96
+ if (typeof ms !== "number" || !Number.isFinite(ms) || ms < 0) return void 0;
97
+ if (ms > 0 && ms < 1) return style === "short" ? "<1 ms" : "less than 1 millisecond";
98
+ if (ms < 1e3) {
99
+ const whole = Math.round(ms);
100
+ return style === "short" ? `${whole} ms` : `${whole} ${plural(whole, "millisecond")}`;
101
+ }
102
+ if (ms < 6e4) {
103
+ const seconds = ms < 1e4 ? Math.round(ms / 100) / 10 : Math.round(ms / 1e3);
104
+ const text = Number.isInteger(seconds) ? String(seconds) : seconds.toFixed(1);
105
+ return style === "short" ? `${text} s` : `${text} ${seconds === 1 ? "second" : "seconds"}`;
106
+ }
107
+ const totalSeconds = Math.round(ms / 1e3);
108
+ const minutes = Math.floor(totalSeconds / 60);
109
+ const seconds = totalSeconds % 60;
110
+ if (style === "short") return seconds === 0 ? `${minutes} min` : `${minutes} min ${seconds} s`;
111
+ const m = `${minutes.toLocaleString()} ${plural(minutes, "minute")}`;
112
+ return seconds === 0 ? m : `${m} ${seconds} ${plural(seconds, "second")}`;
113
+ }
114
+ /**
115
+ * What a suite can say about itself from the tests listed in it. Any listed
116
+ * failure makes it `failed`; a listed test still running makes it `running`;
117
+ * `passed` needs at least one passed test and every listed test to be passed or
118
+ * skipped. Anything else — no tests, a test with no status — is silence.
119
+ */
120
+ function suiteState(counts) {
121
+ if (counts.failed > 0) return "failed";
122
+ if (counts.running > 0) return "running";
123
+ if (counts.passed > 0 && counts.pending === 0 && counts.unknown === 0) return "passed";
124
+ }
125
+ /** A suite's key among its siblings: its id if it has one, otherwise its position. */
126
+ function suiteKey(parent, suite, index) {
127
+ return `${parent}/${suite.id ?? `s${index}`}`;
128
+ }
129
+ function testKey(parent, test, index) {
130
+ return `${parent}:${test.id ?? `t${index}`}`;
131
+ }
132
+ /** Distinguish repeated ids without tying a row to the object instance it renders. */
133
+ function repeatedKey(key, occurrence) {
134
+ return JSON.stringify([key, occurrence]);
135
+ }
136
+ /**
137
+ * A row's identity among its siblings only: the host id verbatim, or its
138
+ * position when it has none. The leading letter keeps the two apart, so an id
139
+ * that looks like a position never collides with one. A row's place in the tree
140
+ * is the list of these keys from the root, never one string that nests its
141
+ * parent's, so a key stays as long as its own id however deep the row sits.
142
+ */
143
+ function siblingKey(item, index) {
144
+ return item.id === void 0 ? `p${index}` : `i${item.id}`;
145
+ }
146
+ /** Build keyed rows only for the currently visible prefix of a bounded list. */
147
+ function boundedEntries(items, visibleCount, itemKey) {
148
+ const entries = [];
149
+ const byKey = /* @__PURE__ */ new Map();
150
+ const occurrences = /* @__PURE__ */ new Map();
151
+ const count = Math.max(0, Math.min(items.length, Math.floor(visibleCount)));
152
+ for (let index = 0; index < count; index += 1) {
153
+ const item = items[index];
154
+ const base = itemKey(item, index);
155
+ const occurrence = occurrences.get(base) ?? 0;
156
+ occurrences.set(base, occurrence + 1);
157
+ const entry = {
158
+ key: repeatedKey(base, occurrence),
159
+ item,
160
+ index
161
+ };
162
+ entries.push(entry);
163
+ byKey.set(entry.key, entry);
164
+ }
165
+ return {
166
+ entries,
167
+ byKey
168
+ };
169
+ }
170
+ /** The key of the first failing test in reading order. */
171
+ function firstFailureKey(suites) {
172
+ const stack = [{
173
+ suites,
174
+ parent: "",
175
+ index: 0
176
+ }];
177
+ while (stack.length > 0) {
178
+ const frame = stack[stack.length - 1];
179
+ const suite = frame.suites[frame.index];
180
+ if (!suite) {
181
+ stack.pop();
182
+ continue;
183
+ }
184
+ frame.index += 1;
185
+ const key = suiteKey(frame.parent, suite, frame.index - 1);
186
+ for (let i = 0; i < (suite.tests?.length ?? 0); i += 1) if (suite.tests[i].status === "failed") return testKey(key, suite.tests[i], i);
187
+ if (suite.suites?.length) stack.push({
188
+ suites: suite.suites,
189
+ parent: key,
190
+ index: 0
191
+ });
192
+ }
193
+ }
194
+ /** True when both describe the same failure at the same place in the tree. */
195
+ function sameFailure(left, right) {
196
+ if (left === right) return true;
197
+ if (!left || !right) return false;
198
+ if (left.test !== right.test || left.suites.length !== right.suites.length) return false;
199
+ for (let index = 0; index < left.suites.length; index += 1) if (left.suites[index] !== right.suites[index]) return false;
200
+ return true;
201
+ }
202
+ /**
203
+ * The first failure's unique rendering keys, including its ancestor suites. The
204
+ * work is linear in the suites visited and the path it returns is linear in the
205
+ * depth, so a long chain of nested suites costs no more than a wide list.
206
+ */
207
+ function firstFailureRenderPath(suites) {
208
+ const stack = [{
209
+ suites,
210
+ index: 0,
211
+ occurrences: /* @__PURE__ */ new Map()
212
+ }];
213
+ while (stack.length > 0) {
214
+ const frame = stack[stack.length - 1];
215
+ const suite = frame.suites[frame.index];
216
+ if (!suite) {
217
+ stack.pop();
218
+ continue;
219
+ }
220
+ frame.index += 1;
221
+ const base = siblingKey(suite, frame.index - 1);
222
+ const occurrence = frame.occurrences.get(base) ?? 0;
223
+ frame.occurrences.set(base, occurrence + 1);
224
+ const key = repeatedKey(base, occurrence);
225
+ const tests = suite.tests ?? [];
226
+ const testOccurrences = /* @__PURE__ */ new Map();
227
+ for (let i = 0; i < tests.length; i += 1) {
228
+ const testBase = siblingKey(tests[i], i);
229
+ const testOccurrence = testOccurrences.get(testBase) ?? 0;
230
+ testOccurrences.set(testBase, testOccurrence + 1);
231
+ if (tests[i].status === "failed") {
232
+ const path = [];
233
+ for (let depth = 1; depth < stack.length; depth += 1) path.push(stack[depth].key);
234
+ path.push(key);
235
+ return {
236
+ suites: path,
237
+ test: repeatedKey(testBase, testOccurrence)
238
+ };
239
+ }
240
+ }
241
+ if (suite.suites?.length) stack.push({
242
+ suites: suite.suites,
243
+ index: 0,
244
+ occurrences: /* @__PURE__ */ new Map(),
245
+ key
246
+ });
247
+ }
248
+ }
249
+ //#endregion
250
+ export { boundedEntries, describeCount, firstFailureKey, firstFailureRenderPath, formatDuration, listedCounts, reconcileCounts, repeatedKey, sameFailure, siblingKey, suiteKey, suiteState, testKey };
251
+
252
+ //# sourceMappingURL=test-results-model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-results-model.js","names":[],"sources":["../../../../src/components/composites/test-results/test-results-model.ts"],"sourcesContent":["/**\n * The test run's pure rules: what the listed tests add up to, how that compares\n * with the counts the host reported, and how a duration is said.\n *\n * The one rule that shapes everything here is that a count is a claim. There are\n * two honest sources for one — the host's own tally (`summary`), and the tests it\n * chose to list — and they are allowed to disagree: a host may list only the\n * failures, a runner may count tests it did not stream, a suite may have been cut\n * short. So nothing is silently recomputed. A supplied count is shown as given; if\n * the tests listed do not add up to it, the listed number is shown beside it; and\n * when no summary was supplied, the counts that are shown are labelled as coming\n * from the tests listed, not presented as the run's totals.\n */\n\nexport type TestOutcome = 'passed' | 'failed' | 'skipped'\n/** `running` and `pending` are states of a test that has no outcome yet; they are not counted. */\nexport type TestCaseStatus = TestOutcome | 'running' | 'pending'\n\nexport type TestCase = Readonly<{\n /** Stable identity for keyed rendering. Defaults to the position. */\n id?: string\n name: string\n /** Absent means the host did not say; the test is listed and nothing is claimed. */\n status?: TestCaseStatus\n durationMs?: number\n /** The failure message, as text. */\n message?: string\n /** A stack trace for `StackTrace` to read. */\n stack?: string\n /** A unified diff of expected against actual for `DiffBlock`. */\n diff?: string\n}>\n\nexport type TestSuite = Readonly<{\n id?: string\n name: string\n /** The file the suite lives in, shown as text. */\n file?: string\n durationMs?: number\n tests?: readonly TestCase[]\n suites?: readonly TestSuite[]\n}>\n\n/** The host's own tally. Every field is optional; only supplied ones are shown. */\nexport type TestSummary = Readonly<{\n passed?: number\n failed?: number\n skipped?: number\n total?: number\n durationMs?: number\n}>\n\nexport type ListedCounts = Readonly<{\n passed: number\n failed: number\n skipped: number\n running: number\n pending: number\n /** Tests listed with no status. */\n unknown: number\n /** Every test listed, whatever its status. */\n total: number\n}>\n\nconst empty: ListedCounts = {\n passed: 0,\n failed: 0,\n skipped: 0,\n running: 0,\n pending: 0,\n unknown: 0,\n total: 0,\n}\n\nconst KNOWN_STATUSES: ReadonlySet<string> = new Set([\n 'passed',\n 'failed',\n 'skipped',\n 'running',\n 'pending',\n])\n\n/** Count the tests in a list of suites, at any depth. Iterative: suites come from a host. */\nexport function listedCounts(suites: readonly TestSuite[]): ListedCounts {\n const counts = { ...empty }\n const stack = [...suites]\n while (stack.length > 0) {\n const suite = stack.pop()!\n for (const test of suite.tests ?? []) {\n counts.total += 1\n // A status the host invented is as good as none.\n if (test.status !== undefined && KNOWN_STATUSES.has(test.status)) counts[test.status] += 1\n else counts.unknown += 1\n }\n for (const child of suite.suites ?? []) stack.push(child)\n }\n return counts\n}\n\nexport type CountLine = Readonly<{\n outcome: TestOutcome\n /** The number to show: the host's if it gave one, otherwise the listed one. */\n count: number\n /** How many tests of this outcome are listed. */\n listed: number\n /** The host gave a count and the list does not agree with it. */\n differs: boolean\n}>\n\nexport type RunCounts = Readonly<{\n /** Whose numbers these are. `listed` must be labelled as such. */\n basis: 'reported' | 'listed'\n lines: readonly CountLine[]\n /** The host's total, when supplied. */\n reportedTotal?: number\n /** The reported total, when the host gave one and the list disagrees. */\n totalNote?: Readonly<{ reported: number; listed: number }>\n}>\n\nfunction validCount(value: unknown): value is number {\n return typeof value === 'number' && Number.isInteger(value) && value >= 0\n}\n\nconst OUTCOMES: readonly TestOutcome[] = ['failed', 'passed', 'skipped']\n\n/**\n * Decide which numbers to show.\n *\n * With a summary: exactly the counts it supplied, as given. `differs` is set\n * when tests are listed at all and the listed number for that outcome is not the\n * supplied one — a host that lists only failures will see \"40 passed (0 listed)\",\n * which is true and tells the reader the list is partial. Without a summary: the\n * outcomes that occur among the listed tests, with `basis: 'listed'`.\n */\nexport function reconcileCounts(summary: TestSummary | undefined, listed: ListedCounts): RunCounts {\n const supplied = OUTCOMES.filter((outcome) => validCount(summary?.[outcome]))\n const hasTotal = validCount(summary?.total)\n\n if (summary && (supplied.length > 0 || hasTotal)) {\n const lines: CountLine[] = supplied.map((outcome) => {\n const count = summary[outcome] as number\n return {\n outcome,\n count,\n listed: listed[outcome],\n differs: listed.total > 0 && listed[outcome] !== count,\n }\n })\n const totalNote =\n hasTotal && listed.total > 0 && summary.total !== listed.total\n ? { reported: summary.total as number, listed: listed.total }\n : undefined\n return {\n basis: 'reported',\n lines,\n ...(hasTotal && { reportedTotal: summary.total as number }),\n ...(totalNote && { totalNote }),\n }\n }\n\n const lines: CountLine[] = OUTCOMES.filter((outcome) => listed[outcome] > 0).map((outcome) => ({\n outcome,\n count: listed[outcome],\n listed: listed[outcome],\n differs: false,\n }))\n return { basis: 'listed', lines }\n}\n\n/** The words for one count: \"38 passed\", or \"40 passed (38 listed)\" when the list disagrees. */\nexport function describeCount(line: CountLine): string {\n const base = `${line.count.toLocaleString()} ${line.outcome}`\n return line.differs ? `${base} (${line.listed.toLocaleString()} listed)` : base\n}\n\nconst plural = (n: number, one: string) => (n === 1 ? one : `${one}s`)\n\n/**\n * A duration. `short` is for a meta column (\"120 ms\", \"3.4 s\"); `long` is for a\n * sentence (\"120 milliseconds\", \"3.4 seconds\", \"2 minutes 5 seconds\"). Anything\n * that is not a finite non-negative number has no duration, so none is drawn.\n */\nexport function formatDuration(ms: unknown, style: 'short' | 'long' = 'short'): string | undefined {\n if (typeof ms !== 'number' || !Number.isFinite(ms) || ms < 0) return undefined\n if (ms > 0 && ms < 1) return style === 'short' ? '<1 ms' : 'less than 1 millisecond'\n if (ms < 1000) {\n const whole = Math.round(ms)\n return style === 'short' ? `${whole} ms` : `${whole} ${plural(whole, 'millisecond')}`\n }\n if (ms < 60_000) {\n const seconds = ms < 10_000 ? Math.round(ms / 100) / 10 : Math.round(ms / 1000)\n const text = Number.isInteger(seconds) ? String(seconds) : seconds.toFixed(1)\n return style === 'short' ? `${text} s` : `${text} ${seconds === 1 ? 'second' : 'seconds'}`\n }\n const totalSeconds = Math.round(ms / 1000)\n const minutes = Math.floor(totalSeconds / 60)\n const seconds = totalSeconds % 60\n if (style === 'short') return seconds === 0 ? `${minutes} min` : `${minutes} min ${seconds} s`\n const m = `${minutes.toLocaleString()} ${plural(minutes, 'minute')}`\n return seconds === 0 ? m : `${m} ${seconds} ${plural(seconds, 'second')}`\n}\n\nexport type SuiteState = 'failed' | 'passed' | 'running' | undefined\n\n/**\n * What a suite can say about itself from the tests listed in it. Any listed\n * failure makes it `failed`; a listed test still running makes it `running`;\n * `passed` needs at least one passed test and every listed test to be passed or\n * skipped. Anything else — no tests, a test with no status — is silence.\n */\nexport function suiteState(counts: ListedCounts): SuiteState {\n if (counts.failed > 0) return 'failed'\n if (counts.running > 0) return 'running'\n if (counts.passed > 0 && counts.pending === 0 && counts.unknown === 0) return 'passed'\n return undefined\n}\n\n/** A suite's key among its siblings: its id if it has one, otherwise its position. */\nexport function suiteKey(parent: string, suite: TestSuite, index: number): string {\n return `${parent}/${suite.id ?? `s${index}`}`\n}\n\nexport function testKey(parent: string, test: TestCase, index: number): string {\n return `${parent}:${test.id ?? `t${index}`}`\n}\n\n/** Distinguish repeated ids without tying a row to the object instance it renders. */\nexport function repeatedKey(key: string, occurrence: number): string {\n return JSON.stringify([key, occurrence])\n}\n\n/**\n * A row's identity among its siblings only: the host id verbatim, or its\n * position when it has none. The leading letter keeps the two apart, so an id\n * that looks like a position never collides with one. A row's place in the tree\n * is the list of these keys from the root, never one string that nests its\n * parent's, so a key stays as long as its own id however deep the row sits.\n */\nexport function siblingKey(item: Readonly<{ id?: string }>, index: number): string {\n return item.id === undefined ? `p${index}` : `i${item.id}`\n}\n\nexport type BoundedEntry<T> = Readonly<{\n key: string\n item: T\n index: number\n}>\n\n/** Build keyed rows only for the currently visible prefix of a bounded list. */\nexport function boundedEntries<T>(\n items: readonly T[],\n visibleCount: number,\n itemKey: (item: T, index: number) => string\n): Readonly<{\n entries: readonly BoundedEntry<T>[]\n byKey: ReadonlyMap<string, BoundedEntry<T>>\n}> {\n const entries: BoundedEntry<T>[] = []\n const byKey = new Map<string, BoundedEntry<T>>()\n const occurrences = new Map<string, number>()\n const count = Math.max(0, Math.min(items.length, Math.floor(visibleCount)))\n\n for (let index = 0; index < count; index += 1) {\n const item = items[index]!\n const base = itemKey(item, index)\n const occurrence = occurrences.get(base) ?? 0\n occurrences.set(base, occurrence + 1)\n const entry = { key: repeatedKey(base, occurrence), item, index }\n entries.push(entry)\n byKey.set(entry.key, entry)\n }\n\n return { entries, byKey }\n}\n\n/** The key of the first failing test in reading order. */\nexport function firstFailureKey(suites: readonly TestSuite[]): string | undefined {\n type Frame = { suites: readonly TestSuite[]; parent: string; index: number }\n const stack: Frame[] = [{ suites, parent: '', index: 0 }]\n while (stack.length > 0) {\n const frame = stack[stack.length - 1]!\n const suite = frame.suites[frame.index]\n if (!suite) {\n stack.pop()\n continue\n }\n frame.index += 1\n const key = suiteKey(frame.parent, suite, frame.index - 1)\n for (let i = 0; i < (suite.tests?.length ?? 0); i += 1) {\n if (suite.tests![i]!.status === 'failed') return testKey(key, suite.tests![i]!, i)\n }\n if (suite.suites?.length) stack.push({ suites: suite.suites, parent: key, index: 0 })\n }\n return undefined\n}\n\nexport type FirstFailureRenderPath = Readonly<{\n /**\n * The rendering key of each suite from the root through the suite containing\n * the failure, one entry per level. A key is unique among its siblings, so\n * a suite is on the path when its entry at its own depth is its key and its\n * parent was on the path.\n */\n suites: readonly string[]\n /** The failed test's rendering key among the tests of the last suite on the path. */\n test: string\n}>\n\n/** True when both describe the same failure at the same place in the tree. */\nexport function sameFailure(\n left: FirstFailureRenderPath | undefined,\n right: FirstFailureRenderPath | undefined\n): boolean {\n if (left === right) return true\n if (!left || !right) return false\n if (left.test !== right.test || left.suites.length !== right.suites.length) return false\n for (let index = 0; index < left.suites.length; index += 1)\n if (left.suites[index] !== right.suites[index]) return false\n return true\n}\n\n/**\n * The first failure's unique rendering keys, including its ancestor suites. The\n * work is linear in the suites visited and the path it returns is linear in the\n * depth, so a long chain of nested suites costs no more than a wide list.\n */\nexport function firstFailureRenderPath(\n suites: readonly TestSuite[]\n): FirstFailureRenderPath | undefined {\n type Frame = {\n suites: readonly TestSuite[]\n index: number\n occurrences: Map<string, number>\n /** The rendering key of the suite these are the children of; absent at the root. */\n key?: string\n }\n const stack: Frame[] = [{ suites, index: 0, occurrences: new Map() }]\n while (stack.length > 0) {\n const frame = stack[stack.length - 1]!\n const suite = frame.suites[frame.index]\n if (!suite) {\n stack.pop()\n continue\n }\n frame.index += 1\n const base = siblingKey(suite, frame.index - 1)\n const occurrence = frame.occurrences.get(base) ?? 0\n frame.occurrences.set(base, occurrence + 1)\n const key = repeatedKey(base, occurrence)\n const tests = suite.tests ?? []\n const testOccurrences = new Map<string, number>()\n for (let i = 0; i < tests.length; i += 1) {\n const testBase = siblingKey(tests[i]!, i)\n const testOccurrence = testOccurrences.get(testBase) ?? 0\n testOccurrences.set(testBase, testOccurrence + 1)\n if (tests[i]!.status === 'failed') {\n const path: string[] = []\n for (let depth = 1; depth < stack.length; depth += 1) path.push(stack[depth]!.key!)\n path.push(key)\n return { suites: path, test: repeatedKey(testBase, testOccurrence) }\n }\n }\n if (suite.suites?.length) {\n stack.push({ suites: suite.suites, index: 0, occurrences: new Map(), key })\n }\n }\n return undefined\n}\n"],"mappings":";AAgEA,IAAM,QAAsB;CAC1B,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,SAA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AM,QAAQ,MAAM,OAAO,MAAM;EACjC,IAAI,CAAC,OAAO;GACV,MAAM,IAAI;GACV;EACF;EACA,MAAM,SAAS;EACf,MAAM,OAAO,WAAW,OAAO,MAAM,QAAQ,CAAC;EAC9C,MAAM,aAAa,MAAM,YAAY,IAAI,IAAI,KAAK;EAClD,MAAM,YAAY,IAAI,MAAM,aAAa,CAAC;EAC1C,MAAM,MAAM,YAAY,MAAM,UAAU;EACxC,MAAM,QAAQ,MAAM,SAAS,CAAC;EAC9B,MAAM,kCAAkB,IAAI,IAAoB;EAChD,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK,GAAG;GACxC,MAAM,WAAW,WAAW,MAAM,IAAK,CAAC;GACxC,MAAM,iBAAiB,gBAAgB,IAAI,QAAQ,KAAK;GACxD,gBAAgB,IAAI,UAAU,iBAAiB,CAAC;GAChD,IAAI,MAAM,EAAE,CAAE,WAAW,UAAU;IACjC,MAAM,OAAiB,CAAC;IACxB,KAAK,IAAI,QAAQ,GAAG,QAAQ,MAAM,QAAQ,SAAS,GAAG,KAAK,KAAK,MAAM,MAAM,CAAE,GAAI;IAClF,KAAK,KAAK,GAAG;IACb,OAAO;KAAE,QAAQ;KAAM,MAAM,YAAY,UAAU,cAAc;IAAE;GACrE;EACF;EACA,IAAI,MAAM,QAAQ,QAChB,MAAM,KAAK;GAAE,QAAQ,MAAM;GAAQ,OAAO;GAAG,6BAAa,IAAI,IAAI;GAAG;EAAI,CAAC;CAE9E;AAEF"}
@@ -0,0 +1,60 @@
1
+ import { type ComponentProps, type JSX } from 'solid-js';
2
+ import { type StackTraceProps } from '../stack-trace';
3
+ import { type TestSuite, type TestSummary } from './test-results-model';
4
+ /**
5
+ * TestResults.
6
+ *
7
+ * A test run: how it went in words and in a segmented bar, then the suites it
8
+ * ran as `Trace` lines, each opening onto its tests, and a failing test opening
9
+ * onto its message, diff and stack. It is for a run the host can structure; reach
10
+ * for `Terminal` when all there is to show is the command's output, and for
11
+ * `StackTrace` alone when one call failed outside a test.
12
+ *
13
+ * ## Counts are claims
14
+ *
15
+ * Nothing is computed that the host did not supply data for, and nothing the host
16
+ * supplied is quietly recomputed. `summary` is the host's own tally and is shown
17
+ * as given. If tests are listed and their number for an outcome does not match, the
18
+ * listed number is shown beside it — "40 passed (2 listed)" — which is also how a
19
+ * host that lists only its failures reads. Without a `summary` the counts shown are
20
+ * those of the tests listed, and the component says so; it does not present them as
21
+ * the run's totals. A suite is marked failed or passed only from the tests listed in
22
+ * it, and its spoken label says "listed" so it claims no more than that.
23
+ *
24
+ * ## Not colour-only
25
+ *
26
+ * The bar is decoration: every segment has a counterpart in the words beside it,
27
+ * each with its own shape (a cross, a tick, a dash). Segments are separated by a
28
+ * gap and never narrower than a visible sliver, so one failure in five thousand
29
+ * tests is still on the bar.
30
+ *
31
+ * ## Bounded
32
+ *
33
+ * Suites and tests are listed `listLimit` at a time with "show more", and a suite's
34
+ * tests are not rendered until it is open. The first failure in reading order opens
35
+ * when its row is visible; a failure beyond a "show more" boundary stays unmounted
36
+ * until its page is revealed. When a running result first reports a failure, its
37
+ * suite and test open once. Later updates preserve the user's disclosure choices.
38
+ *
39
+ * Failure details are text: the message is a `pre`, the diff goes to `DiffBlock`
40
+ * and the stack to `StackTrace`. If a stack already begins with the message, pass
41
+ * only the stack; nothing here de-duplicates what the host sends.
42
+ */
43
+ export type TestResultsProps = Omit<ComponentProps<'section'>, 'children'> & {
44
+ suites: readonly TestSuite[];
45
+ /** The host's own counts. Shown as given; see the component comment. */
46
+ summary?: TestSummary;
47
+ /** The run is still going. */
48
+ running?: boolean;
49
+ /** Suites, or tests within a suite, listed before "show more". Default 50. */
50
+ listLimit?: number;
51
+ /** Passed to each failure's `StackTrace`. */
52
+ onOpenFrame?: StackTraceProps['onOpenFrame'];
53
+ /** The section's accessible name. Default "Test results". */
54
+ label?: string;
55
+ };
56
+ export declare const TEST_RESULTS_LIST_LIMIT = 50;
57
+ /** Characters of a failure message drawn before the rest is offered. */
58
+ export declare const TEST_RESULTS_MESSAGE_LIMIT = 4000;
59
+ export declare function TestResults(props: TestResultsProps): JSX.Element;
60
+ //# sourceMappingURL=test-results.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-results.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/test-results/test-results.tsx"],"names":[],"mappings":"AASA,OAAO,EASL,KAAK,cAAc,EACnB,KAAK,GAAG,EACT,MAAM,UAAU,CAAA;AAMjB,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACjE,OAAO,EAcL,KAAK,SAAS,EACd,KAAK,WAAW,EAEjB,MAAM,sBAAsB,CAAA;AAE7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,GAAG;IAC3E,MAAM,EAAE,SAAS,SAAS,EAAE,CAAA;IAC5B,wEAAwE;IACxE,OAAO,CAAC,EAAE,WAAW,CAAA;IACrB,8BAA8B;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,8EAA8E;IAC9E,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,6CAA6C;IAC7C,WAAW,CAAC,EAAE,eAAe,CAAC,aAAa,CAAC,CAAA;IAC5C,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,eAAO,MAAM,uBAAuB,KAAK,CAAA;AAyHzC,wEAAwE;AACxE,eAAO,MAAM,0BAA0B,OAAQ,CAAA;AAgR/C,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,eA4FlD"}