omp-mode-switch 1.4.0 → 1.5.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.
package/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # omp-mode-switch
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/omp-mode-switch)](https://www.npmjs.com/package/omp-mode-switch)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+
3
6
  An OMP plugin that lets you switch between three permission modes at runtime. Press **Tab** to cycle, or use `/mode <ask|auto|plan>`.
4
7
 
5
8
  ---
@@ -20,6 +23,24 @@ omp plugin install https://github.com/xinhaojin/omp-mode-switch.git
20
23
 
21
24
  Restart OMP (or start a new session) to activate.
22
25
 
26
+ ## Verify installation
27
+
28
+ After install and restart, you should see:
29
+
30
+ ```
31
+ ✓ Mode Switch loaded
32
+ Tab: ASK → AUTO → PLAN → ASK
33
+ /mode <ask|auto|plan>
34
+ ```
35
+
36
+ Press **Tab** — the mode indicator should appear at the bottom of the editor area, cycling through ASK (yellow), AUTO (green), PLAN (cyan).
37
+
38
+ Check that the extension file exists:
39
+
40
+ ```bash
41
+ ls ~/.omp/agent/extensions/mode-switch.ts
42
+ ```
43
+
23
44
  ## Usage
24
45
 
25
46
  ### Modes
package/README.zh-CN.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # omp-mode-switch
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/omp-mode-switch)](https://www.npmjs.com/package/omp-mode-switch)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+
3
6
  一个 OMP 插件,让你在运行中切换三种权限模式。按 **Tab** 键循环切换,或使用 `/mode <ask|auto|plan>` 命令。
4
7
 
5
8
  ---
@@ -20,6 +23,24 @@ omp plugin install https://github.com/xinhaojin/omp-mode-switch.git
20
23
 
21
24
  重启 OMP(或新建会话)即可生效。
22
25
 
26
+ ## 验证安装
27
+
28
+ 安装并重启后,终端应显示加载信息:
29
+
30
+ ```
31
+ ✓ Mode Switch loaded
32
+ Tab: ASK → AUTO → PLAN → ASK
33
+ /mode <ask|auto|plan>
34
+ ```
35
+
36
+ 按 **Tab** 键,编辑器底部会出现彩色模式指示器,依次切换 ASK(黄)、AUTO(绿)、PLAN(蓝青)。
37
+
38
+ 检查扩展文件是否存在:
39
+
40
+ ```bash
41
+ ls ~/.omp/agent/extensions/mode-switch.ts
42
+ ```
43
+
23
44
  ## 使用方法
24
45
 
25
46
  ### 模式
package/mode-switch.ts CHANGED
@@ -145,4 +145,7 @@ export default function modeSwitch(pi: ExtensionAPI) {
145
145
  showWidget(ctx);
146
146
  pi.setActiveTools(pi.getAllTools());
147
147
  });
148
+ console.log("✓ Mode Switch loaded");
149
+ console.log(" Tab: ASK → AUTO → PLAN → ASK");
150
+ console.log(" /mode <ask|auto|plan>");
148
151
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omp-mode-switch",
3
- "version": "1.4.0",
3
+ "version": "1.5.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",
package/postinstall.js CHANGED
@@ -1,8 +1,3 @@
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
1
  const fs = require("fs");
7
2
  const path = require("path");
8
3
  const os = require("os");
@@ -14,9 +9,13 @@ const dest = path.join(extDir, "mode-switch.ts");
14
9
  try {
15
10
  if (!fs.existsSync(extDir)) {
16
11
  fs.mkdirSync(extDir, { recursive: true });
12
+ console.log("✓ Created " + extDir);
17
13
  }
18
14
  fs.copyFileSync(source, dest);
19
- console.log("✓ mode-switch.ts installed to " + dest);
15
+ console.log("✓ Installed: " + dest);
16
+ console.log(" Restart OMP to activate.");
20
17
  } catch (err) {
21
- console.error("⚠ Failed to install extension: " + err.message);
18
+ console.error("⚠ Could not auto-install. Run this manually:");
19
+ console.error(" mkdir " + extDir);
20
+ console.error(" copy " + source + " " + dest);
22
21
  }