@corbet-labs/ccht 0.2.2 → 0.2.4

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 (397) hide show
  1. package/LICENSE +307 -0
  2. package/LICENSE.md +30 -0
  3. package/LICENSES/GPL-3.0-only.txt +232 -0
  4. package/LICENSES/LGPL-3.0-linking-exception.txt +16 -0
  5. package/LICENSES/LGPL-3.0-only WITH LGPL-3.0-linking-exception.txt +16 -0
  6. package/LICENSES/LGPL-3.0-only.txt +304 -0
  7. package/LICENSES/dependencies/agent-client-protocol-2.1.0/LICENSE +191 -0
  8. package/LICENSES/dependencies/agent-client-protocol-derive-2.1.0/LICENSE +191 -0
  9. package/LICENSES/dependencies/agent-client-protocol-schema-1.7.0/LICENSE +190 -0
  10. package/LICENSES/dependencies/android_system_properties-0.1.6/LICENSE-APACHE +13 -0
  11. package/LICENSES/dependencies/android_system_properties-0.1.6/LICENSE-MIT +20 -0
  12. package/LICENSES/dependencies/anyhow-1.0.104/LICENSE-APACHE +176 -0
  13. package/LICENSES/dependencies/anyhow-1.0.104/LICENSE-MIT +23 -0
  14. package/LICENSES/dependencies/async-channel-2.5.0/LICENSE-APACHE +201 -0
  15. package/LICENSES/dependencies/async-channel-2.5.0/LICENSE-MIT +23 -0
  16. package/LICENSES/dependencies/async-io-2.6.0/LICENSE-APACHE +201 -0
  17. package/LICENSES/dependencies/async-io-2.6.0/LICENSE-MIT +23 -0
  18. package/LICENSES/dependencies/async-lock-3.4.2/LICENSE-APACHE +201 -0
  19. package/LICENSES/dependencies/async-lock-3.4.2/LICENSE-MIT +23 -0
  20. package/LICENSES/dependencies/async-process-2.5.0/LICENSE-APACHE +201 -0
  21. package/LICENSES/dependencies/async-process-2.5.0/LICENSE-MIT +23 -0
  22. package/LICENSES/dependencies/async-signal-0.2.14/LICENSE-APACHE +201 -0
  23. package/LICENSES/dependencies/async-signal-0.2.14/LICENSE-MIT +23 -0
  24. package/LICENSES/dependencies/async-task-4.7.1/LICENSE-APACHE +201 -0
  25. package/LICENSES/dependencies/async-task-4.7.1/LICENSE-MIT +23 -0
  26. package/LICENSES/dependencies/atomic-waker-1.1.2/LICENSE-APACHE +201 -0
  27. package/LICENSES/dependencies/atomic-waker-1.1.2/LICENSE-MIT +23 -0
  28. package/LICENSES/dependencies/atomic-waker-1.1.2/LICENSE-THIRD-PARTY +45 -0
  29. package/LICENSES/dependencies/autocfg-1.5.1/LICENSE-APACHE +201 -0
  30. package/LICENSES/dependencies/autocfg-1.5.1/LICENSE-MIT +25 -0
  31. package/LICENSES/dependencies/base64-0.22.1/LICENSE-APACHE +201 -0
  32. package/LICENSES/dependencies/base64-0.22.1/LICENSE-MIT +21 -0
  33. package/LICENSES/dependencies/base64-0.23.1/LICENSE-APACHE +201 -0
  34. package/LICENSES/dependencies/base64-0.23.1/LICENSE-MIT +21 -0
  35. package/LICENSES/dependencies/bitflags-1.3.2/LICENSE-APACHE +201 -0
  36. package/LICENSES/dependencies/bitflags-1.3.2/LICENSE-MIT +25 -0
  37. package/LICENSES/dependencies/bitflags-2.13.2/LICENSE-APACHE +201 -0
  38. package/LICENSES/dependencies/bitflags-2.13.2/LICENSE-MIT +25 -0
  39. package/LICENSES/dependencies/blocking-1.7.0/LICENSE-APACHE +201 -0
  40. package/LICENSES/dependencies/blocking-1.7.0/LICENSE-MIT +23 -0
  41. package/LICENSES/dependencies/bs58-0.5.1/LICENSE-APACHE +201 -0
  42. package/LICENSES/dependencies/bs58-0.5.1/LICENSE-MIT +20 -0
  43. package/LICENSES/dependencies/bumpalo-3.20.3/LICENSE-APACHE +201 -0
  44. package/LICENSES/dependencies/bumpalo-3.20.3/LICENSE-MIT +25 -0
  45. package/LICENSES/dependencies/bytes-1.12.1/LICENSE +25 -0
  46. package/LICENSES/dependencies/cc-1.4.5/LICENSE-APACHE +201 -0
  47. package/LICENSES/dependencies/cc-1.4.5/LICENSE-MIT +25 -0
  48. package/LICENSES/dependencies/cfg-if-1.0.4/LICENSE-APACHE +201 -0
  49. package/LICENSES/dependencies/cfg-if-1.0.4/LICENSE-MIT +25 -0
  50. package/LICENSES/dependencies/chrono-0.4.45/LICENSE.txt +240 -0
  51. package/LICENSES/dependencies/concurrent-queue-2.5.0/LICENSE-APACHE +201 -0
  52. package/LICENSES/dependencies/concurrent-queue-2.5.0/LICENSE-MIT +23 -0
  53. package/LICENSES/dependencies/convert_case-0.10.0/LICENSE +21 -0
  54. package/LICENSES/dependencies/core-foundation-sys-0.8.7/LICENSE-APACHE +201 -0
  55. package/LICENSES/dependencies/core-foundation-sys-0.8.7/LICENSE-MIT +25 -0
  56. package/LICENSES/dependencies/crossbeam-deque-0.8.8/LICENSE-APACHE +201 -0
  57. package/LICENSES/dependencies/crossbeam-deque-0.8.8/LICENSE-MIT +27 -0
  58. package/LICENSES/dependencies/crossbeam-epoch-0.9.21/LICENSE-APACHE +201 -0
  59. package/LICENSES/dependencies/crossbeam-epoch-0.9.21/LICENSE-MIT +27 -0
  60. package/LICENSES/dependencies/crossbeam-utils-0.8.23/LICENSE-APACHE +201 -0
  61. package/LICENSES/dependencies/crossbeam-utils-0.8.23/LICENSE-MIT +27 -0
  62. package/LICENSES/dependencies/darling-0.24.1/LICENSE +21 -0
  63. package/LICENSES/dependencies/darling_core-0.24.1/LICENSE +21 -0
  64. package/LICENSES/dependencies/darling_macro-0.24.1/LICENSE +21 -0
  65. package/LICENSES/dependencies/defmt-1.1.1/LICENSE-APACHE +201 -0
  66. package/LICENSES/dependencies/defmt-1.1.1/LICENSE-MIT +25 -0
  67. package/LICENSES/dependencies/defmt-macros-1.1.1/LICENSE-APACHE +201 -0
  68. package/LICENSES/dependencies/defmt-macros-1.1.1/LICENSE-MIT +25 -0
  69. package/LICENSES/dependencies/defmt-parser-1.0.0/LICENSE-APACHE +201 -0
  70. package/LICENSES/dependencies/defmt-parser-1.0.0/LICENSE-MIT +25 -0
  71. package/LICENSES/dependencies/deranged-0.5.8/LICENSE-Apache +202 -0
  72. package/LICENSES/dependencies/deranged-0.5.8/LICENSE-MIT +19 -0
  73. package/LICENSES/dependencies/derive_more-2.1.1/LICENSE +21 -0
  74. package/LICENSES/dependencies/derive_more-impl-2.1.1/LICENSE +21 -0
  75. package/LICENSES/dependencies/dyn-clone-1.0.20/LICENSE-APACHE +176 -0
  76. package/LICENSES/dependencies/dyn-clone-1.0.20/LICENSE-MIT +23 -0
  77. package/LICENSES/dependencies/either-1.18.0/LICENSE-APACHE +201 -0
  78. package/LICENSES/dependencies/either-1.18.0/LICENSE-MIT +25 -0
  79. package/LICENSES/dependencies/equivalent-1.0.2/LICENSE-APACHE +201 -0
  80. package/LICENSES/dependencies/equivalent-1.0.2/LICENSE-MIT +25 -0
  81. package/LICENSES/dependencies/errno-0.3.14/LICENSE-APACHE +201 -0
  82. package/LICENSES/dependencies/errno-0.3.14/LICENSE-MIT +25 -0
  83. package/LICENSES/dependencies/event-listener-5.4.2/LICENSE-APACHE +201 -0
  84. package/LICENSES/dependencies/event-listener-5.4.2/LICENSE-MIT +23 -0
  85. package/LICENSES/dependencies/event-listener-strategy-0.5.4/LICENSE-APACHE +201 -0
  86. package/LICENSES/dependencies/event-listener-strategy-0.5.4/LICENSE-MIT +23 -0
  87. package/LICENSES/dependencies/fallible-iterator-0.3.0/LICENSE-APACHE +202 -0
  88. package/LICENSES/dependencies/fallible-iterator-0.3.0/LICENSE-MIT +19 -0
  89. package/LICENSES/dependencies/fastrand-2.5.0/LICENSE-APACHE +201 -0
  90. package/LICENSES/dependencies/fastrand-2.5.0/LICENSE-MIT +23 -0
  91. package/LICENSES/dependencies/find-msvc-tools-0.1.12/LICENSE-APACHE +201 -0
  92. package/LICENSES/dependencies/find-msvc-tools-0.1.12/LICENSE-MIT +25 -0
  93. package/LICENSES/dependencies/fixedbitset-0.5.7/LICENSE-APACHE +201 -0
  94. package/LICENSES/dependencies/fixedbitset-0.5.7/LICENSE-MIT +25 -0
  95. package/LICENSES/dependencies/foldhash-0.2.0/LICENSE +19 -0
  96. package/LICENSES/dependencies/futures-0.3.34/LICENSE-APACHE +202 -0
  97. package/LICENSES/dependencies/futures-0.3.34/LICENSE-MIT +26 -0
  98. package/LICENSES/dependencies/futures-channel-0.3.34/LICENSE-APACHE +202 -0
  99. package/LICENSES/dependencies/futures-channel-0.3.34/LICENSE-MIT +26 -0
  100. package/LICENSES/dependencies/futures-concurrency-7.7.1/LICENSE-APACHE +190 -0
  101. package/LICENSES/dependencies/futures-concurrency-7.7.1/LICENSE-MIT +21 -0
  102. package/LICENSES/dependencies/futures-core-0.3.34/LICENSE-APACHE +202 -0
  103. package/LICENSES/dependencies/futures-core-0.3.34/LICENSE-MIT +26 -0
  104. package/LICENSES/dependencies/futures-executor-0.3.34/LICENSE-APACHE +202 -0
  105. package/LICENSES/dependencies/futures-executor-0.3.34/LICENSE-MIT +26 -0
  106. package/LICENSES/dependencies/futures-io-0.3.34/LICENSE-APACHE +202 -0
  107. package/LICENSES/dependencies/futures-io-0.3.34/LICENSE-MIT +26 -0
  108. package/LICENSES/dependencies/futures-lite-2.6.1/LICENSE-APACHE +201 -0
  109. package/LICENSES/dependencies/futures-lite-2.6.1/LICENSE-MIT +23 -0
  110. package/LICENSES/dependencies/futures-lite-2.6.1/LICENSE-THIRD-PARTY +45 -0
  111. package/LICENSES/dependencies/futures-macro-0.3.34/LICENSE-APACHE +202 -0
  112. package/LICENSES/dependencies/futures-macro-0.3.34/LICENSE-MIT +26 -0
  113. package/LICENSES/dependencies/futures-sink-0.3.34/LICENSE-APACHE +202 -0
  114. package/LICENSES/dependencies/futures-sink-0.3.34/LICENSE-MIT +26 -0
  115. package/LICENSES/dependencies/futures-task-0.3.34/LICENSE-APACHE +202 -0
  116. package/LICENSES/dependencies/futures-task-0.3.34/LICENSE-MIT +26 -0
  117. package/LICENSES/dependencies/futures-util-0.3.34/LICENSE-APACHE +202 -0
  118. package/LICENSES/dependencies/futures-util-0.3.34/LICENSE-MIT +26 -0
  119. package/LICENSES/dependencies/getrandom-0.4.3/LICENSE-APACHE +201 -0
  120. package/LICENSES/dependencies/getrandom-0.4.3/LICENSE-MIT +26 -0
  121. package/LICENSES/dependencies/gimli-0.32.3/LICENSE-APACHE +201 -0
  122. package/LICENSES/dependencies/gimli-0.32.3/LICENSE-MIT +25 -0
  123. package/LICENSES/dependencies/hashbrown-0.12.3/LICENSE-APACHE +201 -0
  124. package/LICENSES/dependencies/hashbrown-0.12.3/LICENSE-MIT +25 -0
  125. package/LICENSES/dependencies/hashbrown-0.16.1/LICENSE-APACHE +201 -0
  126. package/LICENSES/dependencies/hashbrown-0.16.1/LICENSE-MIT +25 -0
  127. package/LICENSES/dependencies/hashbrown-0.17.1/LICENSE-APACHE +201 -0
  128. package/LICENSES/dependencies/hashbrown-0.17.1/LICENSE-MIT +25 -0
  129. package/LICENSES/dependencies/heck-0.5.0/LICENSE-APACHE +201 -0
  130. package/LICENSES/dependencies/heck-0.5.0/LICENSE-MIT +25 -0
  131. package/LICENSES/dependencies/hermit-abi-0.5.3/LICENSE-APACHE +201 -0
  132. package/LICENSES/dependencies/hermit-abi-0.5.3/LICENSE-MIT +23 -0
  133. package/LICENSES/dependencies/hex-0.4.3/LICENSE-APACHE +202 -0
  134. package/LICENSES/dependencies/hex-0.4.3/LICENSE-MIT +20 -0
  135. package/LICENSES/dependencies/iana-time-zone-0.1.65/LICENSE-APACHE +201 -0
  136. package/LICENSES/dependencies/iana-time-zone-0.1.65/LICENSE-MIT +25 -0
  137. package/LICENSES/dependencies/iana-time-zone-haiku-0.1.2/LICENSE-APACHE +201 -0
  138. package/LICENSES/dependencies/iana-time-zone-haiku-0.1.2/LICENSE-MIT +25 -0
  139. package/LICENSES/dependencies/id-arena-2.3.0/LICENSE-APACHE +201 -0
  140. package/LICENSES/dependencies/id-arena-2.3.0/LICENSE-MIT +25 -0
  141. package/LICENSES/dependencies/ident_case-1.0.1/LICENSE +19 -0
  142. package/LICENSES/dependencies/indexmap-1.9.3/LICENSE-APACHE +201 -0
  143. package/LICENSES/dependencies/indexmap-1.9.3/LICENSE-MIT +25 -0
  144. package/LICENSES/dependencies/indexmap-2.14.2/LICENSE-APACHE +201 -0
  145. package/LICENSES/dependencies/indexmap-2.14.2/LICENSE-MIT +25 -0
  146. package/LICENSES/dependencies/itoa-1.0.18/LICENSE-APACHE +176 -0
  147. package/LICENSES/dependencies/itoa-1.0.18/LICENSE-MIT +23 -0
  148. package/LICENSES/dependencies/jiff-0.2.35/COPYING +3 -0
  149. package/LICENSES/dependencies/jiff-0.2.35/LICENSE-MIT +21 -0
  150. package/LICENSES/dependencies/jiff-0.2.35/UNLICENSE +24 -0
  151. package/LICENSES/dependencies/jiff-core-0.1.0/COPYING +3 -0
  152. package/LICENSES/dependencies/jiff-core-0.1.0/LICENSE-MIT +21 -0
  153. package/LICENSES/dependencies/jiff-core-0.1.0/UNLICENSE +24 -0
  154. package/LICENSES/dependencies/jiff-static-0.2.35/COPYING +3 -0
  155. package/LICENSES/dependencies/jiff-static-0.2.35/LICENSE-MIT +21 -0
  156. package/LICENSES/dependencies/jiff-static-0.2.35/UNLICENSE +24 -0
  157. package/LICENSES/dependencies/jiff-tzdb-0.1.8/COPYING +3 -0
  158. package/LICENSES/dependencies/jiff-tzdb-0.1.8/LICENSE-MIT +21 -0
  159. package/LICENSES/dependencies/jiff-tzdb-0.1.8/UNLICENSE +24 -0
  160. package/LICENSES/dependencies/jiff-tzdb-platform-0.1.3/COPYING +3 -0
  161. package/LICENSES/dependencies/jiff-tzdb-platform-0.1.3/LICENSE-MIT +21 -0
  162. package/LICENSES/dependencies/jiff-tzdb-platform-0.1.3/UNLICENSE +24 -0
  163. package/LICENSES/dependencies/js-sys-0.3.105/LICENSE-APACHE +201 -0
  164. package/LICENSES/dependencies/js-sys-0.3.105/LICENSE-MIT +25 -0
  165. package/LICENSES/dependencies/leb128-0.2.7/LICENSE-APACHE +201 -0
  166. package/LICENSES/dependencies/leb128-0.2.7/LICENSE-MIT +25 -0
  167. package/LICENSES/dependencies/leb128fmt-0.1.0/LICENSE-APACHE +201 -0
  168. package/LICENSES/dependencies/leb128fmt-0.1.0/LICENSE-MIT +23 -0
  169. package/LICENSES/dependencies/libc-0.2.189/LICENSE-APACHE +176 -0
  170. package/LICENSES/dependencies/libc-0.2.189/LICENSE-MIT +25 -0
  171. package/LICENSES/dependencies/linux-raw-sys-0.12.1/COPYRIGHT +29 -0
  172. package/LICENSES/dependencies/linux-raw-sys-0.12.1/LICENSE-APACHE +201 -0
  173. package/LICENSES/dependencies/linux-raw-sys-0.12.1/LICENSE-Apache-2.0_WITH_LLVM-exception +220 -0
  174. package/LICENSES/dependencies/linux-raw-sys-0.12.1/LICENSE-MIT +23 -0
  175. package/LICENSES/dependencies/log-0.4.34/LICENSE-APACHE +201 -0
  176. package/LICENSES/dependencies/log-0.4.34/LICENSE-MIT +25 -0
  177. package/LICENSES/dependencies/memchr-2.8.3/COPYING +3 -0
  178. package/LICENSES/dependencies/memchr-2.8.3/LICENSE-MIT +21 -0
  179. package/LICENSES/dependencies/memchr-2.8.3/UNLICENSE +24 -0
  180. package/LICENSES/dependencies/mio-1.2.3/LICENSE +19 -0
  181. package/LICENSES/dependencies/num-conv-0.2.2/LICENSE-Apache +177 -0
  182. package/LICENSES/dependencies/num-conv-0.2.2/LICENSE-MIT +19 -0
  183. package/LICENSES/dependencies/num-traits-0.2.19/LICENSE-APACHE +201 -0
  184. package/LICENSES/dependencies/num-traits-0.2.19/LICENSE-MIT +25 -0
  185. package/LICENSES/dependencies/once_cell-1.21.4/LICENSE-APACHE +201 -0
  186. package/LICENSES/dependencies/once_cell-1.21.4/LICENSE-MIT +23 -0
  187. package/LICENSES/dependencies/parking-2.2.1/LICENSE-APACHE +201 -0
  188. package/LICENSES/dependencies/parking-2.2.1/LICENSE-MIT +23 -0
  189. package/LICENSES/dependencies/parking-2.2.1/LICENSE-THIRD-PARTY +9 -0
  190. package/LICENSES/dependencies/pin-project-1.1.13/LICENSE-APACHE +177 -0
  191. package/LICENSES/dependencies/pin-project-1.1.13/LICENSE-MIT +23 -0
  192. package/LICENSES/dependencies/pin-project-internal-1.1.13/LICENSE-APACHE +177 -0
  193. package/LICENSES/dependencies/pin-project-internal-1.1.13/LICENSE-MIT +23 -0
  194. package/LICENSES/dependencies/pin-project-lite-0.2.17/LICENSE-APACHE +177 -0
  195. package/LICENSES/dependencies/pin-project-lite-0.2.17/LICENSE-MIT +23 -0
  196. package/LICENSES/dependencies/piper-0.2.5/LICENSE-APACHE +201 -0
  197. package/LICENSES/dependencies/piper-0.2.5/LICENSE-MIT +23 -0
  198. package/LICENSES/dependencies/polling-3.11.0/LICENSE-APACHE +201 -0
  199. package/LICENSES/dependencies/polling-3.11.0/LICENSE-MIT +23 -0
  200. package/LICENSES/dependencies/portable-atomic-1.15.0/LICENSE-APACHE +177 -0
  201. package/LICENSES/dependencies/portable-atomic-1.15.0/LICENSE-MIT +23 -0
  202. package/LICENSES/dependencies/portable-atomic-util-0.2.8/LICENSE-APACHE +177 -0
  203. package/LICENSES/dependencies/portable-atomic-util-0.2.8/LICENSE-MIT +23 -0
  204. package/LICENSES/dependencies/powerfmt-0.2.0/LICENSE-Apache +202 -0
  205. package/LICENSES/dependencies/powerfmt-0.2.0/LICENSE-MIT +19 -0
  206. package/LICENSES/dependencies/proc-macro2-1.0.107/LICENSE-APACHE +176 -0
  207. package/LICENSES/dependencies/proc-macro2-1.0.107/LICENSE-MIT +23 -0
  208. package/LICENSES/dependencies/quote-1.0.47/LICENSE-APACHE +176 -0
  209. package/LICENSES/dependencies/quote-1.0.47/LICENSE-MIT +23 -0
  210. package/LICENSES/dependencies/r-efi-6.0.0/AUTHORS +75 -0
  211. package/LICENSES/dependencies/rayon-1.12.0/LICENSE-APACHE +201 -0
  212. package/LICENSES/dependencies/rayon-1.12.0/LICENSE-MIT +25 -0
  213. package/LICENSES/dependencies/rayon-core-1.13.0/LICENSE-APACHE +201 -0
  214. package/LICENSES/dependencies/rayon-core-1.13.0/LICENSE-MIT +25 -0
  215. package/LICENSES/dependencies/ref-cast-1.0.27/LICENSE-APACHE +176 -0
  216. package/LICENSES/dependencies/ref-cast-1.0.27/LICENSE-MIT +23 -0
  217. package/LICENSES/dependencies/ref-cast-impl-1.0.27/LICENSE-APACHE +176 -0
  218. package/LICENSES/dependencies/ref-cast-impl-1.0.27/LICENSE-MIT +23 -0
  219. package/LICENSES/dependencies/rustc-demangle-0.1.28/LICENSE-APACHE +201 -0
  220. package/LICENSES/dependencies/rustc-demangle-0.1.28/LICENSE-MIT +25 -0
  221. package/LICENSES/dependencies/rustc-hash-2.1.3/LICENSE-APACHE +176 -0
  222. package/LICENSES/dependencies/rustc-hash-2.1.3/LICENSE-MIT +23 -0
  223. package/LICENSES/dependencies/rustc_version-0.4.1/LICENSE-APACHE +201 -0
  224. package/LICENSES/dependencies/rustc_version-0.4.1/LICENSE-MIT +25 -0
  225. package/LICENSES/dependencies/rustix-1.1.4/COPYRIGHT +29 -0
  226. package/LICENSES/dependencies/rustix-1.1.4/LICENSE-APACHE +201 -0
  227. package/LICENSES/dependencies/rustix-1.1.4/LICENSE-Apache-2.0_WITH_LLVM-exception +220 -0
  228. package/LICENSES/dependencies/rustix-1.1.4/LICENSE-MIT +23 -0
  229. package/LICENSES/dependencies/rustversion-1.0.23/LICENSE-APACHE +176 -0
  230. package/LICENSES/dependencies/rustversion-1.0.23/LICENSE-MIT +23 -0
  231. package/LICENSES/dependencies/schemars-0.9.0/LICENSE +21 -0
  232. package/LICENSES/dependencies/schemars-1.2.2/LICENSE +21 -0
  233. package/LICENSES/dependencies/schemars_derive-1.2.2/LICENSE +21 -0
  234. package/LICENSES/dependencies/semver-1.0.28/LICENSE-APACHE +176 -0
  235. package/LICENSES/dependencies/semver-1.0.28/LICENSE-MIT +23 -0
  236. package/LICENSES/dependencies/serde-1.0.229/LICENSE-APACHE +176 -0
  237. package/LICENSES/dependencies/serde-1.0.229/LICENSE-MIT +23 -0
  238. package/LICENSES/dependencies/serde_core-1.0.229/LICENSE-APACHE +176 -0
  239. package/LICENSES/dependencies/serde_core-1.0.229/LICENSE-MIT +23 -0
  240. package/LICENSES/dependencies/serde_derive-1.0.229/LICENSE-APACHE +176 -0
  241. package/LICENSES/dependencies/serde_derive-1.0.229/LICENSE-MIT +23 -0
  242. package/LICENSES/dependencies/serde_derive_internals-0.30.0/LICENSE-APACHE +176 -0
  243. package/LICENSES/dependencies/serde_derive_internals-0.30.0/LICENSE-MIT +23 -0
  244. package/LICENSES/dependencies/serde_json-1.0.151/LICENSE-APACHE +176 -0
  245. package/LICENSES/dependencies/serde_json-1.0.151/LICENSE-MIT +23 -0
  246. package/LICENSES/dependencies/serde_with-3.23.0/LICENSE-APACHE +201 -0
  247. package/LICENSES/dependencies/serde_with-3.23.0/LICENSE-MIT +25 -0
  248. package/LICENSES/dependencies/serde_with_macros-3.23.0/LICENSE-APACHE +201 -0
  249. package/LICENSES/dependencies/serde_with_macros-3.23.0/LICENSE-MIT +25 -0
  250. package/LICENSES/dependencies/shell-words-1.1.1/LICENSE-APACHE +201 -0
  251. package/LICENSES/dependencies/shell-words-1.1.1/LICENSE-MIT +25 -0
  252. package/LICENSES/dependencies/shlex-2.0.1/LICENSE-APACHE +13 -0
  253. package/LICENSES/dependencies/shlex-2.0.1/LICENSE-MIT +21 -0
  254. package/LICENSES/dependencies/signal-hook-registry-1.4.8/LICENSE-APACHE +201 -0
  255. package/LICENSES/dependencies/signal-hook-registry-1.4.8/LICENSE-MIT +25 -0
  256. package/LICENSES/dependencies/slab-0.4.12/LICENSE +25 -0
  257. package/LICENSES/dependencies/smallvec-1.16.0/LICENSE-APACHE +201 -0
  258. package/LICENSES/dependencies/smallvec-1.16.0/LICENSE-MIT +25 -0
  259. package/LICENSES/dependencies/socket2-0.6.5/LICENSE-APACHE +201 -0
  260. package/LICENSES/dependencies/socket2-0.6.5/LICENSE-MIT +25 -0
  261. package/LICENSES/dependencies/stable_deref_trait-1.2.1/LICENSE-APACHE +201 -0
  262. package/LICENSES/dependencies/stable_deref_trait-1.2.1/LICENSE-MIT +25 -0
  263. package/LICENSES/dependencies/strsim-0.11.1/LICENSE +23 -0
  264. package/LICENSES/dependencies/strum-0.28.0/LICENSE +21 -0
  265. package/LICENSES/dependencies/strum_macros-0.28.0/LICENSE +21 -0
  266. package/LICENSES/dependencies/syn-2.0.119/LICENSE-APACHE +176 -0
  267. package/LICENSES/dependencies/syn-2.0.119/LICENSE-MIT +23 -0
  268. package/LICENSES/dependencies/syn-3.0.5/LICENSE-APACHE +176 -0
  269. package/LICENSES/dependencies/syn-3.0.5/LICENSE-MIT +23 -0
  270. package/LICENSES/dependencies/thiserror-2.0.20/LICENSE-APACHE +176 -0
  271. package/LICENSES/dependencies/thiserror-2.0.20/LICENSE-MIT +23 -0
  272. package/LICENSES/dependencies/thiserror-impl-2.0.20/LICENSE-APACHE +176 -0
  273. package/LICENSES/dependencies/thiserror-impl-2.0.20/LICENSE-MIT +23 -0
  274. package/LICENSES/dependencies/time-0.3.55/LICENSE-Apache +177 -0
  275. package/LICENSES/dependencies/time-0.3.55/LICENSE-MIT +19 -0
  276. package/LICENSES/dependencies/time-core-0.1.9/LICENSE-Apache +177 -0
  277. package/LICENSES/dependencies/time-core-0.1.9/LICENSE-MIT +19 -0
  278. package/LICENSES/dependencies/time-macros-0.2.32/LICENSE-Apache +177 -0
  279. package/LICENSES/dependencies/time-macros-0.2.32/LICENSE-MIT +19 -0
  280. package/LICENSES/dependencies/tinyvec-1.13.2/LICENSE-APACHE.md +202 -0
  281. package/LICENSES/dependencies/tinyvec-1.13.2/LICENSE-MIT.md +5 -0
  282. package/LICENSES/dependencies/tinyvec-1.13.2/LICENSE-ZLIB.md +11 -0
  283. package/LICENSES/dependencies/tinyvec_macros-0.1.1/LICENSE-APACHE.md +202 -0
  284. package/LICENSES/dependencies/tinyvec_macros-0.1.1/LICENSE-MIT.md +21 -0
  285. package/LICENSES/dependencies/tinyvec_macros-0.1.1/LICENSE-ZLIB.md +20 -0
  286. package/LICENSES/dependencies/tokio-1.53.1/LICENSE +21 -0
  287. package/LICENSES/dependencies/tokio-macros-2.7.2/LICENSE +22 -0
  288. package/LICENSES/dependencies/tracing-0.1.44/LICENSE +25 -0
  289. package/LICENSES/dependencies/tracing-attributes-0.1.31/LICENSE +25 -0
  290. package/LICENSES/dependencies/tracing-core-0.1.36/LICENSE +25 -0
  291. package/LICENSES/dependencies/unicode-ident-1.0.24/LICENSE-APACHE +176 -0
  292. package/LICENSES/dependencies/unicode-ident-1.0.24/LICENSE-MIT +23 -0
  293. package/LICENSES/dependencies/unicode-ident-1.0.24/LICENSE-UNICODE +39 -0
  294. package/LICENSES/dependencies/unicode-segmentation-1.13.3/COPYRIGHT +7 -0
  295. package/LICENSES/dependencies/unicode-segmentation-1.13.3/LICENSE-APACHE +201 -0
  296. package/LICENSES/dependencies/unicode-segmentation-1.13.3/LICENSE-MIT +25 -0
  297. package/LICENSES/dependencies/unicode-xid-0.2.6/COPYRIGHT +7 -0
  298. package/LICENSES/dependencies/unicode-xid-0.2.6/LICENSE-APACHE +201 -0
  299. package/LICENSES/dependencies/unicode-xid-0.2.6/LICENSE-MIT +25 -0
  300. package/LICENSES/dependencies/uuid-1.26.1/LICENSE-APACHE +201 -0
  301. package/LICENSES/dependencies/uuid-1.26.1/LICENSE-MIT +26 -0
  302. package/LICENSES/dependencies/walrus-0.26.5/LICENSE-APACHE +201 -0
  303. package/LICENSES/dependencies/walrus-0.26.5/LICENSE-MIT +25 -0
  304. package/LICENSES/dependencies/walrus-macro-0.26.0/LICENSE-APACHE +201 -0
  305. package/LICENSES/dependencies/walrus-macro-0.26.0/LICENSE-MIT +25 -0
  306. package/LICENSES/dependencies/wasi-0.11.1+wasi-snapshot-preview1/LICENSE-APACHE +201 -0
  307. package/LICENSES/dependencies/wasi-0.11.1+wasi-snapshot-preview1/LICENSE-Apache-2.0_WITH_LLVM-exception +220 -0
  308. package/LICENSES/dependencies/wasi-0.11.1+wasi-snapshot-preview1/LICENSE-MIT +23 -0
  309. package/LICENSES/dependencies/wasm-bindgen-0.2.128/LICENSE-APACHE +201 -0
  310. package/LICENSES/dependencies/wasm-bindgen-0.2.128/LICENSE-MIT +25 -0
  311. package/LICENSES/dependencies/wasm-bindgen-cli-support-0.2.128/LICENSE-APACHE +201 -0
  312. package/LICENSES/dependencies/wasm-bindgen-cli-support-0.2.128/LICENSE-MIT +25 -0
  313. package/LICENSES/dependencies/wasm-bindgen-macro-0.2.128/LICENSE-APACHE +201 -0
  314. package/LICENSES/dependencies/wasm-bindgen-macro-0.2.128/LICENSE-MIT +25 -0
  315. package/LICENSES/dependencies/wasm-bindgen-macro-support-0.2.128/LICENSE-APACHE +201 -0
  316. package/LICENSES/dependencies/wasm-bindgen-macro-support-0.2.128/LICENSE-MIT +25 -0
  317. package/LICENSES/dependencies/wasm-bindgen-shared-0.2.128/LICENSE-APACHE +201 -0
  318. package/LICENSES/dependencies/wasm-bindgen-shared-0.2.128/LICENSE-MIT +25 -0
  319. package/LICENSES/dependencies/wasm-encoder-0.245.1/LICENSE-APACHE +201 -0
  320. package/LICENSES/dependencies/wasm-encoder-0.245.1/LICENSE-Apache-2.0_WITH_LLVM-exception +220 -0
  321. package/LICENSES/dependencies/wasm-encoder-0.245.1/LICENSE-MIT +23 -0
  322. package/LICENSES/dependencies/wasmparser-0.245.1/LICENSE-APACHE +201 -0
  323. package/LICENSES/dependencies/wasmparser-0.245.1/LICENSE-Apache-2.0_WITH_LLVM-exception +220 -0
  324. package/LICENSES/dependencies/wasmparser-0.245.1/LICENSE-MIT +23 -0
  325. package/LICENSES/dependencies/windows-core-0.62.2/license-apache-2.0 +201 -0
  326. package/LICENSES/dependencies/windows-core-0.62.2/license-mit +21 -0
  327. package/LICENSES/dependencies/windows-implement-0.60.2/license-apache-2.0 +201 -0
  328. package/LICENSES/dependencies/windows-implement-0.60.2/license-mit +21 -0
  329. package/LICENSES/dependencies/windows-interface-0.59.3/license-apache-2.0 +201 -0
  330. package/LICENSES/dependencies/windows-interface-0.59.3/license-mit +21 -0
  331. package/LICENSES/dependencies/windows-link-0.2.1/license-apache-2.0 +201 -0
  332. package/LICENSES/dependencies/windows-link-0.2.1/license-mit +21 -0
  333. package/LICENSES/dependencies/windows-result-0.4.1/license-apache-2.0 +201 -0
  334. package/LICENSES/dependencies/windows-result-0.4.1/license-mit +21 -0
  335. package/LICENSES/dependencies/windows-strings-0.5.1/license-apache-2.0 +201 -0
  336. package/LICENSES/dependencies/windows-strings-0.5.1/license-mit +21 -0
  337. package/LICENSES/dependencies/windows-sys-0.61.2/license-apache-2.0 +201 -0
  338. package/LICENSES/dependencies/windows-sys-0.61.2/license-mit +21 -0
  339. package/LICENSES/dependencies/zmij-1.0.23/LICENSE-MIT +23 -0
  340. package/README.md +70 -0
  341. package/THIRD-PARTY.md +62 -0
  342. package/package.json +48 -9
  343. package/source/.cargo/config.toml +5 -0
  344. package/source/.ci/upstream-notices/PROVENANCE.json +198 -0
  345. package/source/.ci/upstream-notices/agent-client-protocol-2.1.0/LICENSE +191 -0
  346. package/source/.ci/upstream-notices/agent-client-protocol-derive-2.1.0/LICENSE +191 -0
  347. package/source/.ci/upstream-notices/agent-client-protocol-schema-1.7.0/LICENSE +190 -0
  348. package/source/.ci/upstream-notices/defmt-parser-1.0.0/LICENSE-APACHE +201 -0
  349. package/source/.ci/upstream-notices/defmt-parser-1.0.0/LICENSE-MIT +25 -0
  350. package/source/.ci/upstream-notices/r-efi-6.0.0/AUTHORS +75 -0
  351. package/source/.ci/upstream-notices/wasm-encoder-0.245.1/LICENSE-APACHE +201 -0
  352. package/source/.ci/upstream-notices/wasm-encoder-0.245.1/LICENSE-Apache-2.0_WITH_LLVM-exception +220 -0
  353. package/source/.ci/upstream-notices/wasm-encoder-0.245.1/LICENSE-MIT +23 -0
  354. package/source/.ci/upstream-notices/wasmparser-0.245.1/LICENSE-APACHE +201 -0
  355. package/source/.ci/upstream-notices/wasmparser-0.245.1/LICENSE-Apache-2.0_WITH_LLVM-exception +220 -0
  356. package/source/.ci/upstream-notices/wasmparser-0.245.1/LICENSE-MIT +23 -0
  357. package/source/.ci/wasm-bundle/Cargo.toml +10 -0
  358. package/source/.ci/wasm-bundle/src/main.rs +17 -0
  359. package/source/CHANGELOG.md +99 -0
  360. package/source/Cargo.lock +1630 -0
  361. package/source/Cargo.toml +48 -0
  362. package/source/LICENSE +307 -0
  363. package/source/LICENSE.md +30 -0
  364. package/source/LICENSES/GPL-3.0-only.txt +232 -0
  365. package/source/LICENSES/LGPL-3.0-linking-exception.txt +16 -0
  366. package/source/LICENSES/LGPL-3.0-only WITH LGPL-3.0-linking-exception.txt +16 -0
  367. package/source/LICENSES/LGPL-3.0-only.txt +304 -0
  368. package/source/README.md +289 -0
  369. package/source/THIRD-PARTY.md +62 -0
  370. package/source/dependencies.tar.gz +0 -0
  371. package/source/examples/native.rs +45 -0
  372. package/source/src/auth.rs +435 -0
  373. package/source/src/configuration.rs +140 -0
  374. package/source/src/conversation.rs +594 -0
  375. package/source/src/dock.rs +564 -0
  376. package/source/src/lib.rs +39 -0
  377. package/source/src/native/client.rs +401 -0
  378. package/source/src/native/drivers/codex.rs +506 -0
  379. package/source/src/native/drivers/mod.rs +305 -0
  380. package/source/src/native/drivers/opencode.rs +531 -0
  381. package/source/src/native/env.rs +264 -0
  382. package/source/src/native/fixture.py +191 -0
  383. package/source/src/native/mod.rs +257 -0
  384. package/source/src/native/pool.rs +440 -0
  385. package/source/src/native/session.rs +609 -0
  386. package/source/src/native/tests.rs +667 -0
  387. package/source/src/transport.rs +330 -0
  388. package/source/src/web.rs +35 -0
  389. package/src/auth.test.ts +115 -0
  390. package/src/components/ChatDock.component.test.ts +213 -0
  391. package/src/components/ChatDock.svelte +422 -0
  392. package/src/components/Dock.component.test.ts +92 -0
  393. package/src/components/Dock.svelte +6 -3
  394. package/src/components/StepConfig.component.test.ts +185 -0
  395. package/src/components/StepConfig.svelte +247 -0
  396. package/src/dock.test.ts +226 -0
  397. package/wasm/ccht_bg.wasm +0 -0
@@ -0,0 +1,185 @@
1
+ /** Browser behavior of the generic per-step config form (StepConfig.svelte).
2
+ *
3
+ * Covers step rendering, backend/model selection callbacks, the account
4
+ * slot branch, extra select/boolean controls, refresh, and error display.
5
+ */
6
+ import { render, fireEvent, cleanup } from '@testing-library/svelte';
7
+ import { afterEach, describe, expect, test, vi } from 'vitest';
8
+ import { createRawSnippet } from 'svelte';
9
+ import StepConfig from './StepConfig.svelte';
10
+ import type { StepData } from './StepConfig.svelte';
11
+
12
+ afterEach(() => cleanup());
13
+
14
+ function step(overrides: Partial<StepData> = {}): StepData {
15
+ return {
16
+ id: 'creator',
17
+ label: 'Creator chat',
18
+ backendValue: '',
19
+ backendOptions: [{ value: 'local', name: 'Local' }],
20
+ backendPlaceholder: 'Configured default',
21
+ accountConnected: true,
22
+ accountBusy: false,
23
+ configurationError: null,
24
+ modelValue: 'qwen',
25
+ modelOptions: [{ value: 'qwen', name: 'Qwen' }],
26
+ extraOptions: [],
27
+ extraValues: {},
28
+ ...overrides,
29
+ };
30
+ }
31
+
32
+ function openSteps(steps: StepData[], props: Record<string, unknown> = {}) {
33
+ return render(StepConfig, {
34
+ steps,
35
+ onSelectBackend: () => {},
36
+ onSelectModel: () => {},
37
+ onSelectOption: () => {},
38
+ onRefresh: () => {},
39
+ ...props,
40
+ });
41
+ }
42
+
43
+ describe('step rendering', () => {
44
+ test('renders one labelled group per step with backend and model selects', () => {
45
+ const { getByRole, getByLabelText } = openSteps([step(), step({ id: 'compile', label: 'Proposal compilation' })]);
46
+ expect(getByRole('group', { name: 'Creator chat' })).toBeTruthy();
47
+ expect(getByRole('group', { name: 'Proposal compilation' })).toBeTruthy();
48
+ expect(getByLabelText('Creator chat assistant')).toBeTruthy();
49
+ expect(getByLabelText('Creator chat model')).toBeTruthy();
50
+ });
51
+
52
+ test('backend and model selections forward step id and value', async () => {
53
+ const onSelectBackend = vi.fn();
54
+ const onSelectModel = vi.fn();
55
+ const { getByLabelText } = openSteps([step()], { onSelectBackend, onSelectModel });
56
+ await fireEvent.change(getByLabelText('Creator chat assistant'), { target: { value: 'local' } });
57
+ expect(onSelectBackend).toHaveBeenCalledWith('creator', 'local');
58
+ await fireEvent.change(getByLabelText('Creator chat model'), { target: { value: 'qwen' } });
59
+ expect(onSelectModel).toHaveBeenCalledWith('creator', 'qwen');
60
+ });
61
+
62
+ test('empty model options render a No model placeholder', () => {
63
+ const { getByLabelText } = openSteps([step({ modelValue: '', modelOptions: [] })]);
64
+ expect(getByLabelText('Creator chat model').textContent).toContain('No model');
65
+ });
66
+ });
67
+
68
+ describe('account branch', () => {
69
+ test('disconnected steps without a slot fall back to model controls', () => {
70
+ const { getByLabelText } = openSteps([step({ accountConnected: false })]);
71
+ expect(getByLabelText('Creator chat model')).toBeTruthy();
72
+ });
73
+
74
+ test('disconnected steps render the account slot with the step id', () => {
75
+ const accountSlot = createRawSnippet<{ step: string }>((getStep) => ({
76
+ render: () => `<button type="button" data-step="${getStep().step}">connect</button>`,
77
+ }));
78
+ const { getByRole, queryByLabelText } = openSteps([step({ accountConnected: false })], { accountSlot });
79
+ expect(queryByLabelText('Creator chat model')).toBeNull();
80
+ expect(getByRole('button', { name: 'connect' }).getAttribute('data-step')).toBe('creator');
81
+ });
82
+
83
+ test('connected steps render model controls even with a slot provided', () => {
84
+ const { getByLabelText } = render(StepConfig, {
85
+ steps: [step({ accountConnected: true })],
86
+ onSelectBackend: () => {},
87
+ onSelectModel: () => {},
88
+ onSelectOption: () => {},
89
+ onRefresh: () => {},
90
+ accountSlot: (() => {}) as never,
91
+ });
92
+ expect(getByLabelText('Creator chat model')).toBeTruthy();
93
+ });
94
+ });
95
+
96
+ describe('extra controls', () => {
97
+ const options = [
98
+ {
99
+ id: 'model',
100
+ name: 'Model',
101
+ category: 'model',
102
+ type: 'select',
103
+ currentValue: 'one',
104
+ options: [{ value: 'one', name: 'One' }],
105
+ },
106
+ {
107
+ id: 'thinking',
108
+ name: 'Thinking',
109
+ type: 'boolean',
110
+ currentValue: true,
111
+ },
112
+ ];
113
+
114
+ test('model-category controls are filtered out; others render', () => {
115
+ const { queryByLabelText, getByLabelText } = openSteps([step({ extraOptions: options as never })]);
116
+ expect(queryByLabelText('Model')).toBeNull();
117
+ expect(getByLabelText('Thinking')).toBeTruthy();
118
+ });
119
+
120
+ test('select and boolean edits forward option and typed value', async () => {
121
+ const onSelectOption = vi.fn();
122
+ const selectOptions = [
123
+ {
124
+ id: 'effort',
125
+ name: 'Effort',
126
+ type: 'select',
127
+ currentValue: 'low',
128
+ options: [{ value: 'low', name: 'Low' }, { value: 'high', name: 'High' }],
129
+ },
130
+ ];
131
+ const { getByLabelText } = openSteps(
132
+ [step({ extraOptions: [...selectOptions, options[1]] as never, extraValues: { effort: 'low', thinking: true } })],
133
+ { onSelectOption },
134
+ );
135
+ await fireEvent.change(getByLabelText('Effort'), { target: { value: 'high' } });
136
+ expect(onSelectOption).toHaveBeenCalledWith('creator', expect.objectContaining({ id: 'effort' }), 'high');
137
+ const thinking = getByLabelText('Thinking') as HTMLInputElement;
138
+ expect(thinking.checked).toBe(true);
139
+ await fireEvent.click(thinking);
140
+ expect(onSelectOption).toHaveBeenCalledWith('creator', expect.objectContaining({ id: 'thinking' }), false);
141
+ });
142
+
143
+ test('grouped select choices flatten in order', async () => {
144
+ const onSelectOption = vi.fn();
145
+ const { getByLabelText } = openSteps(
146
+ [
147
+ step({
148
+ extraOptions: [
149
+ {
150
+ id: 'model2',
151
+ name: 'Second',
152
+ type: 'select',
153
+ currentValue: 'b',
154
+ options: [{ group: 'g', name: 'G', options: [{ value: 'a', name: 'A' }, { value: 'b', name: 'B' }] }],
155
+ },
156
+ ] as never,
157
+ }),
158
+ ],
159
+ { onSelectOption },
160
+ );
161
+ const select = getByLabelText('Second') as HTMLSelectElement;
162
+ expect([...select.options].map((option) => option.value)).toEqual(['a', 'b']);
163
+ });
164
+ });
165
+
166
+ describe('refresh and errors', () => {
167
+ test('refresh button forwards the step id and reflects loading', async () => {
168
+ const onRefresh = vi.fn();
169
+ const idle = openSteps([step()], { onRefresh });
170
+ await fireEvent.click(idle.getByRole('button', { name: 'Refresh models' }));
171
+ expect(onRefresh).toHaveBeenCalledWith('creator');
172
+ const loading = openSteps([step()], { onRefresh, refreshing: true });
173
+ expect(loading.getByRole('button', { name: 'Loading controls…' })).toBeTruthy();
174
+ });
175
+
176
+ test('configuration errors render as alerts', () => {
177
+ const { getByText } = openSteps([step({ configurationError: 'stale options' })]);
178
+ expect(getByText('stale options')).toBeTruthy();
179
+ });
180
+
181
+ test('no refresh row while disconnected', () => {
182
+ const { queryByRole } = openSteps([step({ accountConnected: false })]);
183
+ expect(queryByRole('button', { name: 'Refresh models' })).toBeNull();
184
+ });
185
+ });
@@ -0,0 +1,247 @@
1
+ <!-- Generic per-step backend/model/options config form (content only).
2
+ The application wraps this in a Dock and owns all effects (loading model
3
+ lists, refreshing controls, connecting accounts); this component only
4
+ renders one fieldset per step and forwards user intent through
5
+ app-supplied callbacks. It never fetches, spawns, or stores anything. -->
6
+ <script module lang="ts">
7
+ import type { SessionConfigOption } from '../../index.js';
8
+
9
+ export interface StepBackendOption {
10
+ value: string;
11
+ name: string;
12
+ }
13
+
14
+ export interface StepModelOption {
15
+ value: string;
16
+ name: string;
17
+ }
18
+
19
+ export interface StepData {
20
+ id: string;
21
+ label: string;
22
+ backendValue: string;
23
+ backendOptions: StepBackendOption[];
24
+ backendPlaceholder: string;
25
+ accountConnected: boolean;
26
+ accountBusy: boolean;
27
+ configurationError?: string | null;
28
+ modelValue: string;
29
+ modelOptions: StepModelOption[];
30
+ extraOptions: SessionConfigOption[];
31
+ extraValues: Record<string, string | boolean>;
32
+ }
33
+ </script>
34
+
35
+ <script lang="ts">
36
+ import type { Snippet } from 'svelte';
37
+ import type {
38
+ ConfigChoice,
39
+ ConfigGroup,
40
+ SessionConfigOption
41
+ } from '../../index.js';
42
+
43
+ let {
44
+ steps,
45
+ refreshing = false,
46
+ onSelectBackend,
47
+ onSelectModel,
48
+ onSelectOption,
49
+ onRefresh,
50
+ accountSlot,
51
+ headerCopy,
52
+ footerSlot
53
+ }: {
54
+ steps: StepData[];
55
+ refreshing?: boolean;
56
+ onSelectBackend: (id: string, value: string) => void;
57
+ onSelectModel: (id: string, value: string) => void;
58
+ onSelectOption: (
59
+ id: string,
60
+ option: SessionConfigOption,
61
+ value: string | boolean
62
+ ) => void;
63
+ onRefresh: (id: string) => void;
64
+ accountSlot?: Snippet<[{ step: string }]>;
65
+ headerCopy?: Snippet;
66
+ footerSlot?: Snippet;
67
+ } = $props();
68
+
69
+ // Flatten grouped select choices while preserving order.
70
+ function choices(option: SessionConfigOption | undefined): ConfigChoice[] {
71
+ if (option?.type !== 'select') return [];
72
+ return option.options.flatMap((entry) =>
73
+ 'options' in entry
74
+ ? (entry as ConfigGroup).options
75
+ : [entry as ConfigChoice]
76
+ );
77
+ }
78
+
79
+ // Drop the model control defensively; it has its own dedicated row.
80
+ function extraOptions(step: StepData): SessionConfigOption[] {
81
+ return step.extraOptions.filter(
82
+ (item) => item.category !== 'model' && item.id !== 'model'
83
+ );
84
+ }
85
+
86
+ function selectedValue(
87
+ step: StepData,
88
+ option: SessionConfigOption
89
+ ): string | boolean {
90
+ return step.extraValues[option.id] ?? option.currentValue;
91
+ }
92
+ </script>
93
+
94
+ {#if headerCopy}
95
+ <div class="ccht-steps-copy">{@render headerCopy()}</div>
96
+ {/if}
97
+
98
+ {#each steps as step (step.id)}
99
+ <fieldset class="ccht-step">
100
+ <legend>{step.label}</legend>
101
+ <label class="ccht-step-label" for={`ccht-step-${step.id}-assistant`}>
102
+ {step.label} assistant
103
+ </label>
104
+ <select
105
+ id={`ccht-step-${step.id}-assistant`}
106
+ class="ccht-step-select"
107
+ value={step.backendValue}
108
+ disabled={step.accountBusy}
109
+ onchange={(event) => onSelectBackend(step.id, event.currentTarget.value)}
110
+ >
111
+ <option value="">{step.backendPlaceholder}</option>
112
+ {#each step.backendOptions as backend (backend.value)}
113
+ <option value={backend.value}>{backend.name}</option>
114
+ {/each}
115
+ </select>
116
+ {#if accountSlot && !step.accountConnected}
117
+ {@render accountSlot({ step: step.id })}
118
+ {:else}
119
+ <label class="ccht-step-label" for={`ccht-step-${step.id}-model`}>
120
+ {step.label} model
121
+ </label>
122
+ <select
123
+ id={`ccht-step-${step.id}-model`}
124
+ class="ccht-step-select"
125
+ value={step.modelValue}
126
+ onchange={(event) => onSelectModel(step.id, event.currentTarget.value)}
127
+ >
128
+ {#if step.modelOptions.length}
129
+ {#each step.modelOptions as model (model.value)}
130
+ <option value={model.value}>{model.name}</option>
131
+ {/each}
132
+ {:else if step.modelValue}
133
+ <option value={step.modelValue}>{step.modelValue}</option>
134
+ {:else}
135
+ <option value="" disabled>No model</option>
136
+ {/if}
137
+ </select>
138
+ {#each extraOptions(step) as item (item.id)}
139
+ <label
140
+ class="ccht-step-label"
141
+ for={`ccht-step-${step.id}-option-${item.id}`}
142
+ title={item.description}
143
+ >
144
+ {item.name}
145
+ </label>
146
+ {#if item.type === 'select'}
147
+ <select
148
+ id={`ccht-step-${step.id}-option-${item.id}`}
149
+ class="ccht-step-select"
150
+ value={String(selectedValue(step, item))}
151
+ disabled={refreshing}
152
+ onchange={(event) =>
153
+ onSelectOption(step.id, item, event.currentTarget.value)}
154
+ >
155
+ {#each choices(item) as choice (choice.value)}
156
+ <option value={choice.value}>{choice.name}</option>
157
+ {/each}
158
+ </select>
159
+ {:else if item.type === 'boolean'}
160
+ <input
161
+ id={`ccht-step-${step.id}-option-${item.id}`}
162
+ class="ccht-step-check"
163
+ type="checkbox"
164
+ checked={Boolean(selectedValue(step, item))}
165
+ disabled={refreshing}
166
+ onchange={(event) =>
167
+ onSelectOption(step.id, item, event.currentTarget.checked)}
168
+ />
169
+ {/if}
170
+ {/each}
171
+ {#if step.accountConnected}
172
+ <button
173
+ type="button"
174
+ class="ccht-step-refresh"
175
+ disabled={refreshing}
176
+ onclick={() => onRefresh(step.id)}
177
+ >
178
+ {refreshing ? 'Loading controls…' : 'Refresh models'}
179
+ </button>
180
+ {#if step.configurationError}
181
+ <span class="ccht-step-error" role="alert">
182
+ {step.configurationError}
183
+ </span>
184
+ {/if}
185
+ {/if}
186
+ {/if}
187
+ </fieldset>
188
+ {/each}
189
+
190
+ {#if footerSlot}
191
+ {@render footerSlot()}
192
+ {/if}
193
+
194
+ <style>
195
+ .ccht-steps-copy {
196
+ margin: 0;
197
+ font-size: 0.85rem;
198
+ line-height: 1.5;
199
+ color: var(--ccht-muted, #8fa0b7);
200
+ }
201
+ .ccht-step {
202
+ display: grid;
203
+ gap: 0.45rem;
204
+ margin: 0;
205
+ border: 1px solid var(--ccht-border, #30405c);
206
+ border-radius: 0.5rem;
207
+ padding: 0.75rem;
208
+ }
209
+ .ccht-step legend {
210
+ font-weight: 700;
211
+ padding: 0 0.4rem;
212
+ }
213
+ .ccht-step-label {
214
+ font-size: 0.75rem;
215
+ color: var(--ccht-muted, #8fa0b7);
216
+ }
217
+ .ccht-step-select {
218
+ min-width: 0;
219
+ width: 100%;
220
+ padding: 0.5rem;
221
+ border: 1px solid var(--ccht-select-border, #405779);
222
+ border-radius: 0.4rem;
223
+ background: var(--ccht-select-bg, #070f1b);
224
+ color: var(--ccht-fg-bright, #e2eaf5);
225
+ }
226
+ .ccht-step-check {
227
+ width: 1rem;
228
+ min-height: 1rem;
229
+ margin: 0;
230
+ accent-color: var(--ccht-accent-check, #34d399);
231
+ }
232
+ .ccht-step-refresh {
233
+ min-height: 2.2rem;
234
+ padding: 0.4rem 0.6rem;
235
+ border: 1px solid var(--ccht-border, #30405c);
236
+ border-radius: 0.4rem;
237
+ background: var(--ccht-tab-bg, #111c2d);
238
+ color: var(--ccht-fg, #bdc8d7);
239
+ font-size: 0.7rem;
240
+ font-weight: 750;
241
+ cursor: pointer;
242
+ }
243
+ .ccht-step-error {
244
+ color: var(--ccht-error, #fda4af);
245
+ font-size: 0.7rem;
246
+ }
247
+ </style>
@@ -0,0 +1,226 @@
1
+ /** Conformance tests for the framework-free dock state (web/src/dock.ts).
2
+ *
3
+ * These mirror the Rust `src/dock.rs` unit tests case-for-case: both
4
+ * implementations share the id rules, error names, open/placement
5
+ * semantics, focus-token lifecycle, and serialization contract. Fixtures
6
+ * only; no DOM, network, or storage.
7
+ */
8
+ import { describe, expect, test } from 'bun:test';
9
+ import { createDockManager, validateDockId } from './dock.ts';
10
+
11
+ describe('validateDockId', () => {
12
+ test('accepts lowercase, digits, dash, underscore', () => {
13
+ for (const id of ['a', 'scope', 'models-panel', 'chat_2', 'a-b_c9']) {
14
+ expect(validateDockId(id)).toBeNull();
15
+ }
16
+ });
17
+
18
+ test('accepts exactly 64 characters', () => {
19
+ expect(validateDockId('a'.repeat(64))).toBeNull();
20
+ });
21
+
22
+ test('rejects empty, non-string, too long, and bad characters', () => {
23
+ expect(validateDockId('')).not.toBeNull();
24
+ expect(validateDockId('a'.repeat(65))).not.toBeNull();
25
+ for (const id of ['Scope', 'has space', 'dot.name', 'slash/x', 'uniçode', 'CAPS'] as unknown[]) {
26
+ expect(validateDockId(id)).not.toBeNull();
27
+ }
28
+ for (const id of [null, undefined, 42, true, {}, []] as unknown[]) {
29
+ expect(validateDockId(id)).not.toBeNull();
30
+ }
31
+ });
32
+
33
+ test('never throws', () => {
34
+ expect(() => validateDockId(Symbol('x') as unknown as string)).not.toThrow();
35
+ });
36
+ });
37
+
38
+ describe('register', () => {
39
+ test('registers closed docks of every kind and placement', () => {
40
+ const docks = createDockManager();
41
+ docks.register('chat', 'chat', 'left');
42
+ docks.register('cfg', 'config', 'right');
43
+ docks.register('misc', 'custom', 'bottom');
44
+ docks.register('inline', 'custom', 'inline');
45
+ expect(docks.isOpen('chat')).toBe(false);
46
+ expect(docks.placement('cfg')).toBe('right');
47
+ });
48
+
49
+ test('rejects duplicates, malformed ids, kinds, and placements', () => {
50
+ const docks = createDockManager();
51
+ docks.register('scope', 'config', 'left');
52
+ expect(() => docks.register('scope', 'config', 'left')).toThrow('DuplicateDock: scope');
53
+ expect(() => docks.register('', 'config', 'left')).toThrow();
54
+ expect(() => docks.register('other', 'bogus' as never, 'left')).toThrow('invalid dock kind');
55
+ expect(() => docks.register('other', 'config', 'top' as never)).toThrow('invalid dock placement');
56
+ });
57
+ });
58
+
59
+ describe('open/close/toggle', () => {
60
+ test('open and close are idempotent; toggle flips and returns state', () => {
61
+ const docks = createDockManager();
62
+ docks.register('a', 'chat', 'left');
63
+ docks.open('a');
64
+ docks.open('a');
65
+ expect(docks.isOpen('a')).toBe(true);
66
+ expect(docks.toggle('a')).toBe(false);
67
+ expect(docks.toggle('a')).toBe(true);
68
+ docks.close('a');
69
+ docks.close('a');
70
+ expect(docks.isOpen('a')).toBe(false);
71
+ });
72
+
73
+ test('unknown ids throw UnknownDock on every accessor', () => {
74
+ const docks = createDockManager();
75
+ for (const fn of [
76
+ () => docks.open('nope'),
77
+ () => docks.openWithFocus('nope', 't'),
78
+ () => docks.close('nope'),
79
+ () => docks.toggle('nope'),
80
+ () => docks.isOpen('nope'),
81
+ () => docks.placement('nope'),
82
+ () => docks.setPlacement('nope', 'left'),
83
+ ]) {
84
+ expect(fn).toThrow('UnknownDock: nope');
85
+ }
86
+ });
87
+
88
+ test('docks are independent and openDocks preserves registration order', () => {
89
+ const docks = createDockManager();
90
+ docks.register('one', 'chat', 'left');
91
+ docks.register('two', 'config', 'right');
92
+ docks.register('three', 'custom', 'inline');
93
+ docks.open('three');
94
+ docks.open('one');
95
+ expect(docks.openDocks()).toEqual(['one', 'three']);
96
+ docks.close('one');
97
+ expect(docks.openDocks()).toEqual(['three']);
98
+ });
99
+
100
+ test('setPlacement moves only the target dock', () => {
101
+ const docks = createDockManager();
102
+ docks.register('a', 'chat', 'left');
103
+ docks.register('b', 'chat', 'left');
104
+ docks.setPlacement('a', 'bottom');
105
+ expect(docks.placement('a')).toBe('bottom');
106
+ expect(docks.placement('b')).toBe('left');
107
+ expect(() => docks.setPlacement('a', 'nowhere' as never)).toThrow('invalid dock placement');
108
+ });
109
+
110
+ test('closeAll closes everything but keeps the staged token', () => {
111
+ const docks = createDockManager();
112
+ docks.register('a', 'chat', 'left');
113
+ docks.register('b', 'config', 'right');
114
+ docks.openWithFocus('a', 'tok');
115
+ docks.open('b');
116
+ docks.closeAll();
117
+ expect(docks.openDocks()).toEqual([]);
118
+ expect(docks.takeFocusToken()).toBe('tok');
119
+ });
120
+ });
121
+
122
+ describe('focus token', () => {
123
+ test('openWithFocus stages, plain open preserves, take consumes once', () => {
124
+ const docks = createDockManager();
125
+ docks.register('a', 'chat', 'left');
126
+ expect(docks.takeFocusToken()).toBeNull();
127
+ docks.openWithFocus('a', 'first');
128
+ docks.open('a');
129
+ expect(docks.takeFocusToken()).toBe('first');
130
+ expect(docks.takeFocusToken()).toBeNull();
131
+ docks.openWithFocus('a', 'second');
132
+ docks.close('a');
133
+ expect(docks.takeFocusToken()).toBe('second');
134
+ });
135
+
136
+ test('empty tokens are rejected before lookup', () => {
137
+ const docks = createDockManager();
138
+ docks.register('a', 'chat', 'left');
139
+ expect(() => docks.openWithFocus('a', '')).toThrow('invalid focus token');
140
+ expect(() => docks.openWithFocus('ghost', '')).toThrow('invalid focus token');
141
+ expect(docks.takeFocusToken()).toBeNull();
142
+ });
143
+
144
+ test('managers are independent', () => {
145
+ const first = createDockManager();
146
+ const second = createDockManager();
147
+ first.register('a', 'chat', 'left');
148
+ second.register('a', 'chat', 'left');
149
+ first.openWithFocus('a', 'tok');
150
+ expect(second.isOpen('a')).toBe(false);
151
+ expect(second.takeFocusToken()).toBeNull();
152
+ });
153
+ });
154
+
155
+ describe('serialize/restore', () => {
156
+ test('round-trips open state and placement without the focus token', () => {
157
+ const docks = createDockManager();
158
+ docks.register('scope', 'config', 'left');
159
+ docks.register('models', 'config', 'right');
160
+ docks.openWithFocus('scope', 'tok');
161
+ docks.setPlacement('models', 'bottom');
162
+ const snapshot = docks.serialize();
163
+ expect(snapshot).not.toContain('tok');
164
+ const revived = createDockManager();
165
+ revived.restore(snapshot);
166
+ expect(revived.isOpen('scope')).toBe(true);
167
+ expect(revived.isOpen('models')).toBe(false);
168
+ expect(revived.placement('models')).toBe('bottom');
169
+ expect(revived.takeFocusToken()).toBeNull();
170
+ });
171
+
172
+ test('empty managers round-trip', () => {
173
+ const revived = createDockManager();
174
+ revived.restore(createDockManager().serialize());
175
+ expect(revived.openDocks()).toEqual([]);
176
+ });
177
+
178
+ test('malformed snapshots throw and leave state untouched', () => {
179
+ const malformed = [
180
+ 'not json',
181
+ '{}',
182
+ '[null]',
183
+ '["scope"]',
184
+ '[{}]',
185
+ '[{"id":"","kind":"config","placement":"left","open":false}]',
186
+ '[{"id":"UPPER","kind":"config","placement":"left","open":false}]',
187
+ '[{"id":"a","kind":"bogus","placement":"left","open":false}]',
188
+ '[{"id":"a","kind":"config","placement":"top","open":false}]',
189
+ '[{"id":"a","kind":"config","placement":"left"}]',
190
+ '[{"id":"a","kind":"config","placement":"left","open":"yes"}]',
191
+ '[{"id":"a","kind":"config","placement":"left","open":false},{"id":"a","kind":"chat","placement":"right","open":true}]',
192
+ ];
193
+ for (const snapshot of malformed) {
194
+ const docks = createDockManager();
195
+ docks.register('keep', 'chat', 'left');
196
+ docks.open('keep');
197
+ expect(() => docks.restore(snapshot)).toThrow(/^invalid dock snapshot/);
198
+ expect(docks.isOpen('keep')).toBe(true);
199
+ expect(docks.openDocks()).toEqual(['keep']);
200
+ }
201
+ });
202
+
203
+ test('restore replaces everything and clears the staged token', () => {
204
+ const docks = createDockManager();
205
+ docks.register('stale', 'chat', 'left');
206
+ docks.openWithFocus('stale', 'tok');
207
+ docks.restore('[{"id":"fresh","kind":"custom","placement":"inline","open":true}]');
208
+ expect(() => docks.isOpen('stale')).toThrow('UnknownDock: stale');
209
+ expect(docks.isOpen('fresh')).toBe(true);
210
+ expect(docks.takeFocusToken()).toBeNull();
211
+ });
212
+
213
+ test('error messages never carry focus tokens', () => {
214
+ const docks = createDockManager();
215
+ docks.register('a', 'chat', 'left');
216
+ docks.openWithFocus('a', 'secret-token');
217
+ for (const fn of [() => docks.open('ghost'), () => docks.toggle('ghost'), () => docks.restore('[1]')]) {
218
+ try {
219
+ fn();
220
+ expect.unreachable();
221
+ } catch (error) {
222
+ expect(String(error)).not.toContain('secret-token');
223
+ }
224
+ }
225
+ });
226
+ });
package/wasm/ccht_bg.wasm CHANGED
Binary file