@hiai-gg/hiai-opencode 0.1.4 → 0.1.5
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/AGENTS.md +5 -3
- package/ARCHITECTURE.md +7 -6
- package/README.md +16 -4
- package/config/hiai-opencode.schema.json +71 -148
- package/dist/config/defaults.d.ts +1 -0
- package/dist/config/platform-schema.d.ts +273 -4
- package/dist/config/schema/categories.d.ts +2 -2
- package/dist/config/types.d.ts +21 -2
- package/dist/create-tools.d.ts +2 -0
- package/dist/index.js +577 -342
- package/dist/internals/plugins/websearch-cited/index.d.ts +7 -1
- package/dist/mcp/types.d.ts +1 -1
- package/dist/plugin/tool-registry.d.ts +2 -0
- package/dist/tools/skill-mcp/tools.d.ts +2 -0
- package/hiai-opencode.json +39 -173
- package/package.json +1 -1
- package/src/config/defaults.ts +158 -28
- package/src/config/loader.test.ts +16 -1
- package/src/config/loader.ts +4 -2
- package/src/config/platform-schema.ts +36 -2
- package/src/config/types.ts +33 -2
- package/src/create-tools.ts +4 -1
- package/src/index.ts +39 -1
- package/src/internals/plugins/websearch-cited/index.ts +10 -5
- package/src/lsp/index.ts +1 -0
- package/src/mcp/registry.ts +6 -1
- package/src/plugin/tool-registry.ts +4 -0
- package/src/tools/skill-mcp/tools.ts +45 -7
package/AGENTS.md
CHANGED
|
@@ -213,6 +213,8 @@ The runtime loader is:
|
|
|
213
213
|
|
|
214
214
|
- [src/config/defaults.ts](src/config/defaults.ts)
|
|
215
215
|
|
|
216
|
+
Users configure only the 10 primary agent model slots under `models`: `bob`, `coder`, `strategist`, `guard`, `critic`, `designer`, `researcher`, `manager`, `brainstormer`, and `vision`.
|
|
217
|
+
Hidden agents and task categories are derived internally in `src/config/defaults.ts`.
|
|
216
218
|
Use fully qualified model IDs. Do not introduce local aliases like `hiai-fast`, `sonnet`, `fast`, or `high`.
|
|
217
219
|
|
|
218
220
|
## Change Map
|
|
@@ -221,9 +223,9 @@ Use this table when you need to change something and want the right file immedia
|
|
|
221
223
|
|
|
222
224
|
| Goal | Edit this first | Why |
|
|
223
225
|
|---|---|---|
|
|
224
|
-
| Change
|
|
225
|
-
| Change
|
|
226
|
-
| Change MCP/LSP
|
|
226
|
+
| Change a user-facing default model slot | [hiai-opencode.json](hiai-opencode.json) | This is the canonical model source |
|
|
227
|
+
| Change how categories inherit the 10 model slots | [src/config/defaults.ts](src/config/defaults.ts) | Category routing is internal |
|
|
228
|
+
| Change MCP/LSP user-facing switches | [hiai-opencode.json](hiai-opencode.json) | Users only toggle enabled state there |
|
|
227
229
|
| Change Bob behavior or prompt text | [src/agents/bob.ts](src/agents/bob.ts), `src/agents/bob/*` | Bob prompt authoring lives there |
|
|
228
230
|
| Change Coder behavior or prompt text | `src/agents/coder/*` | Coder prompt authoring lives there |
|
|
229
231
|
| Change Strategist behavior or prompt text | `src/agents/strategist/*` | Strategist prompt authoring lives there |
|
package/ARCHITECTURE.md
CHANGED
|
@@ -62,20 +62,20 @@ Runtime naming, visibility, and compatibility are normalized through:
|
|
|
62
62
|
|
|
63
63
|
### Presets
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
User-facing model IDs live in one place:
|
|
66
66
|
|
|
67
67
|
- [hiai-opencode.json](hiai-opencode.json)
|
|
68
68
|
|
|
69
69
|
### Runtime Defaults
|
|
70
70
|
|
|
71
|
-
The TypeScript defaults loader
|
|
71
|
+
The TypeScript defaults loader derives hidden agents and categories from the 10 user-facing model slots:
|
|
72
72
|
|
|
73
73
|
- [src/config/defaults.ts](src/config/defaults.ts)
|
|
74
74
|
|
|
75
|
-
This is the
|
|
75
|
+
This is the internal routing source for:
|
|
76
76
|
|
|
77
|
-
- agent
|
|
78
|
-
- category
|
|
77
|
+
- hidden agent model inheritance
|
|
78
|
+
- category model inheritance
|
|
79
79
|
- MCP defaults
|
|
80
80
|
- LSP defaults
|
|
81
81
|
- permissions
|
|
@@ -158,7 +158,8 @@ If a prompt change looks correct in source but does not show up correctly in Ope
|
|
|
158
158
|
|
|
159
159
|
Use these rules when editing the prompt layer:
|
|
160
160
|
|
|
161
|
-
- change `hiai-opencode.json` when any
|
|
161
|
+
- change `hiai-opencode.json` when any primary agent model slot should change
|
|
162
|
+
- change `src/config/defaults.ts` when internal category-to-agent-slot routing should change
|
|
162
163
|
- change `src/agents/*` when the prompt content or behavior should change
|
|
163
164
|
- change shared prompt/injection files when the prompt is being appended or normalized after agent construction
|
|
164
165
|
- change `src/plugin-handlers/agent-config-handler.ts` when runtime name, visibility, mode, or final description should change
|
package/README.md
CHANGED
|
@@ -116,10 +116,22 @@ New-Item -ItemType Directory -Force .opencode
|
|
|
116
116
|
Copy-Item .\hiai-opencode.json .\.opencode\hiai-opencode.json
|
|
117
117
|
```
|
|
118
118
|
|
|
119
|
-
If you installed only from npm/OpenCode and do not have this repository checked out, create `.opencode/hiai-opencode.json` with the
|
|
119
|
+
If you installed only from npm/OpenCode and do not have this repository checked out, create `.opencode/hiai-opencode.json` with the shape below and adjust it later.
|
|
120
120
|
|
|
121
121
|
```json
|
|
122
122
|
{
|
|
123
|
+
"models": {
|
|
124
|
+
"bob": { "model": "openrouter/anthropic/claude-3.5-opus", "recommended": "xhigh" },
|
|
125
|
+
"coder": { "model": "openrouter/anthropic/claude-3.5-sonnet", "recommended": "high" },
|
|
126
|
+
"strategist": { "model": "openrouter/z-ai/glm-5.1", "recommended": "high" },
|
|
127
|
+
"guard": { "model": "openrouter/openai/gpt-4o", "recommended": "middle" },
|
|
128
|
+
"critic": { "model": "openrouter/qwen/qwen2.5-72b-instruct", "recommended": "high" },
|
|
129
|
+
"designer": { "model": "openrouter/google/gemini-3.1-pro", "recommended": "design" },
|
|
130
|
+
"researcher": { "model": "openrouter/google/gemini-2.0-flash", "recommended": "fast" },
|
|
131
|
+
"manager": { "model": "openrouter/google/gemini-2.0-flash", "recommended": "fast" },
|
|
132
|
+
"brainstormer": { "model": "openrouter/kimi/kimi-latest", "recommended": "writing" },
|
|
133
|
+
"vision": { "model": "openrouter/google/gemini-3.1-pro", "recommended": "vision" }
|
|
134
|
+
},
|
|
123
135
|
"mcp": {
|
|
124
136
|
"playwright": { "enabled": true },
|
|
125
137
|
"sequential-thinking": { "enabled": true },
|
|
@@ -137,7 +149,7 @@ By default, skill discovery is deterministic: `hiai-opencode` skills plus projec
|
|
|
137
149
|
### 3. Connect models and add service keys
|
|
138
150
|
|
|
139
151
|
Model provider credentials belong to OpenCode Connect, not to `hiai-opencode`.
|
|
140
|
-
This plugin only
|
|
152
|
+
This plugin only reads the 10 model IDs in `models`. Internal routing derives hidden agents and task categories from those 10 choices.
|
|
141
153
|
|
|
142
154
|
Use OpenCode Connect to authorize the providers behind your configured model IDs. Then add only the service keys for MCP or search integrations you actually use:
|
|
143
155
|
|
|
@@ -216,7 +228,7 @@ If a dependency is missing, install only user-level or project-local dependencie
|
|
|
216
228
|
|
|
217
229
|
### Models
|
|
218
230
|
|
|
219
|
-
Canonical
|
|
231
|
+
Canonical user-facing config for 10 primary agent models, MCP/LSP switches, service auth placeholders, and skill discovery:
|
|
220
232
|
|
|
221
233
|
- [hiai-opencode.json](hiai-opencode.json)
|
|
222
234
|
|
|
@@ -224,7 +236,7 @@ Runtime loader for the bundled canonical config:
|
|
|
224
236
|
|
|
225
237
|
- [src/config/defaults.ts](src/config/defaults.ts)
|
|
226
238
|
|
|
227
|
-
If you want to change
|
|
239
|
+
If you want to change model selection, edit the 10 entries in `models`. Do not add category-specific model choices unless you are intentionally developing the plugin internals.
|
|
228
240
|
|
|
229
241
|
Use fully qualified model IDs. Do not introduce local aliases like `hiai-fast`, `sonnet`, `fast`, or `high`.
|
|
230
242
|
|
|
@@ -1,131 +1,75 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
3
|
"title": "hiai-opencode Configuration",
|
|
4
|
-
"description": "
|
|
4
|
+
"description": "User-facing hiai-opencode config. Users choose 10 primary agent models, service auth placeholders, and enable/disable MCP/LSP integrations. Internal routing derives hidden agents and task categories from these model slots.",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"properties": {
|
|
7
7
|
"$schema": { "type": "string" },
|
|
8
|
-
"
|
|
8
|
+
"models": {
|
|
9
9
|
"type": "object",
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
},
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
"categories": {
|
|
37
|
-
"type": "object",
|
|
38
|
-
"additionalProperties": {
|
|
39
|
-
"type": "object",
|
|
40
|
-
"properties": {
|
|
41
|
-
"model": { "type": "string" },
|
|
42
|
-
"variant": { "type": "string" },
|
|
43
|
-
"description": { "type": "string" },
|
|
44
|
-
"fallbackChain": {
|
|
45
|
-
"type": "array",
|
|
46
|
-
"items": { "$ref": "#/definitions/fallbackEntry" }
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
"required": ["model"]
|
|
50
|
-
}
|
|
10
|
+
"description": "The only user-facing model source of truth. Use fully qualified OpenCode model IDs.",
|
|
11
|
+
"properties": {
|
|
12
|
+
"bob": { "$ref": "#/definitions/modelSlot" },
|
|
13
|
+
"coder": { "$ref": "#/definitions/modelSlot" },
|
|
14
|
+
"strategist": { "$ref": "#/definitions/modelSlot" },
|
|
15
|
+
"guard": { "$ref": "#/definitions/modelSlot" },
|
|
16
|
+
"critic": { "$ref": "#/definitions/modelSlot" },
|
|
17
|
+
"designer": { "$ref": "#/definitions/modelSlot" },
|
|
18
|
+
"researcher": { "$ref": "#/definitions/modelSlot" },
|
|
19
|
+
"manager": { "$ref": "#/definitions/modelSlot" },
|
|
20
|
+
"brainstormer": { "$ref": "#/definitions/modelSlot" },
|
|
21
|
+
"vision": { "$ref": "#/definitions/modelSlot" }
|
|
22
|
+
},
|
|
23
|
+
"required": [
|
|
24
|
+
"bob",
|
|
25
|
+
"coder",
|
|
26
|
+
"strategist",
|
|
27
|
+
"guard",
|
|
28
|
+
"critic",
|
|
29
|
+
"designer",
|
|
30
|
+
"researcher",
|
|
31
|
+
"manager",
|
|
32
|
+
"brainstormer",
|
|
33
|
+
"vision"
|
|
34
|
+
]
|
|
51
35
|
},
|
|
52
|
-
"
|
|
36
|
+
"auth": {
|
|
53
37
|
"type": "object",
|
|
54
|
-
"additionalProperties": {
|
|
55
|
-
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
},
|
|
61
|
-
"variant": { "type": "string" },
|
|
62
|
-
"requiresModel": { "type": "string" },
|
|
63
|
-
"requiresAnyModel": { "type": "boolean" },
|
|
64
|
-
"requiresProvider": { "type": "array", "items": { "type": "string" } }
|
|
65
|
-
},
|
|
66
|
-
"required": ["fallbackChain"]
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
"modelFamilies": {
|
|
70
|
-
"type": "array",
|
|
71
|
-
"items": {
|
|
72
|
-
"type": "object",
|
|
73
|
-
"properties": {
|
|
74
|
-
"family": { "type": "string" },
|
|
75
|
-
"includes": { "type": "array", "items": { "type": "string" } },
|
|
76
|
-
"pattern": { "type": "string" },
|
|
77
|
-
"variants": { "type": "array", "items": { "type": "string" } },
|
|
78
|
-
"reasoningEfforts": { "type": "array", "items": { "type": "string" } },
|
|
79
|
-
"supportsThinking": { "type": "boolean" }
|
|
80
|
-
},
|
|
81
|
-
"required": ["family"]
|
|
38
|
+
"additionalProperties": { "type": "string" },
|
|
39
|
+
"properties": {
|
|
40
|
+
"googleSearch": { "type": "string" },
|
|
41
|
+
"stitch": { "type": "string" },
|
|
42
|
+
"firecrawl": { "type": "string" },
|
|
43
|
+
"context7": { "type": "string" }
|
|
82
44
|
}
|
|
83
45
|
},
|
|
84
46
|
"mcp": {
|
|
85
47
|
"type": "object",
|
|
86
|
-
"additionalProperties":
|
|
87
|
-
"type": "object",
|
|
88
|
-
"properties": {
|
|
89
|
-
"enabled": { "type": "boolean", "default": true },
|
|
90
|
-
"type": { "enum": ["remote", "local"] },
|
|
91
|
-
"url": { "type": "string" },
|
|
92
|
-
"headers": { "type": "object", "additionalProperties": { "type": "string" } },
|
|
93
|
-
"command": { "type": "array", "items": { "type": "string" } },
|
|
94
|
-
"timeout": { "type": "number" },
|
|
95
|
-
"environment": { "type": "object", "additionalProperties": { "type": "string" } }
|
|
96
|
-
},
|
|
97
|
-
"required": ["enabled"]
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
"lsp": {
|
|
101
|
-
"type": "object",
|
|
102
|
-
"additionalProperties": {
|
|
103
|
-
"type": "object",
|
|
104
|
-
"properties": {
|
|
105
|
-
"command": { "type": "array", "items": { "type": "string" } },
|
|
106
|
-
"extensions": { "type": "array", "items": { "type": "string" } },
|
|
107
|
-
"initialization": { "type": "object" }
|
|
108
|
-
},
|
|
109
|
-
"required": ["command", "extensions"]
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
"subtask2": {
|
|
113
|
-
"type": "object",
|
|
48
|
+
"additionalProperties": false,
|
|
114
49
|
"properties": {
|
|
115
|
-
"
|
|
116
|
-
"
|
|
50
|
+
"playwright": { "$ref": "#/definitions/toggle" },
|
|
51
|
+
"stitch": { "$ref": "#/definitions/toggle" },
|
|
52
|
+
"sequential-thinking": { "$ref": "#/definitions/toggle" },
|
|
53
|
+
"firecrawl": { "$ref": "#/definitions/toggle" },
|
|
54
|
+
"rag": { "$ref": "#/definitions/toggle" },
|
|
55
|
+
"mempalace": { "$ref": "#/definitions/toggle" },
|
|
56
|
+
"context7": { "$ref": "#/definitions/toggle" }
|
|
117
57
|
}
|
|
118
58
|
},
|
|
119
|
-
"
|
|
59
|
+
"lsp": {
|
|
120
60
|
"type": "object",
|
|
61
|
+
"additionalProperties": false,
|
|
121
62
|
"properties": {
|
|
122
|
-
"
|
|
123
|
-
"
|
|
63
|
+
"typescript": { "$ref": "#/definitions/toggle" },
|
|
64
|
+
"svelte": { "$ref": "#/definitions/toggle" },
|
|
65
|
+
"eslint": { "$ref": "#/definitions/toggle" },
|
|
66
|
+
"bash": { "$ref": "#/definitions/toggle" },
|
|
67
|
+
"pyright": { "$ref": "#/definitions/toggle" }
|
|
124
68
|
}
|
|
125
69
|
},
|
|
126
70
|
"skill_discovery": {
|
|
127
71
|
"type": "object",
|
|
128
|
-
"description": "Controls
|
|
72
|
+
"description": "Controls external skill folder scanning. Defaults keep installs deterministic.",
|
|
129
73
|
"properties": {
|
|
130
74
|
"config_sources": { "type": "boolean", "default": true },
|
|
131
75
|
"project_opencode": { "type": "boolean", "default": true },
|
|
@@ -136,59 +80,38 @@
|
|
|
136
80
|
"global_agents": { "type": "boolean", "default": false }
|
|
137
81
|
}
|
|
138
82
|
},
|
|
139
|
-
"
|
|
140
|
-
"type": "object",
|
|
141
|
-
"properties": {
|
|
142
|
-
"read": { "type": "object", "additionalProperties": { "type": "string" } },
|
|
143
|
-
"edit": { "type": "object", "additionalProperties": { "type": "string" } },
|
|
144
|
-
"bash": { "type": "object", "additionalProperties": { "type": "string" } },
|
|
145
|
-
"deny_paths": { "type": "array", "items": { "type": "string" } }
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
"auth": {
|
|
149
|
-
"type": "object",
|
|
150
|
-
"additionalProperties": { "type": "string" }
|
|
151
|
-
},
|
|
152
|
-
"ollama": {
|
|
153
|
-
"type": "object",
|
|
154
|
-
"properties": {
|
|
155
|
-
"enabled": { "type": "boolean", "default": false },
|
|
156
|
-
"model": { "type": "string" },
|
|
157
|
-
"baseUrl": { "type": "string" },
|
|
158
|
-
"purpose": { "enum": ["verification", "helper", "fallback"] }
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
"fast_apply": {
|
|
83
|
+
"subtask2": {
|
|
162
84
|
"type": "object",
|
|
163
85
|
"properties": {
|
|
164
|
-
"
|
|
165
|
-
"ollama_url": { "type": "string" },
|
|
166
|
-
"model": { "type": "string" },
|
|
167
|
-
"timeout": { "type": "number" }
|
|
86
|
+
"replace_generic": { "type": "boolean" }
|
|
168
87
|
}
|
|
169
88
|
}
|
|
170
89
|
},
|
|
90
|
+
"required": ["models"],
|
|
171
91
|
"definitions": {
|
|
172
|
-
"
|
|
173
|
-
"
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
"model": { "type": "string" },
|
|
177
|
-
"variant": { "type": "string" },
|
|
178
|
-
"reasoningEffort": { "type": "string" },
|
|
179
|
-
"temperature": { "type": "number" },
|
|
180
|
-
"top_p": { "type": "number" },
|
|
181
|
-
"maxTokens": { "type": "number" },
|
|
182
|
-
"thinking": {
|
|
92
|
+
"modelSlot": {
|
|
93
|
+
"oneOf": [
|
|
94
|
+
{ "type": "string" },
|
|
95
|
+
{
|
|
183
96
|
"type": "object",
|
|
184
97
|
"properties": {
|
|
185
|
-
"
|
|
186
|
-
"
|
|
98
|
+
"model": { "type": "string" },
|
|
99
|
+
"recommended": {
|
|
100
|
+
"enum": ["xhigh", "high", "middle", "fast", "vision", "writing", "design"]
|
|
101
|
+
}
|
|
187
102
|
},
|
|
188
|
-
"required": ["
|
|
103
|
+
"required": ["model"],
|
|
104
|
+
"additionalProperties": false
|
|
189
105
|
}
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
"toggle": {
|
|
109
|
+
"type": "object",
|
|
110
|
+
"properties": {
|
|
111
|
+
"enabled": { "type": "boolean", "default": true }
|
|
190
112
|
},
|
|
191
|
-
"required": ["
|
|
113
|
+
"required": ["enabled"],
|
|
114
|
+
"additionalProperties": false
|
|
192
115
|
}
|
|
193
116
|
}
|
|
194
117
|
}
|