Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.
Rust acpagent-client-protocolai-agentsai-assistantclaudeclaude-codecodexcoding-agentscursorgeminigemini-cligrok-bot-alternativeiosiphonelinuxmacosmcpopen-sourcerustself-hosted
Native Linux app and icon-first buttons
leepokai58ab8c0ded53
diff --git a/.github/workflows/host.yml b/.github/workflows/host.ymlindex 71060c27..f52b3d9e 100644--- a/.github/workflows/host.yml+++ b/.github/workflows/host.yml@@ -3,10 +3,10 @@ name: codync-hoston:push:branches: [main, v2]- paths: ["host/**", ".github/workflows/host.yml"]+ paths: ["host/**", "linux/**", ".github/workflows/host.yml"]tags: ["host-v*"]pull_request:- paths: ["host/**"]+ paths: ["host/**", "linux/**"]jobs:test:@@ -28,6 +28,45 @@ jobs:- run: cargo clippy -- -D warnings- run: cargo test+ linux-app:+ strategy:+ matrix:+ include:+ - { os: ubuntu-24.04, target: x86_64-unknown-linux-gnu }+ - { os: ubuntu-24.04-arm, target: aarch64-unknown-linux-gnu }+ runs-on: ${{ matrix.os }}+ permissions:+ contents: write+ defaults:+ run:+ working-directory: linux+ steps:+ - uses: actions/checkout@v4+ - run: sudo apt-get update && sudo apt-get install -y libgtk-4-dev libadwaita-1-dev+ - uses: dtolnay/rust-toolchain@stable+ with:+ components: clippy+ - uses: Swatinem/rust-cache@v2+ with:+ workspaces: linux+ - run: cargo clippy -- -D warnings+ - run: cargo test+ - name: Package+ if: startsWith(github.ref, 'refs/tags/host-v')+ run: |+ VERSION=${GITHUB_REF_NAME#host-v}+ NAME=codync-linux-$VERSION-${{ matrix.target }}+ cargo build --release+ mkdir -p $NAME/share/applications $NAME/share/icons/hicolor/scalable/apps $NAME/bin+ cp target/release/codync $NAME/bin/+ cp data/com.pokai.Codync.desktop $NAME/share/applications/+ cp data/com.pokai.Codync.svg $NAME/share/icons/hicolor/scalable/apps/+ tar czf ../$NAME.tar.gz $NAME+ - uses: softprops/action-gh-release@v2+ if: startsWith(github.ref, 'refs/tags/host-v')+ with:+ files: codync-linux-*.tar.gz+release:if: startsWith(github.ref, 'refs/tags/host-v')needs: testdiff --git a/CLAUDE.md b/CLAUDE.mdindex c02dcc08..6074aa97 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -13,14 +13,17 @@ Bot-based remote for coding agents: persistent named bots on your computer, mess## Architecture-- `host/` — **codync-host** (Rust, macOS + Linux). Drives agents over **ACP** (JSON-RPC on stdio, hand-rolled in `acp.rs`, updates kept as `serde_json::Value` so new adapter variants never break parsing). One actor per bot (`bot.rs`) owns the agent process + session and maps `session/update` onto transcript entries.+- Clients: iOS app, native Mac window (menu bar app), native Linux app (`linux/`, GTK 4 + libadwaita in Rust). All talk to the host API; no web UI.+- Shared Swift: `CodyncKit` (models, client, theme, avatars) + `CodyncUI` (`BotStore` + chat screens) used by iOS and macOS. Platform specifics go through `BotStore` hooks or `Platform.swift`.+- UI principle: buttons an icon can express are icon-only (with tooltip / accessibility label); text only where an icon would be ambiguous (approval choices).+- `host/` — **codync-host** (Rust, macOS + Linux). Detects installed harnesses (`backends.rs`: login-shell PATH + known dirs) and the ACP registry (`registry.rs`, cached in `~/.codync/registry.json`, binaries under `~/.codync/agents`). Drives agents over **ACP** (JSON-RPC on stdio, hand-rolled in `acp.rs`, updates kept as `serde_json::Value` so new adapter variants never break parsing). One actor per bot (`bot.rs`) owns the agent process + session and maps `session/update` onto transcript entries.- **Thread ≠ session**: a bot is one endless transcript (SQLite `entries`, ordered by `seq`); the ACP session underneath is resumed with `session/load` or replaced by *New session*.- **Chat shows only**: user messages, the *final* agent message of each turn (`data.final`), permission cards, notices. Narration, thoughts, tool calls, plans are trace entries (Full conversation sheet).- **Sync**: every mutation stamps a global `rev`. Clients call `GET /events?since=<rev>` (catch-up in rev order, then live). Emission happens under `Hub::emit_lock` so events leave in rev order. Clients upsert by id; never skip undecodable events (the iOS app rewinds to rev 0).- API: `POST /api/<method>` + SSE, bearer token (`~/.codync/token`). Default port **19222**, binds 0.0.0.0 for Tailscale/LAN.- Push: iOS registers its APNs token with `relay/` → gets an AES-GCM ticket → gives it to the host. Only two alert kinds: *needs you* and *done*, suppressed while the iOS app is connected.-- Usage: host-only reads (Claude statusline ingest + `/api/oauth/usage` with the stored Claude Code token, Codex rollout files). Never refresh or write agent credentials.-- macOS app is thin: embeds `codync-host` in `Contents/MacOS` (Xcode post-build script runs cargo), installs it as a launchd agent via `codync-host install`, shows status/pairing/usage. Not sandboxed, not Mac App Store (the host must spawn CLIs).+- Usage: local only — `claude -p /usage --no-session-persistence`, the Claude status line (`codync-host statusline`, wrapping any existing one), Claude ACP `usage_update` rate-limit meta, Codex rollout files. Never call provider APIs with agent credentials.+- macOS app is thin: embeds `codync-host` in `Contents/MacOS` (Xcode post-build script runs cargo), installs it as a launchd agent via `codync-host install`; menu bar shows status/pairing/usage and opens the native chat window (NavigationSplitView over `CodyncUI`). Not sandboxed, not Mac App Store (the host must spawn CLIs).- Do **not** reintroduce Claude Code hooks or CloudKit — both were removed in 2.0.## Project generation@@ -43,4 +46,5 @@ Bot-based remote for coding agents: persistent named bots on your computer, mess- `Codync-macOS` — menu bar app + embedded host- `Codync-iOS` — iOS app- `CodyncWidgets` — usage widget + bot Live Activity (bundle id `com.pokai.Codync.ios.LiveActivity`)-- `CodyncKit` — shared Swift package (models, host client, theme, avatars)+- `CodyncKit` — shared Swift package: `CodyncKit` + `CodyncUI` libraries+- `linux/` — `codync` GTK app (build/test in a container with libgtk-4-dev + libadwaita-1-dev)diff --git a/Codync-iOS/Views/PairingView.swift b/Codync-iOS/Views/PairingView.swiftindex 240298bd..b1f366e0 100644--- a/Codync-iOS/Views/PairingView.swift+++ b/Codync-iOS/Views/PairingView.swift@@ -54,7 +54,9 @@ struct PairingView: View {.textInputAutocapitalization(.never).autocorrectionDisabled().font(.callout.monospaced())- Button("Pair") { pair(pasted) }+ Button("Pair", systemImage: "arrow.right.circle.fill") { pair(pasted) }+ .labelStyle(.iconOnly)+ .font(.title3).disabled(pasted.isEmpty)}.padding(12)diff --git a/Codync-iOS/Views/SettingsView.swift b/Codync-iOS/Views/SettingsView.swiftindex 51073ffe..5f15ab0f 100644--- a/Codync-iOS/Views/SettingsView.swift+++ b/Codync-iOS/Views/SettingsView.swift@@ -32,7 +32,9 @@ struct SettingsView: View {Section {ForEach(model.usage.providers) { UsageCard(provider: $0) }- Button("Refresh") { Task { await model.refreshUsage() } }+ Button("Refresh", systemImage: "arrow.clockwise") { Task { await model.refreshUsage() } }+ .labelStyle(.iconOnly)+ .accessibilityLabel("Refresh usage")} header: {Text("Usage limits")} footer: {@@ -61,7 +63,7 @@ struct SettingsView: View {CharacterAvatar(bot: bot, size: 28, animated: false)Text(bot.name)Spacer()- Button("Unhide") { model.setHidden(bot, false) }+ Button("Unhide", systemImage: "eye") { model.setHidden(bot, false) }.labelStyle(.iconOnly)}}}@@ -83,7 +85,9 @@ struct SettingsView: View {.navigationTitle("Settings").navigationBarTitleDisplayMode(.inline).toolbar {- ToolbarItem(placement: .confirmationAction) { Button("Done") { dismiss() } }+ ToolbarItem(placement: .confirmationAction) {+ Button("Done", systemImage: "checkmark") { dismiss() }.labelStyle(.iconOnly)+ }}.confirmationDialog("Unpair from \(model.hostName)?", isPresented: $confirmUnpair, titleVisibility: .visible) {Button("Unpair", role: .destructive) {diff --git a/Codync-macOS/CodyncMacApp.swift b/Codync-macOS/CodyncMacApp.swiftindex a357878d..8bde6109 100644--- a/Codync-macOS/CodyncMacApp.swift+++ b/Codync-macOS/CodyncMacApp.swift@@ -59,15 +59,19 @@ struct MenuView: View {openWindow(id: "chat")NSApp.activate()} label: {- Label("Open", systemImage: "bubble.left.and.bubble.right")+ Image(systemName: "bubble.left.and.bubble.right")}+ .help("Open Codync")+ .accessibilityLabel("Open Codync").controlSize(.small)Button {showPairing.toggle()if showPairing { host.loadPairing() }} label: {- Label("Pair", systemImage: "qrcode")+ Image(systemName: "qrcode")}+ .help("Pair iPhone")+ .accessibilityLabel("Pair iPhone").buttonStyle(.borderedProminent).tint(Palette.accentFill).foregroundStyle(Palette.onAccent)@@ -182,7 +186,9 @@ struct MenuView: View {}.menuStyle(.borderlessButton).fixedSize()- Button("Quit") { NSApp.terminate(nil) }+ Button("Quit Codync", systemImage: "power") { NSApp.terminate(nil) }+ .labelStyle(.iconOnly)+ .help("Quit Codync").font(.caption)}.padding(10)@@ -206,7 +212,10 @@ private struct BotLine: View {}Spacer()if bot.isWorking && hovering {- Button("Stop", action: stop).controlSize(.small)+ Button("Stop", systemImage: "stop.fill", action: stop)+ .labelStyle(.iconOnly)+ .help("Stop")+ .controlSize(.small)} else {Text(RelativeTime.short(Date(milliseconds: bot.lastAt))).font(.caption2).foregroundStyle(Palette.tertiary)}@@ -246,15 +255,20 @@ private struct PairingPanel: View {.foregroundStyle(Palette.tertiary).multilineTextAlignment(.center)}- Button("Copy link") {+ Button("Copy pairing link", systemImage: "doc.on.doc") {NSPasteboard.general.clearContents()NSPasteboard.general.setString(info.pairingUrl, forType: .string)}+ .labelStyle(.iconOnly)+ .help("Copy pairing link").controlSize(.small)} else {ProgressView()}- Button("Done", action: close).controlSize(.small)+ Button("Close", systemImage: "xmark", action: close)+ .labelStyle(.iconOnly)+ .help("Close")+ .controlSize(.small)}.frame(maxWidth: .infinity).padding(16)diff --git a/CodyncKit/Sources/CodyncUI/BotEditorView.swift b/CodyncKit/Sources/CodyncUI/BotEditorView.swiftindex 6f8927d4..bcd45014 100644--- a/CodyncKit/Sources/CodyncUI/BotEditorView.swift+++ b/CodyncKit/Sources/CodyncUI/BotEditorView.swift@@ -102,12 +102,16 @@ public struct BotEditorView: View {.navigationTitle(isNew ? "New bot" : "Edit bot").inlineNavigationTitle().toolbar {- ToolbarItem(placement: .cancellationAction) { Button("Cancel") { dismiss() } }+ ToolbarItem(placement: .cancellationAction) {+ Button("Cancel", systemImage: "xmark") { dismiss() }.labelStyle(.iconOnly).help("Cancel")+ }ToolbarItem(placement: .confirmationAction) {if saving {ProgressView()} else {- Button(isNew ? "Create" : "Save") { save() }+ Button(isNew ? "Create" : "Save", systemImage: "checkmark") { save() }+ .labelStyle(.iconOnly)+ .help(isNew ? "Create" : "Save").disabled(draft.name.trimmingCharacters(in: .whitespaces).isEmpty || draft.cwd.isEmpty)}}@@ -119,7 +123,9 @@ public struct BotEditorView: View {pickingFolder = false}.toolbar {- ToolbarItem(placement: .cancellationAction) { Button("Cancel") { pickingFolder = false } }+ ToolbarItem(placement: .cancellationAction) {+ Button("Cancel", systemImage: "xmark") { pickingFolder = false }.labelStyle(.iconOnly).help("Cancel")+ }}}}diff --git a/CodyncKit/Sources/CodyncUI/Roster.swift b/CodyncKit/Sources/CodyncUI/Roster.swiftindex b11476d0..e797da3b 100644--- a/CodyncKit/Sources/CodyncUI/Roster.swift+++ b/CodyncKit/Sources/CodyncUI/Roster.swift@@ -90,7 +90,9 @@ public struct ConnectionBanner: View {Image(systemName: "wifi.exclamationmark").foregroundStyle(Palette.warning)Text(reason).font(.footnote).foregroundStyle(Palette.secondary)Spacer()- Button("Retry") { model.restartStream() }.font(.footnote.bold())+ Button("Retry", systemImage: "arrow.clockwise") { model.restartStream() }+ .labelStyle(.iconOnly)+ .help("Retry")}.padding(10).background(Palette.surface, in: RoundedRectangle(cornerRadius: 10))diff --git a/CodyncKit/Sources/CodyncUI/ThreadView.swift b/CodyncKit/Sources/CodyncUI/ThreadView.swiftindex c3bb0d8a..fb8a7f72 100644--- a/CodyncKit/Sources/CodyncUI/ThreadView.swift+++ b/CodyncKit/Sources/CodyncUI/ThreadView.swift@@ -262,8 +262,8 @@ struct UserBubble: View {case "failed":HStack(spacing: 10) {Text("Failed to send").foregroundStyle(Palette.danger)- Button("Resend") { model.retry(entry) }- Button("Delete") { model.discard(entry) }+ Button("Resend", systemImage: "arrow.clockwise") { model.retry(entry) }.labelStyle(.iconOnly).help("Resend")+ Button("Delete", systemImage: "trash") { model.discard(entry) }.labelStyle(.iconOnly).help("Delete")}.font(.caption2.bold())case "cancelled":diff --git a/CodyncKit/Sources/CodyncUI/TraceView.swift b/CodyncKit/Sources/CodyncUI/TraceView.swiftindex 2b72dfc1..6b224f6e 100644--- a/CodyncKit/Sources/CodyncUI/TraceView.swift+++ b/CodyncKit/Sources/CodyncUI/TraceView.swift@@ -33,7 +33,9 @@ public struct TraceView: View {.navigationTitle("Full conversation").inlineNavigationTitle().toolbar {- ToolbarItem(placement: .confirmationAction) { Button("Done") { dismiss() } }+ ToolbarItem(placement: .confirmationAction) {+ Button("Done", systemImage: "checkmark") { dismiss() }.labelStyle(.iconOnly).help("Done")+ }}.defaultScrollAnchor(.bottom)}diff --git a/README.md b/README.mdindex 51a1a9ba..7b1b6f92 100644--- a/README.md+++ b/README.md@@ -2,7 +2,7 @@**Your coding agents, as teammates you can message.**-Codync turns Claude Code, Codex, OpenCode, Grok Build and Gemini CLI into persistent *bots* you delegate to from your iPhone — the way you'd message a colleague. Pick who, say what, put the phone away. You get a notification when a bot finishes or needs your approval.+Codync turns the coding agents on your computer — Claude Code, Codex, Cursor, Pi, OpenCode, Grok Build, Gemini, Copilot and ~40 more — into persistent *bots* you delegate to from your iPhone, Mac or Linux desktop, the way you'd message a colleague. Pick who, say what, put the phone away. You get a notification when a bot finishes or needs your approval.> Why bots? On a phone, "find the right working session, then pick an environment" is too slow. With bots you already know who to hand the intent to: open the chat, type, done.@@ -12,15 +12,16 @@ Codync turns Claude Code, Codex, OpenCode, Grok Build and Gemini CLI into persis## How it works```-iPhone (Codync) ⇄ HTTP + SSE over Tailscale / Wi-Fi ⇄ codync-host ⇄ ACP (stdio) ⇄ claude · codex · opencode · grok · gemini- ▲ │- └──────── APNs ◀── relay (Cloudflare Worker) ◀────────┘ "needs you" / "done"+iPhone · Mac window · Linux (GTK) ⇄ HTTP + SSE ⇄ codync-host ⇄ ACP (stdio) ⇄ claude · codex · cursor · pi · opencode · …+ ▲ │+ └──────── APNs ◀── relay (Cloudflare Worker) ◀─────┘ "needs you" / "done"```- **Bots** have a name, a character avatar, standing instructions, an agent backend, a project folder and a permission policy. Each bot is **one endless conversation**; the agent sessions underneath are an implementation detail (resumed with `session/load`, restarted with *New session*).- **The chat only shows what matters**: your messages, each turn's final reply, approval cards and notices. Every tool call, diff, plan and thought is one tap away in *Full conversation*. While a bot works, its row shows what it's doing right now.+- **Agents are detected automatically**: the host hydrates PATH from your login shell (plus Homebrew, ~/.local/bin, nvm, bun, volta, asdf, mise, pnpm…), finds every harness you have installed, and prefers its native ACP mode. Anything else in the official [ACP registry](https://agentclientprotocol.com/registry) can be picked too — Codync fetches it on first use (npx, uvx or a checksummed binary).- **codync-host** (Rust, macOS + Linux) runs on your computer. It speaks the [Agent Client Protocol](https://agentclientprotocol.com) to each agent, keeps transcripts in SQLite, and serves the phone. Every change carries a global `rev`, so the phone reconnects with `since: rev` and never misses anything.-- **Usage limits**: the host reads Claude (statusline `rate_limits`, or the OAuth usage endpoint with the token Claude Code already stored) and Codex (`~/.codex/sessions`) limits. Tokens never leave your computer; the phone and widgets only see percentages.+- **Usage limits** come from your local installs, with no extra login: Claude via `claude -p /usage` (a local command, no model call) plus Claude Code's status line, Codex via `~/.codex/sessions`. The phone, widgets and menu bar only see percentages.- **Push** goes through a tiny relay that holds the APNs key. The phone trades its device token for an encrypted ticket; the host only ever holds tickets.UI patterns (roster, character avatars, approval cards, trace sheet, "needs you / done" notifications) follow Grok Bot.@@ -33,25 +34,24 @@ UI patterns (roster, character avatars, approval cards, trace sheet, "needs youbrew install --cask leepokai/codync/codync```-Open Codync in the menu bar → **Install host** → **Pair iPhone**, and scan the code with the Codync app.+Open Codync in the menu bar → **Install host**. The chat bubble opens the full Codync window; the QR button pairs your iPhone.-**Linux**+**Linux** — native GTK 4 / libadwaita app plus the host:```bash-brew install leepokai/codync/codync-host # or download a release tarball+brew install leepokai/codync/codync-host # or a release tarballcodync-host install # systemd --user service-codync-host pair # shows the QR code in the terminal+codync # the desktop app (release tarball: bin/codync + .desktop file)+codync-host pair # QR code in the terminal, or Settings in the app```-Install [Tailscale](https://tailscale.com) on the computer and the phone to reach your bots from anywhere.+Building the Linux app yourself needs `libgtk-4-dev libadwaita-1-dev`: `cargo install --path linux`.-**Agents** — install and log in to whichever you use: `claude`, `codex`, `opencode`, `grok`, `gemini`. Claude Code and Codex are driven through their ACP adapters (`@agentclientprotocol/claude-agent-acp`, `@agentclientprotocol/codex-acp`), which `npx` fetches on first use, so Node.js is required for those two.+Install [Tailscale](https://tailscale.com) on the computer and the phone to reach your bots from anywhere.-Optional: show usage in Claude Code's status line and feed live limits to the host:+**Agents** — install and sign in to whichever you use; Codync finds them. Claude Code, Codex and Pi run through their ACP adapters (fetched by `npx`, so Node.js is needed for those).-```json-{ "statusLine": { "type": "command", "command": "codync-host statusline" } }-```+`codync-host install` also routes Claude Code's status line through `codync-host statusline` so live limits reach the host; an existing status line keeps working (it's wrapped, and restored on `uninstall`).## `codync-host`@@ -61,7 +61,7 @@ Optional: show usage in Claude Code's status line and feed live limits to the ho| `codync-host pair [--json]` | pairing QR code / link || `codync-host status` | installed? running? || `codync-host serve [--port 19222]` | run in the foreground |-| `codync-host statusline` | Claude Code status line command |+| `codync-host statusline [-- <your command>]` | Claude Code status line command (wraps yours) || `codync-host reset-token` | unpair every phone |Data lives in `~/.codync` (`codync.db`, `token`, `host.log`). **The token is full access** — whoever has it can run agents in any folder on your computer. Prefer Tailscale over open Wi-Fi (the API is plain HTTP; Tailscale encrypts it), and `codync-host reset-token` if a phone is lost. The API is `POST /api/<method>` + `GET /events` (SSE), both with `Authorization: Bearer <token>`; see `host/src/api.rs`.@@ -71,10 +71,11 @@ Data lives in `~/.codync` (`codync.db`, `token`, `host.log`). **The token is ful| Path | ||---|---|| `host/` | `codync-host` — Rust daemon: ACP client, SQLite transcript, HTTP/SSE API, push, usage |-| `Codync-iOS/` | iOS app: roster, threads, approval cards, trace, bot editor, pairing |+| `CodyncKit/` | Swift package: `CodyncKit` (wire models, host client, theme, avatars) and `CodyncUI` (store + chat screens shared by iPhone and Mac) |+| `Codync-iOS/` | iOS app: pairing, roster, push, Live Activity glue || `CodyncWidgets/` | Usage widget + bot Live Activity |-| `Codync-macOS/` | Menu bar app: installs/monitors the host, pairing QR, usage |-| `CodyncKit/` | Shared Swift package: wire models, host client, theme, avatars |+| `Codync-macOS/` | Menu bar + native chat window; installs/monitors the host |+| `linux/` | Native Linux app (GTK 4 + libadwaita, Rust) || `relay/` | Cloudflare Worker APNs relay with encrypted per-device tickets || `packaging/` | Homebrew formula template |@@ -83,6 +84,7 @@ The Xcode project is generated: `xcodegen generate`.```bashcd host && cargo test # hostcd CodyncKit && swift test # shared Swift+cd linux && cargo test # Linux app (needs GTK dev packages)cd relay && npm test # relay tickets```diff --git a/linux/.gitignore b/linux/.gitignorenew file mode 100644index 00000000..2f7896d1--- /dev/null+++ b/linux/.gitignore@@ -0,0 +1 @@+target/diff --git a/linux/Cargo.lock b/linux/Cargo.locknew file mode 100644index 00000000..e04ec59e--- /dev/null+++ b/linux/Cargo.lock@@ -0,0 +1,2236 @@+# This file is automatically @generated by Cargo.+# It is not intended for manual editing.+version = 4++[[package]]+name = "async-channel"+version = "2.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "924ed96dd52d1b75e9c1a3e6275715fd320f5f9439fb5a4a11fa51f4221158d2"+dependencies = [+ "concurrent-queue",+ "event-listener-strategy",+ "futures-core",+ "pin-project-lite",+]++[[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 = "aws-lc-rs"+version = "1.18.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b281d307588d634de920874890732659e2e7672f72b5e10e81badc1a8a83621e"+dependencies = [+ "aws-lc-sys",+ "zeroize",+]++[[package]]+name = "aws-lc-sys"+version = "0.45.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9bff6c3b54fad79a2e60b8102caf565819711497c1f5f092f49508e2f5c31b27"+dependencies = [+ "cc",+ "cmake",+ "dunce",+ "fs_extra",+ "pkg-config",+]++[[package]]+name = "base64"+version = "0.23.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5"++[[package]]+name = "bitflags"+version = "2.13.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06"++[[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 = "cairo-rs"+version = "0.22.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "df683f1d30b457964673a5541a4603208ef95ab6873d2a55871895cf310f3b56"+dependencies = [+ "bitflags",+ "cairo-sys-rs",+ "glib",+ "libc",+]++[[package]]+name = "cairo-sys-rs"+version = "0.22.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ee548131103ad8f698c6725669647b9c757b3b66992dd6a026037596417bee21"+dependencies = [+ "glib-sys",+ "libc",+ "system-deps 9.0.0",+]++[[package]]+name = "cc"+version = "1.4.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "54413ede23c2daf518f35156dfde027feb2374004d63bd497f983c8db9c0e313"+dependencies = [+ "find-msvc-tools",+ "jobserver",+ "libc",+ "shlex",+]++[[package]]+name = "cfg-expr"+version = "0.20.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fe4ece8474b5f766c63426647e7b4b316b67431ade1036a8313cee24a03ae917"+dependencies = [+ "smallvec",+ "target-lexicon",+]++[[package]]+name = "cfg-if"+version = "1.0.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600"++[[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.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "65c35e4b699c7e15ccbe7ee35c005e4fc0a278d22238a2857e6ce2dadeda1b06"+dependencies = [+ "cfg-if",+ "cpufeatures",+ "rand_core",+]++[[package]]+name = "cmake"+version = "0.1.58"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c0f78a02292a74a88ac736019ab962ece0bc380e3f977bf72e376c5d78ff0678"+dependencies = [+ "cc",+]++[[package]]+name = "codync-gtk"+version = "2.0.0"+dependencies = [+ "async-channel",+ "dirs",+ "futures",+ "gtk4",+ "libadwaita",+ "qrcode",+ "reqwest",+ "serde_json",+ "tokio",+ "uuid",+]++[[package]]+name = "combine"+version = "4.6.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cfc320937d09e6de266b31b9afb480f197d7a861be86be7cb2ea7e5d1bfffc5e"+dependencies = [+ "bytes",+ "memchr",+]++[[package]]+name = "concurrent-queue"+version = "2.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973"+dependencies = [+ "crossbeam-utils",+]++[[package]]+name = "core-foundation"+version = "0.10.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6"+dependencies = [+ "core-foundation-sys",+ "libc",+]++[[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.3.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5ca28b0ae3115b884660db4118d803791fd6756b6e88f39c0f3f7859060d7566"+dependencies = [+ "libc",+]++[[package]]+name = "crossbeam-utils"+version = "0.8.23"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6"++[[package]]+name = "dirs"+version = "7.0.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8d57d423b3c82e89b9a24ca3091fee61f456a26edbd28d26c65906f4bc1dcd8f"+dependencies = [+ "dirs-sys",+]++[[package]]+name = "dirs-sys"+version = "0.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab"+dependencies = [+ "libc",+ "option-ext",+ "redox_users",+ "windows-sys 0.61.2",+]++[[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.6",+]++[[package]]+name = "dunce"+version = "1.0.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813"++[[package]]+name = "equivalent"+version = "1.0.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"++[[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 = "event-listener"+version = "5.4.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5a23add41df1562121a9393cb065eab5146a1242410f23a644851e90cfd669d2"+dependencies = [+ "parking",+ "pin-project-lite",+]++[[package]]+name = "event-listener-strategy"+version = "0.5.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93"+dependencies = [+ "event-listener",+ "pin-project-lite",+]++[[package]]+name = "field-offset"+version = "0.3.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f"+dependencies = [+ "memoffset",+ "rustc_version",+]++[[package]]+name = "find-msvc-tools"+version = "0.1.13"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ef25905e51abafe4dcea6c15fec58c57b601cdbd0ee53d22ea1d3016c587d39b"++[[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 = "fs_extra"+version = "1.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c"++[[package]]+name = "futures"+version = "0.3.34"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9a31d2a3fbaaeb2af2368bbdd904aa8e812d3c04a1ee10d3171f52d556e5d0a3"+dependencies = [+ "futures-channel",+ "futures-core",+ "futures-executor",+ "futures-io",+ "futures-sink",+ "futures-task",+ "futures-util",+]++[[package]]+name = "futures-channel"+version = "0.3.34"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4"+dependencies = [+ "futures-core",+ "futures-sink",+]++[[package]]+name = "futures-core"+version = "0.3.34"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e"++[[package]]+name = "futures-executor"+version = "0.3.34"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "031b47cf1a3c6cc8bc2fc76cd437f521619387907d469316e7c0bc278f1f5432"+dependencies = [+ "futures-core",+ "futures-task",+ "futures-util",+]++[[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.6",+]++[[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-channel",+ "futures-core",+ "futures-io",+ "futures-macro",+ "futures-sink",+ "futures-task",+ "memchr",+ "pin-project-lite",+ "slab",+]++[[package]]+name = "gdk-pixbuf"+version = "0.22.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "25f420376dbee041b2db374ce4573892a36222bb3f6c0c43e24f0d67eae9b646"+dependencies = [+ "gdk-pixbuf-sys",+ "gio",+ "glib",+ "libc",+]++[[package]]+name = "gdk-pixbuf-sys"+version = "0.22.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9d5209294ba3775f9b650bf78bfadeba4332089f2329b3e2f6ce0a4957a45bff"+dependencies = [+ "gio-sys",+ "glib-sys",+ "gobject-sys",+ "libc",+ "system-deps 9.0.0",+]++[[package]]+name = "gdk4"+version = "0.11.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e77c579bac9eff8b84c0625d5f533da6d69988c063062fe92c2e955ede8f28eb"+dependencies = [+ "cairo-rs",+ "gdk-pixbuf",+ "gdk4-sys",+ "gio",+ "glib",+ "libc",+ "pango",+]++[[package]]+name = "gdk4-sys"+version = "0.11.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3eff6238a30c1f198fb3c8d3d445fa7faf211d11d9075af0772e6e0ca32ae001"+dependencies = [+ "cairo-sys-rs",+ "gdk-pixbuf-sys",+ "gio-sys",+ "glib-sys",+ "gobject-sys",+ "libc",+ "pango-sys",+ "pkg-config",+ "system-deps 9.0.0",+]++[[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.4.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099"+dependencies = [+ "cfg-if",+ "js-sys",+ "libc",+ "r-efi",+ "rand_core",+ "wasm-bindgen",+]++[[package]]+name = "gio"+version = "0.22.10"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4620fbafdf19dba814473e19f18e75290cb3338662f6ae35f0402affd3b2b699"+dependencies = [+ "futures-channel",+ "futures-core",+ "futures-io",+ "futures-util",+ "gio-sys",+ "glib",+ "libc",+ "pin-project-lite",+ "smallvec",+]++[[package]]+name = "gio-sys"+version = "0.22.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6c28739f914c15b87a9856000bed9cbd5b3a8afbca5e982d9a299e1601422cb5"+dependencies = [+ "glib-sys",+ "gobject-sys",+ "libc",+ "system-deps 9.0.0",+ "windows-sys 0.61.2",+]++[[package]]+name = "glib"+version = "0.22.10"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e4cf9e5bd8713f1990a92c422998826e0fb34824277b46bc59757373483c6694"+dependencies = [+ "bitflags",+ "futures-channel",+ "futures-core",+ "futures-executor",+ "futures-task",+ "futures-util",+ "gio-sys",+ "glib-macros",+ "glib-sys",+ "gobject-sys",+ "libc",+ "memchr",+ "smallvec",+]++[[package]]+name = "glib-macros"+version = "0.22.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c9597c68fa7bdf4154a3079642cd21c4dccac0b0bdd2897d82861523bf91e7b9"+dependencies = [+ "heck",+ "proc-macro2",+ "quote",+ "syn 3.0.6",+]++[[package]]+name = "glib-sys"+version = "0.22.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "99b38907e67e40dec9b60f858bcada952598719cb512a13eb13d6cdcd16f8295"+dependencies = [+ "libc",+ "system-deps 9.0.0",+]++[[package]]+name = "gobject-sys"+version = "0.22.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "07595c9ba696bd9819cb6a8df39f08078f3dd679508fe052dd558492c2053834"+dependencies = [+ "glib-sys",+ "libc",+ "system-deps 9.0.0",+]++[[package]]+name = "graphene-rs"+version = "0.22.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "eb856b9c558971c3f13ab692358926da710b046932a4e087aedcc35b040d7dff"+dependencies = [+ "glib",+ "graphene-sys",+]++[[package]]+name = "graphene-sys"+version = "0.22.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "97842c7543828f98aa5583aa54fcda28aa84fa2b0f8c556142177f7bbb638057"+dependencies = [+ "glib-sys",+ "libc",+ "system-deps 9.0.0",+]++[[package]]+name = "gsk4"+version = "0.11.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "eee23d7425c5281ec5a2f40f7b69384aac66c15861d990d248e9d9c9368be464"+dependencies = [+ "cairo-rs",+ "gdk4",+ "glib",+ "graphene-rs",+ "gsk4-sys",+ "libc",+ "pango",+]++[[package]]+name = "gsk4-sys"+version = "0.11.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "27900c92e47df410bbe43b51818104051e3409da43fb88547a41c0bafddfd39c"+dependencies = [+ "cairo-sys-rs",+ "gdk4-sys",+ "glib-sys",+ "gobject-sys",+ "graphene-sys",+ "libc",+ "pango-sys",+ "system-deps 9.0.0",+]++[[package]]+name = "gtk4"+version = "0.11.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e0f8226c94dd0b65ba2e8fcd8ff402d380e890f6e5a6488e652a0158e827b9bf"+dependencies = [+ "cairo-rs",+ "field-offset",+ "futures-channel",+ "gdk-pixbuf",+ "gdk4",+ "gio",+ "glib",+ "graphene-rs",+ "gsk4",+ "gtk4-macros",+ "gtk4-sys",+ "libc",+ "pango",+]++[[package]]+name = "gtk4-macros"+version = "0.11.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "eb906c98f0b4cc9002594e337e83f40492aa6dca22c97242f13be5b046c5f338"+dependencies = [+ "proc-macro-crate",+ "proc-macro2",+ "quote",+ "syn 3.0.6",+]++[[package]]+name = "gtk4-sys"+version = "0.11.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bd14af0137f269bdecee73404157d2a852f9651af7d68bd1023d3b8b914a14c3"+dependencies = [+ "cairo-sys-rs",+ "gdk-pixbuf-sys",+ "gdk4-sys",+ "gio-sys",+ "glib-sys",+ "gobject-sys",+ "graphene-sys",+ "gsk4-sys",+ "libc",+ "pango-sys",+ "system-deps 9.0.0",+]++[[package]]+name = "hashbrown"+version = "0.17.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a"++[[package]]+name = "heck"+version = "0.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"++[[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 = "httparse"+version = "1.10.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"++[[package]]+name = "hyper"+version = "1.11.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "27b501faa50e7a26c3d3560ca625132f4078a17771f4810baf70475ae48cbe43"+dependencies = [+ "atomic-waker",+ "bytes",+ "futures-channel",+ "futures-core",+ "http",+ "http-body",+ "httparse",+ "itoa",+ "pin-project-lite",+ "smallvec",+ "tokio",+ "want",+]++[[package]]+name = "hyper-rustls"+version = "0.27.10"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "dfa8e654703247911e29c23fbeaa261834bd9bb74efba2f9acddc37bfb127f53"+dependencies = [+ "http",+ "hyper",+ "hyper-util",+ "rustls",+ "tokio",+ "tokio-rustls",+ "tower-service",+]++[[package]]+name = "hyper-util"+version = "0.1.21"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ddc03d96684f9226b8a787cdb71488417b53ab5ea8fdb1dac946cb9431cc8bff"+dependencies = [+ "base64",+ "bytes",+ "futures-channel",+ "futures-util",+ "http",+ "http-body",+ "httparse",+ "hyper",+ "ipnet",+ "libc",+ "percent-encoding",+ "pin-project-lite",+ "socket2",+ "tokio",+ "tower-service",+ "tracing",+]++[[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.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d27bbb9d3abbefac45d55f647c9de1d44aafcd1186eb91879afef17c396c3e73"+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 = "indexmap"+version = "2.14.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855"+dependencies = [+ "equivalent",+ "hashbrown",+]++[[package]]+name = "ipnet"+version = "2.12.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "791930b43c0d5973160d90a8f3894509f2b273430f5c5c73b668636d0287c5c0"++[[package]]+name = "itoa"+version = "1.0.18"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"++[[package]]+name = "jni"+version = "0.22.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5efd9a482cf3a427f00d6b35f14332adc7902ce91efb778580e180ff90fa3498"+dependencies = [+ "cfg-if",+ "combine",+ "jni-macros",+ "jni-sys",+ "log",+ "simd_cesu8",+ "thiserror",+ "walkdir",+ "windows-link",+]++[[package]]+name = "jni-macros"+version = "0.22.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a00109accc170f0bdb141fed3e393c565b6f5e072365c3bd58f5b062591560a3"+dependencies = [+ "proc-macro2",+ "quote",+ "rustc_version",+ "simd_cesu8",+ "syn 2.0.119",+]++[[package]]+name = "jni-sys"+version = "0.4.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2"+dependencies = [+ "jni-sys-macros",+]++[[package]]+name = "jni-sys-macros"+version = "0.4.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264"+dependencies = [+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "jobserver"+version = "0.1.35"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1c00acbd29eabad4a2392fa0e921c874934dbbf4194312ad20f04a0ed67a3cb3"+dependencies = [+ "getrandom 0.4.3",+ "libc",+]++[[package]]+name = "js-sys"+version = "0.3.105"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ce57d20d1ea864ce2ac172ab472d409214f4fd359f0b2a2775abdf522e2af99e"+dependencies = [+ "cfg-if",+ "futures-util",+ "wasm-bindgen",+]++[[package]]+name = "libadwaita"+version = "0.9.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "85b9900e67182a4b5b1f157b448d94f0715c8b9770cce21cf000801917f53bfa"+dependencies = [+ "gdk4",+ "gio",+ "glib",+ "gtk4",+ "libadwaita-sys",+ "pango",+]++[[package]]+name = "libadwaita-sys"+version = "0.9.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "28d3c27642b389852aa99341bd4a4c19ec6f8a2b63ebdd7f5ba1952198079ccd"+dependencies = [+ "gdk4-sys",+ "gio-sys",+ "glib-sys",+ "gobject-sys",+ "gtk4-sys",+ "libc",+ "pango-sys",+ "system-deps 7.0.8",+]++[[package]]+name = "libc"+version = "0.2.189"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"++[[package]]+name = "libredox"+version = "0.1.25"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "61ff90caf6077a803a240f62fdbe88645a890bbca49ef8174c3cb0404362171d"+dependencies = [+ "libc",+]++[[package]]+name = "litemap"+version = "0.8.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae"++[[package]]+name = "log"+version = "0.4.34"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6"++[[package]]+name = "lru-slab"+version = "0.1.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4050469837a6ff301cd14c1f8f24f88549e6d548f24f64e2148eb0f72cebc51f"++[[package]]+name = "memchr"+version = "2.8.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"++[[package]]+name = "memoffset"+version = "0.9.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"+dependencies = [+ "autocfg",+]++[[package]]+name = "mio"+version = "1.2.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4b18443e9c262bfe8fa82f51666e2642c53393f7e5c27b3e1aeab922cff5b9d8"+dependencies = [+ "libc",+ "wasi",+ "windows-sys 0.61.2",+]++[[package]]+name = "once_cell"+version = "1.21.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"++[[package]]+name = "openssl-probe"+version = "0.2.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe"++[[package]]+name = "option-ext"+version = "0.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"++[[package]]+name = "pango"+version = "0.22.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0b2022dbbd82e1c42bd950a6f1df9b98c796e725dce5ec275e03cbf9772e4efa"+dependencies = [+ "gio",+ "glib",+ "pango-sys",+]++[[package]]+name = "pango-sys"+version = "0.22.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ca02d64761b74d56cdd4b437db6d73dc95e6c0d40f27e1c707952c0f09052948"+dependencies = [+ "glib-sys",+ "gobject-sys",+ "libc",+ "system-deps 9.0.0",+]++[[package]]+name = "parking"+version = "2.2.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba"++[[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 = "pkg-config"+version = "0.3.34"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548"++[[package]]+name = "potential_utf"+version = "0.1.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d83eb9bc6d8e5cf568e7a1101d60ee05e81ed50ea106026f3d18deeb046d7661"+dependencies = [+ "zerovec",+]++[[package]]+name = "proc-macro-crate"+version = "3.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f"+dependencies = [+ "toml_edit",+]++[[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 = "qrcode"+version = "0.14.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d68782463e408eb1e668cf6152704bd856c78c5b6417adaee3203d8f4c1fc9ec"++[[package]]+name = "quinn"+version = "0.11.12"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4051e23e9185c255a7e33ef59cdbca87a22d359052eecd22fc6b901fb37d9d11"+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.18"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a9746dbde176634f4f2f1faf2404e30a31b2bc1e9cafb5329c95d8177a18c9fc"+dependencies = [+ "aws-lc-rs",+ "bytes",+ "getrandom 0.4.3",+ "lru-slab",+ "rand",+ "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 = "6.0.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"++[[package]]+name = "rand"+version = "0.10.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "65c9fb96cbc91e3478eaae79a69fcd3f1ae4ad052e471fe6732fff548984b4af"+dependencies = [+ "chacha20",+ "getrandom 0.4.3",+ "rand_core",+]++[[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",+]++[[package]]+name = "redox_users"+version = "0.5.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "60dc65c0ff1a7ae1294b0c67b9f14baf70b644404010370171787bfac1038fc0"+dependencies = [+ "libredox",+ "thiserror",+]++[[package]]+name = "reqwest"+version = "0.13.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "16a1cfa75cc186dd73d5818e510e042e40927bccc9c236b061cea97e1eb08029"+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",+ "rustls-platform-verifier",+ "serde",+ "serde_json",+ "sync_wrapper",+ "tokio",+ "tokio-rustls",+ "tokio-util",+ "tower",+ "tower-http",+ "tower-service",+ "url",+ "wasm-bindgen",+ "wasm-bindgen-futures",+ "wasm-streams",+ "web-sys",+]++[[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 = "rustc-hash"+version = "2.1.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d"++[[package]]+name = "rustc_version"+version = "0.4.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92"+dependencies = [+ "semver",+]++[[package]]+name = "rustls"+version = "0.23.45"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0d41d731c7d2f962d1ccc364cec258de3c0e93b38c2fb3ba97ac74513048d634"+dependencies = [+ "aws-lc-rs",+ "once_cell",+ "rustls-pki-types",+ "rustls-webpki",+ "subtle",+ "zeroize",+]++[[package]]+name = "rustls-native-certs"+version = "0.8.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "dab5152771c58876a2146916e53e35057e1a4dfa2b9df0f0305b07f611fdea4d"+dependencies = [+ "openssl-probe",+ "rustls-pki-types",+ "schannel",+ "security-framework",+]++[[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-platform-verifier"+version = "0.7.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "26d1e2536ce4f35f4846aa13bff16bd0ff40157cdb14cc056c7b14ba41233ba0"+dependencies = [+ "core-foundation",+ "core-foundation-sys",+ "jni",+ "log",+ "once_cell",+ "rustls",+ "rustls-native-certs",+ "rustls-platform-verifier-android",+ "rustls-webpki",+ "security-framework",+ "security-framework-sys",+ "webpki-root-certs",+ "windows-sys 0.61.2",+]++[[package]]+name = "rustls-platform-verifier-android"+version = "0.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f"++[[package]]+name = "rustls-webpki"+version = "0.103.15"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f3c3cf1d8b1e7d4927e2d154c3fcb02979afb9939629c62cd9048d4f07b60ac2"+dependencies = [+ "aws-lc-rs",+ "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 = "same-file"+version = "1.0.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"+dependencies = [+ "winapi-util",+]++[[package]]+name = "schannel"+version = "0.1.29"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939"+dependencies = [+ "windows-sys 0.61.2",+]++[[package]]+name = "security-framework"+version = "3.7.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d"+dependencies = [+ "bitflags",+ "core-foundation",+ "core-foundation-sys",+ "libc",+ "security-framework-sys",+]++[[package]]+name = "security-framework-sys"+version = "2.17.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3"+dependencies = [+ "core-foundation-sys",+ "libc",+]++[[package]]+name = "semver"+version = "1.0.28"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd"++[[package]]+name = "serde"+version = "1.0.229"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"+dependencies = [+ "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.6",+]++[[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_spanned"+version = "1.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26"+dependencies = [+ "serde_core",+]++[[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 = "simd_cesu8"+version = "1.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "11031e251abf8611c80f460e19dbdeb54a66db918e49c65a7065b46ac7aec520"+dependencies = [+ "rustc_version",+ "simdutf8",+]++[[package]]+name = "simdutf8"+version = "0.1.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e"++[[package]]+name = "slab"+version = "0.4.12"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"++[[package]]+name = "smallvec"+version = "1.16.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ba467056f1b547ed52077911161fc86985becbc60e8e1857c8a144dab0def891"++[[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.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8593e8e72159ed2257d083c7a454a85cbf854f37a0966d8d483aff8c8a3ebcee"+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.14.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "901704edd0dfe137f1987838ee4f259e4e063c31371bdb423f7ae38ec6f77f02"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.6",+]++[[package]]+name = "system-deps"+version = "7.0.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "396a35feb67335377e0251fcbc1092fc85c484bd4e3a7a54319399da127796e7"+dependencies = [+ "cfg-expr",+ "heck",+ "pkg-config",+ "toml",+ "version-compare",+]++[[package]]+name = "system-deps"+version = "9.0.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8a0dae2cbca1f0ff93795713cfe0a4c02f760e3c0b8ae2ab4ec4045808ff429f"+dependencies = [+ "cfg-expr",+ "heck",+ "pkg-config",+ "toml",+ "version-compare",+]++[[package]]+name = "target-lexicon"+version = "0.13.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"++[[package]]+name = "thiserror"+version = "2.0.21"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e"+dependencies = [+ "thiserror-impl",+]++[[package]]+name = "thiserror-impl"+version = "2.0.21"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.6",+]++[[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.13.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fd3ca314f692efd6c868f8408f53fe444634a845f96c028b97d35f6a1f79f0ee"++[[package]]+name = "tokio"+version = "1.53.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed"+dependencies = [+ "bytes",+ "libc",+ "mio",+ "pin-project-lite",+ "signal-hook-registry",+ "socket2",+ "windows-sys 0.61.2",+]++[[package]]+name = "tokio-rustls"+version = "0.26.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b0c85f2c3ef0b1cd58b36682f4b17aaa995f0e5db534d85692b4903abce21f67"+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 = "toml"+version = "1.1.6+spec-1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "920602543f0911ab71da12c50d59701da54c196d1a2bf5cb4b75667f137a406a"+dependencies = [+ "indexmap",+ "serde_core",+ "serde_spanned",+ "toml_datetime",+ "toml_parser",+ "toml_writer",+ "winnow",+]++[[package]]+name = "toml_datetime"+version = "1.1.1+spec-1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7"+dependencies = [+ "serde_core",+]++[[package]]+name = "toml_edit"+version = "0.25.15+spec-1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1340ea94a5856333492c9064b02c778b191dd2c853778d9609debdcdfea3a614"+dependencies = [+ "indexmap",+ "toml_datetime",+ "toml_parser",+ "winnow",+]++[[package]]+name = "toml_parser"+version = "1.1.3+spec-1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56"+dependencies = [+ "winnow",+]++[[package]]+name = "toml_writer"+version = "1.1.2+spec-1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7d56353a2a665ad0f41a421187180aab746c8c325620617ad883a99a1cbe66d2"++[[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",+]++[[package]]+name = "tower-http"+version = "0.6.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4cfcf7e2740e6fc6d4d688b4ef00650406bb94adf4731e43c096c3a19fe40840"+dependencies = [+ "bitflags",+ "bytes",+ "futures-util",+ "http",+ "http-body",+ "pin-project-lite",+ "tower",+ "tower-layer",+ "tower-service",+ "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 = [+ "pin-project-lite",+ "tracing-core",+]++[[package]]+name = "tracing-core"+version = "0.1.36"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a"+dependencies = [+ "once_cell",+]++[[package]]+name = "try-lock"+version = "0.2.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"++[[package]]+name = "unicode-ident"+version = "1.0.26"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d245f478577f809a851594d02313b640fb437e0bb33866753cff937863096954"++[[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.26.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2ef6dac1e96601b4fb3acccccff2139741fcb757cb9a36089bf5be91cfb285ce"+dependencies = [+ "getrandom 0.4.3",+ "js-sys",+ "wasm-bindgen",+]++[[package]]+name = "version-compare"+version = "0.2.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "03c2856837ef78f57382f06b2b8563a2f512f7185d732608fd9176cb3b8edf0e"++[[package]]+name = "walkdir"+version = "2.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b"+dependencies = [+ "same-file",+ "winapi-util",+]++[[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 = "wasm-bindgen"+version = "0.2.128"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "aecb87a33d3b0c5e3b7aa46336eaf486cffafbd281b195e4c8b80d50df2351bf"+dependencies = [+ "cfg-if",+ "once_cell",+ "rustversion",+ "wasm-bindgen-macro",+ "wasm-bindgen-shared",+]++[[package]]+name = "wasm-bindgen-futures"+version = "0.4.78"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6ef4c5d3d2cdf5c54f4231181768f5510842e350db025faf1f7163b1030ed928"+dependencies = [+ "js-sys",+ "wasm-bindgen",+]++[[package]]+name = "wasm-bindgen-macro"+version = "0.2.128"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a690d511e3c1a8b3a55e33511e3c2c00c78415cd23650f32b808627f5696b9ed"+dependencies = [+ "quote",+ "wasm-bindgen-macro-support",+]++[[package]]+name = "wasm-bindgen-macro-support"+version = "0.2.128"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "411e4887f0071ef2d2164a9d5fdf2d20efbef78fccd3a78b0c10a1dc5295e48a"+dependencies = [+ "bumpalo",+ "proc-macro2",+ "quote",+ "syn 3.0.6",+ "wasm-bindgen-shared",+]++[[package]]+name = "wasm-bindgen-shared"+version = "0.2.128"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "81941cd78d0c92026c33e5e01312845a4cb1e9af3407f9134b100dd03144103e"+dependencies = [+ "unicode-ident",+]++[[package]]+name = "wasm-streams"+version = "0.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9d1ec4f6517c9e11ae630e200b2b65d193279042e28edd4a2cda233e46670bbb"+dependencies = [+ "futures-util",+ "js-sys",+ "wasm-bindgen",+ "wasm-bindgen-futures",+ "web-sys",+]++[[package]]+name = "web-sys"+version = "0.3.105"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9fbddc4a036f00ec4f18c83445bd3115cb306a91da554919a099d9222fe4a7f8"+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-root-certs"+version = "1.0.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b96554aa2acc8ccdb7e1c9a58a7a68dd5d13bccc69cd124cb09406db612a1c9b"+dependencies = [+ "rustls-pki-types",+]++[[package]]+name = "winapi-util"+version = "0.1.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"+dependencies = [+ "windows-sys 0.61.2",+]++[[package]]+name = "windows-link"+version = "0.2.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"++[[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.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 = "winnow"+version = "1.0.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81"+dependencies = [+ "memchr",+]++[[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.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "33811428bee40dbceb6d545e95754741d17a6aef9a4849f0fd62e2ba4f412a78"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.6",+ "synstructure",+]++[[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.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f75b4683f6c7f45248d4d64056a24298c6281e0993356d7d1b4a1a962ef10d4a"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.6",+ "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.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bb0464e17806c1d976d5cba29399c7f08e516e279e2ba493f63123b5fca67dd8"+dependencies = [+ "yoke",+ "zerofrom",+ "zerovec-derive",+]++[[package]]+name = "zerovec-derive"+version = "0.11.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "34df6fc39dbd26ddc9c10e6a2984476e13acce22e64e4487636ef494369225da"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.6",+]++[[package]]+name = "zmij"+version = "1.0.23"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"diff --git a/linux/Cargo.toml b/linux/Cargo.tomlnew file mode 100644index 00000000..2eb7e8d1--- /dev/null+++ b/linux/Cargo.toml@@ -0,0 +1,22 @@+[package]+name = "codync-gtk"+version = "2.0.0"+edition = "2024"+description = "Codync for Linux: message your coding-agent bots (GTK 4 + libadwaita)"+license = "MIT"++[[bin]]+name = "codync"+path = "src/main.rs"++[dependencies]+adw = { package = "libadwaita", version = "0.9", features = ["v1_5"] }+gtk = { package = "gtk4", version = "0.11", features = ["v4_14"] }+async-channel = "2"+futures = "0.3"+qrcode = { version = "0.14", default-features = false }+reqwest = { version = "0.13", default-features = false, features = ["rustls", "json", "stream"] }+serde_json = "1"+tokio = { version = "1", features = ["rt-multi-thread", "time", "process"] }+uuid = { version = "1", features = ["v4"] }+dirs = "7"diff --git a/linux/data/com.pokai.Codync.desktop b/linux/data/com.pokai.Codync.desktopnew file mode 100644index 00000000..3c9f5ba4--- /dev/null+++ b/linux/data/com.pokai.Codync.desktop@@ -0,0 +1,9 @@+[Desktop Entry]+Type=Application+Name=Codync+Comment=Message your coding-agent bots+Exec=codync+Icon=com.pokai.Codync+Terminal=false+Categories=Development;+StartupWMClass=com.pokai.Codyncdiff --git a/linux/data/com.pokai.Codync.svg b/linux/data/com.pokai.Codync.svgnew file mode 100644index 00000000..72baf14b--- /dev/null+++ b/linux/data/com.pokai.Codync.svg@@ -0,0 +1 @@+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128"><rect width="128" height="128" rx="28" fill="#121411"/><path fill="#00C972" d="M64 18c26 0 46 18 46 46s-20 46-46 46-46-20-46-46 20-46 46-46Z"/><rect x="42" y="48" width="17" height="25" rx="8.5" fill="#fff"/><rect x="69" y="48" width="17" height="25" rx="8.5" fill="#fff"/><circle cx="51" cy="61" r="5" fill="#141712"/><circle cx="78" cy="61" r="5" fill="#141712"/></svg>diff --git a/linux/src/avatar.rs b/linux/src/avatar.rsnew file mode 100644index 00000000..3ed979e8--- /dev/null+++ b/linux/src/avatar.rs@@ -0,0 +1,137 @@+//! Grok-Bot-style characters (same silhouettes and palette as the Apple apps), drawn with cairo.++use gtk::cairo::Context;+use gtk::prelude::*;+use std::f64::consts::PI;++pub const SHAPES: &[&str] = &["blob", "pebble", "squircle", "tablet", "wedge", "hex", "cloud", "teardrop"];+pub const COLORS: &[(&str, u32)] = &[+ ("black", 0x2B2B2B),+ ("brown", 0x936439),+ ("red", 0xFF263C),+ ("orange", 0xFF6700),+ ("yellow", 0xFF9800),+ ("green", 0x00C972),+ ("cyan", 0x00BCA6),+ ("blue", 0x1084FE),+ ("violet", 0x9159FE),+ ("magenta", 0xFF309B),+ ("gray", 0x777777),+];++pub fn rgb(hex: u32) -> (f64, f64, f64) {+ (((hex >> 16) & 0xFF) as f64 / 255.0, ((hex >> 8) & 0xFF) as f64 / 255.0, (hex & 0xFF) as f64 / 255.0)+}++fn color_of(name: &str) -> u32 {+ COLORS.iter().find(|(n, _)| *n == name).map(|c| c.1).unwrap_or(0x1084FE)+}++fn rounded_rect(cr: &Context, x: f64, y: f64, w: f64, h: f64, r: f64) {+ cr.new_sub_path();+ cr.arc(x + w - r, y + r, r, -PI / 2.0, 0.0);+ cr.arc(x + w - r, y + h - r, r, 0.0, PI / 2.0);+ cr.arc(x + r, y + h - r, r, PI / 2.0, PI);+ cr.arc(x + r, y + r, r, PI, 1.5 * PI);+ cr.close_path();+}++/// Draws the silhouette into a 100×100 unit box.+fn silhouette(cr: &Context, shape: &str) {+ match shape {+ "pebble" => {+ cr.save().ok();+ cr.translate(50.0, 50.0);+ cr.scale(50.0, 40.0);+ cr.arc(0.0, 0.0, 1.0, 0.0, 2.0 * PI);+ cr.restore().ok();+ }+ "squircle" => rounded_rect(cr, 4.0, 4.0, 92.0, 92.0, 30.0),+ "tablet" => rounded_rect(cr, 14.0, 0.0, 72.0, 100.0, 22.0),+ "wedge" => {+ cr.move_to(50.0, 4.0);+ cr.curve_to(76.0, 30.0, 90.0, 55.0, 98.0, 86.0);+ cr.curve_to(66.0, 100.0, 34.0, 100.0, 2.0, 86.0);+ cr.curve_to(10.0, 55.0, 24.0, 30.0, 50.0, 4.0);+ cr.close_path();+ }+ "hex" => {+ for i in 0..6 {+ let a = i as f64 * PI / 3.0 - PI / 2.0;+ let (x, y) = (50.0 + a.cos() * 49.0, 50.0 + a.sin() * 49.0);+ if i == 0 { cr.move_to(x, y) } else { cr.line_to(x, y) }+ }+ cr.close_path();+ }+ "cloud" => {+ for (x, y, r) in [(27.0, 57.0, 27.0), (73.0, 57.0, 27.0), (50.0, 40.0, 32.0)] {+ cr.new_sub_path();+ cr.arc(x, y, r, 0.0, 2.0 * PI);+ }+ rounded_rect(cr, 10.0, 50.0, 80.0, 35.0, 15.0);+ }+ "teardrop" => {+ cr.move_to(50.0, 0.0);+ cr.curve_to(62.0, 20.0, 94.0, 38.0, 94.0, 62.0);+ cr.arc(50.0, 62.0, 44.0, 0.0, PI);+ cr.curve_to(6.0, 38.0, 38.0, 20.0, 50.0, 0.0);+ cr.close_path();+ }+ _ => {+ for i in 0..=64 {+ let a = i as f64 / 64.0 * 2.0 * PI;+ let r = 46.0 + 3.5 * (a * 3.0 + 0.6).sin();+ let (x, y) = (50.0 + a.cos() * r, 50.0 + a.sin() * r);+ if i == 0 { cr.move_to(x, y) } else { cr.line_to(x, y) }+ }+ cr.close_path();+ }+ }+}++pub fn draw(cr: &Context, size: f64, shape: &str, color: &str, look: f64) {+ cr.save().ok();+ cr.scale(size / 100.0, size / 100.0);+ silhouette(cr, shape);+ let (r, g, b) = rgb(color_of(color));+ cr.set_source_rgb(r, g, b);+ cr.fill().ok();+ // Eyes (they look side to side while the bot works).+ let dx = look * 5.0;+ for x in [31.0, 55.4] {+ rounded_rect(cr, x + dx, 36.0, 13.6, 19.5, 6.8);+ cr.set_source_rgb(1.0, 1.0, 1.0);+ cr.fill().ok();+ cr.arc(x + 6.8 + dx * 1.3, 45.7, 3.8, 0.0, 2.0 * PI);+ cr.set_source_rgb(0.08, 0.09, 0.07);+ cr.fill().ok();+ }+ cr.restore().ok();+}++/// status: "" | "unread" | "needs"+pub fn widget(shape: &str, color: &str, size: i32, working: bool, status: &str) -> gtk::DrawingArea {+ let area = gtk::DrawingArea::builder().content_width(size).content_height(size).valign(gtk::Align::Center).build();+ let (shape, color, status) = (shape.to_owned(), color.to_owned(), status.to_owned());+ let start = std::time::Instant::now();+ area.set_draw_func(move |_, cr, w, _| {+ let s = w as f64;+ let look = if working { (start.elapsed().as_secs_f64() * 3.5).sin() } else { 0.0 };+ draw(cr, s, &shape, &color, look);+ if !status.is_empty() {+ let d = s * if status == "needs" { 0.36 } else { 0.28 };+ let (cx, cy) = (s - d / 2.0, s - d / 2.0);+ let (r, g, b) = if status == "needs" { rgb(0xFF9800) } else { rgb(0xC7EC6B) };+ cr.arc(cx, cy, d / 2.0, 0.0, 2.0 * PI);+ cr.set_source_rgb(r, g, b);+ cr.fill().ok();+ }+ });+ if working {+ area.add_tick_callback(|a, _| {+ a.queue_draw();+ gtk::glib::ControlFlow::Continue+ });+ }+ area+}diff --git a/linux/src/client.rs b/linux/src/client.rsnew file mode 100644index 00000000..659ec6e0--- /dev/null+++ b/linux/src/client.rs@@ -0,0 +1,147 @@+//! Talks to the local codync-host: JSON commands and the SSE event stream,+//! run on a tokio runtime and handed to the GTK main loop through channels.++use futures::StreamExt;+use serde_json::{Value, json};+use std::path::PathBuf;+use std::sync::OnceLock;+use std::sync::atomic::{AtomicI64, Ordering};+use std::time::Duration;++pub fn runtime() -> &'static tokio::runtime::Runtime {+ static RT: OnceLock<tokio::runtime::Runtime> = OnceLock::new();+ RT.get_or_init(|| tokio::runtime::Builder::new_multi_thread().worker_threads(2).enable_all().build().unwrap())+}++pub fn data_dir() -> PathBuf {+ std::env::var_os("CODYNC_HOME")+ .map(PathBuf::from)+ .unwrap_or_else(|| dirs::home_dir().unwrap_or_default().join(".codync"))+}++pub fn port() -> u16 {+ std::env::var("CODYNC_PORT").ok().and_then(|p| p.parse().ok()).unwrap_or(19222)+}++/// `CODYNC_URL` overrides the host address (e.g. a host outside a container).+pub fn base() -> String {+ std::env::var("CODYNC_URL").unwrap_or_else(|_| format!("http://127.0.0.1:{}", port()))+}++pub fn token() -> Option<String> {+ std::fs::read_to_string(data_dir().join("token")).ok().map(|t| t.trim().to_owned()).filter(|t| !t.is_empty())+}++fn http() -> &'static reqwest::Client {+ static C: OnceLock<reqwest::Client> = OnceLock::new();+ C.get_or_init(reqwest::Client::new)+}++async fn call_async(method: String, body: Value) -> Result<Value, String> {+ let token = token().ok_or("The Codync host isn't set up on this computer.")?;+ let res = http()+ .post(format!("{}/api/{method}", base()))+ .bearer_auth(token)+ .json(&body)+ .timeout(Duration::from_secs(30))+ .send()+ .await+ .map_err(|_| "Can't reach the Codync host.".to_owned())?;+ let ok = res.status().is_success();+ let v: Value = res.json().await.unwrap_or(Value::Null);+ if ok { Ok(v) } else { Err(v["error"].as_str().unwrap_or("Host error").to_owned()) }+}++/// Runs a host command off the main thread and hands the result back on it.+pub fn call(method: &str, body: Value, done: impl FnOnce(Result<Value, String>) + 'static) {+ let (tx, rx) = async_channel::bounded(1);+ let method = method.to_owned();+ runtime().spawn(async move {+ let _ = tx.send(call_async(method, body).await).await;+ });+ gtk::glib::spawn_future_local(async move {+ if let Ok(r) = rx.recv().await {+ done(r);+ }+ });+}++pub enum Event {+ Online(bool),+ Message(Value),+}++static REV: AtomicI64 = AtomicI64::new(0);++pub fn reset_rev() {+ REV.store(0, Ordering::Relaxed);+}++/// Streams host events forever, reconnecting with `since = last rev`.+pub fn stream(tx: async_channel::Sender<Event>) {+ runtime().spawn(async move {+ loop {+ if let Some(token) = token() {+ let url = format!("{}/events?since={}&client=linux", base(), REV.load(Ordering::Relaxed));+ if let Ok(res) = http().get(url).bearer_auth(token).send().await+ && res.status().is_success()+ {+ let _ = tx.send(Event::Online(true)).await;+ let mut body = res.bytes_stream();+ let mut buf = String::new();+ while let Some(Ok(chunk)) = body.next().await {+ buf.push_str(&String::from_utf8_lossy(&chunk));+ while let Some(i) = buf.find('\n') {+ let line: String = buf.drain(..=i).collect();+ if let Some(data) = line.trim_end().strip_prefix("data:")+ && let Ok(v) = serde_json::from_str::<Value>(data.trim_start())+ {+ if let Some(rev) = v["rev"].as_i64() {+ REV.fetch_max(rev, Ordering::Relaxed);+ }+ if tx.send(Event::Message(v)).await.is_err() {+ return;+ }+ }+ }+ }+ }+ }+ if tx.send(Event::Online(false)).await.is_err() {+ return;+ }+ tokio::time::sleep(Duration::from_secs(2)).await;+ }+ });+}++/// `codync-host install`, for when the host isn't running yet.+pub fn install_host(done: impl FnOnce(Result<(), String>) + 'static) {+ let (tx, rx) = async_channel::bounded(1);+ runtime().spawn(async move {+ let bin = ["codync-host", "/usr/local/bin/codync-host", "/home/linuxbrew/.linuxbrew/bin/codync-host"]+ .iter()+ .map(PathBuf::from)+ .chain(dirs::home_dir().map(|h| h.join(".cargo/bin/codync-host")))+ .chain(dirs::home_dir().map(|h| h.join(".local/bin/codync-host")))+ .find(|p| p.components().count() == 1 || p.exists());+ let r = match bin {+ Some(bin) => match tokio::process::Command::new(bin).arg("install").output().await {+ Ok(o) if o.status.success() => Ok(()),+ Ok(o) => Err(String::from_utf8_lossy(&o.stderr).trim().to_owned()),+ Err(_) => Err("codync-host isn't installed. Install it with Homebrew or from a release, then try again.".into()),+ },+ None => Err("codync-host isn't installed.".into()),+ };+ let _ = tx.send(r).await;+ });+ gtk::glib::spawn_future_local(async move {+ if let Ok(r) = rx.recv().await {+ done(r);+ }+ });+}++pub fn empty() -> Value {+ json!({})+}diff --git a/linux/src/dialogs.rs b/linux/src/dialogs.rsnew file mode 100644index 00000000..5005bb33--- /dev/null+++ b/linux/src/dialogs.rs@@ -0,0 +1,437 @@+//! Bot editor, full-conversation trace, settings/pairing and the bot menu.++use crate::client;+use crate::ui::{self, App};+use crate::{avatar, markup};+use adw::prelude::*;+use serde_json::{Value, json};+use std::cell::RefCell;+use std::rc::Rc;++fn header_dialog(title: &str, width: i32, height: i32) -> (adw::Dialog, adw::ToolbarView, adw::HeaderBar) {+ let header = adw::HeaderBar::new();+ let view = adw::ToolbarView::new();+ view.add_top_bar(&header);+ let dialog = adw::Dialog::builder().title(title).content_width(width).content_height(height).child(&view).build();+ (dialog, view, header)+}++// MARK: editor++pub fn editor(ui: &App, bot: Option<Value>) {+ let is_new = bot.is_none();+ let backends: Vec<Value> = ui.state.borrow().hello["backends"].as_array().cloned().unwrap_or_default();+ let d = Rc::new(RefCell::new(bot.clone().unwrap_or_else(|| {+ let n = client_seed();+ json!({+ "name": "", "description": "", "permission": "ask", "model": null, "command": null, "cwd": "",+ "avatarShape": avatar::SHAPES[n % avatar::SHAPES.len()],+ "avatarColor": avatar::COLORS[n % avatar::COLORS.len()].0,+ "backend": backends.iter().find(|b| b["available"] == true).and_then(|b| b["id"].as_str()).unwrap_or("claude"),+ })+ })));++ let (dialog, view, header) = header_dialog(if is_new { "New Bot" } else { "Edit Bot" }, 560, 720);+ let save = gtk::Button::builder()+ .icon_name("object-select-symbolic")+ .tooltip_text(if is_new { "Create" } else { "Save" })+ .css_classes(["accent-fill", "circular"])+ .build();+ header.pack_end(&save);++ let page = adw::PreferencesPage::new();+ // Profile+ let preview = gtk::Box::builder().halign(gtk::Align::Center).margin_bottom(8).build();+ let redraw_preview = {+ let (preview, d) = (preview.clone(), d.clone());+ move || {+ while let Some(c) = preview.first_child() {+ preview.remove(&c);+ }+ let b = d.borrow();+ preview.append(&avatar::widget(b["avatarShape"].as_str().unwrap_or("blob"), b["avatarColor"].as_str().unwrap_or("blue"), 84, true, ""));+ }+ };+ redraw_preview();+ let profile = adw::PreferencesGroup::new();+ profile.add(&preview);+ let name = adw::EntryRow::builder().title("Name").text(d.borrow()["name"].as_str().unwrap_or("")).build();+ profile.add(&name);+ let shapes = gtk::FlowBox::builder().selection_mode(gtk::SelectionMode::None).max_children_per_line(8).margin_top(8).build();+ for s in avatar::SHAPES {+ let btn = gtk::Button::builder().child(&avatar::widget(s, d.borrow()["avatarColor"].as_str().unwrap_or("blue"), 30, false, "")).css_classes(["flat"]).tooltip_text(*s).build();+ let (d2, redraw) = (d.clone(), redraw_preview.clone());+ btn.connect_clicked(move |_| {+ d2.borrow_mut()["avatarShape"] = (*s).into();+ redraw();+ });+ shapes.insert(&btn, -1);+ }+ profile.add(&shapes);+ let colors = gtk::FlowBox::builder().selection_mode(gtk::SelectionMode::None).max_children_per_line(11).build();+ for (cname, hex) in avatar::COLORS {+ let swatch = gtk::DrawingArea::builder().content_width(22).content_height(22).build();+ let hex = *hex;+ swatch.set_draw_func(move |_, cr, w, h| {+ let (r, g, b) = avatar::rgb(hex);+ cr.arc(w as f64 / 2.0, h as f64 / 2.0, w as f64 / 2.0, 0.0, 2.0 * std::f64::consts::PI);+ cr.set_source_rgb(r, g, b);+ cr.fill().ok();+ });+ let btn = gtk::Button::builder().child(&swatch).css_classes(["flat", "circular"]).tooltip_text(*cname).build();+ let (d2, redraw) = (d.clone(), redraw_preview.clone());+ btn.connect_clicked(move |_| {+ d2.borrow_mut()["avatarColor"] = (*cname).into();+ redraw();+ });+ colors.insert(&btn, -1);+ }+ profile.add(&colors);+ page.add(&profile);++ // Standing instructions+ let instructions_group = adw::PreferencesGroup::builder()+ .title("Standing instructions")+ .description("Rules that always apply. Put task-specific requests in the chat.")+ .build();+ let instructions = gtk::TextView::builder().wrap_mode(gtk::WrapMode::WordChar).top_margin(8).bottom_margin(8).left_margin(8).right_margin(8).build();+ instructions.buffer().set_text(d.borrow()["description"].as_str().unwrap_or(""));+ instructions_group.add(>k::Frame::builder().child(>k::ScrolledWindow::builder().min_content_height(90).child(&instructions).build()).build());+ page.add(&instructions_group);++ // Agent: installed harnesses first, then the registry, then a custom command.+ let agent = adw::PreferencesGroup::builder().title("Coding agent").build();+ let mut ids: Vec<String> = vec![];+ let names = gtk::StringList::new(&[]);+ for b in &backends {+ let tag = if b["installed"] == true { "" } else if b["available"] == true { " — installs automatically" } else { " — needs setup" };+ names.append(&format!("{}{tag}", b["name"].as_str().unwrap_or("")));+ ids.push(b["id"].as_str().unwrap_or("").to_owned());+ }+ names.append("Custom ACP command");+ ids.push("custom".into());+ let current = d.borrow()["backend"].as_str().unwrap_or("").to_owned();+ let harness = adw::ComboRow::builder()+ .title("Runs on")+ .model(&names)+ .enable_search(true)+ .selected(ids.iter().position(|i| *i == current).unwrap_or(0) as u32)+ .build();+ let hint = gtk::Label::builder().wrap(true).xalign(0.0).css_classes(["small", "dim-label"]).margin_top(6).build();+ let command = adw::EntryRow::builder().title("ACP command").text(d.borrow()["command"].as_str().unwrap_or("")).build();+ let model = adw::EntryRow::builder().title("Model (optional)").text(d.borrow()["model"].as_str().unwrap_or("")).build();+ agent.add(&harness);+ agent.add(&command);+ agent.add(&model);+ agent.add(&hint);+ let sync_harness = {+ let (ids, backends, d, hint, command, harness) = (ids.clone(), backends.clone(), d.clone(), hint.clone(), command.clone(), harness.clone());+ move || {+ let id = ids.get(harness.selected() as usize).cloned().unwrap_or_default();+ command.set_visible(id == "custom");+ let b = backends.iter().find(|b| b["id"] == id.as_str());+ hint.set_label(b.filter(|b| b["installed"] != true).and_then(|b| b["installHint"].as_str()).unwrap_or(""));+ d.borrow_mut()["backend"] = id.into();+ }+ };+ sync_harness();+ harness.connect_selected_notify(move |_| sync_harness());+ page.add(&agent);++ // Project folder (native folder chooser: the host runs on this computer)+ let project = adw::PreferencesGroup::builder().title("Project folder").build();+ let folder_row = adw::ActionRow::builder().title(d.borrow()["cwd"].as_str().filter(|s| !s.is_empty()).unwrap_or("Choose a folder…")).activatable(true).build();+ let choose = gtk::Button::builder().icon_name("folder-open-symbolic").tooltip_text("Choose folder").css_classes(["flat"]).valign(gtk::Align::Center).build();+ folder_row.add_suffix(&choose);+ project.add(&folder_row);+ {+ let (d2, row, dialog2) = (d.clone(), folder_row.clone(), dialog.clone());+ let pick = move || {+ let chooser = gtk::FileDialog::builder().title("Project folder").build();+ let (d3, row2) = (d2.clone(), row.clone());+ let parent = dialog2.root().and_downcast::<gtk::Window>();+ chooser.select_folder(parent.as_ref(), gtk::gio::Cancellable::NONE, move |res| {+ if let Ok(f) = res+ && let Some(path) = f.path()+ {+ let p = path.to_string_lossy().into_owned();+ row2.set_title(&p);+ d3.borrow_mut()["cwd"] = p.into();+ }+ });+ };+ let pick2 = pick.clone();+ choose.connect_clicked(move |_| pick());+ folder_row.connect_activated(move |_| pick2());+ }+ page.add(&project);++ // Permissions+ let perms = adw::PreferencesGroup::builder().title("Permissions").build();+ let auto = adw::SwitchRow::builder()+ .title("Approve automatically")+ .subtitle("Otherwise you get an approval card and a notification each time the agent asks.")+ .active(d.borrow()["permission"] == "auto")+ .build();+ perms.add(&auto);+ let notify = adw::SwitchRow::builder().title("Notifications").active(d.borrow()["notify"].as_bool().unwrap_or(true)).build();+ perms.add(¬ify);+ page.add(&perms);++ view.set_content(Some(&page));+ let ui2 = ui.clone();+ let dialog2 = dialog.clone();+ save.connect_clicked(move |btn| {+ let mut body = d.borrow().clone();+ let buf = instructions.buffer();+ body["name"] = name.text().trim().into();+ body["description"] = buf.text(&buf.start_iter(), &buf.end_iter(), false).trim().into();+ body["permission"] = if auto.is_active() { "auto" } else { "ask" }.into();+ body["notify"] = notify.is_active().into();+ let m = model.text().trim().to_owned();+ body["model"] = if m.is_empty() { Value::Null } else { m.into() };+ body["command"] = if body["backend"] == "custom" { command.text().trim().into() } else { Value::Null };+ for k in ["status", "activity", "unread", "lastMessage", "lastAt", "rev", "deleted", "startedAt"] {+ body.as_object_mut().unwrap().remove(k);+ }+ btn.set_sensitive(false);+ let (ui3, dialog3, btn2) = (ui2.clone(), dialog2.clone(), btn.clone());+ client::call(if is_new { "createBot" } else { "updateBot" }, body, move |r| match r {+ Ok(v) => {+ let bot = v["bot"].clone();+ let id = bot["id"].as_str().unwrap_or_default().to_owned();+ {+ let mut st = ui3.state.borrow_mut();+ st.bots.insert(id.clone(), bot);+ if is_new {+ st.current = Some(id);+ }+ }+ dialog3.close();+ ui3.split.set_show_content(true);+ ui::schedule(&ui3);+ }+ Err(e) => {+ btn2.set_sensitive(true);+ ui::toast(&ui3, &e);+ }+ });+ });+ dialog.present(Some(&ui.window));+}++fn client_seed() -> usize {+ std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).map(|d| d.subsec_nanos() as usize).unwrap_or(0)+}++// MARK: trace++pub fn trace(ui: &App) {+ let st = ui.state.borrow();+ let Some(id) = st.current.clone() else { return };+ let (dialog, view, _) = header_dialog("Full conversation", 560, 760);+ let list = gtk::Box::builder().orientation(gtk::Orientation::Vertical).spacing(10).margin_start(16).margin_end(16).margin_top(12).margin_bottom(16).build();+ let entries = st.entries.get(&id).cloned().unwrap_or_default();+ let mut turn = -1i64;+ let mut group = adw::PreferencesGroup::new();+ for e in &entries {+ let t = e["turn"].as_i64().unwrap_or(0);+ if t != turn {+ turn = t;+ let title = entries.iter().find(|x| x["turn"] == t && x["kind"] == "user").and_then(|x| x["data"]["text"].as_str()).unwrap_or("");+ group = adw::PreferencesGroup::builder().title(gtk::glib::markup_escape_text(&title.chars().take(80).collect::<String>())).build();+ list.append(&group);+ }+ let d = &e["data"];+ let widget: gtk::Widget = match e["kind"].as_str().unwrap_or("") {+ "tool" => {+ let status = match d["status"].as_str() { Some("completed") => "✓", Some("failed") => "✕", _ => "…" };+ let row = adw::ExpanderRow::builder().title(gtk::glib::markup_escape_text(d["title"].as_str().unwrap_or("Tool"))).subtitle(status).build();+ let mut body = String::new();+ for diff in d["diffs"].as_array().into_iter().flatten() {+ body.push_str(&format!("{} +{} −{}\n{}\n", diff["path"].as_str().unwrap_or(""), diff["added"], diff["removed"], diff["patch"].as_str().unwrap_or("")));+ }+ body.push_str(d["output"].as_str().unwrap_or(""));+ if !body.trim().is_empty() {+ row.add_row(>k::Label::builder().label(body.trim()).xalign(0.0).wrap(true).selectable(true).css_classes(["codebox"]).margin_start(8).margin_end(8).margin_top(6).margin_bottom(6).build());+ }+ row.upcast()+ }+ "thought" => {+ let row = adw::ExpanderRow::builder().title("Thinking").build();+ row.add_row(>k::Label::builder().label(d["text"].as_str().unwrap_or("")).xalign(0.0).wrap(true).css_classes(["dim-label"]).margin_start(8).margin_end(8).margin_top(6).margin_bottom(6).build());+ row.upcast()+ }+ "agent" => gtk::Label::builder().use_markup(true).label(markup::to_pango(d["text"].as_str().unwrap_or(""))).xalign(0.0).wrap(true).selectable(true).margin_start(12).margin_end(12).margin_top(8).margin_bottom(8).build().upcast(),+ "plan" => {+ let text: Vec<String> = d["entries"].as_array().into_iter().flatten().map(|p| format!("{} {}", if p["status"] == "completed" { "✅" } else { "○" }, p["content"].as_str().unwrap_or(""))).collect();+ adw::ActionRow::builder().title("Plan").subtitle(gtk::glib::markup_escape_text(&text.join("\n"))).build().upcast()+ }+ "user" => adw::ActionRow::builder().title(gtk::glib::markup_escape_text(d["text"].as_str().unwrap_or(""))).build().upcast(),+ _ => adw::ActionRow::builder().title(gtk::glib::markup_escape_text(d["title"].as_str().or(d["text"].as_str()).unwrap_or(""))).build().upcast(),+ };+ group.add(&widget);+ }+ view.set_content(Some(>k::ScrolledWindow::builder().child(&list).vexpand(true).build()));+ dialog.present(Some(&ui.window));+}++// MARK: bot menu++pub fn bot_menu(ui: &App) -> gtk::Popover {+ let pop = gtk::Popover::new();+ let col = gtk::Box::builder().orientation(gtk::Orientation::Vertical).spacing(2).build();+ let bot = { let st = ui.state.borrow(); st.current.as_ref().and_then(|id| st.bots.get(id)).cloned() };+ let Some(bot) = bot else { return pop };+ let id = bot["id"].as_str().unwrap_or_default().to_owned();+ let add = |label: &str, destructive: bool, f: Box<dyn Fn()>| {+ let b = gtk::Button::builder().label(label).css_classes(["flat"]).build();+ if destructive {+ b.add_css_class("error");+ }+ let pop2 = pop.clone();+ b.connect_clicked(move |_| {+ pop2.popdown();+ f();+ });+ col.append(&b);+ };+ {+ let (ui2, bot2) = (ui.clone(), bot.clone());+ add("Edit profile", false, Box::new(move || editor(&ui2, Some(bot2.clone()))));+ }+ {+ let (id2, pinned) = (id.clone(), bot["pinned"].as_bool().unwrap_or(false));+ add(if pinned { "Unpin" } else { "Pin" }, false, Box::new(move || client::call("updateBot", json!({"id": id2, "pinned": !pinned}), |_| {})));+ }+ {+ let id2 = id.clone();+ add("New session", false, Box::new(move || client::call("newSession", json!({"botId": id2}), |_| {})));+ }+ {+ let (ui2, id2, name) = (ui.clone(), id.clone(), bot["name"].as_str().unwrap_or("").to_owned());+ add("Delete bot…", true, Box::new(move || {+ let alert = adw::AlertDialog::new(Some(&format!("Delete {name}?")), Some("The conversation is removed. Files it changed stay as they are."));+ alert.add_responses(&[("cancel", "Cancel"), ("delete", "Delete")]);+ alert.set_response_appearance("delete", adw::ResponseAppearance::Destructive);+ let id3 = id2.clone();+ alert.connect_response(None, move |_, r| {+ if r == "delete" {+ client::call("deleteBot", json!({"botId": id3}), |_| {});+ }+ });+ alert.present(Some(&ui2.window));+ }));+ }+ pop.set_child(Some(&col));+ pop+}++// MARK: settings & pairing++pub fn settings(ui: &App) {+ let (dialog, view, _) = header_dialog("Settings", 520, 720);+ let page = adw::PreferencesPage::new();+ let pair = adw::PreferencesGroup::builder().title("Pair your iPhone").description("Scan with the Codync app or the iPhone Camera.").build();+ let qr_area = gtk::DrawingArea::builder().content_width(220).content_height(220).halign(gtk::Align::Center).margin_top(8).build();+ pair.add(&qr_area);+ let copy = gtk::Button::builder().icon_name("edit-copy-symbolic").tooltip_text("Copy pairing link").css_classes(["flat", "circular"]).halign(gtk::Align::Center).margin_top(8).build();+ pair.add(©);+ page.add(&pair);+ client::call("pairing", client::empty(), move |r| {+ if let Ok(v) = r+ && let Some(url) = v["pairingUrl"].as_str()+ && let Ok(code) = qrcode::QrCode::new(url.as_bytes())+ {+ let width = code.width();+ let dark: Vec<bool> = code.to_colors().iter().map(|c| *c == qrcode::Color::Dark).collect();+ qr_area.set_draw_func(move |_, cr, w, _| {+ let cell = w as f64 / (width + 4) as f64;+ cr.set_source_rgb(1.0, 1.0, 1.0);+ cr.paint().ok();+ cr.set_source_rgb(0.0, 0.0, 0.0);+ for (i, on) in dark.iter().enumerate() {+ if *on {+ cr.rectangle(((i % width) + 2) as f64 * cell, ((i / width) + 2) as f64 * cell, cell, cell);+ }+ }+ cr.fill().ok();+ });+ qr_area.queue_draw();+ let url = url.to_owned();+ copy.connect_clicked(move |b| b.clipboard().set_text(&url));+ }+ });++ let st = ui.state.borrow();+ let agents = adw::PreferencesGroup::builder().title("Coding agents on this computer").build();+ for b in st.hello["backends"].as_array().into_iter().flatten().filter(|b| b["installed"] == true) {+ agents.add(&adw::ActionRow::builder().title(b["name"].as_str().unwrap_or("")).subtitle(gtk::glib::markup_escape_text(b["path"].as_str().unwrap_or(""))).build());+ }+ let rescan = gtk::Button::builder().icon_name("view-refresh-symbolic").tooltip_text("Re-scan this computer").css_classes(["flat"]).build();+ agents.set_header_suffix(Some(&rescan));+ {+ let (ui2, dialog2) = (ui.clone(), dialog.clone());+ rescan.connect_clicked(move |_| {+ let (ui3, dialog3) = (ui2.clone(), dialog2.clone());+ client::call("refreshBackends", client::empty(), move |r| {+ if let Ok(v) = r {+ ui3.state.borrow_mut().hello["backends"] = v["backends"].clone();+ }+ dialog3.close();+ settings(&ui3);+ });+ });+ }+ page.add(&agents);++ let usage = adw::PreferencesGroup::builder().title("Usage limits").build();+ for p in st.usage["providers"].as_array().into_iter().flatten() {+ for w in p["windows"].as_array().into_iter().flatten() {+ let reset = w["resetsText"].as_str().map(|s| format!("resets {s}")).unwrap_or_default();+ let row = adw::ActionRow::builder()+ .title(format!("{} {}", p["name"].as_str().unwrap_or(""), w["label"].as_str().unwrap_or("")))+ .subtitle(gtk::glib::markup_escape_text(&reset))+ .build();+ let bar = gtk::LevelBar::builder().min_value(0.0).max_value(100.0).value(w["percent"].as_f64().unwrap_or(0.0)).width_request(120).valign(gtk::Align::Center).build();+ row.add_suffix(&bar);+ row.add_suffix(>k::Label::new(Some(&format!("{:.0}%", w["percent"].as_f64().unwrap_or(0.0)))));+ usage.add(&row);+ }+ }+ page.add(&usage);+ let about = adw::PreferencesGroup::new();+ about.add(&adw::ActionRow::builder().title("codync-host").subtitle(format!("{} · {}", st.hello["version"].as_str().unwrap_or(""), st.hello["os"].as_str().unwrap_or(""))).build());+ page.add(&about);+ view.set_content(Some(&page));+ dialog.present(Some(&ui.window));+}++/// Shown when the host isn't running: offer to install/start it.+pub fn host_missing(ui: &App) {+ let status = adw::StatusPage::builder()+ .title("Start the Codync host")+ .description("Codync runs your coding agents through a small background service on this computer.")+ .icon_name("computer-symbolic")+ .build();+ let btn = gtk::Button::builder().label("Install & start host").css_classes(["pill", "accent-fill"]).halign(gtk::Align::Center).build();+ status.set_child(Some(&btn));+ let (dialog, view, _) = header_dialog("Codync", 460, 420);+ view.set_content(Some(&status));+ let (ui2, dialog2) = (ui.clone(), dialog.clone());+ btn.connect_clicked(move |b| {+ b.set_sensitive(false);+ let (ui3, dialog3, b2) = (ui2.clone(), dialog2.clone(), b.clone());+ client::install_host(move |r| match r {+ Ok(()) => {+ dialog3.close();+ gtk::glib::timeout_add_seconds_local_once(1, move || ui::reconnect(&ui3));+ }+ Err(e) => {+ b2.set_sensitive(true);+ ui::toast(&ui3, &e);+ }+ });+ });+ dialog.present(Some(&ui.window));+}diff --git a/linux/src/main.rs b/linux/src/main.rsnew file mode 100644index 00000000..13330418--- /dev/null+++ b/linux/src/main.rs@@ -0,0 +1,52 @@+//! Codync for Linux — the same bot chat as the iPhone and Mac apps, in GTK 4 + libadwaita.++mod avatar;+mod client;+mod dialogs;+mod markup;+mod ui;++use adw::prelude::*;++const CSS: &str = r#"+.bubble { border-radius: 18px; padding: 8px 13px; }+.bubble-user { background: #c7ec6b; color: #141712; }+.bubble-agent { background: alpha(currentColor, 0.08); }+.card { border-radius: 16px; padding: 14px; border: 1px solid alpha(currentColor, 0.15); background: alpha(currentColor, 0.03); }+.card.pending { border-color: alpha(#ff9800, 0.7); }+.accent-fill { background: #c7ec6b; color: #141712; }+.accent-fill:hover { background: shade(#c7ec6b, 0.95); }+.accent-text { color: #6f8f1a; }+.needs-text { color: #e08600; }+.muted { opacity: 0.6; }+.small { font-size: 0.85em; }+.badge { background: #c7ec6b; color: #141712; border-radius: 999px; padding: 0 6px; font-weight: bold; font-size: 0.8em; min-width: 12px; }+.chip { border-radius: 999px; padding: 3px 10px; border: 1px solid alpha(currentColor, 0.15); }+.codebox { font-family: monospace; font-size: 0.9em; background: alpha(currentColor, 0.06); border-radius: 8px; padding: 8px; }+.composer { border-radius: 20px; padding: 8px 12px; border: 1px solid alpha(currentColor, 0.18); }+.composer textview, .composer text { background: transparent; }+.notice-error { background: alpha(#e0443e, 0.12); border-radius: 12px; padding: 10px 12px; }+.round { border-radius: 999px; min-width: 38px; min-height: 38px; padding: 0; }+"#;++fn main() -> gtk::glib::ExitCode {+ let app = adw::Application::builder().application_id("com.pokai.Codync").build();+ app.connect_startup(|_| {+ let provider = gtk::CssProvider::new();+ provider.load_from_string(CSS);+ gtk::style_context_add_provider_for_display(+ >k::gdk::Display::default().expect("no display"),+ &provider,+ gtk::STYLE_PROVIDER_PRIORITY_APPLICATION,+ );+ });+ app.connect_activate(|app| {+ if let Some(win) = app.active_window() {+ win.present();+ return;+ }+ ui::build(app);+ });+ // Our own flags (`--bot <id>`) are read in ui::connect; keep GTK from rejecting them.+ app.run_with_args(&std::env::args().take(1).collect::<Vec<_>>())+}diff --git a/linux/src/markup.rs b/linux/src/markup.rsnew file mode 100644index 00000000..b71b2e3b--- /dev/null+++ b/linux/src/markup.rs@@ -0,0 +1,79 @@+//! Markdown → Pango markup (the subset agents actually send).++use gtk::glib::markup_escape_text;++fn inline(line: &str) -> String {+ let escaped = markup_escape_text(line).to_string();+ let mut out = String::new();+ let mut code = false;+ for (i, part) in escaped.split('`').enumerate() {+ if i > 0 {+ code = !code;+ }+ if code {+ out.push_str(&format!("<tt>{part}</tt>"));+ } else {+ out.push_str(&emphasis(part));+ }+ }+ out+}++fn emphasis(s: &str) -> String {+ let mut out = String::new();+ for (i, part) in s.split("**").enumerate() {+ if i % 2 == 1 { out.push_str(&format!("<b>{part}</b>")) } else { out.push_str(&links(part)) }+ }+ out+}++fn links(s: &str) -> String {+ // [text](http…) → <a>+ let mut out = String::new();+ let mut rest = s;+ while let Some(open) = rest.find('[') {+ let Some(close) = rest[open..].find("](").map(|i| open + i) else { break };+ let Some(end) = rest[close..].find(')').map(|i| close + i) else { break };+ let url = &rest[close + 2..end];+ if !url.starts_with("http") {+ break;+ }+ out.push_str(&rest[..open]);+ out.push_str(&format!("<a href=\"{url}\">{}</a>", &rest[open + 1..close]));+ rest = &rest[end + 1..];+ }+ out.push_str(rest);+ out+}++pub fn to_pango(src: &str) -> String {+ let mut out = Vec::new();+ let mut in_code = false;+ for line in src.lines() {+ let t = line.trim_start();+ if t.starts_with("```") {+ in_code = !in_code;+ continue;+ }+ if in_code {+ out.push(format!("<tt>{}</tt>", markup_escape_text(line)));+ } else if let Some(h) = t.strip_prefix("### ").or_else(|| t.strip_prefix("## ")).or_else(|| t.strip_prefix("# ")) {+ out.push(format!("<b>{}</b>", inline(h)));+ } else if let Some(item) = t.strip_prefix("- ").or_else(|| t.strip_prefix("* ")) {+ out.push(format!(" • {}", inline(item)));+ } else {+ out.push(inline(line));+ }+ }+ out.join("\n")+}++#[cfg(test)]+mod tests {+ #[test]+ fn converts_common_markdown() {+ assert_eq!(super::to_pango("**hi** `a<b`"), "<b>hi</b> <tt>a<b</tt>");+ assert_eq!(super::to_pango("- x\n```\nfn()\n```"), " • x\n<tt>fn()</tt>");+ assert_eq!(super::to_pango("[doc](https://a.b)"), "<a href=\"https://a.b\">doc</a>");+ }+}diff --git a/linux/src/ui.rs b/linux/src/ui.rsnew file mode 100644index 00000000..4b598de6--- /dev/null+++ b/linux/src/ui.rs@@ -0,0 +1,705 @@+//! Main window: roster sidebar + conversation (Grok Bot's desktop layout).++use crate::client::{self, Event};+use crate::{avatar, dialogs, markup};+use adw::prelude::*;+use serde_json::{Value, json};+use std::cell::RefCell;+use std::collections::HashMap;+use std::rc::Rc;++#[derive(Default)]+pub struct State {+ pub bots: HashMap<String, Value>,+ pub entries: HashMap<String, Vec<Value>>,+ pub usage: Value,+ pub hello: Value,+ pub current: Option<String>,+ pub online: bool,+}++pub struct Ui {+ pub window: adw::ApplicationWindow,+ pub toasts: adw::ToastOverlay,+ pub split: adw::NavigationSplitView,+ roster: gtk::ListBox,+ usage_box: gtk::Box,+ banner: adw::Banner,+ title: adw::WindowTitle,+ head_avatar: gtk::Box,+ thread: gtk::Box,+ scroller: gtk::ScrolledWindow,+ composer: gtk::TextView,+ send_btn: gtk::Button,+ stop_btn: gtk::Button,+ content_stack: gtk::Stack,+ chat_buttons: [gtk::Widget; 2],+ /// Bot shown in the last render; switching bots jumps to the newest message.+ shown_bot: RefCell<String>,+ pub state: RefCell<State>,+ rendering: std::cell::Cell<bool>,+}++pub type App = Rc<Ui>;++pub fn build(app: &adw::Application) {+ // Sidebar+ let roster = gtk::ListBox::builder().css_classes(["navigation-sidebar"]).build();+ let usage_box = gtk::Box::builder().spacing(6).margin_start(12).margin_end(12).margin_bottom(6).build();+ let usage_scroll = gtk::ScrolledWindow::builder().vscrollbar_policy(gtk::PolicyType::Never).child(&usage_box).build();+ let banner = adw::Banner::new("Reconnecting to the Codync host…");+ let sidebar_box = gtk::Box::new(gtk::Orientation::Vertical, 0);+ sidebar_box.append(&banner);+ sidebar_box.append(&usage_scroll);+ sidebar_box.append(>k::ScrolledWindow::builder().vexpand(true).child(&roster).build());+ let new_btn = gtk::Button::builder().icon_name("document-edit-symbolic").tooltip_text("New bot").build();+ let settings_btn = gtk::Button::builder().icon_name("emblem-system-symbolic").tooltip_text("Settings & pairing").build();+ let side_header = adw::HeaderBar::new();+ side_header.pack_start(&settings_btn);+ side_header.pack_end(&new_btn);+ let side_view = adw::ToolbarView::new();+ side_view.add_top_bar(&side_header);+ side_view.set_content(Some(&sidebar_box));+ let sidebar_page = adw::NavigationPage::new(&side_view, "Codync");++ // Conversation+ let title = adw::WindowTitle::new("", "");+ let head_avatar = gtk::Box::new(gtk::Orientation::Horizontal, 0);+ let head = gtk::Box::builder().spacing(8).build();+ head.append(&head_avatar);+ head.append(&title);+ let trace_btn = gtk::Button::builder().icon_name("view-list-symbolic").tooltip_text("Full conversation").build();+ let menu_btn = gtk::MenuButton::builder().icon_name("view-more-symbolic").tooltip_text("More").build();+ let content_header = adw::HeaderBar::builder().title_widget(&head).build();+ content_header.pack_end(&menu_btn);+ content_header.pack_end(&trace_btn);+ let thread = gtk::Box::builder()+ .orientation(gtk::Orientation::Vertical)+ .spacing(4)+ .margin_start(16)+ .margin_end(16)+ .margin_top(12)+ .margin_bottom(12)+ .build();+ let clamp = adw::Clamp::builder().maximum_size(760).child(&thread).build();+ let scroller = gtk::ScrolledWindow::builder().vexpand(true).child(&clamp).build();+ let composer = gtk::TextView::builder().wrap_mode(gtk::WrapMode::WordChar).accepts_tab(false).hexpand(true).top_margin(4).bottom_margin(4).build();+ let composer_frame = gtk::ScrolledWindow::builder()+ .child(&composer)+ .max_content_height(160)+ .propagate_natural_height(true)+ .hscrollbar_policy(gtk::PolicyType::Never)+ .css_classes(["composer"])+ .hexpand(true)+ .build();+ let send_btn = gtk::Button::builder().icon_name("go-up-symbolic").tooltip_text("Send").css_classes(["round", "accent-fill"]).valign(gtk::Align::End).build();+ let stop_btn = gtk::Button::builder().icon_name("media-playback-stop-symbolic").tooltip_text("Stop").css_classes(["round"]).valign(gtk::Align::End).build();+ let composer_row = gtk::Box::builder().spacing(8).margin_start(12).margin_end(12).margin_top(8).margin_bottom(12).build();+ composer_row.append(&composer_frame);+ composer_row.append(&stop_btn);+ composer_row.append(&send_btn);+ let convo = gtk::Box::new(gtk::Orientation::Vertical, 0);+ convo.append(&scroller);+ convo.append(>k::Separator::new(gtk::Orientation::Horizontal));+ convo.append(&composer_row);+ let empty = adw::StatusPage::builder()+ .title("Your coding agents, as teammates")+ .description("Pick a bot, or create one for each kind of work and point it at a project.")+ .icon_name("user-available-symbolic")+ .build();+ let content_stack = gtk::Stack::new();+ content_stack.add_named(&empty, Some("empty"));+ content_stack.add_named(&convo, Some("chat"));+ let content_view = adw::ToolbarView::new();+ content_view.add_top_bar(&content_header);+ content_view.set_content(Some(&content_stack));+ let content_page = adw::NavigationPage::new(&content_view, "Chat");++ let split = adw::NavigationSplitView::builder().sidebar(&sidebar_page).content(&content_page).min_sidebar_width(260.0).build();+ let toasts = adw::ToastOverlay::new();+ toasts.set_child(Some(&split));+ let window = adw::ApplicationWindow::builder().application(app).title("Codync").default_width(1100).default_height(760).content(&toasts).build();+ let bp = adw::Breakpoint::new(adw::BreakpointCondition::new_length(adw::BreakpointConditionLengthType::MaxWidth, 640.0, adw::LengthUnit::Sp));+ bp.add_setter(&split, "collapsed", Some(&true.to_value()));+ window.add_breakpoint(bp);++ let ui: App = Rc::new(Ui {+ window,+ toasts,+ split,+ roster,+ usage_box,+ banner,+ title,+ head_avatar,+ thread,+ scroller,+ composer,+ send_btn,+ stop_btn,+ content_stack,+ chat_buttons: [trace_btn.clone().upcast(), menu_btn.clone().upcast()],+ shown_bot: RefCell::new(String::new()),+ state: RefCell::new(State::default()),+ rendering: std::cell::Cell::new(false),+ });++ // Wiring+ {+ let ui2 = ui.clone();+ ui.roster.connect_row_activated(move |_, row| {+ ui2.state.borrow_mut().current = Some(row.widget_name().to_string());+ ui2.split.set_show_content(true);+ mark_read(&ui2);+ render(&ui2);+ });+ }+ {+ let ui2 = ui.clone();+ new_btn.connect_clicked(move |_| dialogs::editor(&ui2, None));+ }+ {+ let ui2 = ui.clone();+ settings_btn.connect_clicked(move |_| dialogs::settings(&ui2));+ }+ {+ let ui2 = ui.clone();+ trace_btn.connect_clicked(move |_| dialogs::trace(&ui2));+ }+ {+ let ui2 = ui.clone();+ menu_btn.set_create_popup_func(move |btn| btn.set_popover(Some(&dialogs::bot_menu(&ui2))));+ }+ {+ let ui2 = ui.clone();+ ui.send_btn.connect_clicked(move |_| send(&ui2));+ }+ {+ let ui2 = ui.clone();+ ui.stop_btn.connect_clicked(move |_| {+ if let Some(id) = ui2.state.borrow().current.clone() {+ client::call("stop", json!({"botId": id}), |_| {});+ }+ });+ }+ {+ let ui2 = ui.clone();+ let keys = gtk::EventControllerKey::new();+ keys.connect_key_pressed(move |_, key, _, mods| {+ if (key == gtk::gdk::Key::Return || key == gtk::gdk::Key::KP_Enter) && !mods.contains(gtk::gdk::ModifierType::SHIFT_MASK) {+ send(&ui2);+ return gtk::glib::Propagation::Stop;+ }+ gtk::glib::Propagation::Proceed+ });+ ui.composer.add_controller(keys);+ }+ {+ let ui2 = ui.clone();+ ui.composer.buffer().connect_changed(move |_| update_composer(&ui2));+ }+ // Keep relative times fresh.+ {+ let ui2 = ui.clone();+ gtk::glib::timeout_add_seconds_local(30, move || {+ render_roster(&ui2);+ gtk::glib::ControlFlow::Continue+ });+ }++ ui.window.present();+ connect(&ui);+}++fn connect(ui: &App) {+ if client::token().is_none() {+ dialogs::host_missing(ui);+ return;+ }+ let ui2 = ui.clone();+ client::call("hello", client::empty(), move |r| match r {+ Ok(hello) => {+ let mut st = ui2.state.borrow_mut();+ st.hello = hello;+ // Open a specific bot on launch: `codync --bot <id>` (also used by desktop notifications).+ let args: Vec<String> = std::env::args().collect();+ if let Some(i) = args.iter().position(|a| a == "--bot") {+ st.current = args.get(i + 1).cloned();+ }+ drop(st);+ let (tx, rx) = async_channel::unbounded();+ client::stream(tx);+ let ui3 = ui2.clone();+ gtk::glib::spawn_future_local(async move {+ while let Ok(ev) = rx.recv().await {+ handle(&ui3, ev);+ }+ });+ }+ Err(_) => dialogs::host_missing(&ui2),+ });+}++pub fn reconnect(ui: &App) {+ client::reset_rev();+ connect(ui);+}++fn handle(ui: &App, ev: Event) {+ {+ let mut st = ui.state.borrow_mut();+ match ev {+ Event::Online(on) => st.online = on,+ Event::Message(m) => match m["type"].as_str().unwrap_or_default() {+ "hello" => st.usage = m["usage"].clone(),+ "usage" => st.usage = m["usage"].clone(),+ "bot" => {+ let bot = &m["bot"];+ let id = bot["id"].as_str().unwrap_or_default().to_owned();+ if bot["deleted"].as_bool().unwrap_or(false) {+ st.bots.remove(&id);+ st.entries.remove(&id);+ if st.current.as_deref() == Some(&id) {+ st.current = None;+ }+ } else {+ if let Some(old) = st.bots.get(&id) {+ notify(ui, old, bot);+ }+ st.bots.insert(id, bot.clone());+ }+ }+ "entry" => upsert(&mut st, m["entry"].clone()),+ _ => {}+ },+ }+ }+ schedule(ui);+}++/// Desktop notification when a bot needs you or finishes, unless Codync is focused.+fn notify(ui: &App, old: &Value, new: &Value) {+ if ui.window.is_active() || new["notify"] == false || new["hidden"] == true {+ return;+ }+ let name = new["name"].as_str().unwrap_or("Bot");+ let (title, body) = match (old["status"].as_str(), new["status"].as_str()) {+ (Some(o), Some("needsInput")) if o != "needsInput" => (format!("{name} needs you"), new["activity"].as_str().unwrap_or("").to_owned()),+ (Some("working" | "needsInput"), Some("idle")) => (name.to_owned(), new["lastMessage"].as_str().unwrap_or("Finished.").to_owned()),+ _ => return,+ };+ let n = gtk::gio::Notification::new(&title);+ n.set_body(Some(&body.chars().take(140).collect::<String>()));+ if let Some(app) = ui.window.application() {+ app.send_notification(new["id"].as_str(), &n);+ }+}++pub fn upsert(st: &mut State, e: Value) {+ let bot = e["botId"].as_str().unwrap_or_default().to_owned();+ let list = st.entries.entry(bot).or_default();+ let id = e["id"].as_str().unwrap_or_default();+ if let Some(i) = list.iter().position(|x| x["id"] == id) {+ // A late command response mustn't undo a newer streamed update.+ if e["rev"].as_i64() >= list[i]["rev"].as_i64() {+ list[i] = e;+ }+ return;+ }+ if e["kind"] == "user"+ && let Some(nonce) = e["data"]["clientNonce"].as_str().filter(|n| !n.is_empty())+ {+ list.retain(|x| x["id"] != format!("local-{nonce}"));+ }+ list.push(e);+ list.sort_by_key(|x| x["seq"].as_i64().unwrap_or(i64::MAX));+ if list.len() > 400 {+ list.drain(..list.len() - 400);+ }+}++/// Coalesces bursts of events into one render per frame.+pub fn schedule(ui: &App) {+ if ui.rendering.replace(true) {+ return;+ }+ let ui2 = ui.clone();+ gtk::glib::idle_add_local_once(move || {+ ui2.rendering.set(false);+ render(&ui2);+ });+}++pub fn render(ui: &App) {+ ui.banner.set_revealed(!ui.state.borrow().online);+ render_usage(ui);+ render_roster(ui);+ render_thread(ui);+}++fn working(b: &Value) -> bool {+ matches!(b["status"].as_str(), Some("working" | "needsInput"))+}++pub fn backend_name(st: &State, id: &str) -> String {+ st.hello["backends"]+ .as_array()+ .and_then(|l| l.iter().find(|b| b["id"] == id))+ .and_then(|b| b["name"].as_str())+ .unwrap_or(if id == "custom" { "Custom agent" } else { id })+ .to_owned()+}++fn folder(p: &str) -> String {+ std::path::Path::new(p).file_name().map(|s| s.to_string_lossy().into_owned()).unwrap_or_else(|| p.to_owned())+}++pub fn ago(ms: i64) -> String {+ let now = std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).unwrap().as_millis() as i64;+ let s = ((now - ms) / 1000).max(0);+ match s {+ 0..60 => "now".into(),+ 60..3600 => format!("{}m", s / 60),+ 3600..86400 => format!("{}h", s / 3600),+ _ => format!("{}d", s / 86400),+ }+}++fn render_usage(ui: &App) {+ while let Some(c) = ui.usage_box.first_child() {+ ui.usage_box.remove(&c);+ }+ let st = ui.state.borrow();+ for p in st.usage["providers"].as_array().into_iter().flatten() {+ for w in p["windows"].as_array().into_iter().flatten().take(2) {+ let pct = w["percent"].as_f64().unwrap_or(0.0);+ let chip = gtk::Box::builder().orientation(gtk::Orientation::Vertical).css_classes(["chip"]).build();+ chip.append(>k::Label::builder().label(format!("{} {}", p["name"].as_str().unwrap_or(""), w["label"].as_str().unwrap_or(""))).css_classes(["small", "muted"]).xalign(0.0).build());+ let value = gtk::Label::builder().label(format!("{pct:.0}%")).xalign(0.0).css_classes(["heading"]).build();+ if pct >= 90.0 {+ value.add_css_class("error");+ } else if pct >= 70.0 {+ value.add_css_class("warning");+ }+ chip.append(&value);+ ui.usage_box.append(&chip);+ }+ }+}++fn render_roster(ui: &App) {+ let st = ui.state.borrow();+ let mut bots: Vec<&Value> = st.bots.values().filter(|b| !b["hidden"].as_bool().unwrap_or(false)).collect();+ bots.sort_by_key(|b| (!b["pinned"].as_bool().unwrap_or(false), -b["lastAt"].as_i64().unwrap_or(0)));+ while let Some(c) = ui.roster.first_child() {+ ui.roster.remove(&c);+ }+ for b in bots {+ let id = b["id"].as_str().unwrap_or_default();+ let unread = b["unread"].as_i64().unwrap_or(0);+ let status = if b["status"] == "needsInput" { "needs" } else if unread > 0 { "unread" } else { "" };+ let row_box = gtk::Box::builder().spacing(10).margin_top(6).margin_bottom(6).build();+ row_box.append(&avatar::widget(b["avatarShape"].as_str().unwrap_or("blob"), b["avatarColor"].as_str().unwrap_or("blue"), 40, working(b), status));+ let text = gtk::Box::builder().orientation(gtk::Orientation::Vertical).hexpand(true).build();+ let top = gtk::Box::builder().spacing(6).build();+ top.append(>k::Label::builder().label(b["name"].as_str().unwrap_or("")).xalign(0.0).hexpand(true).ellipsize(gtk::pango::EllipsizeMode::End).css_classes(["heading"]).build());+ let time = gtk::Label::builder().label(ago(b["lastAt"].as_i64().unwrap_or(0))).css_classes(["small", "muted"]).build();+ top.append(&time);+ text.append(&top);+ let (preview, class) = match b["status"].as_str() {+ Some("needsInput") => (format!("✋ {}", b["activity"].as_str().filter(|s| !s.is_empty()).unwrap_or("Needs your approval")), "needs-text"),+ Some("working") => (b["activity"].as_str().filter(|s| !s.is_empty()).unwrap_or("Working…").to_owned(), "accent-text"),+ Some("error") => (b["lastMessage"].as_str().unwrap_or("Something went wrong").to_owned(), "error"),+ _ => (+ b["lastMessage"].as_str().map(str::to_owned).unwrap_or_else(|| format!("{} · {}", backend_name(&st, b["backend"].as_str().unwrap_or("")), folder(b["cwd"].as_str().unwrap_or("")))),+ "dim-label",+ ),+ };+ let bottom = gtk::Box::builder().spacing(6).build();+ bottom.append(>k::Label::builder().label(preview.replace('\n', " ")).xalign(0.0).hexpand(true).ellipsize(gtk::pango::EllipsizeMode::End).css_classes([class]).build());+ if unread > 0 {+ bottom.append(>k::Label::builder().label(unread.to_string()).css_classes(["badge"]).build());+ }+ text.append(&bottom);+ row_box.append(&text);+ let row = gtk::ListBoxRow::builder().child(&row_box).name(id).build();+ ui.roster.append(&row);+ if st.current.as_deref() == Some(id) {+ ui.roster.select_row(Some(&row));+ }+ }+}++fn is_chat(e: &Value) -> bool {+ match e["kind"].as_str() {+ Some("user" | "permission" | "notice") => true,+ Some("agent") => e["data"]["final"].as_bool().unwrap_or(false),+ _ => false,+ }+}++fn render_thread(ui: &App) {+ let st = ui.state.borrow();+ let Some(bot) = st.current.as_ref().and_then(|id| st.bots.get(id)) else {+ ui.content_stack.set_visible_child_name("empty");+ ui.chat_buttons.iter().for_each(|b| b.set_visible(false));+ ui.title.set_title("Codync");+ ui.title.set_subtitle("");+ return;+ };+ ui.content_stack.set_visible_child_name("chat");+ ui.chat_buttons.iter().for_each(|b| b.set_visible(true));+ let switched = ui.shown_bot.replace(bot["id"].as_str().unwrap_or_default().to_owned()) != bot["id"].as_str().unwrap_or_default();+ let near_bottom = switched || {+ let adj = ui.scroller.vadjustment();+ adj.upper() - adj.value() - adj.page_size() < 120.0+ };+ ui.title.set_title(bot["name"].as_str().unwrap_or(""));+ let sub = match bot["status"].as_str() {+ Some("needsInput") => "Needs you".to_owned(),+ Some("working") => "Working".to_owned(),+ _ => format!("{} · {}", backend_name(&st, bot["backend"].as_str().unwrap_or("")), folder(bot["cwd"].as_str().unwrap_or(""))),+ };+ ui.title.set_subtitle(&sub);+ while let Some(c) = ui.head_avatar.first_child() {+ ui.head_avatar.remove(&c);+ }+ ui.head_avatar.append(&avatar::widget(bot["avatarShape"].as_str().unwrap_or("blob"), bot["avatarColor"].as_str().unwrap_or("blue"), 28, working(bot), ""));++ while let Some(c) = ui.thread.first_child() {+ ui.thread.remove(&c);+ }+ let entries: Vec<&Value> = st.entries.get(bot["id"].as_str().unwrap_or_default()).map(|l| l.iter().filter(|e| is_chat(e)).collect()).unwrap_or_default();+ if entries.is_empty() {+ let intro = adw::StatusPage::builder()+ .title(bot["name"].as_str().unwrap_or(""))+ .description(format!("{} in {}\n\n{}\n\nTell it what you need.", backend_name(&st, bot["backend"].as_str().unwrap_or("")), bot["cwd"].as_str().unwrap_or(""), bot["description"].as_str().unwrap_or("")))+ .build();+ ui.thread.append(&intro);+ }+ let mut last_author = "";+ let mut last_time = 0i64;+ for e in entries {+ let at = e["createdAt"].as_i64().unwrap_or(0);+ if at - last_time > 3_600_000 {+ ui.thread.append(>k::Label::builder().label(ago(at)).css_classes(["small", "muted"]).margin_top(12).margin_bottom(6).build());+ last_author = "";+ }+ last_time = at;+ let kind = e["kind"].as_str().unwrap_or_default();+ let start = kind != last_author;+ last_author = if kind == "user" || kind == "agent" { kind } else { "" };+ match kind {+ "user" => ui.thread.append(&user_bubble(e, working(bot), start)),+ "agent" => ui.thread.append(&agent_bubble(e, bot, start)),+ "permission" => ui.thread.append(&permission_card(ui, &st, e)),+ _ => ui.thread.append(¬ice(e)),+ }+ }+ if working(bot) {+ let row = gtk::Box::builder().spacing(8).margin_top(10).build();+ row.append(&avatar::widget(bot["avatarShape"].as_str().unwrap_or("blob"), bot["avatarColor"].as_str().unwrap_or("blue"), 28, true, ""));+ let col = gtk::Box::new(gtk::Orientation::Vertical, 2);+ col.append(>k::Label::builder().label("•••").css_classes(["bubble", "bubble-agent", "muted"]).halign(gtk::Align::Start).build());+ let act = bot["activity"].as_str().filter(|s| !s.is_empty()).unwrap_or("Working…");+ col.append(>k::Label::builder().label(act).xalign(0.0).css_classes(["small", if bot["status"] == "needsInput" { "needs-text" } else { "dim-label" }]).build());+ row.append(&col);+ ui.thread.append(&row);+ }+ update_composer_for(ui, bot);+ if near_bottom {+ let adj = ui.scroller.vadjustment();+ // Twice: labels finish wrapping (and the height settles) one frame later.+ gtk::glib::idle_add_local_once(move || {+ adj.set_value(adj.upper());+ let adj2 = adj.clone();+ gtk::glib::timeout_add_local_once(std::time::Duration::from_millis(60), move || adj2.set_value(adj2.upper()));+ });+ }+}++fn user_bubble(e: &Value, bot_working: bool, start: bool) -> gtk::Widget {+ let col = gtk::Box::builder().orientation(gtk::Orientation::Vertical).halign(gtk::Align::End).margin_start(60).margin_top(if start { 12 } else { 2 }).build();+ col.append(>k::Label::builder().label(e["data"]["text"].as_str().unwrap_or("")).wrap(true).wrap_mode(gtk::pango::WrapMode::WordChar).selectable(true).xalign(0.0).css_classes(["bubble", "bubble-user"]).build());+ let status = match e["data"]["status"].as_str() {+ Some("sending") => "Sending…",+ Some("queued") if bot_working => "Waiting to send — it'll read this when it's done",+ Some("failed") => "Failed to send",+ Some("cancelled") => "Not sent — stopped",+ _ => "",+ };+ if !status.is_empty() {+ col.append(>k::Label::builder().label(status).css_classes(["small", "muted"]).halign(gtk::Align::End).build());+ }+ col.upcast()+}++fn agent_bubble(e: &Value, bot: &Value, start: bool) -> gtk::Widget {+ let row = gtk::Box::builder().spacing(8).margin_end(60).margin_top(if start { 12 } else { 2 }).build();+ if start {+ row.append(&avatar::widget(bot["avatarShape"].as_str().unwrap_or("blob"), bot["avatarColor"].as_str().unwrap_or("blue"), 28, false, ""));+ } else {+ row.append(>k::Box::builder().width_request(28).build());+ }+ let label = gtk::Label::builder()+ .use_markup(true)+ .label(markup::to_pango(e["data"]["text"].as_str().unwrap_or("")))+ .wrap(true)+ .wrap_mode(gtk::pango::WrapMode::WordChar)+ .selectable(true)+ .xalign(0.0)+ .css_classes(["bubble", "bubble-agent"])+ .valign(gtk::Align::End)+ .build();+ row.append(&label);+ row.upcast()+}++fn notice(e: &Value) -> gtk::Widget {+ let text = e["data"]["text"].as_str().unwrap_or("");+ let label = gtk::Label::builder().label(text).wrap(true).selectable(true).margin_top(10).build();+ match e["data"]["style"].as_str() {+ Some("error") => {+ label.add_css_class("notice-error");+ label.set_xalign(0.0);+ }+ _ => label.add_css_class("dim-label"),+ }+ label.upcast()+}++fn permission_card(ui: &App, st: &State, e: &Value) -> gtk::Widget {+ let d = &e["data"];+ let pending = d["status"] == "pending";+ let card = gtk::Box::builder().orientation(gtk::Orientation::Vertical).spacing(6).css_classes(["card"]).margin_start(36).margin_top(12).build();+ if pending {+ card.add_css_class("pending");+ }+ let headline = match d["toolKind"].as_str() {+ Some("execute") => "Wants to run a command",+ Some("edit" | "delete" | "move") => "Wants to change files",+ Some("fetch") => "Wants to access the web",+ Some("read" | "search") => "Wants to read files",+ _ => "Wants to use a tool",+ };+ card.append(>k::Label::builder().label(format!("✋ {headline}")).xalign(0.0).css_classes(["heading"]).build());+ card.append(>k::Label::builder().label(d["title"].as_str().unwrap_or("")).xalign(0.0).wrap(true).build());+ let host = st.hello["name"].as_str().unwrap_or("this computer");+ card.append(>k::Label::builder().label(format!("Runs on {host} · {}", folder(d["cwd"].as_str().unwrap_or("")))).xalign(0.0).css_classes(["small", "muted"]).build());+ let mut detail = String::new();+ if let Some(c) = d["command"].as_str() {+ detail.push_str(c);+ }+ for diff in d["diffs"].as_array().into_iter().flatten() {+ detail.push_str(&format!("\n{} +{} −{}\n{}", diff["path"].as_str().unwrap_or(""), diff["added"], diff["removed"], diff["patch"].as_str().unwrap_or("")));+ }+ if !detail.trim().is_empty() {+ let exp = gtk::Expander::new(Some("Details"));+ exp.set_child(Some(>k::Label::builder().label(detail.trim()).xalign(0.0).selectable(true).wrap(true).css_classes(["codebox"]).build()));+ card.append(&exp);+ }+ if pending {+ let buttons = gtk::FlowBox::builder().selection_mode(gtk::SelectionMode::None).max_children_per_line(4).column_spacing(8).row_spacing(8).homogeneous(true).build();+ let mut opts: Vec<&Value> = d["options"].as_array().into_iter().flatten().collect();+ let rank = |k: &str| match k { "allow_once" => 0, "allow_always" => 1, "reject_once" => 2, _ => 3 };+ opts.sort_by_key(|o| rank(o["kind"].as_str().unwrap_or("")));+ for o in opts {+ let kind = o["kind"].as_str().unwrap_or("");+ let label = match kind { "allow_once" => "Allow once", "allow_always" => "Always allow", "reject_once" => "Deny", "reject_always" => "Never", _ => o["name"].as_str().unwrap_or("OK") };+ let btn = gtk::Button::with_label(label);+ if kind == "allow_once" {+ btn.add_css_class("accent-fill");+ } else if kind.starts_with("reject") {+ btn.add_css_class("destructive-action");+ }+ let (entry_id, opt) = (e["id"].as_str().unwrap_or("").to_owned(), o["optionId"].clone());+ let ui2 = ui.clone();+ btn.connect_clicked(move |b| {+ b.set_sensitive(false);+ let ui3 = ui2.clone();+ client::call("respondPermission", json!({"entryId": entry_id, "optionId": opt}), move |r| {+ if let Err(e) = r {+ toast(&ui3, &e);+ }+ });+ });+ buttons.insert(&btn, -1);+ }+ card.append(&buttons);+ } else {+ let chosen = d["options"].as_array().into_iter().flatten().find(|o| o["optionId"] == d["selected"]);+ let outcome = match (d["status"].as_str(), chosen.and_then(|o| o["kind"].as_str())) {+ (Some("answered"), Some("allow_once")) => "Allowed once",+ (Some("answered"), Some("allow_always")) => "Always allowed",+ (Some("answered"), Some("reject_once")) => "Denied",+ (Some("answered"), _) => "Answered",+ (Some("cancelled"), _) => "Cancelled",+ _ => "Expired — the agent moved on",+ };+ card.append(>k::Label::builder().label(outcome).xalign(0.0).css_classes(["small", "dim-label"]).build());+ }+ card.upcast()+}++fn update_composer(ui: &App) {+ let st = ui.state.borrow();+ if let Some(bot) = st.current.as_ref().and_then(|id| st.bots.get(id)) {+ update_composer_for(ui, bot);+ }+}++fn update_composer_for(ui: &App, bot: &Value) {+ let buf = ui.composer.buffer();+ let has_text = !buf.text(&buf.start_iter(), &buf.end_iter(), false).trim().is_empty();+ ui.stop_btn.set_visible(working(bot) && !has_text);+ ui.send_btn.set_visible(!working(bot) || has_text);+ ui.send_btn.set_sensitive(has_text);+}++fn send(ui: &App) {+ let buf = ui.composer.buffer();+ let text = buf.text(&buf.start_iter(), &buf.end_iter(), false).trim().to_owned();+ let Some(bot) = ui.state.borrow().current.clone() else { return };+ if text.is_empty() {+ return;+ }+ buf.set_text("");+ let nonce = uuid::Uuid::new_v4().to_string();+ upsert(+ &mut ui.state.borrow_mut(),+ json!({"id": format!("local-{nonce}"), "seq": i64::MAX, "botId": bot, "rev": 0, "kind": "user", "turn": 0,+ "data": {"text": text, "status": "sending", "clientNonce": nonce}, "createdAt": now_ms(), "updatedAt": 0}),+ );+ schedule(ui);+ let ui2 = ui.clone();+ client::call("send", json!({"botId": bot, "text": text, "clientNonce": nonce}), move |r| {+ let mut st = ui2.state.borrow_mut();+ match r {+ Ok(v) => upsert(&mut st, v["entry"].clone()),+ Err(_) => {+ if let Some(e) = st.entries.get_mut(&bot).and_then(|l| l.iter_mut().find(|e| e["id"] == format!("local-{nonce}"))) {+ e["data"]["status"] = "failed".into();+ }+ }+ }+ drop(st);+ schedule(&ui2);+ });+}++fn now_ms() -> i64 {+ std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).unwrap().as_millis() as i64+}++pub fn mark_read(ui: &App) {+ let st = ui.state.borrow();+ if let Some(bot) = st.current.as_ref().and_then(|id| st.bots.get(id))+ && bot["unread"].as_i64().unwrap_or(0) > 0+ {+ client::call("markRead", json!({"botId": bot["id"]}), |_| {});+ }+}++pub fn toast(ui: &App, text: &str) {+ ui.toasts.add_toast(adw::Toast::new(text));+}