@a3t/rapid 0.1.11 → 0.1.12
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/bin.js
CHANGED
|
@@ -991,7 +991,7 @@ async function cleanupMergedWorktrees(repoRoot) {
|
|
|
991
991
|
|
|
992
992
|
// src/isolation/lima.ts
|
|
993
993
|
import { execa as execa2 } from "execa";
|
|
994
|
-
import { readFile as readFile2, writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
|
|
994
|
+
import { readFile as readFile2, writeFile as writeFile2, mkdir as mkdir2, access as access3 } from "fs/promises";
|
|
995
995
|
import { homedir, platform } from "os";
|
|
996
996
|
import { join as join3, dirname as dirname2 } from "path";
|
|
997
997
|
import { fileURLToPath } from "url";
|
|
@@ -1061,7 +1061,19 @@ async function getInstance(name = RAPID_LIMA_INSTANCE) {
|
|
|
1061
1061
|
}
|
|
1062
1062
|
async function instanceExists(name = RAPID_LIMA_INSTANCE) {
|
|
1063
1063
|
const instance = await getInstance(name);
|
|
1064
|
-
|
|
1064
|
+
if (instance !== null) {
|
|
1065
|
+
return true;
|
|
1066
|
+
}
|
|
1067
|
+
return instanceDirExists(name);
|
|
1068
|
+
}
|
|
1069
|
+
async function instanceDirExists(name = RAPID_LIMA_INSTANCE) {
|
|
1070
|
+
const instanceDir = join3(homedir(), ".lima", name);
|
|
1071
|
+
try {
|
|
1072
|
+
await access3(instanceDir);
|
|
1073
|
+
return true;
|
|
1074
|
+
} catch {
|
|
1075
|
+
return false;
|
|
1076
|
+
}
|
|
1065
1077
|
}
|
|
1066
1078
|
async function isRunning(name = RAPID_LIMA_INSTANCE) {
|
|
1067
1079
|
const instance = await getInstance(name);
|
|
@@ -1182,7 +1194,9 @@ async function startInstance(projectDir, options = {}) {
|
|
|
1182
1194
|
return { success: true };
|
|
1183
1195
|
}
|
|
1184
1196
|
await execa2("limactl", ["start", name], {
|
|
1185
|
-
timeout: (options.timeout ?? 300) * 1e3
|
|
1197
|
+
timeout: (options.timeout ?? 300) * 1e3,
|
|
1198
|
+
stdio: "inherit"
|
|
1199
|
+
// Show progress
|
|
1186
1200
|
});
|
|
1187
1201
|
} else {
|
|
1188
1202
|
const configPath = await createLimaConfig(projectDir, options);
|
|
@@ -1482,21 +1496,22 @@ async function prepareMcpEnv(rootDir, mcp) {
|
|
|
1482
1496
|
}
|
|
1483
1497
|
const configFile = mcp.configFile ?? ".mcp.json";
|
|
1484
1498
|
const configPath = isAbsolute(configFile) ? configFile : join4(rootDir, configFile);
|
|
1485
|
-
const
|
|
1499
|
+
const mcpServers = {};
|
|
1486
1500
|
for (const [name, serverConfig] of Object.entries(mcp.servers)) {
|
|
1487
1501
|
if (!serverConfig || typeof serverConfig !== "object") {
|
|
1488
1502
|
continue;
|
|
1489
1503
|
}
|
|
1490
|
-
const { enabled, ...rest } = serverConfig;
|
|
1504
|
+
const { enabled, type, ...rest } = serverConfig;
|
|
1491
1505
|
if (enabled === false) {
|
|
1492
1506
|
continue;
|
|
1493
1507
|
}
|
|
1494
|
-
|
|
1508
|
+
const outputType = type === "remote" ? "http" : type;
|
|
1509
|
+
mcpServers[name] = { type: outputType, ...rest };
|
|
1495
1510
|
}
|
|
1496
|
-
if (Object.keys(
|
|
1511
|
+
if (Object.keys(mcpServers).length === 0) {
|
|
1497
1512
|
return void 0;
|
|
1498
1513
|
}
|
|
1499
|
-
await writeFile3(configPath, `${JSON.stringify({
|
|
1514
|
+
await writeFile3(configPath, `${JSON.stringify({ mcpServers }, null, 2)}
|
|
1500
1515
|
`, "utf-8");
|
|
1501
1516
|
return {
|
|
1502
1517
|
MCP_CONFIG_FILE: configFile
|
|
@@ -2013,6 +2028,42 @@ agentCommand.command("default [name]").description("Get or set default agent").a
|
|
|
2013
2028
|
process.exit(1);
|
|
2014
2029
|
}
|
|
2015
2030
|
});
|
|
2031
|
+
agentCommand.command("yolo [name]").description("Enable YOLO mode (skip all permission prompts) for an agent").option("--off", "Disable YOLO mode").action(async (name, options) => {
|
|
2032
|
+
try {
|
|
2033
|
+
const loaded = await loadConfig3();
|
|
2034
|
+
if (!loaded) {
|
|
2035
|
+
logger4.error("No rapid.json found. Run `rapid init` first.");
|
|
2036
|
+
process.exit(1);
|
|
2037
|
+
}
|
|
2038
|
+
const { config } = loaded;
|
|
2039
|
+
const agentName = name || config.agents.default;
|
|
2040
|
+
if (!config.agents.available[agentName]) {
|
|
2041
|
+
logger4.error(`Agent "${agentName}" not found in configuration`);
|
|
2042
|
+
logger4.info("Available agents:");
|
|
2043
|
+
Object.keys(config.agents.available).forEach((n) => {
|
|
2044
|
+
console.log(` - ${n}`);
|
|
2045
|
+
});
|
|
2046
|
+
process.exit(1);
|
|
2047
|
+
}
|
|
2048
|
+
const agent = config.agents.available[agentName];
|
|
2049
|
+
const enabling = !options.off;
|
|
2050
|
+
if (enabling && agent.cli !== "claude") {
|
|
2051
|
+
logger4.warn(`YOLO mode is only supported for Claude (${agentName} uses ${agent.cli})`);
|
|
2052
|
+
logger4.info("Continuing anyway...");
|
|
2053
|
+
}
|
|
2054
|
+
agent.yolo = enabling;
|
|
2055
|
+
await writeFile4(loaded.filepath, JSON.stringify(config, null, 2) + "\n");
|
|
2056
|
+
if (enabling) {
|
|
2057
|
+
logger4.success(`YOLO mode enabled for "${agentName}"`);
|
|
2058
|
+
logger4.dim("Permission prompts will be skipped (--dangerously-skip-permissions)");
|
|
2059
|
+
} else {
|
|
2060
|
+
logger4.success(`YOLO mode disabled for "${agentName}"`);
|
|
2061
|
+
}
|
|
2062
|
+
} catch (error) {
|
|
2063
|
+
logger4.error(error instanceof Error ? error.message : String(error));
|
|
2064
|
+
process.exit(1);
|
|
2065
|
+
}
|
|
2066
|
+
});
|
|
2016
2067
|
|
|
2017
2068
|
// src/commands/start.ts
|
|
2018
2069
|
import { Command as Command5 } from "commander";
|
|
@@ -3619,4 +3670,4 @@ program.action(() => {
|
|
|
3619
3670
|
export {
|
|
3620
3671
|
program
|
|
3621
3672
|
};
|
|
3622
|
-
//# sourceMappingURL=chunk-
|
|
3673
|
+
//# sourceMappingURL=chunk-52NWSTTE.js.map
|