@bivy/bivy 0.16.17-staging.1 → 0.16.17-staging.2
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/agent-manifest.json +2 -1
- package/bin/bivy.mjs +3 -6
- package/bin/install-python-agent.mjs +24 -0
- package/dist/agents/profiles.js +2 -1
- package/dist/runtime/index.js +3 -5
- package/package.json +1 -1
package/bin/agent-manifest.json
CHANGED
package/bin/bivy.mjs
CHANGED
|
@@ -668,12 +668,9 @@ async function ensureNpmCommand(command, packageName, label) {
|
|
|
668
668
|
|
|
669
669
|
async function ensurePythonCommand(command, packageName, label) {
|
|
670
670
|
if (commandExists(command)) return true;
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
}
|
|
675
|
-
console.log(c.dim(`Installing ${label} (${packageName})…`));
|
|
676
|
-
const code = await run("python3", ["-m", "pip", "install", "--user", packageName]);
|
|
671
|
+
const install = loadAgentManifest().find((agent) => agent.command === command)?.install;
|
|
672
|
+
console.log(c.dim(`Installing ${label} (${packageName}) in an isolated Python environment…`));
|
|
673
|
+
const code = await run(process.execPath, [path.join(__dirname, "install-python-agent.mjs"), packageName, install?.python ?? "", userLocalPrefix]);
|
|
677
674
|
return code === 0 && commandExists(command);
|
|
678
675
|
}
|
|
679
676
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright (c) 2026 Petter André Sjulstad
|
|
3
|
+
// Shared by terminal setup/update and the daemon's agent installer.
|
|
4
|
+
import { spawnSync } from "node:child_process";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import os from "node:os";
|
|
7
|
+
|
|
8
|
+
const [pkg, python, prefix] = process.argv.slice(2);
|
|
9
|
+
if (!pkg || !prefix) {
|
|
10
|
+
console.error("Usage: install-python-agent.mjs <package> <python-or-empty> <prefix>");
|
|
11
|
+
process.exit(1);
|
|
12
|
+
}
|
|
13
|
+
const probe = spawnSync("uv", ["--version"], { stdio: "ignore" });
|
|
14
|
+
if (probe.error || probe.status !== 0) {
|
|
15
|
+
console.error("Python agent installation requires uv. Install it from https://docs.astral.sh/uv/getting-started/installation/ then re-run 'bivy agents:install'.");
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
const resolvedPrefix = prefix === "~" ? os.homedir() : prefix.startsWith("~/") ? path.join(os.homedir(), prefix.slice(2)) : prefix;
|
|
19
|
+
const result = spawnSync("uv", ["tool", "install", ...(python ? ["--python", python] : []), pkg], {
|
|
20
|
+
stdio: "inherit",
|
|
21
|
+
env: { ...process.env, UV_TOOL_BIN_DIR: path.join(resolvedPrefix, "bin") },
|
|
22
|
+
});
|
|
23
|
+
if (result.error) console.error(result.error.message);
|
|
24
|
+
process.exit(result.status ?? 1);
|
package/dist/agents/profiles.js
CHANGED
|
@@ -104,7 +104,8 @@ export const AGENT_PROFILES = {
|
|
|
104
104
|
// generic id-based primitive, and unsafe to bolt on generically (a second,
|
|
105
105
|
// unrelated session opened in the same workspace would inherit that file's
|
|
106
106
|
// history). See docs/agents-not-fully-supported.md.
|
|
107
|
-
|
|
107
|
+
// Isolate dependencies from the host Python (which may be too new).
|
|
108
|
+
install: { kind: "pip", pkg: "aider-chat", python: "3.12" },
|
|
108
109
|
},
|
|
109
110
|
hermes: {
|
|
110
111
|
displayName: "Hermes",
|
package/dist/runtime/index.js
CHANGED
|
@@ -236,12 +236,10 @@ function installSpecForCliAgent(spec, prefix) {
|
|
|
236
236
|
};
|
|
237
237
|
}
|
|
238
238
|
if (install.kind === "pip") {
|
|
239
|
-
// Some node images ship a python3 without pip; bootstrap it via ensurepip
|
|
240
|
-
// (best-effort) before installing, but show users the plain pip line.
|
|
241
239
|
return {
|
|
242
|
-
command:
|
|
243
|
-
args: ["
|
|
244
|
-
display: `
|
|
240
|
+
command: process.execPath,
|
|
241
|
+
args: [path.join(path.dirname(fileURLToPath(import.meta.url)), "..", "..", "bin", "install-python-agent.mjs"), install.pkg, install.python ?? "", prefix],
|
|
242
|
+
display: `uv tool install${install.python ? ` --python ${install.python}` : ""} ${install.pkg}`,
|
|
245
243
|
};
|
|
246
244
|
}
|
|
247
245
|
// curl / script: `{bin}` → the node's <prefix>/bin so binaries land on PATH.
|
package/package.json
CHANGED