@corbet-labs/ccht 0.2.0 → 0.2.2

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 (382) hide show
  1. package/README.md +194 -212
  2. package/index.d.ts +6 -1
  3. package/index.js +8 -1
  4. package/package.json +12 -26
  5. package/src/auth.ts +149 -0
  6. package/src/components/AccountConnection.svelte +201 -0
  7. package/src/components/Dock.svelte +172 -0
  8. package/src/dock.ts +244 -0
  9. package/wasm/ccht_bg.wasm +0 -0
  10. package/LICENSE +0 -307
  11. package/LICENSE.md +0 -25
  12. package/LICENSES/GPL-3.0-only.txt +0 -232
  13. package/LICENSES/LGPL-3.0-only.txt +0 -304
  14. package/LICENSES/dependencies/agent-client-protocol-2.1.0/LICENSE +0 -191
  15. package/LICENSES/dependencies/agent-client-protocol-derive-2.1.0/LICENSE +0 -191
  16. package/LICENSES/dependencies/agent-client-protocol-schema-1.7.0/LICENSE +0 -190
  17. package/LICENSES/dependencies/android_system_properties-0.1.6/LICENSE-APACHE +0 -13
  18. package/LICENSES/dependencies/android_system_properties-0.1.6/LICENSE-MIT +0 -20
  19. package/LICENSES/dependencies/anyhow-1.0.104/LICENSE-APACHE +0 -176
  20. package/LICENSES/dependencies/anyhow-1.0.104/LICENSE-MIT +0 -23
  21. package/LICENSES/dependencies/async-channel-2.5.0/LICENSE-APACHE +0 -201
  22. package/LICENSES/dependencies/async-channel-2.5.0/LICENSE-MIT +0 -23
  23. package/LICENSES/dependencies/async-io-2.6.0/LICENSE-APACHE +0 -201
  24. package/LICENSES/dependencies/async-io-2.6.0/LICENSE-MIT +0 -23
  25. package/LICENSES/dependencies/async-lock-3.4.2/LICENSE-APACHE +0 -201
  26. package/LICENSES/dependencies/async-lock-3.4.2/LICENSE-MIT +0 -23
  27. package/LICENSES/dependencies/async-process-2.5.0/LICENSE-APACHE +0 -201
  28. package/LICENSES/dependencies/async-process-2.5.0/LICENSE-MIT +0 -23
  29. package/LICENSES/dependencies/async-signal-0.2.14/LICENSE-APACHE +0 -201
  30. package/LICENSES/dependencies/async-signal-0.2.14/LICENSE-MIT +0 -23
  31. package/LICENSES/dependencies/async-task-4.7.1/LICENSE-APACHE +0 -201
  32. package/LICENSES/dependencies/async-task-4.7.1/LICENSE-MIT +0 -23
  33. package/LICENSES/dependencies/atomic-waker-1.1.2/LICENSE-APACHE +0 -201
  34. package/LICENSES/dependencies/atomic-waker-1.1.2/LICENSE-MIT +0 -23
  35. package/LICENSES/dependencies/atomic-waker-1.1.2/LICENSE-THIRD-PARTY +0 -45
  36. package/LICENSES/dependencies/autocfg-1.5.1/LICENSE-APACHE +0 -201
  37. package/LICENSES/dependencies/autocfg-1.5.1/LICENSE-MIT +0 -25
  38. package/LICENSES/dependencies/base64-0.22.1/LICENSE-APACHE +0 -201
  39. package/LICENSES/dependencies/base64-0.22.1/LICENSE-MIT +0 -21
  40. package/LICENSES/dependencies/base64-0.23.1/LICENSE-APACHE +0 -201
  41. package/LICENSES/dependencies/base64-0.23.1/LICENSE-MIT +0 -21
  42. package/LICENSES/dependencies/bitflags-1.3.2/LICENSE-APACHE +0 -201
  43. package/LICENSES/dependencies/bitflags-1.3.2/LICENSE-MIT +0 -25
  44. package/LICENSES/dependencies/bitflags-2.13.2/LICENSE-APACHE +0 -201
  45. package/LICENSES/dependencies/bitflags-2.13.2/LICENSE-MIT +0 -25
  46. package/LICENSES/dependencies/blocking-1.7.0/LICENSE-APACHE +0 -201
  47. package/LICENSES/dependencies/blocking-1.7.0/LICENSE-MIT +0 -23
  48. package/LICENSES/dependencies/bs58-0.5.1/LICENSE-APACHE +0 -201
  49. package/LICENSES/dependencies/bs58-0.5.1/LICENSE-MIT +0 -20
  50. package/LICENSES/dependencies/bumpalo-3.20.3/LICENSE-APACHE +0 -201
  51. package/LICENSES/dependencies/bumpalo-3.20.3/LICENSE-MIT +0 -25
  52. package/LICENSES/dependencies/cc-1.4.5/LICENSE-APACHE +0 -201
  53. package/LICENSES/dependencies/cc-1.4.5/LICENSE-MIT +0 -25
  54. package/LICENSES/dependencies/cfg-if-1.0.4/LICENSE-APACHE +0 -201
  55. package/LICENSES/dependencies/cfg-if-1.0.4/LICENSE-MIT +0 -25
  56. package/LICENSES/dependencies/chrono-0.4.45/LICENSE.txt +0 -240
  57. package/LICENSES/dependencies/concurrent-queue-2.5.0/LICENSE-APACHE +0 -201
  58. package/LICENSES/dependencies/concurrent-queue-2.5.0/LICENSE-MIT +0 -23
  59. package/LICENSES/dependencies/convert_case-0.10.0/LICENSE +0 -21
  60. package/LICENSES/dependencies/core-foundation-sys-0.8.7/LICENSE-APACHE +0 -201
  61. package/LICENSES/dependencies/core-foundation-sys-0.8.7/LICENSE-MIT +0 -25
  62. package/LICENSES/dependencies/crossbeam-deque-0.8.8/LICENSE-APACHE +0 -201
  63. package/LICENSES/dependencies/crossbeam-deque-0.8.8/LICENSE-MIT +0 -27
  64. package/LICENSES/dependencies/crossbeam-epoch-0.9.21/LICENSE-APACHE +0 -201
  65. package/LICENSES/dependencies/crossbeam-epoch-0.9.21/LICENSE-MIT +0 -27
  66. package/LICENSES/dependencies/crossbeam-utils-0.8.23/LICENSE-APACHE +0 -201
  67. package/LICENSES/dependencies/crossbeam-utils-0.8.23/LICENSE-MIT +0 -27
  68. package/LICENSES/dependencies/darling-0.24.1/LICENSE +0 -21
  69. package/LICENSES/dependencies/darling_core-0.24.1/LICENSE +0 -21
  70. package/LICENSES/dependencies/darling_macro-0.24.1/LICENSE +0 -21
  71. package/LICENSES/dependencies/defmt-1.1.1/LICENSE-APACHE +0 -201
  72. package/LICENSES/dependencies/defmt-1.1.1/LICENSE-MIT +0 -25
  73. package/LICENSES/dependencies/defmt-macros-1.1.1/LICENSE-APACHE +0 -201
  74. package/LICENSES/dependencies/defmt-macros-1.1.1/LICENSE-MIT +0 -25
  75. package/LICENSES/dependencies/defmt-parser-1.0.0/LICENSE-APACHE +0 -201
  76. package/LICENSES/dependencies/defmt-parser-1.0.0/LICENSE-MIT +0 -25
  77. package/LICENSES/dependencies/deranged-0.5.8/LICENSE-Apache +0 -202
  78. package/LICENSES/dependencies/deranged-0.5.8/LICENSE-MIT +0 -19
  79. package/LICENSES/dependencies/derive_more-2.1.1/LICENSE +0 -21
  80. package/LICENSES/dependencies/derive_more-impl-2.1.1/LICENSE +0 -21
  81. package/LICENSES/dependencies/dyn-clone-1.0.20/LICENSE-APACHE +0 -176
  82. package/LICENSES/dependencies/dyn-clone-1.0.20/LICENSE-MIT +0 -23
  83. package/LICENSES/dependencies/either-1.18.0/LICENSE-APACHE +0 -201
  84. package/LICENSES/dependencies/either-1.18.0/LICENSE-MIT +0 -25
  85. package/LICENSES/dependencies/equivalent-1.0.2/LICENSE-APACHE +0 -201
  86. package/LICENSES/dependencies/equivalent-1.0.2/LICENSE-MIT +0 -25
  87. package/LICENSES/dependencies/errno-0.3.14/LICENSE-APACHE +0 -201
  88. package/LICENSES/dependencies/errno-0.3.14/LICENSE-MIT +0 -25
  89. package/LICENSES/dependencies/event-listener-5.4.2/LICENSE-APACHE +0 -201
  90. package/LICENSES/dependencies/event-listener-5.4.2/LICENSE-MIT +0 -23
  91. package/LICENSES/dependencies/event-listener-strategy-0.5.4/LICENSE-APACHE +0 -201
  92. package/LICENSES/dependencies/event-listener-strategy-0.5.4/LICENSE-MIT +0 -23
  93. package/LICENSES/dependencies/fallible-iterator-0.3.0/LICENSE-APACHE +0 -202
  94. package/LICENSES/dependencies/fallible-iterator-0.3.0/LICENSE-MIT +0 -19
  95. package/LICENSES/dependencies/fastrand-2.5.0/LICENSE-APACHE +0 -201
  96. package/LICENSES/dependencies/fastrand-2.5.0/LICENSE-MIT +0 -23
  97. package/LICENSES/dependencies/find-msvc-tools-0.1.12/LICENSE-APACHE +0 -201
  98. package/LICENSES/dependencies/find-msvc-tools-0.1.12/LICENSE-MIT +0 -25
  99. package/LICENSES/dependencies/fixedbitset-0.5.7/LICENSE-APACHE +0 -201
  100. package/LICENSES/dependencies/fixedbitset-0.5.7/LICENSE-MIT +0 -25
  101. package/LICENSES/dependencies/foldhash-0.2.0/LICENSE +0 -19
  102. package/LICENSES/dependencies/futures-0.3.34/LICENSE-APACHE +0 -202
  103. package/LICENSES/dependencies/futures-0.3.34/LICENSE-MIT +0 -26
  104. package/LICENSES/dependencies/futures-channel-0.3.34/LICENSE-APACHE +0 -202
  105. package/LICENSES/dependencies/futures-channel-0.3.34/LICENSE-MIT +0 -26
  106. package/LICENSES/dependencies/futures-concurrency-7.7.1/LICENSE-APACHE +0 -190
  107. package/LICENSES/dependencies/futures-concurrency-7.7.1/LICENSE-MIT +0 -21
  108. package/LICENSES/dependencies/futures-core-0.3.34/LICENSE-APACHE +0 -202
  109. package/LICENSES/dependencies/futures-core-0.3.34/LICENSE-MIT +0 -26
  110. package/LICENSES/dependencies/futures-executor-0.3.34/LICENSE-APACHE +0 -202
  111. package/LICENSES/dependencies/futures-executor-0.3.34/LICENSE-MIT +0 -26
  112. package/LICENSES/dependencies/futures-io-0.3.34/LICENSE-APACHE +0 -202
  113. package/LICENSES/dependencies/futures-io-0.3.34/LICENSE-MIT +0 -26
  114. package/LICENSES/dependencies/futures-lite-2.6.1/LICENSE-APACHE +0 -201
  115. package/LICENSES/dependencies/futures-lite-2.6.1/LICENSE-MIT +0 -23
  116. package/LICENSES/dependencies/futures-lite-2.6.1/LICENSE-THIRD-PARTY +0 -45
  117. package/LICENSES/dependencies/futures-macro-0.3.34/LICENSE-APACHE +0 -202
  118. package/LICENSES/dependencies/futures-macro-0.3.34/LICENSE-MIT +0 -26
  119. package/LICENSES/dependencies/futures-sink-0.3.34/LICENSE-APACHE +0 -202
  120. package/LICENSES/dependencies/futures-sink-0.3.34/LICENSE-MIT +0 -26
  121. package/LICENSES/dependencies/futures-task-0.3.34/LICENSE-APACHE +0 -202
  122. package/LICENSES/dependencies/futures-task-0.3.34/LICENSE-MIT +0 -26
  123. package/LICENSES/dependencies/futures-util-0.3.34/LICENSE-APACHE +0 -202
  124. package/LICENSES/dependencies/futures-util-0.3.34/LICENSE-MIT +0 -26
  125. package/LICENSES/dependencies/getrandom-0.4.3/LICENSE-APACHE +0 -201
  126. package/LICENSES/dependencies/getrandom-0.4.3/LICENSE-MIT +0 -26
  127. package/LICENSES/dependencies/gimli-0.32.3/LICENSE-APACHE +0 -201
  128. package/LICENSES/dependencies/gimli-0.32.3/LICENSE-MIT +0 -25
  129. package/LICENSES/dependencies/hashbrown-0.12.3/LICENSE-APACHE +0 -201
  130. package/LICENSES/dependencies/hashbrown-0.12.3/LICENSE-MIT +0 -25
  131. package/LICENSES/dependencies/hashbrown-0.16.1/LICENSE-APACHE +0 -201
  132. package/LICENSES/dependencies/hashbrown-0.16.1/LICENSE-MIT +0 -25
  133. package/LICENSES/dependencies/hashbrown-0.17.1/LICENSE-APACHE +0 -201
  134. package/LICENSES/dependencies/hashbrown-0.17.1/LICENSE-MIT +0 -25
  135. package/LICENSES/dependencies/heck-0.5.0/LICENSE-APACHE +0 -201
  136. package/LICENSES/dependencies/heck-0.5.0/LICENSE-MIT +0 -25
  137. package/LICENSES/dependencies/hermit-abi-0.5.3/LICENSE-APACHE +0 -201
  138. package/LICENSES/dependencies/hermit-abi-0.5.3/LICENSE-MIT +0 -23
  139. package/LICENSES/dependencies/hex-0.4.3/LICENSE-APACHE +0 -202
  140. package/LICENSES/dependencies/hex-0.4.3/LICENSE-MIT +0 -20
  141. package/LICENSES/dependencies/iana-time-zone-0.1.65/LICENSE-APACHE +0 -201
  142. package/LICENSES/dependencies/iana-time-zone-0.1.65/LICENSE-MIT +0 -25
  143. package/LICENSES/dependencies/iana-time-zone-haiku-0.1.2/LICENSE-APACHE +0 -201
  144. package/LICENSES/dependencies/iana-time-zone-haiku-0.1.2/LICENSE-MIT +0 -25
  145. package/LICENSES/dependencies/id-arena-2.3.0/LICENSE-APACHE +0 -201
  146. package/LICENSES/dependencies/id-arena-2.3.0/LICENSE-MIT +0 -25
  147. package/LICENSES/dependencies/ident_case-1.0.1/LICENSE +0 -19
  148. package/LICENSES/dependencies/indexmap-1.9.3/LICENSE-APACHE +0 -201
  149. package/LICENSES/dependencies/indexmap-1.9.3/LICENSE-MIT +0 -25
  150. package/LICENSES/dependencies/indexmap-2.14.2/LICENSE-APACHE +0 -201
  151. package/LICENSES/dependencies/indexmap-2.14.2/LICENSE-MIT +0 -25
  152. package/LICENSES/dependencies/itoa-1.0.18/LICENSE-APACHE +0 -176
  153. package/LICENSES/dependencies/itoa-1.0.18/LICENSE-MIT +0 -23
  154. package/LICENSES/dependencies/jiff-0.2.35/COPYING +0 -3
  155. package/LICENSES/dependencies/jiff-0.2.35/LICENSE-MIT +0 -21
  156. package/LICENSES/dependencies/jiff-0.2.35/UNLICENSE +0 -24
  157. package/LICENSES/dependencies/jiff-core-0.1.0/COPYING +0 -3
  158. package/LICENSES/dependencies/jiff-core-0.1.0/LICENSE-MIT +0 -21
  159. package/LICENSES/dependencies/jiff-core-0.1.0/UNLICENSE +0 -24
  160. package/LICENSES/dependencies/jiff-static-0.2.35/COPYING +0 -3
  161. package/LICENSES/dependencies/jiff-static-0.2.35/LICENSE-MIT +0 -21
  162. package/LICENSES/dependencies/jiff-static-0.2.35/UNLICENSE +0 -24
  163. package/LICENSES/dependencies/jiff-tzdb-0.1.8/COPYING +0 -3
  164. package/LICENSES/dependencies/jiff-tzdb-0.1.8/LICENSE-MIT +0 -21
  165. package/LICENSES/dependencies/jiff-tzdb-0.1.8/UNLICENSE +0 -24
  166. package/LICENSES/dependencies/jiff-tzdb-platform-0.1.3/COPYING +0 -3
  167. package/LICENSES/dependencies/jiff-tzdb-platform-0.1.3/LICENSE-MIT +0 -21
  168. package/LICENSES/dependencies/jiff-tzdb-platform-0.1.3/UNLICENSE +0 -24
  169. package/LICENSES/dependencies/js-sys-0.3.105/LICENSE-APACHE +0 -201
  170. package/LICENSES/dependencies/js-sys-0.3.105/LICENSE-MIT +0 -25
  171. package/LICENSES/dependencies/leb128-0.2.7/LICENSE-APACHE +0 -201
  172. package/LICENSES/dependencies/leb128-0.2.7/LICENSE-MIT +0 -25
  173. package/LICENSES/dependencies/leb128fmt-0.1.0/LICENSE-APACHE +0 -201
  174. package/LICENSES/dependencies/leb128fmt-0.1.0/LICENSE-MIT +0 -23
  175. package/LICENSES/dependencies/libc-0.2.189/LICENSE-APACHE +0 -176
  176. package/LICENSES/dependencies/libc-0.2.189/LICENSE-MIT +0 -25
  177. package/LICENSES/dependencies/linux-raw-sys-0.12.1/COPYRIGHT +0 -29
  178. package/LICENSES/dependencies/linux-raw-sys-0.12.1/LICENSE-APACHE +0 -201
  179. package/LICENSES/dependencies/linux-raw-sys-0.12.1/LICENSE-Apache-2.0_WITH_LLVM-exception +0 -220
  180. package/LICENSES/dependencies/linux-raw-sys-0.12.1/LICENSE-MIT +0 -23
  181. package/LICENSES/dependencies/log-0.4.34/LICENSE-APACHE +0 -201
  182. package/LICENSES/dependencies/log-0.4.34/LICENSE-MIT +0 -25
  183. package/LICENSES/dependencies/memchr-2.8.3/COPYING +0 -3
  184. package/LICENSES/dependencies/memchr-2.8.3/LICENSE-MIT +0 -21
  185. package/LICENSES/dependencies/memchr-2.8.3/UNLICENSE +0 -24
  186. package/LICENSES/dependencies/mio-1.2.3/LICENSE +0 -19
  187. package/LICENSES/dependencies/num-conv-0.2.2/LICENSE-Apache +0 -177
  188. package/LICENSES/dependencies/num-conv-0.2.2/LICENSE-MIT +0 -19
  189. package/LICENSES/dependencies/num-traits-0.2.19/LICENSE-APACHE +0 -201
  190. package/LICENSES/dependencies/num-traits-0.2.19/LICENSE-MIT +0 -25
  191. package/LICENSES/dependencies/once_cell-1.21.4/LICENSE-APACHE +0 -201
  192. package/LICENSES/dependencies/once_cell-1.21.4/LICENSE-MIT +0 -23
  193. package/LICENSES/dependencies/parking-2.2.1/LICENSE-APACHE +0 -201
  194. package/LICENSES/dependencies/parking-2.2.1/LICENSE-MIT +0 -23
  195. package/LICENSES/dependencies/parking-2.2.1/LICENSE-THIRD-PARTY +0 -9
  196. package/LICENSES/dependencies/pin-project-1.1.13/LICENSE-APACHE +0 -177
  197. package/LICENSES/dependencies/pin-project-1.1.13/LICENSE-MIT +0 -23
  198. package/LICENSES/dependencies/pin-project-internal-1.1.13/LICENSE-APACHE +0 -177
  199. package/LICENSES/dependencies/pin-project-internal-1.1.13/LICENSE-MIT +0 -23
  200. package/LICENSES/dependencies/pin-project-lite-0.2.17/LICENSE-APACHE +0 -177
  201. package/LICENSES/dependencies/pin-project-lite-0.2.17/LICENSE-MIT +0 -23
  202. package/LICENSES/dependencies/piper-0.2.5/LICENSE-APACHE +0 -201
  203. package/LICENSES/dependencies/piper-0.2.5/LICENSE-MIT +0 -23
  204. package/LICENSES/dependencies/polling-3.11.0/LICENSE-APACHE +0 -201
  205. package/LICENSES/dependencies/polling-3.11.0/LICENSE-MIT +0 -23
  206. package/LICENSES/dependencies/portable-atomic-1.15.0/LICENSE-APACHE +0 -177
  207. package/LICENSES/dependencies/portable-atomic-1.15.0/LICENSE-MIT +0 -23
  208. package/LICENSES/dependencies/portable-atomic-util-0.2.8/LICENSE-APACHE +0 -177
  209. package/LICENSES/dependencies/portable-atomic-util-0.2.8/LICENSE-MIT +0 -23
  210. package/LICENSES/dependencies/powerfmt-0.2.0/LICENSE-Apache +0 -202
  211. package/LICENSES/dependencies/powerfmt-0.2.0/LICENSE-MIT +0 -19
  212. package/LICENSES/dependencies/proc-macro2-1.0.107/LICENSE-APACHE +0 -176
  213. package/LICENSES/dependencies/proc-macro2-1.0.107/LICENSE-MIT +0 -23
  214. package/LICENSES/dependencies/quote-1.0.47/LICENSE-APACHE +0 -176
  215. package/LICENSES/dependencies/quote-1.0.47/LICENSE-MIT +0 -23
  216. package/LICENSES/dependencies/r-efi-6.0.0/AUTHORS +0 -75
  217. package/LICENSES/dependencies/rayon-1.12.0/LICENSE-APACHE +0 -201
  218. package/LICENSES/dependencies/rayon-1.12.0/LICENSE-MIT +0 -25
  219. package/LICENSES/dependencies/rayon-core-1.13.0/LICENSE-APACHE +0 -201
  220. package/LICENSES/dependencies/rayon-core-1.13.0/LICENSE-MIT +0 -25
  221. package/LICENSES/dependencies/ref-cast-1.0.27/LICENSE-APACHE +0 -176
  222. package/LICENSES/dependencies/ref-cast-1.0.27/LICENSE-MIT +0 -23
  223. package/LICENSES/dependencies/ref-cast-impl-1.0.27/LICENSE-APACHE +0 -176
  224. package/LICENSES/dependencies/ref-cast-impl-1.0.27/LICENSE-MIT +0 -23
  225. package/LICENSES/dependencies/rustc-demangle-0.1.28/LICENSE-APACHE +0 -201
  226. package/LICENSES/dependencies/rustc-demangle-0.1.28/LICENSE-MIT +0 -25
  227. package/LICENSES/dependencies/rustc-hash-2.1.3/LICENSE-APACHE +0 -176
  228. package/LICENSES/dependencies/rustc-hash-2.1.3/LICENSE-MIT +0 -23
  229. package/LICENSES/dependencies/rustc_version-0.4.1/LICENSE-APACHE +0 -201
  230. package/LICENSES/dependencies/rustc_version-0.4.1/LICENSE-MIT +0 -25
  231. package/LICENSES/dependencies/rustix-1.1.4/COPYRIGHT +0 -29
  232. package/LICENSES/dependencies/rustix-1.1.4/LICENSE-APACHE +0 -201
  233. package/LICENSES/dependencies/rustix-1.1.4/LICENSE-Apache-2.0_WITH_LLVM-exception +0 -220
  234. package/LICENSES/dependencies/rustix-1.1.4/LICENSE-MIT +0 -23
  235. package/LICENSES/dependencies/rustversion-1.0.23/LICENSE-APACHE +0 -176
  236. package/LICENSES/dependencies/rustversion-1.0.23/LICENSE-MIT +0 -23
  237. package/LICENSES/dependencies/schemars-0.9.0/LICENSE +0 -21
  238. package/LICENSES/dependencies/schemars-1.2.2/LICENSE +0 -21
  239. package/LICENSES/dependencies/schemars_derive-1.2.2/LICENSE +0 -21
  240. package/LICENSES/dependencies/semver-1.0.28/LICENSE-APACHE +0 -176
  241. package/LICENSES/dependencies/semver-1.0.28/LICENSE-MIT +0 -23
  242. package/LICENSES/dependencies/serde-1.0.229/LICENSE-APACHE +0 -176
  243. package/LICENSES/dependencies/serde-1.0.229/LICENSE-MIT +0 -23
  244. package/LICENSES/dependencies/serde_core-1.0.229/LICENSE-APACHE +0 -176
  245. package/LICENSES/dependencies/serde_core-1.0.229/LICENSE-MIT +0 -23
  246. package/LICENSES/dependencies/serde_derive-1.0.229/LICENSE-APACHE +0 -176
  247. package/LICENSES/dependencies/serde_derive-1.0.229/LICENSE-MIT +0 -23
  248. package/LICENSES/dependencies/serde_derive_internals-0.30.0/LICENSE-APACHE +0 -176
  249. package/LICENSES/dependencies/serde_derive_internals-0.30.0/LICENSE-MIT +0 -23
  250. package/LICENSES/dependencies/serde_json-1.0.151/LICENSE-APACHE +0 -176
  251. package/LICENSES/dependencies/serde_json-1.0.151/LICENSE-MIT +0 -23
  252. package/LICENSES/dependencies/serde_with-3.23.0/LICENSE-APACHE +0 -201
  253. package/LICENSES/dependencies/serde_with-3.23.0/LICENSE-MIT +0 -25
  254. package/LICENSES/dependencies/serde_with_macros-3.23.0/LICENSE-APACHE +0 -201
  255. package/LICENSES/dependencies/serde_with_macros-3.23.0/LICENSE-MIT +0 -25
  256. package/LICENSES/dependencies/shell-words-1.1.1/LICENSE-APACHE +0 -201
  257. package/LICENSES/dependencies/shell-words-1.1.1/LICENSE-MIT +0 -25
  258. package/LICENSES/dependencies/shlex-2.0.1/LICENSE-APACHE +0 -13
  259. package/LICENSES/dependencies/shlex-2.0.1/LICENSE-MIT +0 -21
  260. package/LICENSES/dependencies/signal-hook-registry-1.4.8/LICENSE-APACHE +0 -201
  261. package/LICENSES/dependencies/signal-hook-registry-1.4.8/LICENSE-MIT +0 -25
  262. package/LICENSES/dependencies/slab-0.4.12/LICENSE +0 -25
  263. package/LICENSES/dependencies/smallvec-1.16.0/LICENSE-APACHE +0 -201
  264. package/LICENSES/dependencies/smallvec-1.16.0/LICENSE-MIT +0 -25
  265. package/LICENSES/dependencies/socket2-0.6.5/LICENSE-APACHE +0 -201
  266. package/LICENSES/dependencies/socket2-0.6.5/LICENSE-MIT +0 -25
  267. package/LICENSES/dependencies/stable_deref_trait-1.2.1/LICENSE-APACHE +0 -201
  268. package/LICENSES/dependencies/stable_deref_trait-1.2.1/LICENSE-MIT +0 -25
  269. package/LICENSES/dependencies/strsim-0.11.1/LICENSE +0 -23
  270. package/LICENSES/dependencies/strum-0.28.0/LICENSE +0 -21
  271. package/LICENSES/dependencies/strum_macros-0.28.0/LICENSE +0 -21
  272. package/LICENSES/dependencies/syn-2.0.119/LICENSE-APACHE +0 -176
  273. package/LICENSES/dependencies/syn-2.0.119/LICENSE-MIT +0 -23
  274. package/LICENSES/dependencies/syn-3.0.5/LICENSE-APACHE +0 -176
  275. package/LICENSES/dependencies/syn-3.0.5/LICENSE-MIT +0 -23
  276. package/LICENSES/dependencies/thiserror-2.0.20/LICENSE-APACHE +0 -176
  277. package/LICENSES/dependencies/thiserror-2.0.20/LICENSE-MIT +0 -23
  278. package/LICENSES/dependencies/thiserror-impl-2.0.20/LICENSE-APACHE +0 -176
  279. package/LICENSES/dependencies/thiserror-impl-2.0.20/LICENSE-MIT +0 -23
  280. package/LICENSES/dependencies/time-0.3.55/LICENSE-Apache +0 -177
  281. package/LICENSES/dependencies/time-0.3.55/LICENSE-MIT +0 -19
  282. package/LICENSES/dependencies/time-core-0.1.9/LICENSE-Apache +0 -177
  283. package/LICENSES/dependencies/time-core-0.1.9/LICENSE-MIT +0 -19
  284. package/LICENSES/dependencies/time-macros-0.2.32/LICENSE-Apache +0 -177
  285. package/LICENSES/dependencies/time-macros-0.2.32/LICENSE-MIT +0 -19
  286. package/LICENSES/dependencies/tinyvec-1.13.2/LICENSE-APACHE.md +0 -202
  287. package/LICENSES/dependencies/tinyvec-1.13.2/LICENSE-MIT.md +0 -5
  288. package/LICENSES/dependencies/tinyvec-1.13.2/LICENSE-ZLIB.md +0 -11
  289. package/LICENSES/dependencies/tinyvec_macros-0.1.1/LICENSE-APACHE.md +0 -202
  290. package/LICENSES/dependencies/tinyvec_macros-0.1.1/LICENSE-MIT.md +0 -21
  291. package/LICENSES/dependencies/tinyvec_macros-0.1.1/LICENSE-ZLIB.md +0 -20
  292. package/LICENSES/dependencies/tokio-1.53.1/LICENSE +0 -21
  293. package/LICENSES/dependencies/tokio-macros-2.7.2/LICENSE +0 -22
  294. package/LICENSES/dependencies/tracing-0.1.44/LICENSE +0 -25
  295. package/LICENSES/dependencies/tracing-attributes-0.1.31/LICENSE +0 -25
  296. package/LICENSES/dependencies/tracing-core-0.1.36/LICENSE +0 -25
  297. package/LICENSES/dependencies/unicode-ident-1.0.24/LICENSE-APACHE +0 -176
  298. package/LICENSES/dependencies/unicode-ident-1.0.24/LICENSE-MIT +0 -23
  299. package/LICENSES/dependencies/unicode-ident-1.0.24/LICENSE-UNICODE +0 -39
  300. package/LICENSES/dependencies/unicode-segmentation-1.13.3/COPYRIGHT +0 -7
  301. package/LICENSES/dependencies/unicode-segmentation-1.13.3/LICENSE-APACHE +0 -201
  302. package/LICENSES/dependencies/unicode-segmentation-1.13.3/LICENSE-MIT +0 -25
  303. package/LICENSES/dependencies/unicode-xid-0.2.6/COPYRIGHT +0 -7
  304. package/LICENSES/dependencies/unicode-xid-0.2.6/LICENSE-APACHE +0 -201
  305. package/LICENSES/dependencies/unicode-xid-0.2.6/LICENSE-MIT +0 -25
  306. package/LICENSES/dependencies/uuid-1.26.1/LICENSE-APACHE +0 -201
  307. package/LICENSES/dependencies/uuid-1.26.1/LICENSE-MIT +0 -26
  308. package/LICENSES/dependencies/walrus-0.26.5/LICENSE-APACHE +0 -201
  309. package/LICENSES/dependencies/walrus-0.26.5/LICENSE-MIT +0 -25
  310. package/LICENSES/dependencies/walrus-macro-0.26.0/LICENSE-APACHE +0 -201
  311. package/LICENSES/dependencies/walrus-macro-0.26.0/LICENSE-MIT +0 -25
  312. package/LICENSES/dependencies/wasi-0.11.1+wasi-snapshot-preview1/LICENSE-APACHE +0 -201
  313. package/LICENSES/dependencies/wasi-0.11.1+wasi-snapshot-preview1/LICENSE-Apache-2.0_WITH_LLVM-exception +0 -220
  314. package/LICENSES/dependencies/wasi-0.11.1+wasi-snapshot-preview1/LICENSE-MIT +0 -23
  315. package/LICENSES/dependencies/wasm-bindgen-0.2.128/LICENSE-APACHE +0 -201
  316. package/LICENSES/dependencies/wasm-bindgen-0.2.128/LICENSE-MIT +0 -25
  317. package/LICENSES/dependencies/wasm-bindgen-cli-support-0.2.128/LICENSE-APACHE +0 -201
  318. package/LICENSES/dependencies/wasm-bindgen-cli-support-0.2.128/LICENSE-MIT +0 -25
  319. package/LICENSES/dependencies/wasm-bindgen-macro-0.2.128/LICENSE-APACHE +0 -201
  320. package/LICENSES/dependencies/wasm-bindgen-macro-0.2.128/LICENSE-MIT +0 -25
  321. package/LICENSES/dependencies/wasm-bindgen-macro-support-0.2.128/LICENSE-APACHE +0 -201
  322. package/LICENSES/dependencies/wasm-bindgen-macro-support-0.2.128/LICENSE-MIT +0 -25
  323. package/LICENSES/dependencies/wasm-bindgen-shared-0.2.128/LICENSE-APACHE +0 -201
  324. package/LICENSES/dependencies/wasm-bindgen-shared-0.2.128/LICENSE-MIT +0 -25
  325. package/LICENSES/dependencies/wasm-encoder-0.245.1/LICENSE-APACHE +0 -201
  326. package/LICENSES/dependencies/wasm-encoder-0.245.1/LICENSE-Apache-2.0_WITH_LLVM-exception +0 -220
  327. package/LICENSES/dependencies/wasm-encoder-0.245.1/LICENSE-MIT +0 -23
  328. package/LICENSES/dependencies/wasmparser-0.245.1/LICENSE-APACHE +0 -201
  329. package/LICENSES/dependencies/wasmparser-0.245.1/LICENSE-Apache-2.0_WITH_LLVM-exception +0 -220
  330. package/LICENSES/dependencies/wasmparser-0.245.1/LICENSE-MIT +0 -23
  331. package/LICENSES/dependencies/windows-core-0.62.2/license-apache-2.0 +0 -201
  332. package/LICENSES/dependencies/windows-core-0.62.2/license-mit +0 -21
  333. package/LICENSES/dependencies/windows-implement-0.60.2/license-apache-2.0 +0 -201
  334. package/LICENSES/dependencies/windows-implement-0.60.2/license-mit +0 -21
  335. package/LICENSES/dependencies/windows-interface-0.59.3/license-apache-2.0 +0 -201
  336. package/LICENSES/dependencies/windows-interface-0.59.3/license-mit +0 -21
  337. package/LICENSES/dependencies/windows-link-0.2.1/license-apache-2.0 +0 -201
  338. package/LICENSES/dependencies/windows-link-0.2.1/license-mit +0 -21
  339. package/LICENSES/dependencies/windows-result-0.4.1/license-apache-2.0 +0 -201
  340. package/LICENSES/dependencies/windows-result-0.4.1/license-mit +0 -21
  341. package/LICENSES/dependencies/windows-strings-0.5.1/license-apache-2.0 +0 -201
  342. package/LICENSES/dependencies/windows-strings-0.5.1/license-mit +0 -21
  343. package/LICENSES/dependencies/windows-sys-0.61.2/license-apache-2.0 +0 -201
  344. package/LICENSES/dependencies/windows-sys-0.61.2/license-mit +0 -21
  345. package/LICENSES/dependencies/zmij-1.0.23/LICENSE-MIT +0 -23
  346. package/THIRD-PARTY.md +0 -45
  347. package/source/.cargo/config.toml +0 -5
  348. package/source/.ci/upstream-notices/PROVENANCE.json +0 -198
  349. package/source/.ci/upstream-notices/agent-client-protocol-2.1.0/LICENSE +0 -191
  350. package/source/.ci/upstream-notices/agent-client-protocol-derive-2.1.0/LICENSE +0 -191
  351. package/source/.ci/upstream-notices/agent-client-protocol-schema-1.7.0/LICENSE +0 -190
  352. package/source/.ci/upstream-notices/defmt-parser-1.0.0/LICENSE-APACHE +0 -201
  353. package/source/.ci/upstream-notices/defmt-parser-1.0.0/LICENSE-MIT +0 -25
  354. package/source/.ci/upstream-notices/r-efi-6.0.0/AUTHORS +0 -75
  355. package/source/.ci/upstream-notices/wasm-encoder-0.245.1/LICENSE-APACHE +0 -201
  356. package/source/.ci/upstream-notices/wasm-encoder-0.245.1/LICENSE-Apache-2.0_WITH_LLVM-exception +0 -220
  357. package/source/.ci/upstream-notices/wasm-encoder-0.245.1/LICENSE-MIT +0 -23
  358. package/source/.ci/upstream-notices/wasmparser-0.245.1/LICENSE-APACHE +0 -201
  359. package/source/.ci/upstream-notices/wasmparser-0.245.1/LICENSE-Apache-2.0_WITH_LLVM-exception +0 -220
  360. package/source/.ci/upstream-notices/wasmparser-0.245.1/LICENSE-MIT +0 -23
  361. package/source/.ci/wasm-bundle/Cargo.toml +0 -10
  362. package/source/.ci/wasm-bundle/src/main.rs +0 -17
  363. package/source/CHANGELOG.md +0 -28
  364. package/source/Cargo.lock +0 -1622
  365. package/source/Cargo.toml +0 -48
  366. package/source/LICENSE +0 -307
  367. package/source/LICENSE.md +0 -25
  368. package/source/LICENSES/GPL-3.0-only.txt +0 -232
  369. package/source/LICENSES/LGPL-3.0-only.txt +0 -304
  370. package/source/README.md +0 -234
  371. package/source/THIRD-PARTY.md +0 -45
  372. package/source/dependencies.tar.gz +0 -0
  373. package/source/examples/native.rs +0 -45
  374. package/source/src/configuration.rs +0 -89
  375. package/source/src/conversation.rs +0 -569
  376. package/source/src/lib.rs +0 -30
  377. package/source/src/native/client.rs +0 -395
  378. package/source/src/native/fixture.py +0 -114
  379. package/source/src/native/mod.rs +0 -252
  380. package/source/src/native/session.rs +0 -603
  381. package/source/src/native/tests.rs +0 -463
  382. package/source/src/web.rs +0 -35
package/README.md CHANGED
@@ -1,234 +1,216 @@
1
- # ccht
1
+ # @corbet-labs/ccht
2
2
 
3
- Reusable conversations for Rust applications, terminals and web frontends.
4
- **ccht** keeps the conversation model in Rust and compiles
5
- that same model to Wasm. Native hosts connect to installed agents using the
6
- [official ACP Rust SDK](https://github.com/agentclientprotocol/rust-sdk).
3
+ Reusable conversations for your applications, powered by the shared Rust/Wasm model.
7
4
 
8
- ```text
9
- Web UI ── @corbet-labs/ccht (Wasm) ── application transport/storage
10
-
11
- TUI / native UI ── ccht::Conversation ── ccht::native ── upstream ACP agent
12
- ```
13
-
14
- The library owns structured conversation events, ordered replay, native sessions,
15
- streaming, cancellation and permission requests. Your application owns its UI,
16
- instructions, context, tools, user authorization, storage and HTTP/WebSocket/SSE
17
- transport. No Corbet-specific prompts or database are required.
18
-
19
- Agent reasoning, tools, authentication and protocol translation remain upstream.
20
- ccht does not implement an agent loop, read provider credentials, install agents,
21
- call paid model HTTP APIs or select an API-key fallback.
22
-
23
- ## Rust
24
-
25
- ```toml
26
- [dependencies]
27
- ccht = "0.2"
28
- tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
29
- ```
30
-
31
- `native` is the default feature. For the portable model alone:
32
-
33
- ```toml
34
- ccht = { version = "0.2", default-features = false }
35
- ```
36
-
37
- ```rust
38
- use ccht::{Conversation, Event, WireEvent, acp};
39
-
40
- let mut conversation = Conversation::new("workspace/creator");
41
- conversation.apply(WireEvent::new(
42
- "workspace/creator", "turn-1", 1,
43
- Event::Update {
44
- update: acp::SessionUpdate::AgentMessageChunk(
45
- acp::ContentChunk::new("Hello".into()),
46
- ),
47
- },
48
- )).unwrap();
49
- assert_eq!(conversation.turns()[0].text, "Hello");
50
- ```
51
-
52
- [examples/native.rs](source/examples/native.rs) shows streaming from an explicitly
53
- supplied installed ACP executable. It requires native agent authentication already
54
- configured by the operator. Use `codex-acp`, `claude-agent-acp`, or `opencode acp`
55
- as separate, reviewed runtime installations. Generic ACP executables also work.
56
- No agent/runtime is bundled in the crate or browser package.
57
-
58
- `NativeClient::connect` initializes the protocol. Create a session with its working
59
- directory, explicit model (if desired) and application MCP servers. Take the event
60
- receiver before prompting and consume it concurrently with the prompt future.
61
- A session accepts one active prompt; another returns `Busy`. Different sessions
62
- have separate streams and permission identities. History load/resume and model
63
- selection require the agent's advertised capabilities; unsupported requests fail.
64
-
65
- `session.handle().configuration()` exposes the agent's ordered model, reasoning,
66
- mode and boolean controls. Call `set_model(id)` or `set_config_option(id, value)`
67
- to change them. The full response replaces the advertised configuration, including
68
- dependent options; configuration notifications update both the native handle and
69
- the portable conversation snapshot. Unknown values fail without a fallback.
70
- `SessionOptions::configuration` applies explicit settings when creating or restoring
71
- a session. Retain the agent session ID and its working directory in your product
72
- storage to resume completed conversations across process restarts. Never replay an
73
- uncertain delivery automatically.
74
-
75
- Permissions default to denial. Applications that opt into asking must render the
76
- request, check their authority and respond with one of the advertised choices.
77
- A permission callback is not a sandbox: agent-owned tools may have separate runtime
78
- policy. Configure filesystem/network confinement in the host for your use case.
79
- ccht advertises no client filesystem or terminal capabilities.
80
-
81
- Cancellation asks the upstream agent to stop. If it does not stop within the
82
- configured shutdown timeout, ccht closes the SDK connection, affecting **all**
83
- sessions on that connection. Dropping an active prompt also closes its connection.
84
- Use one connection per independent workload when cancellation must be isolated.
85
- Bounded event channels fail explicitly on an unresponsive consumer.
86
-
87
- `AgentCommand::with_working_directory` sets the actual agent startup directory
88
- using installed Linux/macOS `env` launchers. Windows currently reports this helper
89
- as unsupported because the SDK launch configuration lacks a startup-directory
90
- field. Session cwd alone does not constrain files read during agent startup.
91
- Linux is covered by process-level tests; macOS support is source-reviewed.
92
-
93
- ACP enables `serde_json`'s `preserve_order` feature through Cargo feature
94
- unification. Applications that hash or sign JSON must explicitly canonicalize
95
- object keys; depending on a `Value` map's incidental iteration order is unsafe.
96
-
97
- ## Browser
98
-
99
- ```sh
100
- npm install @corbet-labs/ccht
101
- ```
5
+ The root entry (`createConversation`) owns the conversation state machine. The
6
+ `./auth` entry adds typed auth/challenge models mirroring `ccht::auth`, the
7
+ `./dock` entry adds framework-free dock state, and
8
+ `./components/AccountConnection.svelte` adds the first shared Svelte 5 account
9
+ connector alongside the generic `./components/Dock.svelte` edge rail. All
10
+ entries are product-neutral: no product names, prompts, or
11
+ pricing appear in this package.
102
12
 
103
13
  ```js
104
14
  import { createConversation } from '@corbet-labs/ccht';
105
- // Vite example: emit the Wasm as a separately replaceable asset.
106
- import wasmUrl from '@corbet-labs/ccht/ccht_bg.wasm?url';
107
-
108
- const conversation = await createConversation('workspace/creator', { wasm: wasmUrl });
109
- // After your authenticated application transport delivers a ccht WireEvent:
110
- const snapshot = conversation.applyEvent(event);
111
- render(snapshot.turns);
112
- // When the view is destroyed:
113
- conversation.free();
15
+ import { isAuthenticated, validateChallenge } from '@corbet-labs/ccht/auth';
16
+ import { createDockManager, validateDockId } from '@corbet-labs/ccht/dock';
17
+ import AccountConnection from '@corbet-labs/ccht/components/AccountConnection.svelte';
18
+ import Dock from '@corbet-labs/ccht/components/Dock.svelte';
114
19
  ```
115
20
 
116
- Version 0.2.0 requires an explicit `wasm` URL or bytes on first initialization.
117
- A browser cannot launch native processes: its
118
- application server or desktop host runs `ccht::native`. The package makes no
119
- network connection apart from loading its Wasm module. The host decides which
120
- backend is available and how users authenticate to the application.
21
+ The Svelte component ships as source and needs `svelte` `^5` (a peer
22
+ dependency). It has no other dependencies and imports no CSS framework.
121
23
 
122
- ## JSR
24
+ ## What is shared vs what the app owns
123
25
 
124
- The JSR package exposes the same Rust/Wasm model:
26
+ Shared (this package):
125
27
 
126
- ```ts
127
- import { createConversation } from 'jsr:@corbet-labs/ccht@0.2.0';
28
+ - Conversation state and ordered event replay (Wasm `ConversationModel`).
29
+ - Auth/challenge types and validators (`AuthState`, `Challenge`,
30
+ `CredentialsProvider`).
31
+ - Presentational account connector markup with stable styling hooks.
128
32
 
129
- const conversation = await createConversation('workspace/creator', {
130
- wasm: new URL('https://jsr.io/@corbet-labs/ccht/0.2.0/wasm/ccht_bg.wasm'),
131
- });
132
- ```
33
+ Owned by the embedding application:
133
34
 
134
- In Deno, allow access with `--allow-net=jsr.io` for this Wasm download.
135
- Applications can also supply their own Wasm bytes or URL. JSR's corresponding
136
- source archive uses `dependencies.tar.xz` to fit its package size limit; the
137
- source files and runtime bytes are the same as the npm distribution.
35
+ - Transport: delivering `WireEvent`s (HTTP/WebSocket/SSE), serving the Wasm
36
+ bytes, and polling login operations until they complete.
37
+ - Effects: spawning agents, starting or cancelling logins, signing out. These
38
+ never run in browser library code; the component drives them through
39
+ app-supplied async callbacks and the app backend does the work.
40
+ - Storage: where credentials persist (OS keychain natively, origin-scoped
41
+ browser storage on the web). The library defines the interface only.
42
+ - Product copy: account labels, help text, links, and error wording beyond the
43
+ component's generic strings.
138
44
 
139
- ## Python
45
+ Rule: browser code in this package never spawns agents, performs network I/O,
46
+ or holds ambient authority. Service keys are explicit strings passed by the
47
+ app, and secrets are opaque bytes that are never logged.
140
48
 
141
- Install from [PyPI](https://pypi.org/project/ccht/0.2.0/):
49
+ ## Auth entry (`@corbet-labs/ccht/auth`)
142
50
 
143
- ```sh
144
- python -m pip install ccht==0.2.0
145
- ```
51
+ Plain types and functions, no DOM access.
146
52
 
147
- ```python
148
- from ccht import Conversation
53
+ `AuthState` mirrors the Rust `snake_case` JSON byte-for-byte:
149
54
 
150
- conversation = Conversation('workspace/creator')
151
- # Deliver an authorized WireEvent from your application transport.
152
- conversation.apply_event(event)
153
- snapshot = conversation.snapshot()
154
- ```
55
+ | Rust | JSON | TypeScript |
56
+ | --- | --- | --- |
57
+ | `Unknown` | `"unknown"` | `'unknown'` |
58
+ | `Unauthenticated` | `"unauthenticated"` | `'unauthenticated'` |
59
+ | `Authenticated { account }` | `{"authenticated": {"account": "…"}}` | `{ authenticated: { account?: string \| null } }` |
155
60
 
156
- The Python package wraps the published Rust conversation model through PyO3.
157
- It exposes event reduction and snapshots; native agent execution uses a Rust
158
- host with `ccht::native`. See [py/README.md](py/README.md) for the Python API,
159
- binary wheel requirements and source rebuild/replacement instructions.
160
-
161
- ## Event and persistence contract
162
-
163
- `WireEvent` version 1 contains `conversation_id`, `request_id`, a per-request
164
- `sequence` starting at 1, and `event`. Retain the original structured ACP updates:
165
- text, non-text content, tool calls, thought chunks, plans, permissions and errors
166
- are distinct. The model returns a serializable snapshot for your renderer.
167
-
168
- Assign identities and sequences on a trusted application host. Never let a browser
169
- select another user's conversation without server-side authorization. Sequence
170
- numbers are **not** SSE cursors or database row IDs. The app stores its own event
171
- log and replays each request in order. Already-applied sequences are ignored;
172
- gaps, a different conversation, malformed events and new events after completion
173
- fail without mutating state. Delivery identity must not be reused for another turn.
174
-
175
- A model holds at most 256 turns, 8 MiB per turn and 1 MiB per event. Applications
176
- should page long histories into separate models and limit streamed inputs before
177
- parsing them. Durable transcript storage and reconnection are application concerns;
178
- a serialized snapshot is a render result, not a native-agent session checkpoint.
179
-
180
- Namer is the first integration: Creator/Critic have independent conversation
181
- scopes, durable application events, authenticated SSE and cancellation. Its queue
182
- uses a fresh native session per turn with bounded role history supplied by Namer.
183
- CareerVector's TUI reuses the native session API while keeping CV tools, prompts
184
- and revision checks in its own code. Explicit local inference can emit the same
185
- `WireEvent` contract through an application-owned backend.
186
-
187
- ## Building the Wasm package
188
-
189
- Use Rust with `wasm32-unknown-unknown` installed. The checked-in generator uses the
190
- same exact `wasm-bindgen` version as the Rust crate; no global Wasm CLI is required.
191
-
192
- ```sh
193
- cargo build --locked --release --no-default-features --features web --target wasm32-unknown-unknown
194
- cargo run --locked --release -p ccht-wasm-bundle -- target/wasm32-unknown-unknown/release/ccht.wasm web/wasm
195
- ```
61
+ Helpers: `isAuthenticated(state)` mirrors `AuthState::authenticated`,
62
+ `authAccount(state)` returns the display-only label (or null), and
63
+ `parseAuthState(value)` / `isAuthState(value)` validate decoded JSON. The
64
+ label is provenance for the UI, never an authentication proof.
65
+
66
+ `Challenge` is `{ verification_url, user_code }`. The backend issues it, pins
67
+ any provider-specific endpoint, and polls for completion; the browser only
68
+ renders a validated challenge. `validateChallenge(value)` accepts an `https:`
69
+ URL with a host (no embedded credentials) and a non-empty code of up to 64
70
+ ASCII alphanumeric or `-` characters. It never throws, so callers can gate
71
+ rendering on it. The component validates internally and renders waiting text
72
+ for a missing or malformed challenge instead of an unvalidated link.
196
73
 
197
- Published npm browser archives include the corresponding Rust source and generator
198
- under `source/`, original notices, and the full locked dependency sources in
199
- `source/dependencies.tar.gz`. Cargo's vendor checksums are preserved inside that
200
- archive. To rebuild from the distributed package, extract it inside `source/`:
74
+ `CredentialsProvider` mirrors the Rust trait with JS method names:
201
75
 
202
- ```sh
203
- cd source
204
- tar -xzf dependencies.tar.gz
205
- cargo build --locked --offline --release --no-default-features --features web --target wasm32-unknown-unknown
206
- cargo run --locked --offline --release -p ccht-wasm-bundle -- target/wasm32-unknown-unknown/release/ccht.wasm ../wasm
76
+ ```ts
77
+ interface CredentialsProvider {
78
+ readCredentials(service: string): Promise<Credential | null>;
79
+ writeCredentials(service: string, credential: Credential): Promise<void>;
80
+ deleteCredentials(service: string): Promise<void>;
81
+ }
207
82
  ```
208
83
 
209
- The supplied `.cargo/config.toml` uses only those vendored sources. The installed
210
- Rust toolchain must include the Wasm target and linker. CI rebuilds this kit with
211
- an empty Cargo cache and tests the replacement module through the same npm API.
212
- Keep that exported interface compatible when replacing the library.
213
-
214
- CI verifies the portable Rust model, actual Wasm compilation and packaged Node
215
- consumer, native protocol/process fixtures, dependency notices and an independent
216
- Rust crate consumer. Native fixtures do not call a model or access an account.
217
- Live runtime support must additionally be checked against the installed agent,
218
- its advertised capabilities, login state and execution policy.
219
-
220
- ## License
221
-
222
- ccht is **LGPL-3.0-only**. See [LICENSE.md](LICENSE.md) and
223
- [THIRD-PARTY.md](THIRD-PARTY.md). Applications may use different licenses while
224
- preserving the LGPL library rights. Distributing a combined Rust binary requires
225
- a compliant relinking route; making source available somewhere is not by itself
226
- sufficient. Keep the browser's Wasm replaceable and provide its corresponding
227
- source and notices. Review the complete license for your distribution method.
228
-
229
- ACP and an account's subscription do not guarantee a billing mode. The operator
230
- must configure the native agent/account and disable unwanted paid usage. Known
231
- ambient API-key variables are cleared at launch and explicit API-key overrides
232
- are rejected, but ccht cannot attest saved agent credentials or account billing
233
- settings. Native runtimes and hosted services retain their own terms; a library
234
- license does not authorize pooling subscriptions or product-specific login flows.
84
+ `Credential` is `{ account: string; secret: Uint8Array }`. Encode at the app
85
+ boundary (`TextEncoder`/base64) when the store needs text. Service keys are
86
+ app-defined (for example `assistant-login:<provider>`); deleting a missing
87
+ entry succeeds, and a rejected promise signals store failure. There is no
88
+ environment-variable override on the web: the store alone decides, matching
89
+ the documented `ApiKeyState` behavior on Wasm.
90
+
91
+ ## Component (`AccountConnection.svelte`)
92
+
93
+ Svelte 5 runes. Props:
94
+
95
+ | Prop | Type | Meaning |
96
+ | --- | --- | --- |
97
+ | `account` | `{ id: string; label: string; kind: 'chatgpt' \| 'opencode_go' \| string }` | Product-neutral identity. Known kinds select the ceremony; unknown kinds fall back to a generic sign-in button. |
98
+ | `state` | `AuthState` | Observed login state (defaults to `'unknown'`). |
99
+ | `busy` | `boolean` | An app-owned operation is in flight; actions disable, cancel shows. |
100
+ | `challenge` | `Challenge \| null` (optional) | Device-code challenge supplied by the app after `onStart` starts polling. |
101
+ | `onStart` | `() => void \| Promise<void>` | Begin the login ceremony (for example start a device flow). |
102
+ | `onCancel` | `() => void \| Promise<void>` | Abort the in-flight operation; also backs Disconnect when `onDisconnect` is omitted. |
103
+ | `onKeySubmit` | `(key: string) => void \| Promise<void>` | Persist a trimmed account key (minimum 8 characters). |
104
+ | `onDisconnect` | optional | Sign out when authenticated. Falls back to `onCancel`, which can branch on app state. |
105
+
106
+ Rendering:
107
+
108
+ - Unauthenticated `chatgpt`: sign-in button, then waiting text while `busy`,
109
+ then the device-code view (code, copy button, sign-in link) once a valid
110
+ `challenge` arrives. The copy button opens the link during the click (so
111
+ popup blockers do not trigger) and falls back to a manual-copy message when
112
+ the clipboard API is unavailable.
113
+ - Unauthenticated `opencode_go`: password key form that clears on submit.
114
+ - Authenticated: connection status with the account label (when known) and a
115
+ Disconnect button.
116
+ - `unknown` state: neutral checking text with no ceremony buttons.
117
+
118
+ Callbacks are fire-and-forget from the component's view: the app must handle
119
+ its own failures and surface them through its own operation state, which it
120
+ renders outside the component. Callback rejections are therefore ignored here
121
+ by design.
122
+
123
+ Accessibility: semantic `section`/`form`/`label`/`button` elements, an
124
+ `aria-label` naming the account connection, `role="status"` for status lines,
125
+ an `aria-live="polite"` region announcing challenge arrival, and
126
+ `role="alert"` for the clipboard fallback. The key input is labelled,
127
+ password-masked, and non-persistent.
128
+
129
+ ## Dock entry (`@corbet-labs/ccht/dock`) and component (`Dock.svelte`)
130
+
131
+ Framework-free dock state plus a generic Svelte 5 edge rail. `DockKind`
132
+ (`'chat' | 'config' | 'custom'`) classifies a dock and `Placement`
133
+ (`'left' | 'right' | 'bottom' | 'inline'`) places it. The state module is
134
+ plain TypeScript with no DOM access.
135
+
136
+ `validateDockId(id)` returns an error message or null (never throws). Rules:
137
+ a non-empty string of at most 64 ASCII `[a-z0-9-_]` characters.
138
+
139
+ `createDockManager()` returns an independent manager:
140
+
141
+ | Method | Meaning |
142
+ | --- | --- |
143
+ | `register(id, kind, placement)` | Register a closed dock. Throws the validation message for a malformed id, `DuplicateDock: <id>` for a repeat. |
144
+ | `open(id)` / `close(id)` | Mark a dock open or closed. Unknown ids throw `UnknownDock: <id>`. |
145
+ | `openWithFocus(id, token)` | Open a dock and stage an opaque focus token (non-empty string) for the app to consume. |
146
+ | `toggle(id)` | Flip a dock's open state and return the new state. |
147
+ | `isOpen(id)` | Whether a dock is open. |
148
+ | `placement(id)` / `setPlacement(id, placement)` | Read or move a dock's placement. Invalid placements throw `invalid dock placement`. |
149
+ | `openDocks()` | Ids of open docks, in registration order. |
150
+ | `takeFocusToken()` | Take the staged focus token once, clearing it; null when none is staged. |
151
+ | `closeAll()` | Mark every dock closed. |
152
+ | `serialize()` | Persist `[{id, kind, placement, open}]` as JSON, in registration order. The focus token is never persisted. |
153
+ | `restore(json)` | Replace all state from `serialize` output. Every entry is validated first, so a malformed snapshot (thrown as `invalid dock snapshot: …`) leaves current state untouched, and any staged focus token is cleared. |
154
+
155
+ `Dock.svelte` renders one named dock as an edge rail for the `left` and
156
+ `right` placements. Svelte 5 runes. Props:
157
+
158
+ | Prop | Type | Meaning |
159
+ | --- | --- | --- |
160
+ | `side` | `'left' \| 'right'` | Which window edge the rail pins to. |
161
+ | `title` | `string` | Panel heading and dialog label. |
162
+ | `open` | `boolean` | App-owned visibility state. |
163
+ | `onClose` | `() => void` | Close intent (tab is hidden while open; Esc key also closes). |
164
+ | `onOpen` | `() => void` | Open intent from the edge tab button. |
165
+ | `tabLabel` | `string` | Short tab caption. |
166
+ | `tabSummary` | `string` (optional, defaults to `''`) | Detail shown in the tab button and panel head. |
167
+ | `closeLabel` | optional `string` | Close button label (defaults to `Close {title}`). |
168
+ | `panelId` | `string` | Panel element id, referenced by the tab's `aria-controls`. |
169
+ | `children` | `Snippet` | Panel body content. |
170
+
171
+ Rendering:
172
+
173
+ - Closed: a fixed edge tab button (`aria-expanded="false"`,
174
+ `aria-controls={panelId}`, labelled `Open {title}: {tabSummary}` or
175
+ `Open {title}`). The panel stays mounted but hidden and inert.
176
+ - Open: a `role="dialog"` panel with a head (`h2` title, summary paragraph,
177
+ Close button) and a body rendering `children`.
178
+ - Opening moves focus to the first visible, enabled control in the panel
179
+ (or the panel itself); closing returns focus to the tab or the previously
180
+ focused element. Esc closes.
181
+ - The `bottom` and `inline` placements are state-only: they persist and
182
+ restore through the manager but have no rail chrome here. Custom hosts
183
+ (for example a ratatui overlay or an inline sheet) render them.
184
+
185
+ Stable classes: `ccht-dock-tab`, `ccht-dock-tab-text`, `ccht-dock-panel`,
186
+ `ccht-dock-head`, `ccht-dock-title`, `ccht-dock-close`, `ccht-dock-body`.
187
+ The tab and panel carry `data-side` (`left` / `right`) and the panel carries
188
+ `data-open` (`true` / `false`).
189
+
190
+ CSS variables (with fallbacks when unset): `--ccht-fg`, `--ccht-muted`,
191
+ `--ccht-accent`, `--ccht-border`, `--ccht-panel-bg`, `--ccht-tab-bg`,
192
+ `--ccht-tab-bg-hover`, `--ccht-fg-bright`.
193
+
194
+ Rule: the app owns dock effects. The manager never persists, the component
195
+ never fetches, spawns, or stores; visibility, persistence, and focus targets
196
+ beyond the panel run through app callbacks and app-held state.
197
+
198
+ ## Styling hooks
199
+
200
+ Unstyled-but-hooked markup: layout comes from the app, colors resolve through
201
+ CSS custom properties with plain fallbacks. Stable classes:
202
+
203
+ `ccht-account`, `ccht-status`, `ccht-hint`, `ccht-error`, `ccht-challenge`,
204
+ `ccht-code`, `ccht-button`, `ccht-cancel`, `ccht-disconnect`, `ccht-link`,
205
+ `ccht-keyform`, `ccht-label`, `ccht-input`.
206
+
207
+ CSS variables (with fallbacks when unset): `--ccht-fg`, `--ccht-muted`,
208
+ `--ccht-error`, `--ccht-accent`, `--ccht-code-bg`. Example:
209
+
210
+ ```css
211
+ :root {
212
+ --ccht-muted: #a5b5cb;
213
+ --ccht-error: #fda4af;
214
+ --ccht-accent: #7bb8ff;
215
+ }
216
+ ```
package/index.d.ts CHANGED
@@ -51,7 +51,12 @@ export interface Conversation {
51
51
  snapshot(): ConversationSnapshot;
52
52
  free(): void;
53
53
  }
54
- /** Transport/authentication and persistence belong to the embedding application. */
54
+ /** Transport/authentication and persistence belong to the embedding application.
55
+ *
56
+ * Only the first call's `wasm` option initializes the shared module; later
57
+ * calls reuse it. `applyEvent` returns the fresh snapshot and throws on
58
+ * invalid, out-of-scope, gapped, terminal, or freed input. `free` is idempotent.
59
+ */
55
60
  export function createConversation(conversationId: string, options?: {
56
61
  wasm?: URL | string | Request | Response | BufferSource | WebAssembly.Module;
57
62
  }): Promise<Conversation>;
package/index.js CHANGED
@@ -3,7 +3,14 @@ import initialize, { ConversationModel } from './wasm/ccht.js';
3
3
 
4
4
  let initialization;
5
5
 
6
- /** Initialize the shared Rust/Wasm model. Supply an explicit Wasm URL when bundling. */
6
+ /** Initialize the shared Rust/Wasm model. Supply an explicit Wasm URL when bundling.
7
+ *
8
+ * Only the first call's `wasm` option initializes the shared module; later
9
+ * calls reuse it. The returned `applyEvent` applies one ordered event and
10
+ * returns the fresh snapshot (the underlying Rust boolean for "changed" is
11
+ * not exposed); it throws on invalid JSON, scope, gap, terminal, or freed
12
+ * state. `snapshot` returns the parsed render state and `free` is idempotent.
13
+ */
7
14
  export async function createConversation(conversationId, options = {}) {
8
15
  if (!initialization) {
9
16
  initialization = initialize(options.wasm === undefined ? undefined : { module_or_path: options.wasm })
package/package.json CHANGED
@@ -1,36 +1,22 @@
1
1
  {
2
2
  "name": "@corbet-labs/ccht",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Reusable conversations for your applications, powered by the shared Rust/Wasm model",
5
- "license": "LGPL-3.0-only",
5
+ "license": "LGPL-3.0-only WITH LGPL-3.0-linking-exception",
6
6
  "type": "module",
7
7
  "main": "./index.js",
8
8
  "types": "./index.d.ts",
9
9
  "exports": {
10
- ".": {
11
- "types": "./index.d.ts",
12
- "import": "./index.js"
13
- },
10
+ ".": { "types": "./index.d.ts", "import": "./index.js" },
11
+ "./auth": { "types": "./src/auth.ts", "import": "./src/auth.ts" },
12
+ "./dock": { "types": "./src/dock.ts", "import": "./src/dock.ts" },
13
+ "./components/AccountConnection.svelte": "./src/components/AccountConnection.svelte",
14
+ "./components/Dock.svelte": "./src/components/Dock.svelte",
14
15
  "./ccht_bg.wasm": "./wasm/ccht_bg.wasm"
15
16
  },
16
- "files": [
17
- "index.js",
18
- "index.d.ts",
19
- "wasm/",
20
- "source/",
21
- "LICENSE",
22
- "LICENSE.md",
23
- "LICENSES/",
24
- "README.md",
25
- "THIRD-PARTY.md"
26
- ],
27
- "repository": {
28
- "type": "git",
29
- "url": "git+https://github.com/corbet-labs/ccht.git"
30
- },
31
- "publishConfig": {
32
- "access": "public"
33
- },
34
- "sideEffects": false,
35
- "gitHead": "387d2d172a285508efae68b24822a73b152b1633"
17
+ "files": ["index.js", "index.d.ts", "src/", "wasm/", "source/", "LICENSE", "LICENSE.md", "LICENSES/", "README.md", "THIRD-PARTY.md"],
18
+ "repository": { "type": "git", "url": "git+https://github.com/corbet-labs/ccht.git" },
19
+ "publishConfig": { "access": "public" },
20
+ "peerDependencies": { "svelte": "^5" },
21
+ "sideEffects": false
36
22
  }