@a3t/rapid 0.1.8 → 0.1.10

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
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  program
4
- } from "./chunk-VWXN2TG5.js";
4
+ } from "./chunk-3NWIUIFI.js";
5
5
 
6
6
  // src/bin.ts
7
7
  program.parse(process.argv);
@@ -287,13 +287,13 @@ function getDevContainerConfig(detected, usePrebuilt = false) {
287
287
  const baseFeatures = {
288
288
  "ghcr.io/devcontainers/features/git:1": {},
289
289
  "ghcr.io/devcontainers-contrib/features/direnv:1": {},
290
- "ghcr.io/devcontainers-contrib/features/starship:1": {},
291
- "ghcr.io/devcontainers-contrib/features/1password-cli:1": {}
290
+ "ghcr.io/devcontainers-contrib/features/starship:1": {}
292
291
  };
293
292
  const containerEnv = {
294
293
  OP_SERVICE_ACCOUNT_TOKEN: "${localEnv:OP_SERVICE_ACCOUNT_TOKEN}"
295
294
  };
296
- const postCreateBase = "npm install -g @anthropic-ai/claude-code && curl -fsSL https://opencode.ai/install | bash";
295
+ const install1PasswordCli = "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";
296
+ const postCreateBase = `${install1PasswordCli} && npm install -g @anthropic-ai/claude-code && curl -fsSL https://opencode.ai/install | bash`;
297
297
  const postStartCommand = "direnv allow 2>/dev/null || true";
298
298
  const language = detected?.language || "unknown";
299
299
  const templateName = language === "javascript" ? "typescript" : language === "unknown" ? "universal" : language;
@@ -1071,6 +1071,16 @@ async function isRunning(name = RAPID_LIMA_INSTANCE) {
1071
1071
  const instance = await getInstance(name);
1072
1072
  return instance?.status === "Running";
1073
1073
  }
1074
+ function insertProjectMount(config, projectDir) {
1075
+ const projectMount = ` - location: "${projectDir}"
1076
+ writable: true
1077
+ `;
1078
+ const homeMountRegex = /mounts:\s*\n(\s*- location: ['"]~['"]\n(?:\s{2,}[^-][^\n]*\n)*)/;
1079
+ return config.replace(homeMountRegex, (_match, homeMount) => {
1080
+ return `mounts:
1081
+ ${homeMount}${projectMount}`;
1082
+ });
1083
+ }
1074
1084
  async function createLimaConfig(projectDir, options = {}) {
1075
1085
  const templatePath = getLimaTemplatePath();
1076
1086
  const configDir = RAPID_LIMA_DIR;
@@ -1083,14 +1093,7 @@ async function createLimaConfig(projectDir, options = {}) {
1083
1093
  template = getMinimalLimaConfig();
1084
1094
  }
1085
1095
  let config = template;
1086
- const projectMount = `
1087
- - location: "${projectDir}"
1088
- writable: true`;
1089
- config = config.replace(
1090
- /mounts:\s*\n\s*- location: "~"/,
1091
- `mounts:
1092
- - location: "~"${projectMount}`
1093
- );
1096
+ config = insertProjectMount(config, projectDir);
1094
1097
  if (options.cpus) {
1095
1098
  config = config.replace(/cpus: \d+/, `cpus: ${options.cpus}`);
1096
1099
  }
@@ -1112,9 +1115,12 @@ ${envLines}
1112
1115
  function getMinimalLimaConfig() {
1113
1116
  return `
1114
1117
  vmType: "vz"
1115
- rosetta:
1116
- enabled: true
1117
- binfmt: true
1118
+ vmOpts:
1119
+ vz:
1120
+ rosetta:
1121
+ enabled: true
1122
+ binfmt: true
1123
+
1118
1124
  cpus: 4
1119
1125
  memory: "8GiB"
1120
1126
  disk: "50GiB"
@@ -1948,6 +1954,7 @@ var statusCommand = new Command3("status").description("Show environment status"
1948
1954
  });
1949
1955
 
1950
1956
  // src/commands/agent.ts
1957
+ import { writeFile as writeFile4 } from "fs/promises";
1951
1958
  import { Command as Command4 } from "commander";
1952
1959
  import { loadConfig as loadConfig3, checkAllAgents as checkAllAgents2, logger as logger4 } from "@a3t/rapid-core";
1953
1960
  var agentCommand = new Command4("agent").description("Manage AI agents");
@@ -2002,8 +2009,9 @@ agentCommand.command("default [name]").description("Get or set default agent").a
2002
2009
  });
2003
2010
  process.exit(1);
2004
2011
  }
2005
- logger4.warn("Setting default agent requires editing rapid.json");
2006
- logger4.info(`Set "agents.default" to "${name}" in your rapid.json`);
2012
+ config.agents.default = name;
2013
+ await writeFile4(loaded.filepath, JSON.stringify(config, null, 2) + "\n");
2014
+ logger4.success(`Default agent set to "${name}"`);
2007
2015
  } catch (error) {
2008
2016
  logger4.error(error instanceof Error ? error.message : String(error));
2009
2017
  process.exit(1);
@@ -2682,7 +2690,7 @@ authCommand.command("env").description("Show environment variables for detected
2682
2690
 
2683
2691
  // src/commands/mcp.ts
2684
2692
  import { Command as Command9 } from "commander";
2685
- import { writeFile as writeFile4 } from "fs/promises";
2693
+ import { writeFile as writeFile5 } from "fs/promises";
2686
2694
  import { join as join5 } from "path";
2687
2695
  import {
2688
2696
  loadConfig as loadConfig7,
@@ -2705,7 +2713,7 @@ var mcpCommand = new Command9("mcp").description(
2705
2713
  );
2706
2714
  async function saveConfig(rootDir, config) {
2707
2715
  const configPath = join5(rootDir, "rapid.json");
2708
- await writeFile4(configPath, JSON.stringify(config, null, 2) + "\n", "utf-8");
2716
+ await writeFile5(configPath, JSON.stringify(config, null, 2) + "\n", "utf-8");
2709
2717
  }
2710
2718
  mcpCommand.command("list").description("List configured MCP servers").option("--json", "Output as JSON").option("--templates", "Show available templates instead of configured servers").action(async (options) => {
2711
2719
  try {
@@ -3615,4 +3623,4 @@ program.action(() => {
3615
3623
  export {
3616
3624
  program
3617
3625
  };
3618
- //# sourceMappingURL=chunk-VWXN2TG5.js.map
3626
+ //# sourceMappingURL=chunk-3NWIUIFI.js.map