oh-my-opencode-cohub 1.0.13 → 1.0.15

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
@@ -16,15 +16,35 @@ OpenCode 中文智能体编排插件 CoHub——纯调度模式、全中文提
16
16
  - 📜 **AGENTS.md 全覆盖**:项目级和用户级 AGENTS.md 对**本插件所有代理**(内置 8 个 + 插件 4 个)均生效,无需额外配置
17
17
  - 📖 **架构借鉴**:插件架构和代理编排理念借鉴了 oh-my-opencode-slim,但完全独立实现、无运行时依赖
18
18
 
19
- ## 快速开始
19
+ ## 安装
20
20
 
21
- ### 安装
21
+ ### 前置条件
22
+
23
+ - [OpenCode](https://opencode.ai) 已安装
24
+ - 推荐安装 [Bun](https://bun.sh)(CLI 一键安装需要)
25
+
26
+ ### 方式一:CLI 一键安装(推荐)
27
+
28
+ ```bash
29
+ bunx oh-my-opencode-cohub install
30
+ ```
31
+
32
+ CLI 会自动完成以下操作:
33
+
34
+ 1. 将 `oh-my-opencode-cohub` 注册到 `~/.config/opencode/opencode.json` 的 `plugin` 数组
35
+ 2. 将插件注册到 TUI 配置 `~/.config/opencode/tui.json`
36
+ 3. 在 `opencode.json` 的 `agent` 字段中注册全部 12 个 `co-*` 代理
37
+ 4. 写入默认配置文件 `~/.config/opencode/oh-my-opencode-cohub.json`
38
+
39
+ 重启 OpenCode 即可生效。
40
+
41
+ ### 方式二:npm 安装 + 手动配置
22
42
 
23
43
  ```bash
24
44
  npm install oh-my-opencode-cohub
25
45
  ```
26
46
 
27
- ### 配置 opencode.json
47
+ 然后在 `~/.config/opencode/opencode.json` 中添加:
28
48
 
29
49
  ```json
30
50
  {
@@ -32,15 +52,25 @@ npm install oh-my-opencode-cohub
32
52
  }
33
53
  ```
34
54
 
35
- 重启 OpenCode 即可。12 个代理自动注册,中文语言要求自动注入。
55
+ 重启 OpenCode 即可。
56
+
57
+ ### 卸载
58
+
59
+ ```bash
60
+ bunx oh-my-opencode-cohub uninstall
61
+ ```
62
+
63
+ CLI 会精确清理所有 `co-*` 代理和相关配置,不影响其他插件的配置数据。
64
+
65
+ 如果使用 npm 手动安装,则需手动从 `opencode.json` 的 `plugin` 数组中移除 `"oh-my-opencode-cohub"`,然后 `npm uninstall oh-my-opencode-cohub`。
66
+
67
+ ### 验证安装
36
68
 
37
- ### 使用方式
69
+ 安装并重启 OpenCode 后,确认以下效果:
38
70
 
39
- 安装后,OpenCode 会自动:
40
- - 加载中文代理提示词
41
- - 注册 4 个插件代理:@rule-user、@rule-project、@rule-app、@planner
42
- - 注入中文语言要求
43
- - 所有代理(包括 @rule-user、@rule-project、@rule-app、@planner)自动继承项目级和用户级 AGENTS.md 规则
71
+ - 对话中自动出现 **中文语言要求**(如 "你必须始终使用中文进行思考、推理和回复")
72
+ - 可用代理列表中出现 12 个 `co-*` 前缀代理(`co-orchestrator`、`co-oracle`、`co-librarian`、`co-explorer`、`co-designer`、`co-fixer`、`co-observer`、`co-council`、`co-rule-user`、`co-rule-project`、`co-rule-app`、`co-planner`)
73
+ - Orchestrator 自动进入纯调度模式(只做规划、委派、验证,不直接操作文件)
44
74
 
45
75
  ## 代理一览
46
76
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAqClD,wBAAwB;AACxB,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAalD,CAAC;AAwEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,wrBAA+B,CAAC;AAEhE,QAAA,MAAM,WAAW,EAAE,MA2MlB,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAqClD,wBAAwB;AACxB,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAalD,CAAC;AAwEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,wrBAA+B,CAAC;AAEhE,QAAA,MAAM,WAAW,EAAE,MAqNlB,CAAC;AAEF,eAAe,WAAW,CAAC"}
package/dist/index.js CHANGED
@@ -660,7 +660,9 @@ var CoHubPlugin = async (input, options) => {
660
660
  const agents = [
661
661
  {
662
662
  name: "co-orchestrator",
663
- config: { mode: "primary", model: "deepseek/deepseek-v4-pro", variant: "max", prompt: "你是 CoHub 纯调度者。用中文回复。" }
663
+ config: { mode: "primary", model: "deepseek/deepseek-v4-pro", variant: "max", prompt: ORCHESTRATOR_PROMPT + `
664
+
665
+ ` + CHINESE_LANGUAGE_INSTRUCTION }
664
666
  },
665
667
  {
666
668
  name: "co-oracle",
@@ -730,17 +732,22 @@ var CoHubPlugin = async (input, options) => {
730
732
  }
731
733
  }
732
734
  syncAgentConfig();
735
+ const agentConfigs = {};
736
+ for (const agent of agents) {
737
+ agentConfigs[agent.name] = {
738
+ ...agent.config,
739
+ name: agent.name,
740
+ description: agent.description
741
+ };
742
+ }
733
743
  return {
734
744
  name: "oh-my-opencode-cohub",
745
+ agent: agentConfigs,
735
746
  config: async (cfg) => {
736
747
  const c = cfg;
737
748
  c.agent ??= {};
738
- for (const agent of agents) {
739
- c.agent[agent.name] = {
740
- ...agent.config,
741
- name: agent.name,
742
- description: agent.description
743
- };
749
+ for (const [name, config] of Object.entries(agentConfigs)) {
750
+ c.agent[name] = config;
744
751
  }
745
752
  try {
746
753
  fs2.writeFileSync(path2.join(STATE_DIR, "config-hook-ran.json"), JSON.stringify({ ran: true, count: agents.length }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-opencode-cohub",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
4
4
  "description": "OpenCode 中文智能体编排插件 CoHub - 纯调度模式 / 全中文提示词 / 规范分析代理 / 方案制定代理 / 独立运行",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",