@hachej/boring-agent 0.1.29 → 0.1.30
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/index.js +41 -8
- package/package.json +2 -2
package/dist/server/index.js
CHANGED
|
@@ -17,6 +17,11 @@ function getEnv(name) {
|
|
|
17
17
|
function getEnvSnapshot() {
|
|
18
18
|
return { ...process.env };
|
|
19
19
|
}
|
|
20
|
+
function setEnvDefault(name, value) {
|
|
21
|
+
if (process.env[name] !== void 0) return false;
|
|
22
|
+
process.env[name] = value;
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
20
25
|
|
|
21
26
|
// src/server/workspace/runtimeLayout.ts
|
|
22
27
|
import { mkdirSync, writeFileSync } from "fs";
|
|
@@ -1556,8 +1561,7 @@ var UV_SETUP_COMMANDS = [
|
|
|
1556
1561
|
"uv --version"
|
|
1557
1562
|
];
|
|
1558
1563
|
var NODE_UV_SETUP_COMMANDS = [
|
|
1559
|
-
|
|
1560
|
-
`[ -x ${VERCEL_UV_BIN} ] || python3 -m pip install --user --upgrade uv`,
|
|
1564
|
+
`[ -x ${VERCEL_UV_BIN} ] || curl -LsSf https://astral.sh/uv/install.sh | sh`,
|
|
1561
1565
|
`${VERCEL_UV_BIN} --version`
|
|
1562
1566
|
];
|
|
1563
1567
|
function isNodeFamilyRuntime(runtime) {
|
|
@@ -3165,11 +3169,13 @@ async function ensureUv(options) {
|
|
|
3165
3169
|
const explicitUvBin = options.explicitUvBin?.trim();
|
|
3166
3170
|
if (explicitUvBin) {
|
|
3167
3171
|
try {
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
}
|
|
3172
|
+
const uvVersion = await commandOutput2(options.adapter, explicitUvBin, ["--version"]) || "uv unknown";
|
|
3173
|
+
try {
|
|
3174
|
+
await options.adapter.exec("mkdir", ["-p", options.runtimeLayout.uvBin], { cwd: options.runtimeLayout.workspaceRoot });
|
|
3175
|
+
await options.adapter.exec("ln", ["-sf", explicitUvBin, join6(options.runtimeLayout.uvBin, "uv")], { cwd: options.runtimeLayout.workspaceRoot });
|
|
3176
|
+
} catch {
|
|
3177
|
+
}
|
|
3178
|
+
return { uvBin: explicitUvBin, uvVersion, installedWorkspaceUv: false };
|
|
3173
3179
|
} catch {
|
|
3174
3180
|
}
|
|
3175
3181
|
}
|
|
@@ -4397,6 +4403,17 @@ async function ensureVercelWorkspaceRoot(sandbox) {
|
|
|
4397
4403
|
throw new Error(`failed to initialize ${VERCEL_SANDBOX_REMOTE_ROOT} (exit ${result.exitCode ?? "unknown"})`);
|
|
4398
4404
|
}
|
|
4399
4405
|
}
|
|
4406
|
+
async function ensureVercelRuntimePrimitives(sandbox, runtime) {
|
|
4407
|
+
if (!sandbox.runCommand) return;
|
|
4408
|
+
const script = uvSetupCommandsForRuntime(runtime).join(" && ");
|
|
4409
|
+
const result = await sandbox.runCommand({ cmd: "sh", args: ["-c", script] });
|
|
4410
|
+
if ((result.exitCode ?? 1) !== 0) {
|
|
4411
|
+
throw new Error(`runtime bootstrap (uv) failed (exit ${result.exitCode ?? "unknown"})`);
|
|
4412
|
+
}
|
|
4413
|
+
if (isNodeFamilyRuntime(runtime)) {
|
|
4414
|
+
setEnvDefault("BORING_AGENT_UV_BIN", VERCEL_UV_BIN);
|
|
4415
|
+
}
|
|
4416
|
+
}
|
|
4400
4417
|
async function seedTemplateIntoVercelWorkspace(workspace, templatePath, logger) {
|
|
4401
4418
|
const files = await collectFiles(templatePath);
|
|
4402
4419
|
const hash = computeTemplateHash(files);
|
|
@@ -4554,6 +4571,14 @@ async function ensureVercelProvisioningParts(options) {
|
|
|
4554
4571
|
await ensureVercelWorkspaceRoot(sandboxHandle);
|
|
4555
4572
|
}
|
|
4556
4573
|
});
|
|
4574
|
+
await runSandboxSetupStep({
|
|
4575
|
+
telemetry,
|
|
4576
|
+
ctx: options.ctx,
|
|
4577
|
+
phase: "runtime-bootstrap",
|
|
4578
|
+
run: async () => {
|
|
4579
|
+
await ensureVercelRuntimePrimitives(sandboxHandle, runtime);
|
|
4580
|
+
}
|
|
4581
|
+
});
|
|
4557
4582
|
const workspace = createVercelSandboxWorkspace(sandboxHandle);
|
|
4558
4583
|
const workspaceFs = createVercelWorkspaceFs({ workspace, sandbox: sandboxHandle });
|
|
4559
4584
|
const sandbox = createVercelSandboxExec(sandboxHandle);
|
|
@@ -5858,8 +5883,16 @@ var WORKSPACE_PATHS_GUIDELINE = [
|
|
|
5858
5883
|
"- For `find`/`grep`/`ls`: omit the `path` argument to search from the workspace root. Pass `path` only when you need to restrict to a subdirectory, and only as a workspace-relative path.",
|
|
5859
5884
|
"- For `read`/`edit`/`write`: pass workspace-relative paths only."
|
|
5860
5885
|
].join("\n");
|
|
5886
|
+
var PYTHON_RUNTIME_GUIDELINE = [
|
|
5887
|
+
"## Python runtime",
|
|
5888
|
+
"",
|
|
5889
|
+
"- Python 3 and the Astral `uv` package manager are available on PATH.",
|
|
5890
|
+
"- Run scripts with `python3`.",
|
|
5891
|
+
"- Install/manage packages with `uv pip install <pkg>` (fast; targets the workspace venv at `.boring-agent/venv`). `uv` is the canonical package manager here \u2014 don't assume only `pip`.",
|
|
5892
|
+
"- Create venvs with `uv venv` if needed."
|
|
5893
|
+
].join("\n");
|
|
5861
5894
|
function composeSystemPromptAppend(hostAppend) {
|
|
5862
|
-
return [WORKSPACE_PATHS_GUIDELINE, hostAppend?.trim()].filter(Boolean).join("\n\n");
|
|
5895
|
+
return [WORKSPACE_PATHS_GUIDELINE, PYTHON_RUNTIME_GUIDELINE, hostAppend?.trim()].filter(Boolean).join("\n\n");
|
|
5863
5896
|
}
|
|
5864
5897
|
function buildDynamicPromptExtension(source) {
|
|
5865
5898
|
return (pi) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hachej/boring-agent",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.30",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Pane-embeddable coding agent. Ships direct/local/vercel-sandbox execution modes behind one interface.",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"use-stick-to-bottom": "^1.1.3",
|
|
76
76
|
"yaml": "^2.8.3",
|
|
77
77
|
"zod": "^3.25.76",
|
|
78
|
-
"@hachej/boring-ui-kit": "0.1.
|
|
78
|
+
"@hachej/boring-ui-kit": "0.1.30"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@opentelemetry/api": "^1.9.1",
|