@bivy/bivy 0.18.8 → 0.18.9-staging.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/server.js CHANGED
@@ -12,6 +12,8 @@ import { fileURLToPath } from "node:url";
12
12
  import express from "express";
13
13
  import { rateLimit } from "express-rate-limit";
14
14
  import { WebSocketServer, WebSocket } from "ws";
15
+ import { bridgesToSync, installBridges, missingBridges } from "./agent-bridges.mjs";
16
+ import { resolveExecutable } from "./executable.js";
15
17
  import { listRuntimes, catalogRuntimes, agentInstallSpec, canonicalAgentId, invalidateCliProbeCache, pluginAgentConflictDiagnostics } from "./runtime/index.js";
16
18
  import { createRunPolicy } from "./policy/run-policy.js";
17
19
  import { DEFAULT_BACKOFF } from "./policy/ruleset.js";
@@ -70,6 +72,7 @@ import { createSessionEngine } from "./session/engine.js";
70
72
  import { exportProviderAuth, exportAccountApiKeys, exportAccountOAuthCredentials, importAccountOAuthCredentials, exportSyncableProviderAuth, exportProviderAuthTombstones, importProviderAuth, removeProvider, setProviderApiKey, listCredentialRecords, setProviderApiKeyLabeled, setProviderReferenceLabeled, removeProviderCredential, setCredentialSync, setCredentialUnattended, exportUnattendedRecords, unattendedCredentialRevision, getCredentialPresets, setActiveCredentialPreset, setCredentialPresetMapping, exportSyncableRecords, exportRecordTombstones, importCredentialRecords, reconcileHostedCredentialRecords } from "./credentials/api.js";
71
73
  import { listProviders } from "./runtime/provider-catalog.js";
72
74
  import { exportLocalModels, importLocalModels } from "./runtime/local-model-store.js";
75
+ import { mergeSyncedAgentInstructions, readAgentInstructions, sessionInstructions, writeAgentInstructions, MAX_AGENT_INSTRUCTIONS_BYTES } from "./agent-instructions.js";
73
76
  import { execEphemeralRequest } from "./ephemeral-exec.js";
74
77
  import { ApprovalManager } from "./approval.js";
75
78
  import { QuestionManager, validQuestions, isAskUserQuestionTool, formatQuestionResult } from "./question.js";
@@ -764,6 +767,35 @@ function runInstallCommand(spec) {
764
767
  });
765
768
  });
766
769
  }
770
+ /**
771
+ * Install the SDK bridge packages `id` loads in-process, if any are missing
772
+ * (see src/agent-bridges.mjs). Bridges are not shipped with Bivy; the first
773
+ * session with an agent installs its bridge, announced like an agent install.
774
+ */
775
+ async function ensureAgentBridges(id) {
776
+ const missing = missingBridges(id);
777
+ if (!missing.length)
778
+ return;
779
+ broadcast({ type: "runtime.install.start", id, command: `npm install ${missing.join(" ")}` });
780
+ await installBridges(missing);
781
+ invalidateCliProbeCache();
782
+ }
783
+ /**
784
+ * At startup, bring bridges up to Bivy's pinned versions, and install them for
785
+ * agents whose CLI is on PATH, so the first session doesn't wait on npm. This
786
+ * is also how a node updated from a release that bundled bridges gets them
787
+ * back. A no-op without network access when nothing changed.
788
+ */
789
+ async function syncAgentBridges() {
790
+ const names = bridgesToSync({ commandExists: (command) => resolveExecutable(command) !== null });
791
+ if (!names.length)
792
+ return;
793
+ console.log(`[bridges] Installing agent bridges: ${names.join(", ")}`);
794
+ await installBridges(names);
795
+ invalidateCliProbeCache();
796
+ const runtimes = runtimeList(active?.runtimeId ?? defaultRuntimeId);
797
+ broadcast({ type: "runtime.updated", current: runtimeSummary(getRuntime(defaultRuntimeId)), runtimes });
798
+ }
767
799
  /**
768
800
  * Return an available runtime, auto-installing allowlisted optional adapters when
769
801
  * a normal session/select path asks for them. The explicit /api/runtimes/install
@@ -771,6 +803,9 @@ function runInstallCommand(spec) {
771
803
  * to press it before starting a regular managed session.
772
804
  */
773
805
  async function ensureRuntimeAvailable(requested, sandbox) {
806
+ const bridgeAgent = canonicalAgentId(requested ?? defaultRuntimeId);
807
+ if (bridgeAgent)
808
+ await ensureAgentBridges(bridgeAgent);
774
809
  try {
775
810
  return getRuntime(requested, sandbox);
776
811
  }
@@ -1339,9 +1374,21 @@ function nodeSettingsSnapshot() {
1339
1374
  autoAttachToolImages: readSettings().autoAttachToolImages === true,
1340
1375
  appScreenshots: appScreenshotsEnabled(),
1341
1376
  forkWorkspaceMaxBytes: Number.isInteger(readSettings().forkWorkspaceMaxBytes) ? Number(readSettings().forkWorkspaceMaxBytes) : 50 * 1024 * 1024,
1377
+ agentInstructions: { ...readAgentInstructions(appDir), maxBytes: MAX_AGENT_INSTRUCTIONS_BYTES },
1342
1378
  };
1343
1379
  }
1344
1380
  async function applyNodeSettings(patch) {
1381
+ // Account-wide agent instructions live in their own file (not config.yaml) and
1382
+ // sync through the E2E vault. Applied first so a rejected save changes nothing.
1383
+ if (typeof patch.agentInstructions === "string") {
1384
+ const current = readAgentInstructions(appDir);
1385
+ const base = Number(patch.agentInstructionsBaseUpdatedAt);
1386
+ if (Number.isFinite(base) && current.updatedAt > base && current.text !== patch.agentInstructions) {
1387
+ throw new Error("These instructions were changed on another device. Reload them before saving.");
1388
+ }
1389
+ writeAgentInstructions(appDir, patch.agentInstructions);
1390
+ void pushModelAuthToControlPlane();
1391
+ }
1345
1392
  const settings = readSettings();
1346
1393
  if (typeof patch.name === "string" && patch.name.trim()) {
1347
1394
  const prev = identity.name;
@@ -2593,6 +2640,9 @@ const RELAY_COMMANDS = {
2593
2640
  return;
2594
2641
  }
2595
2642
  try {
2643
+ // A missing bridge also reads as "not available"; install it first so an
2644
+ // agent whose CLI is already here isn't reinstalled for nothing.
2645
+ await ensureAgentBridges(spec.id);
2596
2646
  const before = runtimeList().find((runtime) => runtime.id === spec.id);
2597
2647
  if (before?.status !== "available")
2598
2648
  await runInstallCommand(spec);
@@ -3252,8 +3302,8 @@ function ensureLocalModelAuthVaultKey() {
3252
3302
  // silently exchange an incompatible structure. `decrypt` tolerates a bare map
3253
3303
  // for forward-safety.
3254
3304
  const MODEL_AUTH_ENVELOPE_VERSION = 3;
3255
- function encryptModelAuthProviders(providers, deletedAt, localModels, vaultKeyB64, records = {}, recordsDeletedAt = {}) {
3256
- const envelope = { v: MODEL_AUTH_ENVELOPE_VERSION, providers, deletedAt, localModels, records, recordsDeletedAt };
3305
+ function encryptModelAuthProviders(providers, deletedAt, localModels, vaultKeyB64, records = {}, recordsDeletedAt = {}, agentInstructions) {
3306
+ const envelope = { v: MODEL_AUTH_ENVELOPE_VERSION, providers, deletedAt, localModels, records, recordsDeletedAt, ...(agentInstructions ? { agentInstructions } : {}) };
3257
3307
  return seal(Buffer.from(vaultKeyB64, "base64"), JSON.stringify(envelope));
3258
3308
  }
3259
3309
  function decryptModelAuthEnvelope(ciphertext, vaultKeyB64) {
@@ -3272,6 +3322,7 @@ function decryptModelAuthEnvelope(ciphertext, vaultKeyB64) {
3272
3322
  localModels: obj(envelope.localModels),
3273
3323
  records: obj(envelope.records),
3274
3324
  recordsDeletedAt: obj(envelope.recordsDeletedAt),
3325
+ agentInstructions: envelope.agentInstructions,
3275
3326
  };
3276
3327
  }
3277
3328
  // Back-compat: a bare `{ [id]: Credential }` map (pre-envelope / other sender).
@@ -3449,6 +3500,12 @@ async function syncModelAuthFromControlPlane() {
3449
3500
  await importProviderAuth(credsDir, providers, deletedAt);
3450
3501
  }
3451
3502
  importLocalModels(localModelsDir, localModels);
3503
+ // Account-wide agent instructions reconcile last-writer-wins. Hosted
3504
+ // runners hold only the filtered credential snapshot, which never carries
3505
+ // them, so they neither import nor republish.
3506
+ const instructionsSync = hostedCustody ? "unchanged" : mergeSyncedAgentInstructions(appDir, decrypted.agentInstructions);
3507
+ if (instructionsSync === "imported")
3508
+ broadcast({ type: "node.settings", settings: nodeSettingsSnapshot() });
3452
3509
  // A synced key or config change can both alter the projection, so always
3453
3510
  // regenerate it (and refresh the panel) after importing the vault.
3454
3511
  await writePiModelsProjection();
@@ -3463,6 +3520,8 @@ async function syncModelAuthFromControlPlane() {
3463
3520
  broadcast({ type: "providers.list", providers: await listProvidersUnified() });
3464
3521
  if (!hostedCustody && data.vault?.needsRotation)
3465
3522
  await pushModelAuthToControlPlane(true);
3523
+ else if (instructionsSync === "local-newer")
3524
+ await pushModelAuthToControlPlane();
3466
3525
  }
3467
3526
  else if (targetVault?.ciphertext && !vaultKeyB64 && !hostedCustody) {
3468
3527
  await modelAuthFetch("/node/model-auth-key/request", { method: "POST", body: JSON.stringify({ publicKey: pairingStore.nodePublicKeyB64() }) });
@@ -3472,7 +3531,8 @@ async function syncModelAuthFromControlPlane() {
3472
3531
  ensureModelAuthColdStart();
3473
3532
  }
3474
3533
  else if (Object.keys(await exportProviderAuth(credsDir)).length > 0 ||
3475
- Object.keys(exportLocalModels(localModelsDir)).length > 0) {
3534
+ Object.keys(exportLocalModels(localModelsDir)).length > 0 ||
3535
+ readAgentInstructions(appDir).updatedAt > 0) {
3476
3536
  await pushModelAuthToControlPlane();
3477
3537
  }
3478
3538
  await processModelAuthKeyRequests(data.requests ?? []);
@@ -3580,7 +3640,8 @@ async function pushModelAuthToControlPlane(rotateKey = false, throwOnFailure = f
3580
3640
  const vaultKeyB64 = rotateKey ? randomBytes(32).toString("base64") : ensureLocalModelAuthVaultKey();
3581
3641
  if (rotateKey)
3582
3642
  writeLocalModelAuthVaultKey(vaultKeyB64);
3583
- const ciphertext = encryptModelAuthProviders(providers, deletedAt, localModels, vaultKeyB64, records, recordsDeletedAt);
3643
+ const instructions = readAgentInstructions(appDir);
3644
+ const ciphertext = encryptModelAuthProviders(providers, deletedAt, localModels, vaultKeyB64, records, recordsDeletedAt, instructions.updatedAt > 0 ? instructions : undefined);
3584
3645
  if (!rotateKey && ciphertext === lastPushedModelAuthCiphertext) {
3585
3646
  await pushHostedModelAuthToControlPlane(allowEmptyHostedEscrow);
3586
3647
  return;
@@ -7806,7 +7867,7 @@ async function refreshRecordAfterTui(record) {
7806
7867
  const workspace = record.worktree?.path || oldSession.cwd || record.workspace;
7807
7868
  // Refreshing an EXISTING record: its id is already known, so attach_to_chat
7808
7869
  // (see toolProvider's SessionIdRef doc) can be wired live, not deferred.
7809
- const runtimeSessionOptions = { credentialLabels: record.credentialLabels, workspace, toolProvider: integrations.toolProvider({ current: record.id }), ...(rt.capabilities.toolInterception ? { toolInterceptor: guardianInterceptor } : {}) };
7870
+ const runtimeSessionOptions = { credentialLabels: record.credentialLabels, workspace, toolProvider: integrations.toolProvider({ current: record.id }), instructions: sessionInstructions(appDir), ...(rt.capabilities.toolInterception ? { toolInterceptor: guardianInterceptor } : {}) };
7810
7871
  const { session, warning } = await runtimeHost.openSession(rt, { ...runtimeSessionOptions, sessionFile: record.sessionFile });
7811
7872
  record.session = session;
7812
7873
  record.sessionFile = session.sessionFile ?? record.sessionFile;
@@ -8043,6 +8104,7 @@ async function recoverRecordAfterAbort(record) {
8043
8104
  workspace,
8044
8105
  credentialLabels: record.credentialLabels,
8045
8106
  toolProvider: integrations.toolProvider({ current: record.id }),
8107
+ instructions: sessionInstructions(appDir),
8046
8108
  ...(rt.capabilities.toolInterception ? { toolInterceptor: guardianInterceptor } : {}),
8047
8109
  };
8048
8110
  const { session, warning } = await runtimeHost.openSession(rt, {
@@ -8232,7 +8294,9 @@ async function createSession(workspace = defaultWorkspace, sessionFile, opts = {
8232
8294
  // `.current` in the moment `sessionId` is (see toolProvider's SessionIdRef doc).
8233
8295
  const attachSessionIdRef = {};
8234
8296
  const credentialLabels = opts.credentialLabels ?? storedMeta?.credentialLabels;
8235
- const runtimeSessionOptions = { credentialLabels, workspace: runtimeWorkspace, toolProvider: integrations.toolProvider(attachSessionIdRef), ...(rt.capabilities.toolInterception ? { toolInterceptor: guardianInterceptor } : {}) };
8297
+ // The user's account-wide instructions, as of this session's start.
8298
+ const instructions = sessionInstructions(appDir);
8299
+ const runtimeSessionOptions = { credentialLabels, workspace: runtimeWorkspace, toolProvider: integrations.toolProvider(attachSessionIdRef), instructions, ...(rt.capabilities.toolInterception ? { toolInterceptor: guardianInterceptor } : {}) };
8236
8300
  // Stage 2/3: prefer re-attaching to a still-live remote session — routed to its
8237
8301
  // OWN agent service — over re-opening a fresh copy from disk. Falls back to
8238
8302
  // open/create when nothing live is there.
@@ -8350,6 +8414,7 @@ async function createSession(workspace = defaultWorkspace, sessionFile, opts = {
8350
8414
  home: os.homedir(),
8351
8415
  sessionId,
8352
8416
  endpoint: process.env.BIVY_MCP_ENDPOINT,
8417
+ instructionsFile: instructions?.file,
8353
8418
  });
8354
8419
  if (res.injected.length) {
8355
8420
  const prev = record.mcpRestore;
@@ -11413,6 +11478,7 @@ const server = app.listen(port, host, async () => {
11413
11478
  console.log(`Agent data dir: ${piDir}`);
11414
11479
  console.log(`Workspace: ${defaultWorkspace}`);
11415
11480
  startRelayIfConfigured();
11481
+ void syncAgentBridges().catch((error) => console.warn("[bridges] Could not install agent bridges; they will install on first use:", error instanceof Error ? error.message : error));
11416
11482
  if (appGateway) {
11417
11483
  appGateway.server.on("error", (error) => { console.error("[apps] Preview gateway could not start:", error); shutdown("preview gateway failure"); });
11418
11484
  appGateway.server.listen(appPreviewPort, "127.0.0.1", () => console.log(`[apps] Preview gateway listening on 127.0.0.1:${appPreviewPort}`));
package/dist/terminal.js CHANGED
@@ -1,26 +1,24 @@
1
1
  // SPDX-License-Identifier: AGPL-3.0-only
2
2
  // Copyright (c) 2026 Petter André Sjulstad
3
3
  import { randomUUID } from "node:crypto";
4
- import fs from "node:fs";
5
4
  import { resolveExecutable } from "./executable.js";
6
5
  import { createRequire } from "node:module";
7
- import path from "node:path";
8
6
  import { depCacheEnv } from "./harness/dep-cache.js";
9
7
  let ptyModule;
10
8
  export function loadPty() {
11
9
  if (ptyModule)
12
10
  return ptyModule;
13
11
  if (ptyModule === null) {
14
- throw new Error("PTY support is unavailable because the node-pty dependency is not installed. Reinstall Bivy after installing build tools, or use governed chat/exec sessions instead of interactive terminals.");
12
+ throw new Error("PTY support is unavailable because the node-pty dependency is not installed. Reinstall Bivy, or use governed chat/exec sessions instead of interactive terminals.");
15
13
  }
16
14
  try {
17
- ptyModule = createRequire(import.meta.url)("node-pty");
15
+ ptyModule = createRequire(import.meta.url)("@lydell/node-pty");
18
16
  return ptyModule;
19
17
  }
20
18
  catch (error) {
21
19
  ptyModule = null;
22
20
  const detail = error instanceof Error && error.message ? ` (${error.message.split("\n")[0]})` : "";
23
- throw new Error(`PTY support is unavailable because the node-pty dependency could not be loaded${detail}. Reinstall Bivy after installing build tools, or use governed chat/exec sessions instead of interactive terminals.`);
21
+ throw new Error(`PTY support is unavailable because the node-pty dependency could not be loaded${detail}. Prebuilt terminals cover macOS, Windows and glibc Linux on x64/arm64; reinstall Bivy, or use governed chat/exec sessions instead of interactive terminals.`);
24
22
  }
25
23
  }
26
24
  /**
@@ -72,57 +70,6 @@ function defaultShell() {
72
70
  * PTY an unambiguous absolute path.
73
71
  */
74
72
  export { resolveExecutable } from "./executable.js";
75
- /**
76
- * Restore the execute bit on node-pty's bundled `spawn-helper` binary.
77
- *
78
- * On macOS/Linux, node-pty launches every PTY by exec'ing this helper. Its
79
- * prebuilds ship without the execute bit (mode 0664), and a fresh `npm install`
80
- * — exactly what `bivy update` runs — resets the bit. node-pty does not surface
81
- * this: its spawn prints the cryptic "posix_spawnp failed." into the terminal and
82
- * exits, so `bivy run <agent>` dies before the agent starts and keeps breaking
83
- * after every update until someone runs `chmod +x` by hand.
84
- *
85
- * Fix it once, up front, so runs survive updates and reinstalls automatically.
86
- * Best-effort and idempotent: if node-pty can't be resolved or the helper is
87
- * already executable, this is a no-op and node-pty reports its own errors.
88
- */
89
- let spawnHelperEnsured = false;
90
- function ensureSpawnHelperExecutable() {
91
- if (spawnHelperEnsured)
92
- return;
93
- spawnHelperEnsured = true;
94
- if (process.platform === "win32")
95
- return; // Windows has no spawn-helper.
96
- const makeExecutable = (file) => {
97
- try {
98
- const st = fs.statSync(file);
99
- if (!st.isFile() || (st.mode & 0o111) !== 0)
100
- return; // missing or already +x
101
- fs.chmodSync(file, st.mode | 0o755);
102
- }
103
- catch {
104
- // Missing candidate or read-only install — best-effort.
105
- }
106
- };
107
- try {
108
- const require = createRequire(import.meta.url);
109
- const root = path.dirname(require.resolve("node-pty/package.json"));
110
- // Cover both a from-source build and the prebuilt binaries node-pty ships.
111
- makeExecutable(path.join(root, "build", "Release", "spawn-helper"));
112
- const prebuilds = path.join(root, "prebuilds");
113
- try {
114
- for (const dir of fs.readdirSync(prebuilds)) {
115
- makeExecutable(path.join(prebuilds, dir, "spawn-helper"));
116
- }
117
- }
118
- catch {
119
- // No prebuilds directory — fine.
120
- }
121
- }
122
- catch {
123
- // Couldn't resolve node-pty; leave it to node-pty to report.
124
- }
125
- }
126
73
  export class TerminalManager {
127
74
  terminals = new Map();
128
75
  /** The number of live terminals (for tests / capacity reporting). */
@@ -158,10 +105,6 @@ export class TerminalManager {
158
105
  ? `Cannot run "${shell}": command not found or not executable on the node's PATH. Install it, or check the command.`
159
106
  : `Cannot start a terminal: no usable shell found (tried "${shell}"). Set the SHELL environment variable.`);
160
107
  }
161
- // node-pty exec's a bundled `spawn-helper` whose execute bit a fresh install
162
- // (e.g. `bivy update`) strips — restore it before spawning or this fails with
163
- // "posix_spawnp failed." See ensureSpawnHelperExecutable().
164
- ensureSpawnHelperExecutable();
165
108
  const pty = loadPty();
166
109
  const proc = pty.spawn(resolved, shellArgs, {
167
110
  name: "xterm-256color",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bivy/bivy",
3
- "version": "0.18.8",
3
+ "version": "0.18.9-staging.10",
4
4
  "type": "module",
5
5
  "license": "AGPL-3.0-only",
6
6
  "description": "Run coding agents on machines you own. Open-source, self-hostable agent workspace.",
@@ -34,16 +34,15 @@
34
34
  "bivy": "node bin/bivy.mjs",
35
35
  "start": "node dist/server.js",
36
36
  "dev": "node dist/server.js",
37
- "relay:setup": "node bin/bivy.mjs relay:setup",
38
- "postinstall": "node bin/repair-pty-permissions.mjs && node bin/patch-pi-dependencies.mjs"
37
+ "relay:setup": "node bin/bivy.mjs relay:setup"
39
38
  },
40
39
  "dependencies": {
40
+ "@lydell/node-pty": "1.2.0-beta.15",
41
41
  "@modelcontextprotocol/sdk": "1.30.0",
42
42
  "@novnc/novnc": "1.7.0",
43
43
  "brace-expansion": "5.0.12",
44
44
  "express": "^5.2.1",
45
45
  "express-rate-limit": "^8.7.0",
46
- "node-pty": "^1.1.0",
47
46
  "semver": "^7.7.2",
48
47
  "typebox": "^1.3.34",
49
48
  "undici": "8.10.2",
@@ -51,13 +50,8 @@
51
50
  "yaml": "^2.9.1",
52
51
  "zod": "^4.6.5"
53
52
  },
54
- "optionalDependencies": {
55
- "@anthropic-ai/claude-agent-sdk": "0.3.281",
56
- "@earendil-works/pi-ai": "0.87.1",
57
- "@earendil-works/pi-coding-agent": "0.87.1"
58
- },
59
53
  "overrides": {
60
- "fast-uri": "3.1.6",
54
+ "fast-uri": "3.1.8",
61
55
  "hono": "4.13.5",
62
56
  "qs": "6.16.0",
63
57
  "@hono/node-server": "2.0.12",
@@ -71,6 +65,11 @@
71
65
  "lodash-es": "4.18.1",
72
66
  "undici": "8.10.2"
73
67
  },
74
- "readme": "# Bivy\n\n[![npm](https://img.shields.io/npm/v/@bivy/bivy?color=2b6cb0&label=%40bivy%2Fbivy)](https://www.npmjs.com/package/@bivy/bivy)\n[![license: AGPL-3.0-only](https://img.shields.io/badge/license-AGPL--3.0--only-2b6cb0)](LICENSE)\n[![node](https://img.shields.io/badge/node-%E2%89%A520-2b6cb0)](https://nodejs.org)\n\n**Build, try, and review apps from your phone. Your coding agent and dev\nenvironment stay on your own machines.**\n\nBivy is an open-source remote development environment built around coding\nagents. Ask for a change, try the running app, and point to or draw on what\nneeds fixing. Send that feedback to the agent and try again—all in the same\nsession, without going back to your computer.\n\nLive previews bring your app to your phone or browser without deploying it to\nRender, building a Docker image, or setting up a separate preview server.\nShare a preview link so someone else can try it and leave notes, too.\n\nKeep Claude Code, Codex, Pi, OpenCode, or another supported agent. Keep your\nrepos, tools, databases, and development environment. Bivy connects them to\nchat, a terminal, app previews, and code review wherever you are. Start work\nyourself, or let an issue, CI failure, message, schedule, or webhook start it.\n\n**[Start free on Bivy Cloud](https://app.bivy.sh)** ·\n**[Quickstart](docs/quickstart.md)** ·\n**[Documentation](docs/README.md)** ·\n**[Self-host](docs/deploy-images.md)** ·\n**[Website](https://bivy.sh)**\n\n**Recommended:** sign in at [app.bivy.sh](https://app.bivy.sh), then copy your\npersonalized **Connect a Machine** command into a terminal on your Mac or Linux\ncomputer. It installs and enrolls the machine without another Bivy login. The\nbrowser connects automatically; choose a repository and send your first task\nright there.\n\nPrefer starting from the terminal?\n\n```bash\ncurl -fsSL https://bivy.sh/install.sh | bash # install + guided setup\ncd your-repo\nbivy run claude # or codex, pi, opencode\nbivy open # continue in the web app (needs remote setup)\n```\n\nBivy Cloud hosts the app, control plane, and relay—not the machines running your\nagents. Connect a Mac, Linux computer, or existing server and bring your own\nagent subscription, model API key, or local model. You can also self-host the\nentire remote-access stack.\n\n> **Bivy is 0.x software.** Claude Code, Codex, Pi, and OpenCode are the\n> release-tested paths. Credential sync, resume, handoffs, approvals, and\n> sandboxing depend on the runtime. See the\n> [runtime support matrix](docs/runtime-support-matrix.md).\n\n## Build → preview → mark up → iterate\n\nRemote chat lets you ask an agent for a change. Bivy also lets you **use what\nit built and show it what to fix**, without a separate deployment step.\n\n1. **Ask for a change.** The agent works in your repo with your existing tools\n and local services.\n2. **Try the app.** Open a live preview from the session. Use the running app,\n not just a screenshot of what the agent says it finished. Bivy can discover\n dev servers running in the session workspace; tap **Preview** to open one.\n3. **Mark up what needs work.** Point at an element or circle and draw on the\n preview. Add a note, then send the draft to the agent with the element and\n page context. Marked-up screenshots and before/after comparison are available\n when agent screenshots are enabled.\n4. **Iterate and review.** Try the next version, inspect the diff, review checks,\n and decide when the work is ready—not just when the agent stops.\n5. **Bring someone else into the review.** Copy a public preview link so they\n can use the app without a Bivy account and leave notes on specific elements.\n Bring their notes into the session when you're ready to act on them.\n\nOn Bivy Cloud, preview delivery is built in: no per-app domains, certificates,\npublic ports, or tunnels to configure. Self-hosters configure preview delivery\nonce for their Bivy deployment, not for every app. The app still needs its normal\nbuild or dev-server setup, and **the machine serving it must stay awake and\nonline**. These are development previews, not production hosting.\n\n**Share deliberately:** anyone with a preview link can use that app, including\nits live backend. Links expire after 24 hours and can be revoked sooner.\nReviewer notes aren't sent to the agent automatically; you send them or explicitly\nallow agent access. Preview traffic uses HTTPS through the preview relay, not\nsession end-to-end encryption; the relay operator can see it.\n\n[App previews, visual feedback, and sharing →](docs/apps.md)\n\n## Your agents and machines, one workspace\n\n| Capability | What it means for you |\n|---|---|\n| **One workspace, multiple agents** | Use different agents and models for different tasks without maintaining a separate workflow for each. |\n| **Your machines and environment** | Work beside your existing repos, dev servers, databases, private networks, toolchains, and GPUs. |\n| **Automations and triggers** | Let issues, failed CI, messages, schedules, and webhooks start work instead of copying requests into a chat. |\n| **Encrypted key and OAuth sync** | Reuse Bivy-managed provider credentials across enrolled machines and compatible runtimes, with less repeated setup. |\n| **Live sessions from anywhere** | Build and review from your phone, browser, or terminal; answer questions and approve supported actions in the same session. |\n| **Live app previews** | Try the running app without deploying it to a separate hosting service. |\n| **Visual feedback and sharing** | Point, draw, and send specific feedback to the agent; share a preview link for outside review. |\n| **Reviewable results** | Inspect the app, changes, declared checks, artifacts, and pull requests—not just an agent's claim that it finished. |\n| **Hosted convenience or self-hosting** | Use Bivy Cloud for managed remote access, or run the same open-source core yourself. |\n\n## One workflow, from trigger to review\n\n```text\nPrompt · GitHub issue · CI failure · Linear · Slack · Schedule · Webhook\n │\n ▼\n Choose machine + agent + model\n + supported credentials\n │\n ▼\n Live agent session\n Join · steer · approve · stop\n │\n ▼\n Try app · inspect changes · checks\n │\n ▼\n Mark up · send feedback · iterate\n │\n ▼\n Share preview · review PR\n```\n\nA **Machine** is a computer or server you connect. A **Session** is live agent\nwork on that machine. A **Run** is delegated background work that creates a\nsession and tracks its outcome. An **Automation** is a reusable definition that\ncreates runs when an event matches.\n\nManual and automated work use the same kind of live session. You can join a run\nwhen it needs help rather than wait for a black-box job to finish.\n\n### Work in the environment you already have\n\nA clean cloud sandbox isn't always enough. Your agent may need the database\nrunning on localhost, an uncommitted change, an internal API behind your VPN,\nor a model running on your GPU. Bivy runs the agent where those things already\nexist, subject to that machine's permissions and the runtime's protection.\n\nConnect several machines to the same account: a laptop for interactive work,\na Linux server for background jobs, or a GPU box for local inference. Choose\nthe machine for each session or pin it in an automation. Repository runs can\nuse isolated Git worktrees without rebuilding the whole development environment.\n\n**The execution machine must stay awake and online.** To close your laptop and\nleave work running, run the agent on a different, always-on machine.\n\n[Environment and multi-machine recipes →](docs/capability-recipes.md)\n\n### Use multiple agents, not multiple disconnected workflows\n\nRun Claude Code for one task, Codex for another, and Pi or OpenCode where they\nfit. Bivy supplies the shared session, remote-access, automation, and review\nsurfaces; your chosen agent still does the coding and uses your model provider.\n\n- Choose an agent and, where supported, a model for each session or run.\n- Import existing Claude Code and Codex sessions.\n- Fork or move work to another agent or machine when a different setup fits\n better. Continuation fidelity varies: some paths preserve native history,\n while others replay portable turns or seed the destination with context.\n- Use agent-native logins, Bivy-managed credentials, or local inference.\n Bivy's custom OpenAI-compatible endpoint registry currently feeds Pi;\n other agents may need their own provider configuration.\n- Register your own ACP or headless process agent with `bivy agent add`.\n\nBivy does not replace your agent, provide model inference, or make every agent's\nfeatures identical. Consult the [support matrix](docs/runtime-support-matrix.md)\nand [handoff recipes](docs/capability-recipes.md#fork-or-move-a-session).\n\n### Less signing in. Less copying secrets.\n\nBivy syncs **Bivy-managed API keys and supported OAuth credentials** across\nenrolled machines for compatible runtimes. Connect supported credentials once\nand reuse them where you run work, rather than manually distributing keys to\neach machine.\n\nFor ordinary account sync, credentials are encrypted on the node before upload.\nThe control plane stores ciphertext and wrapped-key metadata; enrolled nodes\nshare access by wrapping the vault key to one another. Bivy Cloud does not\nreceive plaintext credentials through this sync path.\n\nYou can also keep credentials local, use labeled keys and project presets, or\nreference environment variables and 1Password instead of embedding secrets in\nconfiguration:\n\n```bash\nbivy provider login\nbivy credentials add anthropic work\nbivy secrets ref github.repo-token op://Bivy/GitHub/repo-token\n```\n\n**Not every CLI login syncs.** Native agent logins may still be per-machine;\nGitHub App private-key sync is separately opt-in. If you lose every node and\ndevice able to unwrap a vault, you must sign in to providers again. Explicit\nhosted-provisioning custody grants are separate from ordinary encrypted sync.\n\n[Credential sync and runtime coverage →](docs/credential-sync.md) ·\n[Credentials guide →](docs/credentials-guide.md) ·\n[Key storage →](docs/key-management.md)\n\n### Let events start the work\n\nAutomations turn recurring or incoming work into sessions you can join,\nsupervise, and review. Choose the repository, machine, agent, model, approval\nmode, sandbox setting, and maximum attempts.\n\n| Trigger | Example workflow |\n|---|---|\n| **GitHub issues and mentions** | Label an issue `bivy` or `bivy/<machine>`, or mention your Bivy GitHub App, to work toward a pull request. |\n| **Failed CI** | Match a failed workflow, ask the agent to reproduce it, make a fix, and run the affected checks. |\n| **Linear** | Label an issue to start work without copying its description into an agent. |\n| **Slack** | Send a request from the conversation where the work came up. |\n| **Schedules** | Run a weekly dependency review, recurring maintenance, or a one-time task. |\n| **Signed webhooks** | Connect alerts, internal tools, or your own event sources. |\n\nConfigure automations in the app or version them with your repository in\n`.bivy/automations.yaml`:\n\n```bash\nbivy automation init\n# Edit the generated definition for your repository and workflow.\nbivy automation validate\nbivy automation test --event .bivy/events/failed-ci.yaml # supply a local event fixture\nbivy automation apply\n```\n\nOr delegate a one-off job without creating an automation:\n\n```bash\nbivy runs start \"Review outdated dependencies and propose a small, tested update.\"\nbivy runs wait <id>\n```\n\nRuns keep routing and lifecycle evidence, check results, and output references\nin a reviewable Receipt. For unattended issue work, Bivy runs declared repository\nchecks after the agent's turn; failed required checks fail the run even if the\nagent reports success. A completed process alone is not proof that the task\nsucceeded.\n\n[Automation recipes →](docs/capability-recipes.md#let-events-start-runs) ·\n[Automations as code →](docs/automations-as-code.md) ·\n[Run outcomes and reliability limits →](docs/automation-runs.md)\n\n### Start at your desk. Continue anywhere.\n\nOpen the same session in the browser, phone PWA, or terminal. Watch work live,\nanswer questions, approve supported tool calls, or stop the agent.\n\n- Send screenshots, images, logs, and other files from your phone.\n- Download reports and artifacts the agent creates.\n- Open [session apps](docs/apps.md) from chat or the **Apps** menu: live web\n previews, desktop app views, and CLI/TUI tools. Agents can publish views with\n `bivy app publish bivy.app.json` and create share links with `bivy app share`.\n- Use voice input and read-aloud where supported; provider-backed voice may\n send audio or text to the selected provider.\n- Keep a native terminal workflow or use structured chat, depending on the agent.\n\n```bash\nbivy run claude --no-follow # start without attaching\nbivy open # open the web app\nbivy resume # return to the session in your terminal\nbivy link # pair a device directly via QR\n```\n\nNo phone app installation is required. Open [app.bivy.sh](https://app.bivy.sh)\nin your browser; adding it to your home screen is optional.\n\n[Remote access →](docs/remote-access.md) ·\n[Voice, files, and terminal recipes →](docs/capability-recipes.md)\n\n## Get started\n\n### Install\n\nBivy supports **macOS and Linux with Node.js 20+**. The installer installs the\n`@bivy/bivy` package, runs guided setup, and starts a launchd or systemd service:\n\n```bash\ncurl -fsSL https://bivy.sh/install.sh | bash\n```\n\nSetup helps you choose an agent and configure remote access. Existing agents\nkeep their command, login, and configuration. The installer may use `sudo` to\ninstall missing Node.js or Debian/Ubuntu build tools, but never for `npm install`. To inspect it first,\ndownload it with `curl -fsSL https://bivy.sh/install.sh -o install.sh`.\n\nAlready have Node.js and want to avoid sudo?\n\n```bash\nnpm install -g @bivy/bivy\nbivy setup\n```\n\nThen try one small task:\n\n```bash\ncd your-repo\nbivy run claude\n# Ask: \"Explain this repo and make one small, safe improvement. Run the relevant checks.\"\nbivy open\n```\n\nOpen that same session on your phone while it runs. For a web app, ask the agent\nto start its dev server, then open **Apps → Running in this workspace → Preview**.\nTry a page, point to something you'd change, and send the feedback back to the\nagent. No separate preview deployment needed.\n\nOnce that works, share a preview for review, connect another machine, or add\nyour first automation.\n\n**Local-only works too.** `bivy run`, `bivy resume`, and `bivy sessions` need no\naccount or server. Choose **local only for now** during setup; use `bivy login`\nlater. Browser and phone access need a hosted or self-hosted control plane;\nthe node itself does not serve a web UI.\n\n[Full quickstart →](docs/quickstart.md) ·\n[Installer options, service management, and uninstall →](docs/install.md)\n\n### Choose hosted or self-hosted\n\n| Option | What you get |\n|---|---|\n| **Free Cloud — $0** | Every launch feature, including automations; 10 new remote sessions per rolling seven days. No credit card required. |\n| **Cloud — $15/month** | The same features with unlimited remote sessions. |\n| **Self-hosted Core** | Operate the app, control plane, and relay yourself, with no Bivy usage limits. |\n\nManual and automated sessions share the Cloud allowance. Resuming existing\nsessions and viewing history do not consume it. Agent subscriptions and model\nprovider charges are separate. See [current pricing](https://bivy.sh#pricing).\n\n**Self-host anywhere:** deploy the public control-plane (including the web app)\nand relay images with Postgres and [a small set of environment variables](docs/deploy-images.md).\nYour server or container platform handles HTTPS. Set up owner access in the\nbrowser—no SSH, external authentication provider, or Bivy Cloud account required.\nFor a bare VPS, the [Compose installer](docs/self-host-quickstart.md) automates the\nsame stack. These onboarding features require a release containing them.\n\nStart on Cloud and self-host later if you prefer. Deploy the stack, reconnect\nmachines with `bivy relay:setup`, and pair devices to your server. This is not a\none-click migration of your Cloud account; your local repos and agent\nconfiguration stay in place.\n\n```bash\nbivy relay:setup \\\n --control-plane https://bivy.example.com \\\n --relay wss://relay.example.com\n```\n\nSelf-hosting is community-supported: you own TLS, backups, upgrades, and\nhardening. Public multi-architecture images are available as\n`ghcr.io/bivysh/bivy-control-plane` and `ghcr.io/bivysh/bivy-relay`; pin a release\nversion or full commit SHA.\n\n[Deploy the images anywhere →](docs/deploy-images.md) ·\n[Optional VPS installer →](docs/self-host-quickstart.md) ·\n[Operations reference →](docs/self-host.md)\n\n## Architecture\n\nYour environment, with clear security boundaries:\n\n```text\nYour machine Hosted or self-hosted\n┌──────────────────────┐ ┌──────────────────────┐\n│ Node daemon │──outbound──▶│ Relay │\n│ Agents, repos, tools │ │ Encrypted frames │\n│ Local credentials │ └──────────┬───────────┘\n└──────────────────────┘ │\n Browser / phone\n + control plane\n (app, accounts, metadata)\n```\n\n- **Execution stays on your machine.** Bivy Cloud does not run your agents.\n Your model provider still sees whatever the agent sends it.\n- **Interactive session traffic is end-to-end encrypted** between the node and\n paired devices. The relay forwards opaque session frames; your node dials out,\n so no inbound public port is required.\n- **App previews have a separate security boundary.** Preview traffic uses HTTPS\n and an outbound tunnel, not session E2E encryption. The preview ingress/relay\n operator can see it. Public preview links grant anyone holding them access to\n that view and its live backend until expiry or revocation. See\n [preview security and sharing](docs/apps.md#runtime-and-security-boundaries).\n- **Ordinary credential sync uploads ciphertext, not plaintext keys.**\n Supported credentials and recovery limits are documented separately.\n- **Encryption is not universal across integrations.** Slack commands and\n generic webhook instructions reach the control plane in plaintext. Do not\n put secrets in them. Routing and bounded run metadata are also visible there.\n- **Device authorization matters.** QR pairing authorizes a device directly\n through the node. Hosted account pairing trusts the control plane to authorize\n devices and serve the web app that holds client keys.\n- **Bivy is not an OS-level sandbox.** The default approval mode is\n `autonomous`; protection depends on the runtime. Some agents enforce sandbox\n tiers, while process agents may run with your full user permissions.\n Heuristic tool checks help prevent accidents but are not isolation.\n\nReview the runtime's Protection label and configure approval/sandbox settings\nfor the task, especially before enabling unattended work.\n\n[Security model and known limitations →](docs/security-model.md) ·\n[Runtime protection matrix →](docs/runtime-support-matrix.md) ·\n[Configuration →](docs/configuration.md)\n\n## Agents and everyday commands\n\n**Claude Code, Codex, Pi, and OpenCode are release-tested.** Additional adapters\ninclude Gemini CLI, Qwen Code, Goose, Aider, Cline, Crush, Cursor, GitHub Copilot,\nGrok, Amp, Auggie, Droid, Continue, Kilo Code, and Rovo Dev. Installation,\nresume, model selection, and tool protection vary—see the\n[support matrix](docs/runtime-support-matrix.md) and [agent guides](docs/agents/README.md).\n\nRun an arbitrary command with `bivy run -- ./your-agent --flags`, register a\nreusable entry with `bivy agent add`, or package a declarative integration with\nexperimental [plugins](docs/plugins.md).\n\n```bash\nbivy run claude # launch a durable session; also codex, pi, opencode\nbivy sessions # list live and saved sessions\nbivy resume # resume the most recent session\nbivy open # open the web app (requires remote setup)\nbivy nodes # list connected account machines\nbivy runs list # inspect delegated work\nbivy automation init # scaffold repo-owned automations\nbivy provider login # connect supported model credentials\nbivy agent add # register an ACP or process agent\nbivy doctor # check installation and connectivity\nbivy logs -f # follow node logs\nbivy update # update and restart the service\n```\n\n`bivy update` uses your original installation method and waits for an active\nturn to finish before restarting. Use `--force` to skip that wait.\n\n[CLI reference →](docs/cli-reference.md) ·\n[Node and project configuration →](docs/config-as-code.md) ·\n[GitHub setup →](docs/github-setup.md) ·\n[Linear setup →](docs/linear-work-queue.md)\n\n## Development and contributions\n\n```bash\npnpm install\npnpm run dev # node daemon on http://localhost:4317\npnpm run dev:web # web client dev server\n```\n\n| Directory | Contents |\n|---|---|\n| `src/`, `bin/` | Node daemon, CLI, runtime adapters, sessions, approvals, secrets |\n| `packages/core/` | Shared protocol, pairing, and wire format |\n| `packages/web/`, `packages/ui/` | React PWA and shared design system |\n| `services/relay/` | Self-hostable encrypted relay |\n| `services/control-plane/` | Self-hostable control plane |\n| `deploy/` | Deployment examples |\n\n```bash\npnpm run typecheck\npnpm run typecheck:web\npnpm run lint\npnpm run test:unit\npnpm run test:core\npnpm run check:licenses\npnpm run check:secrets\n```\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for the development workflow. Releases\nare published from CI with provenance attestations; see\n[release verification](docs/releasing.md).\n\n**Found a security issue?** Use\n[GitHub private vulnerability reporting](https://github.com/bivysh/bivy/security/advisories/new),\nnot a public issue. See [SECURITY.md](SECURITY.md).\n\n### In development—not available at launch\n\nAutomatically provisioned, short-lived **ephemeral machines** are in development\nfor hosted and bring-your-own-cloud deployments. Neither path is ready or\nsupported for this launch. Use an existing computer or server you operate.\nExperimental provisioning has different credential-custody and encryption\nboundaries; see the [provisioning trust model](docs/hosted-provisioning-trust-model.md).\n\n## License\n\nEverything in this repository—node, CLI, web/PWA, relay, and control plane—is\nfree and open-source **AGPL-3.0-only Core**, with no Bivy usage limits. You may\nuse, modify, and self-host it under that license. If users interact with your\nmodified version over a network, section 13 requires you to offer its\ncorresponding source. See [LICENSE](LICENSE).\n\nBivy Cloud is the hosted operation of that stack plus billing and plans, in a\nseparate private repository. Contributions use the\n[DCO](CONTRIBUTING.md#certificate-of-origin); there is no CLA.\n",
75
- "readmeFilename": "README.md"
68
+ "readme": "# Bivy\n\n[![npm](https://img.shields.io/npm/v/@bivy/bivy?color=2b6cb0&label=%40bivy%2Fbivy)](https://www.npmjs.com/package/@bivy/bivy)\n[![license: AGPL-3.0-only](https://img.shields.io/badge/license-AGPL--3.0--only-2b6cb0)](LICENSE)\n[![node](https://img.shields.io/badge/node-%E2%89%A520-2b6cb0)](https://nodejs.org)\n\n**Build, try, and review apps from your phone. Your coding agent and dev\nenvironment stay on your own machines.**\n\nBivy is an open-source remote development environment built around coding\nagents. Ask for a change, try the running app, and point to or draw on what\nneeds fixing. Send that feedback to the agent and try again—all in the same\nsession, without going back to your computer.\n\nLive previews bring your app to your phone or browser without deploying it to\nRender, building a Docker image, or setting up a separate preview server.\nShare a preview link so someone else can try it and leave notes, too.\n\nKeep Claude Code, Codex, Pi, OpenCode, or another supported agent. Keep your\nrepos, tools, databases, and development environment. Bivy connects them to\nchat, a terminal, app previews, and code review wherever you are. Start work\nyourself, or let an issue, CI failure, message, schedule, or webhook start it.\n\n**[Start free on Bivy Cloud](https://app.bivy.sh)** ·\n**[Quickstart](docs/quickstart.md)** ·\n**[Documentation](docs/README.md)** ·\n**[Self-host](docs/deploy-images.md)** ·\n**[Website](https://bivy.sh)**\n\n**Recommended:** sign in at [app.bivy.sh](https://app.bivy.sh), then copy your\npersonalized **Connect a Machine** command into a terminal on your Mac or Linux\ncomputer. It installs and enrolls the machine without another Bivy login. The\nbrowser connects automatically; choose a repository and send your first task\nright there.\n\nPrefer starting from the terminal?\n\n```bash\ncurl -fsSL https://bivy.sh/install.sh | bash # install + guided setup\ncd your-repo\nbivy run claude # or codex, pi, opencode\nbivy open # continue in the web app (needs remote setup)\n```\n\nBivy Cloud hosts the app, control plane, and relay—not the machines running your\nagents. Connect a Mac, Linux computer, or existing server and bring your own\nagent subscription, model API key, or local model. You can also self-host the\nentire remote-access stack.\n\n> **Bivy is 0.x software.** Claude Code, Codex, Pi, and OpenCode are the\n> release-tested paths. Credential sync, resume, handoffs, approvals, and\n> sandboxing depend on the runtime. See the\n> [runtime support matrix](docs/runtime-support-matrix.md).\n\n## Build → preview → mark up → iterate\n\nRemote chat lets you ask an agent for a change. Bivy also lets you **use what\nit built and show it what to fix**, without a separate deployment step.\n\n1. **Ask for a change.** The agent works in your repo with your existing tools\n and local services.\n2. **Try the app.** Open a live preview from the session. Use the running app,\n not just a screenshot of what the agent says it finished. Bivy can discover\n dev servers running in the session workspace; tap **Preview** to open one.\n3. **Mark up what needs work.** Point at an element or circle and draw on the\n preview. Add a note, then send the draft to the agent with the element and\n page context. Marked-up screenshots and before/after comparison are available\n when agent screenshots are enabled.\n4. **Iterate and review.** Try the next version, inspect the diff, review checks,\n and decide when the work is ready—not just when the agent stops.\n5. **Bring someone else into the review.** Copy a public preview link so they\n can use the app without a Bivy account and leave notes on specific elements.\n Bring their notes into the session when you're ready to act on them.\n\nOn Bivy Cloud, preview delivery is built in: no per-app domains, certificates,\npublic ports, or tunnels to configure. Self-hosters configure preview delivery\nonce for their Bivy deployment, not for every app. The app still needs its normal\nbuild or dev-server setup, and **the machine serving it must stay awake and\nonline**. These are development previews, not production hosting.\n\n**Share deliberately:** anyone with a preview link can use that app, including\nits live backend. Links expire after 24 hours and can be revoked sooner.\nReviewer notes aren't sent to the agent automatically; you send them or explicitly\nallow agent access. Preview traffic uses HTTPS through the preview relay, not\nsession end-to-end encryption; the relay operator can see it.\n\n[App previews, visual feedback, and sharing →](docs/apps.md)\n\n## Your agents and machines, one workspace\n\n| Capability | What it means for you |\n|---|---|\n| **One workspace, multiple agents** | Use different agents and models for different tasks without maintaining a separate workflow for each. |\n| **Your machines and environment** | Work beside your existing repos, dev servers, databases, private networks, toolchains, and GPUs. |\n| **Automations and triggers** | Let issues, failed CI, messages, schedules, and webhooks start work instead of copying requests into a chat. |\n| **Encrypted key and OAuth sync** | Reuse Bivy-managed provider credentials across enrolled machines and compatible runtimes, with less repeated setup. |\n| **Live sessions from anywhere** | Build and review from your phone, browser, or terminal; answer questions and approve supported actions in the same session. |\n| **Live app previews** | Try the running app without deploying it to a separate hosting service. |\n| **Visual feedback and sharing** | Point, draw, and send specific feedback to the agent; share a preview link for outside review. |\n| **Reviewable results** | Inspect the app, changes, declared checks, artifacts, and pull requests—not just an agent's claim that it finished. |\n| **Hosted convenience or self-hosting** | Use Bivy Cloud for managed remote access, or run the same open-source core yourself. |\n\n## One workflow, from trigger to review\n\n```text\nPrompt · GitHub issue · CI failure · Linear · Slack · Schedule · Webhook\n │\n ▼\n Choose machine + agent + model\n + supported credentials\n │\n ▼\n Live agent session\n Join · steer · approve · stop\n │\n ▼\n Try app · inspect changes · checks\n │\n ▼\n Mark up · send feedback · iterate\n │\n ▼\n Share preview · review PR\n```\n\nA **Machine** is a computer or server you connect. A **Session** is live agent\nwork on that machine. A **Run** is delegated background work that creates a\nsession and tracks its outcome. An **Automation** is a reusable definition that\ncreates runs when an event matches.\n\nManual and automated work use the same kind of live session. You can join a run\nwhen it needs help rather than wait for a black-box job to finish.\n\n### Work in the environment you already have\n\nA clean cloud sandbox isn't always enough. Your agent may need the database\nrunning on localhost, an uncommitted change, an internal API behind your VPN,\nor a model running on your GPU. Bivy runs the agent where those things already\nexist, subject to that machine's permissions and the runtime's protection.\n\nConnect several machines to the same account: a laptop for interactive work,\na Linux server for background jobs, or a GPU box for local inference. Choose\nthe machine for each session or pin it in an automation. Repository runs can\nuse isolated Git worktrees without rebuilding the whole development environment.\n\n**The execution machine must stay awake and online.** To close your laptop and\nleave work running, run the agent on a different, always-on machine.\n\n[Environment and multi-machine recipes →](docs/capability-recipes.md)\n\n### Use multiple agents, not multiple disconnected workflows\n\nRun Claude Code for one task, Codex for another, and Pi or OpenCode where they\nfit. Bivy supplies the shared session, remote-access, automation, and review\nsurfaces; your chosen agent still does the coding and uses your model provider.\n\n- Choose an agent and, where supported, a model for each session or run.\n- Import existing Claude Code and Codex sessions.\n- Fork or move work to another agent or machine when a different setup fits\n better. Continuation fidelity varies: some paths preserve native history,\n while others replay portable turns or seed the destination with context.\n- Use agent-native logins, Bivy-managed credentials, or local inference.\n Bivy's custom OpenAI-compatible endpoint registry currently feeds Pi;\n other agents may need their own provider configuration.\n- Register your own ACP or headless process agent with `bivy agent add`.\n\nBivy does not replace your agent, provide model inference, or make every agent's\nfeatures identical. Consult the [support matrix](docs/runtime-support-matrix.md)\nand [handoff recipes](docs/capability-recipes.md#fork-or-move-a-session).\n\n### Less signing in. Less copying secrets.\n\nBivy syncs **Bivy-managed API keys and supported OAuth credentials** across\nenrolled machines for compatible runtimes. Connect supported credentials once\nand reuse them where you run work, rather than manually distributing keys to\neach machine.\n\nFor ordinary account sync, credentials are encrypted on the node before upload.\nThe control plane stores ciphertext and wrapped-key metadata; enrolled nodes\nshare access by wrapping the vault key to one another. Bivy Cloud does not\nreceive plaintext credentials through this sync path.\n\nYou can also keep credentials local, use labeled keys and project presets, or\nreference environment variables and 1Password instead of embedding secrets in\nconfiguration:\n\n```bash\nbivy provider login\nbivy credentials add anthropic work\nbivy secrets ref github.repo-token op://Bivy/GitHub/repo-token\n```\n\n**Not every CLI login syncs.** Native agent logins may still be per-machine;\nGitHub App private-key sync is separately opt-in. If you lose every node and\ndevice able to unwrap a vault, you must sign in to providers again. Explicit\nhosted-provisioning custody grants are separate from ordinary encrypted sync.\n\n[Credential sync and runtime coverage →](docs/credential-sync.md) ·\n[Credentials guide →](docs/credentials-guide.md) ·\n[Key storage →](docs/key-management.md)\n\n### Let events start the work\n\nAutomations turn recurring or incoming work into sessions you can join,\nsupervise, and review. Choose the repository, machine, agent, model, approval\nmode, sandbox setting, and maximum attempts.\n\n| Trigger | Example workflow |\n|---|---|\n| **GitHub issues and mentions** | Label an issue `bivy` or `bivy/<machine>`, or mention your Bivy GitHub App, to work toward a pull request. |\n| **Failed CI** | Match a failed workflow, ask the agent to reproduce it, make a fix, and run the affected checks. |\n| **Linear** | Label an issue to start work without copying its description into an agent. |\n| **Slack** | Send a request from the conversation where the work came up. |\n| **Schedules** | Run a weekly dependency review, recurring maintenance, or a one-time task. |\n| **Signed webhooks** | Connect alerts, internal tools, or your own event sources. |\n\nConfigure automations in the app or version them with your repository in\n`.bivy/automations.yaml`:\n\n```bash\nbivy automation init\n# Edit the generated definition for your repository and workflow.\nbivy automation validate\nbivy automation test --event .bivy/events/failed-ci.yaml # supply a local event fixture\nbivy automation apply\n```\n\nOr delegate a one-off job without creating an automation:\n\n```bash\nbivy runs start \"Review outdated dependencies and propose a small, tested update.\"\nbivy runs wait <id>\n```\n\nRuns keep routing and lifecycle evidence, check results, and output references\nin a reviewable Receipt. For unattended issue work, Bivy runs declared repository\nchecks after the agent's turn; failed required checks fail the run even if the\nagent reports success. A completed process alone is not proof that the task\nsucceeded.\n\n[Automation recipes →](docs/capability-recipes.md#let-events-start-runs) ·\n[Automations as code →](docs/automations-as-code.md) ·\n[Run outcomes and reliability limits →](docs/automation-runs.md)\n\n### Start at your desk. Continue anywhere.\n\nOpen the same session in the browser, phone PWA, or terminal. Watch work live,\nanswer questions, approve supported tool calls, or stop the agent.\n\n- Send screenshots, images, logs, and other files from your phone.\n- Download reports and artifacts the agent creates.\n- Open [session apps](docs/apps.md) from chat or the **Apps** menu: live web\n previews, desktop app views, and CLI/TUI tools. Agents can publish views with\n `bivy app publish bivy.app.json` and create share links with `bivy app share`.\n- Use voice input and read-aloud where supported; provider-backed voice may\n send audio or text to the selected provider.\n- Keep a native terminal workflow or use structured chat, depending on the agent.\n\n```bash\nbivy run claude --no-follow # start without attaching\nbivy open # open the web app\nbivy resume # return to the session in your terminal\nbivy link # pair a device directly via QR\n```\n\nNo phone app installation is required. Open [app.bivy.sh](https://app.bivy.sh)\nin your browser; adding it to your home screen is optional.\n\n[Remote access →](docs/remote-access.md) ·\n[Voice, files, and terminal recipes →](docs/capability-recipes.md)\n\n## Get started\n\n### Install\n\nBivy supports **macOS and Linux with Node.js 20+**. The installer installs the\n`@bivy/bivy` package, runs guided setup, and starts a launchd or systemd service:\n\n```bash\ncurl -fsSL https://bivy.sh/install.sh | bash\n```\n\nSetup helps you choose an agent and configure remote access. Existing agents\nkeep their command, login, and configuration. The installer may use `sudo` to\ninstall a missing Node.js, but never for `npm install`. To inspect it first,\ndownload it with `curl -fsSL https://bivy.sh/install.sh -o install.sh`.\n\nAlready have Node.js and want to avoid sudo?\n\n```bash\nnpm install -g @bivy/bivy\nbivy setup\n```\n\nThen try one small task:\n\n```bash\ncd your-repo\nbivy run claude\n# Ask: \"Explain this repo and make one small, safe improvement. Run the relevant checks.\"\nbivy open\n```\n\nOpen that same session on your phone while it runs. For a web app, ask the agent\nto start its dev server, then open **Apps → Running in this workspace → Preview**.\nTry a page, point to something you'd change, and send the feedback back to the\nagent. No separate preview deployment needed.\n\nOnce that works, share a preview for review, connect another machine, or add\nyour first automation.\n\n**Local-only works too.** `bivy run`, `bivy resume`, and `bivy sessions` need no\naccount or server. Choose **local only for now** during setup; use `bivy login`\nlater. Browser and phone access need a hosted or self-hosted control plane;\nthe node itself does not serve a web UI.\n\n[Full quickstart →](docs/quickstart.md) ·\n[Installer options, service management, and uninstall →](docs/install.md)\n\n### Choose hosted or self-hosted\n\n| Option | What you get |\n|---|---|\n| **Free Cloud — $0** | Every launch feature, including automations; 10 new remote sessions per rolling seven days. No credit card required. |\n| **Cloud — $15/month** | The same features with unlimited remote sessions. |\n| **Self-hosted Core** | Operate the app, control plane, and relay yourself, with no Bivy usage limits. |\n\nManual and automated sessions share the Cloud allowance. Resuming existing\nsessions and viewing history do not consume it. Agent subscriptions and model\nprovider charges are separate. See [current pricing](https://bivy.sh#pricing).\n\n**Self-host anywhere:** deploy the public control-plane (including the web app)\nand relay images with Postgres and [a small set of environment variables](docs/deploy-images.md).\nYour server or container platform handles HTTPS. Set up owner access in the\nbrowser—no SSH, external authentication provider, or Bivy Cloud account required.\nFor a bare VPS, the [Compose installer](docs/self-host-quickstart.md) automates the\nsame stack. These onboarding features require a release containing them.\n\nStart on Cloud and self-host later if you prefer. Deploy the stack, reconnect\nmachines with `bivy relay:setup`, and pair devices to your server. This is not a\none-click migration of your Cloud account; your local repos and agent\nconfiguration stay in place.\n\n```bash\nbivy relay:setup \\\n --control-plane https://bivy.example.com \\\n --relay wss://relay.example.com\n```\n\nSelf-hosting is community-supported: you own TLS, backups, upgrades, and\nhardening. Public multi-architecture images are available as\n`ghcr.io/bivysh/bivy-control-plane` and `ghcr.io/bivysh/bivy-relay`; pin a release\nversion or full commit SHA.\n\n[Deploy the images anywhere →](docs/deploy-images.md) ·\n[Optional VPS installer →](docs/self-host-quickstart.md) ·\n[Operations reference →](docs/self-host.md)\n\n## Architecture\n\nYour environment, with clear security boundaries:\n\n```text\nYour machine Hosted or self-hosted\n┌──────────────────────┐ ┌──────────────────────┐\n│ Node daemon │──outbound──▶│ Relay │\n│ Agents, repos, tools │ │ Encrypted frames │\n│ Local credentials │ └──────────┬───────────┘\n└──────────────────────┘ │\n Browser / phone\n + control plane\n (app, accounts, metadata)\n```\n\n- **Execution stays on your machine.** Bivy Cloud does not run your agents.\n Your model provider still sees whatever the agent sends it.\n- **Interactive session traffic is end-to-end encrypted** between the node and\n paired devices. The relay forwards opaque session frames; your node dials out,\n so no inbound public port is required.\n- **App previews have a separate security boundary.** Preview traffic uses HTTPS\n and an outbound tunnel, not session E2E encryption. The preview ingress/relay\n operator can see it. Public preview links grant anyone holding them access to\n that view and its live backend until expiry or revocation. See\n [preview security and sharing](docs/apps.md#runtime-and-security-boundaries).\n- **Ordinary credential sync uploads ciphertext, not plaintext keys.**\n Supported credentials and recovery limits are documented separately.\n- **Encryption is not universal across integrations.** Slack commands and\n generic webhook instructions reach the control plane in plaintext. Do not\n put secrets in them. Routing and bounded run metadata are also visible there.\n- **Device authorization matters.** QR pairing authorizes a device directly\n through the node. Hosted account pairing trusts the control plane to authorize\n devices and serve the web app that holds client keys.\n- **Bivy is not an OS-level sandbox.** The default approval mode is\n `autonomous`; protection depends on the runtime. Some agents enforce sandbox\n tiers, while process agents may run with your full user permissions.\n Heuristic tool checks help prevent accidents but are not isolation.\n\nReview the runtime's Protection label and configure approval/sandbox settings\nfor the task, especially before enabling unattended work.\n\n[Security model and known limitations →](docs/security-model.md) ·\n[Runtime protection matrix →](docs/runtime-support-matrix.md) ·\n[Configuration →](docs/configuration.md)\n\n## Agents and everyday commands\n\n**Claude Code, Codex, Pi, and OpenCode are release-tested.** Additional adapters\ninclude Gemini CLI, Qwen Code, Goose, Aider, Cline, Crush, Cursor, GitHub Copilot,\nGrok, Amp, Auggie, Droid, Continue, Kilo Code, and Rovo Dev. Installation,\nresume, model selection, and tool protection vary—see the\n[support matrix](docs/runtime-support-matrix.md) and [agent guides](docs/agents/README.md).\n\nRun an arbitrary command with `bivy run -- ./your-agent --flags`, register a\nreusable entry with `bivy agent add`, or package a declarative integration with\nexperimental [plugins](docs/plugins.md).\n\n```bash\nbivy run claude # launch a durable session; also codex, pi, opencode\nbivy sessions # list live and saved sessions\nbivy resume # resume the most recent session\nbivy open # open the web app (requires remote setup)\nbivy nodes # list connected account machines\nbivy runs list # inspect delegated work\nbivy automation init # scaffold repo-owned automations\nbivy provider login # connect supported model credentials\nbivy agent add # register an ACP or process agent\nbivy doctor # check installation and connectivity\nbivy logs -f # follow node logs\nbivy update # update and restart the service\n```\n\n`bivy update` uses your original installation method and waits for an active\nturn to finish before restarting. Use `--force` to skip that wait.\n\n[CLI reference →](docs/cli-reference.md) ·\n[Node and project configuration →](docs/config-as-code.md) ·\n[GitHub setup →](docs/github-setup.md) ·\n[Linear setup →](docs/linear-work-queue.md)\n\n## Development and contributions\n\n```bash\npnpm install\npnpm run dev # node daemon on http://localhost:4317\npnpm run dev:web # web client dev server\n```\n\n| Directory | Contents |\n|---|---|\n| `src/`, `bin/` | Node daemon, CLI, runtime adapters, sessions, approvals, secrets |\n| `packages/core/` | Shared protocol, pairing, and wire format |\n| `packages/web/`, `packages/ui/` | React PWA and shared design system |\n| `services/relay/` | Self-hostable encrypted relay |\n| `services/control-plane/` | Self-hostable control plane |\n| `deploy/` | Deployment examples |\n\n```bash\npnpm run typecheck\npnpm run typecheck:web\npnpm run lint\npnpm run test:unit\npnpm run test:core\npnpm run check:licenses\npnpm run check:secrets\n```\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for the development workflow. Releases\nare published from CI with provenance attestations; see\n[release verification](docs/releasing.md).\n\n**Found a security issue?** Use\n[GitHub private vulnerability reporting](https://github.com/bivysh/bivy/security/advisories/new),\nnot a public issue. See [SECURITY.md](SECURITY.md).\n\n### In development—not available at launch\n\nAutomatically provisioned, short-lived **ephemeral machines** are in development\nfor hosted and bring-your-own-cloud deployments. Neither path is ready or\nsupported for this launch. Use an existing computer or server you operate.\nExperimental provisioning has different credential-custody and encryption\nboundaries; see the [provisioning trust model](docs/hosted-provisioning-trust-model.md).\n\n## License\n\nEverything in this repository—node, CLI, web/PWA, relay, and control plane—is\nfree and open-source **AGPL-3.0-only Core**, with no Bivy usage limits. You may\nuse, modify, and self-host it under that license. If users interact with your\nmodified version over a network, section 13 requires you to offer its\ncorresponding source. See [LICENSE](LICENSE).\n\nBivy Cloud is the hosted operation of that stack plus billing and plans, in a\nseparate private repository. Contributions use the\n[DCO](CONTRIBUTING.md#certificate-of-origin); there is no CLA.\n",
69
+ "readmeFilename": "README.md",
70
+ "agentBridges": {
71
+ "@anthropic-ai/claude-agent-sdk": "0.3.281",
72
+ "@earendil-works/pi-ai": "0.87.1",
73
+ "@earendil-works/pi-coding-agent": "0.87.1"
74
+ }
76
75
  }
@@ -1,56 +0,0 @@
1
- #!/usr/bin/env node
2
- // SPDX-License-Identifier: AGPL-3.0-only
3
- // Copyright (c) 2026 Petter André Sjulstad
4
- /**
5
- * pi-coding-agent 0.82.1 publishes an npm-shrinkwrap that pins vulnerable
6
- * transitive packages below its own node_modules. npm overrides update the outer
7
- * lockfile/audit result but do not replace those shrinkwrapped files during
8
- * installation. Replace the affected nested packages with direct, exact patched
9
- * dependencies until pi publishes a corrected shrinkwrap.
10
- *
11
- * This matters for the PUBLISHED package, which users install with npm. It is a
12
- * no-op in this repo's own dev install: pnpm ignores a dependency's shrinkwrap
13
- * and resolves everything through pnpm-lock.yaml, so the vulnerable nested
14
- * copies are never created and the loop below finds nothing to replace. Either
15
- * way scripts/check-security-pins.mjs asserts the end state.
16
- */
17
- import fs from "node:fs";
18
- import path from "node:path";
19
- import { fileURLToPath } from "node:url";
20
-
21
- const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
22
-
23
- // npm-global installs usually nest dependencies under bivy, while npm/npx may
24
- // hoist them to an ancestor node_modules. Support both layouts.
25
- function findDependency(relativePath) {
26
- let dir = root;
27
- while (true) {
28
- const candidate = path.join(dir, "node_modules", relativePath);
29
- if (fs.existsSync(candidate)) return candidate;
30
- const parent = path.dirname(dir);
31
- if (parent === dir) return undefined;
32
- dir = parent;
33
- }
34
- }
35
-
36
- const piPackage = findDependency(path.join("@earendil-works", "pi-coding-agent"));
37
- if (!piPackage) process.exit(0);
38
-
39
- const patches = [
40
- { name: "brace-expansion", version: "5.0.12" },
41
- { name: "undici", version: "8.10.2" },
42
- ];
43
-
44
- for (const patch of patches) {
45
- const source = findDependency(patch.name);
46
- const target = path.join(piPackage, "node_modules", patch.name);
47
- if (!fs.existsSync(target)) continue;
48
- if (!source) throw new Error(`Security patch source ${patch.name}@${patch.version} is missing`);
49
- const sourcePackage = JSON.parse(fs.readFileSync(path.join(source, "package.json"), "utf8"));
50
- if (sourcePackage.version !== patch.version) {
51
- throw new Error(`Refusing dependency patch from unexpected ${patch.name} ${sourcePackage.version}`);
52
- }
53
- fs.rmSync(target, { recursive: true, force: true });
54
- fs.cpSync(source, target, { recursive: true });
55
- console.log(`Patched pi-coding-agent's nested ${patch.name} to ${patch.version}`);
56
- }
@@ -1,35 +0,0 @@
1
- #!/usr/bin/env node
2
- // SPDX-License-Identifier: AGPL-3.0-only
3
- // Copyright (c) 2026 Petter André Sjulstad
4
- // node-pty 1.1.0's npm tarball ships the Darwin spawn-helper with mode 0644.
5
- // Loading pty.node succeeds, but opening any terminal fails with posix_spawnp.
6
- // Restore executable bits at install time, until upstream fixes the archive.
7
- import fs from "node:fs";
8
- import path from "node:path";
9
- import { createRequire } from "node:module";
10
- import { fileURLToPath } from "node:url";
11
-
12
- export function repairPtyPermissions(root, platform = process.platform, arch = process.arch) {
13
- if (platform !== "darwin") return;
14
- // resolve() handles both nested global installs and npm's hoisted layout.
15
- const require = createRequire(path.join(root, "package.json"));
16
- const ptyRoot = path.dirname(require.resolve("node-pty/package.json"));
17
- // node-pty can load a source build or a shipped prebuild. Only change its
18
- // known helper files, never recurse through arbitrary dependency executables.
19
- for (const dir of ["build/Release", "build/Debug", `prebuilds/${platform}-${arch}`]) {
20
- const helper = path.join(ptyRoot, dir, "spawn-helper");
21
- let stat;
22
- try { stat = fs.lstatSync(helper); }
23
- catch (error) {
24
- if (error.code === "ENOENT") continue;
25
- throw error;
26
- }
27
- if (!stat.isFile() || (stat.mode & 0o111) === 0o111) continue;
28
- fs.chmodSync(helper, (stat.mode & 0o777) | 0o111);
29
- console.log(`Restored executable permissions on node-pty/${dir}/spawn-helper`);
30
- }
31
- }
32
-
33
- if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
34
- repairPtyPermissions(path.resolve(path.dirname(fileURLToPath(import.meta.url)), ".."));
35
- }