@ranger1/dx 0.1.19 → 0.1.20

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.
@@ -32,8 +32,7 @@ echo "agent-browser:" && (which agent-browser && agent-browser --version 2>/dev/
32
32
  # 批次 2: 项目文件检测
33
33
  echo "=== PROJECT_FILES ===";
34
34
  echo "AGENTS.md:" && (test -f AGENTS.md && echo "FOUND" || echo "NOT_FOUND");
35
- echo "opencode.json:" && (test -f opencode.json && echo "CONFIGURED" || echo "NOT_FOUND");
36
- echo "instructions:" && (if [ -f opencode.json ]; then grep -q '"AGENTS.md"' opencode.json && grep -q '"ruler/' opencode.json && echo "VALID" || echo "INVALID"; else echo "SKIP"; fi);
35
+ echo "instructions:" && (grep -q '"AGENTS.md"' ~/.config/opencode/opencode.json 2>/dev/null && grep -q '"ruler/' ~/.config/opencode/opencode.json 2>/dev/null && echo "CONFIGURED" || echo "NOT_CONFIGURED");
37
36
  ```
38
37
 
39
38
  ```bash
@@ -60,19 +59,18 @@ echo "agent.middle:" && (grep -Eq '"agent"[[:space:]]*:' ~/.config/opencode/open
60
59
  汇总结果,输出表格:
61
60
 
62
61
  ```
63
- 工具 | 状态 | 版本
64
- opencode | <状态> | <版本>
65
- dx | <状态> | <版本>
66
- AGENTS.md | <状态> | -
67
- opencode.json | <状态> | -
68
- 配置指令 | <状态> | -
69
- oh-my-opencode | <状态> | -
70
- opencode-openai-codex-auth | <状态> | -
71
- agent-browser | <状态> | <版本>
72
- sisyphus_agent 配置 | <状态> | -
73
- agents.sisyphus.variant 配置 | <状态> | -
74
- agent.quick 配置 | <状态> | -
75
- agent.middle 配置 | <状态> | -
62
+ 工具 | 状态 | 版本
63
+ opencode | <状态> | <版本>
64
+ dx | <状态> | <版本>
65
+ AGENTS.md | <状态> | -
66
+ 全局 instructions 配置 | <状态> | -
67
+ oh-my-opencode 插件 | <状态> | -
68
+ opencode-openai-codex-auth 插件 | <状态> | -
69
+ agent-browser | <状态> | <版本>
70
+ 全局 sisyphus_agent 配置 | <状态> | -
71
+ 全局 agents.sisyphus.variant 配置 | <状态> | -
72
+ 全局 agent.quick 配置 | <状态> | -
73
+ 全局 agent.middle 配置 | <状态> | -
76
74
  ```
77
75
 
78
76
  ---
@@ -100,12 +98,19 @@ brew install opencode || npm install -g opencode
100
98
 
101
99
  - AGENTS.md 文件不存在,OpenCode 需要此文件作为项目指令入口
102
100
  - 建议创建或检查文件路径
101
+ - AGENTS.md 应位于项目根目录,并在全局 `~/.config/opencode/opencode.json` 的 `instructions` 中引用
103
102
 
104
- ### 3.3 opencode.json 未配置
103
+ ### 3.3 全局 opencode.json instructions 配置缺失
105
104
 
106
- 使用 Write 工具创建配置文件:
105
+ **注意:instructions 配置应在全局配置文件 `~/.config/opencode/opencode.json` 中,而非项目根目录。项目根目录不需要 opencode.json 文件。**
107
106
 
108
- 文件路径:`<项目根目录>/opencode.json`
107
+ 1. 先读取现有全局配置:
108
+
109
+ ```bash
110
+ cat ~/.config/opencode/opencode.json
111
+ ```
112
+
113
+ 2. 使用 Edit 工具在 `~/.config/opencode/opencode.json` 中添加或修改 `instructions` 配置:
109
114
 
110
115
  ```json
111
116
  {
@@ -114,24 +119,24 @@ brew install opencode || npm install -g opencode
114
119
  }
115
120
  ```
116
121
 
117
- ### 3.4 配置指令无效
122
+ ### 3.4 全局配置指令无效
118
123
 
119
- 使用 Edit 工具修复 opencode.json,确保包含:
124
+ 使用 Edit 工具修复 `~/.config/opencode/opencode.json`,确保包含:
120
125
 
121
126
  - `"AGENTS.md"`: 主配置文件
122
127
  - `"ruler/**/*.md"`: 自动加载 ruler 目录下所有 .md 文件(因 OpenCode 不支持 @ 引用)
123
128
 
124
- ### 3.5 OpenCode 插件安装
129
+ ### 3.5 全局 OpenCode 插件安装
125
130
 
126
- **OpenCode 插件通过编辑 `~/.config/opencode/opencode.json` 的 `plugin` 数组安装。**
131
+ **注意:OpenCode 插件配置应在全局配置文件 `~/.config/opencode/opencode.json` 中,而非项目根目录。**
127
132
 
128
- 1. 先读取现有配置:
133
+ 1. 先读取现有全局配置:
129
134
 
130
135
  ```bash
131
136
  cat ~/.config/opencode/opencode.json
132
137
  ```
133
138
 
134
- 2. 使用 Edit 工具在 `plugin` 数组中添加缺失的插件:
139
+ 2. 使用 Edit 工具在 `~/.config/opencode/opencode.json` 的 `plugin` 数组中添加缺失的插件:
135
140
  - `oh-my-opencode`
136
141
  - `opencode-openai-codex-auth`
137
142
 
@@ -158,11 +163,11 @@ grep -E 'oh-my-opencode|opencode-openai-codex-auth' ~/.config/opencode/opencode.
158
163
  npm install -g agent-browser && agent-browser install
159
164
  ```
160
165
 
161
- ### 3.7 oh-my-opencode.json 配置缺失
166
+ ### 3.7 全局 oh-my-opencode.json 配置缺失
162
167
 
163
- **检查并修复 `~/.config/opencode/oh-my-opencode.json` 配置。**
168
+ **注意:oh-my-opencode 配置应在全局配置文件 `~/.config/opencode/oh-my-opencode.json` 中,而非项目根目录。**
164
169
 
165
- 1. 先读取现有配置:
170
+ 1. 先读取现有全局配置:
166
171
 
167
172
  ```bash
168
173
  cat ~/.config/opencode/oh-my-opencode.json
@@ -211,7 +216,9 @@ grep -q '"sisyphus_agent"' ~/.config/opencode/oh-my-opencode.json && echo "✅ s
211
216
  node -e "const fs=require('node:fs');const os=require('node:os');const p=os.homedir()+'/.config/opencode/oh-my-opencode.json';const j=JSON.parse(fs.readFileSync(p,'utf8'));console.log(j?.agents?.sisyphus?.variant||'MISSING');process.exit(j?.agents?.sisyphus?.variant==='none'?0:1)" && echo "✅ agents.sisyphus.variant=none" || echo "❌ agents.sisyphus.variant 不是 none"
212
217
  ```
213
218
 
214
- ### 3.8 opencode.json agent 配置缺失
219
+ ### 3.8 全局 opencode.json agent 配置缺失
220
+
221
+ **注意:agent 配置应在全局配置文件 `~/.config/opencode/opencode.json` 中,而非项目根目录。**
215
222
 
216
223
  如果 `~/.config/opencode/opencode.json` 缺少 `agent.quick` 或 `agent.middle`,使用 Edit 工具添加:
217
224
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ranger1/dx",
3
- "version": "0.1.19",
3
+ "version": "0.1.20",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {