diff --git a/apps/nova-desktop/.gitignore b/apps/nova-desktop/.gitignore index 07fb9af1..34fa0d1a 100644 --- a/apps/nova-desktop/.gitignore +++ b/apps/nova-desktop/.gitignore @@ -1,5 +1,5 @@ -dist/ node_modules/ +dist/ src-tauri/target/ -src-tauri/gen/ src-tauri/binaries/ +src-tauri/native/ diff --git a/apps/nova-desktop/README.md b/apps/nova-desktop/README.md index fd7b8a81..10559c4b 100644 --- a/apps/nova-desktop/README.md +++ b/apps/nova-desktop/README.md @@ -1,88 +1,85 @@ -# Nova Desktop — development preview +# Nova Desktop -Nova is a Tauri/Rust desktop coding workspace with a React frontend and an app-owned Bun service. It stays separate from Jarvis. Nova Web remains authoritative for hosted conversations, agents, automations, approvals, integrations, usage, and billing. +Local Tauri v2 implementation of Nova Web. **Full product parity is not verified and this is not a completed release.** The latest local sign-in callback fix passes boundary tests but still needs a real browser-to-desktop test. No hosted authentication deployment is required by the current design. Hosted services remain unchanged, as requested. -## Run from the checkout +The desktop bundles the actual Nova Web components and styles. Next APIs, account data, billing, integrations, and agent admission stay hosted. A compiled Bun gateway retains signed web/harness cookies in the OS keyring and forwards the existing API streams. The CLI workspace engine, computer device worker, and local Codex companion execute locally. See [architecture](docs/ARCHITECTURE.md), [parity inventory](docs/PARITY.md), and [validation](docs/VALIDATION.md). + +From the monorepo root: ```sh bun install -bun run --cwd apps/nova-desktop tauri dev +bun run --cwd apps/nova-desktop dev ``` -Development needs Rust and Bun. Cloud features need the hosted desktop workspace, turn, feature, and approval routes and the existing local-workspace-binding migration. Deployment and live native UI verification were deferred by the user; they have not been performed during this implementation pass. - -## Projects and local work +Requires Rust, Xcode command-line tools on macOS, and Cua Driver 0.62.1 at build time. Set `NOVA_CUA_DRIVER=/absolute/path/to/cua-driver` if it is not at `~/.local/bin/cua-driver`. Codex 0.173.0 is pinned in the workspace and copied with its vendor resources. The packaged application includes these runtimes and does not need Bun, Node, Codex, Cua, or a development checkout installed. Local Git operations require system Git; PR publishing uses the existing companion's `gh` authentication. -- Open a folder through the native picker. Access lasts for this service launch and can be revoked from the workspace panel. A remembered path or imported Swift preference never grants filesystem access. -- Initialize a non-Git folder explicitly, or select the current checkout or a new isolated worktree with a starting branch and optional new branch name. Worktrees require an existing commit. No initialization step makes an automatic first commit. -- Project-backed cloud turns share up to 4,000 readable paths and eight prompt-ranked text files, each at most 32,000 UTF-8 bytes. The workspace engine excludes Git-ignored files, `.env` secrets, symlinks, binary files and oversized sources. `.env.example` is intentionally readable. These source-packing protections apply to cloud project context; local Codex has a separate permission scope below. -- Browse files and queue up to eight creations, edits and deletions for one explicit diff review. Existing files are limited to 32,000 UTF-8 bytes; replacement text totals at most 24,000 bytes. Five-minute, single-use previews recheck exact file contents/modes and Git HEAD/branch/index before application, preserving staging. Ignored files, secrets, unsafe paths and linked files are rejected. An interrupted application blocks edits/publication until you inspect and explicitly keep the current files; it is never replayed automatically. No general terminal is exposed. -- Review commit/push/PR publication before confirming it. Existing staging blocks publication. Only selected files enter the commit; previews recheck Git state, contents and targets. Publication uses `origin`; PR creation requires GitHub CLI authentication. An uncertain result is not retried automatically. -- Reopen the original root after service restart. Missing or changed bindings block the turn. The health monitor clears stale project grants after a service replacement. +`dev` builds the frontend and sidecar, then runs the local native app under Tauri’s development process in your terminal. `dev:signed` builds and launches a certificate-signed debug Nova.app on macOS for privacy permission testing; it uses APPLE_SIGNING_IDENTITY, or the single installed Apple Development identity. Quit the running Nova instance before switching modes. For frontend iteration in another terminal, use `bun run --cwd apps/nova-desktop watch:frontend`, then reload Nova with Cmd+R. Both development and packaged builds use `http://127.0.0.1:47831`; close the other instance first. Native instance activation focuses an already-running application. -### Local Codex tasks +Production packaging: -The workspace panel can discover models and run a real read-only task through an installed, signed-in Codex CLI. The native confirmation names the model, workspace and task. **Codex's read-only sandbox can read device files beyond the project.** It is a distinct opt-in from bounded cloud source sharing. Writes and escalation requests are denied, network access for sandboxed commands is disabled, and MCP servers are disabled. Local Codex uses its existing ChatGPT login; Nova neither imports nor signs out that account. Conversations are ephemeral in Codex and their bounded output is recorded in Nova's local journal. +```sh +bun run --cwd apps/nova-desktop package +``` -Execution is absent from GraphQL: Rust must approve a single-use, account-bound preview through a native dialog before the local endpoint starts it. Task results and tool status appear in the conversation. Stopping a local task requests termination of its dedicated process; cross-platform descendant-process shutdown still needs live validation. **Stop viewing** on cloud turns only stops observation; the hosted run may continue. +Packaging signs Nova, its helpers, and the native Install Nova.app using APPLE_SIGNING_IDENTITY (or the single installed Apple Development identity). The DMG contains Install Nova.app: open it to see the responsive video installer, then choose Install Nova. The installer defaults to /Applications, supports another location, and asks before replacing an existing app. It validates signatures before replacing the old copy. Finder itself does not display the video; mounting a DMG cannot automatically launch an executable. -## Accounts and preferences +macOS arm64 outputs: -Desktop device-login credentials are stored by Rust in the macOS Keychain or Windows Credential Store. Credentials move between Rust and the local service over private bootstrap/native requests and never return through GraphQL. Nova no longer automatically borrows the CLI token. Settings → Profile offers an explicit CLI import; signing out of an imported login preserves the original CLI session. +- `apps/nova-desktop/src-tauri/target/release/bundle/macos/Nova.app` +- `apps/nova-desktop/src-tauri/target/release/bundle/dmg/Nova_0.2.0_aarch64.dmg` -Sign-out removes local credentials and project grants, stops local agents/observation, and attempts to revoke the current desktop-owned session through the terminal server's new `/api/desktop/session/revoke` route. Failed or undeployed revocation is shown as unconfirmed. Expired credentials require sign-in again; refresh-token rotation is not implemented. +The package command uses certificate signing; direct Tauri builds still default to ad-hoc signing. Public distribution requires a Developer ID Application identity and Apple notarization credentials; Apple Development builds are for testing. Notarization is not configured on this machine. Windows/Linux packaging has not been validated. -General/Appearance settings persist the default cloud model, chat text size, Enter-to-send and reduced-motion preference on this device. macOS can preview importing the old Supercode Desktop `selectedModel` preference if it is one of Nova's supported cloud models. Apply explicitly, or undo the last import. A versioned backup and stale-preference checks prevent rollback from overwriting subsequent edits. Credentials, conversations, folder bookmarks, permission approvals and OpenCode profiles are preserved in the original app and are not imported. +Verification: -## Features +```sh +bun run --cwd apps/nova-desktop typecheck +bun run --cwd apps/nova-desktop test +cargo check --manifest-path apps/nova-desktop/src-tauri/Cargo.toml +cargo test --manifest-path apps/nova-desktop/src-tauri/Cargo.toml +bun apps/nova-desktop/scripts/smoke-sidecar.ts \ + apps/nova-desktop/src-tauri/target/release/bundle/macos/Nova.app/Contents/MacOS/nova-service \ + apps/nova-desktop/src-tauri/target/release/bundle/macos/Nova.app/Contents/Resources/ui \ + apps/nova-desktop/src-tauri/target/release/bundle/macos/Nova.app/Contents/Resources/native/codex/bin/codex +``` -Desktop data pages read real hosted agents, automations, pull requests, connections, activity, usage and billing. Agents can be created or archived. Weekly automations are created paused, run as the authenticated user, and can be enabled or paused after confirmation. Existing weekly schedules can be edited and active automations can be run manually. Pull request details include bounded, read-only file diffs. Connection OAuth controls, provider credential management, document attachments and other Web features still need parity work. An unavailable route is shown as an error rather than an empty successful page. +The packaged smoke test uses a temporary home and Git repository. It verifies real worktree isolation and the bundled Codex RPC account boundary, without signing into a real provider or publishing anything. -The composer supports Chat, Plan and project-bound Agent mode through the hosted turn engine. Agent file proposals require an explicit workspace preview and review before application. Users can attach selected text files and images and choose enabled hosted providers and models; credentials remain on the server. These features require the updated hosted desktop routes to be deployed. Provider connections are managed in Nova Web. +## Computer use -## Recovery and storage +For macOS permission testing, use `bun run --cwd apps/nova-desktop dev:signed`. This launches a certificate-signed bundle. The bare development executable can inherit the launching terminal’s privacy identity, and ad-hoc builds can invalidate grants when rebuilt. After switching from an old ad-hoc build, grant access to the signed Nova.app once; subsequent builds signed with the same certificate retain that identity. -Run observations have stable event IDs/cursors and versioned snapshots in `~/.nova/desktop/runs`. Delivered cursors are saved before acknowledgement; completion is saved without resubmitting a request. The frontend reconnects to the same cursor with backoff. Local completion/cancellation waits for owned process shutdown; an unconfirmed shutdown stays explicit across restart. Cloud Stop viewing stops observation and does not cancel hosted work. Awaiting-input observations remain distinct from completed tasks. After restart, unfinished observations become interrupted and uncertain hosted work is never replayed. +Open **Settings → Computer use** in Nova Desktop. The **This Mac** card checks account registration, Accessibility, and Screen Recording using the bundled driver. No companion installation, pairing code, or project folder is required. Run the bundled **Nova.app**, then use **Request access** to register Nova in macOS’s permission lists and grant the required permissions, then **Refresh checks**. macOS may require you to quit and reopen Nova after changing permissions. -Journals retain at most 50 runs for seven days during active use. They contain prompt/reply text, use private file permissions, and are not encrypted by Nova. Version 2 journals belong to a verified issuer/user identity cached privately with the credential, so the same account can recover them after token rotation. Another account cannot read or stop them. Legacy token-owned journals migrate only with the exact original token and verified identity. Hosted conversation history remains authoritative. Preferences and an optional import backup live beside the journal; workspace manifests live in `~/.nova/worktrees`. Project grants and actionable review approvals are per-launch. Private patch snapshots in the workspace registry expire after five minutes and are pruned on subsequent previews, with at most 100 retained snapshots. Active interrupted-apply records remain until acknowledged. Filesystem application is not crash-atomic. +Choose **Enable computer use** to allow control, then send `/computer-use ` in chat. Computer tasks use Nova’s Supercode harness even when a local coding agent is selected. Accessibility is required for reading controls, clicking, and typing; Screen Recording is required for captures. Checking permissions does not enable control or grant permissions. The local service reports registration failures directly, including an unavailable hosted computer API. -The native host monitors child health, restarts dead children on a later request, applies startup backoff, and prevents duplicate desktop instances. The private parent pipe stays open; its closure stops the service. Graceful shutdown interrupts observations/local agents before closing connections, with a bounded native kill fallback. Multiple-instance UI behavior, hard crashes and forced termination still need platform walkthroughs. +## Local Cursor Agent -## Build a preview +Nova detects an existing `cursor-agent` installation from PATH, `~/.local/bin`, or `~/.cursor/bin`. The Cursor editor's `cursor` launcher alone is not the agent CLI. Install the Cursor CLI separately if needed and run `cursor-agent login` in a terminal. Nova delegates authentication to the CLI without copying its credential files or requiring a Cursor Cloud API key. -```sh -bun run --cwd apps/nova-desktop package -``` +In **Settings → Models → Your connections**, click **Refresh local agents**, then enable **Cursor Agent · Local**. Enabling a provider never opens a folder picker or requires a Codex login. If Cursor rejects requests with an authentication error, use **Sign in to Cursor** in the connections list to reauthorize the CLI in your browser. Select **Local agents → Cursor Agent · CLI default** in the chat model picker. Requests use the selected project workspace when available, or Nova’s own `~/.nova/local-agent-workspace` folder for chat without a project. Requests use Cursor's configured default model and tool permissions, including file edits and commands when allowed. Nova does not force-approve tools. Cursor account limits still apply; sign-in, permission and usage failures appear in chat. Stop cancels the running CLI process. Local conversation history is held in memory and is lost on reload. -The separate bundle config enables bundling and embeds `nova-service` plus the pinned computer-control runtime; the default config stays convenient for checkout development. The build compiles a standalone Bun executable without runtime `.env`, Bun config, package or TypeScript config autoloading. The release host launches the sibling executable and needs neither a checkout nor globally installed Bun. +## Sign-in handoff -The package command and CI provision Cua Driver 0.62.1 from checksum-pinned upstream release archives into generated app resources. Both Mac architectures use the universal binary. Nova launches it in direct embedded mode, so neither a global driver nor CuaDriver.app is required. macOS still requires Nova’s Accessibility permission for computer use. For checkout development, run `bun run --cwd apps/nova-desktop computer:provision` once. `NOVA_CUA_ARCHIVE` can supply an offline archive (the same checksum is required); `APPLE_SIGNING_IDENTITY` signs the Mac runtime, with ad-hoc signing for previews. +Nova Web sends users to the CLI client's existing GitHub sign-in page. Desktop starts a temporary loopback listener at one of the already-supported Nova local origins (`http://nova.localhost:3003`, falling back to port 3000). A short-lived HttpOnly browser cookie binds the returned one-time token to the pending desktop sign-in attempt. The gateway redeems it through Nova Web's existing `/api/auth/cli/callback`, keeping signed web and harness cookies out of the frontend. -Standalone sidecar builds require Bun 1.4.5 or newer; CI pins 1.4.5. The root workspace package-manager declaration is preserved. +This uses the existing deployed sign-in page and does not require the previously proposed hosted callback/capability changes. The real browser handoff and transition into Nova's main workspace remain unverified after this latest fix. -The build script accepts `aarch64-apple-darwin`, `x86_64-apple-darwin`, or `x86_64-pc-windows-msvc`. macOS arm64 compilation, standalone service smoke tests, and `.app` bundling have been exercised locally. The new CI matrix covers native builds for all three targets; CI and Windows execution have not yet been run. Git is still required for project operations; GitHub CLI and Codex are optional prerequisites for their respective features. +The new Nova `/api/nova/client-actions` route also needs deployment for the five server actions used by connected repositories and pull-request screens. It calls the existing authenticated functions; it does not introduce separate review business logic. -The output is an unsigned development preview. Signing, notarization, signed updates, clean-machine installation, Windows verification, and rollout approval remain release gates. No release was published. +Service logs: `~/Library/Logs/ai.supercode.nova/service.log` on macOS. Native folder grants must be re-established after restart. Sessions and user preferences retain their existing hosted and local persistence. Live authentication, a real agent turn, cancellation, approvals, restart recovery, computer permissions, external integrations, and authenticated visual comparisons remain release gates, listed individually in the parity checklist. -## Verification +## Background media -```sh -bun run --cwd apps/nova-desktop build -bun run --cwd packages/nova typecheck -bun run --cwd packages/nova-runtime typecheck -bun run --cwd apps/web typecheck -bun run --cwd apps/supercode-cli/server typecheck -bun test apps/supercode-cli/server/src/nova/desktop-*.test.ts packages/nova/desktop.test.ts -bun test apps/supercode-cli/server/src/nova/local-codex.test.ts apps/supercode-cli/server/src/nova/workspaces/git.test.ts apps/supercode-cli/server/src/nova/workspaces/patch.test.ts -cd apps/nova-desktop/src-tauri -cargo fmt --check -cargo test --locked --offline -``` +Nova Web and Desktop share `/nova/site-bg.mp4`, an optimized 1080p copy of the supplied video, with `/nova/site-bg-poster.jpg` as fallback. Playback pauses when the page is hidden or reduced motion is enabled. Appearance settings retain ASCII and original-image modes. The DMG contains Install Nova.app, which uses the same video and poster in its resizable native window. -Loopback tests need local port access. Tests use temporary repositories and injected hosted/agent dependencies; they do not create real hosted agents or automations, use production credentials, or migrate a database. Native credential storage and confirmation dialogs require the deferred interactive walkthrough. +To regenerate the media from the original clip, run `bun apps/nova-desktop/scripts/prepare-background.ts /path/to/site-bg.mp4`. The conversion removes the original clip’s black matte before producing the responsive cover video and poster. The custom installer uses an AVPlayerLayer with resizeAspectFill, updates its frame on every layout pass, and displays the poster when Reduce Motion is enabled. It supports windows from 640 × 460 upward. The still image remains available for direct Tauri DMG builds, but the package command uses the custom installer instead. -## Web account permission flow +Installer checks (macOS): -Choose **Connect this Mac** in Nova web computer-use settings. The `nova-computer` app link opens a native approval dialog identifying the requesting web account. Approving links computer use to that account without switching the desktop login, then asks macOS for Nova’s Accessibility permission. Browser-only installation cannot provide OS control; the updated Nova desktop app must be installed and running. The hosted window also routes these connection URLs to the native dialog without granting remote IPC access. +```sh +swiftc -module-cache-path /tmp/nova-installer-swift-cache apps/nova-desktop/installer/Installation.swift apps/nova-desktop/installer/tests/main.swift -o /tmp/nova-installer-tests +/tmp/nova-installer-tests +``` -The deep-link plugin registers the scheme in packaged apps. Native parsing accepts only one random connection code, never an arbitrary server URL. Windows registers configured schemes at startup. On macOS, install the packaged `.app` to register its URL scheme with Launch Services. Stop suspends actions; **Disconnect computer** revokes the web account’s device access. Keys for an approved link persist privately and remain separate from the desktop login. +These tests install signed fixture apps into a temporary folder and verify approved replacement, refusal without approval, signature failures, and cleanup. They never modify /Applications. diff --git a/apps/nova-desktop/index.html b/apps/nova-desktop/index.html index 69c45a10..0c036384 100644 --- a/apps/nova-desktop/index.html +++ b/apps/nova-desktop/index.html @@ -1,13 +1 @@ - - - - - - Nova - - -
Loading Nova…
- - - - +Nova
diff --git a/apps/nova-desktop/installer/Installation.swift b/apps/nova-desktop/installer/Installation.swift new file mode 100644 index 00000000..8fea312c --- /dev/null +++ b/apps/nova-desktop/installer/Installation.swift @@ -0,0 +1,65 @@ +import Foundation + +enum InstallationError: LocalizedError { + case invalidPayload + case alreadyInstalled + case invalidDestination + + var errorDescription: String? { + switch self { + case .invalidPayload: return "The Nova application is missing or damaged. Download the installer again." + case .alreadyInstalled: return "Nova is already installed in this location." + case .invalidDestination: return "Choose an Applications folder outside the installer." + } + } +} + +enum Installation { + static func validate(_ application: URL) throws { + guard Bundle(url: application)?.bundleIdentifier == "ai.supercode.nova" else { + throw InstallationError.invalidPayload + } + let verifier = Process() + verifier.executableURL = URL(fileURLWithPath: "/usr/bin/codesign") + verifier.arguments = ["--verify", "--deep", "--strict", application.path] + verifier.standardOutput = FileHandle.nullDevice + verifier.standardError = FileHandle.nullDevice + try verifier.run() + verifier.waitUntilExit() + guard verifier.terminationStatus == 0 else { throw InstallationError.invalidPayload } + } + + static func install(source: URL, directory: URL, replace: Bool) throws -> URL { + let files = FileManager.default + let folder = directory.resolvingSymlinksInPath().standardizedFileURL + let payload = source.resolvingSymlinksInPath().standardizedFileURL + guard !folder.path.hasPrefix("/Volumes/"), + !folder.pathComponents.contains(where: { $0.hasSuffix(".app") }), + folder != payload else { throw InstallationError.invalidDestination } + var isDirectory: ObjCBool = false + guard files.fileExists(atPath: folder.path, isDirectory: &isDirectory), isDirectory.boolValue else { + throw InstallationError.invalidDestination + } + let destination = folder.appendingPathComponent("Nova.app") + if files.fileExists(atPath: destination.path), !replace { throw InstallationError.alreadyInstalled } + let nonce = UUID().uuidString + let staged = folder.appendingPathComponent(".Nova-install-\(nonce).app") + let backup = folder.appendingPathComponent(".Nova-backup-\(nonce).app") + defer { try? files.removeItem(at: staged) } + try validate(payload) + try files.copyItem(at: payload, to: staged) + try validate(staged) + // Keep the previous app intact until the complete, verified copy is ready. + let existing = files.fileExists(atPath: destination.path) + if existing && !replace { throw InstallationError.alreadyInstalled } + if existing { try files.moveItem(at: destination, to: backup) } + do { + try files.moveItem(at: staged, to: destination) + } catch { + if existing { try? files.moveItem(at: backup, to: destination) } + throw error + } + if existing { try? files.removeItem(at: backup) } + return destination + } +} diff --git a/apps/nova-desktop/installer/InstallerWindow.swift b/apps/nova-desktop/installer/InstallerWindow.swift new file mode 100644 index 00000000..382ab90d --- /dev/null +++ b/apps/nova-desktop/installer/InstallerWindow.swift @@ -0,0 +1,204 @@ +import AppKit +import AVFoundation + +@MainActor +final class InstallerBackground: NSView { + private let poster = CALayer() + private let playerLayer = AVPlayerLayer() + private let shade = CAGradientLayer() + private let player = AVQueuePlayer() + private var looper: AVPlayerLooper? + private var observer: NSObjectProtocol? + + init(resources: URL) { + super.init(frame: .zero) + wantsLayer = true + layer?.backgroundColor = NSColor.black.cgColor + poster.contents = NSImage(contentsOf: resources.appendingPathComponent("site-bg-poster.jpg"))?.cgImage(forProposedRect: nil, context: nil, hints: nil) + poster.contentsGravity = .resizeAspectFill + poster.masksToBounds = true + layer?.addSublayer(poster) + playerLayer.player = player + playerLayer.videoGravity = .resizeAspectFill + playerLayer.masksToBounds = true + layer?.addSublayer(playerLayer) + shade.colors = [NSColor.black.withAlphaComponent(0.4).cgColor, NSColor.black.withAlphaComponent(0.75).cgColor] + layer?.addSublayer(shade) + player.isMuted = true + let item = AVPlayerItem(url: resources.appendingPathComponent("site-bg.mp4")) + looper = AVPlayerLooper(player: player, templateItem: item) + observer = NSWorkspace.shared.notificationCenter.addObserver(forName: NSWorkspace.accessibilityDisplayOptionsDidChangeNotification, object: nil, queue: .main) { [weak self] _ in + MainActor.assumeIsolated { self?.updatePlayback() } + } + updatePlayback() + } + + required init?(coder: NSCoder) { nil } + + func updatePlayback(visible: Bool = true) { + let reduced = NSWorkspace.shared.accessibilityDisplayShouldReduceMotion + playerLayer.isHidden = reduced + if reduced || !visible { player.pause() } else { player.play() } + } + + override func layout() { + super.layout() + CATransaction.begin() + CATransaction.setDisableActions(true) + poster.frame = bounds + playerLayer.frame = bounds + shade.frame = bounds + CATransaction.commit() + } +} + +@MainActor +final class InstallerWindow: NSObject, NSWindowDelegate { + let window: NSWindow + private let resources: URL + private let background: InstallerBackground + private let status = NSTextField(wrappingLabelWithString: "Install Nova to your Applications folder.") + private let progress = NSProgressIndicator() + private let installButton = NSButton(title: "Install Nova", target: nil, action: nil) + private let locationButton = NSButton(title: "Choose location…", target: nil, action: nil) + private var directory = URL(fileURLWithPath: "/Applications", isDirectory: true) + private var installed: URL? + private var installing = false + var canQuit: Bool { !installing } + + init(resources: URL) { + self.resources = resources + background = InstallerBackground(resources: resources) + window = NSWindow(contentRect: NSRect(x: 0, y: 0, width: 820, height: 540), styleMask: [.titled, .closable, .miniaturizable, .resizable, .fullSizeContentView], backing: .buffered, defer: false) + super.init() + window.title = "Install Nova" + window.titleVisibility = .hidden + window.titlebarAppearsTransparent = true + window.backgroundColor = .black + window.minSize = NSSize(width: 640, height: 460) + window.isReleasedWhenClosed = false + window.delegate = self + window.contentView = background + + let icon = NSImageView() + icon.image = NSImage(contentsOf: resources.appendingPathComponent("Nova.icns")) + icon.imageScaling = .scaleProportionallyUpOrDown + icon.setAccessibilityLabel("Nova") + icon.widthAnchor.constraint(equalToConstant: 80).isActive = true + icon.heightAnchor.constraint(equalToConstant: 80).isActive = true + let title = NSTextField(labelWithString: "Welcome to Nova") + title.font = .systemFont(ofSize: 34, weight: .medium) + title.textColor = .white + title.alignment = .center + status.font = .systemFont(ofSize: 15) + status.textColor = NSColor.white.withAlphaComponent(0.85) + status.alignment = .center + progress.style = .spinning + progress.controlSize = .small + progress.isDisplayedWhenStopped = false + installButton.target = self + installButton.action = #selector(install) + installButton.bezelStyle = .rounded + installButton.controlSize = .large + installButton.keyEquivalent = "\r" + installButton.contentTintColor = .white + locationButton.target = self + locationButton.action = #selector(chooseLocation) + locationButton.bezelStyle = .inline + locationButton.contentTintColor = NSColor.white.withAlphaComponent(0.85) + let stack = NSStackView(views: [icon, title, status, progress, installButton, locationButton]) + stack.orientation = .vertical + stack.alignment = .centerX + stack.spacing = 18 + stack.translatesAutoresizingMaskIntoConstraints = false + background.addSubview(stack) + NSLayoutConstraint.activate([ + stack.centerXAnchor.constraint(equalTo: background.centerXAnchor), + stack.centerYAnchor.constraint(equalTo: background.centerYAnchor, constant: 8), + stack.widthAnchor.constraint(equalTo: background.widthAnchor, multiplier: 0.8), + status.widthAnchor.constraint(equalTo: stack.widthAnchor), + installButton.widthAnchor.constraint(greaterThanOrEqualToConstant: 190), + ]) + window.center() + } + + @objc private func chooseLocation() { + let panel = NSOpenPanel() + panel.title = "Choose where to install Nova" + panel.prompt = "Choose folder" + panel.canChooseDirectories = true + panel.canChooseFiles = false + panel.allowsMultipleSelection = false + panel.canCreateDirectories = true + panel.directoryURL = directory + panel.beginSheetModal(for: window) { [weak self] response in + guard response == .OK, let url = panel.url, let self else { return } + self.directory = url + self.status.stringValue = "Install Nova in \(url.path)." + } + } + + @objc private func install() { + if let installed { + NSWorkspace.shared.openApplication(at: installed, configuration: NSWorkspace.OpenConfiguration()) { [weak self] _, error in + DispatchQueue.main.async { + if let error { self?.status.stringValue = "Nova couldn’t open: \(error.localizedDescription)" } + else { NSApp.terminate(nil) } + } + } + return + } + guard !installing else { return } + let destination = directory.appendingPathComponent("Nova.app") + if NSRunningApplication.runningApplications(withBundleIdentifier: "ai.supercode.nova").contains(where: { $0.bundleURL?.standardizedFileURL == destination.standardizedFileURL }) { + showError("Quit Nova before replacing the installed app, then try again.") + return + } + let exists = FileManager.default.fileExists(atPath: destination.path) + if exists { + let alert = NSAlert() + alert.messageText = "Replace the existing Nova app?" + alert.informativeText = "This replaces only Nova.app in \(directory.path). Your conversations and settings are kept." + alert.addButton(withTitle: "Replace Nova") + alert.addButton(withTitle: "Cancel") + guard alert.runModal() == .alertFirstButtonReturn else { return } + } + installing = true + installButton.isEnabled = false + locationButton.isEnabled = false + status.stringValue = "Installing Nova…" + progress.startAnimation(nil) + let source = resources.appendingPathComponent("Nova.app") + let folder = directory + Task { + do { + let result = try await Task.detached(priority: .userInitiated) { + try Installation.install(source: source, directory: folder, replace: exists) + }.value + installed = result + status.stringValue = "Nova is installed and ready to open." + installButton.title = "Open Nova" + locationButton.isHidden = true + } catch { + status.stringValue = "Installation couldn’t finish. Try another location or check folder permissions." + showError(error.localizedDescription) + locationButton.isEnabled = true + } + installing = false + progress.stopAnimation(nil) + installButton.isEnabled = true + } + } + + private func showError(_ message: String) { + let alert = NSAlert() + alert.messageText = "Nova couldn’t be installed" + alert.informativeText = message + alert.addButton(withTitle: "OK") + alert.beginSheetModal(for: window) + } + + func windowShouldClose(_ sender: NSWindow) -> Bool { !installing } + func windowDidMiniaturize(_ notification: Notification) { background.updatePlayback(visible: false) } + func windowDidDeminiaturize(_ notification: Notification) { background.updatePlayback() } +} diff --git a/apps/nova-desktop/installer/main.swift b/apps/nova-desktop/installer/main.swift new file mode 100644 index 00000000..e676873a --- /dev/null +++ b/apps/nova-desktop/installer/main.swift @@ -0,0 +1,33 @@ +import AppKit + +@MainActor +final class InstallerDelegate: NSObject, NSApplicationDelegate { + private var controller: InstallerWindow? + + func applicationDidFinishLaunching(_ notification: Notification) { + guard let resources = Bundle.main.resourceURL else { NSApp.terminate(nil); return } + let menu = NSMenu() + let appItem = NSMenuItem() + let appMenu = NSMenu() + appMenu.addItem(withTitle: "Quit Install Nova", action: #selector(NSApplication.terminate(_:)), keyEquivalent: "q") + appItem.submenu = appMenu + menu.addItem(appItem) + NSApp.mainMenu = menu + controller = InstallerWindow(resources: resources) + controller?.window.makeKeyAndOrderFront(nil) + NSApp.activate(ignoringOtherApps: true) + } + + func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { true } + func applicationShouldTerminate(_ sender: NSApplication) -> NSApplication.TerminateReply { + controller?.canQuit == false ? .terminateCancel : .terminateNow + } +} + +MainActor.assumeIsolated { + let application = NSApplication.shared + let delegate = InstallerDelegate() + application.delegate = delegate + application.setActivationPolicy(.regular) + withExtendedLifetime(delegate) { application.run() } +} diff --git a/apps/nova-desktop/installer/tests/main.swift b/apps/nova-desktop/installer/tests/main.swift new file mode 100644 index 00000000..0d0734ef --- /dev/null +++ b/apps/nova-desktop/installer/tests/main.swift @@ -0,0 +1,63 @@ +import Foundation + +let files = FileManager.default +let root = files.temporaryDirectory.appendingPathComponent("nova-install-test-\(UUID().uuidString)") +try files.createDirectory(at: root, withIntermediateDirectories: true) +defer { try? files.removeItem(at: root) } +let source = root.appendingPathComponent("Payload.app") +let destination = root.appendingPathComponent("Applications") +try files.createDirectory(at: source.appendingPathComponent("Contents/Resources"), withIntermediateDirectories: true) +try files.createDirectory(at: source.appendingPathComponent("Contents/MacOS"), withIntermediateDirectories: true) +try files.createDirectory(at: destination, withIntermediateDirectories: true) +try files.copyItem(at: URL(fileURLWithPath: "/usr/bin/true"), to: source.appendingPathComponent("Contents/MacOS/Nova")) +let plist: [String: Any] = ["CFBundleIdentifier": "ai.supercode.nova", "CFBundleExecutable": "Nova", "CFBundlePackageType": "APPL"] +try PropertyListSerialization.data(fromPropertyList: plist, format: .xml, options: 0).write(to: source.appendingPathComponent("Contents/Info.plist")) + +func sign() throws { + let process = Process() + process.executableURL = URL(fileURLWithPath: "/usr/bin/codesign") + process.arguments = ["--force", "--sign", "-", source.path] + try process.run() + process.waitUntilExit() + precondition(process.terminationStatus == 0, "Could not sign fixture") +} +func assertMarker(_ app: URL, _ expected: String) throws { + let actual = try String(contentsOf: app.appendingPathComponent("Contents/Resources/marker"), encoding: .utf8) + precondition(actual == expected) +} +func expectFailure(_ operation: () throws -> Void) { + do { try operation(); fatalError("Expected operation to fail") } catch {} +} + +try Data("first".utf8).write(to: source.appendingPathComponent("Contents/Resources/marker")) +try sign() +let installed = try Installation.install(source: source, directory: destination, replace: false) +try assertMarker(installed, "first") +print("PASS: signed app installs into selected folder") +expectFailure { _ = try Installation.install(source: source, directory: destination, replace: false) } +try assertMarker(installed, "first") +print("PASS: existing app is preserved without replacement approval") + +try Data("second".utf8).write(to: source.appendingPathComponent("Contents/Resources/marker")) +try sign() +_ = try Installation.install(source: source, directory: destination, replace: true) +try assertMarker(installed, "second") +print("PASS: replacement installs verified new payload") + +try Data("tampered".utf8).write(to: source.appendingPathComponent("Contents/Resources/marker")) +expectFailure { _ = try Installation.install(source: source, directory: destination, replace: true) } +try assertMarker(installed, "second") +print("PASS: damaged payload cannot replace an existing app") +expectFailure { _ = try Installation.install(source: source, directory: source, replace: true) } +expectFailure { _ = try Installation.install(source: source, directory: root.appendingPathComponent("Missing"), replace: true) } +let leftovers = try files.contentsOfDirectory(atPath: destination.path).filter { $0.hasPrefix(".Nova-") } +precondition(leftovers.isEmpty) +print("PASS: invalid destinations rejected and staging files cleaned") + +if let payloadPath = CommandLine.arguments.dropFirst().first { + let realDestination = root.appendingPathComponent("Real Applications") + try files.createDirectory(at: realDestination, withIntermediateDirectories: true) + let result = try Installation.install(source: URL(fileURLWithPath: payloadPath), directory: realDestination, replace: false) + try Installation.validate(result) + print("PASS: complete release payload installs and validates in a temporary folder") +} diff --git a/apps/nova-desktop/package.json b/apps/nova-desktop/package.json index d4e95578..6ea41a11 100644 --- a/apps/nova-desktop/package.json +++ b/apps/nova-desktop/package.json @@ -1,33 +1,42 @@ { "name": "nova-desktop", - "version": "0.1.0", + "version": "0.2.0", "private": true, "type": "module", "scripts": { - "dev": "vite --port 1420 --strictPort", - "build": "tsc --noEmit && vite build", + "dev": "tauri dev", + "dev:signed": "bun scripts/dev.ts", + "dev:bare": "tauri dev", + "build:debug-app": "tauri build --debug --bundles app", + "build:frontend": "vite build", + "build:sidecar": "bun scripts/build-sidecar.ts", + "build": "bun run build:frontend && bun run build:sidecar", + "package": "bun scripts/dev.ts --package", "typecheck": "tsc --noEmit", - "sidecar:build": "bun scripts/build-sidecar.ts", - "sidecar:smoke": "bun scripts/smoke-sidecar.ts", - "computer:provision": "bun scripts/provision-computer.ts", - "package": "bun run computer:provision && bun run sidecar:build && tauri build --config src-tauri/tauri.bundle.conf.json", - "tauri": "tauri" + "test": "bun test service scripts", + "tauri": "tauri", + "watch:frontend": "vite build --watch", + "smoke:sidecar": "bun scripts/smoke-sidecar.ts" }, "dependencies": { "@super/nova": "workspace:*", - "@tauri-apps/api": "^2.0.0", - "@tauri-apps/plugin-dialog": "^2.0.0", - "lucide-react": "^0.468.0", + "@tauri-apps/api": "^2.10.1", + "@tanstack/react-query": "^5.90.17", + "next-themes": "^0.4.6", "react": "19.2.3", "react-dom": "19.2.3", - "react-markdown": "^10.1.0", - "remark-gfm": "^4.0.1" + "sonner": "^2.0.7", + "web": "workspace:*" }, "devDependencies": { - "@tauri-apps/cli": "^2.0.0", + "@tauri-apps/cli": "^2.10.1", + "@tailwindcss/vite": "^4.1.0", + "@types/bun": "^1.3.14", "@types/react": "19.2.7", - "@types/react-dom": "19.2.3", - "typescript": "^5.7.0", - "vite": "^6.1.0" + "@types/react-dom": "19.2.7", + "@vitejs/plugin-react": "^4.7.0", + "typescript": "^5", + "vite": "^6.4.3", + "@openai/codex": "0.173.0" } } diff --git a/apps/nova-desktop/public/startup.js b/apps/nova-desktop/public/startup.js deleted file mode 100644 index fa0b648f..00000000 --- a/apps/nova-desktop/public/startup.js +++ /dev/null @@ -1,8 +0,0 @@ -window.addEventListener("error", (event) => { - const root = document.getElementById("root") - if (root && root.textContent === "Loading Nova…") root.textContent = `Nova could not start: ${event.message || "A required resource failed to load."}` -}, true) -window.addEventListener("unhandledrejection", (event) => { - const root = document.getElementById("root") - if (root && root.textContent === "Loading Nova…") root.textContent = `Nova could not start: ${String(event.reason)}` -}) diff --git a/apps/nova-desktop/scripts/build-sidecar.ts b/apps/nova-desktop/scripts/build-sidecar.ts index 7f92bfdc..1cd2731b 100644 --- a/apps/nova-desktop/scripts/build-sidecar.ts +++ b/apps/nova-desktop/scripts/build-sidecar.ts @@ -1,28 +1,35 @@ -import { mkdir } from "node:fs/promises" -import { dirname, resolve } from "node:path" -import { fileURLToPath } from "node:url" +import { mkdir, copyFile, cp, readFile, writeFile } from "node:fs/promises" +import { createHash } from "node:crypto" +import { createRequire } from "node:module" +import { homedir } from "node:os" +import { resolve, join } from "node:path" -const root = resolve(dirname(fileURLToPath(import.meta.url)), "../../..") -if (Bun.semver.order(Bun.version, "1.4.5") < 0) throw new Error("Standalone Nova sidecar builds require Bun 1.4.5 or newer") -const requested = process.argv[2] -const host = Bun.spawnSync(["rustc", "--print", "host-tuple"]) -if (host.exitCode !== 0) throw new Error("Rust is required to select the sidecar architecture") -const triple = requested ?? host.stdout.toString().trim() -const targets: Record = { - "aarch64-apple-darwin": "bun-darwin-arm64", - "x86_64-apple-darwin": "bun-darwin-x64", - "x86_64-pc-windows-msvc": "bun-windows-x64", -} -const target = targets[triple] -if (!target) throw new Error(`Unsupported Nova sidecar target: ${triple}`) -const output = resolve(root, `apps/nova-desktop/src-tauri/binaries/nova-service-${triple}${triple.includes("windows") ? ".exe" : ""}`) -await mkdir(dirname(output), { recursive: true }) -const child = Bun.spawn([ - process.execPath, "build", "--compile", `--target=${target}`, - "--no-compile-autoload-dotenv", "--no-compile-autoload-bunfig", - "--no-compile-autoload-tsconfig", "--no-compile-autoload-package-json", - "--env=disable", "--outfile", output, - "apps/supercode-cli/server/src/nova/desktop-main.ts", -], { cwd: root, stdout: "inherit", stderr: "inherit" }) -if (await child.exited !== 0) throw new Error("Nova sidecar compilation failed") -process.stdout.write(`Built ${triple} sidecar\n`) +const root = resolve(import.meta.dir, "..") +const rust = Bun.spawnSync(["rustc", "-vV"], { stdout: "pipe" }) +const triple = rust.stdout.toString().match(/^host: (.+)$/m)?.[1] +if (!triple || rust.exitCode !== 0) throw new Error("Rust host toolchain is required") +await mkdir(resolve(root, "src-tauri/binaries"), { recursive: true }) +const output = resolve(root, `src-tauri/binaries/nova-service-${triple}${process.platform === "win32" ? ".exe" : ""}`) +const result = Bun.spawnSync([process.execPath, "build", "--compile", "--minify", "--target=bun", resolve(root, "service/main.ts"), "--outfile", output], { cwd: root, stdout: "inherit", stderr: "inherit" }) +if (result.exitCode !== 0) throw new Error("Sidecar compilation failed") +console.log(`Built ${output}`) + +// Freeze the installed, version-checked native driver into the app; never resolve PATH at runtime. +const driver = process.env.NOVA_CUA_DRIVER ?? join(homedir(), ".local/bin/cua-driver") +const version = Bun.spawnSync([driver, "--version"], { stdout: "pipe", stderr: "pipe" }) +if (version.exitCode !== 0 || version.stdout.toString().trim() !== "cua-driver 0.62.1") throw new Error("Packaging requires Cua Driver 0.62.1; set NOVA_CUA_DRIVER to the verified executable") +await copyFile(driver, resolve(root, `src-tauri/binaries/cua-driver-${triple}${process.platform === "win32" ? ".exe" : ""}`)) + +const platformPackage = `codex-${process.platform}-${process.arch}` +// Bun hoists optional platform packages next to the parent; resolve through the package first. +const requireCodex = createRequire(import.meta.resolve("@openai/codex/package.json")) +const resolvedPlatform = requireCodex.resolve(`@openai/${platformPackage}/package.json`) +const vendorRoot = resolve(resolve(resolvedPlatform, ".."), `vendor/${triple}`) +await cp(vendorRoot, resolve(root, "src-tauri/native/codex"), { recursive: true, force: true }) + +const sha256 = async (path: string) => createHash("sha256").update(await readFile(path)).digest("hex") +await writeFile(resolve(root, "src-tauri/native/runtime-manifest.json"), JSON.stringify({ + protocolVersion: 1, target: triple, bun: Bun.version, + codex: { version: "0.173.0", sha256: await sha256(resolve(vendorRoot, "bin/codex")) }, + cua: { version: "0.62.1", sha256: await sha256(driver) }, +}, null, 2) + "\n") diff --git a/apps/nova-desktop/scripts/provision-computer.test.ts b/apps/nova-desktop/scripts/provision-computer.test.ts deleted file mode 100644 index 0deebd63..00000000 --- a/apps/nova-desktop/scripts/provision-computer.test.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { expect, test } from "bun:test" -import { createHash } from "node:crypto" -import { computerArtifact, verifyComputerArchive } from "./provision-computer" - -test("desktop targets use pinned runtimes and reject unsupported targets", () => { - expect(computerArtifact("aarch64-apple-darwin")).toEqual(computerArtifact("x86_64-apple-darwin")) - expect(computerArtifact("x86_64-pc-windows-msvc").binary).toBe("cua-driver.exe") - expect(() => computerArtifact("unknown")).toThrow("Unsupported") -}) - -test("a modified archive cannot be staged as the bundled runtime", () => { - const bytes = Buffer.from("verified archive") - const digest = createHash("sha256").update(bytes).digest("hex") - verifyComputerArchive(bytes, digest) - expect(() => verifyComputerArchive(Buffer.from("modified archive"), digest)).toThrow("checksum mismatch") -}) diff --git a/apps/nova-desktop/scripts/provision-computer.ts b/apps/nova-desktop/scripts/provision-computer.ts deleted file mode 100644 index 2667d0e0..00000000 --- a/apps/nova-desktop/scripts/provision-computer.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { createHash } from "node:crypto" -import { chmod, cp, mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises" -import { tmpdir } from "node:os" -import { dirname, join, resolve } from "node:path" -import { fileURLToPath } from "node:url" - -// Pinned upstream release assets; never download or install software at runtime. -// https://github.com/trycua/cua/releases/tag/cua-driver-rs-v0.62.1 -const VERSION = "0.62.1" -export function computerArtifact(target: string): { name: string; sha256: string; binary: string } { - if (["aarch64-apple-darwin", "x86_64-apple-darwin"].includes(target)) return { - name: `cua-driver-rs-${VERSION}-darwin-universal-binary.tar.gz`, - sha256: "05ed121a1c57c83c8af22914e93ea02b1795e5d971b6761deaf6d6edb951f5f8", - binary: "cua-driver", - } - if (target === "x86_64-pc-windows-msvc") return { - name: `cua-driver-rs-${VERSION}-windows-x86_64-binary.zip`, - sha256: "6fce4254c42dfbf1cbd2d03340da259c5e3cd0d31254907322629c2d89675d9d", - binary: "cua-driver.exe", - } - throw new Error(`Unsupported computer runtime target: ${target}`) -} - -export function verifyComputerArchive(bytes: Uint8Array, expected: string): void { - if (createHash("sha256").update(bytes).digest("hex") !== expected) throw new Error("Computer runtime checksum mismatch") -} - -async function run(command: string, args: string[]): Promise { - const child = Bun.spawn([command, ...args], { stdout: "inherit", stderr: "inherit" }) - if (await child.exited !== 0) throw new Error(`Computer runtime ${command} failed`) -} - -async function provision(): Promise { - const host = Bun.spawnSync(["rustc", "--print", "host-tuple"]) - if (host.exitCode !== 0) throw new Error("Rust is required to select the desktop target") - const target = process.argv[2] ?? host.stdout.toString().trim() - const artifact = computerArtifact(target) - const base = resolve(dirname(fileURLToPath(import.meta.url)), "../src-tauri/resources") - await mkdir(base, { recursive: true }) - const temporary = await mkdtemp(join(tmpdir(), "nova-computer-")) - try { - let bytes: Uint8Array - if (process.env.NOVA_CUA_ARCHIVE) { - bytes = await readFile(process.env.NOVA_CUA_ARCHIVE) - } else { - const response = await fetch(`https://github.com/trycua/cua/releases/download/cua-driver-rs-v${VERSION}/${artifact.name}`) - if (!response.ok) throw new Error(`Could not download computer runtime: ${response.status}`) - bytes = new Uint8Array(await response.arrayBuffer()) - } - verifyComputerArchive(bytes, artifact.sha256) - const archive = join(temporary, artifact.name) - await writeFile(archive, bytes) - const extracted = join(temporary, "runtime") - await mkdir(extracted) - await run("tar", ["-xf", archive, "-C", extracted]) - const binary = join(extracted, artifact.binary) - await chmod(binary, 0o755) - if (target.endsWith("apple-darwin")) { - if (process.platform !== "darwin") throw new Error("Provision the macOS runtime on a Mac so it can be signed") - await run("codesign", ["--force", "--identifier", "ai.supercode.nova.desktop.computer", "--sign", process.env.APPLE_SIGNING_IDENTITY ?? "-", binary]) - } - // Replace only the generated runtime directory after download verification. - const destination = join(base, "cua-driver") - await rm(destination, { recursive: true, force: true }) - await cp(extracted, destination, { recursive: true }) - process.stdout.write(`Bundled computer runtime ${VERSION} for ${target}\n`) - } finally { - await rm(temporary, { recursive: true, force: true }) - } -} - -if (import.meta.main) await provision() diff --git a/apps/nova-desktop/scripts/smoke-sidecar.ts b/apps/nova-desktop/scripts/smoke-sidecar.ts index e72b0e29..e22fb194 100644 --- a/apps/nova-desktop/scripts/smoke-sidecar.ts +++ b/apps/nova-desktop/scripts/smoke-sidecar.ts @@ -1,38 +1,84 @@ import { randomBytes } from "node:crypto" -import { join, resolve } from "node:path" -import { mkdtemp, rm } from "node:fs/promises" -import { tmpdir } from "node:os" +import { mkdtemp, mkdir, rm, writeFile, readFile } from "node:fs/promises" +import { resolve } from "node:path" -const path = process.argv[2] -if (!path) throw new Error("Pass the compiled Nova sidecar path") -const secret = randomBytes(32).toString("hex") -const scratch = await mkdtemp(join(tmpdir(), "nova-sidecar-smoke-")) -const startedAt = performance.now() -const child = Bun.spawn([resolve(path)], { stdin: "pipe", stdout: "pipe", stderr: "pipe", cwd: scratch, env: { ...process.env, PATH: "" } }) -const timeout = setTimeout(() => child.kill(), 20_000) +// Run with either the built executable or one copied out of a production app bundle. +const executable = process.argv[2] +if (!executable) throw new Error("Pass the packaged nova-service executable") +const assets = process.argv[3] ?? resolve(import.meta.dir, "../dist") +const port = Number(process.env.NOVA_SMOKE_PORT ?? 47839) +const origin = `http://127.0.0.1:${port}` +const secret = randomBytes(32).toString("base64url") +const testHome = await mkdtemp("/private/tmp/nova-packaged-smoke-") +const workspace = resolve(testHome, "workspace") +await mkdir(workspace) +const localBin = resolve(testHome, ".local/bin") +await mkdir(localBin, { recursive: true }) +await writeFile(resolve(localBin, "cursor-agent"), `#!/bin/sh +printf '%s\\n' '{"type":"assistant","message":{"content":[{"type":"text","text":"NOVA_CURSOR_SMOKE_OK"}]}}' '{"type":"result","subtype":"success","result":"NOVA_CURSOR_SMOKE_OK"}' +`, { mode: 0o755 }) +await writeFile(resolve(workspace, "hello.txt"), "original\n") +for (const args of [["init", "--quiet", workspace], ["-C", workspace, "add", "hello.txt"], ["-C", workspace, "-c", "user.name=Nova Smoke", "-c", "user.email=nova-smoke@example.invalid", "-c", "commit.gpgSign=false", "commit", "--quiet", "-m", "fixture"]]) { + const result = Bun.spawnSync(["/usr/bin/git", ...args], { env: { PATH: "/usr/bin:/bin", HOME: testHome, GIT_CONFIG_NOSYSTEM: "1" }, stdout: "pipe", stderr: "pipe" }) + if (result.exitCode !== 0) throw new Error("Could not prepare isolated Git fixture") +} +const codex = resolve(process.argv[4] ?? resolve(import.meta.dir, "../src-tauri/native/codex/bin/codex")) +const child = Bun.spawn([resolve(executable)], { cwd: "/private/tmp", stdin: "pipe", stdout: "pipe", stderr: "pipe", env: { PATH: "/usr/bin:/bin", HOME: testHome, NOVA_CODEX_EXECUTABLE: codex } }) try { - child.stdin.write(`${JSON.stringify({ secret, credential: null })}\n`) + child.stdin.write(JSON.stringify({ secret, assets: resolve(assets), port }) + "\n") const reader = child.stdout.getReader() - const decoder = new TextDecoder() - let line = "" - while (!line.includes("\n")) { - const { value, done } = await reader.read() - if (done) throw new Error("Sidecar exited before readiness") - line += decoder.decode(value, { stream: true }) - if (line.length > 4096) throw new Error("Sidecar readiness exceeds limits") - } - const ready = JSON.parse(line.slice(0, line.indexOf("\n"))) - if (ready.type !== "ready" || ready.protocolVersion !== 1 || !Number.isInteger(ready.port)) throw new Error("Invalid sidecar readiness") + const first = await Promise.race([reader.read(), new Promise((_, reject) => setTimeout(() => reject(new Error("Readiness timed out")), 15000).unref())]) + if (first.done) throw new Error(`Service exited before readiness: ${await new Response(child.stderr).text()}`) + const ready = JSON.parse(new TextDecoder().decode(first.value)) + if (ready.type !== "ready" || ready.protocolVersion !== 1 || ready.port !== port) throw new Error("Invalid service readiness") reader.releaseLock() - const origin = `http://127.0.0.1:${ready.port}` - const health = await fetch(`${origin}/health`, { headers: { Authorization: `Bearer ${secret}` } }) - if ((await health.json() as { status: string }).status !== "ready") throw new Error("Sidecar did not become healthy") - const denied = await fetch(`${origin}/health`) - if (denied.status !== 401) throw new Error("Sidecar accepted an unauthenticated request") - const response = await fetch(`${origin}/graphql`, { method: "POST", headers: { Authorization: `Bearer ${secret}`, "Content-Type": "application/json" }, body: JSON.stringify({ query: "{ account { signedIn } projects { id } }" }) }) - const result = await response.json() as { data?: { account: { signedIn: boolean }; projects: unknown[] }; errors?: unknown[] } - if (result.errors || result.data?.account.signedIn !== false || result.data.projects.length) throw new Error("Unexpected sidecar initial state") + const denied = await fetch(`${origin}/desktop/health`) + if (denied.status !== 401) throw new Error("Unauthenticated service access was allowed") + const response = await fetch(`${origin}/bootstrap?key=${secret}`, { redirect: "manual" }) + const cookie = response.headers.get("set-cookie")?.split(";")[0] + if (response.status !== 303 || !cookie) throw new Error("Bootstrap failed") + const health = await fetch(`${origin}/desktop/health`, { headers: { Cookie: cookie } }) + if (!(await health.json()).status) throw new Error("Health check failed") + const agents = await fetch(`${origin}/desktop/local-agents`, { headers: { Cookie: cookie } }) + if (!agents.headers.get("content-type")?.includes("application/json") || !(await agents.json()).agents?.some((agent: { id: string }) => agent.id === "cursor-agent")) throw new Error("Packaged Cursor discovery unavailable") + const cursor = await fetch(`${origin}/desktop/agent-turn`, { method: "POST", headers: { Cookie: cookie, Origin: origin, "Content-Type": "application/json" }, body: JSON.stringify({ provider: "cursor-agent", content: "Smoke test" }) }) + const cursorEvents = (await cursor.text()).trim().split("\n").map(line => JSON.parse(line)) + if (!cursor.ok || cursorEvents.filter(event => event.type === "text").map(event => event.content).join("") !== "NOVA_CURSOR_SMOKE_OK" || cursorEvents.at(-1)?.reason !== "completed") throw new Error("Packaged Cursor turn without folder selection or Codex pairing failed") + const index = await fetch(`${origin}/app`, { headers: { Cookie: cookie } }) + const html = await index.text() + if (!html.includes('
') || !html.includes("/assets/")) throw new Error("Bundled UI not served") + const asset = html.match(/src="([^\"]+\.js)"/)?.[1] + if (!asset || !(await fetch(origin + asset, { headers: { Cookie: cookie } })).ok) throw new Error("Bundled JS unavailable") + const workspaceResponse = await fetch(`${origin}/desktop/workspace/projects`, { method: "POST", headers: { Cookie: cookie, Origin: origin, "Content-Type": "application/json" }, body: "{}" }) + if (!workspaceResponse.ok || !Array.isArray((await workspaceResponse.json()).projects)) throw new Error("Packaged CLI workspace engine unavailable") + const nativeGrant = await fetch(`${origin}/native/grant`, { method: "POST", headers: { "x-nova-native": secret, "Content-Type": "application/json" }, body: JSON.stringify({ path: workspace }) }) + if (!nativeGrant.ok) throw new Error("Native project grant failed") + const git = async (path: string, input: unknown) => { + const result = await fetch(`${origin}/desktop/workspace${path}`, { method: "POST", headers: { Cookie: cookie, Origin: origin, "Content-Type": "application/json" }, body: JSON.stringify(input) }) + if (!result.ok) throw new Error(`Packaged workspace operation failed: ${path}`) + return result.json() + } + const projects = await git("/projects", {}) + const project = projects.projects[0] + if (!project?.isGit) throw new Error("Native grant did not reach the Git engine") + const branches = await git("/branches", { projectId: project.id }) + const created = await git("/create", { projectId: project.id, threadId: "nova-packaged-smoke", sourceRef: branches.branches.find((branch: { current: boolean }) => branch.current).ref, mode: "worktree", newBranch: "nova-smoke" }) + const workspaceId = created.workspace.id + await git("/write", { workspaceId, path: "hello.txt", content: "changed in worktree\n" }) + const read = await git("/read", { workspaceId, path: "hello.txt" }) + if (read.content !== "changed in worktree\n" || await readFile(resolve(workspace, "hello.txt"), "utf8") !== "original\n") throw new Error("Packaged worktree isolation failed") + const localCodex = await fetch(`${origin}/native/codex`, { method: "POST", headers: { "x-nova-native": secret, "Content-Type": "application/json" }, body: JSON.stringify({ path: workspace }) }) + if (!localCodex.ok) throw new Error("Packaged local Codex runtime did not start") + const local = await localCodex.json() + if (!Number.isInteger(local.port) || typeof local.code !== "string") throw new Error("Packaged Codex companion did not become ready") + const paired = await fetch(`http://127.0.0.1:${local.port}/pair`, { method: "POST", headers: { Origin: origin, "Content-Type": "application/json" }, body: JSON.stringify({ code: local.code, confirm: true }) }) + if (!paired.ok) throw new Error("Packaged Codex pairing failed") + const auth = await paired.json() + const status = await fetch(`http://127.0.0.1:${local.port}/status`, { method: "POST", headers: { Origin: origin, "Content-Type": "application/json", Authorization: `Bearer ${auth.token}` }, body: "{}" }) + const account = await status.json() + if (!status.ok || account.profile !== "isolated" || account.account !== null) throw new Error("Codex account isolation check failed") child.stdin.end() - if (await child.exited !== 0) throw new Error("Sidecar did not shut down on parent-pipe closure") - process.stdout.write(`Sidecar startup, authentication, GraphQL, and parent-exit cleanup passed (${Math.round(performance.now() - startedAt)} ms, empty PATH, outside checkout)\n`) -} finally { clearTimeout(timeout); child.kill(); await child.exited; await rm(scratch, { recursive: true, force: true }) } + const code = await Promise.race([child.exited, new Promise((_, reject) => setTimeout(() => reject(new Error("Parent EOF shutdown timed out")), 5000).unref())]) + if (code !== 0) throw new Error("Service shutdown failed") + console.log("PASS: packaged service readiness, capability auth, bundled UI/assets, real CLI Git worktree/read/write isolation, packaged Codex RPC/account isolation, parent EOF shutdown; no checkout/Bun required") +} finally { child.kill(); await rm(testHome, { recursive: true, force: true }) } diff --git a/apps/nova-desktop/service/cursor-login.test.ts b/apps/nova-desktop/service/cursor-login.test.ts new file mode 100644 index 00000000..7255b29a --- /dev/null +++ b/apps/nova-desktop/service/cursor-login.test.ts @@ -0,0 +1,21 @@ +import { expect, test } from "bun:test" +import { cursorLoginUrl } from "./cursor-login" + +const url = `https://cursor.com/loginDeepControl?challenge=${"a".repeat(43)}&uuid=12345678-1234-1234-1234-123456789abc&mode=login&redirectTarget=cli` + +test("Cursor sign-in requires a complete CLI challenge and preserves all query parameters", () => { + expect(cursorLoginUrl(`Open ${url} in your browser\n`)).toBe(url) + for (const text of [url.replace("cursor.com", "cursor.com.attacker.test"), url.replace("https:", "http:"), url.replace("https://", "https://user:password@"), url.replace("&uuid=12345678-1234-1234-1234-123456789abc", ""), url.replace("&redirectTarget=cli", ""), url.replace("mode=login", "mode=other"), "https://cursor.com/loginDeepControl?challenge=partial", "no link"]) expect(cursorLoginUrl(text)).toBeNull() +}) + +test("reassembles Ink terminal wraps, including wraps inside the URL query", () => { + for (const width of [20, 40, 78, 120]) { + const wrapped = url.match(new RegExp(`.{1,${width}}`, "g"))!.join("\n ") + expect(cursorLoginUrl(`\u001b[2KAuthenticating…\n Open: ${wrapped}\n Waiting for browser authentication…`)).toBe(url) + } +}) + +test("does not expose a partial URL while stdout arrives in separate chunks", () => { + for (let index = 0; index < url.length; index++) expect(cursorLoginUrl(url.slice(0, index))).toBeNull() + expect(cursorLoginUrl(url)).toBe(url) +}) diff --git a/apps/nova-desktop/service/cursor-login.ts b/apps/nova-desktop/service/cursor-login.ts new file mode 100644 index 00000000..30e3ba2a --- /dev/null +++ b/apps/nova-desktop/service/cursor-login.ts @@ -0,0 +1,66 @@ +import { spawn, type ChildProcess } from "node:child_process" +import { stripVTControlCharacters } from "node:util" +import { findLocalAgentExecutable, localAgentPath } from "../../supercode-cli/server/src/nova/local-agents" + +export function cursorLoginUrl(text: string): string | null { + // Ink wraps the URL to terminal width, including in the middle of its query. + // Only publish the completed CLI URL, never a valid-but-partial URL from a chunk. + const unwrapped = stripVTControlCharacters(text).replace(/\r?\n[ \t]*/g, "") + for (const candidate of unwrapped.match(/https:\/\/[^\s]+?\/loginDeepControl\?[^\s]*?redirectTarget=cli/g) ?? []) { + try { + const url = new URL(candidate) + if (!["https://cursor.com", "https://www.cursor.com"].includes(url.origin) || url.username || url.password || url.hash) continue + if (url.pathname !== "/loginDeepControl" || url.searchParams.get("mode") !== "login" || url.searchParams.get("redirectTarget") !== "cli") continue + if (!/^[A-Za-z0-9_-]{43}$/.test(url.searchParams.get("challenge") ?? "") || !/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(url.searchParams.get("uuid") ?? "")) continue + return url.href + } catch { /* Wait for a complete URL. */ } + } + return null +} + +export function createCursorLogin() { + let child: ChildProcess | null = null + let timer: ReturnType | undefined + let state: "idle" | "pending" | "succeeded" | "failed" = "idle" + let authUrl: string | null = null + const status = () => ({ state, authUrl }) + const close = () => { + const current = child + child = null + clearTimeout(timer) + current?.kill() + authUrl = null + state = "idle" + } + return { + status, + close, + async start() { + const executable = await findLocalAgentExecutable("cursor-agent") + if (!executable) throw new Error("Cursor Agent CLI is not installed") + close() + state = "pending" + const current = spawn(executable, ["login"], { env: { ...process.env, PATH: localAgentPath(), NO_OPEN_BROWSER: "1", NO_COLOR: "1" }, shell: false, stdio: ["ignore", "pipe", "pipe"] }) + child = current + let output = "" + const consume = (chunk: Buffer) => { + if (child !== current) return + output = (output + chunk.toString()).slice(-16384) + authUrl = cursorLoginUrl(output) + } + current.stdout?.on("data", consume) + current.stderr?.on("data", consume) + const finish = (success: boolean) => { + if (child !== current) return + child = null + clearTimeout(timer) + authUrl = null + state = success ? "succeeded" : "failed" + } + current.once("error", () => finish(false)) + current.once("close", code => finish(code === 0)) + timer = setTimeout(() => { current.kill(); finish(false) }, 180000) + return status() + }, + } +} diff --git a/apps/nova-desktop/service/folders.test.ts b/apps/nova-desktop/service/folders.test.ts new file mode 100644 index 00000000..673be4e9 --- /dev/null +++ b/apps/nova-desktop/service/folders.test.ts @@ -0,0 +1,35 @@ +import { afterEach, expect, test } from "bun:test" +import { mkdtemp, mkdir, writeFile, symlink, rm, readFile } from "node:fs/promises" +import { join } from "node:path" +import { tmpdir } from "node:os" +import { FolderGrants } from "./folders" +const temporary: string[] = [] +afterEach(async () => { for (const path of temporary.splice(0)) await rm(path, { recursive: true, force: true }) }) +async function setup() { + const root = await mkdtemp(join(tmpdir(), "nova-grant-")); temporary.push(root) + const project = join(root, "project"); await mkdir(project); await writeFile(join(project, "hello.txt"), "hello") + const grants = new FolderGrants(); const grant = await grants.grant(project) + return { root, project, grants, grant } +} +test("native grants confine reads, writes and directory enumeration", async () => { + const { grants, grant, project } = await setup() + expect(await grants.list(grant.id, "")).toEqual([{ name: "hello.txt", kind: "file" }]) + expect(await (await grants.read(grant.id, "hello.txt")).text()).toBe("hello") + await grants.write(grant.id, "hello.txt", "edited") + expect(await readFile(join(project, "hello.txt"), "utf8")).toBe("edited") + for (const path of ["../secret", "/etc/passwd", "a/../../secret", "a\\secret"]) await expect(grants.read(grant.id, path)).rejects.toThrow() + await expect(grants.read("unknown", "hello.txt")).rejects.toThrow() + await grants.mkdir(grant.id, "nested") + await grants.write(grant.id, "nested/new.txt", "new file") + expect(await readFile(join(project, "nested/new.txt"), "utf8")).toBe("new file") + await expect(grants.write(grant.id, "/absolute.txt", "forbidden")).rejects.toThrow() + grants.clear() + await expect(grants.read(grant.id, "hello.txt")).rejects.toThrow() +}) +test("symlinks do not expand a native directory grant", async () => { + const { grants, grant, project, root } = await setup() + await writeFile(join(root, "secret"), "private") + await symlink(join(root, "secret"), join(project, "link")) + await expect(grants.read(grant.id, "link")).rejects.toThrow("Symlinks") + expect(await grants.list(grant.id, "")).toEqual([{ name: "hello.txt", kind: "file" }]) +}) diff --git a/apps/nova-desktop/service/folders.ts b/apps/nova-desktop/service/folders.ts new file mode 100644 index 00000000..7194adde --- /dev/null +++ b/apps/nova-desktop/service/folders.ts @@ -0,0 +1,61 @@ +import { randomUUID } from "node:crypto" +import { lstat, readdir, realpath, readFile, writeFile, mkdir } from "node:fs/promises" +import { basename, isAbsolute, join, relative, sep } from "node:path" + +/** Grants originate exclusively from the native picker, never from a remote path. */ +export class FolderGrants { + private roots = new Map() + async grant(path: string) { + if (!isAbsolute(path) || !(await lstat(path)).isDirectory() || (await lstat(path)).isSymbolicLink()) throw new Error("Choose a directory") + const root = await realpath(path) + const existing = [...this.roots].find(([, value]) => value === root) + const id = existing?.[0] ?? randomUUID() + this.roots.set(id, root) + return { id, name: basename(root), root } + } + paths() { return [...this.roots.values()] } + clear() { this.roots.clear() } + private async resolve(id: string, path: string) { + const root = this.roots.get(id) + if (!root || typeof path !== "string" || path.length > 4096 || path.includes("\\") || path.includes("\0") || isAbsolute(path) || path.split("/").some(p => p === ".." || p === ".")) throw new Error("Invalid folder path") + const full = join(root, path) + const rel = relative(root, full) + if (rel.startsWith(`..${sep}`) || rel === ".." || isAbsolute(rel)) throw new Error("Invalid folder path") + let current = root + for (const part of path.split("/").filter(Boolean)) { + current = join(current, part) + if ((await lstat(current)).isSymbolicLink()) throw new Error("Symlinks are not permitted") + } + if (await realpath(root) !== root) throw new Error("Folder grant changed") + return full + } + async list(id: string, path: string) { + const entries = await readdir(await this.resolve(id, path), { withFileTypes: true }) + if (entries.length > 10000) throw new Error("Directory is too large") + return entries.filter(e => !e.isSymbolicLink() && (e.isFile() || e.isDirectory())).map(e => ({ name: e.name, kind: e.isDirectory() ? "directory" : "file" })) + } + async read(id: string, path: string) { + const full = await this.resolve(id, path) + if ((await lstat(full)).size > 10 * 1024 * 1024) throw new Error("File is too large") + return new Response(await readFile(full)) + } + private async writablePath(id: string, path: string) { + if (typeof path !== "string" || !path || path.length > 4096 || isAbsolute(path)) throw new Error("Invalid file path") + const parts = path.split("/") + const name = parts.pop() + if (!name || name === "." || name === ".." || name.includes("\\") || name.includes("\0")) throw new Error("Invalid file path") + const parent = await this.resolve(id, parts.join("/")) + const full = join(parent, name) + try { if ((await lstat(full)).isSymbolicLink()) throw new Error("Symlinks are not permitted") } + catch (error) { if ((error as NodeJS.ErrnoException).code !== "ENOENT") throw error } + return full + } + async mkdir(id: string, path: string) { + const full = await this.writablePath(id, path) + try { await mkdir(full) } catch (error) { if ((error as NodeJS.ErrnoException).code !== "EEXIST" || !(await lstat(full)).isDirectory()) throw error } + } + async write(id: string, path: string, content: string) { + if (typeof content !== "string" || Buffer.byteLength(content) > 2 * 1024 * 1024) throw new Error("File is too large") + await writeFile(await this.writablePath(id, path), content) + } +} diff --git a/apps/nova-desktop/service/gateway.test.ts b/apps/nova-desktop/service/gateway.test.ts new file mode 100644 index 00000000..8e2ef71f --- /dev/null +++ b/apps/nova-desktop/service/gateway.test.ts @@ -0,0 +1,140 @@ +import { describe, expect, test } from "bun:test" +import { createGateway, equalSecret, allowedApiPath, type GatewayDependencies } from "./gateway" + +const secret = "a".repeat(43) +const origin = "http://127.0.0.1:47831" +function setup(overrides: Partial = {}) { + const calls: Array<{ url: string; init?: RequestInit }> = [] + const deps: GatewayDependencies = { + secret, origin, assets: import.meta.dir, + browserLogin: async state => `http://nova.localhost:3003/desktop/start?state=${state}`, + restore: { cookies: [["web_session", "private-cookie"]] }, + auth: { status: () => ({}), signOut: async () => ({}) }, + workspace: async () => Response.json({ projects: [] }), + folders: { list: async () => [], read: async () => new Response("file"), write: async () => {} }, + grant: async () => ({ id: "grant" }), + fetcher: (async (url: string, init?: RequestInit) => { + calls.push({ url, init }) + if (url.endsWith("/api/auth/get-session")) return Response.json({ session: { id: "session" }, user: { id: "user" } }, { headers: { "Set-Cookie": "web_session=private-cookie; Secure; HttpOnly" } }) + return Response.json({ sessions: [] }, { headers: { "Set-Cookie": "web_session=next-cookie; HttpOnly" } }) + }) as typeof fetch, + ...overrides, + } + const handler = createGateway(deps) + const request = (path: string, options: RequestInit = {}) => handler(new Request(`${origin}${path}`, { ...options, headers: { Host: "127.0.0.1:47831", Cookie: `nova_desktop=${secret}`, ...options.headers } })) + return { request, handler, calls } +} +describe("desktop capability boundary", () => { + test("local computer setup is capability protected and returns metadata without hosted requests", async () => { + const metadata = { deviceId: "this-mac", displayName: "My Mac", state: "disabled", permissions: { accessibility: false, screenRecording: true }, error: null } + const { request, handler, calls } = setup({ computerSetup: async () => metadata }) + expect((await handler(new Request(`${origin}/desktop/computer/setup`, { headers: { Host: "127.0.0.1:47831" } }))).status).toBe(401) + expect(await (await request("/desktop/computer/setup")).json()).toEqual(metadata) + expect(calls).toHaveLength(0) + }) + test("direct local agent turns require the desktop capability and preserve cancellation", async () => { + let calls = 0 + const { request, handler } = setup({ localAgentTurn: async (input, signal) => { + calls++ + expect(input).toEqual({ provider: "cursor-agent", content: "hello" }) + expect(signal).toBeInstanceOf(AbortSignal) + return new Response('{"type":"finish","reason":"completed"}\n', { headers: { "Content-Type": "application/x-ndjson" } }) + } }) + const options = { method: "POST", body: JSON.stringify({ provider: "cursor-agent", content: "hello" }) } + expect((await handler(new Request(`${origin}/desktop/agent-turn`, { ...options, headers: { Host: "127.0.0.1:47831" } }))).status).toBe(401) + expect(calls).toBe(0) + expect((await request("/desktop/agent-turn", options)).headers.get("content-type")).toBe("application/x-ndjson") + expect(calls).toBe(1) + }) + test("local discovery returns JSON and unknown desktop endpoints never serve the SPA", async () => { + const { request } = setup() + const agents = await request("/desktop/local-agents") + expect(agents.headers.get("content-type")).toContain("application/json") + expect(Array.isArray((await agents.json()).agents)).toBe(true) + const missing = await request("/desktop/unknown-local-route") + expect(missing.status).toBe(404) + expect(await missing.json()).toEqual({ error: "Not found" }) + }) + test("checks host, cookie, origin and fetch metadata", async () => { + const { request, handler, calls } = setup() + for (const headers of ([{ Host: "attacker.test" }, { Cookie: "" }, { Origin: "https://evil.test" }, { "Sec-Fetch-Site": "same-site" }] as Record[])) expect((await request("/api/nova/sessions", { headers })).status).toBeGreaterThanOrEqual(401) + expect((await handler(new Request(`${origin}/api/nova/sessions`, { headers: { Host: "127.0.0.1:47831" } }))).status).toBe(401) + expect(calls.length).toBe(0) + expect((await request("/native/credential")).status).toBe(403) + }) + test("bootstrap capability becomes HttpOnly cookie and leaves URL", async () => { + const { handler } = setup() + const result = await handler(new Request(`${origin}/bootstrap?key=${secret}`, { headers: { Host: "127.0.0.1:47831" } })) + expect(result.status).toBe(303) + expect(result.headers.get("location")).toBe("/app") + expect(result.headers.get("set-cookie")).toContain("HttpOnly; SameSite=Strict") + }) + test("keeps upstream credentials and cookies out of webview responses", async () => { + const { request, calls } = setup() + const response = await request("/api/nova/sessions?parentSessionId=abc") + expect(response.status).toBe(200) + expect(response.headers.get("set-cookie")).toBeNull() + expect(calls[0]!.url).toEndWith("/api/nova/sessions?parentSessionId=abc") + expect(calls[0]!.init!.headers).toMatchObject({ Cookie: "web_session=private-cookie" }) + expect(await response.text()).not.toContain("private") + }) + test("restricts hosted paths and does not forward arbitrary native endpoints", async () => { + const { request, calls } = setup() + expect((await request("/api/auth/anything")).status).toBe(404) + expect((await request("/native/grant", { method: "POST", body: "{}" })).status).toBe(403) + expect(calls).toHaveLength(0) + expect(allowedApiPath("/api/nova/%2fadmin")).toBe(false) + expect(equalSecret("", secret)).toBe(false) + }) + test("logout invalidates cached web session", async () => { + const { request, calls } = setup() + await request("/desktop/session") + await request("/desktop/logout", { method: "POST" }) + await request("/desktop/session") + expect(calls.filter(c => c.url.endsWith("/api/auth/get-session"))).toHaveLength(1) + }) + test("streams bytes before completion and preserves abort signal", async () => { + let enqueue: ReadableStreamDefaultController | undefined + let upstreamSignal: AbortSignal | null | undefined + const { request } = setup({ fetcher: (async (url: string, init?: RequestInit) => { + if (url.endsWith("/api/auth/get-session")) return Response.json({ session: { id: "session" }, user: { id: "user" } }, { headers: { "Set-Cookie": "session=value" } }) + upstreamSignal = init?.signal + return new Response(new ReadableStream({ start(controller) { enqueue = controller; controller.enqueue(new TextEncoder().encode("data: first\n\n")) } }), { headers: { "Content-Type": "text/event-stream" } }) + }) as typeof fetch }) + const abort = new AbortController() + const response = await request("/api/nova/sessions/a/turn", { method: "POST", body: "{}", signal: abort.signal }) + const reader = response.body!.getReader() + expect(new TextDecoder().decode((await reader.read()).value)).toBe("data: first\n\n") + abort.abort() + expect(upstreamSignal?.aborted).toBe(true) + enqueue!.close() + reader.releaseLock() + }) + test("web GitHub login callback is state-bound, single-use and reuses Nova Web cookies", async () => { + const { request, calls } = setup({ restore: undefined, fetcher: (async (url: string) => { + calls.push({ url }) + if (url.includes("/api/auth/cli/callback")) return new Response(null, { status: 307, headers: { "Set-Cookie": "web_session=web-cookie; HttpOnly" } }) + return Response.json({ user: { id: "web-user" }, session: { id: "web-session" } }) + }) as typeof fetch }) + const started = await (await request("/desktop/auth/start", { method: "POST" })).json() + const login = new URL(started.url) + expect(login.origin).toBe("http://nova.localhost:3003") + expect(login.pathname).toBe("/desktop/start") + const state = login.searchParams.get("state") + const callback = `/desktop/auth/callback?state=${state}&token=one-time-token` + expect((await request("/desktop/auth/callback?state=wrong&token=one-time-token")).status).toBe(403) + expect((await request(callback)).status).toBe(200) + expect(calls.some(call => call.url.includes("https://nova.supercodeai.tech/api/auth/cli/callback?token=one-time-token"))).toBe(true) + expect((await request(callback)).status).toBe(403) + expect(await (await request("/desktop/session")).json()).toEqual({ user: { id: "web-user" } }) + }) + + test("starting sign-in uses the local return bridge without a new hosted endpoint", async () => { + const { request, calls } = setup() + const response = await request("/desktop/auth/start", { method: "POST" }) + expect(response.status).toBe(200) + expect((await response.json()).url).toStartWith("http://nova.localhost:3003/desktop/start?state=") + expect(calls).toHaveLength(0) + }) + +}) diff --git a/apps/nova-desktop/service/gateway.ts b/apps/nova-desktop/service/gateway.ts new file mode 100644 index 00000000..28f2eacc --- /dev/null +++ b/apps/nova-desktop/service/gateway.ts @@ -0,0 +1,177 @@ +import { randomBytes, timingSafeEqual } from "node:crypto" +import { resolve, sep } from "node:path" +import { discoverLocalAgents } from "../../supercode-cli/server/src/nova/local-agents" +import { readLocalOpenCodeCatalog } from "../../supercode-cli/server/src/nova/local-opencode" + +export const DESKTOP_VERSION = 1 +export const HOSTED_ORIGIN = "https://nova.supercodeai.tech" +const json = (value: unknown, status = 200) => Response.json(value, { status, headers: { "Cache-Control": "no-store" } }) +export function equalSecret(a: string, b: string): boolean { + const left = Buffer.from(a), right = Buffer.from(b) + return left.length === right.length && timingSafeEqual(left, right) +} +export function allowedApiPath(path: string): boolean { + return path.startsWith("/api/nova/") && !path.includes("\\") && !/%(?:2f|5c|2e)/i.test(path) +} + +export type GatewayDependencies = { + computerSetup?: () => Promise + cursorLogin?: { start: () => Promise; status: () => unknown } + localAgentTurn?: (input: unknown, signal: AbortSignal) => Promise + secret: string + assets: string + origin: string + hostedOrigin?: string + fetcher?: typeof fetch + restore?: { cookies: Array<[string, string]> } + onHarnessToken?: (token: string | null) => void + auth: { + status: () => unknown + signOut: () => Promise + } + workspace: (path: string, input: unknown) => Promise + folders: { mkdir?: (id: string, path: string) => Promise; list: (id: string, path: string) => Promise; read: (id: string, path: string) => Promise; write: (id: string, path: string, content: string) => Promise } + browserLogin: (state: string) => Promise + startLocalCodex?: (path: string) => Promise + grant: (path: string) => Promise +} + +export function createGateway(deps: GatewayDependencies) { + const fetcher = deps.fetcher ?? fetch + const hosted = deps.hostedOrigin ?? HOSTED_ORIGIN + let cookies = new Map(deps.restore?.cookies ?? []) + let pendingLogin: { state: string; expiresAt: number } | null = null + deps.onHarnessToken?.(cookies.has("nova_harness_token") ? decodeURIComponent(cookies.get("nova_harness_token")!) : null) + let user: unknown = null + let generation = 0 + function capture(headers: Headers) { + for (const cookie of headers.getSetCookie()) { + const [pair] = cookie.split(";") + const index = pair!.indexOf("=") + if (index > 0) cookies.set(pair!.slice(0, index), pair!.slice(index + 1)) + } + } + const cookieHeader = () => [...cookies].map(([k, v]) => `${k}=${v}`).join("; ") + async function session() { + if (!cookies.size) return json({ user: null }, 401) + const attempt = generation + const response = await fetcher(`${hosted}/api/auth/get-session`, { + headers: { Cookie: cookieHeader() }, redirect: "error", signal: AbortSignal.timeout(20_000), + }) + if (generation !== attempt) return json({ error: "Account changed" }, 409) + if (!response.ok) return json({ error: "Nova session could not be verified" }, response.status) + const value = await response.json() + if (!value?.user || !value?.session) { cookies.clear(); user = null; deps.onHarnessToken?.(null); return json({ user: null }, 401) } + capture(response.headers) + user = value.user + return json({ user }) + } + return async (request: Request): Promise => { + const url = new URL(request.url) + if (url.origin !== deps.origin || request.headers.get("host") !== new URL(deps.origin).host) return json({ error: "Invalid host" }, 403) + if (url.pathname === "/bootstrap" && request.method === "GET" && equalSecret(url.searchParams.get("key") ?? "", deps.secret)) { + return new Response(null, { status: 303, headers: { Location: "/app", "Set-Cookie": `nova_desktop=${deps.secret}; HttpOnly; SameSite=Strict; Path=/`, "Cache-Control": "no-store", "Referrer-Policy": "no-referrer" } }) + } + // System-browser callback is public but bound to one expiring, single-use app transaction. + if (url.pathname === "/desktop/auth/callback" && request.method === "GET") { + const attempt = pendingLogin + const token = url.searchParams.get("token") + if (!attempt || attempt.expiresAt <= Date.now() || !equalSecret(url.searchParams.get("state") ?? "", attempt.state) || !token || !/^[A-Za-z0-9_-]{1,512}$/.test(token)) return json({ error: "Invalid or expired desktop sign-in" }, 403) + pendingLogin = null + const loginGeneration = generation + try { + // Reuse Nova Web's exact one-time-token callback, signed session and harness cookie. + const callback = new URL("/api/auth/cli/callback", hosted) + callback.searchParams.set("token", token) + callback.searchParams.set("redirect", "/app") + const response = await fetcher(callback.href, { redirect: "manual", signal: AbortSignal.timeout(20_000) }) + if (generation !== loginGeneration || response.status !== 307 && response.status !== 303 && response.status !== 302) return json({ error: "Nova sign-in failed. Restart sign-in from the app." }, 401) + capture(response.headers) + const established = await session() + if (!established.ok) return established + deps.onHarnessToken?.(cookies.has("nova_harness_token") ? decodeURIComponent(cookies.get("nova_harness_token")!) : null) + return new Response("Nova sign-in complete

Signed in. You can return to Nova and close this tab.

", { headers: { "Content-Type": "text/html", "Cache-Control": "no-store", "Referrer-Policy": "no-referrer", "Content-Security-Policy": "default-src 'none'" } }) + } catch { return json({ error: "Nova authentication unavailable. Restart sign-in from the app." }, 502) } + } + const native = equalSecret(request.headers.get("x-nova-native") ?? "", deps.secret) && !request.headers.has("origin") + const capability = request.headers.get("cookie")?.split(/;\s*/).find(c => c.startsWith("nova_desktop="))?.slice(13) ?? "" + if (!native && !equalSecret(capability, deps.secret)) return json({ error: "Unauthorized" }, 401) + const origin = request.headers.get("origin") + if (origin && origin !== deps.origin) return json({ error: "Invalid origin" }, 403) + if (["cross-site", "same-site"].includes(request.headers.get("sec-fetch-site") ?? "")) return json({ error: "Invalid site" }, 403) + try { + if (native && url.pathname === "/native/credential" && request.method === "GET") return json({ credential: cookies.size ? { cookies: [...cookies] } : null }) + if (native && url.pathname === "/native/codex" && request.method === "POST" && deps.startLocalCodex) return json(await deps.startLocalCodex((await request.json()).path)) + if (native && url.pathname === "/native/grant" && request.method === "POST") return json(await deps.grant((await request.json()).path)) + if (url.pathname.startsWith("/native/")) return json({ error: "Forbidden" }, 403) + if (url.pathname === "/desktop/health") return json({ protocolVersion: DESKTOP_VERSION, status: "ready" }) + if (url.pathname === "/desktop/computer/setup" && request.method === "GET" && deps.computerSetup) return json(await deps.computerSetup()) + if (url.pathname === "/desktop/local-agents" && request.method === "GET") return json({ agents: await discoverLocalAgents() }) + if (url.pathname === "/desktop/cursor-login" && deps.cursorLogin) { + if (request.method === "POST") return json(await deps.cursorLogin.start()) + if (request.method === "GET") return json(deps.cursorLogin.status()) + } + if (url.pathname === "/desktop/agent-turn" && request.method === "POST" && deps.localAgentTurn) { + if (Number(request.headers.get("content-length") ?? 0) > 131072) return json({ error: "Too large" }, 413) + return deps.localAgentTurn(await request.json(), request.signal) + } + if (url.pathname === "/desktop/opencode-catalog" && request.method === "GET") return json(await readLocalOpenCodeCatalog()) + if (url.pathname === "/desktop/session" && request.method === "GET") return user ? json({ user }) : session() + if (url.pathname === "/desktop/auth/status" && request.method === "GET") return json(deps.auth.status()) + if (url.pathname === "/desktop/auth/start" && request.method === "POST") { + pendingLogin = { state: randomBytes(32).toString("base64url"), expiresAt: Date.now() + 5 * 60_000 } + return json({ url: await deps.browserLogin(pendingLogin.state) }) + } + if (url.pathname === "/desktop/logout" && request.method === "POST") { + generation++; pendingLogin = null + const previous = cookieHeader() + cookies.clear(); user = null; deps.onHarnessToken?.(null) + await deps.auth.signOut() + try { await fetcher(`${hosted}/api/auth/sign-out`, { method: "POST", headers: { Cookie: previous, Origin: hosted, "Content-Type": "application/json" }, body: "{}", redirect: "error", signal: AbortSignal.timeout(8000) }) } catch { /* Local sign-out is complete even while offline. */ } + return json({ signedOut: true }) + } + if (url.pathname.startsWith("/desktop/workspace/") && request.method === "POST") { + if (Number(request.headers.get("content-length") ?? 0) > 2 * 1024 * 1024) return json({ error: "Too large" }, 413) + return deps.workspace(url.pathname.slice("/desktop/workspace".length), await request.json()) + } + if (url.pathname.startsWith("/desktop/folder/") && request.method === "POST") { + const { id, path, content } = await request.json() + if (typeof id !== "string" || typeof path !== "string") return json({ error: "Invalid folder" }, 400) + if (url.pathname.endsWith("/mkdir") && deps.folders.mkdir) { await deps.folders.mkdir(id, path); return json({ ok: true }) } + if (url.pathname.endsWith("/list")) return json(await deps.folders.list(id, path)) + if (url.pathname.endsWith("/read")) return deps.folders.read(id, path) + if (url.pathname.endsWith("/write")) { await deps.folders.write(id, path, content); return json({ ok: true }) } + } + if (allowedApiPath(url.pathname)) { + if (!cookies.size) { + const established = await session() + if (!established.ok) return established + } + const response = await fetcher(`${hosted}${url.pathname}${url.search}`, { + method: request.method, + headers: { Cookie: cookieHeader(), Origin: hosted, Accept: request.headers.get("accept") ?? "application/json", "Content-Type": request.headers.get("content-type") ?? "application/json" }, + body: ["GET", "HEAD"].includes(request.method) ? undefined : request.body, + duplex: "half", redirect: "manual", signal: request.signal, + } as RequestInit) + capture(response.headers) + // Upstream cookies and redirects never reach the local webview. + const headers = new Headers({ "Cache-Control": "no-store", "X-Content-Type-Options": "nosniff" }) + for (const key of ["content-type", "content-disposition"]) { const value = response.headers.get(key); if (value) headers.set(key, value) } + if (response.status === 401) { cookies.clear(); user = null } + return new Response(response.body, { status: response.status, headers }) + } + if (url.pathname.startsWith("/api/") || url.pathname.startsWith("/desktop/") || request.method !== "GET") return json({ error: "Not found" }, 404) + const root = resolve(deps.assets) + const path = resolve(root, `.${decodeURIComponent(url.pathname)}`) + if (path !== root && !path.startsWith(root + sep)) return json({ error: "Invalid path" }, 403) + const file = Bun.file(path) + const asset = await file.exists() ? file : Bun.file(resolve(root, "index.html")) + return new Response(asset, { headers: { + "Content-Security-Policy": "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' https: data: blob:; font-src 'self' data:; connect-src 'self' http://127.0.0.1:*; frame-src https://www.browserbase.com https://browserbase.com; object-src 'none'; base-uri 'self'; form-action 'self'", + "X-Content-Type-Options": "nosniff", "Referrer-Policy": "no-referrer", "Cache-Control": "no-store", + } }) + } catch { + return json({ error: "Nova service unavailable. Check the desktop service log and retry." }, 502) + } + } +} diff --git a/apps/nova-desktop/service/local-agents.test.ts b/apps/nova-desktop/service/local-agents.test.ts new file mode 100644 index 00000000..75d11686 --- /dev/null +++ b/apps/nova-desktop/service/local-agents.test.ts @@ -0,0 +1,45 @@ +import { expect, test } from "bun:test" +import { createDesktopAgentTurns } from "./local-agents" + +test("desktop agents stream from a default workspace without Codex pairing or a folder dialog", async () => { + const workspaceIds: Array = [] + const service = createDesktopAgentTurns(async id => { workspaceIds.push(id); return "/nova/agent-workspace" }, async (input, cwd, signal, emit) => { + expect(input).toEqual({ provider: "cursor-agent", content: "hello" }) + expect(cwd).toBe("/nova/agent-workspace") + expect(signal.aborted).toBe(false) + emit({ type: "text", content: "Hello from Cursor" }) + emit({ type: "finish", reason: "completed" }) + }) + const response = await service.run({ provider: "cursor-agent", content: "hello" }, new AbortController().signal) + expect(response.headers.get("content-type")).toBe("application/x-ndjson") + expect((await response.text()).trim().split("\n").map(line => JSON.parse(line))).toEqual([{ type: "text", content: "Hello from Cursor" }, { type: "finish", reason: "completed" }]) + expect(workspaceIds).toEqual([undefined]) +}) + +test("local turns validate providers, resolve granted workspaces, and report unavailable projects", async () => { + const service = createDesktopAgentTurns(async id => { + expect(id).toBe("selected-workspace") + throw new Error("Grant unavailable") + }) + const signal = new AbortController().signal + expect((await service.run({ provider: "arbitrary-command", content: "hello" }, signal)).status).toBe(400) + expect((await service.run({ provider: "cursor-agent", content: "hello", cwd: "/arbitrary" }, signal)).status).toBe(400) + expect((await service.run({ provider: "cursor-agent", content: "hello", workspaceId: "selected-workspace" }, signal)).status).toBe(409) +}) + +test("cancelling a desktop stream stops its agent and releases the single turn slot", async () => { + let entered!: () => void + const started = new Promise(resolve => { entered = resolve }) + let cancelled = false + const service = createDesktopAgentTurns(async () => "/nova/workspace", async (_input, _cwd, signal) => { + entered() + await new Promise(resolve => signal.addEventListener("abort", () => { cancelled = true; resolve() }, { once: true })) + }) + const controller = new AbortController() + const response = await service.run({ provider: "cursor-agent", content: "hello" }, controller.signal) + await started + expect((await service.run({ provider: "cursor-agent", content: "second" }, controller.signal)).status).toBe(409) + await response.body!.cancel() + await Promise.resolve() + expect(cancelled).toBe(true) +}) diff --git a/apps/nova-desktop/service/local-agents.ts b/apps/nova-desktop/service/local-agents.ts new file mode 100644 index 00000000..4ab9dbe2 --- /dev/null +++ b/apps/nova-desktop/service/local-agents.ts @@ -0,0 +1,54 @@ +import { z } from "zod" +import { localAgentTurn } from "../../supercode-cli/server/src/nova/local-agent-turn" + +const inputSchema = z.object({ + provider: z.enum(["claude-code", "gemini-cli", "cursor-agent", "factory", "opencode"]), + content: z.string().trim().min(1).max(32000), + model: z.string().regex(/^[a-zA-Z0-9._:/-]+$/).max(256).optional(), + workspaceId: z.string().min(1).max(256).optional(), +}).strict() + +export function createDesktopAgentTurns(workspace: (id?: string) => Promise, turn = localAgentTurn) { + let active: AbortController | null = null + return { + close() { active?.abort() }, + async run(value: unknown, signal: AbortSignal): Promise { + const parsed = inputSchema.safeParse(value) + if (!parsed.success) return Response.json({ error: "Invalid local agent request" }, { status: 400 }) + if (active) return Response.json({ error: "A local agent is already running. Stop it before starting another request." }, { status: 409 }) + const abort = new AbortController() + active = abort + const cancel = () => abort.abort() + signal.addEventListener("abort", cancel, { once: true }) + if (signal.aborted) cancel() + let cwd: string + try { cwd = await workspace(parsed.data.workspaceId) } catch { + active = null + signal.removeEventListener("abort", cancel) + return Response.json({ error: "The selected local workspace is unavailable. Reopen the project and retry." }, { status: 409 }) + } + const { workspaceId: _, ...input } = parsed.data + const encoder = new TextEncoder() + let terminal = false + const body = new ReadableStream({ + start(controller) { + const emit: Parameters[3] = (event) => { + if (terminal || abort.signal.aborted) return + if ((controller.desiredSize ?? 0) < 0) { cancel(); return } + controller.enqueue(encoder.encode(`${JSON.stringify(event)}\n`)) + if (event.type === "finish") terminal = true + } + void turn(input, cwd, abort.signal, emit).catch(() => { + emit({ type: "finish", reason: "failed", message: "The local agent could not start. Check its CLI installation and sign-in." }) + }).finally(() => { + active = null + signal.removeEventListener("abort", cancel) + try { controller.close() } catch { /* Reader cancelled. */ } + }) + }, + cancel() { terminal = true; cancel() }, + }, new ByteLengthQueuingStrategy({ highWaterMark: 262144 })) + return new Response(body, { headers: { "Content-Type": "application/x-ndjson", "Cache-Control": "no-store" } }) + }, + } +} diff --git a/apps/nova-desktop/service/login-return.test.ts b/apps/nova-desktop/service/login-return.test.ts new file mode 100644 index 00000000..4aed8d0e --- /dev/null +++ b/apps/nova-desktop/service/login-return.test.ts @@ -0,0 +1,41 @@ +import { afterEach, expect, test } from "bun:test" +import { createLoginReturn } from "./login-return" +const bridges: Array> = [] +afterEach(() => { for (const bridge of bridges.splice(0)) bridge.close() }) +const state = "a".repeat(43) +function fixture(complete = async (_state: string, _token: string) => new Response("Signed in"), now?: () => number) { + const bridge = createLoginReturn(complete, { ports: [0], now }) + bridges.push(bridge) + return bridge +} +function request(url: string, cookie?: string) { + return new Request(url, { headers: { Host: new URL(url).host, ...(cookie ? { Cookie: cookie } : {}) } }) +} +test("uses the existing hosted Nova redirect and accepts its callback once for the same browser", async () => { + const calls: string[][] = [] + const bridge = fixture(async (state, token) => { calls.push([state, token]); return new Response("Signed in") }) + const start = await bridge.start(state) + const begin = await bridge.fetch(request(start)) + expect(begin.status).toBe(303) + const hosted = new URL(begin.headers.get("location")!) + expect(hosted.origin).toBe("https://supercode-terminal.vercel.app") + expect(hosted.pathname).toBe("/sign-in") + expect(hosted.searchParams.get("redirect")).toBe(`${new URL(start).origin}/app`) + expect(hosted.searchParams.has("desktop_callback")).toBe(false) + const cookie = begin.headers.get("set-cookie")!.split(";")[0]! + const callback = `${new URL(start).origin}/api/auth/cli/callback?token=one-time-token&redirect=/app` + expect((await bridge.fetch(request(callback))).status).toBe(403) + expect((await bridge.fetch(request(callback, "nova_login_state=wrong"))).status).toBe(403) + expect((await bridge.fetch(request(callback, cookie))).status).toBe(200) + expect(calls).toEqual([[state, "one-time-token"]]) + expect((await bridge.fetch(request(callback, cookie))).status).toBe(403) +}) +test("denies stale, foreign-host and unbound browser callbacks", async () => { + let clock = 0 + const bridge = fixture(undefined, () => clock) + const start = await bridge.start(state) + expect((await bridge.fetch(new Request(start, { headers: { Host: "evil.test" } }))).status).toBe(403) + clock = 300001 + expect((await bridge.fetch(request(start))).status).toBe(403) + expect((await bridge.fetch(request(`${new URL(start).origin}/api/auth/cli/callback?token=unused&redirect=/app`, `nova_login_state=${state}`))).status).toBe(403) +}) diff --git a/apps/nova-desktop/service/login-return.ts b/apps/nova-desktop/service/login-return.ts new file mode 100644 index 00000000..6f0fe056 --- /dev/null +++ b/apps/nova-desktop/service/login-return.ts @@ -0,0 +1,64 @@ +import { equalSecret } from "./gateway" + +const TERMINAL_ORIGIN = "https://supercode-terminal.vercel.app" +const statePattern = /^[A-Za-z0-9_-]{43}$/ +const headers = { "Cache-Control": "no-store", "Referrer-Policy": "no-referrer", "Content-Security-Policy": "default-src 'none'" } + +/** Uses the Nova localhost origins already allowed by the existing web sign-in page. */ +export function createLoginReturn(complete: (state: string, token: string) => Promise, options: { ports?: number[]; now?: () => number } = {}) { + const now = options.now ?? Date.now + let server: ReturnType | null = null + let origin = "" + let pending: { state: string; expiresAt: number } | null = null + const fetch = async (request: Request): Promise => { + const url = new URL(request.url) + if (url.origin !== origin || request.headers.get("host") !== new URL(origin).host) return new Response("Invalid login host", { status: 403, headers }) + if (request.method !== "GET") return new Response("Method not allowed", { status: 405, headers }) + if (url.pathname === "/desktop/start") { + const state = url.searchParams.get("state") ?? "" + if (!pending || pending.expiresAt <= now() || !equalSecret(state, pending.state)) return new Response("Sign-in expired. Start again from Nova.", { status: 403, headers }) + const login = new URL("/sign-in", TERMINAL_ORIGIN) + login.searchParams.set("redirect", `${origin}/app`) + return new Response(null, { status: 303, headers: { ...headers, Location: login.href, "Set-Cookie": `nova_login_state=${state}; HttpOnly; SameSite=Lax; Path=/; Max-Age=300` } }) + } + if (url.pathname === "/api/auth/cli/callback") { + const state = request.headers.get("cookie")?.split(/;\s*/).find(value => value.startsWith("nova_login_state="))?.slice("nova_login_state=".length) ?? "" + const token = url.searchParams.get("token") ?? "" + if (!pending || pending.expiresAt <= now() || !equalSecret(state, pending.state) || !/^[A-Za-z0-9_-]{1,512}$/.test(token) || url.searchParams.get("redirect") !== "/app") return new Response("Invalid or expired desktop sign-in. Start again from Nova.", { status: 403, headers }) + pending = null + try { + const response = await complete(state, token) + const resultHeaders = new Headers(response.headers) + for (const [key, value] of Object.entries(headers)) resultHeaders.set(key, value) + resultHeaders.set("Set-Cookie", "nova_login_state=; HttpOnly; SameSite=Lax; Path=/; Max-Age=0") + return new Response(response.body, { status: response.status, headers: resultHeaders }) + } catch { + return new Response("Could not complete sign-in. Return to Nova and try again.", { status: 502, headers }) + } + } + return new Response("Not found", { status: 404, headers }) + } + return { + async start(state: string): Promise { + if (!statePattern.test(state)) throw new Error("Invalid login state") + if (!server) { + // These exact origins are already supported by Nova Web's deployed auth client. + for (const port of options.ports ?? [3003, 3000]) { + try { + origin = `http://nova.localhost:${port}` + server = Bun.serve({ hostname: "127.0.0.1", port, maxRequestBodySize: 1024, fetch }) + origin = `http://nova.localhost:${server.port}` + break + } catch (error) { + if ((error as NodeJS.ErrnoException).code !== "EADDRINUSE") throw error + } + } + } + if (!server) throw new Error("Close the local web server on port 3003 or 3000, then try signing in again.") + pending = { state, expiresAt: now() + 5 * 60_000 } + return `${origin}/desktop/start?state=${state}` + }, + fetch, + close() { pending = null; server?.stop(true); server = null }, + } +} diff --git a/apps/nova-desktop/service/main.ts b/apps/nova-desktop/service/main.ts new file mode 100644 index 00000000..0c5cbd28 --- /dev/null +++ b/apps/nova-desktop/service/main.ts @@ -0,0 +1,113 @@ +import { createInterface } from "node:readline" +import { homedir } from "node:os" +import { mkdir, lstat, chmod, realpath } from "node:fs/promises" +import { resolve, basename, isAbsolute } from "node:path" +import { z } from "zod" + +import { desktopAuth } from "../../supercode-cli/server/src/nova/desktop-auth" +import { startWorkspaceCompanion } from "../../supercode-cli/server/src/nova/workspaces/server" +import { NovaWorkspaceGit } from "../../supercode-cli/server/src/nova/workspaces/git" +import { DesktopComputerAgent } from "../../supercode-cli/server/src/nova/cua/desktop-computer" +import { startCompanion } from "../../supercode-cli/server/src/nova/server" +import { spawnCodex } from "../../supercode-cli/server/src/nova/codex-rpc" +import { resolveCodexProfile } from "../../supercode-cli/server/src/nova/profile" +import { LocalCodexRuntime } from "../../supercode-cli/server/src/nova/runtime" +import { FolderGrants } from "./folders" +import { createLoginReturn } from "./login-return" +import { createGateway, DESKTOP_VERSION } from "./gateway" +import { createDesktopAgentTurns } from "./local-agents" +import { createCursorLogin } from "./cursor-login" + +const bootstrap = z.object({ secret: z.string().regex(/^[A-Za-z0-9_-]{43}$/), assets: z.string(), port: z.number().int().min(1024).max(65535), credential: z.unknown().optional() }).strict() +const lines = createInterface({ input: process.stdin }) +const timer = setTimeout(() => process.exit(1), 10000) +lines.once("line", async line => { + clearTimeout(timer) + try { + const input = bootstrap.parse(JSON.parse(line)) + const origin = `http://127.0.0.1:${input.port}` + const desktopComputer = new DesktopComputerAgent() + const folders = new FolderGrants() + const cursorLogin = createCursorLogin() + let localCodex: Awaited> | null = null + let engine = new NovaWorkspaceGit({ roots: [] }) + const localAgents = createDesktopAgentTurns(async id => { + if (id) return (await engine.get(id)).path + const workspace = resolve(homedir(), ".nova/local-agent-workspace") + await mkdir(workspace, { recursive: true, mode: 0o700 }) + return realpath(workspace) + }) + // The original companion validates every operation's schema and Git permissions. + const service = new Proxy({} as NovaWorkspaceGit, { get: (_, key: keyof NovaWorkspaceGit) => { + const method = engine[key] + return typeof method === "function" ? method.bind(engine) : method + } }) + let companion = startWorkspaceCompanion({ roots: [resolve(input.assets)], origins: [origin], port: 0, service }) + let companionOrigin = `http://127.0.0.1:${companion.server.port}` + let pairing: { token: string; expiresAt: string } | null = null + const loginReturn = createLoginReturn((state, token) => handler(new Request(`${origin}/desktop/auth/callback?state=${encodeURIComponent(state)}&token=${encodeURIComponent(token)}`, { headers: { Host: new URL(origin).host } }))) + const handler = createGateway({ + secret: input.secret, assets: input.assets, origin, + computerSetup: () => desktopComputer.setupStatus(), + localAgentTurn: (value, signal) => localAgents.run(value, signal), + cursorLogin, + browserLogin: state => loginReturn.start(state), + restore: input.credential ? z.object({ cookies: z.array(z.tuple([z.string().min(1).max(200), z.string().max(16000)])).max(20) }).strict().parse(input.credential) : undefined, + onHarnessToken: token => desktopAuth.restore(token ? { access_token: token, expiresAt: null, source: "cli" } : null), + auth: { + status: () => desktopAuth.status(), + signOut: async () => { cursorLogin.close(); localAgents.close(); await desktopComputer.disconnect(); await localCodex?.close(); localCodex = null; folders.clear(); engine = new NovaWorkspaceGit({ roots: [] }); desktopAuth.restore(null); return { signedOut: true } }, + }, folders, + startLocalCodex: async path => { + await localCodex?.close(); localCodex = null + if (!isAbsolute(path)) throw new Error("Choose a workspace directory") + const workspace = await realpath(path) + if (!(await lstat(workspace)).isDirectory()) throw new Error("Choose a workspace directory") + const profile = resolveCodexProfile("isolated") + await mkdir(profile.path, { recursive: true, mode: 0o700 }) + const metadata = await lstat(profile.path) + if (metadata.isSymbolicLink() || !metadata.isDirectory() || (typeof process.getuid === "function" && metadata.uid !== process.getuid())) throw new Error("Unsafe Nova Codex profile") + await chmod(profile.path, 0o700) + const rpc = spawnCodex(profile.path, homedir(), "isolated") + const runtime = new LocalCodexRuntime(rpc, workspace, basename(workspace), "isolated") + try { + localCodex = await startCompanion({ origin, port: 0, runtime, workspace }) + return { port: localCodex.port, code: localCodex.pairingCode } + } catch { runtime.close(); throw new Error("Local companion could not start") } + }, + grant: async path => { + const grant = await folders.grant(path) + engine = new NovaWorkspaceGit({ roots: folders.paths() }) + return { id: grant.id, name: grant.name } + }, + workspace: async (path, body) => { + if (pairing && Date.parse(pairing.expiresAt) <= Date.now()) { + companion.stop() + companion = startWorkspaceCompanion({ roots: [resolve(input.assets)], origins: [origin], port: 0, service }) + companionOrigin = `http://127.0.0.1:${companion.server.port}` + pairing = null + } + if (!pairing) { + const response = await fetch(`${companionOrigin}/pair`, { method: "POST", headers: { Origin: origin, "Content-Type": "application/json" }, body: JSON.stringify({ code: companion.code }) }) + if (!response.ok) throw new Error("Companion pairing failed") + pairing = await response.json() + } + return fetch(`${companionOrigin}${path}`, { method: "POST", headers: { Origin: origin, "Content-Type": "application/json", Authorization: `Bearer ${pairing!.token}` }, body: JSON.stringify(body), redirect: "error" }) + }, + }) + const server = Bun.serve({ hostname: "127.0.0.1", port: input.port, maxRequestBodySize: 12 * 1024 * 1024, idleTimeout: 0, fetch: handler }) + desktopComputer.start() + process.stdout.write(JSON.stringify({ type: "ready", port: server.port, protocolVersion: DESKTOP_VERSION }) + "\n") + let stopping = false + const stop = () => { + if (stopping) return + stopping = true + cursorLogin.close(); localAgents.close(); loginReturn.close(); companion.stop(); server.stop(true) + void Promise.allSettled([desktopComputer.stop(), localCodex?.close()]).finally(() => { lines.close(); process.exit(0) }) + } + process.once("SIGTERM", stop); process.once("SIGINT", stop); lines.once("close", stop) + } catch { + process.stderr.write("Nova gateway startup failed\n") + process.exit(1) + } +}) diff --git a/apps/nova-desktop/src-tauri/Cargo.lock b/apps/nova-desktop/src-tauri/Cargo.lock index c248a270..3a371725 100644 --- a/apps/nova-desktop/src-tauri/Cargo.lock +++ b/apps/nova-desktop/src-tauri/Cargo.lock @@ -34,18 +34,18 @@ dependencies = [ [[package]] name = "android_system_properties" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae221649c9976a6f6c56ae1facf410f3ddb33cc661c4b7b61020a912d4237fbc" +checksum = "204ddd8b860c1ff4b89d3cef1d23180caa4d0c34d34c9c2b009bc441ffb94d0f" dependencies = [ "libc", ] [[package]] name = "anyhow" -version = "1.0.104" +version = "1.0.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" +checksum = "2cb931c189b85683d69a5cfad41d4d418671e1ac413dd209f3f2fc31e3cfd902" [[package]] name = "async-broadcast" @@ -140,7 +140,7 @@ checksum = "4f8abc12baad266b1c8cec146854c195b5864b4221d4b2ca7296a7ae82d9e451" dependencies = [ "proc-macro2", "quote", - "syn 3.0.3", + "syn 3.0.10", ] [[package]] @@ -175,14 +175,14 @@ checksum = "82f6aeea286b8eb4dd3431a1be1b59d290ace00f5bfd8e2a159bc2a05e2c1667" dependencies = [ "proc-macro2", "quote", - "syn 3.0.3", + "syn 3.0.10", ] [[package]] name = "atk" -version = "0.18.2" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "241b621213072e993be4f6f3a9e4b45f65b7e6faad43001be957184b7bb1824b" +checksum = "780a62f5d3373a8461bdc9258527bd03fe9299779446681199005712b24cc1d7" dependencies = [ "atk-sys", "glib", @@ -191,14 +191,14 @@ dependencies = [ [[package]] name = "atk-sys" -version = "0.18.2" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5e48b684b0ca77d2bbadeef17424c2ea3c897d44d566a1617e7e8f30614d086" +checksum = "56fd0f13d1dedae306538653b8e42034a2260d1ac3ee920e7a5c31475d7184a5" dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps", + "system-deps 9.0.1", ] [[package]] @@ -231,30 +231,15 @@ version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5" -[[package]] -name = "bit-set" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" -dependencies = [ - "bit-vec 0.8.0", -] - [[package]] name = "bit-set" version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56d87354e4229f54a44f7bf2435906a4656dba36026ab6eaca629a2c436a691c" dependencies = [ - "bit-vec 0.10.2", + "bit-vec", ] -[[package]] -name = "bit-vec" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" - [[package]] name = "bit-vec" version = "0.10.2" @@ -263,28 +248,13 @@ checksum = "72503af1e72be411d74ca45cd6b309878fcb35354e252fc2a3a8bda3a97082a0" [[package]] name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.13.1" +version = "2.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da" +checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06" dependencies = [ "serde_core", ] -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - [[package]] name = "block-buffer" version = "0.12.1" @@ -329,9 +299,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "6.4.0" +version = "6.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "664148598c930650998ef56df301329ffe7b4cdb02d49b2a3fca3bcaf2185bcb" +checksum = "50986a054f56ca3e15382f3c09abee2bf494c00311b238daae118a06bc1c15f1" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -348,9 +318,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.20.3" +version = "3.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" +checksum = "87a0cf66fd1eb2fb7b822cb78370d82303750809bc6ba855f3f58e517d3238db" [[package]] name = "bytemuck" @@ -360,74 +330,73 @@ checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797" [[package]] name = "byteorder" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +checksum = "34fb07aac3b9f547c7af8dc897dfe73c10847b6c71130c364bdd7891d979c816" [[package]] name = "bytes" -version = "1.12.1" +version = "1.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" +checksum = "776dfebd015e2d8732c684a2c71003674ccb49457b539b9e82151ba38e96dd7c" dependencies = [ "serde", ] [[package]] name = "cairo-rs" -version = "0.18.5" +version = "0.22.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ca26ef0159422fb77631dc9d17b102f253b876fe1586b03b803e63a309b4ee2" +checksum = "62bf7f026ae17fe688938438ec1da2b69f69832f1428a17258f6ee9a7f6e1815" dependencies = [ - "bitflags 2.13.1", + "bitflags", "cairo-sys-rs", "glib", "libc", - "once_cell", - "thiserror 1.0.69", ] [[package]] name = "cairo-sys-rs" -version = "0.18.2" +version = "0.22.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "685c9fa8e590b8b3d678873528d83411db17242a73fccaed827770ea0fedda51" +checksum = "ee548131103ad8f698c6725669647b9c757b3b66992dd6a026037596417bee21" dependencies = [ "glib-sys", "libc", - "system-deps", + "system-deps 9.0.1", ] [[package]] name = "camino" -version = "1.2.5" +version = "1.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb1307f12aa967b5a58416e87b3653360e0fd614a016b6e970db08fecbb1b80d" +checksum = "bbbad30e4b4c14a39e3cc8aed085a12a327257c316619c93581e017bc52be591" dependencies = [ "serde_core", ] [[package]] name = "cargo-platform" -version = "0.1.9" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" +checksum = "dd0061da739915fae12ea00e16397555ed4371a6bb285431aab930f61b0aa4ba" dependencies = [ "serde", + "serde_core", ] [[package]] name = "cargo_metadata" -version = "0.19.2" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba" +checksum = "ef987d17b0a113becdd19d3d0022d04d7ef41f9efe4f3fb63ac44ba61df3ade9" dependencies = [ "camino", "cargo-platform", "semver", "serde", "serde_json", - "thiserror 2.0.20", + "thiserror 2.0.21", ] [[package]] @@ -438,14 +407,14 @@ checksum = "82f4b26e751e711a5302649417f2da046dce6391b2ea30a4820f37462314f0b9" dependencies = [ "semver", "serde", - "toml 1.1.4+spec-1.1.0", + "toml", ] [[package]] name = "cc" -version = "1.4.2" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d262e149917187838d5b42777c8253bcb64500067342904e7d429499a6f277e" +checksum = "95e45cf2980b2d467be49a9ed942c9179b701063a7ca3d037de7ee9bd67f8d66" dependencies = [ "find-msvc-tools", "shlex", @@ -470,9 +439,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.15.8" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" +checksum = "edd44d82755fb9210fb10d9daf8dd7e522da0efe1d5f263cffc5db07725663ff" dependencies = [ "smallvec", "target-lexicon", @@ -480,9 +449,9 @@ dependencies = [ [[package]] name = "cfg-if" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" +checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600" [[package]] name = "chrono" @@ -493,14 +462,14 @@ dependencies = [ "iana-time-zone", "num-traits", "serde", - "windows-link", + "windows-link 0.2.1", ] [[package]] name = "combine" -version = "4.6.7" +version = "4.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +checksum = "4356eba6976435498d05a311ee9fc486da3bc81c200d3f0d7dd9703b41913f92" dependencies = [ "bytes", "memchr", @@ -521,30 +490,11 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be95d4a884358a21a199689323c29e9256b4a1b315e22f183d155422041d3a9a" -[[package]] -name = "const-random" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d38d4bb3e79c716fd0330d8da84171b0135e59e01076e99f22b75a64c56e952c" -dependencies = [ - "const-random-macro", -] - -[[package]] -name = "const-random-macro" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d66bb491e9fc48cb3fed9d57df886880a751d540d645ebc86b6d9d35b8fa8457" -dependencies = [ - "getrandom 0.4.3", - "tiny-keccak", -] - [[package]] name = "cookie" -version = "0.18.1" +version = "0.18.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ddef33a339a91ea89fb53151bd0a4689cfce27055c291dfa69945475d22c747" +checksum = "d55f2d6c30eeec7d5c6f98bd4395d4abb1895629eab97ee6522d340623615f8a" dependencies = [ "time", "version_check", @@ -582,7 +532,7 @@ version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "064badf302c3194842cf2c5d61f56cc88e54a759313879cdf03abdd27d0c3b97" dependencies = [ - "bitflags 2.13.1", + "bitflags", "core-foundation 0.10.1", "core-graphics-types", "foreign-types", @@ -595,20 +545,11 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb" dependencies = [ - "bitflags 2.13.1", + "bitflags", "core-foundation 0.10.1", "libc", ] -[[package]] -name = "cpufeatures" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" -dependencies = [ - "libc", -] - [[package]] name = "cpufeatures" version = "0.3.1" @@ -620,43 +561,27 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.5.0" +version = "1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" +checksum = "fd9ae8fcb3ea71b0b26338b4ffb13006bb175de8fd07921089a906ce7e5e6945" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-channel" -version = "0.5.16" +version = "0.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d85363c37faeca707aef026efa9f3b34d077bce547e48f770770625c6013679e" +checksum = "98b0cc327b5bc766e7fda9c9260cc0fa81b43a8e240440422dff70788e3f9ef1" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61803da095bee82a81bb1a452ecc25d3b2f1416d1897eb86430c6159ef717c17" - -[[package]] -name = "crunchy" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" - -[[package]] -name = "crypto-common" -version = "0.1.7" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" -dependencies = [ - "generic-array", - "typenum", -] +checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6" [[package]] name = "crypto-common" @@ -667,19 +592,6 @@ dependencies = [ "hybrid-array", ] -[[package]] -name = "cssparser" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9cdaae01d5ed7882b04d795e7f752f46ff52d2fa3b50a20d28c464510bba98" -dependencies = [ - "cssparser-macros", - "dtoa-short", - "itoa", - "phf 0.13.1", - "smallvec", -] - [[package]] name = "cssparser" version = "0.38.0" @@ -689,7 +601,7 @@ dependencies = [ "cssparser-macros", "dtoa-short", "itoa", - "phf 0.14.0", + "phf", "smallvec", ] @@ -700,7 +612,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d045de693cb712d0b22c6a64be5b953f67b3ce00ab5ad3dd5d8b441886ab8e1a" dependencies = [ "quote", - "syn 3.0.3", + "syn 3.0.10", ] [[package]] @@ -714,9 +626,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.23.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25ae13da2f202d56bd7f91c25fba009e7717a1e4a1cc98a76d844b65ae912e9d" +checksum = "ed17f5901b6630b993ca003def43f2f8ef4014fc13b047b57aad617ff32bc2ec" dependencies = [ "darling_core", "darling_macro", @@ -724,26 +636,26 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.23.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9865a50f7c335f53564bb694ef660825eb8610e0a53d3e11bf1b0d3df31e03b0" +checksum = "6837e2cf7485aaae18f86181d2f0e9a7ed297a025e220aeabf63fdebd3a2ddff" dependencies = [ "ident_case", "proc-macro2", "quote", "strsim", - "syn 2.0.119", + "syn 3.0.10", ] [[package]] name = "darling_macro" -version = "0.23.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d" +checksum = "2ac7135c3ef02b2f7833bbeb1be5ba7f966dcde8a87c6b87f65a778d71a02785" dependencies = [ "darling_core", "quote", - "syn 2.0.119", + "syn 3.0.10", ] [[package]] @@ -759,9 +671,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.5.8" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" +checksum = "9e9de72ce2ad1f90dc62fa25f0f430ef85eb4b0d8fa0be4f30373bc40a21d28e" dependencies = [ "serde_core", ] @@ -787,25 +699,15 @@ dependencies = [ "syn 2.0.119", ] -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer 0.10.4", - "crypto-common 0.1.7", -] - [[package]] name = "digest" version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2" dependencies = [ - "block-buffer 0.12.1", + "block-buffer", "const-oid", - "crypto-common 0.2.2", + "crypto-common", ] [[package]] @@ -826,7 +728,7 @@ dependencies = [ "libc", "option-ext", "redox_users", - "windows-sys 0.61.2", + "windows-sys 0.101.0", ] [[package]] @@ -835,7 +737,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38" dependencies = [ - "bitflags 2.13.1", + "bitflags", "block2", "libc", "objc2", @@ -849,7 +751,16 @@ checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" dependencies = [ "proc-macro2", "quote", - "syn 3.0.3", + "syn 3.0.10", +] + +[[package]] +name = "dlib" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab8ecd87370524b461f8557c119c405552c396ed91fc0a8eec68679eab26f94a" +dependencies = [ + "libloading 0.8.9", ] [[package]] @@ -875,44 +786,26 @@ dependencies = [ "syn 2.0.119", ] -[[package]] -name = "dlv-list" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "442039f5147480ba31067cb00ada1adae6892028e40e45fc5de7b7df6dcc1b5f" -dependencies = [ - "const-random", -] - [[package]] name = "dom_query" -version = "0.28.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fac5fca71e65e94cc718a6e2af65d6e0f9c6027751c2aa562fbb5087fda639bc" +checksum = "b35b4f772a1a8b88e5545a67c2d3a62a93d4edccc5a68f2145fe52e39c96d275" dependencies = [ - "bit-set 0.8.0", - "cssparser 0.37.0", + "bit-set", + "cssparser", "foldhash", - "html5ever 0.39.0", + "html5ever", "precomputed-hash", - "selectors 0.38.0", + "selectors", "tendril", ] [[package]] -name = "dom_query" -version = "0.30.0" +name = "downcast-rs" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b35b4f772a1a8b88e5545a67c2d3a62a93d4edccc5a68f2145fe52e39c96d275" -dependencies = [ - "bit-set 0.11.1", - "cssparser 0.38.0", - "foldhash", - "html5ever 0.40.1", - "precomputed-hash", - "selectors 0.41.0", - "tendril", -] +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" [[package]] name = "dpi" @@ -952,14 +845,14 @@ checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" [[package]] name = "embed-resource" -version = "3.0.11" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbfdaacccebec3b28e4866b8973543c7647797db5ada1bdab552e48fe665fbbd" +checksum = "6168487b5e7eb2673e6efe1200b1848016e436a6ca0b8031bf04bd9d493a249f" dependencies = [ "cc", "memchr", "rustc_version", - "toml 1.1.4+spec-1.1.0", + "toml", "vswhom", "winreg", ] @@ -999,15 +892,15 @@ dependencies = [ [[package]] name = "equivalent" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" +checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826" [[package]] name = "erased-serde" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2add8a07dd6a8d93ff627029c51de145e12686fbc36ecb298ac22e74cf02dec" +checksum = "1e59b668157f32d3459d4bd634861a06ffa2503a461ca5f0916b9f0252605e66" dependencies = [ "serde", "serde_core", @@ -1071,18 +964,19 @@ dependencies = [ [[package]] name = "find-msvc-tools" -version = "0.1.10" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b73573e6edcd2af0cdf47bd6cb58f0b3839491263c314eaad1ccf24430e1de" +checksum = "3e44f110d1777dc6559a51e7d45083945ded4f1bf3305494350f693b6d20b9c8" [[package]] name = "flate2" -version = "1.1.9" +version = "1.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c" +checksum = "626d4928326b646e70f65ed36fc7cf9f206bdb68a0019ee7c6b4709da4e084c4" dependencies = [ "crc32fast", - "miniz_oxide", + "miniz_oxide 0.9.1", + "zlib-rs", ] [[package]] @@ -1115,7 +1009,7 @@ checksum = "ea5190182e6915eb873ddbc16e23b711b6eb1f9c00a0d0a3a91b5f6228475225" dependencies = [ "proc-macro2", "quote", - "syn 3.0.3", + "syn 3.0.10", ] [[package]] @@ -1126,33 +1020,34 @@ checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" [[package]] name = "form_urlencoded" -version = "1.2.2" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +checksum = "afa489199eaffb1211795df1c6236ce1ad0d41a6fa45250add73e3b02420f06e" dependencies = [ "percent-encoding", ] [[package]] name = "futures-channel" -version = "0.3.33" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "262590f4fe6afeb0bc83be1daa64e52657fe185690a958af7f3ad0e92085c5ae" +checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4" dependencies = [ "futures-core", + "futures-sink", ] [[package]] name = "futures-core" -version = "0.3.33" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cd50c473c80f6d7c3670a752354b8e569b1a7cbfdc0419ec88e5edad85e0dc7" +checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e" [[package]] name = "futures-executor" -version = "0.3.33" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6754879cc9f2c66f88c6e5c35344bb0bdb0708b0352b1201815667c7eabc7458" +checksum = "031b47cf1a3c6cc8bc2fc76cd437f521619387907d469316e7c0bc278f1f5432" dependencies = [ "futures-core", "futures-task", @@ -1161,15 +1056,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.33" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4577ecaa3c4f96589d473f679a71b596316f6641bc350038b962a5daf0085d7a" +checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed" [[package]] name = "futures-lite" -version = "2.6.1" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad" +checksum = "28aadd44bf60a243dd4f49b467a5ff30fee9e4dbaed326795d433ffa8a561730" dependencies = [ "fastrand", "futures-core", @@ -1180,32 +1075,32 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.33" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d6d3cde68c518367be28956066ddfef33813991b77a55005a69dae04bf3b10b" +checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44" dependencies = [ "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.10", ] [[package]] name = "futures-sink" -version = "0.3.33" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e34418ac499d6305c2fb5ad0ed2f6ac998c5f8ca209b4510f7f94242c647e307" +checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d" [[package]] name = "futures-task" -version = "0.3.33" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b231ed28831efb4a61a08580c4bc233ec56bc009f4cd8f52da2c3cb97df0c109" +checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd" [[package]] name = "futures-util" -version = "0.3.33" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a77a90a256fce34da66415271e30f94ee91c57b04b8a2c042d9cf3220179deaa" +checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc" dependencies = [ "futures-core", "futures-io", @@ -1219,9 +1114,9 @@ dependencies = [ [[package]] name = "gdk" -version = "0.18.2" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9f245958c627ac99d8e529166f9823fb3b838d1d41fd2b297af3075093c2691" +checksum = "50b79a7fa8b0e9fe6c77118e48cc00a23eb41052c190434d9cda7746418efca6" dependencies = [ "cairo-rs", "gdk-pixbuf", @@ -1234,35 +1129,34 @@ dependencies = [ [[package]] name = "gdk-pixbuf" -version = "0.18.5" +version = "0.22.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50e1f5f1b0bfb830d6ccc8066d18db35c487b1b2b1e8589b5dfe9f07e8defaec" +checksum = "aabb44971913eb9f7bf6747f6e88889386007d8ce8cfd1ca2735751b664e7079" dependencies = [ "gdk-pixbuf-sys", "gio", "glib", "libc", - "once_cell", ] [[package]] name = "gdk-pixbuf-sys" -version = "0.18.0" +version = "0.22.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9839ea644ed9c97a34d129ad56d38a25e6756f99f3a88e15cd39c20629caf7" +checksum = "9d5209294ba3775f9b650bf78bfadeba4332089f2329b3e2f6ce0a4957a45bff" dependencies = [ "gio-sys", "glib-sys", "gobject-sys", "libc", - "system-deps", + "system-deps 9.0.1", ] [[package]] name = "gdk-sys" -version = "0.18.2" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c2d13f38594ac1e66619e188c6d5a1adb98d11b2fcf7894fc416ad76aa2f3f7" +checksum = "463ac2e2f204918dcaeb3c34810bd7fe94448d2b8d4fa13a5ab45a4fc3e88e50" dependencies = [ "cairo-sys-rs", "gdk-pixbuf-sys", @@ -1272,28 +1166,28 @@ dependencies = [ "libc", "pango-sys", "pkg-config", - "system-deps", + "system-deps 9.0.1", ] [[package]] name = "gdkwayland-sys" -version = "0.18.2" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "140071d506d223f7572b9f09b5e155afbd77428cd5cc7af8f2694c41d98dfe69" +checksum = "82559ece0c0952519a3513ecd90638e5db59e00c851f1d3ea05ac7ff2a46942e" dependencies = [ "gdk-sys", "glib-sys", "gobject-sys", "libc", "pkg-config", - "system-deps", + "system-deps 9.0.1", ] [[package]] name = "gdkx11" -version = "0.18.2" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3caa00e14351bebbc8183b3c36690327eb77c49abc2268dd4bd36b856db3fbfe" +checksum = "bad7a698a74652ddba8dc348f9933f6f209fbcf3ab318f2c1fd72c6b2fa99505" dependencies = [ "gdk", "gdkx11-sys", @@ -1305,38 +1199,18 @@ dependencies = [ [[package]] name = "gdkx11-sys" -version = "0.18.2" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e7445fe01ac26f11601db260dd8608fe172514eb63b3b5e261ea6b0f4428d" +checksum = "a103facf2056ce28125a49501f98beb01d1e3c9477257a8e05cfc5d3d677709e" dependencies = [ + "cairo-sys-rs", "gdk-sys", "glib-sys", "libc", - "system-deps", + "system-deps 9.0.1", "x11", ] -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - [[package]] name = "getrandom" version = "0.3.4" @@ -1362,9 +1236,9 @@ dependencies = [ [[package]] name = "gio" -version = "0.18.4" +version = "0.22.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fc8f532f87b79cbc51a79748f16a6828fb784be93145a322fa14d06d354c73" +checksum = "536990682bab3b8bf68a78d298ccae69702a114290b096edf2bec6eb2e4013b3" dependencies = [ "futures-channel", "futures-core", @@ -1373,32 +1247,30 @@ dependencies = [ "gio-sys", "glib", "libc", - "once_cell", "pin-project-lite", "smallvec", - "thiserror 1.0.69", ] [[package]] name = "gio-sys" -version = "0.18.1" +version = "0.22.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37566df850baf5e4cb0dfb78af2e4b9898d817ed9263d1090a2df958c64737d2" +checksum = "b9c253490f9a475047f109bf6ccb68c407e9d186b7bfab01849188f4e669e669" dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps", - "winapi", + "system-deps 9.0.1", + "windows-sys 0.61.2", ] [[package]] name = "glib" -version = "0.18.5" +version = "0.22.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233daaf6e83ae6a12a52055f568f9d7cf4671dabb78ff9560ab6da230ce00ee5" +checksum = "c9c4cbf1972a07741ae5ce9b23a582a90efc69745fc713f8b037b8d962f604da" dependencies = [ - "bitflags 2.13.1", + "bitflags", "futures-channel", "futures-core", "futures-executor", @@ -1410,33 +1282,29 @@ dependencies = [ "gobject-sys", "libc", "memchr", - "once_cell", "smallvec", - "thiserror 1.0.69", ] [[package]] name = "glib-macros" -version = "0.18.5" +version = "0.22.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb0228f477c0900c880fd78c8759b95c7636dbd7842707f49e132378aa2acdc" +checksum = "d4014e54e2049108c93cf278b64e89f490849402e09b455a25dfa2098cc35093" dependencies = [ - "heck 0.4.1", - "proc-macro-crate 2.0.2", - "proc-macro-error", + "heck", "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.10", ] [[package]] name = "glib-sys" -version = "0.18.1" +version = "0.22.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063ce2eb6a8d0ea93d2bf8ba1957e78dbab6be1c2220dd3daca57d5a9d869898" +checksum = "8b01e8b94529c2698b98f765b887f1e001b76195c1e25d1139aa9336019e745d" dependencies = [ "libc", - "system-deps", + "system-deps 9.0.1", ] [[package]] @@ -1447,20 +1315,20 @@ checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b" [[package]] name = "gobject-sys" -version = "0.18.0" +version = "0.22.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0850127b514d1c4a4654ead6dedadb18198999985908e6ffe4436f53c785ce44" +checksum = "07595c9ba696bd9819cb6a8df39f08078f3dd679508fe052dd558492c2053834" dependencies = [ "glib-sys", "libc", - "system-deps", + "system-deps 9.0.1", ] [[package]] name = "gtk" -version = "0.18.2" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd56fb197bfc42bd5d2751f4f017d44ff59fbb58140c6b49f9b3b2bdab08506a" +checksum = "a86cafafc177054a1d555a0b302044d2b5f82e1c1e23d152a7ba252dc6bfced0" dependencies = [ "atk", "cairo-rs", @@ -1479,9 +1347,9 @@ dependencies = [ [[package]] name = "gtk-sys" -version = "0.18.2" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f29a1c21c59553eb7dd40e918be54dccd60c52b049b75119d5d96ce6b624414" +checksum = "a0e6f055c4a2ce6598b32373595b0c9985f1c7cc448afe4f09fee33fb738b488" dependencies = [ "atk-sys", "cairo-sys-rs", @@ -1492,20 +1360,19 @@ dependencies = [ "gobject-sys", "libc", "pango-sys", - "system-deps", + "system-deps 9.0.1", ] [[package]] name = "gtk3-macros" -version = "0.18.2" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ff3c5b21f14f0736fed6dcfc0bfb4225ebf5725f3c0209edeec181e4d73e9d" +checksum = "5fcce21fcb0c4c4fc48bab8d4eee5aacdb361f85d234756430e6e793bd3d95cf" dependencies = [ - "proc-macro-crate 1.3.1", - "proc-macro-error", + "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.10", ] [[package]] @@ -1516,21 +1383,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "hashbrown" -version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" - -[[package]] -name = "heck" -version = "0.4.1" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "735eaa21a6a5ffb2e84362faaeb90c05ba8e19797ca30428478cb6ea3a4921bc" [[package]] name = "heck" @@ -1550,16 +1405,6 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" -[[package]] -name = "html5ever" -version = "0.39.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46a1761807faccc9a19e86944bbf40610014066306f96edcdedc2fb714bcb7b8" -dependencies = [ - "log", - "markup5ever 0.39.0", -] - [[package]] name = "html5ever" version = "0.40.1" @@ -1567,15 +1412,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "456a1a377e608e555d22ddab27ac0114bc7a7b4199078108e34c2aeae6c9b130" dependencies = [ "log", - "markup5ever 0.40.0", + "markup5ever", "memchr", ] [[package]] name = "http" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0" +checksum = "a07dc2d082802d1782faa5b3c8ac252f3a4fc89f51e76c3f37dc2d1a5b857c05" dependencies = [ "bytes", "itoa", @@ -1593,9 +1438,9 @@ dependencies = [ [[package]] name = "http-body-util" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9f41fd6a08e4d4ec69df65976da761afd5ad5e58a9d4acb46bd1c953a9e3ff2" +checksum = "23169fe34a5fbcdd3f3862e78fb9b6fccd5f02a6dc6f732547005d45631ce71c" dependencies = [ "bytes", "futures-core", @@ -1621,13 +1466,12 @@ dependencies = [ [[package]] name = "hyper" -version = "1.11.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d22053281f852e11534f5198498373cbb59295120a20771d90f7ed1897490a72" +checksum = "229c6ff5584df4c6becbfe00567128bac768c8cd32ebc8a8366bd81ed072e8f3" dependencies = [ "atomic-waker", "bytes", - "futures-channel", "futures-core", "http", "http-body", @@ -1641,16 +1485,17 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.20" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" +checksum = "ddc03d96684f9226b8a787cdb71488417b53ab5ea8fdb1dac946cb9431cc8bff" dependencies = [ - "base64 0.22.1", + "base64 0.23.1", "bytes", "futures-channel", "futures-util", "http", "http-body", + "httparse", "hyper", "ipnet", "libc", @@ -1698,9 +1543,9 @@ dependencies = [ [[package]] name = "icu_collections" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" +checksum = "fe090a42a0d3140fed8c63263ed1fecc02422cb2f4bfe55cd8de2de1b8e105dd" dependencies = [ "displaydoc", "potential_utf", @@ -1712,9 +1557,9 @@ dependencies = [ [[package]] name = "icu_locale_core" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" +checksum = "25d29b57c17c6528d0dc4c2141cfa2d08200465acb537a3909c8b9b8a4a984c0" dependencies = [ "displaydoc", "litemap", @@ -1725,9 +1570,9 @@ dependencies = [ [[package]] name = "icu_normalizer" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" +checksum = "404a3b8c486f205c87fe7f23ab6894d84a4ad76d6e4671ae1981ba7def87c599" dependencies = [ "icu_collections", "icu_normalizer_data", @@ -1739,16 +1584,17 @@ dependencies = [ [[package]] name = "icu_normalizer_data" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" +checksum = "20f0088bfb7441f7a37fa0c9e20cb1e9cba1cac6b9ce8cd2a6dc44294f8e8cbc" [[package]] name = "icu_properties" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" +checksum = "2ea83d991c56158f7cf898bf86436c1dfe7c07ee82fe88951f2695c9f37a379f" dependencies = [ + "displaydoc", "icu_collections", "icu_locale_core", "icu_properties_data", @@ -1759,15 +1605,15 @@ dependencies = [ [[package]] name = "icu_properties_data" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" +checksum = "b98f29af82d02b163fe50161388350e743bb3107cc8e8c2f7314cb505faddfcf" [[package]] name = "icu_provider" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" +checksum = "413099315636c588ee8f011190b329b971a09a8fae9d157e01dcae8379468514" dependencies = [ "displaydoc", "icu_locale_core", @@ -1818,12 +1664,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.14.0" +version = "2.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" +checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855" dependencies = [ "equivalent", - "hashbrown 0.17.1", + "hashbrown 0.17.2", "serde", "serde_core", ] @@ -1839,37 +1685,141 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.12.1" +version = "2.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a756c3fac73139e83f14c2d742155dd2b78d3ee56597b419a0579b7bdd6dd78" +checksum = "007d6e6b91097094791302ccc6cd0588e0700ddac5c6829035bcd71eff4dc433" [[package]] name = "itoa" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" +checksum = "3bd1574e617a9a6c1f8f8181bd7e841e1f20e4277607ef28945765188d6284d4" [[package]] name = "javascriptcore-rs" -version = "1.1.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca5671e9ffce8ffba57afc24070e906da7fc4b1ba66f2cabebf61bf2ea257fcc" +checksum = "7481d6ae0ba570cd25ac36481911395bb00715859d520da3444ad77c08762baa" dependencies = [ - "bitflags 1.3.2", + "bitflags", "glib", "javascriptcore-rs-sys", ] [[package]] name = "javascriptcore-rs-sys" -version = "1.1.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af1be78d14ffa4b75b66df31840478fef72b51f8c2465d4ca7c194da9f7a5124" +checksum = "a6d0ad3598dd4db3a85224e1447764b62f3762c9298892474a2cf3ccd1cd11ff" dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps", + "system-deps 9.0.1", +] + +[[package]] +name = "jiff" +version = "0.2.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175dc66334db3b9ab9985bf8b61cfed50dc16d20964bb47f9e479adcae984a7f" +dependencies = [ + "jiff-core 0.1.8", + "jiff-static 0.2.46", + "jiff-tzdb-platform 0.1.3", + "log", + "portable-atomic", + "portable-atomic-util", + "serde_core", + "windows-link 0.2.1", +] + +[[package]] +name = "jiff" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "379ed44bd4e16d3926160e2b3a78b79ca0952ef5c037f124f554842ba272ef92" +dependencies = [ + "jiff-core 1.1.0", + "jiff-static 1.1.0", + "jiff-tzdb-platform 1.0.0", + "log", + "portable-atomic", + "portable-atomic-util", + "serde_core", + "windows-link 0.2.1", +] + +[[package]] +name = "jiff-core" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e599b80292e597019b8b3e392de3f4bea2959ddfb8c7dff60e035e9e311a2c1b" +dependencies = [ + "log", +] + +[[package]] +name = "jiff-core" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0df46fc314b4f458aee614afcd8676ed6cb3637413aa359d47d2646cbc038b79" +dependencies = [ + "log", +] + +[[package]] +name = "jiff-static" +version = "0.2.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7b1af7547d47354bc438d797e3854601bde8f8d185780c5ba4ab27afa54f1ba" +dependencies = [ + "jiff-core 0.1.8", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "jiff-static" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b729c549d3efb5855b3c80b0ee8ee1850d56330a127382fe2760965741c1f3" +dependencies = [ + "jiff-core 1.1.0", + "proc-macro2", + "quote", + "syn 3.0.10", +] + +[[package]] +name = "jiff-tzdb" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0980fca2cc272465bd60e82397607ba9f33add9e48defd77923301bbd03808f2" + +[[package]] +name = "jiff-tzdb" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12e71a1b68a875a44a33bb7a1dd84392cb77145a3367a552a3cfe6a4f5cf3afc" + +[[package]] +name = "jiff-tzdb-platform" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "875a5a69ac2bab1a891711cf5eccbec1ce0341ea805560dcd90b7a2e925132e8" +dependencies = [ + "jiff-tzdb 0.1.10", +] + +[[package]] +name = "jiff-tzdb-platform" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc65b284afcfa8f6cf189c7274c805505314a7ab975c60e1f548bff56525420e" +dependencies = [ + "jiff-tzdb 1.0.0", ] [[package]] @@ -1918,9 +1868,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.104" +version = "0.3.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e0c1080212aad755ea003d18543e8768dd432c48819efd73a7bf1e39b7a5a3a" +checksum = "8dc09d2154098bbf4ef54eab6b117a3c24cbbffe94046b16ee6d6d4510584d3a" dependencies = [ "cfg-if", "futures-util", @@ -1929,21 +1879,21 @@ dependencies = [ [[package]] name = "json-patch" -version = "4.2.0" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7421438de105a0827e44fadd05377727847d717c80ce29a229f85fd04c427b72" +checksum = "aa295c8f71b9bad32d060e0e145f96dcba0cc6c6171e129646140d1c96b05617" dependencies = [ "jsonptr", "serde", "serde_json", - "thiserror 2.0.20", + "thiserror 2.0.21", ] [[package]] name = "jsonptr" -version = "0.7.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5a3cc660ba5d72bce0b3bb295bf20847ccbb40fd423f3f05b61273672e561fe" +checksum = "72c22d99362c7aac7d77efab6b49c2181674b165d7e6e7c755b3432ded64bf51" dependencies = [ "serde", "serde_json", @@ -1955,7 +1905,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fbe853b403ae61a04233030ae8a79d94975281ed9770a1f9e246732b534b28d" dependencies = [ - "bitflags 2.13.1", + "bitflags", "serde", ] @@ -1975,33 +1925,29 @@ dependencies = [ [[package]] name = "libappindicator" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03589b9607c868cc7ae54c0b2a22c8dc03dd41692d48f2d7df73615c6a95dc0a" +checksum = "f57fd42f20edd22ee374ebcedda7bdecd1d5d1e76f11880d9ff2898ed2150d76" dependencies = [ - "glib", "gtk", - "gtk-sys", "libappindicator-sys", - "log", ] [[package]] name = "libappindicator-sys" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e9ec52138abedcc58dc17a7c6c0c00a2bdb4f3427c7f63fa97fd0d859155caf" +checksum = "0b76d3d67eb285f611b14654cd097f52eb7e83acc2b59913147f8ac695b61149" dependencies = [ "gtk-sys", - "libloading", - "once_cell", + "libloading 0.9.1", ] [[package]] name = "libc" -version = "0.2.189" +version = "0.2.191" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" +checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a" [[package]] name = "libdbus-sys" @@ -2014,19 +1960,29 @@ dependencies = [ [[package]] name = "libloading" -version = "0.7.4" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" dependencies = [ "cfg-if", - "winapi", + "windows-link 0.2.1", +] + +[[package]] +name = "libloading" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1832accd5a4ca2795ace4d05d15c4039be15b62d3b950eff99746a990e3cc10" +dependencies = [ + "cfg-if", + "windows-link 0.2.1", ] [[package]] name = "libredox" -version = "0.1.19" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2026a5056764a10b2bf5d56488cba40da507f5493a6a429340e2004d9ed085fa" +checksum = "61ff90caf6077a803a240f62fdbe88645a890bbca49ef8174c3cb0404362171d" dependencies = [ "libc", ] @@ -2045,9 +2001,9 @@ checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" [[package]] name = "litemap" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" +checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae" [[package]] name = "lock_api" @@ -2060,30 +2016,19 @@ dependencies = [ [[package]] name = "log" -version = "0.4.33" +version = "0.4.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" +checksum = "5d15f86d12da44cd8d4ec3c73984537eb7f4cadcb9776a575a0a8a05ca11005c" [[package]] name = "markup5ever" -version = "0.39.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7122d987ec5f704ee56f6e5b41a7d93722e9aae27ae07cafa4036c4d3f9757de" +checksum = "0ab3dc68ac4a0f5719e560136778c1ee716e296030d75dbd4484e37e39e3a842" dependencies = [ "log", "tendril", - "web_atoms 0.2.5", -] - -[[package]] -name = "markup5ever" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab3dc68ac4a0f5719e560136778c1ee716e296030d75dbd4484e37e39e3a842" -dependencies = [ - "log", - "tendril", - "web_atoms 0.3.0", + "web_atoms", ] [[package]] @@ -2103,9 +2048,9 @@ dependencies = [ [[package]] name = "mime" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +checksum = "d5848f5a9e8117cf94f2f90faac24a87ff81600ff8628c1e3deaab572e76bfa1" [[package]] name = "miniz_oxide" @@ -2117,11 +2062,21 @@ dependencies = [ "simd-adler32", ] +[[package]] +name = "miniz_oxide" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b63fbc4a50860e98e7b2aa7804ded1db5cbc3aff9193adaff57a6931bf7c4b4c" +dependencies = [ + "adler2", + "simd-adler32", +] + [[package]] name = "mio" -version = "1.2.2" +version = "1.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d65c71f1ce40ab09135ce117d742b9f8a19ff91a41a8b57ed50bc2de59c427" +checksum = "20521a903f02b0a573cd6840e9d0a5a0cc043d361fe924092cd70f8556cc9c4a" dependencies = [ "libc", "wasi", @@ -2130,22 +2085,22 @@ dependencies = [ [[package]] name = "muda" -version = "0.20.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cca139e57da4383727f189e43e66e84fa372347027fc996f9f1a007ec0a37996" +checksum = "fe2b1ef95ccb2983c8459d869337c0d5a9e2a2c52b32a994f185111cb59f9b52" dependencies = [ "crossbeam-channel", "dpi", "gtk", "keyboard-types", + "libc", "objc2", "objc2-app-kit", "objc2-core-foundation", "objc2-foundation", - "once_cell", "png", "serde", - "thiserror 2.0.20", + "thiserror 2.0.21", "windows-sys 0.61.2", ] @@ -2155,7 +2110,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" dependencies = [ - "bitflags 2.13.1", + "bitflags", "jni-sys 0.3.1", "log", "ndk-sys", @@ -2187,17 +2142,19 @@ checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" [[package]] name = "nova-desktop" -version = "0.1.0" +version = "0.2.0" dependencies = [ + "base64 0.22.1", "getrandom 0.3.4", "keyring", + "reqwest 0.12.28", + "rfd", "serde", "serde_json", "tauri", "tauri-build", - "tauri-plugin-deep-link", - "tauri-plugin-dialog", "tauri-plugin-single-instance", + "url", ] [[package]] @@ -2231,7 +2188,7 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "680998035259dcfcafe653688bf2aa6d3e2dc05e98be6ab46afb089dc84f1df8" dependencies = [ - "proc-macro-crate 3.5.0", + "proc-macro-crate", "proc-macro2", "quote", "syn 2.0.119", @@ -2239,9 +2196,9 @@ dependencies = [ [[package]] name = "objc2" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a12a8ed07aefc768292f076dc3ac8c48f3781c8f2d5851dd3d98950e8c5a89f" +checksum = "08849bbd4767dfae9457696856ae1c84fe4e0281bbe4a7abff2d0e06fb7981f8" dependencies = [ "objc2-encode", "objc2-exception-helper", @@ -2253,7 +2210,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d49e936b501e5c5bf01fda3a9452ff86dc3ea98ad5f283e1455153142d97518c" dependencies = [ - "bitflags 2.13.1", + "bitflags", "block2", "objc2", "objc2-core-foundation", @@ -2267,7 +2224,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73ad74d880bb43877038da939b7427bba67e9dd42004a18b809ba7d87cee241c" dependencies = [ - "bitflags 2.13.1", + "bitflags", "objc2", "objc2-foundation", ] @@ -2288,7 +2245,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" dependencies = [ - "bitflags 2.13.1", + "bitflags", "dispatch2", "objc2", ] @@ -2299,7 +2256,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e022c9d066895efa1345f8e33e584b9f958da2fd4cd116792e15e07e4720a807" dependencies = [ - "bitflags 2.13.1", + "bitflags", "dispatch2", "objc2", "objc2-core-foundation", @@ -2332,7 +2289,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0cde0dfb48d25d2b4862161a4d5fcc0e3c24367869ad306b0c9ec0073bfed92d" dependencies = [ - "bitflags 2.13.1", + "bitflags", "objc2", "objc2-core-foundation", "objc2-core-graphics", @@ -2359,9 +2316,8 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272" dependencies = [ - "bitflags 2.13.1", + "bitflags", "block2", - "libc", "objc2", "objc2-core-foundation", ] @@ -2372,7 +2328,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "180788110936d59bab6bd83b6060ffdfffb3b922ba1396b312ae795e1de9d81d" dependencies = [ - "bitflags 2.13.1", + "bitflags", "objc2", "objc2-core-foundation", ] @@ -2383,7 +2339,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96c1358452b371bf9f104e21ec536d37a650eb10f7ee379fff67d2e08d537f1f" dependencies = [ - "bitflags 2.13.1", + "bitflags", "objc2", "objc2-core-foundation", "objc2-foundation", @@ -2395,7 +2351,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d87d638e33c06f577498cbcc50491496a3ed4246998a7fbba7ccb98b1e7eab22" dependencies = [ - "bitflags 2.13.1", + "bitflags", "block2", "objc2", "objc2-cloud-kit", @@ -2426,7 +2382,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2e5aaab980c433cf470df9d7af96a7b46a9d892d521a2cbbb2f8a4c16751e7f" dependencies = [ - "bitflags 2.13.1", + "bitflags", "block2", "objc2", "objc2-app-kit", @@ -2446,16 +2402,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" -[[package]] -name = "ordered-multimap" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49203cdcae0030493bad186b28da2fa25645fa276a51b6fec8010d281e02ef79" -dependencies = [ - "dlv-list", - "hashbrown 0.14.5", -] - [[package]] name = "ordered-stream" version = "0.2.0" @@ -2468,27 +2414,25 @@ dependencies = [ [[package]] name = "pango" -version = "0.18.3" +version = "0.22.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ca27ec1eb0457ab26f3036ea52229edbdb74dee1edd29063f5b9b010e7ebee4" +checksum = "0b2022dbbd82e1c42bd950a6f1df9b98c796e725dce5ec275e03cbf9772e4efa" dependencies = [ "gio", "glib", - "libc", - "once_cell", "pango-sys", ] [[package]] name = "pango-sys" -version = "0.18.0" +version = "0.22.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436737e391a843e5933d6d9aa102cb126d501e815b83601365a948a518555dc5" +checksum = "dd6be7bdb6cde4c49703315c1818a14382ce500dce57179a8d05f1c5efe4955f" dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps", + "system-deps 9.0.1", ] [[package]] @@ -2517,7 +2461,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-link", + "windows-link 0.2.1", ] [[package]] @@ -2526,56 +2470,25 @@ version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" -[[package]] -name = "phf" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf" -dependencies = [ - "phf_macros 0.13.1", - "phf_shared 0.13.1", - "serde", -] - [[package]] name = "phf" version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "010378780309880b08997fae13be7834dba947d36393bd372f2b1556deb2a2f6" dependencies = [ - "phf_macros 0.14.0", - "phf_shared 0.14.0", + "phf_macros", + "phf_shared", "serde", ] -[[package]] -name = "phf_codegen" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49aa7f9d80421bca176ca8dbfebe668cc7a2684708594ec9f3c0db0805d5d6e1" -dependencies = [ - "phf_generator 0.13.1", - "phf_shared 0.13.1", -] - [[package]] name = "phf_codegen" version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41b585a510fb76fdebead6897982ef2a03a21d8e6cbcca904999742a4afc6ffe" dependencies = [ - "phf_generator 0.14.0", - "phf_shared 0.14.0", -] - -[[package]] -name = "phf_generator" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737" -dependencies = [ - "fastrand", - "phf_shared 0.13.1", + "phf_generator", + "phf_shared", ] [[package]] @@ -2585,20 +2498,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aeb62e0959d5a1bebc965f4d15d9e2b7cea002b6b0f5ba8cde6cc26738467100" dependencies = [ "fastrand", - "phf_shared 0.14.0", -] - -[[package]] -name = "phf_macros" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef" -dependencies = [ - "phf_generator 0.13.1", - "phf_shared 0.13.1", - "proc-macro2", - "quote", - "syn 2.0.119", + "phf_shared", ] [[package]] @@ -2607,22 +2507,13 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5fa8d0ca26d424d27630da600c6624696e7dec8bf7b3b492b383c5dc49e5e085" dependencies = [ - "phf_generator 0.14.0", - "phf_shared 0.14.0", + "phf_generator", + "phf_shared", "proc-macro2", "quote", "syn 2.0.119", ] -[[package]] -name = "phf_shared" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266" -dependencies = [ - "siphasher", -] - [[package]] name = "phf_shared" version = "0.14.0" @@ -2634,9 +2525,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.17" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" +checksum = "f120c8d5021b34abd2f2ffd7ee96687cbcd6c54a3e68d86b6169f4a5cd480ffe" [[package]] name = "piper" @@ -2651,19 +2542,19 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.33" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" +checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548" [[package]] name = "plist" -version = "1.10.0" +version = "1.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da1d65da6dd5d1e44199ac0f58712d241c0f439f80adea8924d832384087f85" +checksum = "cb7a42747bbcc4374e6922a15040dccacf720e4ce48a77e668f7116b9aa19a0a" dependencies = [ - "base64 0.22.1", - "indexmap 2.14.0", - "quick-xml", + "base64 0.23.1", + "indexmap 2.14.2", + "quick-xml 0.42.0", "serde", "time", ] @@ -2674,11 +2565,11 @@ version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60769b8b31b2a9f263dae2776c37b1b28ae246943cf719eb6946a1db05128a61" dependencies = [ - "bitflags 2.13.1", + "bitflags", "crc32fast", "fdeflate", "flate2", - "miniz_oxide", + "miniz_oxide 0.8.9", ] [[package]] @@ -2696,77 +2587,54 @@ dependencies = [ ] [[package]] -name = "potential_utf" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" -dependencies = [ - "zerovec", -] - -[[package]] -name = "powerfmt" -version = "0.2.0" +name = "pollster" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" +checksum = "2f3a9f18d041e6d0e102a0a46750538147e5e8992d3b4873aaafee2520b00ce3" [[package]] -name = "precomputed-hash" -version = "0.1.1" +name = "portable-atomic" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" +checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85" [[package]] -name = "proc-macro-crate" -version = "1.3.1" +name = "portable-atomic-util" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +checksum = "10ab3eb7f3becc3a1cbc4f2c6f20267996cfc1a6467a873763411b136a122715" dependencies = [ - "once_cell", - "toml_edit 0.19.15", + "portable-atomic", ] [[package]] -name = "proc-macro-crate" -version = "2.0.2" +name = "potential_utf" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" +checksum = "d83eb9bc6d8e5cf568e7a1101d60ee05e81ed50ea106026f3d18deeb046d7661" dependencies = [ - "toml_datetime 0.6.3", - "toml_edit 0.20.2", + "zerovec", ] [[package]] -name = "proc-macro-crate" -version = "3.5.0" +name = "powerfmt" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" -dependencies = [ - "toml_edit 0.25.13+spec-1.1.0", -] +checksum = "4a6394b9e965e73d0a289ee54f589087e2c676aedf60885baf52c76b771e4958" [[package]] -name = "proc-macro-error" -version = "1.0.4" +name = "precomputed-hash" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] -name = "proc-macro-error-attr" -version = "1.0.4" +name = "proc-macro-crate" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" dependencies = [ - "proc-macro2", - "quote", - "version_check", + "toml_edit", ] [[package]] @@ -2787,6 +2655,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "quick-xml" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41b1177fdf999d2321d3fb46ff47159d9c1fb9ad66a4879f8c50a0b504615e9b" +dependencies = [ + "memchr", +] + [[package]] name = "quote" version = "1.0.47" @@ -2820,45 +2697,44 @@ version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" dependencies = [ - "bitflags 2.13.1", + "bitflags", ] [[package]] name = "redox_users" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" +checksum = "60dc65c0ff1a7ae1294b0c67b9f14baf70b644404010370171787bfac1038fc0" dependencies = [ - "getrandom 0.2.17", "libredox", - "thiserror 2.0.20", + "thiserror 2.0.21", ] [[package]] name = "ref-cast" -version = "1.0.26" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216e8f773d7923bcba9ceb86a86c93cabb3903a11872fc3f138c49630e50b96d" +checksum = "7e440fb4e4b4147295338efb76001ab9e4efc0e5839df2c47fc5ac2381d365c3" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.26" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9283685feec7d69af75fb0e858d5e7378f33fe4fc699383b2916ab9273e03c" +checksum = "92ecd8964f8453721699a1ed72037b0db49ce2f5a5138486ee89bed6f67cdf3a" dependencies = [ "proc-macro2", "quote", - "syn 3.0.3", + "syn 3.0.10", ] [[package]] name = "regex" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d" +checksum = "9807af0e638c12e753aa1b4e601791bf2a8f71274023c8bbeec12fc149950857" dependencies = [ "aho-corasick", "memchr", @@ -2868,9 +2744,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.18" +version = "0.4.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2" +checksum = "41d60ef07df457506a0a1a2073112eb4aae5733dbd2813c3da77d1b0fd441158" dependencies = [ "aho-corasick", "memchr", @@ -2879,18 +2755,52 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" +checksum = "d902046e6a28a1e4c3cab97258a0ce11e994903f01c2d97a9447a0b3df85f4f6" [[package]] name = "reqwest" -version = "0.13.4" +version = "0.12.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "219c5811de6525e5416c7d5d53bb656d3afdbc6c5af816e0802bcfa42dbdc1c3" +checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" dependencies = [ "base64 0.22.1", "bytes", + "futures-channel", + "futures-core", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "js-sys", + "log", + "percent-encoding", + "pin-project-lite", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "reqwest" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16a1cfa75cc186dd73d5818e510e042e40927bccc9c236b061cea97e1eb08029" +dependencies = [ + "base64 0.23.1", + "bytes", "futures-core", "futures-util", "http", @@ -2925,9 +2835,6 @@ checksum = "20dafead71c16a34e1ff357ddefc8afc11e7d51d6d2b9fbd07eaa48e3e540220" dependencies = [ "block2", "dispatch2", - "glib-sys", - "gobject-sys", - "gtk-sys", "js-sys", "libc", "log", @@ -2936,23 +2843,17 @@ dependencies = [ "objc2-core-foundation", "objc2-foundation", "percent-encoding", + "pollster", "raw-window-handle", "wasm-bindgen", "wasm-bindgen-futures", + "wayland-backend", + "wayland-client", + "wayland-protocols", "web-sys", "windows-sys 0.61.2", ] -[[package]] -name = "rust-ini" -version = "0.21.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "796e8d2b6696392a43bea58116b667fb4c29727dc5abd27d6acf338bb4f688c7" -dependencies = [ - "cfg-if", - "ordered-multimap", -] - [[package]] name = "rustc-hash" version = "2.1.3" @@ -2974,7 +2875,7 @@ version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa" dependencies = [ - "bitflags 2.13.1", + "bitflags", "errno", "libc", "linux-raw-sys", @@ -2987,6 +2888,12 @@ version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" +[[package]] +name = "ryu" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" + [[package]] name = "same-file" version = "1.0.6" @@ -3003,7 +2910,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615" dependencies = [ "dyn-clone", - "indexmap 1.9.3", "schemars_derive", "serde", "serde_json", @@ -3025,9 +2931,9 @@ dependencies = [ [[package]] name = "schemars" -version = "1.2.2" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "687274d293b6cdc6e73e0fee520bf2049650090d7164f87672d212a3c530cf4a" +checksum = "ab508826f74a77ca9d5aba6ff19b522583ee3eaf28a19384ff3d0e5835fadf6e" dependencies = [ "dyn-clone", "ref-cast", @@ -3047,6 +2953,12 @@ dependencies = [ "syn 2.0.119", ] +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + [[package]] name = "scopeguard" version = "1.2.0" @@ -3059,7 +2971,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.13.1", + "bitflags", "core-foundation 0.9.4", "core-foundation-sys", "libc", @@ -3072,7 +2984,7 @@ version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" dependencies = [ - "bitflags 2.13.1", + "bitflags", "core-foundation 0.10.1", "core-foundation-sys", "libc", @@ -3089,39 +3001,20 @@ dependencies = [ "libc", ] -[[package]] -name = "selectors" -version = "0.38.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8adfa1c298912827b8a28b223b3b874357397ae706e6190acd9bf28cee99114d" -dependencies = [ - "bitflags 2.13.1", - "cssparser 0.37.0", - "derive_more", - "log", - "new_debug_unreachable", - "phf 0.13.1", - "phf_codegen 0.13.1", - "precomputed-hash", - "rustc-hash", - "servo_arc 0.4.3", - "smallvec", -] - [[package]] name = "selectors" version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8322aebea94a6cc288ff884e8a49bdbceef60206c400c6c46d22e62fc4fd91a6" dependencies = [ - "bitflags 2.13.1", - "cssparser 0.38.0", + "bitflags", + "cssparser", "derive_more", "log", "new_debug_unreachable", "precomputed-hash", "rustc-hash", - "servo_arc 0.5.0", + "servo_arc", "smallvec", ] @@ -3174,7 +3067,7 @@ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" dependencies = [ "proc-macro2", "quote", - "syn 3.0.3", + "syn 3.0.10", ] [[package]] @@ -3190,9 +3083,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.151" +version = "1.0.154" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14" +checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6" dependencies = [ "itoa", "memchr", @@ -3209,41 +3102,46 @@ checksum = "8d3b1629de253c70a0508c3899572da79ca359fdab27c7920ff00406df418906" dependencies = [ "proc-macro2", "quote", - "syn 3.0.3", + "syn 3.0.10", ] [[package]] name = "serde_spanned" -version = "0.6.9" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" +checksum = "9c187e0a369471c550af028cba56d4f4fa2a489ad28151ae95a4d340a2a8b782" dependencies = [ - "serde", + "serde_core", ] [[package]] -name = "serde_spanned" -version = "1.1.1" +name = "serde_urlencoded" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ - "serde_core", + "form_urlencoded", + "itoa", + "ryu", + "serde", ] [[package]] name = "serde_with" -version = "3.21.0" +version = "3.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76a5c54c7310e7b8b9577c286d7e399ddd876c3e12b3ed917a8aabc4b96e9e8c" +checksum = "56cb1ca7c93ae63d6439b5250f6b6b040f7e121f32e5dd2f5d523dd4149b3204" dependencies = [ - "base64 0.22.1", + "base64 0.23.1", "bs58", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.14.0", + "indexmap 2.14.2", + "jiff 0.2.46", + "jiff 1.1.0", "schemars 0.9.0", - "schemars 1.2.2", + "schemars 1.2.3", "serde_core", "serde_json", "serde_with_macros", @@ -3252,14 +3150,14 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.21.0" +version = "3.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84d57bc0c8b9a17920c178daa6bb924850d54a9c97ab45194bb8c17ad66bb660" +checksum = "cff15a7c864bbec77d9586ca6822bc7c369bdf19e9243134a62b0b51ce26b31f" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.10", ] [[package]] @@ -3284,15 +3182,6 @@ dependencies = [ "syn 2.0.119", ] -[[package]] -name = "servo_arc" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "170fb83ab34de17dc69aa7c67482b22218ddb85da56546f9bd6b929e32a05930" -dependencies = [ - "stable_deref_trait", -] - [[package]] name = "servo_arc" version = "0.5.0" @@ -3304,24 +3193,13 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" -dependencies = [ - "cfg-if", - "cpufeatures 0.2.17", - "digest 0.10.7", -] - -[[package]] -name = "sha2" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0e5c7d67bc53f435386b2130fdc900488c5703770f6d8a4633060e34288a27" +checksum = "820083d430c52864bf834423fc988cbcf61685d6f9d22a765a64e3f6cfe3521c" dependencies = [ "cfg-if", - "cpufeatures 0.3.1", - "digest 0.11.3", + "cpufeatures", + "digest", ] [[package]] @@ -3348,9 +3226,9 @@ checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea" [[package]] name = "siphasher" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ee5873ec9cce0195efcb7a4e9507a04cd49aec9c83d0389df45b1ef7ba2e649" +checksum = "33f4fe9184a62d842c9ef383018f3306d8ba224fd9d836f56d7288308847c256" [[package]] name = "slab" @@ -3360,9 +3238,9 @@ checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" [[package]] name = "smallvec" -version = "1.15.2" +version = "1.16.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90" +checksum = "3244542535d5de959d90ec55d1b5ff0fd2bb7b1310223907d5f11932847f7b59" [[package]] name = "socket2" @@ -3398,9 +3276,9 @@ dependencies = [ [[package]] name = "soup3" -version = "0.5.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "471f924a40f31251afc77450e781cb26d55c0b650842efafc9c6cbd2f7cc4f9f" +checksum = "92d38b59ff6d302538efd337e15d04d61c5b909ec223c60ae4061d74605a962a" dependencies = [ "futures-channel", "gio", @@ -3411,15 +3289,15 @@ dependencies = [ [[package]] name = "soup3-sys" -version = "0.5.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebe8950a680a12f24f15ebe1bf70db7af98ad242d9db43596ad3108aab86c27" +checksum = "79d5d25225bb06f83b78ff8cc35973b56d45fcdd21af6ed6d2bbd67f5a6f9bea" dependencies = [ "gio-sys", "glib-sys", "gobject-sys", "libc", - "system-deps", + "system-deps 7.0.8", ] [[package]] @@ -3434,18 +3312,6 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff7589a1859b09232522bb9edf076ca7fcf14ded96685d3fa629db73023ffbb7" -[[package]] -name = "string_cache" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18596f8c785a729f2819c0f6a7eae6ebeebdfffbfe4214ae6b087f690e31901" -dependencies = [ - "new_debug_unreachable", - "parking_lot", - "phf_shared 0.13.1", - "precomputed-hash", -] - [[package]] name = "string_cache" version = "0.11.0" @@ -3454,30 +3320,18 @@ checksum = "ffa8a5dbe8b3f0bbe29d4c3225daafaeead63afdc1b65fc4c01a1384166038e6" dependencies = [ "new_debug_unreachable", "parking_lot", - "phf_shared 0.14.0", + "phf_shared", "precomputed-hash", ] -[[package]] -name = "string_cache_codegen" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585635e46db231059f76c5849798146164652513eb9e8ab2685939dd90f29b69" -dependencies = [ - "phf_generator 0.13.1", - "phf_shared 0.13.1", - "proc-macro2", - "quote", -] - [[package]] name = "string_cache_codegen" version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "928dcdf75e47626b3617a976ec205d9f057584c371c1f23b782129268d0e6edc" dependencies = [ - "phf_generator 0.14.0", - "phf_shared 0.14.0", + "phf_generator", + "phf_shared", "proc-macro2", "quote", ] @@ -3499,16 +3353,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "unicode-ident", -] - [[package]] name = "syn" version = "2.0.119" @@ -3522,9 +3366,9 @@ dependencies = [ [[package]] name = "syn" -version = "3.0.3" +version = "3.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" +checksum = "4ae9ccbea3a7b0b09443036490c8f34a8b1b760fd345e5c0dae0aac718faea79" dependencies = [ "proc-macro2", "quote", @@ -3542,35 +3386,49 @@ dependencies = [ [[package]] name = "synstructure" -version = "0.13.2" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "901704edd0dfe137f1987838ee4f259e4e063c31371bdb423f7ae38ec6f77f02" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.10", +] + +[[package]] +name = "system-deps" +version = "7.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +checksum = "396a35feb67335377e0251fcbc1092fc85c484bd4e3a7a54319399da127796e7" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.119", + "cfg-expr", + "heck", + "pkg-config", + "toml", + "version-compare", ] [[package]] name = "system-deps" -version = "6.2.2" +version = "9.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" +checksum = "db551ad38aac61d5e0343e0eeeb0163be3115c4e23b6a025959570ee0c03c67d" dependencies = [ "cfg-expr", - "heck 0.5.0", + "heck", "pkg-config", - "toml 0.8.2", + "toml", "version-compare", ] [[package]] name = "tao" -version = "0.37.3" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02ca9c0ce2a2fd70dc4ef4449ca5e8d30e6fa0db111cd8008594602a06a68371" +checksum = "018765afffb658648fbdfa825af8f117ceee0499296811802d8359663932e7b7" dependencies = [ - "bitflags 2.13.1", + "async-channel", + "bitflags", "block2", "core-foundation 0.10.1", "core-graphics", @@ -3617,15 +3475,15 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.16" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" +checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca" [[package]] name = "tauri" -version = "2.12.7" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30fbfbb9dc9a2697b0e96d909ddc295fb18d2d82a58ed542ab8d9eba2edbe6da" +checksum = "ad570590a6620bd7a767910958cdc581308bef2ccae4a2b794f0347aa5169b75" dependencies = [ "anyhow", "bytes", @@ -3636,7 +3494,7 @@ dependencies = [ "getrandom 0.3.4", "glob", "gtk", - "heck 0.5.0", + "heck", "http", "jni", "libc", @@ -3651,7 +3509,7 @@ dependencies = [ "percent-encoding", "plist", "raw-window-handle", - "reqwest", + "reqwest 0.13.5", "serde", "serde_json", "serde_repr", @@ -3662,7 +3520,7 @@ dependencies = [ "tauri-runtime", "tauri-runtime-wry", "tauri-utils", - "thiserror 2.0.20", + "thiserror 2.0.21", "tokio", "tray-icon", "url", @@ -3674,19 +3532,16 @@ dependencies = [ [[package]] name = "tauri-build" -version = "2.7.6" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73d80784e874fa117b9b00a6680cf2f9b8a51bbd14406bea980cf8f328b00646" +checksum = "97cc0781e9d66f684d7150507d5423fc05322312ddfd12f24c30e833cf183153" dependencies = [ "anyhow", "cargo_toml", "dirs", "glob", - "heck 0.5.0", "json-patch", - "schemars 0.8.22", "semver", - "serde", "serde_json", "static_vcruntime", "strsim", @@ -3697,9 +3552,9 @@ dependencies = [ [[package]] name = "tauri-codegen" -version = "2.7.6" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5dc6caab4da5646f57648f39b794bae118f0dd4a4305eeb8c892966171f4852" +checksum = "96c0e6d4ad77790f6da7ac445f1a8908211785e5324bb6a9662582f3ac127231" dependencies = [ "base64 0.23.1", "brotli", @@ -3710,25 +3565,22 @@ dependencies = [ "proc-macro2", "quote", "semver", - "serde", "serde_json", - "sha2 0.11.2", + "sha2", "syn 2.0.119", "tauri-utils", - "thiserror 2.0.20", - "time", - "url", + "thiserror 2.0.21", "uuid", "walkdir", ] [[package]] name = "tauri-macros" -version = "2.7.6" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2831c5da8603a96b1efc0b650c2cb6decc69b6cda257d815fe70c7f5be53818e" +checksum = "564854181dbca954a49e852140be2d810c4fc3e882538e8f530bb197bd69cfec" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", "syn 2.0.119", @@ -3736,85 +3588,6 @@ dependencies = [ "tauri-utils", ] -[[package]] -name = "tauri-plugin" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c18076d9b04211cb4899387aab97497e8edd0d02cd21710623afcdde27145d1" -dependencies = [ - "anyhow", - "glob", - "plist", - "schemars 0.8.22", - "serde", - "serde_json", - "tauri-utils", - "walkdir", -] - -[[package]] -name = "tauri-plugin-deep-link" -version = "2.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab551d9bec27bb79d1c7fe5ed38c5cfd1cebb86efa745acc65f5853f345f6e56" -dependencies = [ - "dunce", - "plist", - "rust-ini", - "serde", - "serde_json", - "tauri", - "tauri-plugin", - "tauri-utils", - "thiserror 2.0.20", - "tracing", - "url", - "windows-registry", - "windows-result", -] - -[[package]] -name = "tauri-plugin-dialog" -version = "2.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce0fb9c2b6d34a9720627ed930ebc8af26f61e648695aecaeb03d5c33c5896f5" -dependencies = [ - "log", - "raw-window-handle", - "rfd", - "serde", - "serde_json", - "tauri", - "tauri-plugin", - "tauri-plugin-fs", - "thiserror 2.0.20", - "url", -] - -[[package]] -name = "tauri-plugin-fs" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d58eb1d4984e535f47a642ffec09a2da6f5c18a12b5902d12126cb7626d628b" -dependencies = [ - "anyhow", - "dunce", - "glob", - "log", - "objc2-foundation", - "percent-encoding", - "schemars 0.8.22", - "serde", - "serde_json", - "serde_repr", - "tauri", - "tauri-plugin", - "tauri-utils", - "thiserror 2.0.20", - "toml 1.1.4+spec-1.1.0", - "url", -] - [[package]] name = "tauri-plugin-single-instance" version = "2.5.5" @@ -3824,8 +3597,7 @@ dependencies = [ "serde", "serde_json", "tauri", - "tauri-plugin-deep-link", - "thiserror 2.0.20", + "thiserror 2.0.21", "tokio", "tracing", "windows-sys 0.61.2", @@ -3834,9 +3606,9 @@ dependencies = [ [[package]] name = "tauri-runtime" -version = "2.12.4" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60c2b14bd5265b63993cdc34ad526fb836e0fd0cf64a4634a895db0784844d5e" +checksum = "33ebc9c0fc7a10f26169edd4adcc8798030cd025b2621791fe7f7e0330105c68" dependencies = [ "cookie", "dpi", @@ -3850,7 +3622,7 @@ dependencies = [ "serde", "serde_json", "tauri-utils", - "thiserror 2.0.20", + "thiserror 2.0.21", "url", "webkit2gtk", "webview2-com", @@ -3859,9 +3631,9 @@ dependencies = [ [[package]] name = "tauri-runtime-wry" -version = "2.12.5" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8c14a025255cc9816d401635035075b09b6cc9973b7b8fd7b8fcb8753f30f92" +checksum = "34a8d0c102664aaec2d2bfc4e8c4375e253a4192f574bb4352517c152643c6a8" dependencies = [ "gtk", "http", @@ -3884,15 +3656,15 @@ dependencies = [ [[package]] name = "tauri-utils" -version = "2.10.4" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d1d33d4453c5df0bf1672dbc7ada69d8ed74f56a4316d964a4aa73d4ecd3ad" +checksum = "4b3bb2217a2c5632f25a375c305f5a1f9b3beaa7b0614a21e79f297b6b3cbc92" dependencies = [ "anyhow", "brotli", "cargo_metadata", "ctor", - "dom_query 0.28.0", + "dom_query", "dunce", "glob", "http", @@ -3900,7 +3672,7 @@ dependencies = [ "json-patch", "log", "memchr", - "phf 0.13.1", + "phf", "plist", "proc-macro2", "quote", @@ -3912,8 +3684,8 @@ dependencies = [ "serde_json", "serde_with", "swift-rs", - "thiserror 2.0.20", - "toml 1.1.4+spec-1.1.0", + "thiserror 2.0.21", + "toml", "url", "urlpattern", "uuid", @@ -3922,13 +3694,13 @@ dependencies = [ [[package]] name = "tauri-winres" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc65d45c68858bfe420dd29e834b5d15dbecf8a07a8a16cf4d532c7b1f69d4b6" +checksum = "c52bb6904475a6ca662f15ef787f18ade61d5740a1ee12c45d3b748efdb6f796" dependencies = [ "dunce", "embed-resource", - "toml 1.1.4+spec-1.1.0", + "toml", ] [[package]] @@ -3964,11 +3736,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.20" +version = "2.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec86235f5fcc2a73650310756d2ac5b138a5780bbbdfae3eeccec992c435ba4f" +checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e" dependencies = [ - "thiserror-impl 2.0.20", + "thiserror-impl 2.0.21", ] [[package]] @@ -3984,13 +3756,13 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.20" +version = "2.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc04cd3e1236dd4a98afca4569f2deb3f120e5422a4023be2cb683f8486292af" +checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524" dependencies = [ "proc-macro2", "quote", - "syn 3.0.3", + "syn 3.0.10", ] [[package]] @@ -4023,20 +3795,11 @@ dependencies = [ "time-core", ] -[[package]] -name = "tiny-keccak" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" -dependencies = [ - "crunchy", -] - [[package]] name = "tinystr" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" +checksum = "abc840c238154d58f9e86b2792261edfde565a17696e1cda1a449de27979801a" dependencies = [ "displaydoc", "zerovec", @@ -4044,24 +3807,15 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb4ebadaa0af04fab11ae01eb5f9fdb5f9c5b875506e210e71c07873528baa7f" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" +version = "1.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +checksum = "fd3ca314f692efd6c868f8408f53fe444634a845f96c028b97d35f6a1f79f0ee" [[package]] name = "tokio" -version = "1.53.1" +version = "1.54.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed" +checksum = "b52fd3255258d26fac7264ab5a76b53c13367136dc011d3d6ad4f8ed070396a3" dependencies = [ "bytes", "libc", @@ -4073,9 +3827,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.19" +version = "0.7.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "494815d09bf52b5548659851081238f0ca39ff638363907596da739561c62c52" +checksum = "e464cf451ba96ebfc6f9b6542f17ee8b8956e33f1e40d9690624e59d7a7f8a4b" dependencies = [ "bytes", "futures-core", @@ -4086,99 +3840,54 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" -dependencies = [ - "serde", - "serde_spanned 0.6.9", - "toml_datetime 0.6.3", - "toml_edit 0.20.2", -] - -[[package]] -name = "toml" -version = "1.1.4+spec-1.1.0" +version = "1.2.3+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3aace63f4bbcdfc2c965b059de67119c89c4017a70d633be6c104910f67056f5" +checksum = "26b1f26e9485c1fa43ee89fe76e9f3fb9e2e52bb227f8594b4d687496b83d073" dependencies = [ - "indexmap 2.14.0", + "indexmap 2.14.2", "serde_core", - "serde_spanned 1.1.1", - "toml_datetime 1.1.1+spec-1.1.0", + "serde_spanned", + "toml_datetime", "toml_parser", "toml_writer", - "winnow 1.0.4", -] - -[[package]] -name = "toml_datetime" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" -dependencies = [ - "serde", + "winnow", ] [[package]] name = "toml_datetime" -version = "1.1.1+spec-1.1.0" +version = "1.1.3+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" +checksum = "173f25c883cd2176a2d8212155638c0a60d484a9d84546d270866f40f56b6e49" dependencies = [ "serde_core", ] [[package]] name = "toml_edit" -version = "0.19.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" -dependencies = [ - "indexmap 2.14.0", - "toml_datetime 0.6.3", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" -dependencies = [ - "indexmap 2.14.0", - "serde", - "serde_spanned 0.6.9", - "toml_datetime 0.6.3", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.25.13+spec-1.1.0" +version = "0.25.21+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6975367e4d2ef766d86af01ffad14b622fecc8d4357a998fbc4deb6e9bacaf9b" +checksum = "88497dab46de5bf343ec66b05c251e48c6213f3e9170c70a70a823f7abe886a4" dependencies = [ - "indexmap 2.14.0", - "toml_datetime 1.1.1+spec-1.1.0", + "indexmap 2.14.2", + "toml_datetime", "toml_parser", - "winnow 1.0.4", + "winnow", ] [[package]] name = "toml_parser" -version = "1.1.3+spec-1.1.0" +version = "1.1.7+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56" +checksum = "0bb28d6e049a9766c3bd91a8326e6179f5b132dec87906bb97018ef7a2f3431a" dependencies = [ - "winnow 1.0.4", + "winnow", ] [[package]] name = "toml_writer" -version = "1.1.2+spec-1.1.0" +version = "1.2.0+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d56353a2a665ad0f41a421187180aab746c8c325620617ad883a99a1cbe66d2" +checksum = "009dbb7700f11c55ef83aebbe4c0e9cf1f1ac0844bd8d6f00dc38f302026e13a" [[package]] name = "tower" @@ -4201,7 +3910,7 @@ version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cfcf7e2740e6fc6d4d688b4ef00650406bb94adf4731e43c096c3a19fe40840" dependencies = [ - "bitflags 2.13.1", + "bitflags", "bytes", "futures-util", "http", @@ -4258,9 +3967,9 @@ dependencies = [ [[package]] name = "tray-icon" -version = "0.25.1" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b9c52859a94554803ccd4a24b98f74148ebc73b90676d783f3490b1bff9d72" +checksum = "19886363e700addca09f3787a1394eda88a80c89b9305f96effb9ea5ce09146d" dependencies = [ "crossbeam-channel", "dirs", @@ -4271,10 +3980,9 @@ dependencies = [ "objc2-core-foundation", "objc2-core-graphics", "objc2-foundation", - "once_cell", "png", "serde", - "thiserror 2.0.20", + "thiserror 2.0.21", "windows-sys 0.61.2", ] @@ -4309,9 +4017,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.24" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" +checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563" [[package]] name = "unicode-segmentation" @@ -4321,9 +4029,9 @@ checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" [[package]] name = "url" -version = "2.5.8" +version = "2.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +checksum = "f00cd2407bb42c0ef17be88d4cf020f5cceffd121665bac9b8b9493a369b3b1a" dependencies = [ "form_urlencoded", "idna", @@ -4346,15 +4054,24 @@ dependencies = [ [[package]] name = "utf8_iter" -version = "1.0.4" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" +checksum = "af3bd9d3e571c26fcce9d033b87ea5ab061b8d2ffe9b7a5675d810d68f03edf0" +dependencies = [ + "utf_types", +] + +[[package]] +name = "utf_types" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a3b425286980a367278453f3b6d28cdcb134b574e5a35824a6ff5eebad50bb6" [[package]] name = "uuid" -version = "1.24.0" +version = "1.29.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf3923a6f5c4c6382e0b653c4117f48d631ea17f38ed86e2a828e6f7412f5239" +checksum = "3c14b15dffa2f4bd712103e857140aa04a4f2ff6e955c77d7eb8e53ee02a3b64" dependencies = [ "getrandom 0.4.3", "js-sys", @@ -4396,9 +4113,9 @@ dependencies = [ [[package]] name = "walkdir" -version = "2.5.0" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +checksum = "b42e295b7452c4604982280d8586001fcad9b8b201cac67bca9771e7a7475403" dependencies = [ "same-file", "winapi-util", @@ -4406,9 +4123,9 @@ dependencies = [ [[package]] name = "want" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +checksum = "ec4cdd0dd910afe868b7ef477227d8d538b46b3075031afee8a9f2acb0a2ed0b" dependencies = [ "try-lock", ] @@ -4430,12 +4147,11 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.127" +version = "0.2.130" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b70935747edd64d89de3efa29d73789b806c15798f8e7dca4d8ac356b50ce70" +checksum = "a0181c14ddd6c7b8b0b0132a5f1ea2f32be0d893cd3ea97b6e3b28886b8a3d1c" dependencies = [ "cfg-if", - "once_cell", "rustversion", "wasm-bindgen-macro", "wasm-bindgen-shared", @@ -4443,19 +4159,20 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.77" +version = "0.4.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b7777d5cc23d0e91404e53ce2d5e8ec7acae3026b16233dba62cd3246457950" +checksum = "5e14e0327cb5368ad60ccb22d04a9827a693c95a926d8d125e9fa39e0baec501" dependencies = [ "js-sys", + "tokio", "wasm-bindgen", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.127" +version = "0.2.130" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77775f8f3f7217702089053b94958f8f54061a3f663417df76e19cbdcca29bc1" +checksum = "6e931a02a39abdbf66966fc35902b5ed58344750a70885bed4ebb3d8eaf28ed9" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4463,22 +4180,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.127" +version = "0.2.130" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e11d33f857dc2fb11b8bc75aee111aa9cbeb12cd9f25efd3d4c2a3dd4e235284" +checksum = "2ca4b54280e455bd831e33a6b8e734baf432fe63fbc35c42ac14ce67a043a53a" dependencies = [ "bumpalo", "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.10", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.127" +version = "0.2.130" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef64dbcc55df09c7e5a46182d181c2cfa3e925f3da937ea764728b4bbb9dcbf" +checksum = "3b1f9c3798725016c6ee5f2f57869ec0831e8bbc0ab0310a86e787e97f41389e" dependencies = [ "unicode-ident", ] @@ -4496,11 +4213,71 @@ dependencies = [ "web-sys", ] +[[package]] +name = "wayland-backend" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38a91b4eaddff87b1cd1074985e3713da4af2c49742d1b356b2c01670a67a078" +dependencies = [ + "cc", + "downcast-rs", + "rustix", + "scoped-tls", + "smallvec", + "wayland-sys", +] + +[[package]] +name = "wayland-client" +version = "0.31.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3c36a0f861ad76d0901f2800b46321410d9f73f2ea88aac0650d86c32688073" +dependencies = [ + "bitflags", + "rustix", + "wayland-backend", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols" +version = "0.32.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23d0c813de3daa2ed6520af85a3bd49b0e722a3078506899aa9686fea58dc4b6" +dependencies = [ + "bitflags", + "wayland-backend", + "wayland-client", + "wayland-scanner", +] + +[[package]] +name = "wayland-scanner" +version = "0.31.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "338e30461b3a2b67d70eb30a6d89f8e0c93a833e07d2ae89085cd070c4a00ac0" +dependencies = [ + "proc-macro2", + "quick-xml 0.41.0", + "quote", +] + +[[package]] +name = "wayland-sys" +version = "0.31.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8eab23fefc9e41f8e841df4a9c707e8a8c4ed26e944ef69297184de2785e3be" +dependencies = [ + "dlib", + "log", + "pkg-config", +] + [[package]] name = "web-sys" -version = "0.3.104" +version = "0.3.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c435338968042f4f59a557f690a253676d47ce13ceb55d70100e7facf6620a30" +checksum = "d7d179596ff5ec0f6de4db64d54011bde6289cc49603d3a6e4ce3f329207ab88" dependencies = [ "js-sys", "wasm-bindgen", @@ -4516,37 +4293,25 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "web_atoms" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "075474b12bcb3d2e3d4546580e9de478eeeead668a1761e2a8860c836b7ef297" -dependencies = [ - "phf 0.13.1", - "phf_codegen 0.13.1", - "string_cache 0.9.0", - "string_cache_codegen 0.6.1", -] - [[package]] name = "web_atoms" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7572660c8890448ba236b7376f27e389c6a7e1c70195622faced601f855c0ada" dependencies = [ - "phf 0.14.0", - "phf_codegen 0.14.0", - "string_cache 0.11.0", - "string_cache_codegen 0.11.2", + "phf", + "phf_codegen", + "string_cache", + "string_cache_codegen", ] [[package]] name = "webkit2gtk" -version = "2.0.2" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1027150013530fb2eaf806408df88461ae4815a45c541c8975e61d6f2fc4793" +checksum = "96c626604de3cf25b809e97bdb771509428fbfa6f0b9ed45ef2e8eacedeee3c8" dependencies = [ - "bitflags 1.3.2", + "bitflags", "cairo-rs", "gdk", "gdk-sys", @@ -4566,11 +4331,11 @@ dependencies = [ [[package]] name = "webkit2gtk-sys" -version = "2.0.2" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "916a5f65c2ef0dfe12fff695960a2ec3d4565359fdbb2e9943c974e06c734ea5" +checksum = "99707dd86d56ab2cc7a35b083220067d28f293194f349df3afc92427f230a95b" dependencies = [ - "bitflags 1.3.2", + "bitflags", "cairo-sys-rs", "gdk-sys", "gio-sys", @@ -4581,7 +4346,7 @@ dependencies = [ "libc", "pkg-config", "soup3-sys", - "system-deps", + "system-deps 9.0.1", ] [[package]] @@ -4613,7 +4378,7 @@ version = "0.39.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3a07132775117d6065853d9d1178157b8c90e228de47129d6bce2c7edebedfb" dependencies = [ - "thiserror 2.0.20", + "thiserror 2.0.21", "windows", "windows-core", ] @@ -4694,7 +4459,7 @@ checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" dependencies = [ "windows-implement", "windows-interface", - "windows-link", + "windows-link 0.2.1", "windows-result", "windows-strings", ] @@ -4706,7 +4471,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb" dependencies = [ "windows-core", - "windows-link", + "windows-link 0.2.1", "windows-threading", ] @@ -4738,6 +4503,12 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" +[[package]] +name = "windows-link" +version = "0.101.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4e57b2aae53a240c62b65069a63eaf8d5fa747f5d0d8e670c5210a98847bce4" + [[package]] name = "windows-numerics" version = "0.3.1" @@ -4745,18 +4516,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26" dependencies = [ "windows-core", - "windows-link", -] - -[[package]] -name = "windows-registry" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720" -dependencies = [ - "windows-link", - "windows-result", - "windows-strings", + "windows-link 0.2.1", ] [[package]] @@ -4765,7 +4525,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" dependencies = [ - "windows-link", + "windows-link 0.2.1", ] [[package]] @@ -4774,7 +4534,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" dependencies = [ - "windows-link", + "windows-link 0.2.1", ] [[package]] @@ -4788,29 +4548,29 @@ dependencies = [ [[package]] name = "windows-sys" -version = "0.59.0" +version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" dependencies = [ - "windows-targets 0.52.6", + "windows-targets 0.53.5", ] [[package]] name = "windows-sys" -version = "0.60.2" +version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" dependencies = [ - "windows-targets 0.53.5", + "windows-link 0.2.1", ] [[package]] name = "windows-sys" -version = "0.61.2" +version = "0.101.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +checksum = "eed2df9f5f458664c87437f6758f0d93085b06433bf66b2b84c23c19f3d2012c" dependencies = [ - "windows-link", + "windows-link 0.101.0", ] [[package]] @@ -4828,33 +4588,17 @@ dependencies = [ "windows_x86_64_msvc 0.42.2", ] -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm 0.52.6", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - [[package]] name = "windows-targets" version = "0.53.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" dependencies = [ - "windows-link", + "windows-link 0.2.1", "windows_aarch64_gnullvm 0.53.1", "windows_aarch64_msvc 0.53.1", "windows_i686_gnu 0.53.1", - "windows_i686_gnullvm 0.53.1", + "windows_i686_gnullvm", "windows_i686_msvc 0.53.1", "windows_x86_64_gnu 0.53.1", "windows_x86_64_gnullvm 0.53.1", @@ -4867,7 +4611,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37" dependencies = [ - "windows-link", + "windows-link 0.2.1", ] [[package]] @@ -4876,7 +4620,7 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4060a1da109b9d0326b7262c8e12c84df67cc0dbc9e33cf49e01ccc2eb63631" dependencies = [ - "windows-link", + "windows-link 0.2.1", ] [[package]] @@ -4885,12 +4629,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" -[[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_gnullvm" version = "0.53.1" @@ -4903,12 +4641,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - [[package]] name = "windows_aarch64_msvc" version = "0.53.1" @@ -4921,24 +4653,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" -[[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_gnu" version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" -[[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_gnullvm" version = "0.53.1" @@ -4951,12 +4671,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - [[package]] name = "windows_i686_msvc" version = "0.53.1" @@ -4969,12 +4683,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" -[[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_gnu" version = "0.53.1" @@ -4987,12 +4695,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" -[[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_gnullvm" version = "0.53.1" @@ -5005,12 +4707,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - [[package]] name = "windows_x86_64_msvc" version = "0.53.1" @@ -5019,30 +4715,21 @@ checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" [[package]] name = "winnow" -version = "0.5.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" -dependencies = [ - "memchr", -] - -[[package]] -name = "winnow" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81" +checksum = "8c3b93199df0ab874cdf0c6a94f0a0dc3423fe41f1cafb62b8bd7b1deb277aef" dependencies = [ "memchr", ] [[package]] name = "winreg" -version = "0.55.0" +version = "0.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb5a765337c50e9ec252c2069be9bf91c7df47afb103b642ba3a53bf8101be97" +checksum = "7d6f32a0ff4a9f6f01231eb2059cc85479330739333e0e58cadf03b6af2cca10" dependencies = [ "cfg-if", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -5053,22 +4740,22 @@ checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" [[package]] name = "writeable" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" +checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc" [[package]] name = "wry" -version = "0.57.4" +version = "0.58.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c7bdc0b007462dd8a6cdb598e131e6899efa7eec16afdab4ee94b33f344c705" +checksum = "a9fadb3ce0a4ec6f7acddf364af8bbf14f5a1e532e5d5eed3b8141cdd3b3a774" dependencies = [ "base64 0.23.1", "block2", "cookie", "crossbeam-channel", "dirs", - "dom_query 0.30.0", + "dom_query", "dpi", "dunce", "gdkx11", @@ -5086,10 +4773,10 @@ dependencies = [ "objc2-web-kit", "percent-encoding", "raw-window-handle", - "sha2 0.10.9", + "sha2", "soup3", "tao-macros", - "thiserror 2.0.20", + "thiserror 2.0.21", "url", "webkit2gtk", "webkit2gtk-sys", @@ -5123,9 +4810,9 @@ dependencies = [ [[package]] name = "yoke" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "709fe23a0424b6a435d82152b1bd3fdfb0833487d5fa90d05d42762a9891fef5" +checksum = "417ef3fcf6c300b7dbd25c85531a746931c02ad536f3cf4786ed1e88223340b3" dependencies = [ "stable_deref_trait", "yoke-derive", @@ -5134,13 +4821,13 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.8.2" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" +checksum = "ec8ebde2db3681e8c9980cc27822030e68752690ddfa9473e739aeb4dbde6d71" dependencies = [ "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.10", "synstructure", ] @@ -5173,7 +4860,7 @@ dependencies = [ "uds_windows", "uuid", "windows-sys 0.61.2", - "winnow 1.0.4", + "winnow", "zbus_macros", "zbus_names", "zvariant", @@ -5185,10 +4872,10 @@ version = "5.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2990635d09ade6df1868f72f8cac69a876a90981e8bd3c40b1be413f8dc88f40" dependencies = [ - "proc-macro-crate 3.5.0", + "proc-macro-crate", "proc-macro2", "quote", - "syn 3.0.3", + "syn 3.0.10", "zbus_names", "zvariant", "zvariant_utils", @@ -5201,7 +4888,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "812a12be4ead7a59e18ea8f047d08add0066b73bc62fc1467066a2472ae088dd" dependencies = [ "serde", - "winnow 1.0.4", + "winnow", "zvariant", ] @@ -5225,13 +4912,13 @@ dependencies = [ [[package]] name = "zerofrom-derive" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" +checksum = "f75b4683f6c7f45248d4d64056a24298c6281e0993356d7d1b4a1a962ef10d4a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.10", "synstructure", ] @@ -5243,9 +4930,9 @@ checksum = "85ccff8a4805aba1eaa4cd4afcd49f7557dd2cf5fd79ffc37f8959466effc5aa" [[package]] name = "zerotrie" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" +checksum = "4ea269c3bd32f0a32c321907a2ae912ba6f4649bb0fc764a15627e99a7095a3f" dependencies = [ "displaydoc", "yoke", @@ -5254,9 +4941,9 @@ dependencies = [ [[package]] name = "zerovec" -version = "0.11.6" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" +checksum = "f58a2799cfe9a1670c7ea8edbd52ef8edb93cb37a7f83bf31ba9e35d9dae6a40" dependencies = [ "yoke", "zerofrom", @@ -5265,15 +4952,21 @@ dependencies = [ [[package]] name = "zerovec-derive" -version = "0.11.3" +version = "0.11.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" +checksum = "c3743ddbf47738d929cd1ae2e199d40d0162979dfe31aef8ae646d2bf00bf97a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.10", ] +[[package]] +name = "zlib-rs" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa76918995d776d9dd34d371030be228d021137449771493d56e29f77e4148ac" + [[package]] name = "zmij" version = "1.0.23" @@ -5289,7 +4982,7 @@ dependencies = [ "endi", "enumflags2", "serde", - "winnow 1.0.4", + "winnow", "zcheapstr", "zvariant_derive", "zvariant_utils", @@ -5301,10 +4994,10 @@ version = "5.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef2672456ba1cb54b5eaec136e63135b3c7495fb938e53b28a62e633496d486d" dependencies = [ - "proc-macro-crate 3.5.0", + "proc-macro-crate", "proc-macro2", "quote", - "syn 3.0.3", + "syn 3.0.10", "zvariant_utils", ] @@ -5317,6 +5010,6 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 3.0.3", - "winnow 1.0.4", + "syn 3.0.10", + "winnow", ] diff --git a/apps/nova-desktop/src-tauri/Cargo.toml b/apps/nova-desktop/src-tauri/Cargo.toml index 428c1ef8..42c76baf 100644 --- a/apps/nova-desktop/src-tauri/Cargo.toml +++ b/apps/nova-desktop/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nova-desktop" -version = "0.1.0" +version = "0.2.0" edition = "2021" [build-dependencies] @@ -8,10 +8,12 @@ tauri-build = { version = "2", features = [] } [dependencies] tauri = { version = "2", features = [] } -tauri-plugin-dialog = "2" -tauri-plugin-single-instance = { version = "2", features = ["deep-link"] } -tauri-plugin-deep-link = "2" serde = { version = "1", features = ["derive"] } serde_json = "1" +url = "2" getrandom = "0.3" -keyring = { version = "=3.6.3", features = ["apple-native", "windows-native"] } +base64 = "0.22" +rfd = "0.17" +keyring = { version = "3", features = ["apple-native", "windows-native"] } +reqwest = { version = "0.12", default-features = false, features = ["blocking", "json"] } +tauri-plugin-single-instance = "=2.5.5" diff --git a/apps/nova-desktop/src-tauri/Info.plist b/apps/nova-desktop/src-tauri/Info.plist new file mode 100644 index 00000000..944deee2 --- /dev/null +++ b/apps/nova-desktop/src-tauri/Info.plist @@ -0,0 +1,3 @@ + + +NSLocalNetworkUsageDescriptionNova connects to its authenticated local workspace service.NSHighResolutionCapable diff --git a/apps/nova-desktop/src-tauri/build.rs b/apps/nova-desktop/src-tauri/build.rs index d860e1e6..4960c4c4 100644 --- a/apps/nova-desktop/src-tauri/build.rs +++ b/apps/nova-desktop/src-tauri/build.rs @@ -1,3 +1,17 @@ fn main() { - tauri_build::build() + println!( + "cargo:rustc-env=NOVA_HOST_TARGET={}", + std::env::var("TARGET").unwrap() + ); + tauri_build::try_build(tauri_build::Attributes::new().app_manifest( + tauri_build::AppManifest::new().commands(&[ + "choose_folder", + "open_external", + "capture_screen", + "computer_permissions", + "open_computer_permission_settings", + "start_local_codex", + ]), + )) + .expect("Tauri build failed"); } diff --git a/apps/nova-desktop/src-tauri/capabilities/default.json b/apps/nova-desktop/src-tauri/capabilities/default.json index c05a79a2..1a19fba8 100644 --- a/apps/nova-desktop/src-tauri/capabilities/default.json +++ b/apps/nova-desktop/src-tauri/capabilities/default.json @@ -1,7 +1,22 @@ { "$schema": "../gen/schemas/desktop-schema.json", - "identifier": "main-window", - "description": "Core window access for Nova", - "windows": ["main"], - "permissions": ["core:default", "core:window:allow-show", "core:window:allow-set-focus"] + "identifier": "nova-main", + "description": "Only the authenticated local Nova window can request native dialogs and HTTPS links.", + "webviews": [ + "main" + ], + "local": false, + "remote": { + "urls": [ + "http://127.0.0.1:47831/*" + ] + }, + "permissions": [ + "allow-choose-folder", + "allow-open-external", + "allow-capture-screen", + "allow-computer-permissions", + "allow-open-computer-permission-settings", + "allow-start-local-codex" + ] } diff --git a/apps/nova-desktop/src-tauri/dmg/background.png b/apps/nova-desktop/src-tauri/dmg/background.png new file mode 100644 index 00000000..a86a5134 Binary files /dev/null and b/apps/nova-desktop/src-tauri/dmg/background.png differ diff --git a/apps/nova-desktop/src-tauri/icons/128x128.png b/apps/nova-desktop/src-tauri/icons/128x128.png new file mode 100644 index 00000000..03f050b3 Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/128x128.png differ diff --git a/apps/nova-desktop/src-tauri/icons/128x128@2x.png b/apps/nova-desktop/src-tauri/icons/128x128@2x.png new file mode 100644 index 00000000..a256387e Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/128x128@2x.png differ diff --git a/apps/nova-desktop/src-tauri/icons/32x32.png b/apps/nova-desktop/src-tauri/icons/32x32.png new file mode 100644 index 00000000..4ead57ce Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/32x32.png differ diff --git a/apps/nova-desktop/src-tauri/icons/64x64.png b/apps/nova-desktop/src-tauri/icons/64x64.png new file mode 100644 index 00000000..60d3b859 Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/64x64.png differ diff --git a/apps/nova-desktop/src-tauri/icons/Square107x107Logo.png b/apps/nova-desktop/src-tauri/icons/Square107x107Logo.png new file mode 100644 index 00000000..aba84061 Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/Square107x107Logo.png differ diff --git a/apps/nova-desktop/src-tauri/icons/Square142x142Logo.png b/apps/nova-desktop/src-tauri/icons/Square142x142Logo.png new file mode 100644 index 00000000..aae0f2a2 Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/Square142x142Logo.png differ diff --git a/apps/nova-desktop/src-tauri/icons/Square150x150Logo.png b/apps/nova-desktop/src-tauri/icons/Square150x150Logo.png new file mode 100644 index 00000000..0f99db8c Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/Square150x150Logo.png differ diff --git a/apps/nova-desktop/src-tauri/icons/Square284x284Logo.png b/apps/nova-desktop/src-tauri/icons/Square284x284Logo.png new file mode 100644 index 00000000..555163a2 Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/Square284x284Logo.png differ diff --git a/apps/nova-desktop/src-tauri/icons/Square30x30Logo.png b/apps/nova-desktop/src-tauri/icons/Square30x30Logo.png new file mode 100644 index 00000000..64fb9b6b Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/Square30x30Logo.png differ diff --git a/apps/nova-desktop/src-tauri/icons/Square310x310Logo.png b/apps/nova-desktop/src-tauri/icons/Square310x310Logo.png new file mode 100644 index 00000000..908391ef Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/Square310x310Logo.png differ diff --git a/apps/nova-desktop/src-tauri/icons/Square44x44Logo.png b/apps/nova-desktop/src-tauri/icons/Square44x44Logo.png new file mode 100644 index 00000000..a76b7fff Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/Square44x44Logo.png differ diff --git a/apps/nova-desktop/src-tauri/icons/Square71x71Logo.png b/apps/nova-desktop/src-tauri/icons/Square71x71Logo.png new file mode 100644 index 00000000..83f7270c Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/Square71x71Logo.png differ diff --git a/apps/nova-desktop/src-tauri/icons/Square89x89Logo.png b/apps/nova-desktop/src-tauri/icons/Square89x89Logo.png new file mode 100644 index 00000000..e7174ad5 Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/Square89x89Logo.png differ diff --git a/apps/nova-desktop/src-tauri/icons/StoreLogo.png b/apps/nova-desktop/src-tauri/icons/StoreLogo.png new file mode 100644 index 00000000..a51c6080 Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/StoreLogo.png differ diff --git a/apps/nova-desktop/src-tauri/icons/android/mipmap-anydpi-v26/ic_launcher.xml b/apps/nova-desktop/src-tauri/icons/android/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 00000000..2ffbf24b --- /dev/null +++ b/apps/nova-desktop/src-tauri/icons/android/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/apps/nova-desktop/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png b/apps/nova-desktop/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png new file mode 100644 index 00000000..63cea0dc Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png differ diff --git a/apps/nova-desktop/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png b/apps/nova-desktop/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png new file mode 100644 index 00000000..8f88411a Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png differ diff --git a/apps/nova-desktop/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png b/apps/nova-desktop/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 00000000..586efc82 Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png differ diff --git a/apps/nova-desktop/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png b/apps/nova-desktop/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png new file mode 100644 index 00000000..bc320f72 Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png differ diff --git a/apps/nova-desktop/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png b/apps/nova-desktop/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png new file mode 100644 index 00000000..79bcfd17 Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png differ diff --git a/apps/nova-desktop/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png b/apps/nova-desktop/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 00000000..7d565859 Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png differ diff --git a/apps/nova-desktop/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png b/apps/nova-desktop/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 00000000..e07ea3eb Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png differ diff --git a/apps/nova-desktop/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png b/apps/nova-desktop/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png new file mode 100644 index 00000000..cb4e2153 Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png differ diff --git a/apps/nova-desktop/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png b/apps/nova-desktop/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 00000000..f1564dff Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/apps/nova-desktop/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png b/apps/nova-desktop/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 00000000..b33108fd Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png differ diff --git a/apps/nova-desktop/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png b/apps/nova-desktop/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png new file mode 100644 index 00000000..978ee98f Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png differ diff --git a/apps/nova-desktop/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png b/apps/nova-desktop/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 00000000..dea47b6a Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/apps/nova-desktop/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png b/apps/nova-desktop/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 00000000..d20fcea4 Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/apps/nova-desktop/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png b/apps/nova-desktop/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png new file mode 100644 index 00000000..f821c2c0 Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png differ diff --git a/apps/nova-desktop/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png b/apps/nova-desktop/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 00000000..142e7104 Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/apps/nova-desktop/src-tauri/icons/android/values/ic_launcher_background.xml b/apps/nova-desktop/src-tauri/icons/android/values/ic_launcher_background.xml new file mode 100644 index 00000000..16cdd5aa --- /dev/null +++ b/apps/nova-desktop/src-tauri/icons/android/values/ic_launcher_background.xml @@ -0,0 +1,4 @@ + + + #FFFFFF + \ No newline at end of file diff --git a/apps/nova-desktop/src-tauri/icons/icon.icns b/apps/nova-desktop/src-tauri/icons/icon.icns index 5cce1f5b..5996d237 100644 Binary files a/apps/nova-desktop/src-tauri/icons/icon.icns and b/apps/nova-desktop/src-tauri/icons/icon.icns differ diff --git a/apps/nova-desktop/src-tauri/icons/icon.ico b/apps/nova-desktop/src-tauri/icons/icon.ico index 8fb294f6..f4c215de 100644 Binary files a/apps/nova-desktop/src-tauri/icons/icon.ico and b/apps/nova-desktop/src-tauri/icons/icon.ico differ diff --git a/apps/nova-desktop/src-tauri/icons/icon.png b/apps/nova-desktop/src-tauri/icons/icon.png index 90010022..27b9a828 100644 Binary files a/apps/nova-desktop/src-tauri/icons/icon.png and b/apps/nova-desktop/src-tauri/icons/icon.png differ diff --git a/apps/nova-desktop/src-tauri/icons/ios/AppIcon-20x20@1x.png b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-20x20@1x.png new file mode 100644 index 00000000..72b450a8 Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-20x20@1x.png differ diff --git a/apps/nova-desktop/src-tauri/icons/ios/AppIcon-20x20@2x-1.png b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-20x20@2x-1.png new file mode 100644 index 00000000..03395f4e Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-20x20@2x-1.png differ diff --git a/apps/nova-desktop/src-tauri/icons/ios/AppIcon-20x20@2x.png b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-20x20@2x.png new file mode 100644 index 00000000..03395f4e Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-20x20@2x.png differ diff --git a/apps/nova-desktop/src-tauri/icons/ios/AppIcon-20x20@3x.png b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-20x20@3x.png new file mode 100644 index 00000000..21a54a06 Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-20x20@3x.png differ diff --git a/apps/nova-desktop/src-tauri/icons/ios/AppIcon-29x29@1x.png b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-29x29@1x.png new file mode 100644 index 00000000..e8c0544a Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-29x29@1x.png differ diff --git a/apps/nova-desktop/src-tauri/icons/ios/AppIcon-29x29@2x-1.png b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-29x29@2x-1.png new file mode 100644 index 00000000..18ddb207 Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-29x29@2x-1.png differ diff --git a/apps/nova-desktop/src-tauri/icons/ios/AppIcon-29x29@2x.png b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-29x29@2x.png new file mode 100644 index 00000000..18ddb207 Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-29x29@2x.png differ diff --git a/apps/nova-desktop/src-tauri/icons/ios/AppIcon-29x29@3x.png b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-29x29@3x.png new file mode 100644 index 00000000..5888cb47 Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-29x29@3x.png differ diff --git a/apps/nova-desktop/src-tauri/icons/ios/AppIcon-40x40@1x.png b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-40x40@1x.png new file mode 100644 index 00000000..03395f4e Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-40x40@1x.png differ diff --git a/apps/nova-desktop/src-tauri/icons/ios/AppIcon-40x40@2x-1.png b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-40x40@2x-1.png new file mode 100644 index 00000000..8d6bb72c Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-40x40@2x-1.png differ diff --git a/apps/nova-desktop/src-tauri/icons/ios/AppIcon-40x40@2x.png b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-40x40@2x.png new file mode 100644 index 00000000..8d6bb72c Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-40x40@2x.png differ diff --git a/apps/nova-desktop/src-tauri/icons/ios/AppIcon-40x40@3x.png b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-40x40@3x.png new file mode 100644 index 00000000..155bef63 Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-40x40@3x.png differ diff --git a/apps/nova-desktop/src-tauri/icons/ios/AppIcon-512@2x.png b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-512@2x.png new file mode 100644 index 00000000..6d7c289b Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-512@2x.png differ diff --git a/apps/nova-desktop/src-tauri/icons/ios/AppIcon-60x60@2x.png b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-60x60@2x.png new file mode 100644 index 00000000..155bef63 Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-60x60@2x.png differ diff --git a/apps/nova-desktop/src-tauri/icons/ios/AppIcon-60x60@3x.png b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-60x60@3x.png new file mode 100644 index 00000000..050d05d3 Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-60x60@3x.png differ diff --git a/apps/nova-desktop/src-tauri/icons/ios/AppIcon-76x76@1x.png b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-76x76@1x.png new file mode 100644 index 00000000..27dcbf53 Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-76x76@1x.png differ diff --git a/apps/nova-desktop/src-tauri/icons/ios/AppIcon-76x76@2x.png b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-76x76@2x.png new file mode 100644 index 00000000..ae6cd387 Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-76x76@2x.png differ diff --git a/apps/nova-desktop/src-tauri/icons/ios/AppIcon-83.5x83.5@2x.png b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-83.5x83.5@2x.png new file mode 100644 index 00000000..dd7026d5 Binary files /dev/null and b/apps/nova-desktop/src-tauri/icons/ios/AppIcon-83.5x83.5@2x.png differ diff --git a/apps/nova-desktop/src-tauri/permissions/autogenerated/capture_screen.toml b/apps/nova-desktop/src-tauri/permissions/autogenerated/capture_screen.toml new file mode 100644 index 00000000..cc12ff0a --- /dev/null +++ b/apps/nova-desktop/src-tauri/permissions/autogenerated/capture_screen.toml @@ -0,0 +1,11 @@ +# Automatically generated - DO NOT EDIT! + +[[permission]] +identifier = "allow-capture-screen" +description = "Enables the capture_screen command without any pre-configured scope." +commands.allow = ["capture_screen"] + +[[permission]] +identifier = "deny-capture-screen" +description = "Denies the capture_screen command without any pre-configured scope." +commands.deny = ["capture_screen"] diff --git a/apps/nova-desktop/src-tauri/permissions/autogenerated/choose_folder.toml b/apps/nova-desktop/src-tauri/permissions/autogenerated/choose_folder.toml new file mode 100644 index 00000000..d0a3615a --- /dev/null +++ b/apps/nova-desktop/src-tauri/permissions/autogenerated/choose_folder.toml @@ -0,0 +1,11 @@ +# Automatically generated - DO NOT EDIT! + +[[permission]] +identifier = "allow-choose-folder" +description = "Enables the choose_folder command without any pre-configured scope." +commands.allow = ["choose_folder"] + +[[permission]] +identifier = "deny-choose-folder" +description = "Denies the choose_folder command without any pre-configured scope." +commands.deny = ["choose_folder"] diff --git a/apps/nova-desktop/src-tauri/permissions/autogenerated/computer_permissions.toml b/apps/nova-desktop/src-tauri/permissions/autogenerated/computer_permissions.toml new file mode 100644 index 00000000..86d6ba1e --- /dev/null +++ b/apps/nova-desktop/src-tauri/permissions/autogenerated/computer_permissions.toml @@ -0,0 +1,11 @@ +# Automatically generated - DO NOT EDIT! + +[[permission]] +identifier = "allow-computer-permissions" +description = "Enables the computer_permissions command without any pre-configured scope." +commands.allow = ["computer_permissions"] + +[[permission]] +identifier = "deny-computer-permissions" +description = "Denies the computer_permissions command without any pre-configured scope." +commands.deny = ["computer_permissions"] diff --git a/apps/nova-desktop/src-tauri/permissions/autogenerated/open_computer_permission_settings.toml b/apps/nova-desktop/src-tauri/permissions/autogenerated/open_computer_permission_settings.toml new file mode 100644 index 00000000..6808e7d0 --- /dev/null +++ b/apps/nova-desktop/src-tauri/permissions/autogenerated/open_computer_permission_settings.toml @@ -0,0 +1,11 @@ +# Automatically generated - DO NOT EDIT! + +[[permission]] +identifier = "allow-open-computer-permission-settings" +description = "Enables the open_computer_permission_settings command without any pre-configured scope." +commands.allow = ["open_computer_permission_settings"] + +[[permission]] +identifier = "deny-open-computer-permission-settings" +description = "Denies the open_computer_permission_settings command without any pre-configured scope." +commands.deny = ["open_computer_permission_settings"] diff --git a/apps/nova-desktop/src-tauri/permissions/autogenerated/open_external.toml b/apps/nova-desktop/src-tauri/permissions/autogenerated/open_external.toml new file mode 100644 index 00000000..c9f47530 --- /dev/null +++ b/apps/nova-desktop/src-tauri/permissions/autogenerated/open_external.toml @@ -0,0 +1,11 @@ +# Automatically generated - DO NOT EDIT! + +[[permission]] +identifier = "allow-open-external" +description = "Enables the open_external command without any pre-configured scope." +commands.allow = ["open_external"] + +[[permission]] +identifier = "deny-open-external" +description = "Denies the open_external command without any pre-configured scope." +commands.deny = ["open_external"] diff --git a/apps/nova-desktop/src-tauri/permissions/autogenerated/start_local_codex.toml b/apps/nova-desktop/src-tauri/permissions/autogenerated/start_local_codex.toml new file mode 100644 index 00000000..7df4b1e7 --- /dev/null +++ b/apps/nova-desktop/src-tauri/permissions/autogenerated/start_local_codex.toml @@ -0,0 +1,11 @@ +# Automatically generated - DO NOT EDIT! + +[[permission]] +identifier = "allow-start-local-codex" +description = "Enables the start_local_codex command without any pre-configured scope." +commands.allow = ["start_local_codex"] + +[[permission]] +identifier = "deny-start-local-codex" +description = "Denies the start_local_codex command without any pre-configured scope." +commands.deny = ["start_local_codex"] diff --git a/apps/nova-desktop/src-tauri/src/computer_link.rs b/apps/nova-desktop/src-tauri/src/computer_link.rs deleted file mode 100644 index 86567cbe..00000000 --- a/apps/nova-desktop/src-tauri/src/computer_link.rs +++ /dev/null @@ -1,178 +0,0 @@ -use crate::{ensure_service, service_request, ServiceState}; -use std::sync::atomic::{AtomicBool, Ordering}; -use tauri::Manager; -use tauri_plugin_deep_link::DeepLinkExt; -use tauri_plugin_dialog::{DialogExt, MessageDialogButtons}; - -static APPROVING: AtomicBool = AtomicBool::new(false); - -fn connection_code(url: &tauri::Url) -> Option { - if url.scheme() != "nova-computer" - || url.host_str() != Some("connect") - || !url.username().is_empty() - || url.password().is_some() - || url.port().is_some() - || !["", "/"].contains(&url.path()) - || url.fragment().is_some() - { - return None; - } - let pairs: Vec<_> = url.query_pairs().collect(); - if pairs.len() != 1 || pairs[0].0 != "code" { - return None; - } - let code = &pairs[0].1; - (code.len() == 43 - && code - .bytes() - .all(|c| c.is_ascii_alphanumeric() || c == b'-' || c == b'_')) - .then(|| code.to_string()) -} - -fn connect(app: tauri::AppHandle, code: String) -> Result<(), String> { - let state = app.state::().0.clone(); - let body = serde_json::json!({ "code": code }).to_string(); - let preview = { - let mut slot = state.lock().map_err(|_| "Service unavailable")?; - service_request( - ensure_service(&mut slot)?, - "POST", - "/computer/link-preview", - Some(&body), - )? - }; - let approval = preview - .get("approvalId") - .and_then(|v| v.as_str()) - .ok_or("Invalid connection request")?; - let account = preview - .get("account") - .and_then(|v| v.as_str()) - .ok_or("Invalid connection account")?; - let origin = preview - .get("origin") - .and_then(|v| v.as_str()) - .ok_or("Invalid connection origin")?; - let account: String = account.chars().filter(|c| !c.is_control()).collect(); - let allowed = app.dialog().message(format!( - "Allow Nova web account {account} at {origin} to use this Mac?\n\nThis allows that account to read application windows and perform computer actions through Nova while computer use is enabled. Your Nova desktop login stays unchanged.\n\nYou can stop computer use or disconnect this Mac in Nova web settings." - )).title("Allow Nova to use this Mac?").buttons(MessageDialogButtons::OkCancelCustom("Allow".into(), "Don’t allow".into())).blocking_show(); - if !allowed { - return Ok(()); - } - let body = serde_json::json!({ "approvalId": approval }).to_string(); - { - let mut slot = state.lock().map_err(|_| "Service unavailable")?; - service_request( - ensure_service(&mut slot)?, - "POST", - "/computer/link-approve", - Some(&body), - )?; - } - request_accessibility(); - app.dialog().message("This Mac is connected. Return to Nova web settings. If macOS asks for Accessibility access, allow Nova, then enable computer use.") - .title("Mac connected").blocking_show(); - Ok(()) -} - -fn handle(app: &tauri::AppHandle, urls: Vec) { - let Some(code) = urls.iter().find_map(connection_code) else { - return; - }; - if APPROVING.swap(true, Ordering::SeqCst) { - return; - } - let app = app.clone(); - tauri::async_runtime::spawn_blocking(move || { - if let Err(error) = connect(app.clone(), code) { - app.dialog().message(format!("Could not connect this Mac: {error}. Request access again from Nova web settings.")) - .title("Mac connection unavailable").blocking_show(); - } - APPROVING.store(false, Ordering::SeqCst); - }); -} - -pub fn open(app: &tauri::AppHandle, url: tauri::Url) { - handle(app, vec![url]); -} - -pub fn setup(app: &tauri::AppHandle) -> Result<(), Box> { - #[cfg(any(target_os = "windows", target_os = "linux"))] - app.deep_link().register_all()?; - let handle_app = app.clone(); - app.deep_link() - .on_open_url(move |event| handle(&handle_app, event.urls())); - if let Some(urls) = app.deep_link().get_current()? { - handle(app, urls); - } - Ok(()) -} - -#[cfg(target_os = "macos")] -fn request_accessibility() { - use std::ffi::c_void; - #[link(name = "ApplicationServices", kind = "framework")] - extern "C" { - static kAXTrustedCheckOptionPrompt: *const c_void; - fn AXIsProcessTrustedWithOptions(options: *const c_void) -> bool; - } - #[link(name = "CoreFoundation", kind = "framework")] - extern "C" { - static kCFBooleanTrue: *const c_void; - fn CFDictionaryCreate( - allocator: *const c_void, - keys: *const *const c_void, - values: *const *const c_void, - count: isize, - key_callbacks: *const c_void, - value_callbacks: *const c_void, - ) -> *const c_void; - fn CFRelease(value: *const c_void); - } - // The native GUI app requests its own TCC permission, after explicit consent. - unsafe { - let keys = [kAXTrustedCheckOptionPrompt]; - let values = [kCFBooleanTrue]; - let options = CFDictionaryCreate( - std::ptr::null(), - keys.as_ptr(), - values.as_ptr(), - 1, - std::ptr::null(), - std::ptr::null(), - ); - if !options.is_null() { - AXIsProcessTrustedWithOptions(options); - CFRelease(options); - } - } -} - -#[cfg(not(target_os = "macos"))] -fn request_accessibility() {} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn accepts_only_connection_links_with_a_single_random_code() { - let code = "a".repeat(43); - assert_eq!( - connection_code( - &tauri::Url::parse(&format!("nova-computer://connect?code={code}")).unwrap() - ), - Some(code.clone()) - ); - for value in [ - format!("https://connect?code={code}"), - format!("nova-computer://other?code={code}"), - format!("nova-computer://connect?code={code}&origin=https://evil.example"), - format!("nova-computer://connect?code={code}&code={code}"), - "nova-computer://connect?code=short".into(), - ] { - assert!(connection_code(&tauri::Url::parse(&value).unwrap()).is_none()); - } - } -} diff --git a/apps/nova-desktop/src-tauri/src/credentials.rs b/apps/nova-desktop/src-tauri/src/credentials.rs deleted file mode 100644 index 9301839f..00000000 --- a/apps/nova-desktop/src-tauri/src/credentials.rs +++ /dev/null @@ -1,39 +0,0 @@ -const SERVICE: &str = "ai.supercode.nova.desktop"; -const ACCOUNT: &str = "device-session"; - -fn entry() -> Result { - if !cfg!(any(target_os = "macos", target_os = "windows")) { - return Err("Secure credential storage is supported on macOS and Windows".into()); - } - keyring::Entry::new(SERVICE, ACCOUNT).map_err(|_| "Credential store unavailable".into()) -} - -pub fn read() -> Result { - // Native integration tests must never open the real account's credential store. - if cfg!(test) { - return Ok(serde_json::Value::Null); - } - match entry()?.get_password() { - Ok(value) => serde_json::from_str(&value) - .map_err(|_| "Stored Nova login is invalid; sign out and retry".into()), - Err(keyring::Error::NoEntry) => Ok(serde_json::Value::Null), - Err(_) => Err("Allow Nova to access its OS credential store, then retry".into()), - } -} - -pub fn save(value: &serde_json::Value) -> Result<(), String> { - if cfg!(test) { - return Ok(()); - } - let entry = entry()?; - if value.is_null() { - match entry.delete_credential() { - Ok(()) | Err(keyring::Error::NoEntry) => Ok(()), - Err(_) => Err("Could not remove Nova's stored login".into()), - } - } else { - entry - .set_password(&value.to_string()) - .map_err(|_| "Could not save Nova's login in the OS credential store".into()) - } -} diff --git a/apps/nova-desktop/src-tauri/src/main.rs b/apps/nova-desktop/src-tauri/src/main.rs index 70057090..f123a4ce 100644 --- a/apps/nova-desktop/src-tauri/src/main.rs +++ b/apps/nova-desktop/src-tauri/src/main.rs @@ -1,536 +1,640 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] -use serde::{Deserialize, Serialize}; -use std::io::{BufRead, BufReader, Read, Write}; -use std::net::{SocketAddr, TcpStream}; -use std::process::{Child, ChildStdin, Command, Stdio}; -use std::sync::{mpsc, Arc, Mutex}; -use std::time::{Duration, Instant}; -use tauri::Manager; -use tauri_plugin_dialog::DialogExt; - -mod computer_link; -mod credentials; - -#[derive(Deserialize)] -#[serde(rename_all = "camelCase")] -struct Ready { - #[serde(rename = "type")] - kind: String, - port: u16, - protocol_version: u32, -} - -#[derive(Deserialize, Serialize)] -#[serde(rename_all = "camelCase")] -struct Health { - service: String, - protocol_version: u32, - status: String, - instance_id: Option, -} +use base64::{engine::general_purpose::URL_SAFE_NO_PAD, Engine}; +use serde::Deserialize; +use serde_json::{json, Value}; +use std::{ + io::{BufRead, BufReader, Write}, + path::PathBuf, + process::{Child, ChildStdin, Command, Stdio}, + sync::{mpsc, Mutex}, + time::Duration, +}; +use tauri::{ + menu::{Menu, MenuItem, PredefinedMenuItem, Submenu}, + Manager, WebviewUrl, WebviewWindow, +}; +use url::Url; +const ORIGIN: &str = "http://127.0.0.1:47831"; +const PROTOCOL: u64 = 1; struct Service { child: Child, - port: u16, + _input: Option, secret: String, - credential: serde_json::Value, - stdin: Option, } - -impl Drop for Service { - fn drop(&mut self) { - self.stdin.take(); - // The sidecar waits up to eight seconds for its owned agent processes. - // Give that cleanup time to finish before the native kill fallback. - for _ in 0..450 { +struct Desktop { + service: Mutex, +} +impl Service { + fn shutdown(&mut self) { + self._input.take(); // EOF asks the sidecar to stop its workspace and computer workers. + for _ in 0..60 { if matches!(self.child.try_wait(), Ok(Some(_))) { return; } - std::thread::sleep(Duration::from_millis(20)); + std::thread::sleep(Duration::from_millis(50)); } let _ = self.child.kill(); let _ = self.child.wait(); } } - -struct ServiceState(Arc>>); -const NOVA_WEB_URL: &str = "https://nova.supercodeai.tech/app"; - -fn require_local_window(window: &tauri::WebviewWindow) -> Result<(), String> { - if window.label() != "main" { - return Err("Native access is available only in the local workspace".into()); - } - let url = window.url().map_err(|_| "Could not verify window origin")?; - let local = url.scheme() == "tauri" && url.host_str() == Some("localhost") - || url.scheme() == "http" && url.host_str() == Some("tauri.localhost") - || cfg!(debug_assertions) - && url.scheme() == "http" - && url.host_str() == Some("127.0.0.1") - && url.port() == Some(1420); - if !local { - return Err("Native access is unavailable for this origin".into()); +impl Drop for Service { + fn drop(&mut self) { + self.shutdown(); } - Ok(()) } - -#[tauri::command] -async fn open_nova_web(app: tauri::AppHandle, window: tauri::WebviewWindow) -> Result<(), String> { - require_local_window(&window)?; - show_web_workspace(&app) +#[derive(Deserialize)] +#[serde(rename_all = "camelCase")] +struct Ready { + r#type: String, + port: u16, + protocol_version: u64, } -fn show_web_workspace(app: &tauri::AppHandle) -> Result<(), String> { - if let Some(existing) = app.get_webview_window("nova-web") { - existing.show().map_err(|_| "Could not show Nova Web")?; - return existing - .set_focus() - .map_err(|_| "Could not focus Nova Web".into()); - } - // No remote IPC capability is granted. A connection URL can only request - // the native account-specific approval flow; credentials stay private. - let link_app = app.clone(); - tauri::WebviewWindowBuilder::new( - app, - "nova-web", - tauri::WebviewUrl::External(NOVA_WEB_URL.parse().map_err(|_| "Invalid Nova URL")?), - ) - .title("Nova — Web workspace") - .on_navigation(move |url| { - if url.scheme() == "nova-computer" { - computer_link::open(&link_app, url.clone()); - false - } else { - true - } - }) - .inner_size(1280.0, 800.0) - .min_inner_size(760.0, 520.0) - .build() - .map_err(|_| "Could not open Nova Web workspace")?; - Ok(()) +fn credential_entry() -> Result { + keyring::Entry::new("ai.supercode.nova", "web-session") + .map_err(|_| "Secure credential storage unavailable".into()) } -static LAST_START_FAILURE: Mutex> = Mutex::new(None); - -#[cfg(debug_assertions)] -fn service_command() -> Result { - let root = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("../../.."); - let mut command = Command::new("bun"); - command - .current_dir(root) - .arg("apps/supercode-cli/server/src/nova/desktop-main.ts"); - let runtime = std::path::Path::new(env!("CARGO_MANIFEST_DIR")) - .join("resources/cua-driver") - .join(if cfg!(target_os = "windows") { - "cua-driver.exe" - } else { - "cua-driver" - }); - if runtime.is_file() { - command.env("CUA_DRIVER_PATH", runtime); - } - Ok(command) +fn api(secret: &str, path: &str, body: Option) -> Result { + let client = reqwest::blocking::Client::builder() + .timeout(Duration::from_secs(10)) + .redirect(reqwest::redirect::Policy::none()) + .build() + .map_err(|_| "Service client failed")?; + let url = format!("{ORIGIN}{path}"); + let request = if let Some(value) = body { + client.post(url).json(&value) + } else { + client.get(url) + }; + request + .header("x-nova-native", secret) + .send() + .and_then(|r| r.error_for_status()) + .and_then(|r| r.json()) + .map_err(|_| "Local Nova service unavailable".into()) } - -#[cfg(not(debug_assertions))] -fn service_command() -> Result { - let exe = std::env::current_exe().map_err(|_| "Could not locate Nova")?; - let directory = exe - .parent() - .ok_or("Could not locate Nova's sidecar directory")?; - let name = if cfg!(target_os = "windows") { - "nova-service.exe" +fn spawn_service(app: &tauri::AppHandle) -> Result { + let mut bytes = [0u8; 32]; + getrandom::fill(&mut bytes).map_err(|_| "Could not create service capability")?; + let secret = URL_SAFE_NO_PAD.encode(bytes); + let assets: PathBuf; + let executable: PathBuf; + let current_executable = std::env::current_exe().map_err(|_| "Executable unavailable")?; + let bundled_executable = current_executable + .with_file_name(format!("nova-service{}", std::env::consts::EXE_SUFFIX)); + let resources = app.path().resource_dir().map_err(|_| "Resources unavailable")?; + // A debug .app is still a bundle: use its signed helpers and resources. + // Only a bare `tauri dev` process should depend on the checkout. + let macos_bundle = current_executable.parent().is_some_and(|directory| { + directory.file_name().is_some_and(|name| name == "MacOS") + && directory.parent().is_some_and(|contents| { + contents.file_name().is_some_and(|name| name == "Contents") + }) + }); + let bundled = !cfg!(debug_assertions) || macos_bundle; + if !bundled { + let root = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + assets = root.join("../dist"); + executable = root.join(format!( + "binaries/nova-service-{}{}", + env!("NOVA_HOST_TARGET"), + std::env::consts::EXE_SUFFIX + )); } else { - "nova-service" + assets = resources.join("ui"); + executable = bundled_executable; + } + let logs = app + .path() + .app_log_dir() + .map_err(|_| "Log directory unavailable")?; + std::fs::create_dir_all(&logs).map_err(|_| "Log directory unavailable")?; + let log = std::fs::OpenOptions::new() + .create(true) + .append(true) + .open(logs.join("service.log")) + .map_err(|_| "Log file unavailable")?; + let credential = match credential_entry()?.get_password() { + Ok(value) => { + serde_json::from_str::(&value).map_err(|_| "Stored credential invalid")? + } + Err(keyring::Error::NoEntry) => Value::Null, + Err(_) => return Err("Could not unlock Nova credentials".into()), }; - let mut command = Command::new(directory.join(name)); - command.current_dir(directory); - // Resolve the app-owned runtime without relying on Finder's PATH or a - // separate CuaDriver.app installation. Keep this absolute in the sidecar. - let resources = if cfg!(target_os = "macos") { - directory.join("../Resources") + let driver = if !bundled { + PathBuf::from(env!("CARGO_MANIFEST_DIR")).join(format!( + "binaries/cua-driver-{}{}", + env!("NOVA_HOST_TARGET"), + std::env::consts::EXE_SUFFIX + )) } else { - directory.to_path_buf() + executable.with_file_name(format!("cua-driver{}", std::env::consts::EXE_SUFFIX)) }; - command.env( - "CUA_DRIVER_PATH", - resources - .join("cua-driver") - .join(if cfg!(target_os = "windows") { - "cua-driver.exe" - } else { - "cua-driver" - }), + let native = if !bundled { + PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("native/codex") + } else { + app.path() + .resource_dir() + .map_err(|_| "Resources unavailable")? + .join("native/codex") + }; + let runtime_path = format!( + "{}:{}:/opt/homebrew/bin:/usr/local/bin", + native.join("codex-path").display(), + std::env::var("PATH").unwrap_or_else(|_| "/usr/bin:/bin".into()) ); - #[cfg(target_os = "windows")] - { - use std::os::windows::process::CommandExt; - command.creation_flags(0x08000000); - } - Ok(command) -} - -fn spawn_service() -> Result { - let credential = credentials::read()?; - let mut random = [0u8; 32]; - getrandom::fill(&mut random).map_err(|_| "Could not create a service credential")?; - let secret: String = random.iter().map(|byte| format!("{byte:02x}")).collect(); - let mut child = service_command()? + let mut child = Command::new(executable) + .env( + "NOVA_CODEX_EXECUTABLE", + native + .join("bin") + .join(format!("codex{}", std::env::consts::EXE_SUFFIX)), + ) + .env("PATH", runtime_path) + .env("CUA_DRIVER_PATH", driver) .stdin(Stdio::piped()) .stdout(Stdio::piped()) - .stderr(Stdio::null()) + .stderr(Stdio::from(log)) .spawn() - .map_err(|_| "Could not start Nova's local service. Check the installation and retry.")?; - let mut stdin = child.stdin.take().ok_or("Could not open service input")?; - let stdout = child.stdout.take().ok_or("Could not open service output")?; - if writeln!( - stdin, + .map_err(|_| "Packaged Nova service could not start")?; + let mut input = child.stdin.take().ok_or("Service pipe unavailable")?; + writeln!( + input, "{}", - serde_json::json!({ "secret": secret, "credential": credential }) + json!({ "secret": secret, "assets": assets, "port": 47831, "credential": credential }) ) - .is_err() - { - let _ = child.kill(); - let _ = child.wait(); - return Err("Could not initialize Supercode CLI".into()); - } - let (sender, receiver) = mpsc::sync_channel(1); + .map_err(|_| "Service bootstrap failed")?; + let output = child.stdout.take().ok_or("Service output unavailable")?; + let (tx, rx) = mpsc::channel(); std::thread::spawn(move || { + let mut reader = BufReader::new(output); let mut line = String::new(); - let result = BufReader::new(stdout).take(4097).read_line(&mut line); - let _ = sender.send(result.map(|_| line)); + let result = reader.read_line(&mut line).map(|_| line); + let _ = tx.send(result); + // Drain remaining output so the child can never block on a full pipe. + let _ = std::io::copy(&mut reader, &mut std::io::sink()); }); - let ready = receiver + let service = Service { + child, + _input: Some(input), + secret, + }; + let line = rx .recv_timeout(Duration::from_secs(15)) - .ok() - .and_then(Result::ok) - .and_then(|line| serde_json::from_str::(&line).ok()); - match ready { - Some(ready) if ready.kind == "ready" && ready.protocol_version == 1 && ready.port != 0 => { - Ok(Service { - child, - port: ready.port, - secret, - credential, - stdin: Some(stdin), - }) - } - _ => { - let _ = child.kill(); - let _ = child.wait(); - Err("Supercode CLI did not start or uses an incompatible protocol".into()) - } + .map_err(|_| "Nova service readiness timed out")? + .map_err(|_| "Nova service disconnected")?; + let ready: Ready = + serde_json::from_str(&line).map_err(|_| "Invalid Nova readiness response")?; + if ready.r#type != "ready" || ready.port != 47831 || ready.protocol_version != PROTOCOL { + return Err("Incompatible Nova service".into()); } + api(&service.secret, "/desktop/health", None)?; + Ok(service) } - -fn ensure_service(slot: &mut Option) -> Result<&mut Service, String> { - if let Some(service) = slot.as_mut() { - if service - .child - .try_wait() - .map_err(|_| "Could not check Nova's service")? - .is_some() - { - *slot = None; - } - } - if slot.is_none() { - let mut failure = LAST_START_FAILURE - .lock() - .map_err(|_| "Service retry state unavailable")?; - if let Some((at, attempts)) = failure.as_ref() { - let delay = Duration::from_millis(500 * (1_u64 << (*attempts).min(5))); - if at.elapsed() < delay { - return Err("Nova's service could not start. Wait a moment, then retry.".into()); - } - } - match spawn_service() { - Ok(service) => { - *slot = Some(service); - *failure = None; - } - Err(error) => { - let attempts = failure.as_ref().map_or(0, |(_, attempts)| attempts + 1); - *failure = Some((Instant::now(), attempts)); - return Err(error); - } - } - } - slot.as_mut().ok_or_else(|| "Service unavailable".into()) +fn trusted_origin(label: &str, url: &Url) -> bool { + label == "main" + && url.origin().ascii_serialization() == ORIGIN + && url.username().is_empty() + && url.password().is_none() } -fn service_request( - service: &mut Service, - method: &str, - path: &str, - body: Option<&str>, -) -> Result { - if service - .child - .try_wait() - .map_err(|_| "Could not check Supercode CLI")? - .is_some() - { - return Err("Supercode CLI stopped unexpectedly".into()); +fn trusted(window: &WebviewWindow) -> Result<(), String> { + if !trusted_origin(window.label(), &window.url().map_err(|_| "Invalid window")?) { + return Err("Native capability denied".into()); } - let address = SocketAddr::from(([127, 0, 0, 1], service.port)); - let mut stream = TcpStream::connect_timeout(&address, Duration::from_secs(2)) - .map_err(|_| "Could not connect to Supercode CLI")?; - stream - .set_read_timeout(Some(Duration::from_secs(20))) - .map_err(|_| "Could not configure service connection")?; - stream - .set_write_timeout(Some(Duration::from_secs(2))) - .map_err(|_| "Could not configure service connection")?; - let body = body.unwrap_or(""); - write!(stream, "{} {} HTTP/1.1\r\nHost: 127.0.0.1:{}\r\nAuthorization: Bearer {}\r\nContent-Type: application/json\r\nContent-Length: {}\r\nConnection: close\r\n\r\n{}", method, path, service.port, service.secret, body.len(), body) - .map_err(|_| "Could not request service status")?; - let mut response = String::new(); - stream - .take(8_388_609) - .read_to_string(&mut response) - .map_err(|_| "Could not read service status")?; - if response.len() > 8_388_608 { - return Err("Service response was too large".into()); + Ok(()) +} +fn external_url(value: &str) -> Result { + if value.len() > 8192 { + return Err("Invalid external URL".into()); } - let (headers, body) = response - .split_once("\r\n\r\n") - .ok_or("Invalid service response")?; - if !headers.starts_with("HTTP/1.1 200 ") { - return Err("Service health request was rejected".into()); + let url = Url::parse(value).map_err(|_| "Invalid external URL")?; + let local_login = url.scheme() == "http" + && url.host_str() == Some("nova.localhost") + && matches!(url.port(), Some(3000 | 3003)) + && url.path() == "/desktop/start" + && url.fragment().is_none() + && url.query_pairs().count() == 1 + && url.query_pairs().any(|(key, value)| { + key == "state" + && value.len() == 43 + && value + .bytes() + .all(|byte| byte.is_ascii_alphanumeric() || byte == b'-' || byte == b'_') + }); + if local_login && url.username().is_empty() && url.password().is_none() { + return Ok(url); } - serde_json::from_str(body).map_err(|_| "Invalid service response".into()) -} - -fn health(service: &mut Service) -> Result { - let result: Health = serde_json::from_value(service_request(service, "GET", "/health", None)?) - .map_err(|_| "Invalid service response")?; - if result.service != "supercode-nova-desktop" - || result.protocol_version != 1 - || result.status != "ready" + if url.scheme() != "https" + || url.host_str().is_none() + || !url.username().is_empty() + || url.password().is_some() { - return Err("Incompatible service response".into()); + return Err("Only HTTPS links may open externally".into()); } - Ok(result) + Ok(url) +} +fn open_url(value: &str) -> Result<(), String> { + let url = external_url(value)?; + #[cfg(target_os = "macos")] + let mut command = Command::new("/usr/bin/open"); + #[cfg(target_os = "windows")] + let mut command = Command::new("explorer.exe"); + #[cfg(target_os = "linux")] + let mut command = Command::new("xdg-open"); + command + .arg(url.as_str()) + .spawn() + .map_err(|_| "Could not open system browser")?; + Ok(()) } - #[tauri::command] -async fn graphql_request( - window: tauri::WebviewWindow, - state: tauri::State<'_, ServiceState>, - query: String, - variables: Option, -) -> Result { - require_local_window(&window)?; - if query.is_empty() || query.len() > 16_384 { - return Err("Invalid GraphQL query".into()); - } - let body = serde_json::json!({ "query": query, "variables": variables.unwrap_or_else(|| serde_json::json!({})) }).to_string(); - if body.len() > 8 * 1024 * 1024 { - return Err("GraphQL request is too large".into()); - } - let state = state.0.clone(); +fn open_external(window: WebviewWindow, url: String) -> Result<(), String> { + trusted(&window)?; + open_url(&url) +} +#[tauri::command] +async fn choose_folder( + window: WebviewWindow, + app: tauri::AppHandle, +) -> Result, String> { + trusted(&window)?; + let folder = rfd::AsyncFileDialog::new() + .set_title("Open project in Nova") + .pick_folder() + .await; + let Some(folder) = folder else { + return Ok(None); + }; tauri::async_runtime::spawn_blocking(move || { - let mut service = state.lock().map_err(|_| "Service state unavailable")?; - let service = ensure_service(&mut service)?; - let result = service_request(service, "POST", "/graphql", Some(&body))?; - let current = service_request(service, "GET", "/credentials", None)?; - let credential = current - .get("credential") - .ok_or("Invalid credential state")?; - if credential != &service.credential { - credentials::save(credential)?; - service.credential = credential.clone(); - } - Ok(result) + let state = app.state::(); + let service = state.service.lock().map_err(|_| "Service unavailable")?; + api( + &service.secret, + "/native/grant", + Some(json!({ "path": folder.path() })), + ) + .map(Some) }) .await - .map_err(|_| "Service request failed")? + .map_err(|_| "Folder grant failed")? +} +#[tauri::command] +fn computer_permissions(window: WebviewWindow) -> Result { + trusted(&window)?; + #[cfg(target_os = "macos")] + { + #[link(name = "ApplicationServices", kind = "framework")] + extern "C" { fn AXIsProcessTrusted() -> bool; } + #[link(name = "CoreGraphics", kind = "framework")] + extern "C" { fn CGPreflightScreenCaptureAccess() -> bool; } + // Read-only checks: macOS grants remain an explicit user action. + Ok(unsafe { json!({ "accessibility": AXIsProcessTrusted(), "screenRecording": CGPreflightScreenCaptureAccess() }) }) + } + #[cfg(not(target_os = "macos"))] + { Ok(json!({ "accessibility": null, "screenRecording": null })) } } #[tauri::command] -async fn service_status( - window: tauri::WebviewWindow, - state: tauri::State<'_, ServiceState>, -) -> Result { - require_local_window(&window)?; - let state = state.0.clone(); - tauri::async_runtime::spawn_blocking(move || { - let mut service = state.lock().map_err(|_| "Service state unavailable")?; - match health(ensure_service(&mut service)?) { - Ok(status) => Ok(status), - Err(error) => { - *service = None; - Err(error) +async fn open_computer_permission_settings(window: WebviewWindow, permission: String) -> Result<(), String> { + trusted(&window)?; + let pane = match permission.as_str() { + "accessibility" => "Privacy_Accessibility", + "screen-recording" => "Privacy_ScreenCapture", + _ => return Err("Unknown computer permission".into()), + }; + #[cfg(target_os = "macos")] + { + let permission = permission.clone(); + tauri::async_runtime::spawn_blocking(move || -> Result<(), String> { + use std::ffi::c_void; + #[link(name = "ApplicationServices", kind = "framework")] + extern "C" { + fn AXIsProcessTrustedWithOptions(options: *const c_void) -> bool; + static kAXTrustedCheckOptionPrompt: *const c_void; } - } - }) - .await - .map_err(|_| "Service request failed")? + #[link(name = "CoreGraphics", kind = "framework")] + extern "C" { fn CGRequestScreenCaptureAccess() -> bool; } + #[link(name = "CoreFoundation", kind = "framework")] + extern "C" { + static kCFBooleanTrue: *const c_void; + fn CFDictionaryCreate(allocator: *const c_void, keys: *const *const c_void, values: *const *const c_void, count: isize, key_callbacks: *const c_void, value_callbacks: *const c_void) -> *const c_void; + fn CFRelease(value: *const c_void); + } + // These APIs register the requesting app with TCC and show the + // system prompt. Opening the settings pane alone does neither. + unsafe { + if permission == "accessibility" { + let keys = [kAXTrustedCheckOptionPrompt]; + let values = [kCFBooleanTrue]; + let options = CFDictionaryCreate(std::ptr::null(), keys.as_ptr(), values.as_ptr(), 1, std::ptr::null(), std::ptr::null()); + if options.is_null() { return Err("Could not request Accessibility access".into()); } + AXIsProcessTrustedWithOptions(options); + CFRelease(options); + } else { + CGRequestScreenCaptureAccess(); + } + } + Ok(()) + }).await.map_err(|_| "Could not request macOS permission")??; + Command::new("/usr/bin/open") + .arg(format!("x-apple.systempreferences:com.apple.preference.security?{pane}")) + .spawn() + .map_err(|_| "Could not open System Settings")?; + Ok(()) + } + #[cfg(not(target_os = "macos"))] + { let _ = pane; Err("Open your operating system's privacy settings to grant computer permissions".into()) } } #[tauri::command] -async fn open_project( - window: tauri::WebviewWindow, - app: tauri::AppHandle, - state: tauri::State<'_, ServiceState>, -) -> Result, String> { - require_local_window(&window)?; - let state = state.0.clone(); +async fn start_local_codex(window: WebviewWindow, app: tauri::AppHandle) -> Result { + trusted(&window)?; + let folder = rfd::AsyncFileDialog::new() + .set_title("Choose a local agent workspace") + .pick_folder() + .await + .ok_or("Workspace selection cancelled")?; tauri::async_runtime::spawn_blocking(move || { - // The webview cannot supply a path. Only the native picker grants a root. - let Some(folder) = app - .dialog() - .file() - .set_title("Choose a project to share with Nova") - .blocking_pick_folder() - else { - return Ok(None); - }; - let path = folder.into_path().map_err(|_| "Choose a local folder")?; - let path = path.to_str().ok_or("Project path is not valid UTF-8")?; - let body = serde_json::json!({ "path": path }).to_string(); - let mut service = state.lock().map_err(|_| "Service state unavailable")?; - let response = service_request( - ensure_service(&mut service)?, - "POST", - "/projects/grant", - Some(&body), - )?; - Ok(response.get("project").cloned()) + let state = app.state::(); + let service = state.service.lock().map_err(|_| "Service unavailable")?; + api( + &service.secret, + "/native/codex", + Some(json!({ "path": folder.path() })), + ) }) .await - .map_err(|_| "Could not open the project picker")? + .map_err(|_| "Could not start local Codex")? } #[tauri::command] -async fn start_local_task( - window: tauri::WebviewWindow, - app: tauri::AppHandle, - state: tauri::State<'_, ServiceState>, - session_id: String, - content: String, - model: String, -) -> Result, String> { - require_local_window(&window)?; - if content.len() > 32_000 || session_id.len() > 128 || model.len() > 128 { - return Err("Local task exceeds limits".into()); - } - let state = state.0.clone(); - tauri::async_runtime::spawn_blocking(move || { - let body = serde_json::json!({ "sessionId": session_id, "content": content, "model": model }).to_string(); - let preview = { - let mut slot = state.lock().map_err(|_| "Service state unavailable")?; - service_request(ensure_service(&mut slot)?, "POST", "/local-tasks/preview", Some(&body))? - }; - let id = preview.get("id").and_then(|value| value.as_str()).ok_or("Invalid task preview")?; - let path = preview.get("path").and_then(|value| value.as_str()).ok_or("Invalid task workspace")?; - let model = preview.get("model").and_then(|value| value.as_str()).ok_or("Invalid task model")?; - let content = preview.get("content").and_then(|value| value.as_str()).ok_or("Invalid task content")?; - let description = format!("Run local Codex using your existing ChatGPT login?\n\nWorkspace: {path}\nModel: {model}\n\nCodex's read-only sandbox can read files accessible to your account beyond this project. File writes and permission escalation requests are denied. External integrations are disabled.\n\nTask: {}", content.chars().take(1600).collect::()); - let approved = app.dialog().message(description).title("Allow read-only local Codex task?") - .buttons(tauri_plugin_dialog::MessageDialogButtons::OkCancel).blocking_show(); - if !approved { return Ok(None); } - let body = serde_json::json!({ "previewId": id }).to_string(); - let mut slot = state.lock().map_err(|_| "Service state unavailable")?; - service_request(ensure_service(&mut slot)?, "POST", "/local-tasks/start", Some(&body)).map(Some) - }).await.map_err(|_| "Local task approval failed")? -} - -#[tauri::command] -async fn preview_legacy_settings( - window: tauri::WebviewWindow, - state: tauri::State<'_, ServiceState>, -) -> Result { - require_local_window(&window)?; - if !cfg!(target_os = "macos") { - return Err("Legacy Swift preference import is available on macOS".into()); - } - let state = state.0.clone(); - tauri::async_runtime::spawn_blocking(move || { - // Read one known, nonsecret preference. Never enumerate the domain or its credentials. - let output = Command::new("/usr/bin/defaults") - .args(["read", "ai.supercode.desktop", "selectedModel"]) - .output() - .map_err(|_| "Could not read Supercode Desktop preferences")?; - if !output.status.success() || output.stdout.len() > 1024 { - return Err("No supported legacy model preference was found".into()); +async fn capture_screen(window: WebviewWindow) -> Result, String> { + trusted(&window)?; + #[cfg(target_os = "macos")] + return tauri::async_runtime::spawn_blocking(|| { + let mut nonce = [0u8; 16]; + getrandom::fill(&mut nonce).map_err(|_| "Could not start screen capture")?; + let directory = + std::env::temp_dir().join(format!("nova-capture-{}", URL_SAFE_NO_PAD.encode(nonce))); + std::fs::create_dir(&directory).map_err(|_| "Could not prepare screen capture")?; + #[cfg(unix)] + { + use std::os::unix::fs::PermissionsExt; + std::fs::set_permissions(&directory, std::fs::Permissions::from_mode(0o700)) + .map_err(|_| "Could not protect capture directory")?; } - let model = - String::from_utf8(output.stdout).map_err(|_| "Invalid legacy model preference")?; - let body = serde_json::json!({ "defaultModel": model.trim() }).to_string(); - let mut slot = state.lock().map_err(|_| "Service state unavailable")?; - service_request( - ensure_service(&mut slot)?, - "POST", - "/preferences/import-preview", - Some(&body), - ) + let path = directory.join("screen.jpg"); + let result = (|| { + let status = Command::new("/usr/sbin/screencapture") + .args(["-i", "-x", "-t", "jpg"]) + .arg(&path) + .status() + .map_err(|_| "Could not start native screen capture")?; + if !status.success() || !path.exists() { + return Ok(None); + } + if std::fs::metadata(&path) + .map_err(|_| "Capture unavailable")? + .len() + > 10 * 1024 * 1024 + { + return Err("Screen capture is too large".into()); + } + let bytes = std::fs::read(&path).map_err(|_| "Capture unavailable")?; + Ok(Some( + base64::engine::general_purpose::STANDARD.encode(bytes), + )) + })(); + let _ = std::fs::remove_file(&path); + let _ = std::fs::remove_dir(&directory); + result }) .await - .map_err(|_| "Legacy preference preview failed")? + .map_err(|_| "Screen capture failed")?; + #[cfg(not(target_os = "macos"))] + Err("Native screen capture is currently supported on macOS".into()) } fn main() { - tauri::Builder::default() + let app = tauri::Builder::default() .plugin(tauri_plugin_single_instance::init(|app, _, _| { - if let Some(window) = app - .get_webview_window("nova-web") - .or_else(|| app.get_webview_window("main")) - { - let _ = window.show(); - let _ = window.unminimize(); - let _ = window.set_focus(); - } + if let Some(window) = app.get_webview_window("main") { let _ = window.show(); let _ = window.set_focus(); } })) - .plugin(tauri_plugin_deep_link::init()) - .plugin(tauri_plugin_dialog::init()) + .invoke_handler(tauri::generate_handler![ + choose_folder, + open_external, + capture_screen, + computer_permissions, + open_computer_permission_settings, + start_local_codex + ]) .setup(|app| { - app.manage(ServiceState(Arc::new(Mutex::new(None)))); - computer_link::setup(app.handle())?; - // Web is the full account workspace. The local main window remains - // available for native project tools and offline diagnostics. - if let Err(error) = show_web_workspace(app.handle()) { - eprintln!("[nova/web] {error}"); - } + let service = spawn_service(app.handle()).map_err(|message| { + rfd::MessageDialog::new() + .set_title("Nova could not start") + .set_description(&message) + .set_level(rfd::MessageLevel::Error) + .show(); + std::io::Error::other(message) + })?; + let url = Url::parse(&format!("{ORIGIN}/bootstrap?key={}", service.secret))?; + app.manage(Desktop { + service: Mutex::new(service), + }); + let menu = Menu::with_items( + app, + &[ + &Submenu::with_items( + app, + "Nova", + true, + &[ + &PredefinedMenuItem::about(app, Some("About Nova"), None)?, + &PredefinedMenuItem::separator(app)?, + &MenuItem::with_id(app, "settings", "Settings…", true, Some("CmdOrCtrl+,"))?, + &PredefinedMenuItem::quit(app, None)?, + ], + )?, + &Submenu::with_items(app, "File", true, &[&MenuItem::with_id(app, "new-thread", "New Thread", true, Some("CmdOrCtrl+N"))?])?, + &Submenu::with_items( + app, + "Edit", + true, + &[ + &PredefinedMenuItem::undo(app, None)?, + &PredefinedMenuItem::redo(app, None)?, + &PredefinedMenuItem::separator(app)?, + &PredefinedMenuItem::cut(app, None)?, + &PredefinedMenuItem::copy(app, None)?, + &PredefinedMenuItem::paste(app, None)?, + &PredefinedMenuItem::select_all(app, None)?, + ], + )?, + &Submenu::with_items( + app, + "View", + true, + &[ + &MenuItem::with_id(app, "reload", "Reload", true, Some("CmdOrCtrl+R"))?, + &PredefinedMenuItem::fullscreen(app, None)?, + ], + )?, + &Submenu::with_items( + app, + "Window", + true, + &[ + &PredefinedMenuItem::minimize(app, None)?, + &PredefinedMenuItem::close_window(app, None)?, + ], + )?, + ], + )?; + app.set_menu(menu)?; + tauri::WebviewWindowBuilder::new(app, "main", WebviewUrl::External(url)) + .title("Nova") + .inner_size(1440.0, 960.0) + .min_inner_size(900.0, 600.0) + .on_navigation(|url| { + if url.origin().ascii_serialization() == ORIGIN { + return true; + } + let _ = open_url(url.as_str()); + false + }) + .on_new_window(|url, _| { + let _ = open_url(url.as_str()); + tauri::webview::NewWindowResponse::Deny + }) + .build()?; + let handle = app.handle().clone(); + std::thread::spawn(move || { + let mut saved = credential_entry() + .ok() + .and_then(|entry| entry.get_password().ok()) + .and_then(|value| serde_json::from_str(&value).ok()) + .unwrap_or(Value::Null); + loop { + std::thread::sleep(Duration::from_secs(3)); + let state = handle.state::(); + let Ok(mut service) = state.service.lock() else { + break; + }; + if matches!(service.child.try_wait(), Ok(Some(_))) { + // Never replay agent actions. Restart only the transport and reload persisted UI state. + match spawn_service(&handle) { + Ok(next) => { + *service = next; + if let Some(window) = handle.get_webview_window("main") { + if let Ok(url) = Url::parse(&format!( + "{ORIGIN}/bootstrap?key={}", + service.secret + )) { + let _ = window.navigate(url); + } + } + } + Err(_) => break, + } + } + if let Ok(value) = api(&service.secret, "/native/credential", None) { + let credential = value.get("credential").cloned().unwrap_or(Value::Null); + if credential != saved { + if let Ok(entry) = credential_entry() { + let result = if credential.is_null() { + entry.delete_credential().or_else(|e| { + if matches!(e, keyring::Error::NoEntry) { + Ok(()) + } else { + Err(e) + } + }) + } else { + entry.set_password(&credential.to_string()) + }; + if result.is_ok() { + saved = credential; + } + } + } + } + } + }); Ok(()) }) - .invoke_handler(tauri::generate_handler![ - service_status, - graphql_request, - open_project, - start_local_task, - preview_legacy_settings, - open_nova_web - ]) - .run(tauri::generate_context!()) - .expect("could not run Nova desktop"); + .on_window_event(|window, event| { + if window.label() == "main" + && matches!(event, tauri::WindowEvent::CloseRequested { .. }) + { + window.app_handle().exit(0); + } + }) + .on_menu_event(|app, event| { + if matches!(event.id().as_ref(), "new-thread" | "settings") { + if let Some(window) = app.get_webview_window("main") { + if trusted(&window).is_ok() { + let path = if event.id().as_ref() == "settings" { "/settings" } else { "/app" }; + let _ = window.eval(format!("window.history.pushState(null, '', '{}');window.dispatchEvent(new PopStateEvent('popstate'));", path)); + } + } + } + if event.id().as_ref() == "reload" { + if let Some(window) = app.get_webview_window("main") { + let _ = window.reload(); + } + } + }) + .build(tauri::generate_context!()) + .expect("Nova Desktop initialization failed"); + app.run(|app, event| { + if matches!(event, tauri::RunEvent::Exit) { + if let Some(state) = app.try_state::() { + if let Ok(mut service) = state.service.lock() { + if let Ok(value) = api(&service.secret, "/native/credential", None) { + if let Ok(entry) = credential_entry() { + if value["credential"].is_null() { + let _ = entry.delete_credential(); + } else { + let _ = entry.set_password(&value["credential"].to_string()); + } + } + } + service.shutdown(); + } + } + } + }); } -#[cfg(all(test, debug_assertions))] +#[cfg(test)] mod tests { use super::*; - #[test] - fn starts_and_authenticates_the_cli_service() { - let mut service = spawn_service().expect("start local CLI service"); - let result = health(&mut service).expect("authenticate local CLI service"); - assert_eq!(result.protocol_version, 1); - assert_eq!(result.status, "ready"); - let body = serde_json::json!({ "query": "{ __typename }", "variables": {} }).to_string(); - let result = service_request(&mut service, "POST", "/graphql", Some(&body)) - .expect("execute GraphQL through the CLI"); - assert_eq!(result["data"]["__typename"], "Query"); + fn native_commands_require_the_exact_main_window_origin() { + assert!(trusted_origin("main", &Url::parse(ORIGIN).unwrap())); + for origin in [ + "https://nova.supercodeai.tech", + "http://127.0.0.1:47832", + "http://localhost:47831", + "http://user@127.0.0.1:47831", + ] { + assert!(!trusted_origin("main", &Url::parse(origin).unwrap())); + } + assert!(!trusted_origin("other", &Url::parse(ORIGIN).unwrap())); } - #[test] - fn restarts_a_dead_child_without_reusing_its_instance_or_secret() { - let mut slot = Some(spawn_service().expect("start service")); - let previous = health(slot.as_mut().unwrap()).unwrap().instance_id; - let secret = slot.as_ref().unwrap().secret.clone(); - slot.as_mut().unwrap().child.kill().unwrap(); - slot.as_mut().unwrap().child.wait().unwrap(); - let service = ensure_service(&mut slot).expect("replace dead service"); - assert_ne!(health(service).unwrap().instance_id, previous); - assert_ne!(service.secret, secret); + fn external_links_reject_privileged_schemes_and_credentials() { + for url in [ + "file:///etc/passwd", + "javascript:alert(1)", + "http://example.com", + "https://a:b@example.com", + "nova://token", + ] { + assert!(external_url(url).is_err()); + } + assert!(external_url("https://github.com/login/oauth/authorize?state=123").is_ok()); } } diff --git a/apps/nova-desktop/src-tauri/tauri.bundle.conf.json b/apps/nova-desktop/src-tauri/tauri.bundle.conf.json deleted file mode 100644 index 380989b2..00000000 --- a/apps/nova-desktop/src-tauri/tauri.bundle.conf.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "bundle": { - "active": true, - "externalBin": ["binaries/nova-service"], - "resources": { "resources/cua-driver/": "cua-driver/" }, - "targets": "all", - "icon": ["icons/icon.png", "icons/icon.icns", "icons/icon.ico"], - "shortDescription": "Nova coding workspace", - "macOS": { "minimumSystemVersion": "12.0" }, - "windows": { "webviewInstallMode": { "type": "downloadBootstrapper", "silent": true } } - } -} diff --git a/apps/nova-desktop/src-tauri/tauri.conf.json b/apps/nova-desktop/src-tauri/tauri.conf.json index 918d3a1e..7139fa86 100644 --- a/apps/nova-desktop/src-tauri/tauri.conf.json +++ b/apps/nova-desktop/src-tauri/tauri.conf.json @@ -1,21 +1,55 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "Nova", - "version": "0.1.0", - "identifier": "ai.supercode.nova.desktop", + "version": "0.2.0", + "identifier": "ai.supercode.nova", "build": { - "beforeDevCommand": "bun run dev", - "devUrl": "http://127.0.0.1:1420", + "beforeDevCommand": { + "script": "bun run build", + "wait": true + }, "beforeBuildCommand": "bun run build", "frontendDist": "../dist" }, "app": { - "windows": [{ "title": "Nova", "width": 1280, "height": 800, "minWidth": 760, "minHeight": 520 }], + "windows": [], "security": { - "csp": "default-src 'self'; connect-src ipc: http://ipc.localhost; style-src 'self' 'unsafe-inline'; img-src 'self' asset: http://asset.localhost data:", - "devCsp": "default-src 'self'; script-src 'self' 'unsafe-inline'; connect-src 'self' ipc: http://ipc.localhost ws://127.0.0.1:1420; style-src 'self' 'unsafe-inline'; img-src 'self' data:" + "capabilities": [ + "nova-main" + ], + "csp": "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'" } }, - "bundle": { "active": false }, - "plugins": { "deep-link": { "desktop": { "schemes": ["nova-computer"] } } } + "bundle": { + "active": true, + "targets": [ + "app", + "dmg" + ], + "externalBin": [ + "binaries/nova-service", + "binaries/cua-driver" + ], + "resources": { + "../dist/": "ui/", + "native/codex/": "native/codex/", + "native/runtime-manifest.json": "native/runtime-manifest.json" + }, + "icon": [ + "icons/icon.png", + "icons/icon.icns", + "icons/icon.ico" + ], + "macOS": { + "minimumSystemVersion": "12.0", + "infoPlist": "Info.plist", + "signingIdentity": "-", + "dmg": { + "background": "dmg/background.png", + "windowSize": { "width": 720, "height": 450 }, + "appPosition": { "x": 200, "y": 225 }, + "applicationFolderPosition": { "x": 520, "y": 225 } + } + } + } } diff --git a/apps/nova-desktop/src/account-settings.tsx b/apps/nova-desktop/src/account-settings.tsx deleted file mode 100644 index 59e93a34..00000000 --- a/apps/nova-desktop/src/account-settings.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import { useEffect, useState } from "react" - -import { graphqlRequest } from "./graphql" - -export function AccountSettings() { - const [account, setAccount] = useState<{ signedIn: boolean; source: string | null } | null>(null) - const [busy, setBusy] = useState(false) - const [notice, setNotice] = useState("") - useEffect(() => { - let active = true - void graphqlRequest<{ account: NonNullable }>("{ account { signedIn source } }") - .then(({ account }) => { if (active) setAccount(account) }) - .catch(() => { if (active) setNotice("Account status is unavailable.") }) - return () => { active = false } - }, []) - async function change(action: "import" | "sign-out") { - setBusy(true) - setNotice("") - try { - if (action === "import") { - const result = await graphqlRequest<{ importCliLogin: boolean }>("mutation { importCliLogin }") - if (!result.importCliLogin) throw new Error("No valid CLI login is available. Sign in from the Threads sidebar.") - setAccount({ signedIn: true, source: "cli" }) - setNotice("CLI login imported. Signing out of Nova will preserve the CLI login.") - } else { - const result = await graphqlRequest<{ signOut: { revocation: string } }>("mutation { signOut { state revocation } }") - setAccount({ signedIn: false, source: null }) - setNotice(result.signOut.revocation === "unconfirmed" ? "Local login removed. Server revocation could not be confirmed; revoke this session from your account when connected." : "Signed out. Nova's stored credential and project grants were removed.") - } - window.dispatchEvent(new Event("nova-account-changed")) - } catch (error) { setNotice(error instanceof Error ? error.message : "Account change could not be confirmed") } - finally { setBusy(false) } - } - return
-

{account ? account.signedIn ? `Signed in with ${account.source === "cli" ? "an explicitly imported CLI login" : "a Nova desktop login"}.` : "Not signed in." : "Checking account…"}

-

Nova stores its login in your OS credential store. The CLI login is used only when you choose to import it.

- {account?.signedIn ? : } - {notice &&

{notice}

} -
-} diff --git a/apps/nova-desktop/src/adapters/actions.test.ts b/apps/nova-desktop/src/adapters/actions.test.ts new file mode 100644 index 00000000..0378f944 --- /dev/null +++ b/apps/nova-desktop/src/adapters/actions.test.ts @@ -0,0 +1,37 @@ +import { afterEach, expect, test } from "bun:test" +import { getReviews, getConnectedRepos } from "./actions" + +const originalFetch = globalThis.fetch +afterEach(() => { globalThis.fetch = originalFetch }) +function respond(response: Response) { + globalThis.fetch = (async () => response) as unknown as typeof fetch +} + +test("missing deployed API gives an actionable error instead of parsing HTML", async () => { + respond(new Response("Not found", { status: 404, headers: { "Content-Type": "text/html" } })) + await expect(getReviews()).rejects.toThrow("server needs an update") +}) + +test("expired session requests sign-in", async () => { + respond(Response.json({ error: "Unauthorized" }, { status: 401 })) + await expect(getReviews()).rejects.toThrow("Sign in again") +}) + +test("successful HTML and malformed JSON never leak WebKit parsing errors", async () => { + respond(new Response("", { headers: { "Content-Type": "text/html" } })) + await expect(getReviews()).rejects.toThrow("unexpected response") + respond(new Response("{", { headers: { "Content-Type": "application/json" } })) + await expect(getReviews()).rejects.toThrow("invalid review data") +}) + +test("reviews and repository filters use the authenticated action transport", async () => { + const calls: unknown[] = [] + globalThis.fetch = (async (url, init) => { + expect(url).toBe("/api/nova/client-actions") + calls.push(JSON.parse(init!.body as string)) + return Response.json({ result: [] }) + }) as typeof fetch + expect(await getReviews("repo-id")).toEqual([]) + expect(await getConnectedRepos()).toEqual([]) + expect(calls).toEqual([{ name: "getReviews", args: ["repo-id"] }, { name: "getConnectedRepos", args: [] }]) +}) diff --git a/apps/nova-desktop/src/adapters/actions.ts b/apps/nova-desktop/src/adapters/actions.ts new file mode 100644 index 00000000..44ee0993 --- /dev/null +++ b/apps/nova-desktop/src/adapters/actions.ts @@ -0,0 +1,27 @@ +import type * as Dashboard from "../../../web/modules/dashboard/actions" +import type * as Analytics from "../../../web/modules/dashboard/actions/analytics" +export type { ReviewItem, ReviewDetail, PrDiffFile } from "../../../web/modules/dashboard/actions" +export type { RepoOption } from "../../../web/modules/dashboard/actions/analytics" + +async function action(name: string, args: unknown[]): Promise { + const response = await fetch("/api/nova/client-actions", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ name, args }) }) + if (response.status === 404 || response.status === 405) { + throw new Error("Pull requests are unavailable because the Nova server needs an update. Deploy the desktop client-actions API, then retry.") + } + if (response.status === 401) throw new Error("Your Nova session expired. Sign in again to load pull requests.") + if (!response.headers.get("content-type")?.includes("application/json")) { + throw new Error("The Nova server returned an unexpected response. Retry loading pull requests.") + } + let body: { result?: T; error?: unknown } + try { body = JSON.parse(await response.text()) } + catch { throw new Error("The Nova server returned invalid review data. Retry loading pull requests.") } + if (!body || typeof body !== "object") throw new Error("The Nova server returned invalid review data.") + if (!response.ok) throw new Error(typeof body.error === "string" ? body.error : "Nova request failed") + if (!("result" in body)) throw new Error("The Nova server returned an incomplete review response.") + return body.result as T +} +export const getConnectedRepos: typeof Analytics.getConnectedRepos = () => action("getConnectedRepos", []) +export const getReviews: typeof Dashboard.getReviews = (...args) => action("getReviews", args) +export const getReview: typeof Dashboard.getReview = (...args) => action("getReview", args) +export const getPrDiffFiles: typeof Dashboard.getPrDiffFiles = (...args) => action("getPrDiffFiles", args) +export const queueReview: typeof Dashboard.queueReview = (...args) => action("queueReview", args) diff --git a/apps/nova-desktop/src/adapters/auth.ts b/apps/nova-desktop/src/adapters/auth.ts new file mode 100644 index 00000000..8d0e98b1 --- /dev/null +++ b/apps/nova-desktop/src/adapters/auth.ts @@ -0,0 +1,52 @@ +import { useEffect, useState } from "react" +import { invoke } from "@tauri-apps/api/core" +import type { NovaUser } from "../../../web/modules/nova-web/types" + +type Session = { user: NovaUser; session: { id: string } } +let current: Session | null = null +let pending: Promise | null = null +let failure: string | null = null +const listeners = new Set<() => void>() +const notify = () => listeners.forEach(fn => fn()) +export function useSession() { + const [, render] = useState(0) + useEffect(() => { + const changed = () => render(n => n + 1) + listeners.add(changed) + void loadSession() + return () => { listeners.delete(changed) } + }, []) + return { data: current, isPending: Boolean(pending), error: failure } +} +export async function loadSession() { + if (current || pending) return pending + pending = (async () => { + try { + const response = await fetch("/desktop/session") + const body = await response.json() + if (response.ok && body.user) { current = { user: body.user, session: { id: "desktop" } }; failure = null } + else if (response.status !== 401) failure = body.error ?? "Nova is unavailable" + } catch { failure = "Could not reach the local Nova service" } + finally { pending = null; notify() } + })() + notify() + return pending +} +export const signIn = { async social(_options: unknown) { + const response = await fetch("/desktop/auth/start", { method: "POST" }) + const state = await response.json() + if (!response.ok || typeof state.url !== "string") throw new Error(state.error ?? "Could not start sign-in") + await invoke("open_external", { url: state.url }) + const deadline = Date.now() + 5 * 60_000 + while (Date.now() < deadline) { + await new Promise(resolve => setTimeout(resolve, 1500)) + await loadSession() + if (current) { window.location.replace("/app"); return } + } + throw new Error("Sign-in expired. Return to Nova and try again.") +} } +export async function signOut() { + const response = await fetch("/desktop/logout", { method: "POST" }) + if (!response.ok) throw new Error("Could not sign out") + current = null; failure = null; notify() +} diff --git a/apps/nova-desktop/src/adapters/image.tsx b/apps/nova-desktop/src/adapters/image.tsx new file mode 100644 index 00000000..e9c8007a --- /dev/null +++ b/apps/nova-desktop/src/adapters/image.tsx @@ -0,0 +1,7 @@ +import type { ImgHTMLAttributes } from "react" +type Props = Omit, "src"> & { + src: string | { src: string }; fill?: boolean; priority?: boolean; unoptimized?: boolean; quality?: number +} +export default function Image({ src, fill, priority, unoptimized: _unoptimized, quality: _quality, style, ...props }: Props) { + return +} diff --git a/apps/nova-desktop/src/adapters/navigation.ts b/apps/nova-desktop/src/adapters/navigation.ts new file mode 100644 index 00000000..72ae64aa --- /dev/null +++ b/apps/nova-desktop/src/adapters/navigation.ts @@ -0,0 +1,22 @@ +import { useSyncExternalStore } from "react" + +const subscribe = (notify: () => void) => { + window.addEventListener("popstate", notify) + return () => window.removeEventListener("popstate", notify) +} +function navigate(path: string, replace = false) { + const url = new URL(path, window.location.href) + if (url.origin !== window.location.origin) throw new Error("Product navigation must stay in Nova") + window.history[replace ? "replaceState" : "pushState"](null, "", url) + window.dispatchEvent(new PopStateEvent("popstate")) +} +const router = { + push: (path: string) => navigate(path), + replace: (path: string) => navigate(path, true), + refresh: () => window.dispatchEvent(new PopStateEvent("popstate")), + back: () => window.history.back(), + forward: () => window.history.forward(), + prefetch: (_path: string) => {}, +} +export const useRouter = () => router +export const usePathname = () => useSyncExternalStore(subscribe, () => window.location.pathname) diff --git a/apps/nova-desktop/src/approvals-view.tsx b/apps/nova-desktop/src/approvals-view.tsx deleted file mode 100644 index 70ce1d02..00000000 --- a/apps/nova-desktop/src/approvals-view.tsx +++ /dev/null @@ -1,75 +0,0 @@ -import { useEffect, useState } from "react" - -import { graphqlRequest } from "./graphql" - -type Approval = { - id: string - sessionId: string - runId: string - toolInvocationId: string | null - capability: string - normalizedArgsHash: string - status: string - expiresAt: string - preview: string | null -} -type ApprovalList = { state: string; approvals: Approval[] } -const QUERY = `query { approvals { state approvals { id sessionId runId toolInvocationId capability normalizedArgsHash status expiresAt preview } } }` -const DECIDE = `mutation DecideApproval($input: ApprovalDecision!) { decideApproval(input: $input) { state status } }` - -export function ApprovalsView() { - const [result, setResult] = useState(null) - const [revision, setRevision] = useState(0) - const [busy, setBusy] = useState(null) - const [notice, setNotice] = useState("") - const [now, setNow] = useState(Date.now) - const hasPending = result?.approvals.some((approval) => approval.status === "pending") ?? false - useEffect(() => { - if (!hasPending) return - const timer = window.setInterval(() => setNow(Date.now()), 1000) - return () => window.clearInterval(timer) - }, [hasPending]) - useEffect(() => { - let active = true - setResult(null) - void graphqlRequest<{ approvals: ApprovalList }>(QUERY) - .then(({ approvals }) => { if (active) setResult(approvals) }) - .catch(() => { if (active) setResult({ state: "unavailable", approvals: [] }) }) - return () => { active = false } - }, [revision]) - - async function decide(approval: Approval, decision: "approved" | "denied") { - if (busy) return - const expiresAt = Date.parse(approval.expiresAt) - if (!Number.isFinite(expiresAt) || expiresAt <= Date.now()) { - setNotice("This request expired. Review the refreshed list.") - setRevision((value) => value + 1) - return - } - setBusy(approval.id) - setNotice("") - try { - const { decideApproval } = await graphqlRequest<{ decideApproval: { state: string; status: string | null } }>(DECIDE, { - input: { approvalId: approval.id, decision, sessionId: approval.sessionId, runId: approval.runId, toolInvocationId: approval.toolInvocationId, capability: approval.capability, normalizedArgsHash: approval.normalizedArgsHash }, - }) - setNotice(decideApproval.state === "ready" ? `Request ${decideApproval.status}.` : decideApproval.state === "stale" ? "This request changed or expired. Review the refreshed list." : decideApproval.state === "sign-in-required" ? "Sign in again before deciding." : "The decision could not be confirmed. Check the refreshed list before trying again.") - } catch { setNotice("The decision could not be confirmed. Check the refreshed list before trying again.") } - finally { setBusy(null); setRevision((value) => value + 1) } - } - - const pending = result?.approvals.filter((approval) => approval.status === "pending") ?? [] - return
-
WORKSPACE

Approvals

Review actions that need your attention.

- {notice &&

{notice}

} - {!result ?

Loading approvals…

: result.state !== "ready" ?

{result.state === "sign-in-required" ? "Sign in to see approval requests." : "Approvals are unavailable. Try refreshing."}

: pending.length === 0 ?

No pending approvals

Actions awaiting your decision will appear here.

:
{pending.map((approval) => { - const expiresAt = Date.parse(approval.expiresAt) - const expired = !Number.isFinite(expiresAt) || expiresAt <= now - return
-
{approval.capability}{expired ? "Expired" : "Pending"}
-

Thread {approval.sessionId.slice(0, 12)} · Expires {new Date(approval.expiresAt).toLocaleString()}

- {approval.preview ?
{approval.preview}
:

Preview unavailable. Approval is disabled until the action can be reviewed.

} -
-
- })}
} -
-} diff --git a/apps/nova-desktop/src/attachments.test.ts b/apps/nova-desktop/src/attachments.test.ts deleted file mode 100644 index 48105446..00000000 --- a/apps/nova-desktop/src/attachments.test.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { expect, test } from "bun:test" - -import { readSelectedAttachments } from "./attachments" - -test("reads explicitly selected UTF-8 text and images in hosted-compatible shapes", async () => { - const files = await readSelectedAttachments([new File(["é"], "hello.txt"), new File([new Uint8Array([137, 80, 78, 71])], "picture.png", { type: "image/png" })]) - expect(files[0]).toMatchObject({ kind: "text", name: "hello.txt", mediaType: "text/plain", size: 2, text: "é" }) - expect(files[1]).toMatchObject({ kind: "image", name: "picture.png", mediaType: "image/png", size: 4, dataBase64: "iVBORw==" }) - expect(new Set(files.map((file) => file.id)).size).toBe(2) -}) - -test("file selection is atomic and rejects unsupported or binary text", async () => { - for (const file of [new File(["a"], "a.pdf"), new File([""], "empty.txt"), new File(["\0"], "binary.txt"), new File([new Uint8Array([255])], "invalid.txt"), new File(["a".repeat(120_001)], "long.txt")]) { - await expect(readSelectedAttachments([file])).rejects.toThrow() - } - const existing = await readSelectedAttachments([new File(["keep"], "keep.txt")]) - await expect(readSelectedAttachments([new File(["bad"], "no.exe")], existing)).rejects.toThrow() - expect(existing).toHaveLength(1) -}) - -test("checks count and byte limits before any file read", async () => { - let reads = 0 - const file = { name: "large.png", type: "image/png", size: 2 * 1024 * 1024 + 1, arrayBuffer: async () => { reads++; return new ArrayBuffer(0) } } as File - await expect(readSelectedAttachments([file])).rejects.toThrow("2 MiB") - await expect(readSelectedAttachments(Array(17).fill(file))).rejects.toThrow("16") - await expect(readSelectedAttachments(Array(3).fill(file))).rejects.toThrow("5 MiB") - expect(reads).toBe(0) -}) - -test("keeps UTF-8 byte order marks and strips directory names", async () => { - const [file] = await readSelectedAttachments([new File(["\ufeffhello"], "../hello.txt")]) - expect(file).toMatchObject({ name: "hello.txt", text: "\ufeffhello", size: 8 }) -}) diff --git a/apps/nova-desktop/src/attachments.ts b/apps/nova-desktop/src/attachments.ts deleted file mode 100644 index b03f69c9..00000000 --- a/apps/nova-desktop/src/attachments.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { DESKTOP_ATTACHMENT_LIMITS, desktopUserAttachmentsSchema, type DesktopUserAttachment } from "@super/nova/desktop" - -const textExtensions = new Set("ts tsx js jsx mjs cjs json md mdx txt csv tsv yml yaml toml py go rs swift sh bash zsh css scss html htm sql prisma xml rb java kt vue svelte c h cpp hpp env gitignore dockerignore editorconfig svg graphql gql proto tf hcl log rtf".split(" ")) -const imageTypes: Record = { png: "image/png", jpg: "image/jpeg", jpeg: "image/jpeg", gif: "image/gif", webp: "image/webp", bmp: "image/bmp", avif: "image/avif", tif: "image/tiff", tiff: "image/tiff", heic: "image/heic", heif: "image/heif" } - -export async function readSelectedAttachments(files: readonly File[], existing: readonly DesktopUserAttachment[] = []): Promise { - if (files.length + existing.length > DESKTOP_ATTACHMENT_LIMITS.count) throw new Error("Choose at most 16 attachments") - if (files.reduce((total, file) => total + file.size, existing.reduce((total, file) => total + file.size, 0)) > DESKTOP_ATTACHMENT_LIMITS.totalBytes) throw new Error("Attachments exceed 5 MiB total") - const additions: DesktopUserAttachment[] = [] - for (const file of files) { - if (!file.size || file.size > DESKTOP_ATTACHMENT_LIMITS.fileBytes) throw new Error(`${file.name}: choose a nonempty file up to 2 MiB`) - const name = (file.name.replace(/\\/g, "/").split("/").pop()?.trim() || "file").replace(/[^\w.\- ()[\]]+/g, "_").slice(0, 200) - const extension = name.toLowerCase().split(".").pop() || "" - const imageType = imageTypes[extension] || Object.values(imageTypes).find((type) => type === file.type.toLowerCase()) - const text = textExtensions.has(extension) || /^(dockerfile|makefile|license|readme)$/i.test(name) || file.type.startsWith("text/") || ["application/json", "application/xml", "application/javascript", "application/typescript"].includes(file.type) - if (!imageType && !text) throw new Error(`${name}: only text and image files are supported`) - const bytes = new Uint8Array(await file.arrayBuffer()) - if (bytes.length !== file.size) throw new Error(`${name}: the file changed while reading`) - const metadata = { id: crypto.randomUUID(), name, size: bytes.length } - if (imageType && imageType !== "text/plain") { - let binary = "" - for (let offset = 0; offset < bytes.length; offset += 8192) binary += String.fromCharCode(...bytes.subarray(offset, offset + 8192)) - additions.push({ ...metadata, kind: "image", mediaType: imageType, dataBase64: btoa(binary) }) - } else { - let contents: string - try { contents = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(bytes) } - catch { throw new Error(`${name}: choose a UTF-8 text file`) } - if (!contents.trim() || contents.includes("\0") || contents.length > DESKTOP_ATTACHMENT_LIMITS.textCharacters) throw new Error(`${name}: choose nonempty text up to 120,000 characters without binary data`) - additions.push({ ...metadata, kind: "text", mediaType: "text/plain", text: contents }) - } - } - return desktopUserAttachmentsSchema.parse([...existing, ...additions]) -} diff --git a/apps/nova-desktop/src/composer.tsx b/apps/nova-desktop/src/composer.tsx deleted file mode 100644 index 723f6a76..00000000 --- a/apps/nova-desktop/src/composer.tsx +++ /dev/null @@ -1,68 +0,0 @@ -import { useEffect, useRef, useState } from "react" -import { ArrowUp, Mic, Plus, X } from "lucide-react" -import type { DesktopUserAttachment } from "@super/nova/desktop" - -import { readSelectedAttachments } from "./attachments" -import { useDesktopPreferences } from "./preferences" - -export function Composer({ draft, onChange, mode, onModeChange, compact = false, creating = false, onCreate, onStop, projectContext = false, blocked = "", stopKind = "cloud", stopping = false, attachments = [], onAttachmentsChange, attachmentsDisabled = "" }: { - draft: string - onChange: (value: string) => void - mode: "chat" | "plan" | "agent" - onModeChange: (value: "chat" | "plan" | "agent") => void - compact?: boolean - creating?: boolean - onCreate?: () => void - onStop?: () => void - projectContext?: boolean - blocked?: string - stopKind?: "cloud" | "local" - stopping?: boolean - attachments?: DesktopUserAttachment[] - onAttachmentsChange?: (files: DesktopUserAttachment[]) => void - attachmentsDisabled?: string -}) { - const { preferences } = useDesktopPreferences() - const picker = useRef(null) - const selection = useRef(0) - const [reading, setReading] = useState(false) - const [attachmentError, setAttachmentError] = useState("") - useEffect(() => () => { selection.current += 1 }, []) - const canSend = Boolean(onCreate && draft.trim() && !creating && !blocked && !reading && !(attachments.length && attachmentsDisabled)) - async function selectFiles(files: File[]) { - const request = ++selection.current - setReading(true) - setAttachmentError("") - try { - const next = await readSelectedAttachments(files, attachments) - if (selection.current === request) onAttachmentsChange?.(next) - } catch (error) { - if (selection.current === request) setAttachmentError(error instanceof Error ? error.message : "Could not read the selected files") - } finally { - if (selection.current === request) setReading(false) - } - } - return
- { - const files = Array.from(event.target.files ?? []) - event.target.value = "" - if (files.length) void selectFiles(files) - }} /> - {attachments.length > 0 &&
    - {attachments.map((file) =>
  • - {file.name} · {Math.ceil(file.size / 1024)} KiB - -
  • )} -
} - {attachmentError &&

{attachmentError}

} - {reading &&

Reading selected files…

} -