diff options
| author | Brendan Allan <[email protected]> | 2025-12-06 04:39:49 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-12-05 14:39:49 -0600 |
| commit | cd6bfb3f694675246a67dc0466d7603a37833586 (patch) | |
| tree | 9d5a4ae51553fbebd748428f1af4549c9adf8f16 /packages/tauri/src-tauri | |
| parent | ba417d80b1174d0e289d8fc91c77a8f6a0d592f4 (diff) | |
| download | opencode-cd6bfb3f694675246a67dc0466d7603a37833586.tar.gz opencode-cd6bfb3f694675246a67dc0466d7603a37833586.zip | |
OpenCode Desktop app (#5044)
Co-authored-by: Adam <[email protected]>
Diffstat (limited to 'packages/tauri/src-tauri')
58 files changed, 953 insertions, 30 deletions
diff --git a/packages/tauri/src-tauri/.gitignore b/packages/tauri/src-tauri/.gitignore index b21bd681d..67554e174 100644 --- a/packages/tauri/src-tauri/.gitignore +++ b/packages/tauri/src-tauri/.gitignore @@ -5,3 +5,5 @@ # Generated by Tauri # will have schema files for capabilities auto-completion /gen/schemas + +sidecars diff --git a/packages/tauri/src-tauri/Cargo.lock b/packages/tauri/src-tauri/Cargo.lock index 6fc6d04b9..aaa7429eb 100644 --- a/packages/tauri/src-tauri/Cargo.lock +++ b/packages/tauri/src-tauri/Cargo.lock @@ -48,6 +48,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" [[package]] +name = "arbitrary" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1" +dependencies = [ + "derive_arbitrary", +] + +[[package]] +name = "ashpd" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6cbdf310d77fd3aaee6ea2093db7011dc2d35d2eb3481e5607f1f8d942ed99df" +dependencies = [ + "enumflags2", + "futures-channel", + "futures-util", + "rand 0.9.2", + "raw-window-handle", + "serde", + "serde_repr", + "tokio", + "url", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "zbus", +] + +[[package]] name = "async-broadcast" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -657,6 +687,17 @@ dependencies = [ ] [[package]] +name = "derive_arbitrary" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e567bd82dcff979e4b03460c307b3cdc9e96fde3d73bed1496d2bc75d9dd62a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.110", +] + +[[package]] name = "derive_more" version = "0.99.20" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -713,6 +754,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89a09f22a6c6069a18470eb92d2298acf25463f14256d24778e1230d789a2aec" dependencies = [ "bitflags 2.10.0", + "block2 0.6.2", + "libc", "objc2 0.6.3", ] @@ -728,6 +771,15 @@ dependencies = [ ] [[package]] +name = "dlib" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" +dependencies = [ + "libloading", +] + +[[package]] name = "dlopen2" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -751,6 +803,12 @@ dependencies = [ ] [[package]] +name = "downcast-rs" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" + +[[package]] name = "dpi" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -807,6 +865,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7" [[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +dependencies = [ + "cfg-if", +] + +[[package]] name = "endi" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -907,6 +974,18 @@ dependencies = [ ] [[package]] +name = "filetime" +version = "0.2.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc0505cd1b6fa6580283f6bdf70a73fcf4aba1184038c90902b92b3dd0df63ed" +dependencies = [ + "cfg-if", + "libc", + "libredox", + "windows-sys 0.60.2", +] + +[[package]] name = "find-msvc-tools" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1195,8 +1274,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi 0.11.1+wasi-snapshot-preview1", + "wasm-bindgen", ] [[package]] @@ -1206,9 +1287,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" dependencies = [ "cfg-if", + "js-sys", "libc", "r-efi", "wasip2", + "wasm-bindgen", ] [[package]] @@ -1469,6 +1552,23 @@ dependencies = [ ] [[package]] +name = "hyper-rustls" +version = "0.27.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" +dependencies = [ + "http", + "hyper", + "hyper-util", + "rustls", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", + "webpki-roots", +] + +[[package]] name = "hyper-util" version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1861,6 +1961,7 @@ checksum = "416f7e718bdb06000964960ffa43b4335ad4012ae8b99060261aa4a8088d5ccb" dependencies = [ "bitflags 2.10.0", "libc", + "redox_syscall", ] [[package]] @@ -1870,6 +1971,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" [[package]] +name = "listeners" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "557f908c6cb431dd2496687aa9ea326507110ee4780517a42ade2df25d31126c" +dependencies = [ + "byteorder", + "rustix", + "windows", +] + +[[package]] name = "litemap" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1891,6 +2003,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" [[package]] +name = "lru-slab" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" + +[[package]] name = "mac" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1949,6 +2067,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] +name = "minisign-verify" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e856fdd13623a2f5f2f54676a4ee49502a96a80ef4a62bcedd23d52427c44d43" + +[[package]] name = "miniz_oxide" version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2284,6 +2408,18 @@ dependencies = [ ] [[package]] +name = "objc2-osa-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f112d1746737b0da274ef79a23aac283376f335f4095a083a267a082f21db0c0" +dependencies = [ + "bitflags 2.10.0", + "objc2 0.6.3", + "objc2-app-kit", + "objc2-foundation 0.3.2", +] + +[[package]] name = "objc2-quartz-core" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2365,14 +2501,19 @@ dependencies = [ ] [[package]] -name = "opencode" -version = "0.1.0" +name = "opencode-desktop" +version = "0.0.0" dependencies = [ + "listeners", "serde", "serde_json", "tauri", "tauri-build", + "tauri-plugin-dialog", "tauri-plugin-opener", + "tauri-plugin-shell", + "tauri-plugin-updater", + "tokio", ] [[package]] @@ -2392,6 +2533,30 @@ dependencies = [ ] [[package]] +name = "os_pipe" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d8fae84b431384b68627d0f9b3b1245fcf9f46f6c0e3dc902e9dce64edd1967" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "osakit" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "732c71caeaa72c065bb69d7ea08717bd3f4863a4f451402fc9513e29dbd5261b" +dependencies = [ + "objc2 0.6.3", + "objc2-foundation 0.3.2", + "objc2-osa-kit", + "serde", + "serde_json", + "thiserror 2.0.17", +] + +[[package]] name = "pango" version = "0.18.3" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2628,7 +2793,7 @@ checksum = "740ebea15c5d1428f910cd1a5f52cebf8d25006245ed8ade92702f4943d91e07" dependencies = [ "base64 0.22.1", "indexmap 2.12.1", - "quick-xml", + "quick-xml 0.38.4", "serde", "time", ] @@ -2760,6 +2925,15 @@ dependencies = [ [[package]] name = "quick-xml" +version = "0.37.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "331e97a1af0bf59823e6eadffe373d7b27f485be8748f71471c662c1f269b7fb" +dependencies = [ + "memchr", +] + +[[package]] +name = "quick-xml" version = "0.38.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b66c2058c55a409d601666cffe35f04333cf1013010882cec174a7467cd4e21c" @@ -2768,6 +2942,61 @@ dependencies = [ ] [[package]] +name = "quinn" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" +dependencies = [ + "bytes", + "cfg_aliases", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror 2.0.17", + "tokio", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-proto" +version = "0.11.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31" +dependencies = [ + "bytes", + "getrandom 0.3.4", + "lru-slab", + "rand 0.9.2", + "ring", + "rustc-hash", + "rustls", + "rustls-pki-types", + "slab", + "thiserror 2.0.17", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-udp" +version = "0.5.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.60.2", +] + +[[package]] name = "quote" version = "1.0.42" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2808,6 +3037,16 @@ dependencies = [ ] [[package]] +name = "rand" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.3", +] + +[[package]] name = "rand_chacha" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2828,6 +3067,16 @@ dependencies = [ ] [[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.3", +] + +[[package]] name = "rand_core" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2846,6 +3095,15 @@ dependencies = [ ] [[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +dependencies = [ + "getrandom 0.3.4", +] + +[[package]] name = "rand_hc" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2952,16 +3210,21 @@ dependencies = [ "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", @@ -2971,9 +3234,55 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", + "webpki-roots", +] + +[[package]] +name = "rfd" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef2bee61e6cffa4635c72d7d81a84294e28f0930db0ddcb0f66d10244674ebed" +dependencies = [ + "ashpd", + "block2 0.6.2", + "dispatch2", + "glib-sys", + "gobject-sys", + "gtk-sys", + "js-sys", + "log", + "objc2 0.6.3", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation 0.3.2", + "raw-window-handle", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "windows-sys 0.59.0", ] [[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.16", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustc-hash" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" + +[[package]] name = "rustc_version" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2996,6 +3305,41 @@ dependencies = [ ] [[package]] +name = "rustls" +version = "0.23.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "533f54bc6a7d4f647e46ad909549eda97bf5afc1585190ef692b4286b198bd8f" +dependencies = [ + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pki-types" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "708c0f9d5f54ba0272468c1d306a52c495b31fa155e91bc25371e6df7996908c" +dependencies = [ + "web-time", + "zeroize", +] + +[[package]] +name = "rustls-webpki" +version = "0.103.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ffdfa2f5286e2247234e03f680868ac2815974dc39e00ea15adc445d0aafe52" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] name = "rustversion" version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3068,6 +3412,12 @@ dependencies = [ ] [[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + +[[package]] name = "scopeguard" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3283,12 +3633,44 @@ dependencies = [ ] [[package]] +name = "shared_child" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e362d9935bc50f019969e2f9ecd66786612daae13e8f277be7bfb66e8bed3f7" +dependencies = [ + "libc", + "sigchld", + "windows-sys 0.60.2", +] + +[[package]] name = "shlex" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] +name = "sigchld" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47106eded3c154e70176fc83df9737335c94ce22f821c32d17ed1db1f83badb1" +dependencies = [ + "libc", + "os_pipe", + "signal-hook", +] + +[[package]] +name = "signal-hook" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d881a16cf4426aa584979d30bd82cb33429027e42122b169753d6ef1085ed6e2" +dependencies = [ + "libc", + "signal-hook-registry", +] + +[[package]] name = "signal-hook-registry" version = "1.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3429,6 +3811,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] name = "swift-rs" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3546,6 +3934,17 @@ dependencies = [ ] [[package]] +name = "tar" +version = "0.4.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d863878d212c87a19c1a610eb53bb01fe12951c0501cf5a0d65f724914a667a" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] name = "target-lexicon" version = "0.12.16" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3683,6 +4082,46 @@ dependencies = [ ] [[package]] +name = "tauri-plugin-dialog" +version = "2.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "313f8138692ddc4a2127c4c9607d616a46f5c042e77b3722450866da0aad2f19" +dependencies = [ + "log", + "raw-window-handle", + "rfd", + "serde", + "serde_json", + "tauri", + "tauri-plugin", + "tauri-plugin-fs", + "thiserror 2.0.17", + "url", +] + +[[package]] +name = "tauri-plugin-fs" +version = "2.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47df422695255ecbe7bac7012440eddaeefd026656171eac9559f5243d3230d9" +dependencies = [ + "anyhow", + "dunce", + "glob", + "percent-encoding", + "schemars 0.8.22", + "serde", + "serde_json", + "serde_repr", + "tauri", + "tauri-plugin", + "tauri-utils", + "thiserror 2.0.17", + "toml 0.9.8", + "url", +] + +[[package]] name = "tauri-plugin-opener" version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3705,6 +4144,59 @@ dependencies = [ ] [[package]] +name = "tauri-plugin-shell" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c374b6db45f2a8a304f0273a15080d98c70cde86178855fc24653ba657a1144c" +dependencies = [ + "encoding_rs", + "log", + "open", + "os_pipe", + "regex", + "schemars 0.8.22", + "serde", + "serde_json", + "shared_child", + "tauri", + "tauri-plugin", + "thiserror 2.0.17", + "tokio", +] + +[[package]] +name = "tauri-plugin-updater" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27cbc31740f4d507712550694749572ec0e43bdd66992db7599b89fbfd6b167b" +dependencies = [ + "base64 0.22.1", + "dirs", + "flate2", + "futures-util", + "http", + "infer", + "log", + "minisign-verify", + "osakit", + "percent-encoding", + "reqwest", + "semver", + "serde", + "serde_json", + "tar", + "tauri", + "tauri-plugin", + "tempfile", + "thiserror 2.0.17", + "time", + "tokio", + "url", + "windows-sys 0.60.2", + "zip", +] + +[[package]] name = "tauri-runtime" version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3911,6 +4403,21 @@ dependencies = [ ] [[package]] +name = "tinyvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" +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.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3920,11 +4427,23 @@ dependencies = [ "libc", "mio", "pin-project-lite", + "signal-hook-registry", "socket2", + "tracing", "windows-sys 0.61.2", ] [[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.17" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -4214,6 +4733,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" [[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.7" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -4405,6 +4930,66 @@ dependencies = [ ] [[package]] +name = "wayland-backend" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "673a33c33048a5ade91a6b139580fa174e19fb0d23f396dca9fa15f2e1e49b35" +dependencies = [ + "cc", + "downcast-rs", + "rustix", + "scoped-tls", + "smallvec", + "wayland-sys", +] + +[[package]] +name = "wayland-client" +version = "0.31.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c66a47e840dc20793f2264eb4b3e4ecb4b75d91c0dd4af04b456128e0bdd449d" +dependencies = [ + "bitflags 2.10.0", + "rustix", + "wayland-backend", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols" +version = "0.32.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efa790ed75fbfd71283bd2521a1cfdc022aabcc28bdcff00851f9e4ae88d9901" +dependencies = [ + "bitflags 2.10.0", + "wayland-backend", + "wayland-client", + "wayland-scanner", +] + +[[package]] +name = "wayland-scanner" +version = "0.31.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54cb1e9dc49da91950bdfd8b848c49330536d9d1fb03d4bfec8cae50caa50ae3" +dependencies = [ + "proc-macro2", + "quick-xml 0.37.5", + "quote", +] + +[[package]] +name = "wayland-sys" +version = "0.31.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34949b42822155826b41db8e5d0c1be3a2bd296c747577a43a3e6daefc296142" +dependencies = [ + "dlib", + "log", + "pkg-config", +] + +[[package]] name = "web-sys" version = "0.3.82" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -4415,6 +5000,16 @@ dependencies = [ ] [[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 = "webkit2gtk" version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -4459,6 +5054,15 @@ dependencies = [ ] [[package]] +name = "webpki-roots" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2878ef029c47c6e8cf779119f20fcf52bde7ad42a731b2a304bc221df17571e" +dependencies = [ + "rustls-pki-types", +] + +[[package]] name = "webview2-com" version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -4690,6 +5294,15 @@ dependencies = [ [[package]] name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" @@ -5026,6 +5639,16 @@ dependencies = [ ] [[package]] +name = "xattr" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e45ad4206f6d2479085147f02bc2ef834ac85886624a23575ae137c8aa8156" +dependencies = [ + "libc", + "rustix", +] + +[[package]] name = "yoke" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -5072,6 +5695,7 @@ dependencies = [ "ordered-stream", "serde", "serde_repr", + "tokio", "tracing", "uds_windows", "uuid", @@ -5151,6 +5775,12 @@ dependencies = [ ] [[package]] +name = "zeroize" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" + +[[package]] name = "zerotrie" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -5184,6 +5814,18 @@ dependencies = [ ] [[package]] +name = "zip" +version = "4.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caa8cd6af31c3b31c6631b8f483848b91589021b28fffe50adada48d4f4d2ed1" +dependencies = [ + "arbitrary", + "crc32fast", + "indexmap 2.12.1", + "memchr", +] + +[[package]] name = "zvariant" version = "5.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -5192,6 +5834,7 @@ dependencies = [ "endi", "enumflags2", "serde", + "url", "winnow 0.7.13", "zvariant_derive", "zvariant_utils", diff --git a/packages/tauri/src-tauri/Cargo.toml b/packages/tauri/src-tauri/Cargo.toml index f9542007b..dd893d6e3 100644 --- a/packages/tauri/src-tauri/Cargo.toml +++ b/packages/tauri/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "opencode" -version = "0.1.0" +name = "opencode-desktop" +version = "0.0.0" description = "A Tauri App" authors = ["you"] edition = "2021" @@ -18,8 +18,13 @@ crate-type = ["staticlib", "cdylib", "rlib"] tauri-build = { version = "2", features = [] } [dependencies] -tauri = { version = "2", features = [] } +tauri = { version = "2", features = ["macos-private-api", "devtools"] } tauri-plugin-opener = "2" +tauri-plugin-shell = "2" +tauri-plugin-dialog = "2" +tauri-plugin-updater = "2" + serde = { version = "1", features = ["derive"] } serde_json = "1" - +tokio = "1.48.0" +listeners = "0.3" diff --git a/packages/tauri/src-tauri/capabilities/default.json b/packages/tauri/src-tauri/capabilities/default.json index f77836402..12f94213e 100644 --- a/packages/tauri/src-tauri/capabilities/default.json +++ b/packages/tauri/src-tauri/capabilities/default.json @@ -3,5 +3,12 @@ "identifier": "default", "description": "Capability for the main window", "windows": ["main"], - "permissions": ["core:default", "opener:default"] + "permissions": [ + "core:default", + "opener:default", + "core:window:allow-start-dragging", + "shell:default", + "updater:default", + "dialog:default" + ] } diff --git a/packages/tauri/src-tauri/icons/128x128.png b/packages/tauri/src-tauri/icons/128x128.png Binary files differindex 6be5e50e9..57d061b44 100644 --- a/packages/tauri/src-tauri/icons/128x128.png +++ b/packages/tauri/src-tauri/icons/128x128.png diff --git a/packages/tauri/src-tauri/icons/[email protected] b/packages/tauri/src-tauri/icons/[email protected] Binary files differindex e81becee5..a87a4c3cc 100644 --- a/packages/tauri/src-tauri/icons/[email protected] +++ b/packages/tauri/src-tauri/icons/[email protected] diff --git a/packages/tauri/src-tauri/icons/32x32.png b/packages/tauri/src-tauri/icons/32x32.png Binary files differindex a437dd517..8383b4730 100644 --- a/packages/tauri/src-tauri/icons/32x32.png +++ b/packages/tauri/src-tauri/icons/32x32.png diff --git a/packages/tauri/src-tauri/icons/64x64.png b/packages/tauri/src-tauri/icons/64x64.png Binary files differnew file mode 100644 index 000000000..ef3b81179 --- /dev/null +++ b/packages/tauri/src-tauri/icons/64x64.png diff --git a/packages/tauri/src-tauri/icons/Square107x107Logo.png b/packages/tauri/src-tauri/icons/Square107x107Logo.png Binary files differindex 0ca4f2719..c80eb8909 100644 --- a/packages/tauri/src-tauri/icons/Square107x107Logo.png +++ b/packages/tauri/src-tauri/icons/Square107x107Logo.png diff --git a/packages/tauri/src-tauri/icons/Square142x142Logo.png b/packages/tauri/src-tauri/icons/Square142x142Logo.png Binary files differindex b81f82039..bb767ed97 100644 --- a/packages/tauri/src-tauri/icons/Square142x142Logo.png +++ b/packages/tauri/src-tauri/icons/Square142x142Logo.png diff --git a/packages/tauri/src-tauri/icons/Square150x150Logo.png b/packages/tauri/src-tauri/icons/Square150x150Logo.png Binary files differindex 624c7bfba..15cc8e0d2 100644 --- a/packages/tauri/src-tauri/icons/Square150x150Logo.png +++ b/packages/tauri/src-tauri/icons/Square150x150Logo.png diff --git a/packages/tauri/src-tauri/icons/Square284x284Logo.png b/packages/tauri/src-tauri/icons/Square284x284Logo.png Binary files differindex c021d2ba7..5d78834e0 100644 --- a/packages/tauri/src-tauri/icons/Square284x284Logo.png +++ b/packages/tauri/src-tauri/icons/Square284x284Logo.png diff --git a/packages/tauri/src-tauri/icons/Square30x30Logo.png b/packages/tauri/src-tauri/icons/Square30x30Logo.png Binary files differindex 621970023..f78bf4c5a 100644 --- a/packages/tauri/src-tauri/icons/Square30x30Logo.png +++ b/packages/tauri/src-tauri/icons/Square30x30Logo.png diff --git a/packages/tauri/src-tauri/icons/Square310x310Logo.png b/packages/tauri/src-tauri/icons/Square310x310Logo.png Binary files differindex f9bc04839..2419f9209 100644 --- a/packages/tauri/src-tauri/icons/Square310x310Logo.png +++ b/packages/tauri/src-tauri/icons/Square310x310Logo.png diff --git a/packages/tauri/src-tauri/icons/Square44x44Logo.png b/packages/tauri/src-tauri/icons/Square44x44Logo.png Binary files differindex d5fbfb2ab..3f665e55a 100644 --- a/packages/tauri/src-tauri/icons/Square44x44Logo.png +++ b/packages/tauri/src-tauri/icons/Square44x44Logo.png diff --git a/packages/tauri/src-tauri/icons/Square71x71Logo.png b/packages/tauri/src-tauri/icons/Square71x71Logo.png Binary files differindex 63440d798..f4d9d20d8 100644 --- a/packages/tauri/src-tauri/icons/Square71x71Logo.png +++ b/packages/tauri/src-tauri/icons/Square71x71Logo.png diff --git a/packages/tauri/src-tauri/icons/Square89x89Logo.png b/packages/tauri/src-tauri/icons/Square89x89Logo.png Binary files differindex f3f705af2..07be723db 100644 --- a/packages/tauri/src-tauri/icons/Square89x89Logo.png +++ b/packages/tauri/src-tauri/icons/Square89x89Logo.png diff --git a/packages/tauri/src-tauri/icons/StoreLogo.png b/packages/tauri/src-tauri/icons/StoreLogo.png Binary files differindex 455638826..3e78e8d3e 100644 --- a/packages/tauri/src-tauri/icons/StoreLogo.png +++ b/packages/tauri/src-tauri/icons/StoreLogo.png diff --git a/packages/tauri/src-tauri/icons/android/mipmap-anydpi-v26/ic_launcher.xml b/packages/tauri/src-tauri/icons/android/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 000000000..2ffbf24b6 --- /dev/null +++ b/packages/tauri/src-tauri/icons/android/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <foreground android:drawable="@mipmap/ic_launcher_foreground"/> + <background android:drawable="@color/ic_launcher_background"/> +</adaptive-icon>
\ No newline at end of file diff --git a/packages/tauri/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png b/packages/tauri/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png Binary files differnew file mode 100644 index 000000000..6e500bb7e --- /dev/null +++ b/packages/tauri/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png diff --git a/packages/tauri/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png b/packages/tauri/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png Binary files differnew file mode 100644 index 000000000..23b5818ac --- /dev/null +++ b/packages/tauri/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png diff --git a/packages/tauri/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png b/packages/tauri/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png Binary files differnew file mode 100644 index 000000000..69d1023ec --- /dev/null +++ b/packages/tauri/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png diff --git a/packages/tauri/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png b/packages/tauri/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png Binary files differnew file mode 100644 index 000000000..e67031171 --- /dev/null +++ b/packages/tauri/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png diff --git a/packages/tauri/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png b/packages/tauri/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png Binary files differnew file mode 100644 index 000000000..d274f1c9d --- /dev/null +++ b/packages/tauri/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png diff --git a/packages/tauri/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png b/packages/tauri/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png Binary files differnew file mode 100644 index 000000000..167af3864 --- /dev/null +++ b/packages/tauri/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png diff --git a/packages/tauri/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png b/packages/tauri/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png Binary files differnew file mode 100644 index 000000000..237b8fb29 --- /dev/null +++ b/packages/tauri/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png diff --git a/packages/tauri/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png b/packages/tauri/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png Binary files differnew file mode 100644 index 000000000..d6299e807 --- /dev/null +++ b/packages/tauri/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png diff --git a/packages/tauri/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png b/packages/tauri/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png Binary files differnew file mode 100644 index 000000000..999e00638 --- /dev/null +++ b/packages/tauri/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png diff --git a/packages/tauri/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png b/packages/tauri/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png Binary files differnew file mode 100644 index 000000000..262667374 --- /dev/null +++ b/packages/tauri/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png diff --git a/packages/tauri/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png b/packages/tauri/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png Binary files differnew file mode 100644 index 000000000..4e04fbca4 --- /dev/null +++ b/packages/tauri/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png diff --git a/packages/tauri/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png b/packages/tauri/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png Binary files differnew file mode 100644 index 000000000..cda7c3e6d --- /dev/null +++ b/packages/tauri/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png diff --git a/packages/tauri/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png b/packages/tauri/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png Binary files differnew file mode 100644 index 000000000..cb9d5ef52 --- /dev/null +++ b/packages/tauri/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png diff --git a/packages/tauri/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png b/packages/tauri/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png Binary files differnew file mode 100644 index 000000000..557ddef40 --- /dev/null +++ b/packages/tauri/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png diff --git a/packages/tauri/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png b/packages/tauri/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png Binary files differnew file mode 100644 index 000000000..df0abee51 --- /dev/null +++ b/packages/tauri/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png diff --git a/packages/tauri/src-tauri/icons/android/values/ic_launcher_background.xml b/packages/tauri/src-tauri/icons/android/values/ic_launcher_background.xml new file mode 100644 index 000000000..ea9c223a6 --- /dev/null +++ b/packages/tauri/src-tauri/icons/android/values/ic_launcher_background.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <color name="ic_launcher_background">#fff</color> +</resources>
\ No newline at end of file diff --git a/packages/tauri/src-tauri/icons/icon.icns b/packages/tauri/src-tauri/icons/icon.icns Binary files differindex 12a5bcee2..8a6b43f96 100644 --- a/packages/tauri/src-tauri/icons/icon.icns +++ b/packages/tauri/src-tauri/icons/icon.icns diff --git a/packages/tauri/src-tauri/icons/icon.ico b/packages/tauri/src-tauri/icons/icon.ico Binary files differindex b3636e4b2..7749a74b1 100644 --- a/packages/tauri/src-tauri/icons/icon.ico +++ b/packages/tauri/src-tauri/icons/icon.ico diff --git a/packages/tauri/src-tauri/icons/icon.png b/packages/tauri/src-tauri/icons/icon.png Binary files differindex e1cd2619e..ae5fdabbe 100644 --- a/packages/tauri/src-tauri/icons/icon.png +++ b/packages/tauri/src-tauri/icons/icon.png diff --git a/packages/tauri/src-tauri/icons/ios/[email protected] b/packages/tauri/src-tauri/icons/ios/[email protected] Binary files differnew file mode 100644 index 000000000..36d7ee388 --- /dev/null +++ b/packages/tauri/src-tauri/icons/ios/[email protected] diff --git a/packages/tauri/src-tauri/icons/ios/[email protected] b/packages/tauri/src-tauri/icons/ios/[email protected] Binary files differnew file mode 100644 index 000000000..871f8e39d --- /dev/null +++ b/packages/tauri/src-tauri/icons/ios/[email protected] diff --git a/packages/tauri/src-tauri/icons/ios/[email protected] b/packages/tauri/src-tauri/icons/ios/[email protected] Binary files differnew file mode 100644 index 000000000..871f8e39d --- /dev/null +++ b/packages/tauri/src-tauri/icons/ios/[email protected] diff --git a/packages/tauri/src-tauri/icons/ios/[email protected] b/packages/tauri/src-tauri/icons/ios/[email protected] Binary files differnew file mode 100644 index 000000000..007046c4a --- /dev/null +++ b/packages/tauri/src-tauri/icons/ios/[email protected] diff --git a/packages/tauri/src-tauri/icons/ios/[email protected] b/packages/tauri/src-tauri/icons/ios/[email protected] Binary files differnew file mode 100644 index 000000000..288506f61 --- /dev/null +++ b/packages/tauri/src-tauri/icons/ios/[email protected] diff --git a/packages/tauri/src-tauri/icons/ios/[email protected] b/packages/tauri/src-tauri/icons/ios/[email protected] Binary files differnew file mode 100644 index 000000000..013281df8 --- /dev/null +++ b/packages/tauri/src-tauri/icons/ios/[email protected] diff --git a/packages/tauri/src-tauri/icons/ios/[email protected] b/packages/tauri/src-tauri/icons/ios/[email protected] Binary files differnew file mode 100644 index 000000000..013281df8 --- /dev/null +++ b/packages/tauri/src-tauri/icons/ios/[email protected] diff --git a/packages/tauri/src-tauri/icons/ios/[email protected] b/packages/tauri/src-tauri/icons/ios/[email protected] Binary files differnew file mode 100644 index 000000000..b042fbdda --- /dev/null +++ b/packages/tauri/src-tauri/icons/ios/[email protected] diff --git a/packages/tauri/src-tauri/icons/ios/[email protected] b/packages/tauri/src-tauri/icons/ios/[email protected] Binary files differnew file mode 100644 index 000000000..871f8e39d --- /dev/null +++ b/packages/tauri/src-tauri/icons/ios/[email protected] diff --git a/packages/tauri/src-tauri/icons/ios/[email protected] b/packages/tauri/src-tauri/icons/ios/[email protected] Binary files differnew file mode 100644 index 000000000..a78ec7334 --- /dev/null +++ b/packages/tauri/src-tauri/icons/ios/[email protected] diff --git a/packages/tauri/src-tauri/icons/ios/[email protected] b/packages/tauri/src-tauri/icons/ios/[email protected] Binary files differnew file mode 100644 index 000000000..a78ec7334 --- /dev/null +++ b/packages/tauri/src-tauri/icons/ios/[email protected] diff --git a/packages/tauri/src-tauri/icons/ios/[email protected] b/packages/tauri/src-tauri/icons/ios/[email protected] Binary files differnew file mode 100644 index 000000000..9de8403a8 --- /dev/null +++ b/packages/tauri/src-tauri/icons/ios/[email protected] diff --git a/packages/tauri/src-tauri/icons/ios/[email protected] b/packages/tauri/src-tauri/icons/ios/[email protected] Binary files differnew file mode 100644 index 000000000..348f719a1 --- /dev/null +++ b/packages/tauri/src-tauri/icons/ios/[email protected] diff --git a/packages/tauri/src-tauri/icons/ios/[email protected] b/packages/tauri/src-tauri/icons/ios/[email protected] Binary files differnew file mode 100644 index 000000000..9de8403a8 --- /dev/null +++ b/packages/tauri/src-tauri/icons/ios/[email protected] diff --git a/packages/tauri/src-tauri/icons/ios/[email protected] b/packages/tauri/src-tauri/icons/ios/[email protected] Binary files differnew file mode 100644 index 000000000..b06c67dd8 --- /dev/null +++ b/packages/tauri/src-tauri/icons/ios/[email protected] diff --git a/packages/tauri/src-tauri/icons/ios/[email protected] b/packages/tauri/src-tauri/icons/ios/[email protected] Binary files differnew file mode 100644 index 000000000..903dc4d3e --- /dev/null +++ b/packages/tauri/src-tauri/icons/ios/[email protected] diff --git a/packages/tauri/src-tauri/icons/ios/[email protected] b/packages/tauri/src-tauri/icons/ios/[email protected] Binary files differnew file mode 100644 index 000000000..c2f796c30 --- /dev/null +++ b/packages/tauri/src-tauri/icons/ios/[email protected] diff --git a/packages/tauri/src-tauri/icons/ios/[email protected] b/packages/tauri/src-tauri/icons/ios/[email protected] Binary files differnew file mode 100644 index 000000000..fd49a44f3 --- /dev/null +++ b/packages/tauri/src-tauri/icons/ios/[email protected] diff --git a/packages/tauri/src-tauri/src/lib.rs b/packages/tauri/src-tauri/src/lib.rs index 4a277ef35..836d575cd 100644 --- a/packages/tauri/src-tauri/src/lib.rs +++ b/packages/tauri/src-tauri/src/lib.rs @@ -1,14 +1,269 @@ -// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/ -#[tauri::command] -fn greet(name: &str) -> String { - format!("Hello, {}! You've been greeted from Rust!", name) +use std::{ + net::SocketAddr, + process::Command, + sync::{Arc, Mutex}, + time::{Duration, Instant}, +}; +use tauri::{App, AppHandle, Manager, RunEvent, WebviewUrl, WebviewWindow}; +use tauri_plugin_dialog::{DialogExt, MessageDialogButtons, MessageDialogResult}; +use tauri_plugin_shell::process::{CommandChild, CommandEvent}; +use tauri_plugin_shell::ShellExt; +use tauri_plugin_updater::UpdaterExt; +use tokio::net::TcpSocket; + +#[derive(Clone)] +struct ServerState(Arc<Mutex<Option<CommandChild>>>); + +fn get_sidecar_port() -> u16 { + option_env!("OPENCODE_PORT") + .map(|s| s.to_string()) + .or_else(|| std::env::var("OPENCODE_PORT").ok()) + .and_then(|port_str| port_str.parse().ok()) + .unwrap_or(4096) +} + +fn find_and_kill_process_on_port(port: u16) -> Result<(), Box<dyn std::error::Error>> { + // Find all listeners on the specified port + let listeners = listeners::get_processes_by_port(port)?; + + if listeners.is_empty() { + println!("No processes found listening on port {}", port); + return Ok(()); + } + + for listener in listeners { + let pid = listener.pid; + println!("Found process {} listening on port {}", pid, port); + + // Kill the process using platform-appropriate command + #[cfg(target_os = "windows")] + { + Command::new("taskkill") + .args(["/F", "/PID", &pid.to_string()]) + .output()?; + } + + #[cfg(not(target_os = "windows"))] + { + Command::new("kill") + .args(["-9", &pid.to_string()]) + .output()?; + } + + println!("Killed process {}", pid); + } + + Ok(()) +} + +fn spawn_sidecar(app: &AppHandle, port: u16) -> CommandChild { + let (mut rx, child) = app + .shell() + .sidecar("opencode") + .unwrap() + .args(["serve", &format!("--port={port}")]) + .spawn() + .expect("Failed to spawn opencode"); + + tauri::async_runtime::spawn(async move { + while let Some(event) = rx.recv().await { + match event { + CommandEvent::Stdout(line_bytes) => { + let line = String::from_utf8_lossy(&line_bytes); + print!("{line}"); + } + CommandEvent::Stderr(line_bytes) => { + let line = String::from_utf8_lossy(&line_bytes); + eprint!("{line}"); + } + _ => {} + } + } + }); + + child +} + +async fn is_server_running(port: u16) -> bool { + TcpSocket::new_v4() + .unwrap() + .connect(SocketAddr::new( + "127.0.0.1".parse().expect("Failed to parse IP"), + port, + )) + .await + .is_ok() } #[cfg_attr(mobile, tauri::mobile_entry_point)] pub fn run() { - tauri::Builder::default() + let updater_enabled = option_env!("TAURI_SIGNING_PRIVATE_KEY").is_some(); + + let mut builder = tauri::Builder::default() + .plugin(tauri_plugin_dialog::init()) + .plugin(tauri_plugin_shell::init()) .plugin(tauri_plugin_opener::init()) - .invoke_handler(tauri::generate_handler![greet]) - .run(tauri::generate_context!()) - .expect("error while running tauri application"); + .setup(move |app| { + let app = app.handle().clone(); + + if updater_enabled { + tauri::async_runtime::spawn(run_updater(app.clone())); + } + + tauri::async_runtime::spawn(async move { + let port = get_sidecar_port(); + let socket_connected = is_server_running(port).await; + + let should_spawn_sidecar = if socket_connected { + let res = app + .dialog() + .message( + "OpenCode Server is already running, would you like to restart it?", + ) + .buttons(MessageDialogButtons::YesNo) + .blocking_show_with_result(); + + match res { + MessageDialogResult::Yes => { + if let Err(e) = find_and_kill_process_on_port(port) { + eprintln!("Failed to kill process on port {}: {}", port, e); + } + true + } + _ => false, + } + } else { + true + }; + + let child = if should_spawn_sidecar { + let child = spawn_sidecar(&app, port); + + let timestamp = Instant::now(); + loop { + if timestamp.elapsed() > Duration::from_secs(3) { + todo!("Handle server spawn timeout"); + } + + tokio::time::sleep(Duration::from_millis(10)).await; + + if is_server_running(port).await { + // give the server a little bit more time to warm up + tokio::time::sleep(Duration::from_millis(10)).await; + + break; + } + } + + println!("Server ready after {:?}", timestamp.elapsed()); + + Some(child) + } else { + None + }; + + let mut window_builder = + WebviewWindow::builder(&app, "main", WebviewUrl::App("/".into())) + .title("OpenCode") + .inner_size(800.0, 600.0) + .decorations(true); + + #[cfg(target_os = "macos")] + { + window_builder = window_builder.hidden_title(true); + } + + window_builder.build().expect("Failed to create window"); + + app.manage(ServerState(Arc::new(Mutex::new(child)))); + }); + + Ok(()) + }); + + if updater_enabled { + builder = builder.plugin(tauri_plugin_updater::Builder::new().build()); + } + + builder + .build(tauri::generate_context!()) + .expect("error while running tauri application") + .run(|app, event| { + if let RunEvent::Exit = event { + println!("Received Exit"); + + let _ = app + .state::<ServerState>() + .0 + .lock() + .expect("Failed to acquire mutex lock") + .take() + .expect("State not found") + .kill(); + + println!("Killed server"); + } + }); +} + +async fn run_updater(app: AppHandle) { + let update = match app + .updater_builder() + .version_comparator(|v, r| { + dbg!(&v, &r); + r.version > v + }) + .build() + .unwrap() + .check() + .await + { + Ok(u) => u, + Err(e) => { + dbg!(e); + app.dialog() + .message("Failed to check for updates") + .show(|_| {}); + return; + } + }; + + dbg!(update.is_some()); + + let Some(update) = update else { + return; + }; + + let Ok(update_bytes) = update.download(|_, _| {}, || {}).await else { + return; + }; + + let should_update = app + .dialog() + .message(format!( + "Version {} of OpenCode is available, would you like to install it?", + &update.version + )) + .buttons(MessageDialogButtons::YesNo) + .blocking_show(); + + if !should_update { + return; + } + + if update.install(update_bytes).is_err() { + app.dialog() + .message("Failed to install update") + .blocking_show(); + } + + let should_restart = app + .dialog() + .message("Update installed successfully, would you like to restart OpenCode?") + .buttons(MessageDialogButtons::YesNo) + .blocking_show(); + + if should_restart { + app.restart(); + } } diff --git a/packages/tauri/src-tauri/tauri.conf.json b/packages/tauri/src-tauri/tauri.conf.json index 754569c6a..fcb6c03de 100644 --- a/packages/tauri/src-tauri/tauri.conf.json +++ b/packages/tauri/src-tauri/tauri.conf.json @@ -1,8 +1,9 @@ { "$schema": "https://schema.tauri.app/config/2", - "productName": "opencode", - "version": "0.1.0", - "identifier": "ai.opencode", + "productName": "OpenCode", + "mainBinaryName": "OpenCode Desktop", + "version": "../package.json", + "identifier": "ai.opencode.desktop", "build": { "beforeDevCommand": "bun run dev", "devUrl": "http://localhost:1420", @@ -11,21 +12,22 @@ }, "app": { "withGlobalTauri": true, - "windows": [ - { - "title": "opencode", - "width": 800, - "height": 600, - "url": "https://desktop.dev.opencode.ai" - } - ], "security": { "csp": null - } + }, + "macOSPrivateApi": true }, "bundle": { "active": true, - "targets": "all", - "icon": ["icons/32x32.png", "icons/128x128.png", "icons/[email protected]", "icons/icon.icns", "icons/icon.ico"] + "targets": ["deb", "rpm", "appimage", "dmg", "app", "nsis"], + "icon": ["icons/32x32.png", "icons/128x128.png", "icons/[email protected]", "icons/icon.icns", "icons/icon.ico"], + "externalBin": ["sidecars/opencode"], + "createUpdaterArtifacts": true + }, + "plugins": { + "updater": { + "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDgxNjQ5OUExQjg2MEI3ODAKUldTQXQyQzRvWmxrZ2VOU09ta1IwSVpKSlQ1ZjJsRVh3cmRZcEZKUlF2MzBpTHcwWU82WWRLOXIK", + "endpoints": ["https://github.com/brendonovich/opencode/releases/latest/download/latest.json"] + } } } |
