Skip to content

Self-improving AI Employees for everyone

docs(cli): correct build, provisioning and deploy comments and docs

trohitga833ddda696d
diff --git a/.env.template b/.env.template
index d8d25f72..346920b7 100644
--- a/.env.template
+++ b/.env.template
@@ -4,7 +4,7 @@
# the Vite dev server in dev, proxying backend prefixes),
# 5679 backend uvicorn in dev, behind the Vite proxy (.env.dev),
# 5680 Temporal Web UI, 5681 Temporal gRPC,
-# 5682 Node.js executor, 5683 WhatsApp RPC.
+# 5682 JS/TS executor sidecar (runs on bun), 5683 WhatsApp RPC.
VITE_CLIENT_PORT=5678
PYTHON_BACKEND_PORT=5678
# Plugin-owned (read by nodes/code/, not core Settings). Related
@@ -24,6 +24,11 @@ DEBUG=false
WORKERS=1
# Security (Development keys - MUST CHANGE FOR PRODUCTION)
+# These two keys and JWT_SECRET_KEY below are public placeholders.
+# Replace each with the output of
+# python -c "import secrets; print(secrets.token_hex(24))"
+# before storing any credentials, and never change API_KEY_ENCRYPTION_KEY
+# after that: stored credentials are encrypted with it.
SECRET_KEY=dev-secret-key-12345678901234567890123456789012
API_KEY_ENCRYPTION_KEY=dev-encryption-key-12345678901234567890123456
diff --git a/.github/workflows/predeploy.yml b/.github/workflows/predeploy.yml
index ad38eeea..d8539723 100644
--- a/.github/workflows/predeploy.yml
+++ b/.github/workflows/predeploy.yml
@@ -1,5 +1,6 @@
# Reusable validation workflow. Called by ci.yml and release.yml.
-# Four jobs: client build + lint, backend tests, CLI tests, cross-OS build + start smoke test.
+# Jobs: build-and-lint (client build + lint), backend-tests, cli-tests,
+# test-build-start (cross-OS build + start smoke test).
name: Predeploy
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index f9c0e9d7..16d0e22d 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -1,6 +1,8 @@
# Release workflow: predeploy gate, publish the registry tarball to npmjs and
-# GitHub Packages with bun. No npm CLI and no setup-node: bun packs, authenticates
-# (~/.npmrc written from the job's token) and publishes.
+# GitHub Packages with bun. No npm CLI: bun packs, authenticates (~/.npmrc
+# written from the job's token) and publishes. The jobs have no setup-node step
+# of their own; the composite setup action installs Node, which bun uses to run
+# vite during `bun run build`.
#
# Triggers on version tag push. Manual dispatch publishes an EXISTING tag
# again, to one or both registries (a lapsed token, a failed mirror): the
diff --git a/cli/_common.py b/cli/_common.py
index e22427b5..8d38bc9e 100644
--- a/cli/_common.py
+++ b/cli/_common.py
@@ -77,7 +77,7 @@ def free_all_ports(cfg: Config) -> list[KillResult]:
# running the lifespan shutdown. uvicorn's default is "forever": a browser
# WebSocket that dies with a TCP reset can leave its handler task lingering,
# and then the backend never reaches the teardown that reaps Temporal, the
-# Node sidecar and the WhatsApp bridge. This is only the connection-drain
+# JS executor sidecar (bun) and the WhatsApp bridge. This is only the connection-drain
# phase, not the full backend shutdown budget. Same value the desktop shell passes.
UVICORN_GRACEFUL_SHUTDOWN_SECONDS = 5
BACKEND_CLEANUP_GRACE_SECONDS = 30
diff --git a/cli/buildenv.py b/cli/buildenv.py
index 7bdbd68a..e6f5df37 100644
--- a/cli/buildenv.py
+++ b/cli/buildenv.py
@@ -1,14 +1,15 @@
-"""Build-environment helpers shared by ``start`` / ``dev`` / ``daemon``.
+"""Build-environment helpers shared by ``start`` / ``serve`` / ``dev``.
``validate_build`` refuses to launch when ``company build`` hasn't been
run. Layout knowledge lives in :mod:`cli.platform_` -- this file only
composes the documented prefixes (workspace venv, node_modules, client
dist) into a boolean check.
-Subprocess callers (start / dev / daemon / temporal specs) build their
-argv via :func:`cli.run.uv_run`, which runs the command inside the uv
-workspace ``.venv`` per https://docs.astral.sh/uv/reference/cli/#uv-run.
-There is no path-to-interpreter logic on the CLI side -- uv owns that.
+The long-running backend (``start`` / ``serve`` / ``dev`` / ``daemon``)
+runs the server venv's interpreter directly via
+:func:`cli.platform_.server_venv_python`, not ``uv run``, so no resident
+``uv`` parent sits above it. :func:`cli.run.uv_run` remains for the
+one-shot steps of ``company build``.
"""
from __future__ import annotations
@@ -29,8 +30,12 @@ def validate_build(root: Path, *, require_client_dist: bool = False) -> None:
"""Refuse to launch if ``company build`` hasn't been run.
Raises ``typer.Exit(1)`` with a remediation hint. ``dev`` allows a
- missing ``client/dist`` (Vite serves the source); ``start`` opts in
- via ``require_client_dist=True``.
+ missing ``client/dist`` (Vite serves the source); ``start`` and
+ ``serve`` opt in via ``require_client_dist=True``.
+
+ Requiring ``node_modules`` for every caller is the open registry-install
+ bug in docs-internal/errors.md #25: a ``bun add -g`` install has no
+ ``node_modules`` next to the package, and only ``dev`` (Vite) needs it.
"""
if not node_modules_dir(root).exists() or not server_venv(root).exists():
console.print('[red]Error: Project not built. Run "company build" first.[/]')
diff --git a/cli/commands/build.py b/cli/commands/build.py
index 71c1a647..849cedd5 100644
--- a/cli/commands/build.py
+++ b/cli/commands/build.py
@@ -1,7 +1,8 @@
"""``company build`` -- replaces ``scripts/build.js``.
-Checks toolchain (node, bun, python, uv), then runs the 6-step
-build: ``.env`` bootstrap -> ``bun install`` -> client build ->
+Checks the toolchain (bun, python, uv; Node is optional and only
+reported), then runs the 6-step build: ``.env`` bootstrap ->
+``bun install`` -> client build ->
JS executor sidecar bundle (bun build) -> ``uv sync --extra docs`` -> compile Python bytecode
-> pooch-fetch Temporal binary.
diff --git a/cli/commands/clean.py b/cli/commands/clean.py
index cdfc7528..a9b84819 100644
--- a/cli/commands/clean.py
+++ b/cli/commands/clean.py
@@ -52,7 +52,7 @@ _TARGETS = [
# (``company deploy destroy`` could no longer find them) -- only
# ``deploy destroy`` removes that tree. ``packages/`` holds the
# OpenCompany-managed binaries (Temporal CLI ~114 MB, Stripe CLI, the
-# shared npm tree with claude/agent-browser/edgymeow): all of it is
+# shared bun-managed packages tree for the plugin CLIs): all of it is
# re-fetchable but expensive -- wiping it forced a full Temporal
# re-download on every clean+build cycle, which hard-fails ``company
# build`` on slow links. Anything else under ``.machina/`` (claude
diff --git a/cli/commands/serve.py b/cli/commands/serve.py
index 472cc012..2e672887 100644
--- a/cli/commands/serve.py
+++ b/cli/commands/serve.py
@@ -5,8 +5,8 @@ the built React SPA (via the ``SERVE_STATIC_CLIENT`` block in
``server/main.py``). Used locally for a production-shaped run AND as the
systemd ``ExecStart`` on a VM provisioned by ``company deploy``.
-Optional daemons are backend-owned and spawn on demand — the Node.js
-code-exec sidecar (``nodes/code/_runtime.py``), WhatsApp, and the
+Optional daemons are backend-owned and spawn on demand — the JS/TS
+code-exec sidecar on bun (``nodes/code/_runtime.py``), WhatsApp, and the
Temporal dev server all start from the backend, so ``serve`` supervises
exactly one process.
diff --git a/cli/config.py b/cli/config.py
index da0bc32d..e88287da 100644
--- a/cli/config.py
+++ b/cli/config.py
@@ -5,14 +5,18 @@ Stdlib-only env-var loader. Three env files, lowest precedence first:
1. ``.env.template`` — canonical production defaults. Ships with every
install. ``DATA_DIR=~/.opencompany`` (user home) is the daemon
behaviour: ``company start`` / ``company daemon`` use these.
- 2. ``.env`` — user overrides (created from the template by
- ``scripts/install.js``, which ``company provision`` runs after
- ``bun add -g @zeenie-ai/opencompany``, or by ``company build`` in a
- checkout). Gitignored.
- 3. ``.env.dev`` — dev-mode overrides. Loaded ONLY by ``company dev``
- via :func:`load_dev_overrides`. Pins ``DATA_DIR=.opencompany`` so
+ 2. ``.env`` — user overrides. Gitignored. Created as a plain copy of the
+ template by ``scripts/install.js``, which the root ``postinstall`` hook
+ runs on ``bun install`` in a checkout and ``company provision`` runs
+ after ``bun add -g @zeenie-ai/opencompany``. ``company build`` creates
+ it only when it is still missing, and then generates fresh secrets.
+ 3. ``.env.dev`` — dev-mode overrides, layered in by
+ :func:`load_dev_overrides` from ``company dev``, ``company stop`` (so it
+ also frees the dev backend port) and ``company build`` (so the build's
+ ``DATA_DIR`` matches ``dev``'s). Pins ``DATA_DIR=.opencompany`` so
per-checkout dev state lives at ``<repo>/.opencompany/`` instead of
- ``~/.opencompany/``. Committed to git. Existing explicit ``.machina``
+ ``~/.opencompany/``. Committed to git, but not shipped in the package,
+ so it is a no-op on a global install. Existing explicit ``.machina``
values remain valid and are intentionally honoured.
Process env (``os.environ``) wins over all three. Merged file values
@@ -110,7 +114,8 @@ class Config:
def load_dev_overrides(root: Path | None = None) -> None:
"""Layer ``.env.dev`` on top of ``.env.template`` + ``.env``.
- Called by ``company dev`` BEFORE :func:`load_config` so dev-only env
+ Called by ``company dev`` (and by ``company stop`` and ``company build``)
+ BEFORE :func:`load_config` so dev-only env
vars (notably ``DATA_DIR=.opencompany``, the per-checkout dev state
root) land in ``os.environ`` first. ``load_config`` then sees them
via its own ``setdefault`` pass and skips its template fallbacks.
diff --git a/cli/terraform/aws/main.tf b/cli/terraform/aws/main.tf
index 9ffb9827..b552e1f8 100644
--- a/cli/terraform/aws/main.tf
+++ b/cli/terraform/aws/main.tf
@@ -3,8 +3,8 @@ provider "aws" {
}
# Ubuntu 24.04 LTS (Canonical): Python 3.12 is inside the server's
-# ">=3.11,<3.13" pin, so uv needs no managed download, and apt's Node 18 is
-# enough for install.sh.
+# ">=3.11,<3.13" pin, so uv needs no managed download. install.sh installs
+# bun itself; nothing on the VM needs Node.
data "aws_ami" "ubuntu" {
most_recent = true
diff --git a/cli/terraform/gcp/startup.sh.tftpl b/cli/terraform/gcp/startup.sh.tftpl
index 74afd672..5907f135 100644
--- a/cli/terraform/gcp/startup.sh.tftpl
+++ b/cli/terraform/gcp/startup.sh.tftpl
@@ -19,7 +19,8 @@ apt-get install -y curl ca-certificates git unzip build-essential pkg-config lib
# executor sidecar and the plugin CLIs, and the installer for the package.
export BUN_INSTALL=/usr/local
curl -fsSL https://bun.sh/install | bash
-# uv on a stable system path (company build uses it to sync the Python venv).
+# uv on a stable system path (`company provision` below uses it to create and
+# sync the Python venvs).
curl -LsSf https://astral.sh/uv/install.sh | env UV_INSTALL_DIR=/usr/local/bin sh
# bun resolves its global "project" by walking up from $BUN_INSTALL/install/global
# to the first package.json; give that dir its own manifest so a stray one
diff --git a/docs-internal/SCRIPTS.md b/docs-internal/SCRIPTS.md
index 2537517d..dc679dd7 100644
--- a/docs-internal/SCRIPTS.md
+++ b/docs-internal/SCRIPTS.md
@@ -34,7 +34,7 @@ deprecation warning; kept for upgrade compatibility).
| `company dev` | Start in dev mode (Vite HMR + uvicorn). `--force` re-bundles Vite deps (recovers "Outdated Optimize Dep"); `--daemon` binds backend to 0.0.0.0 |
| `company serve` | Single-port production runtime (uvicorn serves API + WS + built SPA; optional daemons incl. the JS executor sidecar (bun) are backend-spawned on demand) — the systemd `ExecStart` on deployed VMs |
| `company stop` | Stop all services and free configured ports |
-| `company build` | Full production build (bun install → client → sidecar → `uv sync --extra docs` → bytecode → temporal binary). Step [0/6] scaffolds `.env` from `.env.template` when missing, generating fresh random secrets (`secrets.token_hex(24)`) for `SECRET_KEY` / `JWT_SECRET_KEY` / `API_KEY_ENCRYPTION_KEY` instead of the dev placeholders; an existing `.env` is untouched |
+| `company build` | Full production build (bun install → client → sidecar → `uv sync --extra docs` → bytecode → temporal binary). Step [0/6] scaffolds `.env` from `.env.template` when missing, generating fresh random secrets (`secrets.token_hex(24)`) for `SECRET_KEY` / `JWT_SECRET_KEY` / `API_KEY_ENCRYPTION_KEY` instead of the dev placeholders; an existing `.env` is untouched (and `bun install` in a checkout or `company provision` usually creates one first, as a plain template copy: see [Credentials Encryption → Placeholder secrets](./credentials_encryption.md#placeholder-secrets)) |
| `company clean` | Stop services, then remove build artifacts, node_modules, `.venv`, repo-local state (preserves `.opencompany/{workflows,deploy,packages}`) |
| `company deploy up/status/destroy` | Self-deploy a login-gated VM (gcloud preflight + Terraform; see `cli/commands/deploy/`) |
| `company daemon start/stop/status/restart` | Detached backend management (PID file under user data dir) |
@@ -46,7 +46,10 @@ Help comes from two places. `company` with no arguments, `company help`,
(`printHelp()` in `bin/cli.js`, its `COMMANDS` table), without starting
Python. `company <verb> --help` is forwarded to `python -m cli <verb> --help`
and prints Typer's help for that verb (`cli/cli.py`); `python -m cli` with no
-arguments prints Typer's own command list (`no_args_is_help=True`).
+arguments prints Typer's own command list (`no_args_is_help=True`). The two
+launcher-only verbs are the exception: `doctor` and `provision` never reach
+Python and ignore `--help`, so `company doctor --help` prints the report and
+`company provision --help` behaves like `company provision`.
### Desktop shell scripts (`desktop/package.json`, run from `desktop/`)
@@ -134,7 +137,7 @@ The Temporal dev server is backend-owned: the FastAPI lifespan starts it via `Te
| File | Purpose |
|------|---------|
-| `install.js` | End-user provisioning pipeline (`#!/usr/bin/env bun`; run by `company provision` — eagerly from `install.sh` / `install.ps1` / the cloud-init templates, or lazily by `bin/cli.js` on the first `company` command when `.cli-venv` is missing and the tree is not a source checkout; client build only when `client/dist` is missing from the tarball, `uv sync`, bytecode compile, CLI runtime venv, non-fatal Temporal binary fetch; the JS executor sidecar `dist/index.js` ships pre-built in the tarball) — mirrors `company build`; the compileall command shape is locked in sync by `cli/tests/test_release_pipeline_config.py` |
+| `install.js` | End-user provisioning pipeline (`#!/usr/bin/env bun`; run by `company provision` — eagerly from `install.sh` / `install.ps1` / the cloud-init templates, or lazily by `bin/cli.js` on the first `company` command when `.cli-venv` is missing and the tree is not a source checkout; client build only when `client/dist` is missing from the tarball, `uv sync`, bytecode compile, CLI runtime venv, non-fatal Temporal binary fetch; the JS executor sidecar `dist/index.js` is meant to ship pre-built in the tarball, but 0.2.0 and 0.2.1 lack it, see [errors.md #26](./errors.md)) — mirrors `company build`; the compileall command shape is locked in sync by `cli/tests/test_release_pipeline_config.py` |
| `preinstall.js` | Gates source checkouts to bun; legacy-package/temp cleanup (also runs on uninstall) |
| `postinstall.js` | Lifecycle entry (`bun install` in a checkout) that guards recursion and invokes install.js |
| `migrate_icons.py`, `migrate_skill_icons.py` | One-off icon-migration utilities (historical) |
diff --git a/docs-internal/ci_cd.md b/docs-internal/ci_cd.md
index a41f7eff..eda06e22 100644
--- a/docs-internal/ci_cd.md
+++ b/docs-internal/ci_cd.md
@@ -125,7 +125,7 @@ publish-npm publish-github-packages
npmjs, bun publish --access public npm.pkg.github.com, bun publish
```
-- Both publish jobs `needs: predeploy`, run on `ubuntu-latest`, and share the same prefix: immutable `actions/checkout` with `persist-credentials: false` → composite setup → `bun install --frozen-lockfile` → `bun run build` → `python -m cli version sync`. There is no `setup-node` step and no npm CLI anywhere in the release: bun packs, authenticates and publishes.
+- Both publish jobs `needs: predeploy`, run on `ubuntu-latest`, and share the same prefix: immutable `actions/checkout` with `persist-credentials: false` → composite setup → `bun install --frozen-lockfile` → `bun run build` → `python -m cli version sync`. Neither job has a `setup-node` step of its own, but the composite setup installs Node (see the table above), which bun uses to run vite during `bun run build`. There is no npm CLI anywhere in the release: bun packs, authenticates and publishes.
- `publish-npm` — writes `//registry.npmjs.org/:_authToken=<NPM_TOKEN>` to `~/.npmrc`, validates it with `bun pm whoami`, then publishes the canonical public npmjs package `@zeenie-ai/opencompany` via `bun publish --access public`. npm provenance attestation was an npm-CLI feature and is gone with it.
- `publish-github-packages` — writes `@zeenie-ai:registry=https://npm.pkg.github.com/` and the `//npm.pkg.github.com/:_authToken=<GITHUB_TOKEN>` line to `~/.npmrc`, then a plain `bun publish`. bun 1.4 ignores `publishConfig.registry`, and it keeps an `.npmrc` token only for the registry that same file points at, so the route and the token must sit together; the v0.2.0 mirror publish went to npmjs with the GitHub token and failed with `missing authentication` before this was known ([errors.md #24](./errors.md#24-github-packages-publish-fails-with-missing-authentication-although-the-job-wrote-a-token-for-npmpkggithubcom)).
- `bun publish` runs the root `prepublishOnly` script in both jobs, so `python -m cli version sync` runs a second time inside the publish step (a no-op after the explicit sync step), followed by a `bun -e` check that `package.json` still has `bin` and `version`. The root `publishConfig` still carries `registry: https://registry.npmjs.org` beside `access: public` (`test_root_package_uses_public_zeenie_scope` locks both), but bun ignores that `registry` key: each job's `~/.npmrc` alone decides where it publishes.
diff --git a/docs-internal/deployment_legacy.md b/docs-internal/deployment_legacy.md
index ae8fe3a8..438fbca0 100644
--- a/docs-internal/deployment_legacy.md
+++ b/docs-internal/deployment_legacy.md
@@ -21,6 +21,13 @@ One command provisions a login-gated OpenCompany VM on a cloud provider. Two sta
script (`startup.sh.tftpl`) that installs bun + uv (no Node, no npm), `bun add -g`s the package,
provisions its Python side with `company provision`, and runs `company serve` under systemd.
+> **Known issue in 0.2.0 and 0.2.1 ([errors.md #25 and #26](./errors.md))**: on a registry
+> install, `company serve` stops with `Project not built. Run "company build" first.`, so the
+> VM's systemd service fails and keeps restarting, and the package also lacks the JS executor
+> sidecar bundle. Until the fix ships, run `company build` once on the VM as root (the startup
+> script's user), which fixes both, then `systemctl restart opencompany` (`machinaos` on a
+> pre-rebrand deployment).
+
Login gate = built-in auth (`VITE_AUTH_ENABLED=true`, `AUTH_MODE=single`) with the owner
credential generated at deploy time and seeded on first boot. `build_app_env`
(`cli/commands/deploy/_secrets.py`) also sets `DEPLOYMENT_MODE=cloud` on the VM and mints
diff --git a/docs-internal/release_build_pipeline.md b/docs-internal/release_build_pipeline.md
index 2102689b..d7ea9867 100644
--- a/docs-internal/release_build_pipeline.md
+++ b/docs-internal/release_build_pipeline.md
@@ -158,17 +158,17 @@ The tarball still excludes `__pycache__/` per `package.json` `files` (cross-Pyth
- **`company build` layers `.env.dev` first.** `build_command()` calls `cli.config.load_dev_overrides(root)` before the install steps, so the build's `DATA_DIR` matches what the runtime sees. Without it, a repo checkout's `company build` read `DATA_DIR=~/.opencompany` from `.env.template` and installed Temporal under user home, but `company dev` then read `DATA_DIR=.opencompany` from `.env.dev` and re-downloaded into `<repo>/.opencompany/` — a redundant ~114 MB fetch on every fresh clone.
- **Safe for global installs.** `.env.dev` is git-committed for contributors but is NOT in the `files` list, so an installed (`bun add -g`) copy has no `.env.dev` — `load_dev_overrides` is a no-op and everything falls through to the `.env.template` default (`DATA_DIR=~/.opencompany`), matching `company start` / `company daemon`.
-### 5. Wire compileall into install.js (the sidecar bundle ships pre-built)
+### 5. Wire compileall into install.js (the sidecar bundle is meant to ship pre-built)
- `scripts/install.js` → after `uv sync`:
1. `uv run python -m compileall -q -j 0 <COMPILEALL_SOURCE_DIRS>` — same shape as build.py (no `-O`; locked in sync by `cli/tests/test_release_pipeline_config.py`)
-- The sidecar is **not** rebuilt at install time: `company build` step `[3/6]` runs `bun run --filter opencompany-nodejs-executor build` before `bun pm pack` / `bun publish`, and `server/nodejs/dist/index.js` rides inside the tarball (the `server/` entry in the root `files` list covers it). Likewise the client is only built by install.js when `client/dist/index.html` is missing.
+- The sidecar is **not** rebuilt at install time: `company build` step `[3/6]` runs `bun run --filter opencompany-nodejs-executor build` before `bun pm pack` / `bun publish`, and `server/nodejs/dist/index.js` was meant to ride inside the tarball under the `server/` entry in the root `files` list. It does not: `bun pm pack` honours the nested `server/nodejs/.gitignore`, which lists `dist/`, so 0.2.0 and 0.2.1 ship without the bundle ([errors.md #26](./errors.md)); `company build` in the installed package rebuilds it. Likewise the client is only built by install.js when `client/dist/index.html` is missing.
Idempotent on re-runs (compileall only rewrites stale pyc; `bun build` is deterministic).
### 6. Tarball verification
-- `bun pm pack --dry-run` after the change. Confirm `server/nodejs/dist/index.js` is included (existing `server/` glob already covers it). Confirm no `__pycache__/` leakage.
+- `bun pm pack --dry-run` after the change. Confirm `server/nodejs/dist/index.js` is included; today it is not (errors.md #26). Confirm no `__pycache__/` leakage.
- `server/uv.lock` is committed (since the desktop app) and ships in the tarball; `.npmignore` only hides `package-lock.json` (a legacy artefact — the tree is `bun.lock`-only). The desktop stage script also reads the `bun pm pack --dry-run` file list as its layout source of truth, so a change to the root `files` allowlist reaches the desktop bundle automatically.
## Critical files
@@ -179,9 +179,9 @@ Idempotent on re-runs (compileall only rewrites stale pyc; `bun build` is determ
| `client/package.json` | `typecheck` delegates to the root gate; keeps `typescript@^5.x` for typescript-eslint |
| `client/vite.config.js` | + manualChunks, target, lower warning |
| `server/nodejs/package.json` | `bun build --target=bun` build script, `bun dist/index.js` start, `bun --watch` dev, `engines.bun` (no esbuild / tsx deps) |
-| `server/nodejs/.gitignore` | new — ignore `dist/` |
+| `server/nodejs/.gitignore` | new — ignore `dist/` (this nested rule is what drops the bundle from `bun pm pack`: errors.md #26) |
| `cli/commands/build.py` | + compileall step (`[5/6]`, plain `.pyc` — no `-O`), `COMPILEALL_SOURCE_DIRS` constant |
-| `scripts/install.js` | + compileall call (sidecar bundle arrives pre-built in the tarball) |
+| `scripts/install.js` | + compileall call (expects the sidecar bundle pre-built in the tarball, which 0.2.x lacks: errors.md #26) |
| `server/pyproject.toml` | `[tool.uv] compile-bytecode = true` — `uv sync` compiles `.venv/` site-packages |
| `.github/workflows/predeploy.yml` | + typecheck gate in `build-and-lint`; + `tsc --version` in the cross-OS matrix |
@@ -192,7 +192,7 @@ Idempotent on re-runs (compileall only rewrites stale pyc; `bun build` is determ
3. `cd server/nodejs && bun run build && NODEJS_EXECUTOR_PORT=<port> bun dist/index.js` → starts on `NODEJS_EXECUTOR_PORT` (required env; no fallback literal) in <100ms; `GET /health` reports `runtime: "bun"`.
4. `cd server && uv run python -m compileall -q -j 0 services` → plain `__pycache__/*.pyc` present (no `.opt-1.pyc` — nothing loads those).
5. Cold-start: clean install + `company start > start.log 2>&1` → `Application startup complete` at ≤+50s (was +66.9s).
-6. `bun pm pack --dry-run` → `server/nodejs/dist/index.js` included; no `__pycache__/`; tarball size ≤ v0.0.76.
+6. `bun pm pack --dry-run` → `server/nodejs/dist/index.js` should be included (0.2.x omits it: errors.md #26); no `__pycache__/`; tarball size ≤ v0.0.76.
7. Smoke: `company start` → load the app URL (`http://localhost:${PYTHON_BACKEND_PORT}`) → run "AI Assistant" example → agent responds.
## Desktop installers
diff --git a/scripts/install.js b/scripts/install.js
index b152c4df..63e5ecf9 100755
--- a/scripts/install.js
+++ b/scripts/install.js
@@ -14,7 +14,8 @@ import { existsSync, copyFileSync } from 'fs';
import { resolve, dirname } from 'path';
import { fileURLToPath } from 'url';
-// Prevent recursive execution when npm install runs in subdirectories
+// Prevent recursive execution: the `bun install` this script runs below
+// re-triggers the root postinstall hook, which would call this script again.
if (
process.env.OPENCOMPANY_INSTALLING === 'true'
|| process.env.MACHINAOS_INSTALLING === 'true'
@@ -174,11 +175,11 @@ console.log(
: ' temporal: not on PATH, pooch copy installed below',
);
-// agent-browser is managed by the Python backend
-// (server/nodes/browser/_install.py) — `bun add`ed into the shared
-// <DATA_DIR>/packages/ tree on first use, with the Chromium runtime
-// fetched by ``agent-browser install`` when the browser node first
-// spawns. No dependency here, no postinstall step.
+// The Browser node's runtime is installed by the Python backend on first
+// use: server/nodes/browser/_install_bu.py fetches the pinned browser-use
+// CLI as a uv tool, and _install_chrome.py selects an installed
+// Chrome/Edge/Chromium (it downloads Chrome for Testing only with
+// BROWSER_RUNTIME=testing). No dependency here, no postinstall step.
console.log('');
console.log('Installing...');
@@ -279,7 +280,7 @@ try {
console.log(`[${step}/${totalSteps}] Installing Temporal binaries...`);
// Non-fatal: TemporalServerRuntime._pre_spawn() re-runs this download
// lazily on first `company start` — a failed fetch must never fail
- // `npm install`.
+ // provisioning (`bun install` in a checkout, `company provision`).
try {
run('uv run python -m services.temporal._install', serverDir, 600000);
} catch (err) {