omp-mode-switch 1.1.0 → 1.4.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/package.json +5 -17
  2. package/postinstall.js +22 -0
package/package.json CHANGED
@@ -1,33 +1,21 @@
1
1
  {
2
2
  "name": "omp-mode-switch",
3
- "version": "1.1.0",
3
+ "version": "1.4.0",
4
4
  "description": "OMP plugin: switch between ask / auto / plan permission modes with Tab key",
5
5
  "type": "module",
6
6
  "main": "mode-switch.ts",
7
- "scripts": {},
8
- "files": [
9
- "mode-switch.ts",
10
- "README.md",
11
- "LICENSE"
12
- ],
7
+ "scripts": {
8
+ "postinstall": "node postinstall.js"
9
+ },
13
10
  "omp": {
14
11
  "name": "Mode Switch",
15
- "description": "Switch between ask / auto / plan permission modes with Tab key",
16
- "version": "1.0.1",
17
- "author": "xinhaojin",
18
- "extensions": {
19
- "mode-switch": {
20
- "description": "Mode Switch extension - permission mode toggle",
21
- "main": "mode-switch.ts"
22
- }
23
- }
12
+ "description": "Switch permission modes (ask/auto/plan) with Tab key"
24
13
  },
25
14
  "keywords": [
26
15
  "omp",
27
16
  "plugin",
28
17
  "mode",
29
18
  "permission",
30
- "security",
31
19
  "ask",
32
20
  "auto",
33
21
  "plan",
package/postinstall.js ADDED
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Post-install script: copies mode-switch.ts to ~/.omp/agent/extensions/
4
+ * Runs after `omp plugin install` or `npm install`
5
+ */
6
+ const fs = require("fs");
7
+ const path = require("path");
8
+ const os = require("os");
9
+
10
+ const extDir = path.join(os.homedir(), ".omp", "agent", "extensions");
11
+ const source = path.join(__dirname, "mode-switch.ts");
12
+ const dest = path.join(extDir, "mode-switch.ts");
13
+
14
+ try {
15
+ if (!fs.existsSync(extDir)) {
16
+ fs.mkdirSync(extDir, { recursive: true });
17
+ }
18
+ fs.copyFileSync(source, dest);
19
+ console.log("✓ mode-switch.ts installed to " + dest);
20
+ } catch (err) {
21
+ console.error("⚠ Failed to install extension: " + err.message);
22
+ }