improve nobash tests, fix cursor, reenable CI (#138)

This commit is contained in:
David Blass
2026-01-21 01:37:56 +00:00
committed by pullfrog[bot]
parent ecbbc3ae6f
commit 04cc24bf64
8 changed files with 171 additions and 62 deletions
+36 -24
View File
@@ -88438,7 +88438,9 @@ var Octokit2 = Octokit.plugin(requestLog, legacyRestEndpointMethods, paginateRes
// utils/log.ts
var core = __toESM(require_core(), 1);
var import_table = __toESM(require_src(), 1);
import { existsSync } from "node:fs";
var isGitHubActions = !!process.env.GITHUB_ACTIONS;
var isInsideDocker = existsSync("/.dockerenv");
var isDebugEnabled = () => process.env.LOG_LEVEL === "debug" || process.env.ACTIONS_STEP_DEBUG === "true" || process.env.RUNNER_DEBUG === "1" || core.isDebug();
function formatArgs(args3) {
return args3.map((arg) => {
@@ -88527,9 +88529,11 @@ function box(text, options) {
const boxContent = boxString(text, options);
core.info(boxContent);
}
function writeSummary(text) {
async function writeSummary(text) {
if (!isGitHubActions) return;
core.summary.addRaw(text).write({ overwrite: true });
if (isInsideDocker) return;
if (!process.env.GITHUB_STEP_SUMMARY) return;
await core.summary.addRaw(text).write({ overwrite: true });
}
function printTable(rows, options) {
const { title } = options || {};
@@ -119659,7 +119663,7 @@ function DebugShellCommandTool(_ctx) {
}
// prep/installNodeDependencies.ts
import { existsSync, readFileSync } from "node:fs";
import { existsSync as existsSync2, readFileSync } from "node:fs";
import { join as join3 } from "node:path";
// node_modules/.pnpm/@ark+util@0.53.0/node_modules/@ark/util/out/domain.js
@@ -120288,7 +120292,7 @@ var installNodeDependencies = {
name: "installNodeDependencies",
shouldRun: () => {
const packageJsonPath = join3(process.cwd(), "package.json");
return existsSync(packageJsonPath);
return existsSync2(packageJsonPath);
},
run: async () => {
const fromPackageJson = getPackageManagerFromPackageJson();
@@ -120354,7 +120358,7 @@ ${errorMessage}`]
};
// prep/installPythonDependencies.ts
import { existsSync as existsSync2 } from "node:fs";
import { existsSync as existsSync3 } from "node:fs";
import { join as join4 } from "node:path";
var PYTHON_CONFIGS = [
{
@@ -120427,11 +120431,11 @@ var installPythonDependencies = {
return false;
}
const cwd2 = process.cwd();
return PYTHON_CONFIGS.some((config4) => existsSync2(join4(cwd2, config4.file)));
return PYTHON_CONFIGS.some((config4) => existsSync3(join4(cwd2, config4.file)));
},
run: async () => {
const cwd2 = process.cwd();
const config4 = PYTHON_CONFIGS.find((c) => existsSync2(join4(cwd2, c.file)));
const config4 = PYTHON_CONFIGS.find((c) => existsSync3(join4(cwd2, c.file)));
if (!config4) {
return {
language: "python",
@@ -138340,7 +138344,7 @@ var package_default = {
// utils/install.ts
import { spawnSync as spawnSync2 } from "node:child_process";
import { chmodSync, createWriteStream as createWriteStream2, existsSync as existsSync4 } from "node:fs";
import { chmodSync, createWriteStream as createWriteStream2, existsSync as existsSync5 } from "node:fs";
import { mkdtemp } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join as join7 } from "node:path";
@@ -138398,7 +138402,7 @@ async function installFromNpmTarball(params) {
}
const extractedDir = join7(tempDir, "package");
const cliPath = join7(extractedDir, params.executablePath);
if (!existsSync4(cliPath)) {
if (!existsSync5(cliPath)) {
throw new Error(`Executable not found in extracted package at ${cliPath}`);
}
if (params.installDependencies) {
@@ -138474,7 +138478,7 @@ async function installFromGithub(params) {
} else {
cliPath = downloadPath;
}
if (!existsSync4(cliPath)) {
if (!existsSync5(cliPath)) {
throw new Error(`Executable not found at ${cliPath}`);
}
chmodSync(cliPath, 493);
@@ -138517,7 +138521,7 @@ async function installFromCurl(params) {
);
}
const cliPath = join7(tempDir, ".local", "bin", params.executableName);
if (!existsSync4(cliPath)) {
if (!existsSync5(cliPath)) {
throw new Error(`Executable not found at ${cliPath}`);
}
chmodSync(cliPath, 493);
@@ -139233,7 +139237,7 @@ var messageHandlers2 = {
// agents/cursor.ts
import { spawn as spawn5 } from "node:child_process";
import { existsSync as existsSync5, mkdirSync as mkdirSync4, readFileSync as readFileSync3, writeFileSync as writeFileSync5 } from "node:fs";
import { existsSync as existsSync6, mkdirSync as mkdirSync4, readFileSync as readFileSync3, writeFileSync as writeFileSync5 } from "node:fs";
import { homedir as homedir2 } from "node:os";
import { join as join9 } from "node:path";
var cursorEffortModels = {
@@ -139253,12 +139257,16 @@ var cursor = agent({
name: "cursor",
install: installCursor,
run: async (ctx) => {
const apiKey = process.env.CURSOR_API_KEY;
if (!apiKey) {
throw new Error("CURSOR_API_KEY is required for cursor agent");
}
const cliPath = await installCursor();
configureCursorMcpServers(ctx);
configureCursorTools(ctx);
const projectCliConfigPath = join9(process.cwd(), ".cursor", "cli.json");
let modelOverride = null;
if (existsSync5(projectCliConfigPath)) {
if (existsSync6(projectCliConfigPath)) {
try {
const projectConfig = JSON.parse(readFileSync3(projectCliConfigPath, "utf-8"));
if (projectConfig.model) {
@@ -139274,7 +139282,7 @@ var cursor = agent({
}
if (modelOverride) {
log.info(`\xBB using model: ${modelOverride}, effort=${ctx.payload.effort}`);
} else if (!existsSync5(projectCliConfigPath)) {
} else if (!existsSync6(projectCliConfigPath)) {
log.info(`\xBB using default model, effort=${ctx.payload.effort}`);
}
const loggedModelCallIds = /* @__PURE__ */ new Set();
@@ -139329,23 +139337,26 @@ var cursor = agent({
try {
const baseArgs = [
"--print",
ctx.instructions.full,
"--output-format",
"stream-json",
"--approve-mcps"
"--approve-mcps",
"--api-key",
apiKey
];
if (modelOverride) {
baseArgs.push("--model", modelOverride);
}
const cursorArgs = [...baseArgs, "--force"];
const cursorArgs = [...baseArgs, "--force", ctx.instructions.full];
log.info("\xBB running Cursor CLI...");
const startTime = Date.now();
const cliEnv = Object.fromEntries(
Object.entries(process.env).filter(([key]) => key !== "XDG_CONFIG_HOME")
);
return new Promise((resolve2) => {
const child = spawn5(cliPath, cursorArgs, {
cwd: process.cwd(),
env: process.env,
env: cliEnv,
stdio: ["ignore", "pipe", "pipe"]
// Ignore stdin, pipe stdout/stderr
});
let stdout = "";
let stderr = "";
@@ -139417,9 +139428,11 @@ var cursor = agent({
}
}
});
function getCursorConfigDir() {
return join9(homedir2(), ".cursor");
}
function configureCursorMcpServers(ctx) {
const realHome = homedir2();
const cursorConfigDir = join9(realHome, ".cursor");
const cursorConfigDir = getCursorConfigDir();
const mcpConfigPath = join9(cursorConfigDir, "mcp.json");
mkdirSync4(cursorConfigDir, { recursive: true });
const mcpServers = {
@@ -139429,8 +139442,7 @@ function configureCursorMcpServers(ctx) {
log.info(`\xBB MCP config written to ${mcpConfigPath}`);
}
function configureCursorTools(ctx) {
const realHome = homedir2();
const cursorConfigDir = join9(realHome, ".config", "cursor");
const cursorConfigDir = getCursorConfigDir();
const cliConfigPath = join9(cursorConfigDir, "cli-config.json");
mkdirSync4(cursorConfigDir, { recursive: true });
const bash = ctx.payload.bash;
@@ -140714,7 +140726,7 @@ async function main() {
instructions
});
if (toolState.lastProgressBody) {
writeSummary(toolState.lastProgressBody);
await writeSummary(toolState.lastProgressBody);
}
const mainResult = await handleAgentResult(result);
return mainResult;