@supatest/cli 0.0.48 → 0.0.49
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 +102 -71
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6337,6 +6337,9 @@ var init_shared_es = __esm({
|
|
|
6337
6337
|
|
|
6338
6338
|
// src/commands/setup.ts
|
|
6339
6339
|
import { execSync, spawn, spawnSync } from "child_process";
|
|
6340
|
+
import { existsSync, readFileSync, writeFileSync } from "fs";
|
|
6341
|
+
import { homedir } from "os";
|
|
6342
|
+
import { join } from "path";
|
|
6340
6343
|
function parseVersion(versionString) {
|
|
6341
6344
|
const cleaned = versionString.trim().replace(/^v/, "");
|
|
6342
6345
|
const match = cleaned.match(/^(\d+)\.(\d+)\.(\d+)/);
|
|
@@ -6449,6 +6452,23 @@ async function installAgentBrowser() {
|
|
|
6449
6452
|
});
|
|
6450
6453
|
});
|
|
6451
6454
|
}
|
|
6455
|
+
function removePlaywrightMcpFromFile(mcpPath) {
|
|
6456
|
+
if (!existsSync(mcpPath)) {
|
|
6457
|
+
return false;
|
|
6458
|
+
}
|
|
6459
|
+
try {
|
|
6460
|
+
const content = readFileSync(mcpPath, "utf-8");
|
|
6461
|
+
const config2 = JSON.parse(content);
|
|
6462
|
+
if (!config2.mcpServers?.playwright) {
|
|
6463
|
+
return false;
|
|
6464
|
+
}
|
|
6465
|
+
delete config2.mcpServers.playwright;
|
|
6466
|
+
writeFileSync(mcpPath, JSON.stringify(config2, null, 2), "utf-8");
|
|
6467
|
+
return true;
|
|
6468
|
+
} catch {
|
|
6469
|
+
return false;
|
|
6470
|
+
}
|
|
6471
|
+
}
|
|
6452
6472
|
function getVersionSummary() {
|
|
6453
6473
|
const nodeVersion = getNodeVersion();
|
|
6454
6474
|
const agentBrowserVersion = getAgentBrowserVersion();
|
|
@@ -6505,6 +6525,17 @@ async function setupCommand(options) {
|
|
|
6505
6525
|
result.errors.push(installResult.message);
|
|
6506
6526
|
}
|
|
6507
6527
|
}
|
|
6528
|
+
log("\n3. Checking for deprecated Playwright MCP...");
|
|
6529
|
+
const globalMcpPath = join(homedir(), ".supatest", "mcp.json");
|
|
6530
|
+
const projectMcpPath = join(options.cwd, ".supatest", "mcp.json");
|
|
6531
|
+
const removedGlobal = removePlaywrightMcpFromFile(globalMcpPath);
|
|
6532
|
+
const removedProject = removePlaywrightMcpFromFile(projectMcpPath);
|
|
6533
|
+
if (removedGlobal || removedProject) {
|
|
6534
|
+
const locations = [removedGlobal && "global", removedProject && "project"].filter(Boolean).join(" and ");
|
|
6535
|
+
log(` \u{1F5D1}\uFE0F Removed Playwright MCP from ${locations} config (no longer needed)`);
|
|
6536
|
+
} else {
|
|
6537
|
+
log(" \u2705 No Playwright MCP found");
|
|
6538
|
+
}
|
|
6508
6539
|
const versionSummary = getVersionSummary();
|
|
6509
6540
|
log(versionSummary);
|
|
6510
6541
|
log("\n" + "\u2500".repeat(50));
|
|
@@ -6533,7 +6564,7 @@ var CLI_VERSION;
|
|
|
6533
6564
|
var init_version = __esm({
|
|
6534
6565
|
"src/version.ts"() {
|
|
6535
6566
|
"use strict";
|
|
6536
|
-
CLI_VERSION = "0.0.
|
|
6567
|
+
CLI_VERSION = "0.0.49";
|
|
6537
6568
|
}
|
|
6538
6569
|
});
|
|
6539
6570
|
|
|
@@ -7474,8 +7505,8 @@ var init_api_client = __esm({
|
|
|
7474
7505
|
});
|
|
7475
7506
|
|
|
7476
7507
|
// src/utils/command-discovery.ts
|
|
7477
|
-
import { existsSync as
|
|
7478
|
-
import { join as
|
|
7508
|
+
import { existsSync as existsSync3, readdirSync, readFileSync as readFileSync2, statSync as statSync2 } from "fs";
|
|
7509
|
+
import { join as join4, relative } from "path";
|
|
7479
7510
|
function parseMarkdownFrontmatter(content) {
|
|
7480
7511
|
const frontmatterRegex = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/;
|
|
7481
7512
|
const match = content.match(frontmatterRegex);
|
|
@@ -7495,12 +7526,12 @@ function parseMarkdownFrontmatter(content) {
|
|
|
7495
7526
|
return { frontmatter, body };
|
|
7496
7527
|
}
|
|
7497
7528
|
function discoverMarkdownFiles(dir, baseDir, files = []) {
|
|
7498
|
-
if (!
|
|
7529
|
+
if (!existsSync3(dir)) {
|
|
7499
7530
|
return files;
|
|
7500
7531
|
}
|
|
7501
7532
|
const entries = readdirSync(dir);
|
|
7502
7533
|
for (const entry of entries) {
|
|
7503
|
-
const fullPath =
|
|
7534
|
+
const fullPath = join4(dir, entry);
|
|
7504
7535
|
const stat = statSync2(fullPath);
|
|
7505
7536
|
if (stat.isDirectory()) {
|
|
7506
7537
|
discoverMarkdownFiles(fullPath, baseDir, files);
|
|
@@ -7511,15 +7542,15 @@ function discoverMarkdownFiles(dir, baseDir, files = []) {
|
|
|
7511
7542
|
return files;
|
|
7512
7543
|
}
|
|
7513
7544
|
function discoverCommands(cwd) {
|
|
7514
|
-
const commandsDir =
|
|
7515
|
-
if (!
|
|
7545
|
+
const commandsDir = join4(cwd, ".supatest", "commands");
|
|
7546
|
+
if (!existsSync3(commandsDir)) {
|
|
7516
7547
|
return [];
|
|
7517
7548
|
}
|
|
7518
7549
|
const files = discoverMarkdownFiles(commandsDir, commandsDir);
|
|
7519
7550
|
const commands = [];
|
|
7520
7551
|
for (const filePath of files) {
|
|
7521
7552
|
try {
|
|
7522
|
-
const content =
|
|
7553
|
+
const content = readFileSync2(filePath, "utf-8");
|
|
7523
7554
|
const { frontmatter } = parseMarkdownFrontmatter(content);
|
|
7524
7555
|
const relativePath = relative(commandsDir, filePath);
|
|
7525
7556
|
const name = relativePath.replace(/\.md$/, "").replace(/\//g, ".").replace(/\\/g, ".");
|
|
@@ -7534,14 +7565,14 @@ function discoverCommands(cwd) {
|
|
|
7534
7565
|
return commands.sort((a, b) => a.name.localeCompare(b.name));
|
|
7535
7566
|
}
|
|
7536
7567
|
function expandCommand(cwd, commandName, args) {
|
|
7537
|
-
const commandsDir =
|
|
7568
|
+
const commandsDir = join4(cwd, ".supatest", "commands");
|
|
7538
7569
|
const relativePath = commandName.replace(/\./g, "/") + ".md";
|
|
7539
|
-
const filePath =
|
|
7540
|
-
if (!
|
|
7570
|
+
const filePath = join4(commandsDir, relativePath);
|
|
7571
|
+
if (!existsSync3(filePath)) {
|
|
7541
7572
|
return null;
|
|
7542
7573
|
}
|
|
7543
7574
|
try {
|
|
7544
|
-
const content =
|
|
7575
|
+
const content = readFileSync2(filePath, "utf-8");
|
|
7545
7576
|
const { body } = parseMarkdownFrontmatter(content);
|
|
7546
7577
|
let expanded = body;
|
|
7547
7578
|
if (args) {
|
|
@@ -7559,15 +7590,15 @@ function expandCommand(cwd, commandName, args) {
|
|
|
7559
7590
|
}
|
|
7560
7591
|
}
|
|
7561
7592
|
function discoverAgents(cwd) {
|
|
7562
|
-
const agentsDir =
|
|
7563
|
-
if (!
|
|
7593
|
+
const agentsDir = join4(cwd, ".supatest", "agents");
|
|
7594
|
+
if (!existsSync3(agentsDir)) {
|
|
7564
7595
|
return [];
|
|
7565
7596
|
}
|
|
7566
7597
|
const files = discoverMarkdownFiles(agentsDir, agentsDir);
|
|
7567
7598
|
const agents = [];
|
|
7568
7599
|
for (const filePath of files) {
|
|
7569
7600
|
try {
|
|
7570
|
-
const content =
|
|
7601
|
+
const content = readFileSync2(filePath, "utf-8");
|
|
7571
7602
|
const { frontmatter } = parseMarkdownFrontmatter(content);
|
|
7572
7603
|
const relativePath = relative(agentsDir, filePath);
|
|
7573
7604
|
const defaultName = relativePath.replace(/\.md$/, "").replace(/\//g, "-").replace(/\\/g, "-");
|
|
@@ -7589,9 +7620,9 @@ var init_command_discovery = __esm({
|
|
|
7589
7620
|
});
|
|
7590
7621
|
|
|
7591
7622
|
// src/utils/mcp-loader.ts
|
|
7592
|
-
import { existsSync as
|
|
7593
|
-
import { homedir as
|
|
7594
|
-
import { join as
|
|
7623
|
+
import { existsSync as existsSync4, readFileSync as readFileSync3 } from "fs";
|
|
7624
|
+
import { homedir as homedir3 } from "os";
|
|
7625
|
+
import { join as join5 } from "path";
|
|
7595
7626
|
function expandEnvVar(value) {
|
|
7596
7627
|
return value.replace(/\$\{([^}]+)\}/g, (_, expr) => {
|
|
7597
7628
|
const [varName, defaultValue] = expr.split(":-");
|
|
@@ -7614,11 +7645,11 @@ function expandServerConfig(config2) {
|
|
|
7614
7645
|
return expanded;
|
|
7615
7646
|
}
|
|
7616
7647
|
function loadMcpServersFromFile(mcpPath) {
|
|
7617
|
-
if (!
|
|
7648
|
+
if (!existsSync4(mcpPath)) {
|
|
7618
7649
|
return {};
|
|
7619
7650
|
}
|
|
7620
7651
|
try {
|
|
7621
|
-
const content =
|
|
7652
|
+
const content = readFileSync3(mcpPath, "utf-8");
|
|
7622
7653
|
const config2 = JSON.parse(content);
|
|
7623
7654
|
if (!config2.mcpServers) {
|
|
7624
7655
|
return {};
|
|
@@ -7640,9 +7671,9 @@ function loadMcpServersFromFile(mcpPath) {
|
|
|
7640
7671
|
}
|
|
7641
7672
|
}
|
|
7642
7673
|
function loadMcpServers(cwd) {
|
|
7643
|
-
const globalMcpPath =
|
|
7674
|
+
const globalMcpPath = join5(homedir3(), ".supatest", "mcp.json");
|
|
7644
7675
|
const globalServers = loadMcpServersFromFile(globalMcpPath);
|
|
7645
|
-
const projectMcpPath =
|
|
7676
|
+
const projectMcpPath = join5(cwd, ".supatest", "mcp.json");
|
|
7646
7677
|
const projectServers = loadMcpServersFromFile(projectMcpPath);
|
|
7647
7678
|
return { ...globalServers, ...projectServers };
|
|
7648
7679
|
}
|
|
@@ -7653,17 +7684,17 @@ var init_mcp_loader = __esm({
|
|
|
7653
7684
|
});
|
|
7654
7685
|
|
|
7655
7686
|
// src/utils/project-instructions.ts
|
|
7656
|
-
import { existsSync as
|
|
7657
|
-
import { join as
|
|
7687
|
+
import { existsSync as existsSync5, readFileSync as readFileSync4 } from "fs";
|
|
7688
|
+
import { join as join6 } from "path";
|
|
7658
7689
|
function loadProjectInstructions(cwd) {
|
|
7659
7690
|
const paths = [
|
|
7660
|
-
|
|
7661
|
-
|
|
7691
|
+
join6(cwd, "SUPATEST.md"),
|
|
7692
|
+
join6(cwd, ".supatest", "SUPATEST.md")
|
|
7662
7693
|
];
|
|
7663
7694
|
for (const path5 of paths) {
|
|
7664
|
-
if (
|
|
7695
|
+
if (existsSync5(path5)) {
|
|
7665
7696
|
try {
|
|
7666
|
-
return
|
|
7697
|
+
return readFileSync4(path5, "utf-8");
|
|
7667
7698
|
} catch {
|
|
7668
7699
|
}
|
|
7669
7700
|
}
|
|
@@ -7678,8 +7709,8 @@ var init_project_instructions = __esm({
|
|
|
7678
7709
|
|
|
7679
7710
|
// src/core/agent.ts
|
|
7680
7711
|
import { createRequire } from "module";
|
|
7681
|
-
import { homedir as
|
|
7682
|
-
import { dirname, join as
|
|
7712
|
+
import { homedir as homedir4 } from "os";
|
|
7713
|
+
import { dirname, join as join7 } from "path";
|
|
7683
7714
|
import { query } from "@anthropic-ai/claude-agent-sdk";
|
|
7684
7715
|
var CoreAgent;
|
|
7685
7716
|
var init_agent = __esm({
|
|
@@ -7809,7 +7840,7 @@ ${projectInstructions}`,
|
|
|
7809
7840
|
this.presenter.onLog(`Auth: Using Claude Max (default Claude Code credentials)`);
|
|
7810
7841
|
logger.debug("[agent] Claude Max mode: Using default ~/.claude/ config, cleared provider credentials");
|
|
7811
7842
|
} else {
|
|
7812
|
-
const internalConfigDir =
|
|
7843
|
+
const internalConfigDir = join7(homedir4(), ".supatest", "claude-internal");
|
|
7813
7844
|
cleanEnv.CLAUDE_CONFIG_DIR = internalConfigDir;
|
|
7814
7845
|
cleanEnv.ANTHROPIC_API_KEY = config2.supatestApiKey || "";
|
|
7815
7846
|
cleanEnv.ANTHROPIC_BASE_URL = process.env.ANTHROPIC_BASE_URL || "";
|
|
@@ -8139,7 +8170,7 @@ ${projectInstructions}`,
|
|
|
8139
8170
|
let claudeCodePath;
|
|
8140
8171
|
const require2 = createRequire(import.meta.url);
|
|
8141
8172
|
const sdkPath = require2.resolve("@anthropic-ai/claude-agent-sdk/sdk.mjs");
|
|
8142
|
-
claudeCodePath =
|
|
8173
|
+
claudeCodePath = join7(dirname(sdkPath), "cli.js");
|
|
8143
8174
|
this.presenter.onLog(`Using SDK CLI: ${claudeCodePath}`);
|
|
8144
8175
|
if (config.claudeCodeExecutablePath) {
|
|
8145
8176
|
claudeCodePath = config.claudeCodeExecutablePath;
|
|
@@ -9920,21 +9951,21 @@ var init_encryption = __esm({
|
|
|
9920
9951
|
});
|
|
9921
9952
|
|
|
9922
9953
|
// src/utils/token-storage.ts
|
|
9923
|
-
import { existsSync as
|
|
9924
|
-
import { homedir as
|
|
9925
|
-
import { join as
|
|
9954
|
+
import { existsSync as existsSync6, mkdirSync as mkdirSync2, readFileSync as readFileSync5, unlinkSync as unlinkSync2, writeFileSync as writeFileSync2 } from "fs";
|
|
9955
|
+
import { homedir as homedir6 } from "os";
|
|
9956
|
+
import { join as join8 } from "path";
|
|
9926
9957
|
function getTokenFilePath() {
|
|
9927
9958
|
const apiUrl = process.env.SUPATEST_API_URL || PRODUCTION_API_URL;
|
|
9928
9959
|
if (apiUrl === PRODUCTION_API_URL) {
|
|
9929
|
-
return
|
|
9960
|
+
return join8(CONFIG_DIR, "token.json");
|
|
9930
9961
|
}
|
|
9931
|
-
return
|
|
9962
|
+
return join8(CONFIG_DIR, "token.local.json");
|
|
9932
9963
|
}
|
|
9933
9964
|
function isV2Format(stored) {
|
|
9934
9965
|
return "version" in stored && stored.version === 2;
|
|
9935
9966
|
}
|
|
9936
9967
|
function ensureConfigDir() {
|
|
9937
|
-
if (!
|
|
9968
|
+
if (!existsSync6(CONFIG_DIR)) {
|
|
9938
9969
|
mkdirSync2(CONFIG_DIR, { recursive: true, mode: 448 });
|
|
9939
9970
|
}
|
|
9940
9971
|
}
|
|
@@ -9950,15 +9981,15 @@ function saveToken(token, expiresAt) {
|
|
|
9950
9981
|
encryptedData: encrypt(JSON.stringify(payload))
|
|
9951
9982
|
};
|
|
9952
9983
|
const tokenFile = getTokenFilePath();
|
|
9953
|
-
|
|
9984
|
+
writeFileSync2(tokenFile, JSON.stringify(stored, null, 2), { mode: 384 });
|
|
9954
9985
|
}
|
|
9955
9986
|
function loadToken() {
|
|
9956
9987
|
const tokenFile = getTokenFilePath();
|
|
9957
|
-
if (!
|
|
9988
|
+
if (!existsSync6(tokenFile)) {
|
|
9958
9989
|
return null;
|
|
9959
9990
|
}
|
|
9960
9991
|
try {
|
|
9961
|
-
const data =
|
|
9992
|
+
const data = readFileSync5(tokenFile, "utf8");
|
|
9962
9993
|
const stored = JSON.parse(data);
|
|
9963
9994
|
let payload;
|
|
9964
9995
|
if (isV2Format(stored)) {
|
|
@@ -9987,7 +10018,7 @@ function loadToken() {
|
|
|
9987
10018
|
}
|
|
9988
10019
|
function removeToken() {
|
|
9989
10020
|
const tokenFile = getTokenFilePath();
|
|
9990
|
-
if (
|
|
10021
|
+
if (existsSync6(tokenFile)) {
|
|
9991
10022
|
unlinkSync2(tokenFile);
|
|
9992
10023
|
}
|
|
9993
10024
|
}
|
|
@@ -9996,10 +10027,10 @@ var init_token_storage = __esm({
|
|
|
9996
10027
|
"src/utils/token-storage.ts"() {
|
|
9997
10028
|
"use strict";
|
|
9998
10029
|
init_encryption();
|
|
9999
|
-
CONFIG_DIR =
|
|
10030
|
+
CONFIG_DIR = join8(homedir6(), ".supatest");
|
|
10000
10031
|
PRODUCTION_API_URL = "https://code-api.supatest.ai";
|
|
10001
10032
|
STORAGE_VERSION = 2;
|
|
10002
|
-
TOKEN_FILE =
|
|
10033
|
+
TOKEN_FILE = join8(CONFIG_DIR, "token.json");
|
|
10003
10034
|
}
|
|
10004
10035
|
});
|
|
10005
10036
|
|
|
@@ -11058,8 +11089,8 @@ __export(secret_storage_exports, {
|
|
|
11058
11089
|
setSecret: () => setSecret
|
|
11059
11090
|
});
|
|
11060
11091
|
import { promises as fs3 } from "fs";
|
|
11061
|
-
import { homedir as
|
|
11062
|
-
import { dirname as dirname2, join as
|
|
11092
|
+
import { homedir as homedir7 } from "os";
|
|
11093
|
+
import { dirname as dirname2, join as join9 } from "path";
|
|
11063
11094
|
async function getSecret(key) {
|
|
11064
11095
|
return storage.getSecret(key);
|
|
11065
11096
|
}
|
|
@@ -11084,8 +11115,8 @@ var init_secret_storage = __esm({
|
|
|
11084
11115
|
secretFilePath;
|
|
11085
11116
|
constructor() {
|
|
11086
11117
|
const rootDirName = process.env.NODE_ENV === "development" ? ".supatest-dev" : ".supatest";
|
|
11087
|
-
const secretsDir =
|
|
11088
|
-
this.secretFilePath =
|
|
11118
|
+
const secretsDir = join9(homedir7(), rootDirName, "claude-auth");
|
|
11119
|
+
this.secretFilePath = join9(secretsDir, SECRET_FILE_NAME);
|
|
11089
11120
|
}
|
|
11090
11121
|
async ensureDirectoryExists() {
|
|
11091
11122
|
const dir = dirname2(this.secretFilePath);
|
|
@@ -11182,21 +11213,21 @@ var init_claude_max = __esm({
|
|
|
11182
11213
|
});
|
|
11183
11214
|
|
|
11184
11215
|
// src/utils/mcp-manager.ts
|
|
11185
|
-
import { existsSync as
|
|
11186
|
-
import { homedir as
|
|
11187
|
-
import { join as
|
|
11216
|
+
import { existsSync as existsSync7, mkdirSync as mkdirSync3, readFileSync as readFileSync6, writeFileSync as writeFileSync3 } from "fs";
|
|
11217
|
+
import { homedir as homedir8 } from "os";
|
|
11218
|
+
import { join as join10 } from "path";
|
|
11188
11219
|
function getGlobalMcpPath() {
|
|
11189
|
-
return
|
|
11220
|
+
return join10(homedir8(), ".supatest", "mcp.json");
|
|
11190
11221
|
}
|
|
11191
11222
|
function getProjectMcpPath(cwd) {
|
|
11192
|
-
return
|
|
11223
|
+
return join10(cwd, ".supatest", "mcp.json");
|
|
11193
11224
|
}
|
|
11194
11225
|
function loadMcpConfigFromFile(mcpPath, scope) {
|
|
11195
|
-
if (!
|
|
11226
|
+
if (!existsSync7(mcpPath)) {
|
|
11196
11227
|
return {};
|
|
11197
11228
|
}
|
|
11198
11229
|
try {
|
|
11199
|
-
const content =
|
|
11230
|
+
const content = readFileSync6(mcpPath, "utf-8");
|
|
11200
11231
|
const config2 = JSON.parse(content);
|
|
11201
11232
|
if (!config2.mcpServers) {
|
|
11202
11233
|
return {};
|
|
@@ -11229,8 +11260,8 @@ function loadMcpConfig(cwd) {
|
|
|
11229
11260
|
return { ...globalServers, ...projectServers };
|
|
11230
11261
|
}
|
|
11231
11262
|
function saveMcpConfigToFile(mcpPath, servers) {
|
|
11232
|
-
const mcpDir =
|
|
11233
|
-
if (!
|
|
11263
|
+
const mcpDir = join10(mcpPath, "..");
|
|
11264
|
+
if (!existsSync7(mcpDir)) {
|
|
11234
11265
|
mkdirSync3(mcpDir, { recursive: true });
|
|
11235
11266
|
}
|
|
11236
11267
|
const config2 = {
|
|
@@ -11245,7 +11276,7 @@ function saveMcpConfigToFile(mcpPath, servers) {
|
|
|
11245
11276
|
description: server.description
|
|
11246
11277
|
};
|
|
11247
11278
|
}
|
|
11248
|
-
|
|
11279
|
+
writeFileSync3(mcpPath, JSON.stringify(config2, null, 2), "utf-8");
|
|
11249
11280
|
}
|
|
11250
11281
|
function saveMcpConfig(cwd, servers) {
|
|
11251
11282
|
const globalServers = {};
|
|
@@ -11414,15 +11445,15 @@ var init_mcp_manager = __esm({
|
|
|
11414
11445
|
});
|
|
11415
11446
|
|
|
11416
11447
|
// src/utils/settings-loader.ts
|
|
11417
|
-
import { existsSync as
|
|
11418
|
-
import { join as
|
|
11448
|
+
import { existsSync as existsSync8, mkdirSync as mkdirSync4, readFileSync as readFileSync7, writeFileSync as writeFileSync4 } from "fs";
|
|
11449
|
+
import { join as join11 } from "path";
|
|
11419
11450
|
function loadSupatestSettings(cwd) {
|
|
11420
|
-
const settingsPath =
|
|
11421
|
-
if (!
|
|
11451
|
+
const settingsPath = join11(cwd, ".supatest", "settings.json");
|
|
11452
|
+
if (!existsSync8(settingsPath)) {
|
|
11422
11453
|
return {};
|
|
11423
11454
|
}
|
|
11424
11455
|
try {
|
|
11425
|
-
const content =
|
|
11456
|
+
const content = readFileSync7(settingsPath, "utf-8");
|
|
11426
11457
|
return JSON.parse(content);
|
|
11427
11458
|
} catch (error) {
|
|
11428
11459
|
console.warn(
|
|
@@ -11433,10 +11464,10 @@ function loadSupatestSettings(cwd) {
|
|
|
11433
11464
|
}
|
|
11434
11465
|
}
|
|
11435
11466
|
function saveSupatestSettings(cwd, settings) {
|
|
11436
|
-
const settingsDir =
|
|
11437
|
-
const settingsPath =
|
|
11467
|
+
const settingsDir = join11(cwd, ".supatest");
|
|
11468
|
+
const settingsPath = join11(settingsDir, "settings.json");
|
|
11438
11469
|
try {
|
|
11439
|
-
if (!
|
|
11470
|
+
if (!existsSync8(settingsDir)) {
|
|
11440
11471
|
mkdirSync4(settingsDir, { recursive: true });
|
|
11441
11472
|
}
|
|
11442
11473
|
const existingSettings = loadSupatestSettings(cwd);
|
|
@@ -11453,7 +11484,7 @@ function saveSupatestSettings(cwd, settings) {
|
|
|
11453
11484
|
...settings.hooks
|
|
11454
11485
|
}
|
|
11455
11486
|
};
|
|
11456
|
-
|
|
11487
|
+
writeFileSync4(settingsPath, JSON.stringify(mergedSettings, null, 2), "utf-8");
|
|
11457
11488
|
} catch (error) {
|
|
11458
11489
|
console.warn(
|
|
11459
11490
|
`Warning: Failed to save settings to ${settingsPath}:`,
|
|
@@ -14384,7 +14415,7 @@ var init_useOverlayEscapeGuard = __esm({
|
|
|
14384
14415
|
|
|
14385
14416
|
// src/ui/App.tsx
|
|
14386
14417
|
import { execSync as execSync5 } from "child_process";
|
|
14387
|
-
import { homedir as
|
|
14418
|
+
import { homedir as homedir9 } from "os";
|
|
14388
14419
|
import { Box as Box28, Text as Text26, useApp as useApp2, useStdout as useStdout2 } from "ink";
|
|
14389
14420
|
import Spinner4 from "ink-spinner";
|
|
14390
14421
|
import React31, { useCallback as useCallback5, useEffect as useEffect14, useRef as useRef8, useState as useState18 } from "react";
|
|
@@ -14431,7 +14462,7 @@ var init_App = __esm({
|
|
|
14431
14462
|
};
|
|
14432
14463
|
getCurrentFolder2 = (configCwd) => {
|
|
14433
14464
|
const cwd = configCwd || process.cwd();
|
|
14434
|
-
const home =
|
|
14465
|
+
const home = homedir9();
|
|
14435
14466
|
if (cwd.startsWith(home)) {
|
|
14436
14467
|
return `~${cwd.slice(home.length)}`;
|
|
14437
14468
|
}
|
|
@@ -15794,7 +15825,7 @@ init_react();
|
|
|
15794
15825
|
init_MessageList();
|
|
15795
15826
|
init_SessionContext();
|
|
15796
15827
|
import { execSync as execSync2 } from "child_process";
|
|
15797
|
-
import { homedir as
|
|
15828
|
+
import { homedir as homedir5 } from "os";
|
|
15798
15829
|
import { Box as Box13, useApp } from "ink";
|
|
15799
15830
|
import React14, { useEffect as useEffect2, useRef as useRef4, useState as useState3 } from "react";
|
|
15800
15831
|
var getGitBranch = () => {
|
|
@@ -15806,7 +15837,7 @@ var getGitBranch = () => {
|
|
|
15806
15837
|
};
|
|
15807
15838
|
var getCurrentFolder = () => {
|
|
15808
15839
|
const cwd = process.cwd();
|
|
15809
|
-
const home =
|
|
15840
|
+
const home = homedir5();
|
|
15810
15841
|
if (cwd.startsWith(home)) {
|
|
15811
15842
|
return `~${cwd.slice(home.length)}`;
|
|
15812
15843
|
}
|