Commit Graph
58 Commits
Author SHA1 Message Date
Florian Schmidt 6350f1e6f4 feat(web): app icon and logo (#14)
A notebook with a shell prompt on a dark tile, as one SVG used for the
favicon, the top bar, sign-in, setup and the README. PNG renders (192,
512, apple-touch) and a web manifest let browsers and phones show it
when the app is added to the home screen.
2026-11-16 15:21:07 +01:00
Florian Schmidt bcf392e95a docs(mind): record collapsible parameters (#13) 2026-11-16 14:45:54 +01:00
Florian Schmidt 57305a2dc6 feat(web): collapsible parameter form and groups (#13)
The parameter form and each included notebook group collapse; the choice
is remembered in the browser. Collapsed, the form lists only missing
required values and values changed from their default as chips that open
their field, and counts untouched defaults, so it stays one line.
2026-11-16 14:45:54 +01:00
Florian Schmidt 6bfcc9d70d fix(core): report parameter errors at their line with a quoting hint (#13)
An unquoted comma in a flow-mapping label splits it into a valueless key.
Parameter diagnostics now point at the parameter's own frontmatter line,
and a valueless unknown field says that the value needs quotes.
2026-11-16 14:45:53 +01:00
Florian Schmidt dd0af5d580 docs(mind): record web UI shell (#12) 2026-11-16 12:32:01 +01:00
Florian Schmidt e38f9c453c feat(web): rework layout and quality of life (#12)
- App shell: top bar with connection state and Chat/Terminal toggles,
  per-column scrolling, sidebar only on the Notebooks page.
- Hash routes (#/notebooks/<path>, #/hosts, #/settings) so reloads and
  links keep the open notebook and page.
- Parameters sit beside the notebook on wide screens, collapsible, with
  missing-count summary and Reset; non-secret values are remembered per
  notebook in localStorage (secrets and undeclared names never stored).
- Sticky notebook header with breadcrumbs, check summary and run-all;
  Ctrl/Cmd+S saves the Markdown draft.
- Step cards show target, one deduplicated hint for missing values and
  copy feedback.
- Shared Dialog, Menu and CopyButton components; notebook and host
  actions move into menus and modal dialogs.
- Hosts page as a compact list; Settings split into cards with sign out
  for this browser.
2026-11-16 12:32:01 +01:00
Florian Schmidt 16cfcd36ea fix(templates): avoid template syntax in LXC prose (#12)
The literal {{ct.host}} in prose was composed into {{ct.ct.host}} when the
notebook is included; describe the capture in words instead.
2026-11-16 12:31:54 +01:00
Florian Schmidt 382da1736f fix(core): keep unset values visible in prose (#12)
renderText now leaves {{name}} in place when the value is empty, so prose
shows which parameter is still missing instead of a blank.
2026-11-16 12:31:54 +01:00
Florian Schmidt 276d6ef3ca docs(mind): record chained notebook decisions (#11) 2026-11-16 11:42:50 +01:00
Florian Schmidt 54115289cc feat(deploy): bring new notebook templates into existing workspaces (#11)
Each shipped template is offered once (recorded in
/etc/shellbook/templates-offered) and copied as the service user only
when the file does not exist, so updates add new templates without
overwriting files or restoring deleted ones.
2026-11-16 11:42:13 +01:00
Florian Schmidt 85afd105f7 feat(templates): LXC container and chained web server notebooks (#11)
infra/lxc-container.md creates an unprivileged container on a Proxmox
host with ShellBook's key, waits for its address and adds it to Hosts.
services/web-server.md installs nginx on an existing host or on a new
container through ::use. Document chaining in the spec (3.6) and in the
workspace format guide.
2026-11-16 11:42:12 +01:00
Florian Schmidt 845d6c828e feat: chained notebooks with when sections and host blocks (#11)
A notebook can include another one and continue with what it produced:

- core: parse :::when{param=a,b}, ::use{notebook= as= with=} and
  ::host{name= address= user= port= capture=}; composeNotebook namespaces
  an included notebook's params, steps, captures and templates by alias
  (cycles, missing files, depth > 4 and child errors are reported on the
  use line). Defaults may reference captures and builtins
  ({{shellbook.public_key}}); required params and secrets gate only steps
  of their own scope; secretEnv passes a scope's secrets under local names.
- protocol: NotebookResponse gains includes and builtins.
- server: compose includes on load, inject builtins (client values are
  ignored), refuse steps in inactive when sections.
- web: render when/use/host blocks, group included params in the form,
  add a created machine to Hosts and capture its name, reload when an
  included notebook changes, run all checks only for active steps,
  authoring snippets for when, use and host.
2026-11-16 11:42:12 +01:00
Florian Schmidt 28e806d641 docs(mind): fix entry counts 2026-11-16 10:58:35 +01:00
Florian Schmidt 5e923b9c30 docs(mind): record bundle import and deploy update decisions 2026-11-16 10:58:28 +01:00
Florian Schmidt 399628bf16 feat(deploy): one-step install/update from the Proxmox host (#6)
bootstrap.sh runs on the Proxmox host via
  bash -c "$(curl -fsSL .../deploy/proxmox/bootstrap.sh)"
It unpacks the repository into a temporary directory, runs
create-ct.sh and removes everything again; create-ct.sh also removes
the installer files it pushed into the CT. Nothing stays on the host.

install.sh now installs or updates: an existing checkout is pulled
(fast-forward, SHELLBOOK_REF pins are kept), the service is restarted
and health-checked, and the summary prints the address, the one-time
setup token while setup is pending, the Claude login state and the
SSH public key.

It also installs a root-owned `shellbook-update` that downloads the
installer from the repository and reruns it. Root never executes
scripts from /opt/shellbook, which the service user and its terminal
panel can modify, so deploy/update.sh is removed.

Verified in a Debian 13 container: fresh install, then an update that
pulls a new commit while a tampered checkout script is not executed;
bootstrap.test.sh checks that host and CT keep no installer files.
2026-11-16 10:57:42 +01:00
Florian Schmidt 5e60973ebf fix(server): start the production bundle again (#7)
The bundled server crashed at startup with "Named export 'utils' not
found": ssh2 is CommonJS and Node's ESM loader does not expose `utils`
as a named export. Vitest resolves the module differently, so the unit
tests passed. Import ssh2 through its default export instead.

New test builds the bundle with the package's own esbuild command and
starts it with Node until /api/health answers.
2026-11-16 10:56:27 +01:00
Florian Schmidt 4fe64ee110 docs: record UI-first rule and deploy/integration lessons
AGENTS.md gains the invariant that servers, credentials, notebooks, chat and setup are all doable from the web UI. Project mind records #7-#10 status and the pct exec, TUN, path-convention and watcher-timing gotchas.
2026-11-16 10:32:37 +01:00
Florian Schmidt 27be03d79a test(server): make the notebook watcher test robust under load
The full parallel test run on Windows can delay file events by more
than the 100 ms debounce, which split one burst into two events and
failed the test intermittently. Use a 300 ms debounce, longer quiet
windows and explicit wait timeouts.
2026-11-16 10:31:11 +01:00
Florian Schmidt 324ad4b39a fix: show why SSH connection tests and runs fail (#7)
Test connection, key installation and runs now tell authentication
failures apart from unreachable hosts (refused, timeout, DNS, ...)
instead of a generic "SSH connection failed".

The web client keeps the server's deliberate error messages (4xx,
502, 503) and shows them in the hosts page; unexpected 500 errors
still show only the status. The reload hint appears only on 409
conflicts.
2026-11-16 10:31:11 +01:00
Florian Schmidt 83e4e3f15e Merge branch 't3/manage-host-ssh-credentials'
# Conflicts:
#	.agents/mind/architecture.md
#	apps/server/src/app.ts
#	apps/web/src/App.tsx
#	packages/core/src/protocol.ts
2026-11-16 10:24:42 +01:00
Florian Schmidt 488f992bd3 fix(web): send workspace-relative notebook paths from the chat panel (#8)
The app passes notebook paths relative to notebooks/, but the chat
protocol uses workspace paths (notebooks/...). Every message sent while a
notebook was open was rejected as invalid, and "Open notebook" links on
Claude's edits loaded a non-existent path. ChatPanel now converts at its
boundary in both directions.
2026-11-16 10:23:05 +01:00
Florian Schmidt 63458dd3e4 Merge branch 't3/claude-chat-panel'
# Conflicts:
#	.agents/mind/gotchas.md
#	packages/core/src/protocol.ts
2026-11-16 10:23:05 +01:00
Florian Schmidt df6698c67d Merge branch 't3/notebook-management-authoring'
# Conflicts:
#	.agents/mind/architecture.md
#	packages/core/src/protocol.ts
2026-11-16 10:19:57 +01:00
Florian Schmidt 4d9a632625 feat(hosts): manage servers and encrypted SSH credentials in UI (#7) 2026-11-16 10:19:52 +01:00
Florian Schmidt 2e907b75f2 fix(server): keep existing notebooks manageable and pruning inside notebooks/ (#9)
Reading, saving, renaming and deleting applied the create-time name rules
to existing files, so notebooks named outside those rules (umlauts,
brackets; written by git or Claude) were listed but returned 400. Name rules
now apply to new paths only; existing paths keep the traversal/symlink checks.

Empty-folder pruning compared a realpath against an unresolved root. With a
symlinked workspace path it walked past notebooks/ and removed the
notebooks folder itself. It now uses the resolved root and stops at it.
2026-11-16 10:19:02 +01:00
Florian Schmidt 0055001abf feat(web): add notebook chat panel (#8) 2026-11-16 10:17:20 +01:00
Florian Schmidt 911387264b feat(notebooks): manage and author notebooks in the web UI (#9)
Add atomic, versioned notebook mutations, a searchable folder tree, and editor insertion forms. Validate notebook paths and symlink roots and retain drafts after external changes.

Add yaml as a direct web dependency, reusing the existing workspace library for comment-preserving frontmatter edits.
2026-11-16 10:16:43 +01:00
Florian Schmidt 7095842cf0 Merge branch 't3/settings-first-run-setup' 2026-11-16 10:15:50 +01:00
Florian Schmidt 02a22bef40 feat(settings): add browser setup and administration (#10) 2026-11-16 10:15:04 +01:00
Florian Schmidt 4fe7e4e376 fix(deploy): set PATH and keep Node files root-owned (#6)
pct exec runs with PATH=/sbin:/bin:/usr/sbin:/usr/bin, so install.sh failed
right after installing Node to /usr/local/bin ("node: command not found");
update.sh had the same gap for pnpm. Both scripts now set PATH explicitly.

tar ran as root kept the Node tarball's uid, and cp -a carried it into
/usr/local (bin directory and npm included), handing whichever CT user has
that uid write access to code root executes. Extract with --no-same-owner;
a rerun repairs an affected CT.
2026-11-16 09:45:53 +01:00
Florian Schmidt df489fa147 fix(deploy): keep existing manual TUN passthrough on reused CTs (#6)
create-ct.sh only recognised devN passthrough and added dev0 on top of a
manual lxc.mount.entry for /dev/net/tun (left by earlier Tailscale setups),
so the CT failed to start in the autodev hook (EEXIST). Detection now lives
in ct-config.sh with a regression test.
2026-11-16 09:35:19 +01:00
Florian Schmidt c3ef790d9d docs: record milestone status in project mind 2026-11-16 00:23:41 +01:00
Florian Schmidt 2857bfe047 style(web): drop UTF-8 byte order marks from new sources (#5) 2026-11-16 00:22:23 +01:00
Florian Schmidt 620ac75668 Merge branch 't3/web-terminal-artifacts' 2026-11-16 00:21:44 +01:00
Florian Schmidt b224fff7f3 feat(web): handle one-shot sensitive artifact downloads (#4)
Track sensitive download state per run in the session reducer. Fetch each artifact once into a blob so expired or consumed downloads show HTTP 410 without a separate preflight request. Verify the SSH-key notebook, capture substitution, failure sections and public-key upload provenance through App. Document demo and real terminal workflows.
2026-11-16 00:21:24 +01:00
Florian Schmidt b50d49b790 fix(server): report failing scripts via run.finished only (#4)
A non-zero exit is a normal result (a failed check shows as a cross), not an execution error; publishing run.error showed an error banner for every failed check.
2026-11-16 00:21:17 +01:00
Florian Schmidt a6429e0527 feat(web): add xterm terminal panel (#5)
Use @xterm/xterm for terminal emulation and its official @xterm/addon-fit for container sizing. Lazy-load both on first open to keep them out of the main bundle. Preserve the mounted terminal on collapse and offer explicit reconnect; provide an echo transport for demos.
2026-11-16 00:21:17 +01:00
Florian Schmidt 08d5441cf2 refactor(web): use real core in demos and tests (#4, #5) 2026-11-16 00:21:03 +01:00
Florian Schmidt d10b2114df Merge branch 't3/sensitive-artifact-retention' 2026-11-16 00:19:48 +01:00
Florian Schmidt 7ba8aabb37 feat(server): add one-shot sensitive artifacts and retention (#4) 2026-11-16 00:19:26 +01:00
Florian Schmidt af66a26993 docs: update project mind after parallel milestone merge 2026-11-16 00:15:02 +01:00
Florian Schmidt 4e79af3e24 fix(web): keep host key prompt open after the aborted run finishes (#2)
The server publishes run.finished (exit -1) right after run.hostKeyUnknown, which closed the confirmation dialog immediately.
2026-11-16 00:13:24 +01:00
Florian Schmidt cc68fe39b3 Merge branch 't3/build-web-runbook-ui'
# Conflicts:
#	pnpm-lock.yaml
2026-11-16 00:12:42 +01:00
Florian Schmidt 1dbea28b43 feat(core): flag sensitive artifacts in run.finished (#4)
Optional, additive protocol field so the web UI can mark one-shot downloads such as private keys.
2026-11-16 00:11:40 +01:00
Florian Schmidt b7051d2479 Merge branch 't3/implement-auth-deploy'
Integrate auth, config, watcher and terminal wiring in buildApp: auth guards every API route by default, notebook watcher events feed the /api/events hub, the terminal runs in the configured workspace, and SHELLBOOK_DATA_DIR is the single data directory variable. The systemd unit uses KillMode=process so tmux sessions survive service restarts.
2026-11-16 00:11:06 +01:00
Florian Schmidt b36299340b Merge branch 't3/server-terminal-watcher'
# Conflicts:
#	apps/server/package.json
#	apps/server/src/app.ts
#	pnpm-lock.yaml
2026-11-16 00:08:35 +01:00
Florian Schmidt 443bf944b8 feat(web): add shell-first runbook UI and mock demo (#2)
Add notebook parameters, literal highlighted scripts, copy helpers, streamed runs, host-key confirmation, artifacts, conditional notes, login and optimistic Markdown editing. Keep the temporary core renderer isolated to mock mode.

Use React and Vite for the UI, react-markdown for safe Markdown rendering, highlight.js for shell syntax, and CodeMirror 6 for Markdown editing. Add Testing Library, jsdom and Vitest for component and event-state coverage.

Validate pnpm install, root typecheck and test (29 web tests, 1 server test), plus normal and mock web builds. Core contracts remain unchanged; real backend execution awaits the parallel core/server implementations.
2026-11-16 00:08:30 +01:00
Florian Schmidt ae4e2be528 Merge branch 't3/server-ssh-run-pipeline' 2026-11-16 00:08:10 +01:00
Florian Schmidt 6926526a56 feat(server): implement workspace and SSH run pipeline (#3)
Add strict host-key confirmation, FIFO execution, streamed events, audit records, captures and SFTP artifacts/uploads. Use ssh2 for SSH/SFTP, yaml for inventory parsing, and compile-time ssh2/ws declarations.
2026-11-16 00:07:42 +01:00
Florian Schmidt 1f385b6538 feat(deploy): provision Debian 13 Proxmox containers (#6)
Add architecture-filtered template selection, safe CT reuse, TUN passthrough, a service-user installer, updates, and a Traefik example. Verify official Node 22 binaries with SHA-256 checksums and document deployment and credential setup.

Cover mixed amd64/arm64 template selection with five bash regression checks.
2026-11-16 00:07:23 +01:00
Florian Schmidt af331177ac feat(server): add persistent authentication and production build (#6)
Protect HTTP and WebSocket API routes with scrypt password login and signed persistent sessions. Restrict forwarded identity and HTTPS detection to configured proxies, and serve optional web assets with SPA fallback.

Add @fastify/static for Fastify-compatible static file handling and esbuild to bundle TypeScript core source while retaining native dependencies externally.
2026-11-16 00:07:18 +01:00
Florian Schmidt c993089f37 fix(core): normalize CRLF line endings in step scripts (#1)
Bash treats a trailing carriage return as part of the command, so notebooks saved with CRLF endings produced broken scripts.
2026-11-16 00:06:28 +01:00
Florian Schmidt eee6c0d4fb Merge branch 't3/implement-core-notebook-parser' 2026-11-16 00:05:45 +01:00
Florian Schmidt f0d5de691a feat(core): implement notebook parsing and safe parameter rendering (#1)
Parse YAML frontmatter, shell steps and conditional sections with source ranges and diagnostics. Resolve typed defaults and runtime values through one script substitution path, keeping secrets env-only and validating artifact metadata.

Add yaml for standards-compliant frontmatter parsing and bounded alias handling rather than implementing YAML locally. Cover the spec example and edge cases with 59 core tests, including 256 POSIX shell quoting round trips.
2026-11-16 00:05:27 +01:00
Florian Schmidt 91ac1df8a5 feat(templates): add starter runbook workspace (#5)
Document the notebook format and provide SSH-key, hardening-check, and package-install examples with inventory and credential exclusions.
2026-11-16 00:04:45 +01:00
Florian Schmidt 7cf1ef82ba feat(server): add persistent terminal and notebook watcher (#5)
Use node-pty for native terminal support and chokidar for recursive cross-platform watching with atomic-save normalization. Validate terminal messages, detach clients safely, and expose debounced typed notebook events.
2026-11-16 00:04:45 +01:00
Florian Schmidt d06f4336ae chore: add pnpm monorepo skeleton with core contracts
Shared notebook model (types.ts), HTTP/WebSocket protocol (protocol.ts) and
core function signatures (stubs) so core, server and web can be built in
parallel. Minimal Fastify server with a health route and test.
2026-11-15 23:51:06 +01:00
Florian Schmidt a5fea2f82f docs: add specification, agent rules and project notes 2026-11-15 23:51:05 +01:00