opencode-agent-modes 0.1.0 → 0.1.2
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/README.md +1 -1
- package/dist/config/command-installer.d.ts +34 -0
- package/dist/config/index.d.ts +1 -0
- package/dist/index.js +1333 -1621
- package/package.json +2 -3
- package/dist/postinstall.js +0 -20
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-agent-modes",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "OpenCode plugin to switch agent modes between performance and economy presets",
|
|
5
5
|
"module": "src/index.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -24,14 +24,13 @@
|
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
26
|
"typecheck": "tsc --noEmit",
|
|
27
|
-
"build": "bun build src/index.ts --outdir dist --format esm
|
|
27
|
+
"build": "bun build src/index.ts --outdir dist --format esm --target bun && tsc -p tsconfig.build.json",
|
|
28
28
|
"lint": "bunx biome check src/",
|
|
29
29
|
"format": "prettier --write 'src/**/*.ts'",
|
|
30
30
|
"format:check": "prettier --check 'src/**/*.ts'",
|
|
31
31
|
"test": "bun test",
|
|
32
32
|
"test:watch": "bun test --watch",
|
|
33
33
|
"test:coverage": "bun test --coverage",
|
|
34
|
-
"postinstall": "node dist/postinstall.js",
|
|
35
34
|
"prepublishOnly": "bun run build"
|
|
36
35
|
},
|
|
37
36
|
"keywords": [
|
package/dist/postinstall.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
// scripts/postinstall.ts
|
|
4
|
-
import { copyFileSync, mkdirSync, readdirSync } from "node:fs";
|
|
5
|
-
import { homedir } from "node:os";
|
|
6
|
-
import { dirname, join } from "node:path";
|
|
7
|
-
import { fileURLToPath } from "node:url";
|
|
8
|
-
var __dirname2 = dirname(fileURLToPath(import.meta.url));
|
|
9
|
-
var COMMANDS_SRC = join(__dirname2, "..", "commands");
|
|
10
|
-
var COMMANDS_DEST = join(homedir(), ".config", "opencode", "command");
|
|
11
|
-
try {
|
|
12
|
-
mkdirSync(COMMANDS_DEST, { recursive: true });
|
|
13
|
-
const files = readdirSync(COMMANDS_SRC).filter((f) => f.endsWith(".md"));
|
|
14
|
-
for (const file of files) {
|
|
15
|
-
copyFileSync(join(COMMANDS_SRC, file), join(COMMANDS_DEST, file));
|
|
16
|
-
}
|
|
17
|
-
console.log(`[opencode-agent-modes] Copied ${files.length} command files to ${COMMANDS_DEST}`);
|
|
18
|
-
} catch (error) {
|
|
19
|
-
console.warn("[opencode-agent-modes] Warning: Could not copy command files:", error);
|
|
20
|
-
}
|