chutes-plugin 0.1.6 → 0.1.7
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/cli/index.js +16 -18
- package/package.json +1 -1
- package/src/cli/doctor.ts +3 -4
- package/src/cli/install.ts +10 -11
- package/src/cli/status.ts +3 -4
package/dist/cli/index.js
CHANGED
|
@@ -24,22 +24,22 @@ async function install() {
|
|
|
24
24
|
console.log(`\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
|
|
25
25
|
`);
|
|
26
26
|
const projectDir = process.cwd();
|
|
27
|
-
const pluginDir = path.join(projectDir, ".opencode", "plugin"
|
|
27
|
+
const pluginDir = path.join(projectDir, ".opencode", "plugin");
|
|
28
|
+
const pluginFile = path.join(pluginDir, "chutes-plugin.js");
|
|
28
29
|
console.log(`Installing chutes-plugin to project...
|
|
29
30
|
`);
|
|
30
|
-
console.log(`Copying plugin
|
|
31
|
+
console.log(`Copying plugin to .opencode/plugin/
|
|
31
32
|
`);
|
|
32
33
|
fs.mkdirSync(pluginDir, { recursive: true });
|
|
33
|
-
const
|
|
34
|
-
if (fs.existsSync(
|
|
35
|
-
fs.
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
fs.cpSync(srcCliDir, path.join(pluginDir, "src"), { recursive: true });
|
|
34
|
+
const distFile = path.join(__dirname, "..", "..", "dist", "index.js");
|
|
35
|
+
if (fs.existsSync(distFile)) {
|
|
36
|
+
fs.copyFileSync(distFile, pluginFile);
|
|
37
|
+
} else {
|
|
38
|
+
console.error('\u274C Error: dist/index.js not found. Run "bun run build" first.');
|
|
39
|
+
process.exit(1);
|
|
40
40
|
}
|
|
41
41
|
console.log("\u2705 Successfully installed!");
|
|
42
|
-
console.log(` Location: ${
|
|
42
|
+
console.log(` Location: ${pluginFile}`);
|
|
43
43
|
console.log(`
|
|
44
44
|
\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
|
|
45
45
|
`);
|
|
@@ -70,12 +70,11 @@ async function status() {
|
|
|
70
70
|
console.log(`\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
|
|
71
71
|
`);
|
|
72
72
|
const projectDir = process.cwd();
|
|
73
|
-
const
|
|
74
|
-
const
|
|
75
|
-
const hasPlugin = fs2.existsSync(distFile);
|
|
73
|
+
const pluginFile = path2.join(projectDir, ".opencode", "plugin", "chutes-plugin.js");
|
|
74
|
+
const hasPlugin = fs2.existsSync(pluginFile);
|
|
76
75
|
console.log(`Plugin installed: ${hasPlugin ? "\u2705 Yes" : "\u274C No"}`);
|
|
77
76
|
if (hasPlugin) {
|
|
78
|
-
console.log(`Location: ${
|
|
77
|
+
console.log(`Location: ${pluginFile}`);
|
|
79
78
|
} else {
|
|
80
79
|
console.log(`
|
|
81
80
|
To install:`);
|
|
@@ -214,12 +213,11 @@ async function doctor() {
|
|
|
214
213
|
}
|
|
215
214
|
}
|
|
216
215
|
const projectDir = process.cwd();
|
|
217
|
-
const
|
|
218
|
-
const
|
|
219
|
-
const hasPlugin = fs3.existsSync(distFile);
|
|
216
|
+
const pluginFile = path3.join(projectDir, ".opencode", "plugin", "chutes-plugin.js");
|
|
217
|
+
const hasPlugin = fs3.existsSync(pluginFile);
|
|
220
218
|
console.log(`Installation Checks:
|
|
221
219
|
`);
|
|
222
|
-
check("Plugin installed", hasPlugin, hasPlugin ? `Location: ${
|
|
220
|
+
check("Plugin installed", hasPlugin, hasPlugin ? `Location: ${pluginFile}` : "Run: bunx chutes-plugin install");
|
|
223
221
|
console.log(`
|
|
224
222
|
API Checks:
|
|
225
223
|
`);
|
package/package.json
CHANGED
package/src/cli/doctor.ts
CHANGED
|
@@ -20,15 +20,14 @@ export async function doctor(): Promise<void> {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
const projectDir = process.cwd();
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const hasPlugin = fs.existsSync(distFile);
|
|
23
|
+
const pluginFile = path.join(projectDir, '.opencode', 'plugin', 'chutes-plugin.js');
|
|
24
|
+
const hasPlugin = fs.existsSync(pluginFile);
|
|
26
25
|
|
|
27
26
|
console.log('Installation Checks:\n');
|
|
28
27
|
check(
|
|
29
28
|
'Plugin installed',
|
|
30
29
|
hasPlugin,
|
|
31
|
-
hasPlugin ? `Location: ${
|
|
30
|
+
hasPlugin ? `Location: ${pluginFile}` : 'Run: bunx chutes-plugin install'
|
|
32
31
|
);
|
|
33
32
|
|
|
34
33
|
console.log('\nAPI Checks:\n');
|
package/src/cli/install.ts
CHANGED
|
@@ -6,25 +6,24 @@ export async function install(): Promise<void> {
|
|
|
6
6
|
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n');
|
|
7
7
|
|
|
8
8
|
const projectDir = process.cwd();
|
|
9
|
-
const pluginDir = path.join(projectDir, '.opencode', 'plugin'
|
|
9
|
+
const pluginDir = path.join(projectDir, '.opencode', 'plugin');
|
|
10
|
+
const pluginFile = path.join(pluginDir, 'chutes-plugin.js');
|
|
10
11
|
|
|
11
12
|
console.log('Installing chutes-plugin to project...\n');
|
|
12
|
-
console.log('Copying plugin
|
|
13
|
+
console.log('Copying plugin to .opencode/plugin/\n');
|
|
13
14
|
|
|
14
15
|
fs.mkdirSync(pluginDir, { recursive: true });
|
|
15
16
|
|
|
16
|
-
const
|
|
17
|
-
if (fs.existsSync(
|
|
18
|
-
fs.
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
if (fs.existsSync(srcCliDir)) {
|
|
23
|
-
fs.cpSync(srcCliDir, path.join(pluginDir, 'src'), { recursive: true });
|
|
17
|
+
const distFile = path.join(__dirname, '..', '..', 'dist', 'index.js');
|
|
18
|
+
if (fs.existsSync(distFile)) {
|
|
19
|
+
fs.copyFileSync(distFile, pluginFile);
|
|
20
|
+
} else {
|
|
21
|
+
console.error('❌ Error: dist/index.js not found. Run "bun run build" first.');
|
|
22
|
+
process.exit(1);
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
console.log('✅ Successfully installed!');
|
|
27
|
-
console.log(` Location: ${
|
|
26
|
+
console.log(` Location: ${pluginFile}`);
|
|
28
27
|
console.log('\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n');
|
|
29
28
|
console.log('Next steps:');
|
|
30
29
|
console.log("1. Restart OpenCode if it's running");
|
package/src/cli/status.ts
CHANGED
|
@@ -6,14 +6,13 @@ export async function status(): Promise<void> {
|
|
|
6
6
|
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n');
|
|
7
7
|
|
|
8
8
|
const projectDir = process.cwd();
|
|
9
|
-
const
|
|
10
|
-
const distFile = path.join(pluginDir, 'dist', 'index.js');
|
|
9
|
+
const pluginFile = path.join(projectDir, '.opencode', 'plugin', 'chutes-plugin.js');
|
|
11
10
|
|
|
12
|
-
const hasPlugin = fs.existsSync(
|
|
11
|
+
const hasPlugin = fs.existsSync(pluginFile);
|
|
13
12
|
|
|
14
13
|
console.log(`Plugin installed: ${hasPlugin ? '✅ Yes' : '❌ No'}`);
|
|
15
14
|
if (hasPlugin) {
|
|
16
|
-
console.log(`Location: ${
|
|
15
|
+
console.log(`Location: ${pluginFile}`);
|
|
17
16
|
} else {
|
|
18
17
|
console.log('\nTo install:');
|
|
19
18
|
console.log(' bunx chutes-plugin install\n');
|