@supatest/cli 0.0.58 → 0.0.59
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/index.js +33 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6079,7 +6079,7 @@ var CLI_VERSION;
|
|
|
6079
6079
|
var init_version = __esm({
|
|
6080
6080
|
"src/version.ts"() {
|
|
6081
6081
|
"use strict";
|
|
6082
|
-
CLI_VERSION = "0.0.
|
|
6082
|
+
CLI_VERSION = "0.0.59";
|
|
6083
6083
|
}
|
|
6084
6084
|
});
|
|
6085
6085
|
|
|
@@ -7481,7 +7481,9 @@ ${projectInstructions}`,
|
|
|
7481
7481
|
"ZAI_BASE_URL",
|
|
7482
7482
|
"CLAUDE_CODE_AUTH_TOKEN",
|
|
7483
7483
|
"CLAUDE_CODE_OAUTH_TOKEN",
|
|
7484
|
-
"CLAUDE_API_KEY"
|
|
7484
|
+
"CLAUDE_API_KEY",
|
|
7485
|
+
"CLAUDECODE"
|
|
7486
|
+
// Prevent nested session detection by Claude Code subprocess
|
|
7485
7487
|
]);
|
|
7486
7488
|
for (const [key, value] of Object.entries(process.env)) {
|
|
7487
7489
|
if (value !== void 0 && !excludeKeys.has(key)) {
|
|
@@ -7532,7 +7534,7 @@ ${projectInstructions}`,
|
|
|
7532
7534
|
allowDangerouslySkipPermissions: !isPlanMode,
|
|
7533
7535
|
pathToClaudeCodeExecutable: claudeCodePath,
|
|
7534
7536
|
includePartialMessages: true,
|
|
7535
|
-
executable:
|
|
7537
|
+
executable: process.execPath,
|
|
7536
7538
|
// MCP servers: built-in Supatest MCP + user-configured servers
|
|
7537
7539
|
// User config takes precedence (can override or disable supatest server)
|
|
7538
7540
|
mcpServers: (() => {
|
|
@@ -19924,7 +19926,6 @@ var HeadlessApp = (props) => {
|
|
|
19924
19926
|
init_stdio();
|
|
19925
19927
|
init_version();
|
|
19926
19928
|
async function runAgent(config2) {
|
|
19927
|
-
const cleanupStdio = patchStdio();
|
|
19928
19929
|
const apiUrl = config2.supatestApiUrl || "https://code-api.supatest.ai";
|
|
19929
19930
|
const apiClient = new ApiClient(apiUrl, config2.supatestApiKey);
|
|
19930
19931
|
let sessionId;
|
|
@@ -19948,7 +19949,6 @@ async function runAgent(config2) {
|
|
|
19948
19949
|
}
|
|
19949
19950
|
}
|
|
19950
19951
|
if (!sessionId) {
|
|
19951
|
-
cleanupStdio();
|
|
19952
19952
|
return {
|
|
19953
19953
|
success: false,
|
|
19954
19954
|
summary: "Failed to create session",
|
|
@@ -19957,6 +19957,7 @@ async function runAgent(config2) {
|
|
|
19957
19957
|
error: "Could not create session on backend"
|
|
19958
19958
|
};
|
|
19959
19959
|
}
|
|
19960
|
+
const cleanupStdio = patchStdio();
|
|
19960
19961
|
clearTerminalViewportAndScrollback();
|
|
19961
19962
|
const { stdout: inkStdout, stderr: inkStderr } = createInkStdio();
|
|
19962
19963
|
return new Promise((resolve2) => {
|
|
@@ -20042,7 +20043,16 @@ Updating Supatest CLI ${CLI_VERSION} \u2192 ${latest}...`);
|
|
|
20042
20043
|
try {
|
|
20043
20044
|
try {
|
|
20044
20045
|
const npmPrefix = execSync3("npm config get prefix", { encoding: "utf-8" }).trim();
|
|
20045
|
-
|
|
20046
|
+
if (process.platform === "win32") {
|
|
20047
|
+
const { rmSync, readdirSync: readdirSync2 } = await import("fs");
|
|
20048
|
+
const modulesDir = `${npmPrefix}\\node_modules\\@supatest`;
|
|
20049
|
+
const entries = readdirSync2(modulesDir).filter((e) => e.startsWith(".cli-"));
|
|
20050
|
+
for (const entry of entries) {
|
|
20051
|
+
rmSync(`${modulesDir}\\${entry}`, { recursive: true, force: true });
|
|
20052
|
+
}
|
|
20053
|
+
} else {
|
|
20054
|
+
execSync3(`rm -rf ${npmPrefix}/lib/node_modules/@supatest/.cli-* 2>/dev/null || true`);
|
|
20055
|
+
}
|
|
20046
20056
|
} catch {
|
|
20047
20057
|
}
|
|
20048
20058
|
try {
|
|
@@ -20078,6 +20088,12 @@ Updating Supatest CLI ${CLI_VERSION} \u2192 ${latest}...`);
|
|
|
20078
20088
|
detached: false
|
|
20079
20089
|
});
|
|
20080
20090
|
child.on("exit", (code) => process.exit(code ?? 0));
|
|
20091
|
+
child.on("error", (err) => {
|
|
20092
|
+
logError(err, { source: "auto-update", action: "relaunch" });
|
|
20093
|
+
console.error("Failed to relaunch after update:", err.message);
|
|
20094
|
+
console.log("Please restart the CLI manually.\n");
|
|
20095
|
+
process.exit(0);
|
|
20096
|
+
});
|
|
20081
20097
|
await new Promise(() => {
|
|
20082
20098
|
});
|
|
20083
20099
|
} catch (installError) {
|
|
@@ -20264,6 +20280,17 @@ program.name("supatest").description(
|
|
|
20264
20280
|
process.exit(1);
|
|
20265
20281
|
}
|
|
20266
20282
|
}
|
|
20283
|
+
{
|
|
20284
|
+
const { existsSync: existsSync10 } = await import("fs");
|
|
20285
|
+
const { resolve: resolve2 } = await import("path");
|
|
20286
|
+
const resolvedCwd = resolve2(options.cwd ?? process.cwd());
|
|
20287
|
+
if (!existsSync10(resolvedCwd)) {
|
|
20288
|
+
logger.error(`Working directory does not exist: ${resolvedCwd}`);
|
|
20289
|
+
logger.error(`Provided path: ${options.cwd}`);
|
|
20290
|
+
process.exit(1);
|
|
20291
|
+
}
|
|
20292
|
+
options.cwd = resolvedCwd;
|
|
20293
|
+
}
|
|
20267
20294
|
if (!prompt && isHeadlessMode) {
|
|
20268
20295
|
logger.error("Task description is required in headless mode");
|
|
20269
20296
|
program.help();
|