Files
loki/desktop/README.md
CatoandClaude Opus 5 a02d31d996 Every public claim matches the code, and two gates can now fail (#802)
* fix(truth): every public claim now matches what the code and the licence say

The /license page forbade what LICENSE grants. #791 relicensed the repo to MIT
and fixed LICENSE, the README and the Terms — but missed the page, which still
said "source-available", listed hosting and repackaging under "you may not",
and promised a replacement licence that had already shipped. On a public repo,
that revoked rights we had granted.

Same shape, five more places:

- Three live /thoughts pages and four front-matters carried "Mao Nakamoto",
  the retired identity, into the rendered byline and the OG social card.
- legal/ named that identity as operator, data controller and IP assignor, and
  assigned the work to bitbaum AG / orangecat GmbH / loki GmbH — none of which
  were ever incorporated. Rewritten as a record of authorship and the MIT
  grant, which is what is actually true.
- The desktop About dialog and the installer copyright metadata shipped
  "© 2026 Mao Nakamoto" in every build. No audit pass had looked there.
- /pricing and the feedback-widget docs said the report loop "closes itself"
  months after close-loop.ts deliberately removed auto-resolve for being
  untrue; resolve is an operator act and has zero call sites.
- /roadmap claimed signed installers under "Shipping now"; no signing secret
  exists and /download says the opposite two pages away.
- /releases claimed "every shipped version" while missing nine, and listed a
  0.8.25 that was never tagged — its "Binaries →" link 404'd. Removed per the
  file's own rule: one entry per tag pushed to loki-releases.
- desktop/README pointed all five install commands at bitbaum/loki, which
  404s; releases publish to loki-releases. Version pin replaced with a glob so
  it cannot rot again.
- DEFAULT_USER_NAME greeted nameless OAuth users as "Mao".

And the two that lied to agents rather than users: CLAUDE.md claimed pre-push
runs the full verify bundle so "green locally means green in CI", and
AGENTS.md claimed pre-commit runs tsc. The hook's own header documents why it
stopped doing both — a docs-only push runs nothing. An agent trusting either
line would skip the verification it needed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix(gates): close the two gaps that let deleted things keep passing

Two gates could not fail, and one migration ledger had silently drifted.

MIGRATION JOURNAL — 13 files missing, next db:generate breaks the deploy.
drizzle/ held 78 .sql files; meta/_journal.json had 65 entries. Production
was fine and always had been: apply-schema.sh globs the directory and keeps
its own _deploy_schema_history, so it never reads the journal. But
drizzle-kit does, and its newest snapshot was 0072 — so the next generate
would re-emit 0073-0077, including CREATE TABLE "calendar_busy" with no
IF NOT EXISTS. apply-schema.sh rewrites ADD COLUMN only, and the batch is one
transaction, so the deploy would abort on a change unrelated to it.

Reconciled to 78 via bootstrap-migration-ledger.ts --write-journal, and added
scripts/test/migration-journal-coverage.ts so it cannot drift again: files vs
journal in both directions, plus idx contiguity. Proven by mutation — drop one
entry and it exits 1; restore it and it exits 0.

SMOKE — every authenticated probe passed whether or not the route existed.
The auth middleware answers 401 before routing, and check_route accepted 401
for everything in AUTH_API_ROUTES. Measured: /api/definitely-not-a-real-route
returns 401 exactly like /api/orgs. So the list proved nothing, and
/api/checkout/personal sat in it for 15 days after the Stripe rail was
removed. A 401 now only passes if a route file actually resolves on disk
(dynamic and catch-all segments included); the dead entry is gone, and all
remaining probes resolve.

Also: bumping desktop/package.json to 0.8.29, because the retired-identity fix
in the previous commit touched desktop/src/main/index.ts and desktop-release-
drift.ts correctly refused to let a shipped file change without a release to
carry it. That gate was right and is the model for the two above.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-20 08:40:34 -07:00

5.1 KiB

Fleet Runner Desktop (for Loki)

This is the native desktop application — the local runtime for Loki on the user's own machine (the "local fleet runner"). It is optional: cloud is the default builder, and a project runs here only when its stored routing decision says so ("Runs on" in Control → project profile, or a laptop-only checkout).

The shipped design is documented in docs/architecture/box-owned-pty-executor.md and docs/development/cloud-local-workflows.md. docs/desktop-app.md and docs/fleet-runner-pty-ownership.md are the historical decision records.

Current status

  • Packaged native app (AppImage + .deb produced via electron-builder; macOS/Windows builds via .github/workflows/desktop-release.yml).
  • Ships in web-shell mode: the main window loads https://loki.orangecat.ch directly and the user gets the exact same React tree the browser serves, plus native bits (tray, OS notifications on agent idle, persistent NextAuth cookies). One UI, two surfaces.
  • Native IPC remains available via the preload-injected window.fleetRunner bridge — the web app detects Fleet Runner via the FleetRunner/<version> UA suffix and calls into the local runtime where it makes sense.
  • Owns every agent PTY. A dispatch claimed from pending_commands spawns the agent CLI in a node-pty PTY inside the runner's own process tree (src/main/pty-runtime.ts, the same core the headless box runner uses) and writes the prompt there. An inject for a project with no live owned PTY fails loudly ("no running agent for … — dispatch to start one") and the cloud enqueues a dispatch instead. There is no multiplexer: no zellij binary is bundled, no LOKI_RUNNER_PTY switch exists.
  • No tab focus, no restore. focus_tab is retired (the runner rejects it; watch the agent in the web terminal). There is no cold-start restore on boot and no Settings "Restoration" section — an agent runs while its PTY runs.
  • Agent installers ("Install X" on Control) run in an owned PTY watchable in the web terminal. Peek reads the owned PTY buffer; the "This computer" terminal streams it live and accepts keystrokes.
  • Real home/ integration in the main process: loads your projects config from agent-projects.conf, uses decide(), renders prompts via the orchestration layer (renderTaskForAdapter) on every dispatch.
  • The embedded home/watcher reacts to ~/.loki/sessions/*.md changes and fires a native OS notification on every worker.idle event — fire-and-walk-away UX.

Overriding the shell URL

# Point the desktop at the hosted production app (default)
LOKI_WEB_URL=https://loki.orangecat.ch ./Fleet-Runner-*.AppImage

# Or against a local dev server
LOKI_WEB_URL=http://localhost:3000 ./Fleet-Runner-*.AppImage

Get the runnable app

End users should grab a signed installer from the download page. For a local build from source:

git clone https://github.com/bitbaum/loki.git
cd loki/desktop
npm install
npm run dist:linux    # or dist:mac / dist:win on those platforms

Then run:

chmod +x dist/Fleet-Runner-*.AppImage
./dist/Fleet-Runner-*.AppImage

(Or install the .deb / .dmg / .exe.)

On launch, the app loads the Loki control plane directly. Sign in with the same account you use on the web; native APIs are injected via window.fleetRunner, and the embedded watcher fires native notifications when local agents go idle.

Dev (for contributors)

cd desktop
npm install
npm run dev

Packaging

npm run dist          # current platform
npm run dist:linux    # AppImage + deb
# etc.

Cutting a release

.github/workflows/desktop-release.yml builds Fleet Runner for macOS, Windows, and Linux from one tag push and uploads the signed installers to a GitHub Release. To cut a release:

cd desktop
npm version patch     # or minor/major — bumps package.json + creates a commit
git tag fleet-runner-v$(node -p "require('./package.json').version")
git push --follow-tags

The workflow takes ~10 minutes. Once it's green, the binaries are at:

  • https://github.com/bitbaum/loki-releases/releases/latest/download/Fleet-Runner-linux-x86_64.AppImage
  • https://github.com/bitbaum/loki-releases/releases/latest/download/Fleet-Runner-linux-amd64.deb
  • https://github.com/bitbaum/loki-releases/releases/latest/download/Fleet-Runner-mac-x64.dmg
  • https://github.com/bitbaum/loki-releases/releases/latest/download/Fleet-Runner-mac-arm64.dmg
  • https://github.com/bitbaum/loki-releases/releases/latest/download/Fleet-Runner-win-x64.exe

To test the workflow without minting a real release, dispatch it manually from the Actions tab with dry_run: true — it builds on all three runners but skips the publish step.

Relation to existing code

  • Builds on the home/ pure pieces (state, decide, render, watcher) and the shared executor in src/lib/agent-execution/.
  • The headless box runner (scripts/box-runner.ts, loki-box-runner.service on Hetzner) reuses this runner core without Electron; it is the default builder.

See the root content/thoughts/the-local-fleet-runner-and-remote-control-plane-architecture.md for the strategic "why".