@burdenoff/vibe-plugin-ai 2.0.0 → 2.1.0

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.
Files changed (2) hide show
  1. package/dist/index.js +16 -8
  2. package/package.json +2 -1
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // @bun
2
2
  // src/index.ts
3
- import { existsSync, mkdirSync, writeFileSync } from "fs";
3
+ import { mkdirSync } from "fs";
4
4
  import { join } from "path";
5
5
  var AI_TOOLS = [
6
6
  {
@@ -69,7 +69,13 @@ function runInstallCommand(command) {
69
69
  return proc.exitCode === 0;
70
70
  }
71
71
  function findConfigFiles(tool, directory) {
72
- return tool.configFiles.filter((f) => existsSync(join(directory, f)));
72
+ return tool.configFiles.filter((f) => {
73
+ try {
74
+ return Bun.file(join(directory, f)).size > 0;
75
+ } catch {
76
+ return false;
77
+ }
78
+ });
73
79
  }
74
80
  var vibePlugin = {
75
81
  name: "ai",
@@ -128,7 +134,7 @@ var vibePlugin = {
128
134
  process.exit(1);
129
135
  }
130
136
  });
131
- aiCmd.command("init").description("Initialize AI tool config in the current project").argument("<tool>", "Tool name").option("--cwd <dir>", "Project directory", process.cwd()).action((toolName, options) => {
137
+ aiCmd.command("init").description("Initialize AI tool config in the current project").argument("<tool>", "Tool name").option("--cwd <dir>", "Project directory", process.cwd()).action(async (toolName, options) => {
132
138
  const tool = AI_TOOLS.find((t) => t.name === toolName);
133
139
  if (!tool) {
134
140
  console.error(`\x1B[31mError:\x1B[0m Unknown tool '${toolName}'. Available: ${AI_TOOLS.map((t) => t.name).join(", ")}`);
@@ -137,17 +143,19 @@ var vibePlugin = {
137
143
  const dir = options.cwd;
138
144
  const primaryConfig = tool.configFiles[0];
139
145
  const configPath = join(dir, primaryConfig);
140
- if (existsSync(configPath)) {
141
- console.log(` \x1B[33m\u26A0\x1B[0m ${primaryConfig} already exists in ${dir}`);
142
- return;
143
- }
146
+ try {
147
+ if (Bun.file(configPath).size >= 0) {
148
+ console.log(` \x1B[33m\u26A0\x1B[0m ${primaryConfig} already exists in ${dir}`);
149
+ return;
150
+ }
151
+ } catch {}
144
152
  const segments = primaryConfig.split("/");
145
153
  if (segments.length > 1) {
146
154
  const parentDir = join(dir, ...segments.slice(0, -1));
147
155
  mkdirSync(parentDir, { recursive: true });
148
156
  }
149
157
  const content = generateStarterConfig(tool);
150
- writeFileSync(configPath, content);
158
+ await Bun.write(configPath, content);
151
159
  console.log(`
152
160
  \x1B[32m\u2713 Created ${primaryConfig}\x1B[0m in ${dir}
153
161
  `);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/vibe-plugin-ai",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "main": "./dist/index.js",
5
5
  "type": "module",
6
6
  "engines": {
@@ -38,6 +38,7 @@
38
38
  "description": "AI tool management plugin for VibeControls Agent — manage Claude Code, OpenCode, Codex, Copilot, and more (Bun runtime)",
39
39
  "devDependencies": {
40
40
  "@types/bun": "^1.2.16",
41
+ "bun-types": "^1.3.9",
41
42
  "commander": "^14.0.3",
42
43
  "eslint": "^9.30.1",
43
44
  "prettier": "^3.6.2",