mirror of
https://github.com/agent0ai/a0-launcher.git
synced 2026-12-04 03:58:11 +00:00
Clean up formatting and dedupe shared helpers
Unwrap markdown paragraphs and bullets to single physical lines, remove the completed TODO.md work diary, and extract duplicated renderer and adapter helpers into shared component-utils, release-entries, progress-eta, and RuntimeProvisioner modules.
This commit is contained in:
1 parent
901a899050
commit
7de0d0bf32
39 files changed
+688
-2429
No files matched your search
+19
-48
@@ -2,66 +2,38 @@
|
||||
|
||||
## Purpose
|
||||
|
||||
`.github/` owns repository automation for release builds and renderer content
|
||||
bundling.
|
||||
`.github/` owns repository automation for release builds and renderer content bundling.
|
||||
|
||||
Workflow changes can alter what users download, what the app displays as its
|
||||
version, and what content non-local launcher runs load.
|
||||
Workflow changes can alter what users download, what the app displays as its version, and what content non-local launcher runs load.
|
||||
|
||||
## Ownership
|
||||
|
||||
This scope owns:
|
||||
|
||||
- `workflows/build.yml`: updater-capable executable builds for GitHub Releases
|
||||
and manual workflow dispatch.
|
||||
- `workflows/bundle-content.yml`: `app/` static content bundling into
|
||||
`content.json` for GitHub Releases or manual artifacts.
|
||||
- `workflows/build.yml`: updater-capable executable builds for GitHub Releases and manual workflow dispatch.
|
||||
- `workflows/bundle-content.yml`: `app/` static content bundling into `content.json` for GitHub Releases or manual artifacts.
|
||||
|
||||
## Local Contracts
|
||||
|
||||
- Release executable builds are driven by `v*` tag pushes or manual workflow
|
||||
input.
|
||||
- Tags without a patch segment, such as `v1.1`, are the public release shape.
|
||||
They are normalized to full semver build versions such as `1.1.0` only where
|
||||
Electron tooling or updater comparisons require it; public release asset names
|
||||
keep the shorter `1.1` version.
|
||||
- Build jobs pass `A0_LAUNCHER_APP_VERSION` and `A0_LAUNCHER_RELEASE_TAG` into
|
||||
the packaging scripts so generated Electron packages use the selected release
|
||||
version without mutating the checked-out tag.
|
||||
- Keep the checked-in `package.json` version aligned with the current
|
||||
two-segment release line because local runs and fallback paths use it
|
||||
directly.
|
||||
- Build every release from the tagged source. Do not relabel or reuse executable
|
||||
assets from older releases.
|
||||
- Executable artifact names should remain predictable:
|
||||
`a0-launcher-<release-version>-<platform>-<arch>...`.
|
||||
- Release artifacts are macOS x64/arm64 DMG plus updater ZIP, Windows x64/arm64
|
||||
NSIS setup EXE, Linux x64/arm64 AppImage, and updater metadata files:
|
||||
`metadata-latest-windows.yml`, `metadata-latest-mac.yml`,
|
||||
`metadata-latest-linux.yml`, and `metadata-latest-linux-arm64.yml`.
|
||||
- Do not publish Linux DEB/RPM or Windows Squirrel/NuGet artifacts unless the
|
||||
product decision changes.
|
||||
- Content bundling checks out the release tag, walks `app/`, and uploads
|
||||
`content.json` to the same release. Manual dispatch with a tag also uploads
|
||||
to that release; manual dispatch without a tag only stores the workflow
|
||||
artifact.
|
||||
- `content.json` file entries use `{ encoding, data }`, with `utf8` for text
|
||||
files and `base64` for binary assets. Keep this in sync with
|
||||
`/shell/main.js` content extraction.
|
||||
- If a release tag is moved after publishing, manually confirm whether workflow
|
||||
reruns or release asset refreshes are needed; moving the ref alone does not
|
||||
guarantee all old assets were rebuilt.
|
||||
- Release executable builds are driven by `v*` tag pushes or manual workflow input.
|
||||
- Tags without a patch segment, such as `v1.1`, are the public release shape. They are normalized to full semver build versions such as `1.1.0` only where Electron tooling or updater comparisons require it; public release asset names keep the shorter `1.1` version.
|
||||
- Build jobs pass `A0_LAUNCHER_APP_VERSION` and `A0_LAUNCHER_RELEASE_TAG` into the packaging scripts so generated Electron packages use the selected release version without mutating the checked-out tag.
|
||||
- Keep the checked-in `package.json` version aligned with the current two-segment release line because local runs and fallback paths use it directly.
|
||||
- Build every release from the tagged source. Do not relabel or reuse executable assets from older releases.
|
||||
- Executable artifact names should remain predictable: `a0-launcher-<release-version>-<platform>-<arch>...`.
|
||||
- Release artifacts are macOS x64/arm64 DMG plus updater ZIP, Windows x64/arm64 NSIS setup EXE, Linux x64/arm64 AppImage, and updater metadata files: `metadata-latest-windows.yml`, `metadata-latest-mac.yml`, `metadata-latest-linux.yml`, and `metadata-latest-linux-arm64.yml`.
|
||||
- Do not publish Linux DEB/RPM or Windows Squirrel/NuGet artifacts unless the product decision changes.
|
||||
- Content bundling checks out the release tag, walks `app/`, and uploads `content.json` to the same release. Manual dispatch with a tag also uploads to that release; manual dispatch without a tag only stores the workflow artifact.
|
||||
- `content.json` file entries use `{ encoding, data }`, with `utf8` for text files and `base64` for binary assets. Keep this in sync with `/shell/main.js` content extraction.
|
||||
- If a release tag is moved after publishing, manually confirm whether workflow reruns or release asset refreshes are needed; moving the ref alone does not guarantee all old assets were rebuilt.
|
||||
|
||||
## Work Guidance
|
||||
|
||||
- Keep workflow permissions as narrow as practical.
|
||||
- Preserve separate executable-build and content-bundle workflows unless a task
|
||||
explicitly asks to merge them.
|
||||
- Preserve separate executable-build and content-bundle workflows unless a task explicitly asks to merge them.
|
||||
- Do not add secrets to logs or generated artifacts.
|
||||
- Use repository variables and explicit workflow inputs over hardcoded forks when
|
||||
a workflow must support forks.
|
||||
- When version or tag semantics change, update `/AGENTS.md` and this file in the
|
||||
same session.
|
||||
- Use repository variables and explicit workflow inputs over hardcoded forks when a workflow must support forks.
|
||||
- When version or tag semantics change, update `/AGENTS.md` and this file in the same session.
|
||||
|
||||
## Verification
|
||||
|
||||
@@ -71,8 +43,7 @@ Workflow YAML has no local test contract. For small edits, run:
|
||||
git diff --check
|
||||
```
|
||||
|
||||
For release-affecting edits, inspect the relevant workflow path and document any
|
||||
manual GitHub Actions verification in the final response.
|
||||
For release-affecting edits, inspect the relevant workflow path and document any manual GitHub Actions verification in the final response.
|
||||
|
||||
## Child DOX Index
|
||||
|
||||
|
||||
@@ -4,30 +4,20 @@ Guidance for AI coding agents working in `/home/eclypso/a0/a0-launcher`.
|
||||
|
||||
## Purpose
|
||||
|
||||
This root DOX file owns repo-wide policy for the Agent Zero Launcher and is the
|
||||
first contract to read before editing any project file.
|
||||
This root DOX file owns repo-wide policy for the Agent Zero Launcher and is the first contract to read before editing any project file.
|
||||
|
||||
The launcher is an Electron desktop app that lets people install, activate,
|
||||
switch, inspect, and open Dockerized Agent Zero instances without needing to
|
||||
learn Docker first. It also lets people save and open remote Agent Zero
|
||||
instances running on a VPS or URL without setting up local Docker. Build it as
|
||||
if elegance and reliability are the same requirement: clear, restrained,
|
||||
robust, and worthy of the Agent Zero brand.
|
||||
The launcher is an Electron desktop app that lets people install, activate, switch, inspect, and open Dockerized Agent Zero instances without needing to learn Docker first. It also lets people save and open remote Agent Zero instances running on a VPS or URL without setting up local Docker. Build it as if elegance and reliability are the same requirement: clear, restrained, robust, and worthy of the Agent Zero brand.
|
||||
|
||||
## Ownership
|
||||
|
||||
This scope owns top-level project policy, product language, release/version
|
||||
expectations, development commands, and the Child DOX Index.
|
||||
This scope owns top-level project policy, product language, release/version expectations, development commands, and the Child DOX Index.
|
||||
|
||||
Root-owned files and folders:
|
||||
|
||||
- `AGENTS.md`: repo-wide DOX rail and Child DOX Index.
|
||||
- `README.md`: public product overview and user/developer quick start.
|
||||
- `TODO.md`: pending work, investigation findings, and acceptance checks.
|
||||
- `package.json` and `package-lock.json`: Electron app version, dependencies,
|
||||
npm scripts, and local-dev fallback metadata.
|
||||
- `forge.config.js`: legacy Electron Forge makers for local/manual executable
|
||||
packaging.
|
||||
- `package.json` and `package-lock.json`: Electron app version, dependencies, npm scripts, and local-dev fallback metadata.
|
||||
- `forge.config.js`: legacy Electron Forge makers for local/manual executable packaging.
|
||||
- `.gitignore`, `LICENSE`: repository metadata.
|
||||
- Child-owned areas listed in the Child DOX Index below.
|
||||
|
||||
@@ -36,108 +26,30 @@ Root-owned files and folders:
|
||||
DOX contracts:
|
||||
|
||||
- Treat every `AGENTS.md` file as the source of truth for its subtree.
|
||||
- Before editing, read this file, identify the paths you expect to touch, then
|
||||
walk from the repo root to each target path and read every `AGENTS.md` on that
|
||||
route.
|
||||
- If a parent lists a child `AGENTS.md` whose scope contains the target path,
|
||||
read the child and continue downward.
|
||||
- The closer `AGENTS.md` controls local details. No child may weaken these root
|
||||
DOX rules.
|
||||
- After every meaningful change, make a DOX pass: update the closest owning
|
||||
`AGENTS.md`, update affected parents or children, refresh Child DOX Indexes,
|
||||
and remove stale or contradictory notes.
|
||||
- Keep public product copy in `README.md` and `docs/`. Keep durable development
|
||||
contracts in `AGENTS.md`.
|
||||
- Before editing, read this file, identify the paths you expect to touch, then walk from the repo root to each target path and read every `AGENTS.md` on that route.
|
||||
- If a parent lists a child `AGENTS.md` whose scope contains the target path, read the child and continue downward.
|
||||
- The closer `AGENTS.md` controls local details. No child may weaken these root DOX rules.
|
||||
- After every meaningful change, make a DOX pass: update the closest owning `AGENTS.md`, update affected parents or children, refresh Child DOX Indexes, and remove stale or contradictory notes.
|
||||
- Keep public product copy in `README.md` and `docs/`. Keep durable development contracts in `AGENTS.md`.
|
||||
|
||||
Architecture contracts:
|
||||
|
||||
- First-run onboarding starts with local/remote choices and persists local
|
||||
intent and completion in Docker Manager state. Completed users never receive
|
||||
automatic onboarding again; unavailable runtimes use explicit Runtime Setup
|
||||
recovery. First-image download/extraction may use background progress.
|
||||
- First-run onboarding starts with local/remote choices and persists local intent and completion in Docker Manager state. Completed users never receive automatic onboarding again; unavailable runtimes use explicit Runtime Setup recovery. First-image download/extraction may use background progress.
|
||||
|
||||
- `app/` is the static renderer/content layer.
|
||||
- `shell/` is the privileged Electron main/preload and Docker orchestration
|
||||
layer.
|
||||
- `shell/docker_manager/` is the product-level Agent Zero image, instance,
|
||||
storage-volume, release, retention, and remote-instance orchestration layer.
|
||||
- `shell/` is the privileged Electron main/preload and Docker orchestration layer.
|
||||
- `shell/docker_manager/` is the product-level Agent Zero image, instance, storage-volume, release, retention, and remote-instance orchestration layer.
|
||||
- `shell/docker_adapter/` is the generic Docker and Docker Hub abstraction.
|
||||
- Renderer code requests intent; shell code owns privilege; Docker adapter code
|
||||
owns Docker mechanics.
|
||||
- Launcher Host access is an outbound, tab-leased `a0 gateway` child supervised
|
||||
by the Electron shell. It is not an inbound app server or background daemon:
|
||||
closing the owning tab or detached window, destroyed web contents, and app
|
||||
cleanup end the lease. Detaching transfers the same lease, while
|
||||
Launcher-home selection and in-tab reload keep it alive. Disconnect suppresses
|
||||
that lease until the user reconnects from the Launcher Host access modal or
|
||||
closes it. Agent Zero pages expose no Host access menu or Launcher bridge.
|
||||
- A0 Tag is a default-off Launcher feature leased to one exact open Instance
|
||||
surface and its existing outbound gateway. Settings owns its Instance and
|
||||
default-profile selection; the fixed global shortcut captures an explicit
|
||||
`@a0` or `@a0.<profile>` request when the focused app exposes a safe editable
|
||||
range, and otherwise opens a shell-owned command palette for an explicit
|
||||
computer-wide request. The app restored after the palette closes is the
|
||||
natural starting context when the request refers to the current app; there is
|
||||
no separate palette scope selector or permission mode. Each invocation creates
|
||||
a new tagged A0 CLI chat. The Main model chooses exact field replacement or
|
||||
ordinary Computer Use action, inheriting the gateway's existing scopes and
|
||||
safeguards. The command palette microphone delegates to the exact leased
|
||||
Instance tab's built-in Whisper STT store: Agent Zero retains microphone,
|
||||
model, toast, and draft/send ownership, while Launcher receives only the
|
||||
bounded final transcript and exposes the Instance's first-use model-loading
|
||||
notice in its footer. Its native file/folder chooser keeps selected host
|
||||
paths in the shell, uploads them through the already-authenticated gateway,
|
||||
and passes only validated Agent Zero upload references to the tagged chat.
|
||||
Do not add a daemon, passive text watcher, inbound protocol, duplicate speech
|
||||
or upload backend, or duplicate permission matrix.
|
||||
- Attached Instance tabs can be reordered by dragging their labels. Releasing a
|
||||
dragged tab outside the tab strip detaches it through the same shell-owned
|
||||
reparenting path as the dedicated Detach button. F5 refreshes the active
|
||||
attached or detached Instance page through the shell-owned reload path.
|
||||
Attached views fill the native content area below the measured tab strip;
|
||||
the shell converts its CSS position using Launcher-page zoom, not display scale.
|
||||
Tab shortcuts follow visible attached-tab order with Launcher in position 1:
|
||||
Cmd+1..9 on macOS or Ctrl+1..9 elsewhere selects that position; Ctrl+Tab and
|
||||
Ctrl+Shift+Tab cycle with wraparound. Detached windows keep their own focus.
|
||||
- A running local Instance menu exposes `Restart`. It uses Docker's native
|
||||
immediate container restart through the per-Instance background queue and
|
||||
waits for the Agent Zero UI to become reachable again.
|
||||
- Launcher startup asynchronously installs the official A0 CLI when it is
|
||||
missing or lacks the Launcher gateway contract, and updates it when a newer
|
||||
release is available. Compatible installations use `a0 update`, while Windows
|
||||
fresh installs run a downloaded temporary PowerShell file without inline
|
||||
execution or `Bypass`. Installing the CLI grants no host capability by itself:
|
||||
only an explicitly enabled Host access choice on an open Instance tab may
|
||||
start a gateway lease. An Instance menu shows `Install A0 CLI` while the
|
||||
system CLI is missing and replaces it with `Open A0 CLI` once installed.
|
||||
Create/Add Instance and Host access settings do not include a separate CLI
|
||||
installer step. Official compatible CLI packages include the Python
|
||||
Playwright client used for host Browser launch without bundling Chromium;
|
||||
`Set up browser` repairs older or damaged CLI environments in place.
|
||||
- On macOS, Browser Host access may also select Safari through the connector's
|
||||
system `safaridriver` support. Launcher setup must direct the user to Safari >
|
||||
Settings > Advanced > Show features for web developers, then Developer >
|
||||
Allow remote automation, and must not toggle that browser security setting
|
||||
silently.
|
||||
- A0 CLI v2.5 is the first connector release with the Launcher gateway
|
||||
contract. Continue capability-gating gateway candidates rather than replacing
|
||||
that contract check with a version comparison; an unreleased sibling
|
||||
development checkout may advertise the capability before the public release.
|
||||
- A0 CLI v2.6 is the first connector release expected to advertise
|
||||
`computer_use_setup_v1`. Capability-gate the correlated Computer Use setup
|
||||
command separately from the base gateway contract. On macOS, a newly enabled
|
||||
Computer Use choice may prompt once through the staged setup flow. Electron
|
||||
owns the Accessibility prompt so TCC grants the packaged Launcher or the
|
||||
Electron dev build that actually launched the helper; the connector continues
|
||||
Screen Recording and runtime validation afterward. Later launches preflight
|
||||
silently and keep the saved choice enabled when runtime permission setup needs
|
||||
attention.
|
||||
- A successful manual login in an eligible Instance tab may offer one branded,
|
||||
shell-owned modal child window with `Save credentials` / `Not now` when that
|
||||
Instance has no launcher-saved credentials. Login detection and pending
|
||||
passwords stay shell-owned and in-memory; the static modal receives no
|
||||
credential values, and persistence still requires explicit consent through
|
||||
the existing encrypted credential store.
|
||||
- Renderer code requests intent; shell code owns privilege; Docker adapter code owns Docker mechanics.
|
||||
- Launcher Host access is an outbound, tab-leased `a0 gateway` child supervised by the Electron shell. It is not an inbound app server or background daemon: closing the owning tab or detached window, destroyed web contents, and app cleanup end the lease. Detaching transfers the same lease, while Launcher-home selection and in-tab reload keep it alive. Disconnect suppresses that lease until the user reconnects from the Launcher Host access modal or closes it. Agent Zero pages expose no Host access menu or Launcher bridge.
|
||||
- A0 Tag is a default-off Launcher feature leased to one exact open Instance surface and its existing outbound gateway. Settings owns its Instance and default-profile selection; the fixed global shortcut captures an explicit `@a0` or `@a0.<profile>` request when the focused app exposes a safe editable range, and otherwise opens a shell-owned command palette for an explicit computer-wide request. The app restored after the palette closes is the natural starting context when the request refers to the current app; there is no separate palette scope selector or permission mode. Each invocation creates a new tagged A0 CLI chat. The Main model chooses exact field replacement or ordinary Computer Use action, inheriting the gateway's existing scopes and safeguards. The command palette microphone delegates to the exact leased Instance tab's built-in Whisper STT store: Agent Zero retains microphone, model, toast, and draft/send ownership, while Launcher receives only the bounded final transcript and exposes the Instance's first-use model-loading notice in its footer. Its native file/folder chooser keeps selected host paths in the shell, uploads them through the already-authenticated gateway, and passes only validated Agent Zero upload references to the tagged chat. Do not add a daemon, passive text watcher, inbound protocol, duplicate speech or upload backend, or duplicate permission matrix.
|
||||
- Attached Instance tabs can be reordered by dragging their labels. Releasing a dragged tab outside the tab strip detaches it through the same shell-owned reparenting path as the dedicated Detach button. F5 refreshes the active attached or detached Instance page through the shell-owned reload path. Attached views fill the native content area below the measured tab strip; the shell converts its CSS position using Launcher-page zoom, not display scale. Tab shortcuts follow visible attached-tab order with Launcher in position 1: Cmd+1..9 on macOS or Ctrl+1..9 elsewhere selects that position; Ctrl+Tab and Ctrl+Shift+Tab cycle with wraparound. Detached windows keep their own focus.
|
||||
- A running local Instance menu exposes `Restart`. It uses Docker's native immediate container restart through the per-Instance background queue and waits for the Agent Zero UI to become reachable again.
|
||||
- Launcher startup asynchronously installs the official A0 CLI when it is missing or lacks the Launcher gateway contract, and updates it when a newer release is available. Compatible installations use `a0 update`, while Windows fresh installs run a downloaded temporary PowerShell file without inline execution or `Bypass`. Installing the CLI grants no host capability by itself: only an explicitly enabled Host access choice on an open Instance tab may start a gateway lease. An Instance menu shows `Install A0 CLI` while the system CLI is missing and replaces it with `Open A0 CLI` once installed. Create/Add Instance and Host access settings do not include a separate CLI installer step. Official compatible CLI packages include the Python Playwright client used for host Browser launch without bundling Chromium; `Set up browser` repairs older or damaged CLI environments in place.
|
||||
- On macOS, Browser Host access may also select Safari through the connector's system `safaridriver` support. Launcher setup must direct the user to Safari > Settings > Advanced > Show features for web developers, then Developer > Allow remote automation, and must not toggle that browser security setting silently.
|
||||
- A0 CLI v2.5 is the first connector release with the Launcher gateway contract. Continue capability-gating gateway candidates rather than replacing that contract check with a version comparison; an unreleased sibling development checkout may advertise the capability before the public release.
|
||||
- A0 CLI v2.6 is the first connector release expected to advertise `computer_use_setup_v1`. Capability-gate the correlated Computer Use setup command separately from the base gateway contract. On macOS, a newly enabled Computer Use choice may prompt once through the staged setup flow. Electron owns the Accessibility prompt so TCC grants the packaged Launcher or the Electron dev build that actually launched the helper; the connector continues Screen Recording and runtime validation afterward. Later launches preflight silently and keep the saved choice enabled when runtime permission setup needs attention.
|
||||
- A successful manual login in an eligible Instance tab may offer one branded, shell-owned modal child window with `Save credentials` / `Not now` when that Instance has no launcher-saved credentials. Login detection and pending passwords stay shell-owned and in-memory; the static modal receives no credential values, and persistence still requires explicit consent through the existing encrypted credential store.
|
||||
|
||||
Runtime and release contracts:
|
||||
|
||||
@@ -145,104 +57,43 @@ Runtime and release contracts:
|
||||
- OS: Ubuntu Linux.
|
||||
- Workspace: `/home/eclypso/a0/a0-launcher`.
|
||||
- Use Linux paths and commands in examples.
|
||||
- Do not assume Windows-only paths such as `.\.venv\Scripts\python`; use Linux
|
||||
virtualenv paths like `./.venv/bin/python`.
|
||||
- `npm start` from the repository root uses local app contents. For explicit
|
||||
local-content selection, use:
|
||||
- Do not assume Windows-only paths such as `.\.venv\Scripts\python`; use Linux virtualenv paths like `./.venv/bin/python`.
|
||||
- `npm start` from the repository root uses local app contents. For explicit local-content selection, use:
|
||||
|
||||
```bash
|
||||
A0_LAUNCHER_LOCAL_REPO=/home/eclypso/a0/a0-launcher npm start
|
||||
```
|
||||
|
||||
- The compact header shows the Agent Zero wordmark without visible launcher
|
||||
version text. Electron `app.getVersion()` still reads the root `package.json`
|
||||
version and remains available through renderer metadata for diagnostics and
|
||||
update decisions.
|
||||
- Keep `package.json` and the root entries in `package-lock.json` aligned with
|
||||
the current two-segment release line, such as `1.2`, so local `npm start`
|
||||
runs do not show stale metadata.
|
||||
- Packaged or non-local runs fetch `content.json` from the latest GitHub Release
|
||||
for the configured launcher repo and unpack it under Electron `userData`.
|
||||
- Packaged startup uses `electron-updater` GitHub metadata to compare Electron
|
||||
`app.getVersion()` with the latest launcher executable release. When a newer
|
||||
launcher executable is available, the loading screen may hold with `Update`
|
||||
and `Continue` actions; `Update` downloads the updater payload and then
|
||||
runs `a0 update` before restarting through `quitAndInstall()` once the payload
|
||||
is ready. A CLI update failure remains non-blocking and is logged.
|
||||
- Do not hold ordinary startup for decorative delay beyond the brief splash
|
||||
entry and exit animations. The first renderer state should rebuild live local
|
||||
Docker data from normal remote caches, then refresh remote metadata fully in
|
||||
the background when the cached catalog predates that launch; explicit Refresh
|
||||
remains a forced freshness check.
|
||||
- Packaged DevTools expose `window.space.debugReinstall(version)` plus
|
||||
`checkForUpdates()`, `downloadUpdate()`, and `installUpdate()` for targeted
|
||||
updater testing against a specific release version. This is a debugging
|
||||
surface, not product UI.
|
||||
- The compact header shows the Agent Zero wordmark without visible launcher version text. Electron `app.getVersion()` still reads the root `package.json` version and remains available through renderer metadata for diagnostics and update decisions.
|
||||
- Keep `package.json` and the root entries in `package-lock.json` aligned with the current two-segment release line, such as `1.2`, so local `npm start` runs do not show stale metadata.
|
||||
- Packaged or non-local runs fetch `content.json` from the latest GitHub Release for the configured launcher repo and unpack it under Electron `userData`.
|
||||
- Packaged startup uses `electron-updater` GitHub metadata to compare Electron `app.getVersion()` with the latest launcher executable release. When a newer launcher executable is available, the loading screen may hold with `Update` and `Continue` actions; `Update` downloads the updater payload and then runs `a0 update` before restarting through `quitAndInstall()` once the payload is ready. A CLI update failure remains non-blocking and is logged.
|
||||
- Do not hold ordinary startup for decorative delay beyond the brief splash entry and exit animations. The first renderer state should rebuild live local Docker data from normal remote caches, then refresh remote metadata fully in the background when the cached catalog predates that launch; explicit Refresh remains a forced freshness check.
|
||||
- Packaged DevTools expose `window.space.debugReinstall(version)` plus `checkForUpdates()`, `downloadUpdate()`, and `installUpdate()` for targeted updater testing against a specific release version. This is a debugging surface, not product UI.
|
||||
- `A0_LAUNCHER_GITHUB_REPO` can override the launcher content repository.
|
||||
- `A0_LAUNCHER_USE_LOCAL_CONTENT=true` can use the current working directory as
|
||||
local content when it contains `app/index.html` and `package.json`.
|
||||
- `A0_LAUNCHER_USE_LOCAL_CONTENT=true` can use the current working directory as local content when it contains `app/index.html` and `package.json`.
|
||||
- Docker images default to `agent0ai/agent-zero`.
|
||||
- Normal Create local Instance pickers list only Agent Zero releases and local
|
||||
Agent Zero builds. Arbitrary Docker images belong to the Advanced developer
|
||||
flow and must not appear as normal versions or setup choices.
|
||||
- Advanced Developer is a file-first Docker workspace. It may open bounded
|
||||
project-root Dockerfiles, Compose YAML, `.dockerignore`, and `.env.example`
|
||||
files; edit them through the bundled code editor; save or export them through
|
||||
named shell-owned file intents; and run only fixed Validate, Build, Up, Stop,
|
||||
Logs, and Down actions against the selected Docker runtime. Keep quick custom
|
||||
image execution as a subordinate one-off flow and never expose generic shell
|
||||
or Docker command execution.
|
||||
- Local and saved remote Instance cards derive their running code identity from
|
||||
Agent Zero's `/api/health` Git metadata. A local Instance without health
|
||||
metadata may show the bounded branch from `/a0/.git/HEAD`, but health-derived
|
||||
and cached `R v...` identity remains preferred. Cache the last valid identity
|
||||
by Instance ID so stopped or temporarily offline Instances keep their
|
||||
last-seen version until a later successful health check replaces it.
|
||||
- A saved runtime endpoint is a preference, not a lock: use it while reachable,
|
||||
temporarily fall back to another reachable endpoint, and return to it later.
|
||||
Explicitly starting or selecting a runtime makes that endpoint preferred.
|
||||
- Normal Create local Instance pickers list only Agent Zero releases and local Agent Zero builds. Arbitrary Docker images belong to the Advanced developer flow and must not appear as normal versions or setup choices.
|
||||
- Advanced Developer is a file-first Docker workspace. It may open bounded project-root Dockerfiles, Compose YAML, `.dockerignore`, and `.env.example` files; edit them through the bundled code editor; save or export them through named shell-owned file intents; and run only fixed Validate, Build, Up, Stop, Logs, and Down actions against the selected Docker runtime. Keep quick custom image execution as a subordinate one-off flow and never expose generic shell or Docker command execution.
|
||||
- Local and saved remote Instance cards derive their running code identity from Agent Zero's `/api/health` Git metadata. A local Instance without health metadata may show the bounded branch from `/a0/.git/HEAD`, but health-derived and cached `R v...` identity remains preferred. Cache the last valid identity by Instance ID so stopped or temporarily offline Instances keep their last-seen version until a later successful health check replaces it.
|
||||
- A saved runtime endpoint is a preference, not a lock: use it while reachable, temporarily fall back to another reachable endpoint, and return to it later. Explicitly starting or selecting a runtime makes that endpoint preferred.
|
||||
- Backend release metadata defaults to `agent0ai/agent-zero`.
|
||||
- `A0_BACKEND_IMAGE_REPO` and `A0_BACKEND_GITHUB_REPO` may override those repos
|
||||
for testing.
|
||||
- Keep every reachable Docker endpoint available for preference and fallback,
|
||||
but show the first-run runtime picker only when those endpoints identify two
|
||||
or more distinct Docker daemons. Endpoint aliases and unidentified daemons
|
||||
must not create a picker choice by themselves.
|
||||
- An installed stopped Docker Desktop may count as one additional first-run
|
||||
choice when another daemon is reachable. Label it as stopped and start it
|
||||
through the existing platform runtime setup before saving the preference.
|
||||
- Launcher-managed local instances should mount isolated persistent workspace
|
||||
storage at `/a0/usr` by default. The default backing store is a per-instance
|
||||
host directory under `~/agent-zero`; named Docker volumes are an advanced
|
||||
alternative, and explicit no-volume runs are ephemeral.
|
||||
- Cloning an Instance should reuse its configured image reference, falling back
|
||||
to the source image ID, and copy selected `/a0/usr` data into fresh storage.
|
||||
Do not create a committed snapshot image for ordinary clones.
|
||||
- `A0_BACKEND_IMAGE_REPO` and `A0_BACKEND_GITHUB_REPO` may override those repos for testing.
|
||||
- Keep every reachable Docker endpoint available for preference and fallback, but show the first-run runtime picker only when those endpoints identify two or more distinct Docker daemons. Endpoint aliases and unidentified daemons must not create a picker choice by themselves.
|
||||
- An installed stopped Docker Desktop may count as one additional first-run choice when another daemon is reachable. Label it as stopped and start it through the existing platform runtime setup before saving the preference.
|
||||
- Launcher-managed local instances should mount isolated persistent workspace storage at `/a0/usr` by default. The default backing store is a per-instance host directory under `~/agent-zero`; named Docker volumes are an advanced alternative, and explicit no-volume runs are ephemeral.
|
||||
- Cloning an Instance should reuse its configured image reference, falling back to the source image ID, and copy selected `/a0/usr` data into fresh storage. Do not create a committed snapshot image for ordinary clones.
|
||||
- `v*` tags are release inputs for executable builds.
|
||||
- Public release tags and launcher metadata use two-segment versions such as
|
||||
`v1.8` / `1.8` when the patch is zero. Packaging normalizes them to full
|
||||
semver such as `1.8.0` only where Electron tooling or updater comparisons
|
||||
require it.
|
||||
- Release executable artifacts are macOS x64/arm64 DMG plus updater ZIP,
|
||||
Windows x64/arm64 NSIS setup EXE, Linux x64/arm64 AppImage, and
|
||||
`electron-updater` metadata files. Release content remains `content.json`.
|
||||
Linux DEB/RPM and Windows Squirrel/NuGet artifacts are intentionally omitted
|
||||
from the updater-capable release path unless the product decision changes.
|
||||
- Windows NSIS installers use decoder-compatible app archives plus
|
||||
`packaging/platforms/windows/installer.nsh` for installer diagnostics,
|
||||
hardened running-app shutdown, and direct executable launch after
|
||||
installation so first run does not depend on shortcut creation.
|
||||
- Windows uninstall removes the Launcher-owned `%APPDATA%\\a0-launcher`
|
||||
user-data directory.
|
||||
- If a release tag is moved to include a metadata fix, keep `main`, the tag, and
|
||||
both remotes intentionally aligned.
|
||||
- Public release tags and launcher metadata use two-segment versions such as `v1.8` / `1.8` when the patch is zero. Packaging normalizes them to full semver such as `1.8.0` only where Electron tooling or updater comparisons require it.
|
||||
- Release executable artifacts are macOS x64/arm64 DMG plus updater ZIP, Windows x64/arm64 NSIS setup EXE, Linux x64/arm64 AppImage, and `electron-updater` metadata files. Release content remains `content.json`. Linux DEB/RPM and Windows Squirrel/NuGet artifacts are intentionally omitted from the updater-capable release path unless the product decision changes.
|
||||
- Windows NSIS installers use decoder-compatible app archives plus `packaging/platforms/windows/installer.nsh` for installer diagnostics, hardened running-app shutdown, and direct executable launch after installation so first run does not depend on shortcut creation.
|
||||
- Windows uninstall removes the Launcher-owned `%APPDATA%\\a0-launcher` user-data directory.
|
||||
- If a release tag is moved to include a metadata fix, keep `main`, the tag, and both remotes intentionally aligned.
|
||||
|
||||
Agent Zero runtime assumptions:
|
||||
|
||||
- When discussing plugin/backend code, treat the Dockerized Agent Zero instance
|
||||
at `localhost:32081` as the live runtime.
|
||||
- If you change live runtime plugin/backend code, also copy those changes into
|
||||
the real A0 Core plugin repo:
|
||||
- When discussing plugin/backend code, treat the Dockerized Agent Zero instance at `localhost:32081` as the live runtime.
|
||||
- If you change live runtime plugin/backend code, also copy those changes into the real A0 Core plugin repo:
|
||||
|
||||
```bash
|
||||
/home/eclypso/a0/agent-zero/plugins
|
||||
@@ -253,31 +104,15 @@ Agent Zero runtime assumptions:
|
||||
Product language:
|
||||
|
||||
- Say `Instances`, not `Sessions`, for running or retained containers.
|
||||
- Remote Instances are a first-run path, not an advanced fallback. Do not force
|
||||
local Docker setup or an image pull before a user can add a remote Agent Zero
|
||||
URL.
|
||||
- Remote Instances are a first-run path, not an advanced fallback. Do not force local Docker setup or an image pull before a user can add a remote Agent Zero URL.
|
||||
- Say `Storage volumes`, not just `Storage`, when referring to Docker volumes.
|
||||
- Downloaded Versions may be removed from the Versions view, but image removal must be a
|
||||
non-forced Docker image delete so Docker refuses removal while any Instance
|
||||
still references the image.
|
||||
- Keep instance deletion separate from workspace deletion. Host workspace
|
||||
directories and named Docker volumes should survive container removal unless a
|
||||
user takes an explicit storage cleanup action.
|
||||
- Backup and Restore for local Instances operate on the Agent Zero workspace
|
||||
path `/a0/usr` and should use the same backup shape Agent Zero core uses.
|
||||
- Per-Instance Colour/Icon choices are launcher identity metadata. The bounded
|
||||
colour tints the card and tab icon, while the bounded icon identifies attached
|
||||
and detached tabs without mutating Docker labels or runtime behavior.
|
||||
Colours accept preset IDs or six-digit RGB hex values from the Custom picker.
|
||||
The default icon follows the Instance favicon, with the Agent Zero symbol as
|
||||
fallback. Explicit custom icons take precedence; Favicon and Globe are both
|
||||
available in the picker. Favicon image data is transient, shell-owned tab state.
|
||||
Upload image uses a native chooser and saves a bounded image copy in the same
|
||||
appearance metadata only on Save, independent of the original host file.
|
||||
- Downloaded Versions may be removed from the Versions view, but image removal must be a non-forced Docker image delete so Docker refuses removal while any Instance still references the image.
|
||||
- Keep instance deletion separate from workspace deletion. Host workspace directories and named Docker volumes should survive container removal unless a user takes an explicit storage cleanup action.
|
||||
- Backup and Restore for local Instances operate on the Agent Zero workspace path `/a0/usr` and should use the same backup shape Agent Zero core uses.
|
||||
- Per-Instance Colour/Icon choices are launcher identity metadata. The bounded colour tints the card and tab icon, while the bounded icon identifies attached and detached tabs without mutating Docker labels or runtime behavior. Colours accept preset IDs or six-digit RGB hex values from the Custom picker. The default icon follows the Instance favicon, with the Agent Zero symbol as fallback. Explicit custom icons take precedence; Favicon and Globe are both available in the picker. Favicon image data is transient, shell-owned tab state. Upload image uses a native chooser and saves a bounded image copy in the same appearance metadata only on Save, independent of the original host file.
|
||||
- Keep Docker mechanics behind purposeful controls.
|
||||
- Put `Open UI` where the instance lives, not in the global header.
|
||||
- Keep the surface quiet and precise: avoid excessive borders, nested cards, and
|
||||
explanatory clutter.
|
||||
- Keep the surface quiet and precise: avoid excessive borders, nested cards, and explanatory clutter.
|
||||
- The API Dashboard destination is:
|
||||
|
||||
```text
|
||||
@@ -287,27 +122,19 @@ https://www.agent-zero.ai/p/community/api-dashboard/
|
||||
Security and boundaries:
|
||||
|
||||
- Docker access belongs behind IPC and `shell/docker_manager`.
|
||||
- Renderer code should call `window.dockerManagerAPI` through the preload
|
||||
surface.
|
||||
- Keep Electron windows secure: `contextIsolation: true`, `nodeIntegration:
|
||||
false`, and `sandbox: true` unless there is a documented reason.
|
||||
- Host gateway credentials remain shell-owned and may reach the CLI only as
|
||||
ephemeral environment variables. Gateway processes use the existing
|
||||
authenticated Agent Zero connector protocol and are capability-gated; do not
|
||||
add generic renderer execution IPC, inbound listeners, or a second host-tool
|
||||
protocol.
|
||||
- Renderer code should call `window.dockerManagerAPI` through the preload surface.
|
||||
- Keep Electron windows secure: `contextIsolation: true`, `nodeIntegration: false`, and `sandbox: true` unless there is a documented reason.
|
||||
- Host gateway credentials remain shell-owned and may reach the CLI only as ephemeral environment variables. Gateway processes use the existing authenticated Agent Zero connector protocol and are capability-gated; do not add generic renderer execution IPC, inbound listeners, or a second host-tool protocol.
|
||||
|
||||
## Work Guidance
|
||||
|
||||
- Follow existing patterns before inventing new ones.
|
||||
- Keep changes narrowly scoped to the requested behavior.
|
||||
- Use structured APIs and parsers when available; avoid fragile string
|
||||
manipulation for nontrivial data.
|
||||
- Use structured APIs and parsers when available; avoid fragile string manipulation for nontrivial data.
|
||||
- Prefer small helpers when they remove real complexity.
|
||||
- Add comments only where they explain a non-obvious decision.
|
||||
- Default to ASCII unless the file already uses meaningful Unicode.
|
||||
- Do not create hidden scratch directories or commit generated outputs unless a
|
||||
checked-in fixture is explicitly requested.
|
||||
- Do not create hidden scratch directories or commit generated outputs unless a checked-in fixture is explicitly requested.
|
||||
- Build the usable app first, not a landing page.
|
||||
- Use Agent Zero's existing visual language and local tokens.
|
||||
- Prefer familiar icon buttons for obvious controls such as refresh.
|
||||
@@ -325,8 +152,7 @@ Git discipline:
|
||||
|
||||
## Verification
|
||||
|
||||
There is no default `npm test` contract in this repo unless a future commit adds
|
||||
one.
|
||||
There is no default `npm test` contract in this repo unless a future commit adds one.
|
||||
|
||||
For quick validation, prefer:
|
||||
|
||||
@@ -357,17 +183,12 @@ A0_LAUNCHER_LOCAL_REPO=/home/eclypso/a0/a0-launcher npm start
|
||||
This index must stay exhaustive.
|
||||
|
||||
- `/.github/AGENTS.md`: GitHub Actions release builds and content bundling.
|
||||
- `/app/AGENTS.md`: static renderer app, renderer state, assets, and component
|
||||
loading.
|
||||
- `/app/a0ui/AGENTS.md`: portable Agent Zero UI framework assets and vendored
|
||||
browser dependencies.
|
||||
- `/app/components/docker-manager/AGENTS.md`: Docker Manager renderer
|
||||
components and component store.
|
||||
- `/app/AGENTS.md`: static renderer app, renderer state, assets, and component loading.
|
||||
- `/app/a0ui/AGENTS.md`: portable Agent Zero UI framework assets and vendored browser dependencies.
|
||||
- `/app/components/docker-manager/AGENTS.md`: Docker Manager renderer components and component store.
|
||||
- `/docs/AGENTS.md`: supplemental user-facing documentation.
|
||||
- `/packaging/AGENTS.md`: electron-builder packaging, release artifact staging,
|
||||
and updater metadata helpers.
|
||||
- `/packaging/AGENTS.md`: electron-builder packaging, release artifact staging, and updater metadata helpers.
|
||||
- `/scripts/AGENTS.md`: developer and build helper scripts.
|
||||
- `/shell/AGENTS.md`: Electron main/preload host, content loading, IPC, windows,
|
||||
and privileged orchestration.
|
||||
- `/shell/AGENTS.md`: Electron main/preload host, content loading, IPC, windows, and privileged orchestration.
|
||||
- `/shell/docker_adapter/AGENTS.md`: generic Docker and Docker Hub adapter.
|
||||
- `/shell/docker_manager/AGENTS.md`: Agent Zero Docker Manager product layer.
|
||||
@@ -1,12 +1,8 @@
|
||||
# Agent Zero Launcher
|
||||
|
||||
Agent Zero Launcher is an Electron desktop app for installing, running, switching,
|
||||
inspecting, and opening Dockerized Agent Zero instances without making Docker the
|
||||
first thing a user has to understand.
|
||||
Agent Zero Launcher is an Electron desktop app for installing, running, switching, inspecting, and opening Dockerized Agent Zero instances without making Docker the first thing a user has to understand.
|
||||
|
||||
It is intentionally small at the shell boundary: renderer code expresses user
|
||||
intent, the Electron shell owns privileged IPC, and the Docker manager owns image,
|
||||
container, release, storage-volume, and remote-instance orchestration.
|
||||
It is intentionally small at the shell boundary: renderer code expresses user intent, the Electron shell owns privileged IPC, and the Docker manager owns image, container, release, storage-volume, and remote-instance orchestration.
|
||||
|
||||
## What It Does
|
||||
|
||||
@@ -16,27 +12,18 @@ container, release, storage-volume, and remote-instance orchestration.
|
||||
- Keeps retained instances available for rollback.
|
||||
- Shows local containers, saved remote instances, and storage volumes.
|
||||
- Opens Agent Zero UIs from the instance where they belong.
|
||||
- Installs and maintains the official A0 CLI, with per-Instance actions to open
|
||||
it or run installation/update explicitly.
|
||||
- Offers opt-in, tab-leased Host access for local files, browser, and computer
|
||||
control without making CLI installation part of Instance setup.
|
||||
- Installs and maintains the official A0 CLI, with per-Instance actions to open it or run installation/update explicitly.
|
||||
- Offers opt-in, tab-leased Host access for local files, browser, and computer control without making CLI installation part of Instance setup.
|
||||
|
||||
## Tab Shortcuts
|
||||
|
||||
- **Ctrl+1..9** (Windows/Linux) or **Cmd+1..9** (macOS): select that tab
|
||||
position, counting Launcher as tab 1.
|
||||
- **Ctrl+Tab** / **Ctrl+Shift+Tab**: select the next / previous tab, wrapping
|
||||
at either end.
|
||||
- **Ctrl+1..9** (Windows/Linux) or **Cmd+1..9** (macOS): select that tab position, counting Launcher as tab 1.
|
||||
- **Ctrl+Tab** / **Ctrl+Shift+Tab**: select the next / previous tab, wrapping at either end.
|
||||
- **F5**: reload the active Instance.
|
||||
|
||||
Tab switching follows the current order in the main window and excludes
|
||||
detached Instances.
|
||||
Tab switching follows the current order in the main window and excludes detached Instances.
|
||||
|
||||
Tabs use the Instance's favicon by default. Colour/Icon offers Favicon alongside
|
||||
the custom icons, including Globe; your saved custom choice takes precedence.
|
||||
Use **Upload image** to choose your own image or SVG, then **Save** to keep it
|
||||
as the Instance icon. The Launcher saves a copy, so you can move the source file.
|
||||
The first colour option, **Custom**, opens a colour picker alongside the presets.
|
||||
Tabs use the Instance's favicon by default. Colour/Icon offers Favicon alongside the custom icons, including Globe; your saved custom choice takes precedence. Use **Upload image** to choose your own image or SVG, then **Save** to keep it as the Instance icon. The Launcher saves a copy, so you can move the source file. The first colour option, **Custom**, opens a colour picker alongside the presets.
|
||||
|
||||
## Runtime Model
|
||||
|
||||
@@ -44,36 +31,25 @@ The launcher has two layers:
|
||||
|
||||
1. **Shell** (`shell/`)
|
||||
- Electron main process, preload bridge, secure windows, and IPC.
|
||||
- Downloads release content from GitHub Releases when local content is not
|
||||
requested.
|
||||
- Owns privileged Docker and terminal-launch behavior through
|
||||
`shell/docker_manager/` and `shell/docker_adapter/`.
|
||||
- Downloads release content from GitHub Releases when local content is not requested.
|
||||
- Owns privileged Docker and terminal-launch behavior through `shell/docker_manager/` and `shell/docker_adapter/`.
|
||||
|
||||
2. **Renderer content** (`app/`)
|
||||
- Static HTML, CSS, ES modules, local Agent Zero UI assets, and
|
||||
`<x-component>` includes.
|
||||
- Static HTML, CSS, ES modules, local Agent Zero UI assets, and `<x-component>` includes.
|
||||
- Bundled into `content.json` by GitHub Actions for release content updates.
|
||||
- Served by the shell through the `a0app://` protocol so `fetch()`, ES module
|
||||
imports, and relative URLs work like they would on a local web server.
|
||||
- Served by the shell through the `a0app://` protocol so `fetch()`, ES module imports, and relative URLs work like they would on a local web server.
|
||||
|
||||
Packaged and normal non-local runs load `content.json` from the latest configured
|
||||
GitHub Release and cache it under Electron `userData`. Local UI work should opt
|
||||
into local content explicitly.
|
||||
Packaged and normal non-local runs load `content.json` from the latest configured GitHub Release and cache it under Electron `userData`. Local UI work should opt into local content explicitly.
|
||||
|
||||
Packaged runs also use `electron-updater` metadata from the latest launcher
|
||||
GitHub Release. When a newer executable exists, the startup screen can offer an
|
||||
`Update` button that downloads the updater payload, then restarts to install it
|
||||
once the payload is ready. `Continue` opens the launcher without updating.
|
||||
Packaged runs also use `electron-updater` metadata from the latest launcher GitHub Release. When a newer executable exists, the startup screen can offer an `Update` button that downloads the updater payload, then restarts to install it once the payload is ready. `Continue` opens the launcher without updating.
|
||||
|
||||
## Requirements
|
||||
|
||||
- Node.js 20+
|
||||
- npm 9+
|
||||
- Docker Desktop, Docker Engine, Colima, or rootless Docker for Docker Manager
|
||||
features
|
||||
- Docker Desktop, Docker Engine, Colima, or rootless Docker for Docker Manager features
|
||||
|
||||
Runtime setup and repair notes are in
|
||||
[docs/runtime-troubleshooting.md](docs/runtime-troubleshooting.md).
|
||||
Runtime setup and repair notes are in [docs/runtime-troubleshooting.md](docs/runtime-troubleshooting.md).
|
||||
|
||||
## Quick Start
|
||||
|
||||
@@ -82,8 +58,7 @@ npm install
|
||||
npm start
|
||||
```
|
||||
|
||||
Plain `npm start` exercises the release-content path. That means it may show the
|
||||
latest downloaded `content.json`, not your edited local `app/` files.
|
||||
Plain `npm start` exercises the release-content path. That means it may show the latest downloaded `content.json`, not your edited local `app/` files.
|
||||
|
||||
For local UI development, run:
|
||||
|
||||
@@ -91,8 +66,7 @@ For local UI development, run:
|
||||
A0_LAUNCHER_LOCAL_REPO=. npm start
|
||||
```
|
||||
|
||||
You can also use the current working directory when it contains `app/index.html`
|
||||
and `package.json`:
|
||||
You can also use the current working directory when it contains `app/index.html` and `package.json`:
|
||||
|
||||
```bash
|
||||
A0_LAUNCHER_USE_LOCAL_CONTENT=1 npm start
|
||||
@@ -119,20 +93,9 @@ A0_BACKEND_GITHUB_REPO="owner/agent-zero" npm start
|
||||
A0_BACKEND_IMAGE_REPO="namespace/agent-zero" npm start
|
||||
```
|
||||
|
||||
The default backend image is `agent0ai/agent-zero`, and the default backend
|
||||
release metadata repository is `agent0ai/agent-zero`.
|
||||
The default backend image is `agent0ai/agent-zero`, and the default backend release metadata repository is `agent0ai/agent-zero`.
|
||||
|
||||
Launcher checks the official A0 CLI in the background at startup, installing it
|
||||
when missing or incompatible and updating it when a newer release is available.
|
||||
This does not enable Host access: a gateway runs only for an Instance whose Host
|
||||
access setting was explicitly enabled while its Launcher tab or detached window
|
||||
is open. Each local and saved remote Instance menu shows `Install A0 CLI` while
|
||||
the system CLI is missing, then replaces it with `Open A0 CLI`. A0 CLI v2.5 is
|
||||
the first release carrying the Launcher gateway contract. Launcher 1.4 uses the
|
||||
`computer_use_setup_v1` capability introduced in A0 CLI 2.6 to stage macOS
|
||||
Accessibility and Screen Recording setup after Computer Use is enabled. Saved
|
||||
permission choices remain on when runtime setup needs attention; subsequent
|
||||
launches preflight silently instead of reopening system prompts.
|
||||
Launcher checks the official A0 CLI in the background at startup, installing it when missing or incompatible and updating it when a newer release is available. This does not enable Host access: a gateway runs only for an Instance whose Host access setting was explicitly enabled while its Launcher tab or detached window is open. Each local and saved remote Instance menu shows `Install A0 CLI` while the system CLI is missing, then replaces it with `Open A0 CLI`. A0 CLI v2.5 is the first release carrying the Launcher gateway contract. Launcher 1.4 uses the `computer_use_setup_v1` capability introduced in A0 CLI 2.6 to stage macOS Accessibility and Screen Recording setup after Computer Use is enabled. Saved permission choices remain on when runtime setup needs attention; subsequent launches preflight silently instead of reopening system prompts.
|
||||
|
||||
## Validation
|
||||
|
||||
@@ -181,12 +144,9 @@ Release artifacts are:
|
||||
- `electron-updater` metadata files
|
||||
- `content.json`
|
||||
|
||||
Linux DEB/RPM and Windows Squirrel/NuGet artifacts are intentionally not
|
||||
published in the updater-capable release path unless the product decision
|
||||
changes.
|
||||
Linux DEB/RPM and Windows Squirrel/NuGet artifacts are intentionally not published in the updater-capable release path unless the product decision changes.
|
||||
|
||||
Packaged updater debugging follows the Space Agent flow. Open DevTools in a
|
||||
packaged launcher and use:
|
||||
Packaged updater debugging follows the Space Agent flow. Open DevTools in a packaged launcher and use:
|
||||
|
||||
```js
|
||||
space.checkForUpdates()
|
||||
@@ -194,9 +154,7 @@ space.debugReinstall('v0.4')
|
||||
space.installUpdate()
|
||||
```
|
||||
|
||||
`debugReinstall(version)` stages and downloads the requested release metadata,
|
||||
including downgrades. After it finishes, click `Restart` on the startup screen or
|
||||
run `space.installUpdate()`.
|
||||
`debugReinstall(version)` stages and downloads the requested release metadata, including downgrades. After it finishes, click `Restart` on the startup screen or run `space.installUpdate()`.
|
||||
|
||||
## macOS Signing
|
||||
|
||||
@@ -214,23 +172,17 @@ Release-grade macOS signing and notarization in GitHub Actions require:
|
||||
- `APPLE_PASSWORD`
|
||||
- `APPLE_TEAM_ID`
|
||||
|
||||
When Apple credentials are absent, the workflow still builds unsigned macOS
|
||||
artifacts.
|
||||
When Apple credentials are absent, the workflow still builds unsigned macOS artifacts.
|
||||
|
||||
## Release Process
|
||||
|
||||
GitHub Actions owns the release path:
|
||||
|
||||
1. Create or move a `v*` tag intentionally.
|
||||
2. Push the tag. `build.yml` builds updater-capable executable artifacts,
|
||||
stages canonical release asset names, creates or updates the GitHub Release,
|
||||
and uploads installers plus updater metadata.
|
||||
3. `bundle-content.yml` checks out the tag, bundles `app/` into `content.json`,
|
||||
and uploads it to the release.
|
||||
2. Push the tag. `build.yml` builds updater-capable executable artifacts, stages canonical release asset names, creates or updates the GitHub Release, and uploads installers plus updater metadata.
|
||||
3. `bundle-content.yml` checks out the tag, bundles `app/` into `content.json`, and uploads it to the release.
|
||||
|
||||
Two-segment tags such as `v1.8` are the public release shape. Executable builds
|
||||
normalize them to full semver versions such as `1.8.0` only where packaging or
|
||||
updater tooling requires it, while public asset names keep `1.8`.
|
||||
Two-segment tags such as `v1.8` are the public release shape. Executable builds normalize them to full semver versions such as `1.8.0` only where packaging or updater tooling requires it, while public asset names keep `1.8`.
|
||||
|
||||
After publishing, verify release assets with:
|
||||
|
||||
@@ -261,8 +213,7 @@ a0-launcher/
|
||||
└── package.json
|
||||
```
|
||||
|
||||
Coding agents should read `AGENTS.md` first. Each subtree may also have its own
|
||||
`AGENTS.md` with closer implementation contracts.
|
||||
Coding agents should read `AGENTS.md` first. Each subtree may also have its own `AGENTS.md` with closer implementation contracts.
|
||||
|
||||
## License
|
||||
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
# Onboarding improvements
|
||||
|
||||
- [x] Use "Finish local Agent Zero runtime Setup." for the macOS initial setup
|
||||
description, matching Windows. Keep Linux and active phase descriptions.
|
||||
- [x] Allow the first Agent Zero download and extraction to move to the existing
|
||||
background progress toast without canceling installation or losing progress.
|
||||
- [x] Start onboarding with matching remote/local choice blocks. Save the local
|
||||
choice, open its runtime checklist expanded, and remove remote promotion from
|
||||
all later local steps.
|
||||
- [x] Persist completion across relaunch, unavailable runtimes, and later Instance
|
||||
removal. Recognize existing installations from saved Instance/history evidence.
|
||||
Keep explicit Runtime Setup recovery available without replaying onboarding.
|
||||
- [x] Verify both paths, background progress, completion persistence, and compact
|
||||
layouts with focused checks and updated UI captures.
|
||||
|
||||
## Implementation
|
||||
|
||||
- `app/components/docker-manager/runtime-gate/runtime-gate.js` owns the welcome
|
||||
choice and subsequent local setup. Create/Add dialogs and a handed-off download
|
||||
are protected from a recreated runtime modal. Canceling the remote dialog
|
||||
returns to the initial choice; local intent survives reload and stale snapshots.
|
||||
- `app/components/docker-manager/operation-modal/operation-modal.js` reuses
|
||||
`Download in background` for the first image pull and extraction. The existing
|
||||
toast, failure recovery, and submitted form's run-after-pull behavior remain
|
||||
responsible for the operation lifecycle.
|
||||
- `shell/docker_manager/state_store.js` persists `onboarding: local | complete`.
|
||||
No saved evidence means `new`; unreadable state remains an error, not a new
|
||||
installation. The no-argument `beginLocalSetup` intent saves the local choice
|
||||
without installing anything. Runtime installation still requires Continue.
|
||||
- Completion follows a saved remote or a discovered local Instance. Upgrade
|
||||
detection also uses saved Instance names, Host access Instance records, and
|
||||
runtime identity history. Merely installed Docker and the compatibility-only
|
||||
`hostAccess.onboardingComplete` field are not completion evidence.
|
||||
- Serialized, atomic state writes preserve onboarding advancement when another
|
||||
writer holds an older snapshot. Renderer state also rejects regressions.
|
||||
Completion reaches both state and inventory through the shell/preload bridge.
|
||||
- Returning users with unavailable Docker get an explicit Runtime Setup action
|
||||
in Instances. Recovery can be closed when idle and does not show the welcome
|
||||
choices or first-image prompt.
|
||||
|
||||
## Verification
|
||||
|
||||
- Relevant renderer, state-store, runtime-provisioner, shell, and gateway suites:
|
||||
186 passed, 1 existing skip. Focused onboarding/state tests were rerun after the
|
||||
final changes. Syntax checks and `git diff --check` passed.
|
||||
- Browser replay at 1280 x 900 and 800 x 600: remote cancel and submit, offline
|
||||
remote reload, local-choice reload, expanded checklist, no repeated remote
|
||||
promotion, background download/extraction, run-after-pull, stale state, and
|
||||
explicit runtime recovery passed.
|
||||
- Native Electron local-content smoke used an isolated test profile with the
|
||||
existing Docker Instance. State and inventory reported `complete`, the marker
|
||||
was verified on disk, and renderer reload did not show onboarding.
|
||||
- Captures: `output/playwright/onboarding-updated/`. Clean-machine runtime phases
|
||||
used simulated backend state; native macOS/Windows installation was not run.
|
||||
- Completion protection assumes retained Launcher profile data. Deliberately
|
||||
deleting all saved profile/history is a fresh installation; upgrade detection
|
||||
cannot reconstruct history that no longer exists.
|
||||
+49
-185
@@ -4,203 +4,70 @@
|
||||
|
||||
`app/` owns the renderer content loaded inside the Electron shell.
|
||||
|
||||
It is a static browser application built from local HTML, CSS, ES modules, the
|
||||
portable Agent Zero UI framework, and `<x-component>` includes. It presents the
|
||||
Docker Manager experience and asks the preload APIs to perform privileged work.
|
||||
It is a static browser application built from local HTML, CSS, ES modules, the portable Agent Zero UI framework, and `<x-component>` includes. It presents the Docker Manager experience and asks the preload APIs to perform privileged work.
|
||||
|
||||
## Ownership
|
||||
|
||||
This scope owns:
|
||||
|
||||
- `app/index.html`: renderer entrypoint, CSP, shared styles/scripts, and tab
|
||||
layout.
|
||||
- `app/docker_manager.js`: renderer state coordination, preload API calls,
|
||||
action facade, runtime setup action, toast helpers, and initial refresh flow.
|
||||
- `app/index.html`: renderer entrypoint, CSP, shared styles/scripts, and tab layout.
|
||||
- `app/docker_manager.js`: renderer state coordination, preload API calls, action facade, runtime setup action, toast helpers, and initial refresh flow.
|
||||
- `app/docker_manager.css`: launcher-specific UI surface.
|
||||
- `app/assets/`: renderer-visible images, symbols, and setup showcase media.
|
||||
- `app/components/`: component HTML and ES modules loaded through
|
||||
`<x-component>`.
|
||||
- `app/components/`: component HTML and ES modules loaded through `<x-component>`.
|
||||
- `app/a0ui/`: portable Agent Zero UI primitives vendored into this app.
|
||||
|
||||
## Local Contracts
|
||||
|
||||
- Renderer code must not import Node or Electron modules directly.
|
||||
- All privileged behavior goes through preload surfaces:
|
||||
`window.electronAPI` for shell metadata and `window.dockerManagerAPI` for
|
||||
Docker Manager operations.
|
||||
- `app/docker_manager.js` owns the canonical renderer snapshot. Components read
|
||||
state from the `dm:state` event or `window.__dmLastState`; they should not
|
||||
each call the Docker APIs independently.
|
||||
- Fast Settings and per-Instance metadata actions must apply their sanitized
|
||||
returned state delta to the canonical snapshot instead of forcing a Docker,
|
||||
GitHub, and registry refresh. Keep full refreshes for explicit refresh intent
|
||||
and operations that actually change Docker inventory.
|
||||
- User navigation to data-heavy tabs and post-operation reconciliation should
|
||||
request a non-forced refresh: rebuild live local Docker state while honoring
|
||||
normal release and registry caches. Initial loading uses the same fast path,
|
||||
then requests a non-blocking forced refresh when the cached catalog predates
|
||||
that launch so remote metadata becomes current without delaying first usable
|
||||
state. The explicit Refresh action stays forced.
|
||||
- Components invoke behavior through `window.dockerManagerActions`, not through
|
||||
raw IPC names.
|
||||
- Host access UI renders only shell-sanitized configuration and transient
|
||||
status. The renderer may choose folders through the named native-picker
|
||||
action and send bounded settings or gateway commands; it never sees child
|
||||
process handles, decrypted credentials, or a generic execution primitive.
|
||||
- Create/Add Instance is the single initial Host access opt-in point; do not
|
||||
reopen a global Host access onboarding modal. Local creation inherits the
|
||||
Settings defaults, while saved remote setup requires an explicit choice to
|
||||
connect this computer while its Launcher tab or detached window is open.
|
||||
File read, file write, and Code execution remain preselected by default while
|
||||
browser and Computer Use are opt-in.
|
||||
- A0 Tag renderer state is limited to its normalized enabled/Instance/profile
|
||||
settings plus bounded shortcut, status, message, profile labels, and running
|
||||
flag. Settings may request live profiles only through the named Docker
|
||||
Manager action. Invocation text, foreground context, screenshots, target
|
||||
tokens, command-palette queries, model output, credentials, and child state
|
||||
stay in the shell/gateway.
|
||||
- Runtime setup and persisted `onboarding` (`new`, `local`, `complete`) belong
|
||||
to the canonical renderer snapshot. Unknown state must not trigger onboarding.
|
||||
New users first choose remote or local; the named `beginLocalSetup` intent
|
||||
saves local choice before opening its expanded runtime checklist. Later local
|
||||
steps must not repeat the remote offer. Completed onboarding must never reopen
|
||||
automatically, including on unavailable Docker or stale state/progress events.
|
||||
Keep explicit Runtime Setup recovery in Instances. State refreshes must not
|
||||
recreate the runtime modal above Create/Add Instance dialogs or after the
|
||||
local flow hands off to creation/download. Docker mechanics stay in the shell.
|
||||
- When first launch finds multiple distinct reachable local Docker daemons and
|
||||
no saved preference, show the existing compact runtime selector once before
|
||||
continuing. Multiple endpoint aliases for one daemon must remain one choice.
|
||||
- The selector may also include an installed stopped Docker Desktop beside a
|
||||
reachable daemon. Selecting it starts Docker Desktop through the named runtime
|
||||
action before the normal Run or Download step continues.
|
||||
- The setup capability slideshow is for the long Agent Zero image pull/extract
|
||||
wait, not for Docker runtime setup or short install preflight checks.
|
||||
- When runtime setup completes, the same modal shell owns the next step without
|
||||
implying Agent Zero is still missing: download an image if none is installed,
|
||||
run Agent Zero if an image is installed but no local Instance exists, or
|
||||
continue if an Instance already exists.
|
||||
- First Instance launch settings belong in the normal Create local Instance
|
||||
dialog, including model, storage, port, environment, and credential options.
|
||||
Its image picker lists only Agent Zero releases and local Agent Zero builds.
|
||||
Arbitrary Docker images remain available only through Advanced developer
|
||||
controls.
|
||||
The first Agent Zero image pull operation modal should stay focused on
|
||||
progress and setup showcase content instead of adding a second launch form.
|
||||
- Long-running non-runtime Docker operations should use the same centered modal
|
||||
affordance rather than a top-of-page status strip. Keep the header quiet once
|
||||
the modal flow exists. All image downloads and extraction, including the
|
||||
first pull, may move into the existing background progress toast by explicit
|
||||
user action. Hiding progress must preserve failure recovery and run-after-pull.
|
||||
- Image-download modals and background toasts use the same phase percentage and
|
||||
phase timing metadata for their progress and ETA.
|
||||
- Once a long-running operation returns an operation ID, let progress and state
|
||||
events drive its visible lifecycle; accepting the operation must not wait for
|
||||
an immediate full inventory refresh.
|
||||
- Local instance card `Start`, `Stop`, `Restart`, and `Delete` are background
|
||||
queued actions. They must not open the global operation modal or make the
|
||||
page inert;
|
||||
show queue/running state on the affected card and surface failures with toast
|
||||
feedback. If the Instance was deleted but its workspace folder remains, label
|
||||
the toast as a folder cleanup failure rather than a failed Instance deletion.
|
||||
- Running an installed Version from Versions must keep the operation modal until
|
||||
the Docker Manager reports the new Instance UI ready, then hand off to the
|
||||
Instances tab so the created Instance is visible.
|
||||
- A0 CLI launch, rename, Colour/Icon selection, and log inspection controls belong to
|
||||
each relevant instance card. Clone belongs to local containers and may appear
|
||||
on a saved remote card only when that card points at a loopback URL backed by
|
||||
a discovered local container. Pass a local card's UI URL or a saved remote
|
||||
Instance ID through the shell-owned terminal action; the shell prompts for the
|
||||
CLI working folder before opening the terminal. Show `Install A0 CLI` while
|
||||
the system CLI is missing and replace it with `Open A0 CLI` once installed;
|
||||
disable Open while CLI maintenance is running. Create/Add Instance and Host
|
||||
access settings must not present CLI installation as an extra step,
|
||||
permission, or dependency. Do not add a global footer or ambiguous
|
||||
active-instance CLI button.
|
||||
- Local Instance Backup and Restore belong with the other card-local actions.
|
||||
They must call named renderer actions that delegate host path selection and
|
||||
container archive work to the shell and Docker Manager.
|
||||
- Per-Instance Colour/Icon selection is launcher identity metadata for local and
|
||||
saved remote Instances. It should use validated preset/custom colours and icons from Docker
|
||||
Manager state, tint only launcher identity visuals, and never imply Docker or
|
||||
Agent Zero runtime state.
|
||||
An empty icon ID selects the page favicon, falling back to the bundled Agent
|
||||
Zero symbol; `language` explicitly selects Globe. Attached tabs, detached
|
||||
headers, and the appearance picker share the same icon rendering. Keep native
|
||||
views hidden while either Host access or Colour/Icon dialogs are open.
|
||||
Upload image calls the named shell chooser, decodes images/SVG only as images,
|
||||
and prepares a 96-pixel PNG preview. Cancel leaves the saved choice unchanged;
|
||||
Save uses the existing appearance action. Never accept or persist host paths.
|
||||
Custom is the first colour choice and uses a native colour input. Keep custom
|
||||
RGB hex colours consistent across card accents and attached/detached tab icons.
|
||||
- Local and saved remote Instance cards should render the same health-derived
|
||||
runtime identity, including branch and commits since the nearest release;
|
||||
image tags remain fallback provenance when no runtime identity has been seen.
|
||||
- Removing a Version is a named renderer action from the Versions view. The
|
||||
renderer should present it as image cleanup and let Docker Manager report
|
||||
Docker's in-use refusal rather than trying to infer container/image bindings
|
||||
in component code.
|
||||
- Versions offers image install, run, and removal actions only. Updating belongs
|
||||
to the specific Instance card, where it opens Agent Zero's self-update flow.
|
||||
- The compact header shows the Agent Zero wordmark without visible launcher
|
||||
version text. Shell app/content metadata may remain in renderer state for
|
||||
diagnostics and update decisions, but it should not reintroduce version or
|
||||
`Content:` clutter into the header.
|
||||
- Keep external navigation intentional. The sidebar resource links may request
|
||||
approved Docs, API Dashboard, and Support resource IDs through
|
||||
`window.dockerManagerActions.openResourceLink`; the shell maps those IDs to
|
||||
fixed public URLs. Direct `window.open` should stay limited to safe public
|
||||
links such as Docker install help.
|
||||
- All privileged behavior goes through preload surfaces: `window.electronAPI` for shell metadata and `window.dockerManagerAPI` for Docker Manager operations.
|
||||
- `app/docker_manager.js` owns the canonical renderer snapshot. Components read state from the `dm:state` event or `window.__dmLastState`; they should not each call the Docker APIs independently.
|
||||
- Fast Settings and per-Instance metadata actions must apply their sanitized returned state delta to the canonical snapshot instead of forcing a Docker, GitHub, and registry refresh. Keep full refreshes for explicit refresh intent and operations that actually change Docker inventory.
|
||||
- User navigation to data-heavy tabs and post-operation reconciliation should request a non-forced refresh: rebuild live local Docker state while honoring normal release and registry caches. Initial loading uses the same fast path, then requests a non-blocking forced refresh when the cached catalog predates that launch so remote metadata becomes current without delaying first usable state. The explicit Refresh action stays forced.
|
||||
- Components invoke behavior through `window.dockerManagerActions`, not through raw IPC names.
|
||||
- Host access UI renders only shell-sanitized configuration and transient status. The renderer may choose folders through the named native-picker action and send bounded settings or gateway commands; it never sees child process handles, decrypted credentials, or a generic execution primitive.
|
||||
- Create/Add Instance is the single initial Host access opt-in point; do not reopen a global Host access onboarding modal. Local creation inherits the Settings defaults, while saved remote setup requires an explicit choice to connect this computer while its Launcher tab or detached window is open. File read, file write, and Code execution remain preselected by default while browser and Computer Use are opt-in.
|
||||
- A0 Tag renderer state is limited to its normalized enabled/Instance/profile settings plus bounded shortcut, status, message, profile labels, and running flag. Settings may request live profiles only through the named Docker Manager action. Invocation text, foreground context, screenshots, target tokens, command-palette queries, model output, credentials, and child state stay in the shell/gateway.
|
||||
- Runtime setup and persisted `onboarding` (`new`, `local`, `complete`) belong to the canonical renderer snapshot. Unknown state must not trigger onboarding. New users first choose remote or local; the named `beginLocalSetup` intent saves local choice before opening its expanded runtime checklist. Later local steps must not repeat the remote offer. Completed onboarding must never reopen automatically, including on unavailable Docker or stale state/progress events. Keep explicit Runtime Setup recovery in Instances. State refreshes must not recreate the runtime modal above Create/Add Instance dialogs or after the local flow hands off to creation/download. Docker mechanics stay in the shell.
|
||||
- When first launch finds multiple distinct reachable local Docker daemons and no saved preference, show the existing compact runtime selector once before continuing. Multiple endpoint aliases for one daemon must remain one choice.
|
||||
- The selector may also include an installed stopped Docker Desktop beside a reachable daemon. Selecting it starts Docker Desktop through the named runtime action before the normal Run or Download step continues.
|
||||
- The setup capability slideshow is for the long Agent Zero image pull/extract wait, not for Docker runtime setup or short install preflight checks.
|
||||
- When runtime setup completes, the same modal shell owns the next step without implying Agent Zero is still missing: download an image if none is installed, run Agent Zero if an image is installed but no local Instance exists, or continue if an Instance already exists.
|
||||
- First Instance launch settings belong in the normal Create local Instance dialog, including model, storage, port, environment, and credential options. Its image picker lists only Agent Zero releases and local Agent Zero builds. Arbitrary Docker images remain available only through Advanced developer controls. The first Agent Zero image pull operation modal should stay focused on progress and setup showcase content instead of adding a second launch form.
|
||||
- Long-running non-runtime Docker operations should use the same centered modal affordance rather than a top-of-page status strip. Keep the header quiet once the modal flow exists. All image downloads and extraction, including the first pull, may move into the existing background progress toast by explicit user action. Hiding progress must preserve failure recovery and run-after-pull.
|
||||
- Image-download modals and background toasts use the same phase percentage and phase timing metadata for their progress and ETA.
|
||||
- Once a long-running operation returns an operation ID, let progress and state events drive its visible lifecycle; accepting the operation must not wait for an immediate full inventory refresh.
|
||||
- Local instance card `Start`, `Stop`, `Restart`, and `Delete` are background queued actions. They must not open the global operation modal or make the page inert; show queue/running state on the affected card and surface failures with toast feedback. If the Instance was deleted but its workspace folder remains, label the toast as a folder cleanup failure rather than a failed Instance deletion.
|
||||
- Running an installed Version from Versions must keep the operation modal until the Docker Manager reports the new Instance UI ready, then hand off to the Instances tab so the created Instance is visible.
|
||||
- A0 CLI launch, rename, Colour/Icon selection, and log inspection controls belong to each relevant instance card. Clone belongs to local containers and may appear on a saved remote card only when that card points at a loopback URL backed by a discovered local container. Pass a local card's UI URL or a saved remote Instance ID through the shell-owned terminal action; the shell prompts for the CLI working folder before opening the terminal. Show `Install A0 CLI` while the system CLI is missing and replace it with `Open A0 CLI` once installed; disable Open while CLI maintenance is running. Create/Add Instance and Host access settings must not present CLI installation as an extra step, permission, or dependency. Do not add a global footer or ambiguous active-instance CLI button.
|
||||
- Local Instance Backup and Restore belong with the other card-local actions. They must call named renderer actions that delegate host path selection and container archive work to the shell and Docker Manager.
|
||||
- Per-Instance Colour/Icon selection is launcher identity metadata for local and saved remote Instances. It should use validated preset/custom colours and icons from Docker Manager state, tint only launcher identity visuals, and never imply Docker or Agent Zero runtime state. An empty icon ID selects the page favicon, falling back to the bundled Agent Zero symbol; `language` explicitly selects Globe. Attached tabs, detached headers, and the appearance picker share the same icon rendering. Keep native views hidden while either Host access or Colour/Icon dialogs are open. Upload image calls the named shell chooser, decodes images/SVG only as images, and prepares a 96-pixel PNG preview. Cancel leaves the saved choice unchanged; Save uses the existing appearance action. Never accept or persist host paths. Custom is the first colour choice and uses a native colour input. Keep custom RGB hex colours consistent across card accents and attached/detached tab icons.
|
||||
- Local and saved remote Instance cards should render the same health-derived runtime identity, including branch and commits since the nearest release; image tags remain fallback provenance when no runtime identity has been seen.
|
||||
- Removing a Version is a named renderer action from the Versions view. The renderer should present it as image cleanup and let Docker Manager report Docker's in-use refusal rather than trying to infer container/image bindings in component code.
|
||||
- Versions offers image install, run, and removal actions only. Updating belongs to the specific Instance card, where it opens Agent Zero's self-update flow.
|
||||
- The compact header shows the Agent Zero wordmark without visible launcher version text. Shell app/content metadata may remain in renderer state for diagnostics and update decisions, but it should not reintroduce version or `Content:` clutter into the header.
|
||||
- Keep external navigation intentional. The sidebar resource links may request approved Docs, API Dashboard, and Support resource IDs through `window.dockerManagerActions.openResourceLink`; the shell maps those IDs to fixed public URLs. Direct `window.open` should stay limited to safe public links such as Docker install help.
|
||||
- Use `Instances`, not `Sessions`, in visible copy.
|
||||
- Use `Storage volumes` when referring to Docker volumes.
|
||||
- Keep developer-only Docker controls in the Advanced tab. They may compose and
|
||||
run custom images or edit and operate shell-authorized Docker project files
|
||||
through named Docker Manager actions, but renderer code must not receive host
|
||||
paths or expose generic command execution.
|
||||
- Keep install, activation, rollback, and destructive-storage flows explicit
|
||||
about risk without adding Docker jargon where a user decision is enough.
|
||||
- Toast feedback for modal actions must remain visible above blocking modal
|
||||
backdrops, especially recoverable failures such as Docker Hub sign-in.
|
||||
- Keep developer-only Docker controls in the Advanced tab. They may compose and run custom images or edit and operate shell-authorized Docker project files through named Docker Manager actions, but renderer code must not receive host paths or expose generic command execution.
|
||||
- Keep install, activation, rollback, and destructive-storage flows explicit about risk without adding Docker jargon where a user decision is enough.
|
||||
- Toast feedback for modal actions must remain visible above blocking modal backdrops, especially recoverable failures such as Docker Hub sign-in.
|
||||
- Keep `Open UI` colocated with the Instance or Version it opens.
|
||||
- Show bounded opening feedback while an `Open UI` request waits for the shell,
|
||||
and clear it when the request finishes or fails.
|
||||
- Keep compact controls stable in width and avoid text overflow on small
|
||||
windows.
|
||||
- Keep the launcher workspace responsive across large displays. Do not
|
||||
reintroduce fixed-width page or tab wrappers around the main renderer shell;
|
||||
prefer viewport-aware gutters, grids, and scroll regions.
|
||||
- Keep the outer document and `.dm-page` fixed-height and non-scrolling. Views
|
||||
that can exceed the viewport must own an internal tab, panel, or list scroll
|
||||
region so the launcher header and sidebar stay in place.
|
||||
- Do not use circular launcher buttons. The maximum launcher control radius is
|
||||
the shared 6px Refresh-button radius.
|
||||
- Prefer local Material Symbols icons through the bundled font instead of remote
|
||||
icon/font assets.
|
||||
- Do not add marketing-page structure to the app entrypoint. The first screen is
|
||||
the usable launcher.
|
||||
- Instance tab chrome, including the Launcher tab that returns to the launcher,
|
||||
is renderer-owned, including attached-tab drag ordering and drag-out detach
|
||||
intent, but embedded Agent Zero pages are not. The renderer
|
||||
reports unrounded CSS tab viewport bounds through preload; the shell converts
|
||||
their origin using Launcher-page zoom and fills the native content area to
|
||||
the right and bottom edges. Register window resize
|
||||
handling independently of the asynchronously loaded tab component so native
|
||||
Instance views keep their bounds when the Launcher is maximized or restored.
|
||||
Host access controls remain in attached or detached Launcher chrome: a
|
||||
per-Instance grey/green computer button opens the shared modal, and Agent Zero
|
||||
page content receives no duplicate menu or control bridge.
|
||||
- Show bounded opening feedback while an `Open UI` request waits for the shell, and clear it when the request finishes or fails.
|
||||
- Keep compact controls stable in width and avoid text overflow on small windows.
|
||||
- Keep the launcher workspace responsive across large displays. Do not reintroduce fixed-width page or tab wrappers around the main renderer shell; prefer viewport-aware gutters, grids, and scroll regions.
|
||||
- Keep the outer document and `.dm-page` fixed-height and non-scrolling. Views that can exceed the viewport must own an internal tab, panel, or list scroll region so the launcher header and sidebar stay in place.
|
||||
- Do not use circular launcher buttons. The maximum launcher control radius is the shared 6px Refresh-button radius.
|
||||
- Prefer local Material Symbols icons through the bundled font instead of remote icon/font assets.
|
||||
- Do not add marketing-page structure to the app entrypoint. The first screen is the usable launcher.
|
||||
- Instance tab chrome, including the Launcher tab that returns to the launcher, is renderer-owned, including attached-tab drag ordering and drag-out detach intent, but embedded Agent Zero pages are not. The renderer reports unrounded CSS tab viewport bounds through preload; the shell converts their origin using Launcher-page zoom and fills the native content area to the right and bottom edges. Register window resize handling independently of the asynchronously loaded tab component so native Instance views keep their bounds when the Launcher is maximized or restored. Host access controls remain in attached or detached Launcher chrome: a per-Instance grey/green computer button opens the shared modal, and Agent Zero page content receives no duplicate menu or control bridge.
|
||||
|
||||
## Work Guidance
|
||||
|
||||
- Add shared renderer state to `docker-manager-store.js` first, then expose it
|
||||
through the snapshot in `app/docker_manager.js`.
|
||||
- If a new component needs actions, add a named action to
|
||||
`window.dockerManagerActions` and document the behavior in the component
|
||||
owning doc.
|
||||
- Keep component scripts idempotent: a component may render from the last state
|
||||
immediately and then subscribe to future `dm:state` events.
|
||||
- Keep launcher-specific styles in `app/docker_manager.css`; do not place
|
||||
one-off feature styling in portable `app/a0ui` files.
|
||||
- Add shared renderer state to `docker-manager-store.js` first, then expose it through the snapshot in `app/docker_manager.js`.
|
||||
- If a new component needs actions, add a named action to `window.dockerManagerActions` and document the behavior in the component owning doc.
|
||||
- Keep component scripts idempotent: a component may render from the last state immediately and then subscribe to future `dm:state` events.
|
||||
- Keep launcher-specific styles in `app/docker_manager.css`; do not place one-off feature styling in portable `app/a0ui` files.
|
||||
|
||||
## Verification
|
||||
|
||||
@@ -211,8 +78,7 @@ node --check app/docker_manager.js
|
||||
git diff --check
|
||||
```
|
||||
|
||||
For visible UI changes, start the launcher with local content and inspect the
|
||||
affected tabs:
|
||||
For visible UI changes, start the launcher with local content and inspect the affected tabs:
|
||||
|
||||
```bash
|
||||
A0_LAUNCHER_LOCAL_REPO=/home/eclypso/a0/a0-launcher npm start
|
||||
@@ -220,7 +86,5 @@ A0_LAUNCHER_LOCAL_REPO=/home/eclypso/a0/a0-launcher npm start
|
||||
|
||||
## Child DOX Index
|
||||
|
||||
- `/app/a0ui/AGENTS.md`: portable Agent Zero UI framework assets and vendored
|
||||
browser dependencies.
|
||||
- `/app/components/docker-manager/AGENTS.md`: Docker Manager renderer
|
||||
components and component store.
|
||||
- `/app/a0ui/AGENTS.md`: portable Agent Zero UI framework assets and vendored browser dependencies.
|
||||
- `/app/components/docker-manager/AGENTS.md`: Docker Manager renderer components and component store.
|
||||
+14
-31
@@ -2,11 +2,9 @@
|
||||
|
||||
## Purpose
|
||||
|
||||
`app/a0ui/` owns the portable Agent Zero UI primitives bundled with the
|
||||
launcher.
|
||||
`app/a0ui/` owns the portable Agent Zero UI primitives bundled with the launcher.
|
||||
|
||||
This subtree should feel like shared framework infrastructure, not a dumping
|
||||
ground for launcher-specific behavior.
|
||||
This subtree should feel like shared framework infrastructure, not a dumping ground for launcher-specific behavior.
|
||||
|
||||
## Ownership
|
||||
|
||||
@@ -16,39 +14,24 @@ This scope owns:
|
||||
- `css/buttons.css` and `css/modals.css`: shared button and modal primitives.
|
||||
- `js/initFw.js`: frontend framework bootstrap.
|
||||
- `js/components.js`: `<x-component>` loading.
|
||||
- `js/AlpineStore.js`, `js/initializer.js`, `js/modals.js`, `js/confirmClick.js`,
|
||||
`js/device.js`, `js/sleep.js`, and `js/shortcuts.js`: shared client helpers.
|
||||
- `vendor/`: locally bundled third-party assets, fonts, Alpine, Ace, and Material
|
||||
Symbols.
|
||||
- `js/AlpineStore.js`, `js/initializer.js`, `js/modals.js`, `js/confirmClick.js`, `js/device.js`, `js/sleep.js`, and `js/shortcuts.js`: shared client helpers.
|
||||
- `vendor/`: locally bundled third-party assets, fonts, Alpine, Ace, and Material Symbols.
|
||||
|
||||
## Local Contracts
|
||||
|
||||
- Keep this subtree network-independent. Do not add remote fonts, remote icon
|
||||
kits, CDN scripts, or runtime asset fetches.
|
||||
- Keep launcher-specific Docker Manager state, copy, and behavior outside
|
||||
`app/a0ui`; use `app/docker_manager.js`, `app/docker_manager.css`, or component
|
||||
files instead.
|
||||
- `<x-component>` paths are app-relative static paths. Component loading must
|
||||
remain deterministic and compatible with both local-content mode and unpacked
|
||||
`content.json` mode.
|
||||
- Mount component markup before its module executes so one-shot control binding
|
||||
sees the component DOM.
|
||||
- A failed component asset must clear its transient loading placeholder instead
|
||||
of leaving a perpetual shimmer.
|
||||
- Vendor files should be treated as bundled artifacts. Edit them only when the
|
||||
task is explicitly to update or repair the vendored dependency, and document
|
||||
the source/update path in the change.
|
||||
- Shared primitives should stay conservative. A portable helper belongs here
|
||||
only when it is useful beyond one launcher component.
|
||||
- Keep this subtree network-independent. Do not add remote fonts, remote icon kits, CDN scripts, or runtime asset fetches.
|
||||
- Keep launcher-specific Docker Manager state, copy, and behavior outside `app/a0ui`; use `app/docker_manager.js`, `app/docker_manager.css`, or component files instead.
|
||||
- `<x-component>` paths are app-relative static paths. Component loading must remain deterministic and compatible with both local-content mode and unpacked `content.json` mode.
|
||||
- Mount component markup before its module executes so one-shot control binding sees the component DOM.
|
||||
- A failed component asset must clear its transient loading placeholder instead of leaving a perpetual shimmer.
|
||||
- Vendor files should be treated as bundled artifacts. Edit them only when the task is explicitly to update or repair the vendored dependency, and document the source/update path in the change.
|
||||
- Shared primitives should stay conservative. A portable helper belongs here only when it is useful beyond one launcher component.
|
||||
|
||||
## Work Guidance
|
||||
|
||||
- Prefer adding a launcher-local class in `app/docker_manager.css` before
|
||||
changing shared visual primitives.
|
||||
- Preserve existing framework globals and load order unless the task is
|
||||
explicitly to change framework bootstrap.
|
||||
- Keep this scope safe for static release bundling; avoid filesystem or
|
||||
environment assumptions.
|
||||
- Prefer adding a launcher-local class in `app/docker_manager.css` before changing shared visual primitives.
|
||||
- Preserve existing framework globals and load order unless the task is explicitly to change framework bootstrap.
|
||||
- Keep this scope safe for static release bundling; avoid filesystem or environment assumptions.
|
||||
|
||||
## Verification
|
||||
|
||||
|
||||
@@ -2,463 +2,102 @@
|
||||
|
||||
## Purpose
|
||||
|
||||
`app/components/docker-manager/` owns the renderer components that make up the
|
||||
launcher workspace.
|
||||
`app/components/docker-manager/` owns the renderer components that make up the launcher workspace.
|
||||
|
||||
The components should stay small, state-driven, and predictable. They render the
|
||||
current Docker Manager snapshot and call named renderer actions when the user
|
||||
asks for work.
|
||||
The components should stay small, state-driven, and predictable. They render the current Docker Manager snapshot and call named renderer actions when the user asks for work.
|
||||
|
||||
## Ownership
|
||||
|
||||
This scope owns:
|
||||
|
||||
- `docker-manager-store.js`: mutable renderer store and default state shape.
|
||||
- `progress-eta.js`: renderer-only minute-level progress ETA formatting shared
|
||||
by setup and operation modals.
|
||||
- `status-header/`: wordmark, launcher update affordance, refresh, and shared
|
||||
progress-recovery helpers.
|
||||
- `operation-modal/`: centered progress/error modal for non-runtime installs,
|
||||
updates, activation, start/stop, delete, rollback, and recovery actions.
|
||||
- `runtime-gate/`: first-run local/remote choice, local runtime setup progress,
|
||||
and explicitly opened runtime recovery for returning users.
|
||||
- `remote-instance-dialog.js`: shared remote Instance URL and optional saved
|
||||
credential dialog used by the startup runtime gate and the Instances tab.
|
||||
- `host-access-dialog.js`: existing-Instance Host access settings, scope
|
||||
dependency UI, folder selection, browser-profile selection, permission setup,
|
||||
diagnostics, Retry, Disconnect, Reconnect, and disconnected state.
|
||||
- `first-instance-setup/`: retired first image-pull defaults panel retained for
|
||||
compatibility while normal creation owns first Instance launch choices.
|
||||
- `setup-showcase/`: Agent Zero capability slideshow helper shown during the
|
||||
long Agent Zero image pull phase.
|
||||
- `onboarding/`: retired runtime setup banner files kept only for compatibility
|
||||
until they are removed.
|
||||
- `sidebar/`: tab navigation, `dm:nav` event publication, and sidebar resource
|
||||
links.
|
||||
- `official-versions/`: Version cards, activation dialog, saved
|
||||
Instance defaults, port/env overrides, data-loss acknowledgement, and
|
||||
run/switch actions.
|
||||
- `local-testing/`: local containers, per-instance action menus, rename,
|
||||
Colour/Icon selection, launcher-saved credential controls for local and saved
|
||||
remote Instances, clone/log inspection controls, remote instance CRUD, and
|
||||
instance opening.
|
||||
- `advanced/`: tabbed Dockerfile/Compose project workspace, subordinate custom
|
||||
image runner, diagnostics, and storage-volume maintenance.
|
||||
- `settings/`: port, workspace, Host access, and saved Instance provider/model
|
||||
defaults.
|
||||
- `instance-tabs/`: browser-style attached and detached tab chrome, Launcher
|
||||
tab, drag ordering and drag-out detach, name collapse, per-Instance Host
|
||||
access buttons, reload/detach/reattach, empty state, and viewport bounds
|
||||
reporting for shell-owned Agent Zero views.
|
||||
- `component-utils.js`: shared renderer DOM helpers (byId, asText, compactText, clearChildren, escapeHtml, makeButton, focusableWithin, setPageBlocked, closeDialog) used across docker-manager components.
|
||||
- `release-entries.js`: shared Agent Zero release-tag parsing, channel-entry checks, tag comparison, and date normalization shared by Versions and Instance dialogs.
|
||||
- `progress-eta.js`: renderer-only minute-level progress ETA formatting plus shared percent and background-toast progress helpers.
|
||||
- `status-header/`: wordmark, launcher update affordance, refresh, and shared progress-recovery helpers.
|
||||
- `operation-modal/`: centered progress/error modal for non-runtime installs, updates, activation, start/stop, delete, rollback, and recovery actions.
|
||||
- `runtime-gate/`: first-run local/remote choice, local runtime setup progress, and explicitly opened runtime recovery for returning users.
|
||||
- `remote-instance-dialog.js`: shared remote Instance URL and optional saved credential dialog used by the startup runtime gate and the Instances tab.
|
||||
- `host-access-dialog.js`: existing-Instance Host access settings, scope dependency UI, folder selection, browser-profile selection, permission setup, diagnostics, Retry, Disconnect, Reconnect, and disconnected state.
|
||||
- `first-instance-setup/`: retired first image-pull defaults panel retained for compatibility while normal creation owns first Instance launch choices.
|
||||
- `setup-showcase/`: Agent Zero capability slideshow helper shown during the long Agent Zero image pull phase.
|
||||
- `onboarding/`: retired runtime setup banner files kept only for compatibility until they are removed.
|
||||
- `sidebar/`: tab navigation, `dm:nav` event publication, and sidebar resource links.
|
||||
- `official-versions/`: Version cards, activation dialog, saved Instance defaults, port/env overrides, data-loss acknowledgement, and run/switch actions.
|
||||
- `local-testing/`: local containers, per-instance action menus, rename, Colour/Icon selection, launcher-saved credential controls for local and saved remote Instances, clone/log inspection controls, remote instance CRUD, and instance opening.
|
||||
- `advanced/`: tabbed Dockerfile/Compose project workspace, subordinate custom image runner, diagnostics, and storage-volume maintenance.
|
||||
- `settings/`: port, workspace, Host access, and saved Instance provider/model defaults.
|
||||
- `instance-tabs/`: browser-style attached and detached tab chrome, Launcher tab, drag ordering and drag-out detach, name collapse, per-Instance Host access buttons, reload/detach/reattach, empty state, and viewport bounds reporting for shell-owned Agent Zero views.
|
||||
|
||||
## Local Contracts
|
||||
|
||||
- Components render from the state emitted by `app/docker_manager.js` through
|
||||
`dm:state`.
|
||||
- Components should render once from `window.__dmLastState` if it already
|
||||
exists, then subscribe to future updates.
|
||||
- Components should not call `window.dockerManagerAPI` directly. Use
|
||||
`window.dockerManagerActions`.
|
||||
- Runtime setup renders from `state.runtime` in the blocking startup modal. It
|
||||
should distinguish installable Linux Engine setup, stopped daemons,
|
||||
relogin-required states, and manual install fallback without exposing
|
||||
package-manager details as the main path.
|
||||
- New onboarding first offers matching local and remote choice blocks. Remote
|
||||
copy describes needing no local setup without naming Docker. Save the local
|
||||
choice before opening the platform setup with `See more` expanded; no
|
||||
later local step repeats the remote offer. Canceling the remote form returns
|
||||
to the choice. Completed or unknown onboarding must not open automatically;
|
||||
returning users can explicitly open Runtime Setup from Instances and close
|
||||
recovery when it is not running. Create/Add dialogs and a handed-off image
|
||||
download must not be covered by a recreated runtime modal.
|
||||
- If Docker is already reachable through the Docker Manager state, stale
|
||||
non-ready runtime assessments must not reopen the blocking runtime modal.
|
||||
Only completed runtime setup progress may keep the modal open to guide the
|
||||
immediate next step.
|
||||
- Docker Desktop installed-but-stopped states must be warning states that tell
|
||||
the user to start Docker Desktop. Do not show a download/reinstall action for
|
||||
that state.
|
||||
- Generic runtime setup buttons should say `Continue`, including runtime states
|
||||
that provide `Setup Agent Zero` or `Continue Setup` as a setup action label.
|
||||
Docker Desktop states may still name Docker Desktop plainly.
|
||||
- Sidebar navigation publishes `dm:nav`; click-originated events include
|
||||
`userInitiated` so the renderer coordinator can refresh data-heavy tabs.
|
||||
Tab content activation remains owned by the renderer coordinator, not
|
||||
individual tab content components. Instances is the first sidebar item and
|
||||
the default launcher view. Programmatic tab handoffs should dispatch
|
||||
`dm:navigate` and let the sidebar apply the tab plus publish `dm:nav`.
|
||||
- Empty, loading, error, success, and disabled states must be explicit enough
|
||||
that the user is never left wondering whether Docker or the launcher is still
|
||||
working.
|
||||
- Components render from the state emitted by `app/docker_manager.js` through `dm:state`.
|
||||
- Components should render once from `window.__dmLastState` if it already exists, then subscribe to future updates.
|
||||
- Components should not call `window.dockerManagerAPI` directly. Use `window.dockerManagerActions`.
|
||||
- Runtime setup renders from `state.runtime` in the blocking startup modal. It should distinguish installable Linux Engine setup, stopped daemons, relogin-required states, and manual install fallback without exposing package-manager details as the main path.
|
||||
- New onboarding first offers matching local and remote choice blocks. Remote copy describes needing no local setup without naming Docker. Save the local choice before opening the platform setup with `See more` expanded; no later local step repeats the remote offer. Canceling the remote form returns to the choice. Completed or unknown onboarding must not open automatically; returning users can explicitly open Runtime Setup from Instances and close recovery when it is not running. Create/Add dialogs and a handed-off image download must not be covered by a recreated runtime modal.
|
||||
- If Docker is already reachable through the Docker Manager state, stale non-ready runtime assessments must not reopen the blocking runtime modal. Only completed runtime setup progress may keep the modal open to guide the immediate next step.
|
||||
- Docker Desktop installed-but-stopped states must be warning states that tell the user to start Docker Desktop. Do not show a download/reinstall action for that state.
|
||||
- Generic runtime setup buttons should say `Continue`, including runtime states that provide `Setup Agent Zero` or `Continue Setup` as a setup action label. Docker Desktop states may still name Docker Desktop plainly.
|
||||
- Sidebar navigation publishes `dm:nav`; click-originated events include `userInitiated` so the renderer coordinator can refresh data-heavy tabs. Tab content activation remains owned by the renderer coordinator, not individual tab content components. Instances is the first sidebar item and the default launcher view. Programmatic tab handoffs should dispatch `dm:navigate` and let the sidebar apply the tab plus publish `dm:nav`.
|
||||
- Empty, loading, error, success, and disabled states must be explicit enough that the user is never left wondering whether Docker or the launcher is still working.
|
||||
- Runtime setup progress belongs primarily in the blocking runtime modal.
|
||||
- Runtime setup should stay transparent without becoming a feature showcase.
|
||||
Use the `See more` disclosure for structured setup phases when detailed
|
||||
progress is available.
|
||||
- Runtime setup success should stay in the same modal shell long enough to
|
||||
guide the next step without implying Agent Zero is still missing. If no Agent
|
||||
Zero image is installed, offer a `Download Agent Zero` image action with a
|
||||
selector defaulting to `latest`. If an image is installed and no local
|
||||
Instance exists yet, offer `Run Agent Zero`. If a local Instance already
|
||||
exists, offer `Continue`.
|
||||
- Visible setup titles and transient progress states should use `Setup`, not
|
||||
`Set up`, `Set Up`, or `Setting up`; button labels that advance runtime setup
|
||||
should use `Continue`.
|
||||
- If two or more distinct reachable local Docker daemon identities are detected
|
||||
during setup completion, the same modal may show a compact `Run Agent Zero
|
||||
with` selector. The same one-time selector should appear on first launch when
|
||||
multiple daemons are already reachable and no preference exists. Endpoint
|
||||
aliases for one daemon and reachable endpoints without a verified daemon ID
|
||||
must not trigger the selector. Hide it for zero or one verified daemon, and do
|
||||
not add a runtime picker to Settings or the global chrome.
|
||||
- An installed stopped Docker Desktop may be the second selector choice beside
|
||||
a verified reachable daemon. Label it as stopped, change the primary action
|
||||
to `Start Docker Desktop` while selected, and keep runtime startup progress or
|
||||
failure in the blocking modal until Docker Desktop is verified.
|
||||
- Post-runtime image installs, activation, rollback, start, stop, and delete
|
||||
progress should use the centered operation modal rather than a top-page
|
||||
status strip.
|
||||
All image installs may offer `Download in background`, which moves
|
||||
that operation into the same progress toast without stopping the download.
|
||||
- Local instance card `Start`, `Stop`, `Restart`, and `Delete` are the exception:
|
||||
they are accepted as background queued per-container actions so a slow or
|
||||
hanging container mutation does not block the rest of the launcher. Show
|
||||
only the affected card as queued/running and report failures with toast feedback.
|
||||
- The Agent Zero setup slideshow belongs only to the image pull/extract wait in
|
||||
the install operation modal. Do not show it during Docker runtime setup or
|
||||
short preflight checks. Slides should use renderer-visible still image assets
|
||||
so the blocking install modal never depends on video playback to show
|
||||
meaningful media.
|
||||
- First Instance name, credential, model, storage, port, and environment
|
||||
choices belong to the normal Create local Instance dialog. On first image
|
||||
pull, the operation modal should not show a separate launch wizard, model
|
||||
defaults panel, workspace storage step, or "start my first Instance" checkbox.
|
||||
Starting after a pull is automatic only for the submitted Create local
|
||||
Instance form. First-run image pulls may use `Download in background`,
|
||||
including during extraction, and their modal copy must say `Install`
|
||||
/ `Installing`; channel pulls for an existing local image say `Update` /
|
||||
`Updating`.
|
||||
- Active modal progress should show the current phase once, in the progress
|
||||
header above the bar. Do not repeat the same phase as body detail under the
|
||||
modal title.
|
||||
- Keep the Colima fallback checklist aligned with the shell's client preparation,
|
||||
component installation, runtime start, and verification phases. Image-pull
|
||||
percentages and ETAs describe the visible phase; extraction must not inherit
|
||||
the completed download percentage or its elapsed time.
|
||||
Keep operation progress outside the scrolling slideshow/form body so its
|
||||
percentage and ETA remain visible in short windows.
|
||||
- Running runtime progress updates the existing modal in place, preserving
|
||||
keyboard focus and the expanded `See more` checklist across events.
|
||||
- Operation progress should keep actionable recovery affordances for
|
||||
user-fixable failures. For Docker Hub pull-rate limits, keep the error
|
||||
visible and offer the shell-owned Docker sign-in wrapper plus retry instead
|
||||
of a dead-end message.
|
||||
- Operation progress failures must remain visible with the stable
|
||||
renderer-facing error message after the async operation finishes.
|
||||
- Operation progress may show a cancel action only when the Docker Manager
|
||||
progress payload marks the current phase as cancelable.
|
||||
- Official version cards must distinguish available, installable, installed,
|
||||
active, visible channel tags (`latest`, `ready`), local builds, matching
|
||||
digest, and differing digest states without exposing raw Docker mechanics as
|
||||
the main story. Fresh machines must have a visible install action once Docker
|
||||
is ready. The `latest` and `ready` cards should show channel update dates
|
||||
when Docker Manager provides them, falling back to the matched numbered
|
||||
release date when available. Their primary card meta should stay compact:
|
||||
visible date plus size only, even when structured match/digest hints are
|
||||
present in state. Numbered release cards should be grouped by major version,
|
||||
with every numbered series collapsed by default so only pinned channel cards
|
||||
such as `latest` and `ready` are immediately visible. The
|
||||
unmaintained `testing` tag is intentionally hidden from the Versions view.
|
||||
The Versions view may offer an `All` / `Installed` filter; `Installed` should
|
||||
keep entries that already have a local image, differ from the published
|
||||
digest, are active, or are currently installing.
|
||||
Shared Instance and Version card visuals should keep title glows unclipped
|
||||
and avoid inset divider lines inside the colored artwork area.
|
||||
- Running an installed tag from Versions creates another managed local instance
|
||||
and must not stop existing instances or require a data-loss acknowledgement.
|
||||
Stale installed tags should keep `Run` visible; updating belongs on the
|
||||
specific Instance card. After the run operation reports completed with the
|
||||
UI-ready marker, the renderer should switch to the Instances tab so the new
|
||||
managed Instance is visible.
|
||||
Removing an installed tag must go through Docker Manager image removal and
|
||||
must be non-forced so Docker refuses images still used by an Instance.
|
||||
Destructive switch, update, and retained-instance activation flows must keep
|
||||
the backup/proceed acknowledgement.
|
||||
- Activation may offer optional model provider/model/API-key helpers under
|
||||
Advanced as `Choose your models`, compile helpers to Agent Zero environment
|
||||
defaults, save edited helpers as Instance Defaults for future runs, and
|
||||
preserve Advanced environment variables as the explicit escape hatch.
|
||||
Activation may also offer optional web login
|
||||
username/password helpers that compile to Agent Zero auth environment
|
||||
defaults; blank values must preserve Agent Zero's normal onboarding/default
|
||||
behavior.
|
||||
- Port mappings and environment text stay advanced activation inputs. They
|
||||
should not become a required path for normal users.
|
||||
- Advanced activation may expose a storage override, but it should name concrete
|
||||
outcomes instead of internal preferences: create a folder named after the
|
||||
Instance, choose a custom folder, or use a named Docker volume. The named
|
||||
Instance folder under the default workspace root should be first/default.
|
||||
- The Advanced tab exposes a file-first Docker workspace in the Developer
|
||||
sub-tab. Open project folders or individual root files through native shell
|
||||
dialogs; edit Dockerfiles, Compose YAML, `.dockerignore`, and `.env.example`
|
||||
with the bundled Ace editor; keep Save distinct from Export; and validate or
|
||||
run only the fixed Build, Up, Stop, Logs, and Down intents through Docker
|
||||
Manager IPC. The project root is the build context, Down keeps storage
|
||||
volumes, opening another project or closing with unsaved edits warns first,
|
||||
and renderer state receives opaque project tokens rather than host paths.
|
||||
Keep custom image, tag, environment, port, and mount execution as the
|
||||
collapsed quick-run path. Never expose a generic command runner or a
|
||||
runtime-candidate browser.
|
||||
- Advanced should keep developer controls and their related Compose editing
|
||||
together in the Developer sub-tab. Diagnostics and Storage volumes remain
|
||||
separate sub-tabs so the page avoids multiple boxed panels at once.
|
||||
- Advanced sub-tabs should keep the Advanced page header and tab strip fixed in
|
||||
the launcher shell. Put overflow inside the active Advanced panel instead of
|
||||
relying on document-level scrolling.
|
||||
- Advanced diagnostics should render structured Docker runtime facts from
|
||||
Docker Manager state as report-style rows, not metric-card grids or
|
||||
renderer-inferred runtime guesses.
|
||||
- The Instances tab owns both local Docker containers and saved remote
|
||||
instances. Visible copy must say `Instances`, not `Sessions`.
|
||||
Normal Create local Instance choices list only Agent Zero releases and local
|
||||
Agent Zero builds. Arbitrary Docker images stay in Advanced developer
|
||||
controls; Compose-created Agent Zero containers are still detected from their
|
||||
`/exe/initialize.sh` entrypoint and retain their container identity on cards.
|
||||
When the first inventory has loaded and there are no local or saved remote
|
||||
Instances, show a centered Create local Instance action that opens the normal
|
||||
creation dialog.
|
||||
The Instances header may expose `Create local Instance` beside `Add remote
|
||||
Instance`. Creating a local Instance should list installed versions only, then
|
||||
use the same activation defaults dialog as Versions so local instance name,
|
||||
login, model, storage, port, and environment handling stays consistent.
|
||||
- Local instance cards keep `Open UI` or `Start` as the visible primary action.
|
||||
Any stopped local Agent Zero container listed by Docker Manager may expose
|
||||
`Start`; do not require newer launcher-managed labels just to start it.
|
||||
The component may log a de-duplicated card-action diagnostic snapshot to the
|
||||
renderer console when the Instances card state changes; keep it bounded to
|
||||
visible card/action/version fields and never include credentials.
|
||||
Secondary management and inspection actions such as `Rename`, `See logs`,
|
||||
`Open storage folder`, `Clone`, `Open A0 CLI`, `Restart`, dynamic
|
||||
`Start`/`Stop`, and `Delete` belong in the card overflow menu so they always
|
||||
apply to the specific instance shown. Local Instance deletion must use a
|
||||
launcher dialog, not a native confirm; when persistent `/a0/usr` storage is known, the dialog
|
||||
should offer explicit keep/delete storage choices and a host-folder opener
|
||||
only for host-backed storage.
|
||||
The visual header area of a running local card or saved remote card may
|
||||
mirror `Open UI`; the body/meta area should stay ordinary selectable text so
|
||||
values such as URLs remain easy to copy.
|
||||
The card overflow menu should choose its up/down direction from available
|
||||
viewport space, reserve any fixed bottom launcher chrome, and use bounded
|
||||
internal scrolling when the window is short.
|
||||
Show `Install A0 CLI` on local and saved remote Instance cards only while the
|
||||
system CLI is missing, then replace it with `Open A0 CLI`. Open should let the
|
||||
shell show the native working-folder picker before terminal launch; canceling
|
||||
that picker should not display an error. Disable it while CLI maintenance is
|
||||
running.
|
||||
Clone opens a quiet confirmation dialog with `/a0/usr` category choices hidden
|
||||
in a disclosure by default; all categories are selected by default to match
|
||||
Agent Zero backup behavior, while clearing all categories intentionally
|
||||
creates a fresh empty workspace. Keep Agent profiles as their own category for
|
||||
`/a0/usr/agents`, separate from generic workspace files. Clone and
|
||||
persistence-migration entry points must warn that the source container is
|
||||
paused and resumed, and that running AI work stops and must be resumed
|
||||
manually.
|
||||
- Local and saved remote Instance cards should use the launcher-visible name,
|
||||
saved colour, and saved tab icon as visual identity. Prefer the last valid
|
||||
runtime version reported by Agent Zero health metadata, including branch and
|
||||
commits since release, then fall back to matched or concrete image provenance. Keep the
|
||||
metadata compact: show runtime branch/commit first, put the URL on its own
|
||||
line, and avoid listing routine `image latest` or persistent workspace
|
||||
fragments in the primary card text.
|
||||
- Local instance cards may show an `Update` action when the runtime release tag,
|
||||
matched channel release, or concrete image release is older than the newest
|
||||
official release in Docker Manager state. The action must start stopped
|
||||
Instances through the normal card-local start flow and, for running Instances,
|
||||
open Agent Zero's self-update page instead of performing backend update work
|
||||
in the launcher.
|
||||
- Local instance cards should keep workspace state quiet. Persistent host
|
||||
directories, named volumes, custom mounts, and legacy ephemeral workspaces
|
||||
should be distinguishable through relevant controls and storage affordances
|
||||
without turning Docker storage into the primary card story. Intentionally
|
||||
ephemeral workspaces should not be labeled legacy.
|
||||
- `Open storage folder` should appear only for persistent workspace storage
|
||||
that exposes an actual host directory path. Do not show it for named Docker
|
||||
volumes when the host file manager cannot open a stable user-facing folder.
|
||||
- Repo-mounted `/a0` Instances may open the nested host `usr` folder, but custom
|
||||
mounts must not offer launcher storage deletion.
|
||||
- `Persist a0/usr data` belongs in the local instance overflow menu only when
|
||||
the Docker Manager marks the container as legacy or non-persistent. The
|
||||
action must call a named renderer action, keep the old container retained
|
||||
until the shell operation succeeds, and show a completion dialog reminding the
|
||||
user to verify the new persistent Instance before deleting the old one.
|
||||
- Renaming a local instance changes the launcher-visible display name. It must
|
||||
not rely on mutating existing Docker labels, because Docker labels are
|
||||
immutable after container creation.
|
||||
- Selecting an Instance Colour/Icon changes only launcher metadata and should
|
||||
use the same bounded palette, default Favicon choice, and 14 custom icons for
|
||||
local and saved remote Instances. Empty icon IDs follow the current favicon;
|
||||
explicit `language` retains Globe. Preview the open Instance's shell-provided
|
||||
favicon in the picker, falling back to the bundled Agent Zero symbol.
|
||||
Upload image adds a previewed custom choice using the shell's native chooser.
|
||||
Keep a uniform four-column icon grid: Upload image and Favicon occupy the
|
||||
first two cells, followed by the built-in icons. An uploaded image stays in
|
||||
that same cell with a separate accessible Replace control; never widen the
|
||||
Favicon or upload tiles or move upload below the grid.
|
||||
Decode image/SVG data as an image and rasterize to a 96-pixel PNG; never insert
|
||||
uploaded SVG markup into the document. Save persists that bounded image copy
|
||||
through the existing appearance action; cancel or invalid files preserve the
|
||||
previous saved icon. The picker can replace an uploaded image or return to
|
||||
Favicon or a built-in icon.
|
||||
Custom comes first in the colour grid and opens a native colour input. Persist
|
||||
only normalized six-digit RGB hex values alongside the existing preset IDs;
|
||||
choosing a preset or Automatic replaces the custom colour through normal Save.
|
||||
Saved custom icons take precedence over favicon updates; image colours stay
|
||||
intact while the selected Launcher colour accents their tab button background.
|
||||
The active tab icon opens the same picker as the card menu; compact
|
||||
mode hides both Instance names and the Launcher label. Do not persist raw CSS,
|
||||
other CSS colour expressions, raw icon markup, host paths, or Docker labels for this preference.
|
||||
- Saved remote URL-only instance cards must not expose Docker mutation actions.
|
||||
Their footer status should display the Docker Manager-provided remote health
|
||||
state as `Online`, `Offline`, or `Checking`, not a generic `Remote` tag.
|
||||
Remote `Open A0 CLI` must pass only the saved remote Instance ID to the
|
||||
renderer action; shell code resolves and validates the URL.
|
||||
Saved remote deletion must use a launcher dialog and make clear that it only
|
||||
removes the saved launcher entry.
|
||||
A saved remote card may show `Clone locally` only when its URL is loopback
|
||||
(`localhost`, `127.0.0.1`, or IPv6 loopback) and the port matches a discovered
|
||||
local Docker container; the action must clone that local container.
|
||||
- Clone should explain that it reuses the source image and copies selected
|
||||
`/a0/usr` data; ordinary cloning does not pause or snapshot the source.
|
||||
- The local instance log viewer is a bottom popover panel driven by bounded
|
||||
Docker Manager log snapshots. It must stay read-only and must not expose a
|
||||
generic Docker command surface.
|
||||
- Backup and Restore belong in the local instance overflow menu. Backup creates
|
||||
a core-compatible `.zip` for `/a0/usr`; Restore accepts that same backup
|
||||
shape and writes only into `/a0/usr`, with user confirmation before starting.
|
||||
- Retained instances are rollback candidates; storage-volume cleanup belongs in
|
||||
Advanced and must remain clearly separate from instance start/stop actions.
|
||||
- Storage UI must say `Storage volumes` when referring to Docker volumes.
|
||||
Workspace storage preferences belong in Settings, not the Advanced storage
|
||||
tab. Copy should distinguish workspace directories from Docker named volumes.
|
||||
Host directory mapping should make clear whether the selected folder is a
|
||||
parent for per-Instance workspaces or the exact folder mounted at `/a0/usr`.
|
||||
- Settings owns persistence for preferred UI/SSH ports and Instance
|
||||
provider/model defaults plus workspace storage and Host access defaults. The
|
||||
Instance defaults tab must expose the same master state, five permissions,
|
||||
and fallback folder used by Create Instance, preserve hidden
|
||||
browser-profile state, and save them through the page's single Save action.
|
||||
Do not scatter persistent default controls into install or instance cards
|
||||
except for the first-pull defaults prompt.
|
||||
Its single visible save action should persist every Settings sub-tab, including
|
||||
edited fields in inactive panels.
|
||||
Save them through one combined Settings intent and state-file write, preserve
|
||||
per-section success and dirty state when port validation fails, and finish
|
||||
from the returned state without unrelated Docker, release, or registry
|
||||
discovery.
|
||||
- Settings also owns the default-off A0 Tag section: one exact saved Instance,
|
||||
one live profile key, the fixed shortcut display, and bounded lease status.
|
||||
It inherits the selected Instance gateway permissions rather than rendering a
|
||||
second permission matrix. Copy should explain that valid inline tags replace
|
||||
safely while the same shortcut opens the shell-owned command palette in apps
|
||||
without a safe editable range. Save it with every other Settings panel
|
||||
through the same combined intent, including edits made while its panel is
|
||||
inactive.
|
||||
- `Open UI` opens local and remote instances in a launcher tab by default.
|
||||
Reopening the same target focuses the existing tab. Detach moves the existing
|
||||
page view below the same Launcher header in a standalone secure Electron
|
||||
window without stopping the instance or its live Host access lease; reattach
|
||||
moves it back without reload, and closing that window ends the lease.
|
||||
- A newly opened attached or detached Instance tab shows centered loading
|
||||
feedback until its first page load finishes; its loading icon rotates while
|
||||
the tab is loading.
|
||||
- Instance tab chrome keeps a Launcher tab as the first tab whenever any
|
||||
instance UI tab is open. Selecting Launcher clears the active shell-owned
|
||||
view and leaves the launcher surface usable below the tab strip.
|
||||
Dragging an attached tab label reorders attached tabs; releasing it outside
|
||||
the strip uses the existing shell-owned detach path. After the drag threshold,
|
||||
temporarily hide the active native view so it cannot intercept the gesture;
|
||||
restore its bounds on reorder or cancellation. Keep the real tab stationary
|
||||
during the gesture and show a floating tab copy plus an insertion marker.
|
||||
Connected instance tabs should display only the tab/instance name, not the
|
||||
URL, so short names stay compact in the tab strip.
|
||||
- Each Instance tab shows a separately accessible computer button immediately
|
||||
after its name. The icon is green only while Connected and grey otherwise;
|
||||
clicking it opens the Launcher-owned settings modal. A header control may
|
||||
collapse Instance names to their selected icon and computer icons. Opening settings
|
||||
must keep that Instance
|
||||
selected, temporarily hiding only the shell-owned view while the Launcher
|
||||
modal is open and restoring it when the modal closes. Agent Zero pages expose
|
||||
no Host access menu or controls. Instance cards must not repeat the Host access
|
||||
icon or settings button; connection and scope changes belong in an open
|
||||
Launcher Instance tab or its detached Launcher window.
|
||||
Remote Instances stay configured off by default, but an unset folder in their
|
||||
Host access
|
||||
dialog is prefilled from the Launcher default for a first opt-in.
|
||||
- File read and file write are separate permissions. Write depends on read,
|
||||
and Code execution depends on write. Permission choices render as a compact
|
||||
icon/title/description list inside a native disclosure that starts collapsed;
|
||||
its summary must always identify whether Browser and Computer Use are on or
|
||||
off so those opt-in controls remain discoverable. Summarize all five
|
||||
permissions while Host access is on, show only that Host access is off when
|
||||
the master switch is off, place that master switch and the folder field inside
|
||||
the same disclosure, and keep live Disconnect/Reconnect beside the connection
|
||||
status. Use Agent Zero-style switch controls in every Host access view.
|
||||
Create/Add Instance is the single initial Host access choice and must not be
|
||||
followed by a global onboarding prompt. New local Instances inherit the
|
||||
Settings default, while new remote Instances require their own explicit
|
||||
choice. Browser and Computer Use start opt-in. Do not add a CLI installation
|
||||
helper to Create/Add Instance or Host access settings; Launcher owns CLI
|
||||
preparation independently of permission opt-in.
|
||||
One Agent Zero-style switch owns the persisted master permission state and
|
||||
visibly disables its dependent permissions. Call the selected path the folder
|
||||
for files and commands, explain both roles in plain language, and make
|
||||
clear that commands may use other locations available to the Launcher user.
|
||||
Keep browser selection and Connection/Computer Use diagnostics in a collapsed
|
||||
Advanced settings disclosure with a short summary.
|
||||
Browser preparation and Computer Use permission failures are Needs action
|
||||
states, not silent browser relaunches or hidden permission grants. A Needs
|
||||
action summary must show the concrete browser, permission, restart, or runtime
|
||||
reason in the visible modal body; do not substitute generic tab-lease copy in
|
||||
a modal that is already opened from the owning Instance tab. A missing host
|
||||
Browser dependency must become a concise `Set up browser` repair action; do
|
||||
not hide that action merely because no supported host browser is currently
|
||||
detected, and do not send Launcher users to an A0 CLI slash command. Safari
|
||||
setup must name Show features for web developers in Safari's Advanced
|
||||
settings, then Allow remote automation in Developer settings;
|
||||
Chromium-family setup keeps its browser-specific remote-debugging guidance.
|
||||
Hide
|
||||
Browser support diagnostics and repair actions while the current modal choice
|
||||
does not allow `Use my Browser`; retained runtime metadata must not imply that
|
||||
Browser is required. Render a saved capability choice independently from
|
||||
runtime readiness as `Not allowed`, `Allowed · Setup needed`, `Allowed ·
|
||||
Checking`, or `Allowed · Ready`; runtime metadata must never turn an allowed
|
||||
switch off. Computer Use checking copy must follow the advertised backend;
|
||||
macOS permission wording is valid only for a macOS backend, while other
|
||||
backends use neutral Computer Use copy unless they provide something more
|
||||
specific. When Computer Use is newly enabled on macOS, open the staged setup
|
||||
surface after the gateway connects.
|
||||
Later launches preflight silently, with one explicit retry or restart action
|
||||
when required. Name the pending macOS service on that action (`Open
|
||||
Accessibility Settings`, `Allow Screen Recording`, or `Check Computer Use`)
|
||||
instead of repeating a generic permission button. Present capability metadata
|
||||
as human labels and offer Computer
|
||||
Use setup only for actionable approval, rearm, restart, or error states—not
|
||||
healthy trust modes.
|
||||
Compatibility copy must name advertised Launcher gateway support rather than
|
||||
assume a specific A0 CLI release number.
|
||||
- Local creation defaults channel updates on for `latest` and `ready`; users may
|
||||
turn the checkbox off when they intentionally want the installed channel image.
|
||||
- Runtime setup should stay transparent without becoming a feature showcase. Use the `See more` disclosure for structured setup phases when detailed progress is available.
|
||||
- Runtime setup success should stay in the same modal shell long enough to guide the next step without implying Agent Zero is still missing. If no Agent Zero image is installed, offer a `Download Agent Zero` image action with a selector defaulting to `latest`. If an image is installed and no local Instance exists yet, offer `Run Agent Zero`. If a local Instance already exists, offer `Continue`.
|
||||
- Visible setup titles and transient progress states should use `Setup`, not `Set up`, `Set Up`, or `Setting up`; button labels that advance runtime setup should use `Continue`.
|
||||
- If two or more distinct reachable local Docker daemon identities are detected during setup completion, the same modal may show a compact `Run Agent Zero with` selector. The same one-time selector should appear on first launch when multiple daemons are already reachable and no preference exists. Endpoint aliases for one daemon and reachable endpoints without a verified daemon ID must not trigger the selector. Hide it for zero or one verified daemon, and do not add a runtime picker to Settings or the global chrome.
|
||||
- An installed stopped Docker Desktop may be the second selector choice beside a verified reachable daemon. Label it as stopped, change the primary action to `Start Docker Desktop` while selected, and keep runtime startup progress or failure in the blocking modal until Docker Desktop is verified.
|
||||
- Post-runtime image installs, activation, rollback, start, stop, and delete progress should use the centered operation modal rather than a top-page status strip. All image installs may offer `Download in background`, which moves that operation into the same progress toast without stopping the download.
|
||||
- Local instance card `Start`, `Stop`, `Restart`, and `Delete` are the exception: they are accepted as background queued per-container actions so a slow or hanging container mutation does not block the rest of the launcher. Show only the affected card as queued/running and report failures with toast feedback.
|
||||
- The Agent Zero setup slideshow belongs only to the image pull/extract wait in the install operation modal. Do not show it during Docker runtime setup or short preflight checks. Slides should use renderer-visible still image assets so the blocking install modal never depends on video playback to show meaningful media.
|
||||
- First Instance name, credential, model, storage, port, and environment choices belong to the normal Create local Instance dialog. On first image pull, the operation modal should not show a separate launch wizard, model defaults panel, workspace storage step, or "start my first Instance" checkbox. Starting after a pull is automatic only for the submitted Create local Instance form. First-run image pulls may use `Download in background`, including during extraction, and their modal copy must say `Install` / `Installing`; channel pulls for an existing local image say `Update` / `Updating`.
|
||||
- Active modal progress should show the current phase once, in the progress header above the bar. Do not repeat the same phase as body detail under the modal title.
|
||||
- Keep the Colima fallback checklist aligned with the shell's client preparation, component installation, runtime start, and verification phases. Image-pull percentages and ETAs describe the visible phase; extraction must not inherit the completed download percentage or its elapsed time. Keep operation progress outside the scrolling slideshow/form body so its percentage and ETA remain visible in short windows.
|
||||
- Running runtime progress updates the existing modal in place, preserving keyboard focus and the expanded `See more` checklist across events.
|
||||
- Operation progress should keep actionable recovery affordances for user-fixable failures. For Docker Hub pull-rate limits, keep the error visible and offer the shell-owned Docker sign-in wrapper plus retry instead of a dead-end message.
|
||||
- Operation progress failures must remain visible with the stable renderer-facing error message after the async operation finishes.
|
||||
- Operation progress may show a cancel action only when the Docker Manager progress payload marks the current phase as cancelable.
|
||||
- Official version cards must distinguish available, installable, installed, active, visible channel tags (`latest`, `ready`), local builds, matching digest, and differing digest states without exposing raw Docker mechanics as the main story. Fresh machines must have a visible install action once Docker is ready. The `latest` and `ready` cards should show channel update dates when Docker Manager provides them, falling back to the matched numbered release date when available. Their primary card meta should stay compact: visible date plus size only, even when structured match/digest hints are present in state. Numbered release cards should be grouped by major version, with every numbered series collapsed by default so only pinned channel cards such as `latest` and `ready` are immediately visible. The unmaintained `testing` tag is intentionally hidden from the Versions view. The Versions view may offer an `All` / `Installed` filter; `Installed` should keep entries that already have a local image, differ from the published digest, are active, or are currently installing. Shared Instance and Version card visuals should keep title glows unclipped and avoid inset divider lines inside the colored artwork area.
|
||||
- Running an installed tag from Versions creates another managed local instance and must not stop existing instances or require a data-loss acknowledgement. Stale installed tags should keep `Run` visible; updating belongs on the specific Instance card. After the run operation reports completed with the UI-ready marker, the renderer should switch to the Instances tab so the new managed Instance is visible. Removing an installed tag must go through Docker Manager image removal and must be non-forced so Docker refuses images still used by an Instance. Destructive switch, update, and retained-instance activation flows must keep the backup/proceed acknowledgement.
|
||||
- Activation may offer optional model provider/model/API-key helpers under Advanced as `Choose your models`, compile helpers to Agent Zero environment defaults, save edited helpers as Instance Defaults for future runs, and preserve Advanced environment variables as the explicit escape hatch. Activation may also offer optional web login username/password helpers that compile to Agent Zero auth environment defaults; blank values must preserve Agent Zero's normal onboarding/default behavior.
|
||||
- Port mappings and environment text stay advanced activation inputs. They should not become a required path for normal users.
|
||||
- Advanced activation may expose a storage override, but it should name concrete outcomes instead of internal preferences: create a folder named after the Instance, choose a custom folder, or use a named Docker volume. The named Instance folder under the default workspace root should be first/default.
|
||||
- The Advanced tab exposes a file-first Docker workspace in the Developer sub-tab. Open project folders or individual root files through native shell dialogs; edit Dockerfiles, Compose YAML, `.dockerignore`, and `.env.example` with the bundled Ace editor; keep Save distinct from Export; and validate or run only the fixed Build, Up, Stop, Logs, and Down intents through Docker Manager IPC. The project root is the build context, Down keeps storage volumes, opening another project or closing with unsaved edits warns first, and renderer state receives opaque project tokens rather than host paths. Keep custom image, tag, environment, port, and mount execution as the collapsed quick-run path. Never expose a generic command runner or a runtime-candidate browser.
|
||||
- Advanced should keep developer controls and their related Compose editing together in the Developer sub-tab. Diagnostics and Storage volumes remain separate sub-tabs so the page avoids multiple boxed panels at once.
|
||||
- Advanced sub-tabs should keep the Advanced page header and tab strip fixed in the launcher shell. Put overflow inside the active Advanced panel instead of relying on document-level scrolling.
|
||||
- Advanced diagnostics should render structured Docker runtime facts from Docker Manager state as report-style rows, not metric-card grids or renderer-inferred runtime guesses.
|
||||
- The Instances tab owns both local Docker containers and saved remote instances. Visible copy must say `Instances`, not `Sessions`. Normal Create local Instance choices list only Agent Zero releases and local Agent Zero builds. Arbitrary Docker images stay in Advanced developer controls; Compose-created Agent Zero containers are still detected from their `/exe/initialize.sh` entrypoint and retain their container identity on cards. When the first inventory has loaded and there are no local or saved remote Instances, show a centered Create local Instance action that opens the normal creation dialog. The Instances header may expose `Create local Instance` beside `Add remote Instance`. Creating a local Instance should list installed versions only, then use the same activation defaults dialog as Versions so local instance name, login, model, storage, port, and environment handling stays consistent.
|
||||
- Local instance cards keep `Open UI` or `Start` as the visible primary action. Any stopped local Agent Zero container listed by Docker Manager may expose `Start`; do not require newer launcher-managed labels just to start it. The component may log a de-duplicated card-action diagnostic snapshot to the renderer console when the Instances card state changes; keep it bounded to visible card/action/version fields and never include credentials. Secondary management and inspection actions such as `Rename`, `See logs`, `Open storage folder`, `Clone`, `Open A0 CLI`, `Restart`, dynamic `Start`/`Stop`, and `Delete` belong in the card overflow menu so they always apply to the specific instance shown. Local Instance deletion must use a launcher dialog, not a native confirm; when persistent `/a0/usr` storage is known, the dialog should offer explicit keep/delete storage choices and a host-folder opener only for host-backed storage. The visual header area of a running local card or saved remote card may mirror `Open UI`; the body/meta area should stay ordinary selectable text so values such as URLs remain easy to copy. The card overflow menu should choose its up/down direction from available viewport space, reserve any fixed bottom launcher chrome, and use bounded internal scrolling when the window is short. Show `Install A0 CLI` on local and saved remote Instance cards only while the system CLI is missing, then replace it with `Open A0 CLI`. Open should let the shell show the native working-folder picker before terminal launch; canceling that picker should not display an error. Disable it while CLI maintenance is running. Clone opens a quiet confirmation dialog with `/a0/usr` category choices hidden in a disclosure by default; all categories are selected by default to match Agent Zero backup behavior, while clearing all categories intentionally creates a fresh empty workspace. Keep Agent profiles as their own category for `/a0/usr/agents`, separate from generic workspace files. Clone and persistence-migration entry points must warn that the source container is paused and resumed, and that running AI work stops and must be resumed manually.
|
||||
- Local and saved remote Instance cards should use the launcher-visible name, saved colour, and saved tab icon as visual identity. Prefer the last valid runtime version reported by Agent Zero health metadata, including branch and commits since release, then fall back to matched or concrete image provenance. Keep the metadata compact: show runtime branch/commit first, put the URL on its own line, and avoid listing routine `image latest` or persistent workspace fragments in the primary card text.
|
||||
- Local instance cards may show an `Update` action when the runtime release tag, matched channel release, or concrete image release is older than the newest official release in Docker Manager state. The action must start stopped Instances through the normal card-local start flow and, for running Instances, open Agent Zero's self-update page instead of performing backend update work in the launcher.
|
||||
- Local instance cards should keep workspace state quiet. Persistent host directories, named volumes, custom mounts, and legacy ephemeral workspaces should be distinguishable through relevant controls and storage affordances without turning Docker storage into the primary card story. Intentionally ephemeral workspaces should not be labeled legacy.
|
||||
- `Open storage folder` should appear only for persistent workspace storage that exposes an actual host directory path. Do not show it for named Docker volumes when the host file manager cannot open a stable user-facing folder.
|
||||
- Repo-mounted `/a0` Instances may open the nested host `usr` folder, but custom mounts must not offer launcher storage deletion.
|
||||
- `Persist a0/usr data` belongs in the local instance overflow menu only when the Docker Manager marks the container as legacy or non-persistent. The action must call a named renderer action, keep the old container retained until the shell operation succeeds, and show a completion dialog reminding the user to verify the new persistent Instance before deleting the old one.
|
||||
- Renaming a local instance changes the launcher-visible display name. It must not rely on mutating existing Docker labels, because Docker labels are immutable after container creation.
|
||||
- Selecting an Instance Colour/Icon changes only launcher metadata and should use the same bounded palette, default Favicon choice, and 14 custom icons for local and saved remote Instances. Empty icon IDs follow the current favicon; explicit `language` retains Globe. Preview the open Instance's shell-provided favicon in the picker, falling back to the bundled Agent Zero symbol. Upload image adds a previewed custom choice using the shell's native chooser. Keep a uniform four-column icon grid: Upload image and Favicon occupy the first two cells, followed by the built-in icons. An uploaded image stays in that same cell with a separate accessible Replace control; never widen the Favicon or upload tiles or move upload below the grid. Decode image/SVG data as an image and rasterize to a 96-pixel PNG; never insert uploaded SVG markup into the document. Save persists that bounded image copy through the existing appearance action; cancel or invalid files preserve the previous saved icon. The picker can replace an uploaded image or return to Favicon or a built-in icon. Custom comes first in the colour grid and opens a native colour input. Persist only normalized six-digit RGB hex values alongside the existing preset IDs; choosing a preset or Automatic replaces the custom colour through normal Save. Saved custom icons take precedence over favicon updates; image colours stay intact while the selected Launcher colour accents their tab button background. The active tab icon opens the same picker as the card menu; compact mode hides both Instance names and the Launcher label. Do not persist raw CSS, other CSS colour expressions, raw icon markup, host paths, or Docker labels for this preference.
|
||||
- Saved remote URL-only instance cards must not expose Docker mutation actions. Their footer status should display the Docker Manager-provided remote health state as `Online`, `Offline`, or `Checking`, not a generic `Remote` tag. Remote `Open A0 CLI` must pass only the saved remote Instance ID to the renderer action; shell code resolves and validates the URL. Saved remote deletion must use a launcher dialog and make clear that it only removes the saved launcher entry. A saved remote card may show `Clone locally` only when its URL is loopback (`localhost`, `127.0.0.1`, or IPv6 loopback) and the port matches a discovered local Docker container; the action must clone that local container.
|
||||
- Clone should explain that it reuses the source image and copies selected `/a0/usr` data; ordinary cloning does not pause or snapshot the source.
|
||||
- The local instance log viewer is a bottom popover panel driven by bounded Docker Manager log snapshots. It must stay read-only and must not expose a generic Docker command surface.
|
||||
- Backup and Restore belong in the local instance overflow menu. Backup creates a core-compatible `.zip` for `/a0/usr`; Restore accepts that same backup shape and writes only into `/a0/usr`, with user confirmation before starting.
|
||||
- Retained instances are rollback candidates; storage-volume cleanup belongs in Advanced and must remain clearly separate from instance start/stop actions.
|
||||
- Storage UI must say `Storage volumes` when referring to Docker volumes. Workspace storage preferences belong in Settings, not the Advanced storage tab. Copy should distinguish workspace directories from Docker named volumes. Host directory mapping should make clear whether the selected folder is a parent for per-Instance workspaces or the exact folder mounted at `/a0/usr`.
|
||||
- Settings owns persistence for preferred UI/SSH ports and Instance provider/model defaults plus workspace storage and Host access defaults. The Instance defaults tab must expose the same master state, five permissions, and fallback folder used by Create Instance, preserve hidden browser-profile state, and save them through the page's single Save action. Do not scatter persistent default controls into install or instance cards except for the first-pull defaults prompt. Its single visible save action should persist every Settings sub-tab, including edited fields in inactive panels. Save them through one combined Settings intent and state-file write, preserve per-section success and dirty state when port validation fails, and finish from the returned state without unrelated Docker, release, or registry discovery.
|
||||
- Settings also owns the default-off A0 Tag section: one exact saved Instance, one live profile key, the fixed shortcut display, and bounded lease status. It inherits the selected Instance gateway permissions rather than rendering a second permission matrix. Copy should explain that valid inline tags replace safely while the same shortcut opens the shell-owned command palette in apps without a safe editable range. Save it with every other Settings panel through the same combined intent, including edits made while its panel is inactive.
|
||||
- `Open UI` opens local and remote instances in a launcher tab by default. Reopening the same target focuses the existing tab. Detach moves the existing page view below the same Launcher header in a standalone secure Electron window without stopping the instance or its live Host access lease; reattach moves it back without reload, and closing that window ends the lease.
|
||||
- A newly opened attached or detached Instance tab shows centered loading feedback until its first page load finishes; its loading icon rotates while the tab is loading.
|
||||
- Instance tab chrome keeps a Launcher tab as the first tab whenever any instance UI tab is open. Selecting Launcher clears the active shell-owned view and leaves the launcher surface usable below the tab strip. Dragging an attached tab label reorders attached tabs; releasing it outside the strip uses the existing shell-owned detach path. After the drag threshold, temporarily hide the active native view so it cannot intercept the gesture; restore its bounds on reorder or cancellation. Keep the real tab stationary during the gesture and show a floating tab copy plus an insertion marker. Connected instance tabs should display only the tab/instance name, not the URL, so short names stay compact in the tab strip.
|
||||
- Each Instance tab shows a separately accessible computer button immediately after its name. The icon is green only while Connected and grey otherwise; clicking it opens the Launcher-owned settings modal. A header control may collapse Instance names to their selected icon and computer icons. Opening settings must keep that Instance selected, temporarily hiding only the shell-owned view while the Launcher modal is open and restoring it when the modal closes. Agent Zero pages expose no Host access menu or controls. Instance cards must not repeat the Host access icon or settings button; connection and scope changes belong in an open Launcher Instance tab or its detached Launcher window. Remote Instances stay configured off by default, but an unset folder in their Host access dialog is prefilled from the Launcher default for a first opt-in.
|
||||
- File read and file write are separate permissions. Write depends on read, and Code execution depends on write. Permission choices render as a compact icon/title/description list inside a native disclosure that starts collapsed; its summary must always identify whether Browser and Computer Use are on or off so those opt-in controls remain discoverable. Summarize all five permissions while Host access is on, show only that Host access is off when the master switch is off, place that master switch and the folder field inside the same disclosure, and keep live Disconnect/Reconnect beside the connection status. Use Agent Zero-style switch controls in every Host access view. Create/Add Instance is the single initial Host access choice and must not be followed by a global onboarding prompt. New local Instances inherit the Settings default, while new remote Instances require their own explicit choice. Browser and Computer Use start opt-in. Do not add a CLI installation helper to Create/Add Instance or Host access settings; Launcher owns CLI preparation independently of permission opt-in. One Agent Zero-style switch owns the persisted master permission state and visibly disables its dependent permissions. Call the selected path the folder for files and commands, explain both roles in plain language, and make clear that commands may use other locations available to the Launcher user. Keep browser selection and Connection/Computer Use diagnostics in a collapsed Advanced settings disclosure with a short summary. Browser preparation and Computer Use permission failures are Needs action states, not silent browser relaunches or hidden permission grants. A Needs action summary must show the concrete browser, permission, restart, or runtime reason in the visible modal body; do not substitute generic tab-lease copy in a modal that is already opened from the owning Instance tab. A missing host Browser dependency must become a concise `Set up browser` repair action; do not hide that action merely because no supported host browser is currently detected, and do not send Launcher users to an A0 CLI slash command. Safari setup must name Show features for web developers in Safari's Advanced settings, then Allow remote automation in Developer settings; Chromium-family setup keeps its browser-specific remote-debugging guidance. Hide Browser support diagnostics and repair actions while the current modal choice does not allow `Use my Browser`; retained runtime metadata must not imply that Browser is required. Render a saved capability choice independently from runtime readiness as `Not allowed`, `Allowed · Setup needed`, `Allowed · Checking`, or `Allowed · Ready`; runtime metadata must never turn an allowed switch off. Computer Use checking copy must follow the advertised backend; macOS permission wording is valid only for a macOS backend, while other backends use neutral Computer Use copy unless they provide something more specific. When Computer Use is newly enabled on macOS, open the staged setup surface after the gateway connects. Later launches preflight silently, with one explicit retry or restart action when required. Name the pending macOS service on that action (`Open Accessibility Settings`, `Allow Screen Recording`, or `Check Computer Use`) instead of repeating a generic permission button. Present capability metadata as human labels and offer Computer Use setup only for actionable approval, rearm, restart, or error states—not healthy trust modes. Compatibility copy must name advertised Launcher gateway support rather than assume a specific A0 CLI release number.
|
||||
- Local creation defaults channel updates on for `latest` and `ready`; users may turn the checkbox off when they intentionally want the installed channel image.
|
||||
|
||||
## Work Guidance
|
||||
|
||||
- Keep component scripts pure enough to rerender repeatedly from state without
|
||||
accumulating duplicate event listeners.
|
||||
- Use stable element ids inside a component only within that component's loaded
|
||||
fragment; do not rely on ids owned by sibling components.
|
||||
- Prefer short task-oriented copy. Avoid explanatory paragraphs when a label,
|
||||
status, or action name will do.
|
||||
- Keep component scripts pure enough to rerender repeatedly from state without accumulating duplicate event listeners.
|
||||
- Use stable element ids inside a component only within that component's loaded fragment; do not rely on ids owned by sibling components.
|
||||
- Prefer short task-oriented copy. Avoid explanatory paragraphs when a label, status, or action name will do.
|
||||
- Keep destructive actions guarded by confirmation or explicit acknowledgement.
|
||||
- If a component's contract becomes large enough to need its own doc, add a
|
||||
child `AGENTS.md` and update this file plus the root index in the same session.
|
||||
- If a component's contract becomes large enough to need its own doc, add a child `AGENTS.md` and update this file plus the root index in the same session.
|
||||
|
||||
## Verification
|
||||
|
||||
@@ -469,8 +108,7 @@ node --check app/docker_manager.js
|
||||
git diff --check
|
||||
```
|
||||
|
||||
For script changes under this subtree, also run `node --check` on the edited
|
||||
component modules when they are standalone ES modules.
|
||||
For script changes under this subtree, also run `node --check` on the edited component modules when they are standalone ES modules.
|
||||
|
||||
## Child DOX Index
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { defaultInstanceName } from "../instance-defaults.js";
|
||||
import { byId, compactText } from "../component-utils.js";
|
||||
|
||||
const DEFAULT_IMAGE = "agent0ai/agent-zero";
|
||||
const DEFAULT_TAG = "latest";
|
||||
@@ -14,8 +15,6 @@ let activeFileName = "";
|
||||
let lastDeveloperProgressKey = "";
|
||||
let project = { token: "", name: "", files: [], warnings: [] };
|
||||
|
||||
function byId(id) { return document.getElementById(id); }
|
||||
|
||||
function fmtBytes(bytes) {
|
||||
if (bytes === null || bytes === undefined || bytes === "" || !Number.isFinite(Number(bytes))) return "Unknown";
|
||||
const units = ["B", "KB", "MB", "GB", "TB"];
|
||||
@@ -28,11 +27,6 @@ function fmtBytes(bytes) {
|
||||
return `${value.toFixed(unit > 1 ? 1 : 0)} ${units[unit]}`;
|
||||
}
|
||||
|
||||
function compactText(value, fallback = "") {
|
||||
const text = String(value || "").trim();
|
||||
return text || fallback;
|
||||
}
|
||||
|
||||
function splitImageTag(imageValue, tagValue) {
|
||||
let image = compactText(imageValue, DEFAULT_IMAGE);
|
||||
let tag = compactText(tagValue, "");
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
function byId(id) { return document.getElementById(id); }
|
||||
|
||||
function asText(value) {
|
||||
return typeof value === "string" ? value.trim() : "";
|
||||
}
|
||||
|
||||
function compactText(value, fallback = "") {
|
||||
const text = String(value || "").trim();
|
||||
return text || fallback;
|
||||
}
|
||||
|
||||
function clearChildren(element) {
|
||||
if (!element) return;
|
||||
while (element.firstChild) element.removeChild(element.firstChild);
|
||||
while (element.children && element.children.length) element.removeChild(element.children[0]);
|
||||
}
|
||||
|
||||
function escapeHtml(value) {
|
||||
return String(value || "")
|
||||
.replace(/&/g, "&")
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/"/g, """)
|
||||
.replace(/'/g, "'");
|
||||
}
|
||||
|
||||
function makeButton(label, className, disabled = false) {
|
||||
const button = document.createElement("button");
|
||||
button.type = "button";
|
||||
button.className = className;
|
||||
button.textContent = label;
|
||||
button.disabled = !!disabled;
|
||||
return button;
|
||||
}
|
||||
|
||||
function focusableWithin(root) {
|
||||
return Array.from(root.querySelectorAll("button:not([disabled]), [href], input, select, textarea, [tabindex]:not([tabindex='-1'])"))
|
||||
.filter((el) => !el.hidden);
|
||||
}
|
||||
|
||||
function setPageBlocked(blocked) {
|
||||
const page = document.querySelector(".dm-page");
|
||||
if (!page) return;
|
||||
if ("inert" in page) page.inert = !!blocked;
|
||||
if (blocked) page.setAttribute("aria-hidden", "true");
|
||||
else page.removeAttribute("aria-hidden");
|
||||
}
|
||||
|
||||
function closeDialog(dialog) {
|
||||
if (dialog && dialog.parentNode) dialog.parentNode.removeChild(dialog);
|
||||
}
|
||||
|
||||
export {
|
||||
byId,
|
||||
asText,
|
||||
compactText,
|
||||
clearChildren,
|
||||
escapeHtml,
|
||||
makeButton,
|
||||
focusableWithin,
|
||||
setPageBlocked,
|
||||
closeDialog
|
||||
};
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
readInstanceDefaultsFromForm
|
||||
} from "../instance-defaults.js";
|
||||
import { shouldShowSetupShowcase } from "../setup-showcase/setup-showcase.js";
|
||||
import { asText } from "../component-utils.js";
|
||||
|
||||
const FIRST_INSTANCE_SETUP_CLASS = "dm-first-instance-setup";
|
||||
const FIRST_INSTANCE_SETUP_PREFIX = "firstSetup";
|
||||
@@ -20,10 +21,6 @@ const STORAGE_MODE_EPHEMERAL = "ephemeral";
|
||||
|
||||
const acknowledgedOps = new Set();
|
||||
|
||||
function asText(value) {
|
||||
return typeof value === "string" ? value.trim() : "";
|
||||
}
|
||||
|
||||
function createEl(tagName, className = "", text = "") {
|
||||
const el = document.createElement(tagName);
|
||||
if (className) el.className = className;
|
||||
@@ -31,12 +28,6 @@ function createEl(tagName, className = "", text = "") {
|
||||
return el;
|
||||
}
|
||||
|
||||
function clearChildren(element) {
|
||||
if (!element) return;
|
||||
while (element.firstChild) element.removeChild(element.firstChild);
|
||||
while (element.children && element.children.length) element.removeChild(element.children[0]);
|
||||
}
|
||||
|
||||
function slotFieldId(slotId, field) {
|
||||
return `${FIRST_INSTANCE_SETUP_PREFIX}${slotId}${field}`;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { escapeHtml } from "./component-utils.js";
|
||||
|
||||
const SCOPE_FIELDS = Object.freeze([
|
||||
{ key: "files", icon: "folder_open", label: "Files read", hint: "Open files in the folder below." },
|
||||
{ key: "file_write", icon: "edit_document", label: "Files write", hint: "Create and change files there." },
|
||||
@@ -29,15 +31,6 @@ const ARMABLE_COMPUTER_USE_STATUSES = new Set([
|
||||
"error"
|
||||
]);
|
||||
|
||||
function escapeHtml(value) {
|
||||
return String(value || "")
|
||||
.replace(/&/g, "&")
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/"/g, """)
|
||||
.replace(/'/g, "'");
|
||||
}
|
||||
|
||||
function normalizeScopes(value = {}) {
|
||||
const scopes = {
|
||||
files: value?.files !== false,
|
||||
|
||||
@@ -435,6 +435,7 @@ export {
|
||||
clearInstanceDefaultDirty,
|
||||
defaultInstanceDefaults,
|
||||
defaultInstanceName,
|
||||
envKeyFromLine,
|
||||
instanceModelRowsHtml,
|
||||
normalizeInstanceDefaults,
|
||||
providerApiKeyPlaceholder,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { instanceColorTone, createInstanceIcon } from "../card-visuals.js";
|
||||
import { openHostAccessDialog } from "../host-access-dialog.js";
|
||||
import { openInstanceAppearanceDialog } from "../instance-appearance-dialog.js";
|
||||
import { byId } from "../component-utils.js";
|
||||
|
||||
let namesCollapsed = false;
|
||||
let tabDrag = null;
|
||||
@@ -117,10 +118,6 @@ function moveTabDrag(event) {
|
||||
}
|
||||
}
|
||||
|
||||
function byId(id) {
|
||||
return document.getElementById(id);
|
||||
}
|
||||
|
||||
function activeTab(snapshot) {
|
||||
const tabs = embeddedTabs(snapshot);
|
||||
return tabs.find((tab) => tab?.active) || tabs.find((tab) => tab?.id === snapshot?.activeTabId) || null;
|
||||
|
||||
@@ -5,8 +5,8 @@ import {
|
||||
createLocalInstanceButtonModel,
|
||||
openCreateLocalInstanceDialog
|
||||
} from "../run-instance-dialog.js";
|
||||
|
||||
function byId(id) { return document.getElementById(id); }
|
||||
import { byId, closeDialog, escapeHtml } from "../component-utils.js";
|
||||
import { progressPresentedAsToast } from "../progress-eta.js";
|
||||
|
||||
let logsRequestSeq = 0;
|
||||
let lastInstanceCardDiagnosticsKey = "";
|
||||
@@ -235,10 +235,6 @@ function backgroundOperationCanStop(operation) {
|
||||
return operation?.status === "running" && (operation.type === "start" || operation.type === "restart");
|
||||
}
|
||||
|
||||
function progressPresentedAsToast(progress = null) {
|
||||
return typeof progress?.presentation === "string" && progress.presentation.trim() === "toast";
|
||||
}
|
||||
|
||||
function isBlockingOperationRunning(state = {}) {
|
||||
const progress = state?.progress || null;
|
||||
return progress?.status === "running" && !progressPresentedAsToast(progress);
|
||||
@@ -464,15 +460,6 @@ const CLONE_WORKSPACE_OPTIONS = Object.freeze([
|
||||
}
|
||||
]);
|
||||
|
||||
function escapeHtml(value) {
|
||||
return String(value || "")
|
||||
.replace(/&/g, "&")
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/"/g, """)
|
||||
.replace(/'/g, "'");
|
||||
}
|
||||
|
||||
function remoteInstanceVisualSeed(remote) {
|
||||
return remote?.url || remote?.name || remote?.id || "remote";
|
||||
}
|
||||
@@ -521,10 +508,6 @@ function remoteCliMenuConfig(remote, state = {}) {
|
||||
};
|
||||
}
|
||||
|
||||
function closeDialog(dialog) {
|
||||
if (dialog && dialog.parentNode) dialog.parentNode.removeChild(dialog);
|
||||
}
|
||||
|
||||
function clamp(value, min, max) {
|
||||
if (max < min) return min;
|
||||
return Math.min(Math.max(value, min), max);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { createVersionVisual } from "../card-visuals.js";
|
||||
import { defaultInstanceName } from "../instance-defaults.js";
|
||||
import { openRunInstanceDialog } from "../run-instance-dialog.js";
|
||||
|
||||
function byId(id) { return document.getElementById(id); }
|
||||
import { byId } from "../component-utils.js";
|
||||
import { compareReleaseTags, isLatestEntry, isReadyEntry, isTestingEntry, normalizeDate, parseReleaseTagParts } from "../release-entries.js";
|
||||
|
||||
function fmtDate(v) {
|
||||
if (!v) return "";
|
||||
@@ -20,33 +20,10 @@ function fmtSize(bytes) {
|
||||
return `${val.toFixed(i > 1 ? 1 : 0)} ${units[i]}`;
|
||||
}
|
||||
|
||||
function parseReleaseTagParts(tag) {
|
||||
const normalized = String(tag || "").trim().replace(/^v/, "");
|
||||
const match = normalized.match(/^(\d+)\.(\d+)(?:\.(\d+))?$/);
|
||||
if (!match) return null;
|
||||
return {
|
||||
major: Number(match[1]),
|
||||
minor: Number(match[2]),
|
||||
patch: Number(match[3] || 0)
|
||||
};
|
||||
}
|
||||
|
||||
function isLatestEntry(entry) {
|
||||
return entry?.isBackendImage !== false && entry?.tag === "latest";
|
||||
}
|
||||
|
||||
function isReadyEntry(entry) {
|
||||
return entry?.isBackendImage !== false && entry?.tag === "ready";
|
||||
}
|
||||
|
||||
function isPinnedChannelEntry(entry) {
|
||||
return isLatestEntry(entry) || isReadyEntry(entry);
|
||||
}
|
||||
|
||||
function isTestingEntry(entry) {
|
||||
return entry?.isBackendImage !== false && entry?.tag === "testing";
|
||||
}
|
||||
|
||||
function isHiddenEntry(entry) {
|
||||
return isTestingEntry(entry);
|
||||
}
|
||||
@@ -78,24 +55,6 @@ function isReleaseTag(entry) {
|
||||
return !!parseReleaseTagParts(entry?.tag);
|
||||
}
|
||||
|
||||
function compareReleaseTags(a, b) {
|
||||
const aParts = parseReleaseTagParts(a);
|
||||
const bParts = parseReleaseTagParts(b);
|
||||
if (!aParts && !bParts) return 0;
|
||||
if (!aParts) return 1;
|
||||
if (!bParts) return -1;
|
||||
|
||||
if (aParts.major !== bParts.major) return bParts.major - aParts.major;
|
||||
if (aParts.minor !== bParts.minor) return bParts.minor - aParts.minor;
|
||||
if (aParts.patch !== bParts.patch) return bParts.patch - aParts.patch;
|
||||
return 0;
|
||||
}
|
||||
|
||||
function normalizeDate(value) {
|
||||
const t = Date.parse(value || "");
|
||||
return Number.isFinite(t) ? t : null;
|
||||
}
|
||||
|
||||
function orderedEntries(entries) {
|
||||
return [...entries].sort((left, right) => {
|
||||
const leftLatest = isLatestEntry(left);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
function byId(id) { return document.getElementById(id); }
|
||||
|
||||
import { byId } from "../component-utils.js";
|
||||
function runtimeMessage(runtime, fallback) {
|
||||
const detail = typeof runtime?.detail === "string" ? runtime.detail.trim() : "";
|
||||
if (runtime?.state === "manual_install" && Array.isArray(runtime.manualPackages) && runtime.manualPackages.length) {
|
||||
|
||||
@@ -9,24 +9,14 @@ import {
|
||||
shouldShowSetupShowcase,
|
||||
unmountSetupShowcase
|
||||
} from "../setup-showcase/setup-showcase.js";
|
||||
import { progressMetaText } from "../progress-eta.js";
|
||||
import { percentValue, progressMetaText } from "../progress-eta.js";
|
||||
import { asText, clearChildren, focusableWithin, makeButton, setPageBlocked } from "../component-utils.js";
|
||||
|
||||
const OPERATION_DIALOG_ID = "operationProgressDialog";
|
||||
|
||||
let blockingKeyHandlerDocument = null;
|
||||
let dismissedOperationKey = "";
|
||||
|
||||
function asText(value) {
|
||||
return typeof value === "string" ? value.trim() : "";
|
||||
}
|
||||
|
||||
function percentValue(progress) {
|
||||
if (progress === null || progress === undefined || progress === "") return null;
|
||||
const value = Number(progress);
|
||||
if (!Number.isFinite(value)) return null;
|
||||
return Math.max(0, Math.min(100, value));
|
||||
}
|
||||
|
||||
function operationKey(progress = null) {
|
||||
const opId = asText(progress?.opId);
|
||||
const status = asText(progress?.status);
|
||||
@@ -169,21 +159,6 @@ function normalizedOperationDialog(state = {}) {
|
||||
};
|
||||
}
|
||||
|
||||
function makeButton(label, className, disabled = false) {
|
||||
const button = document.createElement("button");
|
||||
button.type = "button";
|
||||
button.className = className;
|
||||
button.textContent = label;
|
||||
button.disabled = !!disabled;
|
||||
return button;
|
||||
}
|
||||
|
||||
function clearChildren(element) {
|
||||
if (!element) return;
|
||||
while (element.firstChild) element.removeChild(element.firstChild);
|
||||
while (element.children && element.children.length) element.removeChild(element.children[0]);
|
||||
}
|
||||
|
||||
function createProgressBlock() {
|
||||
const block = document.createElement("div");
|
||||
block.className = "sv-progress-block dm-runtime-progress";
|
||||
@@ -353,23 +328,10 @@ function updateOperationDialog(backdrop, model, state, actions) {
|
||||
syncActionButton(backdrop.querySelector(".dm-operation-primary"), model.primary, primaryClass, state, actions);
|
||||
}
|
||||
|
||||
function setPageBlocked(blocked) {
|
||||
const page = document.querySelector(".dm-page");
|
||||
if (!page) return;
|
||||
if ("inert" in page) page.inert = !!blocked;
|
||||
if (blocked) page.setAttribute("aria-hidden", "true");
|
||||
else page.removeAttribute("aria-hidden");
|
||||
}
|
||||
|
||||
function hasOtherBlockingDialog() {
|
||||
return !!document.getElementById("runtimeSetupDialog");
|
||||
}
|
||||
|
||||
function focusableWithin(root) {
|
||||
return Array.from(root.querySelectorAll("button:not([disabled]), [href], input, select, textarea, [tabindex]:not([tabindex='-1'])"))
|
||||
.filter((el) => !el.hidden);
|
||||
}
|
||||
|
||||
function focusFirstControl(root) {
|
||||
if (root.querySelector(".dm-setup-showcase")) {
|
||||
root.querySelector(".dm-operation-dialog")?.focus?.();
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
function asText(value) {
|
||||
return typeof value === "string" ? value.trim() : "";
|
||||
}
|
||||
import { asText } from "./component-utils.js";
|
||||
|
||||
function percentValue(progress) {
|
||||
if (progress === null || progress === undefined || progress === "") return null;
|
||||
@@ -78,8 +76,14 @@ function progressMetaText({
|
||||
return [percentText, etaText].filter(Boolean).join(" · ");
|
||||
}
|
||||
|
||||
function progressPresentedAsToast(progress = null) {
|
||||
return typeof progress?.presentation === "string" && progress.presentation.trim() === "toast";
|
||||
}
|
||||
|
||||
export {
|
||||
estimateEtaText,
|
||||
estimatedProgressFromSteps,
|
||||
progressMetaText
|
||||
percentValue,
|
||||
progressMetaText,
|
||||
progressPresentedAsToast
|
||||
};
|
||||
@@ -0,0 +1,48 @@
|
||||
function parseReleaseTagParts(tag) {
|
||||
const normalized = String(tag || "").trim().replace(/^v/, "");
|
||||
const match = normalized.match(/^(\d+)\.(\d+)(?:\.(\d+))?$/);
|
||||
if (!match) return null;
|
||||
return {
|
||||
major: Number(match[1]),
|
||||
minor: Number(match[2]),
|
||||
patch: Number(match[3] || 0)
|
||||
};
|
||||
}
|
||||
|
||||
function isLatestEntry(entry) {
|
||||
return entry?.isBackendImage !== false && entry?.tag === "latest";
|
||||
}
|
||||
|
||||
function isReadyEntry(entry) {
|
||||
return entry?.isBackendImage !== false && entry?.tag === "ready";
|
||||
}
|
||||
|
||||
function isTestingEntry(entry) {
|
||||
return entry?.isBackendImage !== false && entry?.tag === "testing";
|
||||
}
|
||||
|
||||
function compareReleaseTags(a, b) {
|
||||
const aParts = parseReleaseTagParts(a);
|
||||
const bParts = parseReleaseTagParts(b);
|
||||
if (!aParts && !bParts) return 0;
|
||||
if (!aParts) return 1;
|
||||
if (!bParts) return -1;
|
||||
if (aParts.major !== bParts.major) return bParts.major - aParts.major;
|
||||
if (aParts.minor !== bParts.minor) return bParts.minor - aParts.minor;
|
||||
if (aParts.patch !== bParts.patch) return bParts.patch - aParts.patch;
|
||||
return 0;
|
||||
}
|
||||
|
||||
function normalizeDate(value) {
|
||||
const t = Date.parse(value || "");
|
||||
return Number.isFinite(t) ? t : null;
|
||||
}
|
||||
|
||||
export {
|
||||
parseReleaseTagParts,
|
||||
isLatestEntry,
|
||||
isReadyEntry,
|
||||
isTestingEntry,
|
||||
compareReleaseTags,
|
||||
normalizeDate
|
||||
};
|
||||
@@ -5,19 +5,7 @@ import {
|
||||
scopeFieldsHtml as hostAccessScopeFieldsHtml,
|
||||
switchLineHtml as hostAccessSwitchLineHtml
|
||||
} from "./host-access-dialog.js";
|
||||
|
||||
function closeDialog(dialog) {
|
||||
if (dialog && dialog.parentNode) dialog.parentNode.removeChild(dialog);
|
||||
}
|
||||
|
||||
function escapeHtml(value) {
|
||||
return String(value || "")
|
||||
.replace(/&/g, "&")
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/"/g, """)
|
||||
.replace(/'/g, "'");
|
||||
}
|
||||
import { closeDialog, escapeHtml } from "./component-utils.js";
|
||||
|
||||
function normalizeUrlInput(value) {
|
||||
let raw = String(value || "").trim();
|
||||
|
||||
@@ -4,6 +4,7 @@ import {
|
||||
bindInstanceDefaultProviderPlaceholderSync,
|
||||
buildInstanceEnvText,
|
||||
defaultInstanceName,
|
||||
envKeyFromLine,
|
||||
instanceModelRowsHtml,
|
||||
normalizeInstanceDefaults,
|
||||
readInstanceDefaultsFromForm
|
||||
@@ -16,19 +17,9 @@ import {
|
||||
scopeFieldsHtml as hostAccessScopeFieldsHtml,
|
||||
switchLineHtml as hostAccessSwitchLineHtml
|
||||
} from "./host-access-dialog.js";
|
||||
|
||||
function closeDialog(dialog) {
|
||||
if (dialog && dialog.parentNode) dialog.parentNode.removeChild(dialog);
|
||||
}
|
||||
|
||||
function escapeHtml(value) {
|
||||
return String(value || "")
|
||||
.replace(/&/g, "&")
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/"/g, """)
|
||||
.replace(/'/g, "'");
|
||||
}
|
||||
import { closeDialog, escapeHtml } from "./component-utils.js";
|
||||
import { progressPresentedAsToast } from "./progress-eta.js";
|
||||
import { compareReleaseTags, isLatestEntry, isReadyEntry, isTestingEntry, normalizeDate } from "./release-entries.js";
|
||||
|
||||
function escapeAttribute(value) {
|
||||
return escapeHtml(value);
|
||||
@@ -41,13 +32,6 @@ function cleanEnvValue(value, maxLength = 4096) {
|
||||
.slice(0, maxLength);
|
||||
}
|
||||
|
||||
function envKeyFromLine(line) {
|
||||
const trimmed = String(line || "").trim();
|
||||
if (!trimmed || trimmed.startsWith("#")) return "";
|
||||
const idx = trimmed.indexOf("=");
|
||||
return idx > 0 ? trimmed.slice(0, idx).trim() : "";
|
||||
}
|
||||
|
||||
function mergeGeneratedEnvText(generatedLines, userText) {
|
||||
const userLines = String(userText || "").split(/\r?\n/);
|
||||
const userKeys = new Set(userLines.map(envKeyFromLine).filter(Boolean));
|
||||
@@ -105,50 +89,10 @@ function directWorkspaceFolder(root, instanceName) {
|
||||
return `${base}/${cleanFolderSegment(instanceName)}`;
|
||||
}
|
||||
|
||||
function parseReleaseTagParts(tag) {
|
||||
const normalized = String(tag || "").trim().replace(/^v/, "");
|
||||
const match = normalized.match(/^(\d+)\.(\d+)(?:\.(\d+))?$/);
|
||||
if (!match) return null;
|
||||
return {
|
||||
major: Number(match[1]),
|
||||
minor: Number(match[2]),
|
||||
patch: Number(match[3] || 0)
|
||||
};
|
||||
}
|
||||
|
||||
function compareReleaseTags(a, b) {
|
||||
const aParts = parseReleaseTagParts(a);
|
||||
const bParts = parseReleaseTagParts(b);
|
||||
if (!aParts && !bParts) return 0;
|
||||
if (!aParts) return 1;
|
||||
if (!bParts) return -1;
|
||||
if (aParts.major !== bParts.major) return bParts.major - aParts.major;
|
||||
if (aParts.minor !== bParts.minor) return bParts.minor - aParts.minor;
|
||||
if (aParts.patch !== bParts.patch) return bParts.patch - aParts.patch;
|
||||
return 0;
|
||||
}
|
||||
|
||||
function normalizeDate(value) {
|
||||
const t = Date.parse(value || "");
|
||||
return Number.isFinite(t) ? t : null;
|
||||
}
|
||||
|
||||
function isLatestEntry(entry) {
|
||||
return entry?.isBackendImage !== false && entry?.tag === "latest";
|
||||
}
|
||||
|
||||
function isReadyEntry(entry) {
|
||||
return entry?.isBackendImage !== false && entry?.tag === "ready";
|
||||
}
|
||||
|
||||
function isChannelVersionChoice(entry = {}) {
|
||||
return isLatestEntry(entry) || isReadyEntry(entry);
|
||||
}
|
||||
|
||||
function isTestingEntry(entry) {
|
||||
return entry?.isBackendImage !== false && entry?.tag === "testing";
|
||||
}
|
||||
|
||||
function isInstalledRunEntry(entry) {
|
||||
if (!entry || typeof entry !== "object") return false;
|
||||
if (entry.availability === "installing") return false;
|
||||
@@ -243,10 +187,6 @@ function installedVersionChoices(state = {}) {
|
||||
return choices.sort(installedVersionSort);
|
||||
}
|
||||
|
||||
function progressPresentedAsToast(progress = null) {
|
||||
return typeof progress?.presentation === "string" && progress.presentation.trim() === "toast";
|
||||
}
|
||||
|
||||
function createLocalInstanceButtonModel(state = {}) {
|
||||
const choices = installedVersionChoices(state);
|
||||
const operationRunning = state?.progress?.status === "running" && !progressPresentedAsToast(state.progress);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { estimatedProgressFromSteps, progressMetaText } from "../progress-eta.js";
|
||||
import { estimatedProgressFromSteps, percentValue, progressMetaText } from "../progress-eta.js";
|
||||
import { asText, focusableWithin, makeButton, setPageBlocked } from "../component-utils.js";
|
||||
import { openAddRemoteInstanceDialog } from "../remote-instance-dialog.js";
|
||||
import { openCreateLocalInstanceDialog } from "../run-instance-dialog.js";
|
||||
|
||||
@@ -52,17 +53,6 @@ let acknowledgedRuntimeSetupKey = "";
|
||||
let requestedSetupDocument = null;
|
||||
let setupHandedOffDocument = null;
|
||||
|
||||
function asText(value) {
|
||||
return typeof value === "string" ? value.trim() : "";
|
||||
}
|
||||
|
||||
function percentValue(progress) {
|
||||
if (progress === null || progress === undefined || progress === "") return null;
|
||||
const value = Number(progress);
|
||||
if (!Number.isFinite(value)) return null;
|
||||
return Math.max(0, Math.min(100, value));
|
||||
}
|
||||
|
||||
function isDockerDesktopRuntime(runtime) {
|
||||
return runtime?.mode === "docker_desktop" || runtime?.dockerFlavor === "docker_desktop";
|
||||
}
|
||||
@@ -413,15 +403,6 @@ function appendText(parent, className, text) {
|
||||
return el;
|
||||
}
|
||||
|
||||
function makeButton(label, className, disabled = false) {
|
||||
const button = document.createElement("button");
|
||||
button.type = "button";
|
||||
button.className = className;
|
||||
button.textContent = label;
|
||||
button.disabled = !!disabled;
|
||||
return button;
|
||||
}
|
||||
|
||||
function renderProgress(model, parent) {
|
||||
const block = document.createElement("div");
|
||||
block.className = "sv-progress-block dm-runtime-progress";
|
||||
@@ -637,14 +618,6 @@ function renderSetupOption(parent, { titleText, detailText, action, iconText, la
|
||||
return button;
|
||||
}
|
||||
|
||||
function setPageBlocked(blocked) {
|
||||
const page = document.querySelector(".dm-page");
|
||||
if (!page) return;
|
||||
if ("inert" in page) page.inert = !!blocked;
|
||||
if (blocked) page.setAttribute("aria-hidden", "true");
|
||||
else page.removeAttribute("aria-hidden");
|
||||
}
|
||||
|
||||
function hasOtherBlockingDialog() {
|
||||
return !!document.getElementById("operationProgressDialog");
|
||||
}
|
||||
@@ -655,11 +628,6 @@ function focusFirstControl(root) {
|
||||
target?.focus?.();
|
||||
}
|
||||
|
||||
function focusableWithin(root) {
|
||||
return Array.from(root.querySelectorAll("button:not([disabled]), [href], input, select, textarea, [tabindex]:not([tabindex='-1'])"))
|
||||
.filter((el) => !el.hidden);
|
||||
}
|
||||
|
||||
function blockModalKeyboard(event) {
|
||||
const root = document.getElementById(RUNTIME_GATE_ID);
|
||||
if (!root) return;
|
||||
|
||||
@@ -18,6 +18,7 @@ import {
|
||||
scopeFieldsHtml as hostAccessScopeFieldsHtml,
|
||||
switchLineHtml as hostAccessSwitchLineHtml
|
||||
} from "../host-access-dialog.js";
|
||||
import { byId, compactText } from "../component-utils.js";
|
||||
|
||||
const SETTINGS_TAB_KEY = "dm-settings-active-tab";
|
||||
const SETTINGS_TABS = ["ports", "workspace", "defaults", "a0-tag"];
|
||||
@@ -26,8 +27,6 @@ let settingsSaveInProgress = false;
|
||||
let syncHostAccessDefaults = null;
|
||||
let a0TagProfilesKey = "";
|
||||
|
||||
function byId(id) { return document.getElementById(id); }
|
||||
|
||||
function validSettingsTab(tab) {
|
||||
return SETTINGS_TABS.includes(tab) ? tab : "ports";
|
||||
}
|
||||
@@ -94,11 +93,6 @@ function parseOptionalInt(value) {
|
||||
return Number.isNaN(parsed) ? undefined : parsed;
|
||||
}
|
||||
|
||||
function compactText(value, fallback = "") {
|
||||
const text = String(value || "").trim();
|
||||
return text || fallback;
|
||||
}
|
||||
|
||||
function currentStoragePreferences(state) {
|
||||
const prefs = state?.storagePreferences && typeof state.storagePreferences === "object" ? state.storagePreferences : {};
|
||||
return {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { asText, clearChildren } from "../component-utils.js";
|
||||
const SHOWCASE_ASSET_BASE = "assets/setup-showcase";
|
||||
|
||||
const SETUP_SHOWCASE_SLIDES = Object.freeze([
|
||||
@@ -53,16 +54,6 @@ const SETUP_SHOWCASE_SLIDES = Object.freeze([
|
||||
|
||||
let activeShowcaseIndex = 0;
|
||||
|
||||
function asText(value) {
|
||||
return typeof value === "string" ? value.trim() : "";
|
||||
}
|
||||
|
||||
function clearChildren(element) {
|
||||
if (!element) return;
|
||||
while (element.firstChild) element.removeChild(element.firstChild);
|
||||
while (element.children && element.children.length) element.removeChild(element.children[0]);
|
||||
}
|
||||
|
||||
function normalizeIndex(index) {
|
||||
const count = SETUP_SHOWCASE_SLIDES.length;
|
||||
if (!count) return 0;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
function byId(id) { return document.getElementById(id); }
|
||||
|
||||
import { byId } from "../component-utils.js";
|
||||
function hasLauncherUpdate(state) {
|
||||
const meta = state?.meta || {};
|
||||
return meta.launcherUpdateAvailable === true ||
|
||||
|
||||
+8
-17
@@ -2,11 +2,9 @@
|
||||
|
||||
## Purpose
|
||||
|
||||
`docs/` owns supplemental user-facing documentation for running, integrating,
|
||||
and troubleshooting the launcher.
|
||||
`docs/` owns supplemental user-facing documentation for running, integrating, and troubleshooting the launcher.
|
||||
|
||||
These docs explain the product and workflows. Durable implementation contracts
|
||||
belong in `AGENTS.md` files.
|
||||
These docs explain the product and workflows. Durable implementation contracts belong in `AGENTS.md` files.
|
||||
|
||||
## Ownership
|
||||
|
||||
@@ -14,29 +12,22 @@ This scope owns:
|
||||
|
||||
- `running-ui.md`: notes for running and validating the launcher UI.
|
||||
- `faq-integration.md`: integration-oriented FAQ and user guidance.
|
||||
- `runtime-troubleshooting.md`: user-facing runtime detection and repair notes
|
||||
for Docker-compatible endpoints, Docker contexts, and setup fallback paths.
|
||||
- `release-todos.md`: release checklist and temporary product corrections that
|
||||
must survive across coding sessions.
|
||||
- `runtime-troubleshooting.md`: user-facing runtime detection and repair notes for Docker-compatible endpoints, Docker contexts, and setup fallback paths.
|
||||
- `release-todos.md`: release checklist and temporary product corrections that must survive across coding sessions.
|
||||
|
||||
## Local Contracts
|
||||
|
||||
- Keep public/user-facing language clear and task-oriented.
|
||||
- Do not let docs drift into a second implementation contract. If a detail is
|
||||
needed for agents changing code, put it in the closest owning `AGENTS.md` and
|
||||
link or summarize publicly here only when useful.
|
||||
- Do not let docs drift into a second implementation contract. If a detail is needed for agents changing code, put it in the closest owning `AGENTS.md` and link or summarize publicly here only when useful.
|
||||
- Keep commands Linux-friendly by default.
|
||||
- Update docs when setup, release, local run, or troubleshooting workflows change.
|
||||
- Keep product terms aligned with the app: `Instances`, `Storage volumes`, and
|
||||
`Open UI`.
|
||||
- Keep product terms aligned with the app: `Instances`, `Storage volumes`, and `Open UI`.
|
||||
|
||||
## Work Guidance
|
||||
|
||||
- Prefer short sections with concrete commands and expected outcomes.
|
||||
- Avoid duplicating long code or architecture descriptions that belong in root or
|
||||
scoped AGENTS docs.
|
||||
- If screenshots or generated artifacts are added later, document the capture
|
||||
and regeneration path here.
|
||||
- Avoid duplicating long code or architecture descriptions that belong in root or scoped AGENTS docs.
|
||||
- If screenshots or generated artifacts are added later, document the capture and regeneration path here.
|
||||
|
||||
## Verification
|
||||
|
||||
|
||||
+6
-13
@@ -4,8 +4,7 @@ Use this checklist before cutting the next launcher release.
|
||||
|
||||
## Next Release
|
||||
|
||||
- Restore and verify Windows ARM release artifacts. The build workflow must
|
||||
produce both:
|
||||
- Restore and verify Windows ARM release artifacts. The build workflow must produce both:
|
||||
- `a0-launcher-<version>-windows-arm-setup.exe`
|
||||
- `a0-launcher-<version>-windows-arm.nupkg`
|
||||
- Keep Windows x86 artifacts. The build workflow must also produce:
|
||||
@@ -14,8 +13,7 @@ Use this checklist before cutting the next launcher release.
|
||||
- Keep Linux DEB artifacts only:
|
||||
- `a0-launcher-<version>-linux-arm.deb`
|
||||
- `a0-launcher-<version>-linux-x86.deb`
|
||||
- Do not publish Linux RPM artifacts unless there is an explicit product
|
||||
decision to support RPM again.
|
||||
- Do not publish Linux RPM artifacts unless there is an explicit product decision to support RPM again.
|
||||
- Keep macOS artifacts unchanged:
|
||||
- `a0-launcher-<version>-macos-arm.dmg`
|
||||
- `a0-launcher-<version>-macos-arm.zip`
|
||||
@@ -37,21 +35,16 @@ gh release view <tag> --repo agent0ai/a0-launcher --json assets \
|
||||
|
||||
## CLI Connector
|
||||
|
||||
- The bottom A0 CLI Connector must use the launcher-managed active instance
|
||||
when one is running.
|
||||
- If no launcher-managed active instance exists, it must fall back to a running
|
||||
local Agent Zero container from the Instances inventory when that container has
|
||||
a local UI URL.
|
||||
- The CLI connector must never pass remote, credentialed, or non-HTTP URLs to
|
||||
the shell terminal launcher.
|
||||
- The bottom A0 CLI Connector must use the launcher-managed active instance when one is running.
|
||||
- If no launcher-managed active instance exists, it must fall back to a running local Agent Zero container from the Instances inventory when that container has a local UI URL.
|
||||
- The CLI connector must never pass remote, credentialed, or non-HTTP URLs to the shell terminal launcher.
|
||||
- Validate against a generic running Agent Zero container such as:
|
||||
|
||||
```bash
|
||||
docker ps --filter ancestor=agent0ai/agent-zero:latest
|
||||
```
|
||||
|
||||
- For the known local smoke-test case, a container mapped as
|
||||
`127.0.0.1:32080` or `0.0.0.0:32080->80/tcp` should make the dock show:
|
||||
- For the known local smoke-test case, a container mapped as `127.0.0.1:32080` or `0.0.0.0:32080->80/tcp` should make the dock show:
|
||||
- `Instance socket ready`
|
||||
- `a0 --host http://127.0.0.1:32080/`
|
||||
|
||||
|
||||
+3
-7
@@ -75,14 +75,11 @@ npm install
|
||||
A0_LAUNCHER_LOCAL_REPO=/home/eclypso/a0/a0-launcher npm start
|
||||
```
|
||||
|
||||
This loads `app/index.html` directly from the working tree and is the right
|
||||
path for UI iteration.
|
||||
This loads `app/index.html` directly from the working tree and is the right path for UI iteration.
|
||||
|
||||
### Release content smoke test
|
||||
|
||||
Plain `npm start` exercises the GitHub Release content path. It checks the
|
||||
configured repository's latest release, downloads `content.json` when the remote
|
||||
bundle is newer, and serves the unpacked cache from Electron `userData`.
|
||||
Plain `npm start` exercises the GitHub Release content path. It checks the configured repository's latest release, downloads `content.json` when the remote bundle is newer, and serves the unpacked cache from Electron `userData`.
|
||||
|
||||
```bash
|
||||
npm start
|
||||
@@ -95,8 +92,7 @@ rm -rf /home/eclypso/.config/a0-launcher/app_content \
|
||||
/home/eclypso/.config/a0-launcher/content_meta.json
|
||||
```
|
||||
|
||||
Do not seed cache metadata with future-dated timestamps. Local development
|
||||
should use `A0_LAUNCHER_LOCAL_REPO` or `A0_LAUNCHER_USE_LOCAL_CONTENT=1`.
|
||||
Do not seed cache metadata with future-dated timestamps. Local development should use `A0_LAUNCHER_LOCAL_REPO` or `A0_LAUNCHER_USE_LOCAL_CONTENT=1`.
|
||||
|
||||
## UI smoke tests
|
||||
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
# Runtime Troubleshooting
|
||||
|
||||
The launcher talks to a Docker-compatible runtime through a local socket. It
|
||||
tries existing runtimes first, then offers automatic setup only when the
|
||||
platform supports it.
|
||||
The launcher talks to a Docker-compatible runtime through a local socket. It tries existing runtimes first, then offers automatic setup only when the platform supports it.
|
||||
|
||||
When more than one usable local runtime is already available, the setup flow can
|
||||
ask where Agent Zero should run. If there is only one usable runtime, the
|
||||
launcher chooses it automatically.
|
||||
When more than one usable local runtime is already available, the setup flow can ask where Agent Zero should run. If there is only one usable runtime, the launcher chooses it automatically.
|
||||
|
||||
## Quick Checks
|
||||
|
||||
@@ -18,23 +14,17 @@ docker context show
|
||||
echo "$DOCKER_HOST"
|
||||
```
|
||||
|
||||
If `DOCKER_HOST` points at an old or missing socket, unset it and refresh the
|
||||
launcher:
|
||||
If `DOCKER_HOST` points at an old or missing socket, unset it and refresh the launcher:
|
||||
|
||||
```bash
|
||||
unset DOCKER_HOST
|
||||
```
|
||||
|
||||
Docker contexts are also reused when they point to a reachable Docker-compatible
|
||||
endpoint. Tools such as OrbStack, Rancher Desktop, Colima, rootless Docker, and
|
||||
Podman can work when their Docker API endpoint is running. Portainer is a
|
||||
management UI for existing runtimes, so the launcher still needs the underlying
|
||||
Docker-compatible endpoint.
|
||||
Docker contexts are also reused when they point to a reachable Docker-compatible endpoint. Tools such as OrbStack, Rancher Desktop, Colima, rootless Docker, and Podman can work when their Docker API endpoint is running. Portainer is a management UI for existing runtimes, so the launcher still needs the underlying Docker-compatible endpoint.
|
||||
|
||||
## Docker Desktop
|
||||
|
||||
On macOS or Windows, start Docker Desktop and wait until it reports that the
|
||||
engine is running. Then refresh the launcher.
|
||||
On macOS or Windows, start Docker Desktop and wait until it reports that the engine is running. Then refresh the launcher.
|
||||
|
||||
On Linux, Docker Desktop uses a user socket such as:
|
||||
|
||||
@@ -42,16 +32,11 @@ On Linux, Docker Desktop uses a user socket such as:
|
||||
~/.docker/desktop/docker.sock
|
||||
```
|
||||
|
||||
If Docker Desktop is running but the launcher still cannot connect, check that
|
||||
your shell or desktop session is not overriding `DOCKER_HOST` with a stale
|
||||
value.
|
||||
If Docker Desktop is running but the launcher still cannot connect, check that your shell or desktop session is not overriding `DOCKER_HOST` with a stale value.
|
||||
|
||||
## Native Docker Engine
|
||||
|
||||
On Debian or Ubuntu, the launcher and installer can use the host package manager
|
||||
to install Docker Engine. If Docker was just installed and the launcher says
|
||||
your user cannot access it yet, log out and back in once so group membership is
|
||||
applied.
|
||||
On Debian or Ubuntu, the launcher and installer can use the host package manager to install Docker Engine. If Docker was just installed and the launcher says your user cannot access it yet, log out and back in once so group membership is applied.
|
||||
|
||||
Useful Linux checks:
|
||||
|
||||
@@ -71,29 +56,22 @@ On systems without `systemctl`, use the host service manager.
|
||||
|
||||
## Colima On macOS
|
||||
|
||||
When Docker Desktop is not installed, the launcher can use Colima with a
|
||||
dedicated profile named `a0`. The expected socket is:
|
||||
When Docker Desktop is not installed, the launcher can use Colima with a dedicated profile named `a0`. The expected socket is:
|
||||
|
||||
```text
|
||||
~/.colima/a0/docker.sock
|
||||
```
|
||||
|
||||
Homebrew is not required for this launcher-managed path. When `colima`,
|
||||
`limactl`, or `docker` are missing, the launcher installs its own runtime
|
||||
components under its application data directory and starts Colima in user space.
|
||||
It should not ask for an administrator password just to create the `a0` profile.
|
||||
Homebrew is not required for this launcher-managed path. When `colima`, `limactl`, or `docker` are missing, the launcher installs its own runtime components under its application data directory and starts Colima in user space. It should not ask for an administrator password just to create the `a0` profile.
|
||||
|
||||
If Colima was installed outside the launcher, make sure `colima`, `limactl`, and
|
||||
`docker` are available on `PATH`, then refresh the launcher. To inspect the
|
||||
profile:
|
||||
If Colima was installed outside the launcher, make sure `colima`, `limactl`, and `docker` are available on `PATH`, then refresh the launcher. To inspect the profile:
|
||||
|
||||
```bash
|
||||
colima list
|
||||
colima start a0 --runtime docker
|
||||
```
|
||||
|
||||
The launcher uses Colima's runtime defaults. Do not tune CPU, memory, or disk
|
||||
settings just to make the launcher detect the runtime.
|
||||
The launcher uses Colima's runtime defaults. Do not tune CPU, memory, or disk settings just to make the launcher detect the runtime.
|
||||
|
||||
## Rootless Docker On Linux
|
||||
|
||||
@@ -103,8 +81,7 @@ Rootless Docker usually exposes a user socket under:
|
||||
/run/user/<uid>/docker.sock
|
||||
```
|
||||
|
||||
The launcher checks `XDG_RUNTIME_DIR` when looking for this socket. If rootless
|
||||
Docker is running but unavailable to the launcher, confirm the socket path:
|
||||
The launcher checks `XDG_RUNTIME_DIR` when looking for this socket. If rootless Docker is running but unavailable to the launcher, confirm the socket path:
|
||||
|
||||
```bash
|
||||
echo "$XDG_RUNTIME_DIR"
|
||||
@@ -112,5 +89,4 @@ ls -l "$XDG_RUNTIME_DIR/docker.sock"
|
||||
docker info
|
||||
```
|
||||
|
||||
Make sure the launcher is started from the same desktop session that owns the
|
||||
rootless Docker socket.
|
||||
Make sure the launcher is started from the same desktop session that owns the rootless Docker socket.
|
||||
+15
-37
@@ -2,29 +2,20 @@
|
||||
|
||||
## Purpose
|
||||
|
||||
`packaging/` owns the updater-capable desktop packaging toolchain. It mirrors
|
||||
the Space Agent release shape: electron-builder creates platform artifacts and
|
||||
update metadata, then release staging rewrites those artifacts into canonical
|
||||
GitHub Release asset names.
|
||||
`packaging/` owns the updater-capable desktop packaging toolchain. It mirrors the Space Agent release shape: electron-builder creates platform artifacts and update metadata, then release staging rewrites those artifacts into canonical GitHub Release asset names.
|
||||
|
||||
## Ownership
|
||||
|
||||
This scope owns:
|
||||
|
||||
- `package.json` and `package-lock.json`: packaging-only Electron and
|
||||
electron-builder dependencies.
|
||||
- `package.json` and `package-lock.json`: packaging-only Electron and electron-builder dependencies.
|
||||
- `release-asset-filters.yaml`: public installer asset selection before upload.
|
||||
- `platforms/windows/installer.nsh`: Windows NSIS installer diagnostics,
|
||||
running-app shutdown hardening, and first-run launch behavior.
|
||||
- `scripts/desktop-builder.js`: platform/arch packaging orchestration and
|
||||
electron-builder config shaping.
|
||||
- `scripts/*-package.js` and `scripts/host-package.js`: local platform entry
|
||||
points for desktop packaging.
|
||||
- `platforms/windows/installer.nsh`: Windows NSIS installer diagnostics, running-app shutdown hardening, and first-run launch behavior.
|
||||
- `scripts/desktop-builder.js`: platform/arch packaging orchestration and electron-builder config shaping.
|
||||
- `scripts/*-package.js` and `scripts/host-package.js`: local platform entry points for desktop packaging.
|
||||
- `scripts/release-version.js`: `v*` tag parsing and semver normalization.
|
||||
- `scripts/release-metadata*.js`: updater metadata parsing, merging, and
|
||||
serialization.
|
||||
- `scripts/release-assets-stage.js`: canonical release asset naming, stale
|
||||
asset manifest generation, and updater metadata rewriting.
|
||||
- `scripts/release-metadata*.js`: updater metadata parsing, merging, and serialization.
|
||||
- `scripts/release-assets-stage.js`: canonical release asset naming, stale asset manifest generation, and updater metadata rewriting.
|
||||
|
||||
## Local Contracts
|
||||
|
||||
@@ -34,21 +25,11 @@ This scope owns:
|
||||
npm install --prefix packaging
|
||||
```
|
||||
|
||||
- The root package owns product metadata. Packaging scripts read the root
|
||||
`package.json` `build` config and do not carry a second product identity.
|
||||
- Packaging scripts must not publish directly. GitHub Release upload is owned
|
||||
by `.github/workflows/build.yml`.
|
||||
- Keep electron-builder at 26.15.6 or newer within v26. Earlier releases can
|
||||
produce NSIS app archives whose executable filters the install-time extractor
|
||||
silently skips, leaving Windows installs without the launcher executable and
|
||||
Electron runtime DLLs.
|
||||
- The NSIS uninstaller removes the Launcher-owned `%APPDATA%\\a0-launcher`
|
||||
directory, including saved preferences, remote Instances, credentials, and
|
||||
cached content.
|
||||
- Use `A0_LAUNCHER_APP_VERSION` and `A0_LAUNCHER_RELEASE_TAG` for CI-provided
|
||||
release versions. Two-segment tags such as `v1.8` are the public release
|
||||
shape; build them as semver `1.8.0` where tooling requires it, but stage
|
||||
public assets with release version `1.8`.
|
||||
- The root package owns product metadata. Packaging scripts read the root `package.json` `build` config and do not carry a second product identity.
|
||||
- Packaging scripts must not publish directly. GitHub Release upload is owned by `.github/workflows/build.yml`.
|
||||
- Keep electron-builder at 26.15.6 or newer within v26. Earlier releases can produce NSIS app archives whose executable filters the install-time extractor silently skips, leaving Windows installs without the launcher executable and Electron runtime DLLs.
|
||||
- The NSIS uninstaller removes the Launcher-owned `%APPDATA%\\a0-launcher` directory, including saved preferences, remote Instances, credentials, and cached content.
|
||||
- Use `A0_LAUNCHER_APP_VERSION` and `A0_LAUNCHER_RELEASE_TAG` for CI-provided release versions. Two-segment tags such as `v1.8` are the public release shape; build them as semver `1.8.0` where tooling requires it, but stage public assets with release version `1.8`.
|
||||
- Canonical public/updater asset names are:
|
||||
|
||||
```text
|
||||
@@ -70,12 +51,9 @@ metadata-latest-linux-arm64.yml
|
||||
## Work Guidance
|
||||
|
||||
- Prefer small, deterministic Node scripts over shell-heavy release logic.
|
||||
- Keep staging idempotent: generated manifests should list stale source names
|
||||
and exact upload files.
|
||||
- Do not add signing secrets or credentials to scripts, logs, or generated
|
||||
metadata.
|
||||
- Keep output under `dist/desktop/` or explicit caller-provided staging
|
||||
directories.
|
||||
- Keep staging idempotent: generated manifests should list stale source names and exact upload files.
|
||||
- Do not add signing secrets or credentials to scripts, logs, or generated metadata.
|
||||
- Keep output under `dist/desktop/` or explicit caller-provided staging directories.
|
||||
|
||||
## Verification
|
||||
|
||||
|
||||
+7
-14
@@ -4,35 +4,28 @@
|
||||
|
||||
`scripts/` owns small developer and build helper scripts.
|
||||
|
||||
Scripts should be deterministic, easy to run from Linux, and conservative about
|
||||
side effects.
|
||||
Scripts should be deterministic, easy to run from Linux, and conservative about side effects.
|
||||
|
||||
## Ownership
|
||||
|
||||
This scope owns:
|
||||
|
||||
- `write-build-info.js`: writes `shell/build-info.json` so the shell knows which
|
||||
GitHub repository to use for launcher content when no runtime override is set.
|
||||
- `write-build-info.js`: writes `shell/build-info.json` so the shell knows which GitHub repository to use for launcher content when no runtime override is set.
|
||||
- `bootstrap-macos.sh`: macOS bootstrap helper for local development.
|
||||
|
||||
## Local Contracts
|
||||
|
||||
- `write-build-info.js` must not block local development if it cannot write
|
||||
build metadata; it should warn and let runtime fallbacks work.
|
||||
- Repository resolution order for build info is environment first, then Git
|
||||
remote, then canonical default.
|
||||
- `write-build-info.js` must not block local development if it cannot write build metadata; it should warn and let runtime fallbacks work.
|
||||
- Repository resolution order for build info is environment first, then Git remote, then canonical default.
|
||||
- Keep generated `shell/build-info.json` small and non-secret.
|
||||
- Shell scripts should use portable POSIX/Bash patterns where practical and
|
||||
should not assume Windows paths.
|
||||
- Do not make helper scripts mutate Git history, tags, or remotes unless the
|
||||
script is explicitly for release automation and documented as such.
|
||||
- Shell scripts should use portable POSIX/Bash patterns where practical and should not assume Windows paths.
|
||||
- Do not make helper scripts mutate Git history, tags, or remotes unless the script is explicitly for release automation and documented as such.
|
||||
|
||||
## Work Guidance
|
||||
|
||||
- Prefer Node standard-library helpers for JSON and path handling.
|
||||
- Keep script output concise and useful in CI logs.
|
||||
- When adding a new script, add or update the corresponding package script in
|
||||
`package.json` only if it is a supported developer workflow.
|
||||
- When adding a new script, add or update the corresponding package script in `package.json` only if it is a supported developer workflow.
|
||||
|
||||
## Verification
|
||||
|
||||
|
||||
+80
-417
@@ -2,8 +2,7 @@
|
||||
|
||||
## Purpose
|
||||
|
||||
`shell/` owns the Electron host: main process, preload bridge, content loading,
|
||||
window policy, IPC, and the bridge to Docker orchestration.
|
||||
`shell/` owns the Electron host: main process, preload bridge, content loading, window policy, IPC, and the bridge to Docker orchestration.
|
||||
|
||||
This layer is privileged. Keep it narrow, explicit, and boring in the best way.
|
||||
|
||||
@@ -11,433 +10,97 @@ This layer is privileged. Keep it narrow, explicit, and boring in the best way.
|
||||
|
||||
This scope owns:
|
||||
|
||||
- `shell/main.js`: Electron app lifecycle, content distribution, custom
|
||||
protocol, main windows, IPC handlers, shell actions, and Docker Manager event
|
||||
forwarding.
|
||||
- `shell/main.js`: Electron app lifecycle, content distribution, custom protocol, main windows, IPC handlers, shell actions, and Docker Manager event forwarding.
|
||||
- `shell/preload.js`: safe renderer bridge exposed through `contextBridge`.
|
||||
- `shell/developer_projects.js`: bounded, renderer-owned Docker project file
|
||||
sessions for native open, save, export, and project action targeting.
|
||||
- `shell/credential_prompt.html` and `shell/credential_prompt.css`: static
|
||||
content and native-window layout for the shell-owned credential consent
|
||||
modal. Reuse the Launcher's shared dialog styles and never receive credential
|
||||
values.
|
||||
- `shell/host_access.js`: normalized Launcher Host access defaults, per-Instance
|
||||
configuration, scope dependencies, and stable Instance keys.
|
||||
- `shell/host_gateway.js`: supervised, newline-delimited JSON bridge to the
|
||||
installed `a0 gateway` child process.
|
||||
- `shell/a0_tag.js` and `shell/a0_tag_overlay.*`: A0 Tag lease/controller,
|
||||
tagged headless child contract, GNOME Wayland shortcut fallback, and the
|
||||
static shell-owned command/result surface.
|
||||
- `shell/a0_cli_install.js`: official A0 CLI installer command and release
|
||||
version policy used by Launcher CLI maintenance.
|
||||
- `shell/developer_projects.js`: bounded, renderer-owned Docker project file sessions for native open, save, export, and project action targeting.
|
||||
- `shell/credential_prompt.html` and `shell/credential_prompt.css`: static content and native-window layout for the shell-owned credential consent modal. Reuse the Launcher's shared dialog styles and never receive credential values.
|
||||
- `shell/host_access.js`: normalized Launcher Host access defaults, per-Instance configuration, scope dependencies, and stable Instance keys.
|
||||
- `shell/host_gateway.js`: supervised, newline-delimited JSON bridge to the installed `a0 gateway` child process.
|
||||
- `shell/a0_tag.js` and `shell/a0_tag_overlay.*`: A0 Tag lease/controller, tagged headless child contract, GNOME Wayland shortcut fallback, and the static shell-owned command/result surface.
|
||||
- `shell/a0_cli_install.js`: official A0 CLI installer command and release version policy used by Launcher CLI maintenance.
|
||||
- `shell/loading.html`: loading/error shell while content initializes.
|
||||
- `shell/launcher_update.js`: launcher update version formatting and legacy
|
||||
platform release-asset selection helpers.
|
||||
- `shell/launcher_updater_debug_release.js`: packaged updater metadata staging
|
||||
for DevTools-triggered upgrade, reinstall, and downgrade tests.
|
||||
- `shell/launcher_updater_artifacts.js`: updater cache cleanup marker and
|
||||
pending-download cleanup helpers.
|
||||
- `shell/launcher_updater_install_options.js`: updater diagnostic log path and
|
||||
install-option helpers.
|
||||
- `shell/launcher_update.js`: launcher update version formatting and legacy platform release-asset selection helpers.
|
||||
- `shell/launcher_updater_debug_release.js`: packaged updater metadata staging for DevTools-triggered upgrade, reinstall, and downgrade tests.
|
||||
- `shell/launcher_updater_artifacts.js`: updater cache cleanup marker and pending-download cleanup helpers.
|
||||
- `shell/launcher_updater_install_options.js`: updater diagnostic log path and install-option helpers.
|
||||
- `shell/assets/`: application icons and platform entitlements.
|
||||
- `shell/docker_manager/`: Agent Zero image and instance orchestration.
|
||||
- `shell/docker_adapter/`: Docker and registry abstraction layer.
|
||||
|
||||
## Local Contracts
|
||||
|
||||
- Keep renderer windows on `contextIsolation: true`, `nodeIntegration: false`,
|
||||
and `sandbox: true` unless an exception is documented here.
|
||||
- Do not expose `ipcRenderer`, raw channels, filesystem paths, shell execution,
|
||||
or Docker objects directly to the renderer.
|
||||
- The preload bridge exposes named methods only. New IPC must be added to both
|
||||
`shell/preload.js` and `shell/main.js` deliberately.
|
||||
- Validate IPC bodies in `shell/main.js` before passing values to
|
||||
`shell/docker_manager`.
|
||||
- New windows that open Agent Zero UIs or remote instances must sanitize URLs and
|
||||
allow only `http:` or `https:`.
|
||||
- The A0 CLI terminal IPC may accept a local `http:` or `https:` URL without
|
||||
credentials, or a saved remote Instance ID. Remote CLI launches must resolve
|
||||
the saved URL in `shell/main.js`; the renderer must not pass arbitrary remote
|
||||
URLs. Terminal launch should stay shell-owned and work across Windows, macOS,
|
||||
and Linux when the `a0` CLI is installed or available in a sibling
|
||||
`a0-connector` development checkout. Launcher-owned instance launches should
|
||||
pass the known host directly to the CLI and only use CLI flags advertised by
|
||||
that installed `a0 --help`; use the direct `--connect` plus
|
||||
`--no-docker-discovery` path only when supported, otherwise pass `--host` and
|
||||
let the installed CLI use its normal discovery/autoconnect behavior. Before
|
||||
launching, the shell should use a native directory picker so the user chooses
|
||||
the CLI working folder; canceling that picker is a quiet no-op. Start the
|
||||
interactive CLI through a launcher-owned wrapper script rather than a long
|
||||
inline shell command so Textual receives normal terminal input. If an Instance
|
||||
has launcher-saved credentials, pass them to `a0` only as ephemeral
|
||||
`A0_USERNAME` and `A0_PASSWORD` environment variables for that terminal launch
|
||||
when the target is local loopback or remote `https:`; do not write passwords
|
||||
into wrapper scripts or command lines.
|
||||
- After Electron becomes ready, the shell asynchronously ensures that the
|
||||
system A0 CLI is installed, advertises the Launcher gateway contract, and is
|
||||
current with the latest discoverable `a0-connector` release. Use only the
|
||||
official fixed installer endpoint, keep failures non-blocking for the rest of
|
||||
Launcher, and expose checking/installing state to the renderer. The named
|
||||
`Install A0 CLI` intent is visible only while the system CLI is missing and
|
||||
must report completion instead of merely opening a terminal. Do not expose
|
||||
generic command execution. Installing or updating the CLI is not Host access
|
||||
consent; gateway startup still requires an enabled saved choice and an open
|
||||
eligible Instance tab. Preserve user-requested gateway disconnection while
|
||||
stopping and restarting other leases around CLI maintenance.
|
||||
- Compatible installed CLIs update through `a0 update`; missing or gateway-incompatible
|
||||
CLIs use the official installer. Windows downloads that installer to a unique
|
||||
temporary `.ps1` file and runs PowerShell `-File` with `RemoteSigned`, then
|
||||
removes it on success or failure. Keep the installer child supervised rather
|
||||
than detached/unreferenced. Do not use inline download-and-execute or
|
||||
`ExecutionPolicy Bypass`. Update completion requires the inherited output pipes
|
||||
to close and the CLI updater's `Update complete. Run a0.` success line; the
|
||||
initial CLI process exiting only confirms handoff. Update failure must not
|
||||
trigger an automatic installer fallback.
|
||||
- A0 CLI v2.5 is the first release expected to advertise the Launcher gateway
|
||||
contract. Keep actual gateway startup capability-gated so compatible
|
||||
development checkouts and future versions work without version-specific
|
||||
branches.
|
||||
- A0 CLI v2.6 is the first release expected to advertise
|
||||
`computer_use_setup_v1`. The shell must capability-gate that command, correlate
|
||||
every request/result with `request_id`, reject pending requests on timeout or
|
||||
gateway exit, and keep the base gateway usable when the setup capability is
|
||||
absent. On macOS, the Electron shell owns the Accessibility prompt so TCC
|
||||
authorizes the actual packaged Launcher or Electron dev build; prompt once,
|
||||
poll silently, then let the connector continue staged Screen Recording and
|
||||
runtime validation. Later preflights remain non-prompting.
|
||||
- External links should open through Electron `shell.openExternal` only after
|
||||
validation. Approved public launcher resources such as Docs, API Dashboard,
|
||||
and Support should be exposed to the renderer as fixed resource IDs, not
|
||||
arbitrary URL strings.
|
||||
- Instance UI tabs are shell-owned `WebContentsView`s. Renderer code may request
|
||||
open/select/select launcher home/close/reload/reorder/detach/reattach and report viewport
|
||||
bounds, but URL resolution, URL validation, web contents lifecycle, and
|
||||
detached windows stay in `shell/main.js`. Preserve fractional CSS viewport
|
||||
coordinates until converting their origin with the Launcher renderer's zoom
|
||||
factor. Attached views fill the current native content bounds from that origin,
|
||||
including on main-window resize; do not multiply by display pixel density or
|
||||
use the embedded page's zoom. Null bounds still hide the view for Launcher
|
||||
modals and tab dragging. Detach reparents the existing view
|
||||
below a Launcher-owned header; reattach moves that same view back without a
|
||||
page reload. Main-window layout passes must leave detached views untouched
|
||||
because their detached windows own those bounds. Local `Open UI` requests
|
||||
should wait briefly for a freshly running container's HTTP UI before returning an
|
||||
unavailable error. Hide a new attached or detached view until its first load
|
||||
completes so the renderer's loading state remains visible. Renderer open
|
||||
requests may pass a bounded Agent Zero section selector such as
|
||||
`self-update`; the shell validates the Instance URL,
|
||||
then opens only the matching known in-page Agent Zero modal or same-origin
|
||||
anchor. If a local Instance or saved remote Instance has
|
||||
launcher-saved credentials, `Open UI` may POST them to the same-origin Agent
|
||||
Zero `/login` route in the shell-owned browser session before loading the
|
||||
tab, and an already-open tab may repeat that recovery when a restart sends
|
||||
it back to `/login`; remote credential POSTs must stay on `https:` URLs
|
||||
unless the target is local loopback. Do not put credentials in URLs or expose
|
||||
decrypted passwords to the renderer. After a successful same-origin manual
|
||||
`/login` redirect, an eligible Instance tab with no saved credentials may
|
||||
show one branded modal child window with `Save credentials` / `Not now`.
|
||||
Observe the form only in the shell, never pass credential values into the
|
||||
static modal content, retain them only in memory until that choice, and
|
||||
persist them through the existing secure store only after explicit consent.
|
||||
After a tab starts from a validated
|
||||
Instance URL, in-tab navigation may stay on that Agent Zero origin, including
|
||||
same-origin anchors and callbacks; safe off-origin `http:` and `https:` URLs
|
||||
should open through the user's external browser. Embedded and detached Agent Zero UI
|
||||
web contents
|
||||
should attach the same shell-owned edit context menu so selected text and
|
||||
editable fields keep normal copy/paste behavior. F5 from an active attached or
|
||||
detached Instance surface must refresh that Instance page through the same
|
||||
cache-bypassing path as its Reload button, so an Agent Zero restart cannot
|
||||
strand aborted UI assets in the embedded view.
|
||||
- Tab selection shortcuts use shell-owned `before-input-event` handling on the
|
||||
main renderer and the active attached Instance page, then reuse the existing
|
||||
selection paths and focus the selected surface. Cmd+1..9 on macOS and
|
||||
Ctrl+1..9 on Windows/Linux select the corresponding visible position, counting
|
||||
Launcher as 1. Ctrl+Tab and Ctrl+Shift+Tab cycle through Launcher and attached
|
||||
Instances in their current drag order, wrapping at either end. Detached
|
||||
surfaces and temporarily hidden active views do not switch the main window's
|
||||
tabs. Unmatched shortcuts remain available to the focused page.
|
||||
- Instance favicon updates come from the page's native `page-favicon-updated`
|
||||
event. Fetch same-origin HTTP(S) through that Instance's Electron session and
|
||||
decode inline image data locally, with a five-second timeout, no redirects,
|
||||
and a 64 KiB image limit. Publish only bounded image data URLs in tab snapshots;
|
||||
ignore stale navigation/update results. Favicons remain transient and never
|
||||
overwrite saved custom icon IDs or expose remote URLs to the Launcher renderer.
|
||||
The named `chooseInstanceIcon` IPC uses a native image/SVG chooser, returns
|
||||
at most 5 MiB of selected image data, and keeps file paths shell-owned. The
|
||||
renderer prepares a compact image; existing appearance saves validate and
|
||||
persist only bounded image data URLs or known icon IDs.
|
||||
Appearance colours accept only known preset IDs or normalized `#rrggbb`
|
||||
values; reject other CSS expressions at the shared state/snapshot boundary.
|
||||
- Each eligible Launcher-owned Instance surface may own exactly one outbound
|
||||
`a0 gateway` child. Start it only after an embedded tab opens, keep it alive
|
||||
across Launcher-home selection and in-tab reloads, and transfer that same
|
||||
lease when the tab moves into a detached window. Stop it when the owning tab
|
||||
or detached window closes, its current web contents are destroyed, or the app
|
||||
cleans up. Graceful shutdown must be allowed to finish before Electron exits
|
||||
so remote shell groups, browser sessions, Computer Use sessions, and the
|
||||
WebSocket are not orphaned.
|
||||
- Missing Host access preferences normalize with the local master state off.
|
||||
Preserve explicit saved Instance choices ahead of tab/runtime snapshots;
|
||||
Settings owns local defaults and Create/Add Instance is the single initial
|
||||
opt-in point. The retained onboarding field is compatibility state only and
|
||||
must not gate gateway startup. Legacy loopback DevTools WebSocket browser
|
||||
selections from older connectors normalize to automatic detection so a
|
||||
restarted browser's port/GUID cannot remain pinned. Browser preparation's
|
||||
outer Launcher timeout must outlive the connector's bounded CDP attach so its
|
||||
structured result reaches the renderer.
|
||||
- Launcher gateway supervision must use the installed CLI contract and JSONL
|
||||
stdin/stdout; it must not open an inbound port or expose a generic process
|
||||
surface through preload. Pass credentials only as ephemeral environment
|
||||
variables, never arguments or renderer state. Capability-gate startup on
|
||||
`launcher_gateway` plus `launcher_gateway_file_write` HTTP support and
|
||||
`launcher_gateway_control` WebSocket
|
||||
support, and select CLI candidates by their advertised `a0 gateway` contract
|
||||
rather than a release number so a capable sibling development checkout can
|
||||
follow an older installed CLI. Contract, authentication, and runtime exits
|
||||
stay stopped until an explicit Retry; a user-requested Disconnect is
|
||||
suppressed until the Launcher Host access modal reconnects that same lease or
|
||||
its owning tab/window closes.
|
||||
Keep gateway identity stable for the Launcher installation across tabs,
|
||||
preserve saved reverse-proxy base paths, reject URL credentials, and bound
|
||||
JSONL input before it enters renderer state. Treat stdout as a strict JSONL
|
||||
contract, require versioned status to match the requested gateway identity,
|
||||
send `file_read` for the separate read permission, and terminate children
|
||||
that do not publish valid status within the bounded startup window. The CLI
|
||||
reserves the older `files` argument for legacy read/write Launchers.
|
||||
- A0 Tag stays shell-owned and capability-gated on gateway feature
|
||||
`a0_tag_v1`. The renderer may request a bounded profile list through one
|
||||
named action, but never receives generic gateway commands, target tokens,
|
||||
prompt context, credentials, or process handles. The selected Instance tab
|
||||
or detached-window lease, Host access master, and Computer Use scope must be
|
||||
live before shortcut registration and again before exact replacement.
|
||||
- A0 Tag uses `CommandOrControl+Shift+Enter`, permits one invocation, sends the
|
||||
bounded prompt/context on stdin to a new capability-silent tagged chat, and
|
||||
treats the Main model's validated replace/action marker as delivery metadata.
|
||||
Replace mode may mutate only the helper's revalidated captured range and must
|
||||
never press Enter. Action mode uses ordinary Agent Zero Computer Use and
|
||||
reports its summary in the static sandboxed Copy/Dismiss overlay.
|
||||
- If capture fails only because the foreground app exposes no safe inline tag
|
||||
range, the same invocation may open the static shell-owned command palette.
|
||||
Keep it sandboxed and context-isolated, accept only a bounded query, exact
|
||||
live profile key through the narrow local navigation intent, normalize every
|
||||
accepted palette request to Computer scope, and close it before tagged
|
||||
execution so the prior app can regain focus. That app is the natural starting
|
||||
context when the request refers to the current app, not a confinement rule.
|
||||
Protected fields, lease/permission/capability failures, and
|
||||
apply/revalidation failures remain fail-closed errors. Palette requests have
|
||||
no Launcher replacement target; only ordinary inherited Computer Use may
|
||||
operate another application.
|
||||
- The palette's `+` menu may expose only Attach file and Attach folder through
|
||||
Electron's native chooser. Exact selected paths stay in the main process and
|
||||
may cross only the correlated `a0_tag_upload` gateway command; the sandboxed
|
||||
renderer receives bounded basenames/counts, and tagged argv receives only
|
||||
validated `/a0/usr/uploads/` references. Folder selection means its regular
|
||||
files, matching the WebUI composer; do not add renderer file access, upload
|
||||
credentials, a second HTTP client, or implicit workspace scanning.
|
||||
Anchor the menu to its `+` trigger with the WebUI composer's four-pixel gap;
|
||||
do not anchor it to the outer palette card.
|
||||
On Linux Wayland, keep the transparent composer window at its expanded size
|
||||
and switch Electron's native window shape between the closed card and the
|
||||
open menu canvas; compositor-owned positioning makes resize/reposition move
|
||||
the visible card. Other platforms may retain the bottom-anchored resize path.
|
||||
- The palette microphone must reuse the exact leased Instance page's bundled
|
||||
`_whisper_stt` store through the existing narrow local navigation surface.
|
||||
On macOS, the shell must request native microphone consent for the actual
|
||||
packaged Launcher or Electron development identity before that Instance page
|
||||
starts recording; denied consent remains macOS-owned and requires the normal
|
||||
System Settings plus application-restart recovery.
|
||||
Keep raw microphone audio, device selection, silence detection, model loading,
|
||||
transcription requests, and Agent Zero toast calls inside that authenticated
|
||||
Instance web contents. Launcher may receive only a bounded final transcript,
|
||||
cancellation/error state, and the plugin's configured draft/send choice.
|
||||
Read the same Instance's status before recording and surface a bounded footer
|
||||
notice when Whisper or its selected model must be prepared, downloaded, or
|
||||
loaded; backend errors still use the mirrored palette toast.
|
||||
Closing, submitting, lease loss, or pressing the microphone again must stop
|
||||
the live plugin microphone session. Do not add an overlay preload, renderer
|
||||
credentials, raw-audio IPC, or a second speech service.
|
||||
- Prefer Electron `globalShortcut`. On GNOME Wayland only, if the desktop lacks
|
||||
the GlobalShortcuts portal, one reversible native custom media-key binding
|
||||
may signal the current Launcher process. It must check conflicts, preserve
|
||||
foreign bindings, exist only while the exact lease is ready, and remove only
|
||||
its own path on lease loss/shutdown. The fallback command must match both the
|
||||
current PID and its Linux process start time before signaling, so stale PID
|
||||
reuse cannot target an unrelated process. Never replace it with a keylogger
|
||||
or clipboard/accessibility watcher. Do not create a progress BrowserWindow
|
||||
on Linux Wayland because it can steal the origin field's active state; use a
|
||||
non-focusing native notification for working/busy feedback there. The
|
||||
explicitly requested, focusable command palette is the only working-phase
|
||||
window exception; it must be closed before model or Computer Use work starts.
|
||||
- Generic gateway command failures continue to publish actionable Host access
|
||||
status by default. A caller may opt out only for a correlated recoverable
|
||||
operation such as an invalid A0 Tag field; the structured request must still
|
||||
reject while the underlying connected gateway status stays usable.
|
||||
- Embedded and detached Launcher-owned Agent Zero web contents must append
|
||||
`A0-Launcher/<version>` to the user agent. This tag identifies the shell-owned
|
||||
browsing surface; it does not grant authentication or gateway authority, and
|
||||
Agent Zero pages receive no Launcher Host access preload. The detached
|
||||
Launcher's own header may use the normal named renderer bridge for its tab,
|
||||
modal visibility, reload, and reattach intents; main-process handlers must
|
||||
resolve the caller back to its owning detached window before moving its view.
|
||||
- Local development content is selected by `A0_LAUNCHER_LOCAL_REPO`,
|
||||
`A0_LAUNCHER_USE_LOCAL_CONTENT`, a repo-shaped default-app current working
|
||||
directory, a repo-shaped unpackaged-app current working directory, or the
|
||||
first non-option app path in a default-app Electron launch. The default-app
|
||||
path matters for Windows RunOnce runtime setup resumes, where the original
|
||||
environment variables may be gone.
|
||||
- Local-content development prefers the adjacent `a0-connector` virtualenv over
|
||||
the installed A0 CLI so coupled unreleased capabilities use the matching
|
||||
gateway; explicit `A0_CLI_PATH` remains authoritative, while non-local runs
|
||||
continue to prefer the installed CLI.
|
||||
- Non-local content comes from the configured GitHub Release `content.json`
|
||||
asset and is unpacked under Electron `userData`. Downloaded release content
|
||||
must be written to a staging directory first, then swapped into
|
||||
`app_content`, so a failed cleanup or partial extraction cannot destroy the
|
||||
last usable cache.
|
||||
- Packaged launcher executable update prompts use `electron-updater` metadata
|
||||
from the launcher GitHub Release. A newer executable may hold
|
||||
`shell/loading.html` with `Update` and `Continue`; `Update` downloads the
|
||||
updater payload, then becomes a restart/install action once downloaded. Before
|
||||
`quitAndInstall()`, stop active gateway leases and run the installed CLI's
|
||||
`a0 update` handoff; a CLI update failure is logged but must not strand the
|
||||
downloaded Launcher update.
|
||||
- `electron-updater` stays configured with `autoDownload: false`,
|
||||
`autoInstallOnAppQuit: false`, web installers disabled, and differential
|
||||
download disabled. User intent must start download and install.
|
||||
- The preload bridge intentionally exposes a DevTools debugging surface at
|
||||
`window.space` and `window.launcherUpdater` with `checkForUpdates()`,
|
||||
`downloadUpdate()`, `installUpdate()`, and `debugReinstall(version)`.
|
||||
`debugReinstall` may stage upgrades, reinstalls, or downgrades by reading the
|
||||
requested release metadata; keep it package-only and updater-owned.
|
||||
- Startup begins in a transparent, frameless splash window that shows only the
|
||||
launcher icon and title. Before app content opens, `shell/main.js` sends the
|
||||
splash exit event, replaces that splash with the normal framed app window,
|
||||
then loads `a0app://content/index.html`. Keep the JavaScript hold durations
|
||||
aligned with the CSS animations, wait for the splash document itself instead
|
||||
of guessing its readiness, and do not add secondary decorative waits.
|
||||
Actionable update text and controls must remain legible over arbitrary desktop
|
||||
backgrounds by using solid, high-contrast Agent Zero palette surfaces. Use the
|
||||
bundled Rubik face with a swap fallback so typography never gates startup.
|
||||
The initial update-available view uses only Update and Continue; reserve the
|
||||
status row for progress and failure feedback.
|
||||
- Release bundles may contain legacy string file entries or structured
|
||||
`{ encoding, data }` entries. The loader must preserve `utf8` text and decode
|
||||
`base64` binary assets while rejecting unsafe paths.
|
||||
- Legacy cache metadata with `version: "dev-local"` must never block release
|
||||
updates. Use explicit local-content mode for development instead of
|
||||
future-dated sentinel timestamps.
|
||||
- The `a0app://` custom protocol is the renderer content origin; keep URL
|
||||
resolution, fetch, and CSP compatible with that scheme.
|
||||
- `content_meta.json` owns the downloaded content version exposed through
|
||||
shell metadata.
|
||||
- `app.getVersion()` owns the launcher app version exposed to the renderer for
|
||||
diagnostics and update decisions. The default renderer header does not show
|
||||
visible launcher version text.
|
||||
- `electronAPI` owns shell metadata: status/error listeners, app/content version,
|
||||
and icon data URL.
|
||||
- Keep renderer windows on `contextIsolation: true`, `nodeIntegration: false`, and `sandbox: true` unless an exception is documented here.
|
||||
- Do not expose `ipcRenderer`, raw channels, filesystem paths, shell execution, or Docker objects directly to the renderer.
|
||||
- The preload bridge exposes named methods only. New IPC must be added to both `shell/preload.js` and `shell/main.js` deliberately.
|
||||
- Validate IPC bodies in `shell/main.js` before passing values to `shell/docker_manager`.
|
||||
- New windows that open Agent Zero UIs or remote instances must sanitize URLs and allow only `http:` or `https:`.
|
||||
- The A0 CLI terminal IPC may accept a local `http:` or `https:` URL without credentials, or a saved remote Instance ID. Remote CLI launches must resolve the saved URL in `shell/main.js`; the renderer must not pass arbitrary remote URLs. Terminal launch should stay shell-owned and work across Windows, macOS, and Linux when the `a0` CLI is installed or available in a sibling `a0-connector` development checkout. Launcher-owned instance launches should pass the known host directly to the CLI and only use CLI flags advertised by that installed `a0 --help`; use the direct `--connect` plus `--no-docker-discovery` path only when supported, otherwise pass `--host` and let the installed CLI use its normal discovery/autoconnect behavior. Before launching, the shell should use a native directory picker so the user chooses the CLI working folder; canceling that picker is a quiet no-op. Start the interactive CLI through a launcher-owned wrapper script rather than a long inline shell command so Textual receives normal terminal input. If an Instance has launcher-saved credentials, pass them to `a0` only as ephemeral `A0_USERNAME` and `A0_PASSWORD` environment variables for that terminal launch when the target is local loopback or remote `https:`; do not write passwords into wrapper scripts or command lines.
|
||||
- After Electron becomes ready, the shell asynchronously ensures that the system A0 CLI is installed, advertises the Launcher gateway contract, and is current with the latest discoverable `a0-connector` release. Use only the official fixed installer endpoint, keep failures non-blocking for the rest of Launcher, and expose checking/installing state to the renderer. The named `Install A0 CLI` intent is visible only while the system CLI is missing and must report completion instead of merely opening a terminal. Do not expose generic command execution. Installing or updating the CLI is not Host access consent; gateway startup still requires an enabled saved choice and an open eligible Instance tab. Preserve user-requested gateway disconnection while stopping and restarting other leases around CLI maintenance.
|
||||
- Compatible installed CLIs update through `a0 update`; missing or gateway-incompatible CLIs use the official installer. Windows downloads that installer to a unique temporary `.ps1` file and runs PowerShell `-File` with `RemoteSigned`, then removes it on success or failure. Keep the installer child supervised rather than detached/unreferenced. Do not use inline download-and-execute or `ExecutionPolicy Bypass`. Update completion requires the inherited output pipes to close and the CLI updater's `Update complete. Run a0.` success line; the initial CLI process exiting only confirms handoff. Update failure must not trigger an automatic installer fallback.
|
||||
- A0 CLI v2.5 is the first release expected to advertise the Launcher gateway contract. Keep actual gateway startup capability-gated so compatible development checkouts and future versions work without version-specific branches.
|
||||
- A0 CLI v2.6 is the first release expected to advertise `computer_use_setup_v1`. The shell must capability-gate that command, correlate every request/result with `request_id`, reject pending requests on timeout or gateway exit, and keep the base gateway usable when the setup capability is absent. On macOS, the Electron shell owns the Accessibility prompt so TCC authorizes the actual packaged Launcher or Electron dev build; prompt once, poll silently, then let the connector continue staged Screen Recording and runtime validation. Later preflights remain non-prompting.
|
||||
- External links should open through Electron `shell.openExternal` only after validation. Approved public launcher resources such as Docs, API Dashboard, and Support should be exposed to the renderer as fixed resource IDs, not arbitrary URL strings.
|
||||
- Instance UI tabs are shell-owned `WebContentsView`s. Renderer code may request open/select/select launcher home/close/reload/reorder/detach/reattach and report viewport bounds, but URL resolution, URL validation, web contents lifecycle, and detached windows stay in `shell/main.js`. Preserve fractional CSS viewport coordinates until converting their origin with the Launcher renderer's zoom factor. Attached views fill the current native content bounds from that origin, including on main-window resize; do not multiply by display pixel density or use the embedded page's zoom. Null bounds still hide the view for Launcher modals and tab dragging. Detach reparents the existing view below a Launcher-owned header; reattach moves that same view back without a page reload. Main-window layout passes must leave detached views untouched because their detached windows own those bounds. Local `Open UI` requests should wait briefly for a freshly running container's HTTP UI before returning an unavailable error. Hide a new attached or detached view until its first load completes so the renderer's loading state remains visible. Renderer open requests may pass a bounded Agent Zero section selector such as `self-update`; the shell validates the Instance URL, then opens only the matching known in-page Agent Zero modal or same-origin anchor. If a local Instance or saved remote Instance has launcher-saved credentials, `Open UI` may POST them to the same-origin Agent Zero `/login` route in the shell-owned browser session before loading the tab, and an already-open tab may repeat that recovery when a restart sends it back to `/login`; remote credential POSTs must stay on `https:` URLs unless the target is local loopback. Do not put credentials in URLs or expose decrypted passwords to the renderer. After a successful same-origin manual `/login` redirect, an eligible Instance tab with no saved credentials may show one branded modal child window with `Save credentials` / `Not now`. Observe the form only in the shell, never pass credential values into the static modal content, retain them only in memory until that choice, and persist them through the existing secure store only after explicit consent. After a tab starts from a validated Instance URL, in-tab navigation may stay on that Agent Zero origin, including same-origin anchors and callbacks; safe off-origin `http:` and `https:` URLs should open through the user's external browser. Embedded and detached Agent Zero UI web contents should attach the same shell-owned edit context menu so selected text and editable fields keep normal copy/paste behavior. F5 from an active attached or detached Instance surface must refresh that Instance page through the same cache-bypassing path as its Reload button, so an Agent Zero restart cannot strand aborted UI assets in the embedded view.
|
||||
- Tab selection shortcuts use shell-owned `before-input-event` handling on the main renderer and the active attached Instance page, then reuse the existing selection paths and focus the selected surface. Cmd+1..9 on macOS and Ctrl+1..9 on Windows/Linux select the corresponding visible position, counting Launcher as 1. Ctrl+Tab and Ctrl+Shift+Tab cycle through Launcher and attached Instances in their current drag order, wrapping at either end. Detached surfaces and temporarily hidden active views do not switch the main window's tabs. Unmatched shortcuts remain available to the focused page.
|
||||
- Instance favicon updates come from the page's native `page-favicon-updated` event. Fetch same-origin HTTP(S) through that Instance's Electron session and decode inline image data locally, with a five-second timeout, no redirects, and a 64 KiB image limit. Publish only bounded image data URLs in tab snapshots; ignore stale navigation/update results. Favicons remain transient and never overwrite saved custom icon IDs or expose remote URLs to the Launcher renderer. The named `chooseInstanceIcon` IPC uses a native image/SVG chooser, returns at most 5 MiB of selected image data, and keeps file paths shell-owned. The renderer prepares a compact image; existing appearance saves validate and persist only bounded image data URLs or known icon IDs. Appearance colours accept only known preset IDs or normalized `#rrggbb` values; reject other CSS expressions at the shared state/snapshot boundary.
|
||||
- Each eligible Launcher-owned Instance surface may own exactly one outbound `a0 gateway` child. Start it only after an embedded tab opens, keep it alive across Launcher-home selection and in-tab reloads, and transfer that same lease when the tab moves into a detached window. Stop it when the owning tab or detached window closes, its current web contents are destroyed, or the app cleans up. Graceful shutdown must be allowed to finish before Electron exits so remote shell groups, browser sessions, Computer Use sessions, and the WebSocket are not orphaned.
|
||||
- Missing Host access preferences normalize with the local master state off. Preserve explicit saved Instance choices ahead of tab/runtime snapshots; Settings owns local defaults and Create/Add Instance is the single initial opt-in point. The retained onboarding field is compatibility state only and must not gate gateway startup. Legacy loopback DevTools WebSocket browser selections from older connectors normalize to automatic detection so a restarted browser's port/GUID cannot remain pinned. Browser preparation's outer Launcher timeout must outlive the connector's bounded CDP attach so its structured result reaches the renderer.
|
||||
- Launcher gateway supervision must use the installed CLI contract and JSONL stdin/stdout; it must not open an inbound port or expose a generic process surface through preload. Pass credentials only as ephemeral environment variables, never arguments or renderer state. Capability-gate startup on `launcher_gateway` plus `launcher_gateway_file_write` HTTP support and `launcher_gateway_control` WebSocket support, and select CLI candidates by their advertised `a0 gateway` contract rather than a release number so a capable sibling development checkout can follow an older installed CLI. Contract, authentication, and runtime exits stay stopped until an explicit Retry; a user-requested Disconnect is suppressed until the Launcher Host access modal reconnects that same lease or its owning tab/window closes. Keep gateway identity stable for the Launcher installation across tabs, preserve saved reverse-proxy base paths, reject URL credentials, and bound JSONL input before it enters renderer state. Treat stdout as a strict JSONL contract, require versioned status to match the requested gateway identity, send `file_read` for the separate read permission, and terminate children that do not publish valid status within the bounded startup window. The CLI reserves the older `files` argument for legacy read/write Launchers.
|
||||
- A0 Tag stays shell-owned and capability-gated on gateway feature `a0_tag_v1`. The renderer may request a bounded profile list through one named action, but never receives generic gateway commands, target tokens, prompt context, credentials, or process handles. The selected Instance tab or detached-window lease, Host access master, and Computer Use scope must be live before shortcut registration and again before exact replacement.
|
||||
- A0 Tag uses `CommandOrControl+Shift+Enter`, permits one invocation, sends the bounded prompt/context on stdin to a new capability-silent tagged chat, and treats the Main model's validated replace/action marker as delivery metadata. Replace mode may mutate only the helper's revalidated captured range and must never press Enter. Action mode uses ordinary Agent Zero Computer Use and reports its summary in the static sandboxed Copy/Dismiss overlay.
|
||||
- If capture fails only because the foreground app exposes no safe inline tag range, the same invocation may open the static shell-owned command palette. Keep it sandboxed and context-isolated, accept only a bounded query, exact live profile key through the narrow local navigation intent, normalize every accepted palette request to Computer scope, and close it before tagged execution so the prior app can regain focus. That app is the natural starting context when the request refers to the current app, not a confinement rule. Protected fields, lease/permission/capability failures, and apply/revalidation failures remain fail-closed errors. Palette requests have no Launcher replacement target; only ordinary inherited Computer Use may operate another application.
|
||||
- The palette's `+` menu may expose only Attach file and Attach folder through Electron's native chooser. Exact selected paths stay in the main process and may cross only the correlated `a0_tag_upload` gateway command; the sandboxed renderer receives bounded basenames/counts, and tagged argv receives only validated `/a0/usr/uploads/` references. Folder selection means its regular files, matching the WebUI composer; do not add renderer file access, upload credentials, a second HTTP client, or implicit workspace scanning. Anchor the menu to its `+` trigger with the WebUI composer's four-pixel gap; do not anchor it to the outer palette card. On Linux Wayland, keep the transparent composer window at its expanded size and switch Electron's native window shape between the closed card and the open menu canvas; compositor-owned positioning makes resize/reposition move the visible card. Other platforms may retain the bottom-anchored resize path.
|
||||
- The palette microphone must reuse the exact leased Instance page's bundled `_whisper_stt` store through the existing narrow local navigation surface. On macOS, the shell must request native microphone consent for the actual packaged Launcher or Electron development identity before that Instance page starts recording; denied consent remains macOS-owned and requires the normal System Settings plus application-restart recovery. Keep raw microphone audio, device selection, silence detection, model loading, transcription requests, and Agent Zero toast calls inside that authenticated Instance web contents. Launcher may receive only a bounded final transcript, cancellation/error state, and the plugin's configured draft/send choice. Read the same Instance's status before recording and surface a bounded footer notice when Whisper or its selected model must be prepared, downloaded, or loaded; backend errors still use the mirrored palette toast. Closing, submitting, lease loss, or pressing the microphone again must stop the live plugin microphone session. Do not add an overlay preload, renderer credentials, raw-audio IPC, or a second speech service.
|
||||
- Prefer Electron `globalShortcut`. On GNOME Wayland only, if the desktop lacks the GlobalShortcuts portal, one reversible native custom media-key binding may signal the current Launcher process. It must check conflicts, preserve foreign bindings, exist only while the exact lease is ready, and remove only its own path on lease loss/shutdown. The fallback command must match both the current PID and its Linux process start time before signaling, so stale PID reuse cannot target an unrelated process. Never replace it with a keylogger or clipboard/accessibility watcher. Do not create a progress BrowserWindow on Linux Wayland because it can steal the origin field's active state; use a non-focusing native notification for working/busy feedback there. The explicitly requested, focusable command palette is the only working-phase window exception; it must be closed before model or Computer Use work starts.
|
||||
- Generic gateway command failures continue to publish actionable Host access status by default. A caller may opt out only for a correlated recoverable operation such as an invalid A0 Tag field; the structured request must still reject while the underlying connected gateway status stays usable.
|
||||
- Embedded and detached Launcher-owned Agent Zero web contents must append `A0-Launcher/<version>` to the user agent. This tag identifies the shell-owned browsing surface; it does not grant authentication or gateway authority, and Agent Zero pages receive no Launcher Host access preload. The detached Launcher's own header may use the normal named renderer bridge for its tab, modal visibility, reload, and reattach intents; main-process handlers must resolve the caller back to its owning detached window before moving its view.
|
||||
- Local development content is selected by `A0_LAUNCHER_LOCAL_REPO`, `A0_LAUNCHER_USE_LOCAL_CONTENT`, a repo-shaped default-app current working directory, a repo-shaped unpackaged-app current working directory, or the first non-option app path in a default-app Electron launch. The default-app path matters for Windows RunOnce runtime setup resumes, where the original environment variables may be gone.
|
||||
- Local-content development prefers the adjacent `a0-connector` virtualenv over the installed A0 CLI so coupled unreleased capabilities use the matching gateway; explicit `A0_CLI_PATH` remains authoritative, while non-local runs continue to prefer the installed CLI.
|
||||
- Non-local content comes from the configured GitHub Release `content.json` asset and is unpacked under Electron `userData`. Downloaded release content must be written to a staging directory first, then swapped into `app_content`, so a failed cleanup or partial extraction cannot destroy the last usable cache.
|
||||
- Packaged launcher executable update prompts use `electron-updater` metadata from the launcher GitHub Release. A newer executable may hold `shell/loading.html` with `Update` and `Continue`; `Update` downloads the updater payload, then becomes a restart/install action once downloaded. Before `quitAndInstall()`, stop active gateway leases and run the installed CLI's `a0 update` handoff; a CLI update failure is logged but must not strand the downloaded Launcher update.
|
||||
- `electron-updater` stays configured with `autoDownload: false`, `autoInstallOnAppQuit: false`, web installers disabled, and differential download disabled. User intent must start download and install.
|
||||
- The preload bridge intentionally exposes a DevTools debugging surface at `window.space` and `window.launcherUpdater` with `checkForUpdates()`, `downloadUpdate()`, `installUpdate()`, and `debugReinstall(version)`. `debugReinstall` may stage upgrades, reinstalls, or downgrades by reading the requested release metadata; keep it package-only and updater-owned.
|
||||
- Startup begins in a transparent, frameless splash window that shows only the launcher icon and title. Before app content opens, `shell/main.js` sends the splash exit event, replaces that splash with the normal framed app window, then loads `a0app://content/index.html`. Keep the JavaScript hold durations aligned with the CSS animations, wait for the splash document itself instead of guessing its readiness, and do not add secondary decorative waits. Actionable update text and controls must remain legible over arbitrary desktop backgrounds by using solid, high-contrast Agent Zero palette surfaces. Use the bundled Rubik face with a swap fallback so typography never gates startup. The initial update-available view uses only Update and Continue; reserve the status row for progress and failure feedback.
|
||||
- Release bundles may contain legacy string file entries or structured `{ encoding, data }` entries. The loader must preserve `utf8` text and decode `base64` binary assets while rejecting unsafe paths.
|
||||
- Legacy cache metadata with `version: "dev-local"` must never block release updates. Use explicit local-content mode for development instead of future-dated sentinel timestamps.
|
||||
- The `a0app://` custom protocol is the renderer content origin; keep URL resolution, fetch, and CSP compatible with that scheme.
|
||||
- `content_meta.json` owns the downloaded content version exposed through shell metadata.
|
||||
- `app.getVersion()` owns the launcher app version exposed to the renderer for diagnostics and update decisions. The default renderer header does not show visible launcher version text.
|
||||
- `electronAPI` owns shell metadata: status/error listeners, app/content version, and icon data URL.
|
||||
- `dockerManagerAPI` owns all Docker Manager calls.
|
||||
- Runtime setup IPC is a named Docker Manager intent. The renderer may request
|
||||
setup/start, but assessment and privileged mechanics stay in
|
||||
`shell/docker_manager` and `shell/docker_adapter`.
|
||||
- Runtime preferences are soft. Endpoint detection must fall back when the
|
||||
preferred endpoint is unavailable without deleting the preference; a runtime
|
||||
explicitly started by the user becomes the new preferred endpoint.
|
||||
- Runtime discovery may expose multiple endpoint aliases for fallback, but
|
||||
renderer onboarding choices must be based on distinct verified Docker daemon
|
||||
identities rather than endpoint count.
|
||||
- Shell state sanitization may expose only the bounded runtime-candidate fields
|
||||
needed by the picker, including the narrowly validated installed-and-stopped
|
||||
Docker Desktop start state.
|
||||
- Docker Hub sign-in recovery is a named shell-owned intent. The renderer may
|
||||
request it, but `shell/main.js` must launch a visible wrapper around the real
|
||||
`docker login` flow instead of exposing generic command execution.
|
||||
- Developer custom-image runs are named Docker Manager intents. The renderer may
|
||||
pass image, tag, environment, port, mount, and pull preferences, but shell code
|
||||
must keep validation and Docker execution behind `shell/docker_manager`; do not
|
||||
add generic shell or Docker command IPC.
|
||||
- Developer project files stay shell-owned: native dialogs authorize one
|
||||
dedicated project folder per renderer, the renderer receives an opaque token
|
||||
plus bounded UTF-8 root-file contents, and saves may target only supported
|
||||
project-root filenames. Export uses a separate native save dialog. Docker
|
||||
project execution resolves the token back to the authorized root and passes
|
||||
only fixed Validate, Build, Up, Stop, Logs, or Down intents to Docker Manager.
|
||||
- Create local Instance may select only Agent Zero releases and local Agent Zero
|
||||
builds. Arbitrary Docker image execution remains an Advanced developer intent.
|
||||
- Docker CLI discovery for that sign-in flow should honor explicit
|
||||
`A0_DOCKER_CLI_PATH` or `DOCKER_CLI_PATH` overrides, then `PATH`, then known
|
||||
Docker Desktop, Homebrew, Linux package, and Snap locations before failing.
|
||||
- Windows client WSL setup may request UAC through an explicit runtime setup
|
||||
action. Keep that path narrowly scoped to WSL feature/distro setup; do not add
|
||||
generic command execution IPC.
|
||||
- Runtime state may expose HTTP(S) manual guide URLs, but `shell/main.js` must
|
||||
continue sanitizing that field before it reaches the renderer.
|
||||
- Long-running Docker operations should return an accepted operation id and
|
||||
report progress through Docker Manager events instead of blocking the renderer.
|
||||
The sanitized progress bridge should preserve explicit product state flags
|
||||
such as `uiReady` when the renderer depends on them for handoff behavior.
|
||||
Preserve image-pull `progressStartedAt` and numeric `progressStartValue` so
|
||||
modal and background-toast ETAs use the current phase's observed work.
|
||||
- Docker Manager refresh IPC accepts only a bounded forced/non-forced choice.
|
||||
Initial loading, tab navigation, and post-operation reconciliation use normal
|
||||
remote caches while rebuilding live local Docker state. Startup follows that
|
||||
first usable snapshot with a non-blocking forced remote refresh when its
|
||||
catalog predates the launch. Explicit Refresh remains forced.
|
||||
- The Settings page may submit its five owned preference sections through one
|
||||
named IPC intent. Validate and sanitize every section, persist one combined
|
||||
state update, and restart Host access leases through the existing shell path.
|
||||
- Sanitized Docker Manager state may expose bounded health-derived runtime
|
||||
identity fields for local and saved remote Instances; never forward arbitrary
|
||||
health response content.
|
||||
- Install image removal is a named Docker Manager IPC intent. The renderer may
|
||||
pass a release tag, but shell code must validate the IPC body and Docker
|
||||
Manager must perform a non-forced image removal so Docker can refuse images
|
||||
still used by any container.
|
||||
- Per-instance clone, rename, and Colour/Icon selection operations are named
|
||||
Docker Manager intents. Clone may accept a bounded `/a0/usr` category selection, but
|
||||
archive copy and filtering stay in `shell/docker_manager` and
|
||||
`shell/docker_adapter`. Appearance selection may accept only bounded palette
|
||||
and icon IDs and must stay launcher metadata. Long-running container
|
||||
mutations report progress.
|
||||
- Per-instance Restart is a named Docker Manager intent. It must use the
|
||||
adapter's native immediate container restart, stay in the per-container
|
||||
background queue, and wait for UI readiness before reporting completion.
|
||||
- Per-instance deletion may remove persistent workspace storage only after an
|
||||
explicit renderer choice. Root-owned host-workspace contents must be cleaned
|
||||
through the Docker adapter, and a cleanup failure after container deletion
|
||||
must report that partial result instead of claiming the Instance still exists.
|
||||
- Per-instance Backup and Restore are named Docker Manager intents. The shell
|
||||
owns native save/open dialogs for `.zip` files; Docker Manager owns the
|
||||
`/a0/usr` archive semantics and progress events.
|
||||
- Workspace storage preference and migration actions are named Docker Manager
|
||||
intents. They may expose storage mode/root/path-mode/volume fields, but
|
||||
Docker mount creation, migration, and archive copy behavior must stay in
|
||||
`shell/docker_manager` and `shell/docker_adapter`.
|
||||
- Opening an Instance storage folder is a named Docker Manager intent. The
|
||||
renderer passes a container id; the shell resolves and opens only validated
|
||||
host-directory workspace paths.
|
||||
- Per-instance Docker log inspection is a named, bounded, read-only Docker
|
||||
Manager intent. Do not expose raw Docker log commands or shell execution.
|
||||
- Error responses should use `dockerManager.toErrorResponse()` so renderer code
|
||||
sees a stable `{ code, message }` shape.
|
||||
- The no-argument `beginLocalSetup` IPC saves local onboarding intent without
|
||||
installing a runtime. Sanitized state exposes only `new`, `local`, `complete`,
|
||||
or null for unknown onboarding; completion belongs to Docker Manager state,
|
||||
independently of the legacy Host access onboarding field.
|
||||
- The launcher should not create a system tray/menu-bar status icon. Keep the
|
||||
normal app window plus platform Dock/taskbar entry as the only shell presence.
|
||||
- Runtime setup IPC is a named Docker Manager intent. The renderer may request setup/start, but assessment and privileged mechanics stay in `shell/docker_manager` and `shell/docker_adapter`.
|
||||
- Runtime preferences are soft. Endpoint detection must fall back when the preferred endpoint is unavailable without deleting the preference; a runtime explicitly started by the user becomes the new preferred endpoint.
|
||||
- Runtime discovery may expose multiple endpoint aliases for fallback, but renderer onboarding choices must be based on distinct verified Docker daemon identities rather than endpoint count.
|
||||
- Shell state sanitization may expose only the bounded runtime-candidate fields needed by the picker, including the narrowly validated installed-and-stopped Docker Desktop start state.
|
||||
- Docker Hub sign-in recovery is a named shell-owned intent. The renderer may request it, but `shell/main.js` must launch a visible wrapper around the real `docker login` flow instead of exposing generic command execution.
|
||||
- Developer custom-image runs are named Docker Manager intents. The renderer may pass image, tag, environment, port, mount, and pull preferences, but shell code must keep validation and Docker execution behind `shell/docker_manager`; do not add generic shell or Docker command IPC.
|
||||
- Developer project files stay shell-owned: native dialogs authorize one dedicated project folder per renderer, the renderer receives an opaque token plus bounded UTF-8 root-file contents, and saves may target only supported project-root filenames. Export uses a separate native save dialog. Docker project execution resolves the token back to the authorized root and passes only fixed Validate, Build, Up, Stop, Logs, or Down intents to Docker Manager.
|
||||
- Create local Instance may select only Agent Zero releases and local Agent Zero builds. Arbitrary Docker image execution remains an Advanced developer intent.
|
||||
- Docker CLI discovery for that sign-in flow should honor explicit `A0_DOCKER_CLI_PATH` or `DOCKER_CLI_PATH` overrides, then `PATH`, then known Docker Desktop, Homebrew, Linux package, and Snap locations before failing.
|
||||
- Windows client WSL setup may request UAC through an explicit runtime setup action. Keep that path narrowly scoped to WSL feature/distro setup; do not add generic command execution IPC.
|
||||
- Runtime state may expose HTTP(S) manual guide URLs, but `shell/main.js` must continue sanitizing that field before it reaches the renderer.
|
||||
- Long-running Docker operations should return an accepted operation id and report progress through Docker Manager events instead of blocking the renderer. The sanitized progress bridge should preserve explicit product state flags such as `uiReady` when the renderer depends on them for handoff behavior. Preserve image-pull `progressStartedAt` and numeric `progressStartValue` so modal and background-toast ETAs use the current phase's observed work.
|
||||
- Docker Manager refresh IPC accepts only a bounded forced/non-forced choice. Initial loading, tab navigation, and post-operation reconciliation use normal remote caches while rebuilding live local Docker state. Startup follows that first usable snapshot with a non-blocking forced remote refresh when its catalog predates the launch. Explicit Refresh remains forced.
|
||||
- The Settings page may submit its five owned preference sections through one named IPC intent. Validate and sanitize every section, persist one combined state update, and restart Host access leases through the existing shell path.
|
||||
- Sanitized Docker Manager state may expose bounded health-derived runtime identity fields for local and saved remote Instances; never forward arbitrary health response content.
|
||||
- Install image removal is a named Docker Manager IPC intent. The renderer may pass a release tag, but shell code must validate the IPC body and Docker Manager must perform a non-forced image removal so Docker can refuse images still used by any container.
|
||||
- Per-instance clone, rename, and Colour/Icon selection operations are named Docker Manager intents. Clone may accept a bounded `/a0/usr` category selection, but archive copy and filtering stay in `shell/docker_manager` and `shell/docker_adapter`. Appearance selection may accept only bounded palette and icon IDs and must stay launcher metadata. Long-running container mutations report progress.
|
||||
- Per-instance Restart is a named Docker Manager intent. It must use the adapter's native immediate container restart, stay in the per-container background queue, and wait for UI readiness before reporting completion.
|
||||
- Per-instance deletion may remove persistent workspace storage only after an explicit renderer choice. Root-owned host-workspace contents must be cleaned through the Docker adapter, and a cleanup failure after container deletion must report that partial result instead of claiming the Instance still exists.
|
||||
- Per-instance Backup and Restore are named Docker Manager intents. The shell owns native save/open dialogs for `.zip` files; Docker Manager owns the `/a0/usr` archive semantics and progress events.
|
||||
- Workspace storage preference and migration actions are named Docker Manager intents. They may expose storage mode/root/path-mode/volume fields, but Docker mount creation, migration, and archive copy behavior must stay in `shell/docker_manager` and `shell/docker_adapter`.
|
||||
- Opening an Instance storage folder is a named Docker Manager intent. The renderer passes a container id; the shell resolves and opens only validated host-directory workspace paths.
|
||||
- Per-instance Docker log inspection is a named, bounded, read-only Docker Manager intent. Do not expose raw Docker log commands or shell execution.
|
||||
- Error responses should use `dockerManager.toErrorResponse()` so renderer code sees a stable `{ code, message }` shape.
|
||||
- The no-argument `beginLocalSetup` IPC saves local onboarding intent without installing a runtime. Sanitized state exposes only `new`, `local`, `complete`, or null for unknown onboarding; completion belongs to Docker Manager state, independently of the legacy Host access onboarding field.
|
||||
- The launcher should not create a system tray/menu-bar status icon. Keep the normal app window plus platform Dock/taskbar entry as the only shell presence.
|
||||
|
||||
## Work Guidance
|
||||
|
||||
- Keep main-process code as orchestration. Put reusable Docker behavior in
|
||||
`shell/docker_manager` or `shell/docker_adapter`.
|
||||
- Prefer one IPC method per user intent rather than generic "run command"
|
||||
bridges.
|
||||
- When adding a renderer-visible action, update `shell/preload.js`,
|
||||
`shell/main.js`, `app/docker_manager.js`, and the owning `AGENTS.md` files in
|
||||
the same session.
|
||||
- Avoid platform-specific assumptions unless the code explicitly checks
|
||||
`process.platform`.
|
||||
- Keep main-process code as orchestration. Put reusable Docker behavior in `shell/docker_manager` or `shell/docker_adapter`.
|
||||
- Prefer one IPC method per user intent rather than generic "run command" bridges.
|
||||
- When adding a renderer-visible action, update `shell/preload.js`, `shell/main.js`, `app/docker_manager.js`, and the owning `AGENTS.md` files in the same session.
|
||||
- Avoid platform-specific assumptions unless the code explicitly checks `process.platform`.
|
||||
|
||||
## Verification
|
||||
|
||||
|
||||
+64
-198
@@ -2,223 +2,89 @@
|
||||
|
||||
## Purpose
|
||||
|
||||
`shell/docker_adapter/` owns the generic Docker and Docker Hub abstraction used
|
||||
by the launcher.
|
||||
`shell/docker_adapter/` owns the generic Docker and Docker Hub abstraction used by the launcher.
|
||||
|
||||
This layer should know Docker mechanics. It should not know launcher copy,
|
||||
renderer layout, or product-specific tab behavior.
|
||||
This layer should know Docker mechanics. It should not know launcher copy, renderer layout, or product-specific tab behavior.
|
||||
|
||||
## Ownership
|
||||
|
||||
This scope owns:
|
||||
|
||||
- `DockerInterface.mjs`: abstract interface, environment detection, host parsing,
|
||||
Dockerode option normalization, singleton construction, and shared typedefs.
|
||||
- `DockerCli.mjs`: cross-platform Docker CLI discovery and fixed Dockerfile or
|
||||
Compose project command execution against the selected runtime endpoint.
|
||||
- `docker_cli.test.mjs`: command-shape and non-destructive Compose regression
|
||||
checks.
|
||||
- `getDocker.js`: CommonJS bridge that dynamically imports the ESM interface for
|
||||
`shell/docker_manager`.
|
||||
- `DockerInterface.mjs`: abstract interface, environment detection, host parsing, Dockerode option normalization, singleton construction, and shared typedefs.
|
||||
- `DockerCli.mjs`: cross-platform Docker CLI discovery and fixed Dockerfile or Compose project command execution against the selected runtime endpoint.
|
||||
- `docker_cli.test.mjs`: command-shape and non-destructive Compose regression checks.
|
||||
- `getDocker.js`: CommonJS bridge that dynamically imports the ESM interface for `shell/docker_manager`.
|
||||
- `RuntimeProvisioner.mjs`: platform provisioner base and shared process helpers.
|
||||
- `runtime_provisioner.test.mjs`: runtime provisioner selection and parser
|
||||
smoke tests.
|
||||
- `impl/DockerodeDocker.mjs`: Dockerode-backed container inspection, commit
|
||||
snapshots, creation, lifecycle, volume, image, pull, and log operations.
|
||||
- `dockerode_docker.test.mjs`: Dockerode adapter regression tests for
|
||||
container state shaping.
|
||||
- `runtime_provisioner.test.mjs`: runtime provisioner selection and parser smoke tests.
|
||||
- `impl/DockerodeDocker.mjs`: Dockerode-backed container inspection, commit snapshots, creation, lifecycle, volume, image, pull, and log operations.
|
||||
- `dockerode_docker.test.mjs`: Dockerode adapter regression tests for container state shaping.
|
||||
- `impl/DockerHubRegistry.mjs`: Docker Hub registry and manifest/digest access.
|
||||
- `impl/DockerodeLogProcessor.mjs`: Docker pull/log stream processing.
|
||||
- `impl/ColimaRuntime.mjs`: macOS Colima/Lima assessment, self-contained
|
||||
component download, checksum verification, and dedicated runtime profile
|
||||
start mechanics.
|
||||
- `impl/LinuxEngineRuntime.mjs`: Linux native Docker Engine assessment, daemon
|
||||
start, and package-manager bootstrap mechanics.
|
||||
- `impl/WindowsWslDockerProxy.mjs`: Windows loopback bridge from
|
||||
`127.0.0.1:23750` to the WSL Docker Engine Unix socket.
|
||||
- `impl/WindowsWslRuntime.mjs`: Windows Docker Desktop, Windows client WSL
|
||||
Docker Engine, and Windows Server WSL2/nested-virtualization assessment.
|
||||
- `impl/ColimaRuntime.mjs`: macOS Colima/Lima assessment, self-contained component download, checksum verification, and dedicated runtime profile start mechanics.
|
||||
- `impl/LinuxEngineRuntime.mjs`: Linux native Docker Engine assessment, daemon start, and package-manager bootstrap mechanics.
|
||||
- `impl/WindowsWslDockerProxy.mjs`: Windows loopback bridge from `127.0.0.1:23750` to the WSL Docker Engine Unix socket.
|
||||
- `impl/WindowsWslRuntime.mjs`: Windows Docker Desktop, Windows client WSL Docker Engine, and Windows Server WSL2/nested-virtualization assessment.
|
||||
- `LOG_PROCESSOR.md`: explanatory implementation notes for log processing.
|
||||
|
||||
## Local Contracts
|
||||
|
||||
- `DockerInterface.mjs` is ESM by design. Keep the CommonJS bridge contained in
|
||||
`getDocker.js`.
|
||||
- Environment detection should be best-effort and return structured diagnostics
|
||||
rather than throwing for ordinary "Docker unavailable" cases.
|
||||
- Environment detection should probe likely platform endpoints when
|
||||
`DOCKER_HOST` is unset, including Linux native Engine, Docker Desktop for
|
||||
Linux, and rootless sockets.
|
||||
- Environment detection should build a deduplicated runtime endpoint registry
|
||||
before provisioning. Include launcher preference, `DOCKER_HOST`, Docker
|
||||
contexts, and known Docker-compatible provider sockets as candidates, then
|
||||
mark a candidate usable only after a Docker API probe succeeds.
|
||||
- Reachable endpoint candidates should expose Docker's daemon ID when available.
|
||||
Preserve endpoint aliases for preference and fallback; consumers may group
|
||||
verified matching daemon IDs when deciding whether more than one runtime is
|
||||
actually available. A missing daemon ID must not trigger a picker choice.
|
||||
- `DOCKER_HOST` parsing must preserve enough detail to diagnose Unix socket,
|
||||
named pipe, TCP, HTTP, HTTPS, and invalid host configurations.
|
||||
- Provider names such as Docker Desktop, Colima, OrbStack, Rancher Desktop, and
|
||||
Podman are labels around Docker-compatible endpoints. Do not treat Portainer
|
||||
as a runtime endpoint, and do not expose containerd/nerdctl-only paths as
|
||||
usable Docker endpoints.
|
||||
- Runtime provisioners are consulted only after the Docker Manager has tried to
|
||||
reuse an existing Docker endpoint. They should classify repairable states
|
||||
before proposing installation.
|
||||
- Runtime provisioners should report user-facing progress through `onProgress`
|
||||
for platform setup phases such as authorization, component download, Docker
|
||||
Engine install/start, follow-up/relogin, and Docker Desktop waiting. Keep the
|
||||
messages stable enough for Docker Manager to normalize into modal steps.
|
||||
- Colima reports explicit phases for Docker client preparation, nested startup
|
||||
logs, and final socket verification. Log lines containing `done` or `ready`
|
||||
must not complete setup before the runtime socket is reachable.
|
||||
- Runtime start and provision results should report the Docker endpoint they
|
||||
made reachable so the product layer can remember an explicit user choice.
|
||||
- Platform provisioners should expose Docker Desktop-only assessment and
|
||||
targeted start behavior so the product can offer an installed stopped Docker
|
||||
Desktop beside a different reachable daemon without disturbing that fallback.
|
||||
- Renderer-visible runtime assessment labels and details should use `Setup`,
|
||||
not `Set up`, `Set Up`, or `Setting up`; internal field names may remain
|
||||
`setup`.
|
||||
- macOS automatic provisioning uses a dedicated Colima profile named `a0`.
|
||||
It must not require Docker Desktop, Homebrew, or a privileged Docker socket
|
||||
symlink. Because Colima checks for a Docker client during startup, the
|
||||
provisioner may install Docker's official static macOS CLI into the
|
||||
launcher-owned runtime bin directory when the host does not provide one.
|
||||
- macOS assessment is reuse-first for an already installed Docker Desktop. If
|
||||
Docker Desktop is installed but its socket is not reachable, report a
|
||||
`docker_desktop` `engine_stopped` state so the product can ask the user to
|
||||
start it instead of offering a fresh download/setup path.
|
||||
- A missing macOS Colima runtime uses the same neutral initial setup description
|
||||
as Windows: `Finish local Agent Zero runtime Setup.` Active progress continues
|
||||
to describe its specific phase; Linux keeps its Docker Engine description.
|
||||
- Linux automatic provisioning uses the host package manager and starts native
|
||||
Docker Engine; it must not manage container CPU, memory, or disk sizing.
|
||||
Before native setup, recognize an installed stopped Docker Desktop through
|
||||
its user service or `/opt/docker-desktop`, start it with the unprivileged user
|
||||
service, and return its `~/.docker/desktop/docker.sock` endpoint.
|
||||
- Linux privileged setup prefers `pkexec` for desktop authentication and may use
|
||||
`sudo -n` only when `pkexec` is absent and passwordless sudo is already
|
||||
available.
|
||||
- Linux Engine permission repair should add the current user to the existing
|
||||
`docker` group when Docker is installed but the account is not a member yet,
|
||||
then report that a logout/login is required.
|
||||
- Windows assessment must not direct Windows Server users to Docker Desktop.
|
||||
Docker Desktop is for client Windows; Windows Server needs an existing Docker
|
||||
endpoint or a WSL2-backed Linux Docker Engine with nested virtualization.
|
||||
- Windows WSL Engine support must keep unauthenticated Docker API exposure on
|
||||
Windows loopback only. Do not bind Docker TCP on WSL public or non-loopback
|
||||
interfaces.
|
||||
- Windows WSL Engine detection may prepare the launcher-owned loopback bridge
|
||||
for the built-in `127.0.0.1:23750` endpoint before probing it, so an
|
||||
installed Ubuntu Docker Engine can be reused at startup without another setup
|
||||
modal.
|
||||
- Windows WSL Engine support must also keep the selected WSL distro alive while
|
||||
the launcher-owned loopback bridge is active; otherwise WSL can idle-stop and
|
||||
Docker marks healthy Linux containers as exited.
|
||||
- Windows WSL keepalive helpers must carry a launcher-specific marker and clean
|
||||
up their child sleep process on shutdown so app restarts do not leave orphaned
|
||||
WSL helper loops.
|
||||
- Windows WSL loopback detection may need a longer first probe than other
|
||||
Docker endpoints because starting the bridge can cold-start WSL. Keep that
|
||||
extra wait scoped to `127.0.0.1:23750`.
|
||||
- Windows client WSL onboarding details should stay Agent Zero-first for normal
|
||||
users. Reserve explicit Docker Desktop naming for Docker Desktop reuse or
|
||||
repair states, and keep low-level Docker Engine wording out of the primary
|
||||
setup path.
|
||||
- Windows clients with Docker Desktop installed but stopped must report a
|
||||
`docker_desktop` `engine_stopped` state with start guidance, not a Docker
|
||||
Desktop download or reinstall link.
|
||||
Discover both Program Files and per-user
|
||||
`%LOCALAPPDATA%/Programs/DockerDesktop` installations. Start Desktop with
|
||||
PowerShell's `Start-Process -FilePath` and report launch errors before waiting
|
||||
for its pipe. Never select Docker's private `docker-desktop` or
|
||||
`docker-desktop-data` WSL distributions for Engine setup or startup.
|
||||
- Windows client WSL feature installation may use a user-approved UAC prompt via
|
||||
`wsl.exe --install --no-distribution`; it must report restart/follow-up states
|
||||
instead of claiming Docker is ready immediately.
|
||||
- After the WSL feature reboot, Windows client assessment must be able to
|
||||
continue from ordinary user context. Do not rely only on admin-only optional
|
||||
feature queries; infer feature readiness from `wsl.exe` status/list output
|
||||
when it reports WSL2 is available but no distro is installed.
|
||||
- On Windows 10, `wsl.exe --install -d Ubuntu --no-launch` may install the
|
||||
Ubuntu Appx package without registering a WSL distro. The Windows client setup
|
||||
path should use the Ubuntu launcher root-registration path when available so
|
||||
users are not forced through an interactive Unix user setup.
|
||||
- Windows client WSL Docker Engine setup may install Docker Engine packages
|
||||
inside an existing Ubuntu WSL2 distro using Docker's official apt repository.
|
||||
Include the Python bridge dependency and keep Docker API access on the
|
||||
launcher-owned Windows loopback bridge.
|
||||
- The Windows loopback bridge may run its WSL helper as `root` so users do not
|
||||
need to manage Linux `docker` group membership during onboarding.
|
||||
- `DockerInterface.mjs` is ESM by design. Keep the CommonJS bridge contained in `getDocker.js`.
|
||||
- Environment detection should be best-effort and return structured diagnostics rather than throwing for ordinary "Docker unavailable" cases.
|
||||
- Environment detection should probe likely platform endpoints when `DOCKER_HOST` is unset, including Linux native Engine, Docker Desktop for Linux, and rootless sockets.
|
||||
- Environment detection should build a deduplicated runtime endpoint registry before provisioning. Include launcher preference, `DOCKER_HOST`, Docker contexts, and known Docker-compatible provider sockets as candidates, then mark a candidate usable only after a Docker API probe succeeds.
|
||||
- Reachable endpoint candidates should expose Docker's daemon ID when available. Preserve endpoint aliases for preference and fallback; consumers may group verified matching daemon IDs when deciding whether more than one runtime is actually available. A missing daemon ID must not trigger a picker choice.
|
||||
- `DOCKER_HOST` parsing must preserve enough detail to diagnose Unix socket, named pipe, TCP, HTTP, HTTPS, and invalid host configurations.
|
||||
- Provider names such as Docker Desktop, Colima, OrbStack, Rancher Desktop, and Podman are labels around Docker-compatible endpoints. Do not treat Portainer as a runtime endpoint, and do not expose containerd/nerdctl-only paths as usable Docker endpoints.
|
||||
- Runtime provisioners are consulted only after the Docker Manager has tried to reuse an existing Docker endpoint. They should classify repairable states before proposing installation.
|
||||
- Runtime provisioners should report user-facing progress through `onProgress` for platform setup phases such as authorization, component download, Docker Engine install/start, follow-up/relogin, and Docker Desktop waiting. Keep the messages stable enough for Docker Manager to normalize into modal steps.
|
||||
- Colima reports explicit phases for Docker client preparation, nested startup logs, and final socket verification. Log lines containing `done` or `ready` must not complete setup before the runtime socket is reachable.
|
||||
- Runtime start and provision results should report the Docker endpoint they made reachable so the product layer can remember an explicit user choice.
|
||||
- Platform provisioners should expose Docker Desktop-only assessment and targeted start behavior so the product can offer an installed stopped Docker Desktop beside a different reachable daemon without disturbing that fallback.
|
||||
- Renderer-visible runtime assessment labels and details should use `Setup`, not `Set up`, `Set Up`, or `Setting up`; internal field names may remain `setup`.
|
||||
- macOS automatic provisioning uses a dedicated Colima profile named `a0`. It must not require Docker Desktop, Homebrew, or a privileged Docker socket symlink. Because Colima checks for a Docker client during startup, the provisioner may install Docker's official static macOS CLI into the launcher-owned runtime bin directory when the host does not provide one.
|
||||
- macOS assessment is reuse-first for an already installed Docker Desktop. If Docker Desktop is installed but its socket is not reachable, report a `docker_desktop` `engine_stopped` state so the product can ask the user to start it instead of offering a fresh download/setup path.
|
||||
- A missing macOS Colima runtime uses the same neutral initial setup description as Windows: `Finish local Agent Zero runtime Setup.` Active progress continues to describe its specific phase; Linux keeps its Docker Engine description.
|
||||
- Linux automatic provisioning uses the host package manager and starts native Docker Engine; it must not manage container CPU, memory, or disk sizing. Before native setup, recognize an installed stopped Docker Desktop through its user service or `/opt/docker-desktop`, start it with the unprivileged user service, and return its `~/.docker/desktop/docker.sock` endpoint.
|
||||
- Linux privileged setup prefers `pkexec` for desktop authentication and may use `sudo -n` only when `pkexec` is absent and passwordless sudo is already available.
|
||||
- Linux Engine permission repair should add the current user to the existing `docker` group when Docker is installed but the account is not a member yet, then report that a logout/login is required.
|
||||
- Windows assessment must not direct Windows Server users to Docker Desktop. Docker Desktop is for client Windows; Windows Server needs an existing Docker endpoint or a WSL2-backed Linux Docker Engine with nested virtualization.
|
||||
- Windows WSL Engine support must keep unauthenticated Docker API exposure on Windows loopback only. Do not bind Docker TCP on WSL public or non-loopback interfaces.
|
||||
- Windows WSL Engine detection may prepare the launcher-owned loopback bridge for the built-in `127.0.0.1:23750` endpoint before probing it, so an installed Ubuntu Docker Engine can be reused at startup without another setup modal.
|
||||
- Windows WSL Engine support must also keep the selected WSL distro alive while the launcher-owned loopback bridge is active; otherwise WSL can idle-stop and Docker marks healthy Linux containers as exited.
|
||||
- Windows WSL keepalive helpers must carry a launcher-specific marker and clean up their child sleep process on shutdown so app restarts do not leave orphaned WSL helper loops.
|
||||
- Windows WSL loopback detection may need a longer first probe than other Docker endpoints because starting the bridge can cold-start WSL. Keep that extra wait scoped to `127.0.0.1:23750`.
|
||||
- Windows client WSL onboarding details should stay Agent Zero-first for normal users. Reserve explicit Docker Desktop naming for Docker Desktop reuse or repair states, and keep low-level Docker Engine wording out of the primary setup path.
|
||||
- Windows clients with Docker Desktop installed but stopped must report a `docker_desktop` `engine_stopped` state with start guidance, not a Docker Desktop download or reinstall link. Discover both Program Files and per-user `%LOCALAPPDATA%/Programs/DockerDesktop` installations. Start Desktop with PowerShell's `Start-Process -FilePath` and report launch errors before waiting for its pipe. Never select Docker's private `docker-desktop` or `docker-desktop-data` WSL distributions for Engine setup or startup.
|
||||
- Windows client WSL feature installation may use a user-approved UAC prompt via `wsl.exe --install --no-distribution`; it must report restart/follow-up states instead of claiming Docker is ready immediately.
|
||||
- After the WSL feature reboot, Windows client assessment must be able to continue from ordinary user context. Do not rely only on admin-only optional feature queries; infer feature readiness from `wsl.exe` status/list output when it reports WSL2 is available but no distro is installed.
|
||||
- On Windows 10, `wsl.exe --install -d Ubuntu --no-launch` may install the Ubuntu Appx package without registering a WSL distro. The Windows client setup path should use the Ubuntu launcher root-registration path when available so users are not forced through an interactive Unix user setup.
|
||||
- Windows client WSL Docker Engine setup may install Docker Engine packages inside an existing Ubuntu WSL2 distro using Docker's official apt repository. Include the Python bridge dependency and keep Docker API access on the launcher-owned Windows loopback bridge.
|
||||
- The Windows loopback bridge may run its WSL helper as `root` so users do not need to manage Linux `docker` group membership during onboarding.
|
||||
- Concrete implementations live under `impl/` and are loaded on demand.
|
||||
- Docker Hub calls should expose digest/content-type/rate-limit and tag update
|
||||
metadata without forcing renderer or Docker Manager code to parse registry
|
||||
responses directly.
|
||||
- Dockerode image pulls and Docker Hub metadata requests should reuse Docker CLI
|
||||
registry credentials from `DOCKER_CONFIG` or `~/.docker/config.json`, including
|
||||
configured credential helpers, so the launcher honors a successful
|
||||
shell-owned `docker login`.
|
||||
- `impl/DockerodeDocker.mjs` may surface launcher-managed container labels as
|
||||
structured metadata and may include containers labeled
|
||||
`a0.launcher.managed=true` or legacy Agent Zero install-script containers
|
||||
labeled `ai.agent0.managed=true` in `listContainers()` even when their image
|
||||
repo differs from the default Agent Zero repo. Keep UI language and product
|
||||
decisions in `shell/docker_manager` or the renderer.
|
||||
- Docker may report a container's summary image as an image id or `<none>` after
|
||||
the original tag is replaced. `listContainers()` should recover
|
||||
`Config.Image` from container inspect for those unresolved summaries before
|
||||
deciding whether the container belongs to the requested image repo.
|
||||
- Runtime diagnostics may expose sanitized Docker Engine `version()` and
|
||||
`info()` fields through `getRuntimeDiagnostics()`. Keep the payload bounded
|
||||
and generic; product grouping and visible copy belong above this layer.
|
||||
- Container file reads must stay bounded, path-specific, and adapter-owned.
|
||||
They are for structured inspection such as product-layer runtime source
|
||||
metadata, not for exposing a generic command or filesystem browser.
|
||||
- Container archive copies, generated text-file writes, directory creation, and
|
||||
immediate directory listings must stay path-specific and adapter-owned. They
|
||||
are allowed for product-layer workflows such as workspace migration and
|
||||
selective workspace clone, but must not become a renderer-facing filesystem
|
||||
browser or generic `docker cp` surface.
|
||||
- Container archive import/export primitives may expose raw streams to the
|
||||
product layer for bounded workflows such as Backup and Restore, but product
|
||||
scope, path filtering, metadata, and user-facing semantics must remain in
|
||||
`shell/docker_manager`.
|
||||
- Docker image removal should default to non-forced deletion so callers preserve
|
||||
Docker's native protection for images still referenced by containers. Forced
|
||||
removal must be an explicit option.
|
||||
- Local image inventory may be repository-scoped or runtime-wide. Runtime-wide
|
||||
discovery must preserve every tagged image's full repository and tag.
|
||||
- Container inventory should include backend, launcher-managed, and
|
||||
Compose-created Agent Zero containers identified by their inspected
|
||||
`/exe/initialize.sh` entrypoint; never infer Agent Zero from a container name.
|
||||
- Container commit support is a low-level snapshot primitive for product-layer
|
||||
clone workflows. Keep clone naming, labels, and port-policy decisions in
|
||||
`shell/docker_manager`.
|
||||
- Root-owned bind-mount contents may be removed through a one-shot container
|
||||
created from an already-local image. Use a fixed cleanup command and a
|
||||
structured bind mount without networking, wait for success, and always
|
||||
remove the helper.
|
||||
- Log processing should normalize stream events into stable progress messages and
|
||||
preserve enough detail for cancellation/failure diagnosis.
|
||||
- Image extraction percentages use Docker's expanded layer totals, not frozen
|
||||
compressed manifest sizes. Reserve 100% for explicit layer completion.
|
||||
- Docker project execution may use the installed Compose plugin or legacy
|
||||
`docker-compose` fallback. Keep paths in argument arrays, never invoke a
|
||||
shell, bind `DOCKER_HOST` to the adapter's selected endpoint, bound returned
|
||||
output, and keep the action allowlist inside the adapter.
|
||||
- Docker Hub calls should expose digest/content-type/rate-limit and tag update metadata without forcing renderer or Docker Manager code to parse registry responses directly.
|
||||
- Dockerode image pulls and Docker Hub metadata requests should reuse Docker CLI registry credentials from `DOCKER_CONFIG` or `~/.docker/config.json`, including configured credential helpers, so the launcher honors a successful shell-owned `docker login`.
|
||||
- `impl/DockerodeDocker.mjs` may surface launcher-managed container labels as structured metadata and may include containers labeled `a0.launcher.managed=true` or legacy Agent Zero install-script containers labeled `ai.agent0.managed=true` in `listContainers()` even when their image repo differs from the default Agent Zero repo. Keep UI language and product decisions in `shell/docker_manager` or the renderer.
|
||||
- Docker may report a container's summary image as an image id or `<none>` after the original tag is replaced. `listContainers()` should recover `Config.Image` from container inspect for those unresolved summaries before deciding whether the container belongs to the requested image repo.
|
||||
- Runtime diagnostics may expose sanitized Docker Engine `version()` and `info()` fields through `getRuntimeDiagnostics()`. Keep the payload bounded and generic; product grouping and visible copy belong above this layer.
|
||||
- Container file reads must stay bounded, path-specific, and adapter-owned. They are for structured inspection such as product-layer runtime source metadata, not for exposing a generic command or filesystem browser.
|
||||
- Container archive copies, generated text-file writes, directory creation, and immediate directory listings must stay path-specific and adapter-owned. They are allowed for product-layer workflows such as workspace migration and selective workspace clone, but must not become a renderer-facing filesystem browser or generic `docker cp` surface.
|
||||
- Container archive import/export primitives may expose raw streams to the product layer for bounded workflows such as Backup and Restore, but product scope, path filtering, metadata, and user-facing semantics must remain in `shell/docker_manager`.
|
||||
- Docker image removal should default to non-forced deletion so callers preserve Docker's native protection for images still referenced by containers. Forced removal must be an explicit option.
|
||||
- Local image inventory may be repository-scoped or runtime-wide. Runtime-wide discovery must preserve every tagged image's full repository and tag.
|
||||
- Container inventory should include backend, launcher-managed, and Compose-created Agent Zero containers identified by their inspected `/exe/initialize.sh` entrypoint; never infer Agent Zero from a container name.
|
||||
- Container commit support is a low-level snapshot primitive for product-layer clone workflows. Keep clone naming, labels, and port-policy decisions in `shell/docker_manager`.
|
||||
- Root-owned bind-mount contents may be removed through a one-shot container created from an already-local image. Use a fixed cleanup command and a structured bind mount without networking, wait for success, and always remove the helper.
|
||||
- Log processing should normalize stream events into stable progress messages and preserve enough detail for cancellation/failure diagnosis.
|
||||
- Image extraction percentages use Docker's expanded layer totals, not frozen compressed manifest sizes. Reserve 100% for explicit layer completion.
|
||||
- Docker project execution may use the installed Compose plugin or legacy `docker-compose` fallback. Keep paths in argument arrays, never invoke a shell, bind `DOCKER_HOST` to the adapter's selected endpoint, bound returned output, and keep the action allowlist inside the adapter.
|
||||
|
||||
## Work Guidance
|
||||
|
||||
- Keep this layer reusable. Do not import Electron UI modules or renderer files.
|
||||
- Do not add launcher-specific labels such as `Instances` here; translate
|
||||
low-level results in `shell/docker_manager`.
|
||||
- Prefer structured return values over throwing when the caller can recover or
|
||||
show a diagnostic.
|
||||
- Do not add launcher-specific labels such as `Instances` here; translate low-level results in `shell/docker_manager`.
|
||||
- Prefer structured return values over throwing when the caller can recover or show a diagnostic.
|
||||
- Keep all Dockerode-specific assumptions behind this adapter.
|
||||
- When adding a new Docker capability, define or update the abstract method in
|
||||
`DockerInterface.mjs` before implementing it in `impl/DockerodeDocker.mjs`.
|
||||
- When adding a new Docker capability, define or update the abstract method in `DockerInterface.mjs` before implementing it in `impl/DockerodeDocker.mjs`.
|
||||
|
||||
## Verification
|
||||
|
||||
|
||||
@@ -177,6 +177,14 @@ export function run(cmd, args, options = {}) {
|
||||
});
|
||||
}
|
||||
|
||||
export function sleep(ms) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
export function tail(value, limit = 1200) {
|
||||
return String(value || '').slice(-limit);
|
||||
}
|
||||
|
||||
export async function pathExists(filePath) {
|
||||
try {
|
||||
await fsp.access(filePath);
|
||||
|
||||
@@ -19,6 +19,8 @@ import {
|
||||
makeError,
|
||||
pathExists,
|
||||
run,
|
||||
sleep,
|
||||
tail,
|
||||
sha256FromSumText
|
||||
} from '../RuntimeProvisioner.mjs';
|
||||
|
||||
@@ -500,11 +502,3 @@ async function canConnectSocket(socketPath) {
|
||||
socket.once('error', () => finish(false));
|
||||
});
|
||||
}
|
||||
|
||||
function sleep(ms) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
function tail(value, limit = 1200) {
|
||||
return String(value || '').slice(-limit);
|
||||
}
|
||||
@@ -85,7 +85,7 @@ function decodeInlineAuth(auth) {
|
||||
}
|
||||
}
|
||||
|
||||
export function dockerAuthConfigFromEntry(entry, serveraddress) {
|
||||
function dockerAuthConfigFromEntry(entry, serveraddress) {
|
||||
if (!entry || typeof entry !== 'object') return null;
|
||||
const server = safeTrim(serveraddress);
|
||||
if (!server) return null;
|
||||
@@ -204,7 +204,7 @@ async function defaultRunCredentialHelper(helperName, serveraddress, options = {
|
||||
});
|
||||
}
|
||||
|
||||
export async function readDockerConfigJson(options = {}) {
|
||||
async function readDockerConfigJson(options = {}) {
|
||||
const env = options.env || process.env;
|
||||
const homeDir = safeTrim(options.homeDir) || os.homedir();
|
||||
const dockerConfigDir = safeTrim(env.DOCKER_CONFIG) || path.join(homeDir, '.docker');
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
import os from 'node:os';
|
||||
import { RuntimeProvisioner, makeError, pathExists, run } from '../RuntimeProvisioner.mjs';
|
||||
import { RuntimeProvisioner, makeError, pathExists, run, sleep, tail } from '../RuntimeProvisioner.mjs';
|
||||
|
||||
const DOCKER_DESKTOP_INSTALL_DIR = '/opt/docker-desktop';
|
||||
const DOCKER_DESKTOP_SOCKET = `${os.homedir()}/.docker/desktop/docker.sock`;
|
||||
@@ -460,11 +460,3 @@ export class LinuxEngineRuntime extends RuntimeProvisioner {
|
||||
return user;
|
||||
}
|
||||
}
|
||||
|
||||
function tail(value, limit = 1200) {
|
||||
return String(value || '').slice(-limit);
|
||||
}
|
||||
|
||||
function sleep(ms) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
* need administrator rights.
|
||||
*/
|
||||
|
||||
import { RuntimeProvisioner, makeError, run } from '../RuntimeProvisioner.mjs';
|
||||
import { RuntimeProvisioner, makeError, run, sleep, tail } from '../RuntimeProvisioner.mjs';
|
||||
import { ensureWindowsWslDockerProxy } from './WindowsWslDockerProxy.mjs';
|
||||
|
||||
const WSL_GUIDE_URL = 'https://learn.microsoft.com/windows/wsl/install-on-server';
|
||||
@@ -617,7 +617,3 @@ export const WINDOWS_DOCKER_DESKTOP_URL = DOCKER_DESKTOP_URL;
|
||||
function cleanCommandText(value) {
|
||||
return String(value || '').replace(/\0/g, '');
|
||||
}
|
||||
|
||||
function sleep(ms) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
+79
-311
@@ -2,28 +2,17 @@
|
||||
|
||||
## Purpose
|
||||
|
||||
`shell/docker_manager/` owns Agent Zero instance orchestration above the generic
|
||||
Docker adapter.
|
||||
`shell/docker_manager/` owns Agent Zero instance orchestration above the generic Docker adapter.
|
||||
|
||||
It turns releases, images, containers, storage volumes, retained instances,
|
||||
remote instances, settings, and progress into a stable product-level state model
|
||||
for the renderer.
|
||||
It turns releases, images, containers, storage volumes, retained instances, remote instances, settings, and progress into a stable product-level state model for the renderer.
|
||||
|
||||
## Ownership
|
||||
|
||||
This scope owns:
|
||||
|
||||
- `index.js`: Docker Manager service, state assembly,
|
||||
install/sync/start/stop/restart, activation, rollback, retained-instance,
|
||||
remote-instance, per-container clone and log inspection, port, storage,
|
||||
developer custom-image and Docker project runs, runtime setup, and progress
|
||||
operations.
|
||||
- `state_store.js`: persisted launcher state under Electron `userData`,
|
||||
including preferences, remote instances, local instance display names, and
|
||||
local instance colour/icon overrides, plus Launcher Host access defaults and
|
||||
per-Instance configuration, and the A0 Tag opt-in/Instance/profile choice.
|
||||
- `releases_client.js`: GitHub release discovery for Agent Zero backend
|
||||
versions.
|
||||
- `index.js`: Docker Manager service, state assembly, install/sync/start/stop/restart, activation, rollback, retained-instance, remote-instance, per-container clone and log inspection, port, storage, developer custom-image and Docker project runs, runtime setup, and progress operations.
|
||||
- `state_store.js`: persisted launcher state under Electron `userData`, including preferences, remote instances, local instance display names, and local instance colour/icon overrides, plus Launcher Host access defaults and per-Instance configuration, and the A0 Tag opt-in/Instance/profile choice.
|
||||
- `releases_client.js`: GitHub release discovery for Agent Zero backend versions.
|
||||
- `release_tags.js`: shared validation and ordering for Agent Zero release tags.
|
||||
- `retention.js`: retained instance pruning policy.
|
||||
- `errors.js`: stable UI-facing error response and Docker diagnostic mapping.
|
||||
@@ -32,306 +21,86 @@ This scope owns:
|
||||
## Local Contracts
|
||||
|
||||
- Docker access must go through `getDocker()` from `shell/docker_adapter`.
|
||||
- Backend image repo defaults to `agent0ai/agent-zero` and may be overridden by
|
||||
`A0_BACKEND_IMAGE_REPO`.
|
||||
- Backend GitHub repo defaults to `agent0ai/agent-zero` and may be overridden by
|
||||
`A0_BACKEND_GITHUB_REPO`.
|
||||
- Installable tags must be safe tags and limited to semver-like release tags
|
||||
(`vX.Y` or `vX.Y.Z`), channel tags (`latest`, `ready`, `testing`), or
|
||||
canonical local tags (`local`, `development`, `main`).
|
||||
- Activation can target installed local builds, but still must reject unsafe tag
|
||||
strings.
|
||||
- Once an image inventory is scoped to its repository, activation must identify
|
||||
the local image by tag, not Docker's presentation-specific image reference.
|
||||
- Developer custom-image runs may target safe arbitrary Docker image
|
||||
repositories and tags. Validate image names, tags, environment variables,
|
||||
port mappings, and mounts before Dockerode sees them; label created containers
|
||||
with `a0.launcher.role=developer` so the Instances tab can manage them.
|
||||
- Developer project actions accept only shell-resolved dedicated project roots
|
||||
and regular root files. Compose actions are fixed to Validate, Build, Up,
|
||||
Stop, Logs, and Down; Dockerfile actions are fixed to Validate and Build.
|
||||
Long-running actions use normal progress/cancellation, bound output to 12 KB,
|
||||
and Down must not remove storage volumes.
|
||||
- Runtime-wide local image discovery remains available for Advanced developer
|
||||
controls, while normal Create local Instance choices use only Agent Zero
|
||||
releases and local Agent Zero builds.
|
||||
- UI URLs should be derived from inspected port bindings and verified where
|
||||
practical before opening.
|
||||
- Local and saved remote Instances use the same bounded `/api/health` Git
|
||||
metadata for runtime identity. Cache the last valid identity by stable
|
||||
Instance ID so stopped or temporarily offline Instances retain their
|
||||
last-seen version; replace it only after a later successful health response.
|
||||
A local Instance without health metadata may show the bounded branch from
|
||||
`/a0/.git/HEAD`, but health-derived and cached `R v...` identity remains
|
||||
preferred. Keep Docker image tags as separate fallback provenance.
|
||||
- Channel-tagged images and containers may expose `matchedReleaseTag` when the
|
||||
local tag can be tied to a concrete semver release through digest matching or
|
||||
local evidence for the current `latest` release tag. For containers, channel
|
||||
release labels must respect the container's actual image id so older stopped
|
||||
`ready`/`latest` Instances do not inherit a newer repulled channel version.
|
||||
Channel Version entries may also expose optional `publishedReleaseTag` and
|
||||
`updatedAt` metadata derived from cached Docker Hub tag metadata.
|
||||
- Start, switch, and run flows should give the Agent Zero UI enough time to
|
||||
finish a slow first boot before rolling back a newly-created container.
|
||||
- New managed Instance run progress should mark `uiReady: true` only after the
|
||||
UI readiness probe succeeds. If a created Instance is kept after a readiness
|
||||
timeout, leave the completed progress marked not ready so renderer handoffs do
|
||||
not fire early.
|
||||
- Direct `Open UI` resolution may use a shorter bounded wait than start/run
|
||||
flows so a fresh running container can finish warming up before showing an
|
||||
error.
|
||||
- UI readiness probes should also allow enough time for a local Agent Zero HTTP
|
||||
response to produce headers on slower Windows/WSL loopback paths; avoid
|
||||
per-attempt timeouts that create false failed starts while the UI is reachable.
|
||||
- Running an installed image as a new managed Instance should not delete the
|
||||
container merely because the UI readiness probe timed out after the container
|
||||
started. Keep the Instance visible and report that Agent Zero is still
|
||||
starting; rollback cleanup remains appropriate for update/switch replacement
|
||||
flows that must restore a previous active Instance.
|
||||
- Prefer structured state over renderer-side inference. If the UI needs a
|
||||
status, add it to the Docker Manager state shape.
|
||||
- Docker Manager may log a de-duplicated Instance inventory snapshot for
|
||||
diagnostics. Keep it bounded to container identity, image/version/runtime
|
||||
fields, UI URL, and managed-label booleans; do not log environment variables,
|
||||
credentials, or full container inspect payloads.
|
||||
- Runtime diagnostics for the Advanced tab belong in the Docker Manager state
|
||||
shape as sanitized `runtimeDiagnostics`, sourced from Docker adapter
|
||||
inspection rather than renderer guesses.
|
||||
- Persist user preferences and remote instances through `state_store.js`; do not
|
||||
invent parallel files.
|
||||
- Persist Launcher `onboarding` as `local` or `complete` in that same state
|
||||
file. Missing state is `new` unless saved Instance metadata, Host access
|
||||
Instance records, health identity history, or discovered Instances establish
|
||||
an existing installation. A pending runtime resume implies local intent.
|
||||
Merely installed Docker and the legacy Host access onboarding flag do not
|
||||
establish completion. Completion survives removal of Instances/images and
|
||||
unavailable runtimes; expose it in state and inventory. State-file writes
|
||||
serialize and atomically replace the file, preserving the furthest onboarding
|
||||
state even when another settings writer read an older snapshot. Read failures
|
||||
must remain errors, not new-install signals.
|
||||
- The Settings page persists port, workspace storage, Instance defaults, Host
|
||||
access defaults, and A0 Tag through one combined state-store write and
|
||||
cached-state publication. Duplicate ports keep the previous valid port pair
|
||||
while the other Settings sections save and report their own success.
|
||||
- A0 Tag persists only `{ version: 1, enabled, instanceKey, defaultProfile }`.
|
||||
Missing state defaults to disabled, malformed fields normalize empty, and an
|
||||
incomplete enabled section preserves the previous valid A0 Tag value while
|
||||
unrelated Settings sections save. Profiles are discovered live. Shortcut
|
||||
registration, status, target/context/result data, and child PIDs are never
|
||||
persisted.
|
||||
- Host access persistence lives in `state_store.js`: compatibility-only
|
||||
onboarding state, local defaults, optional default folder, per-Instance
|
||||
configured/master state, five permission scopes, browser selection, and the
|
||||
stable Launcher installation ID. Child PIDs, connection status, and permission
|
||||
readiness are runtime-only. Local records use container IDs and remote records
|
||||
use saved remote Instance IDs.
|
||||
- A local bind mount backing `/a0/usr` is the authoritative Host access folder.
|
||||
This includes development containers that bind the whole `/a0` runtime: map
|
||||
their host source's `usr` child unless a more specific `/a0/usr` mount masks
|
||||
it. Named-volume, ephemeral, and remote Instances require an explicit native
|
||||
host folder, prefilled from the Launcher default when available. Remote
|
||||
Instances otherwise default to their remote machine and do not acquire
|
||||
Launcher host access implicitly.
|
||||
- Local instance display-name and Colour/Icon overrides are persisted through
|
||||
`state_store.js` because Docker labels on existing containers cannot be
|
||||
mutated safely. Local colours and icons are stored as container-id keyed
|
||||
`localInstanceColors` and `localInstanceIcons` maps. Colours accept preset IDs
|
||||
or normalized six-digit RGB hex; icons accept known IDs or bounded image data
|
||||
URLs. Use the shared shell normalizers and save image copies into the existing
|
||||
state file, never source file paths.
|
||||
Empty icon IDs select the live page favicon; `language` explicitly selects
|
||||
Globe. Existing nonempty custom icon choices remain authoritative. Live favicon
|
||||
image data belongs only to shell tab state and must not enter persistence.
|
||||
- Optional local and saved remote Instance login credentials are persisted
|
||||
through `state_store.js` as id-keyed, Electron-safe-storage encrypted password
|
||||
records. The renderer may receive only saved-credential metadata such as saved
|
||||
state and username; decrypted passwords must stay in the shell process and be
|
||||
used only for explicit local CLI launch, Web UI login, or save/clear
|
||||
operations.
|
||||
- Backend image repo defaults to `agent0ai/agent-zero` and may be overridden by `A0_BACKEND_IMAGE_REPO`.
|
||||
- Backend GitHub repo defaults to `agent0ai/agent-zero` and may be overridden by `A0_BACKEND_GITHUB_REPO`.
|
||||
- Installable tags must be safe tags and limited to semver-like release tags (`vX.Y` or `vX.Y.Z`), channel tags (`latest`, `ready`, `testing`), or canonical local tags (`local`, `development`, `main`).
|
||||
- Activation can target installed local builds, but still must reject unsafe tag strings.
|
||||
- Once an image inventory is scoped to its repository, activation must identify the local image by tag, not Docker's presentation-specific image reference.
|
||||
- Developer custom-image runs may target safe arbitrary Docker image repositories and tags. Validate image names, tags, environment variables, port mappings, and mounts before Dockerode sees them; label created containers with `a0.launcher.role=developer` so the Instances tab can manage them.
|
||||
- Developer project actions accept only shell-resolved dedicated project roots and regular root files. Compose actions are fixed to Validate, Build, Up, Stop, Logs, and Down; Dockerfile actions are fixed to Validate and Build. Long-running actions use normal progress/cancellation, bound output to 12 KB, and Down must not remove storage volumes.
|
||||
- Runtime-wide local image discovery remains available for Advanced developer controls, while normal Create local Instance choices use only Agent Zero releases and local Agent Zero builds.
|
||||
- UI URLs should be derived from inspected port bindings and verified where practical before opening.
|
||||
- Local and saved remote Instances use the same bounded `/api/health` Git metadata for runtime identity. Cache the last valid identity by stable Instance ID so stopped or temporarily offline Instances retain their last-seen version; replace it only after a later successful health response. A local Instance without health metadata may show the bounded branch from `/a0/.git/HEAD`, but health-derived and cached `R v...` identity remains preferred. Keep Docker image tags as separate fallback provenance.
|
||||
- Channel-tagged images and containers may expose `matchedReleaseTag` when the local tag can be tied to a concrete semver release through digest matching or local evidence for the current `latest` release tag. For containers, channel release labels must respect the container's actual image id so older stopped `ready`/`latest` Instances do not inherit a newer repulled channel version. Channel Version entries may also expose optional `publishedReleaseTag` and `updatedAt` metadata derived from cached Docker Hub tag metadata.
|
||||
- Start, switch, and run flows should give the Agent Zero UI enough time to finish a slow first boot before rolling back a newly-created container.
|
||||
- New managed Instance run progress should mark `uiReady: true` only after the UI readiness probe succeeds. If a created Instance is kept after a readiness timeout, leave the completed progress marked not ready so renderer handoffs do not fire early.
|
||||
- Direct `Open UI` resolution may use a shorter bounded wait than start/run flows so a fresh running container can finish warming up before showing an error.
|
||||
- UI readiness probes should also allow enough time for a local Agent Zero HTTP response to produce headers on slower Windows/WSL loopback paths; avoid per-attempt timeouts that create false failed starts while the UI is reachable.
|
||||
- Running an installed image as a new managed Instance should not delete the container merely because the UI readiness probe timed out after the container started. Keep the Instance visible and report that Agent Zero is still starting; rollback cleanup remains appropriate for update/switch replacement flows that must restore a previous active Instance.
|
||||
- Prefer structured state over renderer-side inference. If the UI needs a status, add it to the Docker Manager state shape.
|
||||
- Docker Manager may log a de-duplicated Instance inventory snapshot for diagnostics. Keep it bounded to container identity, image/version/runtime fields, UI URL, and managed-label booleans; do not log environment variables, credentials, or full container inspect payloads.
|
||||
- Runtime diagnostics for the Advanced tab belong in the Docker Manager state shape as sanitized `runtimeDiagnostics`, sourced from Docker adapter inspection rather than renderer guesses.
|
||||
- Persist user preferences and remote instances through `state_store.js`; do not invent parallel files.
|
||||
- Persist Launcher `onboarding` as `local` or `complete` in that same state file. Missing state is `new` unless saved Instance metadata, Host access Instance records, health identity history, or discovered Instances establish an existing installation. A pending runtime resume implies local intent. Merely installed Docker and the legacy Host access onboarding flag do not establish completion. Completion survives removal of Instances/images and unavailable runtimes; expose it in state and inventory. State-file writes serialize and atomically replace the file, preserving the furthest onboarding state even when another settings writer read an older snapshot. Read failures must remain errors, not new-install signals.
|
||||
- The Settings page persists port, workspace storage, Instance defaults, Host access defaults, and A0 Tag through one combined state-store write and cached-state publication. Duplicate ports keep the previous valid port pair while the other Settings sections save and report their own success.
|
||||
- A0 Tag persists only `{ version: 1, enabled, instanceKey, defaultProfile }`. Missing state defaults to disabled, malformed fields normalize empty, and an incomplete enabled section preserves the previous valid A0 Tag value while unrelated Settings sections save. Profiles are discovered live. Shortcut registration, status, target/context/result data, and child PIDs are never persisted.
|
||||
- Host access persistence lives in `state_store.js`: compatibility-only onboarding state, local defaults, optional default folder, per-Instance configured/master state, five permission scopes, browser selection, and the stable Launcher installation ID. Child PIDs, connection status, and permission readiness are runtime-only. Local records use container IDs and remote records use saved remote Instance IDs.
|
||||
- A local bind mount backing `/a0/usr` is the authoritative Host access folder. This includes development containers that bind the whole `/a0` runtime: map their host source's `usr` child unless a more specific `/a0/usr` mount masks it. Named-volume, ephemeral, and remote Instances require an explicit native host folder, prefilled from the Launcher default when available. Remote Instances otherwise default to their remote machine and do not acquire Launcher host access implicitly.
|
||||
- Local instance display-name and Colour/Icon overrides are persisted through `state_store.js` because Docker labels on existing containers cannot be mutated safely. Local colours and icons are stored as container-id keyed `localInstanceColors` and `localInstanceIcons` maps. Colours accept preset IDs or normalized six-digit RGB hex; icons accept known IDs or bounded image data URLs. Use the shared shell normalizers and save image copies into the existing state file, never source file paths. Empty icon IDs select the live page favicon; `language` explicitly selects Globe. Existing nonempty custom icon choices remain authoritative. Live favicon image data belongs only to shell tab state and must not enter persistence.
|
||||
- Optional local and saved remote Instance login credentials are persisted through `state_store.js` as id-keyed, Electron-safe-storage encrypted password records. The renderer may receive only saved-credential metadata such as saved state and username; decrypted passwords must stay in the shell process and be used only for explicit local CLI launch, Web UI login, or save/clear operations.
|
||||
- Port preferences are stored as UI and SSH host-port preferences.
|
||||
- Host-port requests using `0` must be settled to explicit host ports before
|
||||
Docker container creation so a container's published port remains stable
|
||||
across later starts, deletions of other containers, and new runs. New normal
|
||||
launcher-managed local Instances publish on `0.0.0.0` for LAN access.
|
||||
Developer/custom-image runs and replacement flows should preserve their
|
||||
explicit or inspected host bindings; clones still receive fresh explicit open
|
||||
ports so they can run beside the source.
|
||||
- Workspace storage preferences are stored as `mode`, `hostRoot`,
|
||||
`hostPathMode`, and `volumePrefix`. The default mode is `host_directory`,
|
||||
default root is `~/agent-zero`, and the default path mode creates a
|
||||
per-instance workspace at `/a0/usr` using the Instance name as the host
|
||||
folder, with a numeric suffix only when that folder already exists. Exact
|
||||
path mode mounts the selected host folder directly at `/a0/usr`. A new
|
||||
launcher-managed local container should skip persistent storage only when the
|
||||
user explicitly selects the no-volume ephemeral workspace mode for that run.
|
||||
- Windows WSL Engine bind mounts should keep the Windows host path in launcher
|
||||
labels and state, but send Docker a WSL-visible `/mnt/<drive>/...` source path
|
||||
for the actual container mount.
|
||||
- Instance defaults are stored as Main, Utility, and Embedding provider/model
|
||||
preferences with optional local API keys for new Instances.
|
||||
- Runtime endpoint selection is stored as a launcher-local Docker endpoint
|
||||
preference. It may be set from the setup modal when multiple usable endpoints
|
||||
are detected, and all Docker Manager operations should continue through the
|
||||
selected endpoint while it remains reachable.
|
||||
- If that preference is unavailable, use another reachable endpoint without
|
||||
overwriting it. Explicitly selecting, starting, or provisioning an endpoint
|
||||
replaces the preference after the endpoint is confirmed reachable.
|
||||
- When another daemon is reachable, an installed stopped Docker Desktop may be
|
||||
exposed as a startable runtime candidate. Selecting it should reuse the
|
||||
runtime setup operation, verify its exact endpoint, and only then replace the
|
||||
preference; startup failure must leave the fallback and prior preference
|
||||
intact.
|
||||
- Host-port requests using `0` must be settled to explicit host ports before Docker container creation so a container's published port remains stable across later starts, deletions of other containers, and new runs. New normal launcher-managed local Instances publish on `0.0.0.0` for LAN access. Developer/custom-image runs and replacement flows should preserve their explicit or inspected host bindings; clones still receive fresh explicit open ports so they can run beside the source.
|
||||
- Workspace storage preferences are stored as `mode`, `hostRoot`, `hostPathMode`, and `volumePrefix`. The default mode is `host_directory`, default root is `~/agent-zero`, and the default path mode creates a per-instance workspace at `/a0/usr` using the Instance name as the host folder, with a numeric suffix only when that folder already exists. Exact path mode mounts the selected host folder directly at `/a0/usr`. A new launcher-managed local container should skip persistent storage only when the user explicitly selects the no-volume ephemeral workspace mode for that run.
|
||||
- Windows WSL Engine bind mounts should keep the Windows host path in launcher labels and state, but send Docker a WSL-visible `/mnt/<drive>/...` source path for the actual container mount.
|
||||
- Instance defaults are stored as Main, Utility, and Embedding provider/model preferences with optional local API keys for new Instances.
|
||||
- Runtime endpoint selection is stored as a launcher-local Docker endpoint preference. It may be set from the setup modal when multiple usable endpoints are detected, and all Docker Manager operations should continue through the selected endpoint while it remains reachable.
|
||||
- If that preference is unavailable, use another reachable endpoint without overwriting it. Explicitly selecting, starting, or provisioning an endpoint replaces the preference after the endpoint is confirmed reachable.
|
||||
- When another daemon is reachable, an installed stopped Docker Desktop may be exposed as a startable runtime candidate. Selecting it should reuse the runtime setup operation, verify its exact endpoint, and only then replace the preference; startup failure must leave the fallback and prior preference intact.
|
||||
- Retention policy is stored as a retained-instance count.
|
||||
- Remote instances must normalize and validate URLs before persistence. Their
|
||||
optional saved `color` and `icon` fields use the same bounded choices as local
|
||||
Instance appearance overrides. Optional saved remote Instance credentials are keyed
|
||||
by remote Instance id and removed when that remote Instance is deleted.
|
||||
Remote instance online/offline status is transient renderer state from a
|
||||
bounded `/api/health` probe and must not be persisted into saved remote
|
||||
instance records. Only the sanitized last-seen runtime identity is cached.
|
||||
- Retained local containers are rollback targets and should keep enough metadata
|
||||
for the renderer to display them without re-inspecting every container
|
||||
needlessly.
|
||||
- Storage-volume operations must remain separate from retained-instance
|
||||
activation/removal and from container deletion. Deleting an instance must not
|
||||
remove its host workspace directory or named volume unless the renderer sends
|
||||
an explicit storage-removal option from the deletion dialog.
|
||||
- Explicit host-workspace deletion removes the Instance container first, then
|
||||
empties root-owned bind-mount contents through Docker using the Instance's
|
||||
existing image before removing the empty host directory. If storage cleanup
|
||||
fails, finish Instance metadata and clone-image cleanup and report that the
|
||||
Instance was deleted while its folder remains.
|
||||
- Host-directory workspace paths may be resolved for the shell-owned
|
||||
`Open storage folder` action. Named Docker volumes should stay represented as
|
||||
Docker volumes rather than guessed host paths.
|
||||
- A host repository bind at `/a0` exposes its nested `/a0/usr` as persistent
|
||||
custom storage for folder opening, but it is not launcher-owned storage and
|
||||
must never be offered for deletion with the Instance.
|
||||
- Remote instances must normalize and validate URLs before persistence. Their optional saved `color` and `icon` fields use the same bounded choices as local Instance appearance overrides. Optional saved remote Instance credentials are keyed by remote Instance id and removed when that remote Instance is deleted. Remote instance online/offline status is transient renderer state from a bounded `/api/health` probe and must not be persisted into saved remote instance records. Only the sanitized last-seen runtime identity is cached.
|
||||
- Retained local containers are rollback targets and should keep enough metadata for the renderer to display them without re-inspecting every container needlessly.
|
||||
- Storage-volume operations must remain separate from retained-instance activation/removal and from container deletion. Deleting an instance must not remove its host workspace directory or named volume unless the renderer sends an explicit storage-removal option from the deletion dialog.
|
||||
- Explicit host-workspace deletion removes the Instance container first, then empties root-owned bind-mount contents through Docker using the Instance's existing image before removing the empty host directory. If storage cleanup fails, finish Instance metadata and clone-image cleanup and report that the Instance was deleted while its folder remains.
|
||||
- Host-directory workspace paths may be resolved for the shell-owned `Open storage folder` action. Named Docker volumes should stay represented as Docker volumes rather than guessed host paths.
|
||||
- A host repository bind at `/a0` exposes its nested `/a0/usr` as persistent custom storage for folder opening, but it is not launcher-owned storage and must never be offered for deletion with the Instance.
|
||||
- Long-running operations return an operation id and emit progress.
|
||||
- Concurrent state refreshes are newest-wins. Before publishing a refreshed
|
||||
state, reapply the latest cached local and remote runtime identity so an older
|
||||
Docker/image snapshot cannot make an Instance disappear or replace a
|
||||
health-confirmed version with image provenance.
|
||||
- Image installs may target Docker channel tags (`latest`, `ready`, `testing`)
|
||||
in addition to semver releases and local development tags, because first-run
|
||||
setup uses `latest` as the default image choice.
|
||||
- Successful Agent Zero image pulls may clean up the previous local image id for
|
||||
the same tag, but only through non-forced Docker image removal. If Docker says
|
||||
the old image is still referenced by any container or another tag, keep it.
|
||||
- Image removal from Versions must validate the tag, target a locally installed
|
||||
Agent Zero image, and call Docker image removal without force. If Docker
|
||||
reports the image is still used by a container, return a stable UI error
|
||||
instead of deleting related Instances or storage.
|
||||
- Progress payloads may include `headline`, `detail`, `phase`, `steps`, and
|
||||
`indeterminate` in addition to the legacy `message` and numeric progress
|
||||
fields. Runtime setup progress uses those fields for the blocking startup
|
||||
modal.
|
||||
- Runtime callbacks may supply an explicit phase as their third argument so
|
||||
nested Colima download/start logs stay on their owning checklist step. Keep
|
||||
failure on the last active step. Image-pull progress uses the current phase's
|
||||
percentage plus `progressStartedAt` and `progressStartValue` for an ETA based
|
||||
only on work observed since that phase became visible.
|
||||
Numeric-only runtime download callbacks retain their current detail and phase;
|
||||
a new stage without a percentage clears the previous download percentage.
|
||||
- Renderer-visible setup progress copy should use `Setup`, not `Set up`,
|
||||
`Set Up`, or `Setting up`; internal identifiers may stay `setup`.
|
||||
- Progress payloads may include `canCancel`; set it only while a user cancel
|
||||
action can actually abort the current operation phase, such as an active image
|
||||
pull.
|
||||
- When a product operation fails for a recoverable reason, progress payloads
|
||||
should carry a stable error code so the renderer can show the right recovery
|
||||
action without parsing human-readable copy.
|
||||
- Runtime setup is additive and reuse-first: existing Docker Desktop, native
|
||||
Engine, and rootless endpoints are used before Linux Engine provisioning is
|
||||
offered.
|
||||
- If Docker diagnostics or inventory operations prove an endpoint is usable
|
||||
after a pessimistic availability probe, normalize the runtime state to ready
|
||||
before exposing it to the renderer.
|
||||
- Runtime setup may persist a `runtimeSetupResume` marker under the Docker
|
||||
Manager state file so reboot-required Windows setup can relaunch once and
|
||||
continue when the next step no longer needs elevation.
|
||||
- Windows RunOnce resume commands must work for both packaged apps and local
|
||||
default-app Electron launches. If Electron injects flags before the app path,
|
||||
skip those flags and preserve the first non-option app path.
|
||||
- Windows WSL setup may complete an intermediate step such as feature enablement
|
||||
or distro installation. Preserve the follow-up message instead of reporting
|
||||
the runtime as ready prematurely.
|
||||
- Windows WSL setup can continue from distro installation into Docker Engine
|
||||
installation when the distro is immediately usable; if Windows requires a
|
||||
restart or first-run distro setup, report that as the next step.
|
||||
- Linux runtime setup may install/start Docker Engine, then report
|
||||
`needs_relogin` when docker group access cannot apply to the current desktop
|
||||
session yet. Do not introduce CPU, memory, or disk sizing controls for native
|
||||
Linux Engine.
|
||||
- Progress messages should be user-oriented: `Starting selected version`, not
|
||||
raw Docker implementation chatter.
|
||||
- Running an installed Version from Versions should create a new launcher-managed
|
||||
container with a unique Docker name and open host ports, so repeated runs of
|
||||
the same image can coexist.
|
||||
- Running, active-instance creation, developer custom-image runs, and clones
|
||||
should label workspace storage metadata and use Docker `Mounts` for the
|
||||
canonical `/a0/usr` mount. Explicit ephemeral runs should still be labeled
|
||||
with storage metadata even though they do not receive the mount. Clones must
|
||||
receive a fresh workspace rather than reusing the source workspace mount.
|
||||
- Per-container start/stop/restart/delete/clone/rename/appearance actions from the
|
||||
Instances card menu still belong in this product layer. Container mutations must target
|
||||
the requested container id, return an operation id, refresh state afterward,
|
||||
and keep storage-volume deletion separate from container deletion. Rename and
|
||||
Colour/Icon selection are fast launcher metadata updates and may return
|
||||
synchronously.
|
||||
- Synchronous launcher-only metadata updates, including Settings, local
|
||||
Instance identity, credentials, and saved remote Instance edits, should patch
|
||||
and emit the cached product state after persistence. Do not rebuild Docker,
|
||||
GitHub, or registry-derived state when the operation cannot have changed it;
|
||||
remote health probing may continue asynchronously from the patched record.
|
||||
- Local instance card start/stop/restart/delete actions run through an in-memory
|
||||
per-container background queue and do not occupy the global Docker Manager
|
||||
operation slot. They return `{ opId, queued: true, background: true }`, publish
|
||||
`backgroundOperations` in state, and keep heavier flows such as install,
|
||||
clone, migration, activation, update, rollback, and developer runs on the
|
||||
single global progress operation.
|
||||
- Per-container log inspection belongs in this product layer as a bounded
|
||||
read-only snapshot. It may not expose generic Docker commands to the renderer.
|
||||
- Per-container Backup and Restore belong in this product layer. Backup should
|
||||
copy `/a0/usr` from the selected container into a core-compatible `.zip` with
|
||||
metadata; Restore should accept that backup shape, map only workspace entries
|
||||
back into `/a0/usr`, and report progress as a long-running operation.
|
||||
- Cloning an instance should reuse the source container's configured image
|
||||
reference, falling back to its image ID, remap published ports to
|
||||
Docker-assigned open host ports, and copy the
|
||||
selected `/a0/usr` workspace categories into fresh storage. Do not commit the
|
||||
source container into a clone-only image. With all categories selected, clone
|
||||
should copy the full `/a0/usr` tree to match Agent Zero backup behavior.
|
||||
`/a0/usr/agents` is the Agent profiles category and should stay separate from
|
||||
generic workspace files. When a clone inherits a host mount at `/a0`, add a
|
||||
process-scoped Git `safe.directory` entry so health metadata can read the
|
||||
checkout without copying host or source-container Git configuration.
|
||||
Persistence migration may still snapshot and pause a legacy source because it
|
||||
replaces that container while preserving its state.
|
||||
- Persisting `/a0/usr` data for a legacy or intentional ephemeral instance
|
||||
should be explicit. Create a persistent replacement, preserve the old
|
||||
container until the replacement starts successfully, copy `/a0/usr` through
|
||||
the Docker adapter archive path when possible, and include source/replacement
|
||||
names in the completion progress payload for the renderer notice.
|
||||
- Cancellation should be best-effort and explicit about whether the active Docker
|
||||
operation can actually stop.
|
||||
- Destructive flows should require renderer acknowledgement when the active
|
||||
instance may be replaced or data may be affected.
|
||||
- Error responses should pass through `toErrorResponse()` and map common Docker
|
||||
diagnostics to useful UI messages.
|
||||
- Concurrent state refreshes are newest-wins. Before publishing a refreshed state, reapply the latest cached local and remote runtime identity so an older Docker/image snapshot cannot make an Instance disappear or replace a health-confirmed version with image provenance.
|
||||
- Image installs may target Docker channel tags (`latest`, `ready`, `testing`) in addition to semver releases and local development tags, because first-run setup uses `latest` as the default image choice.
|
||||
- Successful Agent Zero image pulls may clean up the previous local image id for the same tag, but only through non-forced Docker image removal. If Docker says the old image is still referenced by any container or another tag, keep it.
|
||||
- Image removal from Versions must validate the tag, target a locally installed Agent Zero image, and call Docker image removal without force. If Docker reports the image is still used by a container, return a stable UI error instead of deleting related Instances or storage.
|
||||
- Progress payloads may include `headline`, `detail`, `phase`, `steps`, and `indeterminate` in addition to the legacy `message` and numeric progress fields. Runtime setup progress uses those fields for the blocking startup modal.
|
||||
- Runtime callbacks may supply an explicit phase as their third argument so nested Colima download/start logs stay on their owning checklist step. Keep failure on the last active step. Image-pull progress uses the current phase's percentage plus `progressStartedAt` and `progressStartValue` for an ETA based only on work observed since that phase became visible. Numeric-only runtime download callbacks retain their current detail and phase; a new stage without a percentage clears the previous download percentage.
|
||||
- Renderer-visible setup progress copy should use `Setup`, not `Set up`, `Set Up`, or `Setting up`; internal identifiers may stay `setup`.
|
||||
- Progress payloads may include `canCancel`; set it only while a user cancel action can actually abort the current operation phase, such as an active image pull.
|
||||
- When a product operation fails for a recoverable reason, progress payloads should carry a stable error code so the renderer can show the right recovery action without parsing human-readable copy.
|
||||
- Runtime setup is additive and reuse-first: existing Docker Desktop, native Engine, and rootless endpoints are used before Linux Engine provisioning is offered.
|
||||
- If Docker diagnostics or inventory operations prove an endpoint is usable after a pessimistic availability probe, normalize the runtime state to ready before exposing it to the renderer.
|
||||
- Runtime setup may persist a `runtimeSetupResume` marker under the Docker Manager state file so reboot-required Windows setup can relaunch once and continue when the next step no longer needs elevation.
|
||||
- Windows RunOnce resume commands must work for both packaged apps and local default-app Electron launches. If Electron injects flags before the app path, skip those flags and preserve the first non-option app path.
|
||||
- Windows WSL setup may complete an intermediate step such as feature enablement or distro installation. Preserve the follow-up message instead of reporting the runtime as ready prematurely.
|
||||
- Windows WSL setup can continue from distro installation into Docker Engine installation when the distro is immediately usable; if Windows requires a restart or first-run distro setup, report that as the next step.
|
||||
- Linux runtime setup may install/start Docker Engine, then report `needs_relogin` when docker group access cannot apply to the current desktop session yet. Do not introduce CPU, memory, or disk sizing controls for native Linux Engine.
|
||||
- Progress messages should be user-oriented: `Starting selected version`, not raw Docker implementation chatter.
|
||||
- Running an installed Version from Versions should create a new launcher-managed container with a unique Docker name and open host ports, so repeated runs of the same image can coexist.
|
||||
- Running, active-instance creation, developer custom-image runs, and clones should label workspace storage metadata and use Docker `Mounts` for the canonical `/a0/usr` mount. Explicit ephemeral runs should still be labeled with storage metadata even though they do not receive the mount. Clones must receive a fresh workspace rather than reusing the source workspace mount.
|
||||
- Per-container start/stop/restart/delete/clone/rename/appearance actions from the Instances card menu still belong in this product layer. Container mutations must target the requested container id, return an operation id, refresh state afterward, and keep storage-volume deletion separate from container deletion. Rename and Colour/Icon selection are fast launcher metadata updates and may return synchronously.
|
||||
- Synchronous launcher-only metadata updates, including Settings, local Instance identity, credentials, and saved remote Instance edits, should patch and emit the cached product state after persistence. Do not rebuild Docker, GitHub, or registry-derived state when the operation cannot have changed it; remote health probing may continue asynchronously from the patched record.
|
||||
- Local instance card start/stop/restart/delete actions run through an in-memory per-container background queue and do not occupy the global Docker Manager operation slot. They return `{ opId, queued: true, background: true }`, publish `backgroundOperations` in state, and keep heavier flows such as install, clone, migration, activation, update, rollback, and developer runs on the single global progress operation.
|
||||
- Per-container log inspection belongs in this product layer as a bounded read-only snapshot. It may not expose generic Docker commands to the renderer.
|
||||
- Per-container Backup and Restore belong in this product layer. Backup should copy `/a0/usr` from the selected container into a core-compatible `.zip` with metadata; Restore should accept that backup shape, map only workspace entries back into `/a0/usr`, and report progress as a long-running operation.
|
||||
- Cloning an instance should reuse the source container's configured image reference, falling back to its image ID, remap published ports to Docker-assigned open host ports, and copy the selected `/a0/usr` workspace categories into fresh storage. Do not commit the source container into a clone-only image. With all categories selected, clone should copy the full `/a0/usr` tree to match Agent Zero backup behavior. `/a0/usr/agents` is the Agent profiles category and should stay separate from generic workspace files. When a clone inherits a host mount at `/a0`, add a process-scoped Git `safe.directory` entry so health metadata can read the checkout without copying host or source-container Git configuration. Persistence migration may still snapshot and pause a legacy source because it replaces that container while preserving its state.
|
||||
- Persisting `/a0/usr` data for a legacy or intentional ephemeral instance should be explicit. Create a persistent replacement, preserve the old container until the replacement starts successfully, copy `/a0/usr` through the Docker adapter archive path when possible, and include source/replacement names in the completion progress payload for the renderer notice.
|
||||
- Cancellation should be best-effort and explicit about whether the active Docker operation can actually stop.
|
||||
- Destructive flows should require renderer acknowledgement when the active instance may be replaced or data may be affected.
|
||||
- Error responses should pass through `toErrorResponse()` and map common Docker diagnostics to useful UI messages.
|
||||
|
||||
## Work Guidance
|
||||
|
||||
- Keep Docker Manager as the product layer. Low-level Docker quirks belong in
|
||||
`shell/docker_adapter`.
|
||||
- Keep Docker Manager as the product layer. Low-level Docker quirks belong in `shell/docker_adapter`.
|
||||
- Use helper functions for repeated tag, URL, digest, and port normalization.
|
||||
- Keep release matching digest-aware so the UI can distinguish installed images
|
||||
that match or differ from published releases.
|
||||
- If a new persisted field is introduced, document its shape here and keep
|
||||
migration/default behavior tolerant of older state files.
|
||||
- The installability cache may persist optional `tagUpdatedAt` and
|
||||
`tagMetadataCheckedAt` ISO timestamps for Docker Hub channel tags. Treat them
|
||||
as best-effort metadata and tolerate their absence in older caches.
|
||||
- Keep release matching digest-aware so the UI can distinguish installed images that match or differ from published releases.
|
||||
- If a new persisted field is introduced, document its shape here and keep migration/default behavior tolerant of older state files.
|
||||
- The installability cache may persist optional `tagUpdatedAt` and `tagMetadataCheckedAt` ISO timestamps for Docker Hub channel tags. Treat them as best-effort metadata and tolerate their absence in older caches.
|
||||
|
||||
## Verification
|
||||
|
||||
@@ -343,8 +112,7 @@ node --check shell/main.js
|
||||
git diff --check
|
||||
```
|
||||
|
||||
For changes touching state persistence, also exercise the affected path in a
|
||||
local launcher run.
|
||||
For changes touching state persistence, also exercise the affected path in a local launcher run.
|
||||
|
||||
## Child DOX Index
|
||||
|
||||
|
||||
Reference in new issue
Block a user