|
| 1 | +# Desktop application |
| 2 | + |
| 3 | +Portreeve Desktop is the graphical inspection and coordination surface for the same |
| 4 | +per-user Portreeve installation managed by the CLI. It does not install a second server, |
| 5 | +keep a separate registry, or bypass the HTTP/JSON Unix-socket protocol. The application |
| 6 | +bundles a verified CLI artifact and can install that artifact into the one managed |
| 7 | +per-user location used by native supervision. |
| 8 | + |
| 9 | +## Overview and lifecycle |
| 10 | + |
| 11 | +The Overview tab reports the desktop, bundled CLI, managed CLI, running-server, |
| 12 | +supervisor, and socket layers independently. Lifecycle actions invoke an exact bundled |
| 13 | +or managed executable from the Electron main process; the renderer cannot choose an |
| 14 | +executable, run a shell command, or search `PATH`. |
| 15 | + |
| 16 | +Available actions follow current evidence: |
| 17 | + |
| 18 | +- install and start the managed Portreeve service; |
| 19 | +- start, stop, or restart native per-user supervision; |
| 20 | +- stop an explicitly manual `portreeve serve` process without adopting it; |
| 21 | +- upgrade the managed CLI after version and artifact verification; |
| 22 | +- uninstall supervision while retaining Portreeve data; |
| 23 | +- preview and confirm a complete Portreeve data reset. |
| 24 | + |
| 25 | +Install, reset, and upgrade decisions remain explicit. Update discovery only reports a |
| 26 | +new desktop release and opens one fixed project download page after confirmation; it |
| 27 | +does not download or install updates automatically. |
| 28 | + |
| 29 | +Lifecycle operations display a stable outcome plus safe structured error codes and |
| 30 | +messages. For example, an unsafe supervisor log mode is shown as an actionable |
| 31 | +permission failure rather than only `internal`. Unstructured errors are generalized so |
| 32 | +arbitrary exception detail does not become renderer content. |
| 33 | + |
| 34 | +## Ports |
| 35 | + |
| 36 | +The Ports tab uses the official JavaScript client to show global claimed and unclaimed |
| 37 | +TCP listeners. The main process reduces inventory before publishing it to the renderer. |
| 38 | +Claims show project, component, endpoint, worktree basename, mode, and timing; listeners |
| 39 | +show reduced ownership and process evidence. Lease tokens, internal database fields, and |
| 40 | +arbitrary executable paths are not exposed. |
| 41 | + |
| 42 | +## Stacks |
| 43 | + |
| 44 | +The Stacks tab reads definitions and current generation, activation, resolution, and |
| 45 | +fresh provider evidence through the official client. It supports: |
| 46 | + |
| 47 | +- selecting and applying a checked-in `portreeve.stack.json` through the native file |
| 48 | + picker; |
| 49 | +- preparing or reusing one complete allocation generation; |
| 50 | +- inspecting components, endpoints, dependencies, placements, host addresses, |
| 51 | + Docker-network addresses, and provider evidence; |
| 52 | +- copying individual addresses and previewing a component-scoped sandbox discovery |
| 53 | + document for a launcher-supplied gateway; |
| 54 | +- explicitly reconciling provider evidence after launcher loss; |
| 55 | +- requesting evidence-gated activation ending after the project launcher stops its |
| 56 | + providers; |
| 57 | +- previewing seven-day missing-worktree stack pruning and typing `PRUNE` before |
| 58 | + execution. |
| 59 | + |
| 60 | +Portreeve Desktop never starts or stops a project process or container, invokes Docker |
| 61 | +Compose, owns application startup order, maps project environment variables, or asserts |
| 62 | +application health. Those remain responsibilities of the project launcher. Stale stack |
| 63 | +evidence remains visible for diagnosis but withholds stack mutation controls until |
| 64 | +current evidence returns; the server revalidates every requested action as final |
| 65 | +authority. |
| 66 | + |
| 67 | +## Trust and data boundary |
| 68 | + |
| 69 | +Electron runs a sandboxed renderer with context isolation, Node integration disabled, |
| 70 | +and a restrictive local content policy. The preload exposes only named, schema-validated |
| 71 | +capabilities. The main process accepts IPC only from the primary `app://portreeve` |
| 72 | +renderer frame and owns the native file picker, clipboard write, fixed download-page |
| 73 | +navigation, exact CLI execution, and official client connection. |
| 74 | + |
| 75 | +The desktop receives no general filesystem, shell, network-navigation, SQLite, Docker, |
| 76 | +or Portreeve-socket capability. Stack view models omit full worktree paths, claim and |
| 77 | +lease identifiers, run identifiers, Docker labels, and credentials. Discovery previews |
| 78 | +contain only their documented component-scoped address contract. |
| 79 | + |
| 80 | +## Local package |
| 81 | + |
| 82 | +Build and open an unsigned local macOS application bundle with the repository-pinned Bun |
| 83 | +toolchain: |
| 84 | + |
| 85 | +```sh |
| 86 | +PORTREEVE_HOMEPAGE_URL=https://github.com/TrentBrown/portreeve \ |
| 87 | +PORTREEVE_RELEASE_BASE_URL=https://github.com/TrentBrown/portreeve/releases/download \ |
| 88 | +bun run release:build |
| 89 | + |
| 90 | +bun run desktop:package |
| 91 | +open dist/desktop/Portreeve-darwin-arm64/Portreeve.app |
| 92 | +``` |
| 93 | + |
| 94 | +The packaging script selects the physical host architecture and verifies the bundled |
| 95 | +CLI against the generated release manifest and SHA-256 digest. This local bundle is a |
| 96 | +release candidate for manual verification, not a signed or notarized public desktop |
| 97 | +distribution. |
0 commit comments