Repository navigation
feat(nova-desktop): introduce Nova Desktop application #378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
yashdev9274
wants to merge
2
commits into
main
Choose a base branch
from
nova-2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| name: Nova Desktop | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| pull_request: | ||
| paths: | ||
| - "apps/nova-desktop/**" | ||
| - "apps/supercode-cli/server/src/nova/**" | ||
| - "packages/nova/**" | ||
| - ".github/workflows/nova-desktop.yml" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| package-preview: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - os: macos-15 | ||
| target: aarch64-apple-darwin | ||
| - os: macos-15-intel | ||
| target: x86_64-apple-darwin | ||
| - os: windows-latest | ||
| target: x86_64-pc-windows-msvc | ||
| runs-on: ${{ matrix.os }} | ||
| timeout-minutes: 45 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: "1.4.5" | ||
| - uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| targets: ${{ matrix.target }} | ||
| - uses: Swatinem/rust-cache@v2 | ||
| with: | ||
| workspaces: apps/nova-desktop/src-tauri | ||
| - run: bun install --frozen-lockfile | ||
| - name: Build frontend and contracts | ||
| run: bun run --cwd apps/nova-desktop build | ||
| - name: Desktop regression suites | ||
| shell: bash | ||
| run: bun test apps/supercode-cli/server/src/nova/desktop-*.test.ts packages/nova/desktop.test.ts apps/supercode-cli/server/src/nova/workspaces/patch.test.ts | ||
| - name: Compile standalone sidecar | ||
| run: bun run --cwd apps/nova-desktop sidecar:build ${{ matrix.target }} | ||
| - name: Smoke-test native sidecar | ||
| shell: bash | ||
| run: | | ||
| extension="" | ||
| if [[ "$RUNNER_OS" == "Windows" ]]; then extension=".exe"; fi | ||
| bun run --cwd apps/nova-desktop sidecar:smoke "src-tauri/binaries/nova-service-${{ matrix.target }}${extension}" | ||
| - name: Rust bridge tests | ||
| working-directory: apps/nova-desktop/src-tauri | ||
| run: cargo test --locked | ||
| - name: Build unsigned preview installer | ||
| run: bun run --cwd apps/nova-desktop tauri build --target ${{ matrix.target }} --config src-tauri/tauri.bundle.conf.json | ||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: nova-preview-${{ matrix.target }} | ||
| path: apps/nova-desktop/src-tauri/target/${{ matrix.target }}/release/bundle/ | ||
| if-no-files-found: error | ||
| retention-days: 7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| dist/ | ||
| node_modules/ | ||
| src-tauri/target/ | ||
| src-tauri/gen/ | ||
| src-tauri/binaries/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| # Nova Desktop — development preview | ||
|
|
||
| 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. | ||
|
|
||
| ## Run from the checkout | ||
|
|
||
| ```sh | ||
| bun install | ||
| bun run --cwd apps/nova-desktop tauri 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 | ||
|
|
||
| - 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. | ||
|
|
||
| ### Local Codex tasks | ||
|
|
||
| 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. | ||
|
|
||
| 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. | ||
|
|
||
| ## Accounts and preferences | ||
|
|
||
| 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. | ||
|
|
||
| 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. | ||
|
|
||
| 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. | ||
|
|
||
| ## Features | ||
|
|
||
| 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 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. | ||
|
|
||
| ## Recovery and storage | ||
|
|
||
| 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. | ||
|
|
||
| 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. | ||
|
|
||
| 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. | ||
|
|
||
| ## Build a preview | ||
|
|
||
| ```sh | ||
| bun run --cwd apps/nova-desktop sidecar:build | ||
| bun run --cwd apps/nova-desktop package | ||
| ``` | ||
|
|
||
| The separate bundle config enables bundling and embeds `nova-service`; 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. | ||
|
|
||
| Standalone sidecar builds require Bun 1.4.5 or newer; CI pins 1.4.5. The root workspace package-manager declaration is preserved. | ||
|
|
||
| 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 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. | ||
|
|
||
| ## Verification | ||
|
|
||
| ```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 | ||
| ``` | ||
|
|
||
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>Nova</title> | ||
| </head> | ||
| <body> | ||
| <div id="root">Loading Nova…</div> | ||
| <script src="/startup.js"></script> | ||
| <script type="module" src="/src/main.tsx"></script> | ||
| </body> | ||
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| { | ||
| "name": "nova-desktop", | ||
| "version": "0.1.0", | ||
| "private": true, | ||
| "type": "module", | ||
| "scripts": { | ||
| "dev": "vite --port 1420 --strictPort", | ||
| "build": "tsc --noEmit && vite build", | ||
| "typecheck": "tsc --noEmit", | ||
| "sidecar:build": "bun scripts/build-sidecar.ts", | ||
| "sidecar:smoke": "bun scripts/smoke-sidecar.ts", | ||
| "package": "bun run sidecar:build && tauri build --config src-tauri/tauri.bundle.conf.json", | ||
| "tauri": "tauri" | ||
| }, | ||
| "dependencies": { | ||
| "@super/nova": "workspace:*", | ||
| "@tauri-apps/api": "^2.0.0", | ||
| "@tauri-apps/plugin-dialog": "^2.0.0", | ||
| "lucide-react": "^0.468.0", | ||
| "react": "19.2.3", | ||
| "react-dom": "19.2.3", | ||
| "react-markdown": "^10.1.0", | ||
| "remark-gfm": "^4.0.1" | ||
| }, | ||
| "devDependencies": { | ||
| "@tauri-apps/cli": "^2.0.0", | ||
| "@types/react": "19.2.7", | ||
| "@types/react-dom": "19.2.3", | ||
| "typescript": "^5.7.0", | ||
| "vite": "^6.1.0" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| 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)}` | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| import { mkdir } from "node:fs/promises" | ||
| import { dirname, resolve } from "node:path" | ||
| import { fileURLToPath } from "node:url" | ||
|
|
||
| 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<string, string> = { | ||
| "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`) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| import { randomBytes } from "node:crypto" | ||
| import { join, resolve } from "node:path" | ||
| import { mkdtemp, rm } from "node:fs/promises" | ||
| import { tmpdir } from "node:os" | ||
|
|
||
| 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) | ||
| try { | ||
| child.stdin.write(`${JSON.stringify({ secret, credential: null })}\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") | ||
| 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") | ||
| 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 }) } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The unanchored
docsrule also ignores the existingapps/docsapplication. New pages there disappear from normal Git status and staging, so contributors can leave them out of commits. Use/docs/to ignore only the root-level local planning folder.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!