@corbet-labs/ccht 0.2.2 → 0.2.3
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.
- package/LICENSE +307 -0
- package/LICENSE.md +30 -0
- package/LICENSES/GPL-3.0-only.txt +232 -0
- package/LICENSES/LGPL-3.0-linking-exception.txt +16 -0
- package/LICENSES/LGPL-3.0-only WITH LGPL-3.0-linking-exception.txt +16 -0
- package/LICENSES/LGPL-3.0-only.txt +304 -0
- package/LICENSES/dependencies/agent-client-protocol-2.1.0/LICENSE +191 -0
- package/LICENSES/dependencies/agent-client-protocol-derive-2.1.0/LICENSE +191 -0
- package/LICENSES/dependencies/agent-client-protocol-schema-1.7.0/LICENSE +190 -0
- package/LICENSES/dependencies/android_system_properties-0.1.6/LICENSE-APACHE +13 -0
- package/LICENSES/dependencies/android_system_properties-0.1.6/LICENSE-MIT +20 -0
- package/LICENSES/dependencies/anyhow-1.0.104/LICENSE-APACHE +176 -0
- package/LICENSES/dependencies/anyhow-1.0.104/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/async-channel-2.5.0/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/async-channel-2.5.0/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/async-io-2.6.0/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/async-io-2.6.0/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/async-lock-3.4.2/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/async-lock-3.4.2/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/async-process-2.5.0/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/async-process-2.5.0/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/async-signal-0.2.14/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/async-signal-0.2.14/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/async-task-4.7.1/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/async-task-4.7.1/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/atomic-waker-1.1.2/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/atomic-waker-1.1.2/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/atomic-waker-1.1.2/LICENSE-THIRD-PARTY +45 -0
- package/LICENSES/dependencies/autocfg-1.5.1/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/autocfg-1.5.1/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/base64-0.22.1/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/base64-0.22.1/LICENSE-MIT +21 -0
- package/LICENSES/dependencies/base64-0.23.1/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/base64-0.23.1/LICENSE-MIT +21 -0
- package/LICENSES/dependencies/bitflags-1.3.2/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/bitflags-1.3.2/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/bitflags-2.13.2/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/bitflags-2.13.2/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/blocking-1.7.0/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/blocking-1.7.0/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/bs58-0.5.1/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/bs58-0.5.1/LICENSE-MIT +20 -0
- package/LICENSES/dependencies/bumpalo-3.20.3/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/bumpalo-3.20.3/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/bytes-1.12.1/LICENSE +25 -0
- package/LICENSES/dependencies/cc-1.4.5/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/cc-1.4.5/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/cfg-if-1.0.4/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/cfg-if-1.0.4/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/chrono-0.4.45/LICENSE.txt +240 -0
- package/LICENSES/dependencies/concurrent-queue-2.5.0/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/concurrent-queue-2.5.0/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/convert_case-0.10.0/LICENSE +21 -0
- package/LICENSES/dependencies/core-foundation-sys-0.8.7/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/core-foundation-sys-0.8.7/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/crossbeam-deque-0.8.8/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/crossbeam-deque-0.8.8/LICENSE-MIT +27 -0
- package/LICENSES/dependencies/crossbeam-epoch-0.9.21/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/crossbeam-epoch-0.9.21/LICENSE-MIT +27 -0
- package/LICENSES/dependencies/crossbeam-utils-0.8.23/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/crossbeam-utils-0.8.23/LICENSE-MIT +27 -0
- package/LICENSES/dependencies/darling-0.24.1/LICENSE +21 -0
- package/LICENSES/dependencies/darling_core-0.24.1/LICENSE +21 -0
- package/LICENSES/dependencies/darling_macro-0.24.1/LICENSE +21 -0
- package/LICENSES/dependencies/defmt-1.1.1/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/defmt-1.1.1/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/defmt-macros-1.1.1/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/defmt-macros-1.1.1/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/defmt-parser-1.0.0/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/defmt-parser-1.0.0/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/deranged-0.5.8/LICENSE-Apache +202 -0
- package/LICENSES/dependencies/deranged-0.5.8/LICENSE-MIT +19 -0
- package/LICENSES/dependencies/derive_more-2.1.1/LICENSE +21 -0
- package/LICENSES/dependencies/derive_more-impl-2.1.1/LICENSE +21 -0
- package/LICENSES/dependencies/dyn-clone-1.0.20/LICENSE-APACHE +176 -0
- package/LICENSES/dependencies/dyn-clone-1.0.20/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/either-1.18.0/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/either-1.18.0/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/equivalent-1.0.2/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/equivalent-1.0.2/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/errno-0.3.14/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/errno-0.3.14/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/event-listener-5.4.2/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/event-listener-5.4.2/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/event-listener-strategy-0.5.4/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/event-listener-strategy-0.5.4/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/fallible-iterator-0.3.0/LICENSE-APACHE +202 -0
- package/LICENSES/dependencies/fallible-iterator-0.3.0/LICENSE-MIT +19 -0
- package/LICENSES/dependencies/fastrand-2.5.0/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/fastrand-2.5.0/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/find-msvc-tools-0.1.12/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/find-msvc-tools-0.1.12/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/fixedbitset-0.5.7/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/fixedbitset-0.5.7/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/foldhash-0.2.0/LICENSE +19 -0
- package/LICENSES/dependencies/futures-0.3.34/LICENSE-APACHE +202 -0
- package/LICENSES/dependencies/futures-0.3.34/LICENSE-MIT +26 -0
- package/LICENSES/dependencies/futures-channel-0.3.34/LICENSE-APACHE +202 -0
- package/LICENSES/dependencies/futures-channel-0.3.34/LICENSE-MIT +26 -0
- package/LICENSES/dependencies/futures-concurrency-7.7.1/LICENSE-APACHE +190 -0
- package/LICENSES/dependencies/futures-concurrency-7.7.1/LICENSE-MIT +21 -0
- package/LICENSES/dependencies/futures-core-0.3.34/LICENSE-APACHE +202 -0
- package/LICENSES/dependencies/futures-core-0.3.34/LICENSE-MIT +26 -0
- package/LICENSES/dependencies/futures-executor-0.3.34/LICENSE-APACHE +202 -0
- package/LICENSES/dependencies/futures-executor-0.3.34/LICENSE-MIT +26 -0
- package/LICENSES/dependencies/futures-io-0.3.34/LICENSE-APACHE +202 -0
- package/LICENSES/dependencies/futures-io-0.3.34/LICENSE-MIT +26 -0
- package/LICENSES/dependencies/futures-lite-2.6.1/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/futures-lite-2.6.1/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/futures-lite-2.6.1/LICENSE-THIRD-PARTY +45 -0
- package/LICENSES/dependencies/futures-macro-0.3.34/LICENSE-APACHE +202 -0
- package/LICENSES/dependencies/futures-macro-0.3.34/LICENSE-MIT +26 -0
- package/LICENSES/dependencies/futures-sink-0.3.34/LICENSE-APACHE +202 -0
- package/LICENSES/dependencies/futures-sink-0.3.34/LICENSE-MIT +26 -0
- package/LICENSES/dependencies/futures-task-0.3.34/LICENSE-APACHE +202 -0
- package/LICENSES/dependencies/futures-task-0.3.34/LICENSE-MIT +26 -0
- package/LICENSES/dependencies/futures-util-0.3.34/LICENSE-APACHE +202 -0
- package/LICENSES/dependencies/futures-util-0.3.34/LICENSE-MIT +26 -0
- package/LICENSES/dependencies/getrandom-0.4.3/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/getrandom-0.4.3/LICENSE-MIT +26 -0
- package/LICENSES/dependencies/gimli-0.32.3/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/gimli-0.32.3/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/hashbrown-0.12.3/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/hashbrown-0.12.3/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/hashbrown-0.16.1/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/hashbrown-0.16.1/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/hashbrown-0.17.1/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/hashbrown-0.17.1/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/heck-0.5.0/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/heck-0.5.0/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/hermit-abi-0.5.3/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/hermit-abi-0.5.3/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/hex-0.4.3/LICENSE-APACHE +202 -0
- package/LICENSES/dependencies/hex-0.4.3/LICENSE-MIT +20 -0
- package/LICENSES/dependencies/iana-time-zone-0.1.65/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/iana-time-zone-0.1.65/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/iana-time-zone-haiku-0.1.2/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/iana-time-zone-haiku-0.1.2/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/id-arena-2.3.0/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/id-arena-2.3.0/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/ident_case-1.0.1/LICENSE +19 -0
- package/LICENSES/dependencies/indexmap-1.9.3/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/indexmap-1.9.3/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/indexmap-2.14.2/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/indexmap-2.14.2/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/itoa-1.0.18/LICENSE-APACHE +176 -0
- package/LICENSES/dependencies/itoa-1.0.18/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/jiff-0.2.35/COPYING +3 -0
- package/LICENSES/dependencies/jiff-0.2.35/LICENSE-MIT +21 -0
- package/LICENSES/dependencies/jiff-0.2.35/UNLICENSE +24 -0
- package/LICENSES/dependencies/jiff-core-0.1.0/COPYING +3 -0
- package/LICENSES/dependencies/jiff-core-0.1.0/LICENSE-MIT +21 -0
- package/LICENSES/dependencies/jiff-core-0.1.0/UNLICENSE +24 -0
- package/LICENSES/dependencies/jiff-static-0.2.35/COPYING +3 -0
- package/LICENSES/dependencies/jiff-static-0.2.35/LICENSE-MIT +21 -0
- package/LICENSES/dependencies/jiff-static-0.2.35/UNLICENSE +24 -0
- package/LICENSES/dependencies/jiff-tzdb-0.1.8/COPYING +3 -0
- package/LICENSES/dependencies/jiff-tzdb-0.1.8/LICENSE-MIT +21 -0
- package/LICENSES/dependencies/jiff-tzdb-0.1.8/UNLICENSE +24 -0
- package/LICENSES/dependencies/jiff-tzdb-platform-0.1.3/COPYING +3 -0
- package/LICENSES/dependencies/jiff-tzdb-platform-0.1.3/LICENSE-MIT +21 -0
- package/LICENSES/dependencies/jiff-tzdb-platform-0.1.3/UNLICENSE +24 -0
- package/LICENSES/dependencies/js-sys-0.3.105/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/js-sys-0.3.105/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/leb128-0.2.7/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/leb128-0.2.7/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/leb128fmt-0.1.0/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/leb128fmt-0.1.0/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/libc-0.2.189/LICENSE-APACHE +176 -0
- package/LICENSES/dependencies/libc-0.2.189/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/linux-raw-sys-0.12.1/COPYRIGHT +29 -0
- package/LICENSES/dependencies/linux-raw-sys-0.12.1/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/linux-raw-sys-0.12.1/LICENSE-Apache-2.0_WITH_LLVM-exception +220 -0
- package/LICENSES/dependencies/linux-raw-sys-0.12.1/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/log-0.4.34/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/log-0.4.34/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/memchr-2.8.3/COPYING +3 -0
- package/LICENSES/dependencies/memchr-2.8.3/LICENSE-MIT +21 -0
- package/LICENSES/dependencies/memchr-2.8.3/UNLICENSE +24 -0
- package/LICENSES/dependencies/mio-1.2.3/LICENSE +19 -0
- package/LICENSES/dependencies/num-conv-0.2.2/LICENSE-Apache +177 -0
- package/LICENSES/dependencies/num-conv-0.2.2/LICENSE-MIT +19 -0
- package/LICENSES/dependencies/num-traits-0.2.19/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/num-traits-0.2.19/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/once_cell-1.21.4/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/once_cell-1.21.4/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/parking-2.2.1/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/parking-2.2.1/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/parking-2.2.1/LICENSE-THIRD-PARTY +9 -0
- package/LICENSES/dependencies/pin-project-1.1.13/LICENSE-APACHE +177 -0
- package/LICENSES/dependencies/pin-project-1.1.13/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/pin-project-internal-1.1.13/LICENSE-APACHE +177 -0
- package/LICENSES/dependencies/pin-project-internal-1.1.13/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/pin-project-lite-0.2.17/LICENSE-APACHE +177 -0
- package/LICENSES/dependencies/pin-project-lite-0.2.17/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/piper-0.2.5/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/piper-0.2.5/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/polling-3.11.0/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/polling-3.11.0/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/portable-atomic-1.15.0/LICENSE-APACHE +177 -0
- package/LICENSES/dependencies/portable-atomic-1.15.0/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/portable-atomic-util-0.2.8/LICENSE-APACHE +177 -0
- package/LICENSES/dependencies/portable-atomic-util-0.2.8/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/powerfmt-0.2.0/LICENSE-Apache +202 -0
- package/LICENSES/dependencies/powerfmt-0.2.0/LICENSE-MIT +19 -0
- package/LICENSES/dependencies/proc-macro2-1.0.107/LICENSE-APACHE +176 -0
- package/LICENSES/dependencies/proc-macro2-1.0.107/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/quote-1.0.47/LICENSE-APACHE +176 -0
- package/LICENSES/dependencies/quote-1.0.47/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/r-efi-6.0.0/AUTHORS +75 -0
- package/LICENSES/dependencies/rayon-1.12.0/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/rayon-1.12.0/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/rayon-core-1.13.0/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/rayon-core-1.13.0/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/ref-cast-1.0.27/LICENSE-APACHE +176 -0
- package/LICENSES/dependencies/ref-cast-1.0.27/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/ref-cast-impl-1.0.27/LICENSE-APACHE +176 -0
- package/LICENSES/dependencies/ref-cast-impl-1.0.27/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/rustc-demangle-0.1.28/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/rustc-demangle-0.1.28/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/rustc-hash-2.1.3/LICENSE-APACHE +176 -0
- package/LICENSES/dependencies/rustc-hash-2.1.3/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/rustc_version-0.4.1/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/rustc_version-0.4.1/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/rustix-1.1.4/COPYRIGHT +29 -0
- package/LICENSES/dependencies/rustix-1.1.4/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/rustix-1.1.4/LICENSE-Apache-2.0_WITH_LLVM-exception +220 -0
- package/LICENSES/dependencies/rustix-1.1.4/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/rustversion-1.0.23/LICENSE-APACHE +176 -0
- package/LICENSES/dependencies/rustversion-1.0.23/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/schemars-0.9.0/LICENSE +21 -0
- package/LICENSES/dependencies/schemars-1.2.2/LICENSE +21 -0
- package/LICENSES/dependencies/schemars_derive-1.2.2/LICENSE +21 -0
- package/LICENSES/dependencies/semver-1.0.28/LICENSE-APACHE +176 -0
- package/LICENSES/dependencies/semver-1.0.28/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/serde-1.0.229/LICENSE-APACHE +176 -0
- package/LICENSES/dependencies/serde-1.0.229/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/serde_core-1.0.229/LICENSE-APACHE +176 -0
- package/LICENSES/dependencies/serde_core-1.0.229/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/serde_derive-1.0.229/LICENSE-APACHE +176 -0
- package/LICENSES/dependencies/serde_derive-1.0.229/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/serde_derive_internals-0.30.0/LICENSE-APACHE +176 -0
- package/LICENSES/dependencies/serde_derive_internals-0.30.0/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/serde_json-1.0.151/LICENSE-APACHE +176 -0
- package/LICENSES/dependencies/serde_json-1.0.151/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/serde_with-3.23.0/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/serde_with-3.23.0/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/serde_with_macros-3.23.0/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/serde_with_macros-3.23.0/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/shell-words-1.1.1/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/shell-words-1.1.1/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/shlex-2.0.1/LICENSE-APACHE +13 -0
- package/LICENSES/dependencies/shlex-2.0.1/LICENSE-MIT +21 -0
- package/LICENSES/dependencies/signal-hook-registry-1.4.8/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/signal-hook-registry-1.4.8/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/slab-0.4.12/LICENSE +25 -0
- package/LICENSES/dependencies/smallvec-1.16.0/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/smallvec-1.16.0/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/socket2-0.6.5/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/socket2-0.6.5/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/stable_deref_trait-1.2.1/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/stable_deref_trait-1.2.1/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/strsim-0.11.1/LICENSE +23 -0
- package/LICENSES/dependencies/strum-0.28.0/LICENSE +21 -0
- package/LICENSES/dependencies/strum_macros-0.28.0/LICENSE +21 -0
- package/LICENSES/dependencies/syn-2.0.119/LICENSE-APACHE +176 -0
- package/LICENSES/dependencies/syn-2.0.119/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/syn-3.0.5/LICENSE-APACHE +176 -0
- package/LICENSES/dependencies/syn-3.0.5/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/thiserror-2.0.20/LICENSE-APACHE +176 -0
- package/LICENSES/dependencies/thiserror-2.0.20/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/thiserror-impl-2.0.20/LICENSE-APACHE +176 -0
- package/LICENSES/dependencies/thiserror-impl-2.0.20/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/time-0.3.55/LICENSE-Apache +177 -0
- package/LICENSES/dependencies/time-0.3.55/LICENSE-MIT +19 -0
- package/LICENSES/dependencies/time-core-0.1.9/LICENSE-Apache +177 -0
- package/LICENSES/dependencies/time-core-0.1.9/LICENSE-MIT +19 -0
- package/LICENSES/dependencies/time-macros-0.2.32/LICENSE-Apache +177 -0
- package/LICENSES/dependencies/time-macros-0.2.32/LICENSE-MIT +19 -0
- package/LICENSES/dependencies/tinyvec-1.13.2/LICENSE-APACHE.md +202 -0
- package/LICENSES/dependencies/tinyvec-1.13.2/LICENSE-MIT.md +5 -0
- package/LICENSES/dependencies/tinyvec-1.13.2/LICENSE-ZLIB.md +11 -0
- package/LICENSES/dependencies/tinyvec_macros-0.1.1/LICENSE-APACHE.md +202 -0
- package/LICENSES/dependencies/tinyvec_macros-0.1.1/LICENSE-MIT.md +21 -0
- package/LICENSES/dependencies/tinyvec_macros-0.1.1/LICENSE-ZLIB.md +20 -0
- package/LICENSES/dependencies/tokio-1.53.1/LICENSE +21 -0
- package/LICENSES/dependencies/tokio-macros-2.7.2/LICENSE +22 -0
- package/LICENSES/dependencies/tracing-0.1.44/LICENSE +25 -0
- package/LICENSES/dependencies/tracing-attributes-0.1.31/LICENSE +25 -0
- package/LICENSES/dependencies/tracing-core-0.1.36/LICENSE +25 -0
- package/LICENSES/dependencies/unicode-ident-1.0.24/LICENSE-APACHE +176 -0
- package/LICENSES/dependencies/unicode-ident-1.0.24/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/unicode-ident-1.0.24/LICENSE-UNICODE +39 -0
- package/LICENSES/dependencies/unicode-segmentation-1.13.3/COPYRIGHT +7 -0
- package/LICENSES/dependencies/unicode-segmentation-1.13.3/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/unicode-segmentation-1.13.3/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/unicode-xid-0.2.6/COPYRIGHT +7 -0
- package/LICENSES/dependencies/unicode-xid-0.2.6/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/unicode-xid-0.2.6/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/uuid-1.26.1/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/uuid-1.26.1/LICENSE-MIT +26 -0
- package/LICENSES/dependencies/walrus-0.26.5/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/walrus-0.26.5/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/walrus-macro-0.26.0/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/walrus-macro-0.26.0/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/wasi-0.11.1+wasi-snapshot-preview1/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/wasi-0.11.1+wasi-snapshot-preview1/LICENSE-Apache-2.0_WITH_LLVM-exception +220 -0
- package/LICENSES/dependencies/wasi-0.11.1+wasi-snapshot-preview1/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/wasm-bindgen-0.2.128/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/wasm-bindgen-0.2.128/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/wasm-bindgen-cli-support-0.2.128/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/wasm-bindgen-cli-support-0.2.128/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/wasm-bindgen-macro-0.2.128/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/wasm-bindgen-macro-0.2.128/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/wasm-bindgen-macro-support-0.2.128/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/wasm-bindgen-macro-support-0.2.128/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/wasm-bindgen-shared-0.2.128/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/wasm-bindgen-shared-0.2.128/LICENSE-MIT +25 -0
- package/LICENSES/dependencies/wasm-encoder-0.245.1/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/wasm-encoder-0.245.1/LICENSE-Apache-2.0_WITH_LLVM-exception +220 -0
- package/LICENSES/dependencies/wasm-encoder-0.245.1/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/wasmparser-0.245.1/LICENSE-APACHE +201 -0
- package/LICENSES/dependencies/wasmparser-0.245.1/LICENSE-Apache-2.0_WITH_LLVM-exception +220 -0
- package/LICENSES/dependencies/wasmparser-0.245.1/LICENSE-MIT +23 -0
- package/LICENSES/dependencies/windows-core-0.62.2/license-apache-2.0 +201 -0
- package/LICENSES/dependencies/windows-core-0.62.2/license-mit +21 -0
- package/LICENSES/dependencies/windows-implement-0.60.2/license-apache-2.0 +201 -0
- package/LICENSES/dependencies/windows-implement-0.60.2/license-mit +21 -0
- package/LICENSES/dependencies/windows-interface-0.59.3/license-apache-2.0 +201 -0
- package/LICENSES/dependencies/windows-interface-0.59.3/license-mit +21 -0
- package/LICENSES/dependencies/windows-link-0.2.1/license-apache-2.0 +201 -0
- package/LICENSES/dependencies/windows-link-0.2.1/license-mit +21 -0
- package/LICENSES/dependencies/windows-result-0.4.1/license-apache-2.0 +201 -0
- package/LICENSES/dependencies/windows-result-0.4.1/license-mit +21 -0
- package/LICENSES/dependencies/windows-strings-0.5.1/license-apache-2.0 +201 -0
- package/LICENSES/dependencies/windows-strings-0.5.1/license-mit +21 -0
- package/LICENSES/dependencies/windows-sys-0.61.2/license-apache-2.0 +201 -0
- package/LICENSES/dependencies/windows-sys-0.61.2/license-mit +21 -0
- package/LICENSES/dependencies/zmij-1.0.23/LICENSE-MIT +23 -0
- package/THIRD-PARTY.md +62 -0
- package/package.json +37 -9
- package/source/.cargo/config.toml +5 -0
- package/source/.ci/upstream-notices/PROVENANCE.json +198 -0
- package/source/.ci/upstream-notices/agent-client-protocol-2.1.0/LICENSE +191 -0
- package/source/.ci/upstream-notices/agent-client-protocol-derive-2.1.0/LICENSE +191 -0
- package/source/.ci/upstream-notices/agent-client-protocol-schema-1.7.0/LICENSE +190 -0
- package/source/.ci/upstream-notices/defmt-parser-1.0.0/LICENSE-APACHE +201 -0
- package/source/.ci/upstream-notices/defmt-parser-1.0.0/LICENSE-MIT +25 -0
- package/source/.ci/upstream-notices/r-efi-6.0.0/AUTHORS +75 -0
- package/source/.ci/upstream-notices/wasm-encoder-0.245.1/LICENSE-APACHE +201 -0
- package/source/.ci/upstream-notices/wasm-encoder-0.245.1/LICENSE-Apache-2.0_WITH_LLVM-exception +220 -0
- package/source/.ci/upstream-notices/wasm-encoder-0.245.1/LICENSE-MIT +23 -0
- package/source/.ci/upstream-notices/wasmparser-0.245.1/LICENSE-APACHE +201 -0
- package/source/.ci/upstream-notices/wasmparser-0.245.1/LICENSE-Apache-2.0_WITH_LLVM-exception +220 -0
- package/source/.ci/upstream-notices/wasmparser-0.245.1/LICENSE-MIT +23 -0
- package/source/.ci/wasm-bundle/Cargo.toml +10 -0
- package/source/.ci/wasm-bundle/src/main.rs +17 -0
- package/source/CHANGELOG.md +85 -0
- package/source/Cargo.lock +1630 -0
- package/source/Cargo.toml +48 -0
- package/source/LICENSE +307 -0
- package/source/LICENSE.md +30 -0
- package/source/LICENSES/GPL-3.0-only.txt +232 -0
- package/source/LICENSES/LGPL-3.0-linking-exception.txt +16 -0
- package/source/LICENSES/LGPL-3.0-only WITH LGPL-3.0-linking-exception.txt +16 -0
- package/source/LICENSES/LGPL-3.0-only.txt +304 -0
- package/source/README.md +289 -0
- package/source/THIRD-PARTY.md +62 -0
- package/source/dependencies.tar.gz +0 -0
- package/source/examples/native.rs +45 -0
- package/source/src/auth.rs +435 -0
- package/source/src/configuration.rs +140 -0
- package/source/src/conversation.rs +594 -0
- package/source/src/dock.rs +564 -0
- package/source/src/lib.rs +39 -0
- package/source/src/native/client.rs +401 -0
- package/source/src/native/drivers/codex.rs +506 -0
- package/source/src/native/drivers/mod.rs +305 -0
- package/source/src/native/drivers/opencode.rs +531 -0
- package/source/src/native/env.rs +264 -0
- package/source/src/native/fixture.py +191 -0
- package/source/src/native/mod.rs +257 -0
- package/source/src/native/pool.rs +440 -0
- package/source/src/native/session.rs +609 -0
- package/source/src/native/tests.rs +667 -0
- package/source/src/transport.rs +330 -0
- package/source/src/web.rs +35 -0
- package/wasm/ccht_bg.wasm +0 -0
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
//! Transport abstraction for ACP-style JSON-RPC.
|
|
2
|
+
//!
|
|
3
|
+
//! The same event contract can travel over a native stdio pipe or over a
|
|
4
|
+
//! socket used by a Wasm bridge. This module only describes and validates
|
|
5
|
+
//! endpoints; it never connects, spawns processes, or performs network I/O.
|
|
6
|
+
//!
|
|
7
|
+
//! Validation is offline and never echoes addresses or credentials: error
|
|
8
|
+
//! messages use fixed text so secrets cannot leak through [`TransportError`].
|
|
9
|
+
|
|
10
|
+
/// How an ACP-style endpoint is reached.
|
|
11
|
+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
12
|
+
pub enum TransportKind {
|
|
13
|
+
/// A child process speaking JSON-RPC over stdin and stdout.
|
|
14
|
+
Stdio,
|
|
15
|
+
/// A socket endpoint (`ws`/`wss`/`http`/`https`) used by a bridge.
|
|
16
|
+
Socket,
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/// A validated endpoint description for ACP-style JSON-RPC.
|
|
20
|
+
///
|
|
21
|
+
/// Implementors must be sendable across threads; validation is offline only
|
|
22
|
+
/// and performs no connecting or process spawning.
|
|
23
|
+
pub trait Transport: Send {
|
|
24
|
+
/// Which mechanism this endpoint uses.
|
|
25
|
+
fn kind(&self) -> TransportKind;
|
|
26
|
+
/// Non-sensitive hint for logs or UI, without credentials.
|
|
27
|
+
fn address_hint(&self) -> Option<String>;
|
|
28
|
+
/// Check endpoint shape without connecting or spawning.
|
|
29
|
+
///
|
|
30
|
+
/// # Errors
|
|
31
|
+
///
|
|
32
|
+
/// Returns [`TransportError`] when the endpoint shape is invalid.
|
|
33
|
+
fn validate(&self) -> Result<(), TransportError>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/// Transport validation failure without sensitive data.
|
|
37
|
+
///
|
|
38
|
+
/// Messages are fixed strings; they never echo programs, URLs, or tokens.
|
|
39
|
+
#[derive(Debug, Clone, thiserror::Error, PartialEq, Eq)]
|
|
40
|
+
pub enum TransportError {
|
|
41
|
+
/// The endpoint address shape is invalid.
|
|
42
|
+
#[error("invalid transport address: {0}")]
|
|
43
|
+
InvalidAddress(&'static str),
|
|
44
|
+
/// This transport kind is not supported in the current context.
|
|
45
|
+
#[error("unsupported transport: {0}")]
|
|
46
|
+
Unsupported(&'static str),
|
|
47
|
+
/// The transport is already closed.
|
|
48
|
+
#[error("transport is closed")]
|
|
49
|
+
Closed,
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/// Stdio endpoint: an explicit program plus arguments.
|
|
53
|
+
///
|
|
54
|
+
/// No shell parsing is involved; the program must be non-empty.
|
|
55
|
+
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
56
|
+
pub struct StdioTransport {
|
|
57
|
+
/// Explicit executable path or name; never a shell string.
|
|
58
|
+
pub program: String,
|
|
59
|
+
/// Arguments passed directly to the executable.
|
|
60
|
+
pub args: Vec<String>,
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
impl StdioTransport {
|
|
64
|
+
/// Create a stdio endpoint with an explicit program and arguments.
|
|
65
|
+
pub fn new(program: impl Into<String>, args: Vec<String>) -> Self {
|
|
66
|
+
Self {
|
|
67
|
+
program: program.into(),
|
|
68
|
+
args,
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
impl Transport for StdioTransport {
|
|
74
|
+
/// Report [`TransportKind::Stdio`].
|
|
75
|
+
fn kind(&self) -> TransportKind {
|
|
76
|
+
TransportKind::Stdio
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/// The program name when non-empty, without arguments.
|
|
80
|
+
fn address_hint(&self) -> Option<String> {
|
|
81
|
+
let program = self.program.trim();
|
|
82
|
+
if program.is_empty() {
|
|
83
|
+
None
|
|
84
|
+
} else {
|
|
85
|
+
Some(program.to_owned())
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/// Require a non-empty program; arguments need no validation.
|
|
90
|
+
///
|
|
91
|
+
/// # Errors
|
|
92
|
+
///
|
|
93
|
+
/// Returns [`TransportError::InvalidAddress`] when the program is empty.
|
|
94
|
+
fn validate(&self) -> Result<(), TransportError> {
|
|
95
|
+
if self.program.trim().is_empty() {
|
|
96
|
+
return Err(TransportError::InvalidAddress(
|
|
97
|
+
"stdio program must not be empty",
|
|
98
|
+
));
|
|
99
|
+
}
|
|
100
|
+
Ok(())
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/// Socket endpoint: a URL string validated offline, never dialed.
|
|
105
|
+
///
|
|
106
|
+
/// Accepted schemes are `ws`, `wss`, `http`, and `https` with a non-empty
|
|
107
|
+
/// host. Validation checks shape only and never connects.
|
|
108
|
+
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
109
|
+
pub struct SocketTransport {
|
|
110
|
+
/// Endpoint URL; validated for shape only, never connected.
|
|
111
|
+
pub url: String,
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
impl SocketTransport {
|
|
115
|
+
/// Create a socket endpoint; call [`Transport::validate`] to check shape.
|
|
116
|
+
pub fn new(url: impl Into<String>) -> Self {
|
|
117
|
+
Self { url: url.into() }
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
impl Transport for SocketTransport {
|
|
122
|
+
/// Report [`TransportKind::Socket`].
|
|
123
|
+
fn kind(&self) -> TransportKind {
|
|
124
|
+
TransportKind::Socket
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/// The URL when non-empty; callers must redact userinfo before display
|
|
128
|
+
/// when the URL may carry credentials.
|
|
129
|
+
fn address_hint(&self) -> Option<String> {
|
|
130
|
+
if self.url.trim().is_empty() {
|
|
131
|
+
None
|
|
132
|
+
} else {
|
|
133
|
+
Some(self.url.clone())
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/// Validate scheme and host presence without connecting.
|
|
138
|
+
///
|
|
139
|
+
/// # Errors
|
|
140
|
+
///
|
|
141
|
+
/// Returns [`TransportError::InvalidAddress`] when the scheme is not
|
|
142
|
+
/// `ws`/`wss`/`http`/`https` or when no host is present.
|
|
143
|
+
fn validate(&self) -> Result<(), TransportError> {
|
|
144
|
+
validate_socket_url(&self.url)
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/// Check socket URL shape without connecting or echoing the URL in errors.
|
|
149
|
+
fn validate_socket_url(url: &str) -> Result<(), TransportError> {
|
|
150
|
+
if url.trim().is_empty() {
|
|
151
|
+
return Err(TransportError::InvalidAddress(
|
|
152
|
+
"socket url must not be empty",
|
|
153
|
+
));
|
|
154
|
+
}
|
|
155
|
+
if url != url.trim() || url.chars().any(char::is_whitespace) {
|
|
156
|
+
return Err(TransportError::InvalidAddress(
|
|
157
|
+
"socket url must not contain whitespace",
|
|
158
|
+
));
|
|
159
|
+
}
|
|
160
|
+
let Some((scheme, rest)) = url.split_once("://") else {
|
|
161
|
+
return Err(TransportError::InvalidAddress(
|
|
162
|
+
"socket url must include a scheme",
|
|
163
|
+
));
|
|
164
|
+
};
|
|
165
|
+
match scheme.to_ascii_lowercase().as_str() {
|
|
166
|
+
"ws" | "wss" | "http" | "https" => {}
|
|
167
|
+
_ => {
|
|
168
|
+
return Err(TransportError::InvalidAddress(
|
|
169
|
+
"socket url scheme must be ws, wss, http, or https",
|
|
170
|
+
));
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
if rest.is_empty() {
|
|
174
|
+
return Err(TransportError::InvalidAddress(
|
|
175
|
+
"socket url must include a host",
|
|
176
|
+
));
|
|
177
|
+
}
|
|
178
|
+
let authority = rest.split(['/', '?', '#']).next().unwrap_or("");
|
|
179
|
+
if authority.is_empty() {
|
|
180
|
+
return Err(TransportError::InvalidAddress(
|
|
181
|
+
"socket url must include a host",
|
|
182
|
+
));
|
|
183
|
+
}
|
|
184
|
+
let host_port = authority.rsplit('@').next().unwrap_or("");
|
|
185
|
+
let host = if let Some(bracketed) = host_port.strip_prefix('[') {
|
|
186
|
+
let Some(end) = bracketed.find(']') else {
|
|
187
|
+
return Err(TransportError::InvalidAddress(
|
|
188
|
+
"socket url must include a host",
|
|
189
|
+
));
|
|
190
|
+
};
|
|
191
|
+
&bracketed[..end]
|
|
192
|
+
} else {
|
|
193
|
+
host_port.split(':').next().unwrap_or("")
|
|
194
|
+
};
|
|
195
|
+
if host.is_empty() {
|
|
196
|
+
return Err(TransportError::InvalidAddress(
|
|
197
|
+
"socket url must include a host",
|
|
198
|
+
));
|
|
199
|
+
}
|
|
200
|
+
Ok(())
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
#[cfg(test)]
|
|
204
|
+
mod tests {
|
|
205
|
+
use super::*;
|
|
206
|
+
|
|
207
|
+
fn assert_send<T: Send>() {}
|
|
208
|
+
|
|
209
|
+
#[test]
|
|
210
|
+
fn transports_are_send() {
|
|
211
|
+
assert_send::<StdioTransport>();
|
|
212
|
+
assert_send::<SocketTransport>();
|
|
213
|
+
assert_send::<TransportKind>();
|
|
214
|
+
assert_send::<TransportError>();
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
#[test]
|
|
218
|
+
fn stdio_accepts_explicit_program() {
|
|
219
|
+
let transport = StdioTransport::new("agent", vec!["--flag".into()]);
|
|
220
|
+
assert_eq!(transport.kind(), TransportKind::Stdio);
|
|
221
|
+
assert_eq!(transport.address_hint().as_deref(), Some("agent"));
|
|
222
|
+
transport.validate().unwrap();
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
#[test]
|
|
226
|
+
fn stdio_rejects_empty_program() {
|
|
227
|
+
for program in ["", " ", "\t\n"] {
|
|
228
|
+
let transport = StdioTransport::new(program, Vec::new());
|
|
229
|
+
assert_eq!(transport.address_hint(), None);
|
|
230
|
+
assert_eq!(
|
|
231
|
+
transport.validate().unwrap_err(),
|
|
232
|
+
TransportError::InvalidAddress("stdio program must not be empty")
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
#[test]
|
|
238
|
+
fn socket_accepts_supported_schemes_with_host() {
|
|
239
|
+
for url in [
|
|
240
|
+
"ws://bridge.local/session",
|
|
241
|
+
"wss://bridge.example.com:443/session",
|
|
242
|
+
"http://localhost:8080/bridge",
|
|
243
|
+
"https://example.com",
|
|
244
|
+
"ws://127.0.0.1:9000",
|
|
245
|
+
"wss://[::1]:9000/session",
|
|
246
|
+
"https://example.com/path?query=1#fragment",
|
|
247
|
+
] {
|
|
248
|
+
let transport = SocketTransport::new(url);
|
|
249
|
+
assert_eq!(transport.kind(), TransportKind::Socket);
|
|
250
|
+
assert_eq!(transport.address_hint().as_deref(), Some(url));
|
|
251
|
+
transport.validate().unwrap();
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
#[test]
|
|
256
|
+
fn socket_scheme_match_is_case_insensitive() {
|
|
257
|
+
SocketTransport::new("WSS://bridge.example.com/session")
|
|
258
|
+
.validate()
|
|
259
|
+
.unwrap();
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
#[test]
|
|
263
|
+
fn socket_rejects_missing_or_unsupported_address() {
|
|
264
|
+
for url in [
|
|
265
|
+
"",
|
|
266
|
+
" ",
|
|
267
|
+
"bridge.example.com/session",
|
|
268
|
+
"ftp://bridge.example.com/session",
|
|
269
|
+
"file:///tmp/socket",
|
|
270
|
+
"ws://",
|
|
271
|
+
"wss://",
|
|
272
|
+
"https://",
|
|
273
|
+
"ws:///path-only",
|
|
274
|
+
"https:///path-only",
|
|
275
|
+
"ws://?query-only",
|
|
276
|
+
"ws://#fragment-only",
|
|
277
|
+
"ws://:8080/no-host",
|
|
278
|
+
"ws://bridge.example.com:8080/pa th",
|
|
279
|
+
" ws://bridge.example.com",
|
|
280
|
+
"ws://bridge.example.com ",
|
|
281
|
+
] {
|
|
282
|
+
let transport = SocketTransport::new(url);
|
|
283
|
+
assert!(
|
|
284
|
+
transport.validate().is_err(),
|
|
285
|
+
"expected rejection for {url:?}"
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
#[test]
|
|
291
|
+
fn error_messages_never_echo_addresses() {
|
|
292
|
+
let secret = "super-secret-token-9f8e7d6c";
|
|
293
|
+
let transport = SocketTransport::new(format!("ftp://bridge.example.com/{secret}"));
|
|
294
|
+
let error = transport.validate().unwrap_err();
|
|
295
|
+
assert_eq!(
|
|
296
|
+
error,
|
|
297
|
+
TransportError::InvalidAddress("socket url scheme must be ws, wss, http, or https")
|
|
298
|
+
);
|
|
299
|
+
let rendered = format!("{error} {error:?}");
|
|
300
|
+
assert!(!rendered.contains(secret));
|
|
301
|
+
assert!(!rendered.contains("ftp://"));
|
|
302
|
+
|
|
303
|
+
let stdio_error = StdioTransport::new("", Vec::new()).validate().unwrap_err();
|
|
304
|
+
assert!(!format!("{stdio_error}").contains(secret));
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
#[test]
|
|
308
|
+
fn closed_and_unsupported_variants_stay_static() {
|
|
309
|
+
let closed = TransportError::Closed;
|
|
310
|
+
let unsupported = TransportError::Unsupported("socket bridge");
|
|
311
|
+
assert_eq!(format!("{closed}"), "transport is closed");
|
|
312
|
+
assert_eq!(
|
|
313
|
+
format!("{unsupported}"),
|
|
314
|
+
"unsupported transport: socket bridge"
|
|
315
|
+
);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
#[test]
|
|
319
|
+
fn socket_hint_is_none_for_blank_address() {
|
|
320
|
+
for url in ["", " ", "\t\n"] {
|
|
321
|
+
assert_eq!(SocketTransport::new(url).address_hint(), None);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
#[test]
|
|
326
|
+
fn stdio_hint_trims_program_name() {
|
|
327
|
+
let transport = StdioTransport::new(" agent ", Vec::new());
|
|
328
|
+
assert_eq!(transport.address_hint().as_deref(), Some("agent"));
|
|
329
|
+
}
|
|
330
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//! Browser bindings for the same conversation state used by native consumers.
|
|
2
|
+
|
|
3
|
+
use wasm_bindgen::prelude::*;
|
|
4
|
+
|
|
5
|
+
/// A Rust conversation model exported to JavaScript. The application owns transport.
|
|
6
|
+
#[wasm_bindgen(js_name = ConversationModel)]
|
|
7
|
+
pub struct WebConversation {
|
|
8
|
+
inner: crate::Conversation,
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
#[wasm_bindgen(js_class = ConversationModel)]
|
|
12
|
+
impl WebConversation {
|
|
13
|
+
/// Create an isolated conversation state.
|
|
14
|
+
#[wasm_bindgen(constructor)]
|
|
15
|
+
pub fn new(conversation_id: String) -> Self {
|
|
16
|
+
Self {
|
|
17
|
+
inner: crate::Conversation::new(conversation_id),
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/// Apply an event and report whether it changed the state.
|
|
22
|
+
#[wasm_bindgen(js_name = applyEvent)]
|
|
23
|
+
pub fn apply_event(&mut self, event_json: &str) -> Result<bool, JsValue> {
|
|
24
|
+
self.inner
|
|
25
|
+
.apply_json(event_json)
|
|
26
|
+
.map_err(|error| JsValue::from_str(&error.to_string()))
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/// Return the current render state as JSON.
|
|
30
|
+
pub fn snapshot(&self) -> Result<String, JsValue> {
|
|
31
|
+
self.inner
|
|
32
|
+
.snapshot_json()
|
|
33
|
+
.map_err(|error| JsValue::from_str(&error.to_string()))
|
|
34
|
+
}
|
|
35
|
+
}
|
package/wasm/ccht_bg.wasm
CHANGED
|
Binary file
|