Skip to content

Self-improving AI Employees for everyone

build(cli): swap pnpm invocations to bun in build/dev pipelines

trohitg9f69883e0afd
diff --git a/bin/cli.js b/bin/cli.js
index f88d3d7b..49ea3747 100755
--- a/bin/cli.js
+++ b/bin/cli.js
@@ -132,7 +132,7 @@ function doctor() {
}
const has = (f) => { try { readFileSync(resolve(ROOT, f)); return true; } catch { return false; } };
- console.log(has('pnpm-lock.yaml') ? ' Lockfile: pnpm-lock.yaml' : has('package-lock.json') ? ' Lockfile: package-lock.json' : ' Lockfile: Not Found');
+ console.log(has('bun.lock') ? ' Lockfile: bun.lock' : has('package-lock.json') ? ' Lockfile: package-lock.json' : ' Lockfile: Not Found');
console.log(has('server/.venv/pyvenv.cfg') ? ' Python venv: OK' : ' Python venv: Missing (run company build)');
console.log('');
}
@@ -151,7 +151,7 @@ function run(script, extraArgs = []) {
// ``-m cli <cmd>``. Skips the ``npm run`` shim that previously re-
// resolved the system ``python`` (which on PEP 668 systems lacks
// the CLI runtime deps -- typer/rich/anyio/psutil). The npm-run
- // path stays as the source-checkout fallback (``pnpm run start``
+ // path stays as the source-checkout fallback (``bun run start``
// uses package.json scripts directly).
const venvPy = venvPython();
if (venvPy) {
diff --git a/cli/commands/build.py b/cli/commands/build.py
index 3ebabe89..b39b789a 100644
--- a/cli/commands/build.py
+++ b/cli/commands/build.py
@@ -1,7 +1,7 @@
"""``company build`` -- replaces ``scripts/build.js``.
-Checks toolchain (node, npm, python, uv), then runs the 6-step
-build: ``.env`` bootstrap -> ``pnpm install`` -> client build ->
+Checks toolchain (node, bun, python, uv), then runs the 6-step
+build: ``.env`` bootstrap -> ``bun install`` -> client build ->
Node.js sidecar bundle -> ``uv sync`` -> compile Python bytecode
-> pooch-fetch Temporal binary.
@@ -191,6 +191,9 @@ def build_command() -> None:
npm_version = capture(["npm", "--version"])
console.print(f" npm: {npm_version or '[red]not found[/]'}")
+ bun_version = capture(["bun", "--version"])
+ console.print(f" bun: {bun_version or '[red]not found[/]'}")
+
python_cmd = _which_python()
if not python_cmd or not _check_python(python_cmd):
error_block(
@@ -225,12 +228,14 @@ def build_command() -> None:
if not is_postinstall:
console.log("[1/6] Installing dependencies...")
- run(["pnpm", "install"], cwd=root)
+ run(["bun", "install"], cwd=root)
else:
console.log("[1/6] Dependencies already installed by package manager")
console.log("[2/6] Building client...")
- run(["pnpm", "--filter", "react-flow-client", "run", "build"], cwd=root)
+ # bun requires --filter AFTER the ``run`` subcommand (before it, bun
+ # treats the next word as a script name).
+ run(["bun", "run", "--filter", "react-flow-client", "build"], cwd=root)
# Pre-bundle the Node.js sidecar (server/nodejs) with esbuild so the
# production `npm start` runs `node dist/index.js` instead of
@@ -238,7 +243,7 @@ def build_command() -> None:
# whenever the executor is launched. The bundle keeps Express
# external (it stays in node_modules), so the patch flow is intact.
console.log("[3/6] Building Node.js sidecar...")
- run(["pnpm", "--filter", "opencompany-nodejs-executor", "run", "build"], cwd=root)
+ run(["bun", "run", "--filter", "opencompany-nodejs-executor", "build"], cwd=root)
console.log("[4/6] Installing Python dependencies...")
# ``server/`` is its own standalone uv project; ``uv sync`` at that
diff --git a/cli/commands/clean.py b/cli/commands/clean.py
index ef837c03..cdfc7528 100644
--- a/cli/commands/clean.py
+++ b/cli/commands/clean.py
@@ -29,6 +29,7 @@ from cli._common import free_all_ports, preflight
_TARGETS = [
"node_modules",
"client/node_modules",
+ "server/nodejs/node_modules",
"client/dist",
"client/.vite",
# Python venvs. ``server/.venv`` is uv's default location for the
diff --git a/cli/commands/dev.py b/cli/commands/dev.py
index d64f269c..b59c6fc6 100644
--- a/cli/commands/dev.py
+++ b/cli/commands/dev.py
@@ -12,8 +12,8 @@ esbuild re-optimize (minutes on Windows) on every first page load.
(``optimizeDeps.force`` via the ``VITE_FORCE`` env var, read in
``client/vite.config.js``) -- the documented recovery for an
"Outdated Optimize Dep" error. Env var rather than argv because the
-client spec runs ``pnpm run client:start`` -> ``npm run start`` and a
-``--force`` suffix does not survive the double ``npm run`` indirection.
+client spec runs ``bun run client:start`` -> ``npm run start`` and a
+``--force`` suffix does not survive the double ``run`` indirection.
uvicorn ``--reload``-style restarts (exit code 1) used to cascade-kill
the frontend under ``concurrently --kill-others``. Our supervisor
@@ -60,7 +60,7 @@ def _build_specs(
return [
ServiceSpec(
name="client",
- argv=["pnpm", "run", "client:start"],
+ argv=["bun", "run", "client:start"],
cwd=root,
ready_port=cfg.client_port,
ready_timeout=60.0,
diff --git a/cli/platform_.py b/cli/platform_.py
index 36ab974b..3771dded 100644
--- a/cli/platform_.py
+++ b/cli/platform_.py
@@ -119,7 +119,7 @@ def server_venv_python(root: Path | None = None) -> Path:
def node_modules_dir(root: Path | None = None) -> Path:
- """The pnpm/npm-installed dependency tree at the workspace root."""
+ """The bun/npm-installed dependency tree at the workspace root."""
return _root(root) / "node_modules"
diff --git a/cli/tree.py b/cli/tree.py
index de51c6d1..762eadb6 100644
--- a/cli/tree.py
+++ b/cli/tree.py
@@ -84,7 +84,7 @@ class _JobObject:
# Win10/11 supports nested jobs, but the parent must allow it. When
# the supervisor was launched from another process that already put
- # us inside a Job Object (npm/pnpm/conhost wrappers occasionally do
+ # us inside a Job Object (npm/bun/conhost wrappers occasionally do
# this), AssignProcessToJobObject succeeds at the API level but the
# child silently lands in the OUTER job, not ours. We detect that
# via IsProcessInJob in ``add()`` and warn explicitly.
@@ -148,7 +148,7 @@ class _JobObject:
sys.stderr.write(
f"[supervisor] WARN: pid={pid} did not enter our Job Object "
f"(already in another job: {in_some_job}). Likely cause: "
- f"this supervisor was launched from a wrapper (npm/pnpm/conhost) "
+ f"this supervisor was launched from a wrapper (npm/bun/conhost) "
f"whose own Job Object disallows nesting. Tree-kill on abnormal "
f"supervisor exit will not reach this child.\n"
)
diff --git a/server/core/paths.py b/server/core/paths.py
index 8186effd..3b42f84a 100644
--- a/server/core/paths.py
+++ b/server/core/paths.py
@@ -61,7 +61,7 @@ under ``<DATA_DIR>/`` means a single ``mv ~/.opencompany /backup``
carries the entire OpenCompany footprint.
Out of scope: globally-installed binaries (Himalaya — system
-package manager) and npm `package.json` deps managed by pnpm (none
+package manager) and npm `package.json` deps managed by bun (none
remain after the WhatsApp migration).
Shipped example workflows live at ``<repo>/.opencompany/workflows/`` —
diff --git a/server/nodes/browser/_service.py b/server/nodes/browser/_service.py
index 73abae12..9140d70f 100644
--- a/server/nodes/browser/_service.py
+++ b/server/nodes/browser/_service.py
@@ -13,7 +13,7 @@ project-local CLI. The binary lives at
``<package_dir("browser")>/npm/node_modules/.bin/agent-browser[.cmd]``
and is installed via ``npm install agent-browser --prefix <...>`` on
first use. No dependency on the workspace ``package.json`` /
-``node_modules`` / pnpm lockfile.
+``node_modules`` / bun lockfile.
All subprocess calls use ``shell=False`` with list argv — Python handles
Windows .CMD files natively via ``CreateProcessW``, avoiding the BatBadBut
diff --git a/server/nodes/browser/browser/__init__.py b/server/nodes/browser/browser/__init__.py
index 722d1e1e..3709b347 100644
--- a/server/nodes/browser/browser/__init__.py
+++ b/server/nodes/browser/browser/__init__.py
@@ -356,7 +356,7 @@ class BrowserNode(ActionNode):
svc = get_browser_service()
if not svc:
raise RuntimeError(
- "agent-browser not installed. Run: pnpm install && npx agent-browser install",
+ "agent-browser not installed. Run: bun install && npx agent-browser install",
)
op = params.operation
diff --git a/server/pyproject.toml b/server/pyproject.toml
index 94088092..23da2ff3 100644
--- a/server/pyproject.toml
+++ b/server/pyproject.toml
@@ -204,11 +204,11 @@ aws = [
# PEP 735 dependency groups — included by ``uv sync`` (and ``uv sync
# --group dev``) by default, but NOT shipped to PyPI consumers. Pre-fix
# the dev tools lived in ``[project.optional-dependencies].dev`` which
-# meant every ``pnpm install`` (= ``uv sync`` without ``--extra dev``)
+# meant every ``bun install`` (= ``uv sync`` without ``--extra dev``)
# uninstalled them — broke contributor test workflows on every install
# / dependency bump. Moving them here keeps ``pip install
# opencompany-server`` lean for end-users while making contributor
-# checkouts test-ready straight out of ``pnpm install``.
+# checkouts test-ready straight out of ``bun install``.
dev = [
"pytest>=8.0.0",
"pytest-asyncio>=0.24.0",