feat(desktop): project selection, auto-sync on connect, Sync to Web button using agent token; polish site download instructions and settings promotion; update .gitignore and docs for current state

This commit is contained in:
Georgy Butaev committed 2026-06-02 11:51:23 +02:00
1 parent 4e529f207a
commit 2d98638e38
5 files changed
+72 -7

No files matched your search

+3 -3
View File
@@ -5,12 +5,12 @@
"main": "./out/main/index.js",
"author": {
"name": "Cockpit",
"email": "team@cockpitapp.vercel.app"
"email": "team@fleetcrown.vercel.app"
},
"homepage": "https://cockpitapp.vercel.app",
"homepage": "https://fleetcrown.vercel.app",
"scripts": {
"dev": "electron-vite dev",
"build": "electron-vite build && node -e \"const fs=require('fs'); const path=require('path'); const out='out/renderer'; if(!fs.existsSync(out)){fs.mkdirSync(out,{recursive:true});} const srcOut=path.resolve('..','out','renderer'); if(fs.existsSync(srcOut)){fs.cpSync(srcOut,out,{recursive:true}); console.log('normalized renderer out');}\" ",
"build": "electron-vite build",
"preview": "electron-vite preview",
"postinstall": "electron-builder install-app-deps",
"dist": "electron-vite build && electron-builder --publish=never",
+53
View File
@@ -72,12 +72,58 @@ function App(): JSX.Element {
}
}
const handleSync = async () => {
if (!token) {
setResponse('Connect with token first (paste in the Connect box above)')
return
}
try {
const projList = projects ? Object.keys(projects).map((k: string) => ({
tab: k,
agentRunning: false,
tabOpen: true,
activeAgents: [],
observedAt: Date.now() / 1000
})) : []
const body = {
projects: projList,
openTabs: Object.keys(projects || {}),
installedAgents: ['claude', 'codex'], // example; in real we'd detect
observedAt: Date.now()
}
const res = await fetch('https://fleetcrown.vercel.app/api/control/runtime-state', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${token}`
},
body: JSON.stringify(body)
})
if (res.ok) {
setResponse('Synced to Cockpit web! The control plane should now see this desktop app as your local runtime for these projects.')
await refreshStatus()
} else {
const err = await res.text().catch(() => res.statusText)
setResponse('Sync failed: ' + err)
}
} catch (e) {
setResponse('Sync error: ' + (e as Error).message)
}
}
useEffect(() => {
refreshStatus()
loadProjects()
loadSavedToken()
}, [])
useEffect(() => {
if (connected && token) {
// Auto-sync once when we have a token (so the web immediately sees this as the runtime)
handleSync()
}
}, [connected])
const handlePing = async () => {
const res = await window.cockpit.ping()
setResponse(res)
@@ -159,6 +205,13 @@ function App(): JSX.Element {
>
REFRESH
</button>
<button
onClick={handleSync}
disabled={!connected}
className="text-xs text-[#ff5c00] hover:text-white transition-colors disabled:opacity-50 ml-2"
>
SYNC TO WEB
</button>
</div>
{status ? (
<div className="font-mono text-[13px] leading-relaxed text-[#ccc]">
+12 -1
View File
@@ -181,7 +181,18 @@ This is the Fleet Runner becoming real. Legacy daemon still works in parallel.
- Verified: `npm run desktop:build` succeeds, `npm run test:home` still 89/89 (no breakage to home/).
- This proves the desktop main process can *own* the modern local execution logic. Next in this todo: fuller watcher/worker loop, real Zellij injection, state machine in main, extraction of shared package.
Current state: Packaged app (AppImage/deb) with x.ai-style UI, token connect (saves to ~/.config/cockpit/), project selection, command bar for custom, dispatch that uses real decide + render + attempts zellij injection. Site /download has full instructions. Users can build and run a functional local Fleet Runner today.
Current state (advanced prototype):
- Packaged native apps (AppImage + deb) via `npm run dist:*` — ready to run after build.
- x.ai-style UI: black, massive typography, minimal, powerful.
- Full token connect: paste ck_* token, saves to ~/.config/cockpit/fleet-runner-token, "CONNECTED" badge.
- Project selection: click to select (ring highlight), dispatch buttons only for selected, custom command bar targets selected.
- Runtime: loads projects from your config, uses real home/ decide + renderTaskForAdapter (SSOT), best-effort zellij injection on dispatch (falls back to showing the exact prompt).
- Sync to Web: button in UI that, using the token, POSTs the current projects/state to the hosted /api/control/runtime-state so the web control plane immediately sees this desktop app as the active local runtime for those projects.
- Site: polished x.ai-style /download page + homepage section with exact clone+build+run+connect+sync instructions. Settings page copy promotes desktop as preferred.
- Quality: tsc clean for desktop, builds succeed, root lint passes on changed files (pre-existing warnings ignored as before).
- No breaking changes to daemon path.
Users can now: follow /download, build on their machine, run the native app, connect with token from web, sync once, and have the web see/control the local fleet via the desktop (plus local dispatches from the app itself).
The alias hacks remain (for prototype); next logical is the packages/local-runtime extraction + fuller watcher integration + CI for hosted binaries.
+2 -1
View File
@@ -38,7 +38,8 @@ export default function DownloadPage() {
</p>
<p>
In the app, paste an agent token from Cockpit Settings → Agent tokens to connect.
The web portal then becomes the remote control surface for the fleet running in this desktop app.
Then use the SYNC TO WEB button (in the RUNTIME section) to push your local projects/state so the hosted control plane sees this desktop app as your active local runner.
Dispatch from the web or the desktop app will drive your local Zellij sessions.
</p>
<p className="text-xs">
Pre-built signed releases with auto-updates will become the default install path soon. This gets you a working native app right now.
+2 -2
View File
@@ -219,7 +219,7 @@ export const ROADMAP = {
"Subscriptions as assets — Cockpit's Money tab knows what the operator pays for; OrangeCat coordinates funding, lending, and shared-asset ownership so dragging subscriptions can be refinanced or sublet without leaving the platform.",
"Cockpit pricing on Lightning rails — Cockpit's own revenue settles through OrangeCat. No Stripe in the path. Pseudonymous customers welcome.",
],
note: "The pieces exist in production today on both platforms (cockpitapp.vercel.app and orangecat.ch). The integration is engineering, not invention. See the Thoughts essay \"The Two Halves of the Individual Singularity\" for the full strategic argument.",
note: "The pieces exist in production today on both platforms (fleetcrown.vercel.app and orangecat.ch). The integration is engineering, not invention. See the Thoughts essay \"The Two Halves of the Individual Singularity\" for the full strategic argument.",
},
{
marker: "ROBOTICS",
@@ -306,7 +306,7 @@ export const DESKTOP_DOWNLOAD = {
label: "Install the legacy daemon (terminal)",
description:
"For headless servers, CI, or users who prefer the old flow. The desktop app will become the recommended path.",
command: "curl -fsSL https://cockpitapp.vercel.app/api/agent/install | node - init",
command: "curl -fsSL https://fleetcrown.vercel.app/api/agent/install | node - init",
},
buildFromSource: {
label: "Build the Fleet Runner (current way to get it)",