diff --git a/.gitignore b/.gitignore index 7e45607..45bcb80 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,13 @@ */target */*/target/ **/pkg/*.wasm +**/pkg/*.zip **/pkg/ui -*/*.swp -*/*.swo -*/*/wasi_snapshot_preview1.wasm -*/*/wit/ -*/*/process_env +**.swp +**.swo +**/wasi_snapshot_preview1.wasm +**/wit/ +**/process_env */ui/dist */ui/node_modules */node_modules @@ -15,5 +16,4 @@ /target **/.DS_Store **/.vscode/ - - +*.swp diff --git a/Cargo.lock b/Cargo.lock index f9d8f42..19dd6e6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,6 +17,18 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "admin" +version = "0.1.0" +dependencies = [ + "anyhow", + "kinode_process_lib", + "process_macros", + "serde", + "serde_json", + "wit-bindgen", +] + [[package]] name = "aho-corasick" version = "1.1.3" @@ -78,7 +90,7 @@ checksum = "1a047897373be4bbb0224c1afdabca92648dc57a9c9ef6e7b0be3aff7a859c83" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.65", ] [[package]] @@ -276,7 +288,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.65", ] [[package]] @@ -561,7 +573,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.58", + "syn 2.0.65", ] [[package]] @@ -572,7 +584,7 @@ checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ "darling_core", "quote", - "syn 2.0.58", + "syn 2.0.65", ] [[package]] @@ -614,7 +626,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.65", ] [[package]] @@ -624,7 +636,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "206868b8242f27cecce124c19fd88157fbd0dd334df2587f36417bafbc85097b" dependencies = [ "derive_builder_core", - "syn 2.0.58", + "syn 2.0.65", ] [[package]] @@ -661,6 +673,26 @@ dependencies = [ "subtle", ] +[[package]] +name = "driver" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "kinode_process_lib", + "llm_interface", + "process_macros", + "rand 0.8.5", + "rand_pcg 0.3.1", + "serde", + "serde_json", + "serde_qs", + "thiserror", + "url 2.5.0", + "uuid", + "wit-bindgen", +] + [[package]] name = "ecdsa" version = "0.16.9" @@ -796,7 +828,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.65", ] [[package]] @@ -1107,8 +1139,8 @@ dependencies = [ [[package]] name = "kinode_process_lib" -version = "0.6.0" -source = "git+https://github.com/kinode-dao/process_lib?tag=v0.6.0#ccf9db2493ec1e112f9146994f852b7bb119dbb6" +version = "0.6.1" +source = "git+https://github.com/kinode-dao/process_lib?tag=v0.6.1#37a20b0249dc2c86ae6c2c69cfb199fb177f1520" dependencies = [ "alloy-json-rpc", "alloy-primitives", @@ -1119,6 +1151,7 @@ dependencies = [ "http", "mime_guess 2.0.4", "rand 0.8.5", + "rmp-serde", "serde", "serde_json", "thiserror", @@ -1138,20 +1171,6 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -[[package]] -name = "lccp" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "kinode_process_lib", - "llm_interface 0.1.0 (git+https://github.com/kinode-dao/llm/?branch=interface)", - "multipart", - "serde", - "serde_json", - "wit-bindgen", -] - [[package]] name = "leb128" version = "0.2.5" @@ -1187,17 +1206,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "llm_interface" -version = "0.1.0" -source = "git+https://github.com/kinode-dao/llm/?branch=interface#2bd3067f13e319a7128481598a7e5ae248a924e5" -dependencies = [ - "anyhow", - "derive_builder", - "serde", - "serde_json", -] - [[package]] name = "log" version = "0.3.9" @@ -1392,7 +1400,7 @@ dependencies = [ "anyhow", "bincode", "kinode_process_lib", - "llm_interface 0.1.0 (git+https://github.com/kinode-dao/llm/?branch=hf/interface)", + "llm_interface", "multipart", "serde", "serde_json", @@ -1510,7 +1518,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.65", ] [[package]] @@ -1573,13 +1581,22 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.79" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" +checksum = "0b33eb56c327dec362a9e55b3ad14f9d2f0904fb5a5b03b513ab5465399e9f43" dependencies = [ "unicode-ident", ] +[[package]] +name = "process_macros" +version = "0.1.0" +source = "git+https://github.com/kinode-dao/process_macros?rev=626e501#626e501d351e3365480ec6f770d474ed4ae339bf" +dependencies = [ + "quote", + "syn 2.0.65", +] + [[package]] name = "proptest" version = "1.4.0" @@ -1635,7 +1652,7 @@ dependencies = [ "rand_isaac", "rand_jitter", "rand_os", - "rand_pcg", + "rand_pcg 0.1.2", "rand_xorshift 0.1.1", "winapi", ] @@ -1748,6 +1765,16 @@ dependencies = [ "rand_core 0.4.2", ] +[[package]] +name = "rand_pcg" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59cad018caf63deb318e5a4586d99a24424a364f40f1e5778c29aca23f4fc73e" +dependencies = [ + "rand_core 0.6.4", + "serde", +] + [[package]] name = "rand_xorshift" version = "0.1.1" @@ -1824,6 +1851,43 @@ dependencies = [ "rustc-hex", ] +[[package]] +name = "rmp" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + +[[package]] +name = "router" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "kinode_process_lib", + "process_macros", + "rand 0.8.5", + "rand_pcg 0.3.1", + "serde", + "serde_json", + "wit-bindgen", +] + [[package]] name = "ruint" version = "1.12.1" @@ -1854,6 +1918,18 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f86854cf50259291520509879a5c294c3c9a4c334e9ff65071c51e42ef1e2343" +[[package]] +name = "run_job" +version = "0.1.0" +dependencies = [ + "anyhow", + "kinode_process_lib", + "process_macros", + "serde", + "serde_json", + "wit-bindgen", +] + [[package]] name = "rustc-demangle" version = "0.1.23" @@ -1976,7 +2052,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.65", ] [[package]] @@ -1990,6 +2066,17 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_qs" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd34f36fe4c5ba9654417139a9b3a20d2e1de6012ee678ad14d240c22c78d8d6" +dependencies = [ + "percent-encoding 2.3.1", + "serde", + "thiserror", +] + [[package]] name = "sha2" version = "0.10.8" @@ -2092,9 +2179,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.58" +version = "2.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687" +checksum = "d2863d96a84c6439701d7a38f9de935ec562c8832cc55d1dde0f513b52fad106" dependencies = [ "proc-macro2", "quote", @@ -2136,7 +2223,7 @@ checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.65", ] [[package]] @@ -2403,6 +2490,15 @@ dependencies = [ "percent-encoding 2.3.1", ] +[[package]] +name = "uuid" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" +dependencies = [ + "getrandom", +] + [[package]] name = "valuable" version = "0.1.0" @@ -2463,7 +2559,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.65", "wasm-bindgen-shared", ] @@ -2497,7 +2593,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.65", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2510,18 +2606,18 @@ checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasm-encoder" -version = "0.41.2" +version = "0.202.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "972f97a5d8318f908dded23594188a90bcd09365986b1163e66d70170e5287ae" +checksum = "bfd106365a7f5f7aa3c1916a98cbb3ad477f5ff96ddb130285a91c6e7429e67a" dependencies = [ "leb128", ] [[package]] name = "wasm-metadata" -version = "0.10.20" +version = "0.202.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18ebaa7bd0f9e7a5e5dd29b9a998acf21c4abed74265524dd7e85934597bfb10" +checksum = "094aea3cb90e09f16ee25a4c0e324b3e8c934e7fd838bfa039aef5352f44a917" dependencies = [ "anyhow", "indexmap", @@ -2535,9 +2631,9 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.121.2" +version = "0.202.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dbe55c8f9d0dbd25d9447a5a889ff90c0cc3feaa7395310d3d826b2c703eaab" +checksum = "d6998515d3cf3f8b980ef7c11b29a9b1017d4cf86b99ae93b546992df9931413" dependencies = [ "bitflags 2.5.0", "indexmap", @@ -2662,30 +2758,42 @@ dependencies = [ [[package]] name = "wit-bindgen" -version = "0.17.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=21a46c7#21a46c774532da99384f7a1877c1fcfb7a4c72d3" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb4e7653763780be47e38f479e9aa83c768aa6a3b2ed086dc2826fdbbb7e7f5" dependencies = [ - "bitflags 2.5.0", + "wit-bindgen-rt", "wit-bindgen-rust-macro", ] [[package]] name = "wit-bindgen-core" -version = "0.17.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=21a46c7#21a46c774532da99384f7a1877c1fcfb7a4c72d3" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b67e11c950041849a10828c7600ea62a4077c01e8af72e8593253575428f91b" dependencies = [ "anyhow", - "wit-component", "wit-parser", ] +[[package]] +name = "wit-bindgen-rt" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0780cf7046630ed70f689a098cd8d56c5c3b22f2a7379bbdb088879963ff96" +dependencies = [ + "bitflags 2.5.0", +] + [[package]] name = "wit-bindgen-rust" -version = "0.17.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=21a46c7#21a46c774532da99384f7a1877c1fcfb7a4c72d3" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30acbe8fb708c3a830a33c4cb705df82659bf831b492ec6ca1a17a369cfeeafb" dependencies = [ "anyhow", "heck", + "indexmap", "wasm-metadata", "wit-bindgen-core", "wit-component", @@ -2693,23 +2801,23 @@ dependencies = [ [[package]] name = "wit-bindgen-rust-macro" -version = "0.17.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=21a46c7#21a46c774532da99384f7a1877c1fcfb7a4c72d3" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b1b06eae85feaecdf9f2854f7cac124e00d5a6e5014bfb02eb1ecdeb5f265b9" dependencies = [ "anyhow", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.65", "wit-bindgen-core", "wit-bindgen-rust", - "wit-component", ] [[package]] name = "wit-component" -version = "0.20.3" +version = "0.202.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4436190e87b4e539807bcdcf5b817e79d2e29e16bc5ddb6445413fe3d1f5716" +checksum = "0c836b1fd9932de0431c1758d8be08212071b6bba0151f7bac826dbc4312a2a9" dependencies = [ "anyhow", "bitflags 2.5.0", @@ -2726,9 +2834,9 @@ dependencies = [ [[package]] name = "wit-parser" -version = "0.13.2" +version = "0.202.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "316b36a9f0005f5aa4b03c39bc3728d045df136f8c13a73b7db4510dec725e08" +checksum = "744237b488352f4f27bca05a10acb79474415951c450e52ebd0da784c1df2bcc" dependencies = [ "anyhow", "id-arena", @@ -2739,6 +2847,7 @@ dependencies = [ "serde_derive", "serde_json", "unicode-xid", + "wasmparser", ] [[package]] @@ -2767,5 +2876,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.65", ] diff --git a/Cargo.toml b/Cargo.toml index 910bfdb..4af2295 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,11 @@ [workspace] resolver = "2" members = [ - "lccp/lccp", - "openai/openai", + "admin", + "driver", + "openai", + "router", + "run_job", ] [profile.release] diff --git a/README.md b/README.md index a071403..326c333 100644 --- a/README.md +++ b/README.md @@ -1,98 +1,171 @@ # LLM -Kinode process for interacting with LLMs. +Kinode processes for interacting with & serving LLMs. -- [LLM](#llm) - - [Local LLMs](#local-llms) - - [Running Local LLMs with Messages](#running-local-llms-with-messages) - - [Running Local LLMS with Test Scripts](#running-local-llms-with-test-scripts) - - [Online APIs](#online-apis) - - [Calling APIs Through Messages](#calling-apis-through-messages) - - [Calling APIs Through Test Scripts](#calling-apis-through-test-scripts) +## Usage -## Local LLMs +### Get llamafile & your favorite LLM in GGUF format. -To run the lccp component, follow these steps: - -***Terminal 1:*** Download `llama.cpp` from the GitHub repository: - - ```bash - cd llama.cpp - make - ./server -m ../llama.cpp-sharding.cpp/phi2.gguf --embedding --port 3000 - ``` - -***Terminal 2*** Start a fake node by running: - - ```bash - kit f - ``` +``` +# Get llamafile. +export LLAMAFILE_PATH=$(realpath ~/llms) +mkdir -p $LLAMAFILE_PATH +cd $LLAMAFILE_PATH + +export LLAMAFILE_VERSION=0.8.4 +curl -L -o llamafile-${LLAMAFILE_VERSION} https://github.com/Mozilla-Ocho/llamafile/releases/download/${LLAMAFILE_VERSION}/llamafile-${LLAMAFILE_VERSION} +chmod +x llamafile-${LLAMAFILE_VERSION} + +# Get your favorite LLM in GGUF format. +# E.g. Llama-3-8B-Instruct +cd $LLAMAFILE_PATH +curl -L -o Meta-Llama-3-8B-Instruct-Q8_0.gguf https://huggingface.co/lmstudio-community/Meta-Llama-3-8B-Instruct-GGUF/resolve/main/Meta-Llama-3-8B-Instruct-Q8_0.gguf?download=true + +# Serve the LLM with llamafile. +# Note the port; below we assume it is 8080. +cd $LLAMAFILE_PATH +./llamafile-${LLAMAFILE_VERSION} -m Meta-Llama-3-8B-Instruct-Q8_0.gguf --server --mlock --nobrowser +``` -***Terminal 3*** Build and start the lccp service: +### Get kit & Kinode core develop (requires 0.8.0). - ```bash - kit bs lccp/ - ``` +``` +# Get kit. +cargo install --git https://github.com/kinode-dao/kit --branch develop + +# Get Kinode core develop. +export KINODE_PATH=$(realpath ~/kinode) +mkdir -p $KINODE_PATH +cd $KINODE_PATH + +git clone git@github.com:kinode-dao/kinode.git +cd kinode +git checkout develop + +# Get llm_provider. +cd $KINODE_PATH +git clone git@github.com:kinode-dao/llm +cd llm +git checkout hf/llm-provider +``` -### Running Local LLMs with Messages +### Start fakenodes. -TODO +``` +# Start some fakenodes. +# The first will be the router. +# The second the driver connected to the llamafile server. +# The third the client sending a request -- routed through: +# * third's driver, +# * first's router, +# * second's driver, +# * llamafile, +# * back again. +export KINODE_PATH=$(realpath ~/kinode) +export ROUTER_PORT=8081 +export DRIVER_PORT=8082 +export CLIENT_PORT=8083 +# The first fake node to be booted will compile Kinode core, which will take some time. +kit f --runtime-path ${KINODE_PATH}/kinode --port $ROUTER_PORT + +# In a new terminal: +export KINODE_PATH=$(realpath ~/kinode) +export ROUTER_PORT=8081 +export DRIVER_PORT=8082 +export CLIENT_PORT=8083 +kit f -r ${KINODE_PATH}/kinode -h /tmp/kinode-fake-node-2 -p $DRIVER_PORT -f fake2.dev + +# In a third terminal: +export KINODE_PATH=$(realpath ~/kinode) +export ROUTER_PORT=8081 +export DRIVER_PORT=8082 +export CLIENT_PORT=8083 +kit f -r ${KINODE_PATH}/kinode -h /tmp/kinode-fake-node-3 -p $CLIENT_PORT -f fake3.dev +``` -### Running Local LLMS with Test Scripts +### Build and install llm provider. -Run the tester script in your fakenode: +``` +cd ${KINODE_PATH}/llm +kit b +kit s -p $ROUTER_PORT && kit s -p $DRIVER_PORT && kit s -p $CLIENT_PORT +``` - ```bash -lccp_tester:llm:kinode - ``` +### Configure routers, drivers, clients. -Within the tester, you can see how different requests and responses are handled. +``` +# Start a router (router node terminal). +admin:llm_provider:nick1udwig.os "StartRouter" -### Running local LLMs with Llamafile +# Set driver to use router (driver node terminal). +# All drivers must point to the router: both clients and providers. +admin:llm_provider:nick1udwig.os {"SetRouter": {"node": "fake.dev"}} -TODO +# Set an OpenAI API provider (driver node terminal). +# NOTE: Replace the `8080` port here with $LLAMAFILE_PORT +m our@openai:llm_provider:nick1udwig.os '{"RegisterOaiProviderEndpoint": {"endpoint": "http://127.0.0.1:8080/v1"}}' -https://github.com/Mozilla-Ocho/llamafile +# Set driver to use router (driver node terminal). +admin:llm_provider:nick1udwig.os {"SetLocalDriver": {"model": "llama3-8b", "is_public": true}} +# Send jobs from inside Kinode (client node terminal). +admin:llm_provider:nick1udwig.os {"SetRouter": {"node": "fake.dev"}} +run_job:llm_provider:nick1udwig.os llama3 How much wood could a woodchuck chuck? Be concise. ``` -m our@openai:openai:appattacc.os '{"RegisterOaiProviderEndpoint": {"endpoint": "http://127.0.0.1:8080/v1"}}' -m our@openai:openai:appattacc.os '{"OaiProviderChat": {"model": "", "messages": [{"role": "user", "content": "Suggest a Shakespeare play for me to read. Be concise."}]}}' -a 60 +## Architecture -kit i openai:openai:appattacc.os '{"OaiProviderChat": {"model": "", "messages": [{"role": "user", "content": "Suggest a Shakespeare play for me to read."}]}}' -p 8081 +Clients send Requests to the `driver:llm_provider:nick1udwig.os` process. +If connected to an LLM, e.g. via +``` +m our@openai:llm_provider:nick1udwig.os '{"RegisterOaiProviderEndpoint": {"endpoint": "http://127.0.0.1:8080/v1"}}' +admin:llm_provider:nick1udwig.os {"SetLocalDriver": {"model": "llama3-8b", "is_public": true}} ``` +`driver` will serve the Request locally by passing it to `openai:llm_provider:nick1udwig.os`, which in turn passes it to the registered OpenAI API provider (here, a llamafile server). + +![240523-local](https://github.com/kinode-dao/llm/assets/79381743/47b1c23c-03db-4076-a61f-5e037c66d848) -## Online APIs +If not connected to an LLM, `driver` will contact the `router_node` it has been set to coordinate with and that `router` will forward the Request to a `driver` that has registered as serving the appropriate model. -***Terminal 1*** Start a fake node by running: +![240523-remote](https://github.com/kinode-dao/llm/assets/79381743/3f87f855-81db-4c08-ad84-a63827c23b16) - ```bash - kit f - ``` +## Future work / extensions -***Terminal 2*** Build and start the openai service: +### On-chain coordination, payment, etc. - ```bash - kit bs openai/ - ``` +There are multiple ways on-chain compute & data could be used here. +A few examples are: +1. Payment for services rendered, +2. Coordination of router(s) and drivers to improve quality of service by kicking out bad actors, +3. Gating based on on-chain data. -### Calling APIs Through Messages +An example of 2 can be seen in the following repos: +* https://github.com/nick1udwig/provider-dao-contract +* https://github.com/nick1udwig/provider_dao_router +* https://github.com/nick1udwig/comfyui_provider +* https://github.com/nick1udwig/comfyui_client -TODO +### Gate based on arbitrary conditions -### Calling APIs Through Test Scripts +The `router` is the natural place to gate requests based on arbitrary conditions. +Upon receiving a `ClientRequest::RunJob`, execute arbitrary logic to determine if the requestor should be served or not. +This logic might look like: +1. Comparison with an in-memory `Vec` of allowed nodes, +2. Checking if the requestor holds a certain NFT, +3. Checking if the requestor has paid into an escrow contract, +to list a few examples. -Run the tester script in your fakenode: +### Chunked/non-final `JobUpdate`s -***Terminal 1*** Run the tester script +Currently, one `JobUpdate` is sent as a result of a request. +That is the final output of the LLM. +Instead, `JobUpdate`s could be sent as they arrive and a job would only be considered complete once `is_final = true`. +This gets around a limitation of the current system which is that the request must be completed within 60s. - ```bash -openai_tester:llm:kinode - ``` +### Queue for driver -Within the tester, you can see how different requests and responses are handled. +The `driver` currently only allows one outstanding job at a time. -## TODOS +### Discriminate based on model -- [ ] Make a clean interface. This is a higher level question regarding process communication. -- [ ] Cleaner call functions. +Currently the code the discriminate based on model (i.e. only pass requests specifying a given model to providers serving that specific model) is commented out. diff --git a/admin/Cargo.toml b/admin/Cargo.toml new file mode 100644 index 0000000..f464b82 --- /dev/null +++ b/admin/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "admin" +version = "0.1.0" +edition = "2021" + +[dependencies] +anyhow = "1.0" +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.6.1" } +process_macros = { git = "https://github.com/kinode-dao/process_macros", rev = "626e501" } +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +wit-bindgen = "0.24.0" + +[lib] +crate-type = ["cdylib"] + +[package.metadata.component] +package = "kinode:process" diff --git a/admin/src/lib.rs b/admin/src/lib.rs new file mode 100644 index 0000000..ce7c002 --- /dev/null +++ b/admin/src/lib.rs @@ -0,0 +1,60 @@ +use crate::kinode::process::admin::AdminRequest; +use crate::kinode::process::driver::{AdminRequest as DriverAdminRequest}; +use kinode_process_lib::{ + await_next_message_body, call_init, our_capabilities, println, spawn, Address, OnExit, Request, +}; + +const PUBLISHER: &str = "nick1udwig.os"; +//const PROCESS_NAME: &str = "driver"; +const SCRIPT_NAME: &str = "admin"; +const ROUTER_PATH: &str = "llm_provider:nick1udwig.os/pkg/router.wasm"; + +wit_bindgen::generate!({ + path: "target/wit", + world: "llm-provider-nick1udwig-dot-os-v0", + generate_unused_types: true, + additional_derives: [serde::Deserialize, serde::Serialize, process_macros::SerdeJsonInto], +}); + +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, process_macros::SerdeJsonInto)] +#[serde(untagged)] +enum Req { + AdminRequest(AdminRequest), + DriverAdminRequest(DriverAdminRequest), +} + +call_init!(init); +fn init(our: Address) { + let Ok(ref body) = await_next_message_body() else { + println!("failed to get args!"); + return; + }; + let package_name = our.package(); + + match body.clone().try_into() { + Ok(Req::AdminRequest(AdminRequest::StartRouter)) => { + let our_caps = our_capabilities(); + spawn( + Some("router"), + ROUTER_PATH, + OnExit::Restart, + our_caps, + vec![], + false, + ).unwrap(); + } + Ok(Req::DriverAdminRequest(_)) => { + let driver_process: Address = format!("our@driver:{}", our.package_id()) + .parse() + .unwrap(); + Request::to(driver_process) + .body(body.clone()) + .send() + .unwrap(); + } + Err(_) => { + println!("usage:\n{SCRIPT_NAME}:{package_name}:{PUBLISHER} admin_action\ne.g.\n{SCRIPT_NAME}:{package_name}:{PUBLISHER} \"StartRouter\""); + return; + } + } +} diff --git a/api/llm_provider:nick1udwig.os-v0.wit b/api/llm_provider:nick1udwig.os-v0.wit new file mode 100644 index 0000000..673589f --- /dev/null +++ b/api/llm_provider:nick1udwig.os-v0.wit @@ -0,0 +1,150 @@ +interface pkg { + type job-id = u64; + type model-name = string; + type error-message = string; + + /// client (external) sends to local driver. + /// local driver serves if connected to local llm, + /// else forwards to router. + /// router receives from driver. + variant client-request { + run-job(run-job-request-params), + } + + /// client (external) receives from local driver. + /// client (external) receives from router. + variant client-response { + run-job(result), + } + + /// driver sends to router + variant driver-request { + // TODO: use local-driver + set-is-available(tuple), + } + + /// driver receives from router + variant driver-response { + /// ack + set-is-available, + } + + /// router sends to driver + variant router-request { + run-job(tuple), + query-ready, + } + + /// router receives from driver + variant router-response { + run-job(result), + query-ready(bool), + } + + /// local driver sends to client (external). + /// driver sends to router. + /// router sends to client (external) + // TODO: should we skip the router in the driver -> router -> client chain? + // pro: less bucket brigading + // con: router never notified about job completion + variant to-client-request { + /// job-update-request-blob in lazy-load-blob + job-update(job-update-request-params), + } + + /// local driver receives from client (external). + /// driver receives from router. + /// router receives from client (external) + variant to-client-response { + /// ack + job-update, + } + + record run-job-request-params { + model: string, + prompt: string, + seed: option, + } + + record job-update-request-params { + job-id: job-id, + is-final: bool, + signature: option, + } + + //record job-update-request-blob { + //} +} + +interface admin { + variant admin-request { + start-router, + } + + variant admin-response { + start-router, + } +} + +interface driver { + use standard.{ + process-id, + }; + + variant admin-request { + set-local-driver(local-driver), + set-router(set-router-request), + } + + variant admin-response { + set-local-driver, + set-router, + } + + record local-driver { + model: string, + is-public: bool, + } + + record set-router-request { + process-id: option, + node: option, + } + + use pkg.{ + client-request, + client-response, + driver-request, + driver-response, + router-request, + router-response, + to-client-request, + to-client-response, + run-job-request-params, + job-update-request-params, + //job-update-request-blob, + }; +} + +interface router { + use pkg.{ + client-request, + client-response, + driver-request, + driver-response, + router-request, + router-response, + to-client-request, + to-client-response, + run-job-request-params, + job-update-request-params, + //job-update-request-blob, + }; +} + +world llm-provider-nick1udwig-dot-os-v0 { + import admin; + import driver; + import router; + include process; +} diff --git a/driver/Cargo.toml b/driver/Cargo.toml new file mode 100644 index 0000000..31f52de --- /dev/null +++ b/driver/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "driver" +version = "0.1.0" +edition = "2021" + +[dependencies] +anyhow = "1.0" +bincode = "1.3.3" +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.6.1" } +llm_interface = { git = "https://github.com/kinode-dao/llm/", branch = "hf/interface" } +process_macros = { git = "https://github.com/kinode-dao/process_macros", rev = "626e501" } +rand = "0.8" +rand_pcg = { version = "0.3", features = ["serde1"] } +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +serde_qs = "0.13" +thiserror = "1" +url = "2" +uuid = { version = "1", features = ["v4"] } +wit-bindgen = "0.24.0" + +[lib] +crate-type = ["cdylib"] + +[package.metadata.component] +package = "kinode:process" diff --git a/driver/src/lib.rs b/driver/src/lib.rs new file mode 100644 index 0000000..06c2ece --- /dev/null +++ b/driver/src/lib.rs @@ -0,0 +1,419 @@ +use crate::kinode::process::driver::{ + AdminRequest, + ClientRequest, + DriverRequest, DriverResponse, + LocalDriver, + RouterRequest, RouterResponse, + ToClientRequest, ToClientResponse, + RunJobRequestParams, + JobUpdateRequestParams, + //JobUpdateRequestBlob, +}; +use kinode_process_lib::{ + await_message, call_init, get_typed_state, println, set_state, + Address, ProcessId, Request, Response, +}; +use llm_interface::openai::{ChatRequestBuilder, ChatResponse, LLMRequest, LLMResponse, Message as LLMMessage}; + +const DEFAULT_ROUTER_PROCESS_ID: &str = "router:llm_provider:nick1udwig.os"; +const DEFAULT_ROUTER_NODE: &str = "nick1udwig.os"; // NOTE: this should be changed +const DEFAULT_TIMEOUT_SECONDS: u64 = 60; + +wit_bindgen::generate!({ + path: "target/wit", + world: "llm-provider-nick1udwig-dot-os-v0", + generate_unused_types: true, + additional_derives: [serde::Deserialize, serde::Serialize, process_macros::SerdeJsonInto], +}); + +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, process_macros::SerdeJsonInto)] +#[serde(untagged)] +enum Req { + AdminRequest(AdminRequest), + ClientRequest(ClientRequest), + RouterRequest(RouterRequest), + ToClientRequest(ToClientRequest), +} + +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, process_macros::SerdeJsonInto)] +#[serde(untagged)] +enum Res { + DriverResponse(DriverResponse), + ToClientResponse(ToClientResponse), +} + +#[derive(Debug, serde::Serialize, serde::Deserialize, process_macros::SerdeJsonInto)] +struct State { + router_process_id: Option, + router_node: Option, + local_driver: Option, + outstanding_job: Option +} + +impl Default for State { + fn default() -> Self { + Self { + router_process_id: None, + router_node: None, + local_driver: None, + outstanding_job: None, + } + } +} + +impl State { + fn save(&self) -> anyhow::Result<()> { + set_state(&serde_json::to_vec(self)?); + Ok(()) + } + + fn load() -> Self { + get_typed_state(|bytes| Ok(bytes.try_into()?)) + .unwrap_or_default() + } +} + +fn extract_chat_response_message(chat_response: &ChatResponse) -> anyhow::Result { + if chat_response.choices.len() != 1 { + return Err(anyhow::anyhow!("unexpected form of ChatResponse: {chat_response:?}")); + } + Ok(chat_response.choices[0].message.content.clone()) +} + +fn send_to_sidecar( + our: &Address, + job: &RunJobRequestParams, + timeout: Option, +) -> anyhow::Result { + let llm_process: Address = format!("{}@openai:{}", our.node(), our.package_id()).parse()?; + let mut chat_request = ChatRequestBuilder::default(); + chat_request + .model(job.model.clone()) + .messages(vec![LLMMessage { + role: "user".into(), + content: job.prompt.clone(), + }]); + if let Some(seed) = job.seed { + chat_request.seed(Some(seed as i32)); + }; + let chat_request = chat_request.build()?; + let chat_response = Request::to(llm_process) + .body(serde_json::to_vec(&LLMRequest::OaiProviderChat(chat_request))?) + .send_and_await_response(timeout.unwrap_or_else(|| DEFAULT_TIMEOUT_SECONDS))??; + let LLMResponse::Chat(chat_response) = serde_json::from_slice(chat_response.body())? else { + return Err(anyhow::anyhow!("unexpected chat response: {chat_response:?}")); + }; + let chat_response_message = extract_chat_response_message(&chat_response)?; + return Ok(chat_response_message); +} + +fn run_local_job( + our: &Address, + source: &Address, + job: &RunJobRequestParams, + timeout: Option, + state: &mut State, +) -> anyhow::Result<()> { + if source.node() != our.node() { + return Err(anyhow::anyhow!( + "rejecting local ClientRequest from {}; must be from our", + source.node(), + )); + } + + if let Some(ref local_driver) = state.local_driver { + println!("serving locally: {}", local_driver.model); + Response::new() + .body(RouterResponse::RunJob(Ok(0))) + .send()?; + let chat_response_message = send_to_sidecar(our, job, timeout)?; + Request::to(source) + .body(ToClientRequest::JobUpdate(JobUpdateRequestParams { + job_id: 0, + is_final: true, + signature: None, // TODO + })) + .blob_bytes(chat_response_message) + .expects_response(5) // TODO + .send()?; + } else { + // serve by passing Request to router + let router: Address = format!( + "{}@{}", + state.router_node.clone().unwrap_or_else(|| DEFAULT_ROUTER_NODE.to_string()), + state.router_process_id.clone().unwrap_or_else(|| DEFAULT_ROUTER_PROCESS_ID.parse().unwrap()), + ).parse()?; + println!("serving via router: {}", router); + Response::new() + .body(RouterResponse::RunJob(Ok(0))) + .send()?; + Request::to(router) + .body(ClientRequest::RunJob(job.clone())) + .send()?; + state.outstanding_job = Some(source.process.clone()); + state.save()?; + } + + Ok(()) +} + +fn set_is_available(is_available: bool, state: &mut State) -> anyhow::Result<()> { + let Some(ref local_driver) = state.local_driver else { + return Err(anyhow::anyhow!("LocalDriver must be set before availability can be set")); + }; + let router: Address = format!( + "{}@{}", + state.router_node + .clone() + .unwrap_or_else(|| DEFAULT_ROUTER_NODE.to_string()), + state.router_process_id + .clone() + .unwrap_or_else(|| DEFAULT_ROUTER_PROCESS_ID.parse().unwrap()), + ).parse()?; + Request::to(router) + .body(DriverRequest::SetIsAvailable(( + is_available, + local_driver.model.clone(), + ))) + .send()?; + Ok(()) +} + +fn run_job( + our: &Address, + source: &Address, + job_id: &u64, + job: &RunJobRequestParams, + timeout: Option, + state: &mut State, +) -> anyhow::Result<()> { + let router_node = state.router_node + .clone() + .unwrap_or_else(|| DEFAULT_ROUTER_NODE.into()); + + if source.node() != router_node { + let err = format!( + "rejecting RouterRequest from {}; must be from router {}", + source.node(), + router_node, + ); + Response::new() + .body(RouterResponse::RunJob(Err(err.clone()))) + .send()?; + return Err(anyhow::anyhow!(err)); + } + if !state.local_driver.as_ref().is_some_and(|ld| ld.is_public) { + let err = "got request from router, but not public"; + Response::new() + .body(RouterResponse::RunJob(Err(err.to_string()))) + .send()?; + return Err(anyhow::anyhow!(err)); + } + let Some(ref _local_driver) = state.local_driver else { + // deny Request: cannot serve it + let err = "got request from router, but don't have a local llm"; + Response::new() + .body(RouterResponse::RunJob(Err(err.to_string()))) + .send()?; + return Err(anyhow::anyhow!(err)); + }; + + Response::new() + .body(RouterResponse::RunJob(Ok(0))) + .send()?; + let chat_response_message = send_to_sidecar(our, job, timeout)?; + Request::to(source) + .body(ToClientRequest::JobUpdate(JobUpdateRequestParams { + job_id: job_id.clone(), + is_final: true, + signature: None, // TODO + })) + .blob_bytes(chat_response_message) + .expects_response(5) // TODO + .send()?; + + if state.local_driver.as_ref().is_some_and(|ld| ld.is_public) { + println!("setting ready again"); + set_is_available(true, state)? + } + state.outstanding_job = None; + state.save()?; + + Ok(()) +} + +fn handle_admin_request( + our: &Address, + source: &Address, + admin_request: &AdminRequest, + state: &mut State, +) -> anyhow::Result<()> { + if source.node() != our.node() { + return Err(anyhow::anyhow!( + "rejecting AdminRequest from {}; must be from our", + source.node(), + )); + } + match admin_request { + AdminRequest::SetLocalDriver(ref local_driver) => { + state.local_driver = Some(local_driver.clone()); + state.save()?; + if local_driver.is_public { + set_is_available(true, state)? + } + } + AdminRequest::SetRouter(ref router) => { + if let Some(ref process_id) = router.process_id { + state.router_process_id = Some(ProcessId { + process_name: process_id.process_name.clone(), + package_name: process_id.package_name.clone(), + publisher_node: process_id.publisher_node.clone(), + }); + }; + if let Some(ref node) = router.node { + state.router_node = Some(node.clone()); + }; + state.save()?; + if state.local_driver.as_ref().is_some_and(|ld| ld.is_public) { + set_is_available(true, state)? + } + } + } + Ok(()) +} + +fn handle_client_request( + our: &Address, + source: &Address, + client_request: &ClientRequest, + state: &mut State, +) -> anyhow::Result<()> { + match client_request { + ClientRequest::RunJob(ref job) => { + run_local_job(our, source, job, None, state)?; + } + } + Ok(()) +} + +fn handle_router_request( + our: &Address, + source: &Address, + router_request: &RouterRequest, + state: &mut State, +) -> anyhow::Result<()> { + match router_request { + RouterRequest::RunJob((ref job_id, ref job)) => { + run_job(our, source, job_id, job, None, state)?; + } + RouterRequest::QueryReady => { + Response::new() + .body(RouterResponse::QueryReady( + state.local_driver.as_ref().is_some_and(|ld| ld.is_public) + && state.outstanding_job.as_ref().is_none() + )) + .send()?; + } + } + Ok(()) +} + +fn handle_to_client_request( + to_client_request: &ToClientRequest, + state: &mut State, +) -> anyhow::Result<()> { + match to_client_request { + ToClientRequest::JobUpdate(job_update) => { + let Some(ref requestor) = state.outstanding_job else { + return Err(anyhow::anyhow!("no outstanding job for {job_update:?}; dropping")); + }; + let requestor: Address = format!("our@{requestor}").parse()?; + Request::to(requestor) + .body(to_client_request) + .inherit(true) + .send()?; + if state.local_driver.as_ref().is_some_and(|ld| ld.is_public) { + println!("setting ready again"); + set_is_available(true, state)? + } + state.outstanding_job = None; + state.save()?; + } + } + Ok(()) +} + +fn handle_driver_response( + driver_response: &DriverResponse, +) -> anyhow::Result<()> { + match driver_response { + DriverResponse::SetIsAvailable => {} + } + Ok(()) +} + +fn handle_to_client_response( + to_client_response: &ToClientResponse, +) -> anyhow::Result<()> { + match to_client_response { + ToClientResponse::JobUpdate => {} + } + Ok(()) +} + +fn handle_message( + our: &Address, + state: &mut State, +) -> anyhow::Result<()> { + let message = await_message()?; + + if message.is_request() { + return match message.body().try_into()? { + Req::AdminRequest(ref admin_request) => handle_admin_request( + our, + message.source(), + admin_request, + state, + ), + Req::ClientRequest(ref client_request) => handle_client_request( + our, + message.source(), + client_request, + state, + ), + Req::RouterRequest(ref router_request) => handle_router_request( + our, + message.source(), + router_request, + state, + ), + Req::ToClientRequest(ref to_client_request) => handle_to_client_request( + to_client_request, + state, + ), + }; + } + + match message.body().try_into()? { + Res::DriverResponse(ref driver_response) => handle_driver_response( + driver_response, + ), + Res::ToClientResponse(ref to_client_response) => handle_to_client_response( + to_client_response, + ), + } +} + +call_init!(init); +fn init(our: Address) { + println!("{}: begin", our.process()); + + let mut state = State::load(); + + loop { + match handle_message(&our, &mut state) { + Ok(()) => {}, + Err(e) => println!("{}: error: {:?}", our.process(), e), + }; + } +} diff --git a/lccp/Cargo.lock b/lccp/Cargo.lock deleted file mode 100644 index 2cef475..0000000 --- a/lccp/Cargo.lock +++ /dev/null @@ -1,1446 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "aho-corasick" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" -dependencies = [ - "memchr", -] - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anyhow" -version = "1.0.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" - -[[package]] -name = "ascii" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97be891acc47ca214468e09425d02cef3af2c94d0d82081cd02061f996802f14" - -[[package]] -name = "autocfg" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dde43e75fd43e8a1bf86103336bc699aa8d17ad1be60c76c0bdfd4828e19b78" -dependencies = [ - "autocfg 1.1.0", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "base64" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" -dependencies = [ - "byteorder", - "safemem", -] - -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "buf_redux" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b953a6887648bb07a535631f2bc00fbdb2a2216f135552cb3f534ed136b9c07f" -dependencies = [ - "memchr", - "safemem", -] - -[[package]] -name = "bumpalo" -version = "3.15.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea184aa71bb362a1157c896979544cc23974e08fd265f29ea96b59f0b4a555b" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "bytes" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" - -[[package]] -name = "cc" -version = "1.0.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3286b845d0fccbdd15af433f61c5970e711987036cb468f437ff6badd70f4e24" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chrono" -version = "0.4.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "js-sys", - "num-traits", - "wasm-bindgen", - "windows-targets", -] - -[[package]] -name = "chunked_transfer" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "498d20a7aaf62625b9bf26e637cf7736417cde1d0c99f1d04d1170229a85cf87" - -[[package]] -name = "cloudabi" -version = "0.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "interface" -version = "0.1.0" - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" -dependencies = [ - "libc", - "windows-sys", -] - -[[package]] -name = "fastrand" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "form_urlencoded" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" -dependencies = [ - "percent-encoding 2.3.1", -] - -[[package]] -name = "fuchsia-cprng" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" - -[[package]] -name = "getrandom" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" -dependencies = [ - "cfg-if", - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", -] - -[[package]] -name = "groupable" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32619942b8be646939eaf3db0602b39f5229b74575b67efc897811ded1db4e57" - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" - -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "hermit-abi" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd5256b483761cd23699d0da46cc6fd2ee3be420bbe6d020ae4a091e70b7e9fd" - -[[package]] -name = "http" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "httparse" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" - -[[package]] -name = "hyper" -version = "0.10.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a0652d9a2609a968c14be1a9ea00bf4b1d64e2e1f53a1b51b6fff3a6e829273" -dependencies = [ - "base64", - "httparse", - "language-tags", - "log 0.3.9", - "mime 0.2.6", - "num_cpus", - "time", - "traitobject", - "typeable", - "unicase 1.4.2", - "url 1.7.2", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "id-arena" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" - -[[package]] -name = "idna" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" -dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "idna" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "indexmap" -version = "2.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" -dependencies = [ - "equivalent", - "hashbrown", - "serde", -] - -[[package]] -name = "iron" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6d308ca2d884650a8bf9ed2ff4cb13fbb2207b71f64cda11dc9b892067295e8" -dependencies = [ - "hyper", - "log 0.3.9", - "mime_guess 1.8.8", - "modifier", - "num_cpus", - "plugin", - "typemap", - "url 1.7.2", -] - -[[package]] -name = "itoa" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" - -[[package]] -name = "js-sys" -version = "0.3.68" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "kinode_process_lib" -version = "0.5.9" -source = "git+https://github.com/kinode-dao/process_lib.git?tag=v0.5.9-alpha#5e705086bbd10fde89e11d3e3671f6a618a875a7" -dependencies = [ - "anyhow", - "bincode", - "http", - "mime_guess 2.0.4", - "rand 0.8.5", - "serde", - "serde_json", - "thiserror", - "url 2.5.0", - "wit-bindgen", -] - -[[package]] -name = "language-tags" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "leb128" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" - -[[package]] -name = "libc" -version = "0.2.153" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" - -[[package]] -name = "linux-raw-sys" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" - -[[package]] -name = "llm_process" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "interface", - "kinode_process_lib", - "multipart", - "serde", - "serde_json", - "wit-bindgen", -] - -[[package]] -name = "log" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" -dependencies = [ - "log 0.4.20", -] - -[[package]] -name = "log" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" - -[[package]] -name = "matches" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" - -[[package]] -name = "memchr" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" - -[[package]] -name = "mime" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" -dependencies = [ - "log 0.3.9", -] - -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "mime_guess" -version = "1.8.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216929a5ee4dd316b1702eedf5e74548c123d370f47841ceaac38ca154690ca3" -dependencies = [ - "mime 0.2.6", - "phf", - "phf_codegen", - "unicase 1.4.2", -] - -[[package]] -name = "mime_guess" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" -dependencies = [ - "mime 0.3.17", - "unicase 2.7.0", -] - -[[package]] -name = "modifier" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41f5c9112cb662acd3b204077e0de5bc66305fa8df65c8019d5adb10e9ab6e58" - -[[package]] -name = "multipart" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00dec633863867f29cb39df64a397cdf4a6354708ddd7759f70c7fb51c5f9182" -dependencies = [ - "buf_redux", - "httparse", - "hyper", - "iron", - "log 0.4.20", - "mime 0.3.17", - "mime_guess 2.0.4", - "nickel", - "quick-error", - "rand 0.8.5", - "safemem", - "tempfile", - "tiny_http", - "twoway", -] - -[[package]] -name = "mustache" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51956ef1c5d20a1384524d91e616fb44dfc7d8f249bf696d49c97dd3289ecab5" -dependencies = [ - "log 0.3.9", - "serde", -] - -[[package]] -name = "nickel" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5061a832728db2dacb61cefe0ce303b58f85764ec680e71d9138229640a46d9" -dependencies = [ - "groupable", - "hyper", - "lazy_static", - "log 0.3.9", - "modifier", - "mustache", - "plugin", - "regex", - "serde", - "serde_json", - "time", - "typemap", - "url 1.7.2", -] - -[[package]] -name = "num-traits" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" -dependencies = [ - "autocfg 1.1.0", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "percent-encoding" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" - -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "phf" -version = "0.7.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3da44b85f8e8dfaec21adae67f95d93244b2ecf6ad2a692320598dcc8e6dd18" -dependencies = [ - "phf_shared", -] - -[[package]] -name = "phf_codegen" -version = "0.7.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b03e85129e324ad4166b06b2c7491ae27fe3ec353af72e72cd1654c7225d517e" -dependencies = [ - "phf_generator", - "phf_shared", -] - -[[package]] -name = "phf_generator" -version = "0.7.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09364cc93c159b8b06b1f4dd8a4398984503483891b0c26b867cf431fb132662" -dependencies = [ - "phf_shared", - "rand 0.6.5", -] - -[[package]] -name = "phf_shared" -version = "0.7.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "234f71a15de2288bcb7e3b6515828d22af7ec8598ee6d24c3b526fa0a80b67a0" -dependencies = [ - "siphasher", - "unicase 1.4.2", -] - -[[package]] -name = "plugin" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a6a0dc3910bc8db877ffed8e457763b317cf880df4ae19109b9f77d277cf6e0" -dependencies = [ - "typemap", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" -dependencies = [ - "autocfg 0.1.8", - "libc", - "rand_chacha 0.1.1", - "rand_core 0.4.2", - "rand_hc", - "rand_isaac", - "rand_jitter", - "rand_os", - "rand_pcg", - "rand_xorshift", - "winapi", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_chacha" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" -dependencies = [ - "autocfg 0.1.8", - "rand_core 0.3.1", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_core" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" -dependencies = [ - "rand_core 0.4.2", -] - -[[package]] -name = "rand_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rand_hc" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rand_isaac" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rand_jitter" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" -dependencies = [ - "libc", - "rand_core 0.4.2", - "winapi", -] - -[[package]] -name = "rand_os" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" -dependencies = [ - "cloudabi", - "fuchsia-cprng", - "libc", - "rand_core 0.4.2", - "rdrand", - "winapi", -] - -[[package]] -name = "rand_pcg" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" -dependencies = [ - "autocfg 0.1.8", - "rand_core 0.4.2", -] - -[[package]] -name = "rand_xorshift" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rdrand" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "regex" -version = "1.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" - -[[package]] -name = "rustix" -version = "0.38.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" -dependencies = [ - "bitflags 2.4.2", - "errno", - "libc", - "linux-raw-sys", - "windows-sys", -] - -[[package]] -name = "ryu" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" - -[[package]] -name = "safemem" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" - -[[package]] -name = "semver" -version = "1.0.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" - -[[package]] -name = "serde" -version = "1.0.197" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.197" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.114" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "siphasher" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac" - -[[package]] -name = "smallvec" -version = "1.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" - -[[package]] -name = "spdx" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bde1398b09b9f93fc2fc9b9da86e362693e999d3a54a8ac47a99a5a73f638b" -dependencies = [ - "smallvec", -] - -[[package]] -name = "syn" -version = "2.0.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f1bdc9872430ce9b75da68329d1c1746faf50ffac5f19e02b71e37ff881ffb" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "tempfile" -version = "3.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" -dependencies = [ - "cfg-if", - "fastrand", - "rustix", - "windows-sys", -] - -[[package]] -name = "thiserror" -version = "1.0.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "time" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", -] - -[[package]] -name = "tiny_http" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e22cb179b63e5fc2d0b5be237dc107da072e2407809ac70a8ce85b93fe8f562" -dependencies = [ - "ascii", - "chrono", - "chunked_transfer", - "log 0.4.20", - "url 1.7.2", -] - -[[package]] -name = "tinyvec" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "traitobject" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" - -[[package]] -name = "twoway" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b11b2b5241ba34be09c3cc85a36e56e48f9888862e19cedf23336d35316ed1" -dependencies = [ - "memchr", -] - -[[package]] -name = "typeable" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" - -[[package]] -name = "typemap" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "653be63c80a3296da5551e1bfd2cca35227e13cdd08c6668903ae2f4f77aa1f6" -dependencies = [ - "unsafe-any", -] - -[[package]] -name = "unicase" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" -dependencies = [ - "version_check 0.1.5", -] - -[[package]] -name = "unicase" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check 0.9.4", -] - -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-normalization" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "unicode-xid" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" - -[[package]] -name = "unsafe-any" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30360d7979f5e9c6e6cea48af192ea8fab4afb3cf72597154b8f08935bc9c7f" -dependencies = [ - "traitobject", -] - -[[package]] -name = "url" -version = "1.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" -dependencies = [ - "idna 0.1.5", - "matches", - "percent-encoding 1.0.1", -] - -[[package]] -name = "url" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" -dependencies = [ - "form_urlencoded", - "idna 0.5.0", - "percent-encoding 2.3.1", -] - -[[package]] -name = "version_check" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.91" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.91" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" -dependencies = [ - "bumpalo", - "log 0.4.20", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.91" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.91" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.91" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" - -[[package]] -name = "wasm-encoder" -version = "0.38.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ad2b51884de9c7f4fe2fd1043fccb8dcad4b1e29558146ee57a144d15779f3f" -dependencies = [ - "leb128", -] - -[[package]] -name = "wasm-encoder" -version = "0.41.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "972f97a5d8318f908dded23594188a90bcd09365986b1163e66d70170e5287ae" -dependencies = [ - "leb128", -] - -[[package]] -name = "wasm-metadata" -version = "0.10.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18ebaa7bd0f9e7a5e5dd29b9a998acf21c4abed74265524dd7e85934597bfb10" -dependencies = [ - "anyhow", - "indexmap", - "serde", - "serde_derive", - "serde_json", - "spdx", - "wasm-encoder 0.41.2", - "wasmparser 0.121.2", -] - -[[package]] -name = "wasmparser" -version = "0.118.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77f1154f1ab868e2a01d9834a805faca7bf8b50d041b4ca714d005d0dab1c50c" -dependencies = [ - "indexmap", - "semver", -] - -[[package]] -name = "wasmparser" -version = "0.121.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dbe55c8f9d0dbd25d9447a5a889ff90c0cc3feaa7395310d3d826b2c703eaab" -dependencies = [ - "bitflags 2.4.2", - "indexmap", - "semver", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d380ba1dc7187569a8a9e91ed34b8ccfc33123bbacb8c0aed2d1ad7f3ef2dc5f" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68e5dcfb9413f53afd9c8f86e56a7b4d86d9a2fa26090ea2dc9e40fba56c6ec6" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dab469ebbc45798319e69eebf92308e541ce46760b49b18c6b3fe5e8965b30f" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a4e9b6a7cac734a8b4138a4e1044eac3404d8326b6c0f939276560687a033fb" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b0ec9c422ca95ff34a78755cfa6ad4a51371da2a5ace67500cf7ca5f232c58" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "704131571ba93e89d7cd43482277d6632589b18ecf4468f591fbae0a8b101614" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42079295511643151e98d61c38c0acc444e52dd42ab456f7ccfd5152e8ecf21c" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0770833d60a970638e989b3fa9fd2bb1aaadcf88963d1659fd7d9990196ed2d6" - -[[package]] -name = "wit-bindgen" -version = "0.16.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=efcc759#efcc7592cf3277bcb9be1034e48569c6d822b322" -dependencies = [ - "bitflags 2.4.2", - "wit-bindgen-rust-macro", -] - -[[package]] -name = "wit-bindgen-core" -version = "0.16.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=efcc759#efcc7592cf3277bcb9be1034e48569c6d822b322" -dependencies = [ - "anyhow", - "wit-component", - "wit-parser", -] - -[[package]] -name = "wit-bindgen-rust" -version = "0.16.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=efcc759#efcc7592cf3277bcb9be1034e48569c6d822b322" -dependencies = [ - "anyhow", - "heck", - "wasm-metadata", - "wit-bindgen-core", - "wit-component", -] - -[[package]] -name = "wit-bindgen-rust-macro" -version = "0.16.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=efcc759#efcc7592cf3277bcb9be1034e48569c6d822b322" -dependencies = [ - "anyhow", - "proc-macro2", - "quote", - "syn", - "wit-bindgen-core", - "wit-bindgen-rust", - "wit-component", -] - -[[package]] -name = "wit-component" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a35a2a9992898c9d27f1664001860595a4bc99d32dd3599d547412e17d7e2" -dependencies = [ - "anyhow", - "bitflags 2.4.2", - "indexmap", - "log 0.4.20", - "serde", - "serde_derive", - "serde_json", - "wasm-encoder 0.38.1", - "wasm-metadata", - "wasmparser 0.118.2", - "wit-parser", -] - -[[package]] -name = "wit-parser" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "316b36a9f0005f5aa4b03c39bc3728d045df136f8c13a73b7db4510dec725e08" -dependencies = [ - "anyhow", - "id-arena", - "indexmap", - "log 0.4.20", - "semver", - "serde", - "serde_derive", - "serde_json", - "unicode-xid", -] - -[[package]] -name = "worker" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "kinode_process_lib", - "serde", - "serde_json", - "wit-bindgen", -] diff --git a/lccp/lccp/Cargo.lock b/lccp/lccp/Cargo.lock deleted file mode 100644 index 86c7c98..0000000 --- a/lccp/lccp/Cargo.lock +++ /dev/null @@ -1,1434 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "aho-corasick" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" -dependencies = [ - "memchr", -] - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anyhow" -version = "1.0.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" - -[[package]] -name = "ascii" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97be891acc47ca214468e09425d02cef3af2c94d0d82081cd02061f996802f14" - -[[package]] -name = "autocfg" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dde43e75fd43e8a1bf86103336bc699aa8d17ad1be60c76c0bdfd4828e19b78" -dependencies = [ - "autocfg 1.1.0", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "base64" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" -dependencies = [ - "byteorder", - "safemem", -] - -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "buf_redux" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b953a6887648bb07a535631f2bc00fbdb2a2216f135552cb3f534ed136b9c07f" -dependencies = [ - "memchr", - "safemem", -] - -[[package]] -name = "bumpalo" -version = "3.15.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea184aa71bb362a1157c896979544cc23974e08fd265f29ea96b59f0b4a555b" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "bytes" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" - -[[package]] -name = "cc" -version = "1.0.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3286b845d0fccbdd15af433f61c5970e711987036cb468f437ff6badd70f4e24" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chrono" -version = "0.4.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "js-sys", - "num-traits", - "wasm-bindgen", - "windows-targets", -] - -[[package]] -name = "chunked_transfer" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "498d20a7aaf62625b9bf26e637cf7736417cde1d0c99f1d04d1170229a85cf87" - -[[package]] -name = "cloudabi" -version = "0.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "interface" -version = "0.1.0" - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" -dependencies = [ - "libc", - "windows-sys", -] - -[[package]] -name = "fastrand" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "form_urlencoded" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" -dependencies = [ - "percent-encoding 2.3.1", -] - -[[package]] -name = "fuchsia-cprng" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" - -[[package]] -name = "getrandom" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" -dependencies = [ - "cfg-if", - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", -] - -[[package]] -name = "groupable" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32619942b8be646939eaf3db0602b39f5229b74575b67efc897811ded1db4e57" - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" - -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "hermit-abi" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd5256b483761cd23699d0da46cc6fd2ee3be420bbe6d020ae4a091e70b7e9fd" - -[[package]] -name = "http" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "httparse" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" - -[[package]] -name = "hyper" -version = "0.10.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a0652d9a2609a968c14be1a9ea00bf4b1d64e2e1f53a1b51b6fff3a6e829273" -dependencies = [ - "base64", - "httparse", - "language-tags", - "log 0.3.9", - "mime 0.2.6", - "num_cpus", - "time", - "traitobject", - "typeable", - "unicase 1.4.2", - "url 1.7.2", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "id-arena" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" - -[[package]] -name = "idna" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" -dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "idna" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "indexmap" -version = "2.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" -dependencies = [ - "equivalent", - "hashbrown", - "serde", -] - -[[package]] -name = "iron" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6d308ca2d884650a8bf9ed2ff4cb13fbb2207b71f64cda11dc9b892067295e8" -dependencies = [ - "hyper", - "log 0.3.9", - "mime_guess 1.8.8", - "modifier", - "num_cpus", - "plugin", - "typemap", - "url 1.7.2", -] - -[[package]] -name = "itoa" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" - -[[package]] -name = "js-sys" -version = "0.3.68" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "kinode_process_lib" -version = "0.5.9" -source = "git+https://github.com/kinode-dao/process_lib.git?tag=v0.5.9-alpha#5e705086bbd10fde89e11d3e3671f6a618a875a7" -dependencies = [ - "anyhow", - "bincode", - "http", - "mime_guess 2.0.4", - "rand 0.8.5", - "serde", - "serde_json", - "thiserror", - "url 2.5.0", - "wit-bindgen", -] - -[[package]] -name = "language-tags" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "leb128" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" - -[[package]] -name = "libc" -version = "0.2.153" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" - -[[package]] -name = "linux-raw-sys" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" - -[[package]] -name = "llm_process" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "interface", - "kinode_process_lib", - "multipart", - "serde", - "serde_json", - "wit-bindgen", -] - -[[package]] -name = "log" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" -dependencies = [ - "log 0.4.20", -] - -[[package]] -name = "log" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" - -[[package]] -name = "matches" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" - -[[package]] -name = "memchr" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" - -[[package]] -name = "mime" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" -dependencies = [ - "log 0.3.9", -] - -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "mime_guess" -version = "1.8.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216929a5ee4dd316b1702eedf5e74548c123d370f47841ceaac38ca154690ca3" -dependencies = [ - "mime 0.2.6", - "phf", - "phf_codegen", - "unicase 1.4.2", -] - -[[package]] -name = "mime_guess" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" -dependencies = [ - "mime 0.3.17", - "unicase 2.7.0", -] - -[[package]] -name = "modifier" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41f5c9112cb662acd3b204077e0de5bc66305fa8df65c8019d5adb10e9ab6e58" - -[[package]] -name = "multipart" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00dec633863867f29cb39df64a397cdf4a6354708ddd7759f70c7fb51c5f9182" -dependencies = [ - "buf_redux", - "httparse", - "hyper", - "iron", - "log 0.4.20", - "mime 0.3.17", - "mime_guess 2.0.4", - "nickel", - "quick-error", - "rand 0.8.5", - "safemem", - "tempfile", - "tiny_http", - "twoway", -] - -[[package]] -name = "mustache" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51956ef1c5d20a1384524d91e616fb44dfc7d8f249bf696d49c97dd3289ecab5" -dependencies = [ - "log 0.3.9", - "serde", -] - -[[package]] -name = "nickel" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5061a832728db2dacb61cefe0ce303b58f85764ec680e71d9138229640a46d9" -dependencies = [ - "groupable", - "hyper", - "lazy_static", - "log 0.3.9", - "modifier", - "mustache", - "plugin", - "regex", - "serde", - "serde_json", - "time", - "typemap", - "url 1.7.2", -] - -[[package]] -name = "num-traits" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" -dependencies = [ - "autocfg 1.1.0", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "percent-encoding" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" - -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "phf" -version = "0.7.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3da44b85f8e8dfaec21adae67f95d93244b2ecf6ad2a692320598dcc8e6dd18" -dependencies = [ - "phf_shared", -] - -[[package]] -name = "phf_codegen" -version = "0.7.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b03e85129e324ad4166b06b2c7491ae27fe3ec353af72e72cd1654c7225d517e" -dependencies = [ - "phf_generator", - "phf_shared", -] - -[[package]] -name = "phf_generator" -version = "0.7.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09364cc93c159b8b06b1f4dd8a4398984503483891b0c26b867cf431fb132662" -dependencies = [ - "phf_shared", - "rand 0.6.5", -] - -[[package]] -name = "phf_shared" -version = "0.7.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "234f71a15de2288bcb7e3b6515828d22af7ec8598ee6d24c3b526fa0a80b67a0" -dependencies = [ - "siphasher", - "unicase 1.4.2", -] - -[[package]] -name = "plugin" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a6a0dc3910bc8db877ffed8e457763b317cf880df4ae19109b9f77d277cf6e0" -dependencies = [ - "typemap", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" -dependencies = [ - "autocfg 0.1.8", - "libc", - "rand_chacha 0.1.1", - "rand_core 0.4.2", - "rand_hc", - "rand_isaac", - "rand_jitter", - "rand_os", - "rand_pcg", - "rand_xorshift", - "winapi", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_chacha" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" -dependencies = [ - "autocfg 0.1.8", - "rand_core 0.3.1", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_core" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" -dependencies = [ - "rand_core 0.4.2", -] - -[[package]] -name = "rand_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rand_hc" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rand_isaac" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rand_jitter" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" -dependencies = [ - "libc", - "rand_core 0.4.2", - "winapi", -] - -[[package]] -name = "rand_os" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" -dependencies = [ - "cloudabi", - "fuchsia-cprng", - "libc", - "rand_core 0.4.2", - "rdrand", - "winapi", -] - -[[package]] -name = "rand_pcg" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" -dependencies = [ - "autocfg 0.1.8", - "rand_core 0.4.2", -] - -[[package]] -name = "rand_xorshift" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rdrand" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "regex" -version = "1.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" - -[[package]] -name = "rustix" -version = "0.38.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" -dependencies = [ - "bitflags 2.4.2", - "errno", - "libc", - "linux-raw-sys", - "windows-sys", -] - -[[package]] -name = "ryu" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" - -[[package]] -name = "safemem" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" - -[[package]] -name = "semver" -version = "1.0.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" - -[[package]] -name = "serde" -version = "1.0.197" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.197" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.114" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "siphasher" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac" - -[[package]] -name = "smallvec" -version = "1.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" - -[[package]] -name = "spdx" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bde1398b09b9f93fc2fc9b9da86e362693e999d3a54a8ac47a99a5a73f638b" -dependencies = [ - "smallvec", -] - -[[package]] -name = "syn" -version = "2.0.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f1bdc9872430ce9b75da68329d1c1746faf50ffac5f19e02b71e37ff881ffb" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "tempfile" -version = "3.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" -dependencies = [ - "cfg-if", - "fastrand", - "rustix", - "windows-sys", -] - -[[package]] -name = "thiserror" -version = "1.0.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "time" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", -] - -[[package]] -name = "tiny_http" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e22cb179b63e5fc2d0b5be237dc107da072e2407809ac70a8ce85b93fe8f562" -dependencies = [ - "ascii", - "chrono", - "chunked_transfer", - "log 0.4.20", - "url 1.7.2", -] - -[[package]] -name = "tinyvec" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "traitobject" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" - -[[package]] -name = "twoway" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b11b2b5241ba34be09c3cc85a36e56e48f9888862e19cedf23336d35316ed1" -dependencies = [ - "memchr", -] - -[[package]] -name = "typeable" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" - -[[package]] -name = "typemap" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "653be63c80a3296da5551e1bfd2cca35227e13cdd08c6668903ae2f4f77aa1f6" -dependencies = [ - "unsafe-any", -] - -[[package]] -name = "unicase" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" -dependencies = [ - "version_check 0.1.5", -] - -[[package]] -name = "unicase" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check 0.9.4", -] - -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-normalization" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "unicode-xid" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" - -[[package]] -name = "unsafe-any" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30360d7979f5e9c6e6cea48af192ea8fab4afb3cf72597154b8f08935bc9c7f" -dependencies = [ - "traitobject", -] - -[[package]] -name = "url" -version = "1.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" -dependencies = [ - "idna 0.1.5", - "matches", - "percent-encoding 1.0.1", -] - -[[package]] -name = "url" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" -dependencies = [ - "form_urlencoded", - "idna 0.5.0", - "percent-encoding 2.3.1", -] - -[[package]] -name = "version_check" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.91" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.91" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" -dependencies = [ - "bumpalo", - "log 0.4.20", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.91" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.91" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.91" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" - -[[package]] -name = "wasm-encoder" -version = "0.38.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ad2b51884de9c7f4fe2fd1043fccb8dcad4b1e29558146ee57a144d15779f3f" -dependencies = [ - "leb128", -] - -[[package]] -name = "wasm-encoder" -version = "0.41.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "972f97a5d8318f908dded23594188a90bcd09365986b1163e66d70170e5287ae" -dependencies = [ - "leb128", -] - -[[package]] -name = "wasm-metadata" -version = "0.10.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18ebaa7bd0f9e7a5e5dd29b9a998acf21c4abed74265524dd7e85934597bfb10" -dependencies = [ - "anyhow", - "indexmap", - "serde", - "serde_derive", - "serde_json", - "spdx", - "wasm-encoder 0.41.2", - "wasmparser 0.121.2", -] - -[[package]] -name = "wasmparser" -version = "0.118.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77f1154f1ab868e2a01d9834a805faca7bf8b50d041b4ca714d005d0dab1c50c" -dependencies = [ - "indexmap", - "semver", -] - -[[package]] -name = "wasmparser" -version = "0.121.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dbe55c8f9d0dbd25d9447a5a889ff90c0cc3feaa7395310d3d826b2c703eaab" -dependencies = [ - "bitflags 2.4.2", - "indexmap", - "semver", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d380ba1dc7187569a8a9e91ed34b8ccfc33123bbacb8c0aed2d1ad7f3ef2dc5f" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68e5dcfb9413f53afd9c8f86e56a7b4d86d9a2fa26090ea2dc9e40fba56c6ec6" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dab469ebbc45798319e69eebf92308e541ce46760b49b18c6b3fe5e8965b30f" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a4e9b6a7cac734a8b4138a4e1044eac3404d8326b6c0f939276560687a033fb" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b0ec9c422ca95ff34a78755cfa6ad4a51371da2a5ace67500cf7ca5f232c58" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "704131571ba93e89d7cd43482277d6632589b18ecf4468f591fbae0a8b101614" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42079295511643151e98d61c38c0acc444e52dd42ab456f7ccfd5152e8ecf21c" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0770833d60a970638e989b3fa9fd2bb1aaadcf88963d1659fd7d9990196ed2d6" - -[[package]] -name = "wit-bindgen" -version = "0.16.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=efcc759#efcc7592cf3277bcb9be1034e48569c6d822b322" -dependencies = [ - "bitflags 2.4.2", - "wit-bindgen-rust-macro", -] - -[[package]] -name = "wit-bindgen-core" -version = "0.16.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=efcc759#efcc7592cf3277bcb9be1034e48569c6d822b322" -dependencies = [ - "anyhow", - "wit-component", - "wit-parser", -] - -[[package]] -name = "wit-bindgen-rust" -version = "0.16.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=efcc759#efcc7592cf3277bcb9be1034e48569c6d822b322" -dependencies = [ - "anyhow", - "heck", - "wasm-metadata", - "wit-bindgen-core", - "wit-component", -] - -[[package]] -name = "wit-bindgen-rust-macro" -version = "0.16.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=efcc759#efcc7592cf3277bcb9be1034e48569c6d822b322" -dependencies = [ - "anyhow", - "proc-macro2", - "quote", - "syn", - "wit-bindgen-core", - "wit-bindgen-rust", - "wit-component", -] - -[[package]] -name = "wit-component" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a35a2a9992898c9d27f1664001860595a4bc99d32dd3599d547412e17d7e2" -dependencies = [ - "anyhow", - "bitflags 2.4.2", - "indexmap", - "log 0.4.20", - "serde", - "serde_derive", - "serde_json", - "wasm-encoder 0.38.1", - "wasm-metadata", - "wasmparser 0.118.2", - "wit-parser", -] - -[[package]] -name = "wit-parser" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "316b36a9f0005f5aa4b03c39bc3728d045df136f8c13a73b7db4510dec725e08" -dependencies = [ - "anyhow", - "id-arena", - "indexmap", - "log 0.4.20", - "semver", - "serde", - "serde_derive", - "serde_json", - "unicode-xid", -] diff --git a/lccp/lccp/src/lib.rs b/lccp/lccp/src/lib.rs deleted file mode 100644 index a8e2df8..0000000 --- a/lccp/lccp/src/lib.rs +++ /dev/null @@ -1,177 +0,0 @@ -use anyhow::Context; -use llm_interface::lccp::{ - ChatRequest, ChatResponse, ChatStreamingResponse, EmbeddingRequest, EmbeddingResponse, - LLMRequest, LLMResponse, -}; -use kinode_process_lib::{ - await_message, call_init, get_blob, - http::{HttpClientAction, OutgoingHttpRequest}, - println, Address, LazyLoadBlob, ProcessId, Request, Response, -}; -use serde_json::json; -use std::{collections::HashMap, vec}; - -// TODO: Zen: This should be in a config -const URL: &str = "http://127.0.0.1:3000"; - -const CHAT_CONTEXT_NON_STREAMING: u8 = 0; -const CHAT_CONTEXT_STREAMING: u8 = 1; -const EMBEDDING_CONTEXT: u8 = 2; - -wit_bindgen::generate!({ - path: "wit", - world: "process", - exports: { - world: Component, - }, -}); - -fn handle_response(context: &[u8]) -> anyhow::Result<()> { - match context[0] { - CHAT_CONTEXT_NON_STREAMING => handle_chat_response_non_streaming()?, - // CHAT_CONTEXT_STREAMING => handle_chat_response_streaming()?, - EMBEDDING_CONTEXT => handle_embedding_response()?, - _ => {} - } - - Ok(()) -} - -fn handle_embedding_response() -> anyhow::Result<()> { - let bytes = get_blob().context("Couldn't get blob")?; - let output = serde_json::from_slice::(bytes.bytes.as_slice())?; - let response = LLMResponse::Embedding(output); - let _ = Response::new() - .body(serde_json::to_vec(&response).expect("Failed to serialize response for embedding")) - .send(); - Ok(()) -} - -fn handle_chat_response_non_streaming() -> anyhow::Result<()> { - let bytes = get_blob().context("Couldn't get blob")?; - let response = serde_json::from_slice::(bytes.bytes.as_slice())?; - let response = LLMResponse::Chat(response); - let _ = Response::new() - .body(serde_json::to_vec(&response)?) - .send()?; - Ok(()) -} - -fn _handle_chat_response_streaming() -> anyhow::Result<()> { - let mut acc = String::new(); - if let Some(bytes) = get_blob() { - println!("lccp: length of received bytes: {}", bytes.bytes.len()); - let response_str = String::from_utf8(bytes.bytes.clone()).expect("Invalid UTF-8"); - acc.push_str(&response_str); - - let acc_clone = acc.clone(); - for chunk in acc_clone.split("\n\n").filter(|e| e.starts_with("data: ")) { - let json_str = &chunk[6..]; - if let Ok(response) = serde_json::from_str::(json_str) { - let llm_response = LLMResponse::ChatStreaming(response); - // println!("lccp: sending response: {:?}", llm_response); - Response::new() - .body(serde_json::to_vec(&llm_response)?) - .send()?; - // Remove the string from acc - acc = acc.replace(chunk, ""); - } - } - // if stop { - // break; - // } - } - Ok(()) -} - -fn handle_request(body: &[u8]) -> anyhow::Result<()> { - let request = LLMRequest::parse(body)?; - match &request { - LLMRequest::Embedding(embedding_params) => handle_embedding_request(embedding_params)?, - LLMRequest::Chat(chat_params) => handle_chat_request(chat_params)?, - } - Ok(()) -} -fn send_request( - params: &T, - endpoint: &str, - context: u8, -) -> anyhow::Result<()> { - let outgoing_request = OutgoingHttpRequest { - method: "POST".to_string(), - version: None, - url: format!("{}/{}", URL, endpoint), - headers: HashMap::from_iter(vec![( - "Content-Type".to_string(), - "application/json".to_string(), - )]), - }; - let body_bytes = json!(HttpClientAction::Http(outgoing_request)) - .to_string() - .as_bytes() - .to_vec(); - let content = serde_json::to_string(params).expect("Failed to serialize params"); - Request::new() - .target(Address::new( - "our", - ProcessId::new(Some("http_client"), "distro", "sys"), - )) - .body(body_bytes) - .expects_response(30) - .context(vec![context]) - .blob(LazyLoadBlob { - mime: Some("application/json".to_string()), - bytes: content.as_bytes().to_vec(), - }) - .send()?; - Ok(()) -} - - -fn handle_chat_request_non_streaming(chat_params: &ChatRequest) -> anyhow::Result<()> { - send_request(chat_params, "completion", CHAT_CONTEXT_NON_STREAMING) -} - -fn handle_chat_request_streaming(chat_params: &ChatRequest) -> anyhow::Result<()> { - send_request(chat_params, "completion", CHAT_CONTEXT_STREAMING) -} - -fn handle_embedding_request(embedding_params: &EmbeddingRequest) -> anyhow::Result<()> { - send_request(embedding_params, "embedding", EMBEDDING_CONTEXT) -} - -fn handle_chat_request(chat_params: &ChatRequest) -> anyhow::Result<()> { - if chat_params.stream.unwrap_or(false) { - handle_chat_request_streaming(chat_params) - } else { - handle_chat_request_non_streaming(chat_params) - } -} - -fn handle_message() -> anyhow::Result<()> { - let message = await_message()?; - println!("lccp: we received a message"); - if message.is_request() { - let _ = handle_request(message.body()); - } else { - let context = message.context().context("lccp: Failed to get context")?; - let _ = handle_response(context); - } - - Ok(()) -} - -call_init!(init); - -fn init(_our: Address) { - println!("lccp: begin"); - - loop { - match handle_message() { - Ok(()) => {} - Err(e) => { - println!("lccp: error: {:?}", e); - } - }; - } -} diff --git a/lccp/lccp/wasi_snapshot_preview1.wasm b/lccp/lccp/wasi_snapshot_preview1.wasm deleted file mode 100644 index 4ee5bc1..0000000 Binary files a/lccp/lccp/wasi_snapshot_preview1.wasm and /dev/null differ diff --git a/lccp/lccp/wit/kinode.wit b/lccp/lccp/wit/kinode.wit deleted file mode 100644 index caef605..0000000 --- a/lccp/lccp/wit/kinode.wit +++ /dev/null @@ -1,198 +0,0 @@ -package kinode:process@0.7.0; - -interface standard { - // - // System types: - // - - // JSON is passed over WASM boundary as a string. - type json = string; - - type node-id = string; - - // Context, like a message body, is a protocol-defined serialized byte - // array. It is used when building a Request to save information that - // will not be part of a Response, in order to more easily handle - // ("contextualize") that Response. - type context = list; - - record process-id { - process-name: string, - package-name: string, - publisher-node: node-id, - } - - record address { - node: node-id, - process: process-id, - } - - record lazy-load-blob { - mime: option, - bytes: list, - } - - record request { - // set in order to inherit lazy-load-blob from parent message, and if - // expects-response is none, direct response to source of parent. - // also carries forward certain aspects of parent message in kernel, - // see documentation for formal spec and examples. - inherit: bool, - // if some, request expects a response in the given number of seconds - expects-response: option, - body: list, - metadata: option, - capabilities: list, - // to grab lazy-load-blob, use get_blob() - } - - record response { - inherit: bool, - body: list, - metadata: option, - capabilities: list, - // to grab lazy-load-blob, use get_blob() - } - - // A message can be a request or a response. within a response, there is - // a result which surfaces any error that happened because of a request. - // A successful response will contain the context of the request it - // matches, if any was set. - variant message { - request(request), - response(tuple>), - } - - record capability { - issuer: address, - params: json, - } - - // On-exit is a setting that determines what happens when a process - // panics, completes, or otherwise "ends". NOTE: requests should have - // expects-response set to false, will always be set to that by kernel. - variant on-exit { - none, - restart, - requests(list>>), - } - - // Network errors come from trying to send a message to another node. - // A message can fail by timing out, or by the node being entirely - // unreachable (offline). In either case, the message is not delivered - // and the process that sent it receives that message along with any - // assigned context and/or lazy-load-blob, and is free to handle it as it - // sees fit. Note that if the message is a response, the process can - // issue a response again, and it will be directed to the same (remote) - // request as the original. - record send-error { - kind: send-error-kind, - message: message, - lazy-load-blob: option, - } - - enum send-error-kind { - offline, - timeout, - } - - enum spawn-error { - name-taken, - no-file-at-path, - // TODO more here? - } - - // - // System utils: - // - - print-to-terminal: func(verbosity: u8, message: string); - - // - // Process management: - // - - set-on-exit: func(on-exit: on-exit); - - get-on-exit: func() -> on-exit; - - get-state: func() -> option>; - - set-state: func(bytes: list); - - clear-state: func(); - - spawn: func( - name: option, - wasm-path: string, // must be located within package's drive - on-exit: on-exit, - request-capabilities: list, - // note that we are restricting granting to just messaging the - // newly spawned process - grant-capabilities: list, - public: bool - ) -> result; - - // - // Capabilities management: - // - - // Saves the capabilities to persisted process state. - save-capabilities: func(caps: list); - - // Deletes the capabilities from persisted process state. - drop-capabilities: func(caps: list); - - // Gets all capabilities from persisted process state. - our-capabilities: func() -> list; - - // - // Message I/O: - // - - // Ingest next message when it arrives along with its source. - // Almost all long-running processes will call this in a loop. - receive: func() -> - result, tuple>>; - - // Gets lazy-load-blob, if any, of the message we most recently received. - get-blob: func() -> option; - - // Send message(s) to target(s). - send-request: func( - target: address, - request: request, - context: option, - lazy-load-blob: option - ); - - send-requests: func( - requests: list, - option>> - ); - - send-response: func( - response: response, - lazy-load-blob: option - ); - - // Send a single request, then block (internally) until its response. The - // type returned is Message but will always contain Response. - send-and-await-response: func( - target: address, - request: request, - lazy-load-blob: option - ) -> result, send-error>; -} - -world lib { - import standard; -} - -world process { - include lib; - - export init: func(our: string); -} diff --git a/lccp/pkg/lccp.wasm b/lccp/pkg/lccp.wasm deleted file mode 100644 index c221d47..0000000 Binary files a/lccp/pkg/lccp.wasm and /dev/null differ diff --git a/lccp/pkg/manifest.json b/lccp/pkg/manifest.json deleted file mode 100644 index 5cd1036..0000000 --- a/lccp/pkg/manifest.json +++ /dev/null @@ -1,15 +0,0 @@ -[ - { - "process_name": "lccp", - "process_wasm_path": "/lccp.wasm", - "on_exit": "Restart", - "request_networking": true, - "request_capabilities": [ - "http_client:distro:sys" - ], - "grant_capabilities": [ - "http_client:distro:sys" - ], - "public": true - } -] diff --git a/lccp/pkg/scripts.json b/lccp/pkg/scripts.json deleted file mode 100644 index 6bcc456..0000000 --- a/lccp/pkg/scripts.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "lccp_tester.wasm": { - "root": false, - "public": false, - "request_networking": false, - "request_capabilities": [ - ], - "grant_capabilities": [ - "lccp:llm:kinode" - ] - } -} diff --git a/lccp/metadata.json b/metadata.json similarity index 53% rename from lccp/metadata.json rename to metadata.json index 6dbb697..a79a707 100644 --- a/lccp/metadata.json +++ b/metadata.json @@ -1,11 +1,11 @@ { - "name": "lccp", - "description": "", + "name": "OpenAI-API LLM Provider", + "description": "Expose a locally running LLM or use a remote one", "image": "", "properties": { - "package_name": "llm", + "package_name": "llm_provider", "current_version": "0.1.0", - "publisher": "kinode", + "publisher": "nick1udwig.os", "mirrors": [], "code_hashes": { "0.1.0": "" diff --git a/openai/Cargo.lock b/openai/Cargo.lock index 2cef475..86c7c98 100644 --- a/openai/Cargo.lock +++ b/openai/Cargo.lock @@ -1432,15 +1432,3 @@ dependencies = [ "serde_json", "unicode-xid", ] - -[[package]] -name = "worker" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "kinode_process_lib", - "serde", - "serde_json", - "wit-bindgen", -] diff --git a/openai/openai/Cargo.toml b/openai/Cargo.toml similarity index 78% rename from openai/openai/Cargo.toml rename to openai/Cargo.toml index f906325..584f39d 100644 --- a/openai/openai/Cargo.toml +++ b/openai/Cargo.toml @@ -6,12 +6,12 @@ edition = "2021" [dependencies] anyhow = "1.0" bincode = "1.3.3" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.6.0" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.6.1" } llm_interface = { git = "https://github.com/kinode-dao/llm/", branch = "hf/interface" } multipart = "0.18.0" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" -wit-bindgen = { git = "https://github.com/bytecodealliance/wit-bindgen", rev = "21a46c7" } +wit-bindgen = "0.24.0" [lib] crate-type = ["cdylib"] diff --git a/openai/metadata.json b/openai/metadata.json deleted file mode 100644 index efec521..0000000 --- a/openai/metadata.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "OpenAI LLM", - "description": "OpenAI LLM api beindings", - "image": "", - "properties": { - "package_name": "openai", - "current_version": "0.1.0", - "publisher": "appattacc.os", - "mirrors": [], - "code_hashes": { - "0.1.0": "" - } - }, - "external_url": "", - "animation_url": "" -} diff --git a/openai/openai/Cargo.lock b/openai/openai/Cargo.lock deleted file mode 100644 index 86c7c98..0000000 --- a/openai/openai/Cargo.lock +++ /dev/null @@ -1,1434 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "aho-corasick" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" -dependencies = [ - "memchr", -] - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anyhow" -version = "1.0.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" - -[[package]] -name = "ascii" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97be891acc47ca214468e09425d02cef3af2c94d0d82081cd02061f996802f14" - -[[package]] -name = "autocfg" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dde43e75fd43e8a1bf86103336bc699aa8d17ad1be60c76c0bdfd4828e19b78" -dependencies = [ - "autocfg 1.1.0", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "base64" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" -dependencies = [ - "byteorder", - "safemem", -] - -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "buf_redux" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b953a6887648bb07a535631f2bc00fbdb2a2216f135552cb3f534ed136b9c07f" -dependencies = [ - "memchr", - "safemem", -] - -[[package]] -name = "bumpalo" -version = "3.15.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea184aa71bb362a1157c896979544cc23974e08fd265f29ea96b59f0b4a555b" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "bytes" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" - -[[package]] -name = "cc" -version = "1.0.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3286b845d0fccbdd15af433f61c5970e711987036cb468f437ff6badd70f4e24" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chrono" -version = "0.4.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "js-sys", - "num-traits", - "wasm-bindgen", - "windows-targets", -] - -[[package]] -name = "chunked_transfer" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "498d20a7aaf62625b9bf26e637cf7736417cde1d0c99f1d04d1170229a85cf87" - -[[package]] -name = "cloudabi" -version = "0.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "interface" -version = "0.1.0" - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" -dependencies = [ - "libc", - "windows-sys", -] - -[[package]] -name = "fastrand" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "form_urlencoded" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" -dependencies = [ - "percent-encoding 2.3.1", -] - -[[package]] -name = "fuchsia-cprng" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" - -[[package]] -name = "getrandom" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" -dependencies = [ - "cfg-if", - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", -] - -[[package]] -name = "groupable" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32619942b8be646939eaf3db0602b39f5229b74575b67efc897811ded1db4e57" - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" - -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "hermit-abi" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd5256b483761cd23699d0da46cc6fd2ee3be420bbe6d020ae4a091e70b7e9fd" - -[[package]] -name = "http" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "httparse" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" - -[[package]] -name = "hyper" -version = "0.10.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a0652d9a2609a968c14be1a9ea00bf4b1d64e2e1f53a1b51b6fff3a6e829273" -dependencies = [ - "base64", - "httparse", - "language-tags", - "log 0.3.9", - "mime 0.2.6", - "num_cpus", - "time", - "traitobject", - "typeable", - "unicase 1.4.2", - "url 1.7.2", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "id-arena" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" - -[[package]] -name = "idna" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" -dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "idna" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "indexmap" -version = "2.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" -dependencies = [ - "equivalent", - "hashbrown", - "serde", -] - -[[package]] -name = "iron" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6d308ca2d884650a8bf9ed2ff4cb13fbb2207b71f64cda11dc9b892067295e8" -dependencies = [ - "hyper", - "log 0.3.9", - "mime_guess 1.8.8", - "modifier", - "num_cpus", - "plugin", - "typemap", - "url 1.7.2", -] - -[[package]] -name = "itoa" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" - -[[package]] -name = "js-sys" -version = "0.3.68" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "kinode_process_lib" -version = "0.5.9" -source = "git+https://github.com/kinode-dao/process_lib.git?tag=v0.5.9-alpha#5e705086bbd10fde89e11d3e3671f6a618a875a7" -dependencies = [ - "anyhow", - "bincode", - "http", - "mime_guess 2.0.4", - "rand 0.8.5", - "serde", - "serde_json", - "thiserror", - "url 2.5.0", - "wit-bindgen", -] - -[[package]] -name = "language-tags" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "leb128" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" - -[[package]] -name = "libc" -version = "0.2.153" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" - -[[package]] -name = "linux-raw-sys" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" - -[[package]] -name = "llm_process" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "interface", - "kinode_process_lib", - "multipart", - "serde", - "serde_json", - "wit-bindgen", -] - -[[package]] -name = "log" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" -dependencies = [ - "log 0.4.20", -] - -[[package]] -name = "log" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" - -[[package]] -name = "matches" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" - -[[package]] -name = "memchr" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" - -[[package]] -name = "mime" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" -dependencies = [ - "log 0.3.9", -] - -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "mime_guess" -version = "1.8.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216929a5ee4dd316b1702eedf5e74548c123d370f47841ceaac38ca154690ca3" -dependencies = [ - "mime 0.2.6", - "phf", - "phf_codegen", - "unicase 1.4.2", -] - -[[package]] -name = "mime_guess" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" -dependencies = [ - "mime 0.3.17", - "unicase 2.7.0", -] - -[[package]] -name = "modifier" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41f5c9112cb662acd3b204077e0de5bc66305fa8df65c8019d5adb10e9ab6e58" - -[[package]] -name = "multipart" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00dec633863867f29cb39df64a397cdf4a6354708ddd7759f70c7fb51c5f9182" -dependencies = [ - "buf_redux", - "httparse", - "hyper", - "iron", - "log 0.4.20", - "mime 0.3.17", - "mime_guess 2.0.4", - "nickel", - "quick-error", - "rand 0.8.5", - "safemem", - "tempfile", - "tiny_http", - "twoway", -] - -[[package]] -name = "mustache" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51956ef1c5d20a1384524d91e616fb44dfc7d8f249bf696d49c97dd3289ecab5" -dependencies = [ - "log 0.3.9", - "serde", -] - -[[package]] -name = "nickel" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5061a832728db2dacb61cefe0ce303b58f85764ec680e71d9138229640a46d9" -dependencies = [ - "groupable", - "hyper", - "lazy_static", - "log 0.3.9", - "modifier", - "mustache", - "plugin", - "regex", - "serde", - "serde_json", - "time", - "typemap", - "url 1.7.2", -] - -[[package]] -name = "num-traits" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" -dependencies = [ - "autocfg 1.1.0", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "percent-encoding" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" - -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "phf" -version = "0.7.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3da44b85f8e8dfaec21adae67f95d93244b2ecf6ad2a692320598dcc8e6dd18" -dependencies = [ - "phf_shared", -] - -[[package]] -name = "phf_codegen" -version = "0.7.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b03e85129e324ad4166b06b2c7491ae27fe3ec353af72e72cd1654c7225d517e" -dependencies = [ - "phf_generator", - "phf_shared", -] - -[[package]] -name = "phf_generator" -version = "0.7.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09364cc93c159b8b06b1f4dd8a4398984503483891b0c26b867cf431fb132662" -dependencies = [ - "phf_shared", - "rand 0.6.5", -] - -[[package]] -name = "phf_shared" -version = "0.7.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "234f71a15de2288bcb7e3b6515828d22af7ec8598ee6d24c3b526fa0a80b67a0" -dependencies = [ - "siphasher", - "unicase 1.4.2", -] - -[[package]] -name = "plugin" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a6a0dc3910bc8db877ffed8e457763b317cf880df4ae19109b9f77d277cf6e0" -dependencies = [ - "typemap", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" -dependencies = [ - "autocfg 0.1.8", - "libc", - "rand_chacha 0.1.1", - "rand_core 0.4.2", - "rand_hc", - "rand_isaac", - "rand_jitter", - "rand_os", - "rand_pcg", - "rand_xorshift", - "winapi", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_chacha" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" -dependencies = [ - "autocfg 0.1.8", - "rand_core 0.3.1", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_core" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" -dependencies = [ - "rand_core 0.4.2", -] - -[[package]] -name = "rand_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rand_hc" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rand_isaac" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rand_jitter" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" -dependencies = [ - "libc", - "rand_core 0.4.2", - "winapi", -] - -[[package]] -name = "rand_os" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" -dependencies = [ - "cloudabi", - "fuchsia-cprng", - "libc", - "rand_core 0.4.2", - "rdrand", - "winapi", -] - -[[package]] -name = "rand_pcg" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" -dependencies = [ - "autocfg 0.1.8", - "rand_core 0.4.2", -] - -[[package]] -name = "rand_xorshift" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rdrand" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "regex" -version = "1.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" - -[[package]] -name = "rustix" -version = "0.38.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" -dependencies = [ - "bitflags 2.4.2", - "errno", - "libc", - "linux-raw-sys", - "windows-sys", -] - -[[package]] -name = "ryu" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" - -[[package]] -name = "safemem" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" - -[[package]] -name = "semver" -version = "1.0.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" - -[[package]] -name = "serde" -version = "1.0.197" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.197" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.114" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "siphasher" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac" - -[[package]] -name = "smallvec" -version = "1.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" - -[[package]] -name = "spdx" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bde1398b09b9f93fc2fc9b9da86e362693e999d3a54a8ac47a99a5a73f638b" -dependencies = [ - "smallvec", -] - -[[package]] -name = "syn" -version = "2.0.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f1bdc9872430ce9b75da68329d1c1746faf50ffac5f19e02b71e37ff881ffb" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "tempfile" -version = "3.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" -dependencies = [ - "cfg-if", - "fastrand", - "rustix", - "windows-sys", -] - -[[package]] -name = "thiserror" -version = "1.0.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "time" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", -] - -[[package]] -name = "tiny_http" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e22cb179b63e5fc2d0b5be237dc107da072e2407809ac70a8ce85b93fe8f562" -dependencies = [ - "ascii", - "chrono", - "chunked_transfer", - "log 0.4.20", - "url 1.7.2", -] - -[[package]] -name = "tinyvec" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "traitobject" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" - -[[package]] -name = "twoway" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b11b2b5241ba34be09c3cc85a36e56e48f9888862e19cedf23336d35316ed1" -dependencies = [ - "memchr", -] - -[[package]] -name = "typeable" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" - -[[package]] -name = "typemap" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "653be63c80a3296da5551e1bfd2cca35227e13cdd08c6668903ae2f4f77aa1f6" -dependencies = [ - "unsafe-any", -] - -[[package]] -name = "unicase" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" -dependencies = [ - "version_check 0.1.5", -] - -[[package]] -name = "unicase" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check 0.9.4", -] - -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-normalization" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "unicode-xid" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" - -[[package]] -name = "unsafe-any" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30360d7979f5e9c6e6cea48af192ea8fab4afb3cf72597154b8f08935bc9c7f" -dependencies = [ - "traitobject", -] - -[[package]] -name = "url" -version = "1.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" -dependencies = [ - "idna 0.1.5", - "matches", - "percent-encoding 1.0.1", -] - -[[package]] -name = "url" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" -dependencies = [ - "form_urlencoded", - "idna 0.5.0", - "percent-encoding 2.3.1", -] - -[[package]] -name = "version_check" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.91" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.91" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" -dependencies = [ - "bumpalo", - "log 0.4.20", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.91" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.91" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.91" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" - -[[package]] -name = "wasm-encoder" -version = "0.38.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ad2b51884de9c7f4fe2fd1043fccb8dcad4b1e29558146ee57a144d15779f3f" -dependencies = [ - "leb128", -] - -[[package]] -name = "wasm-encoder" -version = "0.41.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "972f97a5d8318f908dded23594188a90bcd09365986b1163e66d70170e5287ae" -dependencies = [ - "leb128", -] - -[[package]] -name = "wasm-metadata" -version = "0.10.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18ebaa7bd0f9e7a5e5dd29b9a998acf21c4abed74265524dd7e85934597bfb10" -dependencies = [ - "anyhow", - "indexmap", - "serde", - "serde_derive", - "serde_json", - "spdx", - "wasm-encoder 0.41.2", - "wasmparser 0.121.2", -] - -[[package]] -name = "wasmparser" -version = "0.118.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77f1154f1ab868e2a01d9834a805faca7bf8b50d041b4ca714d005d0dab1c50c" -dependencies = [ - "indexmap", - "semver", -] - -[[package]] -name = "wasmparser" -version = "0.121.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dbe55c8f9d0dbd25d9447a5a889ff90c0cc3feaa7395310d3d826b2c703eaab" -dependencies = [ - "bitflags 2.4.2", - "indexmap", - "semver", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d380ba1dc7187569a8a9e91ed34b8ccfc33123bbacb8c0aed2d1ad7f3ef2dc5f" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68e5dcfb9413f53afd9c8f86e56a7b4d86d9a2fa26090ea2dc9e40fba56c6ec6" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dab469ebbc45798319e69eebf92308e541ce46760b49b18c6b3fe5e8965b30f" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a4e9b6a7cac734a8b4138a4e1044eac3404d8326b6c0f939276560687a033fb" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b0ec9c422ca95ff34a78755cfa6ad4a51371da2a5ace67500cf7ca5f232c58" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "704131571ba93e89d7cd43482277d6632589b18ecf4468f591fbae0a8b101614" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42079295511643151e98d61c38c0acc444e52dd42ab456f7ccfd5152e8ecf21c" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0770833d60a970638e989b3fa9fd2bb1aaadcf88963d1659fd7d9990196ed2d6" - -[[package]] -name = "wit-bindgen" -version = "0.16.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=efcc759#efcc7592cf3277bcb9be1034e48569c6d822b322" -dependencies = [ - "bitflags 2.4.2", - "wit-bindgen-rust-macro", -] - -[[package]] -name = "wit-bindgen-core" -version = "0.16.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=efcc759#efcc7592cf3277bcb9be1034e48569c6d822b322" -dependencies = [ - "anyhow", - "wit-component", - "wit-parser", -] - -[[package]] -name = "wit-bindgen-rust" -version = "0.16.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=efcc759#efcc7592cf3277bcb9be1034e48569c6d822b322" -dependencies = [ - "anyhow", - "heck", - "wasm-metadata", - "wit-bindgen-core", - "wit-component", -] - -[[package]] -name = "wit-bindgen-rust-macro" -version = "0.16.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=efcc759#efcc7592cf3277bcb9be1034e48569c6d822b322" -dependencies = [ - "anyhow", - "proc-macro2", - "quote", - "syn", - "wit-bindgen-core", - "wit-bindgen-rust", - "wit-component", -] - -[[package]] -name = "wit-component" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a35a2a9992898c9d27f1664001860595a4bc99d32dd3599d547412e17d7e2" -dependencies = [ - "anyhow", - "bitflags 2.4.2", - "indexmap", - "log 0.4.20", - "serde", - "serde_derive", - "serde_json", - "wasm-encoder 0.38.1", - "wasm-metadata", - "wasmparser 0.118.2", - "wit-parser", -] - -[[package]] -name = "wit-parser" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "316b36a9f0005f5aa4b03c39bc3728d045df136f8c13a73b7db4510dec725e08" -dependencies = [ - "anyhow", - "id-arena", - "indexmap", - "log 0.4.20", - "semver", - "serde", - "serde_derive", - "serde_json", - "unicode-xid", -] diff --git a/openai/openai/wasi_snapshot_preview1.wasm b/openai/openai/wasi_snapshot_preview1.wasm deleted file mode 100644 index e2a3f4d..0000000 Binary files a/openai/openai/wasi_snapshot_preview1.wasm and /dev/null differ diff --git a/openai/openai/wit/kinode.wit b/openai/openai/wit/kinode.wit deleted file mode 100644 index caef605..0000000 --- a/openai/openai/wit/kinode.wit +++ /dev/null @@ -1,198 +0,0 @@ -package kinode:process@0.7.0; - -interface standard { - // - // System types: - // - - // JSON is passed over WASM boundary as a string. - type json = string; - - type node-id = string; - - // Context, like a message body, is a protocol-defined serialized byte - // array. It is used when building a Request to save information that - // will not be part of a Response, in order to more easily handle - // ("contextualize") that Response. - type context = list; - - record process-id { - process-name: string, - package-name: string, - publisher-node: node-id, - } - - record address { - node: node-id, - process: process-id, - } - - record lazy-load-blob { - mime: option, - bytes: list, - } - - record request { - // set in order to inherit lazy-load-blob from parent message, and if - // expects-response is none, direct response to source of parent. - // also carries forward certain aspects of parent message in kernel, - // see documentation for formal spec and examples. - inherit: bool, - // if some, request expects a response in the given number of seconds - expects-response: option, - body: list, - metadata: option, - capabilities: list, - // to grab lazy-load-blob, use get_blob() - } - - record response { - inherit: bool, - body: list, - metadata: option, - capabilities: list, - // to grab lazy-load-blob, use get_blob() - } - - // A message can be a request or a response. within a response, there is - // a result which surfaces any error that happened because of a request. - // A successful response will contain the context of the request it - // matches, if any was set. - variant message { - request(request), - response(tuple>), - } - - record capability { - issuer: address, - params: json, - } - - // On-exit is a setting that determines what happens when a process - // panics, completes, or otherwise "ends". NOTE: requests should have - // expects-response set to false, will always be set to that by kernel. - variant on-exit { - none, - restart, - requests(list>>), - } - - // Network errors come from trying to send a message to another node. - // A message can fail by timing out, or by the node being entirely - // unreachable (offline). In either case, the message is not delivered - // and the process that sent it receives that message along with any - // assigned context and/or lazy-load-blob, and is free to handle it as it - // sees fit. Note that if the message is a response, the process can - // issue a response again, and it will be directed to the same (remote) - // request as the original. - record send-error { - kind: send-error-kind, - message: message, - lazy-load-blob: option, - } - - enum send-error-kind { - offline, - timeout, - } - - enum spawn-error { - name-taken, - no-file-at-path, - // TODO more here? - } - - // - // System utils: - // - - print-to-terminal: func(verbosity: u8, message: string); - - // - // Process management: - // - - set-on-exit: func(on-exit: on-exit); - - get-on-exit: func() -> on-exit; - - get-state: func() -> option>; - - set-state: func(bytes: list); - - clear-state: func(); - - spawn: func( - name: option, - wasm-path: string, // must be located within package's drive - on-exit: on-exit, - request-capabilities: list, - // note that we are restricting granting to just messaging the - // newly spawned process - grant-capabilities: list, - public: bool - ) -> result; - - // - // Capabilities management: - // - - // Saves the capabilities to persisted process state. - save-capabilities: func(caps: list); - - // Deletes the capabilities from persisted process state. - drop-capabilities: func(caps: list); - - // Gets all capabilities from persisted process state. - our-capabilities: func() -> list; - - // - // Message I/O: - // - - // Ingest next message when it arrives along with its source. - // Almost all long-running processes will call this in a loop. - receive: func() -> - result, tuple>>; - - // Gets lazy-load-blob, if any, of the message we most recently received. - get-blob: func() -> option; - - // Send message(s) to target(s). - send-request: func( - target: address, - request: request, - context: option, - lazy-load-blob: option - ); - - send-requests: func( - requests: list, - option>> - ); - - send-response: func( - response: response, - lazy-load-blob: option - ); - - // Send a single request, then block (internally) until its response. The - // type returned is Message but will always contain Response. - send-and-await-response: func( - target: address, - request: request, - lazy-load-blob: option - ) -> result, send-error>; -} - -world lib { - import standard; -} - -world process { - include lib; - - export init: func(our: string); -} diff --git a/openai/pkg/scripts.json b/openai/pkg/scripts.json deleted file mode 100644 index da4ecb8..0000000 --- a/openai/pkg/scripts.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "openai_tester.wasm": { - "root": false, - "public": false, - "request_networking": false, - "request_capabilities": [ - ], - "grant_capabilities": [ - "openai:llm:kinode" - ] - } -} diff --git a/openai/openai/src/helpers.rs b/openai/src/helpers.rs similarity index 100% rename from openai/openai/src/helpers.rs rename to openai/src/helpers.rs diff --git a/openai/openai/src/lib.rs b/openai/src/lib.rs similarity index 99% rename from openai/openai/src/lib.rs rename to openai/src/lib.rs index 5d1a86a..88ee2cb 100644 --- a/openai/openai/src/lib.rs +++ b/openai/src/lib.rs @@ -22,11 +22,8 @@ const DEFAULT_TIMEOUT_SECONDS: u16 = 30; const OAI_PROVIDER_TIMEOUT_SECONDS: u16 = 60; wit_bindgen::generate!({ - path: "wit", + path: "target/wit", world: "process", - exports: { - world: Component, - }, }); fn handle_response(context: &[u8]) -> anyhow::Result<()> { diff --git a/openai/openai/src/structs.rs b/openai/src/structs.rs similarity index 100% rename from openai/openai/src/structs.rs rename to openai/src/structs.rs diff --git a/openai/pkg/manifest.json b/pkg/manifest.json similarity index 54% rename from openai/pkg/manifest.json rename to pkg/manifest.json index 7ec9191..6088ed3 100644 --- a/openai/pkg/manifest.json +++ b/pkg/manifest.json @@ -2,8 +2,8 @@ { "process_name": "openai", "process_wasm_path": "/openai.wasm", - "on_exit": "None", - "request_networking": true, + "on_exit": "Restart", + "request_networking": false, "request_capabilities": [ "http_client:distro:sys", "http_server:distro:sys" @@ -13,5 +13,16 @@ "http_server:distro:sys" ], "public": true + }, + { + "process_name": "driver", + "process_wasm_path": "/driver.wasm", + "on_exit": "Restart", + "request_networking": true, + "request_capabilities": [ + "http_server:distro:sys" + ], + "grant_capabilities": [], + "public": true } ] diff --git a/pkg/scripts.json b/pkg/scripts.json new file mode 100644 index 0000000..5034659 --- /dev/null +++ b/pkg/scripts.json @@ -0,0 +1,26 @@ +{ + "admin.wasm": { + "root": false, + "public": false, + "request_networking": true, + "request_capabilities": [ + "driver:llm_provider:nick1udwig.os", + "vfs:distro:sys" + ], + "grant_capabilities": [ + "driver:llm_provider:nick1udwig.os", + "vfs:distro:sys" + ] + }, + "run_job.wasm": { + "root": false, + "public": false, + "request_networking": false, + "request_capabilities": [ + "driver:llm_provider:nick1udwig.os" + ], + "grant_capabilities": [ + "driver:llm_provider:nick1udwig.os" + ] + } +} diff --git a/lccp/lccp/Cargo.toml b/router/Cargo.toml similarity index 57% rename from lccp/lccp/Cargo.toml rename to router/Cargo.toml index 0ee0e48..1dc5584 100644 --- a/lccp/lccp/Cargo.toml +++ b/router/Cargo.toml @@ -1,17 +1,18 @@ [package] -name = "lccp" +name = "router" version = "0.1.0" edition = "2021" [dependencies] anyhow = "1.0" bincode = "1.3.3" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.6.0" } -multipart = "0.18.0" +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.6.1" } +process_macros = { git = "https://github.com/kinode-dao/process_macros", rev = "626e501" } +rand = "0.8" +rand_pcg = { version = "0.3", features = ["serde1"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" -wit-bindgen = { git = "https://github.com/bytecodealliance/wit-bindgen", rev = "21a46c7" } -llm_interface = { git = "https://github.com/kinode-dao/llm/", branch = "interface" } +wit-bindgen = "0.24.0" [lib] crate-type = ["cdylib"] diff --git a/router/src/lib.rs b/router/src/lib.rs new file mode 100644 index 0000000..439e673 --- /dev/null +++ b/router/src/lib.rs @@ -0,0 +1,429 @@ +use std::collections::{HashMap, VecDeque}; + +use rand::{Rng, SeedableRng, prelude::SliceRandom}; +use rand_pcg::Pcg64; + +use crate::kinode::process::router::{ + ClientRequest, ClientResponse, + DriverRequest, DriverResponse, + RouterRequest, RouterResponse, + ToClientRequest, ToClientResponse, + RunJobRequestParams, + JobUpdateRequestParams, + //JobUpdateRequestBlob, +}; +use kinode_process_lib::{await_message, call_init, get_typed_state, println, set_state, Address, ProcessId, Request, Response}; + + +const DEFAULT_DRIVER_PROCESS_ID: &str = "driver:llm_provider:nick1udwig.os"; +const DEFAULT_QUEUE_RESPONSE_TIMEOUT_SECONDS: u8 = 5; +const DEFAULT_SERVE_TIMEOUT_SECONDS: u16 = 60; + +wit_bindgen::generate!({ + path: "target/wit", + world: "llm-provider-nick1udwig-dot-os-v0", + generate_unused_types: true, + additional_derives: [serde::Deserialize, serde::Serialize, process_macros::SerdeJsonInto], +}); + +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, process_macros::SerdeJsonInto)] +#[serde(untagged)] +enum Req { + ClientRequest(ClientRequest), + DriverRequest(DriverRequest), + ToClientRequest(ToClientRequest), +} + +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, process_macros::SerdeJsonInto)] +#[serde(untagged)] +enum Res { + RouterResponse(RouterResponse), + ToClientResponse(ToClientResponse), +} + +#[derive(Debug, serde::Serialize, serde::Deserialize, process_macros::SerdeJsonInto)] +struct State { + driver_process_id: Option, + available_drivers: HashMap, // driver node to model + outstanding_jobs: HashMap, + job_queue: VecDeque<(Address, u64, RunJobRequestParams)>, + job_queries: HashMap, + rng: Pcg64, + pub queue_response_timeout_seconds: u8, + pub serve_timeout_seconds: u16, // TODO +} + +#[derive(Debug, serde::Serialize, serde::Deserialize, process_macros::SerdeJsonInto)] +struct JobQuery { + job: RunJobRequestParams, + num_rejections: u32, + num_queried: u32, +} + +impl Default for State { + fn default() -> Self { + Self { + driver_process_id: None, + available_drivers: HashMap::new(), + outstanding_jobs: HashMap::new(), + job_queue: VecDeque::new(), + job_queries: HashMap::new(), + rng: Pcg64::from_entropy(), + queue_response_timeout_seconds: DEFAULT_QUEUE_RESPONSE_TIMEOUT_SECONDS, + serve_timeout_seconds: DEFAULT_SERVE_TIMEOUT_SECONDS, + } + } +} + +impl State { + fn save(&self) -> anyhow::Result<()> { + set_state(&serde_json::to_vec(self)?); + Ok(()) + } + + fn load() -> Self { + get_typed_state(|bytes| Ok(bytes.try_into()?)) + .unwrap_or_default() + } +} + +fn permute(mut vec: Vec, rng: &mut Pcg64) -> Vec { + vec.shuffle(rng); + vec +} + +fn serve_job( + driver: &Address, + job_source: &Address, + job_id: u64, + job: RunJobRequestParams, + state: &mut State, +) -> anyhow::Result<()> { + state.outstanding_jobs.insert( + driver.node().to_string(), + (job_source.clone(), job_id.clone()), + ); + Request::to(driver) + .body(RouterRequest::RunJob((job_id, job))) + .inherit(true) + .expects_response(5) // TODO + .send()?; + state.save()?; + Ok(()) +} + +//fn handle_admin_request( +// our: &Address, +// message: &Message, +// state: &mut State, +//) -> anyhow::Result<()> { +// let source = message.source(); +// if source.node() != our.node() { +// return Err(anyhow::anyhow!("only our can make AdminRequests; rejecting from {source:?}")); +// } +// match serde_json::from_slice(message.body())? { +// AdminRequest::SetProviderProcess { process_id } => { +// let process_id = process_id.parse()?; +// state.provider_process = Some(process_id); +// state.save()?; +// Response::new() +// .body(serde_json::to_vec(&AdminResponse::SetProviderProcess { err: None })?) +// .send()?; +// } +// AdminRequest::SetRollupSequencer { address } => { +// let address = address.parse()?; +// state.rollup_sequencer = Some(address); +// await_chain_state(state)?; +// Response::new() +// .body(serde_json::to_vec(&AdminResponse::SetRollupSequencer { err: None })?) +// .send()?; +// } +// AdminRequest::SetContractAddress { address } => { +// state.contract_address = address; +// Response::new() +// .body(serde_json::to_vec(&AdminResponse::SetContractAddress { err: None })?) +// .send()?; +// } +// AdminRequest::CreateDao => { +// // TODO: +// // this belong on the FE, along with all other DAO-changing requests +// // so we can take advantage of already-existing wallet software +// //init_eth(our, eth_provider, filter, state).unwrap(); +// //Response::new() +// // .body(serde_json::to_vec(&AdminResponse::CreateDao { err: None })?) +// // .send()?; +// } +// AdminRequest::SetDaoId { dao_id } => { +// state.dao_id = dao_id; +// init_eth(our, eth_provider, filter, state).unwrap(); +// Response::new() +// .body(serde_json::to_vec(&AdminResponse::SetDaoId { err: None })?) +// .send()?; +// } +// } +// Ok(()) +//} + +fn handle_client_request( + _our: &Address, + source: &Address, + client_request: &ClientRequest, + state: &mut State, +) -> anyhow::Result<()> { + match client_request { + ClientRequest::RunJob(job) => { + let job_id: u64 = state.rng.gen(); + Response::new() + .body(ClientResponse::RunJob(Ok(job_id.clone()))) + .send()?; + // TODO: discriminate based on model here and in + // DriverRequest::SetIsAvailable, below + // let num_hosting_model: Vec<(String, String)> = state.available_drivers + // .iter() + // .filter_map(|(node, model)| { + // if &job.model != model { + // None + // } else { + // Some((node.clone(), model.clone())) + // } + // }) + // .collect(); + let num_hosting_model: Vec<(String, String)> = state.available_drivers + .iter() + .map(|(n, m)| (n.clone(), m.clone())) + .collect(); + if num_hosting_model.is_empty() { + // no available drivers -> add to queue + state.job_queue.push_back((source.clone(), job_id, job.clone())); + println!("new job added to queue; now have {} queued", state.job_queue.len()); + state.save()?; + return Ok(()); + } + // permute available drivers & flood all with query if ready; + // first gets job; if none ready, queue + // TODO: improve algo + let process_id: ProcessId = state.driver_process_id + .clone() + .unwrap_or_else(|| DEFAULT_DRIVER_PROCESS_ID.parse().unwrap()); + state.job_queries.insert(job_id, JobQuery { + job: job.clone(), + num_rejections: 0, + num_queried: num_hosting_model.len() as u32, + }); + for (member, _model) in permute(num_hosting_model, &mut state.rng) { + // if job.model != model { + // continue; + // } + let address = Address::new(member.clone(), process_id.clone()); + Request::to(address.clone()) + .body(RouterRequest::QueryReady) + .context(serde_json::to_vec(&(source.clone(), job_id))?) + .expects_response(state.queue_response_timeout_seconds as u64) + .send()?; + } + } + } + Ok(()) +} + +fn handle_driver_request( + _our: &Address, + source: &Address, + driver_request: &DriverRequest, + state: &mut State, +) -> anyhow::Result<()> { + match driver_request { + DriverRequest::SetIsAvailable((is_available, model_name)) => { + if !is_available { + state.available_drivers.remove(source.node()); + state.save()?; + } else { + if !state.job_queue.is_empty() { + let (job_source, job_id, job) = state.job_queue.pop_front().unwrap(); + serve_job(source, &job_source, job_id, job, state)?; + } else { + state.available_drivers.insert(source.node().to_string(), model_name.clone()); + state.save()?; + } + } + Response::new() + .body(DriverResponse::SetIsAvailable) + .send()?; + } + } + Ok(()) +} + +fn handle_to_client_request( + source: &Address, + to_client_request: &ToClientRequest, + state: &mut State, +) -> anyhow::Result<()> { + match to_client_request { + ToClientRequest::JobUpdate(JobUpdateRequestParams { ref job_id, ref is_final, .. }) => { + let Some((job_source, expected_job_id)) = state.outstanding_jobs.get(source.node()) else { + return Err(anyhow::anyhow!("provider sent back {job_id} but no record here")); + }; + if job_id != expected_job_id { + println!("job_id != expected_job_id: this should never occur! provider gave us wrong job back"); + } + Request::to(job_source) + .body(to_client_request) + .inherit(true) + .send()?; + // TODO: log sigs + if is_final == &true { + state.outstanding_jobs.remove(source.node()); + state.save()?; + } + Response::new() + .body(ToClientResponse::JobUpdate) + .send()?; + } + } + Ok(()) +} + +fn handle_router_response( + _our: &Address, + source: &Address, + context: &[u8], + router_response: &RouterResponse, + state: &mut State, +) -> anyhow::Result<()> { + match router_response { + RouterResponse::RunJob(_result) => { + // TODO: pass on errors to client? + } + RouterResponse::QueryReady(is_ready) => { + // compare to handle_message() send_err case + let (job_source, job_id): (Address, u64) = serde_json::from_slice(context)?; + // message.context().unwrap_or_default() + //)?; + let Some(mut job_query) = state.job_queries.remove(&job_id) else { + // TODO: readd JobTaken again? + //Request::to(message.source()) + // .body(serde_json::to_vec(&MemberRequest::JobTaken { job_id })?) + // .send()?; + //state.save()?; + println!("{source} didnt find job_query for {job_id}"); + return Ok(()); + }; + if !is_ready { + // TODO: reprimand fake ready member? + println!("{source} not ready"); + job_query.num_rejections += 1; + if job_query.num_rejections >= job_query.num_queried { + // no one available to serve job + // TODO: add stat trackers so we can expose endpoints: + // * how long queue is + // * average time / job + // -> expected time till result + state.job_queue.push_back((job_source, job_id.clone(), job_query.job)); + println!("no ready providers; now have {} queued", state.job_queue.len()); + state.save()?; + return Ok(()); + } + state.job_queries.insert(job_id, job_query); + state.save()?; + return Ok(()); + } + println!("{source} accepts job"); + serve_job(source, &job_source, job_id, job_query.job, state)?; + } + } + Ok(()) +} + +fn handle_to_client_response( + to_client_response: &ToClientResponse, +) -> anyhow::Result<()> { + match to_client_response { + ToClientResponse::JobUpdate => {} + } + Ok(()) +} + +fn handle_message( + our: &Address, + state: &mut State, +) -> anyhow::Result<()> { + let message = match await_message() { + Ok(m) => m, + Err(send_err) => { + //println!("SendError\nkind: {:?}\nbody: {:?}", send_err.kind(), serde_json::from_slice::(send_err.message().body())); + // compare to handle_member_response() MemberResponse::QueryReady case + let (source, job_id): (Address, u64) = serde_json::from_slice( + send_err.context().unwrap_or_default() + )?; + let Some(mut job_query) = state.job_queries.remove(&job_id) else { + // provider is offline, so don't inform them + return Ok(()); + }; + job_query.num_rejections += 1; + if job_query.num_rejections >= job_query.num_queried { + // no one available to serve job + // TODO: add stat trackers so we can expose endpoints: + // * how long queue is + // * average time / job + // -> expected time till result + state.job_queue.push_back((source, job_id, job_query.job)); + println!("no ready drivers; now have {} queued", state.job_queue.len()); + state.save()?; + return Ok(()); + } + state.job_queries.insert(job_id, job_query); + state.save()?; + return Ok(()); + } + }; + + if message.is_request() { + return match message.body().try_into()? { + Req::ClientRequest(ref client_request) => handle_client_request( + our, + message.source(), + client_request, + state, + ), + Req::DriverRequest(ref driver_request) => handle_driver_request( + our, + message.source(), + driver_request, + state, + ), + Req::ToClientRequest(ref to_client_request) => handle_to_client_request( + message.source(), + to_client_request, + state, + ), + }; + } + + match message.body().try_into()? { + Res::RouterResponse(ref router_response) => handle_router_response( + our, + message.source(), + message.context().unwrap_or_default(), + router_response, + state, + ), + Res::ToClientResponse(ref to_client_response) => handle_to_client_response( + to_client_response, + ), + } +} + +call_init!(init); +fn init(our: Address) { + println!("{}: begin", our.process()); + + let mut state = State::load(); + + loop { + match handle_message(&our, &mut state) { + Ok(()) => {}, + Err(e) => println!("{}: error: {:?}", our.process(), e), + }; + } +} diff --git a/run_job/Cargo.toml b/run_job/Cargo.toml new file mode 100644 index 0000000..a6558a7 --- /dev/null +++ b/run_job/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "run_job" +version = "0.1.0" +edition = "2021" + +[dependencies] +anyhow = "1.0" +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.6.1" } +process_macros = { git = "https://github.com/kinode-dao/process_macros", rev = "626e501" } +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +wit-bindgen = "0.24.0" + +[lib] +crate-type = ["cdylib"] + +[package.metadata.component] +package = "kinode:process" diff --git a/run_job/src/lib.rs b/run_job/src/lib.rs new file mode 100644 index 0000000..7e0e1d7 --- /dev/null +++ b/run_job/src/lib.rs @@ -0,0 +1,61 @@ +use crate::kinode::process::driver::{ClientRequest, ClientResponse, RunJobRequestParams, ToClientRequest}; +use kinode_process_lib::{ + await_next_message_body, call_init, get_blob, println, Address, Request, +}; + +wit_bindgen::generate!({ + path: "target/wit", + world: "llm-provider-nick1udwig-dot-os-v0", + generate_unused_types: true, + additional_derives: [serde::Deserialize, serde::Serialize, process_macros::SerdeJsonInto], +}); + +const PUBLISHER: &str = "nick1udwig.os"; +const SCRIPT_NAME: &str = "run_job"; + +call_init!(init); +fn init(our: Address) { + let Ok(body) = await_next_message_body() else { + println!("failed to get args!"); + return; + }; + let package_name = our.package(); + let body = String::from_utf8(body).unwrap_or_default(); + let Some((model, prompt)) = body.split_once(' ') else { + println!("usage:\n{SCRIPT_NAME}:{package_name}:{PUBLISHER} model prompt\ne.g.\n{SCRIPT_NAME}:{package_name}:{PUBLISHER} default How much wood could a woodchuck chuck? Be concise."); + return; + }; + + let driver_process: Address = format!("our@driver:{}", our.package_id()).parse().unwrap(); + let job = RunJobRequestParams { + model: model.into(), + prompt: prompt.into(), + seed: None, + }; + let result = Request::to(driver_process) + .body(ClientRequest::RunJob(job)) + .send_and_await_response(5); + let Ok(Ok(result)) = result else { + println!("got error getting Response: {result:?}"); + return; + }; + let Ok(ClientResponse::RunJob(Ok(_))) = result.body().try_into() else { + println!("got error parsing Response: {result:?}"); + return; + }; + + let Ok(body) = await_next_message_body() else { + println!("failed to get result"); + return; + }; + let Ok(ToClientRequest::JobUpdate(_job_update)) = body.try_into() else { + println!("unexpected message: not JobUpdate"); + return; + }; + + let job_result = get_blob().unwrap_or_default().bytes; + let job_result = String::from_utf8(job_result).unwrap_or_default(); + println!("{job_result}"); + + return; +}