@bivy/bivy 0.15.0-staging.5 → 0.15.0-staging.6

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/bin/bivy.mjs CHANGED
@@ -557,9 +557,13 @@ function npmGlobalBinCommand(cmd) {
557
557
  return fs.existsSync(candidate) ? candidate : "";
558
558
  }
559
559
 
560
+ function nodeAtLeast(minMajor, minMinor = 0) {
561
+ const [major, minor] = process.versions.node.split(".").map(Number);
562
+ return major > minMajor || (major === minMajor && minor >= minMinor);
563
+ }
564
+
560
565
  function hasSupportedNode() {
561
- const [major] = process.versions.node.split(".").map(Number);
562
- return major >= 20;
566
+ return nodeAtLeast(20);
563
567
  }
564
568
 
565
569
  async function ensureDeps() {
@@ -617,6 +621,10 @@ function nodePackageInstalled(packageName) {
617
621
  return runQuiet(nodeBin, ["-e", "require.resolve(process.argv[1], { paths: [process.argv[2]] })", packageName, repoRoot]).code === 0;
618
622
  }
619
623
 
624
+ function nodePackageLoadable(packageName) {
625
+ return runQuiet(nodeBin, ["-e", "require(require.resolve(process.argv[1], { paths: [process.argv[2]] }))", packageName, repoRoot]).code === 0;
626
+ }
627
+
620
628
  async function ensureNodePackage(packageName) {
621
629
  if (nodePackageInstalled(packageName)) {
622
630
  console.log(c.green(` ✓ Found Bivy bridge package ${packageName}`));
@@ -4134,6 +4142,14 @@ async function cmdDoctor(args = []) {
4134
4142
 
4135
4143
  console.log(c.bold("\n Bivy doctor\n"));
4136
4144
  console.log(` ${mark(hasSupportedNode())} Node ${process.version}${hasSupportedNode() ? "" : c.dim(" (needs >= 20.0.0)")}`);
4145
+ const ptyInstalled = nodePackageInstalled("node-pty");
4146
+ const ptyUsable = ptyInstalled && nodePackageLoadable("node-pty");
4147
+ console.log(` ${mark(ptyUsable, true)} terminal PTY ${ptyUsable ? c.green("available") : ptyInstalled ? c.yellow("installed but not loadable — reinstall after installing build tools") : c.dim("optional dependency missing — interactive terminals unavailable; chat/exec still work")}`);
4148
+ const claudeBridge = nodePackageInstalled("@anthropic-ai/claude-agent-sdk");
4149
+ console.log(` ${mark(claudeBridge, true)} Claude bridge ${claudeBridge ? c.green("installed") : c.dim("optional — installed on first Claude setup/use")}`);
4150
+ const piBridge = nodePackageInstalled("@earendil-works/pi-coding-agent");
4151
+ const piNodeOk = nodeAtLeast(22, 19);
4152
+ console.log(` ${mark(piBridge && piNodeOk, true)} Pi bridge ${piBridge ? (piNodeOk ? c.green("installed") : c.yellow("installed but needs Node >=22.19")) : c.dim("optional — installed only if you choose Pi")}`);
4137
4153
  console.log(` ${mark(commandExists("git"), true)} git${commandExists("git") ? "" : c.dim(" (recommended for repo-backed sessions)")}`);
4138
4154
  // GitHub is optional (a "No repo" session needs none), so this only ever warns.
4139
4155
  // `gh` is NOT required — it's a token fallback; the primary path is Bivy's own
@@ -5104,8 +5120,10 @@ Unlike 'bivy run', these commands operate on governed background Runs with check
5104
5120
  }
5105
5121
  const remote = await openRemoteApp();
5106
5122
  if (!remote) {
5107
- console.log("No remote access configured yet.");
5108
- console.log(`Run ${c.cyan("bivy relay:setup")} to enable the web/PWA app, then ${c.cyan("bivy open")}.`);
5123
+ console.log(c.yellow("Remote access is not configured on this machine yet."));
5124
+ console.log("The local node hosts only an API/WebSocket, not the Bivy PWA.");
5125
+ console.log(`Run ${c.cyan("bivy relay:setup")} to connect this node to the hosted or self-hosted remote web/PWA app, then run ${c.cyan("bivy open")} again.`);
5126
+ process.exitCode = 1;
5109
5127
  } else if (!canOpenBrowser()) {
5110
5128
  console.log(`Open the Bivy app here: ${c.cyan(remote.remoteBase)}`);
5111
5129
  }
@@ -40,6 +40,15 @@ export function piCommandAvailable() {
40
40
  export function invalidatePiCommandProbe() {
41
41
  PI_COMMAND_CACHE.clear();
42
42
  }
43
+ export function piBridgeInstalled() {
44
+ try {
45
+ import.meta.resolve("@earendil-works/pi-coding-agent");
46
+ return true;
47
+ }
48
+ catch {
49
+ return false;
50
+ }
51
+ }
43
52
  function unsupportedNodeMessage() {
44
53
  return `Pi requires Node.js 22.19+ (found ${process.version}). Upgrade Node, or select another agent such as Claude Code/Codex/OpenCode.`;
45
54
  }
@@ -87,13 +96,15 @@ export function piIntegration(origin) {
87
96
  visible: true,
88
97
  origin,
89
98
  describe: () => {
90
- const installed = piCommandAvailable();
99
+ const commandInstalled = piCommandAvailable();
100
+ const bridgeInstalled = piBridgeInstalled();
101
+ const installed = commandInstalled && bridgeInstalled && nodeSupportsPi();
91
102
  return {
92
103
  id: "pi",
93
104
  executionMode: "protocol",
94
105
  displayName: "Pi",
95
106
  description: "The operator-installed Pi coding agent connected to Bivy for durable sessions, governance, packages, and model selection.",
96
- status: installed && nodeSupportsPi() ? "available" : "external",
107
+ status: installed ? "available" : "external",
97
108
  packageName: "@earendil-works/pi-coding-agent",
98
109
  language: "TypeScript",
99
110
  capabilities: PI_CAPABILITIES,
@@ -105,7 +116,9 @@ export function piIntegration(origin) {
105
116
  ? unsupportedNodeMessage()
106
117
  : installed
107
118
  ? "Uses the Pi command and agent-owned auth/configuration already on this node, and hands sessions back to that native TUI."
108
- : "Install and sign in to Pi on this node; Bivy will connect to that existing agent.",
119
+ : commandInstalled
120
+ ? "Pi is on PATH, but Bivy's optional Pi bridge is not installed. Select Pi in setup or run 'bivy agents:install'."
121
+ : "Install and sign in to Pi on this node; Bivy will connect to that existing agent.",
109
122
  install: installed ? undefined : {
110
123
  label: "Install Pi",
111
124
  description: "Installs the upstream Pi coding agent on this node.",
@@ -116,6 +129,8 @@ export function piIntegration(origin) {
116
129
  create: (options) => {
117
130
  if (!piCommandAvailable())
118
131
  throw new Error(`Pi command not found on PATH: ${piCommand()}`);
132
+ if (!piBridgeInstalled())
133
+ throw new Error("Bivy's optional Pi bridge is not installed. Run 'bivy setup' and choose Pi, or run 'bivy agents:install'.");
119
134
  // Vault-backed credentials (see catalogRuntimes): the daemon-hosted Pi
120
135
  // session reads the shared vault the user signed in to, not Pi's own
121
136
  // plaintext auth.json. The agent dir still supplies config/models/packages.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bivy/bivy",
3
- "version": "0.15.0-staging.5",
3
+ "version": "0.15.0-staging.6",
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.",