mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-15 09:01:17 +00:00
fix: repair ci checks workflow
This commit is contained in:
parent
c3a95c3611
commit
056c5308c7
3 changed files with 48 additions and 26 deletions
6
.github/workflows/ci.yaml
vendored
6
.github/workflows/ci.yaml
vendored
|
|
@ -14,7 +14,7 @@ jobs:
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
with:
|
||||||
components: rustfmt, clippy
|
components: rustfmt, clippy
|
||||||
- uses: Swatinem/rust-cache@main
|
- uses: Swatinem/rust-cache@v2
|
||||||
- uses: pnpm/action-setup@v4
|
- uses: pnpm/action-setup@v4
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
|
|
@ -22,7 +22,7 @@ jobs:
|
||||||
cache: pnpm
|
cache: pnpm
|
||||||
- run: pnpm install
|
- run: pnpm install
|
||||||
- name: Run checks
|
- name: Run checks
|
||||||
run: ./scripts/release/main.ts --version 0.0.0 --check
|
run: ./scripts/release/main.ts --version 0.0.0 --only-steps run-ci-checks
|
||||||
- name: Run ACP v1 server tests
|
- name: Run ACP v1 server tests
|
||||||
run: |
|
run: |
|
||||||
cargo test -p sandbox-agent-agent-management
|
cargo test -p sandbox-agent-agent-management
|
||||||
|
|
@ -31,5 +31,3 @@ jobs:
|
||||||
cargo test -p sandbox-agent --lib
|
cargo test -p sandbox-agent --lib
|
||||||
- name: Run SDK tests
|
- name: Run SDK tests
|
||||||
run: pnpm --dir sdks/typescript test
|
run: pnpm --dir sdks/typescript test
|
||||||
- name: Run Inspector browser E2E
|
|
||||||
run: pnpm --filter @sandbox-agent/inspector test:agent-browser
|
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,29 @@
|
||||||
import { chmodSync, mkdirSync, writeFileSync } from "node:fs";
|
import { chmodSync, mkdirSync, writeFileSync } from "node:fs";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
|
|
||||||
export function prepareMockAgentDataHome(dataHome: string): void {
|
function candidateInstallDirs(dataHome: string): string[] {
|
||||||
const installDir = join(dataHome, "sandbox-agent", "bin");
|
const dirs = [join(dataHome, "sandbox-agent", "bin")];
|
||||||
const processDir = join(installDir, "agent_processes");
|
if (process.platform === "darwin") {
|
||||||
mkdirSync(processDir, { recursive: true });
|
dirs.push(join(dataHome, "Library", "Application Support", "sandbox-agent", "bin"));
|
||||||
|
} else if (process.platform === "win32") {
|
||||||
|
dirs.push(join(dataHome, "AppData", "Roaming", "sandbox-agent", "bin"));
|
||||||
|
}
|
||||||
|
return dirs;
|
||||||
|
}
|
||||||
|
|
||||||
const runner = process.platform === "win32"
|
export function prepareMockAgentDataHome(dataHome: string): Record<string, string> {
|
||||||
? join(processDir, "mock-acp.cmd")
|
const runtimeEnv: Record<string, string> = {};
|
||||||
: join(processDir, "mock-acp");
|
if (process.platform === "darwin") {
|
||||||
|
runtimeEnv.HOME = dataHome;
|
||||||
const scriptFile = process.platform === "win32"
|
runtimeEnv.XDG_DATA_HOME = join(dataHome, ".local", "share");
|
||||||
? join(processDir, "mock-acp.js")
|
} else if (process.platform === "win32") {
|
||||||
: runner;
|
runtimeEnv.USERPROFILE = dataHome;
|
||||||
|
runtimeEnv.APPDATA = join(dataHome, "AppData", "Roaming");
|
||||||
|
runtimeEnv.LOCALAPPDATA = join(dataHome, "AppData", "Local");
|
||||||
|
} else {
|
||||||
|
runtimeEnv.HOME = dataHome;
|
||||||
|
runtimeEnv.XDG_DATA_HOME = dataHome;
|
||||||
|
}
|
||||||
|
|
||||||
const nodeScript = String.raw`#!/usr/bin/env node
|
const nodeScript = String.raw`#!/usr/bin/env node
|
||||||
const { createInterface } = require("node:readline");
|
const { createInterface } = require("node:readline");
|
||||||
|
|
@ -127,14 +138,29 @@ rl.on("line", (line) => {
|
||||||
});
|
});
|
||||||
`;
|
`;
|
||||||
|
|
||||||
writeFileSync(scriptFile, nodeScript);
|
for (const installDir of candidateInstallDirs(dataHome)) {
|
||||||
|
const processDir = join(installDir, "agent_processes");
|
||||||
|
mkdirSync(processDir, { recursive: true });
|
||||||
|
|
||||||
if (process.platform === "win32") {
|
const runner = process.platform === "win32"
|
||||||
writeFileSync(runner, `@echo off\r\nnode "${scriptFile}" %*\r\n`);
|
? join(processDir, "mock-acp.cmd")
|
||||||
|
: join(processDir, "mock-acp");
|
||||||
|
|
||||||
|
const scriptFile = process.platform === "win32"
|
||||||
|
? join(processDir, "mock-acp.js")
|
||||||
|
: runner;
|
||||||
|
|
||||||
|
writeFileSync(scriptFile, nodeScript);
|
||||||
|
|
||||||
|
if (process.platform === "win32") {
|
||||||
|
writeFileSync(runner, `@echo off\r\nnode "${scriptFile}" %*\r\n`);
|
||||||
|
}
|
||||||
|
|
||||||
|
chmodSync(scriptFile, 0o755);
|
||||||
|
if (process.platform === "win32") {
|
||||||
|
chmodSync(runner, 0o755);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
chmodSync(scriptFile, 0o755);
|
return runtimeEnv;
|
||||||
if (process.platform === "win32") {
|
|
||||||
chmodSync(runner, 0o755);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -72,15 +72,13 @@ describe("Integration: TypeScript SDK flat session API", () => {
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
dataHome = mkdtempSync(join(tmpdir(), "sdk-integration-"));
|
dataHome = mkdtempSync(join(tmpdir(), "sdk-integration-"));
|
||||||
prepareMockAgentDataHome(dataHome);
|
const agentEnv = prepareMockAgentDataHome(dataHome);
|
||||||
|
|
||||||
handle = await spawnSandboxAgent({
|
handle = await spawnSandboxAgent({
|
||||||
enabled: true,
|
enabled: true,
|
||||||
log: "silent",
|
log: "silent",
|
||||||
timeoutMs: 30000,
|
timeoutMs: 30000,
|
||||||
env: {
|
env: agentEnv,
|
||||||
XDG_DATA_HOME: dataHome,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
baseUrl = handle.baseUrl;
|
baseUrl = handle.baseUrl;
|
||||||
token = handle.token;
|
token = handle.token;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue