Tauri desktop shell (reuses web/ frontend, connects to OpenAI-compatible endpoint, isolated in desktop/) (#24)
* Add Tauri desktop shell * Update desktop setup after web UI merge * Declare desktop bundle icons
@@ -6,6 +6,8 @@ __pycache__/
|
|||||||
web/node_modules/
|
web/node_modules/
|
||||||
web/dist/
|
web/dist/
|
||||||
web/*.tsbuildinfo
|
web/*.tsbuildinfo
|
||||||
|
desktop/src-tauri/target/
|
||||||
|
desktop/src-tauri/gen/
|
||||||
|
|
||||||
# binari compilati (si rigenerano con make / coli build)
|
# binari compilati (si rigenerano con make / coli build)
|
||||||
c/glm
|
c/glm
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 168 168">
|
||||||
|
<rect width="168" height="168" rx="36" fill="#080b0d"/>
|
||||||
|
<g transform="translate(7 21)" shape-rendering="crispEdges">
|
||||||
|
<rect x="56" y="0" width="14" height="14" fill="#d75fd7"/>
|
||||||
|
<rect x="70" y="0" width="14" height="14" fill="#d75fd7"/>
|
||||||
|
<rect x="84" y="0" width="14" height="14" fill="#d75fd7"/>
|
||||||
|
<rect x="42" y="14" width="14" height="14" fill="#d75fd7"/>
|
||||||
|
<rect x="56" y="14" width="14" height="14" fill="#d75fd7"/>
|
||||||
|
<rect x="70" y="14" width="14" height="14" fill="#d75fd7"/>
|
||||||
|
<rect x="84" y="14" width="14" height="14" fill="#d75fd7"/>
|
||||||
|
<rect x="98" y="14" width="14" height="14" fill="#d75fd7"/>
|
||||||
|
<rect x="140" y="14" width="14" height="14" fill="#5fd7d7"/>
|
||||||
|
<rect x="56" y="28" width="14" height="14" fill="#d75fd7"/>
|
||||||
|
<rect x="70" y="28" width="14" height="14" fill="#d75fd7"/>
|
||||||
|
<rect x="84" y="28" width="14" height="14" fill="#d75fd7"/>
|
||||||
|
<rect x="98" y="28" width="14" height="14" fill="#d75fd7"/>
|
||||||
|
<rect x="126" y="28" width="14" height="14" fill="#5fd7d7"/>
|
||||||
|
<rect x="140" y="28" width="14" height="14" fill="#5fd7d7"/>
|
||||||
|
<rect x="0" y="42" width="14" height="14" fill="#ff8700"/>
|
||||||
|
<rect x="14" y="42" width="14" height="14" fill="#ff8700"/>
|
||||||
|
<rect x="28" y="42" width="14" height="14" fill="#ff8700"/>
|
||||||
|
<rect x="42" y="42" width="14" height="14" fill="#ff8700"/>
|
||||||
|
<rect x="56" y="42" width="14" height="14" fill="#00afaf"/>
|
||||||
|
<rect x="70" y="42" width="14" height="14" fill="#00afaf"/>
|
||||||
|
<rect x="84" y="42" width="14" height="14" fill="#fff"/>
|
||||||
|
<rect x="98" y="42" width="14" height="14" fill="#00afaf"/>
|
||||||
|
<rect x="112" y="42" width="14" height="14" fill="#5fd7d7"/>
|
||||||
|
<rect x="126" y="42" width="14" height="14" fill="#5fd7d7"/>
|
||||||
|
<rect x="56" y="56" width="14" height="14" fill="#00afaf"/>
|
||||||
|
<rect x="70" y="56" width="14" height="14" fill="#00afaf"/>
|
||||||
|
<rect x="84" y="56" width="14" height="14" fill="#00afaf"/>
|
||||||
|
<rect x="98" y="56" width="14" height="14" fill="#00afaf"/>
|
||||||
|
<rect x="112" y="56" width="14" height="14" fill="#00afaf"/>
|
||||||
|
<rect x="126" y="56" width="14" height="14" fill="#5fd7d7"/>
|
||||||
|
<rect x="140" y="56" width="14" height="14" fill="#5fd7d7"/>
|
||||||
|
<rect x="70" y="70" width="14" height="14" fill="#00afaf"/>
|
||||||
|
<rect x="84" y="70" width="14" height="14" fill="#00afaf"/>
|
||||||
|
<rect x="98" y="70" width="14" height="14" fill="#00afaf"/>
|
||||||
|
<rect x="112" y="70" width="14" height="14" fill="#00afaf"/>
|
||||||
|
<rect x="126" y="70" width="14" height="14" fill="#5fd7d7"/>
|
||||||
|
<rect x="140" y="70" width="14" height="14" fill="#5fd7d7"/>
|
||||||
|
<rect x="84" y="84" width="14" height="14" fill="#00afaf"/>
|
||||||
|
<rect x="98" y="84" width="14" height="14" fill="#00afaf"/>
|
||||||
|
<rect x="112" y="84" width="14" height="14" fill="#5fd7d7"/>
|
||||||
|
<rect x="126" y="84" width="14" height="14" fill="#5fd7d7"/>
|
||||||
|
<rect x="98" y="98" width="14" height="14" fill="#00afaf"/>
|
||||||
|
<rect x="112" y="98" width="14" height="14" fill="#5fd7d7"/>
|
||||||
|
<rect x="112" y="112" width="14" height="14" fill="#5fd7d7"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 3.0 KiB |
@@ -0,0 +1,35 @@
|
|||||||
|
# colibrì desktop
|
||||||
|
|
||||||
|
Tauri v2 shell for the shared React interface in `../web`.
|
||||||
|
|
||||||
|
This directory intentionally contains no second frontend. During development,
|
||||||
|
Tauri starts the Vite server from `web/`; release builds package `web/dist`.
|
||||||
|
|
||||||
|
## Development
|
||||||
|
|
||||||
|
The shared web UI landed in PR #23 and is already part of `main`. From the
|
||||||
|
repository root, install its dependencies and start the desktop shell:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cd web
|
||||||
|
npm ci
|
||||||
|
cd ../desktop
|
||||||
|
cargo install tauri-cli --version "^2.0.0" --locked
|
||||||
|
cargo tauri dev
|
||||||
|
```
|
||||||
|
|
||||||
|
The application connects to an OpenAI-compatible server configured in the UI.
|
||||||
|
Bundling the inference engine or managing its process is intentionally deferred:
|
||||||
|
the model is hundreds of gigabytes and must remain an external, user-selected
|
||||||
|
resource rather than an opaque application sidecar.
|
||||||
|
|
||||||
|
This first desktop increment only packages the existing UI in a native window.
|
||||||
|
It does not change the web application, start the inference engine, download
|
||||||
|
models, or add native filesystem and process permissions.
|
||||||
|
|
||||||
|
## Validation
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cargo fmt --manifest-path src-tauri/Cargo.toml --check
|
||||||
|
cargo check --manifest-path src-tauri/Cargo.toml
|
||||||
|
```
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
[package]
|
||||||
|
name = "colibri-desktop"
|
||||||
|
version = "0.1.0"
|
||||||
|
description = "Native desktop shell for the colibri inference engine"
|
||||||
|
authors = ["colibri contributors"]
|
||||||
|
edition = "2024"
|
||||||
|
rust-version = "1.85"
|
||||||
|
|
||||||
|
[lib]
|
||||||
|
name = "colibri_desktop_lib"
|
||||||
|
crate-type = ["staticlib", "cdylib", "rlib"]
|
||||||
|
|
||||||
|
[build-dependencies]
|
||||||
|
tauri-build = { version = "2.6.3", features = [] }
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
tauri = { version = "2.11.5", features = [] }
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fn main() {
|
||||||
|
tauri_build::build()
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"$schema": "../gen/schemas/desktop-schema.json",
|
||||||
|
"identifier": "default",
|
||||||
|
"description": "Default capability for the main colibri window",
|
||||||
|
"windows": ["main"],
|
||||||
|
"permissions": ["core:default"]
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 407 B |
|
After Width: | Height: | Size: 714 B |
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
@@ -0,0 +1,6 @@
|
|||||||
|
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||||
|
pub fn run() {
|
||||||
|
tauri::Builder::default()
|
||||||
|
.run(tauri::generate_context!())
|
||||||
|
.expect("failed to run the colibri desktop application");
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
colibri_desktop_lib::run();
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://schema.tauri.app/config/2",
|
||||||
|
"productName": "colibrì",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"identifier": "org.colibri.desktop",
|
||||||
|
"build": {
|
||||||
|
"beforeDevCommand": "npm --prefix ../web run dev",
|
||||||
|
"devUrl": "http://localhost:5173",
|
||||||
|
"beforeBuildCommand": "npm --prefix ../web run build",
|
||||||
|
"frontendDist": "../../web/dist"
|
||||||
|
},
|
||||||
|
"app": {
|
||||||
|
"windows": [
|
||||||
|
{
|
||||||
|
"label": "main",
|
||||||
|
"title": "colibrì",
|
||||||
|
"width": 1280,
|
||||||
|
"height": 820,
|
||||||
|
"minWidth": 860,
|
||||||
|
"minHeight": 600,
|
||||||
|
"center": true,
|
||||||
|
"resizable": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"security": {
|
||||||
|
"csp": "default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' asset: http://asset.localhost; connect-src 'self' ipc: http://ipc.localhost http://127.0.0.1:* http://localhost:*"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"bundle": {
|
||||||
|
"active": true,
|
||||||
|
"targets": "all",
|
||||||
|
"category": "DeveloperTool",
|
||||||
|
"shortDescription": "Local interface for the colibri inference engine",
|
||||||
|
"icon": [
|
||||||
|
"icons/32x32.png",
|
||||||
|
"icons/128x128.png",
|
||||||
|
"icons/128x128@2x.png",
|
||||||
|
"icons/icon.icns",
|
||||||
|
"icons/icon.ico"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||