@corbet-labs/ccht 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/README.md +70 -0
- package/THIRD-PARTY.md +62 -0
- package/package.json +48 -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 +99 -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/src/auth.test.ts +115 -0
- package/src/components/ChatDock.component.test.ts +213 -0
- package/src/components/ChatDock.svelte +422 -0
- package/src/components/Dock.component.test.ts +92 -0
- package/src/components/Dock.svelte +6 -3
- package/src/components/StepConfig.component.test.ts +185 -0
- package/src/components/StepConfig.svelte +247 -0
- package/src/dock.test.ts +226 -0
- package/wasm/ccht_bg.wasm +0 -0
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
//! Native client connection to one ACP agent process.
|
|
2
|
+
//!
|
|
3
|
+
//! The upstream SDK owns process spawning, protocol dispatch, and cleanup.
|
|
4
|
+
//! This module only validates options, clears ambient credential variables,
|
|
5
|
+
//! and negotiates stable ACP v1 before handing sessions to [`super::session`].
|
|
6
|
+
|
|
7
|
+
use std::sync::{Arc, Mutex};
|
|
8
|
+
|
|
9
|
+
use agent_client_protocol::schema::ProtocolVersion;
|
|
10
|
+
use agent_client_protocol::{AcpAgent, AcpAgentConfig, ActiveSession, Agent, Client, ConnectionTo};
|
|
11
|
+
use tokio::sync::{oneshot, watch};
|
|
12
|
+
use tokio::task::JoinHandle;
|
|
13
|
+
use tokio::time::timeout;
|
|
14
|
+
|
|
15
|
+
use crate::acp::{
|
|
16
|
+
AuthMethod, AuthenticateRequest, InitializeRequest, InitializeResponse, LoadSessionRequest,
|
|
17
|
+
McpServer, NewSessionRequest, ResumeSessionRequest,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
use super::{
|
|
21
|
+
AgentCommand, NativeError, NativeOptions, NativeSession, Result, SessionOptions, lock,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/// A connection to one explicitly selected, externally authenticated ACP agent.
|
|
25
|
+
///
|
|
26
|
+
/// Clones and active sessions share this connection. Closing the client closes
|
|
27
|
+
/// every session on it. No credentials are stored and no API fallback is attempted.
|
|
28
|
+
#[derive(Clone)]
|
|
29
|
+
pub struct NativeClient {
|
|
30
|
+
pub(super) inner: Arc<ClientLease>,
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
pub(super) struct ClientLease {
|
|
34
|
+
pub(super) state: Arc<ClientState>,
|
|
35
|
+
pub(super) connection: ConnectionTo<Agent>,
|
|
36
|
+
pub(super) info: InitializeResponse,
|
|
37
|
+
pub(super) options: NativeOptions,
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
pub(super) struct ClientState {
|
|
41
|
+
shutdown: watch::Sender<bool>,
|
|
42
|
+
pub(super) closed: watch::Sender<bool>,
|
|
43
|
+
failure: Mutex<Option<NativeError>>,
|
|
44
|
+
task: Mutex<Option<JoinHandle<()>>>,
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
impl ClientState {
|
|
48
|
+
pub(super) fn abort(&self) {
|
|
49
|
+
self.shutdown.send_replace(true);
|
|
50
|
+
self.closed.send_replace(true);
|
|
51
|
+
if let Some(task) = lock(&self.task).as_ref() {
|
|
52
|
+
task.abort();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
pub(super) fn error(&self) -> NativeError {
|
|
57
|
+
lock(&self.failure).clone().unwrap_or(NativeError::Closed)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
pub(super) fn is_closed(&self) -> bool {
|
|
61
|
+
*self.closed.borrow()
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
impl Drop for ClientLease {
|
|
66
|
+
fn drop(&mut self) {
|
|
67
|
+
self.state.abort();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
struct Connecting(Option<Arc<ClientState>>);
|
|
72
|
+
|
|
73
|
+
impl Drop for Connecting {
|
|
74
|
+
fn drop(&mut self) {
|
|
75
|
+
if let Some(state) = &self.0 {
|
|
76
|
+
state.abort();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
impl NativeClient {
|
|
82
|
+
/// Spawn the configured agent through the SDK and negotiate stable ACP v1.
|
|
83
|
+
///
|
|
84
|
+
/// Requires a caller-owned Tokio runtime. No terminal or filesystem client
|
|
85
|
+
/// capabilities are advertised. Authentication remains with the agent.
|
|
86
|
+
pub async fn connect(command: AgentCommand, options: NativeOptions) -> Result<Self> {
|
|
87
|
+
let runtime =
|
|
88
|
+
tokio::runtime::Handle::try_current().map_err(|_| NativeError::RuntimeUnavailable)?;
|
|
89
|
+
if command.program.as_os_str().is_empty()
|
|
90
|
+
|| options.event_capacity == 0
|
|
91
|
+
|| options.operation_timeout.is_zero()
|
|
92
|
+
|| options.prompt_timeout.is_zero()
|
|
93
|
+
|| options.permission_timeout.is_zero()
|
|
94
|
+
|| options.shutdown_timeout.is_zero()
|
|
95
|
+
{
|
|
96
|
+
return Err(NativeError::InvalidOptions(
|
|
97
|
+
"executable and positive limits are required",
|
|
98
|
+
));
|
|
99
|
+
}
|
|
100
|
+
if command
|
|
101
|
+
.env
|
|
102
|
+
.iter()
|
|
103
|
+
.any(|(key, value)| api_credential_variable(key) && !value.is_empty())
|
|
104
|
+
{
|
|
105
|
+
return Err(NativeError::InvalidOptions(
|
|
106
|
+
"API credential environment overrides are not accepted",
|
|
107
|
+
));
|
|
108
|
+
}
|
|
109
|
+
let mut config = AcpAgentConfig::new(command.program)
|
|
110
|
+
.args(command.args)
|
|
111
|
+
.envs(command.env);
|
|
112
|
+
// The SDK inherits the host environment. Empty known API credential
|
|
113
|
+
// variables so an ambient key cannot silently replace native agent login.
|
|
114
|
+
// The agent's own saved credentials and billing settings remain its concern.
|
|
115
|
+
for (key, _) in std::env::vars_os() {
|
|
116
|
+
if let Some(key) = key.to_str().filter(|key| api_credential_variable(key)) {
|
|
117
|
+
config = config.env(key, "");
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
let agent = AcpAgent::new(config);
|
|
121
|
+
let (ready_tx, ready_rx) = oneshot::channel();
|
|
122
|
+
let (shutdown, mut shutdown_rx) = watch::channel(false);
|
|
123
|
+
let (closed, _) = watch::channel(false);
|
|
124
|
+
let state = Arc::new(ClientState {
|
|
125
|
+
shutdown,
|
|
126
|
+
closed,
|
|
127
|
+
failure: Mutex::new(None),
|
|
128
|
+
task: Mutex::new(None),
|
|
129
|
+
});
|
|
130
|
+
let mut guard = Connecting(Some(state.clone()));
|
|
131
|
+
let worker_state = Arc::downgrade(&state);
|
|
132
|
+
let task = runtime.spawn(async move {
|
|
133
|
+
let outcome = Client
|
|
134
|
+
.builder()
|
|
135
|
+
.connect_with(agent, async move |connection| {
|
|
136
|
+
let info = connection
|
|
137
|
+
.send_request(
|
|
138
|
+
InitializeRequest::new(ProtocolVersion::V1).client_capabilities(
|
|
139
|
+
crate::acp::ClientCapabilities::new().session(
|
|
140
|
+
crate::acp::ClientSessionCapabilities::new().config_options(
|
|
141
|
+
crate::acp::SessionConfigOptionsCapabilities::new()
|
|
142
|
+
.boolean(
|
|
143
|
+
crate::acp::BooleanConfigOptionCapabilities::new(),
|
|
144
|
+
),
|
|
145
|
+
),
|
|
146
|
+
),
|
|
147
|
+
),
|
|
148
|
+
)
|
|
149
|
+
.block_task()
|
|
150
|
+
.await?;
|
|
151
|
+
if info.protocol_version != ProtocolVersion::V1 {
|
|
152
|
+
return Err(agent_client_protocol::Error::new(
|
|
153
|
+
-32600,
|
|
154
|
+
"unsupported ACP version",
|
|
155
|
+
));
|
|
156
|
+
}
|
|
157
|
+
if ready_tx.send((connection.clone(), info)).is_err() {
|
|
158
|
+
return Ok(());
|
|
159
|
+
}
|
|
160
|
+
tokio::select! {
|
|
161
|
+
_ = shutdown_rx.changed() => {},
|
|
162
|
+
_ = connection.incoming_closed() => {},
|
|
163
|
+
}
|
|
164
|
+
Ok(())
|
|
165
|
+
})
|
|
166
|
+
.await;
|
|
167
|
+
if let Some(state) = worker_state.upgrade() {
|
|
168
|
+
if let Err(error) = outcome {
|
|
169
|
+
*lock(&state.failure) = Some(error.into());
|
|
170
|
+
}
|
|
171
|
+
state.closed.send_replace(true);
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
*lock(&state.task) = Some(task);
|
|
175
|
+
let (connection, info) = match timeout(options.operation_timeout, ready_rx).await {
|
|
176
|
+
Ok(Ok(ready)) => ready,
|
|
177
|
+
Ok(Err(_)) => {
|
|
178
|
+
let mut closed = state.closed.subscribe();
|
|
179
|
+
if !state.is_closed() {
|
|
180
|
+
let _ = timeout(options.shutdown_timeout, closed.changed()).await;
|
|
181
|
+
}
|
|
182
|
+
return Err(state.error());
|
|
183
|
+
}
|
|
184
|
+
Err(_) => return Err(NativeError::Timeout),
|
|
185
|
+
};
|
|
186
|
+
guard.0 = None;
|
|
187
|
+
Ok(Self {
|
|
188
|
+
inner: Arc::new(ClientLease {
|
|
189
|
+
state,
|
|
190
|
+
connection,
|
|
191
|
+
info,
|
|
192
|
+
options,
|
|
193
|
+
}),
|
|
194
|
+
})
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/// The agent's exact negotiated capabilities, implementation, and auth methods.
|
|
198
|
+
pub fn info(&self) -> &InitializeResponse {
|
|
199
|
+
&self.inner.info
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/// Invoke an explicitly selected agent-owned authentication method.
|
|
203
|
+
///
|
|
204
|
+
/// Terminal authentication is left to the application or the agent's CLI.
|
|
205
|
+
/// The method must have been advertised; none is selected automatically.
|
|
206
|
+
pub async fn authenticate(&self, method_id: &str) -> Result<()> {
|
|
207
|
+
match self
|
|
208
|
+
.info()
|
|
209
|
+
.auth_methods
|
|
210
|
+
.iter()
|
|
211
|
+
.find(|method| method.id().0.as_ref() == method_id)
|
|
212
|
+
{
|
|
213
|
+
Some(AuthMethod::Agent(_)) => {}
|
|
214
|
+
Some(_) => {
|
|
215
|
+
return Err(NativeError::Unsupported(
|
|
216
|
+
"terminal authentication through this client",
|
|
217
|
+
));
|
|
218
|
+
}
|
|
219
|
+
None => {
|
|
220
|
+
return Err(NativeError::Unsupported(
|
|
221
|
+
"the selected authentication method",
|
|
222
|
+
));
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
self.operation(
|
|
226
|
+
self.inner
|
|
227
|
+
.connection
|
|
228
|
+
.send_request(AuthenticateRequest::new(method_id.to_owned()))
|
|
229
|
+
.block_task(),
|
|
230
|
+
)
|
|
231
|
+
.await?;
|
|
232
|
+
Ok(())
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/// Create an independent conversation in an application-selected directory.
|
|
236
|
+
pub async fn new_session(&self, options: SessionOptions) -> Result<NativeSession> {
|
|
237
|
+
self.validate_session(&options)?;
|
|
238
|
+
let request = NewSessionRequest::new(&options.cwd).mcp_servers(options.mcp_servers.clone());
|
|
239
|
+
let session = self
|
|
240
|
+
.operation(
|
|
241
|
+
self.inner
|
|
242
|
+
.connection
|
|
243
|
+
.build_session_from(request)
|
|
244
|
+
.block_task()
|
|
245
|
+
.start_session(),
|
|
246
|
+
)
|
|
247
|
+
.await?;
|
|
248
|
+
self.finish_session(session, options).await
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/// Restore a known agent session, preserving the agent's replayed history events.
|
|
252
|
+
pub async fn load_session(
|
|
253
|
+
&self,
|
|
254
|
+
agent_session_id: &str,
|
|
255
|
+
options: SessionOptions,
|
|
256
|
+
) -> Result<NativeSession> {
|
|
257
|
+
if !self.info().agent_capabilities.load_session {
|
|
258
|
+
return Err(NativeError::Unsupported("session history loading"));
|
|
259
|
+
}
|
|
260
|
+
self.validate_session(&options)?;
|
|
261
|
+
let request = LoadSessionRequest::new(agent_session_id.to_owned(), &options.cwd)
|
|
262
|
+
.mcp_servers(options.mcp_servers.clone());
|
|
263
|
+
let restored = self
|
|
264
|
+
.operation(
|
|
265
|
+
self.inner
|
|
266
|
+
.connection
|
|
267
|
+
.load_session_from(request)
|
|
268
|
+
.block_task()
|
|
269
|
+
.start_session(),
|
|
270
|
+
)
|
|
271
|
+
.await?;
|
|
272
|
+
self.finish_session(restored.into_session(), options).await
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/// Resume a known session without replay, only when the agent advertises support.
|
|
276
|
+
pub async fn resume_session(
|
|
277
|
+
&self,
|
|
278
|
+
agent_session_id: &str,
|
|
279
|
+
options: SessionOptions,
|
|
280
|
+
) -> Result<NativeSession> {
|
|
281
|
+
if self
|
|
282
|
+
.info()
|
|
283
|
+
.agent_capabilities
|
|
284
|
+
.session_capabilities
|
|
285
|
+
.resume
|
|
286
|
+
.is_none()
|
|
287
|
+
{
|
|
288
|
+
return Err(NativeError::Unsupported(
|
|
289
|
+
"session resumption without replay",
|
|
290
|
+
));
|
|
291
|
+
}
|
|
292
|
+
self.validate_session(&options)?;
|
|
293
|
+
let request = ResumeSessionRequest::new(agent_session_id.to_owned(), &options.cwd)
|
|
294
|
+
.mcp_servers(options.mcp_servers.clone());
|
|
295
|
+
let restored = self
|
|
296
|
+
.operation(
|
|
297
|
+
self.inner
|
|
298
|
+
.connection
|
|
299
|
+
.resume_session_from(request)
|
|
300
|
+
.block_task()
|
|
301
|
+
.start_session(),
|
|
302
|
+
)
|
|
303
|
+
.await?;
|
|
304
|
+
self.finish_session(restored.into_session(), options).await
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
async fn finish_session(
|
|
308
|
+
&self,
|
|
309
|
+
session: ActiveSession<'static, Agent>,
|
|
310
|
+
options: SessionOptions,
|
|
311
|
+
) -> Result<NativeSession> {
|
|
312
|
+
let session = NativeSession::start(self.inner.clone(), session)?;
|
|
313
|
+
let handle = session.handle();
|
|
314
|
+
if let Some(model) = options.model {
|
|
315
|
+
handle.set_model(&model).await?;
|
|
316
|
+
}
|
|
317
|
+
for (id, value) in options.configuration {
|
|
318
|
+
handle.set_config_option(&id, value).await?;
|
|
319
|
+
}
|
|
320
|
+
Ok(session)
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
fn validate_session(&self, options: &SessionOptions) -> Result<()> {
|
|
324
|
+
if self.inner.state.is_closed() {
|
|
325
|
+
return Err(self.inner.state.error());
|
|
326
|
+
}
|
|
327
|
+
if !options.cwd.is_absolute() || !options.cwd.is_dir() {
|
|
328
|
+
return Err(NativeError::InvalidOptions(
|
|
329
|
+
"session cwd must be an existing absolute directory",
|
|
330
|
+
));
|
|
331
|
+
}
|
|
332
|
+
let capabilities = &self.info().agent_capabilities.mcp_capabilities;
|
|
333
|
+
for server in &options.mcp_servers {
|
|
334
|
+
match server {
|
|
335
|
+
McpServer::Stdio(_) => {}
|
|
336
|
+
McpServer::Http(_) if capabilities.http => {}
|
|
337
|
+
McpServer::Sse(_) if capabilities.sse => {}
|
|
338
|
+
_ => return Err(NativeError::Unsupported("the requested MCP transport")),
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
Ok(())
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
async fn operation<T>(
|
|
345
|
+
&self,
|
|
346
|
+
future: impl std::future::Future<Output = std::result::Result<T, agent_client_protocol::Error>>,
|
|
347
|
+
) -> Result<T> {
|
|
348
|
+
if self.inner.state.is_closed() {
|
|
349
|
+
return Err(self.inner.state.error());
|
|
350
|
+
}
|
|
351
|
+
match timeout(self.inner.options.operation_timeout, future).await {
|
|
352
|
+
Ok(Ok(value)) => Ok(value),
|
|
353
|
+
Ok(Err(error)) => {
|
|
354
|
+
if error.code == crate::acp::ErrorCode::InternalError {
|
|
355
|
+
tokio::task::yield_now().await;
|
|
356
|
+
}
|
|
357
|
+
if self.inner.state.is_closed() {
|
|
358
|
+
Err(self.inner.state.error())
|
|
359
|
+
} else {
|
|
360
|
+
Err(error.into())
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
Err(_) => {
|
|
364
|
+
self.inner.state.abort();
|
|
365
|
+
Err(NativeError::Timeout)
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/// Close every session and wait a bounded time for the SDK to clean up its child.
|
|
371
|
+
pub async fn close(&self) -> Result<()> {
|
|
372
|
+
self.inner.state.shutdown.send_replace(true);
|
|
373
|
+
let task = lock(&self.inner.state.task).take();
|
|
374
|
+
if let Some(mut task) = task
|
|
375
|
+
&& timeout(self.inner.options.shutdown_timeout, &mut task)
|
|
376
|
+
.await
|
|
377
|
+
.is_err()
|
|
378
|
+
{
|
|
379
|
+
task.abort();
|
|
380
|
+
self.inner.state.closed.send_replace(true);
|
|
381
|
+
return Err(NativeError::Timeout);
|
|
382
|
+
}
|
|
383
|
+
self.inner.state.closed.send_replace(true);
|
|
384
|
+
Ok(())
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
fn api_credential_variable(key: &str) -> bool {
|
|
389
|
+
let upper = key.to_ascii_uppercase();
|
|
390
|
+
upper.ends_with("_API_KEY")
|
|
391
|
+
|| matches!(
|
|
392
|
+
upper.as_str(),
|
|
393
|
+
"ANTHROPIC_AUTH_TOKEN"
|
|
394
|
+
| "AZURE_OPENAI_KEY"
|
|
395
|
+
| "AWS_BEARER_TOKEN_BEDROCK"
|
|
396
|
+
| "GOOGLE_APPLICATION_CREDENTIALS"
|
|
397
|
+
| "AWS_ACCESS_KEY_ID"
|
|
398
|
+
| "AWS_SECRET_ACCESS_KEY"
|
|
399
|
+
| "AWS_SESSION_TOKEN"
|
|
400
|
+
)
|
|
401
|
+
}
|