Skip to content

A personal assistant that lives on your desktop, remembers what matters, and can use your Mac for you.

TypeScript

build: run the bundled engine in the container image

Alan Buscaglia8d5a1359ddbd
diff --git a/Dockerfile b/Dockerfile
index 7321e43..d174785 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -17,18 +17,17 @@ COPY tsconfig.base.json ./
RUN pnpm --filter @gentle-dot/ui build
FROM node:24-bookworm-slim
+COPY --from=build /app /app
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates curl git tini \
&& rm -rf /var/lib/apt/lists/* \
- && npm install -g gentle-pi \
- # The companion-package setup needs `pi` on PATH; match the version gentle-pi bundles.
- && PI_VERSION="$(node -p "require('$(npm root -g)/gentle-pi/node_modules/@earendil-works/pi-coding-agent/package.json').version")" \
+ # The engine's first-run setup needs `pi` on PATH; match the version the daemon bundles.
+ && PI_VERSION="$(node -p "require('/app/packages/daemon/node_modules/@earendil-works/pi-coding-agent/package.json').version")" \
&& npm install -g "@earendil-works/pi-coding-agent@${PI_VERSION}" \
&& useradd --create-home dot \
- # gentle-pi installs its gentle-ai binary as root with mode 0700; the agent runs as dot.
- && chown -R dot:dot "$(npm root -g)/gentle-pi/.gentle-ai"
+ # gentle-pi installs its gentle-ai binary with mode 0700 during the build (as root); the engine runs as dot.
+ && chown -R dot:dot /app
COPY --from=engram /go/bin/engram /usr/local/bin/engram
-COPY --from=build /app /app
COPY docker/entrypoint.sh /usr/local/bin/gentle-dot-entrypoint
USER dot
WORKDIR /home/dot
diff --git a/odd/tasks/gentle-dot.md b/odd/tasks/gentle-dot.md
index 619f860..dfb87f5 100644
--- a/odd/tasks/gentle-dot.md
+++ b/odd/tasks/gentle-dot.md
@@ -31,6 +31,21 @@ Branch: `feat/gentle-dot` · Delivery strategy: `single-pr` (user choice, L7; fo
- Acceptance: `docs/design.md` holds the architecture, protocol v1, white-label layer, UX, visual system, recovery, and security, and this document holds the specs and tasks.
- Checks: structural readback (done in T0).
+- **S9 — The assistant is our rose, glowing.** User: "para el diseño, trata de utilizar nuestra rosa. ¿Bien? Estaría buenísimo que tenga animaciones, que tenga un glow, por ejemplo, como está trabajando, cosas así. pero un glow, ojo con lo que te voy a decir, la rosa misma, no el círculo donde está contenida, sino la rosa, que tenga un glow. Es más, podría ser como una línea que va recorriendo, que va teniendo un glow y que va recorriendo la rosa en sí, algo así." Earlier: "tendríamos que tener uno flotante también para Mac, cosa que si lo quieren tener en el escritorio, así dando vueltas mientras uno trabaja y le puedes hacer clic en cualquier lugar".
+ - Acceptance: the floating Dot is the rose itself in a transparent window, with no circle or container. Its traced strokes glow, and per state a line of light travels along the rose (design sheet `docs/brand/rose-design.html`). The menu bar uses `rose-glyph.svg` as a template icon, and the app icon is the neon rose on a black squircle. Reduce motion is respected.
+ - Checks: UI tests for state classes; a screenshot review of every state; tray and app icons regenerated.
+- **S10 — Sign in from the assistant itself.** User: "tenemos que tener la posibilidad de, desde lo que es el bot, poder hacer un login para las suscripciones y demás de que ya soporta API, bien, que ya soporta genteel Cell. Tenemos que tener esa capacidad. Eso es muy importante." "Puede ser alguna opción, hacer un barra login desde ahí mismo, etcétera. Te lo digo porque la idea es que esto es para las personas que no saben determinar eso, literal."
+ - Acceptance: from the panel or web UI, without a terminal, the user can sign in to every subscription provider and API key that Gentle Shell supports. That works both from a visible option and by typing `/login`, with plain-language guidance. Credentials stay where Gentle Shell keeps them and never pass through logs or the UI after entry.
+ - Checks: to be defined after exploring how Gentle Shell performs login in RPC mode.
+- **S11 — Create and edit profiles from the assistant.** User: "También la de crear profiles y modificarlos, como tenemos ahora, bien, pero desde el bot mismo."
+ - Acceptance: the user can list, create, edit, and switch the same profiles Gentle Shell supports today, from the UI, without a terminal.
+ - Checks: to be defined after exploration.
+
+- **S12 — The assistant brings its own instance.** User: "piensa que la persona puede ni siquiera tener GentleShell instalado, ¿eh? Por eso te lo digo. O sea, el bot tiene que tener su propia instancia con sus cositas. Y lo mismo que te digo, puede ser que la persona no tenga GentleShell instalado, por lo cual el login, los perfiles, todo eso, puede ser que no tenga nada, que venga pelado. Entonces, si tiene GentleShell, lo podríamos reutilizar, pero claro, si vos guardas un modelo con un syncing y tal para lo que es el bot, que quede solamente para el bot."
+ - Acceptance: Gentle Shell ships as a dependency of the daemon (`gentle-pi`), and the daemon runs it with its own home `~/.gentle-dot/agent` (forced through `--home`, so `~/.gentle-shell/config.json` cannot redirect it) and its own profile store (`GENTLE_PI_CONFIG_HOME=~/.gentle-dot/gentle-ai`). Sign-ins, models, settings, and profiles saved by the assistant stay in the assistant. It works from a clean machine with nothing configured. Reusing an existing Gentle Shell setup is only ever an explicit user choice.
+ - Checks: integration test of the spawn arguments and environment; a smoke run with a fresh data dir and no `gentle-shell` on PATH.
+ - Open decision (user: "Por ahí lo que se podría hacer es perfiles para el bot o reutilizar los que ya tenemos. No sé, eso tenemos que verlo."): whether profiles are the assistant's own or reused from Gentle Shell. T12 waits for it.
+
## Tasks
| ID | Specs | Route | Status | Commit / evidence | Scope |
@@ -42,9 +57,13 @@ Branch: `feat/gentle-dot` · Delivery strategy: `single-pr` (user choice, L7; fo
| T4 | S4 | inline | done | `194721d` RED (missing module) → GREEN 57 tests; `pnpm test:real` 2/2 | White-label: verify `--append-system-prompt` passthrough, `identity.md`, event sanitizer, tool-kind mapping, error neutralization |
| T5 | S2 | inline (parallel with delegated T7) | done | `f871c01`, fix `4ca84d3` (3 visual defects, RED → GREEN) | Web UI: chat, streaming Markdown, activity rows, conversations, composer with Stop/steer, visual tokens |
| T6 | S2, S4, S5 | inline | done | `f871c01`, e2e `dc425c0` + `5b466a8`: Playwright 7/7 | Ask cards (select/confirm/input/editor with timeout), toasts, interrupted-run Continue prompt, reconnect with `seq` gap recovery |
-| T7 | S1 | delegated writer (parallel units T5/T6 and T7, disjoint surfaces) | in progress | — | Tauri 2 app: tray menu, floating Dot window, expand panel, `⌥ Space` shortcut, daemon spawn/attach, position persistence, launch at login |
+| T7 | S1 | delegated writer (parallel units T5/T6 and T7, disjoint surfaces) | done | `81d70c3` cargo test 29/29 (parent re-ran), `tauri build --debug` produced `Gentle Dot.app`; GUI not launched yet (T9) | Tauri 2 app: tray menu, floating Dot window, expand panel, `⌥ Space` shortcut, daemon spawn/attach, position persistence, launch at login |
| T8 | S7 | inline | done | `ee74148` docker build OK, container smoke: health idle, companion setup 3/3 | `Dockerfile`, `compose.yaml`, `docs/deploy-vps.md`, security checklist, video step list |
-| T9 | S1–S6 | delegated verifier (high risk: process supervision, auth) | pending | — | Full verification: unit, integration, Playwright, `@real-agent`, `tauri build` + launch, manual macOS checklist with observed results |
+| T10 | S9 | inline | pending | — | Apply the rose design: Dot surface (transparent rose window ~64×84, traced strokes, glow, traveling light per state), tray template glyph with frames, app icon from the neon rose |
+| T11 | S10 | explore (delegated) then inline | done | `43a512d` RED → GREEN: 12 daemon auth tests (fake runtime + real offline ModelRuntime), 9 UI tests, e2e 8/8 incl. `/login` + API key connect/disconnect | Login from the UI for subscriptions and API keys (`/login` and a visible option) |
+| T12 | S11 | explore first, then inline | pending | — | Profiles: list, create, edit, switch from the UI |
+| T13 | S12 | inline | done | `43a512d` config + spawn tests; real smoke without gentle-shell on PATH: own home created, 42 providers, none configured | Bundle `gentle-pi`, own `--home` and profile store, first-run timeout, no PATH dependency |
+| T9 | S1–S6, S9–S12 | delegated verifier (high risk: process supervision, auth) | pending | — | Full verification: unit, integration, Playwright, `@real-agent`, `tauri build` + launch, manual macOS checklist with observed results |
Environment notes: Node v24.14.1 and pnpm are present. `cargo` is on PATH but `rustc` is not, so T7 must first install or repair the Rust toolchain (rustup) and asks before installing. Xcode is present.
@@ -62,4 +81,11 @@ Environment notes: Node v24.14.1 and pnpm are present. `cargo` is on PATH but `r
- **L10 (2026-10-08, T4 evidence):** the launcher forwards unknown args to Pi (`runtime/gentle-shell-launcher.mjs:153,971`), so `--append-system-prompt` works; the S4 assumption holds. `pnpm test:real` (opt-in through `GENTLE_DOT_REAL_AGENT=1` so ordinary runs cost no model calls) passed 2/2. Answer: "I’m Gentle Dot, a personal assistant that lives on your desktop and in your browser. I can work with your files, run tasks, remember things across conversations, and bring in focused helpers when needed." No hidden names appeared in any UI-bound message. Info toasts are hidden as harness chatter.
- **L11 (2026-10-08, T5/T6 evidence):** Route: T5/T6 inline and T7 delegated in parallel (Writer trigger (a): disjoint surfaces `packages/ui` and `apps/desktop/src-tauri`, contract fixed first in design §9). RED observed for components, client, and Dot (missing modules); exception: the store reducer was written before its tests ran (tests passed on the first run). Screenshots exposed 3 defects that the tests missed: lost user line breaks, start/end activity ids split, and a title stuck at "New conversation"; each got a RED test, then a fix (`4ca84d3`). Totals: vitest 88 passed + 2 opt-in skipped; Playwright 7/7 (chat, ask card, conversations, interruption + Continue, reload, rejected key, missing key).
- **L12 (2026-10-08, T8 evidence):** HostGator cPanel/WHM Apache owns ports 80/443, so the default compose binds `127.0.0.1:${DOT_PORT}` behind an Apache include (`docker/apache-gentle-dot.conf`, Basic Auth + WebSocket proxy), and Caddy is an opt-in profile for a VPS without a web server. The safety policy blocked creating `.env.example`; the variables are documented in `docs/deploy-vps.md` step 3 instead. Image fixes found by the smoke run: `gentle-pi` installs its gentle-ai binary as root with mode 0700 (chown to `dot`), and companion setup needs `curl` plus `pi` on PATH (pinned to gentle-pi's bundled version). Final smoke: health `idle`, companion packages installed, verification 3 passed. A chat inside the container was not run because it needs a model key.
-- **Next step:** integrate T7, then run T9.
+- **L13 (2026-10-08, user):** "Me haces un diseño de cómo se podría ver el iconito que vamos a cliquear para levantar a la gente y demás. Acordate que te dije que tendríamos que tener uno flotante también para Mac, cosa que si lo quieren tener en el escritorio, así dando vueltas mientras uno trabaja y le puedes hacer clic en cualquier lugar, tenemos que tener esa representación también." A violet orb design was produced (`9e8cecc`), then superseded by L15.
+- **L14 (2026-10-08, user):** "Genérame un cloud de design, por favor, y pásame el link." Options offered (a Claude Design prompt, a Higgsfield file link, a Higgsfield site); the user cancelled and redirected in L15. Nothing was published.
+- **L15 (2026-10-08, user):** S9 quote. Evidence: the rose source is `gentle-pi/assets/gentle-logo-only.png` (1254×1254 neon PNG), copied to `docs/brand/rose-source.png`. `docs/brand/tools/trace_rose.py` (isolated venv with numpy, Pillow, and scikit-image; threshold 120, closing disk(3), skeletonize) traced 178 strokes and 45 sparkles into `rose-lines.svg`. Traced strokes are illegible at 18 pt, so a hand-drawn `rose-glyph.svg` is used for the menu bar. Sheet: `rose-design.html`/`.png`; video: `rose-animation.webm` (`d4672e3`). T7 integrated (`81d70c3`) after removing unused Android/iOS/Windows icons.
+- **L16 (2026-10-08, user):** S10 and S11 quotes (login and profiles from the bot).
+- **L17 (2026-10-08, explore evidence):** `/login` is a built-in TUI command that RPC does not execute, and `/gentle:profiles`/`/gentle:models` use `ctx.ui.custom` (undefined in RPC). The daemon can sign in through `ModelRuntime.create({authPath, modelsPath}).login(providerId, type, {prompt, notify, signal}, {getDeviceId})`, exported from `@earendil-works/pi-coding-agent` (verified by the parent at `dist/core/model-runtime.d.ts:56-108`), with `AuthStorage` file locking. New credentials apply on the next request, but the model list needs a restart. Profiles live in `${GENTLE_PI_CONFIG_HOME:-~/.pi/gentle-ai}/profiles.json`; switching them globally exists only inside `extensions/gentle-ai.ts`.
+- **L18 (2026-10-08, user):** S12 quote. Decision: the assistant owns its instance (bundled `[email protected]` with pinned `pi-coding-agent`, `pi-ai`, and `pi-tui` 1.0.4). pnpm 11 `allowBuilds`: esbuild and gentle-pi allowed; `@google/genai` and protobufjs denied.
+- **L19 (2026-10-08, T13/T11 evidence):** A smoke run with a fresh data dir and `gentle-shell` removed from PATH started the bundled engine in `<data>/agent`: companion setup passed 3/3, the agent was idle, and `auth_list` returned 42 providers (9 with subscription sign-in: Claude Pro/Max, ChatGPT Plus/Pro and subscription, GitHub Copilot, xAI, Kimi, Meta, OpenRouter, Radius) with none configured. Defects found by the e2e and fixed test-first: (1) "Back to accounts" kept the finished flow on screen; (2) a fresh `ModelRuntime` with `refreshOnCreate: false` did not see stored credentials (verified with a direct probe), so it now refreshes on create, still offline. The real API key flow is one `secret` prompt with no network check, and `auth.json` is written with mode 0600. The Tauri capability adds `opener:default` for sign-in pages; cargo build + 29 tests pass. Dockerfile updated for the bundled engine (chown /app to dot; global `pi` pinned to the bundled version). Risk tier: high (credentials, item 2); independent verification in T9. Not verified: a real OAuth subscription sign-in (needs the user's account in a browser).
+- **Next step:** the profiles decision for T12 (asked), then T10, then T9.