@a3t/rapid 0.1.10 → 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
|
@@ -286,14 +286,13 @@ function getPrebuiltConfig(templateName, containerEnv, postStartCommand) {
|
|
|
286
286
|
function getDevContainerConfig(detected, usePrebuilt = false) {
|
|
287
287
|
const baseFeatures = {
|
|
288
288
|
"ghcr.io/devcontainers/features/git:1": {},
|
|
289
|
-
"ghcr.io/devcontainers
|
|
290
|
-
"ghcr.io/devcontainers-contrib/features/starship:1": {}
|
|
289
|
+
"ghcr.io/devcontainers/features/github-cli:1": {}
|
|
291
290
|
};
|
|
292
291
|
const containerEnv = {
|
|
293
292
|
OP_SERVICE_ACCOUNT_TOKEN: "${localEnv:OP_SERVICE_ACCOUNT_TOKEN}"
|
|
294
293
|
};
|
|
295
|
-
const
|
|
296
|
-
const postCreateBase = `${
|
|
294
|
+
const installTools = "sudo apt-get update -qq && sudo apt-get install -y -qq jq direnv && curl -sS https://downloads.1password.com/linux/keys/1password.asc | sudo gpg --dearmor -o /usr/share/keyrings/1password.gpg && echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/1password.gpg] https://downloads.1password.com/linux/debian/amd64 stable main' | sudo tee /etc/apt/sources.list.d/1password.list && sudo apt-get update -qq && sudo apt-get install -y -qq 1password-cli && curl -fsSL https://starship.rs/install.sh | sh -s -- -y";
|
|
295
|
+
const postCreateBase = `${installTools} && npm install -g @anthropic-ai/claude-code && curl -fsSL https://opencode.ai/install | bash`;
|
|
297
296
|
const postStartCommand = "direnv allow 2>/dev/null || true";
|
|
298
297
|
const language = detected?.language || "unknown";
|
|
299
298
|
const templateName = language === "javascript" ? "typescript" : language === "unknown" ? "universal" : language;
|
|
@@ -307,8 +306,7 @@ function getDevContainerConfig(detected, usePrebuilt = false) {
|
|
|
307
306
|
name: "RAPID TypeScript",
|
|
308
307
|
image: "mcr.microsoft.com/devcontainers/typescript-node:22",
|
|
309
308
|
features: {
|
|
310
|
-
...baseFeatures
|
|
311
|
-
"ghcr.io/devcontainers-contrib/features/pnpm:2": {}
|
|
309
|
+
...baseFeatures
|
|
312
310
|
},
|
|
313
311
|
customizations: {
|
|
314
312
|
vscode: {
|
|
@@ -339,9 +337,7 @@ function getDevContainerConfig(detected, usePrebuilt = false) {
|
|
|
339
337
|
image: "mcr.microsoft.com/devcontainers/python:3.12",
|
|
340
338
|
features: {
|
|
341
339
|
...baseFeatures,
|
|
342
|
-
"ghcr.io/devcontainers/features/node:1": { version: "22" }
|
|
343
|
-
"ghcr.io/devcontainers-contrib/features/poetry:2": {},
|
|
344
|
-
"ghcr.io/devcontainers-contrib/features/uv:1": {}
|
|
340
|
+
"ghcr.io/devcontainers/features/node:1": { version: "22" }
|
|
345
341
|
},
|
|
346
342
|
customizations: {
|
|
347
343
|
vscode: {
|
|
@@ -367,7 +363,7 @@ function getDevContainerConfig(detected, usePrebuilt = false) {
|
|
|
367
363
|
}
|
|
368
364
|
},
|
|
369
365
|
containerEnv,
|
|
370
|
-
postCreateCommand: `${postCreateBase} && pip install aider-chat`,
|
|
366
|
+
postCreateCommand: `${postCreateBase} && pip install poetry uv aider-chat`,
|
|
371
367
|
postStartCommand,
|
|
372
368
|
remoteUser: "vscode"
|
|
373
369
|
};
|
|
@@ -995,7 +991,7 @@ async function cleanupMergedWorktrees(repoRoot) {
|
|
|
995
991
|
|
|
996
992
|
// src/isolation/lima.ts
|
|
997
993
|
import { execa as execa2 } from "execa";
|
|
998
|
-
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";
|
|
999
995
|
import { homedir, platform } from "os";
|
|
1000
996
|
import { join as join3, dirname as dirname2 } from "path";
|
|
1001
997
|
import { fileURLToPath } from "url";
|
|
@@ -1065,7 +1061,19 @@ async function getInstance(name = RAPID_LIMA_INSTANCE) {
|
|
|
1065
1061
|
}
|
|
1066
1062
|
async function instanceExists(name = RAPID_LIMA_INSTANCE) {
|
|
1067
1063
|
const instance = await getInstance(name);
|
|
1068
|
-
|
|
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
|
+
}
|
|
1069
1077
|
}
|
|
1070
1078
|
async function isRunning(name = RAPID_LIMA_INSTANCE) {
|
|
1071
1079
|
const instance = await getInstance(name);
|
|
@@ -1186,7 +1194,9 @@ async function startInstance(projectDir, options = {}) {
|
|
|
1186
1194
|
return { success: true };
|
|
1187
1195
|
}
|
|
1188
1196
|
await execa2("limactl", ["start", name], {
|
|
1189
|
-
timeout: (options.timeout ?? 300) * 1e3
|
|
1197
|
+
timeout: (options.timeout ?? 300) * 1e3,
|
|
1198
|
+
stdio: "inherit"
|
|
1199
|
+
// Show progress
|
|
1190
1200
|
});
|
|
1191
1201
|
} else {
|
|
1192
1202
|
const configPath = await createLimaConfig(projectDir, options);
|
|
@@ -1486,21 +1496,22 @@ async function prepareMcpEnv(rootDir, mcp) {
|
|
|
1486
1496
|
}
|
|
1487
1497
|
const configFile = mcp.configFile ?? ".mcp.json";
|
|
1488
1498
|
const configPath = isAbsolute(configFile) ? configFile : join4(rootDir, configFile);
|
|
1489
|
-
const
|
|
1499
|
+
const mcpServers = {};
|
|
1490
1500
|
for (const [name, serverConfig] of Object.entries(mcp.servers)) {
|
|
1491
1501
|
if (!serverConfig || typeof serverConfig !== "object") {
|
|
1492
1502
|
continue;
|
|
1493
1503
|
}
|
|
1494
|
-
const { enabled, ...rest } = serverConfig;
|
|
1504
|
+
const { enabled, type, ...rest } = serverConfig;
|
|
1495
1505
|
if (enabled === false) {
|
|
1496
1506
|
continue;
|
|
1497
1507
|
}
|
|
1498
|
-
|
|
1508
|
+
const outputType = type === "remote" ? "http" : type;
|
|
1509
|
+
mcpServers[name] = { type: outputType, ...rest };
|
|
1499
1510
|
}
|
|
1500
|
-
if (Object.keys(
|
|
1511
|
+
if (Object.keys(mcpServers).length === 0) {
|
|
1501
1512
|
return void 0;
|
|
1502
1513
|
}
|
|
1503
|
-
await writeFile3(configPath, `${JSON.stringify({
|
|
1514
|
+
await writeFile3(configPath, `${JSON.stringify({ mcpServers }, null, 2)}
|
|
1504
1515
|
`, "utf-8");
|
|
1505
1516
|
return {
|
|
1506
1517
|
MCP_CONFIG_FILE: configFile
|
|
@@ -2017,6 +2028,42 @@ agentCommand.command("default [name]").description("Get or set default agent").a
|
|
|
2017
2028
|
process.exit(1);
|
|
2018
2029
|
}
|
|
2019
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
|
+
});
|
|
2020
2067
|
|
|
2021
2068
|
// src/commands/start.ts
|
|
2022
2069
|
import { Command as Command5 } from "commander";
|
|
@@ -3623,4 +3670,4 @@ program.action(() => {
|
|
|
3623
3670
|
export {
|
|
3624
3671
|
program
|
|
3625
3672
|
};
|
|
3626
|
-
//# sourceMappingURL=chunk-
|
|
3673
|
+
//# sourceMappingURL=chunk-52NWSTTE.js.map
|