diff --git a/.gitmodules b/.gitmodules index de7101c..5a9bf41 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "vendor/cultcache-py"] path = vendor/cultcache-py url = https://github.com/GameCult/cultcache-py.git +[submodule "vendor/eve"] + path = vendor/eve + url = https://github.com/GameCult/Eve.git diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..90afb4f --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,2180 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "aho-corasick" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba" +dependencies = [ + "memchr", +] + +[[package]] +name = "android_system_properties" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae221649c9976a6f6c56ae1facf410f3ddb33cc661c4b7b61020a912d4237fbc" +dependencies = [ + "libc", +] + +[[package]] +name = "anyhow" +version = "1.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" + +[[package]] +name = "async-trait" +version = "0.1.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82f6aeea286b8eb4dd3431a1be1b59d290ace00f5bfd8e2a159bc2a05e2c1667" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.3", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" + +[[package]] +name = "axum" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31b698c5f9a010f6573133b09e0de5408834d0c82f8d7475a89fc1867a71cd90" +dependencies = [ + "axum-core", + "axum-macros", + "bytes", + "form_urlencoded", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "serde_core", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum-core" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08c78f31d7b1291f7ee735c1c6780ccde7785daae9a9206026862dab7d8792d1" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "http-body-util", + "mime", + "pin-project-lite", + "sync_wrapper", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum-macros" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7aa268c23bfbbd2c4363b9cd302a4f504fb2a9dfe7e3451d66f35dd392e20aca" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bitflags" +version = "2.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bumpalo" +version = "3.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" + +[[package]] +name = "bytes" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" + +[[package]] +name = "cc" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "509591b7bcd67f4ef775afad7662703b4935daaa6ec0e5605cfb1090b32a2b6d" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "cfg_aliases" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527" + +[[package]] +name = "chacha20" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d524456ba66e72eb8b115ff89e01e497f8e6d11d78b70b1aa13c0fbd97540a81" +dependencies = [ + "cfg-if", + "cpufeatures 0.3.0", + "rand_core 0.10.1", +] + +[[package]] +name = "chrono" +version = "0.4.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327" +dependencies = [ + "iana-time-zone", + "js-sys", + "num-traits", + "serde", + "wasm-bindgen", + "windows-link", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "cpufeatures" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "cultcache-rs" +version = "0.1.0" +source = "git+https://github.com/GameCult/cultcache-rs.git?rev=0ba87453115e3d44e8fcb7419866cd7dd70fb096#0ba87453115e3d44e8fcb7419866cd7dd70fb096" +dependencies = [ + "anyhow", + "chrono", + "cultcache-rs-derive", + "fs2", + "redb", + "rmp-serde", + "serde", + "serde_bytes", + "serde_json", + "uuid", + "windows-sys 0.59.0", +] + +[[package]] +name = "cultcache-rs-derive" +version = "0.1.0" +source = "git+https://github.com/GameCult/cultcache-rs.git?rev=0ba87453115e3d44e8fcb7419866cd7dd70fb096#0ba87453115e3d44e8fcb7419866cd7dd70fb096" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "displaydoc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.3", +] + +[[package]] +name = "dyn-clone" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "fastrand" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223" + +[[package]] +name = "find-msvc-tools" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d45db016d36b838f563236e9193d0ee6ce38f3f68b6c94e914b4929c96bbb890" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fs2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "futures-channel" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e" + +[[package]] +name = "futures-io" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed" + +[[package]] +name = "futures-macro" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.3", +] + +[[package]] +name = "futures-sink" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d" + +[[package]] +name = "futures-task" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd" + +[[package]] +name = "futures-util" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc" +dependencies = [ + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "libc", + "r-efi 5.3.0", + "wasip2", +] + +[[package]] +name = "getrandom" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "r-efi 6.0.0", + "rand_core 0.10.1", + "wasm-bindgen", +] + +[[package]] +name = "ghostlight-dungeon" +version = "0.1.0" +dependencies = [ + "anyhow", + "async-trait", + "axum", + "chrono", + "cultcache-rs", + "rand 0.9.5", + "reqwest", + "rmp-serde", + "schemars", + "serde", + "serde_json", + "sha2", + "tempfile", + "thiserror", + "tokio", + "tower-http", + "tracing", + "tracing-subscriber", + "uuid", +] + +[[package]] +name = "http" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0" +dependencies = [ + "bytes", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2a8f2913ee65f60facd6a5905613afaa448497a0230cc41ce022d93290bc2c" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23169fe34a5fbcdd3f3862e78fb9b6fccd5f02a6dc6f732547005d45631ce71c" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "http-range-header" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9171a2ea8a68358193d15dd5d70c1c10a2afc3e7e4c5bc92bc9f025cebd7359c" + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d22053281f852e11534f5198498373cbb59295120a20771d90f7ed1897490a72" +dependencies = [ + "atomic-waker", + "bytes", + "futures-channel", + "futures-core", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ca68d021ef39cf6463ab54c1d0f5daf03377b70561305bb89a8f83aab66e0f" +dependencies = [ + "http", + "hyper", + "hyper-util", + "rustls", + "tokio", + "tokio-rustls", + "tower-service", + "webpki-roots", +] + +[[package]] +name = "hyper-util" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" +dependencies = [ + "base64", + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "ipnet", + "libc", + "percent-encoding", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "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 = "icu_collections" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa68d21081c4a05d5a901a1c62add574c77048b6a1c67be3b50ce0b60d4ca513" +dependencies = [ + "displaydoc", + "potential_utf", + "utf8_iter", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d56e28588da92eee5c3201a6eff33fabdd49b62269c8938d4ff050ce4d900deb" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f9cf5f235641ed274641dd81c3f28d870e276763d0797aeeab72317b1c646f" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1563da1ed3e0b3bf3d74c9b85917ac9c56464d2f57242270c09c9e752f8021a0" + +[[package]] +name = "icu_properties" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e7ca276ad3145661a65914e6daf131ca5120cd3dcee8f8f3214b8875184a148" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e590f038c1464a96894fd6d10127e90a8be4509f56ff7ecef851b15cee0b7caa" + +[[package]] +name = "icu_provider" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92a7ed671a6aad807a8651a2e1782a6598fda9ce5185dd8158549e95a91c6428" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "ipnet" +version = "2.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a756c3fac73139e83f14c2d742155dd2b78d3ee56597b419a0579b7bdd6dd78" + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "js-sys" +version = "0.3.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e0c1080212aad755ea003d18543e8768dd432c48819efd73a7bf1e39b7a5a3a" +dependencies = [ + "cfg-if", + "futures-util", + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.189" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" + +[[package]] +name = "linux-raw-sys" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" + +[[package]] +name = "litemap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" + +[[package]] +name = "lru-slab" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" + +[[package]] +name = "matchers" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "matchit" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" + +[[package]] +name = "memchr" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "mio" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30d65c71f1ce40ab09135ce117d742b9f8a19ff91a41a8b57ed50bc2de59c427" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.61.2", +] + +[[package]] +name = "nu-ansi-term" +version = "0.50.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "potential_utf" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d83eb9bc6d8e5cf568e7a1101d60ee05e81ed50ea106026f3d18deeb046d7661" +dependencies = [ + "zerovec", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "proc-macro2" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quinn" +version = "0.11.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c1a41e437b6bbd489372cd4971de128e85c855f56c57f283d20ff016cf7c0a8" +dependencies = [ + "bytes", + "cfg_aliases", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-proto" +version = "0.11.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f4bfc015262b9df63c8845072ce59068853ff5872180c2ce2f13038b970e560" +dependencies = [ + "bytes", + "getrandom 0.4.3", + "lru-slab", + "rand 0.10.2", + "rand_pcg", + "ring", + "rustc-hash", + "rustls", + "rustls-pki-types", + "slab", + "thiserror", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-udp" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35a133f956daabe89a61a685c2649f13d82d5aa4bd5d12d1277e1072a21c0694" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.61.2", +] + +[[package]] +name = "quote" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "rand" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ef1d0d795eb7d84685bca4f72f3649f064e6641543d3a8c415898726a57b41" +dependencies = [ + "rand_chacha", + "rand_core 0.9.5", +] + +[[package]] +name = "rand" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7f5fa3a058cd35567ef9bfa5e75732bee0f9e4c55fa90477bef2dfcdbc4be80" +dependencies = [ + "chacha20", + "getrandom 0.4.3", + "rand_core 0.10.1", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.5", +] + +[[package]] +name = "rand_core" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" +dependencies = [ + "getrandom 0.3.4", +] + +[[package]] +name = "rand_core" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" + +[[package]] +name = "rand_pcg" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caa0f4137e1c0a72f4c651489402276c8e8e1cf081f3b0ba156d2cbeef09e86a" +dependencies = [ + "rand_core 0.10.1", +] + +[[package]] +name = "redb" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e925444704b5f17d32bf42f5b6e2df050bceebc3dcd6e71cc73dafe8092e839" +dependencies = [ + "libc", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags", +] + +[[package]] +name = "ref-cast" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "216e8f773d7923bcba9ceb86a86c93cabb3903a11872fc3f138c49630e50b96d" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9283685feec7d69af75fb0e858d5e7378f33fe4fc699383b2916ab9273e03c" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.3", +] + +[[package]] +name = "regex-automata" +version = "0.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" + +[[package]] +name = "reqwest" +version = "0.12.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" +dependencies = [ + "base64", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-util", + "js-sys", + "log", + "percent-encoding", + "pin-project-lite", + "quinn", + "rustls", + "rustls-pki-types", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tokio-rustls", + "tokio-util", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", + "webpki-roots", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.17", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rmp" +version = "0.8.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ba8be72d372b2c9b35542551678538b562e7cf86c3315773cae48dfbfe7790c" +dependencies = [ + "num-traits", +] + +[[package]] +name = "rmp-serde" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72f81bee8c8ef9b577d1681a70ebbc962c232461e397b22c208c43c04b67a155" +dependencies = [ + "rmp", + "serde", +] + +[[package]] +name = "rustc-hash" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d" + +[[package]] +name = "rustix" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls" +version = "0.23.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0283386ce02abc0151e1761d08802dfe86c173b0b494af5cbc086574e453da06" +dependencies = [ + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pki-types" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f4925028c7eb5d1fcdaf196971378ed9d2c1c4efc7dc5d011256f76c99c0a96" +dependencies = [ + "web-time", + "zeroize", +] + +[[package]] +name = "rustls-webpki" +version = "0.103.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0527518605e68109d875e248ea259b6758801cf165e4b2c2733ae3b51f12535a" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" + +[[package]] +name = "ryu" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" + +[[package]] +name = "schemars" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "687274d293b6cdc6e73e0fee520bf2049650090d7164f87672d212a3c530cf4a" +dependencies = [ + "chrono", + "dyn-clone", + "ref-cast", + "schemars_derive", + "serde", + "serde_json", + "uuid", +] + +[[package]] +name = "schemars_derive" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d98c67716b46af2f0b8cf752abc930f6f9aecfbf671ecfb531db8a31dbe4e2ba" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 3.0.3", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "serde" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_bytes" +version = "0.11.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5d440709e79d88e51ac01c4b72fc6cb7314017bb7da9eeff678aa94c10e3ea8" +dependencies = [ + "serde", + "serde_core", +] + +[[package]] +name = "serde_core" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.3", +] + +[[package]] +name = "serde_derive_internals" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f852137cce035d6a4df67ccce505ff6b3e9fd3a10e3e52b24dc71e650bb1a9bd" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.3", +] + +[[package]] +name = "serde_json" +version = "1.0.151" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_path_to_error" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10a9ff822e371bb5403e391ecd83e182e0e77ba7f6fe0160b795797109d1b457" +dependencies = [ + "itoa", + "serde", + "serde_core", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures 0.2.17", + "digest", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" + +[[package]] +name = "signal-hook-registry" +version = "1.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +dependencies = [ + "errno", + "libc", +] + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90" + +[[package]] +name = "socket2" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.119" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "tempfile" +version = "3.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" +dependencies = [ + "fastrand", + "getrandom 0.4.3", + "once_cell", + "rustix", + "windows-sys 0.61.2", +] + +[[package]] +name = "thiserror" +version = "2.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec86235f5fcc2a73650310756d2ac5b138a5780bbbdfae3eeccec992c435ba4f" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc04cd3e1236dd4a98afca4569f2deb3f120e5422a4023be2cb683f8486292af" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.3", +] + +[[package]] +name = "thread_local" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad99c4c6d32803332c548b1af0540b357b3f5fc0be8f6c6bfe8b2e6ae784070" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "tinystr" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1e27c91459209c2986af3dcf603a5a74a4368754ce37414f59acc971167f643" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb4ebadaa0af04fab11ae01eb5f9fdb5f9c5b875506e210e71c07873528baa7f" +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 = "tokio" +version = "1.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed" +dependencies = [ + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-macros" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78773a2a397f451582ce068015985c33193cf6dea8b74d2a639fe457b2f07b0e" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.3", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "494815d09bf52b5548659851081238f0ca39ff638363907596da739561c62c52" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tower" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-http" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cfcf7e2740e6fc6d4d688b4ef00650406bb94adf4731e43c096c3a19fe40840" +dependencies = [ + "bitflags", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-body-util", + "http-range-header", + "httpdate", + "mime", + "mime_guess", + "percent-encoding", + "pin-project-lite", + "tokio", + "tokio-util", + "tower", + "tower-layer", + "tower-service", + "tracing", + "url", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7f578e5945fb242538965c2d0b04418d38ec25c79d160cd279bf0731c8d319" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex-automata", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "typenum" +version = "1.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" + +[[package]] +name = "unicase" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "uuid" +version = "1.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cefc03fd367c0c6d4305de1b312cf00248c4114f4a0418ce6a6af769e3b0bd9" +dependencies = [ + "getrandom 0.4.3", + "js-sys", + "serde_core", + "wasm-bindgen", +] + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.4+wasi-0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.127" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b70935747edd64d89de3efa29d73789b806c15798f8e7dca4d8ac356b50ce70" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b7777d5cc23d0e91404e53ce2d5e8ec7acae3026b16233dba62cd3246457950" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.127" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77775f8f3f7217702089053b94958f8f54061a3f663417df76e19cbdcca29bc1" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.127" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e11d33f857dc2fb11b8bc75aee111aa9cbeb12cd9f25efd3d4c2a3dd4e235284" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn 2.0.119", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.127" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ef64dbcc55df09c7e5a46182d181c2cfa3e925f3da937ea764728b4bbb9dcbf" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-streams" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "web-sys" +version = "0.3.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c435338968042f4f59a557f690a253676d47ce13ceb55d70100e7facf6620a30" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-roots" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dcd9d09a39985f5344844e66b0c530a33843579125f23e21e9f0f220850f22a" +dependencies = [ + "rustls-pki-types", +] + +[[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.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] + +[[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-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "wit-bindgen" +version = "0.57.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" + +[[package]] +name = "writeable" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc" + +[[package]] +name = "yoke" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "709fe23a0424b6a435d82152b1bd3fdfb0833487d5fa90d05d42762a9891fef5" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "556764e583adb45a9f8d413c2a147fa7e8d821e48e12b14fd560b607998b75eb" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2ab42fc20575779bd240faa45f94a74256f755c0fa9e89f0ede20d91d0cdfc1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "zerofrom" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13c156562582aa81c60cb29407084cdb54c4164760106ab78e6c5b0858cf64e" + +[[package]] +name = "zerotrie" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea269c3bd32f0a32c321907a2ae912ba6f4649bb0fc764a15627e99a7095a3f" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94b5c6b5976d66c1d703c4fd17d3f5e43c8cedaacf604961b171adc7130896d8" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47402523226a02bfe5230160dc3ccc089aa6f6f19e7fcbb4e6f824bbb1b4aa62" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.3", +] + +[[package]] +name = "zmij" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..46f600b --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,29 @@ +[workspace] +members = ["crates/ghostlight-dungeon"] +resolver = "2" + +[workspace.package] +edition = "2024" +license = "MIT" +version = "0.1.0" + +[workspace.dependencies] +anyhow = "1" +async-trait = "0.1" +axum = { version = "0.8", features = ["macros"] } +chrono = { version = "0.4", features = ["serde"] } +cultcache-rs = { git = "https://github.com/GameCult/cultcache-rs.git", rev = "0ba87453115e3d44e8fcb7419866cd7dd70fb096" } +rand = "0.9" +reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls", "stream"] } +rmp-serde = "1.3" +schemars = { version = "1", features = ["chrono04", "uuid1"] } +serde = { version = "1", features = ["derive"] } +serde_json = "1" +sha2 = "0.10" +thiserror = "2" +tokio = { version = "1", features = ["full"] } +tower-http = { version = "0.6", features = ["fs", "trace"] } +tracing = "0.1" +tracing-subscriber = { version = "0.3", features = ["env-filter"] } +uuid = { version = "1", features = ["v4", "serde"] } + diff --git a/crates/ghostlight-dungeon/Cargo.toml b/crates/ghostlight-dungeon/Cargo.toml new file mode 100644 index 0000000..18eb7d0 --- /dev/null +++ b/crates/ghostlight-dungeon/Cargo.toml @@ -0,0 +1,29 @@ +[package] +name = "ghostlight-dungeon" +version.workspace = true +edition.workspace = true +license.workspace = true + +[dependencies] +anyhow.workspace = true +async-trait.workspace = true +axum.workspace = true +chrono.workspace = true +cultcache-rs.workspace = true +rand.workspace = true +reqwest.workspace = true +rmp-serde.workspace = true +schemars.workspace = true +serde.workspace = true +serde_json.workspace = true +sha2.workspace = true +thiserror.workspace = true +tokio.workspace = true +tower-http.workspace = true +tracing.workspace = true +tracing-subscriber.workspace = true +uuid.workspace = true + +[dev-dependencies] +tempfile = "3" + diff --git a/crates/ghostlight-dungeon/src/d20.rs b/crates/ghostlight-dungeon/src/d20.rs new file mode 100644 index 0000000..cc9dc5a --- /dev/null +++ b/crates/ghostlight-dungeon/src/d20.rs @@ -0,0 +1,76 @@ +use crate::domain::{OutcomeBand, RollReceipt}; + +pub fn capped_modifier(values: impl IntoIterator) -> i8 { + values + .into_iter() + .map(i16::from) + .sum::() + .clamp(-10, 10) as i8 +} + +pub fn outcome(d20: u8, modifier: i8, dc: u8) -> OutcomeBand { + let total = i16::from(d20) + i16::from(modifier); + let base = if total >= i16::from(dc) + 10 { + OutcomeBand::StrongSuccess + } else if total >= i16::from(dc) { + OutcomeBand::Success + } else if total >= i16::from(dc) - 5 { + OutcomeBand::Mixed + } else { + OutcomeBand::Failure + }; + shift( + base, + if d20 == 20 { + 1 + } else if d20 == 1 { + -1 + } else { + 0 + }, + ) +} + +fn shift(band: OutcomeBand, delta: i8) -> OutcomeBand { + use OutcomeBand::*; + match (band, delta) { + (Failure, 1) => Mixed, + (Mixed, 1) => Success, + (Success, 1) => StrongSuccess, + (StrongSuccess, -1) => Success, + (Success, -1) => Mixed, + (Mixed, -1) => Failure, + (value, _) => value, + } +} + +pub fn receipt(digest: String, d20: u8, modifier: i8, dc: u8) -> RollReceipt { + RollReceipt { + schema: "ghostlight.roll_receipt.v1".into(), + assessment_digest: digest, + d20, + modifier_total: modifier, + total: i16::from(d20) + i16::from(modifier), + dc, + outcome: outcome(d20, modifier, dc), + } +} + +#[cfg(test)] +mod tests { + use super::*; + #[test] + fn caps_context_not_attributes() { + assert_eq!(capped_modifier([8, 7, -2]), 10); + } + #[test] + fn margin_bands_hold() { + assert_eq!(outcome(10, 0, 15), OutcomeBand::Mixed); + assert_eq!(outcome(15, 0, 15), OutcomeBand::Success); + assert_eq!(outcome(20, 5, 15), OutcomeBand::StrongSuccess); + } + #[test] + fn natural_one_only_shifts_one_band() { + assert_eq!(outcome(1, 10, 5), OutcomeBand::Mixed); + } +} diff --git a/crates/ghostlight-dungeon/src/domain.rs b/crates/ghostlight-dungeon/src/domain.rs new file mode 100644 index 0000000..807debf --- /dev/null +++ b/crates/ghostlight-dungeon/src/domain.rs @@ -0,0 +1,236 @@ +use chrono::{DateTime, Utc}; +use schemars::JsonSchema; +use serde::{Deserialize, Serialize}; +use std::collections::{BTreeMap, BTreeSet}; +use uuid::Uuid; + +#[derive(Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq)] +pub struct Campaign { + pub schema: String, + pub id: Uuid, + pub name: String, + pub revision: u64, + pub branch_origin: BranchOrigin, + pub world_time: DateTime, + pub tick_hours: u32, + pub player_actor_id: String, + pub locations: BTreeMap, + pub actors: BTreeMap, + pub institutions: BTreeMap, + pub clocks: BTreeMap, + pub facts: BTreeMap, + pub transcript: Vec, + pub last_player_activity: DateTime, + pub pending_ticks: u8, +} + +#[derive(Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq)] +pub struct BranchOrigin { + pub canon_cutoff: String, + pub evidence_receipt_ids: Vec, +} + +#[derive(Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq)] +pub struct Location { + pub id: String, + pub name: String, + pub container_id: Option, + pub routes: BTreeMap, + pub persistent_features: Vec, +} + +#[derive(Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq)] +pub struct Route { + pub destination_id: String, + pub distance: String, + pub travel_minutes: u32, +} + +#[derive(Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq)] +pub struct ActorState { + pub id: String, + pub name: String, + pub location_id: String, + pub capabilities: BTreeSet, + pub knowledge: BTreeSet, + pub equipment: BTreeSet, + pub conditions: BTreeSet, + pub obligations: BTreeSet, + pub relationships: BTreeMap, + pub goals: Vec, +} + +#[derive(Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq)] +pub struct InstitutionState { + pub id: String, + pub name: String, + pub resources: Vec, + pub goals: Vec, + pub posture: String, +} + +#[derive(Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq)] +pub struct WorldClock { + pub id: String, + pub label: String, + pub progress: u8, + pub threshold: u8, + pub consequence: String, +} + +#[derive(Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq)] +pub struct WorldFact { + pub id: String, + pub statement: String, + pub scope: FactScope, + pub evidence_receipt_ids: Vec, +} + +#[derive(Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum FactScope { + CanonBaseline, + BranchLocal, + ProvisionalLocal, +} + +#[derive(Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq)] +pub struct NarrativeTurn { + pub revision: u64, + pub at: DateTime, + pub speaker: String, + pub text: String, +} + +#[derive(Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq)] +pub struct ActionIntent { + pub actor_id: String, + pub description: String, + pub intended_effect: String, +} + +#[derive(Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq)] +#[serde(tag = "type", rename_all = "snake_case")] +pub enum WorldCommand { + CreateCampaign { + campaign: Campaign, + }, + Speak { + expected_revision: u64, + actor_id: String, + text: String, + intended_effect: Option, + }, + Assess { + expected_revision: u64, + intent: ActionIntent, + }, + Attempt { + assessment_digest: String, + }, + Wait { + expected_revision: u64, + minutes: u32, + }, + AdvanceStrategicTick { + expected_revision: u64, + source: TickSource, + }, +} + +#[derive(Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum TickSource { + Scheduler, + ReturnCatchUp, + PlayerWait, +} + +#[derive(Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq)] +pub struct ContextModifier { + pub label: String, + pub value: i8, + pub references: Vec, +} + +#[derive(Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq)] +pub struct ActionAssessment { + pub schema: String, + pub campaign_id: Uuid, + pub revision: u64, + pub intent: ActionIntent, + pub admissible: bool, + pub missing_permission: Option, + pub dc: u8, + pub modifiers: Vec, + pub modifier_total: i8, + pub effect_ceiling: String, + pub success_stake: String, + pub mixed_stake: String, + pub failure_stake: String, + pub bargains: Vec, + pub expires_at: DateTime, + pub digest: String, +} + +#[derive(Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq, Eq)] +#[serde(rename_all = "snake_case")] +pub enum OutcomeBand { + Failure, + Mixed, + Success, + StrongSuccess, +} + +#[derive(Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq)] +pub struct RollReceipt { + pub schema: String, + pub assessment_digest: String, + pub d20: u8, + pub modifier_total: i8, + pub total: i16, + pub dc: u8, + pub outcome: OutcomeBand, +} + +#[derive(Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq)] +pub struct WorldCommitReceipt { + pub schema: String, + pub campaign_id: Uuid, + pub previous_revision: u64, + pub revision: u64, + pub command_kind: String, + pub committed_at: DateTime, + pub roll: Option, +} + +#[derive(Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq)] +pub struct VaultEvidenceReceipt { + pub schema: String, + pub id: String, + pub provider: String, + pub query_hash: String, + pub witnesses: Vec, + pub retrieved_at: DateTime, +} + +#[derive(Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq)] +pub struct SourceWitness { + pub source_id: String, + pub exact_locator: String, + pub content_hash: String, + pub excerpt: String, + pub authority_lane: String, + pub temporal_scope: String, +} + +#[derive(Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq)] +pub struct WorldCompilePreview { + pub schema: String, + pub title: String, + pub campaign: Campaign, + pub evidence_receipts: Vec, + pub gaps: Vec, + pub branch_assumptions: Vec, + pub requires_approval: bool, +} diff --git a/crates/ghostlight-dungeon/src/kernel.rs b/crates/ghostlight-dungeon/src/kernel.rs new file mode 100644 index 0000000..a4986a9 --- /dev/null +++ b/crates/ghostlight-dungeon/src/kernel.rs @@ -0,0 +1,423 @@ +use crate::d20::{capped_modifier, receipt}; +use crate::domain::*; +use crate::persistence::CampaignStore; +use chrono::{Duration, Utc}; +use rand::Rng; +use sha2::{Digest, Sha256}; +use std::collections::BTreeMap; +use thiserror::Error; +use tokio::sync::{mpsc, oneshot}; + +#[derive(Debug, Error)] +pub enum KernelError { + #[error("campaign not found")] + NotFound, + #[error("stale revision: expected {expected}, actual {actual}")] + Stale { expected: u64, actual: u64 }, + #[error("action is impossible: {0}")] + Impossible(String), + #[error("assessment is stale or unknown")] + StaleAssessment, + #[error("invalid command: {0}")] + Invalid(String), + #[error("persistence failure: {0}")] + Persistence(String), +} + +#[derive(Clone, Debug, serde::Serialize)] +#[serde(tag = "kind", rename_all = "snake_case")] +pub enum CommandResult { + Created { + campaign: Campaign, + }, + Assessed { + assessment: ActionAssessment, + }, + Committed { + campaign: Campaign, + receipt: WorldCommitReceipt, + }, +} + +struct Request { + command: WorldCommand, + reply: oneshot::Sender>, +} + +#[derive(Clone)] +pub struct WorldKernel { + tx: mpsc::Sender, +} + +impl WorldKernel { + pub fn start(store: CampaignStore) -> Self { + let (tx, mut rx) = mpsc::channel::(64); + tokio::spawn(async move { + let mut assessments = BTreeMap::new(); + while let Some(request) = rx.recv().await { + let result = execute(&store, &mut assessments, request.command); + let _ = request.reply.send(result); + } + }); + Self { tx } + } + pub async fn command(&self, command: WorldCommand) -> Result { + let (reply, receive) = oneshot::channel(); + self.tx + .send(Request { command, reply }) + .await + .map_err(|_| KernelError::Invalid("kernel stopped".into()))?; + receive + .await + .map_err(|_| KernelError::Invalid("kernel stopped".into()))? + } +} + +fn execute( + store: &CampaignStore, + assessments: &mut BTreeMap, + command: WorldCommand, +) -> Result { + if let WorldCommand::CreateCampaign { campaign } = command { + store + .insert( + "campaign.v1", + "ghostlight.campaign.v1", + &campaign.id.to_string(), + &campaign, + ) + .map_err(persist)?; + return Ok(CommandResult::Created { campaign }); + } + let campaign_id = single_campaign_id(store)?; + let (row, mut campaign): (_, Campaign) = store + .load("campaign.v1", &campaign_id) + .map_err(persist)? + .ok_or(KernelError::NotFound)?; + match command { + WorldCommand::Assess { + expected_revision, + intent, + } => { + require_revision(&campaign, expected_revision)?; + let assessment = assess(&campaign, intent); + assessments.insert(assessment.digest.clone(), assessment.clone()); + Ok(CommandResult::Assessed { assessment }) + } + WorldCommand::Attempt { assessment_digest } => { + let assessment = assessments + .remove(&assessment_digest) + .ok_or(KernelError::StaleAssessment)?; + if assessment.revision != campaign.revision || assessment.expires_at < Utc::now() { + return Err(KernelError::StaleAssessment); + } + if !assessment.admissible { + return Err(KernelError::Impossible( + assessment + .missing_permission + .unwrap_or_else(|| "not admissible".into()), + )); + } + let roll = receipt( + assessment.digest.clone(), + rand::rng().random_range(1..=20), + assessment.modifier_total, + assessment.dc, + ); + let text = match roll.outcome { + OutcomeBand::StrongSuccess => &assessment.success_stake, + OutcomeBand::Success => &assessment.success_stake, + OutcomeBand::Mixed => &assessment.mixed_stake, + OutcomeBand::Failure => &assessment.failure_stake, + }; + campaign.transcript.push(NarrativeTurn { + revision: campaign.revision + 1, + at: Utc::now(), + speaker: "world".into(), + text: text.clone(), + }); + commit(store, row, campaign, "attempt", Some(roll)) + } + WorldCommand::Speak { + expected_revision, + actor_id, + text, + intended_effect, + } => { + require_revision(&campaign, expected_revision)?; + if !campaign.actors.contains_key(&actor_id) { + return Err(KernelError::Invalid("unknown actor".into())); + } + campaign.transcript.push(NarrativeTurn { + revision: campaign.revision + 1, + at: Utc::now(), + speaker: actor_id, + text, + }); + if let Some(effect) = intended_effect { + campaign.transcript.push(NarrativeTurn { + revision: campaign.revision + 1, + at: Utc::now(), + speaker: "system".into(), + text: format!("Intended effect requires assessment: {effect}"), + }); + } + campaign.last_player_activity = Utc::now(); + commit(store, row, campaign, "speak", None) + } + WorldCommand::Wait { + expected_revision, + minutes, + } => { + require_revision(&campaign, expected_revision)?; + campaign.world_time += Duration::minutes(i64::from(minutes)); + campaign.last_player_activity = Utc::now(); + commit(store, row, campaign, "wait", None) + } + WorldCommand::AdvanceStrategicTick { + expected_revision, + source: _, + } => { + require_revision(&campaign, expected_revision)?; + campaign.world_time += Duration::hours(i64::from(campaign.tick_hours)); + for clock in campaign.clocks.values_mut() { + clock.progress = clock.progress.saturating_add(1).min(clock.threshold); + } + campaign.pending_ticks = campaign.pending_ticks.saturating_sub(1); + commit(store, row, campaign, "strategic_tick", None) + } + WorldCommand::CreateCampaign { .. } => unreachable!(), + } +} + +fn single_campaign_id(store: &CampaignStore) -> Result { + let keys = store.keys("campaign.v1").map_err(persist)?; + match keys.as_slice() { + [id] => Ok(id.clone()), + [] => Err(KernelError::NotFound), + _ => Err(KernelError::Invalid( + "a campaign store must contain exactly one campaign".into(), + )), + } +} + +fn require_revision(c: &Campaign, expected: u64) -> Result<(), KernelError> { + if c.revision == expected { + Ok(()) + } else { + Err(KernelError::Stale { + expected, + actual: c.revision, + }) + } +} + +fn assess(c: &Campaign, intent: ActionIntent) -> ActionAssessment { + let actor = c.actors.get(&intent.actor_id); + let admissible = actor.is_some() && !intent.description.trim().is_empty(); + let missing = if actor.is_none() { + Some("actor does not exist in this branch".into()) + } else if intent.description.trim().is_empty() { + Some("no attempt was described".into()) + } else { + None + }; + let modifiers = vec![]; + let modifier_total = capped_modifier(modifiers.iter().map(|m: &ContextModifier| m.value)); + let mut a = ActionAssessment { + schema: "ghostlight.player_action_assessment.v1".into(), + campaign_id: c.id, + revision: c.revision, + intent, + admissible, + missing_permission: missing, + dc: 15, + modifiers, + modifier_total, + effect_ceiling: + "A bounded local consequence; no unsupported world fact or custody transfer.".into(), + success_stake: "The intended local effect succeeds and the world reacts.".into(), + mixed_stake: "The effect lands with the previewed cost or complication.".into(), + failure_stake: "Opposition holds and gains a concrete advantage.".into(), + bargains: if admissible { + vec![] + } else { + vec![ + "Narrow the effect, obtain access, recruit help, or accept a concrete sacrifice." + .into(), + ] + }, + expires_at: Utc::now() + Duration::minutes(10), + digest: String::new(), + }; + let bytes = rmp_serde::to_vec_named(&a).expect("assessment serializes"); + a.digest = format!("sha256:{:x}", Sha256::digest(bytes)); + a +} + +fn commit( + store: &CampaignStore, + row: cultcache_rs::CultCacheEnvelope, + mut campaign: Campaign, + kind: &str, + roll: Option, +) -> Result { + let previous_revision = campaign.revision; + campaign.revision += 1; + let receipt = WorldCommitReceipt { + schema: "ghostlight.world_commit_receipt.v1".into(), + campaign_id: campaign.id, + previous_revision, + revision: campaign.revision, + command_kind: kind.into(), + committed_at: Utc::now(), + roll, + }; + store + .append_with_replace( + &row, + "ghostlight.campaign.v1", + &campaign, + "world_commit_receipt.v1", + "ghostlight.world_commit_receipt.v1", + &format!("{}-{}", campaign.id, campaign.revision), + &receipt, + ) + .map_err(persist)?; + Ok(CommandResult::Committed { campaign, receipt }) +} + +fn persist(e: anyhow::Error) -> KernelError { + KernelError::Persistence(e.to_string()) +} + +#[cfg(test)] +mod tests { + use super::*; + use std::collections::{BTreeMap, BTreeSet}; + + fn campaign() -> Campaign { + let id = uuid::Uuid::new_v4(); + let actor = ActorState { + id: "player".into(), + name: "Player".into(), + location_id: "room".into(), + capabilities: BTreeSet::new(), + knowledge: BTreeSet::new(), + equipment: BTreeSet::new(), + conditions: BTreeSet::new(), + obligations: BTreeSet::new(), + relationships: BTreeMap::new(), + goals: vec![], + }; + Campaign { + schema: "ghostlight.campaign.v1".into(), + id, + name: "Test".into(), + revision: 0, + branch_origin: BranchOrigin { + canon_cutoff: "test".into(), + evidence_receipt_ids: vec![], + }, + world_time: Utc::now(), + tick_hours: 6, + player_actor_id: "player".into(), + locations: BTreeMap::from([( + "room".into(), + Location { + id: "room".into(), + name: "Room".into(), + container_id: None, + routes: BTreeMap::new(), + persistent_features: vec!["stable".into()], + }, + )]), + actors: BTreeMap::from([("player".into(), actor)]), + institutions: BTreeMap::new(), + clocks: BTreeMap::new(), + facts: BTreeMap::new(), + transcript: vec![], + last_player_activity: Utc::now(), + pending_ticks: 0, + } + } + + #[tokio::test] + async fn stale_command_cannot_mutate_campaign() { + let dir = tempfile::tempdir().unwrap(); + let store = CampaignStore::open(dir.path().join("campaign.cc")).unwrap(); + let kernel = WorldKernel::start(store.clone()); + let seed = campaign(); + kernel + .command(WorldCommand::CreateCampaign { + campaign: seed.clone(), + }) + .await + .unwrap(); + kernel + .command(WorldCommand::Wait { + expected_revision: 0, + minutes: 30, + }) + .await + .unwrap(); + let stale = kernel + .command(WorldCommand::Wait { + expected_revision: 0, + minutes: 30, + }) + .await; + assert!(matches!(stale, Err(KernelError::Stale { actual: 1, .. }))); + let (_, stored): (_, Campaign) = store + .load("campaign.v1", &seed.id.to_string()) + .unwrap() + .unwrap(); + assert_eq!(stored.revision, 1); + assert_eq!(stored.world_time, seed.world_time + Duration::minutes(30)); + } + + #[tokio::test] + async fn assessment_is_private_and_attempt_commits_roll_atomically() { + let dir = tempfile::tempdir().unwrap(); + let store = CampaignStore::open(dir.path().join("campaign.cc")).unwrap(); + let kernel = WorldKernel::start(store.clone()); + let seed = campaign(); + kernel + .command(WorldCommand::CreateCampaign { + campaign: seed.clone(), + }) + .await + .unwrap(); + let result = kernel + .command(WorldCommand::Assess { + expected_revision: 0, + intent: ActionIntent { + actor_id: "player".into(), + description: "Open the ordinary door".into(), + intended_effect: "Pass through".into(), + }, + }) + .await + .unwrap(); + let CommandResult::Assessed { assessment } = result else { + panic!("expected assessment") + }; + let (_, before): (_, Campaign) = store + .load("campaign.v1", &seed.id.to_string()) + .unwrap() + .unwrap(); + assert_eq!(before.revision, 0); + let result = kernel + .command(WorldCommand::Attempt { + assessment_digest: assessment.digest, + }) + .await + .unwrap(); + let CommandResult::Committed { campaign, receipt } = result else { + panic!("expected commit") + }; + assert_eq!(campaign.revision, 1); + assert!(receipt.roll.is_some()); + assert_eq!(store.keys("world_commit_receipt.v1").unwrap().len(), 1); + } +} diff --git a/crates/ghostlight-dungeon/src/lib.rs b/crates/ghostlight-dungeon/src/lib.rs new file mode 100644 index 0000000..dbe4b72 --- /dev/null +++ b/crates/ghostlight-dungeon/src/lib.rs @@ -0,0 +1,10 @@ +pub mod d20; +pub mod domain; +pub mod kernel; +pub mod model; +pub mod persistence; +pub mod persona; +pub mod surface; +pub mod vault; + +pub use kernel::{KernelError, WorldKernel}; diff --git a/crates/ghostlight-dungeon/src/main.rs b/crates/ghostlight-dungeon/src/main.rs new file mode 100644 index 0000000..b78eb44 --- /dev/null +++ b/crates/ghostlight-dungeon/src/main.rs @@ -0,0 +1,209 @@ +use axum::{ + Json, Router, + extract::{Path, State}, + http::{HeaderMap, HeaderValue, StatusCode, header}, + response::{IntoResponse, Redirect, Response}, + routing::{get, post}, +}; +use ghostlight_dungeon::{ + WorldKernel, + domain::{Campaign, WorldCommand}, + persistence::CampaignStore, + surface::player_surface, +}; +use serde::Serialize; +use std::{ + collections::{BTreeMap, BTreeSet}, + net::SocketAddr, + path::PathBuf, + sync::Arc, +}; +use tokio::sync::Mutex; +use tower_http::services::ServeDir; +use tracing_subscriber::EnvFilter; + +#[derive(Clone)] +struct AppState { + kernel: WorldKernel, + store: CampaignStore, + invites: Arc>>, + sessions: Arc>>, +} + +#[tokio::main] +async fn main() -> anyhow::Result<()> { + tracing_subscriber::fmt() + .with_env_filter(EnvFilter::from_default_env()) + .init(); + let runtime_root = std::env::var_os("GHOSTLIGHT_DUNGEON_ROOT") + .map(PathBuf::from) + .unwrap_or_else(|| PathBuf::from(r"F:\GameCult\GhostlightDungeon")); + std::fs::create_dir_all(runtime_root.join("campaigns/default"))?; + let store = CampaignStore::open(runtime_root.join("campaigns/default/campaign.cc"))?; + let kernel = WorldKernel::start(store.clone()); + if store.keys("campaign.v1")?.is_empty() { + kernel + .command(WorldCommand::CreateCampaign { + campaign: seed_campaign(), + }) + .await?; + } + let invite_tokens = std::env::var("GHOSTLIGHT_INVITES") + .unwrap_or_else(|_| "tester-one,tester-two".into()) + .split(',') + .map(str::trim) + .filter(|s| !s.is_empty()) + .map(str::to_owned) + .collect(); + let state = AppState { + kernel, + store, + invites: Arc::new(Mutex::new(invite_tokens)), + sessions: Arc::new(Mutex::new(BTreeSet::new())), + }; + let web_root = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../../web/dist"); + let app = Router::new() + .route("/health", get(health)) + .route("/invite/{token}", get(invite)) + .route("/api/surface", get(surface)) + .route("/api/command", post(command)) + .fallback_service(ServeDir::new(web_root).append_index_html_on_directories(true)) + .with_state(state); + let address: SocketAddr = "0.0.0.0:8831".parse()?; + let listener = tokio::net::TcpListener::bind(address).await?; + tracing::info!(%address, "GhostlightDungeon listening"); + axum::serve(listener, app).await?; + Ok(()) +} + +async fn health(State(state): State) -> Json { + Json( + serde_json::json!({"schema":"ghostlight.service_health.v1","status":"ok","storeIdentity":state.store.identity()}), + ) +} + +async fn invite(Path(token): Path, State(state): State) -> Response { + if !state.invites.lock().await.remove(&token) { + return (StatusCode::UNAUTHORIZED, "invalid or consumed invite").into_response(); + } + let session = uuid::Uuid::new_v4().to_string(); + state.sessions.lock().await.insert(session.clone()); + let mut response = Redirect::to("/").into_response(); + response.headers_mut().insert( + header::SET_COOKIE, + HeaderValue::from_str(&format!( + "ghostlight_session={session}; HttpOnly; SameSite=Strict; Path=/" + )) + .unwrap(), + ); + response +} + +async fn surface(headers: HeaderMap, State(state): State) -> Response { + if !authorized(&headers, &state).await { + return StatusCode::UNAUTHORIZED.into_response(); + } + match load_campaign(&state.store) { + Ok(campaign) => Json(player_surface(&campaign)).into_response(), + Err(error) => (StatusCode::INTERNAL_SERVER_ERROR, error.to_string()).into_response(), + } +} + +async fn command( + headers: HeaderMap, + State(state): State, + Json(command): Json, +) -> Response { + if !authorized(&headers, &state).await { + return StatusCode::UNAUTHORIZED.into_response(); + } + match state.kernel.command(command).await { + Ok(result) => Json(result).into_response(), + Err(error) => ( + StatusCode::CONFLICT, + Json(ErrorBody { + error: error.to_string(), + }), + ) + .into_response(), + } +} + +async fn authorized(headers: &HeaderMap, state: &AppState) -> bool { + let session = headers + .get(header::COOKIE) + .and_then(|v| v.to_str().ok()) + .and_then(|cookies| { + cookies + .split(';') + .map(str::trim) + .find_map(|cookie| cookie.strip_prefix("ghostlight_session=")) + }); + match session { + Some(id) => state.sessions.lock().await.contains(id), + None => false, + } +} + +fn load_campaign(store: &CampaignStore) -> anyhow::Result { + let id = store + .keys("campaign.v1")? + .into_iter() + .next() + .ok_or_else(|| anyhow::anyhow!("campaign missing"))?; + store + .load("campaign.v1", &id)? + .map(|(_, c)| c) + .ok_or_else(|| anyhow::anyhow!("campaign missing")) +} + +#[derive(Serialize)] +struct ErrorBody { + error: String, +} + +fn seed_campaign() -> Campaign { + let id = uuid::Uuid::new_v4(); + let location = ghostlight_dungeon::domain::Location { + id: "starfire-lab".into(), + name: "Starfire Narrative Laboratory".into(), + container_id: None, + routes: BTreeMap::new(), + persistent_features: vec![ + "A stable room waiting for an approved world compilation.".into(), + ], + }; + let actor = ghostlight_dungeon::domain::ActorState { + id: "player".into(), + name: "Tester".into(), + location_id: location.id.clone(), + capabilities: BTreeSet::new(), + knowledge: BTreeSet::new(), + equipment: BTreeSet::new(), + conditions: BTreeSet::new(), + obligations: BTreeSet::new(), + relationships: BTreeMap::new(), + goals: vec!["Compile a world worth entering.".into()], + }; + Campaign { + schema: "ghostlight.campaign.v1".into(), + id, + name: "GhostlightDungeon MVP".into(), + revision: 0, + branch_origin: ghostlight_dungeon::domain::BranchOrigin { + canon_cutoff: "fixture-development".into(), + evidence_receipt_ids: vec![], + }, + world_time: chrono::Utc::now(), + tick_hours: 6, + player_actor_id: actor.id.clone(), + locations: BTreeMap::from([(location.id.clone(), location)]), + actors: BTreeMap::from([(actor.id.clone(), actor)]), + institutions: BTreeMap::new(), + clocks: BTreeMap::new(), + facts: BTreeMap::new(), + transcript: vec![], + last_player_activity: chrono::Utc::now(), + pending_ticks: 0, + } +} diff --git a/crates/ghostlight-dungeon/src/model.rs b/crates/ghostlight-dungeon/src/model.rs new file mode 100644 index 0000000..0edf004 --- /dev/null +++ b/crates/ghostlight-dungeon/src/model.rs @@ -0,0 +1,143 @@ +use anyhow::{Result, anyhow}; +use async_trait::async_trait; +use serde::{Deserialize, Serialize}; +use sha2::{Digest, Sha256}; +use std::time::Instant; + +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +pub struct ModelStageRequest { + pub stage: String, + pub model: String, + pub snapshot_binding: String, + pub lived_stream: String, + pub output_schema: Option, + pub source_receipt_ids: Vec, +} + +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +pub struct ModelStageReceipt { + pub schema: String, + pub provider: String, + pub model: String, + pub stage: String, + pub snapshot_binding: String, + pub request_hash: String, + pub output_hash: String, + pub source_receipt_ids: Vec, + pub latency_ms: u64, + pub validation_result: String, +} + +#[derive(Clone, Debug, PartialEq)] +pub struct ModelStageOutput { + pub narrative: String, + pub structured: Option, + pub receipt: ModelStageReceipt, +} + +#[async_trait] +pub trait ModelPort: Send + Sync { + async fn run(&self, request: &ModelStageRequest) -> Result; + fn provider(&self) -> &'static str; +} + +pub async fn run_validated_stage( + port: &dyn ModelPort, + request: &ModelStageRequest, +) -> Result { + let request_bytes = serde_json::to_vec(request)?; + for attempt in 0..2 { + let started = Instant::now(); + let output = port.run(request).await?; + if output.trim().is_empty() { + if attempt == 0 { + continue; + } + return Err(anyhow!("model returned empty output twice")); + } + let structured = match &request.output_schema { + Some(_) => match serde_json::from_str(&output) { + Ok(value) => Some(value), + Err(_) if attempt == 0 => continue, + Err(error) => return Err(anyhow!("model returned malformed JSON twice: {error}")), + }, + None => None, + }; + return Ok(ModelStageOutput { + narrative: output.clone(), + structured, + receipt: ModelStageReceipt { + schema: "ghostlight.persona_stage_receipt.v1".into(), + provider: port.provider().into(), + model: request.model.clone(), + stage: request.stage.clone(), + snapshot_binding: request.snapshot_binding.clone(), + request_hash: format!("sha256:{:x}", Sha256::digest(&request_bytes)), + output_hash: format!("sha256:{:x}", Sha256::digest(output.as_bytes())), + source_receipt_ids: request.source_receipt_ids.clone(), + latency_ms: started.elapsed().as_millis() as u64, + validation_result: "valid".into(), + }, + }); + } + unreachable!() +} + +#[derive(Clone)] +pub struct FixtureModel; +#[async_trait] +impl ModelPort for FixtureModel { + async fn run(&self, request: &ModelStageRequest) -> Result { + Ok(if request.output_schema.is_some() { + r#"{"private_deltas":[],"speech":null,"reaction_priority":0,"world_actions":[]}"#.into() + } else { + format!("{}", request.lived_stream) + }) + } + fn provider(&self) -> &'static str { + "fixture" + } +} + +#[derive(Clone)] +pub struct DeepSeekPort { + client: reqwest::Client, + api_key: String, + endpoint: String, +} +impl DeepSeekPort { + pub fn new(api_key: String) -> Self { + Self { + client: reqwest::Client::new(), + api_key, + endpoint: "https://api.deepseek.com/chat/completions".into(), + } + } +} +#[async_trait] +impl ModelPort for DeepSeekPort { + async fn run(&self, request: &ModelStageRequest) -> Result { + let mut body = serde_json::json!({"model":request.model,"messages":[{"role":"user","content":request.lived_stream}],"stream":false,"thinking":{"type":"disabled"}}); + if request.output_schema.is_some() { + body["response_format"] = serde_json::json!({"type":"json_object"}); + } + let value: serde_json::Value = self + .client + .post(&self.endpoint) + .bearer_auth(&self.api_key) + .json(&body) + .send() + .await? + .error_for_status()? + .json() + .await?; + value + .pointer("/choices/0/message/content") + .and_then(|v| v.as_str()) + .map(str::to_owned) + .ok_or_else(|| anyhow!("DeepSeek response contained no assistant content")) + } + fn provider(&self) -> &'static str { + "deepseek" + } +} diff --git a/crates/ghostlight-dungeon/src/persistence.rs b/crates/ghostlight-dungeon/src/persistence.rs new file mode 100644 index 0000000..1801c68 --- /dev/null +++ b/crates/ghostlight-dungeon/src/persistence.rs @@ -0,0 +1,111 @@ +use anyhow::{Context, Result, anyhow}; +use chrono::Utc; +use cultcache_rs::{CacheBackingStore, CultCacheEnvelope, OwnedRedbMessagePackBackingStore}; +use serde::{Serialize, de::DeserializeOwned}; +use std::path::Path; + +#[derive(Clone)] +pub struct CampaignStore { + inner: OwnedRedbMessagePackBackingStore, +} + +impl CampaignStore { + pub fn open(path: impl AsRef) -> Result { + Ok(Self { + inner: OwnedRedbMessagePackBackingStore::new(path.as_ref())?, + }) + } + pub fn identity(&self) -> &str { + self.inner.file_identity() + } + + pub fn keys(&self, kind: &str) -> Result> { + Ok(self + .inner + .pull_all()? + .into_iter() + .filter(|r| r.r#type == kind) + .map(|r| r.key) + .collect()) + } + + pub fn load( + &self, + kind: &str, + key: &str, + ) -> Result> { + let row = self + .inner + .pull_all()? + .into_iter() + .find(|r| r.r#type == kind && r.key == key); + row.map(|r| { + let value = rmp_serde::from_slice(&r.payload).context("decode CultCache row")?; + Ok((r, value)) + }) + .transpose() + } + + pub fn insert( + &self, + kind: &str, + schema: &str, + key: &str, + value: &T, + ) -> Result { + let row = envelope(kind, schema, key, value)?; + if !self.inner.insert_entry_if_absent(row.clone())? { + return Err(anyhow!("row already exists: {kind}/{key}")); + } + Ok(row) + } + + pub fn replace( + &self, + expected: &CultCacheEnvelope, + schema: &str, + value: &T, + ) -> Result { + let next = envelope(&expected.r#type, schema, &expected.key, value)?; + if !self.inner.compare_and_swap_entry(expected, next.clone())? { + return Err(anyhow!("stale CultCache snapshot")); + } + Ok(next) + } + + pub fn append_with_replace( + &self, + expected: &CultCacheEnvelope, + next_schema: &str, + next: &T, + receipt_kind: &str, + receipt_schema: &str, + receipt_key: &str, + receipt: &R, + ) -> Result { + let next_row = envelope(&expected.r#type, next_schema, &expected.key, next)?; + let receipt_row = envelope(receipt_kind, receipt_schema, receipt_key, receipt)?; + if !self.inner.compare_and_swap_batch( + std::slice::from_ref(expected), + vec![next_row.clone(), receipt_row], + )? { + return Err(anyhow!("stale CultCache snapshot")); + } + Ok(next_row) + } +} + +fn envelope( + kind: &str, + schema: &str, + key: &str, + value: &T, +) -> Result { + Ok(CultCacheEnvelope { + key: key.into(), + r#type: kind.into(), + payload: rmp_serde::to_vec_named(value)?, + stored_at: Utc::now().to_rfc3339(), + schema_id: Some(schema.into()), + }) +} diff --git a/crates/ghostlight-dungeon/src/persona.rs b/crates/ghostlight-dungeon/src/persona.rs new file mode 100644 index 0000000..725d8e5 --- /dev/null +++ b/crates/ghostlight-dungeon/src/persona.rs @@ -0,0 +1,189 @@ +use crate::model::{ModelPort, ModelStageRequest, run_validated_stage}; +use anyhow::{Result, anyhow}; +use async_trait::async_trait; +use serde::{Deserialize, Serialize}; +use std::sync::Arc; + +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +pub struct PermittedActorSlice { + pub actor_id: String, + pub snapshot_binding: String, + pub identity_experience: Vec, + pub memories: Vec, + pub perceived_events: Vec, + pub relationships: Vec, + pub goals: Vec, + pub knowledge: Vec, + pub capabilities: Vec, + pub pressures: Vec, + pub affordances: Vec, + pub source_receipt_ids: Vec, +} + +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +pub struct LivedNarrativeStream { + pub text: String, + pub snapshot_binding: String, + pub projector_receipt: crate::model::ModelStageReceipt, +} + +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +pub struct PersonaProposalBundle { + pub private_deltas: Vec, + pub speech: Option, + pub reaction_priority: i16, + pub world_actions: Vec, +} + +#[derive(Clone, Debug)] +pub struct PersonaTerminalBundle { + pub lived_stream: LivedNarrativeStream, + pub persona_output: String, + pub proposals: PersonaProposalBundle, + pub stage_receipts: Vec, +} + +#[async_trait] +pub trait ExecutionPermit: Send + Sync { + async fn require(&self, actor_id: &str, snapshot_binding: &str, stage: &str) -> Result<()>; +} + +#[derive(Clone)] +pub struct AllowAllPermit; +#[async_trait] +impl ExecutionPermit for AllowAllPermit { + async fn require(&self, _: &str, _: &str, _: &str) -> Result<()> { + Ok(()) + } +} + +pub struct PersonaProjectionEngine { + pub model: Arc, + pub permit: Arc, + pub projector_model: String, + pub persona_model: String, + pub interpreter_model: String, +} + +impl PersonaProjectionEngine { + pub async fn execute(&self, slice: PermittedActorSlice) -> Result { + self.permit + .require(&slice.actor_id, &slice.snapshot_binding, "projector") + .await?; + let projector_prompt = format!( + "Project this permitted typed experience into one private lived narrative stream. Emit narrative only; no JSON, action syntax, schemas, or raw field labels.\n\n{}", + serde_json::to_string(&slice)? + ); + let projected = run_validated_stage( + self.model.as_ref(), + &ModelStageRequest { + stage: "projector".into(), + model: self.projector_model.clone(), + snapshot_binding: slice.snapshot_binding.clone(), + lived_stream: projector_prompt, + output_schema: None, + source_receipt_ids: slice.source_receipt_ids.clone(), + }, + ) + .await?; + require_narrative_membrane(&projected.narrative)?; + let lived = LivedNarrativeStream { + text: projected.narrative.clone(), + snapshot_binding: slice.snapshot_binding.clone(), + projector_receipt: projected.receipt.clone(), + }; + + self.permit + .require(&slice.actor_id, &slice.snapshot_binding, "persona") + .await?; + // This is the membrane: the Persona's domain context is exactly one lived stream. + let persona = run_validated_stage( + self.model.as_ref(), + &ModelStageRequest { + stage: "persona".into(), + model: self.persona_model.clone(), + snapshot_binding: slice.snapshot_binding.clone(), + lived_stream: lived.text.clone(), + output_schema: None, + source_receipt_ids: vec![], + }, + ) + .await?; + + self.permit + .require(&slice.actor_id, &slice.snapshot_binding, "interpreter") + .await?; + let schema = serde_json::json!({"type":"object","required":["private_deltas","speech","reaction_priority","world_actions"]}); + let interpreted = run_validated_stage( + self.model.as_ref(), + &ModelStageRequest { + stage: "interpreter".into(), + model: self.interpreter_model.clone(), + snapshot_binding: slice.snapshot_binding.clone(), + lived_stream: format!( + "LIVED STREAM:\n{}\n\nPERSONA OUTPUT:\n{}", + lived.text, persona.narrative + ), + output_schema: Some(schema), + source_receipt_ids: slice.source_receipt_ids, + }, + ) + .await?; + self.permit + .require(&slice.actor_id, &slice.snapshot_binding, "terminal") + .await?; + let proposals: PersonaProposalBundle = serde_json::from_value( + interpreted + .structured + .clone() + .ok_or_else(|| anyhow!("interpreter produced no typed proposal"))?, + )?; + Ok(PersonaTerminalBundle { + lived_stream: lived, + persona_output: persona.narrative, + proposals, + stage_receipts: vec![projected.receipt, persona.receipt, interpreted.receipt], + }) + } +} + +fn require_narrative_membrane(text: &str) -> Result<()> { + let trimmed = text.trim(); + if trimmed.is_empty() || trimmed.starts_with('{') || trimmed.contains("```json") { + return Err(anyhow!("projector violated lived-narrative membrane")); + } + Ok(()) +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::model::FixtureModel; + #[tokio::test] + async fn persona_receives_only_projected_stream() { + let engine = PersonaProjectionEngine { + model: Arc::new(FixtureModel), + permit: Arc::new(AllowAllPermit), + projector_model: "flash".into(), + persona_model: "pro".into(), + interpreter_model: "flash".into(), + }; + let slice = PermittedActorSlice { + actor_id: "npc".into(), + snapshot_binding: "campaign:1".into(), + identity_experience: vec!["A tired navigator".into()], + memories: vec![], + perceived_events: vec![], + relationships: vec![], + goals: vec![], + knowledge: vec![], + capabilities: vec![], + pressures: vec![], + affordances: vec![], + source_receipt_ids: vec![], + }; + let result = engine.execute(slice).await.unwrap(); + assert_eq!(result.stage_receipts.len(), 3); + assert_eq!(result.proposals.reaction_priority, 0); + } +} diff --git a/crates/ghostlight-dungeon/src/surface.rs b/crates/ghostlight-dungeon/src/surface.rs new file mode 100644 index 0000000..705076c --- /dev/null +++ b/crates/ghostlight-dungeon/src/surface.rs @@ -0,0 +1,16 @@ +use crate::domain::Campaign; +use serde_json::{Value, json}; + +pub fn player_surface(campaign: &Campaign) -> Value { + let turns = campaign.transcript.iter().map(|t| json!({"id":format!("turn-{}-{}",t.revision,t.speaker),"kind":"text","props":{"value":format!("{}: {}",t.speaker,t.text)},"children":[]})).collect::>(); + json!({ + "type":"surface-state", "schema":"gamecult.eve.surface.v1", "providerId":"gamecult.ghostlight.dungeon", + "providerKind":"narrative.simulation", "title":campaign.name, "version":campaign.revision, + "surface":{"id":format!("ghostlight.campaign.{}",campaign.id),"root":{"id":"dungeon.root","kind":"surface","props":{},"children":[ + {"id":"dungeon.status","kind":"card","props":{"title":format!("{} · revision {} · {}",campaign.name,campaign.revision,campaign.world_time)},"children":[]}, + {"id":"dungeon.transcript","kind":"card","props":{"title":"Story"},"children":turns}, + {"id":"dungeon.composer","kind":"text-input","props":{"label":"What do you attempt?","commandId":"attempt.assess"},"children":[]} + ]},"styles":{"tokens":{"colorBackground":"#0c1110","colorPanel":"#17201d","colorText":"#e8e1cf","colorMuted":"#9aa69f","colorAccent":"#d49b58"}}}, + "commands":[{"id":"attempt.assess","schema":"gamecult.eve.command.v1","receiptSchema":"ghostlight.player_action_assessment.v1"}] + }) +} diff --git a/crates/ghostlight-dungeon/src/vault.rs b/crates/ghostlight-dungeon/src/vault.rs new file mode 100644 index 0000000..0ff48dd --- /dev/null +++ b/crates/ghostlight-dungeon/src/vault.rs @@ -0,0 +1,102 @@ +use crate::domain::{SourceWitness, VaultEvidenceReceipt}; +use anyhow::{Result, anyhow}; +use async_trait::async_trait; +use chrono::Utc; +use reqwest::Client; +use serde::{Deserialize, Serialize}; +use sha2::{Digest, Sha256}; + +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct VaultQuery { + pub query: String, + pub authority_lanes: Vec, + pub temporal_scope: String, + pub limit: u8, +} + +#[async_trait] +pub trait VaultProvider: Send + Sync { + async fn search(&self, query: &VaultQuery) -> Result; + async fn exact_document(&self, source_id: &str) -> Result; + fn provider_id(&self) -> &'static str; +} + +#[derive(Clone)] +pub struct FixtureVault { + pub witnesses: Vec, +} +#[async_trait] +impl VaultProvider for FixtureVault { + async fn search(&self, query: &VaultQuery) -> Result { + Ok(receipt( + self.provider_id(), + query, + self.witnesses + .iter() + .take(query.limit as usize) + .cloned() + .collect(), + )) + } + async fn exact_document(&self, source_id: &str) -> Result { + self.witnesses + .iter() + .find(|w| w.source_id == source_id) + .cloned() + .ok_or_else(|| anyhow!("fixture source not found")) + } + fn provider_id(&self) -> &'static str { + "fixture" + } +} + +#[derive(Clone)] +pub struct VoidBotMcpVault { + client: Client, + endpoint: String, +} +impl VoidBotMcpVault { + pub fn starfire_loopback() -> Self { + Self { + client: Client::new(), + endpoint: "http://127.0.0.1:17875/mcp".into(), + } + } +} +#[async_trait] +impl VaultProvider for VoidBotMcpVault { + async fn search(&self, query: &VaultQuery) -> Result { + let response: serde_json::Value = self.client.post(&self.endpoint).json(&serde_json::json!({"jsonrpc":"2.0","id":"ghostlight-vault","method":"tools/call","params":{"name":"search_sources","arguments":{"query":query.query,"limit":query.limit}}})).send().await?.error_for_status()?.json().await?; + let witnesses = response + .pointer("/result/structuredContent/witnesses") + .cloned() + .and_then(|v| serde_json::from_value(v).ok()) + .ok_or_else(|| anyhow!("VoidBot MCP returned no typed witnesses"))?; + Ok(receipt(self.provider_id(), query, witnesses)) + } + async fn exact_document(&self, _source_id: &str) -> Result { + Err(anyhow!( + "exact-document VoidBot adapter awaits restored trusted crossing contract verification" + )) + } + fn provider_id(&self) -> &'static str { + "voidbot.aetheria" + } +} + +fn receipt( + provider: &str, + query: &VaultQuery, + witnesses: Vec, +) -> VaultEvidenceReceipt { + let query_bytes = rmp_serde::to_vec_named(query).expect("query serializes"); + let query_hash = format!("sha256:{:x}", Sha256::digest(query_bytes)); + VaultEvidenceReceipt { + schema: "ghostlight.vault_evidence_receipt.v1".into(), + id: format!("vault:{query_hash}"), + provider: provider.into(), + query_hash, + witnesses, + retrieved_at: Utc::now(), + } +} diff --git a/package.json b/package.json index 2eb32d3..876fbad 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,9 @@ "version": "0.0.0", "description": "Persistent research repo for socially situated generative agent architecture.", "scripts": { + "dungeon:build": "cargo build --workspace && npm --prefix web run build", + "dungeon:test": "cargo test --workspace && npm --prefix web run build", + "dungeon:run": "cargo run -p ghostlight-dungeon", "state:status": "\"C:\\Users\\Meta\\.cache\\codex-runtimes\\codex-primary-runtime\\dependencies\\python\\python.exe\" .\\tools\\ghostlight_state.py status", "state:prepare-compaction": "\"C:\\Users\\Meta\\.cache\\codex-runtimes\\codex-primary-runtime\\dependencies\\python\\python.exe\" .\\tools\\ghostlight_prepare_compaction.py", "agent-state:validate": "\"C:\\Users\\Meta\\.cache\\codex-runtimes\\codex-primary-runtime\\dependencies\\python\\python.exe\" .\\tools\\validate_agent_state.py", diff --git a/vendor/eve b/vendor/eve new file mode 160000 index 0000000..076d212 --- /dev/null +++ b/vendor/eve @@ -0,0 +1 @@ +Subproject commit 076d2124ed476cdaeff540c9d24c2d4fb57d04cf diff --git a/web/dist/assets/index-CmB__dez.js b/web/dist/assets/index-CmB__dez.js new file mode 100644 index 0000000..85310da --- /dev/null +++ b/web/dist/assets/index-CmB__dez.js @@ -0,0 +1,153 @@ +(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&i(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(o){if(o.ep)return;o.ep=!0;const a=n(o);fetch(o.href,a)}})();const K=new WeakMap,pt=20;function Vt(t,e,n,i,o,a,s,l){const f=te(t.canvas);if(!f)return!1;const c=f.gl;if(!ee(f,a,s))return K.set(t.canvas,null),!1;const r=Jt(e,n,i,o,l);c.bindFramebuffer(c.FRAMEBUFFER,f.framebuffer),c.viewport(0,0,a,s),c.disable(c.DEPTH_TEST),c.disable(c.CULL_FACE),c.enable(c.BLEND),c.blendFunc(c.ONE,c.ONE),c.clearColor(0,0,0,1),c.clear(c.COLOR_BUFFER_BIT),r.gravity.length>0&&(c.useProgram(f.splatProgram),c.uniform4f(c.getUniformLocation(f.splatProgram,"u_viewport"),o.minX,o.minY,o.maxX,o.maxY),c.uniform1f(c.getUniformLocation(f.splatProgram,"u_time"),_(e.simulationTimeSeconds,0)),c.bindBuffer(c.ARRAY_BUFFER,f.splatBuffer),c.bufferData(c.ARRAY_BUFFER,r.gravity,c.DYNAMIC_DRAW),Ct(c,f.splatProgram),c.drawArrays(c.TRIANGLES,0,r.gravity.length/pt)),c.bindFramebuffer(c.FRAMEBUFFER,f.tintFramebuffer),c.clearColor(0,0,0,0),c.clear(c.COLOR_BUFFER_BIT),r.tint.length>0&&(c.useProgram(f.splatProgram),c.uniform4f(c.getUniformLocation(f.splatProgram,"u_viewport"),o.minX,o.minY,o.maxX,o.maxY),c.uniform1f(c.getUniformLocation(f.splatProgram,"u_time"),_(e.simulationTimeSeconds,0)),c.bindBuffer(c.ARRAY_BUFFER,f.splatBuffer),c.bufferData(c.ARRAY_BUFFER,r.tint,c.DYNAMIC_DRAW),Ct(c,f.splatProgram),c.drawArrays(c.TRIANGLES,0,r.tint.length/pt)),c.disable(c.BLEND),c.bindFramebuffer(c.FRAMEBUFFER,null),c.viewport(0,0,a,s),c.useProgram(f.shadeProgram),c.activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,f.fieldTexture),c.uniform1i(c.getUniformLocation(f.shadeProgram,"u_field"),0),c.activeTexture(c.TEXTURE1),c.bindTexture(c.TEXTURE_2D,f.tintTexture),c.uniform1i(c.getUniformLocation(f.shadeProgram,"u_tint"),1),c.uniform2f(c.getUniformLocation(f.shadeProgram,"u_resolution"),a,s),c.uniform1f(c.getUniformLocation(f.shadeProgram,"u_time"),_(n.simulationTimeSeconds,_(e.simulationTimeSeconds,0))),c.uniform1f(c.getUniformLocation(f.shadeProgram,"u_lineInterval"),_(e.lineInterval,_(e.scalarFieldLineInterval,_(e.depthRange,228.79605)/20))),c.uniform1f(c.getUniformLocation(f.shadeProgram,"u_lineOffset"),_(e.lineOffset,_(e.startDepth,2.310401))),c.uniform1f(c.getUniformLocation(f.shadeProgram,"u_lineWidth"),_(e.lineWidth,.3)),c.uniform1f(c.getUniformLocation(f.shadeProgram,"u_lineFade"),_(e.lineFade,5)),c.uniform1f(c.getUniformLocation(f.shadeProgram,"u_angleWidth"),_(e.angleWidth,.05)),c.uniform1f(c.getUniformLocation(f.shadeProgram,"u_angleFade"),_(e.angleFade,1.15)),c.uniform1f(c.getUniformLocation(f.shadeProgram,"u_dangerSteepness"),_(e.dangerSteepness,1.5)),c.uniform1f(c.getUniformLocation(f.shadeProgram,"u_scale"),_(e.isolineScale,2.6924083)),V(c,f.shadeProgram,"u_baseColor",q(e.scalarFieldBaseColor,[.002,.006,.012])),V(c,f.shadeProgram,"u_fieldGlowColor",q(e.scalarFieldGlowColor,[.018,.05,.075])),V(c,f.shadeProgram,"u_lineLowColor",q(e.scalarFieldLowLineColor,[0,.34,.52])),V(c,f.shadeProgram,"u_lineHighColor",q(e.scalarFieldHighLineColor,[1.45,.3,.05])),V(c,f.shadeProgram,"u_angleLowColor",q(e.scalarFieldLowAngleColor,[.06,.16,.24])),V(c,f.shadeProgram,"u_angleHighColor",q(e.scalarFieldHighAngleColor,[1.1,.24,.04])),c.uniform1f(c.getUniformLocation(f.shadeProgram,"u_tintScale"),_(e.vectorFieldTintScale,.45)),c.bindBuffer(c.ARRAY_BUFFER,f.quadBuffer);const d=c.getAttribLocation(f.shadeProgram,"a_position");return c.enableVertexAttribArray(d),c.vertexAttribPointer(d,2,c.FLOAT,!1,0,0),c.drawArrays(c.TRIANGLES,0,6),t.drawImage(f.canvas,0,0,a,s),!0}function Jt(t,e,n,i,o){const a=[],s=[];return Zt(a,t,e,n),Qt(s,t,o),{gravity:new Float32Array(a),tint:new Float32Array(s)}}function Zt(t,e,n,i,o){const a=_(n.terrainRadius,_(e.terrainRadius,1200)),s=_(n.terrainDepth,_(e.terrainDepth,-8));s!==0&&at(t,0,0,Math.max(1,a*2),Math.max(1,a*2),-s,0,0,1,Math.max(1e-4,_(n.terrainDepthExponent,_(e.terrainDepthExponent,1.2))),0,1,0,0);for(const l of i)at(t,l.x,l.y,Math.max(1,l.radius),Math.max(1,l.radius),-l.depth,0,0,1,Math.max(1e-4,l.exponent),0,1,0,0),l.waveRadius>0&&l.waveDepth!==0&&at(t,l.x,l.y,l.waveRadius,l.waveRadius,-l.waveDepth,0,0,1,8,4,_(n.terrainWaveFrequency,_(e.terrainWaveFrequency,.6)),l.waveSpeed,0)}function Qt(t,e,n){const i=ne(n?.splats),o=Array.isArray(n?.layers)?n.layers:[],a=new Set,s=re(e.vectorFieldLayer,e.tintFieldLayer,"fog.tint");o.forEach((E,H)=>{const tt=ie(E?.layerKey,"");_(E?.channel,-1)===4&&tt===s&&a.add(H)});const l=Math.max(0,oe(i.count,0));if(l<=0||a.size===0)return;const f=k(i.centerX),c=k(i.centerY),r=k(i.halfExtentX),d=k(i.halfExtentY),u=k(i.rotationCos),h=k(i.rotationSin),y=k(i.channel),b=k(i.falloff),v=k(i.valueR),C=k(i.valueG),A=k(i.valueB),N=k(i.valueA),O=k(i.sourceKind),W=k(i.frequencyX),Y=k(i.animationSpeed),j=k(i.sourceFlags),z=k(i.layerIndex);for(let E=0;ENumber(i));if(n.length>=3&&n.slice(0,3).every(Number.isFinite))return[n[0],n[1],n[2]]}if(typeof t=="string"){const n=t.split(/[,\s]+/).map(i=>Number(i)).filter(Number.isFinite);if(n.length>=3)return[n[0],n[1],n[2]]}return e}function V(t,e,n,i){t.uniform3f(t.getUniformLocation(e,n),i[0],i[1],i[2])}function k(t){return Array.isArray(t)?t.map(e=>_(e,0)):[]}function ne(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function ie(t,e){return t==null?e:String(t)}function re(...t){for(const e of t){if(typeof e=="string"&&e.trim())return e;if(typeof e=="number"&&Number.isFinite(e))return String(e)}return""}function oe(t,e){const n=Number(t);return Number.isFinite(n)?Math.max(0,Math.floor(n)):e}const ae=`#version 300 es +in vec2 a_corner; +in vec2 a_center; +in vec2 a_half; +in vec2 a_rot; +in vec4 a_meta; +in vec4 a_source; +in vec4 a_value; +uniform vec4 u_viewport; +out vec2 v_local; +out vec4 v_meta; +out vec4 v_source; +out vec4 v_value; +void main() { + vec2 scaled = a_corner * a_half; + vec2 world = a_center + vec2( + scaled.x * a_rot.x - scaled.y * a_rot.y, + scaled.x * a_rot.y + scaled.y * a_rot.x + ); + vec2 clip = vec2( + ((world.x - u_viewport.x) / max(0.0001, u_viewport.z - u_viewport.x)) * 2.0 - 1.0, + ((world.y - u_viewport.y) / max(0.0001, u_viewport.w - u_viewport.y)) * 2.0 - 1.0 + ); + gl_Position = vec4(clip, 0.0, 1.0); + v_local = a_corner; + v_meta = a_meta; + v_source = a_source; + v_value = a_value; +}`,ce=`#version 300 es +precision highp float; +in vec2 v_local; +in vec4 v_meta; +in vec4 v_source; +in vec4 v_value; +uniform float u_time; +out vec4 outColor; +float hash21(vec2 p) { + p = fract(p * vec2(123.34, 456.21)); + p += dot(p, p + 45.32); + return fract(p.x * p.y); +} +float valueNoise(vec2 p) { + vec2 i = floor(p); + vec2 f = fract(p); + float a = hash21(i); + float b = hash21(i + vec2(1.0, 0.0)); + float c = hash21(i + vec2(0.0, 1.0)); + float d = hash21(i + vec2(1.0, 1.0)); + vec2 u = f * f * (3.0 - 2.0 * f); + return mix(mix(a, b, u.x), mix(c, d, u.x), u.y) * 2.0 - 1.0; +} +float powerPulse(float x, float power) { + x = clamp(abs(x), 0.0, 1.0); + return pow((x + 1.0) * (1.0 - x), max(0.0001, power)); +} +void main() { + float d = length(v_local); + if (d > 1.0) discard; + float alpha = powerPulse(d, v_meta.x); + if (alpha <= 0.0001) discard; + float source = 1.0; + if (v_source.x > 0.5 && v_source.x < 2.5) { + float timeOffset = v_source.x > 1.5 ? u_time * v_source.z : 0.0; + source = valueNoise(v_local * v_source.y + timeOffset); + if (v_source.w != 0.0) source = abs(source); + } else if (v_source.x > 3.5) { + source = cos(pow(d * 2.0, 1.25) * v_source.y + u_time * v_source.z); + } + outColor = v_value * alpha * source; +}`,se=`#version 300 es +in vec2 a_position; +out vec2 v_uv; +void main() { + v_uv = a_position * 0.5 + 0.5; + gl_Position = vec4(a_position, 0.0, 1.0); +}`,le=`#version 300 es +precision highp float; +uniform sampler2D u_field; +uniform sampler2D u_tint; +uniform vec2 u_resolution; +uniform float u_time; +uniform float u_lineInterval; +uniform float u_lineOffset; +uniform float u_lineWidth; +uniform float u_lineFade; +uniform float u_angleWidth; +uniform float u_angleFade; +uniform float u_dangerSteepness; +uniform float u_scale; +uniform vec3 u_baseColor; +uniform vec3 u_fieldGlowColor; +uniform vec3 u_lineLowColor; +uniform vec3 u_lineHighColor; +uniform vec3 u_angleLowColor; +uniform vec3 u_angleHighColor; +uniform float u_tintScale; +in vec2 v_uv; +out vec4 outColor; +vec2 calcGrad(vec2 uv, float me) { + vec2 texel = 1.0 / max(vec2(1.0), u_resolution); + float n = -texture(u_field, vec2(uv.x, uv.y + texel.y)).r; + float e = -texture(u_field, vec2(uv.x + texel.x, uv.y)).r; + return vec2(e - me, n - me); +} +void main() { + float height = -texture(u_field, v_uv).r; + vec4 tint = texture(u_tint, v_uv); + vec2 plan = calcGrad(v_uv, height); + float slope = max(length(plan), 0.00001); + vec3 color = u_baseColor; + float fieldGlow = smoothstep(0.0, u_lineInterval * 7.0, abs(height)); + color += u_fieldGlowColor * fieldGlow; + color += tint.rgb * clamp(tint.a, 0.0, 1.0) * u_tintScale; + + float dangerBlend = smoothstep(0.0, u_dangerSteepness, pow(slope / max(0.0001, u_scale), 2.0)); + vec3 baseLine = mix(u_lineLowColor, u_lineHighColor, dangerBlend); + vec3 angleLine = mix(u_angleLowColor, u_angleHighColor, dangerBlend) * clamp(slope / max(0.0001, u_scale), 0.0, 1.0); + + vec3 lines = vec3(0.0); + float interval = max(0.0001, abs(u_lineInterval)); + float nearestLine = abs(fract((height + u_lineOffset) / interval) - 0.5) * interval; + float lineDistance = nearestLine / slope; + float line = 1.0 - smoothstep(u_lineWidth, u_lineWidth * u_lineFade, lineDistance); + lines += line * baseLine; + + float angle = atan(plan.y, plan.x) / 3.1415926536 + 1.0; + float nearestAngle = abs(fract(angle * 6.0) - 0.5) / 6.0; + float angleMask = smoothstep(interval * 0.25, interval * 1.5, abs(height)); + float angleLineAmount = 1.0 - smoothstep(u_angleWidth, u_angleWidth * u_angleFade, nearestAngle); + lines += angleLineAmount * angleMask * angleLine; + + color += clamp(lines, 0.0, 1.7); + outColor = vec4(color, 1.0); +}`,Ut=new Set(["gamecult.fields.splats.v1","gamecult.fields.gravity.v1","gamecult.fields.objects.v1"]),de={pluginId:"fields.surface",capabilities:["field.surface2d","gravity.surface","field.scalar","field.vector","field.objects"],componentKinds:["field.surface2d","gravity.surface"],schemas:[...Ut],normalizeDocument:ht,renderComponent:ue};function ue(t,e,n,i,o,a){const s=document.createElement("canvas");s.className="cultui-gravity-surface",t.id&&(s.id=t.id),s.setAttribute("role","img"),s.setAttribute("aria-label",Ne(e.label,"gravity surface")),s.style.display="block",s.style.width="100%",s.style.height="100%",s.style.pointerEvents="none",a.applyGeneratedLayout(s,n,i);let l=!1;const f={},c=()=>pe(s,e,f,a.resolveAssetUrl),r=()=>{!s.isConnected||l||(l=!0,requestAnimationFrame(()=>{l=!1,s.isConnected&&c()}))};s.addEventListener("cultui:asset-loaded",r);let d=0,u;const h=()=>{d&&window.clearInterval(d),u?.disconnect(),s.removeEventListener("cultui:asset-loaded",r)},y=()=>{if(!s.isConnected){h();return}fe(t,e,o,a.providerId,f).then(v=>{v&&s.isConnected&&r()}).catch(v=>{f.lastError=v instanceof Error?v.message:String(v)})};typeof ResizeObserver<"u"&&(u=new ResizeObserver(r),u.observe(s)),r();const b=Math.max(33,Math.min(1e3,Be(e.stateRefreshMs,100)));return d=window.setInterval(y,b),queueMicrotask(y),window.setTimeout(r,300),window.setTimeout(r,1e3),s}async function fe(t,e,n,i,o){if(o.loading)return!1;const a=[ft(t,e,"renderSplats","renderSplatsDocumentId","renderSplatsSchemaId"),ft(t,e,"gravity","gravityDocumentId","gravitySchemaId"),ft(t,e,"objects","objectsDocumentId","objectsSchemaId")].filter(s=>!!s?.documentId);if(a.length===0)return!1;o.loading=!0;try{let s=!1;for(const l of a){const f=await n.documentResolver?.(l,t);let c=lt(ht(f?.schemaId||l.schemaId,f?.document));if(Object.keys(c).length===0&&(c=lt(ht(l.schemaId,await me(l,i||n.provider?.providerId)))),Object.keys(c).length===0)continue;const r=l.slotId==="renderSplats"?"renderSplats":l.slotId==="gravity"?"gravity":"objects",d=yt(o[r]?.frameId,-1),u=yt(c.frameId,d);o[r]=c,s||=u!==d}return o.lastLoadedAt=Date.now(),s}finally{o.loading=!1}}async function me(t,e){if(typeof fetch!="function"||typeof window>"u"||!e)return;const n=new URLSearchParams({documentId:t.documentId});t.schemaId&&n.set("schemaId",t.schemaId),t.slotId&&n.set("slotId",t.slotId);const i=await fetch(`/eir/document/${encodeURIComponent(e)}?${n.toString()}`,{cache:"no-store",headers:{Accept:"application/json"}});if(i.ok)return lt(await i.json()).document}function ft(t,e,n,i,o){const a=(t.embeddedDocuments||[]).find(l=>String(l?.slotId||"")===n),s=T(e[i],a?.documentId);if(s)return{documentId:s,schemaId:T(e[o],a?.schemaId),presentationKind:T(a?.presentationKind)||"data",slotId:n}}function ht(t,e){const n=Array.isArray(e)?e:void 0,i=n?n[0]:e?.schema,o=String(t||i||"");return!n||!Ut.has(o)?e:o==="gamecult.fields.splats.v1"?Ee(n):o==="gamecult.fields.gravity.v1"?Ce(n):Te(n)}function pe(t,e,n,i){const o=t.getBoundingClientRect(),a=Math.max(1,Math.floor(o.width||t.clientWidth||1)),s=Math.max(1,Math.floor(o.height||t.clientHeight||1)),l=Math.max(1,Math.min(2,window.devicePixelRatio||1)),f=Math.max(1,Math.floor(a*l)),c=Math.max(1,Math.floor(s*l));(t.width!==f||t.height!==c)&&(t.width=f,t.height=c);const r=t.getContext("2d");if(!r)return;r.setTransform(l,0,0,l,0,0),r.clearRect(0,0,a,s);const d=_e(Ae(e),a,s),u=$t(n?.gravity),h=Se(n?.gravity)||xe(T(e.bodies,"")),y=Ie(n?.objects)||we(T(e.objects,""));Vt(r,e,u,h,d,a,s,n?.renderSplats)||he(r,e,a,s,"field.surface2d requires WebGL2 float render targets"),ge(r,h,e,d,a,s,i),be(r,y,e,d,a,s,i)}function he(t,e,n,i,o){t.save(),t.fillStyle=T(e.failureBackground,"rgba(0, 0, 0, 0.72)"),t.fillRect(0,0,n,i),t.font=T(e.failureFont,"700 13px Cascadia Mono, Consolas, monospace"),t.fillStyle=T(e.failureColor,"rgba(255, 184, 79, 0.95)"),t.fillText(o,16,28),t.restore()}function ge(t,e,n,i,o,a,s){for(const l of e){const f=zt(i,l.x,l.y,o,a),c=Math.max(18,Math.min(190,l.radius/Math.max(1,i.maxX-i.minX)*o*.32)),r=s(l.icon),d=l.kind.toLowerCase().includes("sun")?Math.max(I(n.sunIconMinPx,34),c*I(n.sunIconScale,.72)):Math.max(I(n.bodyIconMinPx,24),c*I(n.bodyIconScale,.48)),u=l.iconSize>0?l.iconSize:d;r&&ye(t,r,f.x,f.y,u,.92),l.key&&Wt(t,n,l.key.replace(/^local\./,""),f.x+c*.44,f.y-c*.48,T(n.bodyLabelColor,"rgba(226, 244, 255, 0.82)"))}}const st=new Map;function ye(t,e,n,i,o,a){let s=st.get(e);s||(s=new Image,s.decoding="async",s.onload=()=>requestAnimationFrame(()=>{t.canvas.dispatchEvent(new CustomEvent("cultui:asset-loaded"))}),s.src=e,st.set(e,s)),!(!s.complete||s.naturalWidth===0)&&(t.save(),t.globalAlpha=a,t.drawImage(s,n-o/2,i-o/2,o,o),t.restore())}function be(t,e,n,i,o,a,s){for(const l of e){const f=zt(i,l.x,l.y,o,a);if(f.x<-40||f.x>o+40||f.y<-40||f.y>a+40)continue;const c=l.kind.toLowerCase().includes("station")?I(n.stationIconSizePx,34):l.controlled?I(n.shipIconSizePx,22):I(n.remoteShipIconSizePx,18),r=ve(n,l.faction,l.controlled,l.visibility),d=s(l.icon);t.save(),t.globalAlpha=Math.max(.25,Math.min(1,l.visibility)),t.translate(f.x,f.y);const u=Math.atan2(l.directionY,l.directionX)+Math.PI/2;if(l.kind.toLowerCase().includes("ship")&&t.rotate(u),d){const h=st.get(d);if(h)h.complete&&h.naturalWidth>0&&t.drawImage(h,-c/2,-c/2,c,c);else{const y=new Image;y.decoding="async",y.onload=()=>t.canvas.dispatchEvent(new CustomEvent("cultui:asset-loaded")),y.src=d,st.set(d,y)}}t.restore(),Wt(t,n,l.label,f.x+c*.55,f.y-c*.45,r)}}function Wt(t,e,n,i,o,a){n&&(t.save(),t.font=T(e.objectLabelFont,"700 12px Ubuntu, system-ui, sans-serif"),t.textBaseline="middle",t.lineWidth=I(e.objectLabelStrokeWidth,3),t.strokeStyle=T(e.objectLabelStroke,"rgba(0, 0, 0, 0.72)"),t.fillStyle=a,t.strokeText(n,i,o),t.fillText(n,i,o),t.restore())}function ve(t,e,n,i){const o=Math.max(.25,Math.min(1,i));if(n)return et(T(t.objectControlledColor,"rgba(122, 240, 255, {alpha})"),o);const a=e.toLowerCase();return a.includes("raider")?et(T(t.objectRaiderColor,"rgba(255, 143, 74, {alpha})"),o):a.includes("neutral")?et(T(t.objectNeutralColor,"rgba(232, 232, 224, {alpha})"),o):et(T(t.objectDefaultColor,"rgba(214, 244, 255, {alpha})"),o)}function et(t,e){return t.replaceAll("{alpha}",String(e))}function xe(t){return t.split(";").map(e=>e.trim()).filter(Boolean).map(e=>{const n=e.split("|");return{key:n[0]??"",kind:n[1]??"",x:Number(n[2])||0,y:Number(n[3])||0,radius:Math.max(1,Number(n[4])||1),depth:Number(n[5])||0,exponent:Number(n[6])||1,waveRadius:Number(n[7])||0,waveDepth:Number(n[8])||0,waveSpeed:Number(n[9])||0,icon:n[10]??"",iconSize:Number(n[12])||0,tint:n[11]??""}})}function we(t){return t.split(";").map(e=>e.trim()).filter(Boolean).map(e=>{const n=e.split("|");return{key:n[0]??"",kind:n[1]??"",label:n[2]??"",x:Number(n[3])||0,y:Number(n[4])||0,directionX:Number(n[5])||0,directionY:Number(n[6])||1,faction:n[7]??"",controlled:n[8]==="1"||n[8]==="true",visibility:Number(n[9])||1,icon:n[10]??""}})}function Se(t){const e=Array.isArray(t?.gravityInfluences)?t.gravityInfluences:[],n=Array.isArray(t?.bodies)?t.bodies:[];if(e.length===0&&n.length===0)return;const i=new Map;for(const o of n){const a=T(o.bodyKey,o.name,"");a&&i.set(a,o)}return(e.length>0?e:n).map(o=>{const a=T(o.bodyKey,o.name,"body"),s=i.get(a),l=T(o.kind,"Body");return{key:a,kind:l,x:I(o.x,0),y:I(o.y,0),radius:Math.max(1,I(o.radius,80)),depth:I(o.gravityDepth,0),exponent:I(o.gravityDepthExponent,1),waveRadius:I(o.waveRadius,0),waveDepth:I(o.waveDepth,0),waveSpeed:I(o.waveSpeed,0),icon:gt(o.iconAsset)||gt(s?.iconAsset),iconSize:I(s?.iconSize,I(o.iconSize,0)),tint:""}})}function Ie(t){const e=Array.isArray(t?.objects)?t.objects:[];if(e.length!==0)return e.map(n=>{const i=T(n.kind,"object");return{key:T(n.entityKey,String(n.entityIndex??""),"object"),kind:i,label:T(n.displayName,n.entityKey,"object"),x:I(n.x,0),y:I(n.y,0),directionX:I(n.directionX,1),directionY:I(n.directionY,0),faction:T(n.factionKey,""),controlled:De(n.controlled),visibility:I(n.visibility,1),icon:gt(n.iconAsset)}})}function gt(t){const e=$t(t);return T(e.uri,"")}function Ae(t){const e=Math.max(1,I(t.viewRadius,Math.max(1200,I(t.terrainRadius,1200))));return{minX:I(t.minX,-e),minY:I(t.minY,-e),maxX:I(t.maxX,e),maxY:I(t.maxY,e)}}function _e(t,e,n){const i=Math.max(1e-4,t.maxX-t.minX),o=Math.max(1e-4,t.maxY-t.minY),a=Math.max(1e-4,e/Math.max(1,n)),s=i/o,l=(t.minX+t.maxX)*.5,f=(t.minY+t.maxY)*.5;if(a>s){const r=o*a;return{minX:l-r*.5,maxX:l+r*.5,minY:t.minY,maxY:t.maxY}}const c=i/a;return{minX:t.minX,maxX:t.maxX,minY:f-c*.5,maxY:f+c*.5}}function zt(t,e,n,i,o){return{x:(e-t.minX)/Math.max(1,t.maxX-t.minX)*i,y:(n-t.minY)/Math.max(1,t.maxY-t.minY)*o}}function Ee(t){const e=L(t[9]);return{schema:t[0],frameId:t[1],publishedAtUtc:t[2],simulationTimeSeconds:t[3],runId:t[4],zoneIndex:t[5],zoneName:t[6],viewport:vt(t[7]),layers:L(t[8]).map(Re),splats:{count:e[0]??0,centerX:e[1]||[],centerY:e[2]||[],halfExtentX:e[3]||[],halfExtentY:e[4]||[],rotationCos:e[5]||[],rotationSin:e[6]||[],channel:e[7]||[],falloff:e[8]||[],valueR:e[9]||[],valueG:e[10]||[],valueB:e[11]||[],valueA:e[12]||[],sourceKey:e[13]||[],layerIndex:e[14]||[],sourceKind:e[15]||[],frequencyX:e[16]||[],frequencyY:e[17]||[],phaseX:e[18]||[],phaseY:e[19]||[],animationSpeed:e[20]||[],sourceFlags:e[21]||[]}}}function Ce(t){return{schema:t[0],frameId:t[1],publishedAtUtc:t[2],simulationTimeSeconds:t[3],runId:t[4],zoneIndex:t[5],zoneName:t[6],viewport:vt(t[7]),gravityInfluences:L(t[8]).map(Fe),bodies:L(t[9]).map(Pe),terrainRadius:t[10],terrainDepth:t[11],terrainDepthExponent:t[12],terrainWaveFrequency:t[13]}}function Te(t){return{schema:t[0],frameId:t[1],publishedAtUtc:t[2],simulationTimeSeconds:t[3],runId:t[4],zoneIndex:t[5],zoneName:t[6],currentEntityKey:t[7],viewport:vt(t[8]),controlledEntityIndices:L(t[9]),objects:L(t[10]).map(ke)}}function vt(t){const e=L(t);return e.length?{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}:t}function Re(t){const e=L(t);return e.length?{layerKey:e[0],displayName:e[1],channel:e[2],blendMode:e[3],graphicsFormat:e[4],clearBeforeDraw:e[5],clearR:e[6],clearG:e[7],clearB:e[8],clearA:e[9]}:t}function Fe(t){const e=L(t);return e.length?{bodyKey:e[0],orbitKey:e[1],kind:e[2],x:e[3],y:e[4],radius:e[5],gravityDepth:e[6],gravityDepthExponent:e[7],waveRadius:e[8],waveDepth:e[9],waveSpeed:e[10]}:t}function Pe(t){const e=L(t);return e.length?{bodyKey:e[0],orbitKey:e[1],name:e[2],kind:e[3],x:e[4],y:e[5],radius:e[6],isAsteroidBelt:e[7],body:e[8],iconAsset:xt(e[9])}:t}function ke(t){const e=L(t);return e.length?{entityIndex:e[0],entityKey:e[1],displayName:e[2],kind:e[3],factionKey:e[4],x:e[5],y:e[6],z:e[7],directionX:e[8],directionY:e[9],velocityX:e[10],velocityY:e[11],controlled:e[12],targetEntityIndex:e[13],isActive:e[14],visibility:e[15],status:Me(e[16]),inventory:L(e[17]).map(Le),iconAsset:xt(e[18])}:t}function Me(t){const e=L(t);return e.length?{hull:e[0],shield:e[1],heat:e[2]}:t||{}}function Le(t){const e=L(t);return e.length?{source:e[0],itemKey:e[1],quantity:e[2],quality:e[3],durability:e[4],enabled:e[5],sourceIndex:e[6],x:e[7],y:e[8],iconAsset:xt(e[9])}:t}function xt(t){const e=L(t);return e.length?{assetKey:e[0],kind:e[1],uri:e[2],transport:e[3],contentHash:e[4],mimeType:e[5],metadata:e[6]||{}}:t||{}}function L(t){return Array.isArray(t)?t:[]}function lt(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function T(...t){for(const e of t)if(typeof e=="string"&&e.trim())return e.trim();return""}function Ne(t,e){return typeof t=="string"&&t?t:e}function Be(t,e){const n=Number(t);return Number.isFinite(n)&&n>0?Math.floor(n):e}function yt(t,e){const n=Number(t);return Number.isFinite(n)?n:e}const $t=lt,I=yt;function De(t){return typeof t=="boolean"?t:typeof t=="number"?t!==0:typeof t=="string"&&["1","true","yes","on"].includes(t.trim().toLowerCase())}const Ue=[de],We={"--bg":"#020909","--bg-top":"#020909","--bg-mid":"#020909","--bg-bottom":"#020909","--shell-top":"#010707","--shell-bottom":"#010707","--panel":"#071918","--panel-2":"#0a2423","--line":"rgba(103, 240, 228, 0.28)","--line-deep":"rgba(103, 240, 228, 0.18)","--text":"#e7f1f1","--text-bright":"#e7f1f1","--quiet":"#8ba5a3","--accent":"#ffb84f","--accent-strong":"#ffb84f","--corner-accent":"#ffb84f","--cyan":"#8efcff","--shadow":"rgba(0, 0, 0, 0.35)","--pixel-grid":"rgba(142, 252, 255, 0.04)","--border-width":"1px","--border-bottom-width":"1px","--corner-accent-size":"0","--font-body":'"M PLUS 1", "Ubuntu Sans", Ubuntu, "Noto Sans JP", system-ui, sans-serif',"--font-title":'"Montserrat", "Zen Kaku Gothic New", "M PLUS 1", "Ubuntu Sans", system-ui, sans-serif',"--font-mono":'"Ubuntu Sans Mono", "M PLUS 1 Code", "Cascadia Mono", Consolas, monospace'};let nt,Kt=wt(void 0),Z,U={};const Ft=new WeakMap;function ze(t,e,n={}){if(Ft.get(e)?.dispose(),Z=t,U=n,Kt=wt(t.surface?.styles),globalThis.__eveCurrentMesh=t.mesh,on(t.surface?.styles,n.body??document.body),n.body&&(n.body.dataset.provider=t.providerId||n.provider?.providerId||""),n.statusElement&&(n.statusElement.textContent=`${t.title||t.surface?.title||"surface"}${n.source?` (${n.source})`:""}`),t.surface?.root){if(e.replaceChildren(P(t.surface.root,n)),n.stateBindingResolver){const i=new Ke(t,e,n);Ft.set(e,i),i.start()}}else e.replaceChildren(X("No surface root"));return e}function $e(t,e,n){const i=e.targetProp.split(".").filter(Boolean);if(i.length===0)throw new Error("Eve state binding targetProp must not be empty.");t.props||={};let o=t.props;for(const a of i.slice(0,-1)){const s=o[a];(!s||typeof s!="object"||Array.isArray(s))&&(o[a]={}),o=o[a]}o[i[i.length-1]]=n}class Ke{surface;host;options;disposed=!1;unsubscribers=[];constructor(e,n,i){this.surface=e,this.host=n,this.options=i}async start(){const e=this.options.stateBindingResolver,n=this.surface.surface?.root;if(!(!e||!n))for(const i of Gt(n))for(const o of i.stateBindings||[]){if(this.disposed)return;const a=await e(o,i);if(!a||this.disposed)continue;const s=l=>{this.disposed||($e(i,o,l),this.renderCanonicalProjection())};if(s(await a.latest()),this.disposed)return;this.unsubscribers.push(a.watch(s))}}dispose(){this.disposed=!0;for(const e of this.unsubscribers.splice(0))e()}renderCanonicalProjection(){const e=this.surface.surface?.root;e&&this.host.replaceChildren(P(e,this.options))}}function*Gt(t){yield t;for(const e of t.children||[])yield*Gt(e)}function P(t,e=U){const n=t.kind||"panel",i=x(t.props),o=x(t.layout),a=x(t.style),s=t.children||[],l=t.embeddedDocuments||[];if(n==="surface"||n==="cockpit"||n==="dashboard"){const r=m("section","cultui-surface-root eve-surface");w(r,t),typeof o.direction=="string"?r.dataset.direction=o.direction:typeof i.layout=="object"&&i.layout&&typeof i.layout.direction=="string"&&(r.dataset.direction=String(i.layout.direction)),n!=="surface"&&(r.dataset.surfaceKind=n),S(r,o,a);for(const d of s)r.append(P(d,e));return r}if(n==="column"||n==="row"||n==="form"||n==="rail"){const r=m("div",`cultui-partition eve-${n}`);w(r,t),r.dataset.direction=n==="row"||n==="rail"?"horizontal":"vertical",n==="rail"&&(r.dataset.overflow="x"),rt(r,{...o,...i}),S(r,o,a);for(const d of s)r.append(P(d,e));return r}if(n==="grid"){const r=m("section","cultui-grid"),d=B(i.columns,0);d>0?r.style.gridTemplateColumns=`repeat(${d}, minmax(0, 1fr))`:typeof i.columns=="string"&&(r.style.gridTemplateColumns=i.columns);const u=B(i.rows,0);u>0&&(r.style.gridTemplateRows=`repeat(${u}, minmax(0, auto))`),S(r,o,a);for(const h of s)r.append(P(h,e));return r}if(n==="partition"){const r=m("section",`cultui-partition split-${g(i.split,"none")}`);w(r,t),rt(r,i),S(r,o,a),r.style.minWidth="0",g(i.split,"none")==="x"&&!p(i.flexWrap,o.flexWrap,"")&&(r.style.flexWrap="wrap"),typeof i.role=="string"&&(r.dataset.role=i.role);for(const d of s)r.append(P(d,e));return r}if(n==="input.binding-map")return tn(t,i,e);if(n==="inventory.drag_session")return qe(t,i,o,a);if(n==="inventory.grid")return Ve(t,i,o,a,e);if(n==="inventory.item")return Je(t,i,o,a);const f=(e.pluginAdapters||Ue).find(r=>r.componentKinds.includes(n));if(f?.renderComponent)return f.renderComponent(t,i,o,a,e,{applyGeneratedLayout:S,providerId:Z?.providerId||e.provider?.providerId,resolveAssetUrl:J});if(n==="world.scene3d"||n==="world.scene2d")return Xe(t,i,o,a,e);if(n==="image.background"){const r=m("div","cultui-background"),d=J(p(i.src,i.assetUri,i.assetRef,""));return d&&(r.style.backgroundImage=`url("${d}")`),r.setAttribute("aria-label",g(i.label,"background")),r}if(n==="image.sprite"){const r=m("figure",`cultui-sprite ${g(i.slot,"center")}`);w(r,t);const d=J(p(i.src,i.assetUri,i.assetRef,""));if(d){const u=m("img");u.src=d,u.alt=g(i.alt,g(i.actor,g(i.label,""))),r.append(u)}return r}if(n==="avatar"){const r=m("figure","cultui-avatar-card");w(r,t);const d=J(p(i.src,i.assetUri,i.assetRef,""));if(d){const b=m("img");b.src=d,b.alt=g(i.alt,g(i.text,g(i.label,""))),r.append(b)}else r.append(m("div","cultui-avatar-fallback",yn(p(i.text,i.label,i.actor,"?"))));const u=p(i.text,i.label,i.actor,"");u&&r.append(m("figcaption","cultui-avatar-name",u));const h=p(i.status,"");h&&r.append(m("div","cultui-avatar-status",h));const y=p(i.detail,"");return y&&r.append(m("div","cultui-avatar-detail",y)),r}if(n==="pane"||n==="panel"){const r=m("section","pane cultui-pane");w(r,t);const d=g(i.span,"");d&&(r.dataset.span=d);const u=g(i.density,"");u&&(r.dataset.density=u);const h=g(i.title,t.text||"");h&&r.append(m("h2","",h));for(const y of s)r.append(P(y,e));return r}if(n==="list"||n.endsWith(".roster")){const r=m("section","cultui-list");w(r,t),r.dataset.componentKind=n;const d=g(i.title,"");d&&r.append(m("h3","cultui-list-title",d));for(const[u,h]of hn(i.items).entries())r.append(P({id:`${t.id||"list"}-item-${u}`,kind:"list.item",props:{...h}},e));for(const u of s)r.append(P(u,e));return r}if(n==="list.item"||n.endsWith(".item")){const r=Xt(t),d=m("article","cultui-list-item");w(d,t),d.dataset.componentKind=n;const u=m("div","cultui-list-item-heading");if(u.append(m("strong","cultui-list-item-label",r.label)),r.status&&u.append(m("span","cultui-list-item-status",r.status)),d.append(u),r.detail&&d.append(m("div","cultui-list-item-detail",r.detail)),r.badges.length){const h=m("div","cultui-list-item-badges");for(const y of r.badges)h.append(m("span","cultui-list-item-badge",y));d.append(h)}for(const h of s)d.append(P(h,e));return d}if(n==="bar"){const r=m("div","cultui-meter");w(r,t);const d=g(i.label,""),u=g(i.value,"");if(d||u){const b=m("div","cultui-meter-head");b.append(m("span","",d)),b.append(m("strong","",u)),r.append(b)}const h=m("div","cultui-meter-track"),y=m("span","cultui-meter-fill");return y.style.width=`${Bt(i.percent)}%`,h.append(y),r.append(h),r}if(n==="card"){const r=Lt(i,t),d=r?m("button","card cultui-card cultui-card-button"):m("article","card cultui-card");w(d,t),S(d,o,a),d instanceof HTMLButtonElement&&(d.type="button");const u=g(i.title,t.text||"");u&&d.append(m("div","card-title",u));for(const h of s)d.append(P(h,e));return r&&Nt(d,t,r,i,e),d}if(n==="control.button"){const r=m("button","cultui-button eve-control-button",g(i.label,"Action"));return w(r,t),r.type="button",S(r,o,a),Nt(r,t,Lt(i,t),i,e),r}if(n==="control.popup"){const r=m("button","cultui-button eve-control-popup",g(i.label,"Open"));return w(r,t),r.type="button",S(r,o,a),r.addEventListener("click",d=>{en(t,e,r,d.clientX,d.clientY)}),r}if(n==="text.dialogue"||n==="text"||n==="text.title"||n==="text.subtitle"||n==="label"){const r=m("div",dn(n,i),g(i.value,g(i.text,t.text||"")));return w(r,t),rt(r,i),S(r,o,a),r}if(n==="metric"){const r=m("dl","metric cultui-reactive-metric eve-metric");return w(r,t),S(r,o,a),r.append(m("dt","",g(i.label,"Metric"))),r.append(m("dd","metric-value",g(i.value,""))),r}if(n==="progress"){const r=m("div","cultui-meter eve-progress");w(r,t),S(r,o,a);const d=g(i.label,""),u=g(i.value,""),h=Number(i.min??0),y=Number(i.max??1),b=Number(i.value??0),v=Number.isFinite(b)&&Number.isFinite(h)&&Number.isFinite(y)&&y!==h?(b-h)/(y-h)*100:Bt(i.percent);if(d||u){const N=m("div","cultui-meter-head");N.append(m("span","",d)),N.append(m("strong","",u)),r.append(N)}const C=m("div","cultui-meter-track"),A=m("span","cultui-meter-fill");return A.style.width=`${Math.max(0,Math.min(100,v))}%`,C.append(A),r.append(C),r}if(n==="modal"){const r=m("section","cultui-modal-surface");w(r,t),S(r,o,a);const d=g(i.title,"");d&&r.append(m("h2","cultui-modal-surface-title",d));for(const u of s)r.append(P(u,e));return r}if(n==="options"){const r=m("section","cultui-options");w(r,t),S(r,o,a);const d=g(i.label,"");d&&r.append(m("h3","cultui-list-title",d));for(const u of s)r.append(P(u,e));return s.length===0&&r.append(X("waiting for options")),r}if(n==="image.preview"){const r=m("figure","cultui-image-preview");w(r,t);const d=m("div","cultui-image-frame"),u=J(p(i.src,i.assetUri,i.assetRef,""));if(u){const h=m("img");h.src=u,h.alt=g(i.label,""),h.style.imageRendering=g(i.imageRendering,"auto"),i.zoom!==void 0&&(h.style.transform=`scale(${i.zoom})`,h.style.transformOrigin=g(i.crop,"50% 50%")),d.append(h)}else d.append(m("span","",g(i.label,"image")));return r.append(d),i.label&&r.append(m("figcaption","",String(i.label))),r}if(n==="canvas.preview"||n==="canvas.editor"){const r=m("div",`cultui-canvas-placeholder ${n==="canvas.editor"?"editor":"preview"}`);return w(r,t),r.append(m("div","viz-label",g(i.label,"Canvas"))),r.append(m("div","cultui-canvas-grid",i.state==="empty"?"waiting for pixels":g(i.state,""))),r}if(n==="surface.slot"){const r=m("section","cultui-embedded-slot");w(r,t),S(r,o,a),r.dataset.slotId=g(i.slotId,g(l[0]?.slotId,"")),r.dataset.documentId=g(i.documentId,g(l[0]?.documentId,"")),r.dataset.schemaId=g(i.schemaId,g(l[0]?.schemaId,"")),r.dataset.presentationKind=g(i.presentationKind,g(l[0]?.presentationKind,""));const d=l.map(h=>x(h.surface)).find(h=>x(h.root).kind||h.root),u=i.modal===!0||r.dataset.presentationKind.includes("modal");if((d||r.dataset.documentId)&&u){const h=m("button","cultui-button cultui-modal-trigger",g(i.label,r.dataset.slotId||"Configure"));h.type="button",h.addEventListener("click",()=>jt(bt(t,e),e)),r.append(h)}else if(d||r.dataset.documentId){const h=m("div","cultui-embedded-slot-body");h.append(m("div","detail","materializing surface")),r.append(h),bt(t,e).then(y=>{h.replaceChildren(y?.root?P(y.root,e):X("Embedded surface unavailable"))}).catch(y=>{h.replaceChildren(X(`Embedded surface failed: ${y instanceof Error?y.message:String(y)}`))})}else r.append(m("div","detail",r.dataset.presentationKind||r.dataset.slotId||"embedded surface"));return r}if(n==="control.slider")return cn(i,s,e);if(n==="control.toggle"){const r=m("label","toggle-row cultui-toggle");return w(r,t),r.append(m("span","field-control",i.value?"on":"off")),r.append(m("span","toggle-copy",g(i.label,"Toggle"))),r}if(n==="input.number"||n==="input.select"||n==="control.range"||n==="control.input.text"||n==="control.select"){const r=m("label","field cultui-field");return w(r,t),rt(r,i),S(r,o,a),r.append(m("span","field-label",g(i.label,""))),r.append(m("span","field-control cultui-field-value",i.value===void 0?"":String(i.value))),r}if(n==="color.swatch"){const r=m("div","paint-swatch cultui-swatch");return w(r,t),r.style.background=g(i.value,g(i.color,"currentColor")),r.title=g(i.label,"Color"),r}const c=m("section","pane");w(c,t),c.append(m("h2","",n));for(const r of s)c.append(P(r,e));return c}function Xt(t){const e=x(t.props);return{label:p(e.label,e.title,e.displayName,t.text,t.kind,"item"),status:p(e.status,e.state,""),detail:p(e.detail,e.phase,e.repoName,""),badges:Array.isArray(e.badges)?e.badges.map(n=>String(n).trim()).filter(Boolean):p(e.badges,"").split(",").map(n=>n.trim()).filter(Boolean)}}function S(t,e,n={}){const i=p(e.display,"");i&&(t.style.display=i);const o=p(e.direction,"");o&&(t.style.flexDirection=o==="horizontal"?"row":o==="vertical"?"column":o);const a=p(e.flexWrap,"");a&&(t.style.flexWrap=a);const s=p(e.gridTemplateColumns,"");s&&(t.style.gridTemplateColumns=s);const l=p(e.gridTemplateRows,"");l&&(t.style.gridTemplateRows=l);const f=p(e.gridTemplateAreas,"");f&&(t.style.gridTemplateAreas=f);const c=p(e.gridArea,"");c&&(t.style.gridArea=c);const r=p(e.placeItems,"");r&&(t.style.placeItems=r),M(t,"gap",p(e.gap,"")),M(t,"padding",p(e.padding,"")),M(t,"margin",p(e.margin,"")),M(t,"top",p(e.top,"")),M(t,"right",p(e.right,"")),M(t,"bottom",p(e.bottom,"")),M(t,"left",p(e.left,"")),M(t,"width",p(e.width,"")),M(t,"minWidth",p(e.minWidth,"")),M(t,"maxWidth",p(e.maxWidth,"")),M(t,"height",p(e.height,"")),M(t,"minHeight",p(e.minHeight,"")),M(t,"maxHeight",p(e.maxHeight,""));const d=p(e.alignItems,"");d&&(t.style.alignItems=d);const u=p(e.justifyContent,"");u&&(t.style.justifyContent=u);const h=p(e.alignSelf,"");h&&(t.style.alignSelf=h);const y=p(e.overflow,"");y&&(t.style.overflow=y);const b=p(e.overflowX,"");b&&(t.style.overflowX=b);const v=p(e.overflowY,"");v&&(t.style.overflowY=v);const C=p(e.position,"");C&&(t.style.position=C);const A=p(e.cursor,"");A&&(t.style.cursor=A);const N=p(n.background,"");N&&(t.style.background=ct(N));const O=p(n.color,"");O&&(t.style.color=ct(O)),M(t,"borderWidth",p(n.borderWidth,""));const W=p(n.borderColor,"");W&&(t.style.borderColor=ct(W));const Y=p(n.borderStyle,"");Y&&(t.style.borderStyle=Y),M(t,"borderRadius",p(n.borderRadius,""));const j=p(n.boxShadow,"");j&&(t.style.boxShadow=j);const z=p(n.font,"");z&&(t.style.font=z),M(t,"fontSize",p(n.fontSize,""));const E=p(n.fontWeight,"");E&&(t.style.fontWeight=E);const H=p(n.textTransform,"");H&&(t.style.textTransform=H);const tt=p(n.textAlign,"");tt&&(t.style.textAlign=tt);const ut=p(n.whiteSpace,"");ut&&(t.style.whiteSpace=ut);const At=p(n.overflow,"");At&&(t.style.overflow=At);const _t=p(n.textOverflow,"");_t&&(t.style.textOverflow=_t),M(t,"lineHeight",p(n.lineHeight,""))}function M(t,e,n){n&&(t.style[e]=R(n))}function F(t,e){const n={};for(const[i,o]of Object.entries(t))i.startsWith(e)&&(n[i.slice(e.length)]=o);return n}function Ge(t){const e=(t.children||[]).filter(u=>u.kind==="world.entity3d"),n=e.map(u=>He(x(u.props).position,[0,0,0])),i=n.map(u=>u[0]),o=n.map(u=>u[2]),a=Math.min(...i,-1),s=Math.max(...i,1),l=Math.min(...o,-1),f=Math.max(...o,1),c=Math.max(1,s-a),r=Math.max(1,f-l),d=6;return e.map((u,h)=>{const y=x(u.props);return{entityId:p(y.entityId,u.id),faction:g(y.faction,"neutral"),kind:g(y.entityKind,"entity"),label:p(y.label,y.entityId,u.id,"Entity"),controlled:St(y.controllable),xPercent:d+(n[h][0]-a)/c*(100-d*2),yPercent:d+(1-(n[h][2]-l)/r)*(100-d*2),source:u}})}function Xe(t,e,n,i,o){const a=m("section","cultui-world-scene");w(a,t),S(a,n,i),a.tabIndex=0,a.setAttribute("aria-label",g(e.label,"Interactive world"));const s=Ge(t),l=s.find(r=>r.controlled),f=m("div","cultui-world-heading");f.append(m("strong","",g(e.label,"World"))),f.append(m("span","",`${s.length} entities`)),a.append(f);const c=m("div","cultui-world-plane");for(const r of s){const d=m("button",`cultui-world-entity faction-${Pt(r.faction)} kind-${Pt(r.kind)}`);d.type="button",d.style.left=`${r.xPercent}%`,d.style.top=`${r.yPercent}%`,d.dataset.entityId=r.entityId,d.dataset.controlled=r.controlled?"true":"false",d.title=r.label,d.setAttribute("aria-label",`${r.label}, ${r.kind}, ${r.faction}`),d.append(m("span","cultui-world-entity-glyph",je(r.kind))),d.append(m("span","cultui-world-entity-label",r.label));const u=x(r.source.props),h=p(u.targetCommand,e.targetCommand,u.focusCommand,e.focusCommand);h&&d.addEventListener("click",()=>mt(h,{actorEntityId:l?.entityId||p(e.playerEntityId),entityId:r.entityId,targetEntityId:r.entityId,targetEntityKey:r.entityId},r.source,o)),c.append(d)}return a.append(c),a.addEventListener("keydown",r=>{const d=Ye(r.key);if(d){r.preventDefault();const h=p(e.movementCommand,x(l?.source.props).moveCommand);h&&mt(h,{actorEntityId:l?.entityId||p(e.playerEntityId),actorEntityKey:l?.entityId||p(e.playerEntityId),directionX:d[0],directionY:d[1],scalar:1},t,o);return}const u=r.key===" "?p(e.actionCommand,x(l?.source.props).actionCommand):r.key.toLowerCase()==="f"?p(e.focusCommand,x(l?.source.props).focusCommand):"";u&&(r.preventDefault(),mt(u,{actionId:r.key===" "?"0":"focus",actorEntityId:l?.entityId||p(e.playerEntityId),actorEntityKey:l?.entityId||p(e.playerEntityId)},t,o))}),a}function mt(t,e,n,i){i.commandSink?.(Oe(t,e,i),n)}function Oe(t,e,n=U){return Q(t,{action:e},n)}function Ye(t){switch(t.toLowerCase()){case"w":case"arrowup":return[0,1];case"s":case"arrowdown":return[0,-1];case"a":case"arrowleft":return[-1,0];case"d":case"arrowright":return[1,0];default:return}}function je(t){return t.includes("station")?"S":t.includes("projectile")?".":t.includes("ship")?"^":"+"}function Pt(t){return t.toLowerCase().replace(/[^a-z0-9_-]+/g,"-")}function G(t,e){const n=Number(t);return Number.isFinite(n)?n:e}function He(t,e){if(Array.isArray(t)){const n=t.map(i=>Number(i));if(n.length>=3&&n.slice(0,3).every(Number.isFinite))return[n[0],n[1],n[2]]}if(typeof t=="string"){const n=t.split(/[,\s]+/).map(i=>Number(i)).filter(Number.isFinite);if(n.length>=3)return[n[0],n[1],n[2]]}return e}function qe(t,e,n,i){const o=St(e.active),a=m("section","cultui-inventory-drag");w(a,t),S(a,n,i),a.dataset.active=o?"true":"false";const s=m("div","cultui-inventory-section-label","Drag");if(S(s,F(n,"sectionLabel."),F(i,"sectionLabel.")),a.append(s),!o){const d=m("div","cultui-inventory-empty","None");return S(d,F(n,"empty."),F(i,"empty.")),a.append(d),a}const l=p(e.itemKey,e.item,"item"),f=m("div","cultui-inventory-drag-chip",l);S(f,F(n,"dragChip."),F(i,"dragChip.")),a.append(f);const c=[e.originOffsetX,e.originOffsetY].map(d=>Number(d)).map(d=>Number.isFinite(d)?d:0),r=m("div","cultui-inventory-meta",`origin ${c[0]}, ${c[1]}`);return S(r,F(n,"meta."),F(i,"meta.")),a.append(r),a}function Ve(t,e,n,i,o){const a=m("section","cultui-inventory-grid");w(a,t),S(a,n,i);const s=B(p(e.columns,e.gridColumns,e.widthCells,""),0),l=s>0?s:6,f=B(e.rows,0),c=f>0?f:Math.max(3,Math.ceil(Math.max((t.children||[]).length,1)/l));a.style.setProperty("--inventory-columns",String(l)),a.style.setProperty("--inventory-rows",String(c)),a.dataset.cellSpriteMode=g(e.cellSpriteMode,"");const r=p(e.title,e.label,"Inventory"),d=m("div","cultui-inventory-section-label",r);S(d,F(n,"sectionLabel."),F(i,"sectionLabel.")),a.append(d);const u=m("div","cultui-inventory-board");u.style.display="grid",u.style.gridTemplateColumns=`repeat(${l}, ${R(p(e.cellSize,"72"))})`,u.style.gridTemplateRows=`repeat(${c}, ${R(p(e.cellSize,"72"))})`,u.style.gap=R(p(e.cellGap,"4")),u.style.overflow=p(e.boardOverflow,"auto"),u.style.padding=R(p(e.boardPadding,"4")),S(u,F(n,"board."),F(i,"board.")),u.addEventListener("dragover",b=>{Ze(e)&&(b.preventDefault(),b.dataTransfer&&(b.dataTransfer.dropEffect="move"))}),u.addEventListener("drop",b=>{const v=b.dataTransfer?.getData("application/vnd.gamecult.eve.inventory-item+json")||"";if(!v)return;let C;try{C=JSON.parse(v)}catch{return}const A=u.getBoundingClientRect(),N=Math.max(1,G(e.cellSize,72)),O=Math.max(0,G(e.cellGap,4)),W=N+O,Y=Math.max(0,Math.min(l-1,Math.floor((b.clientX-A.left)/W))),j=Math.max(0,Math.min(c-1,Math.floor((b.clientY-A.top)/W))),z=Qe(C,e,Y,j,o);z&&(b.preventDefault(),o.commandSink?.(z,t))});const h=new Set;for(const b of t.children||[]){const v=x(b.props),C=B(v.x,0),A=B(v.y,0);h.add(`${C}:${A}`),u.append(P(b,o))}const y=Math.min(l*c,256);for(let b=0;b{!a.draggable||!y.dataTransfer||(y.dataTransfer.effectAllowed="move",y.dataTransfer.setData("application/vnd.gamecult.eve.inventory-item+json",JSON.stringify(e)))});let f=B(e.shapeWidth,1),c=B(e.shapeHeight,1);const r=p(e.rotation,"").toLowerCase();["clockwise","counterclockwise","right","left","rotate90","rotate270"].includes(r)&&([f,c]=[c,f]),a.style.gridColumn=`${s+1} / span ${f}`,a.style.gridRow=`${l+1} / span ${c}`;const d=m("span","cultui-inventory-item-icon");S(d,F(n,"icon."),F(i,"icon.")),d.textContent=gn(p(e.iconAssetUri,e.iconAssetKey,e.itemKey,e.label,"")),a.append(d);const u=p(e.label,e.itemKey,"");if(u){const y=m("span","cultui-inventory-item-label",u);S(y,F(n,"label."),F(i,"label.")),a.append(y)}const h=Number(e.quantity);if(Number.isFinite(h)&&h>1){const y=m("span","cultui-inventory-item-quantity",String(h));S(y,F(n,"quantity."),F(i,"quantity.")),a.append(y)}return a.title=[u,p(e.source,""),p(e.quality,"")?`quality ${e.quality}`:"",p(e.durability,"")?`durability ${e.durability}`:""].filter(Boolean).join(" | "),a}function Ze(t){return Object.entries(t).some(([e,n])=>(e==="dropCommand"||e.startsWith("dropCommand."))&&typeof n=="string"&&n.length>0)}function Qe(t,e,n,i,o=U){const a=p(t.sourceKind,t.source,""),s=p(e[`dropCommand.${a}`],e.dropCommand,"");if(!a||!s)return;const l=G(t.sourceIndex,-1),f=G(e.targetIndex,-1),c=p(e.targetKind,""),r={sourceKind:a,originEntityKey:p(t.sourceEntityKey,t.entityKey,""),originIndex:l,originCargoIndex:a==="cargo"?l:-1,itemKey:p(t.itemKey,""),quantity:Math.max(1,G(t.quantity,1)),sourceX:G(t.x,-2147483648),sourceY:G(t.y,-2147483648),destinationKind:c,destinationEntityKey:p(e.targetEntityKey,e.entityKey,""),destinationIndex:f,destinationCargoIndex:c==="cargo"?f:-1,destinationX:Math.trunc(n),destinationY:Math.trunc(i),hasDestinationPosition:!0};return Q(s,{action:r},o)}function tn(t,e,n){const i=m("section","cultui-binding-map");w(i,t);const o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("class","cultui-xbox-controller"),o.setAttribute("viewBox","0 0 780 420"),o.setAttribute("role","img"),o.setAttribute("aria-label",g(e.label,"Xbox controller remapping")),o.innerHTML=rn(),i.append(o);const a=m("div","cultui-binding-overlay");for(const s of t.children||[]){const l=x(s.props),f=g(l.target,s.id||""),c=m("button","cultui-binding-box");w(c,s),c.type="button",c.dataset.target=f,c.dataset.kind=g(l.bindingKind,"button"),c.style.left=R(l.x??"50%"),c.style.top=R(l.y??"50%"),c.append(m("span","cultui-binding-target",g(l.label,f))),c.append(m("span","cultui-binding-source",g(l.current,"unmapped"))),c.addEventListener("click",()=>{const d=Yt(s);if(Ot(s)||d?.documentId)jt(bt(s,n),n);else{const u=g(l.commandId,"");u&&n.commandSink?.(Q(u,l,n),s)}}),a.append(c);const r=document.createElementNS("http://www.w3.org/2000/svg","line");r.setAttribute("class","cultui-binding-line"),r.setAttribute("x1",g(l.anchorX,"390")),r.setAttribute("y1",g(l.anchorY,"210")),r.setAttribute("x2",String(Mt(l.x,780))),r.setAttribute("y2",String(Mt(l.y,420))),o.append(r)}return i.append(a),i}function Ot(t){for(const e of t.embeddedDocuments||[]){const n=x(e.surface);if(n.root)return n}}function Yt(t){const e=(t.embeddedDocuments||[])[0],n=x(t.props),i=p(n.documentId,e?.documentId,"");if(i)return{documentId:i,presentationKind:p(n.presentationKind,e?.presentationKind,""),schemaId:p(n.schemaId,e?.schemaId,""),slotId:p(n.slotId,e?.slotId,"")}}async function bt(t,e){const n=Ot(t);if(n)return n;const i=Yt(t);if(!i?.documentId||!e.documentResolver)return;const o=await e.documentResolver(i,t);if(o)return x(o.surface).root?o.surface:o}function jt(t,e){const n=m("div","cultui-modal-backdrop"),i=m("section","cultui-modal");i.setAttribute("role","dialog"),i.setAttribute("aria-modal","true");const o=m("header","cultui-modal-header");o.append(m("h2","","Configure Binding"));const a=m("button","cultui-modal-close","Close");a.type="button",a.addEventListener("click",()=>n.remove()),o.append(a);const s=m("div","cultui-modal-body");i.append(o,s),n.append(i),n.addEventListener("click",l=>{l.target===n&&n.remove()}),document.body.append(n),s.append(m("div","detail","materializing document")),Promise.resolve(t).then(l=>{o.querySelector("h2").textContent=l?.title||"Configure Binding",s.replaceChildren(l?.root?P(l.root,e):X("Embedded document unavailable"))}).catch(l=>{s.replaceChildren(X(`Embedded document failed: ${l instanceof Error?l.message:String(l)}`))})}function en(t,e,n,i,o){const a=x(t.props),s=(t.children||[])[0],l=x(s?.props),f=p(l.anchor,a.anchor,"trigger"),c=p(l.placement,a.placement,"below-start"),r=Number(p(l.offsetX,a.offsetX,"0"))||0,d=Number(p(l.offsetY,a.offsetY,"4"))||0,u=m("div","cultui-modal-backdrop");u.style.background="transparent",u.style.placeItems="start";const h=m("section","cultui-modal");h.setAttribute("role","dialog"),h.setAttribute("aria-modal","true"),h.style.position="fixed",h.style.width="min(420px, calc(100vw - 24px))",h.style.maxHeight="min(620px, calc(100vh - 24px))";const y=m("header","cultui-modal-header");y.append(m("h2","",p(l.title,a.title,a.label,"Options")));const b=m("button","cultui-modal-close","Close");b.type="button",b.addEventListener("click",()=>u.remove()),y.append(b);const v=m("div","cultui-modal-body");if(s){const A=s.children||[];A.length>0?v.replaceChildren(...A.map(N=>P(N,e))):v.append(P(s,e))}else v.append(X("Popup has no content"));h.append(y,v),u.append(h),u.addEventListener("click",A=>{A.target===u&&u.remove()}),document.body.append(u);const C=nn(f,c,n,h,i,o,r,d);h.style.left=`${C.left}px`,h.style.top=`${C.top}px`}function nn(t,e,n,i,o,a,s,l){const f=n.getBoundingClientRect(),c=i.getBoundingClientRect(),r=c.width||420,d=c.height||320,u=t==="cursor"?{left:o,right:o,top:a,bottom:a}:f;if(e==="right-down"||e==="dropdown")return it(u,r,d,s,l,"right","down");if(e==="left-down")return it(u,r,d,s,l,"left","down");if(e==="right-up")return it(u,r,d,s,l,"right","up");if(e==="left-up")return it(u,r,d,s,l,"left","up");switch(e){case"above-start":return D(u.left+s,u.top-d-l,r,d);case"above-end":return D(u.right-r+s,u.top-d-l,r,d);case"below-end":return D(u.right-r+s,u.bottom+l,r,d);case"right-start":return D(u.right+s,u.top+l,r,d);case"left-start":return D(u.left-r-s,u.top+l,r,d);case"center":return D((window.innerWidth-r)/2+s,(window.innerHeight-d)/2+l,r,d);default:return D(u.left+s,u.bottom+l,r,d)}}function it(t,e,n,i,o,a,s){const f=window.innerWidth-t.right-i-12,c=t.left-i-12,r=window.innerHeight-t.top-o-12,d=t.bottom-o-12,u=a==="right"?f>=e||f>=c:!(c>=e||c>=f),h=s==="down"?r>=n||r>=d:!(d>=n||d>=r),y=u?t.right+i:t.left-e-i,b=h?t.top+o:t.bottom-n-o;return D(y,b,e,n)}function D(t,e,n,i){return{left:kt(t,12,window.innerWidth-n-12),top:kt(e,12,window.innerHeight-i-12)}}function kt(t,e,n){return n + + + + + + + + + + + + + + + + + YBXA + `}function on(t,e=document.body){const n=wt(t),i=document.documentElement.style;ln(n.assets.fontCss);for(const[c,r]of Object.entries(We))i.setProperty(c,r);const o={colorBackground:"--bg",colorBackgroundTop:"--bg-top",colorBackgroundMid:"--bg-mid",colorBackgroundBottom:"--bg-bottom",colorShellSurfaceTop:"--shell-top",colorShellSurfaceBottom:"--shell-bottom",colorPanel:"--panel",colorPanelAlt:"--panel-2",colorPanelBorder:"--line",colorPanelBorderDeep:"--line-deep",colorText:"--text",colorTextBright:"--text-bright",colorMuted:"--quiet",colorAccent:"--accent",colorAccentStrong:"--accent-strong",colorCornerAccent:"--corner-accent",colorLink:"--cyan",colorShadow:"--shadow",colorPixelGrid:"--pixel-grid"};for(const[c,r]of Object.entries(o)){const d=n.tokens[c];d!==void 0&&i.setProperty(r,String(d))}const a=n.tokens.fontBody,s=n.tokens.fontDisplay,l=n.tokens.fontTitle,f=n.tokens.fontMono;a&&i.setProperty("--font-body",ot(String(a))),s&&i.setProperty("--font-title",ot(String(s))),l&&i.setProperty("--font-title",ot(String(l))),f&&i.setProperty("--font-mono",ot(String(f))),n.tokens.borderWidthPx&&i.setProperty("--border-width",`${n.tokens.borderWidthPx}px`),n.tokens.borderBottomWidthPx&&i.setProperty("--border-bottom-width",`${n.tokens.borderBottomWidthPx}px`),n.tokens.cornerAccentPx&&i.setProperty("--corner-accent-size",`${n.tokens.cornerAccentPx}px`),e.dataset.pixelArt=n.tokens.pixelArt||n.tokens.imageRendering==="pixelated"?"true":"false",e.dataset.scanlines=n.tokens.scanlineOverlay?"true":"false"}function Q(t,e={},n=U){const i=x(e.action),o=n.provider?.providerId||Z?.providerId||"surface unknown",a=n.activeSurfaceId||Z?.surface?.id||n.provider?.surfaces?.[0]?.surfaceId||o,s=an(n,a),l=p(s.commandBoundary,e.commandBoundary,i.commandBoundary,i.target),f=p(s.receiptSchema,e.receiptSchema,i.receiptSchema),c={type:"surface-command",schema:"gamecult.eve.command_invocation.v1",providerId:o,surfaceId:a,command:t||g(i.type,"invoke"),payload:{...i,transport:e.transport??null},issuedAt:new Date().toISOString(),clientId:n.clientId||"eve.browser"};return l&&(c.commandBoundary=l),f&&(c.receiptSchema=f),c}function an(t,e){const n=[...t.provider?.surfaces||[],...t.provider?.localAdvertisement?.surfaces||[]];return n.find(i=>i.surfaceId===e&&i.worldInteraction)?.worldInteraction||n.find(i=>i.worldInteraction)?.worldInteraction||{}}function Lt(t,e){const n=x(t.action);return g(t.command,g(t.commandId,g(n.command,g(n.target,g(n.type,e?.commandId||"")))))}function X(t){const e=m("section","pane");return e.append(m("h2","","No Surface")),e.append(m("div","detail",t)),e}function Nt(t,e,n,i,o){t.dataset.commandId=n,t.tabIndex=t instanceof HTMLButtonElement?t.tabIndex:0;const a=()=>{const s=Q(n,i,o);o.commandSink?.(s,e)};t.addEventListener("click",a),t.addEventListener("keydown",s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),a())})}function cn(t,e,n){const i=sn(t,e),o=x(i.find(u=>u.kind==="control.box")?.props),a=i.filter(u=>u.kind==="control.part"),s=Number(t.min??0),l=Number(t.max??1),f=m("div","cultui-slider");f.dataset.skin=g(t.skin,"default"),f.dataset.bind=g(t.bind,""),un(f,o);const c=m("div","cultui-slider-visual"),r=m("input","cultui-slider-input");r.type="range",r.min=String(s),r.max=String(l),r.step=String(t.step??.01),r.setAttribute("aria-label",g(t.bind,"slider"));for(const u of a){const h=x(u.props),y=m("span",`cultui-slider-part ${g(h.name,"part")}`);fn(y,h),c.append(y)}return a.some(u=>x(u.props).name==="track")||c.append(m("span","cultui-slider-part track")),a.some(u=>x(u.props).name==="fill")||c.append(m("span","cultui-slider-part fill")),a.some(u=>x(u.props).name==="thumb")||c.append(m("span","cultui-slider-part thumb")),f.append(c,r),(u=>{const h=Number(u??s),y=Math.max(s,Math.min(l,Number.isFinite(h)?h:s)),b=l===s?0:(y-s)/(l-s)*100;r.value=String(y),f.style.setProperty("--cultui-slider-value",`${b}%`),f.dataset.value=String(y)})(t.value??s),r.addEventListener("input",()=>{const u=Q(g(t.command,"control.slider.input"),{...t,action:{...x(t.action),value:Number(r.value)},value:Number(r.value)},n);n.commandSink?.(u,{kind:"control.slider",props:t})}),f}function sn(t,e){const n=typeof t.skin=="string"?t.skin:"",o=[...n?Kt.controlSkins[n]?.children||[]:[],...e];return o.length?o:[{kind:"control.box",props:{height:18,overflow:"visible"}},{kind:"control.part",props:{name:"track",anchor:"center",size:["100%",6],radius:2,fill:"color.panelInset"}},{kind:"control.part",props:{name:"fill",anchor:["left","center"],size:["value%",6],radius:2,fill:"color.accent"}},{kind:"control.part",props:{name:"thumb",anchor:["value","center"],size:[12,12],bleed:3,radius:999,fill:"color.accent"}}]}function wt(t){if(Array.isArray(t)){const e={},n={};for(const i of t)i?.name&&(i.name==="font.web.google"&&typeof i.value=="string"?n.fontCss=i.value:e[i.name]=i.value);return{tokens:e,assets:n,controlSkins:{}}}return{tokens:x(t?.tokens),assets:x(t?.assets),controlSkins:x(t?.controlSkins)}}function J(t){if(!t)return"";const e=U.assetUrlResolver;return e?e(t,Z):/^(https?:|data:|blob:)/i.test(t)?t:U.assetBaseUrl&&t.startsWith("/")?`${U.assetBaseUrl.replace(/\/+$/,"")}${t}`:t}function ln(t){const e=typeof t=="string"?t.trim():"";if(nt?.dataset.href===e||(nt?.remove(),nt=void 0,!e))return;const n=document.createElement("link");n.rel="preconnect",n.href="https://fonts.gstatic.com",n.crossOrigin="anonymous",document.head.append(n);const i=document.createElement("link");i.rel="stylesheet",i.href=e,i.dataset.href=e,document.head.append(i),nt=i}function dn(t,e,n){const i=[];return(t==="text.title"||e.role==="title")&&i.push("cultui-title","eve-text-title"),t==="text.subtitle"&&i.push("eve-text-subtitle"),t==="label"&&i.push("cultui-label"),e.role==="mono"&&i.push("detail","mono"),i.length===0&&i.push("detail","eve-text"),i.join(" ")}function un(t,e){e.height!==void 0&&(t.style.minHeight=R(e.height)),e.width!==void 0&&(t.style.width=R(e.width)),typeof e.overflow=="string"&&(t.style.overflow=e.overflow)}function fn(t,e){const n=Array.isArray(e.size)?e.size:[e.size,void 0];n[0]!==void 0&&n[0]!=="value%"&&(t.style.width=R(n[0])),n[1]!==void 0&&(t.style.height=R(n[1])),e.radius!==void 0&&(t.style.borderRadius=R(e.radius)),e.fill!==void 0&&(t.style.background=ct(String(e.fill))),e.bleed!==void 0&&t.style.setProperty("--part-bleed",R(e.bleed)),(Array.isArray(e.anchor)?e.anchor:[e.anchor]).includes("value")&&(t.dataset.anchorValue="true")}function rt(t,e){e.gap!==void 0&&(t.style.gap=R(e.gap)),e.padding!==void 0&&(t.style.padding=R(e.padding)),e.size!==void 0&&(t.style.flex=mn(e.size)),e.min!==void 0&&(t.style.minWidth=R(e.min)),e.max!==void 0&&(t.style.maxWidth=R(e.max)),e.align!==void 0&&(t.style.alignItems=e.align==="end"?"flex-end":String(e.align)),(e.clip==="true"||e.clip===!0)&&(t.style.overflow="hidden"),e.scroll==="y"&&(t.style.overflowY="auto"),e.scroll==="x"&&(t.style.overflowX="auto")}function mn(t){return typeof t=="string"&&t.endsWith("fr")?`${Number(t.slice(0,-2))||1} 1 0`:t==="auto"||t==="content"?"0 0 auto":`0 0 ${R(t)}`}function R(t){return Array.isArray(t)?t.map(R).join(" "):typeof t=="number"?`${t}px`:typeof t=="string"&&/^-?\d+(\.\d+)?$/.test(t)?`${t}px`:String(t??"")}function ct(t){return{"color.accent":"var(--accent)","color.panelInset":"rgba(0, 0, 0, 0.34)","color.panel":"var(--panel)","color.text":"var(--text)"}[t]||t}function ot(t){return t.includes("Zen Kaku Gothic New")||t.includes("M PLUS 1")?t:t.includes("Montserrat")?`${t}, "Zen Kaku Gothic New", "M PLUS 1", "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif`:t.includes("Ubuntu")?`${t}, "M PLUS 1", "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif`:`${t}, "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif`}function w(t,e){e.id&&(t.id=e.id),e.id&&(t.dataset.eveNodeId=e.id),e.kind&&(t.dataset.eveKind=e.kind)}function x(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function pn(t){return Array.isArray(t)?t:[]}function hn(t){return pn(t).map((e,n)=>Xt({kind:"list.item",props:x(e)}))}function g(t,e){return t==null?e:String(t)}function p(...t){for(const e of t){if(typeof e=="string"&&e.trim())return e;if(typeof e=="number"&&Number.isFinite(e))return String(e)}return""}function St(t){return typeof t=="boolean"?t:typeof t=="number"?t!==0:typeof t=="string"?["1","true","yes","on"].includes(t.trim().toLowerCase()):!1}function B(t,e){const n=Number(t);return Number.isFinite(n)?Math.max(0,Math.floor(n)):e}function gn(t){const e=t.toLowerCase();return e.includes("sensor")?"S":e.includes("thermal")?"T":e.includes("fuel")?"F":e.includes("cargo")?"C":e.includes("weapon")?"W":t.trim().slice(0,1).toUpperCase()||"?"}function yn(t){const e=t.trim().split(/\s+/).filter(Boolean);return e.length&&e.slice(0,2).map(n=>n[0]?.toUpperCase()||"").join("")||"?"}function Bt(t){const e=Number(t);return Number.isFinite(e)?Math.max(0,Math.min(100,e)):0}function m(t,e="",n=""){const i=document.createElement(t);return e&&(i.className=e),n&&(i.textContent=n),i}const bn=document.querySelector("#surface"),dt=document.querySelector("#status"),Dt=document.querySelector("#receipt");let It=0,vn="player";async function Ht(){const t=await fetch("/api/surface");if(t.status===401){dt.textContent="This laboratory requires an unused invite link.";return}const e=await t.json();It=Number(e.version??0),ze(e,bn,{body:document.body,clientId:"ghostlight.browser",statusElement:dt})}async function qt(t){dt.textContent="The world is considering the command…";const e=await fetch("/api/command",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),n=await e.json();if(Dt.hidden=!1,Dt.textContent=JSON.stringify(n,null,2),!e.ok){dt.textContent=n.error??"The command was refused.";return}await Ht()}document.querySelector("#composer").addEventListener("submit",t=>{t.preventDefault();const e=document.querySelector("#attempt").value.trim();e&&qt({type:"assess",expected_revision:It,intent:{actor_id:vn,description:e,intended_effect:e}})});document.querySelector("#wait").addEventListener("click",()=>{qt({type:"wait",expected_revision:It,minutes:60})});Ht(); diff --git a/web/dist/assets/index-CyG_836Q.css b/web/dist/assets/index-CyG_836Q.css new file mode 100644 index 0000000..a0f8ce0 --- /dev/null +++ b/web/dist/assets/index-CyG_836Q.css @@ -0,0 +1 @@ +@import"https://fonts.googleapis.com/css2?family=M+PLUS+1:wght@100;300;400;500;700&family=Montserrat:wght@100;300;400;500;700&family=Ubuntu+Sans:wght@300;400;500;700&family=Zen+Kaku+Gothic+New:wght@300;400;500;700&display=swap";@import"https://fonts.googleapis.com/css2?family=Crimson+Pro:opsz,wght@8..144,400;8..144,600&family=IBM+Plex+Mono:wght@400;600&display=swap";:root{color-scheme:dark;--bg: #020909;--bg-top: var(--bg);--bg-mid: var(--bg);--bg-bottom: var(--bg);--shell-top: #010707;--shell-bottom: #010707;--panel: #071918;--panel-2: #0a2423;--line: rgba(103, 240, 228, .28);--line-deep: rgba(103, 240, 228, .18);--line-hot: rgba(142, 252, 255, .72);--text: #e7f1f1;--text-bright: var(--text);--quiet: #8ba5a3;--accent: #ffb84f;--accent-strong: var(--accent);--corner-accent: var(--accent);--cyan: #8efcff;--shadow: rgba(0, 0, 0, .35);--pixel-grid: rgba(142, 252, 255, .04);--border-width: 1px;--border-bottom-width: var(--border-width);--corner-accent-size: 0;--font-body: "M PLUS 1", "Ubuntu Sans", Ubuntu, "Noto Sans JP", system-ui, sans-serif;--font-title: "Montserrat", "Zen Kaku Gothic New", "M PLUS 1", "Ubuntu Sans", system-ui, sans-serif;--font-mono: "Ubuntu Sans Mono", "M PLUS 1 Code", "Cascadia Mono", Consolas, monospace}*{box-sizing:border-box}body{margin:0;min-height:100vh;background:linear-gradient(180deg,var(--bg-top),var(--bg-mid),var(--bg-bottom));color:var(--text);font-family:var(--font-body)}.topbar{height:84px;display:flex;justify-content:space-between;align-items:center;padding:10px 16px;border-bottom:1px solid var(--line);background:linear-gradient(180deg,var(--shell-top),var(--shell-bottom))}h1{margin:0;font-size:20px;letter-spacing:0}p{margin:4px 0 0;color:var(--quiet);font-size:13px}.hud{min-width:168px;padding:8px;border:1px solid var(--line-hot);border-radius:6px;background:#071918e0;color:var(--accent);font-family:Cascadia Mono,Consolas,monospace;font-size:11px;display:grid;gap:2px}.provider-bar{display:flex;align-items:center;gap:8px;padding:10px 16px;border-bottom:1px solid var(--line-deep);background:color-mix(in srgb,var(--panel) 70%,transparent)}.provider-bar label{color:var(--quiet);font:700 11px var(--font-mono);text-transform:uppercase}.provider-bar select{border:1px solid var(--line);border-radius:6px;background:var(--panel);color:var(--text);padding:8px 12px;font:700 13px var(--font-mono);min-width:min(28rem,52vw)}.provider-meta{color:var(--quiet);font:600 11px var(--font-mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.surface{padding:10px 16px 16px}.cockpit{display:grid;grid-template-columns:.78fr 1.08fr 1.34fr;gap:10px;min-height:calc(100vh - 138px)}.ctb{grid-column:1 / -1;min-height:88px;overflow-x:auto;display:flex;gap:8px;padding-bottom:8px}.pane{min-height:0;border:1px solid var(--line);border-radius:6px;background:#071918eb;padding:12px;box-shadow:0 12px 26px var(--shadow)}.pane h2{margin:0 0 10px;color:var(--quiet);font-size:12px;font-weight:500;text-transform:uppercase}.card{border:1px solid var(--line);border-radius:6px;background:#0a2423f5;padding:10px;box-shadow:0 8px 20px var(--shadow)}.cultui-card[data-command-id]{cursor:pointer;border-bottom-width:var(--border-bottom-width)}.cultui-card-button{display:block;width:100%;color:inherit;font:inherit;text-align:left}.ctb .card{flex:0 0 96px;min-height:76px;padding:6px}.avatar{width:34px;height:34px;border-radius:50%;border:1px solid var(--line-hot);object-fit:cover;background:#123}.card-title{white-space:pre-line;margin-top:4px;font:700 11px var(--font-mono)}.health{color:var(--accent);font:700 10px var(--font-mono)}.detail{white-space:pre-wrap;font:600 12px var(--font-mono);line-height:1.45}.list{display:grid;gap:8px}.metrics{display:grid;gap:9px;margin:12px 0}.metric label{display:flex;justify-content:space-between;color:var(--quiet);font:700 10px var(--font-mono)}.bar{height:7px;border-radius:7px;background:#010707;border:1px solid rgba(255,255,255,.12);overflow:hidden}.bar span{display:block;height:100%;background:linear-gradient(90deg,#bca8ff,#8efcff)}.graph{position:relative;min-height:calc(100vh - 166px);border:1px solid var(--line);border-radius:6px;background:linear-gradient(var(--pixel-grid) 1px,transparent 1px),linear-gradient(90deg,var(--pixel-grid) 1px,transparent 1px),#030f11f0;background-size:44px 44px}.node{position:absolute;transform:translate(-50%,-50%);border:1px solid var(--line);border-radius:7px;background:#0a2423f2;padding:10px;overflow:hidden}.node.selected{border-color:var(--line-hot);box-shadow:0 0 0 1px #8efcff61}.node .detail{margin-top:6px;color:var(--quiet);font-size:10px}@media(max-width:900px){.cockpit{grid-template-columns:1fr}}.cultui-vn-stage{position:relative;min-height:calc(100vh - 138px);overflow:hidden;border:1px solid var(--line);border-radius:6px;background:var(--bg)}.cultui-grid{min-height:calc(100vh - 138px);display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:10px;align-content:start}.cultui-surface-root{min-height:calc(100vh - 150px);display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px;align-content:start}.cultui-surface-root[data-direction=vertical]{grid-template-columns:minmax(0,1fr)}.cultui-surface-root[data-direction=horizontal]{grid-template-columns:repeat(auto-fit,minmax(260px,1fr))}.cultui-embedded-slot .cultui-surface-root{min-height:0;grid-template-columns:minmax(0,1fr)}@media(max-width:900px){.cultui-pane[data-span=wide]{grid-column:1 / -1}}.cultui-pane{border-width:var(--border-width);border-bottom-width:var(--border-bottom-width);min-width:0}.cultui-pane[data-span=wide]{grid-column:span 2}.cultui-pane .cultui-pane{box-shadow:none;background:#030f1161}.cultui-pane[data-density=compact]{padding:8px}.cultui-pane[data-density=compact] h2{margin-bottom:6px}.cultui-partition{min-width:0;min-height:0;display:flex;gap:10px}.cultui-partition[data-direction=horizontal]{flex-direction:row}.cultui-partition[data-direction=vertical]{flex-direction:column}.cultui-partition[data-overflow=x]{overflow-x:auto;padding-bottom:4px}.cultui-partition.split-x{flex-direction:row}.cultui-partition.split-y,.cultui-partition.split-none{flex-direction:column}.cultui-partition.split-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}.cultui-partition[data-role="inspector.row"]{min-height:34px;border:1px solid rgba(255,255,255,.06);border-radius:4px;background:linear-gradient(180deg,#201f2bf5,#13141df5);box-shadow:inset 0 1px #ffffff0d,0 2px 8px #0006}.cultui-partition[data-role="inspector.label"]{justify-content:center}.cultui-label{color:var(--accent);font:700 13px var(--font-mono);line-height:1.15;text-transform:uppercase}.cultui-slider{--cultui-slider-value: 0%;--part-bleed: 0px;position:relative;display:grid;align-items:center;width:100%;min-height:18px;overflow:visible}.cultui-slider-visual{position:absolute;inset:0;overflow:visible;pointer-events:none}.cultui-slider-input{position:absolute;inset:0;opacity:0;cursor:pointer}.cultui-slider-part{position:absolute;top:50%;display:block;transform:translateY(-50%)}.cultui-slider-part.track{right:0;left:0;height:6px;border-radius:2px;background:#00000057}.cultui-slider-part.fill{left:0;width:var(--cultui-slider-value);height:6px;border-radius:2px;background:var(--accent)}.cultui-slider-part.thumb{left:var(--cultui-slider-value);width:12px;height:12px;border-radius:999px;background:var(--accent);transform:translate(-50%,-50%);box-shadow:0 0 7px color-mix(in srgb,var(--accent) 45%,transparent)}.cultui-slider-part[data-anchor-value=true]{left:var(--cultui-slider-value);transform:translate(-50%,-50%)}@media(max-width:520px){.cultui-partition[data-role="inspector.row"]{flex-direction:column;align-items:stretch}.cultui-partition[data-role="inspector.label"]{flex:0 0 auto!important}}body[data-provider=repixelizer] .surface{position:relative}body[data-provider=repixelizer] .surface:after{content:"";pointer-events:none;position:fixed;inset:0;background:repeating-linear-gradient(0deg,rgba(255,255,255,.035) 0 1px,transparent 1px 4px);opacity:.28;mix-blend-mode:screen}body[data-pixel-art=true] img,body[data-pixel-art=true] .cultui-background{image-rendering:pixelated}.cultui-title{color:var(--accent);font:100 18px var(--font-title);line-height:1.35}.mono{color:var(--accent);font-family:var(--font-mono)}.cultui-reactive-metric{margin-top:8px}.cultui-reactive-list{display:grid;gap:8px}.cultui-list{display:grid;gap:8px;min-width:0}.cultui-list-title{margin:0;color:var(--quiet);font:700 10px var(--font-mono);letter-spacing:0;text-transform:uppercase}.cultui-list-item{display:grid;gap:5px;min-width:0;padding:8px;border:1px solid var(--line);border-radius:6px;background:var(--panel)}.cultui-list-item-heading,.cultui-list-item-badges{display:flex;gap:6px;align-items:center;flex-wrap:wrap;min-width:0}.cultui-list-item-label{min-width:0;overflow-wrap:anywhere}.cultui-list-item-status,.cultui-list-item-badge{padding:2px 5px;border:1px solid var(--line-hot);border-radius:4px;color:var(--quiet);font:600 10px var(--font-mono)}.cultui-list-item-detail{color:var(--quiet);font-size:12px;overflow-wrap:anywhere}.cultui-avatar-card{flex:0 0 104px;display:grid;gap:4px;align-content:start;min-height:92px;margin:0;padding:8px;border:1px solid var(--line);border-radius:6px;background:#0a2423f0;box-shadow:0 8px 20px var(--shadow)}.cultui-avatar-card img,.cultui-avatar-fallback{width:34px;height:34px;border:1px solid var(--line-hot);border-radius:50%;object-fit:cover;background:#010707db}.cultui-avatar-fallback{display:grid;place-items:center;color:var(--accent);font:700 12px var(--font-mono)}.cultui-avatar-name{color:var(--text-bright);font:700 11px var(--font-mono);line-height:1.15}.cultui-avatar-status,.cultui-avatar-detail{color:var(--quiet);font:700 10px var(--font-mono);line-height:1.2}.cultui-avatar-status{color:var(--accent)}.cultui-meter{display:grid;gap:4px}.cultui-meter-head{display:flex;justify-content:space-between;gap:8px;color:var(--quiet);font:700 10px var(--font-mono)}.cultui-meter-track{height:7px;overflow:hidden;border:1px solid rgba(255,255,255,.12);border-radius:7px;background:#010707e0}.cultui-meter-fill{display:block;height:100%;background:linear-gradient(90deg,#ffb84f,#8efcff)}.cultui-stream-item{border-left:2px solid var(--line-hot);padding-left:8px}.cultui-background{position:absolute;inset:0;background-size:cover;background-position:center;image-rendering:pixelated;opacity:.72}.cultui-graph{position:absolute;top:18px;left:18px;width:min(48rem,46vw);height:min(29rem,52vh);z-index:4}.cultui-placed{position:absolute;transform-origin:center}.cultui-placed[data-placement-mode=keystone],.cultui-placed[data-placement-mode=skew],.cultui-placed[data-placement-mode=sprite-chromakey]{box-shadow:0 12px 26px #00000047}.cultui-placed[data-chroma-key]{outline:1px dashed rgba(0,255,120,.45)}.cultui-node{position:absolute;transform:translate(-50%,-50%);border:2px solid var(--cyan);border-radius:999px;background:#07111ac2;color:var(--text);min-width:68px;min-height:44px;padding:8px 10px;font:700 12px Cascadia Mono,Consolas,monospace}.cultui-node.selected{border-color:var(--accent);box-shadow:0 0 0 2px #ffb84f47}.cultui-graph svg{position:absolute;inset:0;overflow:visible}.cultui-graph line{stroke:#8efcff5c;stroke-width:.006;stroke-linecap:round}.cultui-layer-embedded-surfaces{position:absolute;inset:0;z-index:5;pointer-events:none}.cultui-layer-embedded-surfaces>*{pointer-events:auto}.cultui-tex{min-width:12rem;min-height:3.2rem;border:1px solid rgba(142,252,255,.34);border-radius:6px;background:#07111ac7;color:var(--text);padding:10px 12px}.cultui-tex-label{color:var(--accent);font:700 10px Cascadia Mono,Consolas,monospace;text-transform:uppercase}.cultui-tex-source{margin-top:4px;font:700 15px "Cambria Math","STIX Two Math",Georgia,serif;white-space:pre-wrap}.cultui-layer-cards{position:absolute;top:18px;right:18px;left:calc(min(48rem,46vw) + 36px);z-index:3;display:grid;gap:10px}.cultui-dialogue{position:absolute;right:0;bottom:0;left:0;z-index:5;min-height:128px;border-right:0;border-bottom:0;border-left:0;border-radius:0;background:#05080deb}.cultui-rail-actions{position:absolute;right:18px;bottom:18px;z-index:6;display:grid;gap:8px;width:min(28rem,42vw)}.cultui-button{border:1px solid var(--line);border-radius:6px;background:#0a2423f0;color:var(--text);padding:9px 10px;text-align:left;font:700 12px Cascadia Mono,Consolas,monospace}.cultui-button:hover,.cultui-button:focus-visible{border-color:var(--line-hot);color:var(--accent)}.cultui-image-preview{display:grid;gap:8px;margin:0}.cultui-image-frame,.cultui-canvas-grid{display:grid;place-items:center;min-height:160px;border:2px solid var(--panel-border);background:repeating-linear-gradient(45deg,#f7efd80f 0 8px,#0000002e 8px 16px),linear-gradient(180deg,#07172c,#0a2039);overflow:hidden}.cultui-image-frame{aspect-ratio:1 / 1}.cultui-image-frame img{width:100%;height:100%;object-fit:cover}.cultui-image-preview figcaption,.cultui-canvas-grid{color:var(--muted);font-size:.75rem;line-height:1.25}.cultui-canvas-placeholder{display:grid;gap:8px}.cultui-canvas-placeholder.editor .cultui-canvas-grid{min-height:280px;background:linear-gradient(45deg,rgba(255,255,255,.08) 25%,transparent 25% 75%,rgba(255,255,255,.08) 75%),linear-gradient(45deg,rgba(255,255,255,.08) 25%,transparent 25% 75%,rgba(255,255,255,.08) 75%),#142033;background-position:0 0,8px 8px;background-size:16px 16px}.cultui-status-stage{display:grid;gap:8px;padding:12px;border:2px solid var(--panel-border);background:#061627eb}.cultui-field{display:grid;gap:4px}.cultui-field-value{display:block;border:2px solid var(--panel-border);background:#01040b94;padding:6px 8px}.cultui-world-scene{position:relative;z-index:2;width:100%;min-height:min(72vh,760px);overflow:hidden;outline:none;background:#02080c80}.cultui-world-scene:focus-visible{box-shadow:inset 0 0 0 2px var(--accent)}.cultui-world-heading{position:absolute;z-index:3;top:12px;left:12px;display:flex;gap:12px;align-items:baseline;color:var(--text);font-family:var(--font-mono);font-size:.75rem;pointer-events:none}.cultui-world-heading span{color:var(--quiet)}.cultui-world-plane{position:absolute;inset:0;background:linear-gradient(var(--pixel-grid) 1px,transparent 1px),linear-gradient(90deg,var(--pixel-grid) 1px,transparent 1px);background-size:48px 48px}.cultui-world-entity{position:absolute;display:grid;justify-items:center;width:34px;height:34px;padding:0;border:1px solid rgba(224,238,240,.65);border-radius:50%;color:#f1f5f4;background:#182226eb;transform:translate(-50%,-50%);cursor:pointer}.cultui-world-entity.faction-player{border-color:#54d9c7;color:#9ff8e8}.cultui-world-entity.faction-raider,.cultui-world-entity.faction-hostile{border-color:#ff695f;color:#ffaaa3}.cultui-world-entity[data-controlled=true]{box-shadow:0 0 0 3px #ffbe4866}.cultui-world-entity-glyph{align-self:center;font:700 16px/1 var(--font-mono)}.cultui-world-entity-label{position:absolute;top:38px;width:max-content;max-width:132px;overflow:hidden;color:var(--text);font:600 11px/1.2 var(--font-body);text-overflow:ellipsis;white-space:nowrap;pointer-events:none}.cultui-swatch{width:36px;min-height:36px;border:2px solid var(--accent);box-shadow:inset 0 0 0 2px #00000073}.cultui-binding-map{position:relative;min-height:510px;border:1px solid var(--line);border-radius:6px;background:linear-gradient(var(--pixel-grid) 1px,transparent 1px),linear-gradient(90deg,var(--pixel-grid) 1px,transparent 1px),#030f11eb;background-size:28px 28px;overflow:hidden}.cultui-xbox-controller{position:absolute;inset:18px;width:calc(100% - 36px);height:calc(100% - 36px)}.cultui-xbox-controller .shell,.cultui-xbox-controller .stick,.cultui-xbox-controller .dpad,.cultui-xbox-controller .face,.cultui-xbox-controller .menu,.cultui-xbox-controller .guide,.cultui-xbox-controller .bumper,.cultui-xbox-controller .trigger{fill:#0a2423f0;stroke:var(--line);stroke-width:3}.cultui-xbox-controller .stick-dot,.cultui-xbox-controller .guide{fill:#8efcff1f}.cultui-xbox-controller .face{fill:#ffb84f29}.cultui-xbox-controller text{fill:var(--text);font:700 16px var(--font-mono);text-anchor:middle}.cultui-binding-line{stroke:var(--accent);stroke-width:2;stroke-dasharray:5 6;opacity:.78}.cultui-binding-overlay{position:absolute;inset:0}.cultui-binding-box{position:absolute;width:clamp(112px,12vw,138px);min-height:50px;transform:translate(-50%,-50%);display:grid;gap:4px;border:1px solid var(--line-hot);border-radius:6px;background:#071918f5;color:var(--text);padding:8px;text-align:left;box-shadow:0 10px 20px var(--shadow)}.cultui-binding-box:hover,.cultui-binding-box:focus-visible{border-color:var(--accent);color:var(--accent)}.cultui-binding-target{font:700 11px var(--font-mono);text-transform:uppercase}.cultui-binding-source{color:var(--quiet);font:600 11px var(--font-mono);overflow-wrap:anywhere}.cultui-modal-backdrop{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;background:#00000094;padding:20px}.cultui-modal{width:min(680px,96vw);max-height:min(780px,92vh);display:grid;grid-template-rows:auto minmax(0,1fr);border:1px solid var(--line-hot);border-radius:6px;background:var(--panel);box-shadow:0 18px 42px #00000085;overflow:hidden}.cultui-modal-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;border-bottom:1px solid var(--line);background:var(--shell-top)}.cultui-modal-header h2{margin:0;color:var(--accent);font:700 13px var(--font-mono);text-transform:uppercase}.cultui-modal-close{border:1px solid var(--line);border-radius:6px;background:var(--panel-2);color:var(--text);padding:7px 10px;font:700 11px var(--font-mono)}.cultui-modal-body{min-height:0;overflow:auto;padding:14px}@media(max-width:900px){.cultui-graph{right:12px;left:12px;width:auto;height:min(18rem,34vh)}.cultui-layer-cards{top:calc(30px + min(18rem,34vh));right:12px;left:12px}.cultui-rail-actions{left:12px;width:auto}}:root{color-scheme:dark;font-family:Crimson Pro,serif;background:#0c1110;color:#e8e1cf}body{margin:0;min-height:100vh;background:radial-gradient(circle at 15% 0,#253229 0,transparent 38rem),linear-gradient(145deg,#0c1110,#111513)}header,main{width:min(920px,calc(100% - 2rem));margin:auto}header{padding:3rem 0 1.25rem;border-bottom:1px solid #66543d}h1{font-size:clamp(2.6rem,8vw,5.5rem);font-weight:400;letter-spacing:-.045em;margin:.1rem 0}.eyebrow,#status,label,button,pre{font-family:IBM Plex Mono,monospace}.eyebrow{color:#d49b58;letter-spacing:.18em;font-size:.72rem}#status{color:#9aa69f;font-size:.78rem}main{padding:1.5rem 0 5rem}#surface{min-height:15rem}form{margin-top:1.5rem;padding:1rem;border:1px solid #66543d;background:#17201ddd}label{display:block;font-size:.72rem;text-transform:uppercase;letter-spacing:.12em;margin-bottom:.65rem}textarea{box-sizing:border-box;width:100%;min-height:7rem;resize:vertical;background:#0b0f0d;color:#f2e7d0;border:1px solid #4a5148;padding:.9rem;font:1.25rem/1.4 Crimson Pro,serif}button{margin:.8rem .5rem 0 0;padding:.65rem 1rem;border:1px solid #d49b58;background:#d49b58;color:#17120c;cursor:pointer}button+button{background:transparent;color:#d49b58}pre{white-space:pre-wrap;padding:1rem;background:#080b09;color:#aeb9af;overflow:auto;font-size:.72rem}@media(max-width:600px){header{padding-top:2rem}h1{font-size:3rem}} diff --git a/web/dist/index.html b/web/dist/index.html new file mode 100644 index 0000000..6e1e8d2 --- /dev/null +++ b/web/dist/index.html @@ -0,0 +1,5 @@ + +GhostlightDungeon + + +

STARFIRE / PRIVATE VERSE

GhostlightDungeon

Reading the world…

diff --git a/web/index.html b/web/index.html new file mode 100644 index 0000000..0c1a4d1 --- /dev/null +++ b/web/index.html @@ -0,0 +1,3 @@ + +GhostlightDungeon +

STARFIRE / PRIVATE VERSE

GhostlightDungeon

Reading the world…

diff --git a/web/package-lock.json b/web/package-lock.json new file mode 100644 index 0000000..d618b2a --- /dev/null +++ b/web/package-lock.json @@ -0,0 +1,1191 @@ +{ + "name": "@gamecult/ghostlight-dungeon-web", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@gamecult/ghostlight-dungeon-web", + "dependencies": { + "@gamecult/eve-browser-lowering": "file:../vendor/eve/packages/eve-browser-lowering" + }, + "devDependencies": { + "typescript": "^5.6.3", + "vite": "^7.1.2" + } + }, + "../vendor/eve/packages/eve-browser-lowering": { + "name": "@gamecult/eve-browser-lowering", + "version": "0.1.0", + "devDependencies": { + "typescript": "^5.6.3" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz", + "integrity": "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.2.tgz", + "integrity": "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.2.tgz", + "integrity": "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.2.tgz", + "integrity": "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.2.tgz", + "integrity": "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.2.tgz", + "integrity": "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.2.tgz", + "integrity": "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.2.tgz", + "integrity": "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.2.tgz", + "integrity": "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.2.tgz", + "integrity": "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.2.tgz", + "integrity": "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.2.tgz", + "integrity": "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.2.tgz", + "integrity": "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.2.tgz", + "integrity": "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.2.tgz", + "integrity": "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.2.tgz", + "integrity": "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.2.tgz", + "integrity": "sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.2.tgz", + "integrity": "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.2.tgz", + "integrity": "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.2.tgz", + "integrity": "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.2.tgz", + "integrity": "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.2.tgz", + "integrity": "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.2.tgz", + "integrity": "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.2.tgz", + "integrity": "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.2.tgz", + "integrity": "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.2.tgz", + "integrity": "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@gamecult/eve-browser-lowering": { + "resolved": "../vendor/eve/packages/eve-browser-lowering", + "link": true + }, + "node_modules/@napi-rs/lzma-linux-x64-gnu": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@napi-rs/lzma-linux-x64-gnu/-/lzma-linux-x64-gnu-1.5.1.tgz", + "integrity": "sha512-oTXEIha4SsuXdTA4Iyskj0kpdx2yVXdhd75c2v3xGrHFfVMsbhTPZU/nMPL4sWKo4pBHm3aucLaqGlF696dTyQ==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^22.20 || ^24.12 || >=25" + } + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.62.4.tgz", + "integrity": "sha512-RrPokAb7dmbxFoeO3TloqHyOjgye8RkBhSqmp4aJMIex4c9r46ZstPnleDQOq1t46VOVjwIuwNogIqbodV1Vvg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.62.4.tgz", + "integrity": "sha512-JKuJc+pnpks2pjy7L/N3v/cAkZxYlnmuZoD840ldbMI5KDbC4iO9NKwPKYdjYFCMAIIlBzYSFHxIJVYzRo2/8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.62.4.tgz", + "integrity": "sha512-krw5uS2STmvJ02x0uTXHbqQNuz+9eZ1iw+qXk9dmW2gvV4jV7O2hEoOnuhFrpOPiel1mBFtqbxYZZtC46hXLOw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.62.4.tgz", + "integrity": "sha512-wsTxtgApb4PrOsNJIm0FZ1h3WvCC+k9uxLJ4ad75hgoS4NiRes2SoJFlDAyMwiUY8IssDqGcHbXuN0sx1tfF1A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.62.4.tgz", + "integrity": "sha512-GUOnQlyZe3yAXhWOtOMsn5Qkrv5E5mZXa0thbARWi5Ei2szlVXJFQhddZ4HbAzh8q92w5twp+CQvs/eFanz9YQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.62.4.tgz", + "integrity": "sha512-/Y7f3QuxjzPKsjA/rfEDa3+0vXqyjmJ50Ln8dPpCmWkKTrUoWHG1cWhTqaAMLob2m2nESWuC7yGrREz019Ztqg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.62.4.tgz", + "integrity": "sha512-81wiiX3v7aqy+T+bT61TJ78yJjRquqFFTTbAPt08imfQQzkPIW8t6aJbkTagtCCrXMNc9D66+geqlK7ydLPNqA==", + "cpu": [ + "arm" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.62.4.tgz", + "integrity": "sha512-9kmDIvNZqdoHOBZgNtpTBeLWYO/LVipM3H/j62P8848/l/VPEQL6N3uxU9pvP1oZAsXyC2MEnFP3ovRjo7WYNQ==", + "cpu": [ + "arm" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.62.4.tgz", + "integrity": "sha512-CcnXHWnXg69g+DX5VWL3FHts3qMRN2uVEHX+BZvGLdd07/gXkn3ePjYtO1LDJvxkGKVHMclKBRa1QUTH+6toYQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.62.4.tgz", + "integrity": "sha512-iFOibiHnTRuhrWLlRsOQFdZJJIa7S8OwkneJr4ocALP16u5yk6lWLINFwhHaEqBFMsKDUZofLkGos7+CPzGB3g==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.62.4.tgz", + "integrity": "sha512-XnWYMI7euHlb5a871xPja+Gm7DRCFU+FGRrtS2sMq9N8FvqtpagUy6gD4YOemC5MRk9xbh8+jYMEJbigFQwsgA==", + "cpu": [ + "loong64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.62.4.tgz", + "integrity": "sha512-qGDAlO0U8xedCcsdRm9oaoQY8DAx/QT7uIxJWhCdx0ceIWX783UC9QSYkdpzAe29wNiVfp24+bZdQmn49o45SQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.62.4.tgz", + "integrity": "sha512-ru4H6ezD7ysA5EiEK6qkkaEb4modH8CTej6kUy/gQi20u3kB3G7Zn8snXXkeJSCOFKG/rbPPtM/+9Wgas1961w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.62.4.tgz", + "integrity": "sha512-2W4MO5WQVJnbJaZdvDb9rhBDuFU1nKIepPFpJUBsTh2k1YY2g+ODViaWuyOAjQ5cOP7NvrvLzt3wvHOoiAvc7w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.62.4.tgz", + "integrity": "sha512-+fxjfuoAmVMCYV5QyjoIpu0cp5DOiOTeqYFk1AVaxGr+/ravWLX89XfQmptsoWcaVy/TGf2hexzbUOrCQIL1CQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.62.4.tgz", + "integrity": "sha512-jTn8JfHGL4djjFxPuM06LmNUJDsst2jeVlsd9OmIH6zc5sC9K6rIuO4YajXatLUpBmBKl6b35ro1QZocLi+tcA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.62.4.tgz", + "integrity": "sha512-oCJCJL4pXsoDcP2QZ+JVlPTIRc6266zsIaeJJsWImmF7HO0W8nb6HuSgZlMWxJwaPf8ehbSw8yo0EUw925hKsA==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.62.4.tgz", + "integrity": "sha512-W69hukhZ3KKNRCaMIEzKvcFye42hh0FE1+YoYaf5+Ikacuftoco6yO/xouz0hc5d5W/s3yBro5jRiuEE/Q5vUw==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.62.4.tgz", + "integrity": "sha512-qiXbGG2jkjXhzXpsFZSR2Xpb8DN/UaxYsbb/STbuR/6fpaDgRmmaq1B/LmtF2wQFOFOSsK2jdE0RZ3a0zHn4QA==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.62.4.tgz", + "integrity": "sha512-nWeM//hxv8mIo6jD7Hu4o48DVmV9pbV6gsKaWU+4NFyqHoPKwrkRiZGLKUhOBk8qNmDmpwFtPKg80Bo/Tn4xiQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.62.4.tgz", + "integrity": "sha512-s62SQ/vgsRSvMwDkOEfTqfgASF0f26ZNaQuTA6Aok5lrikf89yI2W0gFHvZb2Jpgc6N8JnOKZgCK2iciO3CsxQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.62.4.tgz", + "integrity": "sha512-J6wGf8TVGbXJq+HH+ttTvrcfNKPbuZecV6KT1B8I18BC5IURUh5kl4Yl5OEP5eFIUoI5BWxCsyYMhFsDx8kekw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.62.4.tgz", + "integrity": "sha512-zmfrQd/0wu6oJs8Vq8KwY/YtsKSsLtKe/HwAP4Wqy8LhWjeT55fHRAkOhYQ12wI3ayS4Tt12d5CDRD7N96SAYQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.62.4.tgz", + "integrity": "sha512-qPzHqdj9rfUD+w79dtE07zi/kFwKyCJqplp5K5ygeLTp7jLpAoc16OAH39HSmRC9UpozaecsleI8uAdEj6v2yw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.62.4.tgz", + "integrity": "sha512-zD6NdeWEByGE9QF9vCrlJ5YQB4oq9q91kPZS37Jwj5hOkvR1lTBSpsKhKDw4IJtbQ35LsTS1HD9DZYGKIshU1Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@types/estree": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/esbuild": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.2.tgz", + "integrity": "sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.28.2", + "@esbuild/android-arm": "0.28.2", + "@esbuild/android-arm64": "0.28.2", + "@esbuild/android-x64": "0.28.2", + "@esbuild/darwin-arm64": "0.28.2", + "@esbuild/darwin-x64": "0.28.2", + "@esbuild/freebsd-arm64": "0.28.2", + "@esbuild/freebsd-x64": "0.28.2", + "@esbuild/linux-arm": "0.28.2", + "@esbuild/linux-arm64": "0.28.2", + "@esbuild/linux-ia32": "0.28.2", + "@esbuild/linux-loong64": "0.28.2", + "@esbuild/linux-mips64el": "0.28.2", + "@esbuild/linux-ppc64": "0.28.2", + "@esbuild/linux-riscv64": "0.28.2", + "@esbuild/linux-s390x": "0.28.2", + "@esbuild/linux-x64": "0.28.2", + "@esbuild/netbsd-arm64": "0.28.2", + "@esbuild/netbsd-x64": "0.28.2", + "@esbuild/openbsd-arm64": "0.28.2", + "@esbuild/openbsd-x64": "0.28.2", + "@esbuild/openharmony-arm64": "0.28.2", + "@esbuild/sunos-x64": "0.28.2", + "@esbuild/win32-arm64": "0.28.2", + "@esbuild/win32-ia32": "0.28.2", + "@esbuild/win32-x64": "0.28.2" + } + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/nanoid": { + "version": "3.3.18", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.18.tgz", + "integrity": "sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.26", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.26.tgz", + "integrity": "sha512-u82N74LFzG8ca+dD8puPnplTXoGH4fTPpVGuIbt36G3qvNlkvfD0lEAZSxaly3KX8TS/L1A1gsCEmvKmBcVbkQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.17", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/rollup": { + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.62.4.tgz", + "integrity": "sha512-RXOqwaPsBGjMNMa4sQjDjHieHEZDFoj/Rdr46l2MU5DfEs16wHJPC2RPTPHWhNl+M3aI472LLqFkFKut4SblOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.9" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@napi-rs/lzma-linux-x64-gnu": "1.5.1", + "@rollup/rollup-android-arm-eabi": "4.62.4", + "@rollup/rollup-android-arm64": "4.62.4", + "@rollup/rollup-darwin-arm64": "4.62.4", + "@rollup/rollup-darwin-x64": "4.62.4", + "@rollup/rollup-freebsd-arm64": "4.62.4", + "@rollup/rollup-freebsd-x64": "4.62.4", + "@rollup/rollup-linux-arm-gnueabihf": "4.62.4", + "@rollup/rollup-linux-arm-musleabihf": "4.62.4", + "@rollup/rollup-linux-arm64-gnu": "4.62.4", + "@rollup/rollup-linux-arm64-musl": "4.62.4", + "@rollup/rollup-linux-loong64-gnu": "4.62.4", + "@rollup/rollup-linux-loong64-musl": "4.62.4", + "@rollup/rollup-linux-ppc64-gnu": "4.62.4", + "@rollup/rollup-linux-ppc64-musl": "4.62.4", + "@rollup/rollup-linux-riscv64-gnu": "4.62.4", + "@rollup/rollup-linux-riscv64-musl": "4.62.4", + "@rollup/rollup-linux-s390x-gnu": "4.62.4", + "@rollup/rollup-linux-x64-gnu": "4.62.4", + "@rollup/rollup-linux-x64-musl": "4.62.4", + "@rollup/rollup-openbsd-x64": "4.62.4", + "@rollup/rollup-openharmony-arm64": "4.62.4", + "@rollup/rollup-win32-arm64-msvc": "4.62.4", + "@rollup/rollup-win32-ia32-msvc": "4.62.4", + "@rollup/rollup-win32-x64-gnu": "4.62.4", + "@rollup/rollup-win32-x64-msvc": "4.62.4", + "fsevents": "~2.3.2" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/vite": { + "version": "7.3.6", + "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.6.tgz", + "integrity": "sha512-4XP60spRGjSZFf1qYH+dJIkK2znL3zQfl9KkOV9MkkRR/3Dls0dxaBsQPTloEc5BLXWPL9vsOxopxyKoMmDueg==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.27.0 || ^0.28.0", + "fdir": "^6.5.0", + "picomatch": "^4.0.3", + "postcss": "^8.5.6", + "rollup": "^4.43.0", + "tinyglobby": "^0.2.15" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "lightningcss": "^1.21.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + } + } +} diff --git a/web/package.json b/web/package.json new file mode 100644 index 0000000..2412734 --- /dev/null +++ b/web/package.json @@ -0,0 +1,8 @@ +{ + "name": "@gamecult/ghostlight-dungeon-web", + "private": true, + "type": "module", + "scripts": { "build": "vite build", "dev": "vite --host 127.0.0.1 --port 8832" }, + "dependencies": { "@gamecult/eve-browser-lowering": "file:../vendor/eve/packages/eve-browser-lowering" }, + "devDependencies": { "typescript": "^5.6.3", "vite": "^7.1.2" } +} diff --git a/web/src/main.ts b/web/src/main.ts new file mode 100644 index 0000000..90d037e --- /dev/null +++ b/web/src/main.ts @@ -0,0 +1,36 @@ +import { renderEveSurface } from "@gamecult/eve-browser-lowering"; +import "@gamecult/eve-browser-lowering/styles.css"; +import "./style.css"; + +const host = document.querySelector("#surface")!; +const status = document.querySelector("#status")!; +const receipt = document.querySelector("#receipt")!; +let revision = 0; +let actorId = "player"; + +async function refresh() { + const response = await fetch("/api/surface"); + if (response.status === 401) { status.textContent = "This laboratory requires an unused invite link."; return; } + const surface = await response.json(); + revision = Number(surface.version ?? 0); + renderEveSurface(surface, host, { body: document.body, clientId: "ghostlight.browser", statusElement: status }); +} + +async function send(command: unknown) { + status.textContent = "The world is considering the command…"; + const response = await fetch("/api/command", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify(command) }); + const body = await response.json(); + receipt.hidden = false; + receipt.textContent = JSON.stringify(body, null, 2); + if (!response.ok) { status.textContent = body.error ?? "The command was refused."; return; } + await refresh(); +} + +document.querySelector("#composer")!.addEventListener("submit", event => { + event.preventDefault(); + const text = document.querySelector("#attempt")!.value.trim(); + if (!text) return; + void send({ type: "assess", expected_revision: revision, intent: { actor_id: actorId, description: text, intended_effect: text } }); +}); +document.querySelector("#wait")!.addEventListener("click", () => void send({ type: "wait", expected_revision: revision, minutes: 60 })); +void refresh(); diff --git a/web/src/style.css b/web/src/style.css new file mode 100644 index 0000000..505e5d2 --- /dev/null +++ b/web/src/style.css @@ -0,0 +1,2 @@ +@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:opsz,wght@8..144,400;8..144,600&family=IBM+Plex+Mono:wght@400;600&display=swap'); +:root{color-scheme:dark;font-family:"Crimson Pro",serif;background:#0c1110;color:#e8e1cf}body{margin:0;min-height:100vh;background:radial-gradient(circle at 15% 0,#253229 0,transparent 38rem),linear-gradient(145deg,#0c1110,#111513)}header,main{width:min(920px,calc(100% - 2rem));margin:auto}header{padding:3rem 0 1.25rem;border-bottom:1px solid #66543d}h1{font-size:clamp(2.6rem,8vw,5.5rem);font-weight:400;letter-spacing:-.045em;margin:.1rem 0}.eyebrow,#status,label,button,pre{font-family:"IBM Plex Mono",monospace}.eyebrow{color:#d49b58;letter-spacing:.18em;font-size:.72rem}#status{color:#9aa69f;font-size:.78rem}main{padding:1.5rem 0 5rem}#surface{min-height:15rem}form{margin-top:1.5rem;padding:1rem;border:1px solid #66543d;background:#17201ddd}label{display:block;font-size:.72rem;text-transform:uppercase;letter-spacing:.12em;margin-bottom:.65rem}textarea{box-sizing:border-box;width:100%;min-height:7rem;resize:vertical;background:#0b0f0d;color:#f2e7d0;border:1px solid #4a5148;padding:.9rem;font:1.25rem/1.4 "Crimson Pro",serif}button{margin:.8rem .5rem 0 0;padding:.65rem 1rem;border:1px solid #d49b58;background:#d49b58;color:#17120c;cursor:pointer}button+button{background:transparent;color:#d49b58}pre{white-space:pre-wrap;padding:1rem;background:#080b09;color:#aeb9af;overflow:auto;font-size:.72rem}@media(max-width:600px){header{padding-top:2rem}h1{font-size:3rem}}